diff --git a/README.md b/README.md index c01b621bd..0746ca999 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ Processing This is the official source code for the [Processing](http://processing.org) Development Environment (PDE), the “core” and the libraries that are included with the [download](http://processing.org/download). +> Development of Processing 3 has started, so major changes are underway inside this repository. **If you need a stable version of the source, use the tag processing-0227-2.2.1.** Do not expect this code to be stable. Major changes include severe things like breaking libraries (due to chaining operations in PVector) or the removal of `Applet` as the base class for PApplet. Some of these will be sorted out before the release, others are simply being tested or are developments that are in-progress. + If you have found a bug in the Processing software, you can file it here under the [“issues” tab](https://github.com/processing/processing/issues). If it relates to the [JavaScript](http://processingjs.org) version, please use [their issue tracker](https://processing-js.lighthouseapp.com/). All Android-related development has moved to its own repository [here](https://github.com/processing/processing-android), @@ -15,18 +17,18 @@ changes made by [processing-bugs](https://github.com/processing-bugs), it may be Over time this will clean itself up as bugs are fixed and new issues are added from within Github. Help speed this process along by helping us! -The [processing-web](https://github.com/processing/processing-web/) repository -contains reference, examples, and the site. +The [processing-docs](https://github.com/processing/processing-docs/) repository contains reference, examples, and the site. (Please use that link to file issues regarding the web site, the examples, or the reference.) The instructions for building the source [are here](https://github.com/processing/processing/wiki/Build-Instructions). Someday we'll also write code style guidelines, fix all these bugs, -throw together hundreds of unit tests, and solve the Israeli-Palestinian conflict. +throw together hundreds of unit tests, +and get rich off all this stuff that we're giving away for free. But in the meantime, I ask for your patience, [participation](https://github.com/processing/processing/wiki/Project-List), and [patches](https://github.com/processing/processing/pulls). Ben Fry, 3 February 2013 -Last updated 21 April 2013 +Last updated 30 July 2014 diff --git a/app/.classpath b/app/.classpath index 25495070c..e12f72e7e 100644 --- a/app/.classpath +++ b/app/.classpath @@ -6,8 +6,7 @@ - - + diff --git a/app/.settings/org.eclipse.jdt.core.prefs b/app/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 60fcdf705..000000000 --- a/app/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,381 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled -org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore -org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault -org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable -org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=ignore -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning -org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error -org.eclipse.jdt.core.compiler.problem.nullReference=ignore -org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore -org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore -org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.7 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=18 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=18 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=18 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=36 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=18 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=18 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=1 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=false -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=80 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=1 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=2 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=80 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=2 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 6b4f86bce..f8fc94126 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -46,9 +46,9 @@ import processing.mode.java.JavaMode; public class Base { // Added accessors for 0218 because the UpdateCheck class was not properly // updating the values, due to javac inlining the static final values. - static private final int REVISION = 228; + static private final int REVISION = 229; /** This might be replaced by main() if there's a lib/version.txt file. */ - static private String VERSION_NAME = "0228"; //$NON-NLS-1$ + static private String VERSION_NAME = "0229"; //$NON-NLS-1$ /** Set true if this a proper release rather than a numbered revision. */ // static private boolean RELEASE = false; @@ -300,12 +300,12 @@ public class Base { // try { // Class.forName("processing.mode.java2.DebugMode"); ModeContribution experimentalContrib = - ModeContribution.load(this, getContentFile("modes/experimental"), //$NON-NLS-1$ + ModeContribution.load(this, getContentFile("modes/ExperimentalMode"), //$NON-NLS-1$ "processing.mode.experimental.ExperimentalMode"); //$NON-NLS-1$ if (experimentalContrib != null) { Mode experimentalMode = experimentalContrib.getMode(); //coreModes = new Mode[] { javaMode, androidMode, experimentalMode }; - coreModes = new Mode[] { javaMode, experimentalMode }; + coreModes = new Mode[] { experimentalMode, javaMode }; } // } catch (ClassNotFoundException e) { } @@ -604,38 +604,37 @@ public class Base { } + /** + * The call has already checked to make sure this sketch is not modified, + * now change the mode. + */ protected void changeMode(Mode mode) { if (activeEditor.getMode() != mode) { Sketch sketch = activeEditor.getSketch(); - if (sketch.isModified()) { - Base.showWarning("Save", - "Please save the sketch before changing the mode.", - null); - return; - } nextMode = mode; - - // If the current editor contains file extensions that the new mode can handle, then - // write a sketch.properties file with the new mode specified, and reopen. - boolean newModeCanHandleCurrentSource = true; - for (final SketchCode code: sketch.getCode()) { - if (!mode.validExtension(code.getExtension())) { - newModeCanHandleCurrentSource = false; - break; - } - } - if (newModeCanHandleCurrentSource) { - final File props = new File(sketch.getCodeFolder(), "sketch.properties"); - saveModeSettings(props, nextMode); + + if (sketch.isUntitled()) { + // If no changes have been made, just close and start fresh. + // (Otherwise the editor would lose its 'untitled' status.) handleClose(activeEditor, true); - handleOpen(sketch.getMainFilePath()); - } else { - // If you're changing modes, and there's nothing in the current sketch, you probably - // don't intend to keep the old, wrong-mode editor around. - if (sketch.isUntitled()) { - handleClose(activeEditor, true); - } handleNew(); + + } else { + // If the current editor contains file extensions that the new mode can handle, then + // write a sketch.properties file with the new mode specified, and reopen. + boolean newModeCanHandleCurrentSource = true; + for (final SketchCode code: sketch.getCode()) { + if (!mode.validExtension(code.getExtension())) { + newModeCanHandleCurrentSource = false; + break; + } + } + if (newModeCanHandleCurrentSource) { + final File props = new File(sketch.getCodeFolder(), "sketch.properties"); + saveModeSettings(props, nextMode); + handleClose(activeEditor, true); + handleOpen(sketch.getMainFilePath()); + } } } } @@ -930,14 +929,18 @@ public class Base { return null; } - // System.err.println(" editors: " + editors); // Cycle through open windows to make sure that it's not already open. for (Editor editor : editors) { - if (editor.getSketch().getMainFile().equals(file)) { - editor.toFront(); - // move back to the top of the recent list - handleRecent(editor); - return editor; + // User may have double-clicked any PDE in the sketch folder, + // so we have to check each open tab (not just the main one). + // https://github.com/processing/processing/issues/2506 + for (SketchCode tab : editor.getSketch().getCode()) { + if (tab.getFile().equals(file)) { + editor.toFront(); + // move back to the top of the recent list + handleRecent(editor); + return editor; + } } } @@ -960,8 +963,6 @@ public class Base { // Editor.State state = new Editor.State(editors); Editor editor = nextMode.createEditor(this, path, state); if (editor == null) { - // if it's the last editor window -// if (editors.size() == 0 && defaultFileMenu == null) { // if it's not mode[0] already, then don't go into an infinite loop // trying to recreate a window with the default mode. if (nextMode == coreModes[0]) { @@ -974,15 +975,14 @@ public class Base { editor = coreModes[0].createEditor(this, path, state); } } - + // Make sure that the sketch actually loaded - if (editor.getSketch() == null) { -// System.err.println("sketch was null, getting out of handleOpen"); + Sketch sketch = editor.getSketch(); + if (sketch == null) { return null; // Just walk away quietly } -// editor.untitled = untitled; - editor.getSketch().setUntitled(untitled); + sketch.setUntitled(untitled); editors.add(editor); handleRecent(editor); @@ -1867,41 +1867,15 @@ public class Base { } -// static public String getExamplesPath() { -// return examplesFolder.getAbsolutePath(); -// } - -// public File getExamplesFolder() { -// return examplesFolder; -// } - - -// static public String getLibrariesPath() { -// return librariesFolder.getAbsolutePath(); -// } - - -// public File getLibrariesFolder() { -// return librariesFolder; -// } - - -// static public File getToolsFolder() { static public File getToolsFolder() { -// return toolsFolder; return getContentFile("tools"); } -// static public String getToolsPath() { -// return toolsFolder.getAbsolutePath(); -// } - - static public void locateSketchbookFolder() { // If a value is at least set, first check to see if the folder exists. // If it doesn't, warn the user that the sketchbook folder is being reset. - String sketchbookPath = Preferences.get("sketchbook.path"); //$NON-NLS-1$ + String sketchbookPath = Preferences.getSketchbookPath(); if (sketchbookPath != null) { sketchbookFolder = new File(sketchbookPath); if (!sketchbookFolder.exists()) { @@ -1918,7 +1892,7 @@ public class Base { // If no path is set, get the default sketchbook folder for this platform if (sketchbookFolder == null) { sketchbookFolder = getDefaultSketchbookFolder(); - Preferences.set("sketchbook.path", sketchbookFolder.getAbsolutePath()); + Preferences.setSketchbookPath(sketchbookFolder.getAbsolutePath()); if (!sketchbookFolder.exists()) { sketchbookFolder.mkdirs(); } @@ -1933,19 +1907,17 @@ public class Base { public void setSketchbookFolder(File folder) { sketchbookFolder = folder; - Preferences.set("sketchbook.path", folder.getAbsolutePath()); + Preferences.setSketchbookPath(folder.getAbsolutePath()); rebuildSketchbookMenus(); } static public File getSketchbookFolder() { -// return new File(Preferences.get("sketchbook.path")); return sketchbookFolder; } static public File getSketchbookLibrariesFolder() { -// return new File(getSketchbookFolder(), "libraries"); return new File(sketchbookFolder, "libraries"); } diff --git a/app/src/processing/app/ColorChooser.java b/app/src/processing/app/ColorChooser.java index b4a6ccac8..b261096dd 100644 --- a/app/src/processing/app/ColorChooser.java +++ b/app/src/processing/app/ColorChooser.java @@ -442,6 +442,23 @@ public class ColorChooser { //extends JFrame implements DocumentListener { row.add(Box.createHorizontalGlue()); box.add(row); + row = Box.createHorizontalBox(); + if (Base.isMacOS()) { + row.add(Box.createHorizontalStrut(11)); + } else { + row.add(createFixedLabel("")); + } + button = new JButton("Cancel"); + button.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + ColorChooser.this.hide(); + } + }); + row.add(button); + row.add(Box.createHorizontalGlue()); + box.add(row); // box.add(Box.createVerticalGlue()); diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 7f4b1a8be..90e90508e 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -33,6 +33,7 @@ import java.awt.event.*; import java.awt.print.*; import java.io.*; import java.util.*; +import java.util.List; import java.util.Timer; import javax.swing.*; @@ -383,20 +384,37 @@ public abstract class Editor extends JFrame implements RunnerListener { protected void initModeMenu() { modeMenu = new JMenu(); + ButtonGroup modeGroup = new ButtonGroup(); for (final Mode m : base.getModeList()) { - if (mode == m) { - JRadioButtonMenuItem item = new JRadioButtonMenuItem(m.getTitle()); - // doesn't need a listener, since it doesn't do anything - item.setSelected(true); - modeMenu.add(item); - } else { - JMenuItem item = new JMenuItem(m.getTitle()); - item.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { + JRadioButtonMenuItem item = new JRadioButtonMenuItem(m.getTitle()); + item.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + if (!sketch.isModified()) { base.changeMode(m); + + } else { + Base.showWarning("Save", + "Please save the sketch before changing the mode.", + null); + + // Re-select the old checkbox, because it was automatically + // updated by Java, even though the Mode could not be changed. + // https://github.com/processing/processing/issues/2615 + for (Component c : modeMenu.getPopupMenu().getComponents()) { + if (c instanceof JRadioButtonMenuItem) { + if (((JRadioButtonMenuItem)c).getText() == mode.getTitle()) { + ((JRadioButtonMenuItem)c).setSelected(true); + break; + } + } + } } - }); - modeMenu.add(item); + } + }); + modeMenu.add(item); + modeGroup.add(item); + if (mode == m) { + item.setSelected(true); } } @@ -588,6 +606,16 @@ public abstract class Editor extends JFrame implements RunnerListener { fileMenu.add(item); fileMenu.add(base.getSketchbookMenu()); + + JMenuItem sbMenu = Toolkit.newJMenuItemShift("Sketchbook Tree", 'K'); + sbMenu.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + mode.showSketchbookFrame(); + } + }); + + fileMenu.add(sbMenu); // fileMenu.add(mode.getExamplesMenu()); item = Toolkit.newJMenuItemShift(Language.text("menu.file.examples"), 'O'); @@ -895,6 +923,57 @@ public abstract class Editor extends JFrame implements RunnerListener { }); sketchMenu.add(item); + sketchMenu.addSeparator(); + +// final Editor editorName = this; + + sketchMenu.addMenuListener(new MenuListener() { + // Menu Listener that populates the menu only when the menu is opened + List menuList = new ArrayList(); + + @Override + public void menuSelected(MenuEvent event) { + JMenuItem item; + for (final Editor editor : base.getEditors()) { + //if (Editor.this.getSketch().getName().trim().contains(editor2.getSketch().getName().trim())) + if (getSketch().getMainFilePath().equals(editor.getSketch().getMainFilePath())) { + item = new JCheckBoxMenuItem(editor.getSketch().getName()); + item.setSelected(true); + } else { + item = new JMenuItem(editor.getSketch().getName()); + } + item.setText(editor.getSketch().getName() + + " (" + editor.getMode().getTitle() + ")"); + + // Action listener to bring the appropriate sketch in front + item.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + editor.setState(Frame.NORMAL); + editor.setVisible(true); + editor.toFront(); + } + }); + sketchMenu.add(item); + menuList.add(item); + } + } + + @Override + public void menuDeselected(MenuEvent event) { + for (JMenuItem item : menuList) { + sketchMenu.remove(item); + } + menuList.clear(); + } + + @Override + public void menuCanceled(MenuEvent event) { + menuDeselected(event); + } + }); + return sketchMenu; } @@ -1163,6 +1242,11 @@ public abstract class Editor extends JFrame implements RunnerListener { public void showReference(String filename) { File file = new File(mode.getReferenceFolder(), filename); + try { + file = file.getCanonicalFile(); + } catch (IOException e) { + e.printStackTrace(); + } // Prepend with file:// and also encode spaces & other characters Base.openURL(file.toURI().toString()); } @@ -2369,7 +2453,10 @@ public abstract class Editor extends JFrame implements RunnerListener { statusNotice("Saving..."); try { if (sketch.saveAs()) { - statusNotice("Done Saving."); + // statusNotice("Done Saving."); + // status is now printed from Sketch so that "Done Saving." + // is only printed after Save As when progress bar is shown. + // Disabling this for 0125, instead rebuild the menu inside // the Save As method of the Sketch object, since that's the // only one who knows whether something was renamed. diff --git a/app/src/processing/app/EditorConsole.java b/app/src/processing/app/EditorConsole.java index 6ad9eb709..935539841 100644 --- a/app/src/processing/app/EditorConsole.java +++ b/app/src/processing/app/EditorConsole.java @@ -212,7 +212,13 @@ public class EditorConsole extends JScrollPane { StyleConstants.setBold(errStyle, font.isBold()); StyleConstants.setItalic(errStyle, font.isItalic()); - consoleTextPane.setBackground(bgColor); + if (UIManager.getLookAndFeel().getID().equals("Nimbus")) { + getViewport().setBackground(bgColor); + consoleTextPane.setOpaque(false); + consoleTextPane.setBackground(new Color(0, 0, 0, 0)); + } else { + consoleTextPane.setBackground(bgColor); + } // calculate height of a line of text in pixels // and size window accordingly diff --git a/app/src/processing/app/Mode.java b/app/src/processing/app/Mode.java index ea19fde35..666ec7f0d 100644 --- a/app/src/processing/app/Mode.java +++ b/app/src/processing/app/Mode.java @@ -879,6 +879,104 @@ public abstract class Mode { // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + public DefaultMutableTreeNode buildSketchbookTree(){ + DefaultMutableTreeNode sbNode = new DefaultMutableTreeNode("Sketchbook"); + try { + base.addSketches(sbNode, Base.getSketchbookFolder()); + } catch (IOException e) { + e.printStackTrace(); + } + return sbNode; + } + + protected JFrame sketchbookFrame; + + public void showSketchbookFrame() { + if (sketchbookFrame == null) { + sketchbookFrame = new JFrame("Processing Sketchbook"); + Toolkit.setIcon(sketchbookFrame); + Toolkit.registerWindowCloseKeys(sketchbookFrame.getRootPane(), + new ActionListener() { + public void actionPerformed(ActionEvent e) { + sketchbookFrame.setVisible(false); + } + }); + + final JTree tree = new JTree(buildSketchbookTree()); + tree.getSelectionModel() + .setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); + tree.setShowsRootHandles(true); + tree.expandRow(0); + tree.setRootVisible(false); + + tree.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent e) { + if (e.getClickCount() == 2) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree + .getLastSelectedPathComponent(); + + int selRow = tree.getRowForLocation(e.getX(), e.getY()); + //TreePath selPath = tree.getPathForLocation(e.getX(), e.getY()); + //if (node != null && node.isLeaf() && node.getPath().equals(selPath)) { + if (node != null && node.isLeaf() && selRow != -1) { + SketchReference sketch = (SketchReference) node.getUserObject(); + base.handleOpen(sketch.getPath()); + } + } + } + }); + + tree.addKeyListener(new KeyAdapter() { + public void keyPressed(KeyEvent e) { + if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { // doesn't fire keyTyped() + sketchbookFrame.setVisible(false); + } + } + + public void keyTyped(KeyEvent e) { + if (e.getKeyChar() == KeyEvent.VK_ENTER) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree + .getLastSelectedPathComponent(); + if (node != null && node.isLeaf()) { + SketchReference sketch = (SketchReference) node.getUserObject(); + base.handleOpen(sketch.getPath()); + } + } + } + }); + + tree.setBorder(new EmptyBorder(5, 5, 5, 5)); + if (Base.isMacOS()) { + tree.setToggleClickCount(2); + } else { + tree.setToggleClickCount(1); + } + JScrollPane treePane = new JScrollPane(tree); + treePane.setPreferredSize(new Dimension(250, 450)); + treePane.setBorder(new EmptyBorder(0, 0, 0, 0)); + sketchbookFrame.getContentPane().add(treePane); + sketchbookFrame.pack(); + } + + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + // Space for the editor plus a li'l gap + int roughWidth = sketchbookFrame.getWidth() + 20; + Point p = null; + // If no window open, or the editor is at the edge of the screen + if (base.activeEditor == null + || (p = base.activeEditor.getLocation()).x < roughWidth) { + // Center the window on the screen + sketchbookFrame.setLocationRelativeTo(null); + } else { + // Open the window relative to the editor + sketchbookFrame.setLocation(p.x - roughWidth, p.y); + } + sketchbookFrame.setVisible(true); + } + }); + } /** * Get an image object from the theme folder. diff --git a/app/src/processing/app/Preferences.java b/app/src/processing/app/Preferences.java index 525ae5f03..06f4025a8 100644 --- a/app/src/processing/app/Preferences.java +++ b/app/src/processing/app/Preferences.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2004-12 Ben Fry and Casey Reas + Copyright (c) 2004-14 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify @@ -28,7 +28,11 @@ import java.io.*; import java.util.*; import javax.swing.*; +import javax.swing.border.*; +import javax.swing.event.*; +import processing.app.ColorChooser; +import processing.app.Language; import processing.core.*; @@ -98,7 +102,7 @@ public class Preferences { // and linux is all over the map static final int GUI_BIG = 13; - static final int GUI_BETWEEN = 10; + static final int GUI_BETWEEN = 8; static final int GUI_SMALL = 6; // gui elements @@ -107,27 +111,32 @@ public class Preferences { int wide, high; JTextField sketchbookLocationField; + JTextField presentColor; + JTextField presentColorHex; JCheckBox editorAntialiasBox; JCheckBox deletePreviousBox; JCheckBox whinyBox; JCheckBox memoryOverrideBox; JTextField memoryField; JCheckBox checkUpdatesBox; - //JTextField fontSizeField; JComboBox fontSizeField; JComboBox consoleSizeField; JCheckBox inputMethodBox; JCheckBox autoAssociateBox; + + ColorChooser selector; - //JRadioButton bitsThirtyTwoButton; - //JRadioButton bitsSixtyFourButton; + JCheckBox errorCheckerBox; + JCheckBox warningsCheckerBox; + JCheckBox codeCompletionBox; + JCheckBox importSuggestionsBox; + JCheckBox codeCompletionTriggerBox; JComboBox displaySelectionBox; JComboBox languageSelectionBox; int displayCount; - //Font[] monoFontList; String[] monoFontFamilies; JComboBox fontSelectionBox; @@ -158,16 +167,6 @@ public class Preferences { // check for platform-specific properties in the defaults String platformExt = "." + PConstants.platformNames[PApplet.platform]; //$NON-NLS-1$ int platformExtLength = platformExt.length(); -// Enumeration e = table.keys(); -// while (e.hasMoreElements()) { -// String key = (String) e.nextElement(); -// if (key.endsWith(platformExt)) { -// // this is a key specific to a particular platform -// String actualKey = key.substring(0, key.length() - platformExtLength); -// String value = get(key); -// table.put(actualKey, value); -// } -// } // Get a list of keys that are specific to this platform ArrayList platformKeys = new ArrayList(); @@ -190,28 +189,10 @@ public class Preferences { // other things that have to be set explicitly for the defaults setColor("run.window.bgcolor", SystemColor.control); //$NON-NLS-1$ - - // Load a prefs file if specified on the command line -// if (commandLinePrefs != null) { -// try { -// load(new FileInputStream(commandLinePrefs)); -// -// } catch (Exception poe) { -// Base.showError("Error", -// "Could not read preferences from " + -// commandLinePrefs, poe); -// } -// } else if (!Base.isCommandLine()) { + // next load user preferences file preferencesFile = Base.getSettingsFile(PREFS_FILE); - if (!preferencesFile.exists()) { - // create a new preferences file if none exists - // saves the defaults out to the file - save(); - - } else { - // load the previous preferences file - + if (preferencesFile.exists()) { try { load(new FileInputStream(preferencesFile)); @@ -222,7 +203,12 @@ public class Preferences { preferencesFile.getAbsolutePath() + " and restart Processing.", ex); } -// } + } + + if (checkSketchbookPref() || !preferencesFile.exists()) { + // create a new preferences file if none exists + // saves the defaults out to the file + save(); } PApplet.useNativeSelect = @@ -247,11 +233,6 @@ public class Preferences { dialog = new JFrame(Language.text("preferences")); dialog.setResizable(false); -// GroupLayout layout = new GroupLayout(getContentPane()); -// dialog.getContentPane().setLayout(layout); -// layout.setAutoCreateGaps(true); -// layout.setAutoCreateContainerGaps(true); - Container pain = dialog.getContentPane(); pain.setLayout(null); @@ -286,11 +267,6 @@ public class Preferences { PApplet.selectFolder(Language.text("preferences.sketchbook_location.popup"), "sketchbookCallback", dflt, Preferences.this, dialog); -// File file = -// Base.selectFolder("Select new sketchbook location", dflt, dialog); -// if (file != null) { -// sketchbookLocationField.setText(file.getAbsolutePath()); -// } } }); pain.add(button); @@ -372,15 +348,10 @@ public class Preferences { Container box = Box.createHorizontalBox(); label = new JLabel(Language.text("preferences.editor_font_size")+": "); box.add(label); - //fontSizeField = new JTextField(4); fontSizeField = new JComboBox(FONT_SIZES); // fontSizeField = new JComboBox(FONT_SIZES); fontSizeField.setEditable(true); box.add(fontSizeField); - -// label = new JLabel(" ("+Language.text("preferences.requires_restart")+")"); -// label = new JLabel(" (requires restart of Processing)"); -// box.add(label); box.add(Box.createHorizontalStrut(GUI_BETWEEN)); label = new JLabel(Language.text("preferences.console_font_size")+": "); @@ -394,19 +365,136 @@ public class Preferences { pain.add(box); d = box.getPreferredSize(); box.setBounds(left, top, d.width, d.height); -// Font editorFont = Preferences.getFont("editor.font"); - //fontSizeField.setText(String.valueOf(editorFont.getSize())); -// fontSizeField.setSelectedItem(editorFont.getSize()); fontSizeField.setSelectedItem(Preferences.getFont("editor.font.size")); top += d.height + GUI_BETWEEN; + Container colorBox = Box.createHorizontalBox(); + + label = new JLabel("Background color when Presenting: "); + colorBox.add(label); + + final String colorTip = "" + + "Select the background color used when using Present.
" + + "Present is used to present a sketch in full-screen,
" + + "accessible from the Sketch menu."; + label.setToolTipText(colorTip); + + presentColor = new JTextField(" "); + presentColor.setOpaque(true); + presentColor.setEnabled(false); + presentColor.setBorder(new CompoundBorder(BorderFactory.createMatteBorder( + 1, 1, 0, 0, new Color(195, 195, 195)), BorderFactory.createMatteBorder( + 0, 0, 1, 1, new Color(54, 54, 54)))); + presentColor.setBackground(Preferences.getColor("run.present.bgcolor")); + + presentColorHex = new JTextField(6); + presentColorHex + .setText(Preferences.get("run.present.bgcolor").substring(1)); + presentColorHex.getDocument().addDocumentListener(new DocumentListener() { + + @Override + public void removeUpdate(DocumentEvent e) { + final String colorValue = presentColorHex.getText().toUpperCase(); + if (colorValue.length() == 7 && (colorValue.startsWith("#"))) + EventQueue.invokeLater(new Runnable() { + public void run() { + presentColorHex.setText(colorValue.substring(1)); + } + }); + if (colorValue.length() == 6 + && colorValue.matches("[0123456789ABCDEF]*")) { + presentColor.setBackground(new Color(Integer.parseInt( + colorValue.substring(0, 2), 16), Integer.parseInt( + colorValue.substring(2, 4), 16), Integer.parseInt( + colorValue.substring(4, 6), 16))); + if (!colorValue.equals(presentColorHex.getText())) + EventQueue.invokeLater(new Runnable() { + public void run() { + presentColorHex.setText(colorValue); + } + }); + } + } + + @Override + public void insertUpdate(DocumentEvent e) { + final String colorValue = presentColorHex.getText().toUpperCase(); + if (colorValue.length() == 7 && (colorValue.startsWith("#"))) + EventQueue.invokeLater(new Runnable() { + public void run() { + presentColorHex.setText(colorValue.substring(1)); + } + }); + if (colorValue.length() == 6 + && colorValue.matches("[0123456789ABCDEF]*")) { + presentColor.setBackground(new Color(Integer.parseInt( + colorValue.substring(0, 2), 16), Integer.parseInt( + colorValue.substring(2, 4), 16), Integer.parseInt( + colorValue.substring(4, 6), 16))); + if (!colorValue.equals(presentColorHex.getText())) + EventQueue.invokeLater(new Runnable() { + public void run() { + presentColorHex.setText(colorValue); + } + }); + } + } + + @Override public void changedUpdate(DocumentEvent e) {} + }); + + selector = new ColorChooser(dialog, false, + Preferences.getColor("run.present.bgcolor"), "OK", + new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + String colorValue = selector.getHexColor(); + presentColorHex.setText(colorValue.substring(1)); + presentColor.setBackground(new Color(Integer.parseInt( + colorValue.substring(1, 3), 16), Integer.parseInt( + colorValue.substring(3, 5), 16), Integer.parseInt( + colorValue.substring(5, 7), 16))); + selector.hide(); + } + }); + + presentColor.addMouseListener(new MouseListener() { + @Override public void mouseReleased(MouseEvent e) {} + @Override public void mousePressed(MouseEvent e) {} + + @Override + public void mouseExited(MouseEvent e) { + dialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + } + + @Override + public void mouseEntered(MouseEvent e) { + dialog.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + } + + @Override + public void mouseClicked(MouseEvent e) { + selector.show(); + } + }); + + label = new JLabel("#"); + colorBox.add(label); + colorBox.add(presentColorHex); + colorBox.add(Box.createHorizontalStrut(GUI_SMALL + 2 / 3 * GUI_SMALL)); + colorBox.add(presentColor); + + pain.add(colorBox); + d = colorBox.getPreferredSize(); + colorBox.setBounds(left, top, d.width, d.height); + + top += d.height + GUI_BETWEEN; + + // [ ] Use smooth text in editor window - + editorAntialiasBox = new JCheckBox(Language.text("preferences.use_smooth_text")); -// new JCheckBox("Use smooth text in editor window " + -// "(requires restart of Processing)"); - pain.add(editorAntialiasBox); d = editorAntialiasBox.getPreferredSize(); // adding +10 because ubuntu + jre 1.5 truncating items @@ -414,7 +502,7 @@ public class Preferences { right = Math.max(right, left + d.width); top += d.height + GUI_BETWEEN; - + // [ ] Enable complex text input (for Japanese et al, requires restart) inputMethodBox = @@ -426,6 +514,51 @@ public class Preferences { inputMethodBox.setBounds(left, top, d.width + 10, d.height); right = Math.max(right, left + d.width); top += d.height + GUI_BETWEEN; + + + // [ ] Continuously check for errors - PDE X + + errorCheckerBox = + new JCheckBox("Continuously check for errors"); + pain.add(errorCheckerBox); + d = errorCheckerBox.getPreferredSize(); + errorCheckerBox.setBounds(left, top, d.width + 10, d.height); + //right = Math.max(right, left + d.width); + //top += d.height + GUI_BETWEEN; + int warningLeft = left + d.width; + + + // [ ] Show Warnings - PDE X + + warningsCheckerBox = + new JCheckBox("Show warnings"); + pain.add(warningsCheckerBox); + d = warningsCheckerBox.getPreferredSize(); + warningsCheckerBox.setBounds(warningLeft, top, d.width + 10, d.height); + right = Math.max(right, warningLeft + d.width); + top += d.height + GUI_BETWEEN; + + + // [ ] Enable Code Completion - PDE X + + codeCompletionBox = + new JCheckBox("Enable code completion"); + pain.add(codeCompletionBox); + d = codeCompletionBox.getPreferredSize(); + codeCompletionBox.setBounds(left, top, d.width + 10, d.height); + int toggleLeft = left + d.width; + + + // [ ] Toggle Code Completion Trigger - PDE X + + final String modifier = Base.isMacOS() ? "\u2318" : "Ctrl"; + codeCompletionTriggerBox = + new JCheckBox("Trigger with " + modifier + "-space"); + pain.add(codeCompletionTriggerBox); + d = codeCompletionTriggerBox.getPreferredSize(); + codeCompletionTriggerBox.setBounds(toggleLeft, top, d.width + 10, d.height); + right = Math.max(right, toggleLeft + d.width); + top += d.height + GUI_BETWEEN; // [ ] Increase maximum available memory to [______] MB @@ -442,19 +575,6 @@ public class Preferences { top += d.height + GUI_BETWEEN; -// // [ ] Use multiple .jar files when exporting applets -// -// exportSeparateBox = -// new JCheckBox("Use multiple .jar files when exporting applets " + -// "(ignored when using libraries)"); -// pain.add(exportSeparateBox); -// d = exportSeparateBox.getPreferredSize(); -// // adding +10 because ubuntu + jre 1.5 truncating items -// exportSeparateBox.setBounds(left, top, d.width + 10, d.height); -// right = Math.max(right, left + d.width); -// top += d.height + GUI_BETWEEN; - - // [ ] Delete previous application folder on export deletePreviousBox = @@ -466,17 +586,7 @@ public class Preferences { top += d.height + GUI_BETWEEN; -// // [ ] Use external editor -// -// externalEditorBox = new JCheckBox("Use external editor"); -// pain.add(externalEditorBox); -// d = externalEditorBox.getPreferredSize(); -// externalEditorBox.setBounds(left, top, d.width + 10, d.height); -// right = Math.max(right, left + d.width); -// top += d.height + GUI_BETWEEN; - - - // [ ] Use external editor + // [ ] Hide tab/toolbar background image whinyBox = new JCheckBox(Language.text("preferences.hide_toolbar_background_image")+ " ("+Language.text("preferences.requires_restart")+")"); @@ -526,30 +636,6 @@ public class Preferences { } - // Launch programs as [ ] 32-bit [ ] 64-bit (Mac OS X only) - - /* - if (Base.isMacOS()) { - box = Box.createHorizontalBox(); - label = new JLabel(Language.text("preferences.launch_programs_in")+" "); - box.add(label); - bitsThirtyTwoButton = new JRadioButton("32-bit "+Language.text("preferences.launch_programs_in.mode")+" "); - box.add(bitsThirtyTwoButton); - bitsSixtyFourButton = new JRadioButton("64-bit "+Language.text("preferences.launch_programs_in.mode")); - box.add(bitsSixtyFourButton); - - ButtonGroup bg = new ButtonGroup(); - bg.add(bitsThirtyTwoButton); - bg.add(bitsSixtyFourButton); - - pain.add(box); - d = box.getPreferredSize(); - box.setBounds(left, top, d.width, d.height); - top += d.height + GUI_BETWEEN; - } - */ - - // More preferences are in the ... label = new JLabel(Language.text("preferences.file")+":"); @@ -708,7 +794,7 @@ public class Preferences { // each platform, and nobody wants to debug/support that. // if the sketchbook path has changed, rebuild the menus - String oldPath = get("sketchbook.path"); //$NON-NLS-1$ + String oldPath = getSketchbookPath(); String newPath = sketchbookLocationField.getText(); if (!newPath.equals(oldPath)) { base.setSketchbookFolder(new File(newPath)); @@ -756,52 +842,12 @@ public class Preferences { System.err.println("Ignoring bad memory setting"); } - /* - // was gonna use this to check memory settings, - // but it quickly gets much too messy - if (getBoolean("run.options.memory")) { - Process process = Runtime.getRuntime().exec(new String[] { - "java", "-Xms" + memoryMin + "m", "-Xmx" + memoryMax + "m" - }); - processInput = new SystemOutSiphon(process.getInputStream()); - processError = new MessageSiphon(process.getErrorStream(), this); - } - */ - - /* - // If a change has been made between 32- and 64-bit, the libraries need - // to be reloaded so that their native paths are set correctly. - if (Base.isMacOS()) { - String oldBits = get("run.options.bits"); //$NON-NLS-1$ - String newBits = bitsThirtyTwoButton.isSelected() ? "32" : "64"; //$NON-NLS-1$ //$NON-NLS-2$ - if (!oldBits.equals(newBits)) { - set("run.options.bits", newBits); //$NON-NLS-1$ - for (Mode m : base.getModeList()) { - m.rebuildLibraryList(); - } - } - } - */ - // Don't change anything if the user closes the window before fonts load if (fontSelectionBox.isEnabled()) { String fontFamily = (String) fontSelectionBox.getSelectedItem(); set("editor.font.family", fontFamily); } - /* - String newSizeText = fontSizeField.getText(); - try { - int newSize = Integer.parseInt(newSizeText.trim()); - //String pieces[] = PApplet.split(get("editor.font"), ','); //$NON-NLS-1$ - //pieces[2] = String.valueOf(newSize); - //set("editor.font", PApplet.join(pieces, ',')); //$NON-NLS-1$ - set("editor.font.size", String.valueOf(newSize)); - - } catch (Exception e) { - Base.log("Ignoring invalid font size " + newSizeText); //$NON-NLS-1$ - } - */ try { Object selection = fontSizeField.getSelectedItem(); if (selection instanceof String) { @@ -828,51 +874,45 @@ public class Preferences { consoleSizeField.setSelectedItem(getInteger("console.font.size")); } + setColor("run.present.bgcolor", presentColor.getBackground()); + setBoolean("editor.input_method_support", inputMethodBox.isSelected()); //$NON-NLS-1$ if (autoAssociateBox != null) { setBoolean("platform.auto_file_type_associations", //$NON-NLS-1$ autoAssociateBox.isSelected()); } - + + setBoolean("pdex.errorCheckEnabled", errorCheckerBox.isSelected()); + setBoolean("pdex.warningsEnabled", warningsCheckerBox.isSelected()); + setBoolean("pdex.ccEnabled", codeCompletionBox.isSelected()); + setBoolean("pdex.ccTriggerEnabled", codeCompletionTriggerBox.isSelected()); for (Editor editor : base.getEditors()) { editor.applyPreferences(); } + } protected void showFrame() { editorAntialiasBox.setSelected(getBoolean("editor.smooth")); //$NON-NLS-1$ inputMethodBox.setSelected(getBoolean("editor.input_method_support")); //$NON-NLS-1$ - - // set all settings entry boxes to their actual status -// exportSeparateBox. -// setSelected(getBoolean("export.applet.separate_jar_files")); + errorCheckerBox.setSelected(getBoolean("pdex.errorCheckEnabled")); + warningsCheckerBox.setSelected(getBoolean("pdex.warningsEnabled")); + codeCompletionBox.setSelected(getBoolean("pdex.ccEnabled")); + codeCompletionTriggerBox.setSelected(getBoolean("pdex.ccTriggerEnabled")); deletePreviousBox. setSelected(getBoolean("export.delete_target_folder")); //$NON-NLS-1$ - //closingLastQuitsBox. - // setSelected(getBoolean("sketchbook.closing_last_window_quits")); - //sketchPromptBox. - // setSelected(getBoolean("sketchbook.prompt")); - //sketchCleanBox. - // setSelected(getBoolean("sketchbook.auto_clean")); - - sketchbookLocationField. - setText(get("sketchbook.path")); //$NON-NLS-1$ -// externalEditorBox. -// setSelected(getBoolean("editor.external")); - checkUpdatesBox. - setSelected(getBoolean("update.check")); //$NON-NLS-1$ + sketchbookLocationField.setText(getSketchbookPath()); + checkUpdatesBox.setSelected(getBoolean("update.check")); //$NON-NLS-1$ whinyBox.setSelected(getBoolean("header.hide.image") || //$NON-NLS-1$ getBoolean("buttons.hide.image")); //$NON-NLS-1$ updateDisplayList(); int displayNum = getInteger("run.display"); //$NON-NLS-1$ -// System.out.println("display is " + displayNum + ", d count is " + displayCount); if (displayNum >= 0 && displayNum < displayCount) { -// System.out.println("setting num to " + displayNum); displaySelectionBox.setSelectedIndex(displayNum); } @@ -886,27 +926,14 @@ public class Preferences { fontSizeField.setSelectedItem(getInteger("editor.font.size")); consoleSizeField.setSelectedItem(getInteger("console.font.size")); + presentColor.setBackground(Preferences.getColor("run.present.bgcolor")); + presentColorHex.setText(Preferences.get("run.present.bgcolor").substring(1)); + memoryOverrideBox. setSelected(getBoolean("run.options.memory")); //$NON-NLS-1$ memoryField. setText(get("run.options.memory.maximum")); //$NON-NLS-1$ - /* - if (Base.isMacOS()) { - String bits = Preferences.get("run.options.bits"); //$NON-NLS-1$ - if (bits.equals("32")) { //$NON-NLS-1$ - bitsThirtyTwoButton.setSelected(true); - } else if (bits.equals("64")) { //$NON-NLS-1$ - bitsSixtyFourButton.setSelected(true); - } - // in case we go back and support OS X 10.5... - if (System.getProperty("os.version").startsWith("10.5")) { //$NON-NLS-1$ //$NON-NLS-2$ - bitsSixtyFourButton.setSelected(true); - bitsThirtyTwoButton.setEnabled(false); - } - } - */ - if (autoAssociateBox != null) { autoAssociateBox. setSelected(getBoolean("platform.auto_file_type_associations")); //$NON-NLS-1$ @@ -934,37 +961,11 @@ public class Preferences { void initFontList() { - /* - if (monoFontList == null) { - monoFontList = Toolkit.getMonoFontList().toArray(new Font[0]); - fontSelectionBox.setModel(new DefaultComboBoxModel(monoFontList)); - fontSelectionBox.setRenderer(new FontNamer()); - - // Preferred size just makes it extend to the container - //fontSelectionBox.setSize(fontSelectionBox.getPreferredSize()); - // Minimum size is better, but cuts things off (on OS X), so we add 20 - //Dimension minSize = fontSelectionBox.getMinimumSize(); - //Dimension minSize = fontSelectionBox.getPreferredSize(); - //fontSelectionBox.setSize(minSize.width + 20, minSize.height); - fontSelectionBox.setEnabled(true); - } - */ if (monoFontFamilies == null) { monoFontFamilies = Toolkit.getMonoFontFamilies(); fontSelectionBox.setModel(new DefaultComboBoxModel(monoFontFamilies)); String family = get("editor.font.family"); -// System.out.println("family is " + family); -// System.out.println("font sel items = " + fontSelectionBox.getItemCount()); -// for (int i = 0; i < fontSelectionBox.getItemCount(); i++) { -// String item = (String) fontSelectionBox.getItemAt(i); -// if (fontSelectionBox.getItemAt(i) == family) { -// System.out.println("found at index " + i); -// } else if (item.equals(family)) { -// System.out.println("equals at index " + i); -// } else { -// System.out.println("nothing doing: " + item); -// } -// } + // Set a reasonable default, in case selecting the family fails fontSelectionBox.setSelectedItem("Monospaced"); fontSelectionBox.setSelectedItem(family); @@ -988,22 +989,6 @@ public class Preferences { } - // Workaround for Apple bullsh*t caused by their not releasing a 32-bit - // version of Java for Mac OS X 10.5. -// static public String checkBits() { -// String bits = Preferences.get("run.options.bits"); -// if (bits == null) { -// if (System.getProperty("os.version").startsWith("10.5")) { -// bits = "64"; -// } else { -// bits = "32"; -// } -// Preferences.set("run.options.bits", bits); -// } -// return bits; -// } - - // ................................................................. @@ -1062,20 +1047,8 @@ public class Preferences { // all the information from preferences.txt - //static public String get(String attribute) { - //return get(attribute, null); - //} - static public String get(String attribute /*, String defaultValue */) { return table.get(attribute); - /* - //String value = (properties != null) ? - //properties.getProperty(attribute) : applet.getParameter(attribute); - String value = properties.getProperty(attribute); - - return (value == null) ? - defaultValue : value; - */ } @@ -1213,28 +1186,37 @@ public class Preferences { } return new Font("Dialog", Font.PLAIN, 12); } + + + // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + - - /* - static public SyntaxStyle getStyle(String what) { - String str = get("editor." + what + ".style"); //, dflt); //$NON-NLS-1$ //$NON-NLS-2$ - - StringTokenizer st = new StringTokenizer(str, ","); //$NON-NLS-1$ - - String s = st.nextToken(); - if (s.indexOf("#") == 0) s = s.substring(1); //$NON-NLS-1$ - Color color = Color.DARK_GRAY; - try { - color = new Color(Integer.parseInt(s, 16)); - } catch (Exception e) { } - - s = st.nextToken(); - boolean bold = (s.indexOf("bold") != -1); //$NON-NLS-1$ -// boolean italic = (s.indexOf("italic") != -1); //$NON-NLS-1$ - //System.out.println(what + " = " + str + " " + bold + " " + italic); - -// return new SyntaxStyle(color, italic, bold); - return new SyntaxStyle(color, bold); + /** + * Check for a 3.0 sketchbook location, and if none exists, + * try to grab it from the 2.0 sketchbook location. + * @return true if a location was found and the pref didn't exist + */ + static protected boolean checkSketchbookPref() { + // If a 3.0 sketchbook location has never been inited + if (getSketchbookPath() == null) { + String twoPath = get("sketchbook.path"); + // If they've run the 2.0 version, start with that location + if (twoPath != null) { + setSketchbookPath(twoPath); + return true; // save the sketchbook right away + } + // Otherwise it'll be null, and reset properly by Base + } + return false; + } + + + static protected String getSketchbookPath() { + return get("sketchbook.path.three"); //$NON-NLS-1$ + } + + + static protected void setSketchbookPath(String path) { + set("sketchbook.path.three", path); //$NON-NLS-1$ } - */ } diff --git a/app/src/processing/app/ProgressFrame.java b/app/src/processing/app/ProgressFrame.java new file mode 100644 index 000000000..3e91ee54c --- /dev/null +++ b/app/src/processing/app/ProgressFrame.java @@ -0,0 +1,379 @@ +package processing.app; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; + +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.SwingWorker; + +//Class used to handle progress bar, and run Save As or Add File in +//background so that +//progress bar can update without freezing +public class ProgressFrame extends JFrame implements PropertyChangeListener { + + private static final long serialVersionUID = 1L; + + private JProgressBar progressBar; + + private JLabel saveAsLabel; + + private TaskSaveAs t; + + private TaskAddFile t2; + + private File[] copyItems; + + private File newFolder; + + private File addFile, sourceFile; + + private Editor editor; + + // create a new background thread to save as + public class TaskSaveAs extends SwingWorker { + + @Override + protected Void doInBackground() throws Exception { + // a large part of the file copying happens in this background + // thread + + long totalSize = 0; + for (File copyable : copyItems) { + totalSize += getFileLength(copyable); + } + + long progress = 0; + setProgress(0); + for (File copyable : ProgressFrame.this.copyItems) { + // loop to copy over the items that make sense, and to set the + // current progress + + if (copyable.isDirectory()) { + copyDir(copyable, + new File(ProgressFrame.this.newFolder, copyable.getName()), + this, progress, totalSize); + progress += getFileLength(copyable); + } else { + copyFile(copyable, + new File(ProgressFrame.this.newFolder, copyable.getName()), + this, progress, totalSize); + if (getFileLength(copyable) < 524288) { + // If the file length > 0.5MB, the copyFile() function has + // been redesigned to change progress every 0.5MB so that + // the progress bar doesn't stagnate during that time + progress += getFileLength(copyable); + setProgress((int) Math.min(Math.ceil(progress * 100.0 / totalSize), + 100)); + } + } + } + + return null; + } + + public void setProgressBarStatus(int status) { + + setProgress(status); + } + + @Override + public void done() { + // to close the progress bar automatically when done, and to + // print that Saving is done in Message Area + + editor.statusNotice("Done Saving."); + ProgressFrame.this.closeProgressBar(); + } + + } + + // create a new background thread to add a file + public class TaskAddFile extends SwingWorker { + + @Override + protected Void doInBackground() throws Exception { + // a large part of the file copying happens in this background + // thread + + setProgress(0); + + copyFile(sourceFile, addFile, this); + + if (addFile.length() < 1024) { + // If the file length > 1kB, the copyFile() function has + // been redesigned to change progress every 1kB so that + // the progress bar doesn't stagnate during that time + + // If file <1 kB, just fill up Progress Bar to 100% + // directly, since time to copy is now negligable (when + // perceived by a human, anyway) + setProgress(100); + } + + return null; + } + + public void setProgressBarStatus(int status) { + setProgress(status); + } + + @Override + public void done() { + // to close the progress bar automatically when done, and to + // print that adding file is done in Message Area + + editor.statusNotice("One file added to the sketch."); + ProgressFrame.this.closeProgressBar(); + } + + } + + //Use for Save As + public ProgressFrame(File[] c, File nf, String oldName, String newName, + Editor editor) { + // initialize a copyItems and newFolder, which are used for file + // copying in the background thread + copyItems = c; + newFolder = nf; + this.editor = editor; + + // the UI of the progress bar follows + setDefaultCloseOperation(HIDE_ON_CLOSE); + setBounds(200, 200, 400, 140); + setResizable(false); + setTitle("Saving As..."); + JPanel panel = new JPanel(null); + add(panel); + setContentPane(panel); + saveAsLabel = new JLabel("Saving " + oldName + " as " + newName + "..."); + saveAsLabel.setBounds(40, 20, 300, 20); + + progressBar = new JProgressBar(0, 100); + progressBar.setValue(0); + progressBar.setBounds(40, 50, 300, 30); + progressBar.setStringPainted(true); + + panel.add(progressBar); + panel.add(saveAsLabel); + Toolkit.setIcon(this); + this.setVisible(true); + + // create an instance of TaskSaveAs and run execute() on this + // instance to + // start background thread + t = new TaskSaveAs(); + t.addPropertyChangeListener(this); + t.execute(); + } + + //Use for Add File + public ProgressFrame(File sf, File add, Editor editor) { + + addFile = add; + sourceFile = sf; + this.editor = editor; + + // the UI of the progress bar follows + setDefaultCloseOperation(HIDE_ON_CLOSE); + setBounds(200, 200, 400, 140); + setResizable(false); + setTitle("Adding File..."); + JPanel panel = new JPanel(null); + add(panel); + setContentPane(panel); + saveAsLabel = new JLabel("Adding " + addFile.getName()); + saveAsLabel.setBounds(40, 20, 300, 20); + + progressBar = new JProgressBar(0, 100); + progressBar.setValue(0); + progressBar.setBounds(40, 50, 300, 30); + progressBar.setStringPainted(true); + + panel.add(progressBar); + panel.add(saveAsLabel); + Toolkit.setIcon(this); + this.setVisible(true); + + // create an instance of TaskAddFile and run execute() on this + // instance to + // start background thread + t2 = new TaskAddFile(); + t2.addPropertyChangeListener(this); + t2.execute(); + } + + public long getFileLength(File f)// function to return the length of + // the file, or + // ENTIRE directory, including the + // component files + // and sub-folders if passed + { + long fol_len = 0; + if (f.isDirectory()) { + String files[] = f.list(); + for (int i = 0; i < files.length; i++) { + File temp = new File(f, files[i]); + if (temp.isDirectory()) { + fol_len += getFileLength(temp); + } else { + fol_len += (temp.length()); + } + } + } else { + return (f.length()); + } + return fol_len; + } + + public void propertyChange(PropertyChangeEvent evt) + // detects a change in the property of the background task, i.e., is + // called when the size of files already copied changes + { + if ("progress" == evt.getPropertyName()) { + int progress = (Integer) evt.getNewValue(); + progressBar.setValue(progress); + } + } + + private void closeProgressBar() + // closes progress bar + { + this.dispose(); + } + + static public void copyFile(File sourceFile, File targetFile, + ProgressFrame.TaskSaveAs progBar, + double progress, double totalSize) + throws IOException { + // Overloaded copyFile that is called whenever a Save As is being done, so that the + // ProgressBar is updated for very large files as well + BufferedInputStream from = new BufferedInputStream( + new FileInputStream( + sourceFile)); + BufferedOutputStream to = new BufferedOutputStream( + new FileOutputStream( + targetFile)); + byte[] buffer = new byte[16 * 1024]; + int bytesRead; + int totalRead = 0; + while ((bytesRead = from.read(buffer)) != -1) { + to.write(buffer, 0, bytesRead); + totalRead += bytesRead; + if (totalRead >= 524288) //to update progress bar every 0.5MB + { + progress += totalRead; + progBar.setProgressBarStatus((int) Math.min(Math.ceil(progress * 100.0 + / totalSize), 100)); + totalRead = 0; + } + } + if (sourceFile.length() > 524288) { + // Update the progress bar one final time if file size is more than 0.5MB, + // otherwise, the update is handled either by the copyDir function, + // or directly by ProgressFrame.TaskSaveAs.doInBackground() + progress += totalRead; + progBar.setProgressBarStatus((int) Math.min(Math.ceil(progress * 100.0 + / totalSize), 100)); + } + from.close(); + from = null; + to.flush(); + to.close(); + to = null; + + targetFile.setLastModified(sourceFile.lastModified()); + targetFile.setExecutable(sourceFile.canExecute()); + } + + static public void copyFile(File sourceFile, File targetFile, + ProgressFrame.TaskAddFile progBar) + throws IOException { + // Overloaded copyFile that is called whenever a addFile is being done, + // so that the + // ProgressBar is updated + double totalSize = sourceFile.length(); + int progress = 0; + BufferedInputStream from = new BufferedInputStream( + new FileInputStream( + sourceFile)); + BufferedOutputStream to = new BufferedOutputStream( + new FileOutputStream( + targetFile)); + byte[] buffer = new byte[16 * 1024]; + int bytesRead; + int totalRead = 0; + while ((bytesRead = from.read(buffer)) != -1) { + to.write(buffer, 0, bytesRead); + totalRead += bytesRead; + if (totalRead >= 1024) // to update progress bar every 1kB + { + progress += totalRead; + progBar.setProgressBarStatus((int) Math.min(Math.ceil(progress * 100.0 + / totalSize), 100)); + totalRead = 0; + } + } + if (sourceFile.length() > 1024) { + // Update the progress bar one final time if file size is more than + // 1kB, + // otherwise, the update is handled directly by + // ProgressFrame.TaskAddFile.doInBackground() + progress += totalRead; + progBar.setProgressBarStatus((int) Math.min(Math.ceil(progress * 100.0 + / totalSize), 100)); + } + from.close(); + from = null; + to.flush(); + to.close(); + to = null; + targetFile.setLastModified(sourceFile.lastModified()); + targetFile.setExecutable(sourceFile.canExecute()); + } + + static public double copyDir(File sourceDir, File targetDir, + ProgressFrame.TaskSaveAs progBar, + double progress, double totalSize) + throws IOException { + // Overloaded copyDir so that the Save As progress bar gets updated when the + // files are in folders as well (like in the data folder) + if (sourceDir.equals(targetDir)) { + final String urDum = "source and target directories are identical"; + throw new IllegalArgumentException(urDum); + } + targetDir.mkdirs(); + String files[] = sourceDir.list(); + for (int i = 0; i < files.length; i++) { + // Ignore dot files (.DS_Store), dot folders (.svn) while copying + if (files[i].charAt(0) == '.') + continue; + //if (files[i].equals(".") || files[i].equals("..")) continue; + File source = new File(sourceDir, files[i]); + File target = new File(targetDir, files[i]); + if (source.isDirectory()) { + //target.mkdirs(); + progress = copyDir(source, target, progBar, progress, totalSize); + progBar.setProgressBarStatus((int) Math.min(Math.ceil(progress * 100.0 + / totalSize), 100)); + target.setLastModified(source.lastModified()); + } else { + copyFile(source, target, progBar, progress, totalSize); + // Update SaveAs progress bar + progress += source.length(); + progBar.setProgressBarStatus((int) Math.min(Math.ceil(progress * 100.0 + / totalSize), 100)); + } + } + return progress; + } + +} diff --git a/app/src/processing/app/Sketch.java b/app/src/processing/app/Sketch.java index 41cb57482..d0a644c7c 100644 --- a/app/src/processing/app/Sketch.java +++ b/app/src/processing/app/Sketch.java @@ -26,6 +26,9 @@ package processing.app; import processing.core.*; import java.awt.*; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; import java.io.*; import javax.swing.*; @@ -286,7 +289,8 @@ public class Sketch { } renamingCode = false; - editor.status.edit("Name for new file:", ""); + // editor.status.edit("Name for new file:", ""); + promptForTabName("Name for new file:", ""); } @@ -326,8 +330,94 @@ public class Sketch { "New name for sketch:" : "New name for file:"; String oldName = (current.isExtension(mode.getDefaultExtension())) ? current.getPrettyName() : current.getFileName(); - editor.status.edit(prompt, oldName); + // editor.status.edit(prompt, oldName); + promptForTabName(prompt, oldName); } + + /** + * Displays a dialog for renaming or creating a new tab + * @param prompt - msg to display + * @param oldName + */ + protected void promptForTabName(String prompt, String oldName) { + final JTextField field = new JTextField(oldName); + + field.addKeyListener(new KeyAdapter() { + // Forget ESC, the JDialog should handle it. + // Use keyTyped to catch when the feller is actually added to the text + // field. With keyTyped, as opposed to keyPressed, the keyCode will be + // zero, even if it's enter or backspace or whatever, so the keychar + // should be used instead. Grr. + public void keyTyped(KeyEvent event) { + //System.out.println("got event " + event); + char ch = event.getKeyChar(); + if ((ch == '_') || (ch == '.') || // allow.pde and .java + (('A' <= ch) && (ch <= 'Z')) || (('a' <= ch) && (ch <= 'z'))) { + // These events are allowed straight through. + } else if (ch == ' ') { + String t = field.getText(); + int start = field.getSelectionStart(); + int end = field.getSelectionEnd(); + field.setText(t.substring(0, start) + "_" + t.substring(end)); + field.setCaretPosition(start + 1); + event.consume(); + } else if ((ch >= '0') && (ch <= '9')) { + // getCaretPosition == 0 means that it's the first char + // and the field is empty. + // getSelectionStart means that it *will be* the first + // char, because the selection is about to be replaced + // with whatever is typed. + if (field.getCaretPosition() == 0 || + field.getSelectionStart() == 0) { + // number not allowed as first digit + event.consume(); + } + } else if (ch == KeyEvent.VK_ENTER) { + // Slightly ugly hack that ensures OK button of the dialog consumes + // the Enter key event. Since the text field is the default component + // in the dialog, OK doesn't consume Enter key event, by default. + Container parent = field.getParent(); + while (!(parent instanceof JOptionPane)) { + parent = parent.getParent(); + } + JOptionPane pane = (JOptionPane) parent; + final JPanel pnlBottom = (JPanel) + pane.getComponent(pane.getComponentCount() - 1); + for (int i = 0; i < pnlBottom.getComponents().length; i++) { + Component component = pnlBottom.getComponents()[i]; + if (component instanceof JButton) { + final JButton okButton = (JButton) component; + if (okButton.getText().equalsIgnoreCase("OK")) { + ActionListener[] actionListeners = + okButton.getActionListeners(); + if (actionListeners.length > 0) { + actionListeners[0].actionPerformed(null); + event.consume(); + } + } + } + } + } else { + event.consume(); + } + } + }); + + int userReply = JOptionPane.showOptionDialog(editor, new Object[] { + prompt, field }, + "New Name", + JOptionPane.OK_CANCEL_OPTION, + JOptionPane.PLAIN_MESSAGE, + null, new Object[] { + Preferences.PROMPT_OK, + Preferences.PROMPT_CANCEL }, + field); + + if (userReply == JOptionPane.OK_OPTION) { + nameCode(field.getText()); + } + } + /** @@ -382,7 +472,7 @@ public class Sketch { if (current == code[0]) { // If this is the main tab, disallow Base.showWarning("Problem with rename", "The first tab cannot be a ." + newExtension + " file.\n" + - "(It may be time for your to graduate to a\n" + + "(It may be time for you to graduate to a\n" + "\"real\" programming environment, hotshot.)"); return; } @@ -654,7 +744,8 @@ public class Sketch { if (Base.isMacOS()) { // http://developer.apple.com/qa/qa2001/qa1146.html Object modifiedParam = modified ? Boolean.TRUE : Boolean.FALSE; - editor.getRootPane().putClientProperty("windowModified", modifiedParam); + // https://developer.apple.com/library/mac/technotes/tn2007/tn2196.html#WINDOW_DOCUMENTMODIFIED + editor.getRootPane().putClientProperty("Window.documentModified", modifiedParam); } } @@ -712,6 +803,8 @@ public class Sketch { protected boolean saveAs() throws IOException { String newParentDir = null; String newName = null; + + final String oldName2 = folder.getName(); // TODO rewrite this to use shared version from PApplet final String PROMPT = Language.text("save"); if (Preferences.getBoolean("chooser.files.native")) { @@ -719,7 +812,7 @@ public class Sketch { FileDialog fd = new FileDialog(editor, PROMPT, FileDialog.SAVE); if (isReadOnly() || isUntitled()) { // default to the sketchbook folder - fd.setDirectory(Preferences.get("sketchbook.path")); + fd.setDirectory(Preferences.getSketchbookPath()); } else { // default to the parent folder of where this was fd.setDirectory(folder.getParent()); @@ -734,7 +827,7 @@ public class Sketch { fc.setDialogTitle(PROMPT); if (isReadOnly() || isUntitled()) { // default to the sketchbook folder - fc.setCurrentDirectory(new File(Preferences.get("sketchbook.path"))); + fc.setCurrentDirectory(new File(Preferences.getSketchbookPath())); } else { // default to the parent folder of where this was fc.setCurrentDirectory(folder.getParentFile()); @@ -846,15 +939,21 @@ public class Sketch { return true; } }); - // now copy over the items that make sense - for (File copyable : copyItems) { - if (copyable.isDirectory()) { - Base.copyDir(copyable, new File(newFolder, copyable.getName())); - } else { - Base.copyFile(copyable, new File(newFolder, copyable.getName())); - } - } + + final File newFolder2 = newFolder; + final File[] copyItems2 = copyItems; + final String newName2 = newName; + + // Create a new event dispatch thread- to display ProgressBar + // while Saving As + javax.swing.SwingUtilities.invokeLater(new Runnable() { + public void run() { + new ProgressFrame(copyItems2, newFolder2, oldName2, newName2, editor); + } + }); + + // save the other tabs to their new location for (int i = 1; i < codeCount; i++) { File newFile = new File(newFolder, code[i].getFileName()); @@ -885,6 +984,7 @@ public class Sketch { } + /** * Update internal state for new sketch name or folder location. */ @@ -950,7 +1050,8 @@ public class Sketch { boolean result = addFile(sourceFile); if (result) { - editor.statusNotice("One file added to the sketch."); +// editor.statusNotice("One file added to the sketch."); + //Done from within TaskAddFile inner class when copying is completed } } @@ -1043,16 +1144,17 @@ public class Sketch { // in case the user is "adding" the code in an attempt // to update the sketch's tabs - if (!sourceFile.equals(destFile)) { - try { - Base.copyFile(sourceFile, destFile); - - } catch (IOException e) { - Base.showWarning("Error adding file", - "Could not add '" + filename + "' to the sketch.", e); - return false; + if (!sourceFile.equals(destFile)) { + final File sourceFile2 = sourceFile; + final File destFile2 = destFile; + // Create a new event dispatch thread- to display ProgressBar + // while Saving As + javax.swing.SwingUtilities.invokeLater(new Runnable() { + public void run() { + new ProgressFrame(sourceFile2, destFile2, editor); } - } + }); + } if (codeExtension != null) { SketchCode newCode = new SketchCode(destFile, codeExtension); @@ -1286,7 +1388,6 @@ public class Sketch { */ public String getMainFilePath() { return primaryFile.getAbsolutePath(); - //return code[0].file.getAbsolutePath(); } diff --git a/app/src/processing/app/Toolkit.java b/app/src/processing/app/Toolkit.java index 34aa23834..83ead7661 100644 --- a/app/src/processing/app/Toolkit.java +++ b/app/src/processing/app/Toolkit.java @@ -40,8 +40,8 @@ import java.awt.font.TextLayout; import java.awt.geom.AffineTransform; import java.io.BufferedInputStream; import java.io.File; +import java.io.FileInputStream; import java.io.IOException; -import java.io.InputStream; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.HashSet; @@ -453,9 +453,16 @@ public class Toolkit { } + /** + * Get a font from the JRE lib/fonts folder. Our default fonts are also + * installed there so that the monospace (and others) can be used by other + * font listing calls (i.e. it appears in the list of monospace fonts in + * the Preferences window). + */ static private Font createFont(String filename, int size) throws IOException, FontFormatException { - InputStream is = Base.getLibStream("fonts/" + filename); - BufferedInputStream input = new BufferedInputStream(is); + //InputStream is = Base.getLibStream("fonts/" + filename); + File fontFile = new File(System.getProperty("java.home"), "lib/fonts/" + filename); + BufferedInputStream input = new BufferedInputStream(new FileInputStream(fontFile)); Font font = Font.createFont(Font.TRUETYPE_FONT, input); input.close(); return font.deriveFont((float) size); diff --git a/app/src/processing/app/UpdateCheck.java b/app/src/processing/app/UpdateCheck.java index fe98fab2b..c1a3cb4d5 100644 --- a/app/src/processing/app/UpdateCheck.java +++ b/app/src/processing/app/UpdateCheck.java @@ -58,7 +58,7 @@ public class UpdateCheck { new Thread(new Runnable() { public void run() { try { - Thread.sleep(30 * 1000); // give the PDE time to get rolling + Thread.sleep(20 * 1000); // give the PDE time to get rolling updateCheck(); } catch (Exception e) { // this can safely be ignored, too many instances where no net @@ -124,11 +124,11 @@ public class UpdateCheck { // (this should really be handled better). Thread.sleep(5 * 1000); if ((!base.libraryManagerFrame.hasAlreadyBeenOpened() && - base.libraryManagerFrame.hasUpdates()) || + base.libraryManagerFrame.hasUpdates(base)) || (!base.toolManagerFrame.hasAlreadyBeenOpened() && - base.toolManagerFrame.hasUpdates()) || + base.toolManagerFrame.hasUpdates(base)) || (!base.modeManagerFrame.hasAlreadyBeenOpened() && - base.modeManagerFrame.hasUpdates())) { + base.modeManagerFrame.hasUpdates(base))) { promptToOpenContributionManager(); } } diff --git a/app/src/processing/app/contrib/AvailableContribution.java b/app/src/processing/app/contrib/AvailableContribution.java index a815ab6da..44ed86888 100644 --- a/app/src/processing/app/contrib/AvailableContribution.java +++ b/app/src/processing/app/contrib/AvailableContribution.java @@ -1,4 +1,4 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ /* Part of the Processing project - http://processing.org @@ -23,6 +23,7 @@ package processing.app.contrib; import java.io.*; import java.util.HashMap; +import java.util.List; import processing.app.Base; import processing.app.Editor; @@ -53,6 +54,13 @@ class AvailableContribution extends Contribution { version = PApplet.parseInt(versionStr, 0); } prettyVersion = params.get("prettyVersion"); + String lastUpdatedStr = params.get("lastUpdated"); + if (lastUpdatedStr != null) + try { + lastUpdated = Long.parseLong(lastUpdatedStr); + } catch (NumberFormatException e) { + lastUpdated = 0; + } } @@ -179,26 +187,96 @@ class AvailableContribution extends Contribution { /** - * We overwrite the properties file with the curated version from the - * Processing site. This ensures that things have been cleaned up (for - * instance, that the "sentence" is really a sentence) and that bad data - * from the contrib's .properties file doesn't break the manager. + * We overwrite those fields that aren't proper in the properties file with + * the curated version from the Processing site. This ensures that things have + * been cleaned up (for instance, that the "sentence" is really a sentence) + * and that bad data from the contrib's .properties file doesn't break the + * manager. However, it also ensures that valid fields in the properties file + * aren't overwritten, since the properties file may be more recent than the + * contributions.txt file. + * * @param propFile * @return */ public boolean writePropertiesFile(File propFile) { try { + + HashMap properties = Base.readSettings(propFile); + + String name = properties.get("name"); + if (name == null || name.isEmpty()) + name = getName(); + + String category; + List categoryList = parseCategories(properties.get("category")); + if (categoryList.size() == 1 && categoryList.get(0).equals("Unknown")) + category = getCategoryStr(); + else { + StringBuilder sb = new StringBuilder(); + for (String cat : categories) { + sb.append(cat); + sb.append(','); + } + sb.deleteCharAt(sb.length() - 1); + category = sb.toString(); + } + + String authorList = properties.get("authorList"); + if (authorList == null || authorList.isEmpty()) + authorList = getAuthorList(); + + String url = properties.get("url"); + if (url == null || url.isEmpty()) + url = getUrl(); + + String sentence = properties.get("sentence"); + if (sentence == null || sentence.isEmpty()) + sentence = getSentence(); + + String paragraph = properties.get("paragraph"); + if (paragraph == null || paragraph.isEmpty()) + paragraph = getParagraph(); + + int version; + try { + version = Integer.parseInt(properties.get("version")); + } catch (NumberFormatException e) { + version = getVersion(); + System.err.println("The version number for the “" + name + + "” contribution is not set properly."); + System.err + .println("Please contact the author to fix it according to the guidelines."); + } + + String prettyVersion = properties.get("prettyVersion"); + if (prettyVersion == null || prettyVersion.isEmpty()) + prettyVersion = getPrettyVersion(); + + long lastUpdated; + try { + lastUpdated = Long.parseLong(properties.get("lastUpdated")); + } + catch (NumberFormatException nfe) { + lastUpdated = getLastUpdated(); + // Better comment these out till all contribs have a lastUpdated +// System.err.println("The last updated date for the “" + name +// + "” contribution is not set properly."); +// System.err +// .println("Please contact the author to fix it according to the guidelines."); + } + if (propFile.delete() && propFile.createNewFile() && propFile.setWritable(true)) { PrintWriter writer = PApplet.createWriter(propFile); - writer.println("name=" + getName()); - writer.println("category=" + getCategoryStr()); - writer.println("authorList=" + getAuthorList()); - writer.println("url=" + getUrl()); - writer.println("sentence=" + getSentence()); - writer.println("paragraph=" + getParagraph()); - writer.println("version=" + getVersion()); - writer.println("prettyVersion=" + getPrettyVersion()); + writer.println("name=" + name); + writer.println("category=" + category); + writer.println("authorList=" + authorList); + writer.println("url=" + url); + writer.println("sentence=" + sentence); + writer.println("paragraph=" + paragraph); + writer.println("version=" + version); + writer.println("prettyVersion=" + prettyVersion); + writer.println("lastUpdated=" + lastUpdated); writer.flush(); writer.close(); diff --git a/app/src/processing/app/contrib/Contribution.java b/app/src/processing/app/contrib/Contribution.java index 8367b98d3..9fc73c851 100644 --- a/app/src/processing/app/contrib/Contribution.java +++ b/app/src/processing/app/contrib/Contribution.java @@ -43,6 +43,7 @@ abstract public class Contribution { protected String paragraph; // protected int version; // 102 protected String prettyVersion; // "1.0.2" + protected long lastUpdated; // 1402805757 // "Sound" @@ -120,6 +121,11 @@ abstract public class Contribution { public String getPrettyVersion() { return prettyVersion; } + + // 1402805757 + public long getLastUpdated() { + return lastUpdated; + } abstract public ContributionType getType(); diff --git a/app/src/processing/app/contrib/ContributionListing.java b/app/src/processing/app/contrib/ContributionListing.java index 05531f63d..65c16048f 100644 --- a/app/src/processing/app/contrib/ContributionListing.java +++ b/app/src/processing/app/contrib/ContributionListing.java @@ -27,6 +27,7 @@ import java.util.*; import java.util.concurrent.locks.ReentrantLock; import processing.app.Base; +import processing.app.Library; import processing.core.PApplet; @@ -379,6 +380,19 @@ public class ContributionListing { } return false; } + + boolean hasUpdates(Base base) { + for (ModeContribution m : base.getModeContribs()) + if (hasUpdates(m)) + return true; + for (Library l : base.getActiveEditor().getMode().contribLibraries) + if (hasUpdates(l)) + return true; + for (ToolContribution t : base.getActiveEditor().contribTools) + if (hasUpdates(t)) + return true; + return false; + } boolean hasUpdates(Contribution contribution) { @@ -393,6 +407,24 @@ public class ContributionListing { } + String getLatestVersion(Contribution contribution) { + Contribution newestContrib = getAvailableContribution(contribution); + String latestVersion = newestContrib.getPrettyVersion(); + if (latestVersion != null && !latestVersion.isEmpty()) { + if (latestVersion.toLowerCase().startsWith("build")) // For Python mode + return ("v" + latestVersion.substring(5, latestVersion.indexOf(',')) + .trim()); + else if (latestVersion.toLowerCase().startsWith("v")) // For ketai library + return latestVersion; + else + return ("v" + latestVersion); + } + else + return null; + } + + + boolean hasDownloadedLatestList() { return hasDownloadedLatestList; } diff --git a/app/src/processing/app/contrib/ContributionManagerDialog.java b/app/src/processing/app/contrib/ContributionManagerDialog.java index 6583acff9..a4a4e4f70 100644 --- a/app/src/processing/app/contrib/ContributionManagerDialog.java +++ b/app/src/processing/app/contrib/ContributionManagerDialog.java @@ -74,6 +74,10 @@ public class ContributionManagerDialog { } + public boolean hasUpdates(Base base) { + return contribListing.hasUpdates(base); + } + public void showFrame(Editor editor) { this.editor = editor; @@ -106,7 +110,7 @@ public class ContributionManagerDialog { status.setErrorMessage("Connection timed out while " + "downloading the contribution list."); } else { - status.setErrorMessage("Could not download the list" + + status.setErrorMessage("Could not download the list " + "of available contributions."); } exception.printStackTrace(); @@ -121,6 +125,7 @@ public class ContributionManagerDialog { * Close the window after an OK or Cancel. */ protected void disposeFrame() { + status.clear(); dialog.dispose(); editor = null; } @@ -163,6 +168,7 @@ public class ContributionManagerDialog { category = null; } filterLibraries(category, filterField.filters); + contributionListPanel.updateColors(); } }); @@ -420,6 +426,8 @@ public class ContributionManagerDialog { filter = filter.replaceAll("[^\\x30-\\x39^\\x61-\\x7a^\\x3a]", " "); filters = Arrays.asList(filter.split(" ")); filterLibraries(category, filters); + + contributionListPanel.updateColors(); } public String getFilterText() { diff --git a/app/src/processing/app/contrib/ContributionPanel.java b/app/src/processing/app/contrib/ContributionPanel.java index ca6f2da4e..c4a2763b5 100644 --- a/app/src/processing/app/contrib/ContributionPanel.java +++ b/app/src/processing/app/contrib/ContributionPanel.java @@ -28,6 +28,8 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.Date; +import java.text.DateFormat; import javax.swing.*; import javax.swing.border.EmptyBorder; @@ -99,6 +101,7 @@ class ContributionPanel extends JPanel { installActionListener = new ActionListener() { public void actionPerformed(ActionEvent e) { + listPanel.contribManager.status.clear(); if (contrib instanceof AvailableContribution) { installContribution((AvailableContribution) contrib); contribListing.replaceContribution(contrib, contrib); @@ -108,6 +111,7 @@ class ContributionPanel extends JPanel { undoActionListener = new ActionListener() { public void actionPerformed(ActionEvent e) { + listPanel.contribManager.status.clear(); if (contrib instanceof LocalContribution) { LocalContribution installed = (LocalContribution) contrib; installed.setDeletionFlag(false); @@ -118,6 +122,7 @@ class ContributionPanel extends JPanel { removeActionListener = new ActionListener() { public void actionPerformed(ActionEvent arg) { + listPanel.contribManager.status.clear(); if (contrib.isInstalled() && contrib instanceof LocalContribution) { updateButton.setEnabled(false); installRemoveButton.setEnabled(false); @@ -180,6 +185,9 @@ class ContributionPanel extends JPanel { descriptionBlock.setContentType("text/html"); setTextStyle(descriptionBlock); descriptionBlock.setOpaque(false); + if (UIManager.getLookAndFeel().getID().equals("Nimbus")) { + descriptionBlock.setBackground(new Color(0, 0, 0, 0)); + } // stripTextSelectionListeners(descriptionBlock); descriptionBlock.setBorder(new EmptyBorder(4, 7, 7, 7)); @@ -209,6 +217,7 @@ class ContributionPanel extends JPanel { updateButton.setVisible(false); updateButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { + listPanel.contribManager.status.clear(); updateButton.setEnabled(false); AvailableContribution ad = contribListing.getAvailableContribution(contrib); String url = ad.link; @@ -359,6 +368,29 @@ class ContributionPanel extends JPanel { } description.append(sentence); } + + String version = contrib.getPrettyVersion(); + + if (version != null && !version.isEmpty()) { + description.append("
"); + if (version.toLowerCase().startsWith("build")) // For Python mode + description.append("v" + + version.substring(5, version.indexOf(',')).trim()); + else if (version.toLowerCase().startsWith("v")) // For ketai library + description.append(version); + else + description.append("v" + version); + } + + long lastUpdatedUTC = contrib.getLastUpdated(); + if (lastUpdatedUTC != 0) { + DateFormat dateFormatter = DateFormat.getDateInstance(DateFormat.MEDIUM); + Date lastUpdatedDate = new Date(lastUpdatedUTC); + if (version != null && !version.isEmpty()) + description.append(", "); + description.append("Last Updated on " + dateFormatter.format(lastUpdatedDate)); + } + description.append(""); //descriptionText.setText(description.toString()); descriptionBlock.setText(description.toString()); @@ -371,7 +403,11 @@ class ContributionPanel extends JPanel { // Already marked for deletion, see requiresRestart() notes below. versionText.append("To finish an update, reinstall this contribution after restarting."); } else { - versionText.append("New version available!"); + String latestVersion = contribListing.getLatestVersion(contrib); + if (latestVersion != null) + versionText.append("New version (" + latestVersion + ") available!"); + else + versionText.append("New version available!"); if (contrib.getType().requiresRestart()) { // If a contribution can't be reinstalled in-place, the user may need // to remove the current version, restart Processing, then install. diff --git a/app/src/processing/app/contrib/LocalContribution.java b/app/src/processing/app/contrib/LocalContribution.java index 03a6e0f31..57ac2ffc9 100644 --- a/app/src/processing/app/contrib/LocalContribution.java +++ b/app/src/processing/app/contrib/LocalContribution.java @@ -1,4 +1,4 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ /* Part of the Processing project - http://processing.org @@ -74,6 +74,15 @@ public abstract class LocalContribution extends Contribution { System.err.println("Please contact the library author to fix it according to the guidelines."); } prettyVersion = properties.get("prettyVersion"); + try { + lastUpdated = Long.parseLong(properties.get("lastUpdated")); + } catch (NumberFormatException e) { + lastUpdated = 0; + + // Better comment these out till all contribs have a lastUpdated +// System.err.println("The last updated timestamp for the “" + name + "” library is not set properly."); +// System.err.println("Please contact the library author to fix it according to the guidelines."); + } } else { Base.log("No properties file at " + propertiesFile.getAbsolutePath()); diff --git a/app/src/processing/app/contrib/StatusPanel.java b/app/src/processing/app/contrib/StatusPanel.java index a4f98e14c..ea1e874ac 100644 --- a/app/src/processing/app/contrib/StatusPanel.java +++ b/app/src/processing/app/contrib/StatusPanel.java @@ -45,6 +45,11 @@ class StatusPanel extends JLabel { setText(message); repaint(); } + + void clear() { + setText(""); + repaint(); + } } diff --git a/app/src/processing/app/platform/LinuxPlatform.java b/app/src/processing/app/platform/LinuxPlatform.java index 8e9ee7c71..85d2b4e9a 100644 --- a/app/src/processing/app/platform/LinuxPlatform.java +++ b/app/src/processing/app/platform/LinuxPlatform.java @@ -23,6 +23,7 @@ package processing.app.platform; import java.io.File; +import java.awt.Toolkit; import processing.app.Base; import processing.app.Platform; @@ -47,6 +48,21 @@ public class LinuxPlatform extends Platform { "placement. For more background, please read the wiki:\n" + "http://wiki.processing.org/w/Supported_Platforms#Linux", null); } + + // Set x11 WM_CLASS property which is used as the application + // name by Gnome3 and other window managers. + // https://github.com/processing/processing/issues/2534 + try { + Toolkit xToolkit = Toolkit.getDefaultToolkit(); + java.lang.reflect.Field awtAppClassNameField = + xToolkit.getClass().getDeclaredField("awtAppClassName"); + awtAppClassNameField.setAccessible(true); + awtAppClassNameField.set(xToolkit, "Processing"); + + } catch(Exception e) { + // In case the implementation details change + e.printStackTrace(); + } } diff --git a/app/src/processing/app/platform/ThinkDifferent.java b/app/src/processing/app/platform/ThinkDifferent.java index aba1ed4ba..e13db6f0b 100644 --- a/app/src/processing/app/platform/ThinkDifferent.java +++ b/app/src/processing/app/platform/ThinkDifferent.java @@ -22,7 +22,6 @@ package processing.app.platform; -import java.awt.Dimension; import java.awt.event.*; import javax.swing.*; @@ -30,7 +29,6 @@ import javax.swing.*; import processing.app.About; import processing.app.Base; import processing.app.Toolkit; -import processing.core.PApplet; import com.apple.eawt.*; @@ -84,27 +82,27 @@ public class ThinkDifferent implements ApplicationListener { // This is kind of a gross way to do this, but the alternatives? Hrm. Base.defaultFileMenu = fileMenu; - if (PApplet.javaVersion <= 1.6f) { // doesn't work on Oracle's Java - try { - application.setDefaultMenuBar(defaultMenuBar); - - } catch (Exception e) { - e.printStackTrace(); // oh well nevermind - } - } else { - // The douchebags at Oracle didn't feel that a working f*king menubar - // on OS X was important enough to make it into the 7u40 release. - //http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8007267 - // It languished in the JDK 8 source and has been backported for 7u60: - //http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8022667 - - JFrame offscreen = new JFrame(); - offscreen.setUndecorated(true); - offscreen.setJMenuBar(defaultMenuBar); - Dimension screen = Toolkit.getScreenSize(); - offscreen.setLocation(screen.width, screen.height); - offscreen.setVisible(true); +// if (PApplet.javaVersion <= 1.6f) { // doesn't work on Oracle's Java + try { + application.setDefaultMenuBar(defaultMenuBar); + + } catch (Exception e) { + e.printStackTrace(); // oh well, never mind } +// } else { +// // The douchebags at Oracle didn't feel that a working f*king menubar +// // on OS X was important enough to make it into the 7u40 release. +// //http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8007267 +// // It languished in the JDK 8 source and has been backported for 7u60: +// //http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8022667 +// +// JFrame offscreen = new JFrame(); +// offscreen.setUndecorated(true); +// offscreen.setJMenuBar(defaultMenuBar); +// Dimension screen = Toolkit.getScreenSize(); +// offscreen.setLocation(screen.width, screen.height); +// offscreen.setVisible(true); +// } } diff --git a/app/src/processing/app/syntax/JEditTextArea.java b/app/src/processing/app/syntax/JEditTextArea.java index de7eb16ce..221218d46 100644 --- a/app/src/processing/app/syntax/JEditTextArea.java +++ b/app/src/processing/app/syntax/JEditTextArea.java @@ -103,7 +103,7 @@ public class JEditTextArea extends JComponent } // Initialize some misc. stuff - painter = new TextAreaPainter(this, defaults); + painter = createPainter(defaults); documentHandler = new DocumentHandler(); eventListenerList = new EventListenerList(); caretEvent = new MutableCaretEvent(); @@ -176,6 +176,16 @@ public class JEditTextArea extends JComponent } + /** + * Override this to provide your own painter for this {@link JEditTextArea}. + * @param defaults + * @return a newly constructed {@link TextAreaPainter}. + */ + protected TextAreaPainter createPainter(final TextAreaDefaults defaults) { + return new TextAreaPainter(this, defaults); + } + + /** * Inline Input Method Support for Japanese. */ diff --git a/app/src/processing/mode/java/JavaBuild.java b/app/src/processing/mode/java/JavaBuild.java index 46c18816d..42f8de00f 100644 --- a/app/src/processing/mode/java/JavaBuild.java +++ b/app/src/processing/mode/java/JavaBuild.java @@ -422,7 +422,7 @@ public class JavaBuild { String entry = (dot == -1) ? item : item.substring(0, dot); // System.out.print(entry + " => "); - if (item.startsWith("static ")) { + if (item.startsWith("static ")) { // import static - https://github.com/processing/processing/issues/8 // Remove more stuff. int dot2 = item.lastIndexOf('.'); @@ -472,8 +472,8 @@ public class JavaBuild { javaClassPath = javaClassPath.substring(1, javaClassPath.length() - 1); } classPath += File.pathSeparator + javaClassPath; - - // But make sure that there isn't anything in there that's missing, + + // But make sure that there isn't anything in there that's missing, // otherwise ECJ will complain and die. For instance, Java 1.7 (or maybe // it's appbundler?) adds Java/Classes to the path, which kills us. //String[] classPieces = PApplet.split(classPath, File.pathSeparator); @@ -549,7 +549,7 @@ public class JavaBuild { if (pkg.startsWith("processing.data.")) return true; if (pkg.startsWith("processing.event.")) return true; if (pkg.startsWith("processing.opengl.")) return true; - + // if (pkg.startsWith("com.jogamp.")) return true; // // ignore core, data, and opengl packages @@ -1113,11 +1113,11 @@ public class JavaBuild { File folder = null; for (String platformName : PConstants.platformNames) { int platform = Base.getPlatformIndex(platformName); - + // Can only embed Java on the native platform - boolean embedJava = (platform == PApplet.platform) && + boolean embedJava = (platform == PApplet.platform) && Preferences.getBoolean("export.application.embed_java"); - + if (Preferences.getBoolean("export.application.platform." + platformName)) { if (Library.hasMultipleArch(platform, importedLibraries)) { // export the 32-bit version @@ -1216,41 +1216,41 @@ public class JavaBuild { File jdkFolder = new File(Base.getJavaHome(), "../../.."); String jdkFolderName = jdkFolder.getCanonicalFile().getName(); jvmRuntime = "JVMRuntime\n " + jdkFolderName + ""; - jdkPath = new File(dotAppFolder, "Contents/PlugIns/" + jdkFolderName + ".jdk").getAbsolutePath(); + jdkPath = new File(dotAppFolder, "Contents/PlugIns/" + jdkFolderName).getAbsolutePath(); } File contentsFolder = new File(dotAppFolder, "Contents"); contentsFolder.mkdirs(); // Info.plist will be written later - + // set the jar folder to a different location than windows/linux //jarFolder = new File(dotAppFolder, "Contents/Resources/Java"); jarFolder = new File(contentsFolder, "Java"); File macosFolder = new File(contentsFolder, "MacOS"); macosFolder.mkdirs(); - Base.copyFile(new File(contentsOrig, "MacOS/Processing"), + Base.copyFile(new File(contentsOrig, "MacOS/Processing"), new File(contentsFolder, "MacOS/" + sketch.getName())); - + File pkgInfo = new File(contentsFolder, "PkgInfo"); PrintWriter writer = PApplet.createWriter(pkgInfo); writer.println("APPL????"); writer.flush(); writer.close(); - + // Use faster(?) native copy here (also to do sym links) if (embedJava) { Base.copyDirNative(new File(contentsOrig, "PlugIns"), new File(contentsFolder, "PlugIns")); } - + File resourcesFolder = new File(contentsFolder, "Resources"); - Base.copyDir(new File(contentsOrig, "Resources/en.lproj"), + Base.copyDir(new File(contentsOrig, "Resources/en.lproj"), new File(resourcesFolder, "en.lproj")); Base.copyFile(mode.getContentFile("application/sketch.icns"), new File(resourcesFolder, "sketch.icns")); - + /* String stubName = "Contents/MacOS/JavaApplicationStub"; // need to set the stub to executable @@ -1279,7 +1279,7 @@ public class JavaBuild { if (embedJava) { Base.copyDirNative(Base.getJavaHome(), new File(destFolder, "java")); } - + } else if (exportPlatform == PConstants.WINDOWS) { if (embedJava) { Base.copyDir(Base.getJavaHome(), new File(destFolder, "java")); @@ -1312,7 +1312,7 @@ public class JavaBuild { } */ - + /// start copying all jar files Vector jarListVector = new Vector(); @@ -1446,7 +1446,11 @@ public class JavaBuild { } // https://github.com/processing/processing/issues/2239 runOptions.add("-Djna.nosys=true"); - + // https://github.com/processing/processing/issues/2559 + if (exportPlatform == PConstants.WINDOWS) { + runOptions.add("-Djava.library.path=\"%EXEDIR%\\lib\""); + } + /// macosx: write out Info.plist (template for classpath, etc) @@ -1457,7 +1461,7 @@ public class JavaBuild { runOptionsXML.append(opt); runOptionsXML.append(""); runOptionsXML.append('\n'); - } + } String PLIST_TEMPLATE = "Info.plist.tmpl"; File plistTemplate = new File(sketch.getFolder(), PLIST_TEMPLATE); @@ -1500,10 +1504,10 @@ public class JavaBuild { // attempt to code sign if the Xcode tools appear to be installed if (Base.isMacOS() && new File("/usr/bin/codesign_allocate").exists()) { if (embedJava) { - ProcessHelper.ffs("codesign", "--force", "--sign", "-", jdkPath); + ProcessHelper.ffs("codesign", "--force", "--sign", "-", jdkPath); } String appPath = dotAppFolder.getAbsolutePath(); - ProcessHelper.ffs("codesign", "--force", "--sign", "-", appPath); + ProcessHelper.ffs("codesign", "--force", "--sign", "-", appPath); } } else if (exportPlatform == PConstants.WINDOWS) { @@ -1513,27 +1517,27 @@ public class JavaBuild { XML project = new XML("project"); XML target = project.addChild("target"); target.setString("name", "windows"); - + XML taskdef = target.addChild("taskdef"); taskdef.setString("name", "launch4j"); taskdef.setString("classname", "net.sf.launch4j.ant.Launch4jTask"); String launchPath = mode.getContentFile("application/launch4j").getAbsolutePath(); taskdef.setString("classpath", launchPath + "/launch4j.jar:" + launchPath + "/lib/xstream.jar"); - + XML launch4j = target.addChild("launch4j"); // not all launch4j options are available when embedded inside the ant // build file (i.e. the icon param doesn't work), so use a config file // launch4j.setString("configFile", configFile.getAbsolutePath()); - + XML config = new XML("launch4jConfig"); config.addChild("headerType").setContent("gui"); config.addChild("dontWrapJar").setContent("true"); config.addChild("downloadUrl").setContent("http://java.com/download"); - + File exeFile = new File(destFolder, sketch.getName() + ".exe"); config.addChild("outfile").setContent(exeFile.getAbsolutePath()); - + File iconFile = mode.getContentFile("application/sketch.ico"); config.addChild("icon").setContent(iconFile.getAbsolutePath()); @@ -1550,7 +1554,7 @@ public class JavaBuild { for (String opt : runOptions) { jre.addChild("opt").setContent(opt); } - + /* XML config = launch4j.addChild("config"); config.setString("headerType", "gui"); @@ -1558,10 +1562,10 @@ public class JavaBuild { config.setString("outfile", exeFile.getAbsolutePath()); config.setString("dontWrapJar", "true"); config.setString("jarPath", "lib\\" + jarList[0]); - + File iconFile = mode.getContentFile("application/sketch.ico"); config.addChild("icon").setContent(iconFile.getAbsolutePath()); - + XML clazzPath = config.addChild("classPath"); clazzPath.setString("mainClass", sketch.getName()); for (int i = 1; i < jarList.length; i++) { @@ -1575,11 +1579,11 @@ public class JavaBuild { jre.addChild("opt").setContent(opt); } */ - + config.save(configFile); project.save(buildFile); if (!buildWindowsLauncher(buildFile, "windows")) { - // don't delete the build file, might be useful for debugging + // don't delete the build file, might be useful for debugging return false; } configFile.delete(); @@ -1597,10 +1601,10 @@ public class JavaBuild { // another fix for bug #234, LD_LIBRARY_PATH ignored on some platforms //ps.print("LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$APPDIR\n"); if (embedJava) { - // https://github.com/processing/processing/issues/2349 + // https://github.com/processing/processing/issues/2349 pw.print("$APPDIR/java/bin/"); } - String runOptionsStr = + String runOptionsStr = PApplet.join(runOptions.toArray(new String[0]), " "); pw.print("java " + runOptionsStr + " -Djava.library.path=\"$APPDIR:$APPDIR/lib\"" + @@ -1646,7 +1650,7 @@ public class JavaBuild { } - /** + /** * Run the launch4j build.xml file through ant to create the exe. * Most of this code was lifted from Android mode. */ diff --git a/app/src/processing/mode/java/JavaEditor.java b/app/src/processing/mode/java/JavaEditor.java index 155ef546c..2bdc199da 100644 --- a/app/src/processing/mode/java/JavaEditor.java +++ b/app/src/processing/mode/java/JavaEditor.java @@ -289,6 +289,11 @@ public class JavaEditor extends Editor { } }); + // Only possible to export OS X applications on OS X + if (!Base.isMacOS()) { + // Make sure they don't have a previous 'true' setting for this + Preferences.setBoolean("export.application.platform.macosx", false); + } final JCheckBox macosxButton = new JCheckBox("Mac OS X"); macosxButton.setSelected(Preferences.getBoolean("export.application.platform.macosx")); macosxButton.addItemListener(new ItemListener() { @@ -296,6 +301,10 @@ public class JavaEditor extends Editor { Preferences.setBoolean("export.application.platform.macosx", macosxButton.isSelected()); } }); + if (!Base.isMacOS()) { + macosxButton.setEnabled(false); + macosxButton.setToolTipText("Mac OS X export is only available on Mac OS X"); + } final JCheckBox linuxButton = new JCheckBox("Linux"); //linuxButton.setMnemonic(KeyEvent.VK_L); diff --git a/app/src/processing/mode/java/JavaMode.java b/app/src/processing/mode/java/JavaMode.java index 0753404b5..4515d46d7 100644 --- a/app/src/processing/mode/java/JavaMode.java +++ b/app/src/processing/mode/java/JavaMode.java @@ -46,7 +46,7 @@ public class JavaMode extends Mode { public String getTitle() { - return "Java"; + return "Java (2.0)"; } diff --git a/app/src/processing/mode/java/PdeKeyListener.java b/app/src/processing/mode/java/PdeKeyListener.java index e1acd5fad..c1ba6c30d 100644 --- a/app/src/processing/mode/java/PdeKeyListener.java +++ b/app/src/processing/mode/java/PdeKeyListener.java @@ -194,6 +194,9 @@ public class PdeKeyListener { textarea.setSelectedText(spaces(tabSize)); event.consume(); return true; + } else if (!Preferences.getBoolean("editor.tabs.expand")) { + textarea.setSelectedText("\t"); + event.consume(); } break; diff --git a/app/src/processing/mode/java/runner/Runner.java b/app/src/processing/mode/java/runner/Runner.java index 314e37f0d..4fbf5f8f1 100644 --- a/app/src/processing/mode/java/runner/Runner.java +++ b/app/src/processing/mode/java/runner/Runner.java @@ -63,19 +63,6 @@ public class Runner implements MessageConsumer { // Thread transferring remote output stream to our output stream protected Thread outThread = null; - // Mode for tracing the Trace program (default= 0 off) -// protected int debugTraceMode = 0; - - // Do we want to watch assignments to fields -// protected boolean watchFields = false; - -// // Class patterns for which we don't want events -// protected String[] excludes = { -// "java.*", "javax.*", "sun.*", "com.sun.*", -// "apple.*", -// "processing.*" -// }; - protected SketchException exception; protected Editor editor; protected JavaBuild build; @@ -138,60 +125,6 @@ public class Runner implements MessageConsumer { // Everyone works the same under Java 7 (also on OS X) String[] commandArgs = new String[] { Base.getJavaPath(), jdwpArg }; - /* - String[] commandArgs = null; - if (!Base.isMacOS()) { - commandArgs = new String[] { - Base.getJavaPath(), - jdwpArg - }; - } else { - // Decided to just set this to 1.6 only, because otherwise it's gonna - // be a shitshow if folks are getting Apple's 1.6 with 32-bit and - // Oracle's 1.7 when run in 64-bit mode. ("Why does my sketch suck in - // 64-bit? Why is retina broken?) - // The --request flag will prompt to install Apple's 1.6 JVM if none is - // available. We're specifying 1.6 so that we can get support for both - // 32- and 64-bit, because Oracle won't be releasing Java 1.7 in 32-bit. - // Helpfully, the --request flag is not present on Mac OS X 10.6 - // (luckily it is also not needed, because 1.6 is installed by default) - // but it requires an additional workaround to not use that flag, - // otherwise will see an error about an unsupported option. The flag is - // available with 10.7 and 10.8, the only other supported versions of - // OS X at this point, because we require 10.6.8 and higher. That also - // means we don't need to check for any other OS versions, the user is - // a douchebag and modifies Info.plist to get around the restriction. - if (false) { - if (System.getProperty("os.version").startsWith("10.6")) { - commandArgs = new String[] { - "/usr/libexec/java_home", - "--version", "1.6", - "--exec", "java", - "-d" + Base.getNativeBits(), - jdwpArg - }; - } else { // for 10.7, 10.8, etc - commandArgs = new String[] { - "/usr/libexec/java_home", - "--request", // install on-demand - "--version", "1.6", - "--exec", "java", - "-d" + Base.getNativeBits(), -// debugArg, - jdwpArg - }; - } - } else { - // testing jdk-7u40 - commandArgs = new String[] { - //"/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/bin/java", - Base.getJavaPath(), - jdwpArg - }; - } - } - */ - commandArgs = PApplet.concat(commandArgs, vmParams); commandArgs = PApplet.concat(commandArgs, sketchParams); // PApplet.println(commandArgs); @@ -482,153 +415,6 @@ public class Runner implements MessageConsumer { } - /* - protected VirtualMachine launchVirtualMachine(String[] vmParams, - String[] classParams) { - //vm = launchTarget(sb.toString()); - LaunchingConnector connector = (LaunchingConnector) - findConnector("com.sun.jdi.RawCommandLineLaunch"); - //PApplet.println(connector); // gets the defaults - - //Map arguments = connectorArguments(connector, mainArgs); - Map arguments = connector.defaultArguments(); - - Connector.Argument commandArg = - (Connector.Argument)arguments.get("command"); - // Using localhost instead of 127.0.0.1 sometimes causes a - // "Transport Error 202" error message when trying to run. - // http://dev.processing.org/bugs/show_bug.cgi?id=895 - // String addr = "127.0.0.1:" + (8000 + (int) (Math.random() * 1000)); - //String addr = "localhost:" + (8000 + (int) (Math.random() * 1000)); - // Better yet, host is not needed, so using just the port for the address - String addr = "" + (8000 + (int) (Math.random() * 1000)); - - String commandArgs = - "java -Xrunjdwp:transport=dt_socket,address=" + addr + ",suspend=y "; - if (Base.isMacOS()) { - // Decided to just set this to 1.6 only, because otherwise it's gonna - // be a shitshow if folks are getting Apple's 1.6 with 32-bit and - // Oracle's 1.7 when run in 64-bit mode. ("Why does my sketch suck in - // 64-bit? Why is retina broken?) - // The --request flag will prompt to install Apple's 1.6 JVM if none is - // available. We're specifying 1.6 so that we can get support for both - // 32- and 64-bit, because Oracle won't be releasing Java 1.7 in 32-bit. - // Helpfully, the --request flag is not present on Mac OS X 10.6 - // (luckily it is also not needed, because 1.6 is installed by default) - // but it requires an additional workaround to not use that flag, - // otherwise will see an error about an unsupported option. The flag is - // available with 10.7 and 10.8, the only other supported versions of - // OS X at this point, because we require 10.6.8 and higher. That also - // means we don't need to check for any other OS versions, unless - // is a douchebag and modifies Info.plist to get around the restriction. - addr = "" + (8000 + (int) (Math.random() * 1000)); - commandArgs = - "/usr/libexec/java_home " + - (System.getProperty("os.version").startsWith("10.6") ? "" : "--request ") + - "--version 1.6 " + - "--exec java " + - "-d" + Base.getNativeBits() + " " + - "-Xrunjdwp:transport=dt_socket,address=" + addr + ",suspend=y "; - } - - for (int i = 0; i < vmParams.length; i++) { - commandArgs = addArgument(commandArgs, vmParams[i], ' '); - } - if (classParams != null) { - for (int i = 0; i < classParams.length; i++) { - commandArgs = addArgument(commandArgs, classParams[i], ' '); - } - } - System.out.println("commandArgs is " + commandArgs); - commandArg.setValue(commandArgs); - - Connector.Argument addressArg = - (Connector.Argument)arguments.get("address"); - addressArg.setValue(addr); - - //PApplet.println(connector); // prints the current - //com.sun.tools.jdi.AbstractLauncher al; - //com.sun.tools.jdi.RawCommandLineLauncher rcll; - - //System.out.println(PApplet.javaVersion); - // http://java.sun.com/j2se/1.5.0/docs/guide/jpda/conninv.html#sunlaunch - try { - return connector.launch(arguments); - } catch (IOException exc) { - throw new Error("Unable to launch target VM: " + exc); - } catch (IllegalConnectorArgumentsException exc) { - throw new Error("Internal error: " + exc); - } catch (VMStartException exc) { - Process p = exc.process(); - //System.out.println(p); - String[] errorStrings = PApplet.loadStrings(p.getErrorStream()); - //String[] inputStrings = - PApplet.loadStrings(p.getInputStream()); - - if (errorStrings != null && errorStrings.length > 1) { - if (errorStrings[0].indexOf("Invalid maximum heap size") != -1) { - Base.showWarning("Way Too High", - "Please lower the value for \u201Cmaximum available memory\u201D in the\n" + - "Preferences window. For more information, read Help \u2192 Troubleshooting.", - exc); - } else { - PApplet.println(errorStrings); - System.err.println("Using startup command:"); - PApplet.println(arguments); - } - } else { - exc.printStackTrace(); - System.err.println("Could not run the sketch (Target VM failed to initialize)."); - if (Preferences.getBoolean("run.options.memory")) { - // Only mention this if they've even altered the memory setup - System.err.println("Make sure that you haven't set the maximum available memory too high."); - } - System.err.println("For more information, read revisions.txt and Help \u2192 Troubleshooting."); - } - // changing this to separate editor and listener [091124] - //if (editor != null) { - listener.statusError("Could not run the sketch."); - //} - return null; - } - } - - - private static boolean hasWhitespace(String string) { - int length = string.length(); - for (int i = 0; i < length; i++) { - if (Character.isWhitespace(string.charAt(i))) { - return true; - } - } - return false; - } - - - private static String addArgument(String string, String argument, char sep) { - if (hasWhitespace(argument) || argument.indexOf(',') != -1) { - // Quotes were stripped out for this argument, add 'em back. - StringBuffer buffer = new StringBuffer(string); - buffer.append('"'); - for (int i = 0; i < argument.length(); i++) { - char c = argument.charAt(i); - if (c == '"') { - buffer.append('\\'); -// buffer.append("\\\\"); - } - buffer.append(c); - } - buffer.append('"'); - buffer.append(sep); - return buffer.toString(); - - } else { - return string + argument + String.valueOf(sep); - } - } - */ - - /** * Generate the trace. * Enable events, start thread to display events, @@ -639,9 +425,6 @@ public class Runner implements MessageConsumer { //vm.setDebugTraceMode(debugTraceMode); // vm.setDebugTraceMode(VirtualMachine.TRACE_ALL); // vm.setDebugTraceMode(VirtualMachine.TRACE_NONE); // formerly, seems to have no effect - - // For internal debugging - PrintWriter writer = null; // Calling this seems to set something internally to make the // Eclipse JDI wake up. Without it, an ObjectCollectedException @@ -735,7 +518,6 @@ public class Runner implements MessageConsumer { // we don't interrupt } //System.out.println("and leaving"); - if (writer != null) writer.close(); } diff --git a/build/build.xml b/build/build.xml index 4d0f0b233..808195bde 100755 --- a/build/build.xml +++ b/build/build.xml @@ -14,7 +14,7 @@ - + @@ -31,6 +31,9 @@ + + @@ -151,21 +154,21 @@ - + + message="JDK 7u${jdk.update.macosx} required.${line.separator}To build on OS X, you must install Oracle's JDK 7u${jdk.update.macosx} from${line.separator}http://www.oracle.com/technetwork/java/javase/downloads${line.separator}Note that only 7u${jdk.update.macosx} (not a later or earlier version) will work. ${line.separator}And it must be the JDK, not the JRE. And do not try to defy me again." /> - + + value="macosx/work/Processing.app/Contents/Java"> @@ -201,10 +204,14 @@ + description="Build Processing for distribution."> + addproperty="version" + defaultvalue="${revision}" /> + + + + @@ -226,8 +233,12 @@ - + + + + + @@ -237,8 +248,9 @@ - + + @@ -248,7 +260,7 @@ + message="Do not call assemble from the command line." /> @@ -257,34 +269,33 @@ - - - - - + + - - + + - - - + + + + + src="../java/reference.zip" + overwrite="false"> - - + + - + + + + + + + @@ -303,39 +314,39 @@ - - - - - - + + + + + + + property="revision.base"> - - - - - + + + + + + LF in revision.base. Please file a bug if you have a fix. --> + if $revision wasn't found... --> + message="Fix revision number in Base.java" /> @@ -369,25 +380,25 @@ + name="Processing" + displayName="Processing" + executableName="Processing" + identifier="org.processing.app" + signature="Pde2" + icon="macosx/processing.icns" + copyright="© The Processing Foundation" + getInfo="${version}, Copyright © The Processing Foundation" + shortVersion="${version}" + version="${revision}" + mainClassName="processing.app.Base"> + it's primarily copying over the JRE folder. --> + the .tgz on the Oracle site, though it's in a folder called + jre1.7.0_40.jre, so we'll need to strip that out. --> @@ -411,9 +422,9 @@ + icon="macosx/pde.icns" + name="Processing Source Code" + role="Editor"> @@ -425,8 +436,9 @@ + + - + @@ -475,33 +487,30 @@ + value="macosx/work/Processing.app/Contents/Java" /> + tofile="${launch4j.dir}/bin/windres" /> + tofile="${launch4j.dir}/bin/ld" /> - + - - - + description="Run Mac OS X version"> @@ -537,8 +546,8 @@ + depends="macosx-build" + description="Create a downloadable .zip for the Mac OS X version"> @@ -546,9 +555,9 @@ @@ -593,7 +602,7 @@ - + @@ -606,16 +615,16 @@ + tofile="${launch4j.dir}/bin/windres" /> + tofile="${launch4j.dir}/bin/ld" /> - + @@ -623,10 +632,6 @@ - - - - @@ -637,19 +642,19 @@ + dest="linux/jre.tgz" + usetimestamp="true" /> - - + @@ -692,12 +697,12 @@ + description="Run Linux version"> + description="Build .tar.gz of linux version"> + description="Clean windows version"> @@ -753,8 +758,8 @@ + depends="revision-check, windows-checkos, subprojects-build" + description="Build windows version"> @@ -766,7 +771,7 @@ - + @@ -781,32 +786,22 @@ + tofile="${launch4j.dir}/bin/windres.exe" /> + tofile="${launch4j.dir}/bin/ld.exe" /> - + - - - - - - - - - - + classname="net.sf.launch4j.ant.Launch4jTask" + classpath="${launch4j.dir}/launch4j.jar; ${launch4j.dir}/lib/xstream.jar" /> + file (i.e. the icon param doesn't work), so use a config file --> @@ -817,22 +812,22 @@ + dest="windows/jre.tgz" + usetimestamp="true" /> + since those shouldn't matter on Windows. --> + dest="windows/work" + src="windows/jre.tgz" + overwrite="false" /> - + @@ -844,36 +839,36 @@ + description="Run windows version"> + dir="windows/work" spawn="true"/> + description="Create .zip files of windows version"> + prefix="processing-${version}" /> @@ -916,23 +911,23 @@ remove the spaces for depth since it should be double dash, but screws up commen + also suppresses the java.lang prefix in the text. --> - + @@ -947,25 +942,27 @@ remove the spaces for depth since it should be double dash, but screws up commen - - + + - + - - + + @@ -1005,7 +1002,7 @@ remove the spaces for depth since it should be double dash, but screws up commen + depends="linux-clean, windows-clean, macosx-clean, subprojects-clean"> diff --git a/build/linux/processing b/build/linux/processing index eedceaa5f..51cf37848 100755 --- a/build/linux/processing +++ b/build/linux/processing @@ -103,7 +103,7 @@ cmd_name='processing-java' if [ $current_name = $cmd_name ] then - java -Djna.nosys=true processing.mode.java.Commander "$@" + java -Djna.nosys=true -Xmx256m processing.mode.java.Commander "$@" exit $? else # Start Processing in the same directory as this script @@ -114,5 +114,5 @@ else fi cd "$APPDIR" - java -Djna.nosys=true processing.app.Base "$SKETCH" & + java -Djna.nosys=true -Xmx256m processing.app.Base "$SKETCH" & fi diff --git a/build/macosx/jAppleMenuBar.url b/build/macosx/jAppleMenuBar.url deleted file mode 100644 index 62dc0f635..000000000 --- a/build/macosx/jAppleMenuBar.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=https://github.com/kritzikratzi/jAppleMenuBar diff --git a/build/shared/lib/defaults.txt b/build/shared/lib/defaults.txt index 5e0039b4d..ea9c388d2 100644 --- a/build/shared/lib/defaults.txt +++ b/build/shared/lib/defaults.txt @@ -339,3 +339,14 @@ run.present.stop.color = #cccccc #proxy.port=8080 proxy.host= proxy.port= + +# PDE X +pdex.autoSave.autoSaveByDefault=true +pdex.autoSave.autoSaveEnabled=false +pdex.autoSave.promptDisplay=true +pdex.autoSaveInterval=5 +pdex.ccEnabled=true +pdex.dbgOutput=false +pdex.errorCheckEnabled=true +pdex.warningsEnabled=true +pdex.writeErrorLogs=false \ No newline at end of file diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index 4b6516220..d76ae25ee 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -1,3 +1,146 @@ +PROCESSING 3.0a2 (REV 0229) - ?? August 2014 + + +[ fixes ] + ++ The Examples weren't included in 3.0a1. Oops. + https://github.com/processing/processing/issues/2652 + + +[ changes ] + ++ Added a new sketchbook location, so that you can have separate sketchbooks + with 2.0 and 3.0 releases. The downside is that they won't stay in sync, + but the upside is that sketches that haven't been updated, or conflicting + Libraries, Modes, or Tools won't cause trouble with the other version. + The new preference is called sketchbook.location.three (the old preference + was sketchbook.location). If you already have a 2.0 sketchbook, that will + be used by default with 3.0 until you change it in the Preferences window. + ++ Neglected to mention with the previous release that the video library has + been removed from the default download. This decreases the size of the + Processing download by about 20%. In addition, it was only the video + library for the platform being downloaded, and with the return of cross- + platform application export, that could cause sadness. To use the video + library, use the "Add Library..." menu and select it from the list. + + +. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + + +PROCESSING 3.0a1 (REV 0228) - 26 July 2014 + +Kicking off the 3.0 release process. The focus for Processing 3 is improving +the editor and the coding process, so we'll be integrating what was formerly +PDE X as the main editor. + +This release also includes a number of bug fixes and changes, based on +in-progress Google Summer of Code projects and a few helpful souls on Github. + +Please contribute to the Processing 3 release by testing and reporting bugs. +Or better yet, helping us fix them and submitting pull requests. + + +[ contributed fixes! ] + ++ Fix blendMode() problems in the default renderer (thanks Jakub Valtar!) + https://github.com/processing/processing/issues/2012 + https://github.com/processing/processing/issues/2275 + https://github.com/processing/processing/issues/2276 + https://github.com/processing/processing/issues/2483 + ++ Lighting issues with non-planar triangle strips or quad strips + https://github.com/processing/processing/issues/2014 + https://github.com/processing/processing/issues/2018 + https://github.com/processing/processing/pull/2644 + ++ Set the application name on Linux + https://github.com/processing/processing/issues/2534 + https://github.com/processing/processing/pull/2584 + ++ Serial library not working on export + https://github.com/processing/processing/issues/2559 + ++ Fix build problems on Windows + https://github.com/processing/processing/issues/2603 + https://github.com/processing/processing/pull/2610 + ++ filter() not applying to images produced by saveframe() consistently + https://github.com/processing/processing/issues/2619 + ++ drawLatch in PJOGL can be null after requesting frame rendering + https://github.com/processing/processing/issues/2630 + + +[ summer of code ] + ++ Line coloring incorrect for filtered contribution listings + https://github.com/processing/processing/issues/2583 + https://github.com/processing/processing/pull/2598 + ++ Added Present's background color as an option to the Preferences window + https://github.com/processing/processing/pull/2568 + ++ Check for updates on startup + https://github.com/processing/processing/pull/2636 + ++ Avoid problems with out-of-date contribution list + https://github.com/processing/processing/issues/2572 + ++ Integrate tweak mode into the new editor + https://github.com/processing/processing/pull/2624 + ++ Implementation of a list of open sketches in the Sketch menu + https://github.com/processing/processing/pull/2551 + ++ Add preference to set the present color + https://github.com/processing/processing/pull/2568 + ++ Fix a problem where mode menu selection would change even if + the change was canceled due to the sketch being modified + https://github.com/processing/processing/issues/2615 + ++ Add date and time stamps to the Contribution Manager + https://github.com/processing/processing/pull/2651 + + +[ more bug fixes ] + ++ Prevent the current Mode from being de-selected + https://github.com/processing/processing/issues/2545 + ++ Prevent ArrayIndexOutOfBoundsException when calling min/maxValue() + on a FloatDict that only contains NaN values + ++ Last row was being skipped on tables with the 'newlines' option set + ++ Debug table parsing with header rows + ++ Bug fix for setting Table data types + ++ Fixes for new Table(Iterable). Category data types were not importing + their dictionary, column titles weren't set, and performance improvements + were badly needed. + ++ When using setColumnType(), replace nulls with missingInt, missingFloat, etc + Formerly, this was throwing a NullPointerException. + + +[ changes ] + ++ A new sound library has been added, and Minim has been removed. Minim + will now available via the Contributions Manager. + ++ Add copy() method to PVector + ++ Major performance improvements to parsing w/ the 'newlines' option + ++ add getColumnTitle(int) and getColumnTitles() to TableRow interface + + +. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + + PROCESSING 2.2.1 (REV 0227) - 19 May 2014 A handful of bug fixes, the most prominent rolls back a change that broke diff --git a/build/windows/config-cmd.xml b/build/windows/config-cmd.xml index 44c7b4aa7..607d545c5 100755 --- a/build/windows/config-cmd.xml +++ b/build/windows/config-cmd.xml @@ -34,6 +34,8 @@ -Djna.nosys=true 1.7.0_40 + + 256 An error occurred while starting the application. diff --git a/build/windows/config.xml b/build/windows/config.xml index 4a3e91c5c..1ff09ff00 100755 --- a/build/windows/config.xml +++ b/build/windows/config.xml @@ -34,6 +34,8 @@ -Djna.nosys=true 1.7.0_40 + + 256 about.bmp diff --git a/core/.settings/org.eclipse.jdt.core.prefs b/core/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 8e54f4641..000000000 --- a/core/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,381 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled -org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore -org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault -org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable -org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=ignore -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=disabled -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning -org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore -org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=18 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=18 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=18 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=36 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=18 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=18 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=1 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=false -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=80 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=1 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=2 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=80 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=2 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/core/build.xml b/core/build.xml index 8bb8b3a2c..3d24eae76 100755 --- a/core/build.xml +++ b/core/build.xml @@ -38,8 +38,10 @@ + diff --git a/core/done.txt b/core/done.txt index 694933b4b..007c32e8b 100644 --- a/core/done.txt +++ b/core/done.txt @@ -1,3 +1,41 @@ +0228 core (3.0a1) +X add copy() method to PVector +X modify PVector to include better methods for chaining operations +X http://code.google.com/p/processing/issues/detail?id=218 +X https://github.com/processing/processing/issues/257 +X PVector discussion with Dan +o Jer and Dan will look at their code, plus toxiclibs +X blendMode() broken with default renderer +X fix from Jakub Valtar +X https://github.com/processing/processing/issues/2012 +X may have been introduced between 2.0b7 and 2.0b8 +X https://github.com/processing/processing/issues/2275 +X https://github.com/processing/processing/issues/2276 +X https://github.com/processing/processing/issues/2483 +X if all data is NaN in a FloatDict, return NaN for maxValue() and minValue() +X formerly as AIOOBE -1 because -1 means "not found" +X but that was indexing directly into the data array + +pulls +X filter() not applying to images produced by saveframe() consistently +X https://github.com/processing/processing/issues/2619 +X drawLatch in PJOGL can be null after requesting frame rendering +X https://github.com/processing/processing/issues/2630 + +table +X major performance improvements to 'newlines' parsing +X last row was being skipped on tables with the 'newlines' option set +X debug table parsing with header rows +X bug fix for setting data types +X add getColumnTitle(int) and getColumnTitles() to TableRow interface +X fixes for new Table(Iterable) +X category data types were not importing their dictionary +X column titles weren't set on the new table +X drastic performance improvements for addRow() +X when using setColumnType(), replace nulls with missingInt, missingFloat, etc +X formerly, was throwing a NullPointerException + + 0227 core (2.2.1) X Permit mouse PRESS to set mouseX/mouseY X https://github.com/processing/processing/pull/2509 diff --git a/core/src/japplemenubar/JAppleMenuBar.java b/core/src/japplemenubar/JAppleMenuBar.java deleted file mode 100755 index 148eed94d..000000000 --- a/core/src/japplemenubar/JAppleMenuBar.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2011-12 hansi raber, released under LGPL under agreement - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, version 2.1. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ -package japplemenubar; - -import java.io.*; - -import processing.core.PApplet; - - -/** - * Starting point for the application. General initialization should be done - * inside the ApplicationController's init() method. If certain kinds of - * non-Swing initialization takes too long, it should happen in a new Thread - * and off the Swing event dispatch thread (EDT). - * - * @author hansi - */ -public class JAppleMenuBar { - static JAppleMenuBar instance; - static final String FILENAME = "libjAppleMenuBar.jnilib"; - - static { - try { - File temp = File.createTempFile("processing", "menubar"); - temp.delete(); // remove the file itself - temp.mkdirs(); // create a directory out of it - temp.deleteOnExit(); - - File jnilibFile = new File(temp, FILENAME); - InputStream input = JAppleMenuBar.class.getResourceAsStream(FILENAME); - if (input != null) { - if (PApplet.saveStream(jnilibFile, input)) { - System.load(jnilibFile.getAbsolutePath()); - instance = new JAppleMenuBar(); - - } else { - sadness("Problem saving " + FILENAME + " for full screen use."); - } - } else { - sadness("Could not load " + FILENAME + " from core.jar"); - } - } catch (IOException e) { - sadness("Unknown error, here's the stack trace."); - e.printStackTrace(); - } - } - - - static void sadness(String msg) { - System.err.println("Full screen mode disabled. " + msg); - } - - -// static public void show() { -// instance.setVisible(true); -// } - - - static public void hide() { - instance.setVisible(false, false); - } - - - public native void setVisible(boolean visibility, boolean kioskMode); - - -// public void setVisible(boolean visibility) { -// // Keep original API in-tact. Default kiosk-mode to off. -// setVisible(visibility, false); -// } -} diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 110814425..0cb8b3a66 100755 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -10410,25 +10410,6 @@ public class PApplet extends Applet } -// /** -// * GIF image of the Processing logo. -// */ -// static public final byte[] ICON_IMAGE = { -// 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -77, 0, 0, 0, 0, 0, -1, -1, -1, 12, -// 12, 13, -15, -15, -14, 45, 57, 74, 54, 80, 111, 47, 71, 97, 62, 88, 117, -// 1, 14, 27, 7, 41, 73, 15, 52, 85, 2, 31, 55, 4, 54, 94, 18, 69, 109, 37, -// 87, 126, -1, -1, -1, 33, -7, 4, 1, 0, 0, 15, 0, 44, 0, 0, 0, 0, 16, 0, 16, -// 0, 0, 4, 122, -16, -107, 114, -86, -67, 83, 30, -42, 26, -17, -100, -45, -// 56, -57, -108, 48, 40, 122, -90, 104, 67, -91, -51, 32, -53, 77, -78, -100, -// 47, -86, 12, 76, -110, -20, -74, -101, 97, -93, 27, 40, 20, -65, 65, 48, -// -111, 99, -20, -112, -117, -123, -47, -105, 24, 114, -112, 74, 69, 84, 25, -// 93, 88, -75, 9, 46, 2, 49, 88, -116, -67, 7, -19, -83, 60, 38, 3, -34, 2, -// 66, -95, 27, -98, 13, 4, -17, 55, 33, 109, 11, 11, -2, -128, 121, 123, 62, -// 91, 120, -128, 127, 122, 115, 102, 2, 119, 0, -116, -113, -119, 6, 102, -// 121, -108, -126, 5, 18, 6, 4, -102, -101, -100, 114, 15, 17, 0, 59 -// }; - - static ArrayList iconImages; protected void setIconImage(Frame frame) { @@ -10457,18 +10438,46 @@ public class PApplet extends Applet } - // Not gonna do this dynamically, only on startup. Too much headache. -// public void fullscreen() { -// if (frame != null) { -// if (PApplet.platform == MACOSX) { -// japplemenubar.JAppleMenuBar.hide(); -// } -// GraphicsConfiguration gc = frame.getGraphicsConfiguration(); -// Rectangle rect = gc.getBounds(); -//// GraphicsDevice device = gc.getDevice(); -// frame.setBounds(rect.x, rect.y, rect.width, rect.height); -// } -// } + /** + * Use reflection to call + * com.apple.eawt.FullScreenUtilities.setWindowCanFullScreen(window, true); + */ + static private void macosxFullScreenEnable(Window window) { + try { + Class util = Class.forName("com.apple.eawt.FullScreenUtilities"); + Class params[] = new Class[] { Window.class, Boolean.TYPE }; + Method method = util.getMethod("setWindowCanFullScreen", params); + method.invoke(util, window, true); + + } catch (ClassNotFoundException cnfe) { + // ignored + } catch (Exception e) { + e.printStackTrace(); + } + } + + + /** + * Use reflection to call + * com.apple.eawt.Application.getApplication().requestToggleFullScreen(window); + */ + static private void macosxFullScreenToggle(Window window) { + try { + Class appClass = Class.forName("com.apple.eawt.Application"); + + Method getAppMethod = appClass.getMethod("getApplication"); + Object app = getAppMethod.invoke(null, new Object[0]); + + Method requestMethod = + appClass.getMethod("requestToggleFullScreen", Window.class); + requestMethod.invoke(app, window); + + } catch (ClassNotFoundException cnfe) { + // ignored + } catch (Exception e) { + e.printStackTrace(); + } + } /** @@ -10868,11 +10877,21 @@ public class PApplet extends Applet // // or cmd/ctrl-shift-R in the PDE. if (present) { - if (platform == MACOSX) { - // Call some native code to remove the menu bar on OS X. Not necessary - // on Linux and Windows, who are happy to make full screen windows. - japplemenubar.JAppleMenuBar.hide(); - } +// if (platform == MACOSX) { +// println("before"); +// println(screenRect); +// println(frame.getBounds()); +// +// // Call some native code to remove the menu bar on OS X. Not necessary +// // on Linux and Windows, who are happy to make full screen windows. +//// japplemenubar.JAppleMenuBar.hide(); +// toggleFullScreen(frame); +// println("after"); +// println(screenRect); +// println(frame.getBounds()); +// +// println(applet.width + " " + applet.height); +// } // After the pack(), the screen bounds are gonna be 0s frame.setBounds(screenRect); @@ -10880,6 +10899,17 @@ public class PApplet extends Applet (screenRect.height - applet.height) / 2, applet.width, applet.height); + if (platform == MACOSX) { + macosxFullScreenEnable(frame); + macosxFullScreenToggle(frame); + +// toggleFullScreen(frame); +// println("after"); +// println(screenRect); +// println(frame.getBounds()); +// println(applet.width + " " + applet.height); + } + if (!hideStop) { Label label = new Label("stop"); label.setForeground(stopColor); @@ -13149,9 +13179,9 @@ public class PApplet extends Applet * @param x x-coordinate of text * @param y y-coordinate of text * @see PGraphics#textAlign(int, int) - * @see PGraphics#textMode(int) - * @see PApplet#loadFont(String) * @see PGraphics#textFont(PFont) + * @see PGraphics#textMode(int) + * @see PGraphics#textSize(float) * @see PGraphics#rectMode(int) * @see PGraphics#fill(int, float) * @see_external String @@ -13290,6 +13320,7 @@ public class PApplet extends Applet * @webref transform * @see PGraphics#popMatrix() * @see PGraphics#translate(float, float, float) + * @see PGraphics#scale(float) * @see PGraphics#rotate(float) * @see PGraphics#rotateX(float) * @see PGraphics#rotateY(float) diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index 517527102..7d950eecc 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -2664,8 +2664,8 @@ public class PGraphics extends PImage implements PConstants { } if (stop - start > TWO_PI) { - start = 0; - stop = TWO_PI; + // don't change start, it is visible in PIE mode + stop = start + TWO_PI; } arcImpl(x, y, w, h, start, stop, mode); } @@ -4234,9 +4234,9 @@ public class PGraphics extends PImage implements PConstants { * @param x x-coordinate of text * @param y y-coordinate of text * @see PGraphics#textAlign(int, int) - * @see PGraphics#textMode(int) - * @see PApplet#loadFont(String) * @see PGraphics#textFont(PFont) + * @see PGraphics#textMode(int) + * @see PGraphics#textSize(float) * @see PGraphics#rectMode(int) * @see PGraphics#fill(int, float) * @see_external String @@ -4808,6 +4808,7 @@ public class PGraphics extends PImage implements PConstants { * @webref transform * @see PGraphics#popMatrix() * @see PGraphics#translate(float, float, float) + * @see PGraphics#scale(float) * @see PGraphics#rotate(float) * @see PGraphics#rotateX(float) * @see PGraphics#rotateY(float) diff --git a/core/src/processing/core/PGraphicsJava2D.java b/core/src/processing/core/PGraphicsJava2D.java index 4b43c7e90..af906a6dd 100644 --- a/core/src/processing/core/PGraphicsJava2D.java +++ b/core/src/processing/core/PGraphicsJava2D.java @@ -743,11 +743,14 @@ public class PGraphicsJava2D extends PGraphics { int[] srcPixels = new int[width]; int[] dstPixels = new int[width]; + // Java won't set the high bits when RGB, returns 0 for alpha + int alphaFiller = (dstIn.getNumBands() == 3) ? (0xFF << 24) : 0x00; + for (int y = 0; y < height; y++) { src.getDataElements(0, y, width, 1, srcPixels); dstIn.getDataElements(0, y, width, 1, dstPixels); for (int x = 0; x < width; x++) { - dstPixels[x] = blendColor(srcPixels[x], dstPixels[x], mode); + dstPixels[x] = blendColor(srcPixels[x], alphaFiller | dstPixels[x], mode); } dstOut.setDataElements(0, y, width, 1, dstPixels); } @@ -1298,6 +1301,12 @@ public class PGraphicsJava2D extends PGraphics { } if (who.modified) { + if (who.pixels == null) { + // This might be a PGraphics that hasn't been drawn to yet. + // Can't just bail because the cache has been created above. + // https://github.com/processing/processing/issues/2208 + who.pixels = new int[who.width * who.height]; + } cash.update(who, tint, tintColor); who.modified = false; } @@ -1671,7 +1680,7 @@ public class PGraphicsJava2D extends PGraphics { if (textFont == null) { defaultFontOrDeath("textWidth"); } - + Font font = (Font) textFont.getNative(); //if (font != null && (textFont.isStream() || hints[ENABLE_NATIVE_FONTS])) { if (font != null) { diff --git a/core/src/processing/core/PImage.java b/core/src/processing/core/PImage.java index 430d67228..94be0a2e2 100644 --- a/core/src/processing/core/PImage.java +++ b/core/src/processing/core/PImage.java @@ -283,10 +283,14 @@ public class PImage implements PConstants, Cloneable { width = bi.getWidth(); height = bi.getHeight(); pixels = new int[width * height]; - WritableRaster raster = bi.getRaster(); - raster.getDataElements(0, 0, width, height, pixels); - if (bi.getType() == BufferedImage.TYPE_INT_ARGB) { + pixels = ((DataBufferInt) bi.getRaster().getDataBuffer()).getData(); + int type = bi.getType(); + if (type == BufferedImage.TYPE_INT_ARGB) { format = ARGB; + } else if (type == BufferedImage.TYPE_INT_RGB) { + for (int i = 0; i < pixels.length; i++) { + pixels[i] = 0xFF000000 | pixels[i]; + } } } else { // go the old school java 1.0 route diff --git a/core/src/processing/core/PShape.java b/core/src/processing/core/PShape.java index 8420f72f6..d0db5006b 100644 --- a/core/src/processing/core/PShape.java +++ b/core/src/processing/core/PShape.java @@ -2065,7 +2065,12 @@ public class PShape implements PConstants { vertices[index][X] = vec.x; vertices[index][Y] = vec.y; - vertices[index][Z] = vec.z; + + if (vertices[index].length > 2) { + vertices[index][Z] = vec.z; + } else if (vec.z != 0 && vec.z == vec.z) { + throw new IllegalArgumentException("Cannot set a z-coordinate on a 2D shape"); + } } diff --git a/core/src/processing/core/PShapeSVG.java b/core/src/processing/core/PShapeSVG.java index 7bac4fb62..aa18b6ed0 100644 --- a/core/src/processing/core/PShapeSVG.java +++ b/core/src/processing/core/PShapeSVG.java @@ -518,7 +518,7 @@ public class PShapeSVG extends PShape { c == 'S' || c == 's' || c == 'Q' || c == 'q' || // quadratic beziers c == 'T' || c == 't' || -// c == 'A' || c == 'a' || // elliptical arc + c == 'A' || c == 'a' || // elliptical arc c == 'Z' || c == 'z' || // closepath c == ',') { separate = true; @@ -816,6 +816,40 @@ public class PShapeSVG extends PShape { } break; + // A - elliptical arc to (absolute) + case 'A': { + float rx = PApplet.parseFloat(pathTokens[i + 1]); + float ry = PApplet.parseFloat(pathTokens[i + 2]); + float angle = PApplet.parseFloat(pathTokens[i + 3]); + boolean fa = PApplet.parseFloat(pathTokens[i + 4]) != 0; + boolean fs = PApplet.parseFloat(pathTokens[i + 5]) != 0; + float endX = PApplet.parseFloat(pathTokens[i + 6]); + float endY = PApplet.parseFloat(pathTokens[i + 7]); + parsePathArcto(cx, cy, rx, ry, angle, fa, fs, endX, endY); + cx = endX; + cy = endY; + i += 8; + prevCurve = true; + } + break; + + // a - elliptical arc to (relative) + case 'a': { + float rx = PApplet.parseFloat(pathTokens[i + 1]); + float ry = PApplet.parseFloat(pathTokens[i + 2]); + float angle = PApplet.parseFloat(pathTokens[i + 3]); + boolean fa = PApplet.parseFloat(pathTokens[i + 4]) != 0; + boolean fs = PApplet.parseFloat(pathTokens[i + 5]) != 0; + float endX = cx + PApplet.parseFloat(pathTokens[i + 6]); + float endY = cy + PApplet.parseFloat(pathTokens[i + 7]); + parsePathArcto(cx, cy, rx, ry, angle, fa, fs, endX, endY); + cx = endX; + cy = endY; + i += 8; + prevCurve = true; + } + break; + case 'Z': case 'z': // since closing the path, the 'current' point needs @@ -924,6 +958,93 @@ public class PShapeSVG extends PShape { } + // Approximates elliptical arc by several bezier segments. + // Meets SVG standard requirements from: + // http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands + // http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes + // Based on arc to bezier curve equations from: + // http://www.spaceroots.org/documents/ellipse/node22.html + private void parsePathArcto(float x1, float y1, + float rx, float ry, + float angle, + boolean fa, boolean fs, + float x2, float y2) { + if (x1 == x2 && y1 == y2) return; + if (rx == 0 || ry == 0) { parsePathLineto(x2, y2); return; } + + rx = PApplet.abs(rx); ry = PApplet.abs(ry); + + float phi = PApplet.radians(((angle % 360) + 360) % 360); + float cosPhi = PApplet.cos(phi), sinPhi = PApplet.sin(phi); + + float x1r = ( cosPhi * (x1 - x2) + sinPhi * (y1 - y2)) / 2; + float y1r = (-sinPhi * (x1 - x2) + cosPhi * (y1 - y2)) / 2; + + float cxr, cyr; + { + float A = (x1r*x1r) / (rx*rx) + (y1r*y1r) / (ry*ry); + if (A > 1) { + // No solution, scale ellipse up according to SVG standard + float sqrtA = PApplet.sqrt(A); + rx *= sqrtA; cxr = 0; + ry *= sqrtA; cyr = 0; + } else { + float k = ((fa == fs) ? -1f : 1f) * + PApplet.sqrt((rx*rx * ry*ry) / ((rx*rx * y1r*y1r) + (ry*ry * x1r*x1r)) - 1f); + cxr = k * rx * y1r / ry; + cyr = -k * ry * x1r / rx; + } + } + + float cx = cosPhi * cxr - sinPhi * cyr + (x1 + x2) / 2; + float cy = sinPhi * cxr + cosPhi * cyr + (y1 + y2) / 2; + + float phi1, phiDelta; + { + float sx = ( x1r - cxr) / rx, sy = ( y1r - cyr) / ry; + float tx = (-x1r - cxr) / rx, ty = (-y1r - cyr) / ry; + phi1 = PApplet.atan2(sy, sx); + phiDelta = (((PApplet.atan2(ty, tx) - phi1) % TWO_PI) + TWO_PI) % TWO_PI; + if (!fs) phiDelta -= TWO_PI; + } + + // One segment can not cover more that PI, less than PI/2 is + // recommended to avoid visible inaccuracies caused by rounding errors + int segmentCount = PApplet.ceil(PApplet.abs(phiDelta) / TWO_PI * 4); + + float inc = phiDelta / segmentCount; + float a = PApplet.sin(inc) * + (PApplet.sqrt(4 + 3 * PApplet.sq(PApplet.tan(inc / 2))) - 1) / 3; + + float sinPhi1 = PApplet.sin(phi1), cosPhi1 = PApplet.cos(phi1); + + float p1x = x1; + float p1y = y1; + float relq1x = a * (-rx * cosPhi * sinPhi1 - ry * sinPhi * cosPhi1); + float relq1y = a * (-rx * sinPhi * sinPhi1 + ry * cosPhi * cosPhi1); + + for (int i = 0; i < segmentCount; i++) { + float eta = phi1 + (i + 1) * inc; + float sinEta = PApplet.sin(eta), cosEta = PApplet.cos(eta); + + float p2x = cx + rx * cosPhi * cosEta - ry * sinPhi * sinEta; + float p2y = cy + rx * sinPhi * cosEta + ry * cosPhi * sinEta; + float relq2x = a * (-rx * cosPhi * sinEta - ry * sinPhi * cosEta); + float relq2y = a * (-rx * sinPhi * sinEta + ry * cosPhi * cosEta); + + if (i == segmentCount - 1) { p2x = x2; p2y = y2; } + + parsePathCode(BEZIER_VERTEX); + parsePathVertex(p1x + relq1x, p1y + relq1y); + parsePathVertex(p2x - relq2x, p2y - relq2y); + parsePathVertex(p2x, p2y); + + p1x = p2x; relq1x = relq2x; + p1y = p2y; relq1y = relq2y; + } + } + + /** * Parse the specified SVG matrix into a PMatrix2D. Note that PMatrix2D * is rotated relative to the SVG definition, so parameters are rearranged diff --git a/core/src/processing/core/PVector.java b/core/src/processing/core/PVector.java index 49e54a0d0..1a7f841aa 100644 --- a/core/src/processing/core/PVector.java +++ b/core/src/processing/core/PVector.java @@ -119,6 +119,7 @@ public class PVector implements Serializable { /** Array so that this can be temporarily used in an array context */ transient protected float[] array; + /** * Constructor for an empty vector: x, y, and z are set to 0. */ @@ -149,6 +150,7 @@ public class PVector implements Serializable { this.z = 0; } + /** * ( begin auto-generated from PVector_set.xml ) * @@ -169,6 +171,7 @@ public class PVector implements Serializable { this.z = z; } + /** * @param x the x component of the vector * @param y the y component of the vector @@ -178,6 +181,7 @@ public class PVector implements Serializable { this.y = y; } + /** * @param v any variable of type PVector */ @@ -217,9 +221,10 @@ public class PVector implements Serializable { * @see PVector#random3D() */ static public PVector random2D() { - return random2D(null,null); + return random2D(null, null); } + /** * Make a new 2D unit vector with a random direction * using Processing's current random number generator @@ -227,7 +232,7 @@ public class PVector implements Serializable { * @return the random PVector */ static public PVector random2D(PApplet parent) { - return random2D(null,parent); + return random2D(null, parent); } /** @@ -236,18 +241,23 @@ public class PVector implements Serializable { * @return the random PVector */ static public PVector random2D(PVector target) { - return random2D(target,null); + return random2D(target, null); } + /** - * Make a new 2D unit vector with a random direction + * Make a new 2D unit vector with a random direction. Pass in the parent + * PApplet if you want randomSeed() to work (and be predictable). Or leave + * it null and be... random. * @return the random PVector */ static public PVector random2D(PVector target, PApplet parent) { - if (parent == null) return fromAngle((float)(Math.random()*Math.PI*2),target); - else return fromAngle(parent.random(PConstants.TWO_PI),target); + return (parent == null) ? + fromAngle((float) (Math.random() * Math.PI*2), target) : + fromAngle(parent.random(PConstants.TAU), target); } + /** * ( begin auto-generated from PVector_random3D.xml ) * @@ -262,9 +272,10 @@ public class PVector implements Serializable { * @see PVector#random2D() */ static public PVector random3D() { - return random3D(null,null); + return random3D(null, null); } + /** * Make a new 3D unit vector with a random direction * using Processing's current random number generator @@ -272,18 +283,20 @@ public class PVector implements Serializable { * @return the random PVector */ static public PVector random3D(PApplet parent) { - return random3D(null,parent); + return random3D(null, parent); } + /** * Set a 3D vector to a random unit vector with a random direction * @param target the target vector (if null, a new vector will be created) * @return the random PVector */ static public PVector random3D(PVector target) { - return random3D(target,null); + return random3D(target, null); } + /** * Make a new 3D unit vector with a random direction * @return the random PVector @@ -309,6 +322,7 @@ public class PVector implements Serializable { return target; } + /** * ( begin auto-generated from PVector_sub.xml ) * @@ -342,6 +356,12 @@ public class PVector implements Serializable { return target; } + + public PVector copy() { + return new PVector(x, y, z); + } + + /** * ( begin auto-generated from PVector_get.xml ) * @@ -353,10 +373,12 @@ public class PVector implements Serializable { * @usage web_application * @brief Get a copy of the vector */ + @Deprecated public PVector get() { - return new PVector(x, y, z); + return copy(); } + /** * @param target */ @@ -393,6 +415,7 @@ public class PVector implements Serializable { return (float) Math.sqrt(x*x + y*y + z*z); } + /** * ( begin auto-generated from PVector_mag.xml ) * @@ -413,6 +436,7 @@ public class PVector implements Serializable { return (x*x + y*y + z*z); } + /** * ( begin auto-generated from PVector_add.xml ) * @@ -435,6 +459,7 @@ public class PVector implements Serializable { z += v.z; } + /** * @param x x component of the vector * @param y y component of the vector @@ -493,6 +518,7 @@ public class PVector implements Serializable { z -= v.z; } + /** * @param x the x component of the vector * @param y the y component of the vector @@ -571,7 +597,6 @@ public class PVector implements Serializable { } - /** * ( begin auto-generated from PVector_div.xml ) * @@ -600,6 +625,7 @@ public class PVector implements Serializable { return div(v, n, null); } + /** * Divide a vector by a scalar and store the result in another vector. * @param target PVector in which to store the result @@ -665,6 +691,7 @@ public class PVector implements Serializable { return x*v.x + y*v.y + z*v.z; } + /** * @param x x component of the vector * @param y y component of the vector @@ -674,6 +701,7 @@ public class PVector implements Serializable { return this.x*x + this.y*y + this.z*z; } + /** * @param v1 any variable of type PVector * @param v2 any variable of type PVector @@ -717,6 +745,7 @@ public class PVector implements Serializable { return target; } + /** * @param v1 any variable of type PVector * @param v2 any variable of type PVector @@ -792,6 +821,7 @@ public class PVector implements Serializable { } } + /** * ( begin auto-generated from PVector_setMag.xml ) * @@ -809,6 +839,7 @@ public class PVector implements Serializable { mult(len); } + /** * Sets the magnitude of this vector, storing the result in another vector. * @param target Set to null to create a new vector @@ -821,6 +852,7 @@ public class PVector implements Serializable { return target; } + /** * ( begin auto-generated from PVector_setMag.xml ) * @@ -858,10 +890,10 @@ public class PVector implements Serializable { * @param theta the angle of rotation */ public void rotate(float theta) { - float xTemp = x; + float temp = x; // Might need to check for rounding errors like with angleBetween function? x = x*PApplet.cos(theta) - y*PApplet.sin(theta); - y = xTemp*PApplet.sin(theta) + y*PApplet.cos(theta); + y = temp*PApplet.sin(theta) + y*PApplet.cos(theta); } @@ -880,22 +912,24 @@ public class PVector implements Serializable { * @see PApplet#lerp(float, float, float) */ public void lerp(PVector v, float amt) { - x = PApplet.lerp(x,v.x,amt); - y = PApplet.lerp(y,v.y,amt); - z = PApplet.lerp(z,v.z,amt); + x = PApplet.lerp(x, v.x, amt); + y = PApplet.lerp(y, v.y, amt); + z = PApplet.lerp(z, v.z, amt); } + /** * Linear interpolate between two vectors (returns a new PVector object) * @param v1 the vector to start from * @param v2 the vector to lerp to */ public static PVector lerp(PVector v1, PVector v2, float amt) { - PVector v = v1.get(); + PVector v = v1.copy(); v.lerp(v2, amt); return v; } + /** * Linear interpolate the vector to x,y,z values * @param x the x component to lerp to @@ -903,11 +937,12 @@ public class PVector implements Serializable { * @param z the z component to lerp to */ public void lerp(float x, float y, float z, float amt) { - this.x = PApplet.lerp(this.x,x,amt); - this.y = PApplet.lerp(this.y,y,amt); - this.z = PApplet.lerp(this.z,z,amt); + this.x = PApplet.lerp(this.x, x, amt); + this.y = PApplet.lerp(this.y, y, amt); + this.z = PApplet.lerp(this.z, z, amt); } + /** * ( begin auto-generated from PVector_angleBetween.xml ) * @@ -976,14 +1011,17 @@ public class PVector implements Serializable { return array; } + @Override public boolean equals(Object obj) { - if (!(obj instanceof PVector)) + if (!(obj instanceof PVector)) { return false; + } final PVector p = (PVector) obj; return x == p.x && y == p.y && z == p.z; } + @Override public int hashCode() { int result = 1; diff --git a/core/src/processing/data/FloatDict.java b/core/src/processing/data/FloatDict.java index e9b902396..d300afc1d 100644 --- a/core/src/processing/data/FloatDict.java +++ b/core/src/processing/data/FloatDict.java @@ -411,13 +411,21 @@ public class FloatDict { public String minKey() { checkMinMax("minKey"); - return keys[minIndex()]; + int index = minIndex(); + if (index == -1) { + return null; + } + return keys[index]; } public float minValue() { checkMinMax("minValue"); - return values[minIndex()]; + int index = minIndex(); + if (index == -1) { + return Float.NaN; + } + return values[index]; } @@ -452,17 +460,25 @@ public class FloatDict { } - /** The key for a max value. */ + /** The key for a max value, or null if everything is NaN (no max). */ public String maxKey() { checkMinMax("maxKey"); - return keys[maxIndex()]; + int index = maxIndex(); + if (index == -1) { + return null; + } + return keys[index]; } - /** The max value. */ + /** The max value. (Or NaN if they're all NaN.) */ public float maxValue() { checkMinMax("maxValue"); - return values[maxIndex()]; + int index = maxIndex(); + if (index == -1) { + return Float.NaN; + } + return values[index]; } @@ -652,7 +668,22 @@ public class FloatDict { Sort s = new Sort() { @Override public int size() { - return count; + if (useKeys) { + return count; // don't worry about NaN values + + } else { // first move NaN values to the end of the list + int right = count - 1; + while (values[right] != values[right]) { + right--; + } + for (int i = right; i >= 0; --i) { + if (Float.isNaN(values[i])) { + swap(i, right); + --right; + } + } + return right + 1; + } } @Override @@ -713,12 +744,11 @@ public class FloatDict { } -// /** -// * Write tab-delimited entries out to the console. -// */ -// public void print() { -// write(new PrintWriter(System.out)); -// } + public void print() { + for (int i = 0; i < size(); i++) { + System.out.println(keys[i] + " = " + values[i]); + } + } /** diff --git a/core/src/processing/data/FloatList.java b/core/src/processing/data/FloatList.java index 9921cb326..1e4a85f19 100644 --- a/core/src/processing/data/FloatList.java +++ b/core/src/processing/data/FloatList.java @@ -110,6 +110,9 @@ public class FloatList implements Iterable { * @brief Get an entry at a particular index */ public float get(int index) { + if (index >= count) { + throw new ArrayIndexOutOfBoundsException(index); + } return data[index]; } @@ -563,7 +566,20 @@ public class FloatList implements Iterable { new Sort() { @Override public int size() { - return count; + // move NaN values to the end of the list and don't sort them + int right = count - 1; + while (data[right] != data[right]) { + right--; + } + for (int i = right; i >= 0; --i) { + float v = data[i]; + if (v != v) { + data[i] = data[right]; + data[right] = v; + --right; + } + } + return right + 1; } @Override @@ -601,7 +617,7 @@ public class FloatList implements Iterable { /** * @webref floatlist:method - * @brief Reverse sort, orders values by first digit + * @brief Reverse the order of the list elements */ public void reverse() { int ii = count - 1; @@ -763,6 +779,13 @@ public class FloatList implements Iterable { } + public void print() { + for (int i = 0; i < size(); i++) { + System.out.format("[%d] %f%n", i, data[i]); + } + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/core/src/processing/data/IntDict.java b/core/src/processing/data/IntDict.java index b581eaecf..022d9195f 100644 --- a/core/src/processing/data/IntDict.java +++ b/core/src/processing/data/IntDict.java @@ -663,6 +663,13 @@ public class IntDict { } + public void print() { + for (int i = 0; i < size(); i++) { + System.out.println(keys[i] + " = " + values[i]); + } + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/core/src/processing/data/IntList.java b/core/src/processing/data/IntList.java index 78775be3f..00483f927 100644 --- a/core/src/processing/data/IntList.java +++ b/core/src/processing/data/IntList.java @@ -130,6 +130,9 @@ public class IntList implements Iterable { * @brief Get an entry at a particular index */ public int get(int index) { + if (index >= this.count) { + throw new ArrayIndexOutOfBoundsException(index); + } return data[index]; } @@ -569,7 +572,7 @@ public class IntList implements Iterable { /** * @webref intlist:method - * @brief Reverse sort, orders values by first digit + * @brief Reverse the order of the list elements */ public void reverse() { int ii = count - 1; diff --git a/core/src/processing/data/Sort.java b/core/src/processing/data/Sort.java index d205edb12..b42e0f141 100644 --- a/core/src/processing/data/Sort.java +++ b/core/src/processing/data/Sort.java @@ -31,8 +31,8 @@ public abstract class Sort implements Runnable { protected int partition(int left, int right) { int pivot = right; do { - while (compare(++left, pivot) < 0) ; - while ((right != 0) && (compare(--right, pivot) > 0)) ; + while (compare(++left, pivot) < 0) { } + while ((right != 0) && (compare(--right, pivot) > 0)) { } swap(left, right); } while (left < right); swap(left, right); diff --git a/core/src/processing/data/StringDict.java b/core/src/processing/data/StringDict.java index 38b2175eb..becc5ee51 100644 --- a/core/src/processing/data/StringDict.java +++ b/core/src/processing/data/StringDict.java @@ -428,6 +428,13 @@ public class StringDict { } + public void print() { + for (int i = 0; i < size(); i++) { + System.out.println(keys[i] + " = " + values[i]); + } + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/core/src/processing/data/StringList.java b/core/src/processing/data/StringList.java index a407265a9..67e58a9ee 100644 --- a/core/src/processing/data/StringList.java +++ b/core/src/processing/data/StringList.java @@ -113,6 +113,9 @@ public class StringList implements Iterable { * @brief Get an entry at a particular index */ public String get(int index) { + if (index >= count) { + throw new ArrayIndexOutOfBoundsException(index); + } return data[index]; } @@ -309,7 +312,7 @@ public class StringList implements Iterable { if (index < 0) { throw new IllegalArgumentException("insert() index cannot be negative: it was " + index); } - if (index >= values.length) { + if (index >= data.length) { throw new IllegalArgumentException("insert() index " + index + " is past the end of this list"); } @@ -495,7 +498,7 @@ public class StringList implements Iterable { /** * @webref stringlist:method - * @brief To come... + * @brief Reverse the order of the list elements */ public void reverse() { int ii = count - 1; @@ -702,10 +705,11 @@ public class StringList implements Iterable { } -// static public StringList split(String value, char delim) { -// String[] array = PApplet.split(value, delim); -// return new StringList(array); -// } + public void print() { + for (int i = 0; i < size(); i++) { + System.out.format("[%d] %s%n", i, data[i]); + } + } @Override diff --git a/core/src/processing/data/Table.java b/core/src/processing/data/Table.java index d98a9db51..93ba62fc4 100644 --- a/core/src/processing/data/Table.java +++ b/core/src/processing/data/Table.java @@ -155,12 +155,30 @@ public class Table { public Table(Iterable rows) { init(); - boolean typed = false; - for (TableRow row : rows) { - if (!typed) { - setColumnTypes(row.getColumnTypes()); + + int row = 0; + int alloc = 10; + + for (TableRow incoming : rows) { + if (row == 0) { + setColumnTypes(incoming.getColumnTypes()); + setColumnTitles(incoming.getColumnTitles()); + // Do this after setting types, otherwise it'll attempt to parse the + // allocated but empty rows, and drive CATEGORY columns nutso. + setRowCount(alloc); + + } else if (row == alloc) { + // Far more efficient than re-allocating all columns and doing a copy + alloc *= 2; + setRowCount(alloc); } - addRow(row); + + //addRow(row); + setRow(row++, incoming); + } + // Shrink the table to only the rows that were used + if (row != alloc) { + setRowCount(row); } } @@ -417,6 +435,10 @@ public class Table { char[] c = new char[100]; int count = 0; boolean insideQuote = false; + + int alloc = 100; + setRowCount(100); + int row = 0; int col = 0; int ch; @@ -462,14 +484,23 @@ public class Table { } setString(row, col, new String(c, 0, count)); count = 0; - if (row == 0 && header) { + row++; + if (row == 1 && header) { // Use internal row removal (efficient because only one row). removeTitleRow(); // Un-set the header variable so that next time around, we don't // just get stuck into a loop, removing the 0th row repeatedly. header = false; + // Reset the number of rows (removeTitleRow() won't reset our local 'row' counter) + row = 0; + } +// if (row % 1000 == 0) { +// PApplet.println(PApplet.nfc(row)); +// } + if (row == alloc) { + alloc *= 2; + setRowCount(alloc); } - row++; col = 0; } else if (ch == ',') { @@ -491,6 +522,10 @@ public class Table { if (count > 0) { setString(row, col, new String(c, 0, count)); } + row++; // set row to row count (the current row index + 1) + if (alloc != row) { + setRowCount(row); // shrink to the actual size + } } @@ -1484,7 +1519,7 @@ public class Table { int[] intData = new int[rowCount]; for (int row = 0; row < rowCount; row++) { String s = getString(row, column); - intData[row] = PApplet.parseInt(s, missingInt); + intData[row] = (s == null) ? missingInt : PApplet.parseInt(s, missingInt); } columns[column] = intData; break; @@ -1494,7 +1529,7 @@ public class Table { for (int row = 0; row < rowCount; row++) { String s = getString(row, column); try { - longData[row] = Long.parseLong(s); + longData[row] = (s == null) ? missingLong : Long.parseLong(s); } catch (NumberFormatException nfe) { longData[row] = missingLong; } @@ -1506,7 +1541,7 @@ public class Table { float[] floatData = new float[rowCount]; for (int row = 0; row < rowCount; row++) { String s = getString(row, column); - floatData[row] = PApplet.parseFloat(s, missingFloat); + floatData[row] = (s == null) ? missingFloat : PApplet.parseFloat(s, missingFloat); } columns[column] = floatData; break; @@ -1516,7 +1551,7 @@ public class Table { for (int row = 0; row < rowCount; row++) { String s = getString(row, column); try { - doubleData[row] = Double.parseDouble(s); + doubleData[row] = (s == null) ? missingDouble : Double.parseDouble(s); } catch (NumberFormatException nfe) { doubleData[row] = missingDouble; } @@ -1818,13 +1853,16 @@ public class Table { * @param source a reference to the original row to be duplicated */ public TableRow addRow(TableRow source) { - int row = rowCount; + return setRow(rowCount, source); + } + + + public TableRow setRow(int row, TableRow source) { // Make sure there are enough columns to add this data ensureBounds(row, source.getColumnCount() - 1); for (int col = 0; col < columns.length; col++) { switch (columnTypes[col]) { - case CATEGORY: case INT: setInt(row, col, source.getInt(col)); break; @@ -1840,6 +1878,14 @@ public class Table { case STRING: setString(row, col, source.getString(col)); break; + case CATEGORY: + int index = source.getInt(col); + setInt(row, col, index); + if (!columnCategories[col].hasCategory(index)) { + columnCategories[col].setCategory(index, source.getString(col)); + } + break; + default: throw new RuntimeException("no types"); } @@ -2272,6 +2318,14 @@ public class Table { public int[] getColumnTypes() { return table.getColumnTypes(); } + + public String getColumnTitle(int column) { + return table.getColumnTitle(column); + } + + public String[] getColumnTitles() { + return table.getColumnTitles(); + } } @@ -2930,11 +2984,19 @@ public class Table { return missingString; } return columnCategories[column].key(cat); - } else { - return String.valueOf(Array.get(columns[column], row)); + } else if (columnTypes[column] == FLOAT) { + if (Float.isNaN(getFloat(row, column))) { + return null; + } + } else if (columnTypes[column] == DOUBLE) { + if (Double.isNaN(getFloat(row, column))) { + return null; + } } + return String.valueOf(Array.get(columns[column], row)); } + /** * @param columnName title of the column to reference */ @@ -3389,9 +3451,9 @@ public class Table { // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - public void replaceAll(String orig, String replacement) { + public void replaceAll(String regex, String replacement) { for (int col = 0; col < columns.length; col++) { - replaceAll(orig, replacement, col); + replaceAll(regex, replacement, col); } } @@ -3592,6 +3654,18 @@ public class Table { return indexToData.get(index); } + boolean hasCategory(int index) { + return index < size() && indexToData.get(index) != null; + } + + void setCategory(int index, String name) { + while (indexToData.size() <= index) { + indexToData.add(null); + } + indexToData.set(index, name); + dataToIndex.put(name, index); + } + int size() { return dataToIndex.size(); } @@ -3613,9 +3687,11 @@ public class Table { void read(DataInputStream input) throws IOException { int count = input.readInt(); + //System.out.println("found " + count + " entries in category map"); dataToIndex = new HashMap(count); for (int i = 0; i < count; i++) { String str = input.readUTF(); + //System.out.println(i + " " + str); dataToIndex.put(str, i); indexToData.add(str); } @@ -4216,4 +4292,10 @@ public class Table { } } */ + + + /** Make a copy of the current table */ + public Table copy() { + return new Table(rows()); + } } diff --git a/core/src/processing/data/TableRow.java b/core/src/processing/data/TableRow.java index 7107ee693..87e288825 100644 --- a/core/src/processing/data/TableRow.java +++ b/core/src/processing/data/TableRow.java @@ -109,4 +109,7 @@ public interface TableRow { public int getColumnType(int column); public int[] getColumnTypes(); + + public String getColumnTitle(int column); + public String[] getColumnTitles(); } diff --git a/java/examples/Demos/Graphics/LowLevelGL/data/frag.glsl b/core/src/processing/opengl/LightFrag.glsl similarity index 85% rename from java/examples/Demos/Graphics/LowLevelGL/data/frag.glsl rename to core/src/processing/opengl/LightFrag.glsl index 16742d2bd..b566c8e5b 100644 --- a/java/examples/Demos/Graphics/LowLevelGL/data/frag.glsl +++ b/core/src/processing/opengl/LightFrag.glsl @@ -1,7 +1,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2011-12 Ben Fry and Casey Reas + Copyright (c) 2011-13 Ben Fry and Casey Reas This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -24,7 +24,8 @@ precision mediump int; #endif varying vec4 vertColor; +varying vec4 backVertColor; void main() { - gl_FragColor = vertColor; + gl_FragColor = gl_FrontFacing ? vertColor : backVertColor; } \ No newline at end of file diff --git a/core/src/processing/opengl/LightVert.glsl b/core/src/processing/opengl/LightVert.glsl index bfbb6a8d3..8d75f970a 100644 --- a/core/src/processing/opengl/LightVert.glsl +++ b/core/src/processing/opengl/LightVert.glsl @@ -43,6 +43,7 @@ attribute vec4 emissive; attribute float shininess; varying vec4 vertColor; +varying vec4 backVertColor; const float zero_float = 0.0; const float one_float = 1.0; @@ -82,17 +83,17 @@ void main() { // Normal vector in eye coordinates vec3 ecNormal = normalize(normalMatrix * normal); - - if (dot(-one_float * ecVertex, ecNormal) < zero_float) { - // If normal is away from camera, choose its opposite. - // If we add backface culling, this will be backfacing - ecNormal *= -one_float; - } + vec3 ecNormalInv = ecNormal * -one_float; // Light calculations vec3 totalAmbient = vec3(0, 0, 0); - vec3 totalDiffuse = vec3(0, 0, 0); - vec3 totalSpecular = vec3(0, 0, 0); + + vec3 totalFrontDiffuse = vec3(0, 0, 0); + vec3 totalFrontSpecular = vec3(0, 0, 0); + + vec3 totalBackDiffuse = vec3(0, 0, 0); + vec3 totalBackSpecular = vec3(0, 0, 0); + for (int i = 0; i < 8; i++) { if (lightCount == i) break; @@ -118,24 +119,33 @@ void main() { : one_float; if (any(greaterThan(lightAmbient[i], zero_vec3))) { - totalAmbient += lightAmbient[i] * falloff; + totalAmbient += lightAmbient[i] * falloff; } if (any(greaterThan(lightDiffuse[i], zero_vec3))) { - totalDiffuse += lightDiffuse[i] * falloff * spotf * - lambertFactor(lightDir, ecNormal); + totalFrontDiffuse += lightDiffuse[i] * falloff * spotf * + lambertFactor(lightDir, ecNormal); + totalBackDiffuse += lightDiffuse[i] * falloff * spotf * + lambertFactor(lightDir, ecNormalInv); } if (any(greaterThan(lightSpecular[i], zero_vec3))) { - totalSpecular += lightSpecular[i] * falloff * spotf * - blinnPhongFactor(lightDir, ecVertex, ecNormal, shininess); + totalFrontSpecular += lightSpecular[i] * falloff * spotf * + blinnPhongFactor(lightDir, ecVertex, ecNormal, shininess); + totalBackSpecular += lightSpecular[i] * falloff * spotf * + blinnPhongFactor(lightDir, ecVertex, ecNormalInv, shininess); } } // Calculating final color as result of all lights (plus emissive term). // Transparency is determined exclusively by the diffuse component. - vertColor = vec4(totalAmbient, 0) * ambient + - vec4(totalDiffuse, 1) * color + - vec4(totalSpecular, 0) * specular + - vec4(emissive.rgb, 0); + vertColor = vec4(totalAmbient, 0) * ambient + + vec4(totalFrontDiffuse, 1) * color + + vec4(totalFrontSpecular, 0) * specular + + vec4(emissive.rgb, 0); + + backVertColor = vec4(totalAmbient, 0) * ambient + + vec4(totalBackDiffuse, 1) * color + + vec4(totalBackSpecular, 0) * specular + + vec4(emissive.rgb, 0); } \ No newline at end of file diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index 12c6fe413..c2bf327e9 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -160,6 +160,11 @@ public class PGraphicsOpenGL extends PGraphics { PGraphicsOpenGL.class.getResource("ColorFrag.glsl"); static protected URL defTextureShaderFragURL = PGraphicsOpenGL.class.getResource("TextureFrag.glsl"); + static protected URL defLightShaderFragURL = + PGraphicsOpenGL.class.getResource("LightFrag.glsl"); + static protected URL defTexlightShaderFragURL = + PGraphicsOpenGL.class.getResource("TexlightFrag.glsl"); + static protected URL defLineShaderVertURL = PGraphicsOpenGL.class.getResource("LineVert.glsl"); static protected URL defLineShaderFragURL = @@ -379,9 +384,9 @@ public class PGraphicsOpenGL extends PGraphics { /** PImage that wraps filterTexture. */ protected PImage filterImage; - /** Flag to indicate if the user is manipulating the - * pixels array through the set()/get() methods */ - protected boolean setgetPixels; + /** Flag to indicate that pixels array is up-to-date and + * ready to be manipulated through the set()/get() methods */ + protected boolean arePixelsUpToDate; // ........................................................ @@ -2151,6 +2156,9 @@ public class PGraphicsOpenGL extends PGraphics { if ((flushMode == FLUSH_CONTINUOUSLY) || (flushMode == FLUSH_WHEN_FULL && tessGeo.isFull())) { flush(); + } else { + // pixels array is not up-to-date anymore + arePixelsUpToDate = false; } } @@ -2166,6 +2174,9 @@ public class PGraphicsOpenGL extends PGraphics { if (flushMode == FLUSH_CONTINUOUSLY || (flushMode == FLUSH_WHEN_FULL && tessGeo.isFull())) { flush(); + } else { + // pixels array is not up-to-date anymore + arePixelsUpToDate = false; } } @@ -2443,7 +2454,7 @@ public class PGraphicsOpenGL extends PGraphics { tessGeo.clear(); texCache.clear(); - setgetPixels = false; + arePixelsUpToDate = false; } @@ -3237,6 +3248,7 @@ public class PGraphicsOpenGL extends PGraphics { normalMode = NORMAL_MODE_SHAPE; inGeo.setMaterial(fillColor, strokeColor, strokeWeight, ambientColor, specularColor, emissiveColor, shininess); + inGeo.setNormal(normalX, normalY, normalZ); inGeo.addArc(x, y, w, h, start, stop, fill, stroke, mode); endShape(); @@ -5435,7 +5447,7 @@ public class PGraphicsOpenGL extends PGraphics { needEndDraw = true; } - if (!setgetPixels) { + if (!arePixelsUpToDate) { // Draws any remaining geometry in case the user is still not // setting/getting new pixels. flush(); @@ -5443,10 +5455,13 @@ public class PGraphicsOpenGL extends PGraphics { allocatePixels(); - if (!setgetPixels) { + if (!arePixelsUpToDate) { readPixels(); } + // Pixels are now up-to-date, set the flag. + arePixelsUpToDate = true; + if (needEndDraw) { endDraw(); } @@ -5566,7 +5581,6 @@ public class PGraphicsOpenGL extends PGraphics { @Override public int get(int x, int y) { loadPixels(); - setgetPixels = true; return super.get(x, y); } @@ -5576,7 +5590,6 @@ public class PGraphicsOpenGL extends PGraphics { int sourceWidth, int sourceHeight, PImage target, int targetX, int targetY) { loadPixels(); - setgetPixels = true; super.getImpl(sourceX, sourceY, sourceWidth, sourceHeight, target, targetX, targetY); } @@ -5585,7 +5598,6 @@ public class PGraphicsOpenGL extends PGraphics { @Override public void set(int x, int y, int argb) { loadPixels(); - setgetPixels = true; super.set(x, y, argb); } @@ -5596,7 +5608,6 @@ public class PGraphicsOpenGL extends PGraphics { int sourceWidth, int sourceHeight, int targetX, int targetY) { loadPixels(); - setgetPixels = true; super.setImpl(sourceImage, sourceX, sourceY, sourceWidth, sourceHeight, targetX, targetY); // do we need this? @@ -6531,8 +6542,12 @@ public class PGraphicsOpenGL extends PGraphics { lightSpecular(0, 0, 0); } - // Because y is flipped, the vertices that should be specified by - // the user in CCW order to define a front-facing facet, end up being CW. + // Vertices should be specified by user in CW order (left-handed) + // That is CCW order (right-handed). Vertex shader inverts + // Y-axis and outputs vertices in CW order (right-handed). + // Culling occurs after the vertex shader, so FRONT FACE + // has to be set to CW (right-handed) for OpenGL to correctly + // recognize FRONT and BACK faces. pgl.frontFace(PGL.CW); pgl.disable(PGL.CULL_FACE); @@ -6540,7 +6555,8 @@ public class PGraphicsOpenGL extends PGraphics { pgl.activeTexture(PGL.TEXTURE0); // The current normal vector is set to be parallel to the Z axis. - normalX = normalY = normalZ = 0; + normalX = normalY = 0; + normalZ = 1; // Clear depth and stencil buffers. pgl.depthMask(true); @@ -6569,7 +6585,7 @@ public class PGraphicsOpenGL extends PGraphics { clearColorBuffer = false; modified = false; - setgetPixels = false; + arePixelsUpToDate = false; } @@ -6680,9 +6696,13 @@ public class PGraphicsOpenGL extends PGraphics { @Override - // TODO: deprecate this method, the kind arguments is not used anymore public void shader(PShader shader, int kind) { - shader(shader); + flush(); // Flushing geometry drawn with a different shader. + + if (kind == TRIANGLES) polyShader = shader; + else if (kind == LINES) lineShader = shader; + else if (kind == POINTS) pointShader = shader; + else PGraphics.showWarning(UNKNOWN_SHADER_KIND_ERROR); } @@ -6736,7 +6756,7 @@ public class PGraphicsOpenGL extends PGraphics { if (useDefault || !polyShader.checkPolyType(PShader.TEXLIGHT)) { if (ppg.defTexlightShader == null) { String[] vertSource = pgl.loadVertexShader(defTexlightShaderVertURL, 120); - String[] fragSource = pgl.loadFragmentShader(defTextureShaderFragURL, 120); + String[] fragSource = pgl.loadFragmentShader(defTexlightShaderFragURL, 120); ppg.defTexlightShader = new PShader(parent, vertSource, fragSource); } shader = ppg.defTexlightShader; @@ -6747,7 +6767,7 @@ public class PGraphicsOpenGL extends PGraphics { if (useDefault || !polyShader.checkPolyType(PShader.LIGHT)) { if (ppg.defLightShader == null) { String[] vertSource = pgl.loadVertexShader(defLightShaderVertURL, 120); - String[] fragSource = pgl.loadFragmentShader(defColorShaderFragURL, 120); + String[] fragSource = pgl.loadFragmentShader(defLightShaderFragURL, 120); ppg.defLightShader = new PShader(parent, vertSource, fragSource); } shader = ppg.defLightShader; @@ -7794,6 +7814,7 @@ public class PGraphicsOpenGL extends PGraphics { // // Normal calculation + // Expects vertices in CW (left-handed) order. void calcTriangleNormal(int i0, int i1, int i2) { int index; @@ -7821,9 +7842,9 @@ public class PGraphicsOpenGL extends PGraphics { float v10z = z0 - z1; // The automatic normal calculation in Processing assumes - // that vertices as given in CCW order so: + // that vertices as given in CCW order (right-handed) so: // n = v12 x v10 - // so that the normal outwards. + // so that the normal extends from the front face. float nx = v12y * v10z - v10y * v12z; float ny = v12z * v10x - v10z * v12x; float nz = v12x * v10y - v10x * v12y; @@ -7872,14 +7893,18 @@ public class PGraphicsOpenGL extends PGraphics { for (int i = 1; i < vertexCount - 1; i++) { int i1 = i; int i0, i2; - if (i % 2 == 0) { - // The even triangles (0, 2, 4...) should be CW - i0 = i + 1; - i2 = i - 1; - } else { - // The even triangles (1, 3, 5...) should be CCW + // Vertices are specified by user as: + // 1-3 ... + // |\|\ ... + // 0-2-4 ... + if (i % 2 == 1) { + // The odd triangles (1, 3, 5...) should be CW (left-handed) i0 = i - 1; i2 = i + 1; + } else { + // The even triangles (2, 4, 6...) should be CCW (left-handed) + i0 = i + 1; + i2 = i - 1; } calcTriangleNormal(i0, i1, i2); } @@ -7904,8 +7929,14 @@ public class PGraphicsOpenGL extends PGraphics { int i2 = 2 * qd; int i3 = 2 * qd + 1; - calcTriangleNormal(i0, i3, i1); - calcTriangleNormal(i0, i2, i3); + // Vertices are specified by user as: + // 1-3-5 ... + // |\|\| ... + // 0-2-4 ... + // thus (0, 1, 2) and (2, 1, 3) are triangles + // in CW order (left-handed). + calcTriangleNormal(i0, i1, i2); + calcTriangleNormal(i2, i1, i3); } } @@ -8077,56 +8108,108 @@ public class PGraphicsOpenGL extends PGraphics { int startLUT = (int) (0.5f + (start / TWO_PI) * SINCOS_LENGTH); int stopLUT = (int) (0.5f + (stop / TWO_PI) * SINCOS_LENGTH); - int idx0 = addVertex(centerX, centerY, VERTEX, true); + // get length before wrapping indexes so (startLUT <= stopLUT); + int length = PApplet.constrain(stopLUT - startLUT, 0, SINCOS_LENGTH); - int increment = 1; // what's a good algorithm? stopLUT - startLUT; - int pidx = 0, idx = 0; - for (int i = startLUT; i < stopLUT; i += increment) { - int ii = i % SINCOS_LENGTH; - // modulo won't make the value positive - if (ii < 0) ii += SINCOS_LENGTH; + boolean fullCircle = length == SINCOS_LENGTH; + + if (fullCircle && arcMode == CHORD) { + // get rid of overlapping vertices, + // solves problem with closing edge in P3D + length -= 1; + stopLUT -= 1; + } + + { // wrap indexes so they are safe to use in LUT + startLUT %= SINCOS_LENGTH; + if (startLUT < 0) startLUT += SINCOS_LENGTH; + + stopLUT %= SINCOS_LENGTH; + if (stopLUT < 0) stopLUT += SINCOS_LENGTH; + } + + int idx0; + if (arcMode == CHORD || arcMode == OPEN) { + // move center to the middle of flat side + // to properly display arcs smaller than PI + float relX = (cosLUT[startLUT] + cosLUT[stopLUT]) * 0.5f * hr; + float relY = (sinLUT[startLUT] + sinLUT[stopLUT]) * 0.5f * vr; + idx0 = addVertex(centerX + relX, centerY + relY, VERTEX, true); + } else { + idx0 = addVertex(centerX, centerY, VERTEX, true); + } + + int inc; + { // initializes inc the same way ellipse does + float sx1 = pg.screenX(x, y); + float sy1 = pg.screenY(x, y); + float sx2 = pg.screenX(x + w, y + h); + float sy2 = pg.screenY(x + w, y + h); + + int accuracy = + PApplet.min(MAX_POINT_ACCURACY, PApplet.max(MIN_POINT_ACCURACY, + (int) (TWO_PI * PApplet.dist(sx1, sy1, sx2, sy2) / + POINT_ACCURACY_FACTOR))); + inc = PApplet.max(1, SINCOS_LENGTH / accuracy); + } + + int idx = idx0; + int pidx; + + int i = -inc; + int ii; + + // i: (0 -> length) inclusive + // ii: (startLUT -> stopLUT) inclusive, going CW (left-handed), + // wrapping around end of LUT + do { + i += inc; + i = PApplet.min(i, length); // clamp so last vertex won't go over + + ii = startLUT + i; // ii from 0 to (2 * SINCOS_LENGTH - 1) + if (ii >= SINCOS_LENGTH) ii -= SINCOS_LENGTH; + + pidx = idx; idx = addVertex(centerX + cosLUT[ii] * hr, centerY + sinLUT[ii] * vr, - VERTEX, i == startLUT && !fill); + VERTEX, i == 0 && !fill); if (stroke) { - if (arcMode == PIE) { - addEdge(pidx, idx, i == startLUT, false); - } else if (startLUT < i) { - addEdge(pidx, idx, i == startLUT + 1, arcMode == 0 && - i == stopLUT - 1); + if (arcMode == CHORD || arcMode == PIE) { + addEdge(pidx, idx, i == 0, false); + } else if (0 < i) { + // when drawing full circle, the edge is closed later + addEdge(pidx, idx, i == inc, i == length && !fullCircle); } } + } while (i < length); + + // keeping last vertex as idx and second last vertex as pidx - pidx = idx; - } - // draw last point explicitly for accuracy - idx = addVertex(centerX + cosLUT[stopLUT % SINCOS_LENGTH] * hr, - centerY + sinLUT[stopLUT % SINCOS_LENGTH] * vr, - VERTEX, false); if (stroke) { - if (arcMode == PIE) { + if (arcMode == CHORD || arcMode == PIE) { addEdge(idx, idx0, false, false); closeEdge(idx, idx0); - } - } - if (arcMode == CHORD || arcMode == OPEN) { - // Add a last vertex coincident with the first along the perimeter - pidx = idx; - int i = startLUT; - int ii = i % SINCOS_LENGTH; - if (ii < 0) ii += SINCOS_LENGTH; - idx = addVertex(centerX + cosLUT[ii] * hr, - centerY + sinLUT[ii] * vr, - VERTEX, false); - if (stroke && arcMode == CHORD) { - addEdge(pidx, idx, false, true); + } else if (fullCircle) { + closeEdge(pidx, idx); } } } void addBox(float w, float h, float d, boolean fill, boolean stroke) { + + // Correct normals if some dimensions are negative so they always + // extend from front face. We could just take absolute value + // of dimensions, but that would affect texturing. + boolean invertNormX = (h > 0) != (d > 0); + boolean invertNormY = (w > 0) != (d > 0); + boolean invertNormZ = (w > 0) != (h > 0); + + int normX = invertNormX ? -1 : 1; + int normY = invertNormY ? -1 : 1; + int normZ = invertNormZ ? -1 : 1; + float x1 = -w/2f; float x2 = w/2f; float y1 = -h/2f; float y2 = h/2f; float z1 = -d/2f; float z2 = d/2f; @@ -8134,11 +8217,11 @@ public class PGraphicsOpenGL extends PGraphics { int idx1 = 0, idx2 = 0, idx3 = 0, idx4 = 0; if (fill || stroke) { // back face - setNormal(0, 0, -1); + setNormal(0, 0, -normZ); idx1 = addVertex(x1, y1, z1, 0, 0, VERTEX, true); - idx2 = addVertex(x2, y1, z1, 1, 0, VERTEX, false); + idx2 = addVertex(x1, y2, z1, 0, 1, VERTEX, false); idx3 = addVertex(x2, y2, z1, 1, 1, VERTEX, false); - idx4 = addVertex(x1, y2, z1, 0, 1, VERTEX, false); + idx4 = addVertex(x2, y1, z1, 1, 0, VERTEX, false); if (stroke) { addEdge(idx1, idx2, true, false); addEdge(idx2, idx3, false, false); @@ -8148,10 +8231,10 @@ public class PGraphicsOpenGL extends PGraphics { } // front face - setNormal(0, 0, 1); - idx1 = addVertex(x2, y1, z2, 0, 0, VERTEX, false); + setNormal(0, 0, normZ); + idx1 = addVertex(x1, y2, z2, 1, 1, VERTEX, false); idx2 = addVertex(x1, y1, z2, 1, 0, VERTEX, false); - idx3 = addVertex(x1, y2, z2, 1, 1, VERTEX, false); + idx3 = addVertex(x2, y1, z2, 0, 0, VERTEX, false); idx4 = addVertex(x2, y2, z2, 0, 1, VERTEX, false); if (stroke) { addEdge(idx1, idx2, true, false); @@ -8162,11 +8245,11 @@ public class PGraphicsOpenGL extends PGraphics { } // right face - setNormal(1, 0, 0); + setNormal(normX, 0, 0); idx1 = addVertex(x2, y1, z1, 0, 0, VERTEX, false); - idx2 = addVertex(x2, y1, z2, 1, 0, VERTEX, false); + idx2 = addVertex(x2, y2, z1, 0, 1, VERTEX, false); idx3 = addVertex(x2, y2, z2, 1, 1, VERTEX, false); - idx4 = addVertex(x2, y2, z1, 0, 1, VERTEX, false); + idx4 = addVertex(x2, y1, z2, 1, 0, VERTEX, false); if (stroke) { addEdge(idx1, idx2, true, false); addEdge(idx2, idx3, false, false); @@ -8176,10 +8259,10 @@ public class PGraphicsOpenGL extends PGraphics { } // left face - setNormal(-1, 0, 0); - idx1 = addVertex(x1, y1, z2, 0, 0, VERTEX, false); + setNormal(-normX, 0, 0); + idx1 = addVertex(x1, y2, z1, 1, 1, VERTEX, false); idx2 = addVertex(x1, y1, z1, 1, 0, VERTEX, false); - idx3 = addVertex(x1, y2, z1, 1, 1, VERTEX, false); + idx3 = addVertex(x1, y1, z2, 0, 0, VERTEX, false); idx4 = addVertex(x1, y2, z2, 0, 1, VERTEX, false); if (stroke) { addEdge(idx1, idx2, true, false); @@ -8189,26 +8272,26 @@ public class PGraphicsOpenGL extends PGraphics { closeEdge(idx4, idx1); } - // bottom face - setNormal(0, -1, 0); - idx1 = addVertex(x1, y1, z2, 0, 0, VERTEX, false); - idx2 = addVertex(x2, y1, z2, 1, 0, VERTEX, false); - idx3 = addVertex(x2, y1, z1, 1, 1, VERTEX, false); - idx4 = addVertex(x1, y1, z1, 0, 1, VERTEX, false); - if (stroke) { - addEdge(idx1, idx2, true, false); - addEdge(idx2, idx3, false, false); - addEdge(idx3, idx4, false, false); - addEdge(idx4, idx1, false, false); - closeEdge(idx4, idx1); - } - // top face - setNormal(0, 1, 0); + setNormal(0, -normY, 0); + idx1 = addVertex(x2, y1, z1, 1, 1, VERTEX, false); + idx2 = addVertex(x2, y1, z2, 1, 0, VERTEX, false); + idx3 = addVertex(x1, y1, z2, 0, 0, VERTEX, false); + idx4 = addVertex(x1, y1, z1, 0, 1, VERTEX, false); + if (stroke) { + addEdge(idx1, idx2, true, false); + addEdge(idx2, idx3, false, false); + addEdge(idx3, idx4, false, false); + addEdge(idx4, idx1, false, false); + closeEdge(idx4, idx1); + } + + // bottom face + setNormal(0, normY, 0); idx1 = addVertex(x1, y2, z1, 0, 0, VERTEX, false); - idx2 = addVertex(x2, y2, z1, 1, 0, VERTEX, false); + idx2 = addVertex(x1, y2, z2, 0, 1, VERTEX, false); idx3 = addVertex(x2, y2, z2, 1, 1, VERTEX, false); - idx4 = addVertex(x1, y2, z2, 0, 1, VERTEX, false); + idx4 = addVertex(x2, y2, z1, 1, 0, VERTEX, false); if (stroke) { addEdge(idx1, idx2, true, false); addEdge(idx2, idx3, false, false); @@ -8338,8 +8421,8 @@ public class PGraphicsOpenGL extends PGraphics { int i0 = vert0 + i; int i1 = vert0 + i + detailU + 1; - indices[indCount + 3 * i + 0] = i0; - indices[indCount + 3 * i + 1] = i1; + indices[indCount + 3 * i + 0] = i1; + indices[indCount + 3 * i + 1] = i0; indices[indCount + 3 * i + 2] = i0 + 1; addEdge(i0, i0 + 1, true, true); @@ -9165,6 +9248,7 @@ public class PGraphicsOpenGL extends PGraphics { // // Normal calculation + // Expects vertices in CW (left-handed) order. void calcPolyNormal(int i0, int i1, int i2) { int index; diff --git a/core/src/processing/opengl/PJOGL.java b/core/src/processing/opengl/PJOGL.java index 9957204c8..9aa70d2d1 100644 --- a/core/src/processing/opengl/PJOGL.java +++ b/core/src/processing/opengl/PJOGL.java @@ -167,7 +167,7 @@ public class PJOGL extends PGL { /** This countdown latch is used to maintain the synchronization between * Processing's drawing thread and JOGL's rendering thread */ - protected CountDownLatch drawLatch; + protected CountDownLatch drawLatch = new CountDownLatch(0); /** Flag used to do request final display() call to make sure that the * buffers are properly swapped. diff --git a/core/src/processing/opengl/PShapeOpenGL.java b/core/src/processing/opengl/PShapeOpenGL.java index 6db7fddca..a771ff053 100644 --- a/core/src/processing/opengl/PShapeOpenGL.java +++ b/core/src/processing/opengl/PShapeOpenGL.java @@ -58,6 +58,13 @@ import java.util.Stack; * DXF: http://en.wikipedia.org/wiki/AutoCAD_DXF */ public class PShapeOpenGL extends PShape { + // Testing these constants, not use as they might go away... + static public final int POSITION = 0; + static public final int NORMAL = 1; + static public final int TEXCOORD = 2; + static public final int DIRECTION = 3; + static public final int OFFSET = 4; + static protected final int TRANSLATE = 0; static protected final int ROTATE = 1; static protected final int SCALE = 2; @@ -108,6 +115,9 @@ public class PShapeOpenGL extends PShape { public int glPointAttrib; public int glPointIndex; + // Testing this field, not use as it might go away... + public int glUsage = PGL.STATIC_DRAW; + // ........................................................ // Offsets for geometry aggregation and update. @@ -2493,6 +2503,73 @@ public class PShapeOpenGL extends PShape { return tess; } + // Testing this method, not use as it might go away... + public float[] getTessellation(int kind, int data) { + updateTessellation(); + + if (kind == TRIANGLES) { + if (data == POSITION) { + if (is3D()) { + root.setModifiedPolyVertices(firstPolyVertex, lastPolyVertex); + } else if (is2D()) { + int last1 = lastPolyVertex + 1; + if (-1 < firstLineVertex) last1 = firstLineVertex; + if (-1 < firstPointVertex) last1 = firstPointVertex; + root.setModifiedPolyVertices(firstPolyVertex, last1 - 1); + } + return tessGeo.polyVertices; + } else if (data == NORMAL) { + if (is3D()) { + root.setModifiedPolyNormals(firstPolyVertex, lastPolyVertex); + } else if (is2D()) { + int last1 = lastPolyVertex + 1; + if (-1 < firstLineVertex) last1 = firstLineVertex; + if (-1 < firstPointVertex) last1 = firstPointVertex; + root.setModifiedPolyNormals(firstPolyVertex, last1 - 1); + } + return tessGeo.polyNormals; + } else if (data == TEXCOORD) { + if (is3D()) { + root.setModifiedPolyTexCoords(firstPolyVertex, lastPolyVertex); + } else if (is2D()) { + int last1 = lastPolyVertex + 1; + if (-1 < firstLineVertex) last1 = firstLineVertex; + if (-1 < firstPointVertex) last1 = firstPointVertex; + root.setModifiedPolyTexCoords(firstPolyVertex, last1 - 1); + } + return tessGeo.polyTexCoords; + } + } else if (kind == LINES) { + if (data == POSITION) { + if (is3D()) { + root.setModifiedLineVertices(firstLineVertex, lastLineVertex); + } else if (is2D()) { + root.setModifiedPolyVertices(firstLineVertex, lastLineVertex); + } + return tessGeo.lineVertices; + } else if (data == DIRECTION) { + if (is2D()) { + root.setModifiedLineAttributes(firstLineVertex, lastLineVertex); + } + return tessGeo.lineDirections; + } + } else if (kind == POINTS) { + if (data == POSITION) { + if (is3D()) { + root.setModifiedPointVertices(firstPointVertex, lastPointVertex); + } else if (is2D()) { + root.setModifiedPolyVertices(firstPointVertex, lastPointVertex); + } + return tessGeo.pointVertices; + } else if (data == OFFSET) { + if (is2D()) { + root.setModifiedPointAttributes(firstPointVertex, lastPointVertex); + } + return tessGeo.pointOffsets; + } + } + return null; + } /////////////////////////////////////////////////////////// @@ -3652,56 +3729,56 @@ public class PShapeOpenGL extends PShape { glPolyVertex = PGraphicsOpenGL.createVertexBufferObject(context, pgl); pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyVertex); pgl.bufferData(PGL.ARRAY_BUFFER, 4 * sizef, - tessGeo.polyVerticesBuffer, PGL.STATIC_DRAW); + tessGeo.polyVerticesBuffer, glUsage); tessGeo.updatePolyColorsBuffer(); if (glPolyColor == 0) glPolyColor = PGraphicsOpenGL.createVertexBufferObject(context, pgl); pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyColor); pgl.bufferData(PGL.ARRAY_BUFFER, sizei, - tessGeo.polyColorsBuffer, PGL.STATIC_DRAW); + tessGeo.polyColorsBuffer, glUsage); tessGeo.updatePolyNormalsBuffer(); if (glPolyNormal == 0) glPolyNormal = PGraphicsOpenGL.createVertexBufferObject(context, pgl); pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyNormal); pgl.bufferData(PGL.ARRAY_BUFFER, 3 * sizef, - tessGeo.polyNormalsBuffer, PGL.STATIC_DRAW); + tessGeo.polyNormalsBuffer, glUsage); tessGeo.updatePolyTexCoordsBuffer(); if (glPolyTexcoord == 0) glPolyTexcoord = PGraphicsOpenGL.createVertexBufferObject(context, pgl); pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyTexcoord); pgl.bufferData(PGL.ARRAY_BUFFER, 2 * sizef, - tessGeo.polyTexCoordsBuffer, PGL.STATIC_DRAW); + tessGeo.polyTexCoordsBuffer, glUsage); tessGeo.updatePolyAmbientBuffer(); if (glPolyAmbient == 0) glPolyAmbient = PGraphicsOpenGL.createVertexBufferObject(context, pgl); pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyAmbient); pgl.bufferData(PGL.ARRAY_BUFFER, sizei, - tessGeo.polyAmbientBuffer, PGL.STATIC_DRAW); + tessGeo.polyAmbientBuffer, glUsage); tessGeo.updatePolySpecularBuffer(); if (glPolySpecular == 0) glPolySpecular = PGraphicsOpenGL.createVertexBufferObject(context, pgl); pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolySpecular); pgl.bufferData(PGL.ARRAY_BUFFER, sizei, - tessGeo.polySpecularBuffer, PGL.STATIC_DRAW); + tessGeo.polySpecularBuffer, glUsage); tessGeo.updatePolyEmissiveBuffer(); if (glPolyEmissive == 0) glPolyEmissive = PGraphicsOpenGL.createVertexBufferObject(context, pgl); pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyEmissive); pgl.bufferData(PGL.ARRAY_BUFFER, sizei, - tessGeo.polyEmissiveBuffer, PGL.STATIC_DRAW); + tessGeo.polyEmissiveBuffer, glUsage); tessGeo.updatePolyShininessBuffer(); if (glPolyShininess == 0) glPolyShininess = PGraphicsOpenGL.createVertexBufferObject(context, pgl); pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyShininess); pgl.bufferData(PGL.ARRAY_BUFFER, sizef, - tessGeo.polyShininessBuffer, PGL.STATIC_DRAW); + tessGeo.polyShininessBuffer, glUsage); pgl.bindBuffer(PGL.ARRAY_BUFFER, 0); @@ -3711,7 +3788,7 @@ public class PShapeOpenGL extends PShape { pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glPolyIndex); pgl.bufferData(PGL.ELEMENT_ARRAY_BUFFER, tessGeo.polyIndexCount * PGL.SIZEOF_INDEX, - tessGeo.polyIndicesBuffer, PGL.STATIC_DRAW); + tessGeo.polyIndicesBuffer, glUsage); pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0); } @@ -3727,21 +3804,21 @@ public class PShapeOpenGL extends PShape { glLineVertex = PGraphicsOpenGL.createVertexBufferObject(context, pgl); pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineVertex); pgl.bufferData(PGL.ARRAY_BUFFER, 4 * sizef, - tessGeo.lineVerticesBuffer, PGL.STATIC_DRAW); + tessGeo.lineVerticesBuffer, glUsage); tessGeo.updateLineColorsBuffer(); if (glLineColor == 0) glLineColor = PGraphicsOpenGL.createVertexBufferObject(context, pgl); pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineColor); pgl.bufferData(PGL.ARRAY_BUFFER, sizei, - tessGeo.lineColorsBuffer, PGL.STATIC_DRAW); + tessGeo.lineColorsBuffer, glUsage); tessGeo.updateLineDirectionsBuffer(); if (glLineAttrib == 0) glLineAttrib = PGraphicsOpenGL.createVertexBufferObject(context, pgl); pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineAttrib); pgl.bufferData(PGL.ARRAY_BUFFER, 4 * sizef, - tessGeo.lineDirectionsBuffer, PGL.STATIC_DRAW); + tessGeo.lineDirectionsBuffer, glUsage); pgl.bindBuffer(PGL.ARRAY_BUFFER, 0); @@ -3751,7 +3828,7 @@ public class PShapeOpenGL extends PShape { pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glLineIndex); pgl.bufferData(PGL.ELEMENT_ARRAY_BUFFER, tessGeo.lineIndexCount * PGL.SIZEOF_INDEX, - tessGeo.lineIndicesBuffer, PGL.STATIC_DRAW); + tessGeo.lineIndicesBuffer, glUsage); pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0); } @@ -3767,21 +3844,21 @@ public class PShapeOpenGL extends PShape { glPointVertex = PGraphicsOpenGL.createVertexBufferObject(context, pgl); pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointVertex); pgl.bufferData(PGL.ARRAY_BUFFER, 4 * sizef, - tessGeo.pointVerticesBuffer, PGL.STATIC_DRAW); + tessGeo.pointVerticesBuffer, glUsage); tessGeo.updatePointColorsBuffer(); if (glPointColor == 0) glPointColor = PGraphicsOpenGL.createVertexBufferObject(context, pgl); pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointColor); pgl.bufferData(PGL.ARRAY_BUFFER, sizei, - tessGeo.pointColorsBuffer, PGL.STATIC_DRAW); + tessGeo.pointColorsBuffer, glUsage); tessGeo.updatePointOffsetsBuffer(); if (glPointAttrib == 0) glPointAttrib = PGraphicsOpenGL.createVertexBufferObject(context, pgl); pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointAttrib); pgl.bufferData(PGL.ARRAY_BUFFER, 2 * sizef, - tessGeo.pointOffsetsBuffer, PGL.STATIC_DRAW); + tessGeo.pointOffsetsBuffer, glUsage); pgl.bindBuffer(PGL.ARRAY_BUFFER, 0); @@ -3791,7 +3868,7 @@ public class PShapeOpenGL extends PShape { pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glPointIndex); pgl.bufferData(PGL.ELEMENT_ARRAY_BUFFER, tessGeo.pointIndexCount * PGL.SIZEOF_INDEX, - tessGeo.pointIndicesBuffer, PGL.STATIC_DRAW); + tessGeo.pointIndicesBuffer, glUsage); pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0); } diff --git a/java/examples/Demos/Graphics/LowLevelGL/data/vert.glsl b/core/src/processing/opengl/TexlightFrag.glsl similarity index 70% rename from java/examples/Demos/Graphics/LowLevelGL/data/vert.glsl rename to core/src/processing/opengl/TexlightFrag.glsl index 27c255ee5..f423e49d3 100644 --- a/java/examples/Demos/Graphics/LowLevelGL/data/vert.glsl +++ b/core/src/processing/opengl/TexlightFrag.glsl @@ -1,7 +1,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2011-12 Ben Fry and Casey Reas + Copyright (c) 2011-13 Ben Fry and Casey Reas This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -18,14 +18,19 @@ Boston, MA 02111-1307 USA */ -uniform mat4 transform; +#ifdef GL_ES +precision mediump float; +precision mediump int; +#endif -attribute vec4 vertex; -attribute vec4 color; +uniform sampler2D texture; + +uniform vec2 texOffset; varying vec4 vertColor; +varying vec4 backVertColor; +varying vec4 vertTexCoord; void main() { - gl_Position = transform * vertex; - vertColor = color; + gl_FragColor = texture2D(texture, vertTexCoord.st) * (gl_FrontFacing ? vertColor : backVertColor); } \ No newline at end of file diff --git a/core/src/processing/opengl/TexlightVert.glsl b/core/src/processing/opengl/TexlightVert.glsl index 6542bf8fb..d9f2cde3a 100644 --- a/core/src/processing/opengl/TexlightVert.glsl +++ b/core/src/processing/opengl/TexlightVert.glsl @@ -45,6 +45,7 @@ attribute vec4 emissive; attribute float shininess; varying vec4 vertColor; +varying vec4 backVertColor; varying vec4 vertTexCoord; const float zero_float = 0.0; @@ -85,17 +86,17 @@ void main() { // Normal vector in eye coordinates vec3 ecNormal = normalize(normalMatrix * normal); - - if (dot(-one_float * ecVertex, ecNormal) < zero_float) { - // If normal is away from camera, choose its opposite. - // If we add backface culling, this will be backfacing - ecNormal *= -one_float; - } + vec3 ecNormalInv = ecNormal * -one_float; // Light calculations vec3 totalAmbient = vec3(0, 0, 0); - vec3 totalDiffuse = vec3(0, 0, 0); - vec3 totalSpecular = vec3(0, 0, 0); + + vec3 totalFrontDiffuse = vec3(0, 0, 0); + vec3 totalFrontSpecular = vec3(0, 0, 0); + + vec3 totalBackDiffuse = vec3(0, 0, 0); + vec3 totalBackSpecular = vec3(0, 0, 0); + for (int i = 0; i < 8; i++) { if (lightCount == i) break; @@ -121,27 +122,36 @@ void main() { : one_float; if (any(greaterThan(lightAmbient[i], zero_vec3))) { - totalAmbient += lightAmbient[i] * falloff; + totalAmbient += lightAmbient[i] * falloff; } if (any(greaterThan(lightDiffuse[i], zero_vec3))) { - totalDiffuse += lightDiffuse[i] * falloff * spotf * - lambertFactor(lightDir, ecNormal); + totalFrontDiffuse += lightDiffuse[i] * falloff * spotf * + lambertFactor(lightDir, ecNormal); + totalBackDiffuse += lightDiffuse[i] * falloff * spotf * + lambertFactor(lightDir, ecNormalInv); } if (any(greaterThan(lightSpecular[i], zero_vec3))) { - totalSpecular += lightSpecular[i] * falloff * spotf * - blinnPhongFactor(lightDir, ecVertex, ecNormal, shininess); - } + totalFrontSpecular += lightSpecular[i] * falloff * spotf * + blinnPhongFactor(lightDir, ecVertex, ecNormal, shininess); + totalBackSpecular += lightSpecular[i] * falloff * spotf * + blinnPhongFactor(lightDir, ecVertex, ecNormalInv, shininess); + } } // Calculating final color as result of all lights (plus emissive term). // Transparency is determined exclusively by the diffuse component. - vertColor = vec4(totalAmbient, 0) * ambient + - vec4(totalDiffuse, 1) * color + - vec4(totalSpecular, 0) * specular + - vec4(emissive.rgb, 0); + vertColor = vec4(totalAmbient, 0) * ambient + + vec4(totalFrontDiffuse, 1) * color + + vec4(totalFrontSpecular, 0) * specular + + vec4(emissive.rgb, 0); + backVertColor = vec4(totalAmbient, 0) * ambient + + vec4(totalBackDiffuse, 1) * color + + vec4(totalBackSpecular, 0) * specular + + vec4(emissive.rgb, 0); + // Calculating texture coordinates, with r and q set both to one vertTexCoord = texMatrix * vec4(texCoord, 1.0, 1.0); } diff --git a/core/todo.txt b/core/todo.txt index ea362845a..ee3902ee8 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -1,9 +1,90 @@ -0228 core +0229 core (3.0a2) +X PImage resize() causes images to not draw +X https://github.com/processing/processing/issues/2228 +X https://github.com/processing/processing/pull/2324 +X move to native OS X full screen (gets rid of native code) +X https://github.com/processing/processing/issues/2641 +X do bounds check on setVertex(PVector) +X https://github.com/processing/processing/issues/2556 +X using createGraphics() w/o begin/endDraw(), don't attempt drawing w/ image() +X https://github.com/processing/processing/issues/2208 + +data +X add copy() method to Table +X return null from getString() on NaN float and double values +X affects how saveTable() works (writes blank entries instead of NaN) +X get(5) with an empty Int/Float/StringList was returning 0 +X https://github.com/processing/processing/pull/2343 +o fix for maxValue() and minValue() when all entries are bad +o on FloatDict it was NaN, check across the lists and other dict types +X nothing else to do here +X FloatDict and FloatList should always put NaN values at the end on sort +X same for the other list and dict classes +X (this is part of the point of having these easier versions) +o 'collector' class.. Dict that points to a list +o String as a key, int/float/string list as values +X seems too much like a better place for HashMap +X add print() method to other data types (not just IntList) + +pulls +X implement A and a (elliptical arcs) +X https://github.com/processing/processing/issues/169 +X http://code.google.com/p/processing/issues/detail?id=130 +X https://github.com/processing/processing/pull/2659 +X done with an approximation, if re-saving this will destroy data (docs) +X fix typo in StringList.insert() +X https://github.com/processing/processing/pull/2672 +X StingList.insert() error (should be an easy fix) +X https://github.com/processing/processing/issues/2548 + +earlier +X default font fixes (merged for 2.2.1 or earlier) +X https://github.com/processing/processing/issues/2331 +X https://github.com/processing/processing/pull/2338 +X image resize() takes oddly long time +X https://github.com/processing/processing/issues/5 +X the problem was confirmed to have fixed itself + + +applet/component +_ remove Applet as base class +_ performance issues on OS X (might be threading due to Applet) +_ https://github.com/processing/processing/issues/2423 +_ play with improvements to full screen here +_ new full screen sometimes causes sketch to temporarily be in the wrong spot +_ add option to have full screen span across screens +_ display=all in cmd line +_ sketchDisplay() -> 0 for all, or 1, 2, 3... +_ clean up requestFocus() stuff +_ make sure it works with retina/canvas/strategy as well + + +processing.data +_ need a better method for "missing" data in Table +_ if missing int is zero, can't just remove those values from saving a table +_ but for NaN values, it's a necessity +_ get() methods in List/Dict shouldn't allow you to get bad values +_ but set() methods can automatically resize the arrays +_ though that means insert() should allow you to insert past the end +_ addRow() is not efficient, probably need to do the doubling +o or have a setIncrement() function? +_ it would default to 1 on tables loaded from a file +_ and default to doubling when created with "new Table" +_ row count and array size are combined.. need to break apart +_ match and iterators +_ add match version that returns table that's only a pointer to original +_ save the constructor for the version that actually copies data +_ the table pointer version will be speedy and allow chaining + + +later +_ bring back chaining in JSON (and add to XML) +_ maybe once we make the PVector change high -_ pull for image resize and alpha issues -_ https://github.com/processing/processing/pull/2324 +_ Closing opengl sketch from the PDE doesn't stop java process on windows +_ https://github.com/processing/processing/issues/2335 _ dataPath() not working when app is not run from app dir on Linux _ https://github.com/processing/processing/issues/2195 _ "Buffers have not been created" error for sketches w/o draw() @@ -14,38 +95,21 @@ _ some sort of threading issue happening here _ https://github.com/processing/processing/issues/1672 _ https://github.com/processing/processing/issues/2039 (dupe) _ https://github.com/processing/processing/issues/2294 (dupe) +_ also check this out with the new full screen code on OS X _ point() rendering differently in 2.0.3 and 2.1 _ https://github.com/processing/processing/issues/2278 _ internally, we probably have to call set() if it's a 1 pixel point _ but that's going to be a mess.. need to first check the CTM _ tint() not working in PDF (regression between 2.0.3 and 2.1) _ https://github.com/processing/processing/issues/2428 -_ default font fixes -_ https://github.com/processing/processing/issues/2331 -_ https://github.com/processing/processing/pull/2338 -_ add print() method to other data types (not just IntList) _ Sort out blending differences with P2D/P3D _ might be that compatible images not setting alpha mode correctly _ image = gc.createCompatibleVolatileImage(source.width, source.height, Transparency.TRANSLUCENT); _ https://github.com/processing/processing/issues/1844 -_ 'collector' class.. Dict that points to a list -_ String as a key, int/float/string list as values -_ blendMode(ADD) is broken with default renderer -_ https://github.com/processing/processing/issues/2012 -_ may have been introduced between 2.0b7 and 2.0b8 -_ https://github.com/processing/processing/issues/2275 -_ https://github.com/processing/processing/issues/2276 -_ https://github.com/processing/processing/issues/2483 -_ add option to have full screen span across screens -_ display=all in cmd line -_ sketchDisplay() -> 0 for all, or 1, 2, 3... -_ clean up requestFocus() stuff -_ make sure it works with retina/canvas/strategy as well _ finish PFont.getShape() implementation _ needs to have a way to set width/height properly _ draw(s) doesn't work on the returned PShape -_ TGA files writing strangely -_ https://github.com/processing/processing/issues/2096 + hidpi _ saveFrame() with retina render is making black images @@ -56,26 +120,20 @@ _ hint(ENABLE_RETINA_PIXELS) or hint(ENABLE_HIDPI_PIXELS) _ hint(ENABLE_2X_PIXELS)? _ hidpi is Apple's name as well _ no high-res display support for OpenGL +_ https://github.com/processing/processing/issues/2573 +_ https://jogamp.org/bugzilla/show_bug.cgi?id=741 _ no high-dpi support for core on Windows _ https://github.com/processing/processing/issues/2411 _ retina sketches slow to start _ https://github.com/processing/processing/issues/2357 + cantfix _ crash on startup when "Mirror Displays" selected _ suspect that this is a specific chipset since Oracle didn't reproduce _ https://github.com/processing/processing/issues/2186 +_ test with JG's 13" retina laptop -table -_ addRow() is not efficient, probably need to do the doubling -_ or have a setIncrement() function? -_ it would default to 1 on tables loaded from a file -_ and default to doubling when created with "new Table" -_ row count and array size are combined.. need to break apart -_ match and iterators -_ add match version that returns table that's only a pointer to original -_ save the constructor for the version that actually copies data -_ the table pointer version will be speedy and allow chaining decisions/misc _ make join() work with Iterable? @@ -173,6 +231,8 @@ _ is this still true? _ decide how disconnectEvent should actually be handled (and name?) _ was disconnect always there? _ will need documentation +_ negative indices so that we can work relative to the end in data classes? +_ add Double and Long versions of the classes? @@ -313,6 +373,9 @@ _ https://github.com/processing/processing/issues/1727 CORE / PImage +_ TGA files writing strangely +_ https://github.com/processing/processing/issues/2096 + _ don't grab pixels of java2d images unless asked _ this is the difference between a lot of loadPixels() and not _ so important to have it in before beta if that's the change @@ -399,8 +462,6 @@ _ for PShape, need to be able to set the origin (flash people) CORE / PShapeSVG -_ implement A and a (elliptical arcs) -_ http://code.google.com/p/processing/issues/detail?id=130 _ implement support for SVG gradients from Inkscape _ http://code.google.com/p/processing/issues/detail?id=1142 _ need to handle Dan looking into this CORE / OpenGL (Andres) diff --git a/done.txt b/done.txt index 225f3aa3a..bffe7352c 100644 --- a/done.txt +++ b/done.txt @@ -1,3 +1,50 @@ +0228 pde (3.0a1) +X increase heap size to 256m (-Xmx256) per Manindra request +X use a ButtonGroup so that the current Mode cannot be de-selected +X https://github.com/processing/processing/issues/2545 + +earlier +X cpu usage when nothing happening (unmarked duplicate) +X https://github.com/processing/processing/issues/1074 + +gsoc +X Line coloring incorrect for filtered contribution listings +X https://github.com/processing/processing/issues/2583 +X https://github.com/processing/processing/pull/2598 +X Added Present's background color as an option to the Preferences window +X https://github.com/processing/processing/pull/2568 +X check for updates with contribs +X https://github.com/processing/processing/pull/2636 +X shows update manager on startup +X contrib properties files ignored in favor of contributions.txt from p5.org +X https://github.com/processing/processing/issues/2572 +X tweak mode integrated +X https://github.com/processing/processing/pull/2624 +X wrong mode selected if sketch is modified (checkbox changes) +X https://github.com/processing/processing/issues/2615 +X https://github.com/processing/processing/issues/2586 +X Add date and time stamps to the Contribution Manager +X https://github.com/processing/processing/pull/2651 + +pulls +X Implementation of a list of open sketches in the Sketch menu +X https://github.com/processing/processing/pull/2551 +X color selector for the pref (not reading it properly) +X https://github.com/processing/processing/pull/2568 +X lighting issues with non-planar triangle strips or quad strips +X https://github.com/processing/processing/issues/2014 +X https://github.com/processing/processing/issues/2018 +X https://github.com/processing/processing/pull/2644 +X set application name on Linux +X https://github.com/processing/processing/issues/2534 +X https://github.com/processing/processing/pull/2584 +X serial not working on export +X https://github.com/processing/processing/issues/2559 +X build error on Windows +X https://github.com/processing/processing/issues/2603 +X https://github.com/processing/processing/pull/2610 + + 0227 pde (2.2.1) X use mouseReleased() instead of mousePressed() in color selector X otherwise it registers the release as a click in the color window diff --git a/java/examples/Basics/Arrays/Array/Array.pde b/java/examples/Basics/Arrays/Array/Array.pde deleted file mode 100644 index c060b476c..000000000 --- a/java/examples/Basics/Arrays/Array/Array.pde +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Array. - * - * An array is a list of data. Each piece of data in an array - * is identified by an index number representing its position in - * the array. Arrays are zero based, which means that the first - * element in the array is [0], the second element is [1], and so on. - * In this example, an array named "coswav" is created and - * filled with the cosine values. This data is displayed three - * separate ways on the screen. - */ - - -float[] coswave; - -void setup() { - size(640, 360); - coswave = new float[width]; - for (int i = 0; i < width; i++) { - float amount = map(i, 0, width, 0, PI); - coswave[i] = abs(cos(amount)); - } - background(255); - noLoop(); -} - -void draw() { - - int y1 = 0; - int y2 = height/3; - for (int i = 0; i < width; i+=2) { - stroke(coswave[i]*255); - line(i, y1, i, y2); - } - - y1 = y2; - y2 = y1 + y1; - for (int i = 0; i < width; i+=2) { - stroke(coswave[i]*255 / 4); - line(i, y1, i, y2); - } - - y1 = y2; - y2 = height; - for (int i = 0; i < width; i+=2) { - stroke(255 - coswave[i]*255); - line(i, y1, i, y2); - } - -} - diff --git a/java/examples/Basics/Arrays/Array2D/Array2D.pde b/java/examples/Basics/Arrays/Array2D/Array2D.pde deleted file mode 100644 index c985f834c..000000000 --- a/java/examples/Basics/Arrays/Array2D/Array2D.pde +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Array 2D. - * - * Demonstrates the syntax for creating a two-dimensional (2D) array. - * Values in a 2D array are accessed through two index values. - * 2D arrays are useful for storing images. In this example, each dot - * is colored in relation to its distance from the center of the image. - */ - -float[][] distances; -float maxDistance; -int spacer; - -void setup() { - size(640, 360); - maxDistance = dist(width/2, height/2, width, height); - distances = new float[width][height]; - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - float distance = dist(width/2, height/2, x, y); - distances[x][y] = distance/maxDistance * 255; - } - } - spacer = 10; - noLoop(); // Run once and stop -} - -void draw() { - background(0); - // This embedded loop skips over values in the arrays based on - // the spacer variable, so there are more values in the array - // than are drawn here. Change the value of the spacer variable - // to change the density of the points - for (int y = 0; y < height; y += spacer) { - for (int x = 0; x < width; x += spacer) { - stroke(distances[x][y]); - point(x + spacer/2, y + spacer/2); - } - } -} - - - diff --git a/java/examples/Basics/Arrays/ArrayObjects/ArrayObjects.pde b/java/examples/Basics/Arrays/ArrayObjects/ArrayObjects.pde deleted file mode 100644 index a447148ef..000000000 --- a/java/examples/Basics/Arrays/ArrayObjects/ArrayObjects.pde +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Array Objects. - * - * Demonstrates the syntax for creating an array of custom objects. - */ - -int unit = 40; -int count; -Module[] mods; - -void setup() { - size(640, 360); - noStroke(); - int wideCount = width / unit; - int highCount = height / unit; - count = wideCount * highCount; - mods = new Module[count]; - - int index = 0; - for (int y = 0; y < highCount; y++) { - for (int x = 0; x < wideCount; x++) { - mods[index++] = new Module(x*unit, y*unit, unit/2, unit/2, random(0.05, 0.8), unit); - } - } -} - -void draw() { - background(0); - for (int i = 0; i < count; i++) { - mods[i].update(); - mods[i].draw(); - } -} - diff --git a/java/examples/Basics/Arrays/ArrayObjects/Module.pde b/java/examples/Basics/Arrays/ArrayObjects/Module.pde deleted file mode 100644 index a7f174edd..000000000 --- a/java/examples/Basics/Arrays/ArrayObjects/Module.pde +++ /dev/null @@ -1,39 +0,0 @@ -class Module { - int xOffset; - int yOffset; - float x, y; - int unit; - int xDirection = 1; - int yDirection = 1; - float speed; - - // Contructor - Module(int xOffsetTemp, int yOffsetTemp, int xTemp, int yTemp, float speedTemp, int tempUnit) { - xOffset = xOffsetTemp; - yOffset = yOffsetTemp; - x = xTemp; - y = yTemp; - speed = speedTemp; - unit = tempUnit; - } - - // Custom method for updating the variables - void update() { - x = x + (speed * xDirection); - if (x >= unit || x <= 0) { - xDirection *= -1; - x = x + (1 * xDirection); - y = y + (1 * yDirection); - } - if (y >= unit || y <= 0) { - yDirection *= -1; - y = y + (1 * yDirection); - } - } - - // Custom method for drawing the object - void draw() { - fill(255); - ellipse(xOffset + x, yOffset + y, 6, 6); - } -} diff --git a/java/examples/Basics/Camera/MoveEye/MoveEye.pde b/java/examples/Basics/Camera/MoveEye/MoveEye.pde deleted file mode 100644 index 6a6384640..000000000 --- a/java/examples/Basics/Camera/MoveEye/MoveEye.pde +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Move Eye. - * by Simon Greenwold. - * - * The camera lifts up (controlled by mouseY) while looking at the same point. - */ - -void setup() { - size(640, 360, P3D); - fill(204); -} - -void draw() { - lights(); - background(0); - - // Change height of the camera with mouseY - camera(30.0, mouseY, 220.0, // eyeX, eyeY, eyeZ - 0.0, 0.0, 0.0, // centerX, centerY, centerZ - 0.0, 1.0, 0.0); // upX, upY, upZ - - noStroke(); - box(90); - stroke(255); - line(-100, 0, 0, 100, 0, 0); - line(0, -100, 0, 0, 100, 0); - line(0, 0, -100, 0, 0, 100); -} diff --git a/java/examples/Basics/Camera/Orthographic/Orthographic.pde b/java/examples/Basics/Camera/Orthographic/Orthographic.pde deleted file mode 100644 index e13e4eaaf..000000000 --- a/java/examples/Basics/Camera/Orthographic/Orthographic.pde +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Perspective vs. Ortho - * - * Move the mouse left to right to change the "far" - * parameter for the perspective() and ortho() functions. - * This parameter sets the maximum distance from the - * origin away from the viewer and will clip the geometry. - * Click a mouse button to switch between the perspective and - * orthographic projections. - */ - - -boolean showPerspective = false; - -void setup() { - size(600, 360, P3D); - noFill(); - fill(255); - noStroke(); -} - -void draw() { - lights(); - background(0); - float far = map(mouseX, 0, width, 120, 400); - if (showPerspective == true) { - perspective(PI/3.0, float(width)/float(height), 10, far); - } else { - ortho(0, width, 0, height, 10, far); - } - translate(width/2, height/2, 0); - rotateX(-PI/6); - rotateY(PI/3); - box(180); -} - -void mousePressed() { - showPerspective = !showPerspective; -} - diff --git a/java/examples/Basics/Camera/Perspective/Perspective.pde b/java/examples/Basics/Camera/Perspective/Perspective.pde deleted file mode 100644 index 46695397d..000000000 --- a/java/examples/Basics/Camera/Perspective/Perspective.pde +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Perspective. - * - * Move the mouse left and right to change the field of view (fov). - * Click to modify the aspect ratio. The perspective() function - * sets a perspective projection applying foreshortening, making - * distant objects appear smaller than closer ones. The parameters - * define a viewing volume with the shape of truncated pyramid. - * Objects near to the front of the volume appear their actual size, - * while farther objects appear smaller. This projection simulates - * the perspective of the world more accurately than orthographic projection. - * The version of perspective without parameters sets the default - * perspective and the version with four parameters allows the programmer - * to set the area precisely. - */ - -void setup() { - size(640, 360, P3D); - noStroke(); -} - -void draw() { - lights(); - background(204); - float cameraY = height/2.0; - float fov = mouseX/float(width) * PI/2; - float cameraZ = cameraY / tan(fov / 2.0); - float aspect = float(width)/float(height); - if (mousePressed) { - aspect = aspect / 2.0; - } - perspective(fov, aspect, cameraZ/10.0, cameraZ*10.0); - - translate(width/2+30, height/2, 0); - rotateX(-PI/6); - rotateY(PI/3 + mouseY/float(height) * PI); - box(45); - translate(0, 0, -50); - box(30); -} - diff --git a/java/examples/Basics/Color/Brightness/Brightness.pde b/java/examples/Basics/Color/Brightness/Brightness.pde deleted file mode 100644 index 261fdce38..000000000 --- a/java/examples/Basics/Color/Brightness/Brightness.pde +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Brightness - * by Rusty Robison. - * - * Brightness is the relative lightness or darkness of a color. - * Move the cursor vertically over each bar to alter its brightness. - */ - -int barWidth = 20; -int lastBar = -1; - -void setup() { - size(640, 360); - colorMode(HSB, width, 100, width); - noStroke(); - background(0); -} - -void draw() { - int whichBar = mouseX / barWidth; - if (whichBar != lastBar) { - int barX = whichBar * barWidth; - fill(barX, 100, mouseY); - rect(barX, 0, barWidth, height); - lastBar = whichBar; - } -} diff --git a/java/examples/Basics/Color/ColorVariables/ColorVariables.pde b/java/examples/Basics/Color/ColorVariables/ColorVariables.pde deleted file mode 100644 index 8b62969ab..000000000 --- a/java/examples/Basics/Color/ColorVariables/ColorVariables.pde +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Color Variables (Homage to Albers). - * - * This example creates variables for colors that may be referred to - * in the program by a name, rather than a number. - */ - -size(640, 360); -noStroke(); -background(51, 0, 0); - -color inside = color(204, 102, 0); -color middle = color(204, 153, 0); -color outside = color(153, 51, 0); - -// These statements are equivalent to the statements above. -// Programmers may use the format they prefer. -//color inside = #CC6600; -//color middle = #CC9900; -//color outside = #993300; - -pushMatrix(); -translate(80, 80); -fill(outside); -rect(0, 0, 200, 200); -fill(middle); -rect(40, 60, 120, 120); -fill(inside); -rect(60, 90, 80, 80); -popMatrix(); - -pushMatrix(); -translate(360, 80); -fill(inside); -rect(0, 0, 200, 200); -fill(outside); -rect(40, 60, 120, 120); -fill(middle); -rect(60, 90, 80, 80); -popMatrix(); diff --git a/java/examples/Basics/Color/Hue/Hue.pde b/java/examples/Basics/Color/Hue/Hue.pde deleted file mode 100644 index d2d0c28ed..000000000 --- a/java/examples/Basics/Color/Hue/Hue.pde +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Hue. - * - * Hue is the color reflected from or transmitted through an object - * and is typically referred to as the name of the color (red, blue, yellow, etc.) - * Move the cursor vertically over each bar to alter its hue. - */ - -int barWidth = 20; -int lastBar = -1; - -void setup() -{ - size(640, 360); - colorMode(HSB, height, height, height); - noStroke(); - background(0); -} - -void draw() -{ - int whichBar = mouseX / barWidth; - if (whichBar != lastBar) { - int barX = whichBar * barWidth; - fill(mouseY, height, height); - rect(barX, 0, barWidth, height); - lastBar = whichBar; - } -} - diff --git a/java/examples/Basics/Color/LinearGradient/LinearGradient.pde b/java/examples/Basics/Color/LinearGradient/LinearGradient.pde deleted file mode 100644 index f83b522f5..000000000 --- a/java/examples/Basics/Color/LinearGradient/LinearGradient.pde +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Simple Linear Gradient - * - * The lerpColor() function is useful for interpolating - * between two colors. - */ - -// Constants -int Y_AXIS = 1; -int X_AXIS = 2; -color b1, b2, c1, c2; - -void setup() { - size(640, 360); - - // Define colors - b1 = color(255); - b2 = color(0); - c1 = color(204, 102, 0); - c2 = color(0, 102, 153); - - noLoop(); -} - -void draw() { - // Background - setGradient(0, 0, width/2, height, b1, b2, X_AXIS); - setGradient(width/2, 0, width/2, height, b2, b1, X_AXIS); - // Foreground - setGradient(50, 90, 540, 80, c1, c2, Y_AXIS); - setGradient(50, 190, 540, 80, c2, c1, X_AXIS); -} - -void setGradient(int x, int y, float w, float h, color c1, color c2, int axis ) { - - noFill(); - - if (axis == Y_AXIS) { // Top to bottom gradient - for (int i = y; i <= y+h; i++) { - float inter = map(i, y, y+h, 0, 1); - color c = lerpColor(c1, c2, inter); - stroke(c); - line(x, i, x+w, i); - } - } - else if (axis == X_AXIS) { // Left to right gradient - for (int i = x; i <= x+w; i++) { - float inter = map(i, x, x+w, 0, 1); - color c = lerpColor(c1, c2, inter); - stroke(c); - line(i, y, i, y+h); - } - } -} - diff --git a/java/examples/Basics/Color/RadialGradient/RadialGradient.pde b/java/examples/Basics/Color/RadialGradient/RadialGradient.pde deleted file mode 100644 index ed358a1e5..000000000 --- a/java/examples/Basics/Color/RadialGradient/RadialGradient.pde +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Radial Gradient. - * - * Draws are series of concentric circles to create a gradient - * from one color to another. - */ - -int dim; - -void setup() { - size(640, 360); - dim = width/2; - background(0); - colorMode(HSB, 360, 100, 100); - noStroke(); - ellipseMode(RADIUS); - frameRate(1); -} - -void draw() { - background(0); - for (int x = 0; x <= width; x+=dim) { - drawGradient(x, height/2); - } -} - -void drawGradient(float x, float y) { - int radius = dim/2; - float h = random(0, 360); - for (int r = radius; r > 0; --r) { - fill(h, 90, 90); - ellipse(x, y, r, r); - h = (h + 1) % 360; - } -} - diff --git a/java/examples/Basics/Color/Relativity/Relativity.pde b/java/examples/Basics/Color/Relativity/Relativity.pde deleted file mode 100644 index 6ca87cd70..000000000 --- a/java/examples/Basics/Color/Relativity/Relativity.pde +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Relativity. - * - * Each color is perceived in relation to other colors. The top and bottom - * bars each contain the same component colors, but a different display order - * causes individual colors to appear differently. - */ - -color a, b, c, d, e; - -void setup() { - size(640, 360); - noStroke(); - a = color(165, 167, 20); - b = color(77, 86, 59); - c = color(42, 106, 105); - d = color(165, 89, 20); - e = color(146, 150, 127); - noLoop(); // Draw only one time -} - -void draw() { - drawBand(a, b, c, d, e, 0, width/128); - drawBand(c, a, d, b, e, height/2, width/128); -} - -void drawBand(color v, color w, color x, color y, color z, int ypos, int barWidth) { - int num = 5; - color[] colorOrder = { v, w, x, y, z }; - for(int i = 0; i < width; i += barWidth*num) { - for(int j = 0; j < num; j++) { - fill(colorOrder[j]); - rect(i+j*barWidth, ypos, barWidth, height/2); - } - } -} - - - - - - diff --git a/java/examples/Basics/Color/Saturation/Saturation.pde b/java/examples/Basics/Color/Saturation/Saturation.pde deleted file mode 100644 index c7a0c3c73..000000000 --- a/java/examples/Basics/Color/Saturation/Saturation.pde +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Saturation. - * - * Saturation is the strength or purity of the color and represents the - * amount of gray in proportion to the hue. A "saturated" color is pure - * and an "unsaturated" color has a large percentage of gray. - * Move the cursor vertically over each bar to alter its saturation. - */ - -int barWidth = 20; -int lastBar = -1; - - -void setup() { - size(640, 360); - colorMode(HSB, width, height, 100); - noStroke(); -} - - -void draw() { - int whichBar = mouseX / barWidth; - if (whichBar != lastBar) { - int barX = whichBar * barWidth; - fill(barX, mouseY, 66); - rect(barX, 0, barWidth, height); - lastBar = whichBar; - } -} diff --git a/java/examples/Basics/Color/WaveGradient/WaveGradient.pde b/java/examples/Basics/Color/WaveGradient/WaveGradient.pde deleted file mode 100644 index 19cc4a599..000000000 --- a/java/examples/Basics/Color/WaveGradient/WaveGradient.pde +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Wave Gradient - * by Ira Greenberg. - * - * Generate a gradient along a sin() wave. - */ - -float angle = 0; -float px = 0, py = 0; -float amplitude = 30; -float frequency = 0; -float fillGap = 2.5; -color c; - -void setup() { - size(640, 360); - background(200); - noLoop(); -} - -void draw() { - for (int i =- 75; i < height+75; i++){ - // Reset angle to 0, so waves stack properly - angle = 0; - // Increasing frequency causes more gaps - frequency+=.002; - for (float j = 0; j < width+75; j++){ - py = i + sin(radians(angle)) * amplitude; - angle += frequency; - c = color(abs(py-i)*255/amplitude, 255-abs(py-i)*255/amplitude, j*(255.0/(width+50))); - // Hack to fill gaps. Raise value of fillGap if you increase frequency - for (int filler = 0; filler < fillGap; filler++){ - set(int(j-filler), int(py)-filler, c); - set(int(j), int(py), c); - set(int(j+filler), int(py)+filler, c); - } - } - } -} diff --git a/java/examples/Basics/Control/Conditionals1/Conditionals1.pde b/java/examples/Basics/Control/Conditionals1/Conditionals1.pde deleted file mode 100644 index ea70e67b8..000000000 --- a/java/examples/Basics/Control/Conditionals1/Conditionals1.pde +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Conditionals 1. - * - * Conditions are like questions. - * They allow a program to decide to take one action if - * the answer to a question is true or to do another action - * if the answer to the question is false. - * The questions asked within a program are always logical - * or relational statements. For example, if the variable 'i' is - * equal to zero then draw a line. - */ - -size(640, 360); -background(0); - -for(int i = 10; i < width; i += 10) { - // If 'i' divides by 20 with no remainder draw the first line - // else draw the second line - if(i%20 == 0) { - stroke(255); - line(i, 80, i, height/2); - } else { - stroke(153); - line(i, 20, i, 180); - } -} diff --git a/java/examples/Basics/Control/Conditionals2/Conditionals2.pde b/java/examples/Basics/Control/Conditionals2/Conditionals2.pde deleted file mode 100644 index b43be6e2c..000000000 --- a/java/examples/Basics/Control/Conditionals2/Conditionals2.pde +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Conditionals 2. - * - * We extend the language of conditionals from the previous - * example by adding the keyword "else". This allows conditionals - * to ask two or more sequential questions, each with a different - * action. - */ - -size(640, 360); -background(0); - -for(int i = 2; i < width-2; i += 2) { - // If 'i' divides by 20 with no remainder - if((i % 20) == 0) { - stroke(255); - line(i, 80, i, height/2); - // If 'i' divides by 10 with no remainder - } else if ((i % 10) == 0) { - stroke(153); - line(i, 20, i, 180); - // If neither of the above two conditions are met - // then draw this line - } else { - stroke(102); - line(i, height/2, i, height-20); - } -} diff --git a/java/examples/Basics/Control/EmbeddedIteration/EmbeddedIteration.pde b/java/examples/Basics/Control/EmbeddedIteration/EmbeddedIteration.pde deleted file mode 100644 index 700657d5f..000000000 --- a/java/examples/Basics/Control/EmbeddedIteration/EmbeddedIteration.pde +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Embedding Iteration. - * - * Embedding "for" structures allows repetition in two dimensions. - * - */ - - -size(640, 360); -background(0); -noStroke(); - -int gridSize = 40; - -for (int x = gridSize; x <= width - gridSize; x += gridSize) { - for (int y = gridSize; y <= height - gridSize; y += gridSize) { - noStroke(); - fill(255); - rect(x-1, y-1, 3, 3); - stroke(255, 50); - line(x, y, width/2, height/2); - } -} - diff --git a/java/examples/Basics/Control/Iteration/Iteration.pde b/java/examples/Basics/Control/Iteration/Iteration.pde deleted file mode 100644 index 635f473e3..000000000 --- a/java/examples/Basics/Control/Iteration/Iteration.pde +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Iteration. - * - * Iteration with a "for" structure to construct repetitive forms. - */ - -int y; -int num = 14; - -size(640, 360); -background(102); -noStroke(); - -// Draw gray bars -fill(255); -y = 60; -for(int i = 0; i < num/3; i++) { - rect(50, y, 475, 10); - y+=20; -} - -// Gray bars -fill(51); -y = 40; -for(int i = 0; i < num; i++) { - rect(405, y, 30, 10); - y += 20; -} -y = 50; -for(int i = 0; i < num; i++) { - rect(425, y, 30, 10); - y += 20; -} - -// Thin lines -y = 45; -fill(0); -for(int i = 0; i < num-1; i++) { - rect(120, y, 40, 1); - y+= 20; -} diff --git a/java/examples/Basics/Control/LogicalOperators/LogicalOperators.pde b/java/examples/Basics/Control/LogicalOperators/LogicalOperators.pde deleted file mode 100644 index eb20ea7bc..000000000 --- a/java/examples/Basics/Control/LogicalOperators/LogicalOperators.pde +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Logical Operators. - * - * The logical operators for AND (&&) and OR (||) are used to - * combine simple relational statements into more complex expressions. - * The NOT (!) operator is used to negate a boolean statement. - */ - -size(640, 360); -background(126); - -boolean test = false; - -for (int i = 5; i <= height; i += 5) { - // Logical AND - stroke(0); - if((i > 35) && (i < 100)) { - line(width/4, i, width/2, i); - test = false; - } - - // Logical OR - stroke(76); - if ((i <= 35) || (i >= 100)) { - line(width/2, i, width, i); - test = true; - } - - // Testing if a boolean value is "true" - // The expression "if(test)" is equivalent to "if(test == true)" - if (test) { - stroke(0); - point(width/3, i); - } - - // Testing if a boolean value is "false" - // The expression "if(!test)" is equivalent to "if(test == false)" - if (!test) { - stroke(255); - point(width/4, i); - } -} - - - diff --git a/java/examples/Basics/Data/CharactersStrings/CharactersStrings.pde b/java/examples/Basics/Data/CharactersStrings/CharactersStrings.pde deleted file mode 100644 index 4c5b697bd..000000000 --- a/java/examples/Basics/Data/CharactersStrings/CharactersStrings.pde +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Characters Strings. - * - * The character datatype, abbreviated as char, stores letters and - * symbols in the Unicode format, a coding system developed to support - * a variety of world languages. Characters are distinguished from other - * symbols by putting them between single quotes ('P').
- *
- * A string is a sequence of characters. A string is noted by surrounding - * a group of letters with double quotes ("Processing"). - * Chars and strings are most often used with the keyboard methods, - * to display text to the screen, and to load images or files.
- *
- * The String datatype must be capitalized because it is a complex datatype. - * A String is actually a class with its own methods, some of which are - * featured below. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs font="Georgia.ttf"; */ - -char letter; -String words = "Begin..."; - -void setup() { - size(640, 360); - // Create the font - textFont(createFont("Georgia", 36)); -} - -void draw() { - background(0); // Set background to black - - // Draw the letter to the center of the screen - textSize(14); - text("Click on the program, then type to add to the String", 50, 50); - text("Current key: " + letter, 50, 70); - text("The String is " + words.length() + " characters long", 50, 90); - - textSize(36); - text(words, 50, 120, 540, 300); -} - -void keyPressed() { - // The variable "key" always contains the value - // of the most recent key pressed. - if ((key >= 'A' && key <= 'z') || key == ' ') { - letter = key; - words = words + key; - // Write the letter to the console - println(key); - } -} diff --git a/java/examples/Basics/Data/CharactersStrings/data/Georgia.ttf b/java/examples/Basics/Data/CharactersStrings/data/Georgia.ttf deleted file mode 100644 index 27d1c1951..000000000 Binary files a/java/examples/Basics/Data/CharactersStrings/data/Georgia.ttf and /dev/null differ diff --git a/java/examples/Basics/Data/DatatypeConversion/DatatypeConversion.pde b/java/examples/Basics/Data/DatatypeConversion/DatatypeConversion.pde deleted file mode 100644 index 1c9196cb6..000000000 --- a/java/examples/Basics/Data/DatatypeConversion/DatatypeConversion.pde +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Datatype Conversion. - * - * It is sometimes beneficial to convert a value from one type of - * data to another. Each of the conversion functions converts its parameter - * to an equivalent representation within its datatype. - * The conversion functions include int(), float(), char(), byte(), and others. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs font="Georgia.ttf"; */ - -size(640, 360); -background(0); -noStroke(); - -textFont(createFont("Georgia",24)); - -char c; // Chars are used for storing alphanumeric symbols -float f; // Floats are decimal numbers -int i; // Integers are values between 2,147,483,647 and -2147483648 -byte b; // Bytes are values between -128 and 128 - -c = 'A'; -f = float(c); // Sets f = 65.0 -i = int(f * 1.4); // Sets i to 91 -b = byte(c / 2); // Sets b to 32 - -//println(f); -//println(i); -//println(b); - -text("The value of variable c is " + c, 50, 100); -text("The value of variable f is " + f, 50, 150); -text("The value of variable i is " + i, 50, 200); -text("The value of variable b is " + b, 50, 250); diff --git a/java/examples/Basics/Data/DatatypeConversion/data/Georgia.ttf b/java/examples/Basics/Data/DatatypeConversion/data/Georgia.ttf deleted file mode 100644 index 27d1c1951..000000000 Binary files a/java/examples/Basics/Data/DatatypeConversion/data/Georgia.ttf and /dev/null differ diff --git a/java/examples/Basics/Data/IntegersFloats/IntegersFloats.pde b/java/examples/Basics/Data/IntegersFloats/IntegersFloats.pde deleted file mode 100644 index 19b13cb48..000000000 --- a/java/examples/Basics/Data/IntegersFloats/IntegersFloats.pde +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Integers Floats. - * - * Integers and floats are two different kinds of numerical data. - * An integer (more commonly called an int) is a number without - * a decimal point. A float is a floating-point number, which means - * it is a number that has a decimal place. Floats are used when - * more precision is needed. - */ - -int a = 0; // Create a variable "a" of the datatype "int" -float b = 0.0; // Create a variable "b" of the datatype "float" - -void setup() { - size(640, 360); - stroke(255); - frameRate(30); -} - -void draw() { - background(0); - - a = a + 1; - b = b + 0.2; - line(a, 0, a, height/2); - line(b, height/2, b, height); - - if(a > width) { - a = 0; - } - if(b > width) { - b = 0; - } -} diff --git a/java/examples/Basics/Data/TrueFalse/TrueFalse.pde b/java/examples/Basics/Data/TrueFalse/TrueFalse.pde deleted file mode 100644 index d7d6c02ee..000000000 --- a/java/examples/Basics/Data/TrueFalse/TrueFalse.pde +++ /dev/null @@ -1,37 +0,0 @@ -/** - * True/False. - * - * A Boolean variable has only two possible values: true or false. - * It is common to use Booleans with control statements to - * determine the flow of a program. In this example, when the - * boolean value "x" is true, vertical black lines are drawn and when - * the boolean value "x" is false, horizontal gray lines are drawn. - */ - -boolean b = false; - -size(640, 360); -background(0); -stroke(255); - -int d = 20; -int middle = width/2;; - -for (int i = d; i <= width; i += d) { - - if (i < middle) { - b = true; - } else { - b = false; - } - - if (b == true) { - // Vertical line - line(i, d, i, height-d); - } - - if (b == false) { - // Horizontal line - line(middle, i - middle + d, width-d, i - middle + d); - } -} diff --git a/java/examples/Basics/Data/VariableScope/VariableScope.pde b/java/examples/Basics/Data/VariableScope/VariableScope.pde deleted file mode 100644 index 9141c157a..000000000 --- a/java/examples/Basics/Data/VariableScope/VariableScope.pde +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Variable Scope. - * - * Variables have a global or local "scope". - * For example, variables declared within either the - * setup() or draw() functions may be only used in these - * functions. Global variables, variables declared outside - * of setup() and draw(), may be used anywhere within the program. - * If a local variable is declared with the same name as a - * global variable, the program will use the local variable to make - * its calculations within the current scope. Variables are localized - * within each block, the space between a { and }. - */ - -int a = 80; // Create a global variable "a" - -void setup() { - size(640, 360); - background(0); - stroke(255); - noLoop(); -} - -void draw() { - // Draw a line using the global variable "a" - line(a, 0, a, height); - - // Create a new variable "a" local to the for() statement - for (int a = 120; a < 200; a += 2) { - line(a, 0, a, height); - } - - // Create a new variable "a" local to the draw() function - int a = 300; - // Draw a line using the new local variable "a" - line(a, 0, a, height); - - // Make a call to the custom function drawAnotherLine() - drawAnotherLine(); - - // Make a call to the custom function setYetAnotherLine() - drawYetAnotherLine(); -} - -void drawAnotherLine() { - // Create a new variable "a" local to this method - int a = 320; - // Draw a line using the local variable "a" - line(a, 0, a, height); -} - -void drawYetAnotherLine() { - // Because no new local variable "a" is set, - // this lines draws using the original global - // variable "a" which is set to the value 20. - line(a+2, 0, a+2, height); -} diff --git a/java/examples/Basics/Data/Variables/Variables.pde b/java/examples/Basics/Data/Variables/Variables.pde deleted file mode 100644 index ea35e2e8e..000000000 --- a/java/examples/Basics/Data/Variables/Variables.pde +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Variables. - * - * Variables are used for storing values. In this example, change - * the values of variables to affect the composition. - */ - -size(640, 360); -background(0); -stroke(153); -strokeWeight(4); -strokeCap(SQUARE); - -int a = 50; -int b = 120; -int c = 180; - -line(a, b, a+c, b); -line(a, b+10, a+c, b+10); -line(a, b+20, a+c, b+20); -line(a, b+30, a+c, b+30); - -a = a + c; -b = height-b; - -line(a, b, a+c, b); -line(a, b+10, a+c, b+10); -line(a, b+20, a+c, b+20); -line(a, b+30, a+c, b+30); - -a = a + c; -b = height-b; - -line(a, b, a+c, b); -line(a, b+10, a+c, b+10); -line(a, b+20, a+c, b+20); -line(a, b+30, a+c, b+30); - - - diff --git a/java/examples/Basics/Form/Bezier/Bezier.pde b/java/examples/Basics/Form/Bezier/Bezier.pde deleted file mode 100644 index bf3c46acc..000000000 --- a/java/examples/Basics/Form/Bezier/Bezier.pde +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Bezier. - * - * The first two parameters for the bezier() function specify the - * first point in the curve and the last two parameters specify - * the last point. The middle parameters set the control points - * that define the shape of the curve. - */ - -void setup() { - size(640, 360); - stroke(255); - noFill(); -} - -void draw() { - background(0); - for (int i = 0; i < 200; i += 20) { - bezier(mouseX-(i/2.0), 40+i, 410, 20, 440, 300, 240-(i/16.0), 300+(i/8.0)); - } -} - diff --git a/java/examples/Basics/Form/PieChart/PieChart.pde b/java/examples/Basics/Form/PieChart/PieChart.pde deleted file mode 100644 index 915a1ef7e..000000000 --- a/java/examples/Basics/Form/PieChart/PieChart.pde +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Pie Chart - * - * Uses the arc() function to generate a pie chart from the data - * stored in an array. - */ - -int[] angles = { 30, 10, 45, 35, 60, 38, 75, 67 }; - -void setup() { - size(640, 360); - noStroke(); - noLoop(); // Run once and stop -} - -void draw() { - background(100); - pieChart(300, angles); -} - -void pieChart(float diameter, int[] data) { - float lastAngle = 0; - for (int i = 0; i < data.length; i++) { - float gray = map(i, 0, data.length, 0, 255); - fill(gray); - arc(width/2, height/2, diameter, diameter, lastAngle, lastAngle+radians(angles[i])); - lastAngle += radians(angles[i]); - } -} - diff --git a/java/examples/Basics/Form/PointsLines/PointsLines.pde b/java/examples/Basics/Form/PointsLines/PointsLines.pde deleted file mode 100644 index ec0529bb1..000000000 --- a/java/examples/Basics/Form/PointsLines/PointsLines.pde +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Points and Lines. - * - * Points and lines can be used to draw basic geometry. - * Change the value of the variable 'd' to scale the form. - * The four variables set the positions based on the value of 'd'. - */ - -int d = 70; -int p1 = d; -int p2 = p1+d; -int p3 = p2+d; -int p4 = p3+d; - -size(640, 360); -noSmooth(); -background(0); -translate(140, 0); - -// Draw gray box -stroke(153); -line(p3, p3, p2, p3); -line(p2, p3, p2, p2); -line(p2, p2, p3, p2); -line(p3, p2, p3, p3); - -// Draw white points -stroke(255); -point(p1, p1); -point(p1, p3); -point(p2, p4); -point(p3, p1); -point(p4, p2); -point(p4, p4); diff --git a/java/examples/Basics/Form/Primitives3D/Primitives3D.pde b/java/examples/Basics/Form/Primitives3D/Primitives3D.pde deleted file mode 100644 index 053301190..000000000 --- a/java/examples/Basics/Form/Primitives3D/Primitives3D.pde +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Primitives 3D. - * - * Placing mathematically 3D objects in synthetic space. - * The lights() method reveals their imagined dimension. - * The box() and sphere() functions each have one parameter - * which is used to specify their size. These shapes are - * positioned using the translate() function. - */ - -size(640, 360, P3D); -background(0); -lights(); - -noStroke(); -pushMatrix(); -translate(130, height/2, 0); -rotateY(1.25); -rotateX(-0.4); -box(100); -popMatrix(); - -noFill(); -stroke(255); -pushMatrix(); -translate(500, height*0.35, -200); -sphere(280); -popMatrix(); - - diff --git a/java/examples/Basics/Form/RegularPolygon/RegularPolygon.pde b/java/examples/Basics/Form/RegularPolygon/RegularPolygon.pde deleted file mode 100644 index 84c19997c..000000000 --- a/java/examples/Basics/Form/RegularPolygon/RegularPolygon.pde +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Regular Polygon - * - * What is your favorite? Pentagon? Hexagon? Heptagon? - * No? What about the icosagon? The polygon() function - * created for this example is capable of drawing any - * regular polygon. Try placing different numbers into the - * polygon() function calls within draw() to explore. - */ - -void setup() { - size(640, 360); -} - -void draw() { - background(102); - - pushMatrix(); - translate(width*0.2, height*0.5); - rotate(frameCount / 200.0); - polygon(0, 0, 82, 3); - popMatrix(); - - pushMatrix(); - translate(width*0.5, height*0.5); - rotate(frameCount / 50.0); - polygon(0, 0, 80, 20); - popMatrix(); - - pushMatrix(); - translate(width*0.8, height*0.5); - rotate(frameCount / -100.0); - polygon(0, 0, 70, 7); - popMatrix(); -} - -void polygon(float x, float y, float radius, int npoints) { - float angle = TWO_PI / npoints; - beginShape(); - for (float a = 0; a < TWO_PI; a += angle) { - float sx = x + cos(a) * radius; - float sy = y + sin(a) * radius; - vertex(sx, sy); - } - endShape(CLOSE); -} diff --git a/java/examples/Basics/Form/ShapePrimitives/ShapePrimitives.pde b/java/examples/Basics/Form/ShapePrimitives/ShapePrimitives.pde deleted file mode 100644 index 96c630fc7..000000000 --- a/java/examples/Basics/Form/ShapePrimitives/ShapePrimitives.pde +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Shape Primitives. - * - * The basic shape primitive functions are triangle(), - * rect(), quad(), ellipse(), and arc(). Squares are made - * with rect() and circles are made with ellipse(). Each - * of these functions requires a number of parameters to - * determine the shape's position and size. - */ - -size(640, 360); -background(0); -noStroke(); - -fill(204); -triangle(18, 18, 18, 360, 81, 360); - -fill(102); -rect(81, 81, 63, 63); - -fill(204); -quad(189, 18, 216, 18, 216, 360, 144, 360); - -fill(255); -ellipse(252, 144, 72, 72); - -fill(204); -triangle(288, 18, 351, 360, 288, 360); - -fill(255); -arc(479, 300, 280, 280, PI, TWO_PI); - diff --git a/java/examples/Basics/Form/Star/Star.pde b/java/examples/Basics/Form/Star/Star.pde deleted file mode 100644 index d68916edd..000000000 --- a/java/examples/Basics/Form/Star/Star.pde +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Star - * - * The star() function created for this example is capable of drawing a - * wide range of different forms. Try placing different numbers into the - * star() function calls within draw() to explore. - */ - -void setup() { - size(640, 360); -} - -void draw() { - background(102); - - pushMatrix(); - translate(width*0.2, height*0.5); - rotate(frameCount / 200.0); - star(0, 0, 5, 70, 3); - popMatrix(); - - pushMatrix(); - translate(width*0.5, height*0.5); - rotate(frameCount / 50.0); - star(0, 0, 80, 100, 40); - popMatrix(); - - pushMatrix(); - translate(width*0.8, height*0.5); - rotate(frameCount / -100.0); - star(0, 0, 30, 70, 5); - popMatrix(); -} - -void star(float x, float y, float radius1, float radius2, int npoints) { - float angle = TWO_PI / npoints; - float halfAngle = angle/2.0; - beginShape(); - for (float a = 0; a < TWO_PI; a += angle) { - float sx = x + cos(a) * radius2; - float sy = y + sin(a) * radius2; - vertex(sx, sy); - sx = x + cos(a+halfAngle) * radius1; - sy = y + sin(a+halfAngle) * radius1; - vertex(sx, sy); - } - endShape(CLOSE); -} diff --git a/java/examples/Basics/Form/TriangleStrip/TriangleStrip.pde b/java/examples/Basics/Form/TriangleStrip/TriangleStrip.pde deleted file mode 100644 index ec479eb87..000000000 --- a/java/examples/Basics/Form/TriangleStrip/TriangleStrip.pde +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Triangle Strip - * by Ira Greenberg. - * - * Generate a closed ring using the vertex() function and - * beginShape(TRIANGLE_STRIP) mode. The outsideRadius and insideRadius - * variables control ring's radii respectively. - */ - -int x; -int y; -float outsideRadius = 150; -float insideRadius = 100; - -void setup() { - size(640, 360); - background(204); - x = width/2; - y = height/2; -} - -void draw() { - background(204); - - int numPoints = int(map(mouseX, 0, width, 6, 60)); - float angle = 0; - float angleStep = 180.0/numPoints; - - beginShape(TRIANGLE_STRIP); - for (int i = 0; i <= numPoints; i++) { - float px = x + cos(radians(angle)) * outsideRadius; - float py = y + sin(radians(angle)) * outsideRadius; - angle += angleStep; - vertex(px, py); - px = x + cos(radians(angle)) * insideRadius; - py = y + sin(radians(angle)) * insideRadius; - vertex(px, py); - angle += angleStep; - } - endShape(); -} - diff --git a/java/examples/Basics/Image/Alphamask/Alphamask.pde b/java/examples/Basics/Image/Alphamask/Alphamask.pde deleted file mode 100644 index 296835da7..000000000 --- a/java/examples/Basics/Image/Alphamask/Alphamask.pde +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Alpha Mask. - * - * Loads a "mask" for an image to specify the transparency - * in different parts of the image. The two images are blended - * together using the mask() method of PImage. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="moonwalk.jpg,mask.jpg"; */ - -PImage img; -PImage imgMask; - -void setup() { - size(640, 360); - img = loadImage("moonwalk.jpg"); - imgMask = loadImage("mask.jpg"); - img.mask(imgMask); - imageMode(CENTER); -} - -void draw() { - background(0, 102, 153); - image(img, width/2, height/2); - image(img, mouseX, mouseY); -} diff --git a/java/examples/Basics/Image/BackgroundImage/BackgroundImage.pde b/java/examples/Basics/Image/BackgroundImage/BackgroundImage.pde deleted file mode 100644 index 9f872777d..000000000 --- a/java/examples/Basics/Image/BackgroundImage/BackgroundImage.pde +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Background Image. - * - * This example presents the fastest way to load a background image - * into Processing. To load an image as the background, it must be - * the same width and height as the program. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="moonwalk.jpg"; */ - -PImage bg; -int y; - -void setup() { - size(640, 360); - // The background image must be the same size as the parameters - // into the size() method. In this program, the size of the image - // is 640 x 360 pixels. - bg = loadImage("moonwalk.jpg"); -} - -void draw() { - background(bg); - - stroke(226, 204, 0); - line(0, y, width, y); - - y++; - if (y > height) { - y = 0; - } -} diff --git a/java/examples/Basics/Image/CreateImage/CreateImage.pde b/java/examples/Basics/Image/CreateImage/CreateImage.pde deleted file mode 100644 index b3ea02cb5..000000000 --- a/java/examples/Basics/Image/CreateImage/CreateImage.pde +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Create Image. - * - * The createImage() function provides a fresh buffer of pixels to play with. - * This example creates an image gradient. - */ - -PImage img; - -void setup() { - size(640, 360); - img = createImage(230, 230, ARGB); - for(int i = 0; i < img.pixels.length; i++) { - float a = map(i, 0, img.pixels.length, 255, 0); - img.pixels[i] = color(0, 153, 204, a); - } -} - -void draw() { - background(0); - image(img, 90, 80); - image(img, mouseX-img.width/2, mouseY-img.height/2); -} diff --git a/java/examples/Basics/Image/LoadDisplayImage/LoadDisplayImage.pde b/java/examples/Basics/Image/LoadDisplayImage/LoadDisplayImage.pde deleted file mode 100644 index 48cc22379..000000000 --- a/java/examples/Basics/Image/LoadDisplayImage/LoadDisplayImage.pde +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Load and Display - * - * Images can be loaded and displayed to the screen at their actual size - * or any other size. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="moonwalk.jpg"; */ - -PImage img; // Declare variable "a" of type PImage - -void setup() { - size(640, 360); - // The image file must be in the data folder of the current sketch - // to load successfully - img = loadImage("moonwalk.jpg"); // Load the image into the program -} - -void draw() { - // Displays the image at its actual size at point (0,0) - image(img, 0, 0); - // Displays the image at point (0, height/2) at half of its size - image(img, 0, height/2, img.width/2, img.height/2); -} diff --git a/java/examples/Basics/Image/Pointillism/Pointillism.pde b/java/examples/Basics/Image/Pointillism/Pointillism.pde deleted file mode 100644 index 9227a9710..000000000 --- a/java/examples/Basics/Image/Pointillism/Pointillism.pde +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Pointillism - * by Daniel Shiffman. - * - * Mouse horizontal location controls size of dots. - * Creates a simple pointillist effect using ellipses colored - * according to pixels in an image. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="moonwalk.jpg"; */ - -PImage img; -int smallPoint, largePoint; - -void setup() { - size(640, 360); - img = loadImage("moonwalk.jpg"); - smallPoint = 4; - largePoint = 40; - imageMode(CENTER); - noStroke(); - background(255); -} - -void draw() { - float pointillize = map(mouseX, 0, width, smallPoint, largePoint); - int x = int(random(img.width)); - int y = int(random(img.height)); - color pix = img.get(x, y); - fill(pix, 128); - ellipse(x, y, pointillize, pointillize); -} diff --git a/java/examples/Basics/Image/RequestImage/RequestImage.pde b/java/examples/Basics/Image/RequestImage/RequestImage.pde deleted file mode 100644 index eb028b300..000000000 --- a/java/examples/Basics/Image/RequestImage/RequestImage.pde +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Request Image - * by Ira Greenberg ( From Processing for Flash Developers). - * - * Shows how to use the requestImage() function with preloader animation. - * The requestImage() function loads images on a separate thread so that - * the sketch does not freeze while they load. It's very useful when you are - * loading large images. - * - * These images are small for a quick download, but try it with your own huge - * images to get the full effect. - */ - -int imgCount = 12; -PImage[] imgs = new PImage[imgCount]; -float imgW; - -// Keeps track of loaded images (true or false) -boolean[] loadStates = new boolean[imgCount]; - -// For loading animation -float loaderX, loaderY, theta; - -void setup() { - size(640, 360); - smooth(); - imgW = width/imgCount; - - // Load images asynchronously - for (int i = 0; i < imgCount; i++){ - imgs[i] = requestImage("PT_anim"+nf(i, 4)+".gif"); - } -} - -void draw(){ - background(0); - - // Start loading animation - runLoaderAni(); - - for (int i = 0; i < imgs.length; i++){ - // Check if individual images are fully loaded - if ((imgs[i].width != 0) && (imgs[i].width != -1)){ - // As images are loaded set true in boolean array - loadStates[i] = true; - } - } - // When all images are loaded draw them to the screen - if (checkLoadStates()){ - drawImages(); - } -} - -void drawImages() { - int y = (height - imgs[0].height) / 2; - for (int i = 0; i < imgs.length; i++){ - image(imgs[i], width/imgs.length*i, y, imgs[i].height, imgs[i].height); - } -} - -// Loading animation -void runLoaderAni(){ - // Only run when images are loading - if (!checkLoadStates()){ - ellipse(loaderX, loaderY, 10, 10); - loaderX += 2; - loaderY = height/2 + sin(theta) * (height/8); - theta += PI/22; - // Reposition ellipse if it goes off the screen - if (loaderX > width + 5){ - loaderX = -5; - } - } -} - -// Return true when all images are loaded - no false values left in array -boolean checkLoadStates(){ - for (int i = 0; i < imgs.length; i++){ - if (loadStates[i] == false){ - return false; - } - } - return true; -} - - - - - - diff --git a/java/examples/Basics/Image/RequestImage/data/PT_anim0000.gif b/java/examples/Basics/Image/RequestImage/data/PT_anim0000.gif deleted file mode 100644 index b0e3f04ac..000000000 Binary files a/java/examples/Basics/Image/RequestImage/data/PT_anim0000.gif and /dev/null differ diff --git a/java/examples/Basics/Image/RequestImage/data/PT_anim0001.gif b/java/examples/Basics/Image/RequestImage/data/PT_anim0001.gif deleted file mode 100644 index 4f7cb9024..000000000 Binary files a/java/examples/Basics/Image/RequestImage/data/PT_anim0001.gif and /dev/null differ diff --git a/java/examples/Basics/Image/RequestImage/data/PT_anim0002.gif b/java/examples/Basics/Image/RequestImage/data/PT_anim0002.gif deleted file mode 100644 index 4d37297fa..000000000 Binary files a/java/examples/Basics/Image/RequestImage/data/PT_anim0002.gif and /dev/null differ diff --git a/java/examples/Basics/Image/RequestImage/data/PT_anim0003.gif b/java/examples/Basics/Image/RequestImage/data/PT_anim0003.gif deleted file mode 100644 index d3ab40361..000000000 Binary files a/java/examples/Basics/Image/RequestImage/data/PT_anim0003.gif and /dev/null differ diff --git a/java/examples/Basics/Image/RequestImage/data/PT_anim0004.gif b/java/examples/Basics/Image/RequestImage/data/PT_anim0004.gif deleted file mode 100644 index 44cd62bdb..000000000 Binary files a/java/examples/Basics/Image/RequestImage/data/PT_anim0004.gif and /dev/null differ diff --git a/java/examples/Basics/Image/RequestImage/data/PT_anim0005.gif b/java/examples/Basics/Image/RequestImage/data/PT_anim0005.gif deleted file mode 100644 index 185298a94..000000000 Binary files a/java/examples/Basics/Image/RequestImage/data/PT_anim0005.gif and /dev/null differ diff --git a/java/examples/Basics/Image/RequestImage/data/PT_anim0006.gif b/java/examples/Basics/Image/RequestImage/data/PT_anim0006.gif deleted file mode 100644 index 30de51162..000000000 Binary files a/java/examples/Basics/Image/RequestImage/data/PT_anim0006.gif and /dev/null differ diff --git a/java/examples/Basics/Image/RequestImage/data/PT_anim0007.gif b/java/examples/Basics/Image/RequestImage/data/PT_anim0007.gif deleted file mode 100644 index cc9f8f883..000000000 Binary files a/java/examples/Basics/Image/RequestImage/data/PT_anim0007.gif and /dev/null differ diff --git a/java/examples/Basics/Image/RequestImage/data/PT_anim0008.gif b/java/examples/Basics/Image/RequestImage/data/PT_anim0008.gif deleted file mode 100644 index 76475facd..000000000 Binary files a/java/examples/Basics/Image/RequestImage/data/PT_anim0008.gif and /dev/null differ diff --git a/java/examples/Basics/Image/RequestImage/data/PT_anim0009.gif b/java/examples/Basics/Image/RequestImage/data/PT_anim0009.gif deleted file mode 100644 index 3b224625a..000000000 Binary files a/java/examples/Basics/Image/RequestImage/data/PT_anim0009.gif and /dev/null differ diff --git a/java/examples/Basics/Image/RequestImage/data/PT_anim0010.gif b/java/examples/Basics/Image/RequestImage/data/PT_anim0010.gif deleted file mode 100644 index 9c008f38b..000000000 Binary files a/java/examples/Basics/Image/RequestImage/data/PT_anim0010.gif and /dev/null differ diff --git a/java/examples/Basics/Image/RequestImage/data/PT_anim0011.gif b/java/examples/Basics/Image/RequestImage/data/PT_anim0011.gif deleted file mode 100644 index db227e220..000000000 Binary files a/java/examples/Basics/Image/RequestImage/data/PT_anim0011.gif and /dev/null differ diff --git a/java/examples/Basics/Image/Transparency/Transparency.pde b/java/examples/Basics/Image/Transparency/Transparency.pde deleted file mode 100644 index 29c176979..000000000 --- a/java/examples/Basics/Image/Transparency/Transparency.pde +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Transparency. - * - * Move the pointer left and right across the image to change - * its position. This program overlays one image over another - * by modifying the alpha value of the image with the tint() function. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="moonwalk.jpg"; */ - -PImage img; -float offset = 0; -float easing = 0.05; - -void setup() { - size(640, 360); - img = loadImage("moonwalk.jpg"); // Load an image into the program -} - -void draw() { - image(img, 0, 0); // Display at full opacity - float dx = (mouseX-img.width/2) - offset; - offset += dx * easing; - tint(255, 127); // Display at half opacity - image(img, offset, 0); -} - - - - - diff --git a/java/examples/Basics/Input/Clock/Clock.pde b/java/examples/Basics/Input/Clock/Clock.pde deleted file mode 100644 index 01e6105aa..000000000 --- a/java/examples/Basics/Input/Clock/Clock.pde +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Clock. - * - * The current time can be read with the second(), minute(), - * and hour() functions. In this example, sin() and cos() values - * are used to set the position of the hands. - */ - -int cx, cy; -float secondsRadius; -float minutesRadius; -float hoursRadius; -float clockDiameter; - -void setup() { - size(640, 360); - stroke(255); - - int radius = min(width, height) / 2; - secondsRadius = radius * 0.72; - minutesRadius = radius * 0.60; - hoursRadius = radius * 0.50; - clockDiameter = radius * 1.8; - - cx = width / 2; - cy = height / 2; -} - -void draw() { - background(0); - - // Draw the clock background - fill(80); - noStroke(); - ellipse(cx, cy, clockDiameter, clockDiameter); - - // Angles for sin() and cos() start at 3 o'clock; - // subtract HALF_PI to make them start at the top - float s = map(second(), 0, 60, 0, TWO_PI) - HALF_PI; - float m = map(minute() + norm(second(), 0, 60), 0, 60, 0, TWO_PI) - HALF_PI; - float h = map(hour() + norm(minute(), 0, 60), 0, 24, 0, TWO_PI * 2) - HALF_PI; - - // Draw the hands of the clock - stroke(255); - strokeWeight(1); - line(cx, cy, cx + cos(s) * secondsRadius, cy + sin(s) * secondsRadius); - strokeWeight(2); - line(cx, cy, cx + cos(m) * minutesRadius, cy + sin(m) * minutesRadius); - strokeWeight(4); - line(cx, cy, cx + cos(h) * hoursRadius, cy + sin(h) * hoursRadius); - - // Draw the minute ticks - strokeWeight(2); - beginShape(POINTS); - for (int a = 0; a < 360; a+=6) { - float angle = radians(a); - float x = cx + cos(angle) * secondsRadius; - float y = cy + sin(angle) * secondsRadius; - vertex(x, y); - } - endShape(); -} diff --git a/java/examples/Basics/Input/Constrain/Constrain.pde b/java/examples/Basics/Input/Constrain/Constrain.pde deleted file mode 100644 index dca73825c..000000000 --- a/java/examples/Basics/Input/Constrain/Constrain.pde +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Constrain. - * - * Move the mouse across the screen to move the circle. - * The program constrains the circle to its box. - */ - -float mx; -float my; -float easing = 0.05; -int radius = 24; -int edge = 100; -int inner = edge + radius; - -void setup() { - size(640, 360); - noStroke(); - ellipseMode(RADIUS); - rectMode(CORNERS); -} - -void draw() { - background(51); - - if (abs(mouseX - mx) > 0.1) { - mx = mx + (mouseX - mx) * easing; - } - if (abs(mouseY - my) > 0.1) { - my = my + (mouseY- my) * easing; - } - - mx = constrain(mx, inner, width - inner); - my = constrain(my, inner, height - inner); - fill(76); - rect(edge, edge, width-edge, height-edge); - fill(255); - ellipse(mx, my, radius, radius); -} diff --git a/java/examples/Basics/Input/Easing/Easing.pde b/java/examples/Basics/Input/Easing/Easing.pde deleted file mode 100644 index c3772d05a..000000000 --- a/java/examples/Basics/Input/Easing/Easing.pde +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Easing. - * - * Move the mouse across the screen and the symbol will follow. - * Between drawing each frame of the animation, the program - * calculates the difference between the position of the - * symbol and the cursor. If the distance is larger than - * 1 pixel, the symbol moves part of the distance (0.05) from its - * current position toward the cursor. - */ - -float x; -float y; -float easing = 0.05; - -void setup() { - size(640, 360); - noStroke(); -} - -void draw() { - background(51); - - float targetX = mouseX; - float dx = targetX - x; - if(abs(dx) > 1) { - x += dx * easing; - } - - float targetY = mouseY; - float dy = targetY - y; - if(abs(dy) > 1) { - y += dy * easing; - } - - ellipse(x, y, 66, 66); -} diff --git a/java/examples/Basics/Input/Keyboard/Keyboard.pde b/java/examples/Basics/Input/Keyboard/Keyboard.pde deleted file mode 100644 index f2c6da22f..000000000 --- a/java/examples/Basics/Input/Keyboard/Keyboard.pde +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Keyboard. - * - * Click on the image to give it focus and press the letter keys - * to create forms in time and space. Each key has a unique identifying - * number. These numbers can be used to position shapes in space. - */ - -int rectWidth; - -void setup() { - size(640, 360); - noStroke(); - background(0); - rectWidth = width/4; -} - -void draw() { - // keep draw() here to continue looping while waiting for keys -} - -void keyPressed() { - int keyIndex = -1; - if (key >= 'A' && key <= 'Z') { - keyIndex = key - 'A'; - } else if (key >= 'a' && key <= 'z') { - keyIndex = key - 'a'; - } - if (keyIndex == -1) { - // If it's not a letter key, clear the screen - background(0); - } else { - // It's a letter key, fill a rectangle - fill(millis() % 255); - float x = map(keyIndex, 0, 25, 0, width - rectWidth); - rect(x, 0, rectWidth, height); - } -} diff --git a/java/examples/Basics/Input/KeyboardFunctions/KeyboardFunctions.pde b/java/examples/Basics/Input/KeyboardFunctions/KeyboardFunctions.pde deleted file mode 100644 index e08079140..000000000 --- a/java/examples/Basics/Input/KeyboardFunctions/KeyboardFunctions.pde +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Keyboard Functions. - * Modified from code by Martin. - * Original 'Color Typewriter' concept by John Maeda. - * - * Click on the window to give it focus and press the letter keys to type colors. - * The keyboard function keyPressed() is called whenever - * a key is pressed. keyReleased() is another keyboard - * function that is called when a key is released. - */ - -int maxHeight = 40; -int minHeight = 20; -int letterHeight = maxHeight; // Height of the letters -int letterWidth = 20; // Width of the letter - -int x = -letterWidth; // X position of the letters -int y = 0; // Y position of the letters - -boolean newletter; - -int numChars = 26; // There are 26 characters in the alphabet -color[] colors = new color[numChars]; - -void setup() -{ - size(640, 360); - noStroke(); - colorMode(HSB, numChars); - background(numChars/2); - // Set a gray value for each key - for(int i = 0; i < numChars; i++) { - colors[i] = color(i, numChars, numChars); - } -} - -void draw() -{ - if(newletter == true) { - // Draw the "letter" - int y_pos; - if (letterHeight == maxHeight) { - y_pos = y; - rect( x, y_pos, letterWidth, letterHeight ); - } else { - y_pos = y + minHeight; - rect( x, y_pos, letterWidth, letterHeight ); - fill(numChars/2); - rect( x, y_pos-minHeight, letterWidth, letterHeight ); - } - newletter = false; - } -} - -void keyPressed() -{ - // If the key is between 'A'(65) to 'Z' and 'a' to 'z'(122) - if((key >= 'A' && key <= 'Z') || (key >= 'a' && key <= 'z')) { - int keyIndex; - if(key <= 'Z') { - keyIndex = key-'A'; - letterHeight = maxHeight; - fill(colors[key-'A']); - } else { - keyIndex = key-'a'; - letterHeight = minHeight; - fill(colors[key-'a']); - } - } else { - fill(0); - letterHeight = 10; - } - - newletter = true; - - // Update the "letter" position - x = ( x + letterWidth ); - - // Wrap horizontally - if (x > width - letterWidth) { - x = 0; - y+= maxHeight; - } - - // Wrap vertically - if( y > height - letterHeight) { - y = 0; // reset y to 0 - } -} diff --git a/java/examples/Basics/Input/Milliseconds/Milliseconds.pde b/java/examples/Basics/Input/Milliseconds/Milliseconds.pde deleted file mode 100644 index 45977d990..000000000 --- a/java/examples/Basics/Input/Milliseconds/Milliseconds.pde +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Milliseconds. - * - * A millisecond is 1/1000 of a second. - * Processing keeps track of the number of milliseconds a program has run. - * By modifying this number with the modulo(%) operator, - * different patterns in time are created. - */ - -float scale; - -void setup() { - size(640, 360); - noStroke(); - scale = width/20; -} - -void draw() { - for (int i = 0; i < scale; i++) { - colorMode(RGB, (i+1) * scale * 10); - fill(millis()%((i+1) * scale * 10)); - rect(i*scale, 0, scale, height); - } -} diff --git a/java/examples/Basics/Input/Mouse1D/Mouse1D.pde b/java/examples/Basics/Input/Mouse1D/Mouse1D.pde deleted file mode 100644 index 8d02a4831..000000000 --- a/java/examples/Basics/Input/Mouse1D/Mouse1D.pde +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Mouse 1D. - * - * Move the mouse left and right to shift the balance. - * The "mouseX" variable is used to control both the - * size and color of the rectangles. - */ - -void setup() { - size(640, 360); - noStroke(); - colorMode(RGB, height, height, height); - rectMode(CENTER); -} - -void draw() { - background(0.0); - - float r1 = map(mouseX, 0, width, 0, height); - float r2 = height-r1; - - fill(r1); - rect(width/2 + r1/2, height/2, r1, r1); - - fill(r2); - rect(width/2 - r2/2, height/2, r2, r2); - -} - diff --git a/java/examples/Basics/Input/Mouse2D/Mouse2D.pde b/java/examples/Basics/Input/Mouse2D/Mouse2D.pde deleted file mode 100644 index d4a05e2ff..000000000 --- a/java/examples/Basics/Input/Mouse2D/Mouse2D.pde +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Mouse 2D. - * - * Moving the mouse changes the position and size of each box. - */ - -void setup() -{ - size(640, 360); - noStroke(); - rectMode(CENTER); -} - -void draw() -{ - background(51); - fill(255, 204); - rect(mouseX, height/2, mouseY/2+10, mouseY/2+10); - fill(255, 204); - int inverseX = width-mouseX; - int inverseY = height-mouseY; - rect(inverseX, height/2, (inverseY/2)+10, (inverseY/2)+10); -} - diff --git a/java/examples/Basics/Input/MouseFunctions/MouseFunctions.pde b/java/examples/Basics/Input/MouseFunctions/MouseFunctions.pde deleted file mode 100644 index e3039eda0..000000000 --- a/java/examples/Basics/Input/MouseFunctions/MouseFunctions.pde +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Mouse Functions. - * - * Click on the box and drag it across the screen. - */ - -float bx; -float by; -int boxSize = 75; -boolean overBox = false; -boolean locked = false; -float xOffset = 0.0; -float yOffset = 0.0; - -void setup() -{ - size(640, 360); - bx = width/2.0; - by = height/2.0; - rectMode(RADIUS); -} - -void draw() -{ - background(0); - - // Test if the cursor is over the box - if (mouseX > bx-boxSize && mouseX < bx+boxSize && - mouseY > by-boxSize && mouseY < by+boxSize) { - overBox = true; - if(!locked) { - stroke(255); - fill(153); - } - } else { - stroke(153); - fill(153); - overBox = false; - } - - // Draw the box - rect(bx, by, boxSize, boxSize); -} - -void mousePressed() { - if(overBox) { - locked = true; - fill(255, 255, 255); - } else { - locked = false; - } - xOffset = mouseX-bx; - yOffset = mouseY-by; - -} - -void mouseDragged() { - if(locked) { - bx = mouseX-xOffset; - by = mouseY-yOffset; - } -} - -void mouseReleased() { - locked = false; -} - diff --git a/java/examples/Basics/Input/MousePress/MousePress.pde b/java/examples/Basics/Input/MousePress/MousePress.pde deleted file mode 100644 index 00d997f5a..000000000 --- a/java/examples/Basics/Input/MousePress/MousePress.pde +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Mouse Press. - * - * Move the mouse to position the shape. - * Press the mouse button to invert the color. - */ - - -void setup() { - size(640, 360); - noSmooth(); - fill(126); - background(102); -} - -void draw() { - if (mousePressed) { - stroke(255); - } else { - stroke(0); - } - line(mouseX-66, mouseY, mouseX+66, mouseY); - line(mouseX, mouseY-66, mouseX, mouseY+66); -} diff --git a/java/examples/Basics/Input/MouseSignals/MouseSignals.pde b/java/examples/Basics/Input/MouseSignals/MouseSignals.pde deleted file mode 100644 index c4776751d..000000000 --- a/java/examples/Basics/Input/MouseSignals/MouseSignals.pde +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Mouse Signals. - * - * Move and click the mouse to generate signals. - * The top row is the signal from "mouseX", - * the middle row is the signal from "mouseY", - * and the bottom row is the signal from "mousePressed". - */ - -int[] xvals; -int[] yvals; -int[] bvals; - -void setup() -{ - size(640, 360); - noSmooth(); - xvals = new int[width]; - yvals = new int[width]; - bvals = new int[width]; -} - -int arrayindex = 0; - -void draw() -{ - background(102); - - for(int i = 1; i < width; i++) { - xvals[i-1] = xvals[i]; - yvals[i-1] = yvals[i]; - bvals[i-1] = bvals[i]; - } - // Add the new values to the end of the array - xvals[width-1] = mouseX; - yvals[width-1] = mouseY; - if(mousePressed) { - bvals[width-1] = 0; - } else { - bvals[width-1] = 255; - } - - fill(255); - noStroke(); - rect(0, height/3, width, height/3+1); - - for(int i=1; i 10000 - -void setup() -{ - //size(200, 200, P3D); - size(640, 360, P3D); - noStroke(); - fill(204); - sphereDetail(60); -} - -void draw() -{ - background(0); - - // Light the bottom of the sphere - directionalLight(51, 102, 126, 0, -1, 0); - - // Orange light on the upper-right of the sphere - spotLight(204, 153, 0, 360, 160, 600, 0, 0, -1, PI/2, 600); - - // Moving spotlight that follows the mouse - spotLight(102, 153, 204, 360, mouseY, 600, 0, 0, -1, PI/2, 600); - - translate(width/2, height/2, 0); - sphere(120); -} - diff --git a/java/examples/Basics/Math/AdditiveWave/AdditiveWave.pde b/java/examples/Basics/Math/AdditiveWave/AdditiveWave.pde deleted file mode 100644 index add11d459..000000000 --- a/java/examples/Basics/Math/AdditiveWave/AdditiveWave.pde +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Additive Wave - * by Daniel Shiffman. - * - * Create a more complex wave by adding two waves together. - */ - -int xspacing = 8; // How far apart should each horizontal location be spaced -int w; // Width of entire wave -int maxwaves = 4; // total # of waves to add together - -float theta = 0.0; -float[] amplitude = new float[maxwaves]; // Height of wave -float[] dx = new float[maxwaves]; // Value for incrementing X, to be calculated as a function of period and xspacing -float[] yvalues; // Using an array to store height values for the wave (not entirely necessary) - -void setup() { - size(640, 360); - frameRate(30); - colorMode(RGB, 255, 255, 255, 100); - w = width + 16; - - for (int i = 0; i < maxwaves; i++) { - amplitude[i] = random(10,30); - float period = random(100,300); // How many pixels before the wave repeats - dx[i] = (TWO_PI / period) * xspacing; - } - - yvalues = new float[w/xspacing]; -} - -void draw() { - background(0); - calcWave(); - renderWave(); -} - -void calcWave() { - // Increment theta (try different values for 'angular velocity' here - theta += 0.02; - - // Set all height values to zero - for (int i = 0; i < yvalues.length; i++) { - yvalues[i] = 0; - } - - // Accumulate wave height values - for (int j = 0; j < maxwaves; j++) { - float x = theta; - for (int i = 0; i < yvalues.length; i++) { - // Every other wave is cosine instead of sine - if (j % 2 == 0) yvalues[i] += sin(x)*amplitude[j]; - else yvalues[i] += cos(x)*amplitude[j]; - x+=dx[j]; - } - } -} - -void renderWave() { - // A simple way to draw the wave with an ellipse at each location - noStroke(); - fill(255,50); - ellipseMode(CENTER); - for (int x = 0; x < yvalues.length; x++) { - ellipse(x*xspacing,width/2+yvalues[x],16,16); - } -} - diff --git a/java/examples/Basics/Math/Arctangent/Arctangent.pde b/java/examples/Basics/Math/Arctangent/Arctangent.pde deleted file mode 100644 index 3653077d8..000000000 --- a/java/examples/Basics/Math/Arctangent/Arctangent.pde +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Arctangent. - * - * Move the mouse to change the direction of the eyes. - * The atan2() function computes the angle from each eye - * to the cursor. - */ - -Eye e1, e2, e3; - -void setup() { - size(640, 360); - noStroke(); - e1 = new Eye( 250, 16, 120); - e2 = new Eye( 164, 185, 80); - e3 = new Eye( 420, 230, 220); -} - -void draw() { - background(102); - - e1.update(mouseX, mouseY); - e2.update(mouseX, mouseY); - e3.update(mouseX, mouseY); - - e1.display(); - e2.display(); - e3.display(); -} - -class Eye { - int x, y; - int size; - float angle = 0.0; - - Eye(int tx, int ty, int ts) { - x = tx; - y = ty; - size = ts; - } - - void update(int mx, int my) { - angle = atan2(my-y, mx-x); - } - - void display() { - pushMatrix(); - translate(x, y); - fill(255); - ellipse(0, 0, size, size); - rotate(angle); - fill(153, 204, 0); - ellipse(size/4, 0, size/2, size/2); - popMatrix(); - } -} - diff --git a/java/examples/Basics/Math/Distance1D/Distance1D.pde b/java/examples/Basics/Math/Distance1D/Distance1D.pde deleted file mode 100644 index 4070655ce..000000000 --- a/java/examples/Basics/Math/Distance1D/Distance1D.pde +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Distance 1D. - * - * Move the mouse left and right to control the - * speed and direction of the moving shapes. - */ - -float xpos1; -float xpos2; -float xpos3; -float xpos4; -int thin = 8; -int thick = 36; - -void setup() -{ - size(640, 360); - noStroke(); - xpos1 = width/2; - xpos2 = width/2; - xpos3 = width/2; - xpos4 = width/2; -} - -void draw() -{ - background(0); - - float mx = mouseX * 0.4 - width/5.0; - - fill(102); - rect(xpos2, 0, thick, height/2); - fill(204); - rect(xpos1, 0, thin, height/2); - fill(102); - rect(xpos4, height/2, thick, height/2); - fill(204); - rect(xpos3, height/2, thin, height/2); - - xpos1 += mx/16; - xpos2 += mx/64; - xpos3 -= mx/16; - xpos4 -= mx/64; - - if(xpos1 < -thin) { xpos1 = width; } - if(xpos1 > width) { xpos1 = -thin; } - if(xpos2 < -thick) { xpos2 = width; } - if(xpos2 > width) { xpos2 = -thick; } - if(xpos3 < -thin) { xpos3 = width; } - if(xpos3 > width) { xpos3 = -thin; } - if(xpos4 < -thick) { xpos4 = width; } - if(xpos4 > width) { xpos4 = -thick; } -} - diff --git a/java/examples/Basics/Math/Distance2D/Distance2D.pde b/java/examples/Basics/Math/Distance2D/Distance2D.pde deleted file mode 100644 index 05d336ea5..000000000 --- a/java/examples/Basics/Math/Distance2D/Distance2D.pde +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Distance 2D. - * - * Move the mouse across the image to obscure and reveal the matrix. - * Measures the distance from the mouse to each square and sets the - * size proportionally. - */ - -float max_distance; - -void setup() { - size(640, 360); - noStroke(); - max_distance = dist(0, 0, width, height); -} - -void draw() -{ - background(0); - - for(int i = 0; i <= width; i += 20) { - for(int j = 0; j <= height; j += 20) { - float size = dist(mouseX, mouseY, i, j); - size = size/max_distance * 66; - ellipse(i, j, size, size); - } - } -} diff --git a/java/examples/Basics/Math/DoubleRandom/DoubleRandom.pde b/java/examples/Basics/Math/DoubleRandom/DoubleRandom.pde deleted file mode 100644 index 082b32d1f..000000000 --- a/java/examples/Basics/Math/DoubleRandom/DoubleRandom.pde +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Double Random - * by Ira Greenberg. - * - * Using two random() calls and the point() function - * to create an irregular sawtooth line. - */ - -int totalPts = 300; -float steps = totalPts + 1; - -void setup() { - size(640, 360); - stroke(255); - frameRate(1); -} - -void draw() { - background(0); - float rand = 0; - for (int i = 1; i < steps; i++) { - point( (width/steps) * i, (height/2) + random(-rand, rand) ); - rand += random(-5, 5); - } -} - diff --git a/java/examples/Basics/Math/Graphing2DEquation/Graphing2DEquation.pde b/java/examples/Basics/Math/Graphing2DEquation/Graphing2DEquation.pde deleted file mode 100644 index 1572e85f7..000000000 --- a/java/examples/Basics/Math/Graphing2DEquation/Graphing2DEquation.pde +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Graphing 2D Equations - * by Daniel Shiffman. - * - * Graphics the following equation: - * sin(n*cos(r) + 5*theta) - * where n is a function of horizontal mouse location. - */ - -void setup() { - size(640, 360); -} - -void draw() { - loadPixels(); - float n = (mouseX * 10.0) / width; - float w = 16.0; // 2D space width - float h = 16.0; // 2D space height - float dx = w / width; // Increment x this amount per pixel - float dy = h / height; // Increment y this amount per pixel - float x = -w/2; // Start x at -1 * width / 2 - for (int i = 0; i < width; i++) { - float y = -h/2; // Start y at -1 * height / 2 - for (int j = 0; j < height; j++) { - float r = sqrt((x*x) + (y*y)); // Convert cartesian to polar - float theta = atan2(y,x); // Convert cartesian to polar - // Compute 2D polar coordinate function - float val = sin(n*cos(r) + 5 * theta); // Results in a value between -1 and 1 - //float val = cos(r); // Another simple function - //float val = sin(theta); // Another simple function - // Map resulting vale to grayscale value - pixels[i+j*width] = color((val + 1.0) * 255.0/2.0); // Scale to between 0 and 255 - y += dy; // Increment y - } - x += dx; // Increment x - } - updatePixels(); -} - diff --git a/java/examples/Basics/Math/IncrementDecrement/IncrementDecrement.pde b/java/examples/Basics/Math/IncrementDecrement/IncrementDecrement.pde deleted file mode 100644 index 49b115248..000000000 --- a/java/examples/Basics/Math/IncrementDecrement/IncrementDecrement.pde +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Increment Decrement. - * - * Writing "a++" is equivalent to "a = a + 1". - * Writing "a--" is equivalent to "a = a - 1". - */ - -int a; -int b; -boolean direction; - -void setup() { - size(640, 360); - colorMode(RGB, width); - a = 0; - b = width; - direction = true; - frameRate(30); -} - -void draw() { - a++; - if(a > width) { - a = 0; - direction = !direction; - } - if(direction == true){ - stroke(a); - } else { - stroke(width-a); - } - line(a, 0, a, height/2); - - b--; - if(b < 0) { - b = width; - } - if(direction == true) { - stroke(width-b); - } else { - stroke(b); - } - line(b, height/2+1, b, height); -} diff --git a/java/examples/Basics/Math/Interpolate/Interpolate.pde b/java/examples/Basics/Math/Interpolate/Interpolate.pde deleted file mode 100644 index 47aabe50c..000000000 --- a/java/examples/Basics/Math/Interpolate/Interpolate.pde +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Linear Interpolation. - * - * Move the mouse across the screen and the symbol will follow. - * Between drawing each frame of the animation, the ellipse moves - * part of the distance (0.05) from its current position toward - * the cursor using the lerp() function - * - * This is the same as the Easing under input only with lerp() instead. - */ - -float x; -float y; - -void setup() { - size(640, 360); - noStroke(); -} - -void draw() { - background(51); - - // lerp() calculates a number between two numbers at a specific increment. - // The amt parameter is the amount to interpolate between the two values - // where 0.0 equal to the first point, 0.1 is very near the first point, 0.5 - // is half-way in between, etc. - - // Here we are moving 5% of the way to the mouse location each frame - x = lerp(x,mouseX,0.05); - y = lerp(y,mouseY,0.05); - - fill(255); - stroke(255); - ellipse(x, y, 66, 66); -} diff --git a/java/examples/Basics/Math/Noise1D/Noise1D.pde b/java/examples/Basics/Math/Noise1D/Noise1D.pde deleted file mode 100644 index c29741163..000000000 --- a/java/examples/Basics/Math/Noise1D/Noise1D.pde +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Noise1D. - * - * Using 1D Perlin Noise to assign location. - */ - -float xoff = 0.0; -float xincrement = 0.01; - -void setup() { - size(640, 360); - background(0); - noStroke(); -} - -void draw() -{ - // Create an alpha blended background - fill(0, 10); - rect(0,0,width,height); - - //float n = random(0,width); // Try this line instead of noise - - // Get a noise value based on xoff and scale it according to the window's width - float n = noise(xoff)*width; - - // With each cycle, increment xoff - xoff += xincrement; - - // Draw the ellipse at the value produced by perlin noise - fill(200); - ellipse(n,height/2, 64, 64); -} - - diff --git a/java/examples/Basics/Math/Noise2D/Noise2D.pde b/java/examples/Basics/Math/Noise2D/Noise2D.pde deleted file mode 100644 index b933490c6..000000000 --- a/java/examples/Basics/Math/Noise2D/Noise2D.pde +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Noise2D - * by Daniel Shiffman. - * - * Using 2D noise to create simple texture. - */ - -float increment = 0.02; - -void setup() { - size(640, 360); -} - -void draw() { - - loadPixels(); - - float xoff = 0.0; // Start xoff at 0 - float detail = map(mouseX, 0, width, 0.1, 0.6); - noiseDetail(8, detail); - - // For every x,y coordinate in a 2D space, calculate a noise value and produce a brightness value - for (int x = 0; x < width; x++) { - xoff += increment; // Increment xoff - float yoff = 0.0; // For every xoff, start yoff at 0 - for (int y = 0; y < height; y++) { - yoff += increment; // Increment yoff - - // Calculate noise and scale by 255 - float bright = noise(xoff, yoff) * 255; - - // Try using this line instead - //float bright = random(0,255); - - // Set each pixel onscreen to a grayscale value - pixels[x+y*width] = color(bright); - } - } - - updatePixels(); -} - - - diff --git a/java/examples/Basics/Math/Noise3D/Noise3D.pde b/java/examples/Basics/Math/Noise3D/Noise3D.pde deleted file mode 100644 index aa37b53ba..000000000 --- a/java/examples/Basics/Math/Noise3D/Noise3D.pde +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Noise3D. - * - * Using 3D noise to create simple animated texture. - * Here, the third dimension ('z') is treated as time. - */ - -float increment = 0.01; -// The noise function's 3rd argument, a global variable that increments once per cycle -float zoff = 0.0; -// We will increment zoff differently than xoff and yoff -float zincrement = 0.02; - -void setup() { - size(640, 360); - frameRate(30); -} - -void draw() { - - // Optional: adjust noise detail here - // noiseDetail(8,0.65f); - - loadPixels(); - - float xoff = 0.0; // Start xoff at 0 - - // For every x,y coordinate in a 2D space, calculate a noise value and produce a brightness value - for (int x = 0; x < width; x++) { - xoff += increment; // Increment xoff - float yoff = 0.0; // For every xoff, start yoff at 0 - for (int y = 0; y < height; y++) { - yoff += increment; // Increment yoff - - // Calculate noise and scale by 255 - float bright = noise(xoff,yoff,zoff)*255; - - // Try using this line instead - //float bright = random(0,255); - - // Set each pixel onscreen to a grayscale value - pixels[x+y*width] = color(bright,bright,bright); - } - } - updatePixels(); - - zoff += zincrement; // Increment zoff - - -} - - - diff --git a/java/examples/Basics/Math/NoiseWave/NoiseWave.pde b/java/examples/Basics/Math/NoiseWave/NoiseWave.pde deleted file mode 100644 index 152a00f45..000000000 --- a/java/examples/Basics/Math/NoiseWave/NoiseWave.pde +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Noise Wave - * by Daniel Shiffman. - * - * Using Perlin Noise to generate a wave-like pattern. - */ - -float yoff = 0.0; // 2nd dimension of perlin noise - -void setup() { - size(640, 360); -} - -void draw() { - background(51); - - fill(255); - // We are going to draw a polygon out of the wave points - beginShape(); - - float xoff = 0; // Option #1: 2D Noise - // float xoff = yoff; // Option #2: 1D Noise - - // Iterate over horizontal pixels - for (float x = 0; x <= width; x += 10) { - // Calculate a y value according to noise, map to - float y = map(noise(xoff, yoff), 0, 1, 200,300); // Option #1: 2D Noise - // float y = map(noise(xoff), 0, 1, 200,300); // Option #2: 1D Noise - - // Set the vertex - vertex(x, y); - // Increment x dimension for noise - xoff += 0.05; - } - // increment y dimension for noise - yoff += 0.01; - vertex(width, height); - vertex(0, height); - endShape(CLOSE); -} diff --git a/java/examples/Basics/Math/OperatorPrecedence/OperatorPrecedence.pde b/java/examples/Basics/Math/OperatorPrecedence/OperatorPrecedence.pde deleted file mode 100644 index 9fd09e41c..000000000 --- a/java/examples/Basics/Math/OperatorPrecedence/OperatorPrecedence.pde +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Operator Precedence - * - * If you don't explicitly state the order in which - * an expression is evaluated, they are evaluated based - * on the operator precedence. For example, in the statement - * "4+2*8", the 2 will first be multiplied by 8 and then the result will - * be added to 4. This is because the "*" has a higher precedence - * than the "+". To avoid ambiguity in reading the program, - * it is recommended that is statement is written as "4+(2*8)". - * The order of evaluation can be controlled through placement of - * parenthesis in the code. A table of operator precedence follows below. - * - */ - -// The highest precedence is at the top of the list and -// the lowest is at the bottom. -// Multiplicative: * / % -// Additive: + - -// Relational: < > <= >= -// Equality: == != -// Logical AND: && -// Logical OR: || -// Assignment: = += -= *= /= %= - -size(640, 360); -background(51); -noFill(); -stroke(51); - -stroke(204); -for(int i=0; i< width-20; i+= 4) { - // The 30 is added to 70 and then evaluated - // if it is greater than the current value of "i" - // For clarity, write as "if (i > (30 + 70)) {" - if (i > 30 + 70) { - line(i, 0, i, 50); - } -} - -stroke(255); -// The 2 is multiplied by the 8 and the result is added to the 4 -// For clarity, write as "rect(5 + (2 * 8), 0, 90, 20);" -rect(4 + 2 * 8, 52, 290, 48); -rect((4 + 2) * 8, 100, 290, 49); - -stroke(153); -for (int i = 0; i < width; i+= 2) { - // The relational statements are evaluated - // first, and then the logical AND statements and - // finally the logical OR. For clarity, write as: - // "if(((i > 20) && (i < 50)) || ((i > 100) && (i < width-20))) {" - if (i > 20 && i < 50 || i > 100 && i < width-20) { - line(i, 151, i, height-1); - } -} - - diff --git a/java/examples/Basics/Math/PolarToCartesian/PolarToCartesian.pde b/java/examples/Basics/Math/PolarToCartesian/PolarToCartesian.pde deleted file mode 100644 index 0545049d2..000000000 --- a/java/examples/Basics/Math/PolarToCartesian/PolarToCartesian.pde +++ /dev/null @@ -1,52 +0,0 @@ -/** - * PolarToCartesian - * by Daniel Shiffman. - * - * Convert a polar coordinate (r,theta) to cartesian (x,y): - * x = r * cos(theta) - * y = r * sin(theta) - */ - -float r; - -// Angle and angular velocity, accleration -float theta; -float theta_vel; -float theta_acc; - -void setup() { - size(640, 360); - - // Initialize all values - r = height * 0.45; - theta = 0; - theta_vel = 0; - theta_acc = 0.0001; -} - -void draw() { - - background(0); - - // Translate the origin point to the center of the screen - translate(width/2, height/2); - - // Convert polar to cartesian - float x = r * cos(theta); - float y = r * sin(theta); - - // Draw the ellipse at the cartesian coordinate - ellipseMode(CENTER); - noStroke(); - fill(200); - ellipse(x, y, 32, 32); - - // Apply acceleration and velocity to angle (r remains static in this example) - theta_vel += theta_acc; - theta += theta_vel; - -} - - - - diff --git a/java/examples/Basics/Math/Random/Random.pde b/java/examples/Basics/Math/Random/Random.pde deleted file mode 100644 index 56ac420df..000000000 --- a/java/examples/Basics/Math/Random/Random.pde +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Random. - * - * Random numbers create the basis of this image. - * Each time the program is loaded the result is different. - */ - -void setup() { - size(640, 360); - background(0); - strokeWeight(20); - frameRate(2); -} - -void draw() { - for (int i = 0; i < width; i++) { - float r = random(255); - stroke(r); - line(i, 0, i, height); - } -} - diff --git a/java/examples/Basics/Math/RandomGaussian/RandomGaussian.pde b/java/examples/Basics/Math/RandomGaussian/RandomGaussian.pde deleted file mode 100644 index d71501dba..000000000 --- a/java/examples/Basics/Math/RandomGaussian/RandomGaussian.pde +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Random Gaussian. - * - * This sketch draws ellipses with x and y locations tied to a gaussian distribution of random numbers. - */ - -void setup() { - size(640, 360); - background(0); -} - -void draw() { - - // Get a gaussian random number w/ mean of 0 and standard deviation of 1.0 - float val = randomGaussian(); - - float sd = 60; // Define a standard deviation - float mean = width/2; // Define a mean value (middle of the screen along the x-axis) - float x = ( val * sd ) + mean; // Scale the gaussian random number by standard deviation and mean - - noStroke(); - fill(255, 10); - noStroke(); - ellipse(x, height/2, 32, 32); // Draw an ellipse at our "normal" random location -} - - - diff --git a/java/examples/Basics/Math/Sine/Sine.pde b/java/examples/Basics/Math/Sine/Sine.pde deleted file mode 100644 index 7e29cbd00..000000000 --- a/java/examples/Basics/Math/Sine/Sine.pde +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Sine. - * - * Smoothly scaling size with the sin() function. - */ - -float diameter; -float angle = 0; - -void setup() { - size(640, 360); - diameter = height - 10; - noStroke(); - noStroke(); - fill(255, 204, 0); -} - -void draw() { - - background(0); - - float d1 = 10 + (sin(angle) * diameter/2) + diameter/2; - float d2 = 10 + (sin(angle + PI/2) * diameter/2) + diameter/2; - float d3 = 10 + (sin(angle + PI) * diameter/2) + diameter/2; - - ellipse(0, height/2, d1, d1); - ellipse(width/2, height/2, d2, d2); - ellipse(width, height/2, d3, d3); - - angle += 0.02; -} - diff --git a/java/examples/Basics/Math/SineCosine/SineCosine.pde b/java/examples/Basics/Math/SineCosine/SineCosine.pde deleted file mode 100644 index 85fe3b78b..000000000 --- a/java/examples/Basics/Math/SineCosine/SineCosine.pde +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Sine Cosine. - * - * Linear movement with sin() and cos(). - * Numbers between 0 and PI*2 (TWO_PI which angles roughly 6.28) - * are put into these functions and numbers between -1 and 1 are - * returned. These values are then scaled to produce larger movements. - */ - -float x1, x2, y1, y2; -float angle1, angle2; -float scalar = 70; - -void setup() { - size(640, 360); - noStroke(); - rectMode(CENTER); -} - -void draw() { - background(0); - - float ang1 = radians(angle1); - float ang2 = radians(angle2); - - x1 = width/2 + (scalar * cos(ang1)); - x2 = width/2 + (scalar * cos(ang2)); - - y1 = height/2 + (scalar * sin(ang1)); - y2 = height/2 + (scalar * sin(ang2)); - - fill(255); - rect(width*0.5, height*0.5, 140, 140); - - fill(0, 102, 153); - ellipse(x1, height*0.5 - 120, scalar, scalar); - ellipse(x2, height*0.5 + 120, scalar, scalar); - - fill(255, 204, 0); - ellipse(width*0.5 - 120, y1, scalar, scalar); - ellipse(width*0.5 + 120, y2, scalar, scalar); - - angle1 += 2; - angle2 += 3; - -} - diff --git a/java/examples/Basics/Math/SineWave/SineWave.pde b/java/examples/Basics/Math/SineWave/SineWave.pde deleted file mode 100644 index f242b353a..000000000 --- a/java/examples/Basics/Math/SineWave/SineWave.pde +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Sine Wave - * by Daniel Shiffman. - * - * Render a simple sine wave. - */ - -int xspacing = 16; // How far apart should each horizontal location be spaced -int w; // Width of entire wave - -float theta = 0.0; // Start angle at 0 -float amplitude = 75.0; // Height of wave -float period = 500.0; // How many pixels before the wave repeats -float dx; // Value for incrementing X, a function of period and xspacing -float[] yvalues; // Using an array to store height values for the wave - -void setup() { - size(640, 360); - w = width+16; - dx = (TWO_PI / period) * xspacing; - yvalues = new float[w/xspacing]; -} - -void draw() { - background(0); - calcWave(); - renderWave(); -} - -void calcWave() { - // Increment theta (try different values for 'angular velocity' here - theta += 0.02; - - // For every x value, calculate a y value with sine function - float x = theta; - for (int i = 0; i < yvalues.length; i++) { - yvalues[i] = sin(x)*amplitude; - x+=dx; - } -} - -void renderWave() { - noStroke(); - fill(255); - // A simple way to draw the wave with an ellipse at each location - for (int x = 0; x < yvalues.length; x++) { - ellipse(x*xspacing, height/2+yvalues[x], 16, 16); - } -} - diff --git a/java/examples/Basics/Objects/CompositeObjects/CompositeObjects.pde b/java/examples/Basics/Objects/CompositeObjects/CompositeObjects.pde deleted file mode 100644 index f5b1fcad9..000000000 --- a/java/examples/Basics/Objects/CompositeObjects/CompositeObjects.pde +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Composite Objects - * - * An object can include several other objects. Creating such composite objects - * is a good way to use the principles of modularity and build higher levels of - * abstraction within a program. - */ - -EggRing er1, er2; - - -void setup() { - size(640, 360); - er1 = new EggRing(width*0.45, height*0.5, 0.1, 120); - er2 = new EggRing(width*0.65, height*0.8, 0.05, 180); -} - - -void draw() { - background(0); - er1.transmit(); - er2.transmit(); -} diff --git a/java/examples/Basics/Objects/CompositeObjects/Egg.pde b/java/examples/Basics/Objects/CompositeObjects/Egg.pde deleted file mode 100644 index 6dcdebf16..000000000 --- a/java/examples/Basics/Objects/CompositeObjects/Egg.pde +++ /dev/null @@ -1,36 +0,0 @@ -class Egg { - float x, y; // X-coordinate, y-coordinate - float tilt; // Left and right angle offset - float angle; // Used to define the tilt - float scalar; // Height of the egg - - // Constructor - Egg(float xpos, float ypos, float t, float s) { - x = xpos; - y = ypos; - tilt = t; - scalar = s / 100.0; - } - - void wobble() { - tilt = cos(angle) / 8; - angle += 0.1; - } - - void display() { - noStroke(); - fill(255); - pushMatrix(); - translate(x, y); - rotate(tilt); - scale(scalar); - beginShape(); - vertex(0, -100); - bezierVertex(25, -100, 40, -65, 40, -40); - bezierVertex(40, -15, 25, 0, 0, 0); - bezierVertex(-25, 0, -40, -15, -40, -40); - bezierVertex(-40, -65, -25, -100, 0, -100); - endShape(); - popMatrix(); - } -} diff --git a/java/examples/Basics/Objects/CompositeObjects/EggRing.pde b/java/examples/Basics/Objects/CompositeObjects/EggRing.pde deleted file mode 100644 index 699c3d16b..000000000 --- a/java/examples/Basics/Objects/CompositeObjects/EggRing.pde +++ /dev/null @@ -1,19 +0,0 @@ -class EggRing { - Egg ovoid; - Ring circle = new Ring(); - - EggRing(float x, float y, float t, float sp) { - ovoid = new Egg(x, y, t, sp); - circle.start(x, y - sp/2); - } - - void transmit() { - ovoid.wobble(); - ovoid.display(); - circle.grow(); - circle.display(); - if (circle.on == false) { - circle.on = true; - } - } -} diff --git a/java/examples/Basics/Objects/CompositeObjects/Ring.pde b/java/examples/Basics/Objects/CompositeObjects/Ring.pde deleted file mode 100644 index 78edb4518..000000000 --- a/java/examples/Basics/Objects/CompositeObjects/Ring.pde +++ /dev/null @@ -1,31 +0,0 @@ -class Ring { - - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the ring - boolean on = false; // Turns the display on and off - - void start(float xpos, float ypos) { - x = xpos; - y = ypos; - on = true; - diameter = 1; - } - - void grow() { - if (on == true) { - diameter += 0.5; - if (diameter > width*2) { - diameter = 0.0; - } - } - } - - void display() { - if (on == true) { - noFill(); - strokeWeight(4); - stroke(155, 153); - ellipse(x, y, diameter, diameter); - } - } -} diff --git a/java/examples/Basics/Objects/Inheritance/Inheritance.pde b/java/examples/Basics/Objects/Inheritance/Inheritance.pde deleted file mode 100644 index cf5e55154..000000000 --- a/java/examples/Basics/Objects/Inheritance/Inheritance.pde +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Inheritance - * - * A class can be defined using another class as a foundation. In object-oriented - * programming terminology, one class can inherit fi elds and methods from another. - * An object that inherits from another is called a subclass, and the object it - * inherits from is called a superclass. A subclass extends the superclass. - */ - -SpinSpots spots; -SpinArm arm; - -void setup() { - size(640, 360); - arm = new SpinArm(width/2, height/2, 0.01); - spots = new SpinSpots(width/2, height/2, -0.02, 90.0); -} - -void draw() { - background(204); - arm.update(); - arm.display(); - spots.update(); - spots.display(); -} - -class Spin { - float x, y, speed; - float angle = 0.0; - Spin(float xpos, float ypos, float s) { - x = xpos; - y = ypos; - speed = s; - } - void update() { - angle += speed; - } -} - -class SpinArm extends Spin { - SpinArm(float x, float y, float s) { - super(x, y, s); - } - void display() { - strokeWeight(1); - stroke(0); - pushMatrix(); - translate(x, y); - angle += speed; - rotate(angle); - line(0, 0, 165, 0); - popMatrix(); - } -} - -class SpinSpots extends Spin { - float dim; - SpinSpots(float x, float y, float s, float d) { - super(x, y, s); - dim = d; - } - void display() { - noStroke(); - pushMatrix(); - translate(x, y); - angle += speed; - rotate(angle); - ellipse(-dim/2, 0, dim, dim); - ellipse(dim/2, 0, dim, dim); - popMatrix(); - } -} diff --git a/java/examples/Basics/Objects/MultipleConstructors/MultipleConstructors.pde b/java/examples/Basics/Objects/MultipleConstructors/MultipleConstructors.pde deleted file mode 100644 index fb0191602..000000000 --- a/java/examples/Basics/Objects/MultipleConstructors/MultipleConstructors.pde +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Multiple constructors - * - * A class can have multiple constructors that assign the fields in different ways. - * Sometimes it's beneficial to specify every aspect of an object's data by assigning - * parameters to the fields, but other times it might be appropriate to define only - * one or a few. - */ - -Spot sp1, sp2; - -void setup() { - size(640, 360); - background(204); - noLoop(); - // Run the constructor without parameters - sp1 = new Spot(); - // Run the constructor with three parameters - sp2 = new Spot(width*0.5, height*0.5, 120); -} - -void draw() { - sp1.display(); - sp2.display(); -} - -class Spot { - float x, y, radius; - - // First version of the Spot constructor; - // the fields are assigned default values - Spot() { - radius = 40; - x = width*0.25; - y = height*0.5; - } - - // Second version of the Spot constructor; - // the fields are assigned with parameters - Spot(float xpos, float ypos, float r) { - x = xpos; - y = ypos; - radius = r; - } - void display() { - ellipse(x, y, radius*2, radius*2); - } - -} diff --git a/java/examples/Basics/Objects/Objects/Objects.pde b/java/examples/Basics/Objects/Objects/Objects.pde deleted file mode 100644 index 7ba7bef02..000000000 --- a/java/examples/Basics/Objects/Objects/Objects.pde +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Objects - * by hbarragan. - * - * Move the cursor across the image to change the speed and positions - * of the geometry. The class MRect defines a group of lines. - */ - -MRect r1, r2, r3, r4; - -void setup() -{ - size(640, 360); - fill(255, 204); - noStroke(); - r1 = new MRect(1, 134.0, 0.532, 0.1*height, 10.0, 60.0); - r2 = new MRect(2, 44.0, 0.166, 0.3*height, 5.0, 50.0); - r3 = new MRect(2, 58.0, 0.332, 0.4*height, 10.0, 35.0); - r4 = new MRect(1, 120.0, 0.0498, 0.9*height, 15.0, 60.0); -} - -void draw() -{ - background(0); - - r1.display(); - r2.display(); - r3.display(); - r4.display(); - - r1.move(mouseX-(width/2), mouseY+(height*0.1), 30); - r2.move((mouseX+(width*0.05))%width, mouseY+(height*0.025), 20); - r3.move(mouseX/4, mouseY-(height*0.025), 40); - r4.move(mouseX-(width/2), (height-mouseY), 50); -} - -class MRect -{ - int w; // single bar width - float xpos; // rect xposition - float h; // rect height - float ypos ; // rect yposition - float d; // single bar distance - float t; // number of bars - - MRect(int iw, float ixp, float ih, float iyp, float id, float it) { - w = iw; - xpos = ixp; - h = ih; - ypos = iyp; - d = id; - t = it; - } - - void move (float posX, float posY, float damping) { - float dif = ypos - posY; - if (abs(dif) > 1) { - ypos -= dif/damping; - } - dif = xpos - posX; - if (abs(dif) > 1) { - xpos -= dif/damping; - } - } - - void display() { - for (int i=0; i - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Basics/Shape/GetChild/GetChild.pde b/java/examples/Basics/Shape/GetChild/GetChild.pde deleted file mode 100644 index aed6389bb..000000000 --- a/java/examples/Basics/Shape/GetChild/GetChild.pde +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Get Child. - * - * SVG files can be made of many individual shapes. - * Each of these shapes (called a "child") has its own name - * that can be used to extract it from the "parent" file. - * This example loads a map of the United States and creates - * two new PShape objects by extracting the data from two states. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="usa-wikipedia.svg"; */ - -PShape usa; -PShape michigan; -PShape ohio; - -void setup() { - size(640, 360); - usa = loadShape("usa-wikipedia.svg"); - michigan = usa.getChild("MI"); - ohio = usa.getChild("OH"); -} - -void draw() { - background(255); - - // Draw the full map - shape(usa, -600, -180); - - // Disable the colors found in the SVG file - michigan.disableStyle(); - // Set our own coloring - fill(0, 51, 102); - noStroke(); - // Draw a single state - shape(michigan, -600, -180); // Wolverines! - - // Disable the colors found in the SVG file - ohio.disableStyle(); - // Set our own coloring - fill(153, 0, 0); - noStroke(); - // Draw a single state - shape(ohio, -600, -180); // Buckeyes! -} diff --git a/java/examples/Basics/Shape/GetChild/data/usa-wikipedia.svg b/java/examples/Basics/Shape/GetChild/data/usa-wikipedia.svg deleted file mode 100644 index 247ba7383..000000000 --- a/java/examples/Basics/Shape/GetChild/data/usa-wikipedia.svg +++ /dev/null @@ -1,452 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Basics/Shape/LoadDisplayOBJ/LoadDisplayOBJ.pde b/java/examples/Basics/Shape/LoadDisplayOBJ/LoadDisplayOBJ.pde deleted file mode 100644 index 4d9edb5de..000000000 --- a/java/examples/Basics/Shape/LoadDisplayOBJ/LoadDisplayOBJ.pde +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Load and Display an OBJ Shape. - * - * The loadShape() command is used to read simple SVG (Scalable Vector Graphics) - * files and OBJ (Object) files into a Processing sketch. This example loads an - * OBJ file of a rocket and displays it to the screen. - */ - - -PShape rocket; - -float ry; - -public void setup() { - size(640, 360, P3D); - - rocket = loadShape("rocket.obj"); -} - -public void draw() { - background(0); - lights(); - - translate(width/2, height/2 + 100, -200); - rotateZ(PI); - rotateY(ry); - shape(rocket); - - ry += 0.02; -} diff --git a/java/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.mtl b/java/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.mtl deleted file mode 100644 index fbce8d026..000000000 --- a/java/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.mtl +++ /dev/null @@ -1,8 +0,0 @@ -newmtl Default -illum 2 -Ka 0.698039 0.698039 0.698039 -Kd 0.698039 0.698039 0.698039 -Ks 0.710000 0.710000 0.710000 -Ns 76.109253 -map_Kd rocket.png - diff --git a/java/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.obj b/java/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.obj deleted file mode 100644 index 1a3b68915..000000000 --- a/java/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.obj +++ /dev/null @@ -1,1688 +0,0 @@ -mtllib rocket.mtl -g Rocket -v 0.088187 27.748848 0.016643 -v 25.227547 19.502979 -25.122717 -v 35.640614 19.502979 0.016642 -v 0.088185 19.502979 -35.535782 -v 0.088187 27.748848 0.016643 -v -25.051176 19.502979 -25.122717 -v -35.464237 19.502979 0.016645 -v -25.051170 19.502979 25.156006 -v 0.088191 19.502979 35.569065 -v 0.088187 27.748848 0.016643 -v 25.227552 19.502979 25.156000 -v 0.088187 27.748848 0.016643 -v 35.640614 19.502979 0.016642 -v 35.199703 86.845764 -35.094872 -v 49.743370 86.845764 0.016642 -v 25.227547 19.502979 -25.122717 -v 0.088184 86.845764 -49.638538 -v 0.088185 19.502979 -35.535782 -v -35.023331 86.845764 -35.094872 -v 0.088185 19.502979 -35.535782 -v -25.051176 19.502979 -25.122717 -v -49.566994 86.845764 0.016646 -v -35.023331 86.845764 -35.094872 -v -35.464237 19.502979 0.016645 -v -35.023323 86.845764 35.128162 -v -49.566994 86.845764 0.016646 -v -25.051170 19.502979 25.156006 -v 0.088193 86.845764 49.671825 -v -35.023323 86.845764 35.128162 -v -25.051170 19.502979 25.156006 -v 0.088191 19.502979 35.569065 -v 0.088191 19.502979 35.569065 -v 35.199711 86.845764 35.128155 -v 0.088193 86.845764 49.671825 -v 25.227552 19.502979 25.156000 -v 25.227552 19.502979 25.156000 -v 35.640614 19.502979 0.016642 -v 35.199703 173.055786 -35.094872 -v 49.743370 173.055786 0.016643 -v 35.199703 86.845764 -35.094872 -v 0.088184 173.055786 -49.638535 -v 35.199703 86.845764 -35.094872 -v -35.023331 173.055786 -35.094872 -v -35.023331 86.845764 -35.094872 -v -49.566994 173.055786 0.016647 -v -35.023331 173.055786 -35.094872 -v -49.566994 86.845764 0.016646 -v -35.023323 173.055786 35.128166 -v -49.566994 86.845764 0.016646 -v 0.088193 173.055786 49.671829 -v 0.088193 86.845764 49.671825 -v 35.199711 173.055786 35.128159 -v 0.088193 173.055786 49.671829 -v 35.199711 86.845764 35.128155 -v 35.199711 173.055786 35.128159 -v 49.743370 173.055786 0.016643 -v 27.145910 222.581848 -27.041082 -v 38.353592 222.581848 0.016642 -v 49.743370 173.055786 0.016643 -v 35.199703 173.055786 -35.094872 -v 0.088185 222.581848 -38.248760 -v 35.199703 173.055786 -35.094872 -v 0.088184 173.055786 -49.638535 -v 0.088184 173.055786 -49.638535 -v -26.969542 222.581848 -27.041082 -v -35.023331 173.055786 -35.094872 -v -38.177216 222.581848 0.016646 -v -26.969542 222.581848 -27.041082 -v -49.566994 173.055786 0.016647 -v -26.969536 222.581848 27.074369 -v -38.177216 222.581848 0.016646 -v -35.023323 173.055786 35.128166 -v 0.088192 222.581848 38.282043 -v -26.969536 222.581848 27.074369 -v -35.023323 173.055786 35.128166 -v 0.088193 173.055786 49.671829 -v 27.145916 222.581848 27.074364 -v 0.088192 222.581848 38.282043 -v 0.088193 173.055786 49.671829 -v 35.199711 173.055786 35.128159 -v 35.199711 173.055786 35.128159 -v 0.088187 317.654602 0.016646 -v 0.088185 222.581848 -38.248760 -v 0.088187 317.654602 0.016646 -v 0.088185 222.581848 -38.248760 -v 0.088187 317.654602 0.016646 -v -38.177216 222.581848 0.016646 -v 0.088187 317.654602 0.016646 -v -26.969536 222.581848 27.074369 -v 0.088187 317.654602 0.016646 -v 27.145916 222.581848 27.074364 -v 38.353592 222.581848 0.016642 -vt 0.365478 0.904922 -vt 0.427267 0.972178 -vt 0.452861 0.904922 -vt 0.365478 1.000036 -vt 0.365478 0.904922 -vt 0.303689 0.972178 -vt 0.278095 0.904922 -vt 0.303689 0.837667 -vt 0.365478 0.809809 -vt 0.365478 0.904922 -vt 0.427267 0.837667 -vt 0.365478 0.904922 -vt 0.183561 0.319288 -vt 0.274884 0.473113 -vt 0.183561 0.473113 -vt 0.274884 0.319288 -vt 0.366208 0.473113 -vt 0.366208 0.319288 -vt 0.457532 0.473113 -vt 0.366208 0.319288 -vt 0.457532 0.319288 -vt 0.548855 0.473113 -vt 0.457532 0.473113 -vt 0.548855 0.319288 -vt 0.640179 0.473113 -vt 0.548855 0.473113 -vt 0.640179 0.319288 -vt 0.731503 0.473113 -vt 0.640179 0.473113 -vt 0.640179 0.319288 -vt 0.731503 0.319288 -vt 0.000913 0.319288 -vt 0.092237 0.473113 -vt 0.000913 0.473113 -vt 0.092237 0.319288 -vt 0.092237 0.319288 -vt 0.183561 0.319288 -vt 0.274884 0.670034 -vt 0.183561 0.670034 -vt 0.274884 0.473113 -vt 0.366208 0.670034 -vt 0.274884 0.473113 -vt 0.457532 0.670034 -vt 0.457532 0.473113 -vt 0.548855 0.670034 -vt 0.457532 0.670034 -vt 0.548855 0.473113 -vt 0.640179 0.670034 -vt 0.548855 0.473113 -vt 0.731503 0.670034 -vt 0.731503 0.473113 -vt 0.092237 0.670034 -vt 0.000913 0.670034 -vt 0.092237 0.473113 -vt 0.092237 0.670034 -vt 0.183561 0.670034 -vt 0.274884 0.783161 -vt 0.183561 0.783161 -vt 0.183561 0.670034 -vt 0.274884 0.670034 -vt 0.366208 0.783161 -vt 0.274884 0.670034 -vt 0.366208 0.670034 -vt 0.366208 0.670034 -vt 0.457532 0.783161 -vt 0.457532 0.670034 -vt 0.548855 0.783161 -vt 0.457532 0.783161 -vt 0.548855 0.670034 -vt 0.640179 0.783161 -vt 0.548855 0.783161 -vt 0.640179 0.670034 -vt 0.731503 0.783161 -vt 0.640179 0.783161 -vt 0.640179 0.670034 -vt 0.731503 0.670034 -vt 0.092237 0.783161 -vt 0.000913 0.783161 -vt 0.000913 0.670034 -vt 0.092237 0.670034 -vt 0.092237 0.670034 -vt 0.000913 1.000327 -vt 0.366208 0.783161 -vt 0.731503 1.000327 -vt 0.366208 0.783161 -vt 0.731503 1.000327 -vt 0.548855 0.783161 -vt 0.731503 1.000327 -vt 0.640179 0.783161 -vt 0.000913 1.000327 -vt 0.092237 0.783161 -vt 0.183561 0.783161 -usemtl Default -f 1/1 2/2 3/3 -f 1/1 4/4 2/2 -f 5/5 6/6 4/4 -f 5/5 7/7 6/6 -f 5/5 8/8 7/7 -f 5/5 9/9 8/8 -f 10/10 11/11 9/9 -f 12/12 3/3 11/11 -f 13/13 14/14 15/15 -f 13/13 16/16 14/14 -f 16/16 17/17 14/14 -f 16/16 18/18 17/17 -f 18/18 19/19 17/17 -f 20/20 21/21 19/19 -f 21/21 22/22 23/23 -f 21/21 24/24 22/22 -f 24/24 25/25 26/26 -f 24/24 27/27 25/25 -f 27/27 28/28 29/29 -f 30/30 31/31 28/28 -f 32/32 33/33 34/34 -f 32/32 35/35 33/33 -f 35/35 15/15 33/33 -f 36/36 37/37 15/15 -f 15/15 38/38 39/39 -f 15/15 14/14 38/38 -f 40/40 41/41 38/38 -f 42/42 17/17 41/41 -f 17/17 43/43 41/41 -f 17/17 44/44 43/43 -f 19/19 45/45 46/46 -f 19/19 22/22 45/45 -f 47/47 48/48 45/45 -f 49/49 25/25 48/48 -f 29/29 50/50 48/48 -f 29/29 51/51 50/50 -f 34/34 52/52 53/53 -f 34/34 54/54 52/52 -f 33/33 39/39 55/55 -f 33/33 15/15 39/39 -f 56/56 57/57 58/58 -f 59/59 38/38 57/57 -f 60/60 61/61 57/57 -f 62/62 63/63 61/61 -f 64/64 65/65 61/61 -f 64/64 46/46 65/65 -f 66/66 67/67 68/68 -f 43/43 45/45 67/67 -f 69/69 70/70 71/71 -f 69/69 48/48 70/70 -f 72/72 73/73 74/74 -f 75/75 76/76 73/73 -f 53/53 77/77 78/78 -f 79/79 80/80 77/77 -f 81/81 58/58 77/77 -f 55/55 59/59 58/58 -f 82/82 58/58 57/57 -f 82/82 57/57 83/83 -f 84/84 85/85 68/68 -f 84/84 65/65 71/71 -f 86/86 87/87 74/74 -f 88/88 89/89 73/73 -f 82/82 78/78 77/77 -f 90/90 91/91 92/92 -g wing01 -v -72.964706 -60.615013 2.752965 -v -80.651077 -69.945724 2.752970 -v -79.178032 -68.157547 0.201571 -v -72.964706 -60.615013 2.752965 -v -72.964706 -60.615021 -2.628587 -v -58.352703 -20.619514 -2.628605 -v -58.352703 -20.619514 -2.628605 -v -58.352703 -20.619511 2.752947 -v -72.964706 -60.615013 2.752965 -v -58.352703 -20.619511 2.752947 -v -58.352703 -20.619514 -2.628605 -v -46.947498 1.234928 -2.628614 -v -46.947498 1.234928 -2.628614 -v -46.947498 1.234928 2.752937 -v -58.352703 -20.619511 2.752947 -v -41.276043 7.132179 0.062164 -v -46.947498 1.234928 -2.628614 -v -40.422783 8.019409 -2.628617 -v -81.873581 11.210991 0.201533 -v -49.119144 52.636772 -1.776468 -v -48.766163 52.964798 -2.628637 -v -48.766163 52.964798 -2.628637 -v -82.419724 10.123146 -2.628616 -v -81.873581 11.210991 0.201533 -v -82.482941 10.347294 2.752934 -v -80.651093 4.123146 2.752937 -v -58.352703 -20.619511 2.752947 -v -58.352703 -20.619511 2.752947 -v -46.947498 1.234928 2.752937 -v -82.482941 10.347294 2.752934 -v -79.178032 -68.157547 0.201571 -v -80.812019 -70.141090 -2.628582 -v -72.964706 -60.615021 -2.628587 -v -72.964706 -60.615021 -2.628587 -v -72.964706 -60.615013 2.752965 -v -79.178032 -68.157547 0.201571 -v -80.651077 -69.945724 2.752970 -v -72.964706 -60.615013 2.752965 -v -58.352703 -20.619511 2.752947 -v -58.352703 -20.619511 2.752947 -v -80.651093 4.123146 2.752937 -v -80.651077 -69.945724 2.752970 -v -46.947498 1.234928 2.752937 -v -40.422787 8.019402 2.752935 -v -48.766171 36.348991 2.752924 -v -48.766171 36.348991 2.752924 -v -82.482941 10.347294 2.752934 -v -46.947498 1.234928 2.752937 -v -58.352703 -20.619514 -2.628605 -v -72.964706 -60.615021 -2.628587 -v -80.812019 -70.141090 -2.628582 -v -80.812019 -70.141090 -2.628582 -v -80.812027 4.123146 -2.628614 -v -58.352703 -20.619514 -2.628605 -v -82.419724 10.123146 -2.628616 -v -48.766163 52.964798 -2.628637 -v -48.766171 36.348991 -2.628628 -v -58.352703 -20.619514 -2.628605 -v -80.812027 4.123146 -2.628614 -v -82.419724 10.123146 -2.628616 -v -82.419724 10.123146 -2.628616 -v -46.947498 1.234928 -2.628614 -v -58.352703 -20.619514 -2.628605 -v -82.482941 10.347294 2.752934 -v -48.765190 53.047668 2.755279 -v -49.880726 51.661064 0.062147 -v -49.880726 51.661064 0.062147 -v -81.873581 11.210991 0.201533 -v -82.482941 10.347294 2.752934 -v -41.276043 7.132179 0.062164 -v -40.422787 8.019402 2.752935 -v -46.947498 1.234928 2.752937 -v -46.947498 1.234928 2.752937 -v -46.947498 1.234928 -2.628614 -v -41.276043 7.132179 0.062164 -v -48.766171 36.348991 2.752924 -v -48.765190 53.047668 2.755279 -v -82.482941 10.347294 2.752934 -v -40.422783 8.019409 -2.628617 -v -46.947498 1.234928 -2.628614 -v -82.419724 10.123146 -2.628616 -v -82.419724 10.123146 -2.628616 -v -48.766171 36.348991 -2.628628 -v -40.422783 8.019409 -2.628617 -v -49.880726 51.661064 0.062147 -v -49.119144 52.636772 -1.776468 -v -81.873581 11.210991 0.201533 -vt 0.653246 0.106736 -vt 0.645259 0.106736 -vt 0.646789 0.060132 -vt 0.653246 0.106736 -vt 0.653246 0.008436 -vt 0.687484 0.008435 -vt 0.687484 0.008435 -vt 0.687484 0.106736 -vt 0.653246 0.106736 -vt 0.687484 0.106736 -vt 0.687484 0.008435 -vt 0.706193 0.008435 -vt 0.706193 0.008435 -vt 0.706193 0.106735 -vt 0.687484 0.106736 -vt 0.711241 0.057585 -vt 0.706193 0.008435 -vt 0.712001 0.008435 -vt 0.487940 0.249578 -vt 0.452478 0.213447 -vt 0.452197 0.197881 -vt 0.452197 0.197881 -vt 0.488872 0.197882 -vt 0.487940 0.249578 -vt 0.992226 0.113639 -vt 0.982006 0.129463 -vt 0.857606 0.192369 -vt 0.857606 0.192369 -vt 0.793978 0.136806 -vt 0.992226 0.113639 -vt 0.646789 0.060132 -vt 0.645091 0.008436 -vt 0.653246 0.008436 -vt 0.653246 0.008436 -vt 0.653246 0.106736 -vt 0.646789 0.060132 -vt 0.982006 0.317777 -vt 0.939125 0.294054 -vt 0.857606 0.192369 -vt 0.857606 0.192369 -vt 0.982006 0.129463 -vt 0.982006 0.317777 -vt 0.793978 0.136806 -vt 0.757577 0.119557 -vt 0.804124 0.047532 -vt 0.804124 0.047532 -vt 0.992226 0.113639 -vt 0.793978 0.136806 -vt 0.481912 0.158658 -vt 0.390770 0.067710 -vt 0.369062 0.018867 -vt 0.369062 0.018867 -vt 0.538296 0.018867 -vt 0.481912 0.158658 -vt 0.551969 0.008861 -vt 0.649597 0.218327 -vt 0.611733 0.218327 -vt 0.481912 0.158658 -vt 0.538296 0.018867 -vt 0.551969 0.008861 -vt 0.551969 0.008861 -vt 0.531714 0.229646 -vt 0.481912 0.158658 -vt 0.488680 0.296182 -vt 0.452126 0.296225 -vt 0.453313 0.247032 -vt 0.453313 0.247032 -vt 0.487940 0.249578 -vt 0.488680 0.296182 -vt 0.711241 0.057585 -vt 0.712001 0.106735 -vt 0.706193 0.106735 -vt 0.706193 0.106735 -vt 0.706193 0.008435 -vt 0.711241 0.057585 -vt 0.804124 0.047532 -vt 0.804119 0.005077 -vt 0.992226 0.113639 -vt 0.547175 0.270257 -vt 0.531714 0.229646 -vt 0.551969 0.008861 -vt 0.551969 0.008861 -vt 0.611733 0.218327 -vt 0.547175 0.270257 -vt 0.453313 0.247032 -vt 0.452478 0.213447 -vt 0.487940 0.249578 -usemtl Default -f 93/93 94/94 95/95 -f 96/96 97/97 98/98 -f 99/99 100/100 101/101 -f 102/102 103/103 104/104 -f 105/105 106/106 107/107 -f 108/108 109/109 110/110 -f 111/111 112/112 113/113 -f 114/114 115/115 116/116 -f 117/117 118/118 119/119 -f 120/120 121/121 122/122 -f 123/123 124/124 125/125 -f 126/126 127/127 128/128 -f 129/129 130/130 131/131 -f 132/132 133/133 134/134 -f 135/135 136/136 137/137 -f 138/138 139/139 140/140 -f 141/141 142/142 143/143 -f 144/144 145/145 146/146 -f 147/147 148/148 149/149 -f 150/150 151/151 152/152 -f 153/153 154/154 155/155 -f 156/156 157/157 158/158 -f 159/159 160/160 161/161 -f 162/162 163/163 164/164 -f 165/165 166/166 167/167 -f 168/168 169/169 170/170 -f 171/171 172/172 173/173 -f 174/174 175/175 176/176 -f 177/177 178/178 179/179 -g reactor01 -v -92.410393 -77.997627 0.213196 -v -86.097389 -76.306053 0.213195 -v -89.253891 -76.306053 5.680415 -v -92.410393 -77.997627 0.213196 -v -89.253891 -76.306053 5.680415 -v -95.566895 -76.306053 5.680414 -v -98.723396 -76.306053 0.213195 -v -92.410393 -77.997627 0.213196 -v -95.566895 -76.306068 -5.254023 -v -89.253891 -76.306068 -5.254023 -v -86.097389 -76.306053 0.213195 -v -81.475952 -71.684624 0.213195 -v -86.943176 -71.684624 9.682695 -v -86.943176 -71.684624 9.682695 -v -97.877609 -71.684624 9.682695 -v -95.566895 -76.306053 5.680414 -v -95.566895 -76.306053 5.680414 -v -103.344833 -71.684624 0.213194 -v -95.566895 -76.306053 5.680414 -v -98.723396 -76.306053 0.213195 -v -103.344833 -71.684624 0.213194 -v -97.877609 -71.684624 -9.256306 -v -86.943176 -71.684624 -9.256305 -v -95.566895 -76.306068 -5.254023 -v -86.943176 -71.684624 -9.256305 -v -89.253891 -76.306068 -5.254023 -v -81.475952 -71.684624 0.213195 -v -86.097389 -76.306053 0.213195 -v -81.475952 -71.684624 0.213195 -v -79.784393 -65.371635 0.213195 -v -86.097397 -65.371620 11.147633 -v -81.475952 -71.684624 0.213195 -v -86.943176 -71.684624 9.682695 -v -86.097397 -65.371620 11.147633 -v -98.723396 -65.371620 11.147632 -v -97.877609 -71.684624 9.682695 -v -105.036392 -65.371635 0.213194 -v -103.344833 -71.684624 0.213194 -v -105.036392 -65.371635 0.213194 -v -98.723389 -65.371635 -10.721243 -v -97.877609 -71.684624 -9.256306 -v -86.097389 -65.371635 -10.721241 -v -97.877609 -71.684624 -9.256306 -v -81.475952 -71.684624 0.213195 -v -79.784393 6.376373 0.213193 -v -86.097397 6.376373 11.147631 -v -79.784393 -65.371635 0.213195 -v -86.097397 6.376373 11.147631 -v -98.723396 6.376373 11.147630 -v -98.723396 -65.371620 11.147632 -v -105.036392 6.376373 0.213192 -v -105.036392 -65.371635 0.213194 -v -105.036392 -65.371635 0.213194 -v -98.723389 6.376373 -10.721245 -v -98.723389 -65.371635 -10.721243 -v -86.097389 6.376373 -10.721243 -v -86.097389 -65.371635 -10.721241 -v -86.097389 6.376373 -10.721243 -v -79.784393 -65.371635 0.213195 -v -81.475952 12.689369 0.213193 -v -86.943176 12.689369 9.682693 -v -86.943176 12.689369 9.682693 -v -97.877609 12.689369 9.682693 -v -86.097397 6.376373 11.147631 -v -98.723396 6.376373 11.147630 -v -103.344833 12.689369 0.213192 -v -105.036392 6.376373 0.213192 -v -103.344833 12.689369 0.213192 -v -97.877609 12.689369 -9.256309 -v -105.036392 6.376373 0.213192 -v -98.723389 6.376373 -10.721245 -v -86.943176 12.689369 -9.256308 -v -98.723389 6.376373 -10.721245 -v -86.097389 6.376373 -10.721243 -v -86.097389 6.376373 -10.721243 -v -86.943176 12.689369 -9.256308 -v -79.784393 6.376373 0.213193 -v -81.475952 12.689369 0.213193 -v -86.097389 17.310806 0.213192 -v -89.253891 17.310806 5.680411 -v -81.475952 12.689369 0.213193 -v -89.253891 17.310806 5.680411 -v -95.566895 17.310806 5.680411 -v -86.943176 12.689369 9.682693 -v -97.877609 12.689369 9.682693 -v -95.566895 17.310806 5.680411 -v -98.723396 17.310806 0.213192 -v -103.344833 12.689369 0.213192 -v -98.723396 17.310806 0.213192 -v -95.566895 17.310806 -5.254026 -v -97.877609 12.689369 -9.256309 -v -97.877609 12.689369 -9.256309 -v -95.566895 17.310806 -5.254026 -v -89.253891 17.310806 -5.254026 -v -86.097389 17.310806 0.213192 -v -81.475952 12.689369 0.213193 -v -92.410393 19.002373 0.213192 -v -89.253891 17.310806 5.680411 -v -95.566895 17.310806 5.680411 -v -98.723396 17.310806 0.213192 -v -92.410393 19.002373 0.213192 -v -92.410393 19.002373 0.213192 -vt 0.750000 0.750000 -vt 0.807692 0.754360 -vt 0.769231 0.754360 -vt 0.980769 0.750000 -vt 1.000000 0.754360 -vt 0.961538 0.754360 -vt 0.923077 0.754360 -vt 0.980769 0.750000 -vt 0.884615 0.754360 -vt 0.846154 0.754360 -vt 0.807692 0.754360 -vt 0.807692 0.766271 -vt 0.769231 0.766271 -vt 1.000000 0.766271 -vt 0.961538 0.766271 -vt 0.961538 0.754360 -vt 0.961538 0.754360 -vt 0.923077 0.766271 -vt 0.961538 0.754360 -vt 0.923077 0.754360 -vt 0.923077 0.766271 -vt 0.884615 0.766271 -vt 0.846154 0.766271 -vt 0.884615 0.754360 -vt 0.846154 0.766271 -vt 0.846154 0.754360 -vt 0.807692 0.766271 -vt 0.807692 0.754360 -vt 0.807692 0.766271 -vt 0.807692 0.782541 -vt 0.769231 0.782541 -vt 0.807692 0.766271 -vt 0.769231 0.766271 -vt 1.000000 0.782541 -vt 0.961538 0.782541 -vt 0.961538 0.766271 -vt 0.923077 0.782541 -vt 0.923077 0.766271 -vt 0.923077 0.782541 -vt 0.884615 0.782541 -vt 0.884615 0.766271 -vt 0.846154 0.782541 -vt 0.884615 0.766271 -vt 0.807692 0.766271 -vt 0.807692 0.967459 -vt 0.769231 0.967459 -vt 0.807692 0.782541 -vt 1.000000 0.967459 -vt 0.961538 0.967459 -vt 0.961538 0.782541 -vt 0.923077 0.967459 -vt 0.923077 0.782541 -vt 0.923077 0.782541 -vt 0.884615 0.967459 -vt 0.884615 0.782541 -vt 0.846154 0.967459 -vt 0.846154 0.782541 -vt 0.846154 0.967459 -vt 0.807692 0.782541 -vt 0.807692 0.983729 -vt 0.769231 0.983729 -vt 1.000000 0.983729 -vt 0.961538 0.983729 -vt 1.000000 0.967459 -vt 0.961538 0.967459 -vt 0.923077 0.983729 -vt 0.923077 0.967459 -vt 0.923077 0.983729 -vt 0.884615 0.983729 -vt 0.923077 0.967459 -vt 0.884615 0.967459 -vt 0.846154 0.983729 -vt 0.884615 0.967459 -vt 0.846154 0.967459 -vt 0.846154 0.967459 -vt 0.846154 0.983729 -vt 0.807692 0.967459 -vt 0.807692 0.983729 -vt 0.807692 0.995640 -vt 0.769231 0.995640 -vt 0.807692 0.983729 -vt 1.000000 0.995640 -vt 0.961538 0.995640 -vt 1.000000 0.983729 -vt 0.961538 0.983729 -vt 0.961538 0.995640 -vt 0.923077 0.995640 -vt 0.923077 0.983729 -vt 0.923077 0.995640 -vt 0.884615 0.995640 -vt 0.884615 0.983729 -vt 0.884615 0.983729 -vt 0.884615 0.995640 -vt 0.846154 0.995640 -vt 0.807692 0.995640 -vt 0.807692 0.983729 -vt 0.865385 1.000000 -vt 0.769231 0.995640 -vt 0.961538 0.995640 -vt 0.923077 0.995640 -vt 0.865385 1.000000 -vt 0.865385 1.000000 -usemtl Default -f 180/180 181/181 182/182 -f 183/183 184/184 185/185 -f 183/183 185/185 186/186 -f 187/187 186/186 188/188 -f 180/180 188/188 189/189 -f 180/180 189/189 181/181 -f 190/190 191/191 192/192 -f 181/181 192/192 182/182 -f 184/184 193/193 194/194 -f 184/184 194/194 195/195 -f 196/196 194/194 197/197 -f 198/198 197/197 199/199 -f 186/186 200/200 201/201 -f 199/199 201/201 188/188 -f 188/188 201/201 202/202 -f 203/203 202/202 189/189 -f 189/189 204/204 191/191 -f 205/205 206/206 207/207 -f 208/208 209/209 210/210 -f 211/211 210/210 212/212 -f 193/193 213/213 214/214 -f 193/193 214/214 194/194 -f 215/215 214/214 216/216 -f 215/215 216/216 217/217 -f 200/200 218/218 219/219 -f 200/200 219/219 201/201 -f 220/220 219/219 221/221 -f 222/222 221/221 204/204 -f 202/202 221/221 209/209 -f 202/202 209/209 223/223 -f 209/209 224/224 225/225 -f 226/226 225/225 210/210 -f 213/213 227/227 228/228 -f 213/213 228/228 214/214 -f 229/229 228/228 230/230 -f 229/229 230/230 231/231 -f 232/232 230/230 233/233 -f 232/232 233/233 219/219 -f 234/234 233/233 235/235 -f 234/234 235/235 221/221 -f 236/236 237/237 224/224 -f 236/236 224/224 238/238 -f 224/224 239/239 240/240 -f 224/224 240/240 225/225 -f 227/227 241/241 242/242 -f 243/243 242/242 244/244 -f 244/244 242/242 245/245 -f 244/244 245/245 246/246 -f 246/246 247/247 248/248 -f 249/249 248/248 233/233 -f 250/250 248/248 251/251 -f 252/252 251/251 253/253 -f 254/254 255/255 239/239 -f 253/253 239/239 256/256 -f 257/257 258/258 259/259 -f 260/260 259/259 240/240 -f 241/241 261/261 262/262 -f 263/263 262/262 264/264 -f 242/242 265/265 266/266 -f 242/242 266/266 247/247 -f 267/267 268/268 269/269 -f 267/267 269/269 270/270 -f 271/271 272/272 273/273 -f 271/271 273/273 255/255 -f 251/251 273/273 258/258 -f 251/251 274/274 275/275 -f 258/258 276/276 277/277 -f 261/261 276/276 265/265 -f 278/278 276/276 279/279 -f 266/266 280/280 269/269 -f 269/269 276/276 273/273 -f 273/273 281/281 258/258 -g wing02 -v 39.599403 -60.615013 60.362041 -v 43.442596 -69.945724 67.018631 -v 40.496494 -68.157547 67.018639 -v 39.599403 -60.615013 60.362041 -v 34.938843 -60.615013 63.052818 -v 27.632818 -20.619514 50.398453 -v 27.632818 -20.619514 50.398453 -v 32.293377 -20.619514 47.707680 -v 39.599403 -60.615013 60.362041 -v 32.293377 -20.619514 47.707680 -v 27.632818 -20.619514 50.398453 -v 21.930204 1.234921 40.521259 -v 21.930204 1.234921 40.521259 -v 26.590763 1.234924 37.830482 -v 32.293377 -20.619514 47.707680 -v 21.424757 7.132172 34.264244 -v 21.930204 1.234921 40.521259 -v 18.667843 8.019402 34.870689 -v 41.844223 11.210991 69.353058 -v 23.754000 52.636765 41.975880 -v 22.839508 52.964790 42.096275 -v 22.839508 52.964790 42.096275 -v 39.666317 10.123146 71.241112 -v 41.844223 11.210991 69.353058 -v 44.358482 10.347294 68.605080 -v 43.442562 4.123146 67.018654 -v 32.293377 -20.619514 47.707680 -v 32.293377 -20.619514 47.707680 -v 26.590763 1.234924 37.830482 -v 44.358482 10.347294 68.605080 -v 40.496494 -68.157547 67.018639 -v 38.862507 -70.141083 69.848785 -v 34.938843 -60.615013 63.052818 -v 34.938843 -60.615013 63.052818 -v 39.599403 -60.615013 60.362041 -v 40.496494 -68.157547 67.018639 -v 43.442596 -69.945724 67.018631 -v 39.599403 -60.615013 60.362041 -v 32.293377 -20.619514 47.707680 -v 32.293377 -20.619514 47.707680 -v 43.442562 4.123146 67.018654 -v 43.442596 -69.945724 67.018631 -v 26.590763 1.234924 37.830482 -v 23.328405 8.019394 32.179916 -v 27.500082 36.348984 39.405502 -v 27.500082 36.348984 39.405502 -v 44.358482 10.347294 68.605080 -v 26.590763 1.234924 37.830482 -v 27.632818 -20.619514 50.398453 -v 34.938843 -60.615013 63.052818 -v 38.862507 -70.141083 69.848785 -v 38.862507 -70.141083 69.848785 -v 38.862469 4.123146 69.848801 -v 27.632818 -20.619514 50.398453 -v 39.666317 10.123146 71.241112 -v 22.839508 52.964790 42.096275 -v 22.839521 36.348984 42.096279 -v 27.632818 -20.619514 50.398453 -v 38.862469 4.123146 69.848801 -v 39.666317 10.123146 71.241112 -v 39.666317 10.123146 71.241112 -v 21.930204 1.234921 40.521259 -v 27.632818 -20.619514 50.398453 -v 44.358482 10.347294 68.605080 -v 27.501629 53.047661 39.403473 -v 25.727077 51.661057 41.716122 -v 25.727077 51.661057 41.716122 -v 41.844223 11.210991 69.353058 -v 44.358482 10.347294 68.605080 -v 21.424757 7.132172 34.264244 -v 23.328405 8.019394 32.179916 -v 26.590763 1.234924 37.830482 -v 26.590763 1.234924 37.830482 -v 21.930204 1.234921 40.521259 -v 21.424757 7.132172 34.264244 -v 27.500082 36.348984 39.405502 -v 27.501629 53.047661 39.403473 -v 44.358482 10.347294 68.605080 -v 18.667843 8.019402 34.870689 -v 21.930204 1.234921 40.521259 -v 39.666317 10.123146 71.241112 -v 39.666317 10.123146 71.241112 -v 22.839521 36.348984 42.096279 -v 18.667843 8.019402 34.870689 -v 25.727077 51.661057 41.716122 -v 23.754000 52.636765 41.975880 -v 41.844223 11.210991 69.353058 -vt 0.675235 0.145939 -vt 0.659189 0.137027 -vt 0.671489 0.138735 -vt 0.675235 0.145939 -vt 0.694693 0.145939 -vt 0.725197 0.184137 -vt 0.725197 0.184137 -vt 0.705738 0.184137 -vt 0.675235 0.145939 -vt 0.705738 0.184137 -vt 0.725197 0.184137 -vt 0.749006 0.205010 -vt 0.749006 0.205010 -vt 0.729548 0.205010 -vt 0.705738 0.184137 -vt 0.029621 0.222596 -vt 0.031731 0.241442 -vt 0.018110 0.224422 -vt 0.591267 0.027020 -vt 0.626730 0.111287 -vt 0.627011 0.115546 -vt 0.627011 0.115546 -vt 0.590336 0.037165 -vt 0.591267 0.027020 -vt 0.994963 0.356031 -vt 0.983367 0.371855 -vt 0.842205 0.434762 -vt 0.842205 0.434762 -vt 0.770004 0.379199 -vt 0.994963 0.356031 -vt 0.671489 0.138735 -vt 0.678311 0.136840 -vt 0.694693 0.145939 -vt 0.694693 0.145939 -vt 0.675235 0.145939 -vt 0.671489 0.138735 -vt 0.983367 0.560169 -vt 0.934708 0.536447 -vt 0.842205 0.434762 -vt 0.842205 0.434762 -vt 0.983367 0.371855 -vt 0.983367 0.560169 -vt 0.770004 0.379199 -vt 0.745067 0.361950 -vt 0.781517 0.289924 -vt 0.781517 0.289924 -vt 0.994963 0.356031 -vt 0.770004 0.379199 -vt 0.263651 0.176102 -vt 0.172508 0.072900 -vt 0.150800 0.017476 -vt 0.150800 0.017476 -vt 0.320035 0.017476 -vt 0.263651 0.176102 -vt 0.333708 0.006121 -vt 0.431336 0.243810 -vt 0.393471 0.243810 -vt 0.263651 0.176102 -vt 0.320035 0.017476 -vt 0.333708 0.006121 -vt 0.333708 0.006121 -vt 0.313453 0.256655 -vt 0.263651 0.176102 -vt 0.590528 0.015309 -vt 0.627082 0.093830 -vt 0.625895 0.102096 -vt 0.625895 0.102096 -vt 0.591267 0.027020 -vt 0.590528 0.015309 -vt 0.029621 0.222596 -vt 0.037569 0.216318 -vt 0.051190 0.233338 -vt 0.051190 0.233338 -vt 0.031731 0.241442 -vt 0.029621 0.222596 -vt 0.781517 0.289924 -vt 0.781502 0.247469 -vt 0.994963 0.356031 -vt 0.328914 0.302738 -vt 0.313453 0.256655 -vt 0.333708 0.006121 -vt 0.333708 0.006121 -vt 0.393471 0.243810 -vt 0.328914 0.302738 -vt 0.625895 0.102096 -vt 0.626730 0.111287 -vt 0.591267 0.027020 -usemtl Default -f 282/282 283/283 284/284 -f 285/285 286/286 287/287 -f 288/288 289/289 290/290 -f 291/291 292/292 293/293 -f 294/294 295/295 296/296 -f 297/297 298/298 299/299 -f 300/300 301/301 302/302 -f 303/303 304/304 305/305 -f 306/306 307/307 308/308 -f 309/309 310/310 311/311 -f 312/312 313/313 314/314 -f 315/315 316/316 317/317 -f 318/318 319/319 320/320 -f 321/321 322/322 323/323 -f 324/324 325/325 326/326 -f 327/327 328/328 329/329 -f 330/330 331/331 332/332 -f 333/333 334/334 335/335 -f 336/336 337/337 338/338 -f 339/339 340/340 341/341 -f 342/342 343/343 344/344 -f 345/345 346/346 347/347 -f 348/348 349/349 350/350 -f 351/351 352/352 353/353 -f 354/354 355/355 356/356 -f 357/357 358/358 359/359 -f 360/360 361/361 362/362 -f 363/363 364/364 365/365 -f 366/366 367/367 368/368 -g reactor03 -v 45.685333 -77.997643 -78.439079 -v 42.528831 -76.306068 -72.971855 -v 39.372334 -76.306068 -78.439079 -v 45.685333 -77.997643 -78.439079 -v 42.528839 -76.306068 -83.906296 -v 48.841839 -76.306068 -83.906296 -v 51.998333 -76.306068 -78.439072 -v 45.685333 -77.997643 -78.439079 -v 48.841831 -76.306068 -72.971855 -v 48.841831 -76.306068 -72.971855 -v 40.218109 -71.684639 -68.969574 -v 34.750896 -71.684639 -78.439079 -v 39.372334 -76.306068 -78.439079 -v 39.372334 -76.306068 -78.439079 -v 34.750896 -71.684639 -78.439079 -v 40.218121 -71.684639 -87.908577 -v 39.372334 -76.306068 -78.439079 -v 42.528839 -76.306068 -83.906296 -v 51.152557 -71.684624 -87.908577 -v 48.841839 -76.306068 -83.906296 -v 48.841839 -76.306068 -83.906296 -v 51.152557 -71.684624 -87.908577 -v 56.619770 -71.684624 -78.439072 -v 51.998333 -76.306068 -78.439072 -v 51.998333 -76.306068 -78.439072 -v 56.619770 -71.684624 -78.439072 -v 51.152546 -71.684624 -68.969574 -v 51.998333 -76.306068 -78.439072 -v 51.152546 -71.684624 -68.969574 -v 42.528831 -76.306068 -72.971855 -v 40.218109 -71.684639 -68.969574 -v 39.372326 -65.371635 -67.504639 -v 33.059330 -65.371635 -78.439087 -v 33.059330 -65.371635 -78.439087 -v 39.372337 -65.371635 -89.373520 -v 34.750896 -71.684639 -78.439079 -v 40.218121 -71.684639 -87.908577 -v 39.372337 -65.371635 -89.373520 -v 51.998341 -65.371635 -89.373512 -v 40.218121 -71.684639 -87.908577 -v 51.152557 -71.684624 -87.908577 -v 51.998341 -65.371635 -89.373512 -v 58.311333 -65.371635 -78.439072 -v 56.619770 -71.684624 -78.439072 -v 51.998325 -65.371635 -67.504631 -v 56.619770 -71.684624 -78.439072 -v 51.152546 -71.684624 -68.969574 -v 51.998325 -65.371635 -67.504631 -v 39.372314 6.376366 -67.504646 -v 33.059319 6.376366 -78.439087 -v 39.372326 -65.371635 -67.504639 -v 33.059330 -65.371635 -78.439087 -v 33.059330 -65.371635 -78.439087 -v 33.059319 6.376366 -78.439087 -v 39.372326 6.376366 -89.373520 -v 39.372337 -65.371635 -89.373520 -v 39.372337 -65.371635 -89.373520 -v 51.998329 6.376366 -89.373512 -v 58.311321 6.376366 -78.439072 -v 58.311333 -65.371635 -78.439072 -v 58.311321 6.376366 -78.439072 -v 51.998314 6.376366 -67.504639 -v 51.998325 -65.371635 -67.504631 -v 51.998314 6.376366 -67.504639 -v 39.372326 -65.371635 -67.504639 -v 40.218094 12.689362 -68.969582 -v 34.750881 12.689362 -78.439087 -v 40.218105 12.689362 -87.908585 -v 33.059319 6.376366 -78.439087 -v 39.372326 6.376366 -89.373520 -v 51.152542 12.689362 -87.908577 -v 51.998329 6.376366 -89.373512 -v 56.619755 12.689362 -78.439072 -v 58.311321 6.376366 -78.439072 -v 58.311321 6.376366 -78.439072 -v 51.152531 12.689362 -68.969574 -v 58.311321 6.376366 -78.439072 -v 51.998314 6.376366 -67.504639 -v 51.152531 12.689362 -68.969574 -v 51.998314 6.376366 -67.504639 -v 40.218094 12.689362 -68.969582 -v 39.372314 6.376366 -67.504646 -v 40.218094 12.689362 -68.969582 -v 42.528816 17.310799 -72.971863 -v 39.372318 17.310799 -78.439079 -v 34.750881 12.689362 -78.439087 -v 39.372318 17.310799 -78.439079 -v 42.528820 17.310799 -83.906303 -v 40.218105 12.689362 -87.908585 -v 48.841824 17.310799 -83.906296 -v 40.218105 12.689362 -87.908585 -v 51.152542 12.689362 -87.908577 -v 51.152542 12.689362 -87.908577 -v 48.841824 17.310799 -83.906296 -v 51.998318 17.310799 -78.439072 -v 56.619755 12.689362 -78.439072 -v 48.841816 17.310799 -72.971855 -v 51.152531 12.689362 -68.969574 -v 48.841816 17.310799 -72.971855 -v 42.528816 17.310799 -72.971863 -v 45.685318 19.002365 -78.439079 -v 39.372318 17.310799 -78.439079 -v 42.528820 17.310799 -83.906303 -v 48.841824 17.310799 -83.906296 -v 51.998318 17.310799 -78.439072 -v 48.841816 17.310799 -72.971855 -v 45.685318 19.002365 -78.439079 -vt 0.750000 1.000000 -vt 0.821429 0.995640 -vt 0.857143 0.995640 -vt 0.964286 1.000000 -vt 0.892857 0.995640 -vt 0.928571 0.995640 -vt 0.964286 0.995640 -vt 0.964286 1.000000 -vt 1.000000 0.995640 -vt 0.785714 0.995640 -vt 0.821429 0.983729 -vt 0.857143 0.983729 -vt 0.857143 0.995640 -vt 0.857143 0.995640 -vt 0.857143 0.983729 -vt 0.892857 0.983729 -vt 0.857143 0.995640 -vt 0.892857 0.995640 -vt 0.928571 0.983729 -vt 0.928571 0.995640 -vt 0.928571 0.995640 -vt 0.928571 0.983729 -vt 0.964286 0.983729 -vt 0.964286 0.995640 -vt 0.964286 0.995640 -vt 0.964286 0.983729 -vt 1.000000 0.983729 -vt 0.964286 0.995640 -vt 0.785714 0.983729 -vt 0.821429 0.995640 -vt 0.821429 0.983729 -vt 0.821429 0.967459 -vt 0.857143 0.967459 -vt 0.857143 0.967459 -vt 0.892857 0.967459 -vt 0.857143 0.983729 -vt 0.892857 0.983729 -vt 0.892857 0.967459 -vt 0.928571 0.967459 -vt 0.892857 0.983729 -vt 0.928571 0.983729 -vt 0.928571 0.967459 -vt 0.964286 0.967459 -vt 0.964286 0.983729 -vt 1.000000 0.967459 -vt 0.964286 0.983729 -vt 1.000000 0.983729 -vt 0.785714 0.967459 -vt 0.821429 0.782541 -vt 0.857143 0.782541 -vt 0.821429 0.967459 -vt 0.857143 0.967459 -vt 0.857143 0.967459 -vt 0.857143 0.782541 -vt 0.892857 0.782541 -vt 0.892857 0.967459 -vt 0.892857 0.967459 -vt 0.928571 0.782541 -vt 0.964286 0.782541 -vt 0.964286 0.967459 -vt 0.964286 0.782541 -vt 1.000000 0.782541 -vt 1.000000 0.967459 -vt 0.785714 0.782541 -vt 0.821429 0.967459 -vt 0.821429 0.766271 -vt 0.857143 0.766271 -vt 0.892857 0.766271 -vt 0.857143 0.782541 -vt 0.892857 0.782541 -vt 0.928571 0.766271 -vt 0.928571 0.782541 -vt 0.964286 0.766271 -vt 0.964286 0.782541 -vt 0.964286 0.782541 -vt 1.000000 0.766271 -vt 0.964286 0.782541 -vt 1.000000 0.782541 -vt 0.785714 0.766271 -vt 0.785714 0.782541 -vt 0.821429 0.766271 -vt 0.821429 0.782541 -vt 0.821429 0.766271 -vt 0.821429 0.754360 -vt 0.857143 0.754360 -vt 0.857143 0.766271 -vt 0.857143 0.754360 -vt 0.892857 0.754360 -vt 0.892857 0.766271 -vt 0.928571 0.754360 -vt 0.892857 0.766271 -vt 0.928571 0.766271 -vt 0.928571 0.766271 -vt 0.928571 0.754360 -vt 0.964286 0.754360 -vt 0.964286 0.766271 -vt 1.000000 0.754360 -vt 1.000000 0.766271 -vt 0.785714 0.754360 -vt 0.821429 0.754360 -vt 0.857143 0.750000 -vt 0.857143 0.754360 -vt 0.892857 0.754360 -vt 0.928571 0.754360 -vt 0.750000 0.754360 -vt 0.785714 0.754360 -vt 0.857143 0.750000 -usemtl Default -f 369/369 370/370 371/371 -f 372/372 371/371 373/373 -f 372/372 373/373 374/374 -f 372/372 374/374 375/375 -f 376/376 375/375 377/377 -f 369/369 378/378 370/370 -f 370/370 379/379 380/380 -f 370/370 380/380 381/381 -f 382/382 383/383 384/384 -f 385/385 384/384 373/373 -f 386/386 384/384 387/387 -f 373/373 387/387 388/388 -f 389/389 390/390 391/391 -f 389/389 391/391 392/392 -f 393/393 394/394 395/395 -f 396/396 395/395 377/377 -f 378/378 397/397 379/379 -f 378/378 379/379 398/398 -f 399/399 400/400 401/401 -f 379/379 401/401 380/380 -f 383/383 402/402 403/403 -f 404/404 403/403 384/384 -f 405/405 406/406 407/407 -f 408/408 407/407 409/409 -f 409/409 410/410 411/411 -f 409/409 411/411 412/412 -f 412/412 411/411 413/413 -f 414/414 413/413 415/415 -f 397/397 416/416 400/400 -f 397/397 400/400 399/399 -f 400/400 417/417 418/418 -f 419/419 418/418 420/420 -f 421/421 422/422 423/423 -f 421/421 423/423 424/424 -f 425/425 423/423 426/426 -f 425/425 426/426 407/407 -f 410/410 426/426 427/427 -f 410/410 427/427 411/411 -f 428/428 429/429 430/430 -f 428/428 430/430 431/431 -f 416/416 432/432 417/417 -f 416/416 417/417 433/433 -f 417/417 434/434 435/435 -f 417/417 435/435 418/418 -f 422/422 435/435 436/436 -f 437/437 436/436 438/438 -f 423/423 436/436 439/439 -f 423/423 439/439 440/440 -f 426/426 439/439 441/441 -f 426/426 441/441 442/442 -f 443/443 441/441 444/444 -f 445/445 444/444 446/446 -f 432/432 447/447 434/434 -f 448/448 449/449 450/450 -f 451/451 452/452 453/453 -f 434/434 453/453 454/454 -f 435/435 455/455 456/456 -f 435/435 456/456 436/436 -f 457/457 456/456 458/458 -f 459/459 458/458 460/460 -f 461/461 462/462 463/463 -f 439/439 463/463 441/441 -f 464/464 463/463 465/465 -f 464/464 465/465 466/466 -f 447/447 467/467 452/452 -f 447/447 452/452 451/451 -f 468/468 469/469 470/470 -f 470/470 469/469 456/456 -f 471/471 469/469 458/458 -f 472/472 469/469 463/463 -f 473/473 469/469 467/467 -f 474/474 475/475 468/468 -g wing03 -v 33.762955 -60.615021 -62.868530 -v 37.606140 -69.945724 -69.525124 -v 39.079193 -68.157547 -66.973732 -v 33.762955 -60.615021 -62.868530 -v 38.423519 -60.615021 -60.177750 -v 31.117521 -20.619514 -47.523380 -v 31.117521 -20.619514 -47.523380 -v 26.456961 -20.619514 -50.214157 -v 33.762955 -60.615021 -62.868530 -v 26.456961 -20.619514 -50.214157 -v 31.117521 -20.619514 -47.523380 -v 25.414923 1.234928 -37.646183 -v 20.754362 1.234928 -40.336960 -v 20.248913 7.132179 -34.079948 -v 25.414923 1.234928 -37.646183 -v 22.152567 8.019409 -31.995615 -v 40.426983 11.210987 -69.308144 -v 25.762754 52.636772 -39.952969 -v 26.324265 52.964798 -39.221191 -v 26.324265 52.964798 -39.221191 -v 43.151035 10.123142 -68.366035 -v 40.426983 11.210987 -69.308144 -v 38.522083 10.347294 -71.111565 -v 37.606159 4.123146 -69.525139 -v 26.456961 -20.619514 -50.214157 -v 26.456961 -20.619514 -50.214157 -v 20.754362 1.234928 -40.336960 -v 38.522083 10.347294 -71.111565 -v 39.079193 -68.157547 -66.973732 -v 42.347172 -70.141090 -66.973724 -v 38.423519 -60.615021 -60.177750 -v 38.423519 -60.615021 -60.177750 -v 33.762955 -60.615021 -62.868530 -v 39.079193 -68.157547 -66.973732 -v 37.606140 -69.945724 -69.525124 -v 33.762955 -60.615021 -62.868530 -v 26.456961 -20.619514 -50.214157 -v 26.456961 -20.619514 -50.214157 -v 37.606159 4.123146 -69.525139 -v 37.606140 -69.945724 -69.525124 -v 20.754362 1.234928 -40.336960 -v 17.492006 8.019402 -34.686394 -v 21.663702 36.348991 -41.911976 -v 21.663702 36.348991 -41.911976 -v 38.522083 10.347294 -71.111565 -v 20.754362 1.234928 -40.336960 -v 31.117521 -20.619514 -47.523380 -v 38.423519 -60.615021 -60.177750 -v 42.347172 -70.141090 -66.973724 -v 42.347172 -70.141090 -66.973724 -v 42.347187 4.123142 -66.973732 -v 31.117521 -20.619514 -47.523380 -v 43.151035 10.123142 -68.366035 -v 26.324265 52.964798 -39.221191 -v 26.324265 36.348991 -39.221199 -v 31.117521 -20.619514 -47.523380 -v 42.347187 4.123142 -66.973732 -v 43.151035 10.123142 -68.366035 -v 43.151035 10.123142 -68.366035 -v 25.414923 1.234928 -37.646183 -v 31.117521 -20.619514 -47.523380 -v 38.522083 10.347294 -71.111565 -v 21.661169 53.047668 -41.912308 -v 24.551258 51.661064 -41.531822 -v 24.551258 51.661064 -41.531822 -v 40.426983 11.210987 -69.308144 -v 38.522083 10.347294 -71.111565 -v 20.248913 7.132179 -34.079948 -v 17.492006 8.019402 -34.686394 -v 20.754362 1.234928 -40.336960 -v 20.754362 1.234928 -40.336960 -v 25.414923 1.234928 -37.646183 -v 20.248913 7.132179 -34.079948 -v 21.663702 36.348991 -41.911976 -v 21.661169 53.047668 -41.912308 -v 38.522083 10.347294 -71.111565 -v 22.152567 8.019409 -31.995615 -v 25.414923 1.234928 -37.646183 -v 43.151035 10.123142 -68.366035 -v 43.151035 10.123142 -68.366035 -v 26.324265 36.348991 -39.221199 -v 22.152567 8.019409 -31.995615 -v 24.551258 51.661064 -41.531822 -v 25.762754 52.636772 -39.952969 -v 40.426983 11.210987 -69.308144 -vt 0.716045 0.241039 -vt 0.731750 0.232127 -vt 0.737769 0.233835 -vt 0.716045 0.241039 -vt 0.735090 0.241039 -vt 0.705235 0.279237 -vt 0.705235 0.279237 -vt 0.686190 0.279237 -vt 0.716045 0.241039 -vt 0.686190 0.279237 -vt 0.705235 0.279237 -vt 0.681932 0.300110 -vt 0.662887 0.300110 -vt 0.034182 0.291360 -vt 0.055292 0.280633 -vt 0.041961 0.297629 -vt 0.767298 0.024370 -vt 0.731836 0.091226 -vt 0.731555 0.088666 -vt 0.731555 0.088666 -vt 0.768230 0.011951 -vt 0.767298 0.024370 -vt 0.745454 0.612416 -vt 0.756774 0.596591 -vt 0.894572 0.533685 -vt 0.894572 0.533685 -vt 0.965052 0.589248 -vt 0.745454 0.612416 -vt 0.737769 0.233835 -vt 0.751124 0.231941 -vt 0.735090 0.241039 -vt 0.735090 0.241039 -vt 0.716045 0.241039 -vt 0.737769 0.233835 -vt 0.756774 0.408278 -vt 0.804274 0.432001 -vt 0.894572 0.533685 -vt 0.894572 0.533685 -vt 0.756774 0.596591 -vt 0.756774 0.408278 -vt 0.965052 0.589248 -vt 0.989004 0.606497 -vt 0.953814 0.678523 -vt 0.953814 0.678523 -vt 0.745454 0.612416 -vt 0.965052 0.589248 -vt 0.177091 0.135932 -vt 0.268233 0.236675 -vt 0.289941 0.290778 -vt 0.289941 0.290778 -vt 0.120707 0.290778 -vt 0.177091 0.135932 -vt 0.107034 0.301862 -vt 0.009406 0.069838 -vt 0.047271 0.069838 -vt 0.177091 0.135932 -vt 0.120707 0.290778 -vt 0.107034 0.301862 -vt 0.107034 0.301862 -vt 0.127289 0.057299 -vt 0.177091 0.135932 -vt 0.768038 0.033055 -vt 0.731484 0.109925 -vt 0.732671 0.096749 -vt 0.732671 0.096749 -vt 0.767298 0.024370 -vt 0.768038 0.033055 -vt 0.034182 0.291360 -vt 0.022916 0.289536 -vt 0.036247 0.272540 -vt 0.036247 0.272540 -vt 0.055292 0.280633 -vt 0.034182 0.291360 -vt 0.953814 0.678523 -vt 0.953811 0.720977 -vt 0.745454 0.612416 -vt 0.111828 0.012315 -vt 0.127289 0.057299 -vt 0.107034 0.301862 -vt 0.107034 0.301862 -vt 0.047271 0.069838 -vt 0.111828 0.012315 -vt 0.732671 0.096749 -vt 0.731836 0.091226 -vt 0.767298 0.024370 -usemtl Default -f 476/476 477/477 478/478 -f 479/479 480/480 481/481 -f 482/482 483/483 484/484 -f 485/485 486/486 487/487 -f 487/487 488/488 485/485 -f 489/489 490/490 491/491 -f 492/492 493/493 494/494 -f 495/495 496/496 497/497 -f 498/498 499/499 500/500 -f 501/501 502/502 503/503 -f 504/504 505/505 506/506 -f 507/507 508/508 509/509 -f 510/510 511/511 512/512 -f 513/513 514/514 515/515 -f 516/516 517/517 518/518 -f 519/519 520/520 521/521 -f 522/522 523/523 524/524 -f 525/525 526/526 527/527 -f 528/528 529/529 530/530 -f 531/531 532/532 533/533 -f 534/534 535/535 536/536 -f 537/537 538/538 539/539 -f 540/540 541/541 542/542 -f 543/543 544/544 545/545 -f 546/546 547/547 548/548 -f 549/549 550/550 551/551 -f 552/552 553/553 554/554 -f 555/555 556/556 557/557 -f 558/558 559/559 560/560 -g reactor02 -v 47.122719 -77.997612 78.472374 -v 43.966217 -76.306053 73.005157 -v 50.279217 -76.306053 73.005157 -v 53.435719 -76.306053 78.472374 -v 53.435719 -76.306053 78.472374 -v 50.279217 -76.306053 83.939598 -v 47.122719 -77.997612 78.472374 -v 43.966217 -76.306053 83.939598 -v 47.122719 -77.997612 78.472374 -v 40.809719 -76.306053 78.472374 -v 47.122719 -77.997612 78.472374 -v 43.966217 -76.306053 73.005157 -v 41.655499 -71.684608 69.002876 -v 52.589939 -71.684624 69.002876 -v 50.279217 -76.306053 73.005157 -v 58.057159 -71.684624 78.472374 -v 52.589939 -71.684624 87.941879 -v 50.279217 -76.306053 83.939598 -v 52.589939 -71.684624 87.941879 -v 41.655502 -71.684608 87.941879 -v 50.279217 -76.306053 83.939598 -v 43.966217 -76.306053 83.939598 -v 36.188282 -71.684608 78.472374 -v 43.966217 -76.306053 83.939598 -v 40.809719 -76.306053 78.472374 -v 41.655499 -71.684608 69.002876 -v 43.966217 -76.306053 73.005157 -v 40.809723 -65.371620 67.537941 -v 53.435722 -65.371620 67.537941 -v 52.589939 -71.684624 69.002876 -v 59.748722 -65.371620 78.472374 -v 52.589939 -71.684624 69.002876 -v 58.057159 -71.684624 78.472374 -v 53.435722 -65.371620 89.406815 -v 58.057159 -71.684624 78.472374 -v 52.589939 -71.684624 87.941879 -v 53.435722 -65.371620 89.406815 -v 40.809723 -65.371620 89.406815 -v 52.589939 -71.684624 87.941879 -v 40.809723 -65.371620 89.406815 -v 34.496723 -65.371620 78.472374 -v 41.655502 -71.684608 87.941879 -v 36.188282 -71.684608 78.472374 -v 34.496723 -65.371620 78.472374 -v 36.188282 -71.684608 78.472374 -v 41.655499 -71.684608 69.002876 -v 40.809750 6.376381 67.537941 -v 53.435753 6.376381 67.537933 -v 53.435722 -65.371620 67.537941 -v 53.435722 -65.371620 67.537941 -v 59.748753 6.376373 78.472374 -v 59.748722 -65.371620 78.472374 -v 53.435753 6.376381 89.406815 -v 53.435722 -65.371620 89.406815 -v 53.435753 6.376381 89.406815 -v 40.809750 6.376381 89.406815 -v 34.496750 6.376389 78.472374 -v 34.496723 -65.371620 78.472374 -v 34.496723 -65.371620 78.472374 -v 40.809723 -65.371620 67.537941 -v 41.655537 12.689377 69.002876 -v 52.589973 12.689377 69.002876 -v 40.809750 6.376381 67.537941 -v 58.057194 12.689369 78.472374 -v 59.748753 6.376373 78.472374 -v 58.057194 12.689369 78.472374 -v 52.589973 12.689377 87.941872 -v 59.748753 6.376373 78.472374 -v 52.589973 12.689377 87.941872 -v 41.655537 12.689377 87.941872 -v 53.435753 6.376381 89.406815 -v 36.188316 12.689384 78.472374 -v 34.496750 6.376389 78.472374 -v 34.496750 6.376389 78.472374 -v 41.655537 12.689377 69.002876 -v 43.966255 17.310814 73.005157 -v 50.279255 17.310814 73.005157 -v 52.589973 12.689377 69.002876 -v 53.435757 17.310814 78.472374 -v 53.435757 17.310814 78.472374 -v 50.279255 17.310814 83.939590 -v 50.279255 17.310814 83.939590 -v 43.966255 17.310814 83.939590 -v 43.966255 17.310814 83.939590 -v 40.809757 17.310814 78.472374 -v 36.188316 12.689384 78.472374 -v 36.188316 12.689384 78.472374 -v 43.966255 17.310814 73.005157 -v 47.122757 19.002380 78.472374 -v 50.279255 17.310814 83.939590 -v 47.122757 19.002380 78.472374 -v 40.809757 17.310814 78.472374 -v 47.122757 19.002380 78.472374 -vt 0.857143 1.000000 -vt 0.892857 0.995640 -vt 0.928571 0.995640 -vt 0.964286 0.995640 -vt 0.750000 0.995640 -vt 0.785714 0.995640 -vt 0.857143 1.000000 -vt 0.821429 0.995640 -vt 0.857143 1.000000 -vt 0.857143 0.995640 -vt 0.857143 1.000000 -vt 0.892857 0.995640 -vt 0.892857 0.983729 -vt 0.928571 0.983729 -vt 0.928571 0.995640 -vt 0.964286 0.983729 -vt 1.000000 0.983729 -vt 1.000000 0.995640 -vt 0.785714 0.983729 -vt 0.821429 0.983729 -vt 0.785714 0.995640 -vt 0.821429 0.995640 -vt 0.857143 0.983729 -vt 0.821429 0.995640 -vt 0.857143 0.995640 -vt 0.892857 0.983729 -vt 0.892857 0.995640 -vt 0.892857 0.967459 -vt 0.928571 0.967459 -vt 0.928571 0.983729 -vt 0.964286 0.967459 -vt 0.928571 0.983729 -vt 0.964286 0.983729 -vt 1.000000 0.967459 -vt 0.964286 0.983729 -vt 1.000000 0.983729 -vt 0.785714 0.967459 -vt 0.821429 0.967459 -vt 0.785714 0.983729 -vt 0.821429 0.967459 -vt 0.857143 0.967459 -vt 0.821429 0.983729 -vt 0.857143 0.983729 -vt 0.857143 0.967459 -vt 0.857143 0.983729 -vt 0.892857 0.983729 -vt 0.892857 0.782541 -vt 0.928571 0.782541 -vt 0.928571 0.967459 -vt 0.928571 0.967459 -vt 0.964286 0.782541 -vt 0.964286 0.967459 -vt 1.000000 0.782541 -vt 1.000000 0.967459 -vt 0.785714 0.782541 -vt 0.821429 0.782541 -vt 0.857143 0.782541 -vt 0.857143 0.967459 -vt 0.857143 0.967459 -vt 0.892857 0.967459 -vt 0.892857 0.766271 -vt 0.928571 0.766271 -vt 0.892857 0.782541 -vt 0.964286 0.766271 -vt 0.964286 0.782541 -vt 0.964286 0.766271 -vt 1.000000 0.766271 -vt 0.964286 0.782541 -vt 0.785714 0.766271 -vt 0.821428 0.766271 -vt 0.785714 0.782541 -vt 0.857143 0.766271 -vt 0.857143 0.782541 -vt 0.857143 0.782541 -vt 0.892857 0.766271 -vt 0.892857 0.754360 -vt 0.928571 0.754360 -vt 0.928571 0.766271 -vt 0.964286 0.754360 -vt 0.964286 0.754360 -vt 1.000000 0.754360 -vt 0.785714 0.754360 -vt 0.821428 0.754360 -vt 0.821428 0.754360 -vt 0.857143 0.754360 -vt 0.857143 0.766271 -vt 0.857143 0.766271 -vt 0.892857 0.754360 -vt 0.964286 0.750000 -vt 1.000000 0.754360 -vt 0.750000 0.750000 -vt 0.857143 0.754360 -vt 0.964286 0.750000 -usemtl Default -f 561/561 562/562 563/563 -f 561/561 563/563 564/564 -f 561/561 565/565 566/566 -f 567/567 566/566 568/568 -f 569/569 568/568 570/570 -f 571/571 570/570 562/562 -f 572/572 573/573 574/574 -f 572/572 574/574 575/575 -f 563/563 574/574 576/576 -f 575/575 576/576 564/564 -f 564/564 576/576 577/577 -f 564/564 577/577 578/578 -f 566/566 579/579 580/580 -f 581/581 580/580 582/582 -f 582/582 580/580 583/583 -f 584/584 583/583 585/585 -f 570/570 583/583 573/573 -f 570/570 586/586 587/587 -f 586/586 588/588 589/589 -f 573/573 589/589 574/574 -f 590/590 589/589 591/591 -f 592/592 591/591 593/593 -f 576/576 591/591 594/594 -f 595/595 594/594 596/596 -f 579/579 597/597 598/598 -f 599/599 598/598 580/580 -f 580/580 600/600 601/601 -f 602/602 601/601 603/603 -f 583/583 604/604 588/588 -f 605/605 588/588 606/606 -f 588/588 607/607 608/608 -f 588/588 608/608 609/609 -f 610/610 608/608 611/611 -f 610/610 611/611 591/591 -f 612/612 611/611 613/613 -f 612/612 613/613 614/614 -f 597/597 615/615 616/616 -f 597/597 616/616 598/598 -f 600/600 616/616 617/617 -f 600/600 617/617 604/604 -f 618/618 617/617 607/607 -f 619/619 607/607 620/620 -f 607/607 621/621 622/622 -f 623/623 622/622 608/608 -f 608/608 622/622 624/624 -f 608/608 624/624 611/611 -f 625/625 626/626 627/627 -f 628/628 627/627 613/613 -f 615/615 629/629 630/630 -f 631/631 630/630 616/616 -f 616/616 630/630 632/632 -f 616/616 632/632 633/633 -f 634/634 632/632 621/621 -f 617/617 635/635 607/607 -f 621/621 636/636 637/637 -f 621/621 637/637 622/622 -f 638/638 637/637 639/639 -f 622/622 639/639 626/626 -f 626/626 640/640 641/641 -f 626/626 641/641 627/627 -f 629/629 642/642 643/643 -f 629/629 643/643 630/630 -f 630/630 644/644 645/645 -f 630/630 645/645 632/632 -f 646/646 645/645 636/636 -f 647/647 636/636 621/621 -f 648/648 649/649 637/637 -f 637/637 649/649 639/639 -f 639/639 649/649 650/650 -f 642/642 651/651 643/643 -f 643/643 651/651 652/652 -f 645/645 653/653 648/648 diff --git a/java/examples/Basics/Shape/LoadDisplaySVG/LoadDisplaySVG.pde b/java/examples/Basics/Shape/LoadDisplaySVG/LoadDisplaySVG.pde deleted file mode 100644 index b9268db4e..000000000 --- a/java/examples/Basics/Shape/LoadDisplaySVG/LoadDisplaySVG.pde +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Load and Display a Shape. - * Illustration by George Brower. - * - * The loadShape() command is used to read simple SVG (Scalable Vector Graphics) - * files and OBJ (Object) files into a Processing sketch. This example loads an - * SVG file of a monster robot face and displays it to the screen. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="bot1.svg"; */ - -PShape bot; - -void setup() { - size(640, 360); - // The file "bot1.svg" must be in the data folder - // of the current sketch to load successfully - bot = loadShape("bot1.svg"); -} - -void draw(){ - background(102); - shape(bot, 110, 90, 100, 100); // Draw at coordinate (110, 90) at size 100 x 100 - shape(bot, 280, 40); // Draw at coordinate (280, 40) at the default size -} diff --git a/java/examples/Basics/Shape/LoadDisplaySVG/data/bot1.svg b/java/examples/Basics/Shape/LoadDisplaySVG/data/bot1.svg deleted file mode 100644 index 3c56f2d60..000000000 --- a/java/examples/Basics/Shape/LoadDisplaySVG/data/bot1.svg +++ /dev/null @@ -1,160 +0,0 @@ - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Basics/Shape/ScaleShape/ScaleShape.pde b/java/examples/Basics/Shape/ScaleShape/ScaleShape.pde deleted file mode 100644 index bb88eda03..000000000 --- a/java/examples/Basics/Shape/ScaleShape/ScaleShape.pde +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Scale Shape. - * Illustration by George Brower. - * - * Move the mouse left and right to zoom the SVG file. - * This shows how, unlike an imported image, the lines - * remain smooth at any size. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="bot1.svg"; */ - -PShape bot; - -void setup() { - size(640, 360); - // The file "bot1.svg" must be in the data folder - // of the current sketch to load successfully - bot = loadShape("bot1.svg"); -} - -void draw() { - background(102); - translate(width/2, height/2); - float zoom = map(mouseX, 0, width, 0.1, 4.5); - scale(zoom); - shape(bot, -140, -140); -} diff --git a/java/examples/Basics/Shape/ScaleShape/data/bot1.svg b/java/examples/Basics/Shape/ScaleShape/data/bot1.svg deleted file mode 100644 index 3c56f2d60..000000000 --- a/java/examples/Basics/Shape/ScaleShape/data/bot1.svg +++ /dev/null @@ -1,160 +0,0 @@ - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Basics/Structure/Coordinates/Coordinates.pde b/java/examples/Basics/Structure/Coordinates/Coordinates.pde deleted file mode 100644 index 222ab50d6..000000000 --- a/java/examples/Basics/Structure/Coordinates/Coordinates.pde +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Coordinates. - * - * All shapes drawn to the screen have a position that is - * specified as a coordinate. All coordinates are measured - * as the distance from the origin in units of pixels. - * The origin [0, 0] is the coordinate is in the upper left - * of the window and the coordinate in the lower right is - * [width-1, height-1]. - */ - -// Sets the screen to be 640 pixels wide and 360 pixels high -size(640, 360); - -// Set the background to black and turn off the fill color -background(0); -noFill(); - -// The two parameters of the point() method each specify coordinates. -// The first parameter is the x-coordinate and the second is the Y -stroke(255); -point(width * 0.5, height * 0.5); -point(width * 0.5, height * 0.25); - -// Coordinates are used for drawing all shapes, not just points. -// Parameters for different functions are used for different purposes. -// For example, the first two parameters to line() specify -// the coordinates of the first endpoint and the second two parameters -// specify the second endpoint -stroke(0, 153, 255); -line(0, height*0.33, width, height*0.33); - -// By default, the first two parameters to rect() are the -// coordinates of the upper-left corner and the second pair -// is the width and height -stroke(255, 153, 0); -rect(width*0.25, height*0.1, width * 0.5, height * 0.8); diff --git a/java/examples/Basics/Structure/CreateGraphics/CreateGraphics.pde b/java/examples/Basics/Structure/CreateGraphics/CreateGraphics.pde deleted file mode 100644 index 62d698474..000000000 --- a/java/examples/Basics/Structure/CreateGraphics/CreateGraphics.pde +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Create Graphics. - * - * The createGraphics() function creates an object from the PGraphics class - * PGraphics is the main graphics and rendering context for Processing. - * The beginDraw() method is necessary to prepare for drawing and endDraw() is - * necessary to finish. Use this class if you need to draw into an off-screen - * graphics buffer or to maintain two contexts with different properties. - */ - -PGraphics pg; - -void setup() { - size(640, 360); - pg = createGraphics(400, 200); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - noStroke(); - ellipse(mouseX, mouseY, 60, 60); - - pg.beginDraw(); - pg.background(51); - pg.noFill(); - pg.stroke(255); - pg.ellipse(mouseX-120, mouseY-60, 60, 60); - pg.endDraw(); - - // Draw the offscreen buffer to the screen with image() - image(pg, 120, 60); -} diff --git a/java/examples/Basics/Structure/Functions/Functions.pde b/java/examples/Basics/Structure/Functions/Functions.pde deleted file mode 100644 index b838b6103..000000000 --- a/java/examples/Basics/Structure/Functions/Functions.pde +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Functions. - * - * The drawTarget() function makes it easy to draw many distinct targets. - * Each call to drawTarget() specifies the position, size, and number of - * rings for each target. - */ - -void setup() { - size(640, 360); - background(51); - noStroke(); - noLoop(); -} - -void draw() { - drawTarget(width*0.25, height*0.4, 200, 4); - drawTarget(width*0.5, height*0.5, 300, 10); - drawTarget(width*0.75, height*0.3, 120, 6); -} - -void drawTarget(float xloc, float yloc, int size, int num) { - float grayvalues = 255/num; - float steps = size/num; - for (int i = 0; i < num; i++) { - fill(i*grayvalues); - ellipse(xloc, yloc, size - i*steps, size - i*steps); - } -} diff --git a/java/examples/Basics/Structure/Loop/Loop.pde b/java/examples/Basics/Structure/Loop/Loop.pde deleted file mode 100644 index 1ad323f34..000000000 --- a/java/examples/Basics/Structure/Loop/Loop.pde +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Loop. - * - * The loop() function causes draw() to execute - * continuously. If noLoop is called in setup() - * the draw() is only executed once. In this example - * click the mouse to execute loop(), which will - * cause the draw() the execute continuously. - */ - -float y = 100; - -// The statements in the setup() function -// run once when the program begins -void setup() { - size(640, 360); // Size should be the first statement - stroke(255); // Set stroke color to white - noLoop(); - - y = height * 0.5; -} - -// The statements in draw() are run until the -// program is stopped. Each statement is run in -// sequence and after the last line is read, the first -// line is run again. -void draw() { - background(0); // Set the background to black - line(0, y, width, y); - - y = y - 1; - if (y < 0) { - y = height; - } -} - -void mousePressed() { - loop(); -} diff --git a/java/examples/Basics/Structure/NoLoop/NoLoop.pde b/java/examples/Basics/Structure/NoLoop/NoLoop.pde deleted file mode 100644 index 595de53ea..000000000 --- a/java/examples/Basics/Structure/NoLoop/NoLoop.pde +++ /dev/null @@ -1,34 +0,0 @@ -/** - * No Loop. - * - * The noLoop() function causes draw() to only - * execute once. Without calling noLoop(), the - * code inside draw() is run continually. - */ - -float y; - -// The statements in the setup() function -// execute once when the program begins -void setup() -{ - size(640, 360); // Size should be the first statement - stroke(255); // Set line drawing color to white - noLoop(); - - y = height * 0.5; -} - -// The statements in draw() are executed until the -// program is stopped. Each statement is executed in -// sequence and after the last line is read, the first -// line is executed again. -void draw() -{ - background(0); // Set the background to black - y = y - 1; - if (y < 0) { y = height; } - line(0, y, width, y); -} - - diff --git a/java/examples/Basics/Structure/Recursion/Recursion.pde b/java/examples/Basics/Structure/Recursion/Recursion.pde deleted file mode 100644 index 5aff5ef37..000000000 --- a/java/examples/Basics/Structure/Recursion/Recursion.pde +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Recursion. - * - * A demonstration of recursion, which means functions call themselves. - * Notice how the drawCircle() function calls itself at the end of its block. - * It continues to do this until the variable "level" is equal to 1. - */ - -void setup() { - size(640, 360); - noStroke(); - noLoop(); -} - -void draw() { - drawCircle(width/2, 280, 6); -} - -void drawCircle(int x, int radius, int level) { - float tt = 126 * level/4.0; - fill(tt); - ellipse(x, height/2, radius*2, radius*2); - if(level > 1) { - level = level - 1; - drawCircle(x - radius/2, radius/2, level); - drawCircle(x + radius/2, radius/2, level); - } -} diff --git a/java/examples/Basics/Structure/Redraw/Redraw.pde b/java/examples/Basics/Structure/Redraw/Redraw.pde deleted file mode 100644 index 807f8e58c..000000000 --- a/java/examples/Basics/Structure/Redraw/Redraw.pde +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Redraw. - * - * The redraw() function makes draw() execute once. - * In this example, draw() is executed once every time - * the mouse is clicked. - */ - -float y; - -// The statements in the setup() function -// execute once when the program begins -void setup() { - size(640, 360); // Size should be the first statement - stroke(255); // Set line drawing color to white - noLoop(); - y = height * 0.5; -} - -// The statements in draw() are executed until the -// program is stopped. Each statement is executed in -// sequence and after the last line is read, the first -// line is executed again. -void draw() { - background(0); // Set the background to black - y = y - 4; - if (y < 0) { y = height; } - line(0, y, width, y); -} - -void mousePressed() { - redraw(); -} - - diff --git a/java/examples/Basics/Structure/SetupDraw/SetupDraw.pde b/java/examples/Basics/Structure/SetupDraw/SetupDraw.pde deleted file mode 100644 index f0441e121..000000000 --- a/java/examples/Basics/Structure/SetupDraw/SetupDraw.pde +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Setup and Draw. - * - * The code inside the draw() function runs continuously - * from top to bottom until the program is stopped. - */ - -float y = 100; - -// The statements in the setup() function -// execute once when the program begins -void setup() { - size(640, 360); // Size must be the first statement - stroke(255); // Set line drawing color to white - frameRate(30); -} -// The statements in draw() are executed until the -// program is stopped. Each statement is executed in -// sequence and after the last line is read, the first -// line is executed again. -void draw() { - background(0); // Set the background to black - y = y - 1; - if (y < 0) { - y = height; - } - line(0, y, width, y); -} - diff --git a/java/examples/Basics/Structure/StatementsComments/StatementsComments.pde b/java/examples/Basics/Structure/StatementsComments/StatementsComments.pde deleted file mode 100644 index bd99bd3f1..000000000 --- a/java/examples/Basics/Structure/StatementsComments/StatementsComments.pde +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Statements and Comments. - * - * Statements are the elements that make up programs. - * The ";" (semi-colon) symbol is used to end statements. - * It is called the "statement terminator." - * Comments are used for making notes to help people better understand programs. - * A comment begins with two forward slashes ("//"). - */ - -// The size function is a statement that tells the computer -// how large to make the window. -// Each function statement has zero or more parameters. -// Parameters are data passed into the function -// and are used as values for telling the computer what to do. -size(640, 360); - -// The background function is a statement that tells the computer -// which color (or gray value) to make the background of the display window -background(204, 153, 0); diff --git a/java/examples/Basics/Structure/WidthHeight/WidthHeight.pde b/java/examples/Basics/Structure/WidthHeight/WidthHeight.pde deleted file mode 100644 index ea5b4ecbb..000000000 --- a/java/examples/Basics/Structure/WidthHeight/WidthHeight.pde +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Width and Height. - * - * The 'width' and 'height' variables contain the width and height - * of the display window as defined in the size() function. - */ - -void setup() { - size(640, 360); -} - -void draw() { - background(127); - noStroke(); - for (int i = 0; i < height; i += 20) { - fill(129, 206, 15); - rect(0, i, width, 10); - fill(255); - rect(i, 0, 10, height); - } -} - diff --git a/java/examples/Basics/Transform/Arm/Arm.pde b/java/examples/Basics/Transform/Arm/Arm.pde deleted file mode 100644 index f33956649..000000000 --- a/java/examples/Basics/Transform/Arm/Arm.pde +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Arm. - * - * The angle of each segment is controlled with the mouseX and - * mouseY position. The transformations applied to the first segment - * are also applied to the second segment because they are inside - * the same pushMatrix() and popMatrix() group. -*/ - -float x, y; -float angle1 = 0.0; -float angle2 = 0.0; -float segLength = 100; - -void setup() { - size(640, 360); - strokeWeight(30); - stroke(255, 160); - - x = width * 0.3; - y = height * 0.5; -} - -void draw() { - background(0); - - angle1 = (mouseX/float(width) - 0.5) * -PI; - angle2 = (mouseY/float(height) - 0.5) * PI; - - pushMatrix(); - segment(x, y, angle1); - segment(segLength, 0, angle2); - popMatrix(); -} - -void segment(float x, float y, float a) { - translate(x, y); - rotate(a); - line(0, 0, segLength, 0); -} diff --git a/java/examples/Basics/Transform/Rotate/Rotate.pde b/java/examples/Basics/Transform/Rotate/Rotate.pde deleted file mode 100644 index dd0051549..000000000 --- a/java/examples/Basics/Transform/Rotate/Rotate.pde +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Rotate. - * - * Rotating a square around the Z axis. To get the results - * you expect, send the rotate function angle parameters that are - * values between 0 and PI*2 (TWO_PI which is roughly 6.28). If you prefer to - * think about angles as degrees (0-360), you can use the radians() - * method to convert your values. For example: scale(radians(90)) - * is identical to the statement scale(PI/2). - */ - -float angle; -float jitter; - -void setup() { - size(640, 360); - noStroke(); - fill(255); - rectMode(CENTER); -} - -void draw() { - background(51); - - // during even-numbered seconds (0, 2, 4, 6...) - if (second() % 2 == 0) { - jitter = random(-0.1, 0.1); - } - angle = angle + jitter; - float c = cos(angle); - translate(width/2, height/2); - rotate(c); - rect(0, 0, 180, 180); -} diff --git a/java/examples/Basics/Transform/RotatePushPop/RotatePushPop.pde b/java/examples/Basics/Transform/RotatePushPop/RotatePushPop.pde deleted file mode 100644 index cc5569b73..000000000 --- a/java/examples/Basics/Transform/RotatePushPop/RotatePushPop.pde +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Rotate Push Pop. - * - * The push() and pop() functions allow for more control over transformations. - * The push function saves the current coordinate system to the stack - * and pop() restores the prior coordinate system. - */ - -float a; // Angle of rotation -float offset = PI/24.0; // Angle offset between boxes -int num = 12; // Number of boxes - -void setup() { - size(640, 360, P3D); - noStroke(); -} - - -void draw() { - - lights(); - - background(0, 0, 26); - translate(width/2, height/2); - - for(int i = 0; i < num; i++) { - float gray = map(i, 0, num-1, 0, 255); - pushMatrix(); - fill(gray); - rotateY(a + offset*i); - rotateX(a/2 + offset*i); - box(200); - popMatrix(); - } - - a += 0.01; -} diff --git a/java/examples/Basics/Transform/RotateXY/RotateXY.pde b/java/examples/Basics/Transform/RotateXY/RotateXY.pde deleted file mode 100644 index d6401c1d5..000000000 --- a/java/examples/Basics/Transform/RotateXY/RotateXY.pde +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Rotate 1. - * - * Rotating simultaneously in the X and Y axis. - * Transformation functions such as rotate() are additive. - * Successively calling rotate(1.0) and rotate(2.0) - * is equivalent to calling rotate(3.0). - */ - -float a = 0.0; -float rSize; // rectangle size - -void setup() { - size(640, 360, P3D); - rSize = width / 6; - noStroke(); - fill(204, 204); -} - -void draw() { - background(126); - - a += 0.005; - if(a > TWO_PI) { - a = 0.0; - } - - translate(width/2, height/2); - - rotateX(a); - rotateY(a * 2.0); - fill(255); - rect(-rSize, -rSize, rSize*2, rSize*2); - - rotateX(a * 1.001); - rotateY(a * 2.002); - fill(0); - rect(-rSize, -rSize, rSize*2, rSize*2); - -} diff --git a/java/examples/Basics/Transform/Scale/Scale.pde b/java/examples/Basics/Transform/Scale/Scale.pde deleted file mode 100644 index e11baa17e..000000000 --- a/java/examples/Basics/Transform/Scale/Scale.pde +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Scale - * by Denis Grutze. - * - * Paramenters for the scale() function are values specified - * as decimal percentages. For example, the method call scale(2.0) - * will increase the dimension of the shape by 200 percent. - * Objects always scale from the origin. - */ - -float a = 0.0; -float s = 0.0; - -void setup() { - size(640, 360); - noStroke(); - rectMode(CENTER); - frameRate(30); -} - -void draw() { - - background(102); - - a = a + 0.04; - s = cos(a)*2; - - translate(width/2, height/2); - scale(s); - fill(51); - rect(0, 0, 50, 50); - - translate(75, 0); - fill(255); - scale(s); - rect(0, 0, 50, 50); -} diff --git a/java/examples/Basics/Transform/Translate/Translate.pde b/java/examples/Basics/Transform/Translate/Translate.pde deleted file mode 100644 index d701904ff..000000000 --- a/java/examples/Basics/Transform/Translate/Translate.pde +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Translate. - * - * The translate() function allows objects to be moved - * to any location within the window. The first parameter - * sets the x-axis offset and the second parameter sets the - * y-axis offset. - */ - -float x, y; -float dim = 80.0; - -void setup() { - size(640, 360); - noStroke(); -} - -void draw() { - background(102); - - x = x + 0.8; - - if (x > width + dim) { - x = -dim; - } - - translate(x, height/2-dim/2); - fill(255); - rect(-dim/2, -dim/2, dim, dim); - - // Transforms accumulate. Notice how this rect moves - // twice as fast as the other, but it has the same - // parameter for the x-axis value - translate(x, dim); - fill(0); - rect(-dim/2, -dim/2, dim, dim); -} diff --git a/java/examples/Basics/Typography/Letters/Letters.pde b/java/examples/Basics/Typography/Letters/Letters.pde deleted file mode 100644 index 60b3b5ef4..000000000 --- a/java/examples/Basics/Typography/Letters/Letters.pde +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Letters. - * - * Draws letters to the screen. This requires loading a font, - * setting the font, and then drawing the letters. - */ - -PFont f; - -void setup() { - size(640, 360); - background(0); - - // Create the font - printArray(PFont.list()); - f = createFont("Georgia", 24); - textFont(f); - textAlign(CENTER, CENTER); -} - -void draw() { - background(0); - - // Set the left and top margin - int margin = 10; - translate(margin*4, margin*4); - - int gap = 46; - int counter = 35; - - for (int y = 0; y < height-gap; y += gap) { - for (int x = 0; x < width-gap; x += gap) { - - char letter = char(counter); - - if (letter == 'A' || letter == 'E' || letter == 'I' || letter == 'O' || letter == 'U') { - fill(255, 204, 0); - } - else { - fill(255); - } - - // Draw the letter to the screen - text(letter, x, y); - - // Increment the counter - counter++; - } - } -} - diff --git a/java/examples/Basics/Typography/Letters/data/Georgia.ttf b/java/examples/Basics/Typography/Letters/data/Georgia.ttf deleted file mode 100644 index 27d1c1951..000000000 Binary files a/java/examples/Basics/Typography/Letters/data/Georgia.ttf and /dev/null differ diff --git a/java/examples/Basics/Typography/Words/Words.pde b/java/examples/Basics/Typography/Words/Words.pde deleted file mode 100644 index 145641412..000000000 --- a/java/examples/Basics/Typography/Words/Words.pde +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Words. - * - * The text() function is used for writing words to the screen. - * The letters can be aligned left, center, or right with the - * textAlign() function. - */ - -PFont f; - -void setup() { - size(640, 360); - - // Create the font - printArray(PFont.list()); - f = createFont("Georgia", 24); - textFont(f); -} - -void draw() { - background(102); - textAlign(RIGHT); - drawType(width * 0.25); - textAlign(CENTER); - drawType(width * 0.5); - textAlign(LEFT); - drawType(width * 0.75); -} - -void drawType(float x) { - line(x, 0, x, 65); - line(x, 220, x, height); - fill(0); - text("ichi", x, 95); - fill(51); - text("ni", x, 130); - fill(204); - text("san", x, 165); - fill(255); - text("shi", x, 210); -} diff --git a/java/examples/Basics/Typography/Words/data/Georgia.ttf b/java/examples/Basics/Typography/Words/data/Georgia.ttf deleted file mode 100644 index 27d1c1951..000000000 Binary files a/java/examples/Basics/Typography/Words/data/Georgia.ttf and /dev/null differ diff --git a/java/examples/Basics/Web/EmbeddedLinks/EmbeddedLinks.pde b/java/examples/Basics/Web/EmbeddedLinks/EmbeddedLinks.pde deleted file mode 100644 index 05e811187..000000000 --- a/java/examples/Basics/Web/EmbeddedLinks/EmbeddedLinks.pde +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Loading URLs. - * - * Click on the left button to open a different URL in the same window (Only - * works online). Click on the right button to open a URL in a new browser window. -*/ - -boolean overLeftButton = false; -boolean overRightButton = false; - -void setup() { - size(640, 360); -} - -void draw() { - background(204); - - // Left buttom - if (overLeftButton == true) { - fill(255); - } else { - noFill(); - } - rect(20, 60, 75, 75); - rect(50, 90, 15, 15); - - // Right button - if (overRightButton == true) { - fill(255); - } else { - noFill(); - } - rect(105, 60, 75, 75); - line(135, 105, 155, 85); - line(140, 85, 155, 85); - line(155, 85, 155, 100); -} - -void mousePressed() { - if (overLeftButton) { - link("http://www.processing.org"); - } else if (overRightButton) { - link("http://www.processing.org", "_new"); - } -} - -void mouseMoved() { - checkButtons(); -} - -void mouseDragged() { - checkButtons(); -} - -void checkButtons() { - if (mouseX > 20 && mouseX < 95 && mouseY > 60 && mouseY < 135) { - overLeftButton = true; - } else if (mouseX > 105 && mouseX < 180 && mouseY > 60 && mouseY <135) { - overRightButton = true; - } else { - overLeftButton = overRightButton = false; - } -} - - - - diff --git a/java/examples/Basics/Web/LoadingImages/LoadingImages.pde b/java/examples/Basics/Web/LoadingImages/LoadingImages.pde deleted file mode 100644 index 9f2f3fa04..000000000 --- a/java/examples/Basics/Web/LoadingImages/LoadingImages.pde +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Loading Images. - * - * Processing applications can only load images from the network - * while running in the Processing environment. - * - * This example will not run in a web broswer and will only work when - * the computer is connected to the Internet. - */ - -PImage img; - -void setup() { - size(640, 360); - img = loadImage("http://processing.org/img/processing-web.png"); - noLoop(); -} - -void draw() { - background(0); - if (img != null) { - for (int i = 0; i < 5; i++) { - image(img, 0, img.height * i); - } - } -} - diff --git a/java/examples/Books/Getting Started/Chapter02/Ex_02_01/Ex_02_01.pde b/java/examples/Books/Getting Started/Chapter02/Ex_02_01/Ex_02_01.pde deleted file mode 100644 index 82539334c..000000000 --- a/java/examples/Books/Getting Started/Chapter02/Ex_02_01/Ex_02_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -// Example 02-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -ellipse(50, 50, 80, 80); diff --git a/java/examples/Books/Getting Started/Chapter02/Ex_02_02/Ex_02_02.pde b/java/examples/Books/Getting Started/Chapter02/Ex_02_02/Ex_02_02.pde deleted file mode 100644 index 0455e4836..000000000 --- a/java/examples/Books/Getting Started/Chapter02/Ex_02_02/Ex_02_02.pde +++ /dev/null @@ -1,17 +0,0 @@ -// Example 02-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - smooth(); -} - -void draw() { - if (mousePressed) { - fill(0); - } else { - fill(255); - } - ellipse(mouseX, mouseY, 80, 80); -} - diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_01/Ex_03_01.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_01/Ex_03_01.pde deleted file mode 100644 index 2220a08fb..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_01/Ex_03_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -// Example 03-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(800, 600); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_02/Ex_03_02.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_02/Ex_03_02.pde deleted file mode 100644 index abd536f2c..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_02/Ex_03_02.pde +++ /dev/null @@ -1,5 +0,0 @@ -// Example 03-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -point(240, 60); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_03/Ex_03_03.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_03/Ex_03_03.pde deleted file mode 100644 index ba7ab8280..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_03/Ex_03_03.pde +++ /dev/null @@ -1,5 +0,0 @@ -// Example 03-03 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -line(20, 50, 420, 110); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_04/Ex_03_04.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_04/Ex_03_04.pde deleted file mode 100644 index eb117b98c..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_04/Ex_03_04.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Example 03-04 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -quad(158, 55, 199, 14, 392, 66, 351, 107); -triangle(347, 54, 392, 9, 392, 66); -triangle(158, 55, 290, 91, 290, 112); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_05/Ex_03_05.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_05/Ex_03_05.pde deleted file mode 100644 index 9e297af1e..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_05/Ex_03_05.pde +++ /dev/null @@ -1,5 +0,0 @@ -// Example 03-05 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -rect(180, 60, 220, 40); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_06/Ex_03_06.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_06/Ex_03_06.pde deleted file mode 100644 index d4016401c..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_06/Ex_03_06.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Example 03-06 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -ellipse(278, -100, 400, 400); -ellipse(120, 100, 110, 110); -ellipse(412, 60, 18, 18); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_07/Ex_03_07.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_07/Ex_03_07.pde deleted file mode 100644 index a0dc019a7..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_07/Ex_03_07.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Example 03-07 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -arc(90, 60, 80, 80, 0, HALF_PI); -arc(190, 60, 80, 80, 0, PI+HALF_PI); -arc(290, 60, 80, 80, PI, TWO_PI+HALF_PI); -arc(390, 60, 80, 80, QUARTER_PI, PI+QUARTER_PI); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_08/Ex_03_08.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_08/Ex_03_08.pde deleted file mode 100644 index 75b5f4f73..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_08/Ex_03_08.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Example 03-08 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -arc(90, 60, 80, 80, 0, radians(90)); -arc(190, 60, 80, 80, 0, radians(270)); -arc(290, 60, 80, 80, radians(180), radians(450)); -arc(390, 60, 80, 80, radians(45), radians(225)); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_09/Ex_03_09.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_09/Ex_03_09.pde deleted file mode 100644 index 525f1da67..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_09/Ex_03_09.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Example 03-09 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -ellipse(140, 0, 190, 190); -// The rectangle draws on top of the ellipse -// because it comes after in the code -rect(160, 30, 260, 20); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_10/Ex_03_10.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_10/Ex_03_10.pde deleted file mode 100644 index b765d8fb9..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_10/Ex_03_10.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Example 03-10 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -rect(160, 30, 260, 20); -// The ellipse draws on top of the rectangle -// because it comes after in the code -ellipse(140, 0, 190, 190); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_11/Ex_03_11.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_11/Ex_03_11.pde deleted file mode 100644 index d40ff08cb..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_11/Ex_03_11.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Example 03-11 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); // Turns on smoothing -ellipse(140, 60, 90, 90); -noSmooth(); // Turns off smoothing -ellipse(240, 60, 90, 90); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_12/Ex_03_12.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_12/Ex_03_12.pde deleted file mode 100644 index fdd8e9a4f..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_12/Ex_03_12.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Example 03-12 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -ellipse(75, 60, 90, 90); -strokeWeight(8); // Stroke weight to 8 pixels -ellipse(175, 60, 90, 90); -ellipse(279, 60, 90, 90); -strokeWeight(20); // Stroke weight to 20 pixels -ellipse(389, 60, 90, 90); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_13/Ex_03_13.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_13/Ex_03_13.pde deleted file mode 100644 index e47332559..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_13/Ex_03_13.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Example 03-13 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -strokeWeight(12); -strokeJoin(ROUND); // Round the stroke corners -rect(40, 25, 70, 70); -strokeJoin(BEVEL); // Bevel the stroke corners -rect(140, 25, 70, 70); -strokeCap(SQUARE); // Square the line endings -line(270, 25, 340, 95); -strokeCap(ROUND); // Round the line endings -line(350, 25, 420, 95); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_14/Ex_03_14.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_14/Ex_03_14.pde deleted file mode 100644 index 31f7d5f93..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_14/Ex_03_14.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Example 03-14 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -background(0); // Black -fill(204); // Light gray -ellipse(132, 82, 200, 200); // Light gray circle -fill(153); // Medium gray -ellipse(228, -16, 200, 200); // Medium gray circle -fill(102); // Dark gray -ellipse(268, 118, 200, 200); // Dark gray circle diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_15/Ex_03_15.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_15/Ex_03_15.pde deleted file mode 100644 index 83b5d3c44..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_15/Ex_03_15.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Example 03-15 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -fill(153); // Medium gray -ellipse(132, 82, 200, 200); // Gray circle -noFill(); // Turn off fill -ellipse(228, -16, 200, 200); // Outline circle -noStroke(); // Turn off stroke -ellipse(268, 118, 200, 200); // Doesn’t draw! diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_16/Ex_03_16.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_16/Ex_03_16.pde deleted file mode 100644 index 833ce14a1..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_16/Ex_03_16.pde +++ /dev/null @@ -1,13 +0,0 @@ -// Example 03-16 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -noStroke(); -smooth(); -background(0, 26, 51); // Dark blue color -fill(255, 0, 0); // Red color -ellipse(132, 82, 200, 200); // Red circle -fill(0, 255, 0); // Green color -ellipse(228, -16, 200, 200); // Green circle -fill(0, 0, 255); // Blue color -ellipse(268, 118, 200, 200); // Blue circle diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_17/Ex_03_17.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_17/Ex_03_17.pde deleted file mode 100644 index d7bbbd22d..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_17/Ex_03_17.pde +++ /dev/null @@ -1,13 +0,0 @@ -// Example 03-17 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -noStroke(); -smooth(); -background(204, 226, 225); // Light blue color -fill(255, 0, 0, 160); // Red color -ellipse(132, 82, 200, 200); // Red circle -fill(0, 255, 0, 160); // Green color -ellipse(228, -16, 200, 200); // Green circle -fill(0, 0, 255, 160); // Blue color -ellipse(268, 118, 200, 200); // Blue circle diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_18/Ex_03_18.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_18/Ex_03_18.pde deleted file mode 100644 index c19099ee0..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_18/Ex_03_18.pde +++ /dev/null @@ -1,13 +0,0 @@ -// Example 03-18 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -beginShape(); -vertex(180, 82); -vertex(207, 36); -vertex(214, 63); -vertex(407, 11); -vertex(412, 30); -vertex(219, 82); -vertex(226, 109); -endShape(); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_19/Ex_03_19.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_19/Ex_03_19.pde deleted file mode 100644 index 0e1e8d785..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_19/Ex_03_19.pde +++ /dev/null @@ -1,13 +0,0 @@ -// Example 03-19 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -beginShape(); -vertex(180, 82); -vertex(207, 36); -vertex(214, 63); -vertex(407, 11); -vertex(412, 30); -vertex(219, 82); -vertex(226, 109); -endShape(CLOSE); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_20/Ex_03_20.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_20/Ex_03_20.pde deleted file mode 100644 index 76b283bfa..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_20/Ex_03_20.pde +++ /dev/null @@ -1,38 +0,0 @@ -// Example 03-20 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); - -// Left creature -beginShape(); -vertex(50, 120); -vertex(100, 90); -vertex(110, 60); -vertex(80, 20); -vertex(210, 60); -vertex(160, 80); -vertex(200, 90); -vertex(140, 100); -vertex(130, 120); -endShape(); -fill(0); -ellipse(155, 60, 8, 8); - -// Right creature -fill(255); -beginShape(); -vertex(370, 120); -vertex(360, 90); -vertex(290, 80); -vertex(340, 70); -vertex(280, 50); -vertex(420, 10); -vertex(390, 50); -vertex(410, 90); -vertex(460, 120); -endShape(); -fill(0); -ellipse(345, 50, 10, 10); - - diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_01/Ex_04_01.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_01/Ex_04_01.pde deleted file mode 100644 index 22ab9a5e3..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_01/Ex_04_01.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Example 04-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -int y = 60; -int d = 80; -ellipse(75, y, d, d); // Left -ellipse(175, y, d, d); // Middle -ellipse(275, y, d, d); // Right diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_02/Ex_04_02.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_02/Ex_04_02.pde deleted file mode 100644 index 01d3cb29a..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_02/Ex_04_02.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Example 04-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -int y = 100; -int d = 130; -ellipse(75, y, d, d); // Left -ellipse(175, y, d, d); // Middle -ellipse(275, y, d, d); // Right diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_03/Ex_04_03.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_03/Ex_04_03.pde deleted file mode 100644 index b7cdec584..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_03/Ex_04_03.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Example 04-03 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -line(0, 0, width, height); // Line from (0,0) to (480, 120) -line(width, 0, 0, height); // Line from (480, 0) to (0, 120) -ellipse(width/2, height/2, 60, 60); diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_04/Ex_04_04.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_04/Ex_04_04.pde deleted file mode 100644 index 294092ded..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_04/Ex_04_04.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Example 04-04 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -int x = 25; -int h = 20; -int y = 25; -rect(x, y, 300, h); // Top -x = x + 100; -rect(x, y + h, 300, h); // Middle -x = x - 250; -rect(x, y + h*2, 300, h); // Bottom diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_05/Ex_04_05.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_05/Ex_04_05.pde deleted file mode 100644 index beddf453e..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_05/Ex_04_05.pde +++ /dev/null @@ -1,13 +0,0 @@ -// Example 04-05 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -strokeWeight(8); -line(20, 40, 80, 80); -line(80, 40, 140, 80); -line(140, 40, 200, 80); -line(200, 40, 260, 80); -line(260, 40, 320, 80); -line(320, 40, 380, 80); -line(380, 40, 440, 80); diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_06/Ex_04_06.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_06/Ex_04_06.pde deleted file mode 100644 index b7f5fa3f4..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_06/Ex_04_06.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Example 04-06 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -strokeWeight(8); -for (int i = 20; i < 400; i += 60) { - line(i, 40, i + 60, 80); -} - diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_07/Ex_04_07.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_07/Ex_04_07.pde deleted file mode 100644 index 6c641d898..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_07/Ex_04_07.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Example 04-07 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -strokeWeight(2); -for (int i = 20; i < 400; i += 8) { - line(i, 40, i + 60, 80); -} - diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_08/Ex_04_08.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_08/Ex_04_08.pde deleted file mode 100644 index 68092ced5..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_08/Ex_04_08.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Example 04-08 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -strokeWeight(2); -for (int i = 20; i < 400; i += 20) { - line(i, 0, i + i/2, 80); -} - diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_09/Ex_04_09.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_09/Ex_04_09.pde deleted file mode 100644 index 67493fd0d..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_09/Ex_04_09.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Example 04-09 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -strokeWeight(2); -for (int i = 20; i < 400; i += 20) { - line(i, 0, i + i/2, 80); - line(i + i/2, 80, i*1.2, 120); -} - diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_10/Ex_04_10.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_10/Ex_04_10.pde deleted file mode 100644 index 2b6f7cb4f..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_10/Ex_04_10.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Example 04-10 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -background(0); -smooth(); -noStroke(); -for (int y = 0; y <= height; y += 40) { - for (int x = 0; x <= width; x += 40) { - fill(255, 140); - ellipse(x, y, 40, 40); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_11/Ex_04_11.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_11/Ex_04_11.pde deleted file mode 100644 index 18bf46050..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_11/Ex_04_11.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Example 04-11 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -background(0); -smooth(); -noStroke(); -for (int y = 0; y < height+45; y += 40) { - fill(255, 140); - ellipse(0, y, 40, 40); -} -for (int x = 0; x < width+45; x += 40) { - fill(255, 140); - ellipse(x, 0, 40, 40); -} - diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_12/Ex_04_12.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_12/Ex_04_12.pde deleted file mode 100644 index 565af4f4b..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_12/Ex_04_12.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Example 04-12 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -background(0); -smooth(); -fill(255); -stroke(102); -for (int y = 20; y <= height-20; y += 10) { - for (int x = 20; x <= width-20; x += 10) { - ellipse(x, y, 4, 4); - // Draw a line to the center of the display - line(x, y, 240, 60); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_13/Ex_04_13.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_13/Ex_04_13.pde deleted file mode 100644 index a57dd0f97..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_13/Ex_04_13.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Example 04-13 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -background(0); -smooth(); -for (int y = 32; y <= height; y += 8) { - for (int x = 12; x <= width; x += 15) { - ellipse(x + y, y, 16 - y/10.0, 16 - y/10.0); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_01/Ex_05_01.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_01/Ex_05_01.pde deleted file mode 100644 index f1359dd0e..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_01/Ex_05_01.pde +++ /dev/null @@ -1,9 +0,0 @@ -// Example 05-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void draw() { - // Displays the frame count to the Console - println("I’m drawing"); - println(frameCount); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_02/Ex_05_02.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_02/Ex_05_02.pde deleted file mode 100644 index 4dd7dafbb..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_02/Ex_05_02.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Example 05-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - println("I’m starting"); -} - -void draw() { - println("I’m running"); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_03/Ex_05_03.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_03/Ex_05_03.pde deleted file mode 100644 index 6151ad601..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_03/Ex_05_03.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Example 05-03 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int x = 280; -int y = -100; -int diameter = 380; - -void setup() { - size(480, 120); - smooth(); - fill(102); -} - -void draw() { - background(204); - ellipse(x, y, diameter, diameter); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_04/Ex_05_04.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_04/Ex_05_04.pde deleted file mode 100644 index f5752a2e0..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_04/Ex_05_04.pde +++ /dev/null @@ -1,15 +0,0 @@ -// Example 05-04 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - fill(0, 102); - smooth(); - noStroke(); -} - -void draw() { - ellipse(mouseX, mouseY, 9, 9); -} - - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_05/Ex_05_05.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_05/Ex_05_05.pde deleted file mode 100644 index fcd3daa4a..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_05/Ex_05_05.pde +++ /dev/null @@ -1,15 +0,0 @@ -// Example 05-05 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - fill(0, 102); - smooth(); - noStroke(); -} - -void draw() { - background(204); - ellipse(mouseX, mouseY, 9, 9); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_06/Ex_05_06.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_06/Ex_05_06.pde deleted file mode 100644 index 3346117bd..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_06/Ex_05_06.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Example 05-06 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - strokeWeight(4); - smooth(); - stroke(0, 102); -} - -void draw() { - line(mouseX, mouseY, pmouseX, pmouseY); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_07/Ex_05_07.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_07/Ex_05_07.pde deleted file mode 100644 index 5f0415957..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_07/Ex_05_07.pde +++ /dev/null @@ -1,15 +0,0 @@ -// Example 05-07 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - smooth(); - stroke(0, 102); -} - -void draw() { - float weight = dist(mouseX, mouseY, pmouseX, pmouseY); - strokeWeight(weight); - line(mouseX, mouseY, pmouseX, pmouseY); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_08/Ex_05_08.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_08/Ex_05_08.pde deleted file mode 100644 index d32f682bb..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_08/Ex_05_08.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Example 05-08 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float x; -float easing = 0.01; - -void setup() { - size(220, 120); - smooth(); -} - -void draw() { - float targetX = mouseX; - x += (targetX - x) * easing; - ellipse(x, 40, 12, 12); - println(targetX + " : " + x); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_09/Ex_05_09.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_09/Ex_05_09.pde deleted file mode 100644 index 0bca76b71..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_09/Ex_05_09.pde +++ /dev/null @@ -1,27 +0,0 @@ -// Example 05-09 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float x; -float y; -float px; -float py; -float easing = 0.05; - -void setup() { - size(480, 120); - smooth(); - stroke(0, 102); -} - -void draw() { - float targetX = mouseX; - x += (targetX - x) * easing; - float targetY = mouseY; - y += (targetY - y) * easing; - float weight = dist(x, y, px, py); - strokeWeight(weight); - line(x, y, px, py); - py = y; - px = x; -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_10/Ex_05_10.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_10/Ex_05_10.pde deleted file mode 100644 index be0cf8ced..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_10/Ex_05_10.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Example 05-10 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(240, 120); - strokeWeight(12); - smooth(); -} - -void draw() { - background(204); - stroke(255); - line(120, 60, mouseX, mouseY); // White line - stroke(0); - float mx = mouseX/2 + 60; - line(120, 60, mx, mouseY); // Black line -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_11/Ex_05_11.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_11/Ex_05_11.pde deleted file mode 100644 index 0fb127237..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_11/Ex_05_11.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Example 05-11 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(240, 120); - strokeWeight(12); - smooth(); -} - -void draw() { - background(204); - stroke(255); - line(120, 60, mouseX, mouseY); // White line - stroke(0); - float mx = map(mouseX, 0, width, 60, 180); - line(120, 60, mx, mouseY); // Black line -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_12/Ex_05_12.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_12/Ex_05_12.pde deleted file mode 100644 index b69e2f422..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_12/Ex_05_12.pde +++ /dev/null @@ -1,19 +0,0 @@ -// Example 05-12 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(240, 120); - smooth(); - strokeWeight(30); -} - -void draw() { - background(204); - stroke(102); - line(40, 0, 70, height); - if (mousePressed == true) { - stroke(0); - } - line(0, 70, width, 50); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_13/Ex_05_13.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_13/Ex_05_13.pde deleted file mode 100644 index a5f4cd85d..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_13/Ex_05_13.pde +++ /dev/null @@ -1,21 +0,0 @@ -// Example 05-13 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(240, 120); - smooth(); - strokeWeight(30); -} - -void draw() { - background(204); - stroke(102); - line(40, 0, 70, height); - if (mousePressed) { - stroke(0); - } else { - stroke(255); - } - line(0, 70, width, 50); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_14/Ex_05_14.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_14/Ex_05_14.pde deleted file mode 100644 index a75d0a93f..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_14/Ex_05_14.pde +++ /dev/null @@ -1,23 +0,0 @@ -// Example 05-14 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(120, 120); - smooth(); - strokeWeight(30); -} - -void draw() { - background(204); - stroke(102); - line(40, 0, 70, height); - if (mousePressed) { - if (mouseButton == LEFT) { - stroke(255); - } else { - stroke(0); - } - line(0, 70, width, 50); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_15/Ex_05_15.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_15/Ex_05_15.pde deleted file mode 100644 index 78a1bdae0..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_15/Ex_05_15.pde +++ /dev/null @@ -1,28 +0,0 @@ -// Example 05-15 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float x; -int offset = 10; - -void setup() { - size(240, 120); - smooth(); - x = width/2; -} - -void draw() { - background(204); - if (mouseX > x) { - x += 0.5; - offset = -10; - } - if (mouseX < x) { - x -= 0.5; - offset = 10; - } - line(x, 0, x, height); - line(mouseX, mouseY, mouseX + offset, mouseY - 10); - line(mouseX, mouseY, mouseX + offset, mouseY + 10); - line(mouseX, mouseY, mouseX + offset*3, mouseY); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_16/Ex_05_16.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_16/Ex_05_16.pde deleted file mode 100644 index 7092b86ab..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_16/Ex_05_16.pde +++ /dev/null @@ -1,25 +0,0 @@ -// Example 05-16 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int x = 120; -int y = 60; -int radius = 12; - -void setup() { - size(240, 120); - smooth(); - ellipseMode(RADIUS); -} - -void draw() { - background(204); - float d = dist(mouseX, mouseY, x, y); - if (d < radius) { - radius++; - fill(0); - } else { - fill(255); - } - ellipse(x, y, radius, radius); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_17/Ex_05_17.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_17/Ex_05_17.pde deleted file mode 100644 index cf3ebe452..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_17/Ex_05_17.pde +++ /dev/null @@ -1,24 +0,0 @@ -// Example 05-17 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int x = 80; -int y = 30; -int w = 80; -int h = 60; - -void setup() { - size(240, 120); -} - -void draw() { - background(204); - if ((mouseX > x) && (mouseX < x+w) && - (mouseY > y) && (mouseY < y+h)) { - fill(0); - } - else { - fill(255); - } - rect(x, y, w, h); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_18/Ex_05_18.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_18/Ex_05_18.pde deleted file mode 100644 index 1031bb201..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_18/Ex_05_18.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Example 05-18 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(240, 120); - smooth(); -} - -void draw() { - background(204); - line(20, 20, 220, 100); - if (keyPressed) { - line(220, 20, 20, 100); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_19/Ex_05_19.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_19/Ex_05_19.pde deleted file mode 100644 index 96bb0217d..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_19/Ex_05_19.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Example 05-19 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(120, 120); - textSize(64); - textAlign(CENTER); -} - -void draw() { - background(0); - text(key, 60, 80); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_20/Ex_05_20.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_20/Ex_05_20.pde deleted file mode 100644 index df7a032eb..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_20/Ex_05_20.pde +++ /dev/null @@ -1,22 +0,0 @@ -// Example 05-20 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(120, 120); - smooth(); -} - -void draw() { - background(204); - if (keyPressed) { - if ((key == 'h') || (key == 'H')) { - line(30, 60, 90, 60); - } - if ((key == 'n') || (key == 'N')) { - line(30, 20, 90, 100); - } - } - line(30, 20, 30, 100); - line(90, 20, 90, 100); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_21/Ex_05_21.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_21/Ex_05_21.pde deleted file mode 100644 index b3e3afabe..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_21/Ex_05_21.pde +++ /dev/null @@ -1,21 +0,0 @@ -// Example 05-21 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int x = 215; - -void setup() { - size(480, 120); -} - -void draw() { - if (keyPressed && (key == CODED)) { // If it's a coded key - if (keyCode == LEFT) { // If it's the left arrow - x--; - } - else if (keyCode == RIGHT) { // If it's the right arrow - x++; - } - } - rect(x, 45, 50, 50); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_01/Ex_06_01.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_01/Ex_06_01.pde deleted file mode 100644 index 534292bd6..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_01/Ex_06_01.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Example 06-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PImage img; - -void setup() { - size(480, 120); - img = loadImage("lunar.jpg"); -} - -void draw() { - image(img, 0, 0); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_02/Ex_06_02.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_02/Ex_06_02.pde deleted file mode 100644 index 38ede3e47..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_02/Ex_06_02.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Example 06-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PImage img1; -PImage img2; - -void setup() { - size(480, 120); - img1 = loadImage("lunar.jpg"); - img2 = loadImage("capsule.jpg"); -} - -void draw() { - image(img1, -120, 0); - image(img1, 130, 0, 240, 120); - image(img2, 300, 0, 240, 120); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_03/Ex_06_03.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_03/Ex_06_03.pde deleted file mode 100644 index 11d0ce517..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_03/Ex_06_03.pde +++ /dev/null @@ -1,15 +0,0 @@ -// Example 06-03 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PImage img; - -void setup() { - size(480, 120); - img = loadImage("lunar.jpg"); -} - -void draw() { - background(0); - image(img, 0, 0, mouseX * 2, mouseY * 2); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_04/Ex_06_04.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_04/Ex_06_04.pde deleted file mode 100644 index a59ea353a..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_04/Ex_06_04.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Example 06-04 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PImage img; - -void setup() { - size(480, 120); - img = loadImage("clouds.gif"); -} - -void draw() { - background(255); - image(img, 0, 0); - image(img, 0, mouseY * -1); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_04/data/clouds.gif b/java/examples/Books/Getting Started/Chapter06/Ex_06_04/data/clouds.gif deleted file mode 100644 index ad52b85a1..000000000 Binary files a/java/examples/Books/Getting Started/Chapter06/Ex_06_04/data/clouds.gif and /dev/null differ diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_05/Ex_06_05.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_05/Ex_06_05.pde deleted file mode 100644 index 0b157b55d..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_05/Ex_06_05.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Example 06-05 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PImage img; - -void setup() { - size(480, 120); - img = loadImage("clouds.png"); -} - -void draw() { - background(204); - image(img, 0, 0); - image(img, 0, mouseY * -1); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_06/Ex_06_06.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_06/Ex_06_06.pde deleted file mode 100644 index 1831a30bd..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_06/Ex_06_06.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Example 06-06 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PFont font; - -void setup() { - size(480, 120); - smooth(); - font = loadFont("AndaleMono-36.vlw"); - textFont(font); -} - -void draw() { - background(102); - textSize(36); - text("That’s one small step for man...", 25, 60); - textSize(18); - text("That’s one small step for man...", 27, 90); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_06/data/AndaleMono-36.vlw b/java/examples/Books/Getting Started/Chapter06/Ex_06_06/data/AndaleMono-36.vlw deleted file mode 100644 index 34e243f0b..000000000 Binary files a/java/examples/Books/Getting Started/Chapter06/Ex_06_06/data/AndaleMono-36.vlw and /dev/null differ diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_07/Ex_06_07.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_07/Ex_06_07.pde deleted file mode 100644 index b96eff645..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_07/Ex_06_07.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Example 06-07 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PFont font; - -void setup() { - size(480, 120); - font = loadFont("AndaleMono-24.vlw"); - textFont(font); -} - -void draw() { - background(102); - text("That’s one small step for man...", 26, 30, 240, 100); -} - - - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_07/data/AndaleMono-24.vlw b/java/examples/Books/Getting Started/Chapter06/Ex_06_07/data/AndaleMono-24.vlw deleted file mode 100644 index a71ac78ac..000000000 Binary files a/java/examples/Books/Getting Started/Chapter06/Ex_06_07/data/AndaleMono-24.vlw and /dev/null differ diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_08/Ex_06_08.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_08/Ex_06_08.pde deleted file mode 100644 index 25edeafb1..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_08/Ex_06_08.pde +++ /dev/null @@ -1,17 +0,0 @@ -// Example 06-08 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PFont font; -String quote = "That’s one small step for man..."; - -void setup() { - size(480, 120); - font = loadFont("AndaleMono-24.vlw"); - textFont(font); -} - -void draw() { - background(102); - text(quote, 26, 30, 240, 100); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_08/data/AndaleMono-24.vlw b/java/examples/Books/Getting Started/Chapter06/Ex_06_08/data/AndaleMono-24.vlw deleted file mode 100644 index a71ac78ac..000000000 Binary files a/java/examples/Books/Getting Started/Chapter06/Ex_06_08/data/AndaleMono-24.vlw and /dev/null differ diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_09/Ex_06_09.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_09/Ex_06_09.pde deleted file mode 100644 index 74c4be6a6..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_09/Ex_06_09.pde +++ /dev/null @@ -1,17 +0,0 @@ -// Example 06-09 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PShape network; - -void setup() { - size(480, 120); - smooth(); - network = loadShape("network.svg"); -} - -void draw() { - background(0); - shape(network, 30, 10); - shape(network, 180, 10, 280, 280); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_09/data/network.svg b/java/examples/Books/Getting Started/Chapter06/Ex_06_09/data/network.svg deleted file mode 100644 index 5ecd8d159..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_09/data/network.svg +++ /dev/null @@ -1,4056 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_10/Ex_06_10.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_10/Ex_06_10.pde deleted file mode 100644 index 417acc3c8..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_10/Ex_06_10.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Example 06-10 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PShape network; - -void setup() { - size(240, 120); - smooth(); - shapeMode(CENTER); - network = loadShape("network.svg"); -} - -void draw() { - background(0); - float diameter = map(mouseX, 0, width, 10, 800); - shape(network, 120, 60, diameter, diameter); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_10/data/network.svg b/java/examples/Books/Getting Started/Chapter06/Ex_06_10/data/network.svg deleted file mode 100644 index 5ecd8d159..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_10/data/network.svg +++ /dev/null @@ -1,4056 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_01/Ex_07_01.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_01/Ex_07_01.pde deleted file mode 100644 index 3db017b73..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_01/Ex_07_01.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Example 07-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void draw() { - println(frameRate); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_02/Ex_07_02.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_02/Ex_07_02.pde deleted file mode 100644 index 615aaf154..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_02/Ex_07_02.pde +++ /dev/null @@ -1,15 +0,0 @@ -// Example 07-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - frameRate(30); // Thirty frames each second - //frameRate(12); // Twelve frames each second - //frameRate(2); // Two frames each second - //frameRate(0.5); // One frame every two seconds -} - -void draw() { - println(frameRate); -} - - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_03/Ex_07_03.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_03/Ex_07_03.pde deleted file mode 100644 index aafb141cc..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_03/Ex_07_03.pde +++ /dev/null @@ -1,19 +0,0 @@ -// Example 07-03 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int radius = 40; -float x = -radius; -float speed = 0.5; - -void setup() { - size(240, 120); - smooth(); - ellipseMode(RADIUS); -} - -void draw() { - background(0); - x += speed; // Increase the value of x - arc(x, 60, radius, radius, 0.52, 5.76); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_04/Ex_07_04.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_04/Ex_07_04.pde deleted file mode 100644 index b3c37bad9..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_04/Ex_07_04.pde +++ /dev/null @@ -1,22 +0,0 @@ -// Example 07-04 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int radius = 40; -float x = -radius; -float speed = 0.5; - -void setup() { - size(240, 120); - smooth(); - ellipseMode(RADIUS); -} - -void draw() { - background(0); - x += speed; // Increase the value of x - if (x > width+radius) { // If the shape is off screen - x = -radius; // move to the left edge - } - arc(x, 60, radius, radius, 0.52, 5.76); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_05/Ex_07_05.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_05/Ex_07_05.pde deleted file mode 100644 index 99ac8e396..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_05/Ex_07_05.pde +++ /dev/null @@ -1,27 +0,0 @@ -// Example 07-05 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int radius = 40; -float x = 110; -float speed = 0.5; -int direction = 1; - -void setup() { - size(240, 120); - smooth(); - ellipseMode(RADIUS); -} - -void draw() { - background(0); - x += speed * direction; - if ((x > width-radius) || (x < radius)) { - direction = -direction; // Flip direction - } - if (direction == 1) { - arc(x, 60, radius, radius, 0.52, 5.76); // Face right - } else { - arc(x, 60, radius, radius, 3.67, 8.9); // Face left - } -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_06/Ex_07_06.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_06/Ex_07_06.pde deleted file mode 100644 index c318a2fe2..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_06/Ex_07_06.pde +++ /dev/null @@ -1,27 +0,0 @@ -// Example 07-06 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int startX = 20; // Initial x-coordinate -int stopX = 160; // Final x-coordinate -int startY = 30; // Initial y-coordinate -int stopY = 80; // Final y-coordinate -float x = startX; // Current x-coordinate -float y = startY; // Current y-coordinate -float step = 0.005; // Size of each step (0.0 to 1.0) -float pct = 0.0; // Percentage traveled (0.0 to 1.0) - -void setup() { - size(240, 120); - smooth(); -} - -void draw() { - background(0); - if (pct < 1.0) { - x = startX + ((stopX-startX) * pct); - y = startY + ((stopY-startY) * pct); - pct += step; - } - ellipse(x, y, 20, 20); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_07/Ex_07_07.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_07/Ex_07_07.pde deleted file mode 100644 index 045de5dbc..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_07/Ex_07_07.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Example 07-07 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void draw() { - float r = random(0, mouseX); - println(r); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_08/Ex_07_08.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_08/Ex_07_08.pde deleted file mode 100644 index f2d1b0ee1..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_08/Ex_07_08.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Example 07-08 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(240, 120); - smooth(); -} - -void draw() { - background(204); - for (int x = 20; x < width; x += 20) { - float mx = mouseX / 10; - float offsetA = random(-mx, mx); - float offsetB = random(-mx, mx); - line(x + offsetA, 20, x - offsetB, 100); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_09/Ex_07_09.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_09/Ex_07_09.pde deleted file mode 100644 index 55f18fbab..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_09/Ex_07_09.pde +++ /dev/null @@ -1,21 +0,0 @@ -// Example 07-09 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float speed = 2.5; -int diameter = 20; -float x; -float y; - -void setup() { - size(240, 120); - smooth(); - x = width/2; - y = height/2; -} - -void draw() { - x += random(-speed, speed); - y += random(-speed, speed); - ellipse(x, y, diameter, diameter); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_10/Ex_07_10.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_10/Ex_07_10.pde deleted file mode 100644 index cec7c2012..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_10/Ex_07_10.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Example 07-10 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void draw() { - int timer = millis(); - println(timer); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_11/Ex_07_11.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_11/Ex_07_11.pde deleted file mode 100644 index 95ac8b2ab..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_11/Ex_07_11.pde +++ /dev/null @@ -1,23 +0,0 @@ -// Example 07-11 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int time1 = 2000; -int time2 = 4000; -float x = 0; - -void setup() { - size(480, 120); - smooth(); -} - -void draw() { - int currentTime = millis(); - background(204); - if (currentTime > time2) { - x -= 0.5; - } else if (currentTime > time1) { - x += 2; - } - ellipse(x, 60, 90, 90); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_12/Ex_07_12.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_12/Ex_07_12.pde deleted file mode 100644 index 21c2f7701..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_12/Ex_07_12.pde +++ /dev/null @@ -1,13 +0,0 @@ -// Example 07-12 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; - -void draw() { - float sinval = sin(angle); - println(sinval); - float gray = map(sinval, -1, 1, 0, 255); - background(gray); - angle += 0.1; -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_13/Ex_07_13.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_13/Ex_07_13.pde deleted file mode 100644 index b6beee4f4..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_13/Ex_07_13.pde +++ /dev/null @@ -1,24 +0,0 @@ -// Example 07-13 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; -float offset = 60; -float scalar = 40; -float speed = 0.05; - -void setup() { - size(240, 120); - smooth(); -} - -void draw() { - background(0); - float y1 = offset + sin(angle) * scalar; - float y2 = offset + sin(angle + 0.4) * scalar; - float y3 = offset + sin(angle + 0.8) * scalar; - ellipse( 80, y1, 40, 40); - ellipse(120, y2, 40, 40); - ellipse(160, y3, 40, 40); - angle += speed; -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_14/Ex_07_14.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_14/Ex_07_14.pde deleted file mode 100644 index 55bf6952d..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_14/Ex_07_14.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Example 07-14 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; -float offset = 60; -float scalar = 30; -float speed = 0.05; - -void setup() { - size(120, 120); - smooth(); -} - -void draw() { - float x = offset + cos(angle) * scalar; - float y = offset + sin(angle) * scalar; - ellipse( x, y, 40, 40); - angle += speed; -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_15/Ex_07_15.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_15/Ex_07_15.pde deleted file mode 100644 index 85a550f76..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_15/Ex_07_15.pde +++ /dev/null @@ -1,22 +0,0 @@ -// Example 07-15 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; -float offset = 60; -float scalar = 2; -float speed = 0.05; - -void setup() { - size(120, 120); - fill(0); - smooth(); -} - -void draw() { - float x = offset + cos(angle) * scalar; - float y = offset + sin(angle) * scalar; - ellipse( x, y, 2, 2); - angle += speed; - scalar += speed; -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_16/Ex_07_16.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_16/Ex_07_16.pde deleted file mode 100644 index 981566038..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_16/Ex_07_16.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Example 07-16 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(120, 120); -} - -void draw() { - translate(mouseX, mouseY); - rect(0, 0, 30, 30); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_17/Ex_07_17.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_17/Ex_07_17.pde deleted file mode 100644 index c25f2919c..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_17/Ex_07_17.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Example 07-17 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(120, 120); -} - -void draw() { - translate(mouseX, mouseY); - rect(0, 0, 30, 30); - translate(35, 10); - rect(0, 0, 15, 15); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_18/Ex_07_18.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_18/Ex_07_18.pde deleted file mode 100644 index 62530d982..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_18/Ex_07_18.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Example 07-18 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(120, 120); -} - -void draw() { - pushMatrix(); - translate(mouseX, mouseY); - rect(0, 0, 30, 30); - popMatrix(); - translate(35, 10); - rect(0, 0, 15, 15); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_19/Ex_07_19.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_19/Ex_07_19.pde deleted file mode 100644 index 3b8f61554..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_19/Ex_07_19.pde +++ /dev/null @@ -1,17 +0,0 @@ -// Example 07-19 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; - -void setup() { - size(120, 120); - smooth(); -} - -void draw() { - translate(mouseX, mouseY); - rotate(angle); - rect(-15, -15, 30, 30); - angle += 0.1; -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_20/Ex_07_20.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_20/Ex_07_20.pde deleted file mode 100644 index 599b07389..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_20/Ex_07_20.pde +++ /dev/null @@ -1,17 +0,0 @@ -// Example 07-20 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; - -void setup() { - size(120, 120); - smooth(); -} - -void draw() { - rotate(angle); - translate(mouseX, mouseY); - rect(-15, -15, 30, 30); - angle += 0.1; -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_21/Ex_07_21.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_21/Ex_07_21.pde deleted file mode 100644 index 323ed422d..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_21/Ex_07_21.pde +++ /dev/null @@ -1,17 +0,0 @@ -// Example 07-21 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; - -void setup() { - size(120, 120); - smooth(); -} - -void draw() { - translate(mouseX, mouseY); - scale(sin(angle) + 2); - rect(-15, -15, 30, 30); - angle += 0.1; -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_22/Ex_07_22.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_22/Ex_07_22.pde deleted file mode 100644 index 4eaf3f2b3..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_22/Ex_07_22.pde +++ /dev/null @@ -1,19 +0,0 @@ -// Example 07-22 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; - -void setup() { - size(120, 120); - smooth(); -} - -void draw() { - translate(mouseX, mouseY); - float scalar = sin(angle) + 2; - scale(scalar); - strokeWeight(1.0 / scalar); - rect(-15, -15, 30, 30); - angle += 0.1; -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_23/Ex_07_23.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_23/Ex_07_23.pde deleted file mode 100644 index 0c42b9fbc..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_23/Ex_07_23.pde +++ /dev/null @@ -1,33 +0,0 @@ -// Example 07-23 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; -float angleDirection = 1; -float speed = 0.005; - -void setup() { - size(120, 120); - smooth(); -} - -void draw() { - background(204); - translate(20, 25); // Move to start position - rotate(angle); - strokeWeight(12); - line(0, 0, 40, 0); - translate(40, 0); // Move to next joint - rotate(angle * 2.0); - strokeWeight(6); - line(0, 0, 30, 0); - translate(30, 0); // Move the next joint - rotate(angle * 2.5); - strokeWeight(3); - line(0, 0, 20, 0); - - angle += speed * angleDirection; - if ((angle > QUARTER_PI) || (angle < 0)) { - angleDirection *= -1; - } -} - diff --git a/java/examples/Books/Getting Started/Chapter08/Ex_08_01/Ex_08_01.pde b/java/examples/Books/Getting Started/Chapter08/Ex_08_01/Ex_08_01.pde deleted file mode 100644 index 4ca134af5..000000000 --- a/java/examples/Books/Getting Started/Chapter08/Ex_08_01/Ex_08_01.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Example 08-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - println("Ready to roll!"); - rollDice(20); - rollDice(20); - rollDice(6); - println("Finished."); -} - -void rollDice(int numSides) { - int d = 1 + int(random(numSides)); - println("Rolling... " + d); -} - diff --git a/java/examples/Books/Getting Started/Chapter08/Ex_08_02/Ex_08_02.pde b/java/examples/Books/Getting Started/Chapter08/Ex_08_02/Ex_08_02.pde deleted file mode 100644 index a4516b752..000000000 --- a/java/examples/Books/Getting Started/Chapter08/Ex_08_02/Ex_08_02.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Example 08-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - println("Ready to roll!"); - int d1 = 1 + int(random(20)); - println("Rolling... " + d1); - int d2 = 1 + int(random(20)); - println("Rolling... " + d2); - int d3 = 1 + int(random(6)); - println("Rolling... " + d3); - println("Finished."); -} - diff --git a/java/examples/Books/Getting Started/Chapter08/Ex_08_03/Ex_08_03.pde b/java/examples/Books/Getting Started/Chapter08/Ex_08_03/Ex_08_03.pde deleted file mode 100644 index 9f17ec89f..000000000 --- a/java/examples/Books/Getting Started/Chapter08/Ex_08_03/Ex_08_03.pde +++ /dev/null @@ -1,25 +0,0 @@ -// Example 08-03 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - smooth(); -} - -void draw() { - background(204); - translate(110, 110); - stroke(0); - strokeWeight(70); - line(0, -35, 0, -65); // Body - noStroke(); - fill(255); - ellipse(-17.5, -65, 35, 35); // Left eye dome - ellipse(17.5, -65, 35, 35); // Right eye dome - arc(0, -65, 70, 70, 0, PI); // Chin - fill(0); - ellipse(-14, -65, 8, 8); // Left eye - ellipse(14, -65, 8, 8); // Right eye - quad(0, -58, 4, -51, 0, -44, -4, -51); // Beak -} - diff --git a/java/examples/Books/Getting Started/Chapter08/Ex_08_04/Ex_08_04.pde b/java/examples/Books/Getting Started/Chapter08/Ex_08_04/Ex_08_04.pde deleted file mode 100644 index 2a9eba4a0..000000000 --- a/java/examples/Books/Getting Started/Chapter08/Ex_08_04/Ex_08_04.pde +++ /dev/null @@ -1,42 +0,0 @@ -// Example 08-04 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - smooth(); -} - -void draw() { - background(204); - - // Left owl - translate(110, 110); - stroke(0); - strokeWeight(70); - line(0, -35, 0, -65); // Body - noStroke(); - fill(255); - ellipse(-17.5, -65, 35, 35); // Left eye dome - ellipse(17.5, -65, 35, 35); // Right eye dome - arc(0, -65, 70, 70, 0, PI); // Chin - fill(0); - ellipse(-14, -65, 8, 8); // Left eye - ellipse(14, -65, 8, 8); // Right eye - quad(0, -58, 4, -51, 0, -44, -4, -51); // Beak - - // Right owl - translate(70, 0); - stroke(0); - strokeWeight(70); - line(0, -35, 0, -65); // Body - noStroke(); - fill(255); - ellipse(-17.5, -65, 35, 35); // Left eye dome - ellipse(17.5, -65, 35, 35); // Right eye dome - arc(0, -65, 70, 70, 0, PI); // Chin - fill(0); - ellipse(-14, -65, 8, 8); // Left eye - ellipse(14, -65, 8, 8); // Right eye - quad(0, -58, 4, -51, 0, -44, -4, -51); // Beak -} - diff --git a/java/examples/Books/Getting Started/Chapter08/Ex_08_05/Ex_08_05.pde b/java/examples/Books/Getting Started/Chapter08/Ex_08_05/Ex_08_05.pde deleted file mode 100644 index b477a30d5..000000000 --- a/java/examples/Books/Getting Started/Chapter08/Ex_08_05/Ex_08_05.pde +++ /dev/null @@ -1,32 +0,0 @@ -// Example 08-05 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - smooth(); -} - -void draw() { - background(204); - owl(110, 110); - owl(180, 110); -} - -void owl(int x, int y) { - pushMatrix(); - translate(x, y); - stroke(0); - strokeWeight(70); - line(0, -35, 0, -65); // Body - noStroke(); - fill(255); - ellipse(-17.5, -65, 35, 35); // Left eye dome - ellipse(17.5, -65, 35, 35); // Right eye dome - arc(0, -65, 70, 70, 0, PI); // Chin - fill(0); - ellipse(-14, -65, 8, 8); // Left eye - ellipse(14, -65, 8, 8); // Right eye - quad(0, -58, 4, -51, 0, -44, -4, -51); // Beak - popMatrix(); -} - diff --git a/java/examples/Books/Getting Started/Chapter08/Ex_08_06/Ex_08_06.pde b/java/examples/Books/Getting Started/Chapter08/Ex_08_06/Ex_08_06.pde deleted file mode 100644 index df886744c..000000000 --- a/java/examples/Books/Getting Started/Chapter08/Ex_08_06/Ex_08_06.pde +++ /dev/null @@ -1,33 +0,0 @@ -// Example 08-06 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - smooth(); -} - -void draw() { - background(204); - for (int x = 35; x < width + 70; x += 70) { - owl(x, 110); - } -} - -void owl(int x, int y) { - pushMatrix(); - translate(x, y); - stroke(0); - strokeWeight(70); - line(0, -35, 0, -65); // Body - noStroke(); - fill(255); - ellipse(-17.5, -65, 35, 35); // Left eye dome - ellipse(17.5, -65, 35, 35); // Right eye dome - arc(0, -65, 70, 70, 0, PI); // Chin - fill(0); - ellipse(-14, -65, 8, 8); // Left eye - ellipse(14, -65, 8, 8); // Right eye - quad(0, -58, 4, -51, 0, -44, -4, -51); // Beak - popMatrix(); -} - diff --git a/java/examples/Books/Getting Started/Chapter08/Ex_08_07/Ex_08_07.pde b/java/examples/Books/Getting Started/Chapter08/Ex_08_07/Ex_08_07.pde deleted file mode 100644 index 51f496c9b..000000000 --- a/java/examples/Books/Getting Started/Chapter08/Ex_08_07/Ex_08_07.pde +++ /dev/null @@ -1,37 +0,0 @@ -// Example 08-07 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - smooth(); -} - -void draw() { - background(204); - randomSeed(0); - for (int i = 35; i < width + 40; i += 40) { - int gray = int(random(0, 102)); - float scalar = random(0.25, 1.0); - owl(i, 110, gray, scalar); - } -} - -void owl(int x, int y, int g, float s) { - pushMatrix(); - translate(x, y); - scale(s); // Set the size - stroke(g); // Set the gray value - strokeWeight(70); - line(0, -35, 0, -65); // Body - noStroke(); - fill(255-g); - ellipse(-17.5, -65, 35, 35); // Left eye dome - ellipse(17.5, -65, 35, 35); // Right eye dome - arc(0, -65, 70, 70, 0, PI); // Chin - fill(g); - ellipse(-14, -65, 8, 8); // Left eye - ellipse(14, -65, 8, 8); // Right eye - quad(0, -58, 4, -51, 0, -44, -4, -51); // Beak - popMatrix(); -} - diff --git a/java/examples/Books/Getting Started/Chapter08/Ex_08_08/Ex_08_08.pde b/java/examples/Books/Getting Started/Chapter08/Ex_08_08/Ex_08_08.pde deleted file mode 100644 index 04450188b..000000000 --- a/java/examples/Books/Getting Started/Chapter08/Ex_08_08/Ex_08_08.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Example 08-08 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - float yourWeight = 132; - float marsWeight = calculateMars(yourWeight); - println(marsWeight); -} - -float calculateMars(float w) { - float newWeight = w * 0.38; - return newWeight; -} - diff --git a/java/examples/Books/Getting Started/Chapter09/Ex_09_01/Ex_09_01.pde b/java/examples/Books/Getting Started/Chapter09/Ex_09_01/Ex_09_01.pde deleted file mode 100644 index 3ba66c8a6..000000000 --- a/java/examples/Books/Getting Started/Chapter09/Ex_09_01/Ex_09_01.pde +++ /dev/null @@ -1,40 +0,0 @@ -// Example 09-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -JitterBug bug; // Declare object - -void setup() { - size(480, 120); - smooth(); - // Create object and pass in parameters - bug = new JitterBug(width/2, height/2, 20); -} - -void draw() { - bug.move(); - bug.display(); -} - -class JitterBug { - float x; - float y; - int diameter; - float speed = 2.5; - - JitterBug(float tempX, float tempY, int tempDiameter) { - x = tempX; - y = tempY; - diameter = tempDiameter; - } - - void move() { - x += random(-speed, speed); - y += random(-speed, speed); - } - - void display() { - ellipse(x, y, diameter, diameter); - } -} - - diff --git a/java/examples/Books/Getting Started/Chapter09/Ex_09_02/Ex_09_02.pde b/java/examples/Books/Getting Started/Chapter09/Ex_09_02/Ex_09_02.pde deleted file mode 100644 index 3b229def1..000000000 --- a/java/examples/Books/Getting Started/Chapter09/Ex_09_02/Ex_09_02.pde +++ /dev/null @@ -1,45 +0,0 @@ -// Example 09-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -JitterBug jit; -JitterBug bug; - -void setup() { - size(480, 120); - smooth(); - jit = new JitterBug(width * 0.33, height/2, 50); - bug = new JitterBug(width * 0.66, height/2, 10); -} - -void draw() { - jit.move(); - jit.display(); - bug.move(); - bug.display(); -} - -class JitterBug { - - float x; - float y; - int diameter; - float speed = 2.5; - - JitterBug(float tempX, float tempY, int tempDiameter) { - x = tempX; - y = tempY; - diameter = tempDiameter; - } - - void move() { - x += random(-speed, speed); - y += random(-speed, speed); - } - - void display() { - ellipse(x, y, diameter, diameter); - } -} - - - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_01/Ex_10_01.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_01/Ex_10_01.pde deleted file mode 100644 index e2936c92e..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_01/Ex_10_01.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Example 10-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float x1 = -20; -float x2 = 20; - -void setup() { - size(240, 120); - smooth(); - noStroke(); -} - -void draw() { - background(0); - x1 += 0.5; - x2 += 0.5; - arc(x1, 30, 40, 40, 0.52, 5.76); - arc(x2, 90, 40, 40, 0.52, 5.76); -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_02/Ex_10_02.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_02/Ex_10_02.pde deleted file mode 100644 index ae04cde1c..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_02/Ex_10_02.pde +++ /dev/null @@ -1,29 +0,0 @@ -// Example 10-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float x1 = -10; -float x2 = 10; -float x3 = 35; -float x4 = 18; -float x5 = 30; - -void setup() { - size(240, 120); - smooth(); - noStroke(); -} - -void draw() { - background(0); - x1 += 0.5; - x2 += 0.5; - x3 += 0.5; - x4 += 0.5; - x5 += 0.5; - arc(x1, 20, 20, 20, 0.52, 5.76); - arc(x2, 40, 20, 20, 0.52, 5.76); - arc(x3, 60, 20, 20, 0.52, 5.76); - arc(x4, 80, 20, 20, 0.52, 5.76); - arc(x5, 100, 20, 20, 0.52, 5.76); -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_03/Ex_10_03.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_03/Ex_10_03.pde deleted file mode 100644 index 7902c2895..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_03/Ex_10_03.pde +++ /dev/null @@ -1,24 +0,0 @@ -// Example 10-03 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float[] x = new float[3000]; - -void setup() { - size(240, 120); - smooth(); - noStroke(); - fill(255, 200); - for (int i = 0; i < x.length; i++) { - x[i] = random(-1000, 200); - } -} - -void draw() { - background(0); - for (int i = 0; i < x.length; i++) { - x[i] += 0.5; - float y = i * 0.4; - arc(x[i], y, 12, 12, 0.52, 5.76); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_04/Ex_10_04.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_04/Ex_10_04.pde deleted file mode 100644 index 3b6830679..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_04/Ex_10_04.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Example 10-04 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int[] x; // Declare the array - -void setup() { - size(200, 200); - x = new int[2]; // Create the array - x[0] = 12; // Assign the first value - x[1] = 2; // Assign the second value -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_05/Ex_10_05.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_05/Ex_10_05.pde deleted file mode 100644 index 53408bc04..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_05/Ex_10_05.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Example 10-05 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int[] x = new int[2]; // Declare and create the array - -void setup() { - size(200, 200); - x[0] = 12; // Assign the first value - x[1] = 2; // Assign the second value -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_06/Ex_10_06.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_06/Ex_10_06.pde deleted file mode 100644 index a3b551a7a..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_06/Ex_10_06.pde +++ /dev/null @@ -1,9 +0,0 @@ -// Example 10-06 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int[] x = { 12, 2 }; // Declare, create, and assign - -void setup() { - size(200, 200); -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_07/Ex_10_07.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_07/Ex_10_07.pde deleted file mode 100644 index 581c46a2c..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_07/Ex_10_07.pde +++ /dev/null @@ -1,19 +0,0 @@ -// Example 10-07 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float[] x = {-20, 20}; - -void setup() { - size(240, 120); - smooth(); - noStroke(); -} - -void draw() { - background(0); - x[0] += 0.5; // Increase the first element - x[1] += 0.5; // Increase the second element - arc(x[0], 30, 40, 40, 0.52, 5.76); - arc(x[1], 90, 40, 40, 0.52, 5.76); -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_08/Ex_10_08.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_08/Ex_10_08.pde deleted file mode 100644 index a1738f00e..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_08/Ex_10_08.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Example 10-08 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float[] gray; - -void setup() { - size(240, 120); - gray = new float[width]; - for (int i = 0; i < gray.length; i++) { - gray[i] = random(0, 255); - } -} - -void draw() { - for (int i = 0; i < gray.length; i++) { - stroke(gray[i]); - line(i, 0, i, height); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_09/Ex_10_09.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_09/Ex_10_09.pde deleted file mode 100644 index 74246b2b2..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_09/Ex_10_09.pde +++ /dev/null @@ -1,28 +0,0 @@ -// Example 10-09 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int num = 60; -int[] x = new int[num]; -int[] y = new int[num]; - -void setup() { - size(240, 120); - smooth(); - noStroke(); -} - -void draw() { - background(0); - // Copy array values from back to front - for (int i = x.length-1; i > 0; i--) { - x[i] = x[i-1]; - y[i] = y[i-1]; - } - x[0] = mouseX; // Set the first element - y[0] = mouseY; // Set the first element - for (int i = 0; i < x.length; i++) { - fill(i * 4); - ellipse(x[i], y[i], 40, 40); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_10/Ex_10_10.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_10/Ex_10_10.pde deleted file mode 100644 index 6e1734e20..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_10/Ex_10_10.pde +++ /dev/null @@ -1,47 +0,0 @@ -// Example 10-10 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -JitterBug[] bugs = new JitterBug[33]; - -void setup() { - size(240, 120); - smooth(); - for (int i = 0; i < bugs.length; i++) { - float x = random(width); - float y = random(height); - int r = i + 2; - bugs[i] = new JitterBug(x, y, r); - } -} - -void draw() { - for (int i = 0; i < bugs.length; i++) { - bugs[i].move(); - bugs[i].display(); - } -} - -class JitterBug { - - float x; - float y; - int diameter; - float speed = 2.5; - - JitterBug(float tempX, float tempY, int tempDiameter) { - x = tempX; - y = tempY; - diameter = tempDiameter; - } - - void move() { - x += random(-speed, speed); - y += random(-speed, speed); - } - - void display() { - ellipse(x, y, diameter, diameter); - } - -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_11/Ex_10_11.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_11/Ex_10_11.pde deleted file mode 100644 index 8bac9402a..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_11/Ex_10_11.pde +++ /dev/null @@ -1,24 +0,0 @@ -// Example 10-11 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int numFrames = 12; // The number of frames -PImage[] images = new PImage[numFrames]; // Make the array -int currentFrame = 1; - -void setup() { - size(240, 120); - for (int i = 1; i < images.length; i++) { - String imageName = "frame-" + nf(i, 4) + ".png"; - images[i] = loadImage(imageName); // Load each image - } - frameRate(24); -} - -void draw() { - image(images[currentFrame], 0, 0); - currentFrame++; // Next frame - if (currentFrame >= images.length) { - currentFrame = 1; // Return to first frame - } -} - diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_01/Ex_11_01.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_01/Ex_11_01.pde deleted file mode 100644 index 189a80672..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_01/Ex_11_01.pde +++ /dev/null @@ -1,29 +0,0 @@ -// Example 11-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -import processing.opengl.*; - -void setup() { - size(440, 220, OPENGL); - noStroke(); - fill(255, 190); -} - -void draw() { - background(0); - translate(width/2, height/2, 0); - rotateX(mouseX / 200.0); - rotateY(mouseY / 100.0); - int dim = 18; - for (int i = -height/2; i < height/2; i += dim*1.2) { - for (int j = -height/2; j < height/2; j += dim*1.2) { - beginShape(); - vertex(i, j, 0); - vertex(i+dim, j, 0); - vertex(i+dim, j+dim, -dim); - vertex(i, j+dim, -dim); - endShape(); - } - } -} - diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_02/Ex_11_02.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_02/Ex_11_02.pde deleted file mode 100644 index a0585cb85..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_02/Ex_11_02.pde +++ /dev/null @@ -1,36 +0,0 @@ -// Example 11-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -import processing.opengl.*; - -void setup() { - size(420, 220, OPENGL); - noStroke(); - fill(255); -} - -void draw() { - lights(); - //ambientLight(102, 102, 102); - //directionalLight(255, 255, 255, // Color - // -1, 0, 0); // Direction XYZ - //pointLight(255, 255, 255, // Color - // mouseX, 110, 50); // Position - //spotLight(255, 255, 255, // Color - // mouseX, 0, 200, // Position - // 0, 0, -1, // Direction XYZ - // PI, 2); // Concentration - rotateY(PI/24); - background(0); - translate(width/2, height/2, -20); - int dim = 18; - for (int i = -height/2; i < height/2; i += dim*1.4) { - for (int j = -height/2; j < height/2; j += dim*1.4) { - pushMatrix(); - translate(i, j, -j); - box(dim, dim, dim); - popMatrix(); - } - } -} - diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_03/Ex_11_03.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_03/Ex_11_03.pde deleted file mode 100644 index 7c0c0871d..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_03/Ex_11_03.pde +++ /dev/null @@ -1,29 +0,0 @@ -// Example 11-03 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -import processing.opengl.*; - -void setup() { - size(420, 220, OPENGL); - noStroke(); -} - -void draw() { - lights(); - background(0); - float camZ = (height/2.0) / tan(PI*60.0 / 360.0); - camera(mouseX, mouseY, camZ, // Camera location - width/2.0, height/2.0, 0, // Camera target - 0, 1, 0); // Camera orientation - translate(width/2, height/2, -20); - int dim = 18; - for (int i = -height/2; i < height/2; i += dim*1.4) { - for (int j = -height/2; j < height/2; j += dim*1.4) { - pushMatrix(); - translate(i, j, -j); - box(dim, dim, dim); - popMatrix(); - } - } -} - diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_04/Ex_11_04.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_04/Ex_11_04.pde deleted file mode 100644 index fa63b0dd5..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_04/Ex_11_04.pde +++ /dev/null @@ -1,27 +0,0 @@ -// Example 11-04 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float x = 0; - -void setup() { - size(720, 480); - smooth(); - noFill(); - strokeCap(SQUARE); - frameRate(30); -} - -void draw() { - background(204); - translate(x, 0); - for (int y = 40; y < 280; y += 20) { - line(-260, y, 0, y + 200); - line(0, y + 200, 260, y); - } - if (frameCount < 60) { - saveFrame("frames/SaveExample-####.tif"); - } else { - exit(); - } - x += 2.5; -} diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_05/Ex_11_05.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_05/Ex_11_05.pde deleted file mode 100644 index 104c28c73..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_05/Ex_11_05.pde +++ /dev/null @@ -1,25 +0,0 @@ -// Example 11-05 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -import processing.pdf.*; - -void setup() { - size(600, 800, PDF, "Ex-11-5.pdf"); - noFill(); - strokeCap(SQUARE); -} - -void draw() { - background(255); - for (int y = 100; y < height - 300; y+=20) { - float r = random(0, 102); - strokeWeight(r / 10); - beginShape(); - vertex(100, y); - vertex(width/2, y + 200); - vertex(width-100, y); - endShape(); - } - exit(); -} - diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_06/Ex_11_06.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_06/Ex_11_06.pde deleted file mode 100644 index 70db3c766..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_06/Ex_11_06.pde +++ /dev/null @@ -1,17 +0,0 @@ -// Example 11-06 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -// Note: This is code for an Arduino board, not Processing - -int sensorPin = 0; // Select input pin -int val = 0; - -void setup() { - Serial.begin(9600); // Open serial port -} - -void loop() { - val = analogRead(sensorPin) / 4; // Read value from sensor - Serial.print(val, BYTE); // Print variable to serial port - delay(100); // Wait 100 milliseconds -} diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_07/Ex_11_07.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_07/Ex_11_07.pde deleted file mode 100644 index 8965855a7..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_07/Ex_11_07.pde +++ /dev/null @@ -1,30 +0,0 @@ -// Example 11-07 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -import processing.serial.*; - -Serial port; // Create object from Serial class -float val; // Data received from the serial port - -void setup() { - size(440, 220); - // IMPORTANT NOTE: - // The first serial port retrieved by Serial.list() - // should be your Arduino. If not, uncomment the next - // line by deleting the // before it. Run the sketch - // again to see a list of serial ports. Then, change - // the 0 in between [ and ] to the number of the port - // that your Arduino is connected to. - //println(Serial.list()); - String arduinoPort = Serial.list()[0]; - port = new Serial(this, arduinoPort, 9600); -} - -void draw() { - if (port.available() > 0) { // If data is available, - val = port.read(); // read it and store it in val - val = map(val, 0, 255, 0, height); // Convert the value - } - rect(40, val-10, 360, 20); -} - diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_08/Ex_11_08.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_08/Ex_11_08.pde deleted file mode 100644 index 444e8c692..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_08/Ex_11_08.pde +++ /dev/null @@ -1,44 +0,0 @@ -// Example 11-08 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -import processing.serial.*; - -Serial port; // Create object from Serial class -float val; // Data received from the serial port -int x; -float easing = 0.05; -float easedVal; - -void setup() { - size(440, 440); - frameRate(30); - smooth(); - String arduinoPort = Serial.list()[0]; - port = new Serial(this, arduinoPort, 9600); - background(0); -} - -void draw() { - if ( port.available() > 0) { // If data is available, - val = port.read(); // read it and store it in val - val = map(val, 0, 255, 0, height); // Convert the values - } - - float targetVal = val; - easedVal += (targetVal - easedVal) * easing; - - stroke(0); - line(x, 0, x, height); // Black line - stroke(255); - line(x+1, 0, x+1, height); // White line - line(x, 220, x, val); // Raw value - line(x, 440, x, easedVal + 220); // Averaged value - - x++; - if (x > width) { - x = 0; - } -} - - - diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_09/Ex_11_09.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_09/Ex_11_09.pde deleted file mode 100644 index ed28e4622..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_09/Ex_11_09.pde +++ /dev/null @@ -1,41 +0,0 @@ -// Example 11-09 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -import processing.serial.*; - -Serial port; // Create object from Serial class -float val; // Data received from the serial port -float angle; -float radius; - -void setup() { - size(440, 440); - frameRate(30); - strokeWeight(2); - smooth(); - String arduinoPort = Serial.list()[0]; - port = new Serial(this, arduinoPort, 9600); - background(0); -} - -void draw() { - if ( port.available() > 0) { // If data is available, - val = port.read(); // read it and store it in val - // Convert the values to set the radius - radius = map(val, 0, 255, 0, height * 0.45); - } - - int middleX = width/2; - int middleY = height/2; - float x = middleX + cos(angle) * height/2; - float y = middleY + sin(angle) * height/2; - stroke(0); - line(middleX, middleY, x, y); - - x = middleX + cos(angle) * radius; - y = middleY + sin(angle) * radius; - stroke(255); - line(middleX, middleY, x, y); - - angle += 0.01; -} diff --git a/java/examples/Books/Getting Started/Robots/Robot1_Draw/Robot1_Draw.pde b/java/examples/Books/Getting Started/Robots/Robot1_Draw/Robot1_Draw.pde deleted file mode 100644 index 60b197205..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot1_Draw/Robot1_Draw.pde +++ /dev/null @@ -1,41 +0,0 @@ -// Robot 1: Draw from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(720, 480); -smooth(); -strokeWeight(2); -background(204); -ellipseMode(RADIUS); - -// Neck -stroke(102); // Set stroke to gray -line(266, 257, 266, 162); // Left -line(276, 257, 276, 162); // Middle -line(286, 257, 286, 162); // Right - -// Antennae -line(276, 155, 246, 112); // Small -line(276, 155, 306, 56); // Tall -line(276, 155, 342, 170); // Medium - -// Body -noStroke(); // Disable stroke -fill(102); // Set fill to gray -ellipse(264, 377, 33, 33); // Antigravity orb -fill(0); // Set fill to black -rect(219, 257, 90, 120); // Main body -fill(102); // Set fill to gray -rect(219, 274, 90, 6); // Gray stripe - -// Head -fill(0); // Set fill to black -ellipse(276, 155, 45, 45); // Head -fill(255); // Set fill to white -ellipse(288, 150, 14, 14); // Large eye -fill(0); // Set fill to black -ellipse(288, 150, 3, 3); // Pupil -fill(153); // Set fill to light gray -ellipse(263, 148, 5, 5); // Small eye 1 -ellipse(296, 130, 4, 4); // Small eye 2 -ellipse(305, 162, 3, 3); // Small eye 3 - diff --git a/java/examples/Books/Getting Started/Robots/Robot2_Variables/Robot2_Variables.pde b/java/examples/Books/Getting Started/Robots/Robot2_Variables/Robot2_Variables.pde deleted file mode 100644 index a20816e2c..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot2_Variables/Robot2_Variables.pde +++ /dev/null @@ -1,54 +0,0 @@ -// Robot 2: Variables from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int x = 60; // X-coordinate -int y = 420; // Y-coordinate -int bodyHeight = 110; // Body Height -int neckHeight = 140; // Neck Height -int radius = 45; -int ny = y - bodyHeight - neckHeight - radius; // Neck Y - -size(170, 480); -smooth(); -strokeWeight(2); -background(204); -ellipseMode(RADIUS); - -// Neck -stroke(102); -line(x+2, y-bodyHeight, x+2, ny); -line(x+12, y-bodyHeight, x+12, ny); -line(x+22, y-bodyHeight, x+22, ny); - -// Antennae -line(x+12, ny, x-18, ny-43); -line(x+12, ny, x+42, ny-99); -line(x+12, ny, x+78, ny+15); - -// Body -noStroke(); -fill(102); -ellipse(x, y-33, 33, 33); -fill(0); -rect(x-45, y-bodyHeight, 90, bodyHeight-33); -fill(102); -rect(x-45, y-bodyHeight+17, 90, 6); - -// Head -fill(0); -ellipse(x+12, ny, radius, radius); -fill(255); -ellipse(x+24, ny-6, 14, 14); -fill(0); -ellipse(x+24, ny-6, 3, 3); -fill(153); -ellipse(x, ny-8, 5, 5); -ellipse(x+30, ny-26, 4, 4); -ellipse(x+41, ny+6, 3, 3); - - - - - - - diff --git a/java/examples/Books/Getting Started/Robots/Robot3_Response/Robot3_Response.pde b/java/examples/Books/Getting Started/Robots/Robot3_Response/Robot3_Response.pde deleted file mode 100644 index dea4634d9..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot3_Response/Robot3_Response.pde +++ /dev/null @@ -1,59 +0,0 @@ -// Robot 3: Response from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float x = 60; // X-coordinate -float y = 440; // Y-coordinate -int radius = 45; // Head Radius -int bodyHeight = 160; // Body Height -int neckHeight = 70; // Neck Height - -float easing = 0.02; - -void setup() { - size(360, 480); - smooth(); - strokeWeight(2); - ellipseMode(RADIUS); -} - -void draw() { - - int targetX = mouseX; - x += (targetX - x) * easing; - - if (mousePressed) { - neckHeight = 16; - bodyHeight = 90; - } else { - neckHeight = 70; - bodyHeight = 160; - } - - float ny = y - bodyHeight - neckHeight - radius; - - background(204); - - // Neck - stroke(102); - line(x+12, y-bodyHeight, x+12, ny); - - // Antennae - line(x+12, ny, x-18, ny-43); - line(x+12, ny, x+42, ny-99); - line(x+12, ny, x+78, ny+15); - - // Body - noStroke(); - fill(102); - ellipse(x, y-33, 33, 33); - fill(0); - rect(x-45, y-bodyHeight, 90, bodyHeight-33); - - // Head - fill(0); - ellipse(x+12, ny, radius, radius); - fill(255); - ellipse(x+24, ny-6, 14, 14); - fill(0); - ellipse(x+24, ny-6, 3, 3); -} diff --git a/java/examples/Books/Getting Started/Robots/Robot4_Media/Robot4_Media.pde b/java/examples/Books/Getting Started/Robots/Robot4_Media/Robot4_Media.pde deleted file mode 100644 index 1945fa3d4..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot4_Media/Robot4_Media.pde +++ /dev/null @@ -1,43 +0,0 @@ -// Robot 4: Media from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - - -PShape bot1; -PShape bot2; -PShape bot3; -PImage landscape; - -float easing = 0.05; -float offset = 0; - -void setup() { - size(720, 480); - bot1 = loadShape("robot1.svg"); - bot2 = loadShape("robot2.svg"); - bot3 = loadShape("robot3.svg"); - landscape = loadImage("alpine.png"); - smooth(); -} - -void draw() { - // Set the background to the "landscape" image, this image - // must be the same width and height as the program - background(landscape); - - // Set the left/right offset and apply easing to make - // the transition smooth - float targetOffset = map(mouseY, 0, height, -40, 40); - offset += (targetOffset - offset) * easing; - - // Draw the left robot - shape(bot1, 85 + offset, 65); - - // Draw the right robot smaller and give it a smaller offset - float smallerOffset = offset * 0.7; - shape(bot2, 510 + smallerOffset, 140, 78, 248); - - // Draw the smallest robot, give it a smaller offset - smallerOffset *= -0.5; - shape(bot3, 410 + smallerOffset, 225, 39, 124); -} - diff --git a/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot1.svg b/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot1.svg deleted file mode 100644 index e44805f1c..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot1.svg +++ /dev/null @@ -1,1033 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot2.svg b/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot2.svg deleted file mode 100644 index bda32e6a1..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot2.svg +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot3.svg b/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot3.svg deleted file mode 100644 index 436456609..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot3.svg +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/Robots/Robot5_Motion/Robot5_Motion.pde b/java/examples/Books/Getting Started/Robots/Robot5_Motion/Robot5_Motion.pde deleted file mode 100644 index 70c0a2eff..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot5_Motion/Robot5_Motion.pde +++ /dev/null @@ -1,57 +0,0 @@ -// Robot 5: Motion from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float x = 180; // X-coordinate -float y = 400; // Y-coordinate -float bodyHeight = 153; // Body Height -float neckHeight = 56; // Neck Height -float radius = 45; // Head Radius -float angle = 0.0; // Angle for motion - -void setup() { - size(360, 480); - smooth(); - ellipseMode(RADIUS); -} - -void draw() { - // Change position by a small random amount - x += random(-4, 4); - y += random(-1, 1); - - // Change height of neck - neckHeight = 80 + sin(angle) * 30; - angle += 0.05; - - // Adjust the height of the head - float ny = y - bodyHeight - neckHeight - radius; - - // Neck - stroke(102); - line(x+2, y-bodyHeight, x+2, ny); - line(x+12, y-bodyHeight, x+12, ny); - line(x+22, y-bodyHeight, x+22, ny); - - // Antennae - line(x+12, ny, x-18, ny-43); - line(x+12, ny, x+42, ny-99); - line(x+12, ny, x+78, ny+15); - - // Body - noStroke(); - fill(102); - ellipse(x, y-33, 33, 33); - fill(0); - rect(x-45, y-bodyHeight, 90, bodyHeight-33); - fill(102); - rect(x-45, y-bodyHeight+17, 90, 6); - - // Head - fill(0); - ellipse(x+12, ny, radius, radius); - fill(255); - ellipse(x+24, ny-6, 14, 14); - fill(0); - ellipse(x+24, ny-6, 3, 3); -} - diff --git a/java/examples/Books/Getting Started/Robots/Robot6_Functions/Robot6_Functions.pde b/java/examples/Books/Getting Started/Robots/Robot6_Functions/Robot6_Functions.pde deleted file mode 100644 index 9d1878b54..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot6_Functions/Robot6_Functions.pde +++ /dev/null @@ -1,63 +0,0 @@ -// Robot 6: Functions from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - - -void setup() { - size(720, 480); - smooth(); - strokeWeight(2); - ellipseMode(RADIUS); -} - -void draw() { - background(204); - drawRobot(120, 420, 110, 140); - drawRobot(270, 460, 260, 95); - drawRobot(420, 310, 80, 10); - drawRobot(570, 390, 180, 40); -} - -void drawRobot(int x, int y, int bodyHeight, int neckHeight) { - - int radius = 45; - int ny = y - bodyHeight - neckHeight - radius; // neckHeight Y - - // Neck - stroke(102); - line(x+2, y-bodyHeight, x+2, ny); - line(x+12, y-bodyHeight, x+12, ny); - line(x+22, y-bodyHeight, x+22, ny); - - // Antennae - line(x+12, ny, x-18, ny-43); - line(x+12, ny, x+42, ny-99); - line(x+12, ny, x+78, ny+15); - - // Body - noStroke(); - fill(102); - ellipse(x, y-33, 33, 33); - fill(0); - rect(x-45, y-bodyHeight, 90, bodyHeight-33); - fill(102); - rect(x-45, y-bodyHeight+17, 90, 6); - - // Head - fill(0); - ellipse(x+12, ny, radius, radius); - fill(255); - ellipse(x+24, ny-6, 14, 14); - fill(0); - ellipse(x+24, ny-6, 3, 3); - fill(153); - ellipse(x, ny-8, 5, 5); - ellipse(x+30, ny-26, 4, 4); - ellipse(x+41, ny+6, 3, 3); -} - - - - - - - diff --git a/java/examples/Books/Getting Started/Robots/Robot7_Objects/Robot7_Objects.pde b/java/examples/Books/Getting Started/Robots/Robot7_Objects/Robot7_Objects.pde deleted file mode 100644 index 5f0da699f..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot7_Objects/Robot7_Objects.pde +++ /dev/null @@ -1,53 +0,0 @@ -// Robot 7: Objects from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -Robot bot1; -Robot bot2; - -void setup() { - size(720, 480); - bot1 = new Robot("robot1.svg", 90, 80); - bot2 = new Robot("robot2.svg", 440, 30); - smooth(); -} - -void draw() { - background(204); - - // Update and display first robot - bot1.update(); - bot1.display(); - - // Update and display second robot - bot2.update(); - bot2.display(); -} - -class Robot { - float xpos; - float ypos; - float angle; - PShape botShape; - float yoffset = 0.0; - - // Set initial values in constructor - Robot(String svgName, float tempX, float tempY) { - botShape = loadShape(svgName); - xpos = tempX; - ypos = tempY; - angle = random(0, TWO_PI); - } - - // Update the fields - void update() { - angle += 0.05; - yoffset = sin(angle) * 20; - } - - // Draw the robot to the screen - void display() { - shape(botShape, xpos, ypos + yoffset); - } - -} - diff --git a/java/examples/Books/Getting Started/Robots/Robot7_Objects/data/robot1.svg b/java/examples/Books/Getting Started/Robots/Robot7_Objects/data/robot1.svg deleted file mode 100644 index e44805f1c..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot7_Objects/data/robot1.svg +++ /dev/null @@ -1,1033 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/Robots/Robot7_Objects/data/robot2.svg b/java/examples/Books/Getting Started/Robots/Robot7_Objects/data/robot2.svg deleted file mode 100644 index bda32e6a1..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot7_Objects/data/robot2.svg +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/Robots/Robot8_Arrays/Robot8_Arrays.pde b/java/examples/Books/Getting Started/Robots/Robot8_Arrays/Robot8_Arrays.pde deleted file mode 100644 index 396a5d6c5..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot8_Arrays/Robot8_Arrays.pde +++ /dev/null @@ -1,58 +0,0 @@ -// Robot 8: Arrays from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -Robot[] bots; // Declare array of Robot objects - -void setup() { - size(720, 480); - PShape robotShape = loadShape("robot1.svg"); - // Create the array of Robot objects - bots = new Robot[20]; - // Create each object - for (int i = 0; i < bots.length; i++) { - // Create a random x-coordinate - float x = random(-40, width-40); - // Assign the y-coordinate based on the order - float y = map(i, 0, bots.length, -100, height-200); - bots[i] = new Robot(robotShape, x, y); - } - smooth(); -} - -void draw() { - background(204); - // Update and display each bot in the array - for (int i = 0; i < bots.length; i++) { - bots[i].update(); - bots[i].display(); - } -} - -class Robot { - float xpos; - float ypos; - float angle; - PShape botShape; - float yoffset = 0.0; - - // Set initial values in constructor - Robot(PShape shape, float tempX, float tempY) { - botShape = shape; - xpos = tempX; - ypos = tempY; - angle = random(0, TWO_PI); - } - - // Update the fields - void update() { - angle += 0.05; - yoffset = sin(angle) * 20; - } - - // Draw the robot to the screen - void display() { - shape(botShape, xpos, ypos + yoffset); - } - -} - diff --git a/java/examples/Books/Getting Started/Robots/Robot8_Arrays/data/robot1.svg b/java/examples/Books/Getting Started/Robots/Robot8_Arrays/data/robot1.svg deleted file mode 100644 index e44805f1c..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot8_Arrays/data/robot1.svg +++ /dev/null @@ -1,1033 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/media/AndaleMono-24.vlw b/java/examples/Books/Getting Started/media/AndaleMono-24.vlw deleted file mode 100644 index a71ac78ac..000000000 Binary files a/java/examples/Books/Getting Started/media/AndaleMono-24.vlw and /dev/null differ diff --git a/java/examples/Books/Getting Started/media/AndaleMono-36.vlw b/java/examples/Books/Getting Started/media/AndaleMono-36.vlw deleted file mode 100644 index 34e243f0b..000000000 Binary files a/java/examples/Books/Getting Started/media/AndaleMono-36.vlw and /dev/null differ diff --git a/java/examples/Books/Getting Started/media/clouds.gif b/java/examples/Books/Getting Started/media/clouds.gif deleted file mode 100644 index ad52b85a1..000000000 Binary files a/java/examples/Books/Getting Started/media/clouds.gif and /dev/null differ diff --git a/java/examples/Books/Getting Started/media/network.svg b/java/examples/Books/Getting Started/media/network.svg deleted file mode 100644 index 5ecd8d159..000000000 --- a/java/examples/Books/Getting Started/media/network.svg +++ /dev/null @@ -1,4056 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/media/robot1.svg b/java/examples/Books/Getting Started/media/robot1.svg deleted file mode 100644 index e44805f1c..000000000 --- a/java/examples/Books/Getting Started/media/robot1.svg +++ /dev/null @@ -1,1033 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/media/robot2.svg b/java/examples/Books/Getting Started/media/robot2.svg deleted file mode 100644 index e44805f1c..000000000 --- a/java/examples/Books/Getting Started/media/robot2.svg +++ /dev/null @@ -1,1033 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Connection.pde b/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Connection.pde deleted file mode 100644 index 0dcfe7a67..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Connection.pde +++ /dev/null @@ -1,65 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An animated drawing of a Neural Network - -class Connection { - // Connection is from Neuron A to B - Neuron a; - Neuron b; - - // Connection has a weight - float weight; - - // Variables to track the animation - boolean sending = false; - PVector sender; - - // Need to store the output for when its time to pass along - float output = 0; - - Connection(Neuron from, Neuron to, float w) { - weight = w; - a = from; - b = to; - } - - - // The Connection is active - void feedforward(float val) { - output = val*weight; // Compute output - sender = a.location.get(); // Start animation at Neuron A - sending = true; // Turn on sending - } - - // Update traveling sender - void update() { - if (sending) { - // Use a simple interpolation - sender.x = lerp(sender.x, b.location.x, 0.1); - sender.y = lerp(sender.y, b.location.y, 0.1); - float d = PVector.dist(sender, b.location); - // If we've reached the end - if (d < 1) { - // Pass along the output! - b.feedforward(output); - sending = false; - } - } - } - - // Draw line and traveling circle - void display() { - stroke(0); - strokeWeight(1+weight*4); - line(a.location.x, a.location.y, b.location.x, b.location.y); - - if (sending) { - fill(0); - strokeWeight(1); - ellipse(sender.x, sender.y, 16, 16); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Exercise_10_5_LayeredNetworkAnimation.pde b/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Exercise_10_5_LayeredNetworkAnimation.pde deleted file mode 100644 index 87958e675..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Exercise_10_5_LayeredNetworkAnimation.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An animated drawing of a Neural Network - -Network network; - -void setup() { - size(640,360); - // Create the Network object - network = new Network(width/2, height/2); - - int layers = 3; - int inputs = 2; - - Neuron output = new Neuron(250, 0); - for (int i = 0; i < layers; i++) { - for (int j = 0; j < inputs; j++) { - float x = map(i, 0, layers, -250, 300); - float y = map(j, 0, inputs-1, -75, 75); - Neuron n = new Neuron(x, y); - if (i > 0) { - for (int k = 0; k < inputs; k++) { - Neuron prev = network.neurons.get(network.neurons.size()-inputs+k-j); - network.connect(prev, n, random(1)); - } - } - if (i == layers-1) { - network.connect(n, output, random(1)); - } - network.addNeuron(n); - } - } - network.addNeuron(output); -} - -void draw() { - background(255); - // Update and display the Network - network.update(); - network.display(); - - // Every 30 frames feed in an input - if (frameCount % 30 == 0) { - network.feedforward(random(1),random(1)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Network.pde b/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Network.pde deleted file mode 100644 index 68a9f597f..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Network.pde +++ /dev/null @@ -1,68 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An animated drawing of a Neural Network - -class Network { - - // The Network has a list of neurons - ArrayList neurons; - - // The Network now keeps a duplicate list of all Connection objects. - // This makes it easier to draw everything in this class - ArrayList connections; - PVector location; - - Network(float x, float y) { - location = new PVector(x, y); - neurons = new ArrayList(); - connections = new ArrayList(); - } - - // We can add a Neuron - void addNeuron(Neuron n) { - neurons.add(n); - } - - // We can connection two Neurons - void connect(Neuron a, Neuron b, float weight) { - Connection c = new Connection(a, b, weight); - a.addConnection(c); - // Also add the Connection here - connections.add(c); - } - - // Sending an input to the first Neuron - // We should do something better to track multiple inputs - void feedforward(float input1, float input2) { - Neuron n1 = neurons.get(0); - n1.feedforward(input1); - - Neuron n2 = neurons.get(1); - n2.feedforward(input2); - - } - - // Update the animation - void update() { - for (Connection c : connections) { - c.update(); - } - } - - // Draw everything - void display() { - pushMatrix(); - translate(location.x, location.y); - for (Neuron n : neurons) { - n.display(); - } - - for (Connection c : connections) { - c.display(); - } - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Neuron.pde b/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Neuron.pde deleted file mode 100644 index 819fe6750..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Neuron.pde +++ /dev/null @@ -1,64 +0,0 @@ -// Daniel Shiffman -// The Nature of Code -// http://natureofcode.com - -// An animated drawing of a Neural Network - -class Neuron { - // Neuron has a location - PVector location; - - // Neuron has a list of connections - ArrayList connections; - - // We now track the inputs and sum them - float sum = 0; - - // The Neuron's size can be animated - float r = 32; - - Neuron(float x, float y) { - location = new PVector(x, y); - connections = new ArrayList(); - } - - // Add a Connection - void addConnection(Connection c) { - connections.add(c); - } - - // Receive an input - void feedforward(float input) { - // Accumulate it - sum += input; - // Activate it? - if (sum > 1) { - fire(); - sum = 0; // Reset the sum to 0 if it fires - } - } - - // The Neuron fires - void fire() { - r = 64; // It suddenly is bigger - - // We send the output through all connections - for (Connection c : connections) { - c.feedforward(sum); - } - } - - // Draw it as a circle - void display() { - stroke(0); - strokeWeight(1); - // Brightness is mapped to sum - float b = map(sum,0,1,255,0); - fill(b); - ellipse(location.x, location.y, r, r); - - // Size shrinks down back to original dimensions - r = lerp(r,32,0.1); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Connection.pde b/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Connection.pde deleted file mode 100644 index 4d3c6d365..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Connection.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Connection { - float weight; - Neuron a; - Neuron b; - - Connection(Neuron from, Neuron to,float w) { - weight = w; - a = from; - b = to; - } - - void display() { - stroke(0); - strokeWeight(weight*4); - line(a.location.x, a.location.y, b.location.x, b.location.y); - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/LayeredNetworkViz.pde b/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/LayeredNetworkViz.pde deleted file mode 100644 index e9a8f2de2..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/LayeredNetworkViz.pde +++ /dev/null @@ -1,16 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Network network; - -void setup() { - size(640, 360); - network = new Network(4,3,1); -} - -void draw() { - background(255); - network.display(); -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Network.pde b/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Network.pde deleted file mode 100644 index ec87c6e37..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Network.pde +++ /dev/null @@ -1,47 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Network { - ArrayList neurons; - PVector location; - Network(int layers, int inputs, int outputs) { - location = new PVector(width/2, height/2); - - neurons = new ArrayList(); - - Neuron output = new Neuron(250, 0); - for (int i = 0; i < layers; i++) { - for (int j = 0; j < inputs; j++) { - float x = map(i, 0, layers, -200, 200); - float y = map(j, 0, inputs-1, -100, 100); - println(j + " " + y); - Neuron n = new Neuron(x, y); - - if (i > 0) { - for (int k = 0; k < inputs; k++) { - Neuron prev = neurons.get(neurons.size()-inputs+k-j); - prev.connect(n); - } - } - - if (i == layers-1) { - n.connect(output); - } - neurons.add(n); - } - } - neurons.add(output); - } - - - void display() { - pushMatrix(); - translate(location.x, location.y); - for (Neuron n : neurons) { - n.display(); - } - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Neuron.pde b/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Neuron.pde deleted file mode 100644 index e500dcb2b..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Neuron.pde +++ /dev/null @@ -1,31 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Neuron { - PVector location; - - ArrayList connections; - - Neuron(float x, float y) { - location = new PVector(x, y); - connections = new ArrayList(); - } - - void connect(Neuron n) { - Connection c = new Connection(this, n, random(1)); - connections.add(c); - } - - void display() { - stroke(0); - strokeWeight(1); - fill(0); - ellipse(location.x, location.y, 16, 16); - - for (Connection c : connections) { - c.display(); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/NOC_10_01_SimplePerceptron.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/NOC_10_01_SimplePerceptron.pde deleted file mode 100644 index 93148cea1..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/NOC_10_01_SimplePerceptron.pde +++ /dev/null @@ -1,90 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Perceptron Example -// See: http://en.wikipedia.org/wiki/Perceptron - -// Code based on text "Artificial Intelligence", George Luger - -// A list of points we will use to "train" the perceptron -Trainer[] training = new Trainer[2000]; -// A Perceptron object -Perceptron ptron; - -// We will train the perceptron with one "Point" object at a time -int count = 0; - -// Coordinate space -float xmin = -400; -float ymin = -100; -float xmax = 400; -float ymax = 100; - -// The function to describe a line -float f(float x) { - return 0.4*x+1; -} - -void setup() { - size(640, 360); - - // The perceptron has 3 inputs -- x, y, and bias - // Second value is "Learning Constant" - ptron = new Perceptron(3, 0.00001); // Learning Constant is low just b/c it's fun to watch, this is not necessarily optimal - - // Create a random set of training points and calculate the "known" answer - for (int i = 0; i < training.length; i++) { - float x = random(xmin, xmax); - float y = random(ymin, ymax); - int answer = 1; - if (y < f(x)) answer = -1; - training[i] = new Trainer(x, y, answer); - } - smooth(); -} - - -void draw() { - background(255); - translate(width/2,height/2); - - // Draw the line - strokeWeight(4); - stroke(127); - float x1 = xmin; - float y1 = f(x1); - float x2 = xmax; - float y2 = f(x2); - line(x1,y1,x2,y2); - - // Draw the line based on the current weights - // Formula is weights[0]*x + weights[1]*y + weights[2] = 0 - stroke(0); - strokeWeight(1); - float[] weights = ptron.getWeights(); - x1 = xmin; - y1 = (-weights[2] - weights[0]*x1)/weights[1]; - x2 = xmax; - y2 = (-weights[2] - weights[0]*x2)/weights[1]; - line(x1,y1,x2,y2); - - - - // Train the Perceptron with one "training" point at a time - ptron.train(training[count].inputs, training[count].answer); - count = (count + 1) % training.length; - - // Draw all the points based on what the Perceptron would "guess" - // Does not use the "known" correct answer - for (int i = 0; i < count; i++) { - stroke(0); - strokeWeight(1); - fill(0); - int guess = ptron.feedforward(training[i].inputs); - if (guess > 0) noFill(); - - ellipse(training[i].inputs[0], training[i].inputs[1], 8, 8); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/Perceptron.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/Perceptron.pde deleted file mode 100644 index 0eec0da5b..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/Perceptron.pde +++ /dev/null @@ -1,60 +0,0 @@ -// Daniel Shiffman -// The Nature of Code -// http://natureofcode.com - -// Simple Perceptron Example -// See: http://en.wikipedia.org/wiki/Perceptron - -// Perceptron Class - -class Perceptron { - float[] weights; // Array of weights for inputs - float c; // learning constant - - // Perceptron is created with n weights and learning constant - Perceptron(int n, float c_) { - weights = new float[n]; - // Start with random weights - for (int i = 0; i < weights.length; i++) { - weights[i] = random(-1,1); - } - c = c_; - } - - // Function to train the Perceptron - // Weights are adjusted based on "desired" answer - void train(float[] inputs, int desired) { - // Guess the result - int guess = feedforward(inputs); - // Compute the factor for changing the weight based on the error - // Error = desired output - guessed output - // Note this can only be 0, -2, or 2 - // Multiply by learning constant - float error = desired - guess; - // Adjust weights based on weightChange * input - for (int i = 0; i < weights.length; i++) { - weights[i] += c * error * inputs[i]; - } - } - - // Guess -1 or 1 based on input values - int feedforward(float[] inputs) { - // Sum all values - float sum = 0; - for (int i = 0; i < weights.length; i++) { - sum += inputs[i]*weights[i]; - } - // Result is sign of the sum, -1 or 1 - return activate(sum); - } - - int activate(float sum) { - if (sum > 0) return 1; - else return -1; - } - - // Return weights - float[] getWeights() { - return weights; - } -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/Trainer.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/Trainer.pde deleted file mode 100644 index 69db5371c..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/Trainer.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Perceptron Example -// See: http://en.wikipedia.org/wiki/Perceptron - -// A class to describe a training point -// Has an x and y, a "bias" (1) and known output -// Could also add a variable for "guess" but not required here - -class Trainer { - - float[] inputs; - int answer; - - Trainer(float x, float y, int a) { - inputs = new float[3]; - inputs[0] = x; - inputs[1] = y; - inputs[2] = 1; - answer = a; - } -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/NOC_10_02_SeekingNeural.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/NOC_10_02_SeekingNeural.pde deleted file mode 100644 index de91587f1..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/NOC_10_02_SeekingNeural.pde +++ /dev/null @@ -1,63 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A Vehicle controlled by a Perceptron - -Vehicle v; - -PVector desired; - -ArrayList targets; - -void setup() { - size(640, 360); - // The Vehicle's desired location - desired = new PVector(width/2,height/2); - - - // Create a list of targets - makeTargets(); - - // Create the Vehicle (it has to know about the number of targets - // in order to configure its brain) - v = new Vehicle(targets.size(), random(width), random(height)); -} - -// Make a random ArrayList of targets to steer towards -void makeTargets() { - targets = new ArrayList(); - for (int i = 0; i < 8; i++) { - targets.add(new PVector(random(width), random(height))); - } -} - -void draw() { - background(255); - - // Draw a circle to show the Vehicle's goal - stroke(0); - strokeWeight(2); - fill(0, 100); - ellipse(desired.x, desired.y, 36, 36); - - // Draw the targets - for (PVector target : targets) { - noFill(); - stroke(0); - strokeWeight(2); - ellipse(target.x, target.y, 16, 16); - line(target.x,target.y-16,target.x,target.y+16); - line(target.x-16,target.y,target.x+16,target.y); - } - - // Update the Vehicle - v.steer(targets); - v.update(); - v.display(); -} - -void mousePressed() { - makeTargets(); -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/Perceptron.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/Perceptron.pde deleted file mode 100644 index f52c726b3..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/Perceptron.pde +++ /dev/null @@ -1,45 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Perceptron Example -// See: http://en.wikipedia.org/wiki/Perceptron - -// Perceptron Class - -class Perceptron { - float[] weights; // Array of weights for inputs - float c; // learning constant - - // Perceptron is created with n weights and learning constant - Perceptron(int n, float c_) { - weights = new float[n]; - c = c_; - // Start with random weights - for (int i = 0; i < weights.length; i++) { - weights[i] = random(0, 1); - } - } - - // Function to train the Perceptron - // Weights are adjusted based on vehicle's error - void train(PVector[] forces, PVector error) { - for (int i = 0; i < weights.length; i++) { - weights[i] += c*error.x*forces[i].x; - weights[i] += c*error.y*forces[i].y; - weights[i] = constrain(weights[i], 0, 1); - } - } - - // Give me a steering result - PVector feedforward(PVector[] forces) { - // Sum all values - PVector sum = new PVector(); - for (int i = 0; i < weights.length; i++) { - forces[i].mult(weights[i]); - sum.add(forces[i]); - } - return sum; - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/Vehicle.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/Vehicle.pde deleted file mode 100644 index efd9bf287..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/Vehicle.pde +++ /dev/null @@ -1,102 +0,0 @@ -// Seek -// Daniel Shiffman - -// The "Vehicle" class - -class Vehicle { - - // Vehicle now has a brain! - Perceptron brain; - - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(int n, float x, float y) { - brain = new Perceptron(n,0.001); - acceleration = new PVector(0,0); - velocity = new PVector(0,0); - location = new PVector(x,y); - r = 3.0; - maxspeed = 4; - maxforce = 0.1; - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelerationelertion to 0 each cycle - acceleration.mult(0); - - location.x = constrain(location.x,0,width); - location.y = constrain(location.y,0,height); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // Here is where the brain processes everything - void steer(ArrayList targets) { - // Make an array of forces - PVector[] forces = new PVector[targets.size()]; - - // Steer towards all targets - for (int i = 0; i < forces.length; i++) { - forces[i] = seek(targets.get(i)); - } - - // That array of forces is the input to the brain - PVector result = brain.feedforward(forces); - - // Use the result to steer the vehicle - applyForce(result); - - // Train the brain according to the error - PVector error = PVector.sub(desired, location); - brain.train(forces,error); - - } - - // A method that calculates a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - PVector seek(PVector target) { - PVector desired = PVector.sub(target,location); // A vector pointing from the location to the target - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus velocity - PVector steer = PVector.sub(desired,velocity); - steer.limit(maxforce); // Limit to maximum steering force - - return steer; - } - - void display() { - - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + PI/2; - fill(175); - stroke(0); - strokeWeight(1); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(CLOSE); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Connection.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Connection.pde deleted file mode 100644 index 5e183e58f..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Connection.pde +++ /dev/null @@ -1,31 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A static drawing of a Neural Network - -class Connection { - - // Connection is from Neuron A to B - Neuron a; - Neuron b; - - // Connection has a weight - float weight; - - Connection(Neuron from, Neuron to,float w) { - weight = w; - a = from; - b = to; - } - - // Drawn as a line - void display() { - stroke(0); - strokeWeight(weight*4); - line(a.location.x, a.location.y, b.location.x, b.location.y); - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/NOC_10_03_NetworkViz.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/NOC_10_03_NetworkViz.pde deleted file mode 100644 index c368b9966..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/NOC_10_03_NetworkViz.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A static drawing of a Neural Network - -Network network; - -void setup() { - size(640, 360); - // Create the Network object - network = new Network(width/2,height/2); - - // Create a bunch of Neurons - Neuron a = new Neuron(-200,0); - Neuron b = new Neuron(0,75); - Neuron c = new Neuron(0,-75); - Neuron d = new Neuron(200,0); - - // Connect them - network.connect(a,b); - network.connect(a,c); - network.connect(b,d); - network.connect(c,d); - - // Add them to the Network - network.addNeuron(a); - network.addNeuron(b); - network.addNeuron(c); - network.addNeuron(d); -} - -void draw() { - background(255); - // Draw the Network - network.display(); - noLoop(); -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Network.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Network.pde deleted file mode 100644 index 44b94a80f..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Network.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A static drawing of a Neural Network - -class Network { - - // The Network has a list of neurons - ArrayList neurons; - PVector location; - - Network(float x, float y) { - location = new PVector(x,y); - neurons = new ArrayList(); - } - - // We can add a Neuron - void addNeuron(Neuron n) { - neurons.add(n); - } - - // We can connection two Neurons - void connect(Neuron a, Neuron b) { - Connection c = new Connection(a, b, random(1)); - a.addConnection(c); - } - - // We can draw the network - void display() { - pushMatrix(); - translate(location.x, location.y); - for (Neuron n : neurons) { - n.display(); - } - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Neuron.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Neuron.pde deleted file mode 100644 index d14ed2a5e..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Neuron.pde +++ /dev/null @@ -1,38 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A static drawing of a Neural Network - -class Neuron { - - // Neuron has a location - PVector location; - - // Neuron has a list of connections - ArrayList connections; - - Neuron(float x, float y) { - location = new PVector(x, y); - connections = new ArrayList(); - } - - // Add a Connection - void addConnection(Connection c) { - connections.add(c); - } - - // Draw Neuron as a circle - void display() { - stroke(0); - strokeWeight(1); - fill(0); - ellipse(location.x, location.y, 16, 16); - - // Draw all its connections - for (Connection c : connections) { - c.display(); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Connection.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Connection.pde deleted file mode 100644 index 0dcfe7a67..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Connection.pde +++ /dev/null @@ -1,65 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An animated drawing of a Neural Network - -class Connection { - // Connection is from Neuron A to B - Neuron a; - Neuron b; - - // Connection has a weight - float weight; - - // Variables to track the animation - boolean sending = false; - PVector sender; - - // Need to store the output for when its time to pass along - float output = 0; - - Connection(Neuron from, Neuron to, float w) { - weight = w; - a = from; - b = to; - } - - - // The Connection is active - void feedforward(float val) { - output = val*weight; // Compute output - sender = a.location.get(); // Start animation at Neuron A - sending = true; // Turn on sending - } - - // Update traveling sender - void update() { - if (sending) { - // Use a simple interpolation - sender.x = lerp(sender.x, b.location.x, 0.1); - sender.y = lerp(sender.y, b.location.y, 0.1); - float d = PVector.dist(sender, b.location); - // If we've reached the end - if (d < 1) { - // Pass along the output! - b.feedforward(output); - sending = false; - } - } - } - - // Draw line and traveling circle - void display() { - stroke(0); - strokeWeight(1+weight*4); - line(a.location.x, a.location.y, b.location.x, b.location.y); - - if (sending) { - fill(0); - strokeWeight(1); - ellipse(sender.x, sender.y, 16, 16); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/NOC_10_04_NetworkAnimation.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/NOC_10_04_NetworkAnimation.pde deleted file mode 100644 index 4c2d2ed6c..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/NOC_10_04_NetworkAnimation.pde +++ /dev/null @@ -1,50 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An animated drawing of a Neural Network - -Network network; - -void setup() { - size(640, 360); - // Create the Network object - network = new Network(width/2, height/2); - - // Create a bunch of Neurons - Neuron a = new Neuron(-275, 0); - Neuron b = new Neuron(-150, 0); - Neuron c = new Neuron(0, 75); - Neuron d = new Neuron(0, -75); - Neuron e = new Neuron(150, 0); - Neuron f = new Neuron(275, 0); - - // Connect them - network.connect(a, b,1); - network.connect(b, c,random(1)); - network.connect(b, d,random(1)); - network.connect(c, e,random(1)); - network.connect(d, e,random(1)); - network.connect(e, f,1); - - // Add them to the Network - network.addNeuron(a); - network.addNeuron(b); - network.addNeuron(c); - network.addNeuron(d); - network.addNeuron(e); - network.addNeuron(f); -} - -void draw() { - background(255); - // Update and display the Network - network.update(); - network.display(); - - // Every 30 frames feed in an input - if (frameCount % 30 == 0) { - network.feedforward(random(1)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Network.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Network.pde deleted file mode 100644 index 5506414c9..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Network.pde +++ /dev/null @@ -1,64 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An animated drawing of a Neural Network - -class Network { - - // The Network has a list of neurons - ArrayList neurons; - - // The Network now keeps a duplicate list of all Connection objects. - // This makes it easier to draw everything in this class - ArrayList connections; - PVector location; - - Network(float x, float y) { - location = new PVector(x, y); - neurons = new ArrayList(); - connections = new ArrayList(); - } - - // We can add a Neuron - void addNeuron(Neuron n) { - neurons.add(n); - } - - // We can connection two Neurons - void connect(Neuron a, Neuron b, float weight) { - Connection c = new Connection(a, b, weight); - a.addConnection(c); - // Also add the Connection here - connections.add(c); - } - - // Sending an input to the first Neuron - // We should do something better to track multiple inputs - void feedforward(float input) { - Neuron start = neurons.get(0); - start.feedforward(input); - } - - // Update the animation - void update() { - for (Connection c : connections) { - c.update(); - } - } - - // Draw everything - void display() { - pushMatrix(); - translate(location.x, location.y); - for (Neuron n : neurons) { - n.display(); - } - - for (Connection c : connections) { - c.display(); - } - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Neuron.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Neuron.pde deleted file mode 100644 index 89bc6c822..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Neuron.pde +++ /dev/null @@ -1,64 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An animated drawing of a Neural Network - -class Neuron { - // Neuron has a location - PVector location; - - // Neuron has a list of connections - ArrayList connections; - - // We now track the inputs and sum them - float sum = 0; - - // The Neuron's size can be animated - float r = 32; - - Neuron(float x, float y) { - location = new PVector(x, y); - connections = new ArrayList(); - } - - // Add a Connection - void addConnection(Connection c) { - connections.add(c); - } - - // Receive an input - void feedforward(float input) { - // Accumulate it - sum += input; - // Activate it? - if (sum > 1) { - fire(); - sum = 0; // Reset the sum to 0 if it fires - } - } - - // The Neuron fires - void fire() { - r = 64; // It suddenly is bigger - - // We send the output through all connections - for (Connection c : connections) { - c.feedforward(sum); - } - } - - // Draw it as a circle - void display() { - stroke(0); - strokeWeight(1); - // Brightness is mapped to sum - float b = map(sum,0,1,255,0); - fill(b); - ellipse(location.x, location.y, r, r); - - // Size shrinks down back to original dimensions - r = lerp(r,32,0.1); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/xor/Landscape.pde b/java/examples/Books/Nature of Code/chp10_nn/xor/Landscape.pde deleted file mode 100755 index 07bc45c54..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/xor/Landscape.pde +++ /dev/null @@ -1,75 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// "Landscape" example - -class Landscape { - - int scl; // size of each cell - int w,h; // width and height of thingie - int rows, cols; // number of rows and columns - float zoff = 0.0; // perlin noise argument - float[][] z; // using an array to store all the height values - - Landscape(int scl_, int w_, int h_) { - scl = scl_; - w = w_; - h = h_; - cols = w/scl; - rows = h/scl; - z = new float[cols][rows]; - } - - - // Calculate height values (based off a neural netork) - void calculate(Network nn) { - float x = 0; - float dx = (float) 1.0 / cols; - for (int i = 0; i < cols; i++) - { - float y = 0; - float dy = (float) 1.0 / rows; - for (int j = 0; j < rows; j++) - { - float[] input = new float[2]; - input[0] = x; - input[1] = y; - float result = nn.feedForward(input); - z[i][j] = z[i][j]*0.95 + 0.05*(float)(result*280.0f-140.0); - y += dy; - } - x += dx; - } - - } - - // Render landscape as grid of quads - void render() { - // Every cell is an individual quad - // (could use quad_strip here, but produces funny results, investigate this) - for (int x = 0; x < z.length-1; x++) - { - for (int y = 0; y < z[x].length-1; y++) - { - // one quad at a time - // each quad's color is determined by the height value at each vertex - // (clean this part up) - noStroke(); - pushMatrix(); - beginShape(QUADS); - translate(x*scl-w/2,y*scl-h/2,0); - fill(z[x][y]+127,220); - vertex(0,0,z[x][y]); - fill(z[x+1][y]+127,220); - vertex(scl,0,z[x+1][y]); - fill(z[x+1][y+1]+127,220); - vertex(scl,scl,z[x+1][y+1]); - fill(z[x][y+1]+127,220); - vertex(0,scl,z[x][y+1]); - endShape(); - popMatrix(); - } - } - } -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Connection.java b/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Connection.java deleted file mode 100644 index d8415d2a6..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Connection.java +++ /dev/null @@ -1,47 +0,0 @@ -// Daniel Shiffman -// The Nature of Code, Fall 2006 -// Neural Network - -// Class to describe a connection between two neurons - -package nn; - -public class Connection { - - private Neuron from; // Connection goes from. . . - private Neuron to; // To. . . - private float weight; // Weight of the connection. . . - - // Constructor builds a connection with a random weight - public Connection(Neuron a_, Neuron b_) { - from = a_; - to = b_; - weight = (float) Math.random()*2-1; - } - - // In case I want to set the weights manually, using this for testing - public Connection(Neuron a_, Neuron b_, float w) { - from = a_; - to = b_; - weight = w; - } - - public Neuron getFrom() { - return from; - } - - public Neuron getTo() { - return to; - } - - public float getWeight() { - return weight; - } - - // Changing the weight of the connection - public void adjustWeight(float deltaWeight) { - weight += deltaWeight; - } - - -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/HiddenNeuron.java b/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/HiddenNeuron.java deleted file mode 100644 index 3c8d7945d..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/HiddenNeuron.java +++ /dev/null @@ -1,20 +0,0 @@ -//Daniel Shiffman -//The Nature of Code, Fall 2006 -//Neural Network - -// Hidden Neuron Class -// So far not necessary to differentiate these - -package nn; - -public class HiddenNeuron extends Neuron { - - public HiddenNeuron() { - super(); - } - - public HiddenNeuron(int i) { - super(i); - } - -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/InputNeuron.java b/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/InputNeuron.java deleted file mode 100644 index a2191632f..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/InputNeuron.java +++ /dev/null @@ -1,23 +0,0 @@ -//Daniel Shiffman -//The Nature of Code, Fall 2006 -//Neural Network - -// Input Neuron Class -// Has additional functionality to receive beginning input - -package nn; - -public class InputNeuron extends Neuron { - public InputNeuron() { - super(); - } - - public InputNeuron(int i) { - super(i); - } - - public void input(float d) { - output = d; - } - -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Network.java b/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Network.java deleted file mode 100644 index c0854712d..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Network.java +++ /dev/null @@ -1,143 +0,0 @@ -// Daniel Shiffman -// The Nature of Code, Fall 2006 -// Neural Network - -// Class to describe the entire network -// Arrays for input neurons, hidden neurons, and output neuron - -// Need to update this so that it would work with an array out outputs -// Rather silly that I didn't do this initially - -// Also need to build in a "Layer" class so that there can easily -// be more than one hidden layer - -package nn; - -import java.util.ArrayList; - -public class Network { - - // Layers - InputNeuron[] input; - HiddenNeuron[] hidden; - OutputNeuron output; - - public static final float LEARNING_CONSTANT = 0.5f; - - // Only One output now to start!!! (i can do better, really. . .) - // Constructor makes the entire network based on number of inputs & number of neurons in hidden layer - // Only One hidden layer!!! (fix this dood) - - public Network(int inputs, int hiddentotal) { - - input = new InputNeuron[inputs+1]; // Got to add a bias input - hidden = new HiddenNeuron[hiddentotal+1]; - - // Make input neurons - for (int i = 0; i < input.length-1; i++) { - input[i] = new InputNeuron(); - } - - // Make hidden neurons - for (int i = 0; i < hidden.length-1; i++) { - hidden[i] = new HiddenNeuron(); - } - - // Make bias neurons - input[input.length-1] = new InputNeuron(1); - hidden[hidden.length-1] = new HiddenNeuron(1); - - // Make output neuron - output = new OutputNeuron(); - - // Connect input layer to hidden layer - for (int i = 0; i < input.length; i++) { - for (int j = 0; j < hidden.length-1; j++) { - // Create the connection object and put it in both neurons - Connection c = new Connection(input[i],hidden[j]); - input[i].addConnection(c); - hidden[j].addConnection(c); - } - } - - // Connect the hidden layer to the output neuron - for (int i = 0; i < hidden.length; i++) { - Connection c = new Connection(hidden[i],output); - hidden[i].addConnection(c); - output.addConnection(c); - } - - } - - - public float feedForward(float[] inputVals) { - - // Feed the input with an array of inputs - for (int i = 0; i < inputVals.length; i++) { - input[i].input(inputVals[i]); - } - - // Have the hidden layer calculate its output - for (int i = 0; i < hidden.length-1; i++) { - hidden[i].calcOutput(); - } - - // Calculate the output of the output neuron - output.calcOutput(); - - // Return output - return output.getOutput(); - } - - public float train(float[] inputs, float answer) { - float result = feedForward(inputs); - - - // This is where the error correction all starts - // Derivative of sigmoid output function * diff between known and guess - float deltaOutput = result*(1-result) * (answer-result); - - - // BACKPROPOGATION - // This is easier b/c we just have one output - // Apply Delta to connections between hidden and output - ArrayList connections = output.getConnections(); - for (int i = 0; i < connections.size(); i++) { - Connection c = (Connection) connections.get(i); - Neuron neuron = c.getFrom(); - float output = neuron.getOutput(); - float deltaWeight = output*deltaOutput; - c.adjustWeight(LEARNING_CONSTANT*deltaWeight); - } - - // ADJUST HIDDEN WEIGHTS - for (int i = 0; i < hidden.length; i++) { - connections = hidden[i].getConnections(); - float sum = 0; - // Sum output delta * hidden layer connections (just one output) - for (int j = 0; j < connections.size(); j++) { - Connection c = (Connection) connections.get(j); - // Is this a connection from hidden layer to next layer (output)? - if (c.getFrom() == hidden[i]) { - sum += c.getWeight()*deltaOutput; - } - } - // Then adjust the weights coming in based: - // Above sum * derivative of sigmoid output function for hidden neurons - for (int j = 0; j < connections.size(); j++) { - Connection c = (Connection) connections.get(j); - // Is this a connection from previous layer (input) to hidden layer? - if (c.getTo() == hidden[i]) { - float output = hidden[i].getOutput(); - float deltaHidden = output * (1 - output); // Derivative of sigmoid(x) - deltaHidden *= sum; // Would sum for all outputs if more than one output - Neuron neuron = c.getFrom(); - float deltaWeight = neuron.getOutput()*deltaHidden; - c.adjustWeight(LEARNING_CONSTANT*deltaWeight); - } - } - } - - return result; - } -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Neuron.java b/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Neuron.java deleted file mode 100644 index 234780016..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Neuron.java +++ /dev/null @@ -1,81 +0,0 @@ -//Daniel Shiffman -//The Nature of Code, Fall 2006 -//Neural Network - -//Generic Neuron Class -//Can be a bias neuron (true or false) - -package nn; - -import java.util.ArrayList; - -public class Neuron { - - protected float output; - protected ArrayList connections; - protected boolean bias = false; - - // A regular Neuron - public Neuron() { - output = 0; - // Using an arraylist to store list of connections to other neurons - connections = new ArrayList(); - bias = false; - } - - // Constructor for a bias neuron - public Neuron(int i) { - output = i; - connections = new ArrayList(); - bias = true; - } - - // Function to calculate output of this neuron - // Output is sum of all inputs*weight of connections - public void calcOutput() { - if (bias) { - // do nothing - } else { - float sum = 0; - float bias = 0; - //System.out.println("Looking through " + connections.size() + " connections"); - for (int i = 0; i < connections.size(); i++) { - Connection c = (Connection) connections.get(i); - Neuron from = c.getFrom(); - Neuron to = c.getTo(); - // Is this connection moving forward to us - // Ignore connections that we send our output to - if (to == this) { - // This isn't really necessary - // But I am treating the bias individually in case I need to at some point - if (from.bias) { - bias = from.getOutput()*c.getWeight(); - } else { - sum += from.getOutput()*c.getWeight(); - } - } - } - // Output is result of sigmoid function - output = f(bias+sum); - } - } - - void addConnection(Connection c) { - connections.add(c); - } - - float getOutput() { - return output; - } - - // Sigmoid function - public static float f(float x) { - return 1.0f / (1.0f + (float) Math.exp(-x)); - } - - public ArrayList getConnections() { - return connections; - } - - -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/OutputNeuron.java b/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/OutputNeuron.java deleted file mode 100644 index abe8daee4..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/OutputNeuron.java +++ /dev/null @@ -1,7 +0,0 @@ -package nn; - -public class OutputNeuron extends Neuron { - public OutputNeuron() { - super(); - } -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/xor/xor.pde b/java/examples/Books/Nature of Code/chp10_nn/xor/xor.pde deleted file mode 100644 index dd73eef29..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/xor/xor.pde +++ /dev/null @@ -1,112 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// XOR Multi-Layered Neural Network Example -// Neural network code is all in the "code" folder - -import nn.*; - -ArrayList inputs; // List of training input values -Network nn; // Neural Network Object -int count; // Total training interations -Landscape land; // Solution space -float theta = 0.0; // Angle of rotation -PFont f; // Font - - -void setup() { - - size(400,400,P3D); - - // Create a landscape object - land = new Landscape(20,300,300); - - f = createFont("Courier",12,true); - - nn = new Network(2,4); - - // Create a list of 4 training inputs - inputs = new ArrayList(); - float[] input = new float[2]; - input[0] = 1; - input[1] = 0; - inputs.add((float []) input.clone()); - input[0] = 0; - input[1] = 1; - inputs.add((float []) input.clone()); - input[0] = 1; - input[1] = 1; - inputs.add((float []) input.clone()); - input[0] = 0; - input[1] = 0; - inputs.add((float []) input.clone()); -} - -void draw() { - - int trainingIterationsPerFrame = 5; - - for (int i = 0; i < trainingIterationsPerFrame; i++) { - // Pick a random training input - int pick = int(random(inputs.size())); - // Grab that input - float[] inp = (float[]) inputs.get(pick); - // Compute XOR - float known = 1; - if ((inp[0] == 1.0 && inp[1] == 1.0) || (inp[0] == 0 && inp[1] == 0)) known = 0; - // Train that sucker! - float result = nn.train(inp,known); - count++; - } - - // Ok, visualize the solution space - background(175); - pushMatrix(); - translate(width/2,height/2+20,-160); - rotateX(PI/3); - rotateZ(theta); - - // Put a little BOX on screen - pushMatrix(); - stroke(50); - noFill(); - translate(-10,-10,0); - box(280); - - // Draw the landscape - popMatrix(); - land.calculate(nn); - land.render(); - theta += 0.0025; - popMatrix(); - - // Display overal neural net stats - networkStatus(); - -} - - -void networkStatus() { - float mse = 0.0; - - textFont(f); - fill(0); - text("Your friendly neighborhood neural network solving XOR.",10,20); - text("Total iterations: " + count,10,40); - - for (int i = 0; i < inputs.size(); i++) { - float[] inp = (float[]) inputs.get(i); - float known = 1; - if ((inp[0] == 1.0 && inp[1] == 1.0) || (inp[0] == 0 && inp[1] == 0)) known = 0; - float result = nn.feedForward(inp); - //System.out.println("For: " + inp[0] + " " + inp[1] + ": " + result); - mse += (result - known)*(result - known); - } - - float rmse = sqrt(mse/4.0); - text("Root mean squared error: " + nf(rmse,1,5), 10,60); - -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_10_motion101_acceleration/Mover.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_10_motion101_acceleration/Mover.pde deleted file mode 100644 index 44b00fefe..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_10_motion101_acceleration/Mover.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - // The Mover tracks location, velocity, and acceleration - PVector location; - PVector velocity; - PVector acceleration; - // The Mover's maximum speed - float topspeed; - - Mover() { - // Start in the center - location = new PVector(width/2,height/2); - velocity = new PVector(0,0); - topspeed = 5; - } - - void update() { - - // Compute a vector that points from location to mouse - PVector mouse = new PVector(mouseX,mouseY); - PVector acceleration = PVector.sub(mouse,location); - // Set magnitude of acceleration - //acceleration.setMag(0.2); - acceleration.normalize(); - acceleration.mult(0.2); - - // Velocity changes according to acceleration - velocity.add(acceleration); - // Limit the velocity by topspeed - velocity.limit(topspeed); - // Location changes by velocity - location.add(velocity); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127); - ellipse(location.x,location.y,48,48); - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_10_motion101_acceleration/NOC_1_10_motion101_acceleration.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_10_motion101_acceleration/NOC_1_10_motion101_acceleration.pde deleted file mode 100644 index baf4b6522..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_10_motion101_acceleration/NOC_1_10_motion101_acceleration.pde +++ /dev/null @@ -1,21 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A Mover object -Mover mover; - -void setup() { - size(800,200); - mover = new Mover(); -} - -void draw() { - background(255); - - // Update the location - mover.update(); - // Display the Mover - mover.display(); -} - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_11_motion101_acceleration_array/Mover.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_11_motion101_acceleration_array/Mover.pde deleted file mode 100644 index b0713e6ed..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_11_motion101_acceleration_array/Mover.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - // The Mover tracks location, velocity, and acceleration - PVector location; - PVector velocity; - PVector acceleration; - // The Mover's maximum speed - float topspeed; - - Mover() { - // Start in the center - location = new PVector(random(width),random(height)); - velocity = new PVector(0,0); - topspeed = 5; - } - - void update() { - - // Compute a vector that points from location to mouse - PVector mouse = new PVector(mouseX,mouseY); - PVector acceleration = PVector.sub(mouse,location); - // Set magnitude of acceleration - //acceleration.setMag(0.2); - acceleration.normalize(); - acceleration.mult(0.2); - - // Velocity changes according to acceleration - velocity.add(acceleration); - // Limit the velocity by topspeed - velocity.limit(topspeed); - // Location changes by velocity - location.add(velocity); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127,200); - ellipse(location.x,location.y,48,48); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_11_motion101_acceleration_array/NOC_1_11_motion101_acceleration_array.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_11_motion101_acceleration_array/NOC_1_11_motion101_acceleration_array.pde deleted file mode 100644 index 40e9b48d6..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_11_motion101_acceleration_array/NOC_1_11_motion101_acceleration_array.pde +++ /dev/null @@ -1,28 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Demonstration of the basics of motion with vector. -// A "Mover" object stores location, velocity, and acceleration as vectors -// The motion is controlled by affecting the acceleration (in this case towards the mouse) - -Mover[] movers = new Mover[20]; - -void setup() { - size(800,200); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(); - } -} - -void draw() { - - background(255); - - for (int i = 0; i < movers.length; i++) { - movers[i].update(); - movers[i].display(); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_1_bouncingball_novectors/NOC_1_1_bouncingball_novectors.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_1_bouncingball_novectors/NOC_1_1_bouncingball_novectors.pde deleted file mode 100644 index 09b4224a8..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_1_bouncingball_novectors/NOC_1_1_bouncingball_novectors.pde +++ /dev/null @@ -1,38 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Example 1-1: Bouncing Ball, no vectors -float x = 100; -float y = 100; -float xspeed = 2.5; -float yspeed = 2; - -void setup() { - size(800, 200); - smooth(); -} - -void draw() { - background(255); - - - // Add the current speed to the location. - x = x + xspeed; - y = y + yspeed; - - if ((x > width) || (x < 0)) { - xspeed = xspeed * -1; - } - if ((y > height) || (y < 0)) { - yspeed = yspeed * -1; - } - - - // Display circle at x location - stroke(0); - strokeWeight(2); - fill(127); - ellipse(x, y, 48, 48); -} - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_2_bouncingball_vectors/NOC_1_2_bouncingball_vectors.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_2_bouncingball_vectors/NOC_1_2_bouncingball_vectors.pde deleted file mode 100644 index 232de4c48..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_2_bouncingball_vectors/NOC_1_2_bouncingball_vectors.pde +++ /dev/null @@ -1,37 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Example 1-2: Bouncing Ball, with PVector! -PVector location; -PVector velocity; - -void setup() { - size(200,200); - background(255); - location = new PVector(100,100); - velocity = new PVector(2.5,5); -} - -void draw() { - noStroke(); - fill(255,10); - rect(0,0,width,height); - - // Add the current speed to the location. - location.add(velocity); - - if ((location.x > width) || (location.x < 0)) { - velocity.x = velocity.x * -1; - } - if ((location.y > height) || (location.y < 0)) { - velocity.y = velocity.y * -1; - } - - // Display circle at x location - stroke(0); - fill(175); - ellipse(location.x,location.y,16,16); -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_3_vector_subtraction/NOC_1_3_vector_subtraction.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_3_vector_subtraction/NOC_1_3_vector_subtraction.pde deleted file mode 100644 index a9659a409..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_3_vector_subtraction/NOC_1_3_vector_subtraction.pde +++ /dev/null @@ -1,26 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Example 1-3: Vector subtraction - -void setup() { - size(800,200); - smooth(); -} - -void draw() { - background(255); - - PVector mouse = new PVector(mouseX,mouseY); - PVector center = new PVector(width/2,height/2); - mouse.sub(center); - - translate(width/2,height/2); - strokeWeight(2); - stroke(0); - line(0,0,mouse.x,mouse.y); - -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_4_vector_multiplication/NOC_1_4_vector_multiplication.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_4_vector_multiplication/NOC_1_4_vector_multiplication.pde deleted file mode 100644 index 3f7f76b3f..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_4_vector_multiplication/NOC_1_4_vector_multiplication.pde +++ /dev/null @@ -1,28 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Example 1-4: Vector multiplication - -void setup() { - size(800,200); - smooth(); -} - -void draw() { - background(255); - - PVector mouse = new PVector(mouseX,mouseY); - PVector center = new PVector(width/2,height/2); - mouse.sub(center); - - // Multiplying a vector! The vector is now half its original size (multiplied by 0.5). - mouse.mult(0.5); - - translate(width/2,height/2); - strokeWeight(2); - stroke(0); - line(0,0,mouse.x,mouse.y); -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_5_vector_magnitude/NOC_1_5_vector_magnitude.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_5_vector_magnitude/NOC_1_5_vector_magnitude.pde deleted file mode 100644 index 53d0b99a1..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_5_vector_magnitude/NOC_1_5_vector_magnitude.pde +++ /dev/null @@ -1,31 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Example 1-5: Vector magnitude - -void setup() { - size(800,200); - smooth(); -} - -void draw() { - background(255); - - PVector mouse = new PVector(mouseX,mouseY); - PVector center = new PVector(width/2,height/2); - mouse.sub(center); - - float m = mouse.mag(); - fill(0); - noStroke(); - rect(0,0,m,10); - - translate(width/2,height/2); - stroke(0); - strokeWeight(2); - line(0,0,mouse.x,mouse.y); - -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_6_vector_normalize/NOC_1_6_vector_normalize.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_6_vector_normalize/NOC_1_6_vector_normalize.pde deleted file mode 100644 index 659d8a512..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_6_vector_normalize/NOC_1_6_vector_normalize.pde +++ /dev/null @@ -1,37 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Demonstration of normalizing a vector. -// Normalizing a vector sets its length to 1. - -void setup() { - size(800,200); - smooth(); -} - -void draw() { - background(255); - - // A vector that points to the mouse location - PVector mouse = new PVector(mouseX,mouseY); - // A vector that points to the center of the window - PVector center = new PVector(width/2,height/2); - // Subtract center from mouse which results in a vector that points from center to mouse - mouse.sub(center); - - // Normalize the vector - mouse.normalize(); - - // Multiply its length by 50 - mouse.mult(150); - - translate(width/2,height/2); - // Draw the resulting vector - stroke(0); - strokeWeight(2); - line(0,0,mouse.x,mouse.y); - -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_7_motion101/Mover.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_7_motion101/Mover.pde deleted file mode 100644 index 8d7abe902..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_7_motion101/Mover.pde +++ /dev/null @@ -1,43 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - - Mover() { - location = new PVector(random(width), random(height)); - velocity = new PVector(random(-2, 2), random(-2, 2)); - } - - void update() { - location.add(velocity); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127); - ellipse(location.x, location.y, 48, 48); - } - - void checkEdges() { - - if (location.x > width) { - location.x = 0; - } - else if (location.x < 0) { - location.x = width; - } - - if (location.y > height) { - location.y = 0; - } - else if (location.y < 0) { - location.y = height; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_7_motion101/NOC_1_7_motion101.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_7_motion101/NOC_1_7_motion101.pde deleted file mode 100644 index 9f968a254..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_7_motion101/NOC_1_7_motion101.pde +++ /dev/null @@ -1,19 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover mover; - -void setup() { - size(800,200); - mover = new Mover(); -} - -void draw() { - background(255); - - mover.update(); - mover.checkEdges(); - mover.display(); -} - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_8_motion101_acceleration/Mover.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_8_motion101_acceleration/Mover.pde deleted file mode 100644 index fdf9f5093..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_8_motion101_acceleration/Mover.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float topspeed; - - Mover() { - location = new PVector(width/2, height/2); - velocity = new PVector(0, 0); - acceleration = new PVector(-0.001, 0.01); - topspeed = 10; - } - - void update() { - velocity.add(acceleration); - velocity.limit(topspeed); - location.add(velocity); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127); - ellipse(location.x, location.y, 48, 48); - } - - void checkEdges() { - - if (location.x > width) { - location.x = 0; - } - else if (location.x < 0) { - location.x = width; - } - - if (location.y > height) { - location.y = 0; - } - else if (location.y < 0) { - location.y = height; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_8_motion101_acceleration/NOC_1_8_motion101_acceleration.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_8_motion101_acceleration/NOC_1_8_motion101_acceleration.pde deleted file mode 100644 index 3d1668104..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_8_motion101_acceleration/NOC_1_8_motion101_acceleration.pde +++ /dev/null @@ -1,20 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover mover; - -void setup() { - size(800,200); - mover = new Mover(); -} - -void draw() { - background(255); - - mover.update(); - mover.checkEdges(); - mover.display(); -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_9_motion101_acceleration/Mover.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_9_motion101_acceleration/Mover.pde deleted file mode 100644 index d5644bff2..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_9_motion101_acceleration/Mover.pde +++ /dev/null @@ -1,52 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float topspeed; - - Mover() { - location = new PVector(width/2, height/2); - velocity = new PVector(0, 0); - topspeed = 6; - } - - void update() { - - acceleration = PVector.random2D(); - acceleration.mult(random(2)); - - velocity.add(acceleration); - velocity.limit(topspeed); - location.add(velocity); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127); - ellipse(location.x, location.y, 48, 48); - } - - void checkEdges() { - - if (location.x > width) { - location.x = 0; - } - else if (location.x < 0) { - location.x = width; - } - - if (location.y > height) { - location.y = 0; - } - else if (location.y < 0) { - location.y = height; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_9_motion101_acceleration/NOC_1_9_motion101_acceleration.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_9_motion101_acceleration/NOC_1_9_motion101_acceleration.pde deleted file mode 100644 index 30e22723f..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_9_motion101_acceleration/NOC_1_9_motion101_acceleration.pde +++ /dev/null @@ -1,18 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover mover; - -void setup() { - size(800,200); - mover = new Mover(); -} - -void draw() { - background(255); - mover.update(); - mover.checkEdges(); - mover.display(); -} - diff --git a/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Attractor.pde b/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Attractor.pde deleted file mode 100644 index bff0c1f5c..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Attractor.pde +++ /dev/null @@ -1,75 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A class for a draggable attractive body in our world - -class Attractor { - float mass; // Mass, tied to size - PVector location; // Location - boolean dragging = false; // Is the object being dragged? - boolean rollover = false; // Is the mouse over the ellipse? - PVector drag; // holds the offset for when object is clicked on - - Attractor() { - location = new PVector(width/2,height/2); - mass = 10; - drag = new PVector(0.0,0.0); - } - - PVector attract(Mover m) { - PVector force = PVector.sub(location,m.location); // Calculate direction of force - float d = force.mag(); // Distance between objects - d = constrain(d,5.0,25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction) - float strength = (g * mass * m.mass) / (d * d); // Calculate gravitional force magnitude - force.mult(strength); // Get force vector --> magnitude * direction - return force; - } - - // Method to display - void display() { - ellipseMode(CENTER); - stroke(0); - if (dragging) fill (50); - else if (rollover) fill(100); - else fill(0); - ellipse(location.x,location.y,mass*6,mass*6); - } - - // The methods below are for mouse interaction - void clicked(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - dragging = true; - drag.x = location.x-mx; - drag.y = location.y-my; - } - } - - void rollover(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - rollover = true; - } - else { - rollover = false; - } - } - - void stopDragging() { - dragging = false; - } - - - - void drag() { - if (dragging) { - location.x = mouseX + drag.x; - location.y = mouseY + drag.y; - } - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Exercise_2_10_attractrepel.pde b/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Exercise_2_10_attractrepel.pde deleted file mode 100644 index 03eefdbc6..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Exercise_2_10_attractrepel.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[20]; - -Attractor a; - -float g = 1; - -void setup() { - size(800,200); - a = new Attractor(); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(4,12),random(width),random(height)); - } -} - -void draw() { - background(255); - - a.display(); - - - for (int i = 0; i < movers.length; i++) { - for (int j = 0; j < movers.length; j++) { - if (i != j) { - PVector force = movers[j].repel(movers[i]); - movers[i].applyForce(force); - } - } - - PVector force = a.attract(movers[i]); - movers[i].applyForce(force); - movers[i].update(); - movers[i].display(); - } - - - -} - - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Mover.pde deleted file mode 100644 index 0725db4c9..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Mover.pde +++ /dev/null @@ -1,73 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x , float y) { - mass = m; - location = new PVector(x,y); - velocity = new PVector(0,0); - acceleration = new PVector(0,0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - fill(175,200); - ellipse(location.x,location.y,mass*2,mass*2); - } - - PVector repel(Mover m) { - PVector force = PVector.sub(location,m.location); // Calculate direction of force - float distance = force.mag(); // Distance between objects - distance = constrain(distance,1.0,10000.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction - - float strength = (g * mass * m.mass) / (distance * distance); // Calculate gravitional force magnitude - force.mult(-1*strength); // Get force vector --> magnitude * direction - return force; - } - - void checkEdges() { - - if (location.x > width) { - location.x = width; - velocity.x *= -1; - } - else if (location.x < 0) { - location.x = 0; - velocity.x *= -1; - } - - if (location.y > height) { - location.y = height; - velocity.y *= -1; - } - else if (location.y < 0) { - location.y = 0; - velocity.y *= -1; - } - - } - -} - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/Extra_instantforce/Extra_instantforce.pde b/java/examples/Books/Nature of Code/chp2_forces/Extra_instantforce/Extra_instantforce.pde deleted file mode 100644 index ac2636abd..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/Extra_instantforce/Extra_instantforce.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover m; - -float t = 0.0; - -void setup() { - size(640, 360); - m = new Mover(); -} - -void draw() { - background(255); - - // Perlin noise wind - float wx = map(noise(t),0,1,-1,1); - PVector wind = new PVector(wx, 0); - t += 0.01; - line(width/2,height/2,width/2+wind.x*100,height/2+wind.y*100); - m.applyForce(wind); - - // Gravity - PVector gravity = new PVector(0, 0.1); - //m.applyForce(gravity); - - // Shake force - //m.shake(); - - // Boundary force - if (m.location.x > width - 50) { - PVector boundary = new PVector(-1,0); - m.applyForce(boundary); - } else if (m.location.x < 50) { - PVector boundary = new PVector(1,0); - m.applyForce(boundary); - } - - - - - m.update(); - m.display(); - //m.checkEdges(); -} - -// Instant Force -void mousePressed() { - PVector cannon = PVector.random2D(); - cannon.mult(5); - m.applyForce(cannon); -} - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/Extra_instantforce/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/Extra_instantforce/Mover.pde deleted file mode 100644 index 681cfed16..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/Extra_instantforce/Mover.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover() { - location = new PVector(width/2,height/2); - velocity = new PVector(0,0); - acceleration = new PVector(0,0); - mass = 1; - } - - void shake() { - PVector force = PVector.random2D(); - force.mult(0.7); - applyForce(force); - - - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - - // Simple friction - velocity.mult(0.95); - - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127); - ellipse(location.x,location.y,48,48); - } - - void checkEdges() { - - if (location.x > width) { - location.x = width; - velocity.x *= -1; - } else if (location.x < 0) { - velocity.x *= -1; - location.x = 0; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/Attractor.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/Attractor.pde deleted file mode 100644 index a242a2ef2..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/Attractor.pde +++ /dev/null @@ -1,42 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Attraction - -// A class for a draggable attractive body in our world - -class Attractor { - float mass; // Mass, tied to size - PVector location; // Location - float g; - - Attractor() { - location = new PVector(0,0); - mass = 20; - g = 0.4; - } - - - PVector attract(Mover m) { - PVector force = PVector.sub(location,m.location); // Calculate direction of force - float distance = force.mag(); // Distance between objects - distance = constrain(distance,5.0,25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction) - float strength = (g * mass * m.mass) / (distance * distance); // Calculate gravitional force magnitude - force.mult(strength); // Get force vector --> magnitude * direction - return force; - } - - // Method to display - void display() { - stroke(255); - noFill(); - pushMatrix(); - translate(location.x,location.y,location.z); - sphere(mass*2); - popMatrix(); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/Mover.pde deleted file mode 100644 index 5a5b3dcdf..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/Mover.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x, float y, float z) { - mass = m; - location = new PVector(x,y,z); - velocity = new PVector(1,0); - acceleration = new PVector(0,0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - noStroke(); - fill(255); - pushMatrix(); - translate(location.x,location.y,location.z); - sphere(mass*8); - popMatrix(); - } - - void checkEdges() { - - if (location.x > width) { - location.x = 0; - } - else if (location.x < 0) { - location.x = width; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/NOC_02forces_many_attraction_3D.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/NOC_02forces_many_attraction_3D.pde deleted file mode 100644 index 5faf4dca0..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/NOC_02forces_many_attraction_3D.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -import processing.opengl.*; - -Mover[] movers = new Mover[10]; - -Attractor a; - -float angle = 0; - -void setup() { - size(800,200,OPENGL); - background(255); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(0.1,2),random(-width/2,width/2),random(-height/2,height/2),random(-100,100)); - } - a = new Attractor(); -} - -void draw() { - background(0); - sphereDetail(8); - lights(); - translate(width/2,height/2); - rotateY(angle); - - - a.display(); - - for (int i = 0; i < movers.length; i++) { - PVector force = a.attract(movers[i]); - movers[i].applyForce(force); - - movers[i].update(); - movers[i].display(); - } - - angle += 0.003; - -} - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_mutual_boundaries/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_mutual_boundaries/Mover.pde deleted file mode 100644 index ed666c5f0..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_mutual_boundaries/Mover.pde +++ /dev/null @@ -1,74 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x, float y) { - mass = m; - location = new PVector(x, y); - velocity = new PVector(0, 0); - acceleration = new PVector(0, 0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force, mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - fill(175, 200); - ellipse(location.x, location.y, mass*16, mass*16); - } - - PVector attract(Mover m) { - PVector force = PVector.sub(location, m.location); // Calculate direction of force - float distance = force.mag(); // Distance between objects - distance = constrain(distance, 5.0, 25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction - - float strength = (g * mass * m.mass) / (distance * distance); // Calculate gravitional force magnitude - force.mult(strength); // Get force vector --> magnitude * direction - return force; - } - - void boundaries() { - - float d = 50; - - PVector force = new PVector(0, 0); - - if (location.x < d) { - force.x = 1; - } - else if (location.x > width -d) { - force.x = -1; - } - - if (location.y < d) { - force.y = 1; - } - else if (location.y > height-d) { - force.y = -1; - } - - force.normalize(); - force.mult(0.1); - - applyForce(force); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_mutual_boundaries/NOC_02forces_many_mutual_boundaries.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_mutual_boundaries/NOC_02forces_many_mutual_boundaries.pde deleted file mode 100644 index caf6d8b63..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_mutual_boundaries/NOC_02forces_many_mutual_boundaries.pde +++ /dev/null @@ -1,47 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[20]; - -float g = 0.4; - -void setup() { - size(800,200); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(1,2),random(width),random(height)); - } -} - -void draw() { - background(255); - - - for (int i = 0; i < movers.length; i++) { - for (int j = 0; j < movers.length; j++) { - if (i != j) { - PVector force = movers[j].attract(movers[i]); - movers[i].applyForce(force); - } - } - - movers[i].boundaries(); - - movers[i].update(); - movers[i].display(); - } - -} - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_1_forces/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_1_forces/Mover.pde deleted file mode 100644 index 839b1afdc..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_1_forces/Mover.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover() { - location = new PVector(30,30); - velocity = new PVector(0,0); - acceleration = new PVector(0,0); - mass = 1; - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127); - ellipse(location.x,location.y,48,48); - } - - void checkEdges() { - - if (location.x > width) { - location.x = width; - velocity.x *= -1; - } else if (location.x < 0) { - velocity.x *= -1; - location.x = 0; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_1_forces/NOC_2_1_forces.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_1_forces/NOC_2_1_forces.pde deleted file mode 100644 index 92713efaa..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_1_forces/NOC_2_1_forces.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover m; - -void setup() { - size(640,360); - m = new Mover(); -} - -void draw() { - background(255); - - PVector wind = new PVector(0.01,0); - PVector gravity = new PVector(0,0.1); - m.applyForce(wind); - m.applyForce(gravity); - - - m.update(); - m.display(); - m.checkEdges(); - -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_2_forces_many/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_2_forces_many/Mover.pde deleted file mode 100644 index 6b008918c..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_2_forces_many/Mover.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x , float y) { - mass = m; - location = new PVector(x,y); - velocity = new PVector(0,0); - acceleration = new PVector(0,0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(0,127); - ellipse(location.x,location.y,mass*16,mass*16); - } - - void checkEdges() { - - if (location.x > width) { - location.x = width; - velocity.x *= -1; - } else if (location.x < 0) { - velocity.x *= -1; - location.x = 0; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_2_forces_many/NOC_2_2_forces_many.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_2_forces_many/NOC_2_2_forces_many.pde deleted file mode 100644 index db74a7634..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_2_forces_many/NOC_2_2_forces_many.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[20]; - -void setup() { - size(800,200); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(0.1,4),0,0); - } -} - -void draw() { - background(255); - - for (int i = 0; i < movers.length; i++) { - - PVector wind = new PVector(0.01,0); - PVector gravity = new PVector(0,0.1); - - movers[i].applyForce(wind); - movers[i].applyForce(gravity); - - movers[i].update(); - movers[i].display(); - movers[i].checkEdges(); - } - -} - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_3_forces_many_realgravity/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_3_forces_many_realgravity/Mover.pde deleted file mode 100644 index 6b008918c..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_3_forces_many_realgravity/Mover.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x , float y) { - mass = m; - location = new PVector(x,y); - velocity = new PVector(0,0); - acceleration = new PVector(0,0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(0,127); - ellipse(location.x,location.y,mass*16,mass*16); - } - - void checkEdges() { - - if (location.x > width) { - location.x = width; - velocity.x *= -1; - } else if (location.x < 0) { - velocity.x *= -1; - location.x = 0; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_3_forces_many_realgravity/NOC_2_3_forces_many_realgravity.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_3_forces_many_realgravity/NOC_2_3_forces_many_realgravity.pde deleted file mode 100644 index c3ecd8488..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_3_forces_many_realgravity/NOC_2_3_forces_many_realgravity.pde +++ /dev/null @@ -1,37 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[20]; - -void setup() { - size(800, 200); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(1, 4), 0, 0); - } -} - -void draw() { - background(255); - - for (int i = 0; i < movers.length; i++) { - - PVector wind = new PVector(0.01, 0); - PVector gravity = new PVector(0, 0.1*movers[i].mass); - - movers[i].applyForce(wind); - movers[i].applyForce(gravity); - - movers[i].update(); - movers[i].display(); - movers[i].checkEdges(); - } -} - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_friction/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_friction/Mover.pde deleted file mode 100644 index 263724c51..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_friction/Mover.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x , float y) { - mass = m; - location = new PVector(x,y); - velocity = new PVector(0,0); - acceleration = new PVector(0,0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(0,127); - ellipse(location.x,location.y,mass*16,mass*16); - } - - void checkEdges() { - - if (location.x > width) { - location.x = width; - velocity.x *= -1; - } else if (location.x < 0) { - location.x = 0; - velocity.x *= -1; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_friction/NOC_2_4_forces_friction.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_friction/NOC_2_4_forces_friction.pde deleted file mode 100644 index 02c417066..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_friction/NOC_2_4_forces_friction.pde +++ /dev/null @@ -1,45 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[5]; - -void setup() { - size(383, 200); - randomSeed(1); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(1, 4), random(width), 0); - } -} - -void draw() { - background(255); - - for (int i = 0; i < movers.length; i++) { - - PVector wind = new PVector(0.01, 0); - PVector gravity = new PVector(0, 0.1*movers[i].mass); - - float c = 0.05; - PVector friction = movers[i].velocity.get(); - friction.mult(-1); - friction.normalize(); - friction.mult(c); - - movers[i].applyForce(friction); - movers[i].applyForce(wind); - movers[i].applyForce(gravity); - - movers[i].update(); - movers[i].display(); - movers[i].checkEdges(); - } -} - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_nofriction/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_nofriction/Mover.pde deleted file mode 100644 index 263724c51..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_nofriction/Mover.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x , float y) { - mass = m; - location = new PVector(x,y); - velocity = new PVector(0,0); - acceleration = new PVector(0,0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(0,127); - ellipse(location.x,location.y,mass*16,mass*16); - } - - void checkEdges() { - - if (location.x > width) { - location.x = width; - velocity.x *= -1; - } else if (location.x < 0) { - location.x = 0; - velocity.x *= -1; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_nofriction/NOC_2_4_forces_nofriction.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_nofriction/NOC_2_4_forces_nofriction.pde deleted file mode 100644 index 029236deb..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_nofriction/NOC_2_4_forces_nofriction.pde +++ /dev/null @@ -1,45 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[5]; - -void setup() { - size(383, 200); - randomSeed(1); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(1, 4), random(width), 0); - } -} - -void draw() { - background(255); - - for (int i = 0; i < movers.length; i++) { - - PVector wind = new PVector(0.01, 0); - PVector gravity = new PVector(0, 0.1*movers[i].mass); - - float c = 0.05; - PVector friction = movers[i].velocity.get(); - friction.mult(-1); - friction.normalize(); - friction.mult(c); - - //movers[i].applyForce(friction); - movers[i].applyForce(wind); - movers[i].applyForce(gravity); - - movers[i].update(); - movers[i].display(); - movers[i].checkEdges(); - } -} - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/Liquid.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/Liquid.pde deleted file mode 100644 index b0ea9b736..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/Liquid.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - - // Liquid class - class Liquid { - - - // Liquid is a rectangle - float x,y,w,h; - // Coefficient of drag - float c; - - Liquid(float x_, float y_, float w_, float h_, float c_) { - x = x_; - y = y_; - w = w_; - h = h_; - c = c_; - } - - // Is the Mover in the Liquid? - boolean contains(Mover m) { - PVector l = m.location; - if (l.x > x && l.x < x + w && l.y > y && l.y < y + h) { - return true; - } - else { - return false; - } - } - - // Calculate drag force - PVector drag(Mover m) { - // Magnitude is coefficient * speed squared - float speed = m.velocity.mag(); - float dragMagnitude = c * speed * speed; - - // Direction is inverse of velocity - PVector dragForce = m.velocity.get(); - dragForce.mult(-1); - - // Scale according to magnitude - // dragForce.setMag(dragMagnitude); - dragForce.normalize(); - dragForce.mult(dragMagnitude); - return dragForce; - } - - void display() { - noStroke(); - fill(50); - rect(x,y,w,h); - } - -} - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/Mover.pde deleted file mode 100644 index 791e90954..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/Mover.pde +++ /dev/null @@ -1,58 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - // location, velocity, and acceleration - PVector location; - PVector velocity; - PVector acceleration; - - // Mass is tied to size - float mass; - - Mover(float m, float x, float y) { - mass = m; - location = new PVector(x, y); - velocity = new PVector(0, 0); - acceleration = new PVector(0, 0); - } - - // Newton's 2nd law: F = M * A - // or A = F / M - void applyForce(PVector force) { - // Divide by mass - PVector f = PVector.div(force, mass); - // Accumulate all forces in acceleration - acceleration.add(f); - } - - void update() { - - // Velocity changes according to acceleration - velocity.add(acceleration); - // Location changes by velocity - location.add(velocity); - // We must clear acceleration each frame - acceleration.mult(0); - } - - // Draw Mover - void display() { - stroke(0); - strokeWeight(2); - fill(127, 200); - ellipse(location.x, location.y, mass*16, mass*16); - } - - // Bounce off bottom of window - void checkEdges() { - if (location.y > height) { - velocity.y *= -0.9; // A little dampening when hitting the bottom - location.y = height; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/NOC_2_5_fluidresistance.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/NOC_2_5_fluidresistance.pde deleted file mode 100644 index ff9573d6d..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/NOC_2_5_fluidresistance.pde +++ /dev/null @@ -1,72 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Forces (Gravity and Fluid Resistence) with Vectors - -// Demonstration of multiple force acting on bodies (Mover class) -// Bodies experience gravity continuously -// Bodies experience fluid resistance when in "water" - -// Five moving bodies -Mover[] movers = new Mover[11]; - -// Liquid -Liquid liquid; - -void setup() { - size(800, 200); - reset(); - // Create liquid object - liquid = new Liquid(0, height/2, width, height/2, 0.1); -} - -void draw() { - background(255); - - // Draw water - liquid.display(); - - for (int i = 0; i < movers.length; i++) { - - // Is the Mover in the liquid? - if (liquid.contains(movers[i])) { - // Calculate drag force - PVector dragForce = liquid.drag(movers[i]); - // Apply drag force to Mover - movers[i].applyForce(dragForce); - } - - // Gravity is scaled by mass here! - PVector gravity = new PVector(0, 0.1*movers[i].mass); - // Apply gravity - movers[i].applyForce(gravity); - - // Update and display - movers[i].update(); - movers[i].display(); - movers[i].checkEdges(); - } - - fill(0); - text("click mouse to reset",10,30); - -} - -void mousePressed() { - reset(); -} - -// Restart all the Mover objects randomly -void reset() { - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(0.5, 3), 40+i*70, 0); - } -} - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/Liquid.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/Liquid.pde deleted file mode 100644 index bce05cc7c..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/Liquid.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - - // Liquid class - class Liquid { - - - // Liquid is a rectangle - float x,y,w,h; - // Coefficient of drag - float c; - - Liquid(float x_, float y_, float w_, float h_, float c_) { - x = x_; - y = y_; - w = w_; - h = h_; - c = c_; - } - - // Is the Mover in the Liquid? - boolean contains(Mover m) { - PVector l = m.location; - if (l.x > x && l.x < x + w && l.y > y && l.y < y + h) { - return true; - } - else { - return false; - } - } - - // Calculate drag force - PVector drag(Mover m) { - // Magnitude is coefficient * speed squared - float speed = m.velocity.mag(); - float dragMagnitude = c * speed * speed; - - // Direction is inverse of velocity - PVector dragForce = m.velocity.get(); - dragForce.mult(-1); - - // Scale according to magnitude - // dragForce.setMag(dragMagnitude); - dragForce.normalize(); - dragForce.mult(dragMagnitude); - return dragForce; - } - - void display() { - noStroke(); - fill(50); - rect(x,y,w,h); - } - -} - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/Mover.pde deleted file mode 100644 index d45e3b664..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/Mover.pde +++ /dev/null @@ -1,58 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - // location, velocity, and acceleration - PVector location; - PVector velocity; - PVector acceleration; - - // Mass is tied to size - float mass; - - Mover(float m, float x, float y) { - mass = m; - location = new PVector(x, y); - velocity = new PVector(0, 0); - acceleration = new PVector(0, 0); - } - - // Newton's 2nd law: F = M * A - // or A = F / M - void applyForce(PVector force) { - // Divide by mass - PVector f = PVector.div(force, mass); - // Accumulate all forces in acceleration - acceleration.add(f); - } - - void update() { - - // Velocity changes according to acceleration - velocity.add(acceleration); - // Location changes by velocity - location.add(velocity); - // We must clear acceleration each frame - acceleration.mult(0); - } - - // Draw Mover - void display() { - stroke(0); - strokeWeight(2*2.25); - fill(127,200); - ellipse(location.x, location.y, mass*16, mass*16); - } - - // Bounce off bottom of window - void checkEdges() { - if (location.y > height) { - velocity.y *= -0.9; // A little dampening when hitting the bottom - location.y = height; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/NOC_2_5_fluidresistance_sequence.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/NOC_2_5_fluidresistance_sequence.pde deleted file mode 100644 index 99d47915b..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/NOC_2_5_fluidresistance_sequence.pde +++ /dev/null @@ -1,74 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Forces (Gravity and Fluid Resistence) with Vectors - -// Demonstration of multiple force acting on bodies (Mover class) -// Bodies experience gravity continuously -// Bodies experience fluid resistance when in "water" - -// Five moving bodies -Mover[] movers = new Mover[5]; - -// Liquid -Liquid liquid; - -void setup() { - size(450, 450); - randomSeed(1); - reset(); - // Create liquid object - liquid = new Liquid(0, height/2, width, height/2, 0.1); -} - -void draw() { - background(255); - - // Draw water - liquid.display(); - - for (int i = 0; i < movers.length; i++) { - - // Is the Mover in the liquid? - if (liquid.contains(movers[i])) { - // Calculate drag force - PVector dragForce = liquid.drag(movers[i]); - // Apply drag force to Mover - movers[i].applyForce(dragForce); - } - - // Gravity is scaled by mass here! - PVector gravity = new PVector(0, 0.1*movers[i].mass); - // Apply gravity - movers[i].applyForce(gravity); - - // Update and display - movers[i].update(); - movers[i].display(); - movers[i].checkEdges(); - } - - fill(255); - //text("click mouse to reset",10,30); - - if (frameCount % 20 == 0) saveFrame("ch2_05_####.png"); -} - -void mousePressed() { - reset(); -} - -// Restart all the Mover objects randomly -void reset() { - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(0.5*2.25,3*2.25), 20*2.25+i*40*2.25, 0); - } -} - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/Attractor.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/Attractor.pde deleted file mode 100644 index 556605cb7..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/Attractor.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A class for a draggable attractive body in our world - -class Attractor { - float mass; // Mass, tied to size - float G; // Gravitational Constant - PVector location; // Location - boolean dragging = false; // Is the object being dragged? - boolean rollover = false; // Is the mouse over the ellipse? - PVector dragOffset; // holds the offset for when object is clicked on - - Attractor() { - location = new PVector(width/2,height/2); - mass = 20; - G = 1; - dragOffset = new PVector(0.0,0.0); - } - - PVector attract(Mover m) { - PVector force = PVector.sub(location,m.location); // Calculate direction of force - float d = force.mag(); // Distance between objects - d = constrain(d,5.0,25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction) - float strength = (G * mass * m.mass) / (d * d); // Calculate gravitional force magnitude - force.mult(strength); // Get force vector --> magnitude * direction - return force; - } - - // Method to display - void display() { - ellipseMode(CENTER); - strokeWeight(4); - stroke(0); - if (dragging) fill (50); - else if (rollover) fill(100); - else fill(175,200); - ellipse(location.x,location.y,mass*2,mass*2); - } - - // The methods below are for mouse interaction - void clicked(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - dragging = true; - dragOffset.x = location.x-mx; - dragOffset.y = location.y-my; - } - } - - void hover(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - rollover = true; - } - else { - rollover = false; - } - } - - void stopDragging() { - dragging = false; - } - - - - void drag() { - if (dragging) { - location.x = mouseX + dragOffset.x; - location.y = mouseY + dragOffset.y; - } - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/Mover.pde deleted file mode 100644 index 7c35ead44..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/Mover.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover() { - location = new PVector(400,50); - velocity = new PVector(1,0); - acceleration = new PVector(0,0); - mass = 1; - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127); - ellipse(location.x,location.y,16,16); - } - - void checkEdges() { - - if (location.x > width) { - location.x = 0; - } else if (location.x < 0) { - location.x = width; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/NOC_2_6_attraction.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/NOC_2_6_attraction.pde deleted file mode 100644 index d2ab1284a..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/NOC_2_6_attraction.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover m; -Attractor a; - -void setup() { - size(640,360); - m = new Mover(); - a = new Attractor(); -} - -void draw() { - background(255); - - PVector force = a.attract(m); - m.applyForce(force); - m.update(); - - a.drag(); - a.hover(mouseX,mouseY); - - a.display(); - m.display(); -} - -void mousePressed() { - a.clicked(mouseX,mouseY); -} - -void mouseReleased() { - a.stopDragging(); -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/Attractor.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/Attractor.pde deleted file mode 100644 index 556605cb7..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/Attractor.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A class for a draggable attractive body in our world - -class Attractor { - float mass; // Mass, tied to size - float G; // Gravitational Constant - PVector location; // Location - boolean dragging = false; // Is the object being dragged? - boolean rollover = false; // Is the mouse over the ellipse? - PVector dragOffset; // holds the offset for when object is clicked on - - Attractor() { - location = new PVector(width/2,height/2); - mass = 20; - G = 1; - dragOffset = new PVector(0.0,0.0); - } - - PVector attract(Mover m) { - PVector force = PVector.sub(location,m.location); // Calculate direction of force - float d = force.mag(); // Distance between objects - d = constrain(d,5.0,25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction) - float strength = (G * mass * m.mass) / (d * d); // Calculate gravitional force magnitude - force.mult(strength); // Get force vector --> magnitude * direction - return force; - } - - // Method to display - void display() { - ellipseMode(CENTER); - strokeWeight(4); - stroke(0); - if (dragging) fill (50); - else if (rollover) fill(100); - else fill(175,200); - ellipse(location.x,location.y,mass*2,mass*2); - } - - // The methods below are for mouse interaction - void clicked(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - dragging = true; - dragOffset.x = location.x-mx; - dragOffset.y = location.y-my; - } - } - - void hover(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - rollover = true; - } - else { - rollover = false; - } - } - - void stopDragging() { - dragging = false; - } - - - - void drag() { - if (dragging) { - location.x = mouseX + dragOffset.x; - location.y = mouseY + dragOffset.y; - } - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/Mover.pde deleted file mode 100644 index 245dd0c3e..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/Mover.pde +++ /dev/null @@ -1,37 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x, float y) { - mass = m; - location = new PVector(x, y); - velocity = new PVector(1, 0); - acceleration = new PVector(0, 0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force, mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(0,100); - ellipse(location.x, location.y, mass*25, mass*25); - } -} - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/NOC_2_7_attraction_many.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/NOC_2_7_attraction_many.pde deleted file mode 100644 index e7f5b1c5b..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/NOC_2_7_attraction_many.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[10]; - -Attractor a; - -void setup() { - size(800, 200); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(0.1, 2), random(width), random(height)); - } - a = new Attractor(); - } - -void draw() { - background(255); - - a.display(); - a.drag(); - a.hover(mouseX, mouseY); - - for (int i = 0; i < movers.length; i++) { - PVector force = a.attract(movers[i]); - movers[i].applyForce(force); - - movers[i].update(); - movers[i].display(); - } -} - -void mousePressed() { - a.clicked(mouseX, mouseY); -} - -void mouseReleased() { - a.stopDragging(); -} - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_8_mutual_attraction/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_8_mutual_attraction/Mover.pde deleted file mode 100644 index 63b9dbc67..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_8_mutual_attraction/Mover.pde +++ /dev/null @@ -1,52 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x, float y) { - mass = m; - location = new PVector(x, y); - velocity = new PVector(0, 0); - acceleration = new PVector(0, 0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force, mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(0, 100); - ellipse(location.x, location.y, mass*24, mass*24); - } - - PVector attract(Mover m) { - PVector force = PVector.sub(location, m.location); // Calculate direction of force - float distance = force.mag(); // Distance between objects - distance = constrain(distance, 5.0, 25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction - - float strength = (g * mass * m.mass) / (distance * distance); // Calculate gravitional force magnitude - force.mult(strength); // Get force vector --> magnitude * direction - return force; - } - - -} - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_8_mutual_attraction/NOC_2_8_mutual_attraction.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_8_mutual_attraction/NOC_2_8_mutual_attraction.pde deleted file mode 100644 index 3a6ef45a8..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_8_mutual_attraction/NOC_2_8_mutual_attraction.pde +++ /dev/null @@ -1,45 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[20]; - -float g = 0.4; - -void setup() { - size(800,200); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(0.1,2),random(width),random(height)); - } -} - -void draw() { - background(255); - - - for (int i = 0; i < movers.length; i++) { - for (int j = 0; j < movers.length; j++) { - if (i != j) { - PVector force = movers[j].attract(movers[i]); - movers[i].applyForce(force); - } - } - - movers[i].update(); - movers[i].display(); - } - -} - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/AdditiveWave/AdditiveWave.pde b/java/examples/Books/Nature of Code/chp3_oscillation/AdditiveWave/AdditiveWave.pde deleted file mode 100644 index 2636374b8..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/AdditiveWave/AdditiveWave.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Additive Wave -// Create a more complex wave by adding two waves together. - -// Maybe better for this answer to be OOP??? - -int xspacing = 8; // How far apart should each horizontal location be spaced -int w; // Width of entire wave -int maxwaves = 5; // total # of waves to add together - -float theta = 0.0; -float[] amplitude = new float[maxwaves]; // Height of wave -float[] dx = new float[maxwaves]; // Value for incrementing X, to be calculated as a function of period and xspacing -float[] yvalues; // Using an array to store height values for the wave (not entirely necessary) - -void setup() { - size(640,360); - colorMode(RGB, 255, 255, 255, 100); - w = width + 16; - - for (int i = 0; i < maxwaves; i++) { - amplitude[i] = random(10,30); - float period = random(100,300); // How many pixels before the wave repeats - dx[i] = (TWO_PI / period) * xspacing; - } - - yvalues = new float[w/xspacing]; -} - -void draw() { - background(0); - calcWave(); - renderWave(); -} - -void calcWave() { - // Increment theta (try different values for 'angular velocity' here - theta += 0.02; - - // Set all height values to zero - for (int i = 0; i < yvalues.length; i++) { - yvalues[i] = 0; - } - - // Accumulate wave height values - for (int j = 0; j < maxwaves; j++) { - float x = theta; - for (int i = 0; i < yvalues.length; i++) { - // Every other wave is cosine instead of sine - if (j % 2 == 0) yvalues[i] += sin(x)*amplitude[j]; - else yvalues[i] += cos(x)*amplitude[j]; - x+=dx[j]; - } - } -} - -void renderWave() { - // A simple way to draw the wave with an ellipse at each location - noStroke(); - fill(255,50); - ellipseMode(CENTER); - for (int x = 0; x < yvalues.length; x++) { - ellipse(x*xspacing,height/2+yvalues[x],16,16); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/AttractionArrayWithOscillation.pde b/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/AttractionArrayWithOscillation.pde deleted file mode 100644 index 8f58c9712..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/AttractionArrayWithOscillation.pde +++ /dev/null @@ -1,46 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Attraction Array with Oscillating objects around each Crawler - -// Click and drag attractive body to move throughout space - -Crawler[] crawlers = new Crawler[6]; -Attractor a; - -void setup() { - size(640,360); - // Some random bodies - for (int i = 0; i < crawlers.length; i++) { - crawlers[i] = new Crawler(); - } - // Create an attractive body - a = new Attractor(new PVector(width/2,height/2),20,0.4); -} - -void draw() { - background(255); - a.rollover(mouseX,mouseY); - a.go(); - - for (int i = 0; i < crawlers.length; i++) { - // Calculate a force exerted by "attractor" on "Crawler" - PVector f = a.attract(crawlers[i]); - // Apply that force to the Crawler - crawlers[i].applyForce(f); - // Update and render - crawlers[i].update(); - crawlers[i].display(); - } - - -} - -void mousePressed() { - a.clicked(mouseX,mouseY); -} - -void mouseReleased() { - a.stopDragging(); -} diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Attractor.pde b/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Attractor.pde deleted file mode 100644 index 4e97f0cab..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Attractor.pde +++ /dev/null @@ -1,82 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Attraction - -// A class for a draggable attractive body in our world - -class Attractor { - float mass; // Mass, tied to size - float G; // Gravitational Constant - PVector loc; // Location - boolean dragging = false; // Is the object being dragged? - boolean rollover = false; // Is the mouse over the ellipse? - PVector drag; // holds the offset for when object is clicked on - - Attractor(PVector l_,float m_, float g_) { - loc = l_.get(); - mass = m_; - G = g_; - drag = new PVector(0.0,0.0); - } - - void go() { - render(); - drag(); - } - - PVector attract(Crawler c) { - PVector dir = PVector.sub(loc,c.loc); // Calculate direction of force - float d = dir.mag(); // Distance between objects - d = constrain(d,5.0,25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - dir.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction) - float force = (G * mass * c.mass) / (d * d); // Calculate gravitional force magnitude - dir.mult(force); // Get force vector --> magnitude * direction - return dir; - } - - // Method to display - void render() { - ellipseMode(CENTER); - stroke(0,100); - if (dragging) fill (50); - else if (rollover) fill(100); - else fill(175,50); - ellipse(loc.x,loc.y,mass*2,mass*2); - } - - // The methods below are for mouse interaction - void clicked(int mx, int my) { - float d = dist(mx,my,loc.x,loc.y); - if (d < mass) { - dragging = true; - drag.x = loc.x-mx; - drag.y = loc.y-my; - } - } - - void rollover(int mx, int my) { - float d = dist(mx,my,loc.x,loc.y); - if (d < mass) { - rollover = true; - } else { - rollover = false; - } - } - - void stopDragging() { - dragging = false; - } - - - - void drag() { - if (dragging) { - loc.x = mouseX + drag.x; - loc.y = mouseY + drag.y; - } - } - -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Crawler.pde b/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Crawler.pde deleted file mode 100644 index 7c03641ee..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Crawler.pde +++ /dev/null @@ -1,58 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Attraction - -// A class to describe a thing in our world, has vectors for location, velocity, and acceleration -// Also includes scalar values for mass, maximum velocity, and elasticity - -class Crawler { - PVector loc; - PVector vel; - PVector acc; - float mass; - - Oscillator osc; - - Crawler() { - acc = new PVector(); - vel = new PVector(random(-1,1),random(-1,1)); - loc = new PVector(random(width),random(height)); - mass = random(8,16); - osc = new Oscillator(mass*2); - } - - void applyForce(PVector force) { - PVector f = force.get(); - f.div(mass); - acc.add(f); - } - - // Method to update location - void update() { - vel.add(acc); - loc.add(vel); - // Multiplying by 0 sets the all the components to 0 - acc.mult(0); - - osc.update(vel.mag()/10); - } - - // Method to display - void display() { - float angle = vel.heading2D(); - pushMatrix(); - translate(loc.x,loc.y); - rotate(angle); - ellipseMode(CENTER); - stroke(0); - fill(175,100); - ellipse(0,0,mass*2,mass*2); - - osc.display(loc); - popMatrix(); - - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Oscillator.pde b/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Oscillator.pde deleted file mode 100644 index 2f4d4506d..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Oscillator.pde +++ /dev/null @@ -1,37 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Attraction Array with Oscillating objects around each thing - -class Oscillator { - - // Because we are going to oscillate along the x and y axis we can use PVector for two angles, amplitudes, etc.! - float theta; - float amplitude; - - Oscillator(float r) { - - // Initialize randomly - theta = 0; - amplitude = r; - - } - - // Update theta and offset - void update(float thetaVel) { - theta += thetaVel; - } - - // Display based on a location - void display(PVector loc) { - float x = map(cos(theta),-1,1,0,amplitude); - - stroke(0); - fill(50); - line(0,0,x,0); - ellipse(x,0,8,8); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_01_exercise_baton/Exercise_3_01_exercise_baton.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_01_exercise_baton/Exercise_3_01_exercise_baton.pde deleted file mode 100644 index 590ea83ab..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_01_exercise_baton/Exercise_3_01_exercise_baton.pde +++ /dev/null @@ -1,28 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float angle = 0; - -void setup() { - size(750, 150); - smooth(); -} - -void draw() { - background(255); - - fill(127); - stroke(0); - rectMode(CENTER); - translate(width/2, height/2); - rotate(angle); - line(-50, 0, 50, 0); - stroke(0); - strokeWeight(2); - fill(127); - ellipse(50, 0, 16, 16); - ellipse(-50, 0, 16, 16); - angle += 0.05; -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_03_cannon/CannonBall.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_03_cannon/CannonBall.pde deleted file mode 100644 index 80a9ca8ba..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_03_cannon/CannonBall.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class CannonBall { - // All of our regular motion stuff - PVector location; - PVector velocity; - PVector acceleration; - - // Size - float r = 8; - - float topspeed = 10; - - CannonBall(float x, float y) { - location = new PVector(x,y); - velocity = new PVector(); - acceleration = new PVector(); - } - - // Standard Euler integration - void update() { - velocity.add(acceleration); - velocity.limit(topspeed); - location.add(velocity); - acceleration.mult(0); - } - - void applyForce(PVector force) { - acceleration.add(force); - } - - - void display() { - stroke(0); - strokeWeight(2); - pushMatrix(); - translate(location.x,location.y); - ellipse(0,0,r*2,r*2); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_03_cannon/Exercise_3_03_cannon.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_03_cannon/Exercise_3_03_cannon.pde deleted file mode 100644 index 72313eaa9..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_03_cannon/Exercise_3_03_cannon.pde +++ /dev/null @@ -1,54 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - - -// All of this stuff should go into a Cannon class -float angle = -PI/4; -PVector location = new PVector(50, 300); -boolean shot = false; - -CannonBall ball; - -void setup() { - size(640, 360); - ball = new CannonBall(location.x, location.y); -} - -void draw() { - background(255); - - pushMatrix(); - translate(location.x, location.y); - rotate(angle); - rect(0, -5, 50, 10); - popMatrix(); - - if (shot) { - PVector gravity = new PVector(0, 0.2); - ball.applyForce(gravity); - ball.update(); - } - ball.display(); - - if (ball.location.y > height) { - ball = new CannonBall(location.x, location.y); - shot = false; - } -} - -void keyPressed() { - if (key == CODED && keyCode == RIGHT) { - angle += 0.1; - } - else if (key == CODED && keyCode == LEFT) { - angle -= 0.1; - } - else if (key == ' ') { - shot = true; - PVector force = PVector.fromAngle(angle); - force.mult(10); - ball.applyForce(force); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_04_spiral/Exercise_3_04_spiral.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_04_spiral/Exercise_3_04_spiral.pde deleted file mode 100644 index 90b7fea95..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_04_spiral/Exercise_3_04_spiral.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A Polar coordinate, radius now starts at 0 to spiral outwards -float r = 0; -float theta = 0; - -void setup() { - size(750,200); - background(255); - smooth(); -} - -void draw() { - // Polar to Cartesian conversion - float x = r * cos(theta); - float y = r * sin(theta); - - // Draw an ellipse at x,y - noStroke(); - fill(0); - // Adjust for center of window - ellipse(x+width/2, y+height/2, 16, 16); - - // Increment the angle - theta += 0.01; - // Increment the radius - r += 0.05; -} diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_05_asteroids/Exercise_3_05_asteroids.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_05_asteroids/Exercise_3_05_asteroids.pde deleted file mode 100644 index d0340916f..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_05_asteroids/Exercise_3_05_asteroids.pde +++ /dev/null @@ -1,41 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Chapter 3: Asteroids exercise - -// Mover object -Spaceship ship; - -void setup() { - size(640, 360); - ship = new Spaceship(); -} - -void draw() { - background(255); - - // Update location - ship.update(); - // Wrape edges - ship.wrapEdges(); - // Draw ship - ship.display(); - - - fill(0); - //text("left right arrows to turn, z to thrust",10,height-5); - - // Turn or thrust the ship depending on what key is pressed - if (keyPressed) { - if (key == CODED && keyCode == LEFT) { - ship.turn(-0.03); - } else if (key == CODED && keyCode == RIGHT) { - ship.turn(0.03); - } else if (key == 'z' || key == 'Z') { - ship.thrust(); - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_05_asteroids/Spaceship.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_05_asteroids/Spaceship.pde deleted file mode 100644 index 3a8682da7..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_05_asteroids/Spaceship.pde +++ /dev/null @@ -1,99 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Chapter 3: Asteroids - -class Spaceship { - // All of our regular motion stuff - PVector location; - PVector velocity; - PVector acceleration; - - // Arbitrary damping to slow down ship - float damping = 0.995; - float topspeed = 6; - - // Variable for heading! - float heading = 0; - - // Size - float r = 16; - - // Are we thrusting (to color boosters) - boolean thrusting = false; - - Spaceship() { - location = new PVector(width/2,height/2); - velocity = new PVector(); - acceleration = new PVector(); - } - - // Standard Euler integration - void update() { - velocity.add(acceleration); - velocity.mult(damping); - velocity.limit(topspeed); - location.add(velocity); - acceleration.mult(0); - } - - // Newton's law: F = M * A - void applyForce(PVector force) { - PVector f = force.get(); - //f.div(mass); // ignoring mass right now - acceleration.add(f); - } - - // Turn changes angle - void turn(float a) { - heading += a; - } - - // Apply a thrust force - void thrust() { - // Offset the angle since we drew the ship vertically - float angle = heading - PI/2; - // Polar to cartesian for force vector! - PVector force = new PVector(cos(angle),sin(angle)); - force.mult(0.1); - applyForce(force); - // To draw booster - thrusting = true; - } - - void wrapEdges() { - float buffer = r*2; - if (location.x > width + buffer) location.x = -buffer; - else if (location.x < -buffer) location.x = width+buffer; - if (location.y > height + buffer) location.y = -buffer; - else if (location.y < -buffer) location.y = height+buffer; - } - - - // Draw the ship - void display() { - stroke(0); - strokeWeight(2); - pushMatrix(); - translate(location.x,location.y+r); - rotate(heading); - fill(175); - if (thrusting) fill(255,0,0); - // Booster rockets - rect(-r/2,r,r/3,r/2); - rect(r/2,r,r/3,r/2); - fill(175); - // A triangle - beginShape(); - vertex(-r,r); - vertex(0,-r); - vertex(r,r); - endShape(CLOSE); - rectMode(CENTER); - popMatrix(); - - thrusting = false; - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_10_OOPWave/Exercise_3_10_OOPWave.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_10_OOPWave/Exercise_3_10_OOPWave.pde deleted file mode 100644 index f8b759970..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_10_OOPWave/Exercise_3_10_OOPWave.pde +++ /dev/null @@ -1,32 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Sine Wave - -// Two wave objects -Wave wave0; -Wave wave1; - -void setup() { - size(750,200); - // Initialize a wave with starting point, width, amplitude, and period - wave0 = new Wave(new PVector(50,75),100,20,500); - wave1 = new Wave(new PVector(300,100),300,40,220); - -} - -void draw() { - background(255); - - // Update and display waves - wave0.calculate(); - wave0.display(); - - wave1.calculate(); - wave1.display(); - - -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_10_OOPWave/Wave.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_10_OOPWave/Wave.pde deleted file mode 100644 index df88f7cd0..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_10_OOPWave/Wave.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Wave { - - int xspacing = 8; // How far apart should each horizontal location be spaced - int w; // Width of entire wave - - PVector origin; // Where does the wave's first point start - float theta = 0.0; // Start angle at 0 - float amplitude; // Height of wave - float period; // How many pixels before the wave repeats - float dx; // Value for incrementing X, to be calculated as a function of period and xspacing - float[] yvalues; // Using an array to store height values for the wave (not entirely necessary) - - Wave(PVector o, int w_, float a, float p) { - origin = o.get(); - w = w_; - period = p; - amplitude = a; - dx = (TWO_PI / period) * xspacing; - yvalues = new float[w/xspacing]; - } - - - void calculate() { - // Increment theta (try different values for 'angular velocity' here - theta += 0.02; - - // For every x value, calculate a y value with sine function - float x = theta; - for (int i = 0; i < yvalues.length; i++) { - yvalues[i] = sin(x)*amplitude; - x+=dx; - } - } - - void display() { - // A simple way to draw the wave with an ellipse at each location - for (int x = 0; x < yvalues.length; x++) { - stroke(0); - fill(0,50); - ellipseMode(CENTER); - ellipse(origin.x+x*xspacing,origin.y+yvalues[x],48,48); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_11_AdditiveWave/Exercise_3_11_AdditiveWave.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_11_AdditiveWave/Exercise_3_11_AdditiveWave.pde deleted file mode 100644 index ccf0975a3..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_11_AdditiveWave/Exercise_3_11_AdditiveWave.pde +++ /dev/null @@ -1,66 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Additive Wave -// Create a more complex wave by adding two waves together. - -int xspacing = 8; // How far apart should each horizontal location be spaced -int w; // Width of entire wave -int maxwaves = 5; // total # of waves to add together - -float theta = 0.0; -float[] amplitude = new float[maxwaves]; // Height of wave -float[] dx = new float[maxwaves]; // Value for incrementing X, to be calculated as a function of period and xspacing -float[] yvalues; // Using an array to store height values for the wave (not entirely necessary) - -void setup() { - size(750,200); - w = width + 16; - - for (int i = 0; i < maxwaves; i++) { - amplitude[i] = random(10,30); - float period = random(100,300); // How many pixels before the wave repeats - dx[i] = (TWO_PI / period) * xspacing; - } - - yvalues = new float[w/xspacing]; -} - -void draw() { - background(255); - calcWave(); - renderWave(); -} - -void calcWave() { - // Increment theta (try different values for 'angular velocity' here - theta += 0.02; - - // Set all height values to zero - for (int i = 0; i < yvalues.length; i++) { - yvalues[i] = 0; - } - - // Accumulate wave height values - for (int j = 0; j < maxwaves; j++) { - float x = theta; - for (int i = 0; i < yvalues.length; i++) { - // Every other wave is cosine instead of sine - if (j % 2 == 0) yvalues[i] += sin(x)*amplitude[j]; - else yvalues[i] += cos(x)*amplitude[j]; - x+=dx[j]; - } - } -} - -void renderWave() { - // A simple way to draw the wave with an ellipse at each location - stroke(0); - fill(127,50); - ellipseMode(CENTER); - for (int x = 0; x < yvalues.length; x++) { - ellipse(x*xspacing,height/2+yvalues[x],48,48); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Exercise_3_16_springs.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Exercise_3_16_springs.pde deleted file mode 100644 index 9f0d74795..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Exercise_3_16_springs.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Mover object -Bob b1; -Bob b2; -Bob b3; - -Spring s1; -Spring s2; -Spring s3; - -void setup() { - size(640, 360); - // Create objects at starting location - // Note third argument in Spring constructor is "rest length" - b1 = new Bob(width/2, 100); - b2 = new Bob(width/2, 200); - b3 = new Bob(width/2, 300); - - s1 = new Spring(b1,b2,100); - s2 = new Spring(b2,b3,100); - s3 = new Spring(b1,b3,100); -} - -void draw() { - background(255); - - s1.update(); - s2.update(); - s3.update(); - - s1.display(); - s2.display(); - s3.display(); - - b1.update(); - b1.display(); - b2.update(); - b2.display(); - b3.update(); - b3.display(); - - b1.drag(mouseX, mouseY); -} - - - -void mousePressed() { - b1.clicked(mouseX, mouseY); -} - -void mouseReleased() { - b1.stopDragging(); -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Mover.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Mover.pde deleted file mode 100644 index 368aa20d2..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Mover.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Bob class, just like our regular Mover (location, velocity, acceleration, mass) - -class Bob { - PVector location; - PVector velocity; - PVector acceleration; - float mass = 12; - - // Arbitrary damping to simulate friction / drag - float damping = 0.95; - - // For mouse interaction - PVector dragOffset; - boolean dragging = false; - - // Constructor - Bob(float x, float y) { - location = new PVector(x,y); - velocity = new PVector(); - acceleration = new PVector(); - dragOffset = new PVector(); - } - - // Standard Euler integration - void update() { - velocity.add(acceleration); - velocity.mult(damping); - location.add(velocity); - acceleration.mult(0); - } - - // Newton's law: F = M * A - void applyForce(PVector force) { - PVector f = force.get(); - f.div(mass); - acceleration.add(f); - } - - - // Draw the bob - void display() { - stroke(0); - strokeWeight(2); - fill(175); - if (dragging) { - fill(50); - } - ellipse(location.x,location.y,mass*2,mass*2); - } - - // The methods below are for mouse interaction - - // This checks to see if we clicked on the mover - void clicked(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - dragging = true; - dragOffset.x = location.x-mx; - dragOffset.y = location.y-my; - } - } - - void stopDragging() { - dragging = false; - } - - void drag(int mx, int my) { - if (dragging) { - location.x = mx + dragOffset.x; - location.y = my + dragOffset.y; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Spring.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Spring.pde deleted file mode 100644 index 0f4060e13..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Spring.pde +++ /dev/null @@ -1,52 +0,0 @@ -// Nature of Code 2011 -// Daniel Shiffman -// Chapter 3: Oscillation - -// Class to describe an anchor point that can connect to "Bob" objects via a spring -// Thank you: http://www.myphysicslab.com/spring2d.html - -class Spring { - - // Location - PVector anchor; - - // Rest length and spring constant - float len; - float k = 0.2; - - Bob a; - Bob b; - - // Constructor - Spring(Bob a_, Bob b_, int l) { - a = a_; - b = b_; - len = l; - } - - // Calculate spring force - void update() { - // Vector pointing from anchor to bob location - PVector force = PVector.sub(a.location, b.location); - // What is distance - float d = force.mag(); - // Stretch is difference between current distance and rest length - float stretch = d - len; - - // Calculate force according to Hooke's Law - // F = k * stretch - force.normalize(); - force.mult(-1 * k * stretch); - a.applyForce(force); - force.mult(-1); - b.applyForce(force); - } - - - void display() { - strokeWeight(2); - stroke(0); - line(a.location.x, a.location.y, b.location.x, b.location.y); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Exercise_3_16_springs_array.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Exercise_3_16_springs_array.pde deleted file mode 100644 index 01a0bcad4..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Exercise_3_16_springs_array.pde +++ /dev/null @@ -1,50 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Mover object -Bob[] bobs = new Bob[5]; - -Spring[] springs = new Spring[4]; - -void setup() { - size(640, 360); - // Create objects at starting location - // Note third argument in Spring constructor is "rest length" - for (int i = 0; i < bobs.length; i++) { - bobs[i] = new Bob(width/2, i*40); - } - for (int i = 0; i < springs.length; i++) { - springs[i] = new Spring(bobs[i], bobs[i+1],40); - } -} - -void draw() { - background(255); - - for (Spring s : springs) { - s.update(); - s.display(); - } - - for (Bob b : bobs) { - b.update(); - b.display(); - b.drag(mouseX, mouseY); - } -} - - - -void mousePressed() { - for (Bob b : bobs) { - b.clicked(mouseX, mouseY); - } -} - -void mouseReleased() { - for (Bob b : bobs) { - b.stopDragging(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Mover.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Mover.pde deleted file mode 100644 index 7f5e0fcc5..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Mover.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Bob class, just like our regular Mover (location, velocity, acceleration, mass) - -class Bob { - PVector location; - PVector velocity; - PVector acceleration; - float mass = 8; - - // Arbitrary damping to simulate friction / drag - float damping = 0.95; - - // For mouse interaction - PVector dragOffset; - boolean dragging = false; - - // Constructor - Bob(float x, float y) { - location = new PVector(x,y); - velocity = new PVector(); - acceleration = new PVector(); - dragOffset = new PVector(); - } - - // Standard Euler integration - void update() { - velocity.add(acceleration); - velocity.mult(damping); - location.add(velocity); - acceleration.mult(0); - } - - // Newton's law: F = M * A - void applyForce(PVector force) { - PVector f = force.get(); - f.div(mass); - acceleration.add(f); - } - - - // Draw the bob - void display() { - stroke(0); - strokeWeight(2); - fill(175,120); - if (dragging) { - fill(50); - } - ellipse(location.x,location.y,mass*2,mass*2); - } - - // The methods below are for mouse interaction - - // This checks to see if we clicked on the mover - void clicked(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - dragging = true; - dragOffset.x = location.x-mx; - dragOffset.y = location.y-my; - } - } - - void stopDragging() { - dragging = false; - } - - void drag(int mx, int my) { - if (dragging) { - location.x = mx + dragOffset.x; - location.y = my + dragOffset.y; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Spring.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Spring.pde deleted file mode 100644 index 0f4060e13..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Spring.pde +++ /dev/null @@ -1,52 +0,0 @@ -// Nature of Code 2011 -// Daniel Shiffman -// Chapter 3: Oscillation - -// Class to describe an anchor point that can connect to "Bob" objects via a spring -// Thank you: http://www.myphysicslab.com/spring2d.html - -class Spring { - - // Location - PVector anchor; - - // Rest length and spring constant - float len; - float k = 0.2; - - Bob a; - Bob b; - - // Constructor - Spring(Bob a_, Bob b_, int l) { - a = a_; - b = b_; - len = l; - } - - // Calculate spring force - void update() { - // Vector pointing from anchor to bob location - PVector force = PVector.sub(a.location, b.location); - // What is distance - float d = force.mag(); - // Stretch is difference between current distance and rest length - float stretch = d - len; - - // Calculate force according to Hooke's Law - // F = k * stretch - force.normalize(); - force.mult(-1 * k * stretch); - a.applyForce(force); - force.mult(-1); - b.applyForce(force); - } - - - void display() { - strokeWeight(2); - stroke(0); - line(a.location.x, a.location.y, b.location.x, b.location.y); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/Attractor.pde b/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/Attractor.pde deleted file mode 100644 index 556605cb7..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/Attractor.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A class for a draggable attractive body in our world - -class Attractor { - float mass; // Mass, tied to size - float G; // Gravitational Constant - PVector location; // Location - boolean dragging = false; // Is the object being dragged? - boolean rollover = false; // Is the mouse over the ellipse? - PVector dragOffset; // holds the offset for when object is clicked on - - Attractor() { - location = new PVector(width/2,height/2); - mass = 20; - G = 1; - dragOffset = new PVector(0.0,0.0); - } - - PVector attract(Mover m) { - PVector force = PVector.sub(location,m.location); // Calculate direction of force - float d = force.mag(); // Distance between objects - d = constrain(d,5.0,25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction) - float strength = (G * mass * m.mass) / (d * d); // Calculate gravitional force magnitude - force.mult(strength); // Get force vector --> magnitude * direction - return force; - } - - // Method to display - void display() { - ellipseMode(CENTER); - strokeWeight(4); - stroke(0); - if (dragging) fill (50); - else if (rollover) fill(100); - else fill(175,200); - ellipse(location.x,location.y,mass*2,mass*2); - } - - // The methods below are for mouse interaction - void clicked(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - dragging = true; - dragOffset.x = location.x-mx; - dragOffset.y = location.y-my; - } - } - - void hover(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - rollover = true; - } - else { - rollover = false; - } - } - - void stopDragging() { - dragging = false; - } - - - - void drag() { - if (dragging) { - location.x = mouseX + dragOffset.x; - location.y = mouseY + dragOffset.y; - } - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/ExtraOscillatingBody.pde b/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/ExtraOscillatingBody.pde deleted file mode 100644 index 25f1b1ca5..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/ExtraOscillatingBody.pde +++ /dev/null @@ -1,40 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover m; -Attractor a; - -void setup() { - size(640,360); - m = new Mover(); - a = new Attractor(); -} - -void draw() { - background(255); - - PVector force = a.attract(m); - m.applyForce(force); - m.update(); - - a.drag(); - a.hover(mouseX,mouseY); - - a.display(); - m.display(); - -} - -void mousePressed() { - a.clicked(mouseX,mouseY); -} - -void mouseReleased() { - a.stopDragging(); -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/Mover.pde b/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/Mover.pde deleted file mode 100644 index 00850bc1c..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/Mover.pde +++ /dev/null @@ -1,64 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover() { - location = new PVector(400,50); - velocity = new PVector(1,0); - acceleration = new PVector(0,0); - mass = 1; - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127); - pushMatrix(); - translate(location.x,location.y); - float heading = velocity.heading(); - rotate(heading); - ellipse(0,0,16,16); - rectMode(CENTER); - // "20" should be a variable that is oscillating - // with sine function - rect(20,0,10,10); - popMatrix(); - } - - void checkEdges() { - - if (location.x > width) { - location.x = 0; - } else if (location.x < 0) { - location.x = width; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingUpAndDown/ExtraOscillatingUpAndDown.pde b/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingUpAndDown/ExtraOscillatingUpAndDown.pde deleted file mode 100644 index 68b1b2074..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingUpAndDown/ExtraOscillatingUpAndDown.pde +++ /dev/null @@ -1,15 +0,0 @@ -float angle = 0; -void setup() { - size(400,400); -} - -void draw() { - background(255); - float y = 100*sin(angle); - angle += 0.02; - - fill(127); - translate(width/2,height/2); - line(0,0,0,y); - ellipse(0,y,16,16); -} diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/MultipleOscillations/MultipleOscillations.pde b/java/examples/Books/Nature of Code/chp3_oscillation/MultipleOscillations/MultipleOscillations.pde deleted file mode 100644 index 4a53d917f..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/MultipleOscillations/MultipleOscillations.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float angle1 = 0; -float aVelocity1 = 0.01; -float amplitude1 = 300; - -float angle2 = 0; -float aVelocity2 = 0.3; -float amplitude2 = 10; - - -void setup() { - size(640,360); -} - -void draw() { - background(255); - - float x = 0; - x += amplitude1 * cos(angle1); - x += amplitude2 * sin(angle2); - - angle1 += aVelocity1; - angle2 += aVelocity2; - - ellipseMode(CENTER); - stroke(0); - fill(175); - translate(width/2,height/2); - line(0,0,x,0); - ellipse(x,0,20,20); -} diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_03spring_exercise_sine/NOC_03spring_exercise_sine.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_03spring_exercise_sine/NOC_03spring_exercise_sine.pde deleted file mode 100644 index 4645efce7..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_03spring_exercise_sine/NOC_03spring_exercise_sine.pde +++ /dev/null @@ -1,25 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float angle = 0; -float aVelocity = 0.05; - -void setup() { - size(640,360); - smooth(); -} - -void draw() { - background(255); - - float x = width/2; - float y = map(sin(angle),-1,1,50,250); - angle += aVelocity; - - ellipseMode(CENTER); - stroke(0); - fill(175); - line(x,0,x,y); - ellipse(x,y,20,20); -} diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_01_angular_motion/NOC_3_01_angular_motion.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_01_angular_motion/NOC_3_01_angular_motion.pde deleted file mode 100644 index e36c11dd8..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_01_angular_motion/NOC_3_01_angular_motion.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float angle = 0; -float aVelocity = 0; -float aAcceleration = 0.0001; - -void setup() { - size(800, 200); - smooth(); -} - -void draw() { - background(255); - - - fill(127); - stroke(0); - - translate(width/2, height/2); - rectMode(CENTER); - rotate(angle); - stroke(0); - strokeWeight(2); - fill(127); - line(-60, 0, 60, 0); - ellipse(60, 0, 16, 16); - ellipse(-60, 0, 16, 16); - - angle += aVelocity; - aVelocity += aAcceleration; -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/Attractor.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/Attractor.pde deleted file mode 100644 index c7c457db7..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/Attractor.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Attraction - -// A class for a draggable attractive body in our world - -class Attractor { - float mass; // Mass, tied to size - PVector location; // Location - float g; - - Attractor() { - location = new PVector(width/2, height/2); - mass = 20; - g = 0.4; - } - - - PVector attract(Mover m) { - PVector force = PVector.sub(location, m.location); // Calculate direction of force - float distance = force.mag(); // Distance between objects - distance = constrain(distance, 5.0, 25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction) - float strength = (g * mass * m.mass) / (distance * distance); // Calculate gravitional force magnitude - force.mult(strength); // Get force vector --> magnitude * direction - return force; - } - - // Method to display - void display() { - stroke(0); - strokeWeight(2); - fill(127); - ellipse(location.x, location.y, 48, 48); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/Mover.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/Mover.pde deleted file mode 100644 index be9646c09..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/Mover.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - float angle = 0; - float aVelocity = 0; - float aAcceleration = 0; - - Mover(float m, float x, float y) { - mass = m; - location = new PVector(x,y); - velocity = new PVector(random(-1,1),random(-1,1)); - acceleration = new PVector(0,0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - - velocity.add(acceleration); - location.add(velocity); - - aAcceleration = acceleration.x / 10.0; - aVelocity += aAcceleration; - aVelocity = constrain(aVelocity,-0.1,0.1); - angle += aVelocity; - - acceleration.mult(0); - } - - void display() { - stroke(0); - fill(175,200); - rectMode(CENTER); - pushMatrix(); - translate(location.x,location.y); - rotate(angle); - rect(0,0,mass*16,mass*16); - popMatrix(); - } - -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/NOC_3_02_forces_angular_motion.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/NOC_3_02_forces_angular_motion.pde deleted file mode 100644 index 4d4302aff..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/NOC_3_02_forces_angular_motion.pde +++ /dev/null @@ -1,42 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[20]; - -Attractor a; - -void setup() { - size(800,200); - background(255); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(0.1,2),random(width),random(height)); - } - a = new Attractor(); -} - -void draw() { - background(255); - - a.display(); - - for (int i = 0; i < movers.length; i++) { - PVector force = a.attract(movers[i]); - movers[i].applyForce(force); - - movers[i].update(); - movers[i].display(); - } - -} - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_03_pointing_velocity/Mover.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_03_pointing_velocity/Mover.pde deleted file mode 100644 index 399d93a4d..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_03_pointing_velocity/Mover.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float topspeed; - - float xoff, yoff; - - float r = 16; - - Mover() { - location = new PVector(width/2, height/2); - velocity = new PVector(0, 0); - topspeed = 4; - xoff = 1000; - yoff = 0; - } - - void update() { - - PVector mouse = new PVector(mouseX, mouseY); - PVector dir = PVector.sub(mouse, location); - dir.normalize(); - dir.mult(0.5); - acceleration = dir; - - velocity.add(acceleration); - velocity.limit(topspeed); - location.add(velocity); - } - - void display() { - float theta = velocity.heading2D(); - - stroke(0); - strokeWeight(2); - fill(127); - pushMatrix(); - rectMode(CENTER); - translate(location.x, location.y); - rotate(theta); - rect(0, 0, 30, 10); - popMatrix(); - } - - void checkEdges() { - - if (location.x > width) { - location.x = 0; - } - else if (location.x < 0) { - location.x = width; - } - - if (location.y > height) { - location.y = 0; - } - else if (location.y < 0) { - location.y = height; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_03_pointing_velocity/NOC_3_03_pointing_velocity.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_03_pointing_velocity/NOC_3_03_pointing_velocity.pde deleted file mode 100644 index df09af915..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_03_pointing_velocity/NOC_3_03_pointing_velocity.pde +++ /dev/null @@ -1,20 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover mover; - -void setup() { - size(800,200); - mover = new Mover(); -} - -void draw() { - background(255); - - mover.update(); - mover.checkEdges(); - mover.display(); -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_04_PolarToCartesian/NOC_3_04_PolarToCartesian.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_04_PolarToCartesian/NOC_3_04_PolarToCartesian.pde deleted file mode 100644 index 8be1f3bd1..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_04_PolarToCartesian/NOC_3_04_PolarToCartesian.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// PolarToCartesian -// Convert a polar coordinate (r,theta) to cartesian (x,y): -// x = r * cos(theta) -// y = r * sin(theta) - -float r; -float theta; - - -void setup() { - size(800, 200); - // Initialize all values - r = height * 0.45; - theta = 0; -} - -void draw() { - - background(255); - - // Translate the origin point to the center of the screen - translate(width/2, height/2); - - // Convert polar to cartesian - float x = r * cos(theta); - float y = r * sin(theta); - - // Draw the ellipse at the cartesian coordinate - ellipseMode(CENTER); - fill(127); - stroke(0); - strokeWeight(2); - line(0,0,x,y); - ellipse(x, y, 48, 48); - - // Increase the angle over time - theta += 0.02; - - -} - - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_04_PolarToCartesian_trail/NOC_3_04_PolarToCartesian_trail.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_04_PolarToCartesian_trail/NOC_3_04_PolarToCartesian_trail.pde deleted file mode 100644 index 928afe73a..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_04_PolarToCartesian_trail/NOC_3_04_PolarToCartesian_trail.pde +++ /dev/null @@ -1,52 +0,0 @@ -/** - * PolarToCartesian - * by Daniel Shiffman. - * - * Convert a polar coordinate (r,theta) to cartesian (x,y): - * x = r * cos(theta) - * y = r * sin(theta) - */ - -float r; -float theta; - - -void setup() { - size(800, 200); - background(255); - // Initialize all values - r = height * 0.45; - theta = 0; -} - -void draw() { - - //background(255); - noStroke(); - fill(255,5); - rect(0,0,width,height); - - // Translate the origin point to the center of the screen - translate(width/2, height/2); - - // Convert polar to cartesian - float x = r * cos(theta); - float y = r * sin(theta); - - // Draw the ellipse at the cartesian coordinate - ellipseMode(CENTER); - fill(127); - stroke(0); - strokeWeight(2); - line(0,0,x,y); - ellipse(x, y, 48, 48); - - // Increase the angle over time - theta += 0.02; - - -} - - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_05_simple_harmonic_motion/NOC_3_05_simple_harmonic_motion.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_05_simple_harmonic_motion/NOC_3_05_simple_harmonic_motion.pde deleted file mode 100644 index e2830e6ca..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_05_simple_harmonic_motion/NOC_3_05_simple_harmonic_motion.pde +++ /dev/null @@ -1,22 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -void setup() { - size(800,200); -} - -void draw() { - background(255); - - float period = 120; - float amplitude = 300; - // Calculating horizontal location according to formula for simple harmonic motion - float x = amplitude * cos(TWO_PI * frameCount / period); - stroke(0); - strokeWeight(2); - fill(127); - translate(width/2,height/2); - line(0,0,x,0); - ellipse(x,0,48,48); -} diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_06_simple_harmonic_motion/NOC_3_06_simple_harmonic_motion.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_06_simple_harmonic_motion/NOC_3_06_simple_harmonic_motion.pde deleted file mode 100644 index 4ab3782c0..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_06_simple_harmonic_motion/NOC_3_06_simple_harmonic_motion.pde +++ /dev/null @@ -1,27 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float angle = 0; -float aVelocity = 0.03; - -void setup() { - size(640,360); - - smooth(); -} - -void draw() { - background(255); - - float amplitude = 300; - float x = amplitude * cos(angle); - angle += aVelocity; - - ellipseMode(CENTER); - stroke(0); - fill(175); - translate(width/2,height/2); - line(0,0,x,0); - ellipse(x,0,20,20); -} diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_07_oscillating_objects/NOC_3_07_oscillating_objects.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_07_oscillating_objects/NOC_3_07_oscillating_objects.pde deleted file mode 100644 index 20af612ed..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_07_oscillating_objects/NOC_3_07_oscillating_objects.pde +++ /dev/null @@ -1,29 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An array of objects -Oscillator[] oscillators = new Oscillator[10]; - -void setup() { - size(800,200); - smooth(); - // Initialize all objects - for (int i = 0; i < oscillators.length; i++) { - oscillators[i] = new Oscillator(); - } - background(255); -} - -void draw() { - background(255); - // Run all objects - for (int i = 0; i < oscillators.length; i++) { - oscillators[i].oscillate(); - oscillators[i].display(); - } -} - - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_07_oscillating_objects/Oscillator.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_07_oscillating_objects/Oscillator.pde deleted file mode 100644 index da9a7d6ca..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_07_oscillating_objects/Oscillator.pde +++ /dev/null @@ -1,37 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Oscillator { - - PVector angle; - PVector velocity; - PVector amplitude; - - Oscillator() { - angle = new PVector(); - velocity = new PVector(random(-0.05, 0.05), random(-0.05, 0.05)); - amplitude = new PVector(random(20,width/2), random(20,height/2)); - } - - void oscillate() { - angle.add(velocity); - } - - void display() { - - float x = sin(angle.x)*amplitude.x; - float y = sin(angle.y)*amplitude.y; - - pushMatrix(); - translate(width/2, height/2); - stroke(0); - strokeWeight(2); - fill(127,127); - line(0, 0, x, y); - ellipse(x, y, 32, 32); - popMatrix(); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_08_static_wave_lines/NOC_3_08_static_wave_lines.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_08_static_wave_lines/NOC_3_08_static_wave_lines.pde deleted file mode 100644 index 1149e065d..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_08_static_wave_lines/NOC_3_08_static_wave_lines.pde +++ /dev/null @@ -1,21 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float angle = 0; -float angleVel = 0.1; - -size(800,200); -background(255); -stroke(0); -strokeWeight(2); -noFill(); - -beginShape(); -for (int x = 0; x <= width; x += 5) { - float y = map(sin(angle),-1,1,0,height); - vertex(x,y); - angle +=angleVel; -} -endShape(); - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_exercise_additive_wave/NOC_3_09_exercise_additive_wave.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_exercise_additive_wave/NOC_3_09_exercise_additive_wave.pde deleted file mode 100644 index fd7f4bc7b..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_exercise_additive_wave/NOC_3_09_exercise_additive_wave.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Additive Wave -// Create a more complex wave by adding two waves together. - -// Maybe better for this answer to be OOP??? - -int xspacing = 8; // How far apart should each horizontal location be spaced -int w; // Width of entire wave -int maxwaves = 5; // total # of waves to add together - -float theta = 0.0; -float[] amplitude = new float[maxwaves]; // Height of wave -float[] dx = new float[maxwaves]; // Value for incrementing X, to be calculated as a function of period and xspacing -float[] yvalues; // Using an array to store height values for the wave (not entirely necessary) - -void setup() { - size(640,360); - colorMode(RGB, 255, 255, 255, 100); - w = width + 16; - - for (int i = 0; i < maxwaves; i++) { - amplitude[i] = random(10,30); - float period = random(100,300); // How many pixels before the wave repeats - dx[i] = (TWO_PI / period) * xspacing; - } - - yvalues = new float[w/xspacing]; -} - -void draw() { - background(0); - calcWave(); - renderWave(); -} - -void calcWave() { - // Increment theta (try different values for 'angular velocity' here - theta += 0.02; - - // Set all height values to zero - for (int i = 0; i < yvalues.length; i++) { - yvalues[i] = 0; - } - - // Accumulate wave height values - for (int j = 0; j < maxwaves; j++) { - float x = theta; - for (int i = 0; i < yvalues.length; i++) { - // Every other wave is cosine instead of sine - if (j % 2 == 0) yvalues[i] += sin(x)*amplitude[j]; - else yvalues[i] += cos(x)*amplitude[j]; - x+=dx[j]; - } - } -} - -void renderWave() { - // A simple way to draw the wave with an ellipse at each location - noStroke(); - fill(255,50); - ellipseMode(CENTER); - for (int x = 0; x < yvalues.length; x++) { - ellipse(x*xspacing,height/2+yvalues[x],16,16); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave/NOC_3_09_wave.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave/NOC_3_09_wave.pde deleted file mode 100644 index 5eb61b28b..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave/NOC_3_09_wave.pde +++ /dev/null @@ -1,28 +0,0 @@ - -float startAngle = 0; -float angleVel = 0.23; - -void setup() { - size(800,200); - smooth(); -} - -void draw() { - background(255); - - startAngle += 0.015; - float angle = startAngle; - - for (int x = 0; x <= width; x += 24) { - float y = map(sin(angle),-1,1,0,height); - stroke(0); - fill(0,50); - strokeWeight(2); - ellipse(x,y,48,48); - angle += angleVel; - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_a/NOC_3_09_wave_a.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_a/NOC_3_09_wave_a.pde deleted file mode 100644 index 95c824eb5..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_a/NOC_3_09_wave_a.pde +++ /dev/null @@ -1,31 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float startAngle = 0; -float angleVel = 0.05; - -void setup() { - size(250,200); - smooth(); -} - -void draw() { - background(255); - - startAngle += 0.015; - float angle = startAngle; - - for (int x = 0; x <= width; x += 24) { - float y = map(sin(angle),-1,1,0,height); - stroke(0); - fill(0,50); - strokeWeight(2); - ellipse(x,y,48,48); - angle += angleVel; - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_b/NOC_3_09_wave_b.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_b/NOC_3_09_wave_b.pde deleted file mode 100644 index 9749647db..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_b/NOC_3_09_wave_b.pde +++ /dev/null @@ -1,28 +0,0 @@ - -float startAngle = 0; -float angleVel = 0.2; - -void setup() { - size(250,200); - smooth(); -} - -void draw() { - background(255); - - startAngle += 0.015; - float angle = startAngle; - - for (int x = 0; x <= width; x += 24) { - float y = map(sin(angle),-1,1,0,height); - stroke(0); - fill(0,50); - strokeWeight(2); - ellipse(x,y,48,48); - angle += angleVel; - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_c/NOC_3_09_wave_c.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_c/NOC_3_09_wave_c.pde deleted file mode 100644 index 88a1e396d..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_c/NOC_3_09_wave_c.pde +++ /dev/null @@ -1,31 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float startAngle = 0; -float angleVel = 0.4; - -void setup() { - size(250,200); - smooth(); -} - -void draw() { - background(255); - - startAngle += 0.015; - float angle = startAngle; - - for (int x = 0; x <= width; x += 24) { - float y = map(sin(angle),-1,1,0,height); - stroke(0); - fill(0,50); - strokeWeight(2); - ellipse(x,y,48,48); - angle += angleVel; - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExample/NOC_3_10_PendulumExample.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExample/NOC_3_10_PendulumExample.pde deleted file mode 100644 index 80fe915bb..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExample/NOC_3_10_PendulumExample.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pendulum - -// A simple pendulum simulation -// Given a pendulum with an angle theta (0 being the pendulum at rest) and a radius r -// we can use sine to calculate the angular component of the gravitational force. - -// Gravity Force = Mass * Gravitational Constant; -// Pendulum Force = Gravity Force * sine(theta) -// Angular Acceleration = Pendulum Force / Mass = gravitational acceleration * sine(theta); - -// Note this is an ideal world scenario with no tension in the -// pendulum arm, a more realistic formula might be: -// Angular Acceleration = (g / R) * sine(theta) - -// For a more substantial explanation, visit: -// http://www.myphysicslab.com/pendulum1.html - -Pendulum p; - -void setup() { - size(800,200); - // Make a new Pendulum with an origin location and armlength - p = new Pendulum(new PVector(width/2,0),175); - -} - -void draw() { - - background(255); - p.go(); -} - -void mousePressed() { - p.clicked(mouseX,mouseY); -} - -void mouseReleased() { - p.stopDragging(); -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExample/Pendulum.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExample/Pendulum.pde deleted file mode 100644 index 02d400155..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExample/Pendulum.pde +++ /dev/null @@ -1,98 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pendulum - -// A Simple Pendulum Class -// Includes functionality for user can click and drag the pendulum - -class Pendulum { - - PVector location; // Location of pendulum ball - PVector origin; // Location of arm origin - float r; // Length of arm - float angle; // Pendulum arm angle - float aVelocity; // Angle velocity - float aAcceleration; // Angle acceleration - - float ballr; // Ball radius - float damping; // Arbitary damping amount - - boolean dragging = false; - - // This constructor could be improved to allow a greater variety of pendulums - Pendulum(PVector origin_, float r_) { - // Fill all variables - origin = origin_.get(); - location = new PVector(); - r = r_; - angle = PI/4; - - aVelocity = 0.0; - aAcceleration = 0.0; - damping = 0.995; // Arbitrary damping - ballr = 48.0; // Arbitrary ball radius - } - - void go() { - update(); - drag(); //for user interaction - display(); - } - - // Function to update location - void update() { - // As long as we aren't dragging the pendulum, let it swing! - if (!dragging) { - float gravity = 0.4; // Arbitrary constant - aAcceleration = (-1 * gravity / r) * sin(angle); // Calculate acceleration (see: http://www.myphysicslab.com/pendulum1.html) - aVelocity += aAcceleration; // Increment velocity - aVelocity *= damping; // Arbitrary damping - angle += aVelocity; // Increment angle - } - } - - void display() { - location.set(r*sin(angle), r*cos(angle), 0); // Polar to cartesian conversion - location.add(origin); // Make sure the location is relative to the pendulum's origin - - stroke(0); - strokeWeight(2); - // Draw the arm - line(origin.x, origin.y, location.x, location.y); - ellipseMode(CENTER); - fill(175); - if (dragging) fill(0); - // Draw the ball - ellipse(location.x, location.y, ballr, ballr); - } - - - // The methods below are for mouse interaction - - // This checks to see if we clicked on the pendulum ball - void clicked(int mx, int my) { - float d = dist(mx, my, location.x, location.y); - if (d < ballr) { - dragging = true; - } - } - - // This tells us we are not longer clicking on the ball - void stopDragging() { - aVelocity = 0; // No velocity once you let go - dragging = false; - } - - void drag() { - // If we are draging the ball, we calculate the angle between the - // pendulum origin and mouse location - // we assign that angle to the pendulum - if (dragging) { - PVector diff = PVector.sub(origin, new PVector(mouseX, mouseY)); // Difference between 2 points - angle = atan2(-1*diff.y, diff.x) - radians(90); // Angle relative to vertical axis - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExampleSimplified/NOC_3_10_PendulumExampleSimplified.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExampleSimplified/NOC_3_10_PendulumExampleSimplified.pde deleted file mode 100644 index 07c09ed46..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExampleSimplified/NOC_3_10_PendulumExampleSimplified.pde +++ /dev/null @@ -1,35 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pendulum - -// A simple pendulum simulation -// Given a pendulum with an angle theta (0 being the pendulum at rest) and a radius r -// we can use sine to calculate the angular component of the gravitational force. - -// Gravity Force = Mass * Gravitational Constant; -// Pendulum Force = Gravity Force * sine(theta) -// Angular Acceleration = Pendulum Force / Mass = Gravitational Constant * sine(theta); - -// Note this is an ideal world scenario with no tension in the -// pendulum arm, a more realistic formula might be: -// Angular Acceleration = (G / R) * sine(theta) - -// For a more substantial explanation, visit: -// http://www.myphysicslab.com/pendulum1.html - -Pendulum p; - -void setup() { - size(800,200); - // Make a new Pendulum with an origin location and armlength - p = new Pendulum(new PVector(width/2,0),175); - -} - -void draw() { - background(255); - p.go(); -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExampleSimplified/Pendulum.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExampleSimplified/Pendulum.pde deleted file mode 100644 index 1b63fd3cc..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExampleSimplified/Pendulum.pde +++ /dev/null @@ -1,64 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pendulum - -// A Simple Pendulum Class -// Includes functionality for user can click and drag the pendulum - -class Pendulum { - - PVector location; // Location of pendulum ball - PVector origin; // Location of arm origin - float r; // Length of arm - float angle; // Pendulum arm angle - float aVelocity; // Angle velocity - float aAcceleration; // Angle acceleration - float damping; // Arbitary damping amount - - // This constructor could be improved to allow a greater variety of pendulums - Pendulum(PVector origin_, float r_) { - // Fill all variables - origin = origin_.get(); - location = new PVector(); - r = r_; - angle = PI/4; - - aVelocity = 0.0; - aAcceleration = 0.0; - damping = 0.995; // Arbitrary damping - } - - void go() { - update(); - display(); - } - - // Function to update location - void update() { - float gravity = 0.4; // Arbitrary constant - aAcceleration = (-1 * gravity / r) * sin(angle); // Calculate acceleration (see: http://www.myphysicslab.com/pendulum1.html) - aVelocity += aAcceleration; // Increment velocity - aVelocity *= damping; // Arbitrary damping - angle += aVelocity; // Increment angle - } - - void display() { - location.set(r*sin(angle), r*cos(angle), 0); // Polar to cartesian conversion - location.add(origin); // Make sure the location is relative to the pendulum's origin - - stroke(0); - strokeWeight(2); - // Draw the arm - line(origin.x, origin.y, location.x, location.y); - ellipseMode(CENTER); - fill(175); - // Draw the ball - ellipse(location.x, location.y, 48, 48); - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/Mover.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/Mover.pde deleted file mode 100644 index 4545f5cd1..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/Mover.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Bob class, just like our regular Mover (location, velocity, acceleration, mass) - -class Bob { - PVector location; - PVector velocity; - PVector acceleration; - float mass = 24; - - // Arbitrary damping to simulate friction / drag - float damping = 0.98; - - // For mouse interaction - PVector dragOffset; - boolean dragging = false; - - // Constructor - Bob(float x, float y) { - location = new PVector(x,y); - velocity = new PVector(); - acceleration = new PVector(); - dragOffset = new PVector(); - } - - // Standard Euler integration - void update() { - velocity.add(acceleration); - velocity.mult(damping); - location.add(velocity); - acceleration.mult(0); - } - - // Newton's law: F = M * A - void applyForce(PVector force) { - PVector f = force.get(); - f.div(mass); - acceleration.add(f); - } - - - // Draw the bob - void display() { - stroke(0); - strokeWeight(2); - fill(175); - if (dragging) { - fill(50); - } - ellipse(location.x,location.y,mass*2,mass*2); - } - - // The methods below are for mouse interaction - - // This checks to see if we clicked on the mover - void clicked(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - dragging = true; - dragOffset.x = location.x-mx; - dragOffset.y = location.y-my; - } - } - - void stopDragging() { - dragging = false; - } - - void drag(int mx, int my) { - if (dragging) { - location.x = mx + dragOffset.x; - location.y = my + dragOffset.y; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/NOC_3_11_spring.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/NOC_3_11_spring.pde deleted file mode 100644 index ff09a0a9a..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/NOC_3_11_spring.pde +++ /dev/null @@ -1,56 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Mover object -Bob bob; - -// Spring object -Spring spring; - -void setup() { - size(640,360); - // Create objects at starting location - // Note third argument in Spring constructor is "rest length" - spring = new Spring(width/2,10,100); - bob = new Bob(width/2,100); - -} - -void draw() { - background(255); - // Apply a gravity force to the bob - PVector gravity = new PVector(0,2); - bob.applyForce(gravity); - - // Connect the bob to the spring (this calculates the force) - spring.connect(bob); - // Constrain spring distance between min and max - spring.constrainLength(bob,30,200); - - // Update bob - bob.update(); - // If it's being dragged - bob.drag(mouseX,mouseY); - - // Draw everything - spring.displayLine(bob); // Draw a line between spring and bob - bob.display(); - spring.display(); - - fill(0); - text("click on bob to drag",10,height-5); -} - - -// For mouse interaction with bob - -void mousePressed() { - bob.clicked(mouseX,mouseY); -} - -void mouseReleased() { - bob.stopDragging(); -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/Spring.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/Spring.pde deleted file mode 100644 index 565fbb307..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/Spring.pde +++ /dev/null @@ -1,75 +0,0 @@ -// Nature of Code 2011 -// Daniel Shiffman -// Chapter 3: Oscillation - -// Class to describe an anchor point that can connect to "Bob" objects via a spring -// Thank you: http://www.myphysicslab.com/spring2d.html - -class Spring { - - // Location - PVector anchor; - - // Rest length and spring constant - float len; - float k = 0.2; - - // Constructor - Spring(float x, float y, int l) { - anchor = new PVector(x, y); - len = l; - } - - // Calculate spring force - void connect(Bob b) { - // Vector pointing from anchor to bob location - PVector force = PVector.sub(b.location, anchor); - // What is distance - float d = force.mag(); - // Stretch is difference between current distance and rest length - float stretch = d - len; - - // Calculate force according to Hooke's Law - // F = k * stretch - force.normalize(); - force.mult(-1 * k * stretch); - b.applyForce(force); - } - - // Constrain the distance between bob and anchor between min and max - void constrainLength(Bob b, float minlen, float maxlen) { - PVector dir = PVector.sub(b.location, anchor); - float d = dir.mag(); - // Is it too short? - if (d < minlen) { - dir.normalize(); - dir.mult(minlen); - // Reset location and stop from moving (not realistic physics) - b.location = PVector.add(anchor, dir); - b.velocity.mult(0); - // Is it too long? - } - else if (d > maxlen) { - dir.normalize(); - dir.mult(maxlen); - // Reset location and stop from moving (not realistic physics) - b.location = PVector.add(anchor, dir); - b.velocity.mult(0); - } - } - - void display() { - stroke(0); - fill(175); - strokeWeight(2); - rectMode(CENTER); - rect(anchor.x, anchor.y, 10, 10); - } - - void displayLine(Bob b) { - strokeWeight(2); - stroke(0); - line(b.location.x, b.location.y, anchor.x, anchor.y); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/OOPWaveParticles.pde b/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/OOPWaveParticles.pde deleted file mode 100644 index 423afa435..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/OOPWaveParticles.pde +++ /dev/null @@ -1,32 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Sine Wave - -// Two wave objects -Wave wave0; -Wave wave1; - -void setup() { - size(640,360); - // Initialize a wave with starting point, width, amplitude, and period - wave0 = new Wave(new PVector(200,75),100,20,500); - wave1 = new Wave(new PVector(150,250),300,40,220); - -} - -void draw() { - background(255); - - // Update and display waves - wave0.calculate(); - wave0.display(); - - wave1.calculate(); - wave1.display(); - - -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/Particle.pde b/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/Particle.pde deleted file mode 100644 index d04daea97..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/Particle.pde +++ /dev/null @@ -1,23 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Particle { - PVector location; - - Particle() { - location = new PVector(); - } - - void setLocation(float x, float y) { - location.x = x; - location.y = y; - } - - void display() { - fill(random(255)); - ellipse(location.x,location.y,16,16); - } - - -} diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/Wave.pde b/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/Wave.pde deleted file mode 100644 index 9763ba892..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/Wave.pde +++ /dev/null @@ -1,56 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Wave { - - int xspacing = 8; // How far apart should each horizontal location be spaced - int w; // Width of entire wave - - PVector origin; // Where does the wave's first point start - float theta = 0.0; // Start angle at 0 - float amplitude; // Height of wave - float period; // How many pixels before the wave repeats - float dx; // Value for incrementing X, to be calculated as a function of period and xspacing - //float[] yvalues; // Using an array to store height values for the wave (not entirely necessary) - Particle[] particles; - - Wave(PVector o, int w_, float a, float p) { - origin = o.get(); - w = w_; - period = p; - amplitude = a; - dx = (TWO_PI / period) * xspacing; - particles = new Particle[w/xspacing]; - for (int i = 0; i < particles.length; i++) { - particles[i] = new Particle(); - } - } - - - void calculate() { - // Increment theta (try different values for 'angular velocity' here - theta += 0.02; - - // For every x value, calculate a y value with sine function - float x = theta; - for (int i = 0; i < particles.length; i++) { - particles[i].setLocation(origin.x+i*xspacing,origin.y+sin(x)*amplitude); - x+=dx; - } - } - - void manipulate() { - // Loop through the array of particles and check stuff regarding the mouse - - } - - void display() { - - // A simple way to draw the wave with an ellipse at each location - for (int i = 0; i < particles.length; i++) { - particles[i].display(); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/CircleVsBlob.pde b/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/CircleVsBlob.pde deleted file mode 100644 index a81a4ed84..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/CircleVsBlob.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -void setup() { - size(200,200); - PImage img = loadImage("texture.png"); - background(0); - image(img,0,0,width,height); - save("blob.tif"); - - background(0); - fill(255); - noStroke(); - ellipse(100,100,width,height); - save("circle.tif"); -} - -void draw() { - - -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/blob.tif b/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/blob.tif deleted file mode 100644 index 62b3058e4..000000000 Binary files a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/blob.tif and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/circle.tif b/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/circle.tif deleted file mode 100644 index 101ae8775..000000000 Binary files a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/circle.tif and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/data/texture.gif b/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/data/texture.gif deleted file mode 100644 index 17e84e806..000000000 Binary files a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/data/texture.gif and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/data/texture.psd b/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/data/texture.psd deleted file mode 100644 index 8208feb02..000000000 Binary files a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/data/texture.psd and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/Exercise_4_03_MovingParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/Exercise_4_03_MovingParticleSystem.pde deleted file mode 100644 index 3e26041b4..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/Exercise_4_03_MovingParticleSystem.pde +++ /dev/null @@ -1,26 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; - -void setup() { - size(640,360); - ps = new ParticleSystem(new PVector(width/2,50)); -} - -void draw() { - background(255); - - // Option #1 (move the Particle System origin) - ps.origin.set(mouseX,mouseY,0); - - ps.addParticle(); - ps.run(); - - // Option #2 (move the Particle System origin) - // ps.addParticle(mouseX,mouseY); - - - -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/Particle.pde deleted file mode 100644 index 12d1ef02a..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/Particle.pde +++ /dev/null @@ -1,50 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0,0.05); - velocity = new PVector(random(-1,1),random(-2,0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0,lifespan); - strokeWeight(2); - fill(127,lifespan); - ellipse(location.x,location.y,12,12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/ParticleSystem.pde deleted file mode 100644 index 264df8539..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/ParticleSystem.pde +++ /dev/null @@ -1,36 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Using Generics now! comment and annotate, etc. - -class ParticleSystem { - ArrayList particles; - PVector origin; - - ParticleSystem(PVector location) { - origin = location.get(); - particles = new ArrayList(); - } - - void addParticle() { - particles.add(new Particle(origin)); - } - - void addParticle(float x, float y) { - particles.add(new Particle(new PVector(x, y))); - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Exercise_4_04_asteroids.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Exercise_4_04_asteroids.pde deleted file mode 100644 index d0340916f..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Exercise_4_04_asteroids.pde +++ /dev/null @@ -1,41 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Chapter 3: Asteroids exercise - -// Mover object -Spaceship ship; - -void setup() { - size(640, 360); - ship = new Spaceship(); -} - -void draw() { - background(255); - - // Update location - ship.update(); - // Wrape edges - ship.wrapEdges(); - // Draw ship - ship.display(); - - - fill(0); - //text("left right arrows to turn, z to thrust",10,height-5); - - // Turn or thrust the ship depending on what key is pressed - if (keyPressed) { - if (key == CODED && keyCode == LEFT) { - ship.turn(-0.03); - } else if (key == CODED && keyCode == RIGHT) { - ship.turn(0.03); - } else if (key == 'z' || key == 'Z') { - ship.thrust(); - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Particle.pde deleted file mode 100644 index e6736696e..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Particle.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l,PVector dir) { - acceleration = dir.get(); - velocity = PVector.random2D(); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - noStroke(); - fill(127,0,0,lifespan); - ellipse(location.x,location.y,12,12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/ParticleSystem.pde deleted file mode 100644 index 0b83fa96a..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/ParticleSystem.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Using Generics now! comment and annotate, etc. - -class ParticleSystem { - ArrayList particles; - - ParticleSystem() { - particles = new ArrayList(); - } - - void addParticle(float x, float y, PVector force) { - particles.add(new Particle(new PVector(x, y),force)); - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Spaceship.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Spaceship.pde deleted file mode 100644 index bdc11f6c1..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Spaceship.pde +++ /dev/null @@ -1,110 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Chapter 3: Asteroids - -class Spaceship { - // All of our regular motion stuff - PVector location; - PVector velocity; - PVector acceleration; - - ParticleSystem ps; - - // Arbitrary damping to slow down ship - float damping = 0.995; - float topspeed = 6; - - // Variable for heading! - float heading = 0; - - // Size - float r = 16; - - // Are we thrusting (to color boosters) - boolean thrusting = false; - - Spaceship() { - location = new PVector(width/2,height/2); - velocity = new PVector(); - acceleration = new PVector(); - - ps = new ParticleSystem(); - } - - // Standard Euler integration - void update() { - velocity.add(acceleration); - velocity.mult(damping); - velocity.limit(topspeed); - location.add(velocity); - acceleration.mult(0); - - ps.run(); - } - - // Newton's law: F = M * A - void applyForce(PVector force) { - PVector f = force.get(); - //f.div(mass); // ignoring mass right now - acceleration.add(f); - } - - // Turn changes angle - void turn(float a) { - heading += a; - } - - // Apply a thrust force - void thrust() { - // Offset the angle since we drew the ship vertically - float angle = heading - PI/2; - // Polar to cartesian for force vector! - PVector force = PVector.fromAngle(angle); - force.mult(0.1); - applyForce(force); - - force.mult(-2); - ps.addParticle(location.x,location.y+r,force); - - - // To draw booster - thrusting = true; - } - - void wrapEdges() { - float buffer = r*2; - if (location.x > width + buffer) location.x = -buffer; - else if (location.x < -buffer) location.x = width+buffer; - if (location.y > height + buffer) location.y = -buffer; - else if (location.y < -buffer) location.y = height+buffer; - } - - - // Draw the ship - void display() { - stroke(0); - strokeWeight(2); - pushMatrix(); - translate(location.x,location.y+r); - rotate(heading); - fill(175); - if (thrusting) fill(255,0,0); - // Booster rockets - rect(-r/2,r,r/3,r/2); - rect(r/2,r,r/3,r/2); - fill(175); - // A triangle - beginShape(); - vertex(-r,r); - vertex(0,-r); - vertex(r,r); - endShape(CLOSE); - rectMode(CENTER); - popMatrix(); - - thrusting = false; - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/Exercise_4_06_Shatter.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/Exercise_4_06_Shatter.pde deleted file mode 100644 index f7026ae40..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/Exercise_4_06_Shatter.pde +++ /dev/null @@ -1,21 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; - -void setup() { - size(640,360); - ps = new ParticleSystem(100,100,5); -} - -void draw() { - background(255); - - ps.display(); - ps.update(); -} - -void mousePressed() { - ps.shatter(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/Particle.pde deleted file mode 100644 index d160a42c8..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/Particle.pde +++ /dev/null @@ -1,54 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - float r; - - Particle(float x, float y, float r_) { - acceleration = new PVector(0,0.01); - velocity = PVector.random2D(); - velocity.mult(0.5); - location = new PVector(x,y); - lifespan = 255.0; - r = r_; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0); - fill(0); - rectMode(CENTER); - rect(location.x,location.y,r,r); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/ParticleSystem.pde deleted file mode 100644 index 611b1218b..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/ParticleSystem.pde +++ /dev/null @@ -1,45 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Using Generics now! comment and annotate, etc. - -class ParticleSystem { - ArrayList particles; - - int rows = 20; - int cols = 20; - - boolean intact = true; - - ParticleSystem(float x, float y, float r) { - particles = new ArrayList(); - - for (int i = 0; i < rows*cols; i++) { - addParticle(x + (i%cols)*r, y + (i/rows)*r, r); - } - } - - void addParticle(float x, float y, float r) { - particles.add(new Particle(x, y, r)); - } - - void display() { - for (Particle p : particles) { - p.display(); - } - } - - void shatter() { - intact = false; - } - - void update() { - if (!intact) { - for (Particle p : particles) { - p.update(); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/Exercise_4_10_particleintersection.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/Exercise_4_10_particleintersection.pde deleted file mode 100644 index d27427366..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/Exercise_4_10_particleintersection.pde +++ /dev/null @@ -1,18 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; - -void setup() { - size(640,360); - ps = new ParticleSystem(new PVector(width/2,50)); -} - -void draw() { - background(255); - ps.addParticle(mouseX,mouseY); - ps.update(); - ps.intersection(); - ps.display(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/Particle.pde deleted file mode 100644 index 90c4dec0c..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/Particle.pde +++ /dev/null @@ -1,73 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - float r = 6; - boolean highlight; - - Particle(float x, float y) { - acceleration = new PVector(0, 0.05); - velocity = new PVector(random(-1, 1), random(-2, 0)); - location = new PVector(x, y); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - void intersects(ArrayList particles) { - highlight = false; - for (Particle other : particles) { - if (other != this) { - float d = PVector.dist(other.location, location); - if (d < r + other.r) { - highlight = true; - } - } - } - } - - void applyForce(PVector f) { - acceleration.add(f); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0, lifespan); - strokeWeight(2); - fill(127, lifespan); - if (highlight) { - fill(127,0,0); - } - ellipse(location.x, location.y, r*2, r*2); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/ParticleSystem.pde deleted file mode 100644 index 3b3367656..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/ParticleSystem.pde +++ /dev/null @@ -1,43 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Using Generics now! comment and annotate, etc. - -class ParticleSystem { - ArrayList particles; - - ParticleSystem(PVector location) { - particles = new ArrayList(); - } - - void addParticle(float x, float y) { - particles.add(new Particle(x, y)); - } - - - void display() { - for (Particle p : particles) { - p.display(); - } - } - - void intersection() { - for (Particle p : particles) { - p.intersects(particles); - } - } - - - void update() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.update(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/Exercise_4_10_particlerepel.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/Exercise_4_10_particlerepel.pde deleted file mode 100644 index 408ce3edd..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/Exercise_4_10_particlerepel.pde +++ /dev/null @@ -1,21 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; - -void setup() { - size(640,360); - ps = new ParticleSystem(new PVector(width/2,50)); -} - -void draw() { - background(255); - ps.addParticle(random(width),random(height)); - - //PVector gravity = new PVector(0,0.1); - //ps.applyForce(gravity); - ps.update(); - ps.intersection(); - ps.display(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/Particle.pde deleted file mode 100644 index dcd577cec..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/Particle.pde +++ /dev/null @@ -1,70 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - float r = 6; - - - Particle(float x, float y) { - acceleration = new PVector(); - velocity = PVector.random2D(); - location = new PVector(x, y); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - void intersects(ArrayList particles) { - for (Particle other : particles) { - if (other != this) { - PVector dir = PVector.sub(location, other.location); - if (dir.mag() < r*2) { - dir.setMag(0.5); - applyForce(dir); - } - } - } - } - - void applyForce(PVector f) { - acceleration.add(f); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - lifespan -= 0.5; - } - - // Method to display - void display() { - stroke(0, lifespan); - strokeWeight(2); - fill(127, lifespan); - ellipse(location.x, location.y, r*2, r*2); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/ParticleSystem.pde deleted file mode 100644 index 4168dc229..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/ParticleSystem.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Using Generics now! comment and annotate, etc. - -class ParticleSystem { - ArrayList particles; - - ParticleSystem(PVector location) { - particles = new ArrayList(); - } - - void addParticle(float x, float y) { - particles.add(new Particle(x, y)); - } - - - void display() { - for (Particle p : particles) { - p.display(); - } - } - - void applyForce(PVector f) { - for (Particle p : particles) { - p.applyForce(f); - } - } - - void intersection() { - for (Particle p : particles) { - p.intersects(particles); - } - } - - - void update() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.update(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/Exercise_4_12_ArrayofImages.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/Exercise_4_12_ArrayofImages.pde deleted file mode 100644 index dbc8ac3c5..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/Exercise_4_12_ArrayofImages.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Array of Images for particle textures - -ParticleSystem ps; - -PImage[] imgs; - -void setup() { - size(640, 360, P2D); - - imgs = new PImage[5]; - imgs[0] = loadImage("corona.png"); - imgs[1] = loadImage("emitter.png"); - imgs[2] = loadImage("particle.png"); - imgs[3] = loadImage("texture.png"); - imgs[4] = loadImage("reflection.png"); - - ps = new ParticleSystem(imgs, new PVector(width/2, 50)); -} - -void draw() { - - // Additive blending! - blendMode(ADD); - - background(0); - - PVector up = new PVector(0,-0.2); - ps.applyForce(up); - - ps.run(); - for (int i = 0; i < 5; i++) { - ps.addParticle(mouseX,mouseY); - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/Particle.pde deleted file mode 100644 index adb3431f3..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/Particle.pde +++ /dev/null @@ -1,59 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector loc; - PVector vel; - PVector acc; - float lifespan; - - PImage img; - - // Another constructor (the one we are using here) - Particle(float x, float y, PImage img_) { - // Boring example with constant acceleration - acc = new PVector(0, 0); - vel = PVector.random2D(); - loc = new PVector(x, y); - lifespan = 255; - img = img_; - } - - void run() { - update(); - render(); - } - - void applyForce(PVector f) { - acc.add(f); - } - - // Method to update location - void update() { - vel.add(acc); - loc.add(vel); - acc.mult(0); - lifespan -= 2.0; - } - - // Method to display - void render() { - imageMode(CENTER); - tint(lifespan); - image(img, loc.x, loc.y, 32, 32); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan <= 0.0) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/ParticleSystem.pde deleted file mode 100644 index 98208b71e..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/ParticleSystem.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A class to describe a group of Particles -// An ArrayList is used to manage the list of Particles - -class ParticleSystem { - - ArrayList particles; // An arraylist for all the particles - - PImage[] textures; - - ParticleSystem(PImage[] imgs, PVector v) { - textures = imgs; - particles = new ArrayList(); // Initialize the arraylist - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } - - void addParticle(float x, float y) { - int r = int(random(textures.length)); - particles.add(new Particle(x,y,textures[r])); - } - - - void applyForce(PVector f) { - for (Particle p : particles) { - p.applyForce(f); - } - } - - void addParticle(Particle p) { - particles.add(p); - } - - // A method to test if the particle system still has particles - boolean dead() { - if (particles.isEmpty()) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/data/texture.psd b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/data/texture.psd deleted file mode 100644 index d532f15aa..000000000 Binary files a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/data/texture.psd and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle/NOC_4_01_SingleParticle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle/NOC_4_01_SingleParticle.pde deleted file mode 100644 index 1ab939148..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle/NOC_4_01_SingleParticle.pde +++ /dev/null @@ -1,25 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Particle p; - -void setup() { - size(800,200); - p = new Particle(new PVector(width/2,20)); - background(255); - smooth(); -} - -void draw() { - background(255); - - p.run(); - if (p.isDead()) { - p = new Particle(new PVector(width/2,20)); - //println("Particle dead!"); - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle/Particle.pde deleted file mode 100644 index ca927c34a..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle/Particle.pde +++ /dev/null @@ -1,52 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -// A simple Particle class - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0, 0.05); - velocity = new PVector(random(-1, 1), random(-1, 0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0, lifespan); - strokeWeight(2); - fill(127, lifespan); - ellipse(location.x, location.y, 12, 12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle_trail/NOC_4_01_SingleParticle_trail.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle_trail/NOC_4_01_SingleParticle_trail.pde deleted file mode 100644 index e372ea14e..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle_trail/NOC_4_01_SingleParticle_trail.pde +++ /dev/null @@ -1,27 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Particle p; - -void setup() { - size(800, 200); - p = new Particle(new PVector(width/2, 20)); - background(255); - smooth(); -} - -void draw() { - if (mousePressed) { - noStroke(); - fill(255, 5); - rect(0, 0, width, height); - - p.run(); - if (p.isDead()) { - println("Particle dead!"); - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle_trail/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle_trail/Particle.pde deleted file mode 100644 index 5e78f8545..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle_trail/Particle.pde +++ /dev/null @@ -1,50 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0, 0.05); - velocity = new PVector(random(-1, 1), -1); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0, lifespan); - strokeWeight(2); - fill(127); - ellipse(location.x, location.y, 12, 12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_02_ArrayListParticles/NOC_4_02_ArrayListParticles.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_02_ArrayListParticles/NOC_4_02_ArrayListParticles.pde deleted file mode 100644 index c0820f600..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_02_ArrayListParticles/NOC_4_02_ArrayListParticles.pde +++ /dev/null @@ -1,29 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ArrayList particles; - -void setup() { - size(640,360); - particles = new ArrayList(); -} - -void draw() { - background(255); - - particles.add(new Particle(new PVector(width/2,50))); - - // Looping through backwards to delete - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } -} - - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_02_ArrayListParticles/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_02_ArrayListParticles/Particle.pde deleted file mode 100644 index a4c372ac4..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_02_ArrayListParticles/Particle.pde +++ /dev/null @@ -1,50 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0, 0.05); - velocity = new PVector(random(-1, 1), random(-2, 0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0, lifespan); - strokeWeight(2); - fill(127, lifespan); - ellipse(location.x, location.y, 12, 12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/NOC_4_03_ParticleSystemClass.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/NOC_4_03_ParticleSystemClass.pde deleted file mode 100644 index 935a214da..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/NOC_4_03_ParticleSystemClass.pde +++ /dev/null @@ -1,16 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; - -void setup() { - size(640,360); - ps = new ParticleSystem(new PVector(width/2,50)); -} - -void draw() { - background(255); - ps.addParticle(); - ps.run(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/Particle.pde deleted file mode 100644 index 12d1ef02a..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/Particle.pde +++ /dev/null @@ -1,50 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0,0.05); - velocity = new PVector(random(-1,1),random(-2,0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0,lifespan); - strokeWeight(2); - fill(127,lifespan); - ellipse(location.x,location.y,12,12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/ParticleSystem.pde deleted file mode 100644 index ffddfc873..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/ParticleSystem.pde +++ /dev/null @@ -1,33 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Using Generics now! comment and annotate, etc. - -class ParticleSystem { - ArrayList particles; - PVector origin; - - ParticleSystem(PVector location) { - origin = location.get(); - particles = new ArrayList(); - } - - void addParticle() { - particles.add(new Particle(origin)); - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/NOC_4_04_SystemofSystems.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/NOC_4_04_SystemofSystems.pde deleted file mode 100644 index 2fe6ee428..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/NOC_4_04_SystemofSystems.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Simple Particle System - -// Particles are generated each cycle through draw(), -// fall with gravity and fade out over time -// A ParticleSystem object manages a variable size (ArrayList) -// list of particles. - -ArrayList systems; - -void setup() { - size(640,360); - systems = new ArrayList(); -} - -void draw() { - background(255); - for (ParticleSystem ps: systems) { - ps.run(); - ps.addParticle(); - } - - fill(0); - text("click mouse to add particle systems",10,height-30); -} - -void mousePressed() { - systems.add(new ParticleSystem(1,new PVector(mouseX,mouseY))); -} - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/Particle.pde deleted file mode 100644 index 12d1ef02a..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/Particle.pde +++ /dev/null @@ -1,50 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0,0.05); - velocity = new PVector(random(-1,1),random(-2,0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0,lifespan); - strokeWeight(2); - fill(127,lifespan); - ellipse(location.x,location.y,12,12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/ParticleSystem.pde deleted file mode 100644 index 06f1ff3a9..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/ParticleSystem.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -// A class to describe a group of Particles -// An ArrayList is used to manage the list of Particles - -class ParticleSystem { - - ArrayList particles; // An arraylist for all the particles - PVector origin; // An origin point for where particles are birthed - - ParticleSystem(int num, PVector v) { - particles = new ArrayList(); // Initialize the arraylist - origin = v.get(); // Store the origin point - for (int i = 0; i < num; i++) { - particles.add(new Particle(origin)); // Add "num" amount of particles to the arraylist - } - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } - - void addParticle() { - particles.add(new Particle(origin)); - } - - // A method to test if the particle system still has particles - boolean dead() { - if (particles.isEmpty()) { - return true; - } - else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/Confetti.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/Confetti.pde deleted file mode 100644 index e86ce8d5b..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/Confetti.pde +++ /dev/null @@ -1,29 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Confetti extends Particle { - - // We could add variables for only Confetti here if we so - - Confetti(PVector l) { - super(l); - } - - // Inherits update() from parent - - // Override the display method - void display() { - rectMode(CENTER); - fill(127,lifespan); - stroke(0,lifespan); - strokeWeight(2); - pushMatrix(); - translate(location.x,location.y); - float theta = map(location.x,0,width,0,TWO_PI*2); - rotate(theta); - rect(0,0,12,12); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/NOC_4_05_ParticleSystemInheritancePolymorphism.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/NOC_4_05_ParticleSystemInheritancePolymorphism.pde deleted file mode 100644 index 935a214da..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/NOC_4_05_ParticleSystemInheritancePolymorphism.pde +++ /dev/null @@ -1,16 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; - -void setup() { - size(640,360); - ps = new ParticleSystem(new PVector(width/2,50)); -} - -void draw() { - background(255); - ps.addParticle(); - ps.run(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/Particle.pde deleted file mode 100644 index b38b30cf7..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/Particle.pde +++ /dev/null @@ -1,51 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0,0.05); - velocity = new PVector(random(-1,1),random(-2,0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0,lifespan); - strokeWeight(2); - fill(127,lifespan); - ellipse(location.x,location.y,12,12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/ParticleSystem.pde deleted file mode 100644 index 28fde7c2e..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/ParticleSystem.pde +++ /dev/null @@ -1,36 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class ParticleSystem { - ArrayList particles; - PVector origin; - - ParticleSystem(PVector location) { - origin = location.get(); - particles = new ArrayList(); - } - - void addParticle() { - float r = random(1); - if (r < 0.5) { - particles.add(new Particle(origin)); - } - else { - particles.add(new Confetti(origin)); - } - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/NOC_4_06_ParticleSystemForces.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/NOC_4_06_ParticleSystemForces.pde deleted file mode 100644 index eef4c0555..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/NOC_4_06_ParticleSystemForces.pde +++ /dev/null @@ -1,21 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; - -void setup() { - size(640,360); - ps = new ParticleSystem(new PVector(width/2,50)); -} - -void draw() { - background(255); - - // Apply gravity force to all Particles - PVector gravity = new PVector(0,0.1); - ps.applyForce(gravity); - - ps.addParticle(); - ps.run(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/Particle.pde deleted file mode 100644 index 971ea0c5c..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/Particle.pde +++ /dev/null @@ -1,56 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - float mass = 1; // Let's do something better here! - - Particle(PVector l) { - acceleration = new PVector(0,0); - velocity = new PVector(random(-1,1),random(-2,0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - void applyForce(PVector force) { - PVector f = force.get(); - f.div(mass); - acceleration.add(f); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0,lifespan); - strokeWeight(2); - fill(127,lifespan); - ellipse(location.x,location.y,12,12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/ParticleSystem.pde deleted file mode 100644 index c840ffd5b..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/ParticleSystem.pde +++ /dev/null @@ -1,35 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class ParticleSystem { - ArrayList particles; - PVector origin; - - ParticleSystem(PVector location) { - origin = location.get(); - particles = new ArrayList(); - } - - void addParticle() { - particles.add(new Particle(origin)); - } - - // A function to apply a force to all Particles - void applyForce(PVector f) { - for (Particle p: particles) { - p.applyForce(f); - } - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/NOC_4_07_ParticleSystemForcesRepeller.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/NOC_4_07_ParticleSystemForcesRepeller.pde deleted file mode 100644 index c7de70143..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/NOC_4_07_ParticleSystemForcesRepeller.pde +++ /dev/null @@ -1,26 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; -Repeller repeller; - -void setup() { - size(640,360); - ps = new ParticleSystem(new PVector(width/2,50)); - repeller = new Repeller(width/2-20,height/2); -} - -void draw() { - background(255); - ps.addParticle(); - - // Apply gravity force to all Particles - PVector gravity = new PVector(0,0.1); - ps.applyForce(gravity); - - ps.applyRepeller(repeller); - - repeller.display(); - ps.run(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/Particle.pde deleted file mode 100644 index 971ea0c5c..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/Particle.pde +++ /dev/null @@ -1,56 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - float mass = 1; // Let's do something better here! - - Particle(PVector l) { - acceleration = new PVector(0,0); - velocity = new PVector(random(-1,1),random(-2,0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - void applyForce(PVector force) { - PVector f = force.get(); - f.div(mass); - acceleration.add(f); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0,lifespan); - strokeWeight(2); - fill(127,lifespan); - ellipse(location.x,location.y,12,12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/ParticleSystem.pde deleted file mode 100644 index d4ad80fa7..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/ParticleSystem.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class ParticleSystem { - ArrayList particles; - PVector origin; - - ParticleSystem(PVector location) { - origin = location.get(); - particles = new ArrayList(); - } - - void addParticle() { - particles.add(new Particle(origin)); - } - - // A function to apply a force to all Particles - void applyForce(PVector f) { - for (Particle p: particles) { - p.applyForce(f); - } - } - - void applyRepeller(Repeller r) { - for (Particle p: particles) { - PVector force = r.repel(p); - p.applyForce(force); - } - } - - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/Repeller.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/Repeller.pde deleted file mode 100644 index 351780121..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/Repeller.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Particles + Forces - -// A very basic Repeller class -class Repeller { - - // Gravitational Constant - float G = 100; - // Location - PVector location; - float r = 10; - - Repeller(float x, float y) { - location = new PVector(x,y); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(175); - ellipse(location.x,location.y,48,48); - } - - // Calculate a force to push particle away from repeller - PVector repel(Particle p) { - PVector dir = PVector.sub(location,p.location); // Calculate direction of force - float d = dir.mag(); // Distance between objects - dir.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction) - d = constrain(d,5,100); // Keep distance within a reasonable range - float force = -1 * G / (d * d); // Repelling force is inversely proportional to distance - dir.mult(force); // Get force vector --> magnitude * direction - return dir; - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/NOC_4_08_ParticleSystemSmoke.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/NOC_4_08_ParticleSystemSmoke.pde deleted file mode 100644 index fb11356e4..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/NOC_4_08_ParticleSystemSmoke.pde +++ /dev/null @@ -1,54 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Smoke Particle System - -// A basic smoke effect using a particle system -// Each particle is rendered as an alpha masked image - -/* @pjs preload="processingjs/chapter04/_4_08_ParticleSystemSmoke/data/texture.png"; */ - -ParticleSystem ps; - -void setup() { - size(640,360); - PImage img = loadImage("texture.png"); - ps = new ParticleSystem(0,new PVector(width/2,height-75),img); -} - -void draw() { - background(0); - - // Calculate a "wind" force based on mouse horizontal position - float dx = map(mouseX,0,width,-0.2,0.2); - PVector wind = new PVector(dx,0); - ps.applyForce(wind); - ps.run(); - for (int i = 0; i < 2; i++) { - ps.addParticle(); - } - - // Draw an arrow representing the wind force - drawVector(wind, new PVector(width/2,50,0),500); - -} - -// Renders a vector object 'v' as an arrow and a location 'loc' -void drawVector(PVector v, PVector loc, float scayl) { - pushMatrix(); - float arrowsize = 4; - // Translate to location to render vector - translate(loc.x,loc.y); - stroke(255); - // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate - rotate(v.heading2D()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) - line(0,0,len,0); - line(len,0,len-arrowsize,+arrowsize/2); - line(len,0,len-arrowsize,-arrowsize/2); - popMatrix(); -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/Particle.pde deleted file mode 100644 index b3dce76be..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/Particle.pde +++ /dev/null @@ -1,61 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Particle { - PVector loc; - PVector vel; - PVector acc; - float lifespan; - PImage img; - - Particle(PVector l,PImage img_) { - acc = new PVector(0,0); - float vx = randomGaussian()*0.3; - float vy = randomGaussian()*0.3 - 1.0; - vel = new PVector(vx,vy); - loc = l.get(); - lifespan = 100.0; - img = img_; - } - - void run() { - update(); - render(); - } - - // Method to apply a force vector to the Particle object - // Note we are ignoring "mass" here - void applyForce(PVector f) { - acc.add(f); - } - - // Method to update location - void update() { - vel.add(acc); - loc.add(vel); - lifespan -= 2.5; - acc.mult(0); // clear Acceleration - } - - // Method to display - void render() { - imageMode(CENTER); - tint(255,lifespan); - image(img,loc.x,loc.y); - // Drawing a circle instead - // fill(255,lifespan); - // noStroke(); - // ellipse(loc.x,loc.y,img.width,img.height); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan <= 0.0) { - return true; - } else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/ParticleSystem.pde deleted file mode 100644 index 93fee68fa..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/ParticleSystem.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Smoke Particle System - -// A class to describe a group of Particles -// An ArrayList is used to manage the list of Particles - -class ParticleSystem { - - ArrayList particles; // An arraylist for all the particles - PVector origin; // An origin point for where particles are birthed - PImage img; - - ParticleSystem(int num, PVector v, PImage img_) { - particles = new ArrayList(); // Initialize the arraylist - origin = v.get(); // Store the origin point - img = img_; - for (int i = 0; i < num; i++) { - particles.add(new Particle(origin, img)); // Add "num" amount of particles to the arraylist - } - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } - - // Method to add a force vector to all particles currently in the system - void applyForce(PVector dir) { - // Enhanced loop!!! - for (Particle p: particles) { - p.applyForce(dir); - } - } - - void addParticle() { - particles.add(new Particle(origin, img)); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/data/texture.psd b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/data/texture.psd deleted file mode 100644 index 8208feb02..000000000 Binary files a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/data/texture.psd and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/NOC_4_08_ParticleSystemSmoke_b.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/NOC_4_08_ParticleSystemSmoke_b.pde deleted file mode 100644 index 52e945c60..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/NOC_4_08_ParticleSystemSmoke_b.pde +++ /dev/null @@ -1,59 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Smoke Particle System - -// A basic smoke effect using a particle system -// Each particle is rendered as an alpha masked image - -/* @pjs preload="processingjs/chapter04/_4_08_ParticleSystemSmoke/data/texture.png"; */ - -import java.util.Random; - -ParticleSystem ps; -Random generator; - -void setup() { - size(640,360); - generator = new Random(); - PImage img = loadImage("texture.png"); - ps = new ParticleSystem(0,new PVector(width/2,height-75),img); - smooth(); -} - -void draw() { - background(0); - - // Calculate a "wind" force based on mouse horizontal position - float dx = map(mouseX,0,width,-0.2,0.2); - PVector wind = new PVector(dx,0); - ps.applyForce(wind); - ps.run(); - for (int i = 0; i < 2; i++) { - ps.addParticle(); - } - - // Draw an arrow representing the wind force - drawVector(wind, new PVector(width/2,50,0),500); - -} - -// Renders a vector object 'v' as an arrow and a location 'loc' -void drawVector(PVector v, PVector loc, float scayl) { - pushMatrix(); - float arrowsize = 4; - // Translate to location to render vector - translate(loc.x,loc.y); - stroke(255); - // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate - rotate(v.heading2D()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) - line(0,0,len,0); - line(len,0,len-arrowsize,+arrowsize/2); - line(len,0,len-arrowsize,-arrowsize/2); - popMatrix(); -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/Particle.pde deleted file mode 100644 index c5516d104..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/Particle.pde +++ /dev/null @@ -1,64 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Simple Particle System - -// A simple Particle class, renders the particle as an image - -class Particle { - PVector loc; - PVector vel; - PVector acc; - float lifespan; - PImage img; - - Particle(PVector l,PImage img_) { - acc = new PVector(0,0); - float vx = (float) generator.nextGaussian()*0.3; - float vy = (float) generator.nextGaussian()*0.3 - 1.0; - vel = new PVector(vx,vy); - loc = l.get(); - lifespan = 100.0; - img = img_; - } - - void run() { - update(); - render(); - } - - // Method to apply a force vector to the Particle object - // Note we are ignoring "mass" here - void applyForce(PVector f) { - acc.add(f); - } - - // Method to update location - void update() { - vel.add(acc); - loc.add(vel); - lifespan -= 2.5; - acc.mult(0); // clear Acceleration - } - - // Method to display - void render() { - //imageMode(CENTER); - //tint(255,lifespan); - //image(img,loc.x,loc.y); - // Drawing a circle instead - fill(255,lifespan); - noStroke(); - ellipse(loc.x,loc.y,img.width,img.height); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan <= 0.0) { - return true; - } else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/ParticleSystem.pde deleted file mode 100644 index 43296a098..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/ParticleSystem.pde +++ /dev/null @@ -1,63 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Smoke Particle Syste - -// A class to describe a group of Particles -// An ArrayList is used to manage the list of Particles - -class ParticleSystem { - - ArrayList particles; // An arraylist for all the particles - PVector origin; // An origin point for where particles are birthed - PImage img; - - ParticleSystem(int num, PVector v, PImage img_) { - particles = new ArrayList(); // Initialize the arraylist - origin = v.get(); // Store the origin point - img = img_; - for (int i = 0; i < num; i++) { - particles.add(new Particle(origin, img)); // Add "num" amount of particles to the arraylist - } - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } - - // Method to add a force vector to all particles currently in the system - void applyForce(PVector dir) { - // Enhanced loop!!! - for (Particle p: particles) { - p.applyForce(dir); - } - - } - - void addParticle() { - particles.add(new Particle(origin,img)); - } - - void addParticle(Particle p) { - particles.add(p); - } - - // A method to test if the particle system still has particles - boolean dead() { - if (particles.isEmpty()) { - return true; - } else { - return false; - } - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/data/texture.psd b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/data/texture.psd deleted file mode 100644 index 8208feb02..000000000 Binary files a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/data/texture.psd and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/NOC_4_09_AdditiveBlending.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/NOC_4_09_AdditiveBlending.pde deleted file mode 100644 index d0341315f..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/NOC_4_09_AdditiveBlending.pde +++ /dev/null @@ -1,37 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Additive Blending - -// This example demonstrates a "glow" like effect using -// additive blending with a Particle system. By playing -// with colors, textures, etc. you can achieve a variety -// of looks. - -ParticleSystem ps; - -PImage img; - -void setup() { - size(640, 360, P2D); - - // Create an alpha masked image to be applied as the particle's texture - img = loadImage("texture.png"); - - ps = new ParticleSystem(0, new PVector(width/2, 50)); -} - -void draw() { - - // Additive blending! - blendMode(ADD); - - background(0); - - ps.run(); - for (int i = 0; i < 10; i++) { - ps.addParticle(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/Particle.pde deleted file mode 100644 index d9853841b..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/Particle.pde +++ /dev/null @@ -1,52 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector loc; - PVector vel; - PVector acc; - float lifespan; - - // Another constructor (the one we are using here) - Particle(PVector l) { - // Boring example with constant acceleration - acc = new PVector(0,0.05,0); - vel = new PVector(random(-1,1),random(-1,0),0); - vel.mult(2); - loc = l.get(); - lifespan = 255; - } - - void run() { - update(); - render(); - } - - // Method to update location - void update() { - vel.add(acc); - loc.add(vel); - lifespan -= 2.0; - } - - // Method to display - void render() { - imageMode(CENTER); - tint(lifespan); - image(img,loc.x,loc.y); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan <= 0.0) { - return true; - } else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/ParticleSystem.pde deleted file mode 100644 index 208bd5418..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/ParticleSystem.pde +++ /dev/null @@ -1,52 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A class to describe a group of Particles -// An ArrayList is used to manage the list of Particles - -class ParticleSystem { - - ArrayList particles; // An arraylist for all the particles - PVector origin; // An origin point for where particles are birthed - - PImage tex; - - ParticleSystem(int num, PVector v) { - particles = new ArrayList(); // Initialize the arraylist - origin = v.get(); // Store the origin point - for (int i = 0; i < num; i++) { - particles.add(new Particle(origin)); // Add "num" amount of particles to the arraylist - } - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } - - void addParticle() { - particles.add(new Particle(origin)); - } - - void addParticle(Particle p) { - particles.add(p); - } - - // A method to test if the particle system still has particles - boolean dead() { - if (particles.isEmpty()) { - return true; - } - else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/data/texture.psd b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/data/texture.psd deleted file mode 100644 index d532f15aa..000000000 Binary files a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/data/texture.psd and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/Particle.pde deleted file mode 100644 index bc2e58cb3..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/Particle.pde +++ /dev/null @@ -1,61 +0,0 @@ -// Simple Particle System -// Daniel Shiffman - -// A simple Particle class - -class Particle { - - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0,0.05); - velocity = new PVector(random(-1,1),random(-2,0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - push(); - display(); - pop(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - - void push() { - pushMatrix(); - } - - void pop() { - popMatrix(); - } - - // Method to display - void display() { - stroke(0,lifespan); - fill(0,lifespan); - translate(location.x,location.y); - ellipse(0,0,8,8); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleChild.pde b/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleChild.pde deleted file mode 100644 index 95b089aa3..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleChild.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class ParticleChild extends Particle { - - // We could add variables for only Confetti here if we so - - ParticleChild(PVector l) { - super(l); - } - - // Inherits update() from parent - - // Override the display method - void display() { - super.display(); - float theta = map(location.x,0,width,0,TWO_PI*2); - rotate(theta); - stroke(0); - line(0,0,50,0); - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleSystem.pde deleted file mode 100644 index 3e439bd84..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleSystem.pde +++ /dev/null @@ -1,36 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class ParticleSystem { - ArrayList particles; - PVector origin; - - ParticleSystem(PVector location) { - origin = location.get(); - particles = new ArrayList(); - } - - void addParticle() { - float r = random(1); - if (r < 0.5) { - particles.add(new Particle(origin)); - } - else { - particles.add(new ParticleChild(origin)); - } - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleSystemInheritance_pushpop.pde b/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleSystemInheritance_pushpop.pde deleted file mode 100644 index 935a214da..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleSystemInheritance_pushpop.pde +++ /dev/null @@ -1,16 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; - -void setup() { - size(640,360); - ps = new ParticleSystem(new PVector(width/2,50)); -} - -void draw() { - background(255); - ps.addParticle(); - ps.run(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/NOC_gl.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/NOC_gl.pde deleted file mode 100755 index f96fc9d07..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/NOC_gl.pde +++ /dev/null @@ -1,13 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -void renderImage(PImage img, Vec3D _loc, float _diam, color _col, float _alpha ) { - pushMatrix(); - translate( _loc.x, _loc.y, _loc.z ); - tint(red(_col), green(_col), blue(_col), _alpha); - imageMode(CENTER); - image(img,0,0,_diam,_diam); - popMatrix(); -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/emitter.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/emitter.pde deleted file mode 100755 index 0e6eb38fe..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/emitter.pde +++ /dev/null @@ -1,89 +0,0 @@ - -/* -The emitter is just an object that follows the cursor and -can spawn new particle objects. It would be easier to just make -the location vector match the cursor position but I have opted -to use a velocity vector because later I will be allowing for -multiple emitters. -*/ - -class Emitter{ - Vec3D loc; - Vec3D vel; - Vec3D velToMouse; - - color myColor; - - ArrayList particles; - - Emitter( ){ - loc = new Vec3D(); - vel = new Vec3D(); - velToMouse = new Vec3D(); - - myColor = color( 1, 1, 1 ); - - particles = new ArrayList(); - } - - void exist(){ - setVelToMouse(); - findVelocity(); - setPosition(); - iterateListExist(); - render(); - - pgl.disable( PGL.TEXTURE_2D ); - - if( ALLOWTRAILS ) - iterateListRenderTrails(); - } - - void setVelToMouse(){ - velToMouse.set( mouseX - loc.x, mouseY - loc.y, 0 ); - } - - void findVelocity(){ - vel.interpolateToSelf( velToMouse, .35 ); - } - - void setPosition(){ - loc.addSelf( vel ); - - if( ALLOWFLOOR ){ - if( loc.y > floorLevel ){ - loc.y = floorLevel; - vel.y = 0; - } - } - } - - void iterateListExist(){ - for( Iterator it = particles.iterator(); it.hasNext(); ){ - Particle p = (Particle) it.next(); - if( !p.ISDEAD ){ - p.exist(); - } else { - it.remove(); - } - } - } - - - void render(){ - renderImage( emitterImg, loc, 150, myColor, 1.0 ); - } - - void iterateListRenderTrails(){ - for( Iterator it = particles.iterator(); it.hasNext(); ){ - Particle p = (Particle) it.next(); - p.renderTrails(); - } - } - - void addParticles( int _amt ){ - for( int i=0; i<_amt; i++ ){ - particles.add( new Particle( loc, vel ) ); - } - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/flight404_particles_1_simple.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/flight404_particles_1_simple.pde deleted file mode 100644 index 549c8dccc..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/flight404_particles_1_simple.pde +++ /dev/null @@ -1,158 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Updated version of flight404 Particle Emitter release 1 -// This works with Processing 2.0 - -// February 28 2011 -// Daniel Shiffman - -// Source Code release 1 -// Particle Emitter -// -// February 11th 2008 -// -// Built with Processing v.135 which you can download at http://www.processing.org/download -// -// Robert Hodgin -// flight404.com -// barbariangroup.com - -// features: -// Toxi's magnificent Vec3D library -// perlin noise flow fields -// ribbon trails -// OpenGL additive blending -// OpenGL display lists -// -// Uses the very useful Vec3D library by Karsten Schmidt (toxi) -// You can download it at http://code.google.com/p/toxiclibs/downloads/list -// -// Please post suggestions and improvements at the flight404 blog. When nicer/faster/better -// practices are suggested, I will incorporate them into the source and repost. I think that -// will be a reasonable system for now. -// -// Future additions will include: -// Rudimentary camera movement -// Magnetic repulsion -// More textures means more iron -// -// UPDATES -// -// February 11th 2008 -// Reorganized some of the OpenGL calls as per Simon Gelfius' suggestion. -// http://www.kinesis.be/ - - -import toxi.geom.*; -import java.util.*; - -PGL pgl; - -Emitter emitter; -Vec3D gravity; -float floorLevel; - -PImage particleImg; -PImage emitterImg; - -int counter; - - -boolean ALLOWGRAVITY; // add gravity vector? -boolean ALLOWPERLIN; // add perlin noise flow field vector? -boolean ALLOWTRAILS; // render particle trails? -boolean ALLOWFLOOR; // add a floor? - // Turning on all of these options will make things - // slow down. - -void setup(){ - size( 600, 600, P3D ); - smooth(4); - // Lately I have gotten into the habit of limiting the color range to be - // 0.0 to 1.0. It works this way in OpenGL so I might as well get used to it. - colorMode( RGB, 1.0 ); - - // Turn on 4X antialiasing - //hint( ENABLE_OPENGL_4X_SMOOTH ); - - // More OpenGL necessity. - pgl = ((PGraphicsOpenGL) g).pgl; - - // Loads in a particle image from the data folder. Image size should be a power of 2. - particleImg = loadImage( "particle.png" ); - emitterImg = loadImage( "emitter.png" ); - - emitter = new Emitter(); - gravity = new Vec3D( 0, .35, 0 ); // gravity vector - floorLevel = 400; -} - -void draw(){ - background( 0.0 ); - perspective( PI/3.0, (float)width/(float)height, 1, 5000 ); - - // Turns on additive blending so we can draw a bunch of glowing images without - // needing to do any depth testing. - pgl.depthMask(false); - pgl.enable( PGL.BLEND ); - pgl.blendFunc(PGL.SRC_ALPHA, PGL.ONE); - - emitter.exist(); - - // If the mouse button is pressed, then add 10 new particles. - if( mousePressed ){ - if( ALLOWTRAILS && ALLOWFLOOR ){ - emitter.addParticles( 5 ); - } else { - emitter.addParticles( 10 ); - } - } - - counter ++; -} - - -void keyPressed(){ - if( key == 'g' || key == 'G' ) - ALLOWGRAVITY = !ALLOWGRAVITY; - - if( key == 'p' || key == 'P' ) - ALLOWPERLIN = !ALLOWPERLIN; - - if( key == 't' || key == 'T' ) - ALLOWTRAILS = !ALLOWTRAILS; - - if( key == 'f' || key == 'F' ) - ALLOWFLOOR = !ALLOWFLOOR; - -} - - -// This method should be nicer, but it isnt. I use getRads to get a perlin noise -// based angle in radians based on the x and y position of the object asking for it. -// Perlin noise is supposed to give you back a number between 0 and 1, but it wont -// necessarily give you numbers that range from 0 to 1. A usual result is more like -// .25 to .75. -// -// So the point of this method is to try to normalize the values to a -// range of 0 to 1. It's not perfect, and I still get weird results. -// For instance, the mult variable is supposed to be the multiplier for the range. -// So if i wanted a random angle between 0 and TWO_PI, I would set the mult = TWO_PI. -// But when I do that, I find the Perlin noise tends to give me a left-pointing angle. -// To counteract, I end up setting the mult to 10.0 in order to increase the chances -// that I get a nice range from at least 0 to TWO_PI. -float minNoise = 0.499; -float maxNoise = 0.501; -float getRads(float val1, float val2, float mult, float div){ - float rads = noise(val1/div, val2/div, counter/div); - - if (rads < minNoise) minNoise = rads; - if (rads > maxNoise) maxNoise = rads; - - rads -= minNoise; - rads *= 1.0/(maxNoise - minNoise); - - return rads * mult; -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/particle.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/particle.pde deleted file mode 100755 index 16441c9c5..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/particle.pde +++ /dev/null @@ -1,208 +0,0 @@ -/* -General Structure notes. - My classes tend to have a similar naming scheme and flow. I start with the 'exist' method. - Exist is what an object needs to do every frame. Usually 'existing' consists of four main things. - 1) Find the velocity. This involves determining what influences there are on the velocity. - 2) Apply the velocity to the location. - 3) Render the object. - 4) Age the object. - - I also use the metaphor of aging and death. When first made, a particle's age will be zero. - Every frame, the age will increment. If the age reaches the lifeSpan (which is a random number - that I set in the constructor), then the boolean ISDEAD is set to true and the arraylist iterator - removes the dead element from the list. - */ - - - -class Particle { - int len; // number of elements in position array - Vec3D[] loc; // array of position vectors - Vec3D startLoc; // just used to make sure every loc[] is initialized to the same position - Vec3D vel; // velocity vector - Vec3D perlin; // perlin noise vector - float radius; // particle's size - float age; // current age of particle - int lifeSpan; // max allowed age of particle - float agePer; // range from 1.0 (birth) to 0.0 (death) - float bounceAge; // amount to age particle when it bounces off floor - boolean ISDEAD; // if age == lifeSpan, make particle die - boolean ISBOUNCING; // if particle hits the floor... - - - Particle( Vec3D _loc, Vec3D _vel ) { - radius = random( 10, 40 ); - len = (int)( radius ); - loc = new Vec3D[ len ]; - - // This confusing-looking line does three things at once. - // First, you make a random vector. - // new Vec3D().randomVector() - // Next, you multiply that vector by a random number from 0.0 to 5.0. - // scaleSelf( 5.0 ); - // Finally, you add this new vector to the original sent vector. - // _loc.add( ); - // This is just a way to make sure all the particles made this frame - // don't all start on the exact same pixel. This staggering will be useful - // when we incorporate magnetic repulsion in a later tutorial. - startLoc = new Vec3D( _loc.add( new Vec3D().randomVector().scaleSelf( random( 5.0 ) ) ) ); - - for( int i=0; i floorLevel ) { - ISBOUNCING = true; - } - else { - ISBOUNCING = false; - } - } - - if( ISBOUNCING ) { - vel.scaleSelf( .75 ); - vel.y *= -.5; - } - } - - void setPosition() { - // Every frame, the current location will be passed on to - // the next element in the location array. Think 'cursor trail effect'. - for( int i=len-1; i>0; i-- ) { - loc[i].set( loc[i-1] ); - } - - // Set the initial location. - // loc[0] represents the current position of the particle. - loc[0].addSelf( vel ); - } - - void render() { - // As the particle ages, it will gain blue but will lose red and green. - color c = color( agePer, agePer*.75, 1.0 - agePer ); - renderImage(particleImg, loc[0], radius * agePer, c, 1.0 ); - } - - void renderTrails() { - float xp, yp, zp; - float xOff, yOff, zOff; - beginShape(QUAD_STRIP); - for ( int i=0; i lifeSpan ) { - ISDEAD = true; - } - else { - // When spawned, the agePer is 1.0. - // When death occurs, the agePer is 0.0. - agePer = 1.0 - age/(float)lifeSpan; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/NOC_gl.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/NOC_gl.pde deleted file mode 100644 index 2f91c0f1b..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/NOC_gl.pde +++ /dev/null @@ -1,49 +0,0 @@ - -int squareList; -void initGL(){ - pgl.beginGL(); - squareList = gl.glGenLists(1); - gl.glNewList(squareList, GL.GL_COMPILE); - gl.glBegin(GL.GL_POLYGON); - gl.glTexCoord2f(0, 0); gl.glVertex2f(-.5, -.5); - gl.glTexCoord2f(1, 0); gl.glVertex2f( .5, -.5); - gl.glTexCoord2f(1, 1); gl.glVertex2f( .5, .5); - gl.glTexCoord2f(0, 1); gl.glVertex2f(-.5, .5); - gl.glEnd(); - gl.glEndList(); - pgl.endGL(); -} - -void renderImage( Vec3D _loc, float _diam, color _col, float _alpha ){ - gl.glPushMatrix(); - gl.glTranslatef( _loc.x, -_loc.y, _loc.z ); - pov.glReverseCamera(); - gl.glScalef( _diam, _diam, _diam ); - gl.glColor4f( red(_col), green(_col), blue(_col), _alpha ); - gl.glCallList( squareList ); - gl.glPopMatrix(); -} - -// This will allow you to draw images that are oriented to the floor plane. -void renderImageOnFloor( Vec3D _loc, float _diam, color _col, float _aa ){ - gl.glPushMatrix(); - gl.glTranslatef( _loc.x, -_loc.y, _loc.z ); - gl.glScalef( _diam, _diam, _diam ); - gl.glRotatef( 90, 1.0, 0.0, 0.0 ); - gl.glColor4f( red(_col), green(_col), blue(_col), _aa ); - gl.glCallList( squareList ); - gl.glPopMatrix(); -} - -// This will allow you to specify a rotation for images that are oriented perpendicular to the eyeNormal -// which is the vector pointing from the camera's eye to the camera's point of interest. -void renderImageAndRotate( Vec3D _loc, float _diam, color _col, float _aa, float _rot ){ - gl.glPushMatrix(); - gl.glTranslatef( _loc.x, -_loc.y, _loc.z ); - gl.glRotatef( degrees( _rot ), pov.eyeNormal.x, pov.eyeNormal.y, pov.eyeNormal.z ); - pov.glReverseCamera(); - gl.glScalef( _diam, _diam, _diam ); - gl.glColor4f( red(_col), green(_col), blue(_col), _aa ); - gl.glCallList( squareList ); - gl.glPopMatrix(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/cursor.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/cursor.pde deleted file mode 100644 index ee2909cb9..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/cursor.pde +++ /dev/null @@ -1,25 +0,0 @@ -class Cursor{ - Vec3D loc; - Vec3D vel; - - Cursor(){ - loc = new Vec3D(); - vel = new Vec3D(); - } - - void exist(){ - // 2.35 is an arbitrary number. Ideally, this cursor would function - // properly regardless of the camera's rotation and distance from the object. - // Im not sure how to make that happen... 3D interaction with the cursor has - // been low on my research list. Think of this as a crappy placeholder. - loc.set( ( mouseX - xMid ) * 2.25, ( mouseY - yMid ) * 2.25, 0 ); - } - - void render(){ - pushMatrix(); - translate( loc.x, loc.y, loc.z ); - fill( 1, 0, 0 ); - sphere( 10 ); - popMatrix(); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/emitter.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/emitter.pde deleted file mode 100644 index 04eb2045a..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/emitter.pde +++ /dev/null @@ -1,182 +0,0 @@ -class Emitter{ - Vec3D loc; - Vec3D vel; - Vec3D velToMouse; - float radius; - - Texture coronaTex; - Texture emitterTex; - Texture particleTex; - Texture reflectionTex; - - color myColor; - - ArrayList particles; - ArrayList nebulae; - - Emitter( ){ - - try { - coronaTex = TextureIO.newTexture(new File(dataPath("corona.png")), true); - emitterTex = TextureIO.newTexture(new File(dataPath("emitter.png")), true); - particleTex = TextureIO.newTexture(new File(dataPath("particle.png")), true); - reflectionTex = TextureIO.newTexture(new File(dataPath("reflection.png")), true); - } - catch (IOException e) { - println("Texture file is missing"); - exit(); // or handle it some other way - } - - loc = new Vec3D(); - vel = new Vec3D(); - velToMouse = new Vec3D(); - - radius = 100; - - myColor = color( 1, 1, 1 ); - - particles = new ArrayList(); - nebulae = new ArrayList(); - } - - void exist(){ - findVelocity(); - setPosition(); - iterateListExist(); - render(); - - gl.glDisable( GL.GL_TEXTURE_2D ); - - if( ALLOWTRAILS ) - iterateListRenderTrails(); - } - - void findVelocity(){ - Vec3D dirToMouse = new Vec3D( mouse.loc.sub( loc ).scale( .15 ) ); - vel.set( dirToMouse ); - } - - void setPosition(){ - loc.addSelf( vel ); - - if( ALLOWFLOOR ){ - if( loc.y > floorLevel ){ - loc.y = floorLevel; - vel.y = 0; - } - } - } - - void iterateListExist(){ - gl.glEnable( GL.GL_TEXTURE_2D ); - - - int mylength = particles.size(); - for( int i=mylength-1; i>=0; i-- ){ - Particle p = ( Particle )particles.get(i); - if( p.ISSPLIT ) - addParticles( p ); - - if ( !p.ISDEAD ){ - // pgl.bindTexture( images.particle ); - particleTex.bind(); - particleTex.enable(); - p.exist(); - particleTex.disable(); - - } - else { - particles.set( i, particles.get( particles.size() - 1 ) ); - particles.remove( particles.size() - 1 ); - } - } - - if( ALLOWFLOOR ){ - // pgl.bindTexture( images.reflection ); - reflectionTex.bind(); - reflectionTex.enable(); - for( Iterator it = particles.iterator(); it.hasNext(); ){ - Particle p = (Particle) it.next(); - p.renderReflection(); - } - reflectionTex.disable(); - } - - // pgl.bindTexture( images.corona ); - coronaTex.bind(); - coronaTex.enable(); - for( Iterator it = nebulae.iterator(); it.hasNext(); ){ - Nebula n = (Nebula) it.next(); - if( !n.ISDEAD ){ - n.exist(); - } - else { - it.remove(); - } - } - coronaTex.disable(); - } - - - void render(){ - // pgl.bindTexture( images.emitter ); - emitterTex.bind(); - emitterTex.enable(); - renderImage( loc, radius, myColor, 1.0 ); - emitterTex.enable(); - - if( ALLOWNEBULA ){ - nebulae.add( new Nebula( loc, 15.0, true ) ); - nebulae.add( new Nebula( loc, 45.0, true ) ); - } - - - if( ALLOWFLOOR ){ - // pgl.bindTexture( images.reflection ); - reflectionTex.bind(); - reflectionTex.enable(); - renderReflection(); - reflectionTex.disable(); - } - } - - void renderReflection(){ - float altitude = floorLevel - loc.y; - float reflectMaxAltitude = 300.0; - float yPer = 1.0 - altitude/reflectMaxAltitude; - - if( yPer > .05 ) - renderImageOnFloor( new Vec3D( loc.x, floorLevel, loc.z ), radius * 10.0, color( 0.5, 1.0, yPer*.25 ), yPer ); - - if( mousePressed ) - renderImageOnFloor( new Vec3D( loc.x, floorLevel, loc.z ), radius + ( yPer + 1.0 ) * radius * random( 2.0, 3.5 ), color( 1.0, 0, 0 ), yPer ); - } - - void iterateListRenderTrails(){ - for( Iterator it = particles.iterator(); it.hasNext(); ){ - Particle p = (Particle) it.next(); - p.renderTrails(); - } - } - - void addParticles( int _amt ){ - for( int i=0; i<_amt; i++ ){ - particles.add( new Particle( 1, loc, vel ) ); - } - - if( ALLOWNEBULA ){ - nebulae.add( new Nebula( loc, 40.0, false ) ); - nebulae.add( new Nebula( loc, 100.0, false ) ); - } - } - - void addParticles( Particle _p ){ - // play with amt if you want to control how many particles spawn when splitting - int amt = (int)( _p.radius * .15 ); - for( int i=0; i maxNoise) maxNoise = rads; - - rads -= minNoise; - rads *= 1.0/(maxNoise - minNoise); - - return rads * mult; -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/images.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/images.pde deleted file mode 100644 index 821c91230..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/images.pde +++ /dev/null @@ -1,13 +0,0 @@ -class Images{ - PImage particle; - PImage emitter; - PImage corona; - PImage reflection; - - Images(){ - particle = loadImage( "particle.png" ); - emitter = loadImage( "emitter.png" ); - corona = loadImage( "corona.png" ); - reflection = loadImage( "reflection.png" ); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/nebula.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/nebula.pde deleted file mode 100644 index 573378708..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/nebula.pde +++ /dev/null @@ -1,56 +0,0 @@ -class Nebula{ - Vec3D loc; - Vec3D vel; - float radius; - float scaleFac; - float age; - int lifeSpan; - float agePer; - float rot; - color c; - - boolean ISDEAD; - boolean ISGROUNDED; - - Nebula( Vec3D _loc, float _radius, boolean _ISGROUNDED ){ - loc = new Vec3D( _loc ); - vel = new Vec3D( pov.eyeNormal.scale( 2.0 ) ); - radius = random( _radius*.8, _radius*1.75 ); - - scaleFac = random( 1.005, 1.10 ); - age = 0; - lifeSpan = (int)random(10,30); - rot = random( TWO_PI ); - c = color( random(.75, 1.0), random(.5,.75), random(.2,.8) ); - ISGROUNDED = _ISGROUNDED; - - if( ISGROUNDED ){ - scaleFac = random( 1.01, 1.025 ); - vel.y -= random( 1.0 ); - radius *= 2.0; - } - } - - void exist(){ - move(); - render(); - checkAge(); - } - - void move(){ - radius *= scaleFac; - loc.addSelf( vel ); - } - - void render(){ - renderImageAndRotate( loc, radius, c, sin(agePer*PI) * .4, rot ); - } - - void checkAge(){ - age ++; - agePer = 1.0 - age/(float)lifeSpan; - - if (age > lifeSpan) - ISDEAD = true; - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/particle.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/particle.pde deleted file mode 100644 index 53cbf839b..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/particle.pde +++ /dev/null @@ -1,171 +0,0 @@ - -class Particle{ - int len; // number of elements in position array - Vec3D[] loc; // array of position vectors - Vec3D startLoc; // just used to make sure every loc[] is initialized to the same position - Vec3D vel; // velocity vector - Vec3D perlin; // perlin noise vector - float radius; // particle's size - float age; // current age of particle - int lifeSpan; // max allowed age of particle - float agePer; // range from 1.0 (birth) to 0.0 (death) - int gen; // number of times particle has been involved in a SPLIT - float bounceAge; // amount to age particle when it bounces off floor - float bounceVel; // speed at impact - boolean ISDEAD; // if age == lifeSpan, make particle die - boolean ISBOUNCING; // if particle hits the floor... - boolean ISSPLIT; // if particle hits the floor with enough speed... - - - Particle( int _gen, Vec3D _loc, Vec3D _vel ){ - gen = _gen; - radius = random( 10 - gen, 50 - ( gen-1)*10 ); - - len = (int)( radius*.5 ); - loc = new Vec3D[ len ]; - startLoc = new Vec3D( _loc.add( new Vec3D().randomVector().scaleSelf( random( 1.0 ) ) ) ); - - for( int i=0; i 1 ){ - vel.addSelf( new Vec3D().randomVector().scaleSelf( random( 7.0 ) ) ); - } else { - vel.addSelf( new Vec3D().randomVector().scaleSelf( random( 10.0 ) ) ); - } - - perlin = new Vec3D(); - - age = 0; - bounceAge = 2; - lifeSpan = (int)( radius ); - } - - void exist(){ - if( ALLOWPERLIN ) - findPerlin(); - - findVelocity(); - setPosition(); - render(); - setAge(); - } - - void findPerlin(){ - float xyRads = getRads( loc[0].x, loc[0].z, 20.0, 50.0 ); - float yRads = getRads( loc[0].x, loc[0].y, 20.0, 50.0 ); - perlin.set( cos(xyRads), -sin(yRads), sin(xyRads) ); - perlin.scaleSelf( .5 ); - } - - void findVelocity(){ - if( ALLOWGRAVITY ) - vel.addSelf( gravity ); - - if( ALLOWPERLIN ) - vel.addSelf( perlin ); - - if( ALLOWFLOOR ){ - if( loc[0].y + vel.y > floorLevel ){ - ISBOUNCING = true; - } else { - ISBOUNCING = false; - } - } - - // if the particle is moving fast enough, when it hits the ground it can - // split into a bunch of smaller particles. - if( ISBOUNCING ){ - bounceVel = vel.magnitude(); - - vel.scaleSelf( .7 ); - vel.y *= -( ( radius/40.0 ) * .5 ); - - if( bounceVel > 15.0 && gen < 4 ) - ISSPLIT = true; - - } else { - ISSPLIT = false; - } - } - - void setPosition(){ - for( int i=len-1; i>0; i-- ){ - loc[i].set( loc[i-1] ); - } - - loc[0].addSelf( vel ); - } - - void render(){ - color c = color( agePer - .5, agePer*.25, 1.5 - agePer ); - renderImage( loc[0], radius * agePer, c, 1.0 ); - - // Rendering two graphics here. Makes the particles more vivid, - // but will hinder the performance. - c = color( 1, agePer, agePer ); - renderImage( loc[0], radius * agePer * .5, c, agePer ); - } - - void renderReflection(){ - float altitude = floorLevel - loc[0].y; - float reflectMaxAltitude = 25.0; - float yPer = ( 1.0 - ( altitude/reflectMaxAltitude ) ) * .5; - - if( yPer > .05 ) - renderImageOnFloor( new Vec3D( loc[0].x, floorLevel, loc[0].z ), radius * agePer * 8.0 * yPer, color( agePer, agePer*.25, 0 ), yPer + random( .2 ) ); - } - - void renderTrails(){ - float xp, yp, zp; - float xOff, yOff, zOff; - - gl.glBegin( GL.GL_QUAD_STRIP ); - - for ( int i=0; i lifeSpan ){ - ISDEAD = true; - } else { - agePer = 1.0 - age/(float)lifeSpan; - } - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/pov.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/pov.pde deleted file mode 100644 index 1d5bf01d7..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/pov.pde +++ /dev/null @@ -1,62 +0,0 @@ -// Camera class which uses Kristian Damkjer's OCD library -// http://www.cise.ufl.edu/~kdamkjer/processing/libraries/ocd/ - -class POV{ - PApplet parent; - Camera cam; - - Vec3D eye; - Vec3D center; - - Vec3D eyeNormal; - - boolean ISDRAGGING; - - POV( PApplet _parent ){ - parent = _parent; - cam = new Camera( parent, 0, 100, 1500 ); - - eye = new Vec3D(); - center = new Vec3D(); - eyeNormal = new Vec3D(); - } - - void exist(){ - perspective( PI/3.0, (float)xSize/(float)ySize, .5, 5000 ); - if( ISDRAGGING ){ - cam.circle( radians( ( mouseX - pmouseX ) * .25 ) ); - cam.arc( radians( ( mouseY - pmouseY ) * .25 ) ); - } - - cam.feed(); - setPosition(); - } - - - // Code by JohnG from the Processing forum - // http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Programs;action=display;num=1170790832 - // - // Does the camera transformations in reverse to allow for images that always face the camera. - void glReverseCamera(){ - float deltaX = eye.x - center.x; - float deltaY = eye.y - center.y; - float deltaZ = eye.z - center.z; - - float angleZ = atan2( deltaY,deltaX ); - float hyp = sqrt( sq( deltaX ) + sq( deltaY ) ); - float angleY = atan2( hyp,deltaZ ); - - gl.glRotatef( degrees( angleZ ), 0, 0, 1.0 ); - gl.glRotatef( degrees( angleY ), 0, 1.0, 0 ); - } - - - void setPosition(){ - float[] e = cam.position(); - float[] c = cam.target(); - - eye.set( e[0], e[1], e[2] ); - center.set( c[0], c[1], c[2] ); - eyeNormal = eye.sub(center).normalize(); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/NOC_gl.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/NOC_gl.pde deleted file mode 100755 index 44705cdbd..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/NOC_gl.pde +++ /dev/null @@ -1,31 +0,0 @@ - -void renderImage(PImage img, Vec3D _loc, float _diam, color _col, float _alpha ) { - pushMatrix(); - translate( _loc.x, _loc.y, _loc.z ); - pov.glReverseCamera(); - tint(red(_col), green(_col), blue(_col), _alpha); - imageMode(CENTER); - image(img,0,0,_diam,_diam); - popMatrix(); -} - -void renderImageOnFloor(PImage img, Vec3D _loc, float _diam, color _col, float _aa ) { - pushMatrix(); - translate( _loc.x, _loc.y, _loc.z ); - rotateX(PI/2); - //pov.glReverseCamera(); - tint(red(_col), green(_col), blue(_col), _aa); - imageMode(CENTER); - image(img,0,0,_diam,_diam); - popMatrix(); -} - -void renderImageAndRotate(PImage img, Vec3D _loc, float _diam, color _col, float _aa, float _rot ) { - pushMatrix(); - translate( _loc.x, _loc.y, _loc.z ); - pov.glReverseCamera(); - tint(red(_col), green(_col), blue(_col), _aa); - imageMode(CENTER); - image(img,0,0,_diam,_diam); - popMatrix(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/cursor.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/cursor.pde deleted file mode 100755 index ee2909cb9..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/cursor.pde +++ /dev/null @@ -1,25 +0,0 @@ -class Cursor{ - Vec3D loc; - Vec3D vel; - - Cursor(){ - loc = new Vec3D(); - vel = new Vec3D(); - } - - void exist(){ - // 2.35 is an arbitrary number. Ideally, this cursor would function - // properly regardless of the camera's rotation and distance from the object. - // Im not sure how to make that happen... 3D interaction with the cursor has - // been low on my research list. Think of this as a crappy placeholder. - loc.set( ( mouseX - xMid ) * 2.25, ( mouseY - yMid ) * 2.25, 0 ); - } - - void render(){ - pushMatrix(); - translate( loc.x, loc.y, loc.z ); - fill( 1, 0, 0 ); - sphere( 10 ); - popMatrix(); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/emitter.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/emitter.pde deleted file mode 100755 index d405be8fd..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/emitter.pde +++ /dev/null @@ -1,149 +0,0 @@ -class Emitter{ - Vec3D loc; - Vec3D vel; - Vec3D velToMouse; - float radius; - - color myColor; - - ArrayList particles; - ArrayList nebulae; - - Emitter( ){ - loc = new Vec3D(); - vel = new Vec3D(); - velToMouse = new Vec3D(); - - radius = 100; - - myColor = color( 1, 1, 1 ); - - particles = new ArrayList(); - nebulae = new ArrayList(); - } - - void exist(){ - findVelocity(); - setPosition(); - iterateListExist(); - render(); - - pgl.disable( PGL.TEXTURE_2D ); - - if( ALLOWTRAILS ) - iterateListRenderTrails(); - } - - void findVelocity(){ - Vec3D dirToMouse = new Vec3D( mouse.loc.sub( loc ).scale( .15 ) ); - vel.set( dirToMouse ); - } - - void setPosition(){ - loc.addSelf( vel ); - - if( ALLOWFLOOR ){ - if( loc.y > floorLevel ){ - loc.y = floorLevel; - vel.y = 0; - } - } - } - - void iterateListExist(){ - pgl.enable( PGL.TEXTURE_2D ); - - - int mylength = particles.size(); - for( int i=mylength-1; i>=0; i-- ){ - Particle p = ( Particle )particles.get(i); - if( p.ISSPLIT ) - addParticles( p ); - - if ( !p.ISDEAD ){ - //pgl.bindTexture( images.particle ); - p.exist(); - - } else { - particles.set( i, particles.get( particles.size() - 1 ) ); - particles.remove( particles.size() - 1 ); - } - } - - if( ALLOWFLOOR ){ - //pgl.bindTexture( images.reflection ); - for( Iterator it = particles.iterator(); it.hasNext(); ){ - Particle p = (Particle) it.next(); - p.renderReflection(); - } - } - - //pgl.bindTexture( images.corona ); - for( Iterator it = nebulae.iterator(); it.hasNext(); ){ - Nebula n = (Nebula) it.next(); - if( !n.ISDEAD ){ - n.exist(); - } else { - it.remove(); - } - } - } - - - void render(){ - //pgl.bindTexture( images.emitter ); - renderImage( images.emitter,loc, radius, myColor, 1.0 ); - - - if( ALLOWNEBULA ){ - nebulae.add( new Nebula( loc, 15.0, true ) ); - nebulae.add( new Nebula( loc, 45.0, true ) ); - } - - - if( ALLOWFLOOR ){ - //pgl.bindTexture( images.reflection ); - renderReflection(images.reflection); - } - } - - void renderReflection(PImage img){ - float altitude = floorLevel - loc.y; - float reflectMaxAltitude = 300.0; - float yPer = 1.0 - altitude/reflectMaxAltitude; - - if( yPer > .05 ) - renderImageOnFloor(img, new Vec3D( loc.x, floorLevel, loc.z ), radius * 10.0, color( 0.5, 1.0, yPer*.25 ), yPer ); - - if( mousePressed ) - renderImageOnFloor(img, new Vec3D( loc.x, floorLevel, loc.z ), radius + ( yPer + 1.0 ) * radius * random( 2.0, 3.5 ), color( 1.0, 0, 0 ), yPer ); - } - - void iterateListRenderTrails(){ - for( Iterator it = particles.iterator(); it.hasNext(); ){ - Particle p = (Particle) it.next(); - p.renderTrails(); - } - } - - void addParticles( int _amt ){ - for( int i=0; i<_amt; i++ ){ - particles.add( new Particle( 1, loc, vel ) ); - } - - if( ALLOWNEBULA ){ - nebulae.add( new Nebula( loc, 40.0, false ) ); - nebulae.add( new Nebula( loc, 100.0, false ) ); - } - } - - void addParticles( Particle _p ){ - // play with amt if you want to control how many particles spawn when splitting - int amt = (int)( _p.radius * .15 ); - for( int i=0; i maxNoise) maxNoise = rads; - - rads -= minNoise; - rads *= 1.0/(maxNoise - minNoise); - - return rads * mult; -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/images.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/images.pde deleted file mode 100755 index 821c91230..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/images.pde +++ /dev/null @@ -1,13 +0,0 @@ -class Images{ - PImage particle; - PImage emitter; - PImage corona; - PImage reflection; - - Images(){ - particle = loadImage( "particle.png" ); - emitter = loadImage( "emitter.png" ); - corona = loadImage( "corona.png" ); - reflection = loadImage( "reflection.png" ); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/nebula.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/nebula.pde deleted file mode 100755 index 3412c110f..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/nebula.pde +++ /dev/null @@ -1,56 +0,0 @@ -class Nebula{ - Vec3D loc; - Vec3D vel; - float radius; - float scaleFac; - float age; - int lifeSpan; - float agePer; - float rot; - color c; - - boolean ISDEAD; - boolean ISGROUNDED; - - Nebula( Vec3D _loc, float _radius, boolean _ISGROUNDED ){ - loc = new Vec3D( _loc ); - vel = new Vec3D( pov.eyeNormal.scale( 2.0 ) ); - radius = random( _radius*.8, _radius*1.75 ); - - scaleFac = random( 1.005, 1.10 ); - age = 0; - lifeSpan = (int)random(10,30); - rot = random( TWO_PI ); - c = color( random(.75, 1.0), random(.5,.75), random(.2,.8) ); - ISGROUNDED = _ISGROUNDED; - - if( ISGROUNDED ){ - scaleFac = random( 1.01, 1.025 ); - vel.y -= random( 1.0 ); - radius *= 2.0; - } - } - - void exist(){ - move(); - render(); - checkAge(); - } - - void move(){ - radius *= scaleFac; - loc.addSelf( vel ); - } - - void render(){ - renderImageAndRotate(images.corona, loc, radius, c, sin(agePer*PI) * .4, rot ); - } - - void checkAge(){ - age ++; - agePer = 1.0 - age/(float)lifeSpan; - - if (age > lifeSpan) - ISDEAD = true; - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/particle.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/particle.pde deleted file mode 100755 index 893d3631f..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/particle.pde +++ /dev/null @@ -1,172 +0,0 @@ - -class Particle{ - int len; // number of elements in position array - Vec3D[] loc; // array of position vectors - Vec3D startLoc; // just used to make sure every loc[] is initialized to the same position - Vec3D vel; // velocity vector - Vec3D perlin; // perlin noise vector - float radius; // particle's size - float age; // current age of particle - int lifeSpan; // max allowed age of particle - float agePer; // range from 1.0 (birth) to 0.0 (death) - int gen; // number of times particle has been involved in a SPLIT - float bounceAge; // amount to age particle when it bounces off floor - float bounceVel; // speed at impact - boolean ISDEAD; // if age == lifeSpan, make particle die - boolean ISBOUNCING; // if particle hits the floor... - boolean ISSPLIT; // if particle hits the floor with enough speed... - - - Particle( int _gen, Vec3D _loc, Vec3D _vel ){ - gen = _gen; - radius = random( 10 - gen, 50 - ( gen-1)*10 ); - - len = (int)( radius*.5 ); - loc = new Vec3D[ len ]; - startLoc = new Vec3D( _loc.add( new Vec3D().randomVector().scaleSelf( random( 1.0 ) ) ) ); - - for( int i=0; i 1 ){ - vel.addSelf( new Vec3D().randomVector().scaleSelf( random( 7.0 ) ) ); - } else { - vel.addSelf( new Vec3D().randomVector().scaleSelf( random( 10.0 ) ) ); - } - - perlin = new Vec3D(); - - age = 0; - bounceAge = 2; - lifeSpan = (int)( radius ); - } - - void exist(){ - if( ALLOWPERLIN ) - findPerlin(); - - findVelocity(); - setPosition(); - render(); - setAge(); - } - - void findPerlin(){ - float xyRads = getRads( loc[0].x, loc[0].z, 20.0, 50.0 ); - float yRads = getRads( loc[0].x, loc[0].y, 20.0, 50.0 ); - perlin.set( cos(xyRads), -sin(yRads), sin(xyRads) ); - perlin.scaleSelf( .5 ); - } - - void findVelocity(){ - if( ALLOWGRAVITY ) - vel.addSelf( gravity ); - - if( ALLOWPERLIN ) - vel.addSelf( perlin ); - - if( ALLOWFLOOR ){ - if( loc[0].y + vel.y > floorLevel ){ - ISBOUNCING = true; - } else { - ISBOUNCING = false; - } - } - - // if the particle is moving fast enough, when it hits the ground it can - // split into a bunch of smaller particles. - if( ISBOUNCING ){ - bounceVel = vel.magnitude(); - - vel.scaleSelf( .7 ); - vel.y *= -( ( radius/40.0 ) * .5 ); - - if( bounceVel > 15.0 && gen < 4 ) - ISSPLIT = true; - - } else { - ISSPLIT = false; - } - } - - void setPosition(){ - for( int i=len-1; i>0; i-- ){ - loc[i].set( loc[i-1] ); - } - - loc[0].addSelf( vel ); - } - - void render(){ - color c = color( agePer - .5, agePer*.25, 1.5 - agePer ); - renderImage(images.particle, loc[0], radius * agePer, c, 1.0 ); - - // Rendering two graphics here. Makes the particles more vivid, - // but will hinder the performance. - c = color( 1, agePer, agePer ); - renderImage(images.particle, loc[0], radius * agePer * .5, c, agePer ); - } - - void renderReflection(){ - float altitude = floorLevel - loc[0].y; - float reflectMaxAltitude = 25.0; - float yPer = ( 1.0 - ( altitude/reflectMaxAltitude ) ) * .5; - - if( yPer > .05 ) - renderImageOnFloor(images.particle, new Vec3D( loc[0].x, floorLevel, loc[0].z ), radius * agePer * 8.0 * yPer, color( agePer, agePer*.25, 0 ), yPer + random( .2 ) ); - } - - void renderTrails(){ - float xp, yp, zp; - float xOff, yOff, zOff; - - beginShape(QUAD_STRIP); - - for ( int i=0; i lifeSpan ){ - ISDEAD = true; - } else { - agePer = 1.0 - age/(float)lifeSpan; - } - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/pov.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/pov.pde deleted file mode 100755 index cc41c1360..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/pov.pde +++ /dev/null @@ -1,64 +0,0 @@ -// Camera class which uses Kristian Damkjer's OCD library -// http://www.cise.ufl.edu/~kdamkjer/processing/libraries/ocd/ - -class POV{ - PApplet parent; - Camera cam; - - Vec3D eye; - Vec3D center; - - Vec3D eyeNormal; - - boolean ISDRAGGING; - - POV( PApplet _parent ){ - parent = _parent; - cam = new Camera( parent, 0, -100, 1500 ); - - eye = new Vec3D(); - center = new Vec3D(); - eyeNormal = new Vec3D(); - } - - void exist(){ - perspective( PI/3.0, (float)xSize/(float)ySize, .5, 5000 ); - if( ISDRAGGING ){ - cam.circle( radians( ( mouseX - pmouseX ) * .25 ) ); - cam.arc( radians( ( mouseY - pmouseY ) * .25 ) ); - } - - cam.feed(); - setPosition(); - } - - - // Code by JohnG from the Processing forum - // http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Programs;action=display;num=1170790832 - // - // Does the camera transformations in reverse to allow for images that always face the camera. - void glReverseCamera(){ - float deltaX = eye.x - center.x; - float deltaY = eye.y - center.y; - float deltaZ = eye.z - center.z; - - float angleZ = atan2( deltaY,deltaX ); - float hyp = sqrt( sq( deltaX ) + sq( deltaY ) ); - float angleY = atan2( hyp,deltaZ ); - - rotateZ(angleZ); - rotateY(angleY); - //gl.glRotatef( degrees( angleZ ), 0, 0, 1.0 ); - //gl.glRotatef( degrees( angleY ), 0, 1.0, 0 ); - } - - - void setPosition(){ - float[] e = cam.position(); - float[] c = cam.target(); - - eye.set( e[0], e[1], e[2] ); - center.set( c[0], c[1], c[2] ); - eyeNormal = eye.sub(center).normalize(); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Circle.pde b/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Circle.pde deleted file mode 100644 index f45630f37..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Circle.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Circle extends Shape { - - // Inherits all instance variables from parent + adding one - color c; - - Circle(float x_, float y_, float r_, color c_) { - super(x_,y_,r_); // Call the parent constructor - c = c_; // Also deal with this new instance variable - } - - // Call the parent jiggle, but do some more stuff too - void jiggle() { - super.jiggle(); - // The Circle jiggles its size as well as its x,y location. - r += random(-1,1); - r = constrain(r,0,100); - } - - // The changeColor() function is unique to the Circle class. - void changeColor() { - c = color(random(255)); - } - - void display() { - ellipseMode(CENTER); - fill(c); - stroke(0); - ellipse(x,y,r,r); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Shape.pde b/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Shape.pde deleted file mode 100644 index a4d8a723a..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Shape.pde +++ /dev/null @@ -1,28 +0,0 @@ -// Learning Processing -// Daniel Shiffman -// http://www.learningprocessing.com - -// Example 22-1: Inheritance - -class Shape { - float x; - float y; - float r; - - Shape(float x_, float y_, float r_) { - x = x_; - y = y_; - r = r_; - } - - void jiggle() { - x += random(-1,1); - y += random(-1,1); - } - - // A generic shape does not really know how to be displayed. - // This will be overridden in the child classes. - void display() { - point(x,y); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Square.pde b/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Square.pde deleted file mode 100644 index 72831cabe..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Square.pde +++ /dev/null @@ -1,23 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Square extends Shape { - // Variables are inherited from the parent. - // We could also add variables unique to the Square class if we so desire - - Square(float x_, float y_, float r_) { - // If the parent constructor takes arguments then super() needs to pass in those arguments. - super(x_,y_,r_); - } - - // Inherits jiggle() from parent - - // The square overrides its parent for display. - void display() { - rectMode(CENTER); - fill(175); - stroke(0); - rect(x,y,r,r); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/simpleInheritance.pde b/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/simpleInheritance.pde deleted file mode 100644 index d76add5e3..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/simpleInheritance.pde +++ /dev/null @@ -1,25 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Object oriented programming allows us to defi ne classes in terms of other classes. -// A class can be a subclass (aka " child " ) of a super class (aka "parent"). -// This is a simple example demonstrating this concept, known as "inheritance." - -Square s; -Circle c; - -void setup() { - size(200,200); - // A square and circle - s = new Square(75,75,10); - c = new Circle(125,125,20,color(175)); -} - -void draw() { - background(255); - c.jiggle(); - s.jiggle(); - c.display(); - s.display(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Circle.pde b/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Circle.pde deleted file mode 100644 index f45630f37..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Circle.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Circle extends Shape { - - // Inherits all instance variables from parent + adding one - color c; - - Circle(float x_, float y_, float r_, color c_) { - super(x_,y_,r_); // Call the parent constructor - c = c_; // Also deal with this new instance variable - } - - // Call the parent jiggle, but do some more stuff too - void jiggle() { - super.jiggle(); - // The Circle jiggles its size as well as its x,y location. - r += random(-1,1); - r = constrain(r,0,100); - } - - // The changeColor() function is unique to the Circle class. - void changeColor() { - c = color(random(255)); - } - - void display() { - ellipseMode(CENTER); - fill(c); - stroke(0); - ellipse(x,y,r,r); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Shape.pde b/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Shape.pde deleted file mode 100644 index 671b45edf..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Shape.pde +++ /dev/null @@ -1,26 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Shape { - float x; - float y; - float r; - - Shape(float x_, float y_, float r_) { - x = x_; - y = y_; - r = r_; - } - - void jiggle() { - x += random(-1,1); - y += random(-1,1); - } - - // A generic shape does not really know how to be displayed. - // This will be overridden in the child classes. - void display() { - point(x,y); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Square.pde b/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Square.pde deleted file mode 100644 index 72831cabe..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Square.pde +++ /dev/null @@ -1,23 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Square extends Shape { - // Variables are inherited from the parent. - // We could also add variables unique to the Square class if we so desire - - Square(float x_, float y_, float r_) { - // If the parent constructor takes arguments then super() needs to pass in those arguments. - super(x_,y_,r_); - } - - // Inherits jiggle() from parent - - // The square overrides its parent for display. - void display() { - rectMode(CENTER); - fill(175); - stroke(0); - rect(x,y,r,r); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/simplePolymorphism.pde b/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/simplePolymorphism.pde deleted file mode 100644 index b7e667acf..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/simplePolymorphism.pde +++ /dev/null @@ -1,28 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// One array of Shapes -Shape[] shapes = new Shape[30]; - -void setup() { - size(200,200); - for (int i = 0; i < shapes.length; i++ ) { - int r = int(random(2)); - // Randomly put either circles or squares in our array - if (r == 0) { - shapes[i] = new Circle(100,100,10,color(random(255),100)); - } else { - shapes[i] = new Square(100,100,10); - } - } -} - -void draw() { - background(255); - // Jiggle and display all shapes - for (int i = 0; i < shapes.length; i++ ) { - shapes[i].jiggle(); - shapes[i].display(); - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/CollisionsEqualMass.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/CollisionsEqualMass.pde deleted file mode 100644 index bbb54b071..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/CollisionsEqualMass.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Collisions -- Elastic, Equal Mass, Two objects only - -// Based off of Chapter 9: Resolving Collisions -// Mathematics and Physics for Programmers by Danny Kodicek - -// A Thing class for idealized collisions - -Mover a; -Mover b; - -boolean showVectors = true; - -void setup() { - size(200,200); - a = new Mover(new PVector(random(5),random(-5,5)),new PVector(10,10)); - b = new Mover(new PVector(-2,1),new PVector(150,150)); -} - -void draw() { - background(255); - a.go(); - b.go(); - - // Note this function will ONLY WORK with two objects - // Needs to be revised in the case of an array of objects - a.collideEqualMass(b); -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/Mover.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/Mover.pde deleted file mode 100644 index 3281a9850..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/Mover.pde +++ /dev/null @@ -1,100 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Collisions - -class Mover { - - PVector loc; - PVector vel; - float bounce = 1.0; - float r = 20; - boolean colliding = false; - - Mover(PVector v, PVector l) { - vel = v.get(); - loc = l.get(); - } - - // Main method to operate object - void go() { - update(); - borders(); - display(); - } - - // Method to update location - void update() { - loc.add(vel); - } - - // Check for bouncing off borders - void borders() { - if (loc.y > height) { - vel.y *= -bounce; - loc.y = height; - } - else if (loc.y < 0) { - vel.y *= -bounce; - loc.y = 0; - } - if (loc.x > width) { - vel.x *= -bounce; - loc.x = width; - } - else if (loc.x < 0) { - vel.x *= -bounce; - loc.x = 0; - } - } - - // Method to display - void display() { - ellipseMode(CENTER); - stroke(0); - fill(175,200); - ellipse(loc.x,loc.y,r*2,r*2); - if (showVectors) { - drawVector(vel,loc,10); - } - } - - void collideEqualMass(Mover other) { - float d = PVector.dist(loc,other.loc); - float sumR = r + other.r; - // Are they colliding? - if (!colliding && d < sumR) { - // Yes, make new velocities! - colliding = true; - // Direction of one object another - PVector n = PVector.sub(other.loc,loc); - n.normalize(); - - // Difference of velocities so that we think of one object as stationary - PVector u = PVector.sub(vel,other.vel); - - // Separate out components -- one in direction of normal - PVector un = componentVector(u,n); - // Other component - u.sub(un); - // These are the new velocities plus the velocity of the object we consider as stastionary - vel = PVector.add(u,other.vel); - other.vel = PVector.add(un,other.vel); - } - else if (d > sumR) { - colliding = false; - } - } -} - -PVector componentVector (PVector vector, PVector directionVector) { - //--! ARGUMENTS: vector, directionVector (2D vectors) - //--! RETURNS: the component vector of vector in the direction directionVector - //-- normalize directionVector - directionVector.normalize(); - directionVector.mult(vector.dot(directionVector)); - return directionVector; -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/drawVector.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/drawVector.pde deleted file mode 100644 index 141c06960..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/drawVector.pde +++ /dev/null @@ -1,25 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -void drawVector(PVector v, PVector loc, float scayl) { - pushMatrix(); - float arrowsize = 4; - // Translate to location to render vector - translate(loc.x,loc.y); - stroke(0); - // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate - rotate(v.heading2D()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) - line(0,0,len,0); - line(len,0,len-arrowsize,+arrowsize/2); - line(len,0,len-arrowsize,-arrowsize/2); - popMatrix(); -} - - -void mousePressed() { - showVectors = !showVectors; -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Blob.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Blob.pde deleted file mode 100644 index d2cd65eb1..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Blob.pde +++ /dev/null @@ -1,195 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A blob skeleton -// Could be used to create blobbly characters a la Nokia Friends -// http://postspectacular.com/work/nokia/friends/start - -class Skeleton { - - // A list to keep track of all the bodies and joints - ArrayList bodies; - ArrayList joints; - - float bodyRadius; // The radius of each body that makes up the skeleton - float radius; // The radius of the entire blob - float totalPoints; // How many points make up the blob - - - // We should modify this constructor to receive arguments - // So that we can make many different types of blobs - Skeleton() { - - // Create the empty ArrayLists - bodies = new ArrayList(); - joints = new ArrayList(); - - // Where and how big is the blob - Vec2 center = new Vec2(width/2, height/2); - radius = 100; - totalPoints = 32; - bodyRadius = 10; - - // Initialize all the points in a circle - for (int i = 0; i < totalPoints; i++) { - // Look polar to cartesian coordinate transformation! - float theta = PApplet.map(i, 0, totalPoints, 0, TWO_PI); - float x = center.x + radius * sin(theta); - float y = center.y + radius * cos(theta); - - // Make each individual body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - - bd.fixedRotation = true; // no rotation! - bd.position.set(box2d.coordPixelsToWorld(x, y)); - Body body = box2d.createBody(bd); - - // The body is a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(bodyRadius); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - fd.density = 1; - fd.friction = 0.5; - fd.restitution = 0.3; - - // Finalize the body - body.createFixture(fd); - - // Store our own copy for later rendering - bodies.add(body); - } - - // Now connect the outline of the shape all with joints - for (int i = 0; i < bodies.size(); i++) { - DistanceJointDef djd = new DistanceJointDef(); - Body a = bodies.get(i); - int next = i+1; - if (i == bodies.size()-1) { - next = 0; - } - Body b = bodies.get(next); - // Connection between previous particle and this one - djd.bodyA = a; - djd.bodyB = b; - // Equilibrium length is distance between these bodies - Vec2 apos = a.getWorldCenter(); - Vec2 bpos = b.getWorldCenter(); - float d = dist(apos.x, apos.y, bpos.x, bpos.y); - djd.length = d; - // These properties affect how springy the joint is - djd.frequencyHz = 10; - djd.dampingRatio = 0.9; - - // Make the joint. - DistanceJoint dj = (DistanceJoint) box2d.world.createJoint(djd); - joints.add(dj); - } - - - // Make some joints that cross the center of the blob between bodies - for (int i = 0; i < bodies.size(); i++) { - for (int j = i+2; j < bodies.size(); j+=4) { - DistanceJointDef djd = new DistanceJointDef(); - Body a = bodies.get(i); - Body b = bodies.get(j); - // Connection between two bides - djd.bodyA = a; - djd.bodyB = b; - // Equilibrium length is distance between these bodies - Vec2 apos = a.getWorldCenter(); - Vec2 bpos = b.getWorldCenter(); - float d = dist(apos.x, apos.y, bpos.x, bpos.y); - - djd.length = d; - // These properties affect how springy the joint is - djd.frequencyHz = 3; - djd.dampingRatio = 0.1; - - // Make the joint. - DistanceJoint dj = (DistanceJoint) box2d.world.createJoint(djd); - joints.add(dj); - } - } - } - - - // Draw the skeleton as circles for bodies and lines for joints - void displaySkeleton() { - // Draw the outline - stroke(0); - strokeWeight(1); - for (Joint j: joints) { - Body a = j.getBodyA(); - Body b = j.getBodyB(); - Vec2 posa = box2d.getBodyPixelCoord(a); - Vec2 posb = box2d.getBodyPixelCoord(b); - line(posa.x, posa.y, posb.x, posb.y); - } - - // Draw the individual circles - for (Body b: bodies) { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(b); - // Get its angle of rotation - float a = b.getAngle(); - pushMatrix(); - translate(pos.x, pos.y); - rotate(a); - fill(175); - stroke(0); - strokeWeight(1); - ellipse(0, 0, bodyRadius*2, bodyRadius*2); - popMatrix(); - } - } - - - // Draw it as a creature - void displayCreature() { - // Let's compute the center! - Vec2 center = new Vec2(0, 0); - - // Make a curvy polygon - beginShape(); - stroke(175); - strokeWeight(bodyRadius*2); - fill(175); - for (Body b: bodies) { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(b); - curveVertex(pos.x, pos.y); - center.addLocal(pos); - } - endShape(CLOSE); - // Center is average of all points - center.mulLocal(1.0/bodies.size()); - - // Find angle between center and side body - Vec2 pos = box2d.getBodyPixelCoord(bodies.get(0)); - float dx = pos.x - center.x; - float dy = pos.y - center.y; - float angle = atan2(dy, dx)-PI/2; - - // Draw eyes and mouth relative to center - pushMatrix(); - strokeWeight(1); - stroke(0); - translate(center.x, center.y); - rotate(angle); - fill(0); - ellipse(-25, -50, 16, 16); - ellipse(25, -50, 16, 16); - line(-50, 50, 50, 50); - popMatrix(); - } - - Body getFirstBody() { - return bodies.get(0); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/BlobSkeleton.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/BlobSkeleton.pde deleted file mode 100644 index c9f4ee0a0..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/BlobSkeleton.pde +++ /dev/null @@ -1,109 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A blob skeleton -// Could be used to create blobbly characters a la Nokia Friends -// http://postspectacular.com/work/nokia/friends/start - -import pbox2d.*; - -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.joints.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; - -// Our "blob" object -Skeleton blob; - -// Just a single box this time -Box box; -// The Spring that will attach to the box from the mouse -Spring spring; - -// Draw creature design or skeleton? -boolean skeleton; - -void setup() { - size(640, 360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Add some boundaries - boundaries = new ArrayList(); - boundaries.add(new Boundary(width/2, height-5, width, 10)); - boundaries.add(new Boundary(width/2, 5, width, 10)); - boundaries.add(new Boundary(width-5, height/2, 10, height)); - boundaries.add(new Boundary(5, height/2, 10, height)); - - // Make a new blob - blob = new Skeleton(); - - // Make the box - box = new Box(width/2, 100); - - // Make the spring (it doesn't really get initialized until the mouse is clicked) - spring = new Spring(); -} - -// When the mouse is released we're done with the spring -void mouseReleased() { - spring.destroy(); -} - -// When the mouse is pressed we. . . -void mousePressed() { - // Check to see if the mouse was clicked on the box - if (box.contains(mouseX, mouseY)) { - // And if so, bind the mouse location to the box with a spring - spring.bind(mouseX, mouseY, box); - } -} - -void draw() { - background(255); - - // We must always step through time! - - box2d.step(); - - - // Show the blob! - if (skeleton) { - blob.displaySkeleton(); - } - else { - blob.displayCreature(); - } - - // Show the boundaries! - for (Boundary wall: boundaries) { - wall.display(); - } - - // Always alert the spring to the new mouse location - spring.update(mouseX, mouseY); - - // Draw the box - box.display(); - // Draw the spring (it only appears when active) - spring.display(); - - fill(0); - text("Space bar to toggle creature/skeleton.\nClick and drag the box.", 20, height-30); -} - - -void keyPressed() { - if (key == ' ') { - skeleton = !skeleton; - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Boundary.pde deleted file mode 100644 index 9a17026a1..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Boundary.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - rectMode(CENTER); - rect(x,y,w,h); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Box.pde deleted file mode 100644 index 16a2c18b2..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Box.pde +++ /dev/null @@ -1,85 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box - -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x_, float y_) { - float x = x_; - float y = y_; - w = 50; - h = 50; - // Add the box to the box2d world - makeBody(new Vec2(x, y), w, h); - body.setUserData(this); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - boolean contains(float x, float y) { - Vec2 worldPoint = box2d.coordPixelsToWorld(x, y); - Fixture f = body.getFixtureList(); - boolean inside = f.testPoint(worldPoint); - return inside; - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(PConstants.CENTER); - pushMatrix(); - translate(pos.x, pos.y); - rotate(-a); - fill(50); - stroke(0); - rect(0, 0, w, h); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - // Define and create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - body = box2d.createBody(bd); - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - //body.setMassFromShapes(); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Spring.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Spring.pde deleted file mode 100644 index 02fd1612b..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Spring.pde +++ /dev/null @@ -1,75 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Class to describe the spring joint (displayed as a line) - -class Spring { - - // This is the box2d object we need to create - MouseJoint mouseJoint; - - Spring() { - // At first it doesn't exist - mouseJoint = null; - } - - // If it exists we set its target to the mouse location - void update(float x, float y) { - if (mouseJoint != null) { - // Always convert to world coordinates! - Vec2 mouseWorld = box2d.coordPixelsToWorld(x,y); - mouseJoint.setTarget(mouseWorld); - } - } - - void display() { - if (mouseJoint != null) { - // We can get the two anchor points - Vec2 v1 = new Vec2(0,0); - mouseJoint.getAnchorA(v1); - Vec2 v2 = new Vec2(0,0); - mouseJoint.getAnchorB(v2); - // Convert them to screen coordinates - v1 = box2d.coordWorldToPixels(v1); - v2 = box2d.coordWorldToPixels(v2); - // And just draw a line - stroke(0); - strokeWeight(1); - line(v1.x,v1.y,v2.x,v2.y); - } - } - - - // This is the key function where - // we attach the spring to an x,y location - // and the Box object's location - void bind(float x, float y, Box box) { - // Define the joint - MouseJointDef md = new MouseJointDef(); - // Body A is just a fake ground body for simplicity (there isn't anything at the mouse) - md.bodyA = box2d.getGroundBody(); - // Body 2 is the box's boxy - md.bodyB = box.body; - // Get the mouse location in world coordinates - Vec2 mp = box2d.coordPixelsToWorld(x,y); - // And that's the target - md.target.set(mp); - // Some stuff about how strong and bouncy the spring should be - md.maxForce = 1000.0 * box.body.m_mass; - md.frequencyHz = 5.0; - md.dampingRatio = 0.9; - - // Make the joint! - mouseJoint = (MouseJoint) box2d.world.createJoint(md); - } - - void destroy() { - // We can get rid of the joint when the mouse is released - if (mouseJoint != null) { - box2d.world.destroyJoint(mouseJoint); - mouseJoint = null; - } - } - -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Blob.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Blob.pde deleted file mode 100644 index 1919d79e2..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Blob.pde +++ /dev/null @@ -1,118 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// PBox2D example - -// A blob skeleton -// Could be used to create blobbly characters a la Nokia Friends -// http://postspectacular.com/work/nokia/friends/start - -class Blob { - - // A list to keep track of all the points in our blob - ArrayList skeleton; - - float bodyRadius; // The radius of each body that makes up the skeleton - float radius; // The radius of the entire blob - float totalPoints; // How many points make up the blob - - - // We should modify this constructor to receive arguments - // So that we can make many different types of blobs - Blob() { - - // Create the empty - skeleton = new ArrayList(); - - // Let's make a volume of joints! - ConstantVolumeJointDef cvjd = new ConstantVolumeJointDef(); - - // Where and how big is the blob - Vec2 center = new Vec2(width/2, height/2); - radius = 100; - totalPoints = 20; - bodyRadius = 12; - - - // Initialize all the points - for (int i = 0; i < totalPoints; i++) { - // Look polar to cartesian coordinate transformation! - float theta = PApplet.map(i, 0, totalPoints, 0, TWO_PI); - float x = center.x + radius * sin(theta); - float y = center.y + radius * cos(theta); - - // Make each individual body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - - bd.fixedRotation = true; // no rotation! - bd.position.set(box2d.coordPixelsToWorld(x, y)); - Body body = box2d.createBody(bd); - - // The body is a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(bodyRadius); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - - // For filtering out collisions - //fd.filter.groupIndex = -2; - - // Parameters that affect physics - fd.density = 1; - - // Finalize the body - body.createFixture(fd); - // Add it to the volume - cvjd.addBody(body); - - - // Store our own copy for later rendering - skeleton.add(body); - } - - // These parameters control how stiff vs. jiggly the blob is - cvjd.frequencyHz = 10.0f; - cvjd.dampingRatio = 1.0f; - - // Put the joint thing in our world! - box2d.world.createJoint(cvjd); - } - - - // Time to draw the blob! - // Can you make it a cute character, a la http://postspectacular.com/work/nokia/friends/start - void display() { - - // Draw the outline - beginShape(); - noFill(); - stroke(0); - strokeWeight(1); - for (Body b: skeleton) { - Vec2 pos = box2d.getBodyPixelCoord(b); - vertex(pos.x, pos.y); - } - endShape(CLOSE); - - // Draw the individual circles - for (Body b: skeleton) { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(b); - // Get its angle of rotation - float a = b.getAngle(); - pushMatrix(); - translate(pos.x, pos.y); - rotate(a); - fill(175); - stroke(0); - strokeWeight(1); - ellipse(0, 0, bodyRadius*2, bodyRadius*2); - popMatrix(); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Blobby.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Blobby.pde deleted file mode 100644 index d5df8e919..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Blobby.pde +++ /dev/null @@ -1,63 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A blob skeleton -// Could be used to create blobbly characters a la Nokia Friends -// http://postspectacular.com/work/nokia/friends/start - -// This seems to be broken with the Box2D 2.1.2 version I'm using - -import pbox2d.*; - -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.joints.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; - -// Our "blob" object -Blob blob; - - void setup() { - size(400,300); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Add some boundaries - boundaries = new ArrayList(); - boundaries.add(new Boundary(width/2,height-5,width,10)); - boundaries.add(new Boundary(width/2,5,width,10)); - boundaries.add(new Boundary(width-5,height/2,10,height)); - boundaries.add(new Boundary(5,height/2,10,height)); - - // Make a new blob - blob = new Blob(); -} - - void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // Show the blob! - blob.display(); - - // Show the boundaries! - for (Boundary wall: boundaries) { - wall.display(); - } - - -} - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Boundary.pde deleted file mode 100644 index 9a17026a1..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Boundary.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - rectMode(CENTER); - rect(x,y,w,h); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/Boundary.pde deleted file mode 100644 index ff6226252..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/Boundary.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - - b.setUserData(this); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - rectMode(CENTER); - rect(x,y,w,h); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/CollisionListeningDeletionExercise.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/CollisionListeningDeletionExercise.pde deleted file mode 100644 index 37c6ee51d..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/CollisionListeningDeletionExercise.pde +++ /dev/null @@ -1,118 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of controlling an object with our own motion (by attaching a MouseJoint) -// Also demonstrates how to know which object was hit - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.contacts.*; - -// A reference to our box2d world -PBox2D box2d; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -Boundary wall; - -void setup() { - size(400, 300); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Turn on collision listening! - box2d.listenForCollisions(); - - // Create the empty list - particles = new ArrayList(); - - wall = new Boundary(width/2, height-5, width, 10); -} - -void draw() { - background(255); - - if (random(1) < 0.1) { - float sz = random(4, 8); - particles.add(new Particle(random(width), 20, sz)); - } - - - // We must always step through time! - box2d.step(); - - // Look at all particles - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.display(); - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - if (p.done()) { - particles.remove(i); - } - } - - wall.display(); -} - - -// Collision event functions! -void beginContact(Contact cp) { - // Get both shapes - Fixture f1 = cp.getFixtureA(); - Fixture f2 = cp.getFixtureB(); - // Get both bodies - Body b1 = f1.getBody(); - Body b2 = f2.getBody(); - - // Get our objects that reference these bodies - Object o1 = b1.getUserData(); - Object o2 = b2.getUserData(); - - if (o1.getClass() == Particle.class && o2.getClass() == Particle.class) { - Particle p1 = (Particle) o1; - p1.delete(); - Particle p2 = (Particle) o2; - p2.delete(); - } - - if (o1.getClass() == Boundary.class) { - Particle p = (Particle) o2; - p.change(); - } - if (o2.getClass() == Boundary.class) { - Particle p = (Particle) o1; - p.change(); - } - - -} - -// Objects stop touching each other -void endContact(Contact cp) { -} - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/Particle.pde deleted file mode 100644 index 5a4017c84..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/Particle.pde +++ /dev/null @@ -1,95 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - color col; - - boolean delete = false; - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x, y, r); - body.setUserData(this); - col = color(175); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - void delete() { - delete = true; - } - - // Change color when hit - void change() { - col = color(255, 0, 0); - } - - // Is the particle ready for deletion? - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2 || delete) { - killBody(); - return true; - } - return false; - } - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x, pos.y); - rotate(a); - fill(col); - stroke(0); - strokeWeight(1); - ellipse(0, 0, r*2, r*2); - // Let's add a line so we can see the rotation - line(0, 0, r, 0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x, y); - bd.type = BodyType.DYNAMIC; - body = box2d.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - - body.setAngularVelocity(random(-10, 10)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Box.pde deleted file mode 100644 index 1fb05d066..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Box.pde +++ /dev/null @@ -1,85 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box - -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x_, float y_) { - float x = x_; - float y = y_; - w = 24; - h = 24; - // Add the box to the box2d world - makeBody(new Vec2(x, y), w, h); - body.setUserData(this); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - boolean contains(float x, float y) { - Vec2 worldPoint = box2d.coordPixelsToWorld(x, y); - Fixture f = body.getFixtureList(); - boolean inside = f.testPoint(worldPoint); - return inside; - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(PConstants.CENTER); - pushMatrix(); - translate(pos.x, pos.y); - rotate(-a); - fill(175); - stroke(0); - rect(0, 0, w, h); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - // Define and create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - body = box2d.createBody(bd); - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - //body.setMassFromShapes(); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/CollisionsAndControl.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/CollisionsAndControl.pde deleted file mode 100644 index 7ddaa71b6..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/CollisionsAndControl.pde +++ /dev/null @@ -1,150 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of controlling an object with our own motion (by attaching a MouseJoint) -// Also demonstrates how to know which object was hit - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.contacts.*; - -// A reference to our box2d world -PBox2D box2d; - -// Just a single box this time -Box box; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -// The Spring that will attach to the box from the mouse -Spring spring; - -// Perlin noise values -float xoff = 0; -float yoff = 1000; - - -void setup() { - size(400,300); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Turn on collision listening! - box2d.listenForCollisions(); - - // Make the box - box = new Box(width/2,height/2); - - // Make the spring (it doesn't really get initialized until the mouse is clicked) - spring = new Spring(); - spring.bind(width/2,height/2,box); - - // Create the empty list - particles = new ArrayList(); - - -} - -void draw() { - background(255); - - if (random(1) < 0.2) { - float sz = random(4,8); - particles.add(new Particle(width/2,-20,sz)); - } - - - // We must always step through time! - box2d.step(); - - // Make an x,y coordinate out of perlin noise - float x = noise(xoff)*width; - float y = noise(yoff)*height; - xoff += 0.01; - yoff += 0.01; - - // This is tempting but will not work! - // box.body.setXForm(box2d.screenToWorld(x,y),0); - - // Instead update the spring which pulls the mouse along - if (mousePressed) { - spring.update(mouseX,mouseY); - spring.display(); - } else { - spring.update(x,y); - } - box.body.setAngularVelocity(0); - - // Look at all particles - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.display(); - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - if (p.done()) { - particles.remove(i); - } - } - - // Draw the box - box.display(); - - // Draw the spring - // spring.display(); -} - - -// Collision event functions! -void beginContact(Contact cp) { - // Get both fixtures - Fixture f1 = cp.getFixtureA(); - Fixture f2 = cp.getFixtureB(); - // Get both bodies - Body b1 = f1.getBody(); - Body b2 = f2.getBody(); - // Get our objects that reference these bodies - Object o1 = b1.getUserData(); - Object o2 = b2.getUserData(); - - // If object 1 is a Box, then object 2 must be a particle - // Note we are ignoring particle on particle collisions - if (o1.getClass() == Box.class) { - Particle p = (Particle) o2; - p.change(); - } - // If object 2 is a Box, then object 1 must be a particle - else if (o2.getClass() == Box.class) { - Particle p = (Particle) o1; - p.change(); - } -} - - -// Objects stop touching each other -void endContact(Contact cp) { -} - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Particle.pde deleted file mode 100644 index 50be57e86..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Particle.pde +++ /dev/null @@ -1,91 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - color col; - - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x, y, r); - body.setUserData(this); - col = color(175); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Change color when hit - void change() { - col = color(255, 0, 0); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x, pos.y); - rotate(a); - fill(col); - stroke(0); - strokeWeight(1); - ellipse(0, 0, r*2, r*2); - // Let's add a line so we can see the rotation - line(0, 0, r, 0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x, y); - bd.type = BodyType.DYNAMIC; - body = box2d.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - - body.setAngularVelocity(random(-10, 10)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Spring.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Spring.pde deleted file mode 100644 index cca069b90..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Spring.pde +++ /dev/null @@ -1,81 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Class to describe the spring joint (displayed as a line) - -class Spring { - - // This is the box2d object we need to create - MouseJoint mouseJoint; - - Spring() { - // At first it doesn't exist - mouseJoint = null; - } - - // If it exists we set its target to the mouse location - void update(float x, float y) { - if (mouseJoint != null) { - // Always convert to world coordinates! - Vec2 mouseWorld = box2d.coordPixelsToWorld(x,y); - mouseJoint.setTarget(mouseWorld); - } - } - - void display() { - if (mouseJoint != null) { - // We can get the two anchor points - Vec2 v1 = new Vec2(0,0); - mouseJoint.getAnchorA(v1); - Vec2 v2 = new Vec2(0,0); - mouseJoint.getAnchorB(v2); - // Convert them to screen coordinates - v1 = box2d.coordWorldToPixels(v1); - v2 = box2d.coordWorldToPixels(v2); - // And just draw a line - stroke(0); - strokeWeight(1); - line(v1.x,v1.y,v2.x,v2.y); - } - } - - - // This is the key function where - // we attach the spring to an x,y location - // and the Box object's location - void bind(float x, float y, Box box) { - // Define the joint - MouseJointDef md = new MouseJointDef(); - - // Body A is just a fake ground body for simplicity (there isn't anything at the mouse) - md.bodyA = box2d.getGroundBody(); - // Body 2 is the box's boxy - md.bodyB = box.body; - // Get the mouse location in world coordinates - Vec2 mp = box2d.coordPixelsToWorld(x,y); - // And that's the target - md.target.set(mp); - // Some stuff about how strong and bouncy the spring should be - md.maxForce = 1000.0 * box.body.m_mass; - md.frequencyHz = 5.0; - md.dampingRatio = 0.9; - - // Wake up body! - //box.body.wakeUp(); - - // Make the joint! - mouseJoint = (MouseJoint) box2d.world.createJoint(md); - } - - void destroy() { - // We can get rid of the joint when the mouse is released - if (mouseJoint != null) { - box2d.world.destroyJoint(mouseJoint); - mouseJoint = null; - } - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Box.pde deleted file mode 100644 index 1fb05d066..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Box.pde +++ /dev/null @@ -1,85 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box - -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x_, float y_) { - float x = x_; - float y = y_; - w = 24; - h = 24; - // Add the box to the box2d world - makeBody(new Vec2(x, y), w, h); - body.setUserData(this); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - boolean contains(float x, float y) { - Vec2 worldPoint = box2d.coordPixelsToWorld(x, y); - Fixture f = body.getFixtureList(); - boolean inside = f.testPoint(worldPoint); - return inside; - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(PConstants.CENTER); - pushMatrix(); - translate(pos.x, pos.y); - rotate(-a); - fill(175); - stroke(0); - rect(0, 0, w, h); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - // Define and create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - body = box2d.createBody(bd); - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - //body.setMassFromShapes(); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/CollisionsAndControlInterface.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/CollisionsAndControlInterface.pde deleted file mode 100644 index 08df03156..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/CollisionsAndControlInterface.pde +++ /dev/null @@ -1,111 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of controlling an object with our own motion (by attaching a MouseJoint) -// Also demonstrates how to know which object was hit - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.contacts.*; - -// A reference to our box2d world -PBox2D box2d; - -// Just a single box this time -Box box; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -// The Spring that will attach to the box from the mouse -Spring spring; - -// Perlin noise values -float xoff = 0; -float yoff = 1000; - - -void setup() { - size(400,300); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Add a listener to listen for collisions! - box2d.world.setContactListener(new CustomListener()); - - // Make the box - box = new Box(width/2,height/2); - - // Make the spring (it doesn't really get initialized until the mouse is clicked) - spring = new Spring(); - spring.bind(width/2,height/2,box); - - // Create the empty list - particles = new ArrayList(); - - -} - -void draw() { - background(255); - - if (random(1) < 0.2) { - float sz = random(4,8); - particles.add(new Particle(width/2,-20,sz)); - } - - - // We must always step through time! - box2d.step(); - - // Make an x,y coordinate out of perlin noise - float x = noise(xoff)*width; - float y = noise(yoff)*height; - xoff += 0.01; - yoff += 0.01; - - // This is tempting but will not work! - // box.body.setXForm(box2d.screenToWorld(x,y),0); - - // Instead update the spring which pulls the mouse along - if (mousePressed) { - spring.update(mouseX,mouseY); - } else { - spring.update(x,y); - } - //box.body.setAngularVelocity(0); - - // Look at all particles - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.display(); - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - if (p.done()) { - particles.remove(i); - } - } - - // Draw the box - box.display(); - - // Draw the spring - // spring.display(); -} - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/ContactListener.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/ContactListener.pde deleted file mode 100644 index 48b5f659e..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/ContactListener.pde +++ /dev/null @@ -1,56 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// ContactListener to listen for collisions! - -import org.jbox2d.callbacks.ContactImpulse; -import org.jbox2d.callbacks.ContactListener; -import org.jbox2d.collision.Manifold; -import org.jbox2d.dynamics.contacts.Contact; - - class CustomListener implements ContactListener { - CustomListener() { - } - - // This function is called when a new collision occurs - void beginContact(Contact cp) { - // Get both fixtures - Fixture f1 = cp.getFixtureA(); - Fixture f2 = cp.getFixtureB(); - // Get both bodies - Body b1 = f1.getBody(); - Body b2 = f2.getBody(); - // Get our objects that reference these bodies - Object o1 = b1.getUserData(); - Object o2 = b2.getUserData(); - - // If object 1 is a Box, then object 2 must be a particle - // Note we are ignoring particle on particle collisions - if (o1.getClass() == Box.class) { - Particle p = (Particle) o2; - p.change(); - } - // If object 2 is a Box, then object 1 must be a particle - else if (o2.getClass() == Box.class) { - Particle p = (Particle) o1; - p.change(); - } - } - - void endContact(Contact contact) { - // TODO Auto-generated method stub - } - - void preSolve(Contact contact, Manifold oldManifold) { - // TODO Auto-generated method stub - } - - void postSolve(Contact contact, ContactImpulse impulse) { - // TODO Auto-generated method stub - } -} - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Particle.pde deleted file mode 100644 index 50be57e86..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Particle.pde +++ /dev/null @@ -1,91 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - color col; - - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x, y, r); - body.setUserData(this); - col = color(175); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Change color when hit - void change() { - col = color(255, 0, 0); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x, pos.y); - rotate(a); - fill(col); - stroke(0); - strokeWeight(1); - ellipse(0, 0, r*2, r*2); - // Let's add a line so we can see the rotation - line(0, 0, r, 0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x, y); - bd.type = BodyType.DYNAMIC; - body = box2d.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - - body.setAngularVelocity(random(-10, 10)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Spring.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Spring.pde deleted file mode 100644 index c16494932..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Spring.pde +++ /dev/null @@ -1,81 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Class to describe the spring joint (displayed as a line) - -class Spring { - - // This is the box2d object we need to create - MouseJoint mouseJoint; - - Spring() { - // At first it doesn't exist - mouseJoint = null; - } - - // If it exists we set its target to the mouse location - void update(float x, float y) { - if (mouseJoint != null) { - // Always convert to world coordinates! - Vec2 mouseWorld = box2d.coordPixelsToWorld(x,y); - mouseJoint.setTarget(mouseWorld); - } - } - - void display() { - if (mouseJoint != null) { - // We can get the two anchor points - Vec2 v1 = null; - mouseJoint.getAnchorA(v1); - Vec2 v2 = null; - mouseJoint.getAnchorB(v2); - // Convert them to screen coordinates - v1 = box2d.coordWorldToPixels(v1); - v2 = box2d.coordWorldToPixels(v2); - // And just draw a line - stroke(0); - strokeWeight(1); - line(v1.x,v1.y,v2.x,v2.y); - } - } - - - // This is the key function where - // we attach the spring to an x,y location - // and the Box object's location - void bind(float x, float y, Box box) { - // Define the joint - MouseJointDef md = new MouseJointDef(); - - // Body A is just a fake ground body for simplicity (there isn't anything at the mouse) - md.bodyA = box2d.getGroundBody(); - // Body 2 is the box's boxy - md.bodyB = box.body; - // Get the mouse location in world coordinates - Vec2 mp = box2d.coordPixelsToWorld(x,y); - // And that's the target - md.target.set(mp); - // Some stuff about how strong and bouncy the spring should be - md.maxForce = 1000.0f * box.body.m_mass; - md.frequencyHz = 5.0f; - md.dampingRatio = 0.9f; - - // Wake up body! - //box.body.wakeUp(); - - // Make the joint! - mouseJoint = (MouseJoint) box2d.world.createJoint(md); - } - - void destroy() { - // We can get rid of the joint when the mouse is released - if (mouseJoint != null) { - box2d.world.destroyJoint(mouseJoint); - mouseJoint = null; - } - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Boundary.pde deleted file mode 100644 index 9a17026a1..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Boundary.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - rectMode(CENTER); - rect(x,y,w,h); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Box.pde deleted file mode 100644 index 7847ff65f..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Box.pde +++ /dev/null @@ -1,96 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x, float y) { - w = random(8,16); - h = w; - // Add the box to the box2d world - makeBody(new Vec2(x,y),w,h); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+w*h) { - killBody(); - return true; - } - return false; - } - - void attract(float x,float y) { - // From BoxWrap2D example - Vec2 worldTarget = box2d.coordPixelsToWorld(x,y); - Vec2 bodyVec = body.getWorldCenter(); - // First find the vector going from this body to the specified point - worldTarget.subLocal(bodyVec); - // Then, scale the vector to the specified force - worldTarget.normalize(); - worldTarget.mulLocal((float) 50); - // Now apply it to the body's center of mass. - body.applyForce(worldTarget, bodyVec); - } - - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(CENTER); - pushMatrix(); - translate(pos.x,pos.y); - rotate(-a); - fill(175); - stroke(0); - rect(0,0,w,h); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - // Define the body and make it from the shape - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - - body = box2d.createBody(bd); - body.createFixture(fd); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Exercise_5_10_ApplyForceAttractMouse.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Exercise_5_10_ApplyForceAttractMouse.pde deleted file mode 100644 index 63bf2617b..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Exercise_5_10_ApplyForceAttractMouse.pde +++ /dev/null @@ -1,82 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of falling rectangles - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; -// A list for all of our rectangles -ArrayList boxes; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0, -20); - - // Create ArrayLists - boxes = new ArrayList(); - boundaries = new ArrayList(); - - // Add a bunch of fixed boundaries - boundaries.add(new Boundary(width/4,height-5,width/2-50,10)); - boundaries.add(new Boundary(3*width/4,height-5,width/2-50,10)); - boundaries.add(new Boundary(width-5,height/2,10,height)); - boundaries.add(new Boundary(5,height/2,10,height)); -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // When the mouse is clicked, add a new Box object - if (random(1) < 0.1) { - Box p = new Box(random(width),10); - boxes.add(p); - } - - if (mousePressed) { - for (Box b: boxes) { - b.attract(mouseX,mouseY); - } - } - - // Display all the boundaries - for (Boundary wall: boundaries) { - wall.display(); - } - - // Display all the boxes - for (Box b: boxes) { - b.display(); - } - - // Boxes that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = boxes.size()-1; i >= 0; i--) { - Box b = boxes.get(i); - if (b.done()) { - boxes.remove(i); - } - } - - fill(0); - text("Click mouse to attract boxes",20,20); -} - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Boundary.pde deleted file mode 100644 index 9a17026a1..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Boundary.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - rectMode(CENTER); - rect(x,y,w,h); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Box.pde deleted file mode 100644 index 92c4f0280..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Box.pde +++ /dev/null @@ -1,87 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x, float y) { - w = random(8, 16); - h = w; - // Add the box to the box2d world - makeBody(new Vec2(x, y), w, h); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+w*h) { - killBody(); - return true; - } - return false; - } - - void applyForce(Vec2 force) { - Vec2 pos = body.getWorldCenter(); - body.applyForce(force, pos); - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(CENTER); - pushMatrix(); - translate(pos.x, pos.y); - rotate(-a); - fill(175); - stroke(0); - rect(0, 0, w, h); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.2; - - // Define the body and make it from the shape - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - bd.angle = random(TWO_PI); - - body = box2d.createBody(bd); - body.createFixture(fd); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Exercise_5_10_ApplyForceSimpleWind.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Exercise_5_10_ApplyForceSimpleWind.pde deleted file mode 100644 index fa0b3f89c..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Exercise_5_10_ApplyForceSimpleWind.pde +++ /dev/null @@ -1,83 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of falling rectangles - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; -// A list for all of our rectangles -ArrayList boxes; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0, -20); - - // Create ArrayLists - boxes = new ArrayList(); - boundaries = new ArrayList(); - - // Add a bunch of fixed boundaries - boundaries.add(new Boundary(width/4,height-5,width/2-100,10)); - boundaries.add(new Boundary(3*width/4,height-5,width/2-100,10)); - boundaries.add(new Boundary(width-5,height/2,10,height)); - boundaries.add(new Boundary(5,height/2,10,height)); -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // When the mouse is clicked, add a new Box object - if (random(1) < 0.1) { - Box p = new Box(random(width),10); - boxes.add(p); - } - - if (mousePressed) { - for (Box b: boxes) { - Vec2 wind = new Vec2(20,0); - b.applyForce(wind); - } - } - - // Display all the boundaries - for (Boundary wall: boundaries) { - wall.display(); - } - - // Display all the boxes - for (Box b: boxes) { - b.display(); - } - - // Boxes that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = boxes.size()-1; i >= 0; i--) { - Box b = boxes.get(i); - if (b.done()) { - boxes.remove(i); - } - } - - fill(0); - text("Click mouse to apply a wind force.",20,20); -} - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Attractor.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Attractor.pde deleted file mode 100644 index 2a9bd9e38..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Attractor.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Showing how to use applyForce() with box2d - -// Fixed Attractor (this is redundant with Mover) - -class Attractor { - - // We need to keep track of a Body and a radius - Body body; - float r; - - Attractor(float r_, float x, float y) { - r = r_; - // Define a body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - // Set its position - bd.position = box2d.coordPixelsToWorld(x,y); - body = box2d.world.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - body.createFixture(cs,1); - - } - - - // Formula for gravitational attraction - // We are computing this in "world" coordinates - // No need to convert to pixels and back - Vec2 attract(Mover m) { - float G = 100; // Strength of force - // clone() makes us a copy - Vec2 pos = body.getWorldCenter(); - Vec2 moverPos = m.body.getWorldCenter(); - // Vector pointing from mover to attractor - Vec2 force = pos.sub(moverPos); - float distance = force.length(); - // Keep force within bounds - distance = constrain(distance,1,5); - force.normalize(); - // Note the attractor's mass is 0 because it's fixed so can't use that - float strength = (G * 1 * m.body.m_mass) / (distance * distance); // Calculate gravitional force magnitude - force.mulLocal(strength); // Get force vector --> magnitude * direction - return force; - } - - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x,pos.y); - rotate(a); - fill(175); - stroke(0); - strokeWeight(2); - ellipse(0,0,r*2,r*2); - popMatrix(); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Exercise_5_10_AttractionApplyForce.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Exercise_5_10_AttractionApplyForce.pde deleted file mode 100644 index c85c91956..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Exercise_5_10_AttractionApplyForce.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Showing how to use applyForce() with box2d - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// Movers, jsut like before! -Mover[] movers = new Mover[25]; - -// Attractor, just like before! -Attractor a; - -void setup() { - size(800,200); - box2d = new PBox2D(this); - box2d.createWorld(); - // No global gravity force - box2d.setGravity(0,0); - - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(8,16),random(width),random(height)); - } - a = new Attractor(32,width/2,height/2); -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - a.display(); - - for (int i = 0; i < movers.length; i++) { - // Look, this is just like what we had before! - Vec2 force = a.attract(movers[i]); - movers[i].applyForce(force); - movers[i].display(); - } -} - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Mover.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Mover.pde deleted file mode 100644 index df8cafcc5..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Mover.pde +++ /dev/null @@ -1,63 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Showing how to use applyForce() with box2d - -class Mover { - - // We need to keep track of a Body and a radius - Body body; - float r; - - Mover(float r_, float x, float y) { - r = r_; - // Define a body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - - // Set its position - bd.position = box2d.coordPixelsToWorld(x,y); - body = box2d.world.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - - body.setLinearVelocity(new Vec2(random(-5,5),random(-5,-5))); - body.setAngularVelocity(random(-1,1)); - } - - void applyForce(Vec2 v) { - body.applyForce(v, body.getWorldCenter()); - } - - - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x,pos.y); - rotate(a); - fill(127); - stroke(0); - strokeWeight(2); - ellipse(0,0,r*2,r*2); - // Let's add a line so we can see the rotation - line(0,0,r,0); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Exercise_5_3_NoiseChain.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Exercise_5_3_NoiseChain.pde deleted file mode 100644 index d4f75ecd5..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Exercise_5_3_NoiseChain.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An uneven surface - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -// An object to store information about the uneven surface -Surface surface; - -void setup() { - size(383,200); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0, -20); - - // Create the empty list - particles = new ArrayList(); - // Create the surface - surface = new Surface(); -} - -void draw() { - // If the mouse is pressed, we make new particles - if (mousePressed) { - float sz = random(2,6); - particles.add(new Particle(mouseX,mouseY,sz)); - } - - // We must always step through time! - box2d.step(); - - background(255); - - // Draw the surface - surface.display(); - - // Draw all particles - for (Particle p: particles) { - p.display(); - } - - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - if (p.done()) { - particles.remove(i); - } - } -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Particle.pde deleted file mode 100644 index 05783d49e..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Particle.pde +++ /dev/null @@ -1,89 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x,y,r); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x,pos.y); - rotate(-a); - fill(175); - stroke(0); - strokeWeight(1); - ellipse(0,0,r*2,r*2); - // Let's add a line so we can see the rotation - line(0,0,r,0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x,y); - bd.type = BodyType.DYNAMIC; - body = box2d.world.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - - // Give it a random initial velocity (and angular velocity) - body.setLinearVelocity(new Vec2(random(-10f,10f),random(5f,10f))); - body.setAngularVelocity(random(-10,10)); - } - - - - - - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Surface.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Surface.pde deleted file mode 100644 index 211874b0d..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Surface.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An uneven surface boundary - -class Surface { - // We'll keep track of all of the surface points - ArrayList surface; - - - Surface() { - surface = new ArrayList(); - - // This is what box2d uses to put the surface in its world - ChainShape chain = new ChainShape(); - - // Perlin noise argument - float xoff = 0.0; - - // This has to go backwards so that the objects bounce off the top of the surface - // This "edgechain" will only work in one direction! - for (float x = width+10; x > -10; x -= 5) { - - // Doing some stuff with perlin noise to calculate a surface that points down on one side - // and up on the other - float y; - if (x > width/2) { - y = 50 + (width - x)*1.1 + map(noise(xoff),0,1,-80,80); - } - else { - y = 50 + x*1.1 + map(noise(xoff),0,1,-40,40); - } - - // Store the vertex in screen coordinates - surface.add(new Vec2(x,y)); - - // Move through perlin noise - xoff += 0.1; - - } - - // Build an array of vertices in Box2D coordinates - // from the ArrayList we made - Vec2[] vertices = new Vec2[surface.size()]; - for (int i = 0; i < vertices.length; i++) { - Vec2 edge = box2d.coordPixelsToWorld(surface.get(i)); - vertices[i] = edge; - } - - // Create the chain! - chain.createChain(vertices,vertices.length); - - // The edge chain is now attached to a body via a fixture - BodyDef bd = new BodyDef(); - bd.position.set(0.0f,0.0f); - Body body = box2d.createBody(bd); - // Shortcut, we could define a fixture if we - // want to specify frictions, restitution, etc. - body.createFixture(chain,1); - - } - - // A simple function to just draw the edge chain as a series of vertex points - void display() { - strokeWeight(2); - stroke(0); - noFill(); - beginShape(); - for (Vec2 v: surface) { - vertex(v.x,v.y); - } - endShape(); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Exercise_5_3_SineChain.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Exercise_5_3_SineChain.pde deleted file mode 100644 index b313ef3ce..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Exercise_5_3_SineChain.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An uneven surface - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -// An object to store information about the uneven surface -Surface surface; - -void setup() { - size(383,200); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0, -10); - - // Create the empty list - particles = new ArrayList(); - // Create the surface - surface = new Surface(); -} - -void draw() { - // If the mouse is pressed, we make new particles - if (random(1) < 0.5) { - float sz = random(2,6); - particles.add(new Particle(width/2,10,sz)); - } - - // We must always step through time! - box2d.step(); - - background(255); - - // Draw the surface - surface.display(); - - // Draw all particles - for (Particle p: particles) { - p.display(); - } - - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - if (p.done()) { - particles.remove(i); - } - } -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Particle.pde deleted file mode 100644 index 05783d49e..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Particle.pde +++ /dev/null @@ -1,89 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x,y,r); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x,pos.y); - rotate(-a); - fill(175); - stroke(0); - strokeWeight(1); - ellipse(0,0,r*2,r*2); - // Let's add a line so we can see the rotation - line(0,0,r,0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x,y); - bd.type = BodyType.DYNAMIC; - body = box2d.world.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - - // Give it a random initial velocity (and angular velocity) - body.setLinearVelocity(new Vec2(random(-10f,10f),random(5f,10f))); - body.setAngularVelocity(random(-10,10)); - } - - - - - - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Surface.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Surface.pde deleted file mode 100644 index 3be00b5a9..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Surface.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An uneven surface boundary - -class Surface { - // We'll keep track of all of the surface points - ArrayList surface; - - - Surface() { - surface = new ArrayList(); - - // This is what box2d uses to put the surface in its world - ChainShape chain = new ChainShape(); - - float theta = 0; - - // This has to go backwards so that the objects bounce off the top of the surface - // This "edgechain" will only work in one direction! - for (float x = width+10; x > -10; x -= 5) { - - // Doing some stuff with perlin noise to calculate a surface that points down on one side - // and up on the other - float y = map(cos(theta),-1,1,75,height-10); - theta += 0.15; - - // Store the vertex in screen coordinates - surface.add(new Vec2(x,y)); - - } - - // Build an array of vertices in Box2D coordinates - // from the ArrayList we made - Vec2[] vertices = new Vec2[surface.size()]; - for (int i = 0; i < vertices.length; i++) { - Vec2 edge = box2d.coordPixelsToWorld(surface.get(i)); - vertices[i] = edge; - } - - // Create the chain! - chain.createChain(vertices,vertices.length); - - // The edge chain is now attached to a body via a fixture - BodyDef bd = new BodyDef(); - bd.position.set(0.0f,0.0f); - Body body = box2d.createBody(bd); - // Shortcut, we could define a fixture if we - // want to specify frictions, restitution, etc. - body.createFixture(chain,1); - - } - - // A simple function to just draw the edge chain as a series of vertex points - void display() { - strokeWeight(2); - stroke(0); - noFill(); - beginShape(); - for (Vec2 v: surface) { - vertex(v.x,v.y); - } - endShape(); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Box.pde deleted file mode 100644 index f872679b9..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Box.pde +++ /dev/null @@ -1,88 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x, float y) { - w = random(4, 16); - h = random(4, 16); - // Add the box to the box2d world - makeBody(new Vec2(x, y), w, h); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+w*h) { - killBody(); - return true; - } - return false; - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(CENTER); - pushMatrix(); - translate(pos.x, pos.y); - rotate(-a); - stroke(0); - fill(127); - strokeWeight(2); - rect(0, 0, w, h); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - // Define the body and make it from the shape - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - - body = box2d.createBody(bd); - body.createFixture(fd); - //body.setMassFromShapes(); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Bridge.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Bridge.pde deleted file mode 100644 index eafb42cdc..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Bridge.pde +++ /dev/null @@ -1,66 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Series of Particles connected with distance joints - -class Bridge { - - // Bridge properties - float totalLength; // How long - int numPoints; // How many points - - // Our chain is a list of particles - ArrayList particles; - - // Chain constructor - Bridge(float l, int n) { - - totalLength = l; - numPoints = n; - - particles = new ArrayList(); - - float len = totalLength / numPoints; - - // Here is the real work, go through and add particles to the chain itself - for(int i=0; i < numPoints+1; i++) { - // Make a new particle - Particle p = null; - - // First and last particles are made with density of zero - if (i == 0 || i == numPoints) p = new Particle(i*len,height/4,4,true); - else p = new Particle(i*len,height/4,4,false); - particles.add(p); - - // Connect the particles with a distance joint - if (i > 0) { - DistanceJointDef djd = new DistanceJointDef(); - Particle previous = particles.get(i-1); - // Connection between previous particle and this one - djd.bodyA = previous.body; - djd.bodyB = p.body; - // Equilibrium length - djd.length = box2d.scalarPixelsToWorld(len); - // These properties affect how springy the joint is - djd.frequencyHz = 0; - djd.dampingRatio = 0; - - // Make the joint. Note we aren't storing a reference to the joint ourselves anywhere! - // We might need to someday, but for now it's ok - DistanceJoint dj = (DistanceJoint) box2d.world.createJoint(djd); - } - } - } - - // Draw the bridge - void display() { - for (Particle p: particles) { - p.display(); - } - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Exercise_5_6_Bridge.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Exercise_5_6_Bridge.pde deleted file mode 100644 index 2946efe93..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Exercise_5_6_Bridge.pde +++ /dev/null @@ -1,82 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Example demonstrating distance joints -// A bridge is formed by connected a series of particles with joints - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.contacts.*; - -// A reference to our box2d world -PBox2D box2d; - -// An object to describe a Bridget (a list of particles with joint connections) -Bridge bridge; - -// A list for all of our rectangles -ArrayList boxes; - -void setup() { - size(800, 200); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - - // Make the bridge - bridge = new Bridge(width, width/10); - - // Create ArrayLists - boxes = new ArrayList(); -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - - // When the mouse is clicked, add a new Box object - if (mousePressed) { - Box p = new Box(mouseX, mouseY); - boxes.add(p); - } - - // Display all the boxes - for (Box b: boxes) { - b.display(); - } - - // Boxes that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = boxes.size()-1; i >= 0; i--) { - Box b = boxes.get(i); - if (b.done()) { - boxes.remove(i); - } - } - - // Draw the windmill - bridge.display(); - - - fill(0); - //text("Click mouse to add boxes.", 10, height-10); -} - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Particle.pde deleted file mode 100644 index c545127cc..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Particle.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - Particle(float x, float y, float r_, boolean fixed) { - r = r_; - - // Define a body - BodyDef bd = new BodyDef(); - if (fixed) bd.type = BodyType.STATIC; - else bd.type = BodyType.DYNAMIC; - - // Set its position - bd.position = box2d.coordPixelsToWorld(x,y); - body = box2d.world.createBody(bd); - - // Make the body's shape a circle - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x,pos.y); - rotate(a); - stroke(0); - fill(127); - strokeWeight(2); - ellipse(0,0,r*2,r*2); - // Let's add a line so we can see the rotation - line(0,0,r,0); - popMatrix(); - } - - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/Box.pde deleted file mode 100644 index c6a8aed73..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/Box.pde +++ /dev/null @@ -1,102 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box - -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - boolean dragged = false; - - // Constructor - Box(float x_, float y_) { - float x = x_; - float y = y_; - w = 24; - h = 24; - // Add the box to the box2d world - makeBody(new Vec2(x,y),w,h); - body.setUserData(this); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - boolean contains(float x, float y) { - Vec2 worldPoint = box2d.coordPixelsToWorld(x, y); - Fixture f = body.getFixtureList(); - boolean inside = f.testPoint(worldPoint); - return inside; - } - - void setAngularVelocity(float a) { - body.setAngularVelocity(a); - } - void setVelocity(Vec2 v) { - body.setLinearVelocity(v); - } - - void setLocation(float x, float y) { - Vec2 pos = body.getWorldCenter(); - Vec2 target = box2d.coordPixelsToWorld(x,y); - Vec2 diff = new Vec2(target.x-pos.x,target.y-pos.y); - diff.mulLocal(50); - setVelocity(diff); - setAngularVelocity(0); - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(PConstants.CENTER); - pushMatrix(); - translate(pos.x,pos.y); - rotate(a); - fill(175); - stroke(0); - rect(0,0,w,h); - popMatrix(); - } - - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - // Define and create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.KINEMATIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - bd.fixedRotation = true; - body = box2d.createBody(bd); - - // Define a polygon (this is what we use for a rectangle) - PolygonShape ps = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - ps.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = ps; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/KinematicTest.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/KinematicTest.pde deleted file mode 100644 index 758299639..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/KinematicTest.pde +++ /dev/null @@ -1,141 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of controlling an object with our own motion (by attaching a MouseJoint) -// Also demonstrates how to know which object was hit - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.contacts.*; - -// A reference to our box2d world -PBox2D box2d; - -// Just a single box this time -Box box; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -// Perlin noise values -float xoff = 0; -float yoff = 1000; - - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Turn on collision listening! - box2d.listenForCollisions(); - - // Make the box - box = new Box(width/2,height/2); - - // Create the empty list - particles = new ArrayList(); - - -} - -void draw() { - background(255); - - if (random(1) < 0.2) { - float sz = random(4,8); - particles.add(new Particle(width/2,-20,sz)); - } - - - // We must always step through time! - box2d.step(); - - // Make an x,y coordinate out of perlin noise - float x = noise(xoff)*width; - float y = noise(yoff)*height; - xoff += 0.01; - yoff += 0.01; - - // This is tempting but will not work! - // box.body.setXForm(box2d.screenToWorld(x,y),0); - - // Instead update the spring which pulls the mouse along - if (mousePressed) { - box.setLocation(mouseX,mouseY); - } else { - //box.setLocation(x,y); - } - - // Look at all particles - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.display(); - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - if (p.done()) { - particles.remove(i); - } - } - - // Draw the box - box.display(); - - // Draw the spring - // spring.display(); -} - - -// Collision event functions! -void beginContact(Contact cp) { - // Get both fixtures - Fixture f1 = cp.getFixtureA(); - Fixture f2 = cp.getFixtureB(); - // Get both bodies - Body b1 = f1.getBody(); - Body b2 = f2.getBody(); - // Get our objects that reference these bodies - Object o1 = b1.getUserData(); - Object o2 = b2.getUserData(); - - // If object 1 is a Box, then object 2 must be a particle - // Note we are ignoring particle on particle collisions - if (o1.getClass() == Box.class) { - Particle p = (Particle) o2; - p.change(); - } - // If object 2 is a Box, then object 1 must be a particle - else if (o2.getClass() == Box.class) { - Particle p = (Particle) o1; - p.change(); - } -} - - -// Objects stop touching each other -void endContact(Contact cp) { -} - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/Particle.pde deleted file mode 100644 index 12c50f772..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/Particle.pde +++ /dev/null @@ -1,93 +0,0 @@ -// The Nature of Code -// -// Spring 2010 -// PBox2D example - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - color col; - - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x, y, r); - body.setUserData(this); - col = color(175); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Change color when hit - void change() { - col = color(255, 0, 0); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x, pos.y); - rotate(a); - fill(col); - stroke(0); - strokeWeight(1); - ellipse(0, 0, r*2, r*2); - // Let's add a line so we can see the rotation - line(0, 0, r, 0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x, y); - bd.type = BodyType.DYNAMIC; - - body = box2d.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - - body.setAngularVelocity(random(-10, 10)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Boundary.pde deleted file mode 100644 index 71c6a82d0..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Boundary.pde +++ /dev/null @@ -1,61 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class (now incorporates angle) - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_, float a) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.angle = a; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - noFill(); - stroke(0); - strokeWeight(1); - rectMode(CENTER); - - float a = b.getAngle(); - - pushMatrix(); - translate(x,y); - rotate(-a); - rect(0,0,w,h); - popMatrix(); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Liquidy.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Liquidy.pde deleted file mode 100644 index fa7ab19aa..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Liquidy.pde +++ /dev/null @@ -1,71 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Box2D particle system example - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - - - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; - -// A list for all particle systems -ArrayList systems; - -void setup() { - size(400,300); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // We are setting a custom gravity - box2d.setGravity(0, -20); - - // Create ArrayLists - systems = new ArrayList(); - boundaries = new ArrayList(); - - // Add a bunch of fixed boundaries - boundaries.add(new Boundary(50,100,300,5,-0.3)); - boundaries.add(new Boundary(250,175,300,5,0.5)); - -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // Run all the particle systems - for (ParticleSystem system: systems) { - system.run(); - - int n = (int) random(0,2); - system.addParticles(n); - } - - // Display all the boundaries - for (Boundary wall: boundaries) { - wall.display(); - } -} - - -void mousePressed() { - // Add a new Particle System whenever the mouse is clicked - systems.add(new ParticleSystem(0, new PVector(mouseX,mouseY))); -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Particle.pde deleted file mode 100644 index dd1f4f564..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Particle.pde +++ /dev/null @@ -1,98 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A Particle - -class Particle { - - // We need to keep track of a Body - Body body; - - PVector[] trail; - - // Constructor - Particle(float x_, float y_) { - float x = x_; - float y = y_; - trail = new PVector[6]; - for (int i = 0; i < trail.length; i++) { - trail[i] = new PVector(x, y); - } - - // Add the box to the box2d world - // Here's a little trick, let's make a tiny tiny radius - // This way we have collisions, but they don't overwhelm the system - makeBody(new Vec2(x, y), 0.2f); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+20) { - killBody(); - return true; - } - return false; - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - - // Keep track of a history of screen positions in an array - for (int i = 0; i < trail.length-1; i++) { - trail[i] = trail[i+1]; - } - trail[trail.length-1] = new PVector(pos.x, pos.y); - - // Draw particle as a trail - beginShape(); - noFill(); - strokeWeight(2); - stroke(0, 150); - for (int i = 0; i < trail.length; i++) { - vertex(trail[i].x, trail[i].y); - } - endShape(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float r) { - // Define and create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - - bd.position.set(box2d.coordPixelsToWorld(center)); - body = box2d.createBody(bd); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-1, 1), random(-1, 1))); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - - fd.density = 1; - fd.friction = 0; // Slippery when wet! - fd.restitution = 0.5; - - // We could use this if we want to turn collisions off - //cd.filter.groupIndex = -10; - - // Attach fixture to body - body.createFixture(fd); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/ParticleSystem.pde deleted file mode 100644 index 08e74e0b4..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/ParticleSystem.pde +++ /dev/null @@ -1,61 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Box2D Particle System - -// A class to describe a group of Particles -// An ArrayList is used to manage the list of Particles - -class ParticleSystem { - - ArrayList particles; // An ArrayList for all the particles - PVector origin; // An origin point for where particles are birthed - - ParticleSystem(int num, PVector v) { - particles = new ArrayList(); // Initialize the ArrayList - origin = v.get(); // Store the origin point - - for (int i = 0; i < num; i++) { - particles.add(new Particle(origin.x,origin.y)); // Add "num" amount of particles to the ArrayList - } - } - - void run() { - // Display all the particles - for (Particle p: particles) { - p.display(); - } - - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - if (p.done()) { - particles.remove(i); - } - } - } - - void addParticles(int n) { - for (int i = 0; i < n; i++) { - particles.add(new Particle(origin.x,origin.y)); - } - } - - // A method to test if the particle system still has particles - boolean dead() { - if (particles.isEmpty()) { - return true; - } - else { - return false; - } - } - -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/Boundary.pde deleted file mode 100644 index 71c6a82d0..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/Boundary.pde +++ /dev/null @@ -1,61 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class (now incorporates angle) - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_, float a) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.angle = a; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - noFill(); - stroke(0); - strokeWeight(1); - rectMode(CENTER); - - float a = b.getAngle(); - - pushMatrix(); - translate(x,y); - rotate(-a); - rect(0,0,w,h); - popMatrix(); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/Box.pde deleted file mode 100644 index 806f51daa..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/Box.pde +++ /dev/null @@ -1,105 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box - -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - boolean dragged = false; - - // Constructor - Box(float x_, float y_) { - float x = x_; - float y = y_; - w = 24; - h = 24; - // Add the box to the box2d world - makeBody(new Vec2(x,y),w,h); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - boolean contains(float x, float y) { - Vec2 worldPoint = box2d.coordPixelsToWorld(x, y); - Fixture f = body.getFixtureList(); - boolean inside = f.testPoint(worldPoint); - return inside; - } - - void setAngularVelocity(float a) { - body.setAngularVelocity(a); - } - void setVelocity(Vec2 v) { - body.setLinearVelocity(v); - } - - void setLocation(float x, float y) { - Vec2 pos = body.getWorldCenter(); - Vec2 target = box2d.coordPixelsToWorld(x,y); - Vec2 diff = target.sub(pos); - diff.mulLocal(50); - setVelocity(diff); - setAngularVelocity(0); - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(PConstants.CENTER); - pushMatrix(); - translate(pos.x,pos.y); - rotate(a); - fill(175); - stroke(0); - rect(0,0,w,h); - popMatrix(); - } - - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - // Define and create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.KINEMATIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - body = box2d.createBody(bd); - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - //body.setMassFromShapes(); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/MouseKinematic.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/MouseKinematic.pde deleted file mode 100644 index a2e2bdba3..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/MouseKinematic.pde +++ /dev/null @@ -1,75 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of controlling an object with the mouse (by attaching a spring) - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; - -// Just a single box this time -Box box; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Make the box - box = new Box(width/2,height/2); - - // Add a bunch of fixed boundaries - boundaries = new ArrayList(); - boundaries.add(new Boundary(width/2,height-5,width,10,0)); - boundaries.add(new Boundary(width/2,5,width,10,0)); - boundaries.add(new Boundary(width-5,height/2,10,height,0)); - boundaries.add(new Boundary(5,height/2,10,height,0)); -} - - -void draw() { - background(255); - - // We must always step through time! - - //if (box.dragged) { - box.setLocation(mouseX,mouseY); - //} - - box2d.step(); - - // Draw the boundaries - for (Boundary wall : boundaries) { - wall.display(); - } - - // Draw the box - box.display(); - - -} - -void mousePressed() { - if (box.contains(mouseX,mouseY)) { - box.dragged = true; - } -} - -void mouseReleased() { - box.dragged = false; -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise/Box.pde deleted file mode 100644 index e9774abf0..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise/Box.pde +++ /dev/null @@ -1,27 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box -class Box { - - float x,y; - float w,h; - - // Constructor - Box(float x_, float y_) { - x = x_; - y = y_; - w = 16; - h = 16; - } - - // Drawing the box - void display() { - fill(127); - stroke(0); - strokeWeight(2); - rectMode(CENTER); - rect(x,y,w,h); - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise/NOC_5_1_box2d_exercise.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise/NOC_5_1_box2d_exercise.pde deleted file mode 100644 index 111643b0c..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise/NOC_5_1_box2d_exercise.pde +++ /dev/null @@ -1,27 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A list for all of our rectangles -ArrayList boxes; - -void setup() { - size(640,360); - // Create ArrayLists - boxes = new ArrayList(); -} - -void draw() { - background(255); - - // When the mouse is clicked, add a new Box object - if (mousePressed) { - Box p = new Box(mouseX,mouseY); - boxes.add(p); - } - - // Display all the boxes - for (Box b: boxes) { - b.display(); - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise_solved/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise_solved/Box.pde deleted file mode 100644 index 2be8fa137..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise_solved/Box.pde +++ /dev/null @@ -1,59 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box -class Box { - // Instead of any of the usual variables, we will store a reference to a Box2D Body - Body body; - - float w,h; - - Box(float x, float y) { - w = 16; - h = 16; - - // Build Body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - body = box2d.createBody(bd); - - - // Define a polygon (this is what we use for a rectangle) - PolygonShape ps = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); // Box2D considers the width and height of a - ps.setAsBox(box2dW, box2dH); // rectangle to be the distance from the - // center to the edge (so half of what we - // normally think of as width or height.) - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = ps; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - // Attach Fixture to Body - body.createFixture(fd); - } - - void display() { - // We need the Body’s location and angle - Vec2 pos = box2d.getBodyPixelCoord(body); - float a = body.getAngle(); - - pushMatrix(); - translate(pos.x,pos.y); // Using the Vec2 position and float angle to - rotate(-a); // translate and rotate the rectangle - fill(127); - stroke(0); - strokeWeight(2); - rectMode(CENTER); - rect(0,0,w,h); - popMatrix(); - } - -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise_solved/NOC_5_1_box2d_exercise_solved.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise_solved/NOC_5_1_box2d_exercise_solved.pde deleted file mode 100644 index 22d39e2a9..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise_solved/NOC_5_1_box2d_exercise_solved.pde +++ /dev/null @@ -1,40 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A list for all of our rectangles -ArrayList boxes; - -PBox2D box2d; - -void setup() { - size(640, 360); - // Initialize and create the Box2D world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Create ArrayLists - boxes = new ArrayList(); -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // When the mouse is clicked, add a new Box object - Box p = new Box(mouseX, mouseY); - boxes.add(p); - - // Display all the boxes - for (Box b: boxes) { - b.display(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/Boundary.pde deleted file mode 100644 index 54e662ceb..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/Boundary.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape ps = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - ps.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(ps,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - rectMode(CENTER); - rect(x,y,w,h); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/Box.pde deleted file mode 100644 index 344e1f108..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/Box.pde +++ /dev/null @@ -1,87 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x, float y) { - w = random(4, 16); - h = random(4, 16); - // Add the box to the box2d world - makeBody(new Vec2(x, y), w, h); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+w*h) { - killBody(); - return true; - } - return false; - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(CENTER); - pushMatrix(); - translate(pos.x, pos.y); - rotate(-a); - fill(127); - stroke(0); - strokeWeight(2); - rect(0, 0, w, h); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - // Define the body and make it from the shape - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - - body = box2d.createBody(bd); - body.createFixture(fd); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/NOC_5_2_Boxes.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/NOC_5_2_Boxes.pde deleted file mode 100644 index 23193aa97..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/NOC_5_2_Boxes.pde +++ /dev/null @@ -1,71 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of falling rectangles - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; -// A list for all of our rectangles -ArrayList boxes; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0, -10); - - // Create ArrayLists - boxes = new ArrayList(); - boundaries = new ArrayList(); - - // Add a bunch of fixed boundaries - boundaries.add(new Boundary(width/4,height-5,width/2-50,10)); - boundaries.add(new Boundary(3*width/4,height-50,width/2-50,10)); -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // Boxes fall from the top every so often - if (random(1) < 0.2) { - Box p = new Box(width/2,30); - boxes.add(p); - } - - // Display all the boundaries - for (Boundary wall: boundaries) { - wall.display(); - } - - // Display all the boxes - for (Box b: boxes) { - b.display(); - } - - // Boxes that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = boxes.size()-1; i >= 0; i--) { - Box b = boxes.get(i); - if (b.done()) { - boxes.remove(i); - } - } -} - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/NOC_5_3_ChainShape_Simple.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/NOC_5_3_ChainShape_Simple.pde deleted file mode 100644 index cee4a66e1..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/NOC_5_3_ChainShape_Simple.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// -// Spring 2011 -// PBox2D example - -// An uneven surface - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -// An object to store information about the uneven surface -Surface surface; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0, -10); - - // Create the empty list - particles = new ArrayList(); - // Create the surface - surface = new Surface(); -} - -void draw() { - // If the mouse is pressed, we make new particles - if (random(1) < 0.5) { - float sz = random(4,8); - particles.add(new Particle(width/2,10,sz)); - } - - // We must always step through time! - box2d.step(); - - background(255); - - // Draw the surface - surface.display(); - - // Draw all particles - for (Particle p: particles) { - p.display(); - } - - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - if (p.done()) { - particles.remove(i); - } - } -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/Particle.pde deleted file mode 100644 index a7d390361..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/Particle.pde +++ /dev/null @@ -1,89 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x,y,r); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x,pos.y); - rotate(-a); - fill(127); - stroke(0); - strokeWeight(2); - ellipse(0,0,r*2,r*2); - // Let's add a line so we can see the rotation - line(0,0,r,0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x,y); - bd.type = BodyType.DYNAMIC; - body = box2d.world.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - - // Give it a random initial velocity (and angular velocity) - body.setLinearVelocity(new Vec2(random(-10f,10f),random(5f,10f))); - body.setAngularVelocity(random(-10,10)); - } - - - - - - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/Surface.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/Surface.pde deleted file mode 100644 index 09da0d535..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/Surface.pde +++ /dev/null @@ -1,52 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An uneven surface boundary - -class Surface { - // We'll keep track of all of the surface points - ArrayList surface; - - - Surface() { - surface = new ArrayList(); - // Here we keep track of the screen coordinates of the chain - surface.add(new Vec2(0, height/2)); - surface.add(new Vec2(width/2, height/2+50)); - surface.add(new Vec2(width, height/2)); - - // This is what box2d uses to put the surface in its world - ChainShape chain = new ChainShape(); - - // We can add 3 vertices by making an array of 3 Vec2 objects - Vec2[] vertices = new Vec2[surface.size()]; - for (int i = 0; i < vertices.length; i++) { - vertices[i] = box2d.coordPixelsToWorld(surface.get(i)); - } - - chain.createChain(vertices, vertices.length); - - // The edge chain is now a body! - BodyDef bd = new BodyDef(); - Body body = box2d.world.createBody(bd); - // Shortcut, we could define a fixture if we - // want to specify frictions, restitution, etc. - body.createFixture(chain, 1); - } - - // A simple function to just draw the edge chain as a series of vertex points - void display() { - strokeWeight(1); - stroke(0); - fill(0); - beginShape(); - for (Vec2 v: surface) { - vertex(v.x, v.y); - } - vertex(width, height); - vertex(0, height); - endShape(CLOSE); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/Boundary.pde deleted file mode 100644 index ebf6b04bf..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/Boundary.pde +++ /dev/null @@ -1,59 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class (now incorporates angle) - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_, float a) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.angle = a; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, it doesn't move so we don't have to ask the Body for location - void display() { - fill(0); - stroke(0); - strokeWeight(1); - rectMode(CENTER); - float a = b.getAngle(); - pushMatrix(); - translate(x,y); - rotate(-a); - rect(0,0,w,h); - popMatrix(); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/CustomShape.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/CustomShape.pde deleted file mode 100644 index 9e0180a59..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/CustomShape.pde +++ /dev/null @@ -1,90 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box -class CustomShape { - - // We need to keep track of a Body and a width and height - Body body; - - // Constructor - CustomShape(float x, float y) { - // Add the box to the box2d world - makeBody(new Vec2(x, y)); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height) { - killBody(); - return true; - } - return false; - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - Fixture f = body.getFixtureList(); - PolygonShape ps = (PolygonShape) f.getShape(); - - - rectMode(CENTER); - pushMatrix(); - translate(pos.x, pos.y); - rotate(-a); - fill(127); - stroke(0); - strokeWeight(2); - beginShape(); - //println(vertices.length); - // For every vertex, convert to pixel vector - for (int i = 0; i < ps.getVertexCount(); i++) { - Vec2 v = box2d.vectorWorldToPixels(ps.getVertex(i)); - vertex(v.x, v.y); - } - endShape(CLOSE); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center) { - - Vec2[] vertices = new Vec2[4]; - vertices[0] = box2d.vectorPixelsToWorld(new Vec2(-15, 25)); - vertices[1] = box2d.vectorPixelsToWorld(new Vec2(15, 0)); - vertices[2] = box2d.vectorPixelsToWorld(new Vec2(20, -15)); - vertices[3] = box2d.vectorPixelsToWorld(new Vec2(-10, -10)); - - // Define a polygon (this is what we use for a rectangle) - PolygonShape ps = new PolygonShape(); - ps.set(vertices, vertices.length); - - // Define the body and make it from the shape - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - body = box2d.createBody(bd); - - body.createFixture(ps, 1.0); - - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/NOC_5_4_Polygons.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/NOC_5_4_Polygons.pde deleted file mode 100644 index 283741835..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/NOC_5_4_Polygons.pde +++ /dev/null @@ -1,71 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of falling rectangles - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; -// A list for all of our rectangles -ArrayList polygons; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0, -20); - - // Create ArrayLists - polygons = new ArrayList(); - boundaries = new ArrayList(); - - // Add a bunch of fixed boundaries - boundaries.add(new Boundary(width/4,height-5,width/2-50,10,0)); - boundaries.add(new Boundary(3*width/4,height-50,width/2-50,10,0)); - boundaries.add(new Boundary(width-5,height/2,10,height,0)); - boundaries.add(new Boundary(5,height/2,10,height,0)); -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // Display all the boundaries - for (Boundary wall: boundaries) { - wall.display(); - } - - // Display all the people - for (CustomShape cs: polygons) { - cs.display(); - } - - // people that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = polygons.size()-1; i >= 0; i--) { - CustomShape cs = polygons.get(i); - if (cs.done()) { - polygons.remove(i); - } - } -} - -void mousePressed() { - CustomShape cs = new CustomShape(mouseX,mouseY); - polygons.add(cs); -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/Boundary.pde deleted file mode 100644 index afe2ab2f5..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/Boundary.pde +++ /dev/null @@ -1,61 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class (now incorporates angle) - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_, float a) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.angle = a; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - strokeWeight(1); - rectMode(CENTER); - - float a = b.getAngle(); - - pushMatrix(); - translate(x,y); - rotate(-a); - rect(0,0,w,h); - popMatrix(); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/Lollipop.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/Lollipop.pde deleted file mode 100644 index 65805e008..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/Lollipop.pde +++ /dev/null @@ -1,88 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box -class Lollipop { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - float r; - - // Constructor - Lollipop(float x, float y) { - w = 8; - h = 24; - r = 8; - // Add the box to the box2d world - makeBody(new Vec2(x, y)); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+w*h) { - killBody(); - return true; - } - return false; - } - - // Drawing the lollipop - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(CENTER); - pushMatrix(); - translate(pos.x, pos.y); - rotate(-a); - fill(127); - stroke(0); - strokeWeight(2); - - rect(0,0,w,h); - ellipse(0, -h/2, r*2, r*2); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center) { - - // Define the body and make it from the shape - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - body = box2d.createBody(bd); - - CircleShape circle = new CircleShape(); - circle.m_radius = box2d.scalarPixelsToWorld(r); - Vec2 offset = new Vec2(0,-h/2); - offset = box2d.vectorPixelsToWorld(offset); - circle.m_p.set(offset.x,offset.y); - - PolygonShape ps = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - ps.setAsBox(box2dW, box2dH); - - body.createFixture(ps,1.0); - body.createFixture(circle, 1.0); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/NOC_5_5_MultiShapes.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/NOC_5_5_MultiShapes.pde deleted file mode 100644 index 132b03ba6..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/NOC_5_5_MultiShapes.pde +++ /dev/null @@ -1,71 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of falling rectangles - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; -// A list for all of our rectangles -ArrayList pops; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this,20); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0, -20); - - // Create ArrayLists - pops = new ArrayList(); - boundaries = new ArrayList(); - - // Add a bunch of fixed boundaries - boundaries.add(new Boundary(width/4,height-5,width/2-50,10,0)); - boundaries.add(new Boundary(3*width/4,height-50,width/2-50,10,0)); - boundaries.add(new Boundary(width-5,height/2,10,height,0)); - boundaries.add(new Boundary(5,height/2,10,height,0)); -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // Display all the boundaries - for (Boundary wall: boundaries) { - wall.display(); - } - - // Display all the people - for (Lollipop p: pops) { - p.display(); - } - - // people that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = pops.size()-1; i >= 0; i--) { - Lollipop p = pops.get(i); - if (p.done()) { - pops.remove(i); - } - } -} - -void mousePressed() { - Lollipop p = new Lollipop(mouseX,mouseY); - pops.add(p); -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Boundary.pde deleted file mode 100644 index 9a17026a1..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Boundary.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - rectMode(CENTER); - rect(x,y,w,h); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/NOC_5_6_DistanceJoint.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/NOC_5_6_DistanceJoint.pde deleted file mode 100644 index 489468ebb..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/NOC_5_6_DistanceJoint.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Example demonstrating distance joints -// A bridge is formed by connected a series of particles with joints - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.contacts.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; - - -// A list for all of our rectangles -ArrayList pairs; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Create ArrayLists - pairs = new ArrayList(); - - boundaries = new ArrayList(); - - // Add a bunch of fixed boundaries - boundaries.add(new Boundary(width/4,height-5,width/2-50,10)); - boundaries.add(new Boundary(3*width/4,height-50,width/2-50,10)); - -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // When the mouse is clicked, add a new Box object - - // Display all the boxes - for (Pair p: pairs) { - p.display(); - } - - // Display all the boundaries - for (Boundary wall: boundaries) { - wall.display(); - } - - fill(0); - text("Click mouse to add connected particles.",10,20); -} - -void mousePressed() { - Pair p = new Pair(mouseX,mouseY); - pairs.add(p); -} - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Pair.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Pair.pde deleted file mode 100644 index 780a8e316..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Pair.pde +++ /dev/null @@ -1,47 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Series of Particles connected with distance joints - -class Pair { - - Particle p1; - Particle p2; - - float len; - // Chain constructor - Pair(float x, float y) { - len = 32; - - p1 = new Particle(x,y); - p2 = new Particle(x+random(-1,1),y+random(-1,1)); - - DistanceJointDef djd = new DistanceJointDef(); - // Connection between previous particle and this one - djd.bodyA = p1.body; - djd.bodyB = p2.body; - // Equilibrium length - djd.length = box2d.scalarPixelsToWorld(len); - - // These properties affect how springy the joint is - djd.frequencyHz = 3; // Try a value less than 5 (0 for no elasticity) - djd.dampingRatio = 0.1; // Ranges between 0 and 1 (1 for no springiness) - - // Make the joint. Note we aren't storing a reference to the joint ourselves anywhere! - // We might need to someday, but for now it's ok - DistanceJoint dj = (DistanceJoint) box2d.world.createJoint(djd); - } - - void display() { - Vec2 pos1 = box2d.getBodyPixelCoord(p1.body); - Vec2 pos2 = box2d.getBodyPixelCoord(p2.body); - stroke(0); - strokeWeight(2); - line(pos1.x,pos1.y,pos2.x,pos2.y); - - p1.display(); - p2.display(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Particle.pde deleted file mode 100644 index ed3d34199..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Particle.pde +++ /dev/null @@ -1,76 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - Particle(float x, float y) { - r = 8; - - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x,y); - bd.type = BodyType.DYNAMIC; - body = box2d.world.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x,pos.y); - rotate(a); - fill(127); - stroke(0); - strokeWeight(2); - ellipse(0,0,r*2,r*2); - // Let's add a line so we can see the rotation - line(0,0,r,0); - popMatrix(); - } - - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Box.pde deleted file mode 100644 index acf4abdec..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Box.pde +++ /dev/null @@ -1,72 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box - -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x, float y, float w_, float h_, boolean lock) { - w = w_; - h = h_; - - // Define and create the body - BodyDef bd = new BodyDef(); - bd.position.set(box2d.coordPixelsToWorld(new Vec2(x,y))); - if (lock) bd.type = BodyType.STATIC; - else bd.type = BodyType.DYNAMIC; - - body = box2d.createBody(bd); - - // Define the shape -- a (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5,5),random(2,5))); - body.setAngularVelocity(random(-5,5)); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(PConstants.CENTER); - pushMatrix(); - translate(pos.x,pos.y); - rotate(-a); - fill(127); - stroke(0); - strokeWeight(2); - rect(0,0,w,h); - popMatrix(); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/NOC_5_7_RevoluteJoint.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/NOC_5_7_RevoluteJoint.pde deleted file mode 100644 index 74ab0e3f2..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/NOC_5_7_RevoluteJoint.pde +++ /dev/null @@ -1,87 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Example demonstrating revolute joint - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.contacts.*; - -// A reference to our box2d world -PBox2D box2d; - -// An object to describe a Windmill (two bodies and one joint) -Windmill windmill; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Make the windmill at an x,y location - windmill = new Windmill(width/2,175); - - // Create the empty list - particles = new ArrayList(); - -} - -// Click the mouse to turn on or off the motor -void mousePressed() { - windmill.toggleMotor(); -} - -void draw() { - background(255); - - if (random(1) < 0.1) { - float sz = random(4,8); - particles.add(new Particle(random(width/2-100,width/2+100),-20,sz)); - } - - - // We must always step through time! - box2d.step(); - - // Look at all particles - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.display(); - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - if (p.done()) { - particles.remove(i); - } - } - - // Draw the windmill - windmill.display(); - - String status = "OFF"; - if (windmill.motorOn()) status = "ON"; - - fill(0); - text("Click mouse to toggle motor.\nMotor: " + status,10,height-30); - - -} - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Particle.pde deleted file mode 100644 index 89fb8b443..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Particle.pde +++ /dev/null @@ -1,84 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x, y, r); - body.setUserData(this); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x, pos.y); - - rotate(-a); - fill(127); - stroke(0); - strokeWeight(2); - ellipse(0, 0, r*2, r*2); - // Let's add a line so we can see the rotation - line(0, 0, r, 0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x, y); - bd.type = BodyType.DYNAMIC; - - body = box2d.world.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - - fd.density = 2.0; - fd.friction = 0.01; - fd.restitution = 0.3; // Restitution is bounciness - - body.createFixture(fd); - - // Give it a random initial velocity (and angular velocity) - //body.setLinearVelocity(new Vec2(random(-10f,10f),random(5f,10f))); - body.setAngularVelocity(random(-10, 10)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Windmill.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Windmill.pde deleted file mode 100644 index 5a819a81e..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Windmill.pde +++ /dev/null @@ -1,61 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Class to describe a fixed spinning object - -class Windmill { - - // Our object is two boxes and one joint - // Consider making the fixed box much smaller and not drawing it - RevoluteJoint joint; - Box box1; - Box box2; - - Windmill(float x, float y) { - - // Initialize locations of two boxes - box1 = new Box(x, y-20, 120, 10, false); - box2 = new Box(x, y, 10, 40, true); - - // Define joint as between two bodies - RevoluteJointDef rjd = new RevoluteJointDef(); - - rjd.initialize(box1.body, box2.body, box1.body.getWorldCenter()); - - // Turning on a motor (optional) - rjd.motorSpeed = PI*2; // how fast? - rjd.maxMotorTorque = 1000.0; // how powerful? - rjd.enableMotor = false; // is it on? - - // There are many other properties you can set for a Revolute joint - // For example, you can limit its angle between a minimum and a maximum - // See box2d manual for more - - - // Create the joint - joint = (RevoluteJoint) box2d.world.createJoint(rjd); - } - - // Turn the motor on or off - void toggleMotor() { - joint.enableMotor(!joint.isMotorEnabled()); - } - - boolean motorOn() { - return joint.isMotorEnabled(); - } - - - void display() { - box2.display(); - box1.display(); - - // Draw anchor just for debug - Vec2 anchor = box2d.coordWorldToPixels(box1.body.getWorldCenter()); - fill(0); - noStroke(); - ellipse(anchor.x, anchor.y, 8, 8); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Boundary.pde deleted file mode 100644 index 61491af26..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Boundary.pde +++ /dev/null @@ -1,62 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class (now incorporates angle) - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_, float a) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.angle = a; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - noFill(); - stroke(127); - fill(127); - strokeWeight(1); - rectMode(CENTER); - - float a = b.getAngle(); - - pushMatrix(); - translate(x,y); - rotate(-a); - rect(0,0,w,h); - popMatrix(); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Box.pde deleted file mode 100644 index db935b7a4..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Box.pde +++ /dev/null @@ -1,88 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box - -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x_, float y_) { - float x = x_; - float y = y_; - w = 24; - h = 24; - // Add the box to the box2d world - makeBody(new Vec2(x,y),w,h); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - boolean contains(float x, float y) { - Vec2 worldPoint = box2d.coordPixelsToWorld(x, y); - Fixture f = body.getFixtureList(); - boolean inside = f.testPoint(worldPoint); - return inside; - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(PConstants.CENTER); - pushMatrix(); - translate(pos.x,pos.y); - rotate(a); - fill(127); - stroke(0); - strokeWeight(2); - rect(0,0,w,h); - popMatrix(); - } - - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - // Define and create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - body = box2d.createBody(bd); - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - //body.setMassFromShapes(); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/NOC_5_8_MouseJoint.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/NOC_5_8_MouseJoint.pde deleted file mode 100644 index 0d77536d6..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/NOC_5_8_MouseJoint.pde +++ /dev/null @@ -1,83 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of controlling an object with the mouse (by attaching a spring) - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; - -// Just a single box this time -Box box; - -// The Spring that will attach to the box from the mouse -Spring spring; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Make the box - box = new Box(width/2,height/2); - - // Make the spring (it doesn't really get initialized until the mouse is clicked) - spring = new Spring(); - - // Add a bunch of fixed boundaries - boundaries = new ArrayList(); - boundaries.add(new Boundary(width/2,height-5,width,10,0)); - boundaries.add(new Boundary(width/2,5,width,10,0)); - boundaries.add(new Boundary(width-5,height/2,10,height,0)); - boundaries.add(new Boundary(5,height/2,10,height,0)); -} - -// When the mouse is released we're done with the spring -void mouseReleased() { - spring.destroy(); -} - -// When the mouse is pressed we. . . -void mousePressed() { - // Check to see if the mouse was clicked on the box - if (box.contains(mouseX, mouseY)) { - // And if so, bind the mouse location to the box with a spring - spring.bind(mouseX,mouseY,box); - } -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // Always alert the spring to the new mouse location - spring.update(mouseX,mouseY); - - // Draw the boundaries - for (int i = 0; i < boundaries.size(); i++) { - Boundary wall = (Boundary) boundaries.get(i); - wall.display(); - } - - // Draw the box - box.display(); - // Draw the spring (it only appears when active) - spring.display(); -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Spring.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Spring.pde deleted file mode 100644 index 4daa97765..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Spring.pde +++ /dev/null @@ -1,77 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Class to describe the spring joint (displayed as a line) - -class Spring { - - // This is the box2d object we need to create - MouseJoint mouseJoint; - - Spring() { - // At first it doesn't exist - mouseJoint = null; - } - - // If it exists we set its target to the mouse location - void update(float x, float y) { - if (mouseJoint != null) { - // Always convert to world coordinates! - Vec2 mouseWorld = box2d.coordPixelsToWorld(x,y); - mouseJoint.setTarget(mouseWorld); - } - } - - void display() { - if (mouseJoint != null) { - // We can get the two anchor points - Vec2 v1 = new Vec2(0,0); - mouseJoint.getAnchorA(v1); - Vec2 v2 = new Vec2(0,0); - mouseJoint.getAnchorB(v2); - // Convert them to screen coordinates - v1 = box2d.coordWorldToPixels(v1); - v2 = box2d.coordWorldToPixels(v2); - // And just draw a line - stroke(0); - strokeWeight(1); - line(v1.x,v1.y,v2.x,v2.y); - } - } - - - // This is the key function where - // we attach the spring to an x,y location - // and the Box object's location - void bind(float x, float y, Box box) { - // Define the joint - MouseJointDef md = new MouseJointDef(); - // Body A is just a fake ground body for simplicity (there isn't anything at the mouse) - md.bodyA = box2d.getGroundBody(); - // Body 2 is the box's boxy - md.bodyB = box.body; - // Get the mouse location in world coordinates - Vec2 mp = box2d.coordPixelsToWorld(x,y); - // And that's the target - md.target.set(mp); - // Some stuff about how strong and bouncy the spring should be - md.maxForce = 1000.0 * box.body.m_mass; - md.frequencyHz = 5.0; - md.dampingRatio = 0.9; - - // Make the joint! - mouseJoint = (MouseJoint) box2d.world.createJoint(md); - } - - void destroy() { - // We can get rid of the joint when the mouse is released - if (mouseJoint != null) { - box2d.world.destroyJoint(mouseJoint); - mouseJoint = null; - } - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/Boundary.pde deleted file mode 100644 index ff6226252..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/Boundary.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - - b.setUserData(this); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - rectMode(CENTER); - rect(x,y,w,h); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/NOC_5_9_CollisionListening.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/NOC_5_9_CollisionListening.pde deleted file mode 100644 index c4b1688c7..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/NOC_5_9_CollisionListening.pde +++ /dev/null @@ -1,108 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of controlling an object with our own motion (by attaching a MouseJoint) -// Also demonstrates how to know which object was hit - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.contacts.*; - -// A reference to our box2d world -PBox2D box2d; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -Boundary wall; - -void setup() { - size(640, 360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Turn on collision listening! - box2d.listenForCollisions(); - - // Create the empty list - particles = new ArrayList(); - - wall = new Boundary(width/2, height-5, width, 10); -} - -void draw() { - background(255); - - if (random(1) < 0.1) { - float sz = random(4, 8); - particles.add(new Particle(random(width), 20, sz)); - } - - - // We must always step through time! - box2d.step(); - - // Look at all particles - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.display(); - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - if (p.done()) { - particles.remove(i); - } - } - - wall.display(); -} - - -// Collision event functions! -void beginContact(Contact cp) { - // Get both fixtures - Fixture f1 = cp.getFixtureA(); - Fixture f2 = cp.getFixtureB(); - // Get both bodies - Body b1 = f1.getBody(); - Body b2 = f2.getBody(); - - // Get our objects that reference these bodies - Object o1 = b1.getUserData(); - Object o2 = b2.getUserData(); - - if (o1.getClass() == Particle.class && o2.getClass() == Particle.class) { - Particle p1 = (Particle) o1; - p1.change(); - Particle p2 = (Particle) o2; - p2.change(); - } - -} - -// Objects stop touching each other -void endContact(Contact cp) { -} - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/Particle.pde deleted file mode 100644 index 6d3bf38d5..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/Particle.pde +++ /dev/null @@ -1,90 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - color col; - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x, y, r); - body.setUserData(this); - col = color(127); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Change color when hit - void change() { - col = color(255, 0, 0); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x, pos.y); - rotate(a); - fill(col); - stroke(0); - strokeWeight(2); - ellipse(0, 0, r*2, r*2); - // Let's add a line so we can see the rotation - line(0, 0, r, 0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x, y); - bd.type = BodyType.DYNAMIC; - body = box2d.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - - body.setAngularVelocity(random(-10, 10)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/VectorStuff/VectorStuff.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/VectorStuff/VectorStuff.pde deleted file mode 100644 index 49345575d..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/VectorStuff/VectorStuff.pde +++ /dev/null @@ -1,56 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Just demo-ing the basics of Vec2 vs. PVector - -import org.jbox2d.common.*; - -void setup() { - size(400,300); -// PVector a = new PVector(1,-1); -// PVector b = new PVector(3,4); -// a.add(b); -// -// PVector a = new PVector(1,-1); -// PVector b = new PVector(3,4); -// PVector c = PVector.add(a,b); -// -// Vec2 a = new Vec2(1,-1); -// Vec2 b = new Vec2(3,4); -// a.addLocal(b); -// -// Vec2 a = new Vec2(1,-1); -// Vec2 b = new Vec2(3,4); -// Vec2 c = a.add(b); -// -// PVector a = new PVector(1,-1); -// float n = 5; -// a.mult(n); -// -// PVector a = new PVector(1,-1); -// float n = 5; -// PVector c = PVector.mult(a,n); -// -// Vec2 a = new Vec2(1,-1); -// float n = 5; -// a.mulLocal(n); -// -// Vec2 a = new Vec2(1,-1); -// float n = 5; -// Vec2 c = a.mul(n); -// -// PVector a = new PVector(1,-1); -// float m = a.mag(); -// a.normalize(); - - Vec2 a = new Vec2(1,-1); - float m = a.length(); - a.normalize(); - println(a.x + "," + a.y); -} - -void draw() { - noLoop(); -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/readme.txt b/java/examples/Books/Nature of Code/chp5_physicslibraries/readme.txt deleted file mode 100644 index 99d3a27ad..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -For the box2d examples you will need PBox2D! - -https://github.com/shiffman/PBox2D \ No newline at end of file diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Blanket.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Blanket.pde deleted file mode 100644 index 1efcdb2ef..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Blanket.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Blanket { - ArrayList particles; - ArrayList springs; - - Blanket() { - particles = new ArrayList(); - springs = new ArrayList(); - - int w = 20; - int h = 20; - - float len = 10; - float strength = 0.125; - - for(int y=0; y< h; y++) { - for(int x=0; x < w; x++) { - - Particle p = new Particle(new Vec2D(width/2+x*len-w*len/2,y*len)); - physics.addParticle(p); - particles.add(p); - - if (x > 0) { - Particle previous = particles.get(particles.size()-2); - Connection c = new Connection(p,previous,len,strength); - physics.addSpring(c); - springs.add(c); - } - - if (y > 0) { - Particle above = particles.get(particles.size()-w-1); - Connection c=new Connection(p,above,len,strength); - physics.addSpring(c); - springs.add(c); - } - } - } - - Particle topleft= particles.get(0); - topleft.lock(); - - Particle topright = particles.get(w-1); - topright.lock(); - } - - void display() { - for (Connection c : springs) { - c.display(); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Connection.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Connection.pde deleted file mode 100644 index bbbe2655c..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Connection.pde +++ /dev/null @@ -1,15 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Connection extends VerletSpring2D { - Connection(Particle p1, Particle p2, float len, float strength) { - super(p1,p2,len,strength); - } - - void display() { - stroke(0); - line(a.x,a.y,b.x,b.y); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Exercise_5_13_SoftBodySquareAdapted.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Exercise_5_13_SoftBodySquareAdapted.pde deleted file mode 100644 index cf2b469c7..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Exercise_5_13_SoftBodySquareAdapted.pde +++ /dev/null @@ -1,64 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -/** - * This example is adapted from Karsten Schmidt's SoftBodySquare example - */ - -/*

Softbody square demo is showing how to create a 2D square mesh out of - * verlet particles and make it stable enough to avoid total structural - * deformation by including an inner skeleton.

- * - *

Usage: move mouse to drag/deform the square

- */ - -/* - * Copyright (c) 2008-2009 Karsten Schmidt - * - * This demo & library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * http://creativecommons.org/licenses/LGPL/2.1/ - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - -import toxi.physics2d.behaviors.*; -import toxi.physics2d.*; - -import toxi.geom.*; -import toxi.math.*; - -VerletPhysics2D physics; - -Blanket b; - - -void setup() { - size(640,360); - physics=new VerletPhysics2D(); - physics.addBehavior(new GravityBehavior(new Vec2D(0,0.1))); - - b = new Blanket(); -} - -void draw() { - - background(255); - - physics.update(); - - b.display(); -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Particle.pde deleted file mode 100644 index c4fef5474..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Particle.pde +++ /dev/null @@ -1,21 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Notice how we are using inheritance here! -// We could have just stored a reference to a VerletParticle object -// inside the Particle class, but inheritance is a nice alternative - -class Particle extends VerletParticle2D { - - Particle(Vec2D loc) { - super(loc); - } - - // All we're doing really is adding a display() function to a VerletParticle - void display() { - fill(175); - stroke(0); - ellipse(x,y,16,16); - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Cluster.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Cluster.pde deleted file mode 100644 index db0cfe2c2..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Cluster.pde +++ /dev/null @@ -1,98 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Force directed graph -// Heavily based on: http://code.google.com/p/fidgen/ - -class Cluster { - - // A cluster is a grouping of nodes - ArrayList nodes; - - float diameter; - - // We initialize a Cluster with a number of nodes, a diameter, and centerpoint - Cluster(int n, float d, Vec2D center) { - - // Initialize the ArrayList - nodes = new ArrayList(); - - // Set the diameter - diameter = d; - - // Create the nodes - for (int i = 0; i < n; i++) { - // We can't put them right on top of each other - nodes.add(new Node(center.add(Vec2D.randomVector()))); - } - - // Connect all the nodes with a Spring - for (int i = 1; i < nodes.size(); i++) { - VerletParticle2D pi = (VerletParticle2D) nodes.get(i); - for (int j = 0; j < i; j++) { - VerletParticle2D pj = (VerletParticle2D) nodes.get(j); - // A Spring needs two particles, a resting length, and a strength - physics.addSpring(new VerletSpring2D(pi,pj,diameter,0.01)); - } - } - } - - void display() { - // Show all the nodes - for (int i = 0; i < nodes.size(); i++) { - Node n = (Node) nodes.get(i); - n.display(); - } - } - - // This functons connects one cluster to another - // Each point of one cluster connects to each point of the other cluster - // The connection is a "VerletMinDistanceSpring" - // A VerletMinDistanceSpring is a string which only enforces its rest length if the - // current distance is less than its rest length. This is handy if you just want to - // ensure objects are at least a certain distance from each other, but don't - // care if it's bigger than the enforced minimum. - void connect(Cluster other) { - ArrayList otherNodes = other.getNodes(); - for (int i = 0; i < nodes.size(); i++) { - VerletParticle2D pi = (VerletParticle2D) nodes.get(i); - for (int j = 0; j < otherNodes.size(); j++) { - VerletParticle2D pj = (VerletParticle2D) otherNodes.get(j); - // Create the spring - physics.addSpring(new VerletMinDistanceSpring2D(pi,pj,(diameter+other.diameter)*0.5,0.05)); - } - } - } - - - // Draw all the internal connections - void showConnections() { - stroke(0,150); - for (int i = 0; i < nodes.size(); i++) { - VerletParticle2D pi = (VerletParticle2D) nodes.get(i); - for (int j = i+1; j < nodes.size(); j++) { - VerletParticle2D pj = (VerletParticle2D) nodes.get(j); - line(pi.x,pi.y,pj.x,pj.y); - } - } - } - - // Draw all the connections between this Cluster and another Cluster - void showConnections(Cluster other) { - stroke(0,50); - strokeWeight(2); - ArrayList otherNodes = other.getNodes(); - for (int i = 0; i < nodes.size(); i++) { - VerletParticle2D pi = (VerletParticle2D) nodes.get(i); - for (int j = 0; j < otherNodes.size(); j++) { - VerletParticle2D pj = (VerletParticle2D) otherNodes.get(j); - line(pi.x,pi.y,pj.x,pj.y); - } - } - } - - ArrayList getNodes() { - return nodes; - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Exercise_5_15_ForceDirectedGraph.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Exercise_5_15_ForceDirectedGraph.pde deleted file mode 100644 index f3dd8e190..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Exercise_5_15_ForceDirectedGraph.pde +++ /dev/null @@ -1,133 +0,0 @@ -/** - *

Force directed graph, - * heavily based on: fid.gen
- * The Nature of Code
- * Spring 2010

- */ - -/* - * Copyright (c) 2010 Daniel Shiffman - * - * This demo & library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * http://creativecommons.org/licenses/LGPL/2.1/ - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -import toxi.geom.*; -import toxi.physics2d.*; -import toxi.physics2d.behaviors.*; - -// Reference to physics world -VerletPhysics2D physics; - -// A list of cluster objects -ArrayList clusters; - -// Boolean that indicates whether we draw connections or not -boolean showPhysics = true; -boolean showParticles = true; - -// Font -PFont f; - -void setup() { - size(640,360); - f = createFont("Georgia",12,true); - - // Initialize the physics - physics=new VerletPhysics2D(); - physics.setWorldBounds(new Rect(10,10,width-20,height-20)); - - // Spawn a new random graph - newGraph(); - -} - -// Spawn a new random graph -void newGraph() { - - // Clear physics - physics.clear(); - - // Create new ArrayList (clears old one) - clusters = new ArrayList(); - - // Create 8 random clusters - for (int i = 0; i < 8; i++) { - Vec2D center = new Vec2D(width/2,height/2); - clusters.add(new Cluster((int) random(3,8),random(20,100),center)); - } - - // All clusters connect to all clusters - for (int i = 0; i < clusters.size(); i++) { - for (int j = i+1; j < clusters.size(); j++) { - Cluster ci = (Cluster) clusters.get(i); - Cluster cj = (Cluster) clusters.get(j); - ci.connect(cj); - } - } - -} - -void draw() { - - // Update the physics world - physics.update(); - - background(255); - - // Display all points - if (showParticles) { - for (int i = 0; i < clusters.size(); i++) { - Cluster c = (Cluster) clusters.get(i); - c.display(); - } - } - - // If we want to see the physics - if (showPhysics) { - for (int i = 0; i < clusters.size(); i++) { - // Cluster internal connections - Cluster ci = (Cluster) clusters.get(i); - ci.showConnections(); - - // Cluster connections to other clusters - for (int j = i+1; j < clusters.size(); j++) { - Cluster cj = (Cluster) clusters.get(j); - ci.showConnections(cj); - } - } - } - - // Instructions - fill(0); - textFont(f); - text("'p' to display or hide particles\n'c' to display or hide connections\n'n' for new graph",10,20); -} - -// Key press commands -void keyPressed() { - if (key == 'c') { - showPhysics = !showPhysics; - if (!showPhysics) showParticles = true; - } - else if (key == 'p') { - showParticles = !showParticles; - if (!showParticles) showPhysics = true; - } - else if (key == 'n') { - newGraph(); - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Node.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Node.pde deleted file mode 100644 index 54dc835b4..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Node.pde +++ /dev/null @@ -1,26 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Force directed graph -// Heavily based on: http://code.google.com/p/fidgen/ - -// Notice how we are using inheritance here! -// We could have just stored a reference to a VerletParticle object -// inside the Node class, but inheritance is a nice alternative - -class Node extends VerletParticle2D { - - Node(Vec2D pos) { - super(pos); - } - - // All we're doing really is adding a display() function to a VerletParticle - void display() { - fill(0,150); - stroke(0); - strokeWeight(2); - ellipse(x,y,16,16); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_10_SimpleSpring/NOC_5_10_SimpleSpring.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_10_SimpleSpring/NOC_5_10_SimpleSpring.pde deleted file mode 100644 index eeaaf48e0..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_10_SimpleSpring/NOC_5_10_SimpleSpring.pde +++ /dev/null @@ -1,68 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Toxiclibs Spring - -import toxi.physics2d.*; -import toxi.physics2d.behaviors.*; -import toxi.geom.*; - -// Reference to physics world -VerletPhysics2D physics; - -Particle p1; -Particle p2; - -void setup() { - size(640,360); - - // Initialize the physics - physics=new VerletPhysics2D(); - physics.addBehavior(new GravityBehavior(new Vec2D(0,0.5))); - - // Set the world's bounding box - physics.setWorldBounds(new Rect(0,0,width,height)); - - // Make two particles - p1 = new Particle(new Vec2D(width/2,20)); - p2 = new Particle(new Vec2D(width/2+160,20)); - // Lock one in place - p1.lock(); - - // Make a spring connecting both Particles - VerletSpring2D spring=new VerletSpring2D(p1,p2,160,0.01); - - // Anything we make, we have to add into the physics world - physics.addParticle(p1); - physics.addParticle(p2); - physics.addSpring(spring); -} - -void draw() { - - // Update the physics world - physics.update(); - - background(255); - - // Draw a line between the particles - stroke(0); - strokeWeight(2); - line(p1.x,p1.y,p2.x,p2.y); - - // Display the particles - p1.display(); - p2.display(); - - // Move the second one according to the mouse - if (mousePressed) { - p2.lock(); - p2.x = mouseX; - p2.y = mouseY; - p2.unlock(); - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_10_SimpleSpring/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_10_SimpleSpring/Particle.pde deleted file mode 100644 index 06bb533dc..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_10_SimpleSpring/Particle.pde +++ /dev/null @@ -1,22 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Notice how we are using inheritance here! - -// We could have just stored a reference to a VerletParticle object -// inside the Particle class, but inheritance is a nice alternative - -class Particle extends VerletParticle2D { - - Particle(Vec2D loc) { - super(loc); - } - - // All we're doing really is adding a display() function to a VerletParticle - void display() { - fill(127); - stroke(0); - strokeWeight(2); - ellipse(x,y,32,32); - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/Chain.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/Chain.pde deleted file mode 100644 index 91b68c9b6..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/Chain.pde +++ /dev/null @@ -1,103 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A soft pendulum (series of connected springs) - -class Chain { - - // Chain properties - float totalLength; // How long - int numPoints; // How many points - float strength; // Strength of springs - float radius; // Radius of ball at tail - - // This list is redundant since we can ask for physics.particles, but in case we have many of these - // it's a convenient to keep track of our own list - ArrayList particles; - - // Let's keep an extra reference to the tail particle - // This is just the last particle in the ArrayList - Particle tail; - - // Some variables for mouse dragging - PVector offset = new PVector(); - boolean dragged = false; - - // Chain constructor - Chain(float l, int n, float r, float s) { - particles = new ArrayList(); - - totalLength = l; - numPoints = n; - radius = r; - strength = s; - - float len = totalLength / numPoints; - - // Here is the real work, go through and add particles to the chain itself - for(int i=0; i < numPoints; i++) { - // Make a new particle with an initial starting location - Particle particle=new Particle(width/2,i*len); - - // Redundancy, we put the particles both in physics and in our own ArrayList - physics.addParticle(particle); - particles.add(particle); - - // Connect the particles with a Spring (except for the head) - if (i != 0) { - Particle previous = particles.get(i-1); - VerletSpring2D spring = new VerletSpring2D(particle,previous,len,strength); - // Add the spring to the physics world - physics.addSpring(spring); - } - } - - // Keep the top fixed - Particle head=particles.get(0); - head.lock(); - - // Store reference to the tail - tail = particles.get(numPoints-1); - tail.radius = radius; - } - - // Check if a point is within the ball at the end of the chain - // If so, set dragged = true; - void contains(int x, int y) { - float d = dist(x,y,tail.x,tail.y); - if (d < radius) { - offset.x = tail.x - x; - offset.y = tail.y - y; - tail.lock(); - dragged = true; - } - } - - // Release the ball - void release() { - tail.unlock(); - dragged = false; - } - - // Update tail location if being dragged - void updateTail(int x, int y) { - if (dragged) { - tail.set(x+offset.x,y+offset.y); - } - } - - // Draw the chain - void display() { - // Draw line connecting all points - beginShape(); - stroke(0); - strokeWeight(2); - noFill(); - for (Particle p : particles) { - vertex(p.x,p.y); - } - endShape(); - tail.display(); - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/NOC_5_11_SoftStringPendulum.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/NOC_5_11_SoftStringPendulum.pde deleted file mode 100644 index 1e9b6aa25..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/NOC_5_11_SoftStringPendulum.pde +++ /dev/null @@ -1,68 +0,0 @@ -/** - *

A soft pendulum (series of connected springs)
- * The Nature of Code
- * Spring 2010

- */ - -/* - * Copyright (c) 2010 Daniel Shiffman - * - * This demo & library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * http://creativecommons.org/licenses/LGPL/2.1/ - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -import toxi.physics2d.*; -import toxi.physics2d.behaviors.*; -import toxi.geom.*; - -// Reference to physics "world" (2D) -VerletPhysics2D physics; - -// Our "Chain" object -Chain chain; - -void setup() { - size(640, 360); - // Initialize the physics world - physics=new VerletPhysics2D(); - physics.addBehavior(new GravityBehavior(new Vec2D(0, 0.1))); - physics.setWorldBounds(new Rect(0, 0, width, height)); - - // Initialize the chain - chain = new Chain(180, 20, 16, 0.2); -} - -void draw() { - background(255); - - // Update physics - physics.update(); - // Update chain's tail according to mouse location - chain.updateTail(mouseX, mouseY); - // Display chain - chain.display(); -} - -void mousePressed() { - // Check to see if we're grabbing the chain - chain.contains(mouseX, mouseY); -} - -void mouseReleased() { - // Release the chain - chain.release(); -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/Particle.pde deleted file mode 100644 index 99ca7dac3..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Notice how we are using inheritance here! -// We could have just stored a reference to a VerletParticle object -// inside the Particle class, but inheritance is a nice alternative - -class Particle extends VerletParticle2D { - - float radius = 4; // Adding a radius for each particle - - Particle(float x, float y) { - super(x,y); - } - - // All we're doing really is adding a display() function to a VerletParticle - void display() { - fill(127); - stroke(0); - strokeWeight(2); - ellipse(x,y,radius*2,radius*2); - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/Cluster.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/Cluster.pde deleted file mode 100644 index 241520f2b..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/Cluster.pde +++ /dev/null @@ -1,64 +0,0 @@ -// The Nature of Code -// -// Spring 2010 -// Toxiclibs example: http://toxiclibs.org/ - -// Force directed graph -// Heavily based on: http://code.google.com/p/fidgen/ - -class Cluster { - - // A cluster is a grouping of nodes - ArrayList nodes; - - float diameter; - - // We initialize a Cluster with a number of nodes, a diameter, and centerpoint - Cluster(int n, float d, Vec2D center) { - - // Initialize the ArrayList - nodes = new ArrayList(); - - // Set the diameter - diameter = d; - - // Create the nodes - for (int i = 0; i < n; i++) { - // We can't put them right on top of each other - nodes.add(new Node(center.add(Vec2D.randomVector()))); - } - - // Connect all the nodes with a Spring - for (int i = 0; i < nodes.size()-1; i++) { - VerletParticle2D ni = nodes.get(i); - for (int j = i+1; j < nodes.size(); j++) { - VerletParticle2D nj = nodes.get(j); - // A Spring needs two particles, a resting length, and a strength - physics.addSpring(new VerletSpring2D(ni, nj, diameter, 0.01)); - } - } - } - - void display() { - // Show all the nodes - for (Node n : nodes) { - n.display(); - } - } - - - // Draw all the internal connections - void showConnections() { - stroke(0, 150); - strokeWeight(2); - for (int i = 0; i < nodes.size()-1; i++) { - VerletParticle2D pi = (VerletParticle2D) nodes.get(i); - for (int j = i+1; j < nodes.size(); j++) { - VerletParticle2D pj = (VerletParticle2D) nodes.get(j); - - line(pi.x, pi.y, pj.x, pj.y); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/NOC_5_12_SimpleCluster.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/NOC_5_12_SimpleCluster.pde deleted file mode 100644 index 043803d67..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/NOC_5_12_SimpleCluster.pde +++ /dev/null @@ -1,74 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Force directed graph, -// heavily based on: http://code.google.com/p/fidgen/ - -import toxi.geom.*; -import toxi.physics2d.*; - -// Reference to physics world -VerletPhysics2D physics; - -// A list of cluster objects -Cluster cluster; - -// Boolean that indicates whether we draw connections or not -boolean showPhysics = true; -boolean showParticles = true; - -// Font -PFont f; - -void setup() { - size(640, 360); - f = createFont("Georgia", 12, true); - - // Initialize the physics - physics=new VerletPhysics2D(); - physics.setWorldBounds(new Rect(10, 10, width-20, height-20)); - - // Spawn a new random graph - cluster = new Cluster(8, 100, new Vec2D(width/2, height/2)); -} - -void draw() { - - // Update the physics world - physics.update(); - - background(255); - - // Display all points - if (showParticles) { - cluster.display(); - } - - // If we want to see the physics - if (showPhysics) { - cluster.showConnections(); - } - - // Instructions - fill(0); - textFont(f); - text("'p' to display or hide particles\n'c' to display or hide connections\n'n' for new graph",10,20); -} - -// Key press commands -void keyPressed() { - if (key == 'c') { - showPhysics = !showPhysics; - if (!showPhysics) showParticles = true; - } - else if (key == 'p') { - showParticles = !showParticles; - if (!showParticles) showPhysics = true; - } - else if (key == 'n') { - physics.clear(); - cluster = new Cluster(int(random(2, 20)), random(10, width/2), new Vec2D(width/2, height/2)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/Node.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/Node.pde deleted file mode 100644 index 6fe3b5144..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/Node.pde +++ /dev/null @@ -1,27 +0,0 @@ -// The Nature of Code -// -// Spring 2010 -// Toxiclibs example: http://toxiclibs.org/ - -// Force directed graph -// Heavily based on: http://code.google.com/p/fidgen/ - -// Notice how we are using inheritance here! -// We could have just stored a reference to a VerletParticle object -// inside the Node class, but inheritance is a nice alternative - -class Node extends VerletParticle2D { - - Node(Vec2D pos) { - super(pos); - } - - // All we're doing really is adding a display() function to a VerletParticle - void display() { - fill(0,150); - stroke(0); - strokeWeight(2); - ellipse(x,y,16,16); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/Attractor.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/Attractor.pde deleted file mode 100644 index 69e7ecb1d..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/Attractor.pde +++ /dev/null @@ -1,21 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Attractor extends VerletParticle2D { - - float r; - - Attractor (Vec2D loc) { - super (loc); - r = 24; - physics.addParticle(this); - physics.addBehavior(new AttractionBehavior(this, width, 0.1)); - } - - void display () { - fill(0); - ellipse (x, y, r*2, r*2); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/NOC_5_13_AttractRepel.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/NOC_5_13_AttractRepel.pde deleted file mode 100644 index 4359d202c..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/NOC_5_13_AttractRepel.pde +++ /dev/null @@ -1,40 +0,0 @@ -import toxi.geom.*; -import toxi.physics2d.*; -import toxi.physics2d.behaviors.*; - -ArrayList particles; -Attractor attractor; - -VerletPhysics2D physics; - -void setup () { - size (640, 360); - physics = new VerletPhysics2D (); - physics.setDrag (0.01); - - particles = new ArrayList(); - for (int i = 0; i < 50; i++) { - particles.add(new Particle(new Vec2D(random(width),random(height)))); - } - - attractor = new Attractor(new Vec2D(width/2,height/2)); -} - - -void draw () { - background (255); - physics.update (); - - attractor.display(); - for (Particle p: particles) { - p.display(); - } - - if (mousePressed) { - attractor.lock(); - attractor.set(mouseX,mouseY); - } else { - attractor.unlock(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/Particle.pde deleted file mode 100644 index 8096405d4..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// class Spore extends the class "VerletParticle2D" -class Particle extends VerletParticle2D { - - float r; - - Particle (Vec2D loc) { - super(loc); - r = 8; - physics.addParticle(this); - physics.addBehavior(new AttractionBehavior(this, r*4, -1)); - } - - void display () { - fill (127); - stroke (0); - strokeWeight(2); - ellipse (x, y, r*2, r*2); - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Alignment/Alignment.pde b/java/examples/Books/Nature of Code/chp6_agents/Alignment/Alignment.pde deleted file mode 100644 index 09404bbe5..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Alignment/Alignment.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Separation -// Via Reynolds: http://www.red3d.com/cwr/steer/ - -// A list of vehicles -ArrayList vehicles; - -void setup() { - size(640,360); - // We are now making random vehicles and storing them in an ArrayList - vehicles = new ArrayList(); - for (int i = 0; i < 100; i++) { - vehicles.add(new Vehicle(random(width),random(height))); - } -} - -void draw() { - background(255); - - for (Vehicle v : vehicles) { - // Path following and separation are worked on in this function - v.align(vehicles); - // Call the generic run method (update, borders, display, etc.) - v.update(); - v.borders(); - v.display(); - } - - // Instructions - fill(0); - text("Drag the mouse to generate new vehicles.",10,height-16); -} - - -void mouseDragged() { - vehicles.add(new Vehicle(mouseX,mouseY)); -} - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Alignment/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/Alignment/Vehicle.pde deleted file mode 100644 index 43e3f8bbc..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Alignment/Vehicle.pde +++ /dev/null @@ -1,89 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Vehicle class - -class Vehicle { - - // All the usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - // Constructor initialize all values - Vehicle(float x, float y) { - location = new PVector(x, y); - r = 12; - maxspeed = 3; - maxforce = 0.2; - acceleration = new PVector(0, 0); - velocity = PVector.random2D(); - velocity.mult(random(1,4)); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // Alignment - // For every nearby boid in the system, calculate the average velocity - void align (ArrayList boids) { - float neighbordist = 30; - PVector sum = new PVector(0, 0); - int count = 0; - for (Vehicle other : vehicles) { - float d = PVector.dist(location, other.location); - if ((d > 0) && (d < neighbordist)) { - sum.add(other.velocity); - count++; - } - } - if (count > 0) { - sum.div((float)count); - sum.normalize(); - sum.mult(maxspeed); - PVector steer = PVector.sub(sum, velocity); - steer.limit(maxforce); - applyForce(steer); - } - } - - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void display() { - fill(175); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - ellipse(0, 0, r, r); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_04_Wander/Exercise_6_04_Wander.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_04_Wander/Exercise_6_04_Wander.pde deleted file mode 100644 index daeda1da7..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_04_Wander/Exercise_6_04_Wander.pde +++ /dev/null @@ -1,28 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Demonstration of Craig Reynolds' "Wandering" behavior -// See: http://www.red3d.com/cwr/ - -// Click mouse to turn on and off rendering of the wander circle - -Vehicle wanderer; -boolean debug = true; - -void setup() { - size(640,360); - wanderer = new Vehicle(width/2,height/2); -} - -void draw() { - background(255); - wanderer.wander(); - wanderer.run(); -} - -void mousePressed() { - debug = !debug; -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_04_Wander/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_04_Wander/Vehicle.pde deleted file mode 100644 index fb979e8c5..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_04_Wander/Vehicle.pde +++ /dev/null @@ -1,123 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// The "Vehicle" class (for wandering) - -class Vehicle { - - PVector location; - PVector velocity; - PVector acceleration; - float r; - float wandertheta; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(float x, float y) { - acceleration = new PVector(0,0); - velocity = new PVector(0,0); - location = new PVector(x,y); - r = 6; - wandertheta = 0; - maxspeed = 2; - maxforce = 0.05; - } - - void run() { - update(); - borders(); - display(); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void wander() { - float wanderR = 25; // Radius for our "wander circle" - float wanderD = 80; // Distance for our "wander circle" - float change = 0.3; - wandertheta += random(-change,change); // Randomly change wander theta - - // Now we have to calculate the new location to steer towards on the wander circle - PVector circleloc = velocity.get(); // Start with velocity - circleloc.normalize(); // Normalize to get heading - circleloc.mult(wanderD); // Multiply by distance - circleloc.add(location); // Make it relative to boid's location - - float h = velocity.heading2D(); // We need to know the heading to offset wandertheta - - PVector circleOffSet = new PVector(wanderR*cos(wandertheta+h),wanderR*sin(wandertheta+h)); - PVector target = PVector.add(circleloc,circleOffSet); - seek(target); - - // Render wandering circle, etc. - if (debug) drawWanderStuff(location,circleloc,target,wanderR); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - - // A method that calculates and applies a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - void seek(PVector target) { - PVector desired = PVector.sub(target,location); // A vector pointing from the location to the target - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus Velocity - PVector steer = PVector.sub(desired,velocity); - steer.limit(maxforce); // Limit to maximum steering force - - applyForce(steer); - } - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(127); - stroke(0); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } -} - - -// A method just to draw the circle associated with wandering -void drawWanderStuff(PVector location, PVector circle, PVector target, float rad) { - stroke(0); - noFill(); - ellipseMode(CENTER); - ellipse(circle.x,circle.y,rad*2,rad*2); - ellipse(target.x,target.y,4,4); - line(location.x,location.y,circle.x,circle.y); - line(circle.x,circle.y,target.x,target.y); -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/Exercise_6_08_FlowField3DNoise.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/Exercise_6_08_FlowField3DNoise.pde deleted file mode 100644 index 88a6b3bf6..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/Exercise_6_08_FlowField3DNoise.pde +++ /dev/null @@ -1,52 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following -// Via Reynolds: http://www.red3d.com/cwr/steer/FlowFollow.html - -// Using this variable to decide whether to draw all the stuff -boolean debug = true; - -// Flowfield object -FlowField flowfield; -// An ArrayList of vehicles -ArrayList vehicles; - -void setup() { - size(640, 360); - // Make a new flow field with "resolution" of 16 - flowfield = new FlowField(20); - vehicles = new ArrayList(); - // Make a whole bunch of vehicles with random maxspeed and maxforce values - for (int i = 0; i < 120; i++) { - vehicles.add(new Vehicle(new PVector(random(width), random(height)), random(2, 5), random(0.1, 0.5))); - } -} - -void draw() { - background(255); - flowfield.update(); - - // Display the flowfield in "debug" mode - if (debug) flowfield.display(); - // Tell all the vehicles to follow the flow field - for (Vehicle v : vehicles) { - v.follow(flowfield); - v.run(); - } - - // Instructions - fill(0); - text("Hit space bar to toggle debugging lines.\nClick the mouse to generate a new flow field.",10,height-20); -} - - -void keyPressed() { - if (key == ' ') { - debug = !debug; - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/FlowField.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/FlowField.pde deleted file mode 100644 index f10539eb6..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/FlowField.pde +++ /dev/null @@ -1,81 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -class FlowField { - - // A flow field is a two dimensional array of PVectors - PVector[][] field; - int cols, rows; // Columns and Rows - int resolution; // How large is each "cell" of the flow field - - float zoff = 0.0; // 3rd dimension of noise - - FlowField(int r) { - resolution = r; - // Determine the number of columns and rows based on sketch's width and height - cols = width/resolution; - rows = height/resolution; - field = new PVector[cols][rows]; - update(); - } - - void update() { - float xoff = 0; - for (int i = 0; i < cols; i++) { - float yoff = 0; - for (int j = 0; j < rows; j++) { - float theta = map(noise(xoff,yoff,zoff),0,1,0,TWO_PI); - // Make a vector from an angle - field[i][j] = PVector.fromAngle(theta); - yoff += 0.1; - } - xoff += 0.1; - } - // Animate by changing 3rd dimension of noise every frame - zoff += 0.01; - } - - // Draw every vector - void display() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - drawVector(field[i][j],i*resolution,j*resolution,resolution-2); - } - } - - } - - // Renders a vector object 'v' as an arrow and a location 'x,y' - void drawVector(PVector v, float x, float y, float scayl) { - pushMatrix(); - float arrowsize = 4; - // Translate to location to render vector - translate(x,y); - stroke(0,150); - // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate - rotate(v.heading2D()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) - line(0,0,len,0); - //line(len,0,len-arrowsize,+arrowsize/2); - //line(len,0,len-arrowsize,-arrowsize/2); - popMatrix(); - } - - PVector lookup(PVector lookup) { - int column = int(constrain(lookup.x/resolution,0,cols-1)); - int row = int(constrain(lookup.y/resolution,0,rows-1)); - return field[column][row].get(); - } - - -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/Vehicle.pde deleted file mode 100644 index 2326a1e7c..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/Vehicle.pde +++ /dev/null @@ -1,87 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -class Vehicle { - - // The usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(PVector l, float ms, float mf) { - location = l.get(); - r = 3.0; - maxspeed = ms; - maxforce = mf; - acceleration = new PVector(0,0); - velocity = new PVector(0,0); - } - - public void run() { - update(); - borders(); - display(); - } - - - // Implementing Reynolds' flow field following algorithm - // http://www.red3d.com/cwr/steer/FlowFollow.html - void follow(FlowField flow) { - // What is the vector at that spot in the flow field? - PVector desired = flow.lookup(location); - // Scale it up by maxspeed - desired.mult(maxspeed); - // Steering is desired minus velocity - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); // Limit to maximum steering force - applyForce(steer); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_09_AngleBetween/Exercise_6_09_AngleBetween.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_09_AngleBetween/Exercise_6_09_AngleBetween.pde deleted file mode 100644 index b5f145f6b..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_09_AngleBetween/Exercise_6_09_AngleBetween.pde +++ /dev/null @@ -1,54 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Angle Between Two Vectors -// Using the dot product to compute the angle between two vectors - -void setup() { - size(640, 360); -} - -void draw() { - background(255); - - // A "vector" (really a point) to store the mouse location and screen center location - PVector mouseLoc = new PVector(mouseX, mouseY); - PVector centerLoc = new PVector(width/2, height/2); - - // Aha, a vector to store the displacement between the mouse and center - PVector v = PVector.sub(mouseLoc, centerLoc); - v.normalize(); - v.mult(75); - - PVector xaxis = new PVector(75, 0); - // Render the vector - drawVector(v, centerLoc, 1.0); - drawVector(xaxis, centerLoc, 1.0); - - - float theta = PVector.angleBetween(v, xaxis); - - fill(0); - text(int(degrees(theta)) + " degrees\n" + theta + " radians", 10, 160); -} - -// Renders a vector object 'v' as an arrow and a location 'loc' -void drawVector(PVector v, PVector loc, float scayl) { - pushMatrix(); - float arrowsize = 6; - // Translate to location to render vector - translate(loc.x, loc.y); - stroke(0); - strokeWeight(2); - // Call vector heading function to get direction (pointing up is a heading of 0) - rotate(v.heading2D()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow - line(0, 0, len, 0); - line(len, 0, len-arrowsize, +arrowsize/2); - line(len, 0, len-arrowsize, -arrowsize/2); - popMatrix(); -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Exercise_6_13_CrowdPathFollowing.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Exercise_6_13_CrowdPathFollowing.pde deleted file mode 100644 index 43be58653..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Exercise_6_13_CrowdPathFollowing.pde +++ /dev/null @@ -1,77 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Crowd Path Following -// Via Reynolds: http://www.red3d.com/cwr/steer/CrowdPath.html - -// Using this variable to decide whether to draw all the stuff -boolean debug = false; - - -// A path object (series of connected points) -Path path; - -// Two vehicles -ArrayList vehicles; - -void setup() { - size(640,360); - // Call a function to generate new Path object - newPath(); - - // We are now making random vehicles and storing them in an ArrayList - vehicles = new ArrayList(); - for (int i = 0; i < 120; i++) { - newVehicle(random(width),random(height)); - } -} - -void draw() { - background(255); - // Display the path - path.display(); - - for (Vehicle v : vehicles) { - // Path following and separation are worked on in this function - v.applyBehaviors(vehicles,path); - // Call the generic run method (update, borders, display, etc.) - v.run(); - } - - // Instructions - fill(0); - textAlign(CENTER); - text("Hit 'd' to toggle debugging lines.\nClick the mouse to generate new vehicles.",width/2,height-20); -} - -void newPath() { - // A path is a series of connected points - // A more sophisticated path might be a curve - path = new Path(); - float offset = 30; - path.addPoint(offset,offset); - path.addPoint(width-offset,offset); - path.addPoint(width-offset,height-offset); - path.addPoint(width/2,height-offset*3); - path.addPoint(offset,height-offset); -} - -void newVehicle(float x, float y) { - float maxspeed = random(2,4); - float maxforce = 0.3; - vehicles.add(new Vehicle(new PVector(x,y),maxspeed,maxforce)); -} - -void keyPressed() { - if (key == 'd') { - debug = !debug; - } -} - -void mousePressed() { - newVehicle(mouseX,mouseY); -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Path.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Path.pde deleted file mode 100644 index 755be5b1f..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Path.pde +++ /dev/null @@ -1,52 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Path Following - -class Path { - - // A Path is an arraylist of points (PVector objects) - ArrayList points; - // A path has a radius, i.e how far is it ok for the boid to wander off - float radius; - - Path() { - // Arbitrary radius of 20 - radius = 20; - points = new ArrayList(); - } - - // Add a point to the path - void addPoint(float x, float y) { - PVector point = new PVector(x, y); - points.add(point); - } - - // Draw the path - void display() { - strokeJoin(ROUND); - - // Draw thick line for radius - stroke(175); - strokeWeight(radius*2); - noFill(); - beginShape(); - for (PVector v : points) { - vertex(v.x, v.y); - } - endShape(CLOSE); - // Draw thin line for center of path - stroke(0); - strokeWeight(1); - noFill(); - beginShape(); - for (PVector v : points) { - vertex(v.x, v.y); - } - endShape(CLOSE); - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Vehicle.pde deleted file mode 100644 index 14a2947e7..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Vehicle.pde +++ /dev/null @@ -1,240 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Path Following -// Vehicle class - -class Vehicle { - - // All the usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - // Constructor initialize all values - Vehicle( PVector l, float ms, float mf) { - location = l.get(); - r = 12; - maxspeed = ms; - maxforce = mf; - acceleration = new PVector(0, 0); - velocity = new PVector(maxspeed, 0); - } - - // A function to deal with path following and separation - void applyBehaviors(ArrayList vehicles, Path path) { - // Follow path force - PVector f = follow(path); - // Separate from other boids force - PVector s = separate(vehicles); - // Arbitrary weighting - f.mult(3); - s.mult(1); - // Accumulate in acceleration - applyForce(f); - applyForce(s); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - - - // Main "run" function - public void run() { - update(); - borders(); - render(); - } - - - // This function implements Craig Reynolds' path following algorithm - // http://www.red3d.com/cwr/steer/PathFollow.html - PVector follow(Path p) { - - // Predict location 25 (arbitrary choice) frames ahead - PVector predict = velocity.get(); - predict.normalize(); - predict.mult(25); - PVector predictLoc = PVector.add(location, predict); - - // Now we must find the normal to the path from the predicted location - // We look at the normal for each line segment and pick out the closest one - PVector normal = null; - PVector target = null; - float worldRecord = 1000000; // Start with a very high worldRecord distance that can easily be beaten - - // Loop through all points of the path - for (int i = 0; i < p.points.size(); i++) { - - // Look at a line segment - PVector a = p.points.get(i); - PVector b = p.points.get((i+1)%p.points.size()); // Note Path has to wraparound - - // Get the normal point to that line - PVector normalPoint = getNormalPoint(predictLoc, a, b); - - // Check if normal is on line segment - PVector dir = PVector.sub(b, a); - // If it's not within the line segment, consider the normal to just be the end of the line segment (point b) - //if (da + db > line.mag()+1) { - if (normalPoint.x < min(a.x,b.x) || normalPoint.x > max(a.x,b.x) || normalPoint.y < min(a.y,b.y) || normalPoint.y > max(a.y,b.y)) { - normalPoint = b.get(); - // If we're at the end we really want the next line segment for looking ahead - a = p.points.get((i+1)%p.points.size()); - b = p.points.get((i+2)%p.points.size()); // Path wraps around - dir = PVector.sub(b, a); - } - - // How far away are we from the path? - float d = PVector.dist(predictLoc, normalPoint); - // Did we beat the worldRecord and find the closest line segment? - if (d < worldRecord) { - worldRecord = d; - normal = normalPoint; - - // Look at the direction of the line segment so we can seek a little bit ahead of the normal - dir.normalize(); - // This is an oversimplification - // Should be based on distance to path & velocity - dir.mult(25); - target = normal.get(); - target.add(dir); - - } - } - - // Draw the debugging stuff - if (debug) { - // Draw predicted future location - stroke(0); - fill(0); - line(location.x, location.y, predictLoc.x, predictLoc.y); - ellipse(predictLoc.x, predictLoc.y, 4, 4); - - // Draw normal location - stroke(0); - fill(0); - ellipse(normal.x, normal.y, 4, 4); - // Draw actual target (red if steering towards it) - line(predictLoc.x, predictLoc.y, target.x, target.y); - if (worldRecord > p.radius) fill(255, 0, 0); - noStroke(); - ellipse(target.x, target.y, 8, 8); - } - - // Only if the distance is greater than the path's radius do we bother to steer - if (worldRecord > p.radius) { - return seek(target); - } - else { - return new PVector(0, 0); - } - } - - - // A function to get the normal point from a point (p) to a line segment (a-b) - // This function could be optimized to make fewer new Vector objects - PVector getNormalPoint(PVector p, PVector a, PVector b) { - // Vector from a to p - PVector ap = PVector.sub(p, a); - // Vector from a to b - PVector ab = PVector.sub(b, a); - ab.normalize(); // Normalize the line - // Project vector "diff" onto line by using the dot product - ab.mult(ap.dot(ab)); - PVector normalPoint = PVector.add(a, ab); - return normalPoint; - } - - // Separation - // Method checks for nearby boids and steers away - PVector separate (ArrayList boids) { - float desiredseparation = r*2; - PVector steer = new PVector(0, 0, 0); - int count = 0; - // For every boid in the system, check if it's too close - for (int i = 0 ; i < boids.size(); i++) { - Vehicle other = (Vehicle) boids.get(i); - float d = PVector.dist(location, other.location); - // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) - if ((d > 0) && (d < desiredseparation)) { - // Calculate vector pointing away from neighbor - PVector diff = PVector.sub(location, other.location); - diff.normalize(); - diff.div(d); // Weight by distance - steer.add(diff); - count++; // Keep track of how many - } - } - // Average -- divide by how many - if (count > 0) { - steer.div((float)count); - } - - // As long as the vector is greater than 0 - if (steer.mag() > 0) { - // Implement Reynolds: Steering = Desired - Velocity - steer.normalize(); - steer.mult(maxspeed); - steer.sub(velocity); - steer.limit(maxforce); - } - return steer; - } - - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - // A method that calculates and applies a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - PVector seek(PVector target) { - PVector desired = PVector.sub(target, location); // A vector pointing from the location to the target - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus Velocationity - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); // Limit to maximum steering force - - return steer; - } - - - void render() { - // Simpler boid is just a circle - fill(75); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - ellipse(0, 0, r, r); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - //if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - //if (location.y > height+r) location.y = -r; - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Boid.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Boid.pde deleted file mode 100644 index e5ba60546..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Boid.pde +++ /dev/null @@ -1,242 +0,0 @@ -// Flocking -// Daniel Shiffman -// The Nature of Code, Spring 2009 - -// Boid class -// Methods for Separation, Cohesion, Alignment added - -class Boid { - - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - - color col; - Boid(float x, float y) { - acceleration = new PVector(0, 0); - velocity = new PVector(random(-1, 1), random(-1, 1)); - location = new PVector(x, y); - r = 5.0; - maxspeed = 3; - maxforce = 0.05; - - col = color(175); - } - - void run(ArrayList boids) { - //flock(boids); - update(); - borders(); - render(); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // We accumulate a new acceleration each time based on three rules - void flock(ArrayList boids) { - PVector sep = separate(boids); // Separation - PVector ali = align(boids); // Alignment - PVector coh = cohesion(boids); // Cohesion - - // Not for every boid yet - // PVector view = view(boids); // view - - // Arbitrarily weight these forces - sep.mult(1.5); - ali.mult(1.0); - coh.mult(1.0); - - // Not for every boid yet - // view.mult(1.0); - - // Add the force vectors to acceleration - applyForce(sep); - applyForce(ali); - applyForce(coh); - - // Not for every boid yet - // applyForce(view); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - // A method that calculates and applies a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - PVector seek(PVector target) { - PVector desired = PVector.sub(target, location); // A vector pointing from the location to the target - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus Velocity - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); // Limit to maximum steering force - return steer; - } - - void render() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading() + radians(90); - fill(col); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } - - // Separation - // Method checks for nearby boids and steers away - PVector separate (ArrayList boids) { - float desiredseparation = 25.0f; - PVector steer = new PVector(0, 0, 0); - int count = 0; - // For every boid in the system, check if it's too close - for (Boid other : boids) { - float d = PVector.dist(location, other.location); - // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) - if ((d > 0) && (d < desiredseparation)) { - // Calculate vector pointing away from neighbor - PVector diff = PVector.sub(location, other.location); - diff.normalize(); - diff.div(d); // Weight by distance - steer.add(diff); - count++; // Keep track of how many - } - } - // Average -- divide by how many - if (count > 0) { - steer.div((float)count); - } - - // As long as the vector is greater than 0 - if (steer.mag() > 0) { - // Implement Reynolds: Steering = Desired - Velocity - steer.normalize(); - steer.mult(maxspeed); - steer.sub(velocity); - steer.limit(maxforce); - } - return steer; - } - - // Alignment - // For every nearby boid in the system, calculate the average velocity - PVector align (ArrayList boids) { - float neighbordist = 50; - PVector sum = new PVector(0, 0); - int count = 0; - for (Boid other : boids) { - float d = PVector.dist(location, other.location); - if ((d > 0) && (d < neighbordist)) { - sum.add(other.velocity); - count++; - } - } - if (count > 0) { - sum.div((float)count); - sum.normalize(); - sum.mult(maxspeed); - PVector steer = PVector.sub(sum, velocity); - steer.limit(maxforce); - return steer; - } - else { - return new PVector(0, 0); - } - } - - // Cohesion - // For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location - PVector cohesion (ArrayList boids) { - float neighbordist = 50; - PVector sum = new PVector(0, 0); // Start with empty vector to accumulate all locations - int count = 0; - for (Boid other : boids) { - float d = PVector.dist(location, other.location); - if ((d > 0) && (d < neighbordist)) { - sum.add(other.location); // Add location - count++; - } - } - if (count > 0) { - sum.div(count); - return seek(sum); // Steer towards the location - } - else { - return new PVector(0, 0); - } - } - - // View - // move laterally away from any boid that blocks the view - // Right now we are just drawing the view and highlighting boids - PVector view (ArrayList boids) { - - // How far can it see? - float sightDistance = 100; - float periphery = PI/4; - - for (Boid other : boids) { - // A vector that points to another boid and that angle - PVector comparison = PVector.sub(other.location, location); - - // How far is it - float d = PVector.dist(location, other.location); - - // What is the angle between the other boid and this one's current direction - float diff = PVector.angleBetween(comparison, velocity); - - // If it's within the periphery and close enough to see it - if (diff < periphery && d > 0 && d < sightDistance) { - // Just change its color - other.highlight(); - } - } - - - // Debug Drawing - float currentHeading = velocity.heading(); - pushMatrix(); - translate(location.x, location.y); - rotate(currentHeading); - fill(0, 100); - arc(0, 0, sightDistance*2, sightDistance*2, -periphery, periphery); - popMatrix(); - - return new PVector(); - } - - void highlight() { - col = color(255, 0, 0); - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Exercise_6_17_View.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Exercise_6_17_View.pde deleted file mode 100644 index 8aa3f5011..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Exercise_6_17_View.pde +++ /dev/null @@ -1,31 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Exercise 6.17: Implement Flake's "View" rule - -// This answer doesn't implement the rule, but rather demonstrates how a boid can -// detect what is "in front" of it based on peripheral vision - -Flock flock; - -void setup() { - size(640,360); - flock = new Flock(); - // Add an initial set of boids into the system - for (int i = 0; i < 25; i++) { - Boid b = new Boid(width/2+random(0,75),height/2+random(0,75)); - flock.addBoid(b); - } -} - -void draw() { - background(255); - - flock.run(); -} - -// Add a new boid into the System -void mouseDragged() { - flock.addBoid(new Boid(mouseX,mouseY)); -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Flock.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Flock.pde deleted file mode 100644 index 6b7b1c9e0..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Flock.pde +++ /dev/null @@ -1,37 +0,0 @@ -// Flocking -// Daniel Shiffman -// The Nature of Code, Spring 2011 - -// Flock class -// Does very little, simply manages the ArrayList of all the boids - -class Flock { - ArrayList boids; // An ArrayList for all the boids - - Flock() { - boids = new ArrayList(); // Initialize the ArrayList - } - - void run() { - for (Boid b : boids) { - b.col = color(175); - } - - Boid b1 = boids.get(0); - b1.col = color(0, 0, 255); - b1.view(boids); - - for (Boid b : boids) { - b.flock(boids); // Passing the entire list of boids to each boid individually - } - - for (Boid b : boids) { - b.run(boids); // Passing the entire list of boids to each boid individually - } - } - - void addBoid(Boid b) { - boids.add(b); - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/FlowField.pde b/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/FlowField.pde deleted file mode 100644 index 370c83f47..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/FlowField.pde +++ /dev/null @@ -1,85 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -class FlowField { - - // A flow field is a two dimensional array of PVectors - PVector[][] field; - int cols, rows; // Columns and Rows - int resolution; // How large is each "cell" of the flow field - - FlowField(int r) { - resolution = r; - // Determine the number of columns and rows based on sketch's width and height - cols = width/resolution; - rows = height/resolution; - field = new PVector[cols][rows]; - init(); - } - - void init() { - // Reseed noise so we get a new flow field every time - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - - int x = i*resolution; - int y = j*resolution; - int c = img.pixels[x + y * img.width]; - - // Map brightness to an angle - float theta = 0;//map(brightness(c),0,255,0,PI/2); - // Polar to cartesian coordinate transformation to get x and y components of the vector - field[i][j] = PVector.fromAngle(theta); - - // Map magnitude to an angle (how fast is the desired velocity in the flow field) - float m = map(brightness(c),0,255,0,1); - field[i][j].mult(m); - } - } - } - - // Draw every vector - void display() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - drawVector(field[i][j],i*resolution,j*resolution,resolution-2); - } - } - - } - - // Renders a vector object 'v' as an arrow and a location 'x,y' - void drawVector(PVector v, float x, float y, float scayl) { - pushMatrix(); - float arrowsize = 4; - // Translate to location to render vector - translate(x,y); - strokeWeight(2); - stroke(255,0,0); - // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate - rotate(v.heading2D()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) - line(0,0,len,0); - //line(len,0,len-arrowsize,+arrowsize/2); - //line(len,0,len-arrowsize,-arrowsize/2); - popMatrix(); - } - - PVector lookup(PVector lookup) { - int column = int(constrain(lookup.x/resolution,0,cols-1)); - int row = int(constrain(lookup.y/resolution,0,rows-1)); - return field[column][row].get(); - } - - -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/FlowfieldImage.pde b/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/FlowfieldImage.pde deleted file mode 100644 index b023de6d6..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/FlowfieldImage.pde +++ /dev/null @@ -1,59 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following -// Via Reynolds: http://www.red3d.com/cwr/steer/FlowFollow.html - -// Using this variable to decide whether to draw all the stuff -boolean debug = true; - -PImage img; - -// Flowfield object -FlowField flowfield; -// An ArrayList of vehicles -ArrayList vehicles; - -void setup() { - size(600, 568); - img = loadImage("sil.jpg"); - // Make a new flow field with "resolution" of 16 - flowfield = new FlowField(20); - vehicles = new ArrayList(); - // Make a whole bunch of vehicles with random maxspeed and maxforce values - for (int i = 0; i < 120; i++) { - vehicles.add(new Vehicle(new PVector(random(width), random(height)), random(2, 5), random(0.1, 0.5))); - } -} - -void draw() { - background(255); - image(img,0,0); - // Display the flowfield in "debug" mode - if (debug) flowfield.display(); - // Tell all the vehicles to follow the flow field - for (Vehicle v : vehicles) { - v.follow(flowfield); - v.run(); - } - - // Instructions - fill(0); - text("Hit space bar to toggle debugging lines.\nClick the mouse to generate a new flow field.",10,height-20); -} - - -void keyPressed() { - if (key == ' ') { - debug = !debug; - } -} - -// Make a new flowfield -void mousePressed() { - flowfield.init(); -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/Vehicle.pde deleted file mode 100644 index 2326a1e7c..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/Vehicle.pde +++ /dev/null @@ -1,87 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -class Vehicle { - - // The usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(PVector l, float ms, float mf) { - location = l.get(); - r = 3.0; - maxspeed = ms; - maxforce = mf; - acceleration = new PVector(0,0); - velocity = new PVector(0,0); - } - - public void run() { - update(); - borders(); - display(); - } - - - // Implementing Reynolds' flow field following algorithm - // http://www.red3d.com/cwr/steer/FlowFollow.html - void follow(FlowField flow) { - // What is the vector at that spot in the flow field? - PVector desired = flow.lookup(location); - // Scale it up by maxspeed - desired.mult(maxspeed); - // Steering is desired minus velocity - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); // Limit to maximum steering force - applyForce(steer); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek/NOC_6_01_Seek.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek/NOC_6_01_Seek.pde deleted file mode 100644 index f06b2d10f..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek/NOC_6_01_Seek.pde +++ /dev/null @@ -1,35 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Two "vehicles" follow the mouse position - -// Implements Craig Reynold's autonomous steering behaviors -// One vehicle "seeks" -// One vehicle "arrives" -// See: http://www.red3d.com/cwr/ - -Vehicle v; - -void setup() { - size(640, 360); - v = new Vehicle(width/2, height/2); -} - -void draw() { - background(255); - - PVector mouse = new PVector(mouseX, mouseY); - - // Draw an ellipse at the mouse location - fill(200); - stroke(0); - strokeWeight(2); - ellipse(mouse.x, mouse.y, 48, 48); - - // Call the appropriate steering behaviors for our agents - v.seek(mouse); - v.update(); - v.display(); -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek/Vehicle.pde deleted file mode 100644 index 8c469b5d5..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek/Vehicle.pde +++ /dev/null @@ -1,77 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Seek_Arrive - -// The "Vehicle" class - -class Vehicle { - - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(float x, float y) { - acceleration = new PVector(0,0); - velocity = new PVector(0,-2); - location = new PVector(x,y); - r = 6; - maxspeed = 4; - maxforce = 0.1; - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelerationelertion to 0 each cycle - acceleration.mult(0); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // A method that calculates a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - void seek(PVector target) { - PVector desired = PVector.sub(target,location); // A vector pointing from the location to the target - - // Scale to maximum speed - desired.setMag(maxspeed); - - // Steering = Desired minus velocity - PVector steer = PVector.sub(desired,velocity); - steer.limit(maxforce); // Limit to maximum steering force - - applyForce(steer); - } - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + PI/2; - fill(127); - stroke(0); - strokeWeight(1); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(CLOSE); - popMatrix(); - - - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek_trail/NOC_6_01_Seek_trail.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek_trail/NOC_6_01_Seek_trail.pde deleted file mode 100644 index 5ec2d5091..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek_trail/NOC_6_01_Seek_trail.pde +++ /dev/null @@ -1,33 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Implements Craig Reynold's autonomous steering behaviors -// One vehicle "seeks" -// See: http://www.red3d.com/cwr/ - -Vehicle v; - -void setup() { - size(800, 200); - v = new Vehicle(width/2, height/2); -} - -void draw() { - - background(255); - - PVector mouse = new PVector(mouseX, mouseY); - - // Draw an ellipse at the mouse location - fill(200); - stroke(0); - strokeWeight(2); - ellipse(mouse.x, mouse.y, 48, 48); - - // Call the appropriate steering behaviors for our agents - v.seek(mouse); - v.update(); - v.display(); -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek_trail/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek_trail/Vehicle.pde deleted file mode 100644 index d0b33d652..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek_trail/Vehicle.pde +++ /dev/null @@ -1,91 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// The "Vehicle" class - -class Vehicle { - ArrayList history = new ArrayList(); - - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(float x, float y) { - acceleration = new PVector(0,0); - velocity = new PVector(0,-2); - location = new PVector(x,y); - r = 6; - maxspeed = 4; - maxforce = 0.1; - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelerationelertion to 0 each cycle - acceleration.mult(0); - - history.add(location.get()); - if (history.size() > 100) { - history.remove(0); - } - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // A method that calculates a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - void seek(PVector target) { - PVector desired = PVector.sub(target,location); // A vector pointing from the location to the target - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus velocity - PVector steer = PVector.sub(desired,velocity); - steer.limit(maxforce); // Limit to maximum steering force - - applyForce(steer); - } - - void display() { - beginShape(); - stroke(0); - strokeWeight(1); - noFill(); - for(PVector v: history) { - vertex(v.x,v.y); - } - endShape(); - - - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + PI/2; - fill(127); - stroke(0); - strokeWeight(1); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(CLOSE); - popMatrix(); - - - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_02_Arrive/NOC_6_02_Arrive.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_02_Arrive/NOC_6_02_Arrive.pde deleted file mode 100644 index bd445d818..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_02_Arrive/NOC_6_02_Arrive.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// One vehicle "arrives" -// See: http://www.red3d.com/cwr/ - -Vehicle v; - -void setup() { - size(640, 360); - v = new Vehicle(width/2, height/2); -} - -void draw() { - background(255); - - PVector mouse = new PVector(mouseX, mouseY); - - // Draw an ellipse at the mouse location - fill(200); - stroke(0); - strokeWeight(2); - ellipse(mouse.x, mouse.y, 48, 48); - - // Call the appropriate steering behaviors for our agents - v.arrive(mouse); - v.update(); - v.display(); -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_02_Arrive/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_02_Arrive/Vehicle.pde deleted file mode 100644 index a00eb9c4f..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_02_Arrive/Vehicle.pde +++ /dev/null @@ -1,80 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// The "Vehicle" class - -class Vehicle { - - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(float x, float y) { - acceleration = new PVector(0,0); - velocity = new PVector(0,0); - location = new PVector(x,y); - r = 6; - maxspeed = 4; - maxforce = 0.1; - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelerationelertion to 0 each cycle - acceleration.mult(0); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // A method that calculates a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - void arrive(PVector target) { - PVector desired = PVector.sub(target,location); // A vector pointing from the location to the target - float d = desired.mag(); - // Scale with arbitrary damping within 100 pixels - if (d < 100) { - float m = map(d,0,100,0,maxspeed); - desired.setMag(m); - } else { - desired.setMag(maxspeed); - } - - // Steering = Desired minus Velocity - PVector steer = PVector.sub(desired,velocity); - steer.limit(maxforce); // Limit to maximum steering force - applyForce(steer); - } - - void display() { - - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + PI/2; - fill(127); - stroke(0); - strokeWeight(1); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(CLOSE); - popMatrix(); - - - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls/NOC_6_03_StayWithinWalls.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls/NOC_6_03_StayWithinWalls.pde deleted file mode 100644 index dbc5d3a5a..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls/NOC_6_03_StayWithinWalls.pde +++ /dev/null @@ -1,36 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Stay Within Walls -// "Made-up" Steering behavior to stay within walls - - -Vehicle v; -boolean debug = true; - -float d = 25; - -void setup() { - size(640, 360); - v = new Vehicle(width/2, height/2); -} - -void draw() { - background(255); - - if (debug) { - stroke(175); - noFill(); - rectMode(CENTER); - rect(width/2, height/2, width-d*2, height-d*2); - } - - v.boundaries(); - v.run(); -} - -void mousePressed() { - debug = !debug; -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls/Vehicle.pde deleted file mode 100644 index 9a507181c..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls/Vehicle.pde +++ /dev/null @@ -1,92 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// The "Vehicle" class - -class Vehicle { - - PVector location; - PVector velocity; - PVector acceleration; - float r; - - float maxspeed; - float maxforce; - - Vehicle(float x, float y) { - acceleration = new PVector(0, 0); - velocity = new PVector(3, -2); - velocity.mult(5); - location = new PVector(x, y); - r = 6; - maxspeed = 3; - maxforce = 0.15; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void boundaries() { - - PVector desired = null; - - if (location.x < d) { - desired = new PVector(maxspeed, velocity.y); - } - else if (location.x > width -d) { - desired = new PVector(-maxspeed, velocity.y); - } - - if (location.y < d) { - desired = new PVector(velocity.x, maxspeed); - } - else if (location.y > height-d) { - desired = new PVector(velocity.x, -maxspeed); - } - - if (desired != null) { - desired.normalize(); - desired.mult(maxspeed); - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); - applyForce(steer); - } - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(127); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls_trail/NOC_6_03_StayWithinWalls_trail.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls_trail/NOC_6_03_StayWithinWalls_trail.pde deleted file mode 100644 index c260f716a..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls_trail/NOC_6_03_StayWithinWalls_trail.pde +++ /dev/null @@ -1,37 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Stay Within Walls -// "Made-up" Steering behavior to stay within walls - - -Vehicle v; -boolean debug = true; - -float d = 25; - - -void setup() { - size(640, 360); - v = new Vehicle(width/2, height/2); -} - -void draw() { - background(255); - - if (debug) { - stroke(175); - noFill(); - rectMode(CENTER); - rect(width/2, height/2, width-d*2, height-d*2); - } - - v.boundaries(); - v.run(); -} - -void mousePressed() { - debug = !debug; -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls_trail/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls_trail/Vehicle.pde deleted file mode 100644 index 0d94054a4..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls_trail/Vehicle.pde +++ /dev/null @@ -1,108 +0,0 @@ -// Wander -// Daniel Shiffman -// The Nature of Code - -// The "Vehicle" class - -class Vehicle { - ArrayList history = new ArrayList(); - - PVector location; - PVector velocity; - PVector acceleration; - float r; - - float maxspeed; - float maxforce; - - Vehicle(float x, float y) { - acceleration = new PVector(0, 0); - velocity = new PVector(3, -2); - velocity.mult(5); - location = new PVector(x, y); - r = 6; - maxspeed = 3; - maxforce = 0.15; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - - history.add(location.get()); - if (history.size() > 500) { - history.remove(0); - } - } - - void boundaries() { - - PVector desired = null; - - if (location.x < d) { - desired = new PVector(maxspeed, velocity.y); - } - else if (location.x > width -d) { - desired = new PVector(-maxspeed, velocity.y); - } - - if (location.y < d) { - desired = new PVector(velocity.x, maxspeed); - } - else if (location.y > height-d) { - desired = new PVector(velocity.x, -maxspeed); - } - - if (desired != null) { - desired.normalize(); - desired.mult(maxspeed); - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); - applyForce(steer); - } - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - - void display() { - beginShape(); - stroke(0); - strokeWeight(1); - noFill(); - for(PVector v: history) { - vertex(v.x,v.y); - } - endShape(); - - - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(127); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/FlowField.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/FlowField.pde deleted file mode 100644 index 75b471b29..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/FlowField.pde +++ /dev/null @@ -1,94 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -class FlowField { - - // A flow field is a two dimensional array of PVectors - PVector[][] field; - int cols, rows; // Columns and Rows - int resolution; // How large is each "cell" of the flow field - - FlowField(int r) { - resolution = r; - // Determine the number of columns and rows based on sketch's width and height - cols = width/resolution; - rows = height/resolution; - field = new PVector[cols][rows]; - init(); - } - - void init() { - // Reseed noise so we get a new flow field every time - noiseSeed((int)random(10000)); - float xoff = 0; - for (int i = 0; i < cols; i++) { - float yoff = 0; - for (int j = 0; j < rows; j++) { - //float theta = random(TWO_PI); - //float theta = map(noise(xoff,yoff),0,1,0,TWO_PI); - float x = i*resolution; - float y = j*resolution; - PVector v = new PVector(width/2-x,-y); - v.normalize(); - // Polar to cartesian coordinate transformation to get x and y components of the vector - field[i][j] = v;// new PVector(cos(theta),sin(theta)); - yoff += 0.1; - } - xoff += 0.1; - } - } - - // Draw every vector - void display() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - //drawVector(field[i][j],i*resolution,j*resolution,resolution-2); - pushMatrix(); - //translate(i*resolution+arrow.width/2,j*resolution+arrow.height/2); - translate(i*resolution,j*resolution); - rotate(field[i][j].heading2D()); - imageMode(CENTER); - //scale(0.2); - image(a,0,0); - //shape(arrow,-arrow.width/2,-arrow.height/2); - //ellipse(0,0,8,8); - popMatrix(); - } - } - - } - - // Renders a vector object 'v' as an arrow and a location 'x,y' - void drawVector(PVector v, float x, float y, float scayl) { - pushMatrix(); - float arrowsize = 4; - // Translate to location to render vector - translate(x,y); - stroke(0,100); - // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate - rotate(v.heading2D()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) - line(0,0,len,0); - line(len,0,len-arrowsize,+arrowsize/2); - line(len,0,len-arrowsize,-arrowsize/2); - popMatrix(); - } - - PVector lookup(PVector lookup) { - int column = int(constrain(lookup.x/resolution,0,cols-1)); - int row = int(constrain(lookup.y/resolution,0,rows-1)); - return field[column][row].get(); - } - - -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/NOC_6_04_Flow_Figures.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/NOC_6_04_Flow_Figures.pde deleted file mode 100644 index beb0642c9..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/NOC_6_04_Flow_Figures.pde +++ /dev/null @@ -1,35 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -// Via Reynolds: http://www.red3d.com/cwr/steer/FlowFollow.html - -// Flowfield object -FlowField flowfield; -PShape arrow; -PImage a; - -void setup() { - size(1800, 60*9); - // Make a new flow field with "resolution" of 16 - flowfield = new FlowField(60); - arrow = loadShape("arrow.svg"); - a = loadImage("arrow60.png"); -} - -void draw() { - background(255); - // Display the flowfield in "debug" mode - translate(30,30); - flowfield.display(); - saveFrame("ch6_exc6.png"); - noLoop(); -} -// Make a new flowfield -void mousePressed() { - flowfield.init(); -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/Vehicle.pde deleted file mode 100644 index 2326a1e7c..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/Vehicle.pde +++ /dev/null @@ -1,87 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -class Vehicle { - - // The usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(PVector l, float ms, float mf) { - location = l.get(); - r = 3.0; - maxspeed = ms; - maxforce = mf; - acceleration = new PVector(0,0); - velocity = new PVector(0,0); - } - - public void run() { - update(); - borders(); - display(); - } - - - // Implementing Reynolds' flow field following algorithm - // http://www.red3d.com/cwr/steer/FlowFollow.html - void follow(FlowField flow) { - // What is the vector at that spot in the flow field? - PVector desired = flow.lookup(location); - // Scale it up by maxspeed - desired.mult(maxspeed); - // Steering is desired minus velocity - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); // Limit to maximum steering force - applyForce(steer); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/data/arrow.svg b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/data/arrow.svg deleted file mode 100644 index 0f34115e7..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/data/arrow.svg +++ /dev/null @@ -1,5149 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/FlowField.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/FlowField.pde deleted file mode 100644 index 08bf7eb23..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/FlowField.pde +++ /dev/null @@ -1,79 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -class FlowField { - - // A flow field is a two dimensional array of PVectors - PVector[][] field; - int cols, rows; // Columns and Rows - int resolution; // How large is each "cell" of the flow field - - FlowField(int r) { - resolution = r; - // Determine the number of columns and rows based on sketch's width and height - cols = width/resolution; - rows = height/resolution; - field = new PVector[cols][rows]; - init(); - } - - void init() { - // Reseed noise so we get a new flow field every time - noiseSeed((int)random(10000)); - float xoff = 0; - for (int i = 0; i < cols; i++) { - float yoff = 0; - for (int j = 0; j < rows; j++) { - float theta = map(noise(xoff,yoff),0,1,0,TWO_PI); - // Polar to cartesian coordinate transformation to get x and y components of the vector - field[i][j] = new PVector(cos(theta),sin(theta)); - yoff += 0.1; - } - xoff += 0.1; - } - } - - // Draw every vector - void display() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - drawVector(field[i][j],i*resolution,j*resolution,resolution-2); - } - } - - } - - // Renders a vector object 'v' as an arrow and a location 'x,y' - void drawVector(PVector v, float x, float y, float scayl) { - pushMatrix(); - float arrowsize = 4; - // Translate to location to render vector - translate(x,y); - stroke(0,100); - // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate - rotate(v.heading2D()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) - line(0,0,len,0); - //line(len,0,len-arrowsize,+arrowsize/2); - //line(len,0,len-arrowsize,-arrowsize/2); - popMatrix(); - } - - PVector lookup(PVector lookup) { - int column = int(constrain(lookup.x/resolution,0,cols-1)); - int row = int(constrain(lookup.y/resolution,0,rows-1)); - return field[column][row].get(); - } - - -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/NOC_6_04_Flowfield.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/NOC_6_04_Flowfield.pde deleted file mode 100644 index 86a2c4c29..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/NOC_6_04_Flowfield.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following -// Via Reynolds: http://www.red3d.com/cwr/steer/FlowFollow.html - -// Using this variable to decide whether to draw all the stuff -boolean debug = true; - -// Flowfield object -FlowField flowfield; -// An ArrayList of vehicles -ArrayList vehicles; - -void setup() { - size(640, 360); - // Make a new flow field with "resolution" of 16 - flowfield = new FlowField(20); - vehicles = new ArrayList(); - // Make a whole bunch of vehicles with random maxspeed and maxforce values - for (int i = 0; i < 120; i++) { - vehicles.add(new Vehicle(new PVector(random(width), random(height)), random(2, 5), random(0.1, 0.5))); - } -} - -void draw() { - background(255); - // Display the flowfield in "debug" mode - if (debug) flowfield.display(); - // Tell all the vehicles to follow the flow field - for (Vehicle v : vehicles) { - v.follow(flowfield); - v.run(); - } - - // Instructions - fill(0); - text("Hit space bar to toggle debugging lines.\nClick the mouse to generate a new flow field.",10,height-20); -} - - -void keyPressed() { - if (key == ' ') { - debug = !debug; - } -} - -// Make a new flowfield -void mousePressed() { - flowfield.init(); -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/Vehicle.pde deleted file mode 100644 index 2326a1e7c..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/Vehicle.pde +++ /dev/null @@ -1,87 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -class Vehicle { - - // The usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(PVector l, float ms, float mf) { - location = l.get(); - r = 3.0; - maxspeed = ms; - maxforce = mf; - acceleration = new PVector(0,0); - velocity = new PVector(0,0); - } - - public void run() { - update(); - borders(); - display(); - } - - - // Implementing Reynolds' flow field following algorithm - // http://www.red3d.com/cwr/steer/FlowFollow.html - void follow(FlowField flow) { - // What is the vector at that spot in the flow field? - PVector desired = flow.lookup(location); - // Scale it up by maxspeed - desired.mult(maxspeed); - // Steering is desired minus velocity - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); // Limit to maximum steering force - applyForce(steer); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/NOC_6_05_PathFollowingSimple.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/NOC_6_05_PathFollowingSimple.pde deleted file mode 100644 index abe2f5e9a..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/NOC_6_05_PathFollowingSimple.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Path Following -// Path is a just a straight line in this example -// Via Reynolds: // http://www.red3d.com/cwr/steer/PathFollow.html - -// Using this variable to decide whether to draw all the stuff -boolean debug = true; - -// A path object (series of connected points) -Path path; - -// Two vehicles -Vehicle car1; -Vehicle car2; - -void setup() { - size(640, 360); - path = new Path(); - - // Each vehicle has different maxspeed and maxforce for demo purposes - car1 = new Vehicle(new PVector(0, height/2), 2, 0.02); - car2 = new Vehicle(new PVector(0, height/2), 3, 0.05); -} - -void draw() { - background(255); - // Display the path - path.display(); - // The boids follow the path - car1.follow(path); - car2.follow(path); - // Call the generic run method (update, borders, display, etc.) - car1.run(); - car2.run(); - - // Check if it gets to the end of the path since it's not a loop - car1.borders(path); - car2.borders(path); - - // Instructions - fill(0); - text("Hit space bar to toggle debugging lines.", 10, height-30); -} - -public void keyPressed() { - if (key == ' ') { - debug = !debug; - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/Path.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/Path.pde deleted file mode 100644 index 3d222214d..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/Path.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Path Following - -class Path { - - // A Path is line between two points (PVector objects) - PVector start; - PVector end; - // A path has a radius, i.e how far is it ok for the boid to wander off - float radius; - - Path() { - // Arbitrary radius of 20 - radius = 20; - start = new PVector(0,height/3); - end = new PVector(width,2*height/3); - } - - // Draw the path - void display() { - - strokeWeight(radius*2); - stroke(0,100); - line(start.x,start.y,end.x,end.y); - - strokeWeight(1); - stroke(0); - line(start.x,start.y,end.x,end.y); - } -} - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/Vehicle.pde deleted file mode 100644 index 1fdbd172e..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/Vehicle.pde +++ /dev/null @@ -1,160 +0,0 @@ -// Path Following -// Daniel Shiffman -// The Nature of Code, Spring 2009 - -// Vehicle class - -class Vehicle { - - // All the usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - // Constructor initialize all values - Vehicle( PVector l, float ms, float mf) { - location = l.get(); - r = 4.0; - maxspeed = ms; - maxforce = mf; - acceleration = new PVector(0, 0); - velocity = new PVector(maxspeed, 0); - } - - // Main "run" function - void run() { - update(); - display(); - } - - - // This function implements Craig Reynolds' path following algorithm - // http://www.red3d.com/cwr/steer/PathFollow.html - void follow(Path p) { - - // Predict location 50 (arbitrary choice) frames ahead - PVector predict = velocity.get(); - predict.normalize(); - predict.mult(50); - PVector predictLoc = PVector.add(location, predict); - - // Look at the line segment - PVector a = p.start; - PVector b = p.end; - - // Get the normal point to that line - PVector normalPoint = getNormalPoint(predictLoc, a, b); - - // Find target point a little further ahead of normal - PVector dir = PVector.sub(b, a); - dir.normalize(); - dir.mult(10); // This could be based on velocity instead of just an arbitrary 10 pixels - PVector target = PVector.add(normalPoint, dir); - - // How far away are we from the path? - float distance = PVector.dist(predictLoc, normalPoint); - // Only if the distance is greater than the path's radius do we bother to steer - if (distance > p.radius) { - seek(target); - } - - - // Draw the debugging stuff - if (debug) { - fill(0); - stroke(0); - line(location.x, location.y, predictLoc.x, predictLoc.y); - ellipse(predictLoc.x, predictLoc.y, 4, 4); - - // Draw normal location - fill(0); - stroke(0); - line(predictLoc.x, predictLoc.y, normalPoint.x, normalPoint.y); - ellipse(normalPoint.x, normalPoint.y, 4, 4); - stroke(0); - if (distance > p.radius) fill(255, 0, 0); - noStroke(); - ellipse(target.x+dir.x, target.y+dir.y, 8, 8); - } - } - - - // A function to get the normal point from a point (p) to a line segment (a-b) - // This function could be optimized to make fewer new Vector objects - PVector getNormalPoint(PVector p, PVector a, PVector b) { - // Vector from a to p - PVector ap = PVector.sub(p, a); - // Vector from a to b - PVector ab = PVector.sub(b, a); - ab.normalize(); // Normalize the line - // Project vector "diff" onto line by using the dot product - ab.mult(ap.dot(ab)); - PVector normalPoint = PVector.add(a, ab); - return normalPoint; - } - - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - - // A method that calculates and applies a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - void seek(PVector target) { - PVector desired = PVector.sub(target, location); // A vector pointing from the location to the target - - // If the magnitude of desired equals 0, skip out of here - // (We could optimize this to check if x and y are 0 to avoid mag() square root - if (desired.mag() == 0) return; - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus Velocity - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); // Limit to maximum steering force - - applyForce(steer); - } - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - rotate(theta); - beginShape(PConstants.TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders(Path p) { - if (location.x > p.end.x + r) { - location.x = p.start.x - r; - location.y = p.start.y + (location.y-p.end.y); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/NOC_6_06_PathFollowing.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/NOC_6_06_PathFollowing.pde deleted file mode 100644 index b07b478dd..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/NOC_6_06_PathFollowing.pde +++ /dev/null @@ -1,67 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Path Following -// Via Reynolds: // http://www.red3d.com/cwr/steer/PathFollow.html - -// Using this variable to decide whether to draw all the stuff -boolean debug = true; - -// A path object (series of connected points) -Path path; - -// Two vehicles -Vehicle car1; -Vehicle car2; - -void setup() { - size(640, 360); - // Call a function to generate new Path object - newPath(); - - // Each vehicle has different maxspeed and maxforce for demo purposes - car1 = new Vehicle(new PVector(0, height/2), 2, 0.04); - car2 = new Vehicle(new PVector(0, height/2), 3, 0.1); -} - -void draw() { - background(255); - // Display the path - path.display(); - // The boids follow the path - car1.follow(path); - car2.follow(path); - // Call the generic run method (update, borders, display, etc.) - car1.run(); - car2.run(); - - car1.borders(path); - car2.borders(path); - - // Instructions - fill(0); - text("Hit space bar to toggle debugging lines.\nClick the mouse to generate a new path.", 10, height-30); -} - -void newPath() { - // A path is a series of connected points - // A more sophisticated path might be a curve - path = new Path(); - path.addPoint(-20, height/2); - path.addPoint(random(0, width/2), random(0, height)); - path.addPoint(random(width/2, width), random(0, height)); - path.addPoint(width+20, height/2); -} - -public void keyPressed() { - if (key == ' ') { - debug = !debug; - } -} - -public void mousePressed() { - newPath(); -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/Path.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/Path.pde deleted file mode 100644 index 8d28b73cb..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/Path.pde +++ /dev/null @@ -1,59 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Path Following - -class Path { - - // A Path is an arraylist of points (PVector objects) - ArrayList points; - // A path has a radius, i.e how far is it ok for the boid to wander off - float radius; - - Path() { - // Arbitrary radius of 20 - radius = 20; - points = new ArrayList(); - } - - // Add a point to the path - void addPoint(float x, float y) { - PVector point = new PVector(x, y); - points.add(point); - } - - PVector getStart() { - return points.get(0); - } - - PVector getEnd() { - return points.get(points.size()-1); - } - - - // Draw the path - void display() { - // Draw thick line for radius - stroke(175); - strokeWeight(radius*2); - noFill(); - beginShape(); - for (PVector v : points) { - vertex(v.x, v.y); - } - endShape(); - // Draw thin line for center of path - stroke(0); - strokeWeight(1); - noFill(); - beginShape(); - for (PVector v : points) { - vertex(v.x, v.y); - } - endShape(); - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/Vehicle.pde deleted file mode 100644 index 72bd7d1fe..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/Vehicle.pde +++ /dev/null @@ -1,192 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Path Following - -// Vehicle class - -class Vehicle { - - // All the usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - // Constructor initialize all values - Vehicle( PVector l, float ms, float mf) { - location = l.get(); - r = 4.0; - maxspeed = ms; - maxforce = mf; - acceleration = new PVector(0, 0); - velocity = new PVector(maxspeed, 0); - } - - // Main "run" function - public void run() { - update(); - display(); - } - - - // This function implements Craig Reynolds' path following algorithm - // http://www.red3d.com/cwr/steer/PathFollow.html - void follow(Path p) { - - // Predict location 50 (arbitrary choice) frames ahead - // This could be based on speed - PVector predict = velocity.get(); - predict.normalize(); - predict.mult(50); - PVector predictLoc = PVector.add(location, predict); - - // Now we must find the normal to the path from the predicted location - // We look at the normal for each line segment and pick out the closest one - - PVector normal = null; - PVector target = null; - float worldRecord = 1000000; // Start with a very high record distance that can easily be beaten - - // Loop through all points of the path - for (int i = 0; i < p.points.size()-1; i++) { - - // Look at a line segment - PVector a = p.points.get(i); - PVector b = p.points.get(i+1); - - // Get the normal point to that line - PVector normalPoint = getNormalPoint(predictLoc, a, b); - // This only works because we know our path goes from left to right - // We could have a more sophisticated test to tell if the point is in the line segment or not - if (normalPoint.x < a.x || normalPoint.x > b.x) { - // This is something of a hacky solution, but if it's not within the line segment - // consider the normal to just be the end of the line segment (point b) - normalPoint = b.get(); - } - - // How far away are we from the path? - float distance = PVector.dist(predictLoc, normalPoint); - // Did we beat the record and find the closest line segment? - if (distance < worldRecord) { - worldRecord = distance; - // If so the target we want to steer towards is the normal - normal = normalPoint; - - // Look at the direction of the line segment so we can seek a little bit ahead of the normal - PVector dir = PVector.sub(b, a); - dir.normalize(); - // This is an oversimplification - // Should be based on distance to path & velocity - dir.mult(10); - target = normalPoint.get(); - target.add(dir); - } - } - - // Only if the distance is greater than the path's radius do we bother to steer - if (worldRecord > p.radius) { - seek(target); - } - - - // Draw the debugging stuff - if (debug) { - // Draw predicted future location - stroke(0); - fill(0); - line(location.x, location.y, predictLoc.x, predictLoc.y); - ellipse(predictLoc.x, predictLoc.y, 4, 4); - - // Draw normal location - stroke(0); - fill(0); - ellipse(normal.x, normal.y, 4, 4); - // Draw actual target (red if steering towards it) - line(predictLoc.x, predictLoc.y, normal.x, normal.y); - if (worldRecord > p.radius) fill(255, 0, 0); - noStroke(); - ellipse(target.x, target.y, 8, 8); - } - } - - - // A function to get the normal point from a point (p) to a line segment (a-b) - // This function could be optimized to make fewer new Vector objects - PVector getNormalPoint(PVector p, PVector a, PVector b) { - // Vector from a to p - PVector ap = PVector.sub(p, a); - // Vector from a to b - PVector ab = PVector.sub(b, a); - ab.normalize(); // Normalize the line - // Project vector "diff" onto line by using the dot product - ab.mult(ap.dot(ab)); - PVector normalPoint = PVector.add(a, ab); - return normalPoint; - } - - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - - // A method that calculates and applies a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - void seek(PVector target) { - PVector desired = PVector.sub(target, location); // A vector pointing from the location to the target - - // If the magnitude of desired equals 0, skip out of here - // (We could optimize this to check if x and y are 0 to avoid mag() square root - if (desired.mag() == 0) return; - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus Velocity - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); // Limit to maximum steering force - - applyForce(steer); - } - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - rotate(theta); - beginShape(PConstants.TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders(Path p) { - if (location.x > p.getEnd().x + r) { - location.x = p.getStart().x - r; - location.y = p.getStart().y + (location.y-p.getEnd().y); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_07_Separation/NOC_6_07_Separation.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_07_Separation/NOC_6_07_Separation.pde deleted file mode 100644 index d884461f2..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_07_Separation/NOC_6_07_Separation.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Separation -// Via Reynolds: http://www.red3d.com/cwr/steer/ - -// A list of vehicles -ArrayList vehicles; - -void setup() { - size(640,360); - // We are now making random vehicles and storing them in an ArrayList - vehicles = new ArrayList(); - for (int i = 0; i < 100; i++) { - vehicles.add(new Vehicle(random(width),random(height))); - } -} - -void draw() { - background(255); - - for (Vehicle v : vehicles) { - // Path following and separation are worked on in this function - v.separate(vehicles); - // Call the generic run method (update, borders, display, etc.) - v.update(); - v.borders(); - v.display(); - } - - // Instructions - fill(0); - text("Drag the mouse to generate new vehicles.",10,height-16); -} - - -void mouseDragged() { - vehicles.add(new Vehicle(mouseX,mouseY)); -} - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_07_Separation/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_07_Separation/Vehicle.pde deleted file mode 100644 index f0a5ddb96..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_07_Separation/Vehicle.pde +++ /dev/null @@ -1,99 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Vehicle class - -class Vehicle { - - // All the usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - // Constructor initialize all values - Vehicle(float x, float y) { - location = new PVector(x, y); - r = 12; - maxspeed = 3; - maxforce = 0.2; - acceleration = new PVector(0, 0); - velocity = new PVector(0, 0); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // Separation - // Method checks for nearby vehicles and steers away - void separate (ArrayList vehicles) { - float desiredseparation = r*2; - PVector sum = new PVector(); - int count = 0; - // For every boid in the system, check if it's too close - for (Vehicle other : vehicles) { - float d = PVector.dist(location, other.location); - // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) - if ((d > 0) && (d < desiredseparation)) { - // Calculate vector pointing away from neighbor - PVector diff = PVector.sub(location, other.location); - diff.normalize(); - diff.div(d); // Weight by distance - sum.add(diff); - count++; // Keep track of how many - } - } - // Average -- divide by how many - if (count > 0) { - sum.div(count); - // Our desired vector is the average scaled to maximum speed - sum.normalize(); - sum.mult(maxspeed); - // Implement Reynolds: Steering = Desired - Velocity - PVector steer = PVector.sub(sum, velocity); - steer.limit(maxforce); - applyForce(steer); - } - } - - - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void display() { - fill(175); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - ellipse(0, 0, r, r); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } -} - - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_08_SeparationAndSeek/NOC_6_08_SeparationAndSeek.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_08_SeparationAndSeek/NOC_6_08_SeparationAndSeek.pde deleted file mode 100644 index bc744a1b8..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_08_SeparationAndSeek/NOC_6_08_SeparationAndSeek.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A list of vehicles -ArrayList vehicles; - -void setup() { - size(640,360); - // We are now making random vehicles and storing them in an ArrayList - vehicles = new ArrayList(); - for (int i = 0; i < 100; i++) { - vehicles.add(new Vehicle(random(width),random(height))); - } -} - -void draw() { - background(255); - - for (Vehicle v : vehicles) { - // Path following and separation are worked on in this function - v.applyBehaviors(vehicles); - // Call the generic run method (update, borders, display, etc.) - v.update(); - v.display(); - } - - // Instructions - fill(0); - text("Drag the mouse to generate new vehicles.",10,height-16); -} - - -void mouseDragged() { - vehicles.add(new Vehicle(mouseX,mouseY)); -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_08_SeparationAndSeek/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_08_SeparationAndSeek/Vehicle.pde deleted file mode 100644 index b4270972e..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_08_SeparationAndSeek/Vehicle.pde +++ /dev/null @@ -1,113 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Vehicle { - - // All the usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - // Constructor initialize all values - Vehicle(float x, float y) { - location = new PVector(x, y); - r = 12; - maxspeed = 3; - maxforce = 0.2; - acceleration = new PVector(0, 0); - velocity = new PVector(0, 0); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - void applyBehaviors(ArrayList vehicles) { - PVector separateForce = separate(vehicles); - PVector seekForce = seek(new PVector(mouseX,mouseY)); - separateForce.mult(2); - seekForce.mult(1); - applyForce(separateForce); - applyForce(seekForce); - } - - // A method that calculates a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - PVector seek(PVector target) { - PVector desired = PVector.sub(target,location); // A vector pointing from the location to the target - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus velocity - PVector steer = PVector.sub(desired,velocity); - steer.limit(maxforce); // Limit to maximum steering force - - return steer; - } - - // Separation - // Method checks for nearby vehicles and steers away - PVector separate (ArrayList vehicles) { - float desiredseparation = r*2; - PVector sum = new PVector(); - int count = 0; - // For every boid in the system, check if it's too close - for (Vehicle other : vehicles) { - float d = PVector.dist(location, other.location); - // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) - if ((d > 0) && (d < desiredseparation)) { - // Calculate vector pointing away from neighbor - PVector diff = PVector.sub(location, other.location); - diff.normalize(); - diff.div(d); // Weight by distance - sum.add(diff); - count++; // Keep track of how many - } - } - // Average -- divide by how many - if (count > 0) { - sum.div(count); - // Our desired vector is the average scaled to maximum speed - sum.normalize(); - sum.mult(maxspeed); - // Implement Reynolds: Steering = Desired - Velocity - sum.sub(velocity); - sum.limit(maxforce); - } - return sum; - } - - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void display() { - fill(175); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - ellipse(0, 0, r, r); - popMatrix(); - } - -} - - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/Boid.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/Boid.pde deleted file mode 100644 index 194dfc362..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/Boid.pde +++ /dev/null @@ -1,182 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Boid class -// Methods for Separation, Cohesion, Alignment added - -class Boid { - - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Boid(float x, float y) { - acceleration = new PVector(0,0); - velocity = new PVector(random(-1,1),random(-1,1)); - location = new PVector(x,y); - r = 3.0; - maxspeed = 3; - maxforce = 0.05; - } - - void run(ArrayList boids) { - flock(boids); - update(); - borders(); - render(); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // We accumulate a new acceleration each time based on three rules - void flock(ArrayList boids) { - PVector sep = separate(boids); // Separation - PVector ali = align(boids); // Alignment - PVector coh = cohesion(boids); // Cohesion - // Arbitrarily weight these forces - sep.mult(1.5); - ali.mult(1.0); - coh.mult(1.0); - // Add the force vectors to acceleration - applyForce(sep); - applyForce(ali); - applyForce(coh); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - // A method that calculates and applies a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - PVector seek(PVector target) { - PVector desired = PVector.sub(target,location); // A vector pointing from the location to the target - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus Velocity - PVector steer = PVector.sub(desired,velocity); - steer.limit(maxforce); // Limit to maximum steering force - return steer; - } - - void render() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } - - // Separation - // Method checks for nearby boids and steers away - PVector separate (ArrayList boids) { - float desiredseparation = 25.0f; - PVector steer = new PVector(0,0,0); - int count = 0; - // For every boid in the system, check if it's too close - for (Boid other : boids) { - float d = PVector.dist(location,other.location); - // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) - if ((d > 0) && (d < desiredseparation)) { - // Calculate vector pointing away from neighbor - PVector diff = PVector.sub(location,other.location); - diff.normalize(); - diff.div(d); // Weight by distance - steer.add(diff); - count++; // Keep track of how many - } - } - // Average -- divide by how many - if (count > 0) { - steer.div((float)count); - } - - // As long as the vector is greater than 0 - if (steer.mag() > 0) { - // Implement Reynolds: Steering = Desired - Velocity - steer.normalize(); - steer.mult(maxspeed); - steer.sub(velocity); - steer.limit(maxforce); - } - return steer; - } - - // Alignment - // For every nearby boid in the system, calculate the average velocity - PVector align (ArrayList boids) { - float neighbordist = 50; - PVector sum = new PVector(0,0); - int count = 0; - for (Boid other : boids) { - float d = PVector.dist(location,other.location); - if ((d > 0) && (d < neighbordist)) { - sum.add(other.velocity); - count++; - } - } - if (count > 0) { - sum.div((float)count); - sum.normalize(); - sum.mult(maxspeed); - PVector steer = PVector.sub(sum,velocity); - steer.limit(maxforce); - return steer; - } else { - return new PVector(0,0); - } - } - - // Cohesion - // For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location - PVector cohesion (ArrayList boids) { - float neighbordist = 50; - PVector sum = new PVector(0,0); // Start with empty vector to accumulate all locations - int count = 0; - for (Boid other : boids) { - float d = PVector.dist(location,other.location); - if ((d > 0) && (d < neighbordist)) { - sum.add(other.location); // Add location - count++; - } - } - if (count > 0) { - sum.div(count); - return seek(sum); // Steer towards the location - } else { - return new PVector(0,0); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/Flock.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/Flock.pde deleted file mode 100644 index b548b2469..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/Flock.pde +++ /dev/null @@ -1,25 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flock class -// Does very little, simply manages the ArrayList of all the boids - -class Flock { - ArrayList boids; // An ArrayList for all the boids - - Flock() { - boids = new ArrayList(); // Initialize the ArrayList - } - - void run() { - for (Boid b : boids) { - b.run(boids); // Passing the entire list of boids to each boid individually - } - } - - void addBoid(Boid b) { - boids.add(b); - } - -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/NOC_6_09_Flocking.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/NOC_6_09_Flocking.pde deleted file mode 100644 index 921f0d250..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/NOC_6_09_Flocking.pde +++ /dev/null @@ -1,38 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Demonstration of Craig Reynolds' "Flocking" behavior -// See: http://www.red3d.com/cwr/ -// Rules: Cohesion, Separation, Alignment - -// Click mouse to add boids into the system - -Flock flock; - -void setup() { - size(640,360); - flock = new Flock(); - // Add an initial set of boids into the system - for (int i = 0; i < 200; i++) { - Boid b = new Boid(width/2,height/2); - flock.addBoid(b); - } - smooth(); -} - -void draw() { - background(255); - flock.run(); - - // Instructions - fill(0); - //text("Drag the mouse to generate new boids.",10,height-16); -} - -// Add a new boid into the System -void mouseDragged() { - flock.addBoid(new Boid(mouseX,mouseY)); -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/SimpleScalarProjection/SimpleScalarProjection.pde b/java/examples/Books/Nature of Code/chp6_agents/SimpleScalarProjection/SimpleScalarProjection.pde deleted file mode 100644 index dbd09f94e..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/SimpleScalarProjection/SimpleScalarProjection.pde +++ /dev/null @@ -1,41 +0,0 @@ - -void setup() { - size(600, 360); -} - -void draw() { - background(255); - - PVector a = new PVector(20,300); - PVector b = new PVector(500,250); - PVector mouse = new PVector(mouseX,mouseY); - - stroke(0); - strokeWeight(2); - line(a.x,a.y,b.x,b.y); - line(a.x,a.y,mouse.x,mouse.y); - fill(0); - ellipse(a.x,a.y,8,8); - ellipse(b.x,b.y,8,8); - ellipse(mouse.x,mouse.y,8,8); - - PVector norm = scalarProjection(mouse,a,b); - strokeWeight(1); - stroke(50); - line(mouse.x,mouse.y,norm.x,norm.y); - - noStroke(); - fill(255,0,0); - ellipse(norm.x,norm.y,16,16); -} - - -PVector scalarProjection(PVector p, PVector a, PVector b) { - PVector ap = PVector.sub(p, a); - PVector ab = PVector.sub(b, a); - ab.normalize(); // Normalize the line - ab.mult(ap.dot(ab)); - PVector normalPoint = PVector.add(a, ab); - return normalPoint; -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/StayWithinCircle/StayWithinCircle.pde b/java/examples/Books/Nature of Code/chp6_agents/StayWithinCircle/StayWithinCircle.pde deleted file mode 100644 index 0c2d43c86..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/StayWithinCircle/StayWithinCircle.pde +++ /dev/null @@ -1,41 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Stay Within Circle -// "Made-up" Steering behavior to stay within walls - -Vehicle v; -boolean debug = true; - - -PVector circleLocation; -float circleRadius; - - - -void setup() { - size(640, 360); - v = new Vehicle(width/2, height/4); - - circleLocation = new PVector(width/2,height/2); - circleRadius = height/2-25; -} - -void draw() { - background(255); - - if (debug) { - stroke(175); - noFill(); - ellipse(circleLocation.x,circleLocation.y, circleRadius*2,circleRadius*2); - } - - v.boundaries(); - v.run(); -} - -void mousePressed() { - debug = !debug; -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/StayWithinCircle/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/StayWithinCircle/Vehicle.pde deleted file mode 100644 index 7bc96d2fa..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/StayWithinCircle/Vehicle.pde +++ /dev/null @@ -1,93 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Vehicle { - - PVector location; - PVector velocity; - PVector acceleration; - float r; - - float maxspeed; - float maxforce; - - Vehicle(float x, float y) { - acceleration = new PVector(0, 0); - velocity = new PVector(1,0); - velocity.mult(5); - location = new PVector(x, y); - r = 3; - maxspeed = 3; - maxforce = 0.15; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void boundaries() { - - PVector desired = null; - - // Predict location 25 (arbitrary choice) frames ahead - PVector predict = velocity.get(); - predict.mult(25); - PVector futureLocation = PVector.add(location, predict); - float distance = PVector.dist(futureLocation,circleLocation); - - if (distance > circleRadius) { - PVector toCenter = PVector.sub(circleLocation,location); - toCenter.normalize(); - toCenter.mult(velocity.mag()); - desired = PVector.add(velocity,toCenter); - desired.normalize(); - desired.mult(maxspeed); - } - - if (desired != null) { - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); - applyForce(steer); - } - - fill(255,0,0); - ellipse(futureLocation.x,futureLocation.y,4,4); - - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection/Thing.pde b/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection/Thing.pde deleted file mode 100644 index 7a739186b..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection/Thing.pde +++ /dev/null @@ -1,33 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Daniel Shiffman - -// Simple class describing an ellipse living on our screen - -class Thing { - - float x,y; - boolean highlight; - float r; - - Thing (float x_, float y_) { - x = x_; - y = y_; - highlight = false; - r = random(8) + 1; - } - - void move() { - x += random(-1,1); - y += random(-1,1); - } - - void render() { - noStroke(); - if (highlight) fill(255); - else fill(100); - ellipse(x,y,r,r); - } - -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection/intersection.pde b/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection/intersection.pde deleted file mode 100644 index a8474b9c3..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection/intersection.pde +++ /dev/null @@ -1,105 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Bin-Lattice Spatial Subdivision -// http://www.red3d.com/cwr/papers/2000/pip.pdf - -// Example demonstrating optimized intersection test for large # of objects -// Each object registers its location in a virtual grid -// Only the objects in neighboring cells on the grid are tested against each other - -int totalThings = 2000; - -ArrayList a; // ArrayList for all "things" -ArrayList[][] grid; // Grid of ArrayLists for intersection test -int scl = 4; // Size of each grid cell -int cols, rows; // Total coluns and rows - -void setup() { - size(640,360); - a = new ArrayList(); // Create the list - cols = width/scl; // Calculate cols & rows - rows = height/scl; - - // Initialize grid as 2D array of empty ArrayLists - grid = new ArrayList[cols][rows]; - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - grid[i][j] = new ArrayList(); - } - } - - // Put 2000 Things in the system - for (int i = 0; i < totalThings; i++) { - a.add(new Thing(random(width),random(height))); - } - -} - -void draw() { - background(0); - - // Every time through draw clear all the lists - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - grid[i][j].clear(); - } - } - - // Register every Thing object in the grid according to it's location - for (Thing t : a) { - t.highlight = false; - int x = int(t.x) / scl; - int y = int (t.y) /scl; - // It goes in 9 cells, i.e. every Thing is tested against other Things in its cell - // as well as its 8 neighbors - for (int n = -1; n <= 1; n++) { - for (int m = -1; m <= 1; m++) { - if (x+n >= 0 && x+n < cols && y+m >= 0 && y+m< rows) grid[x+n][y+m].add(t); - } - } - } - - // Run through the Grid - stroke(255); - for (int i = 0; i < cols; i++) { - //line(i*scl,0,i*scl,height); - for (int j = 0; j < rows; j++) { - //line(0,j*scl,width,j*scl); - - // For every list in the grid - ArrayList temp = grid[i][j]; - // Check every Thing - for (Thing t : temp) { - // Against every other Thing - for (Thing other : temp) { - // As long as its not the same one - if (other != t) { - // Check to see if they are touching - // (We could do many other things here besides just intersection tests, such - // as apply forces, etc.) - float d = dist(t.x,t.y,other.x,other.y); - if (d < t.r/2 + other.r/2) { - t.highlight = true; - } - } - } - } - } - } - - // Display and move all Things - for (Thing t : a) { - t.render(); - t.move(); - } - - fill(0); - rect(0,height-20,width,20); - fill(255); - text("Framerate: " + int(frameRate),10,height-6); - - - -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection_slow/Thing.pde b/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection_slow/Thing.pde deleted file mode 100644 index 7a739186b..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection_slow/Thing.pde +++ /dev/null @@ -1,33 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Daniel Shiffman - -// Simple class describing an ellipse living on our screen - -class Thing { - - float x,y; - boolean highlight; - float r; - - Thing (float x_, float y_) { - x = x_; - y = y_; - highlight = false; - r = random(8) + 1; - } - - void move() { - x += random(-1,1); - y += random(-1,1); - } - - void render() { - noStroke(); - if (highlight) fill(255); - else fill(100); - ellipse(x,y,r,r); - } - -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection_slow/intersection_slow.pde b/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection_slow/intersection_slow.pde deleted file mode 100644 index f8303c06e..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection_slow/intersection_slow.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// The old way to do intersection tests, look how slow!! - -int totalThings = 2000; - -ArrayList a; // ArrayList for all "things" - -void setup() { - size(640,360); - a = new ArrayList(); // Create the list - - // Put 2000 Things in the system - for (int i = 0; i < totalThings; i++) { - a.add(new Thing(random(width),random(height))); - } - -} - -void draw() { - background(0); - fill(255); - noStroke(); - // Run through the Grid - stroke(255); - for (Thing t : a) { - t.highlight = false; - for (Thing other : a) { - // As long as its not the same one - if (t != other) { - // Check to see if they are touching - // (We could do many other things here besides just intersection tests, such - // as apply forces, etc.) - float d = dist(t.x,t.y,other.x,other.y); - if (d < t.r/2 + other.r/2) { - t.highlight = true; - } - } - } - } - - // Display and move all Things - for (Thing t : a) { - t.render(); - t.move(); - } - - fill(0); - rect(0,height-20,width,20); - fill(255); - text("Framerate: " + int(frameRate),10,height-6); - - - -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Boid.pde b/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Boid.pde deleted file mode 100644 index 85150e404..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Boid.pde +++ /dev/null @@ -1,257 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flocking - -// Boid class -// Methods for Separation, Cohesion, Alignment added - -class Boid { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Boid(PVector loc) { - w = 12; - h = 12; - // Add the box to the box2d world - makeBody(new Vec2(loc.x,loc.y),w,h,new Vec2(0,0),0); - maxspeed = 20; - maxforce = 10; - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - void run(ArrayList boids) { - flock(boids); - borders(); - display(); - } - - // We accumulate a new acceleration each time based on three rules - void flock(ArrayList boids) { - Vec2 sep = separate(boids); // Separation - Vec2 ali = align(boids); // Alignment - Vec2 coh = cohesion(boids); // Cohesion - // Arbitrarily weight these forces - sep.mulLocal(1.5); - ali.mulLocal(1); - coh.mulLocal(1); - // Add the force vectors to acceleration - Vec2 loc = body.getWorldCenter(); - body.applyForce(sep,loc); - body.applyForce(ali,loc); - body.applyForce(coh,loc); - } - - // A method that calculates and applies a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - Vec2 seek(Vec2 target) { - Vec2 loc = body.getWorldCenter(); - Vec2 desired = target.sub(loc); // A vector pointing from the location to the target - - // If the magnitude of desired equals 0, skip out of here - // (We could optimize this to check if x and y are 0 to avoid mag() square root - if (desired.length() == 0) return new Vec2(0,0); - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mulLocal(maxspeed); - // Steering = Desired minus Velocity - - Vec2 vel = body.getLinearVelocity(); - Vec2 steer = desired.sub(vel); - - float len = steer.length(); - if (len > maxforce) { - steer.normalize(); - steer.mulLocal(maxforce); - } - return steer; - } - - - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(CENTER); - pushMatrix(); - translate(pos.x,pos.y); - rotate(-a); - fill(175); - strokeWeight(2); - stroke(0); - rect(0,0,w,h); - popMatrix(); - } - - // Wraparound - void borders() { - Vec2 loc = box2d.getBodyPixelCoord(body); - Vec2 vel = body.getLinearVelocity(); - float a = body.getAngularVelocity(); - if (loc.x < -w) { - killBody(); - makeBody(new Vec2(width+w,loc.y),w,h,vel,a); - } else if (loc.y < -w) { - killBody(); - makeBody(new Vec2(loc.x,height+w),w,h,vel,a); - } else if (loc.x > width+w) { - killBody(); - makeBody(new Vec2(-w,loc.y),w,h,vel,a); - } else if (loc.y > height+w) { - killBody(); - makeBody(new Vec2(loc.x,-w),w,h,vel,a); - } - } - - // Separation - // Method checks for nearby boids and steers away - Vec2 separate (ArrayList boids) { - float desiredseparation = box2d.scalarPixelsToWorld(30); - - Vec2 steer = new Vec2(0,0); - int count = 0; - // For every boid in the system, check if it's too close - Vec2 locA = body.getWorldCenter(); - for (Boid other : boids) { - Vec2 locB = other.body.getWorldCenter(); - float d = dist(locA.x,locA.y,locB.x,locB.y); - // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) - if ((d > 0) && (d < desiredseparation)) { - // Calculate vector pointing away from neighbor - Vec2 diff = locA.sub(locB); - diff.normalize(); - diff.mulLocal(1.0/d); // Weight by distance - steer.addLocal(diff); - count++; // Keep track of how many - } - } - // Average -- divide by how many - if (count > 0) { - steer.mulLocal(1.0/count); - } - - // As long as the vector is greater than 0 - if (steer.length() > 0) { - // Implement Reynolds: Steering = Desired - Velocity - steer.normalize(); - steer.mulLocal(maxspeed); - Vec2 vel = body.getLinearVelocity(); - steer.subLocal(vel); - float len = steer.length(); - if (len > maxforce) { - steer.normalize(); - steer.mulLocal(maxforce); - } - } - return steer; - } - - // Alignment - // For every nearby boid in the system, calculate the average velocity - Vec2 align (ArrayList boids) { - float neighbordist = box2d.scalarPixelsToWorld(50); - Vec2 steer = new Vec2(0,0); - int count = 0; - Vec2 locA = body.getWorldCenter(); - for (Boid other : boids) { - Vec2 locB = other.body.getWorldCenter(); - float d = dist(locA.x,locA.y,locB.x,locB.y); - if ((d > 0) && (d < neighbordist)) { - Vec2 vel = other.body.getLinearVelocity(); - steer.addLocal(vel); - count++; - } - } - if (count > 0) { - steer.mulLocal(1.0/count); - } - - // As long as the vector is greater than 0 - if (steer.length() > 0) { - // Implement Reynolds: Steering = Desired - Velocity - steer.normalize(); - steer.mulLocal(maxspeed); - Vec2 vel = body.getLinearVelocity(); - steer.subLocal(vel); - float len = steer.length(); - if (len > maxforce) { - steer.normalize(); - steer.mulLocal(maxforce); - } - } - return steer; - } - - // Cohesion - // For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location - Vec2 cohesion (ArrayList boids) { - float neighbordist = box2d.scalarPixelsToWorld(50); - Vec2 sum = new Vec2(0,0); // Start with empty vector to accumulate all locations - int count = 0; - Vec2 locA = body.getWorldCenter(); - for (Boid other : boids) { - Vec2 locB = other.body.getWorldCenter(); - - float d = dist(locA.x,locA.y,locB.x,locB.y); - if ((d > 0) && (d < neighbordist)) { - sum.addLocal(locB); // Add location - count++; - } - } - if (count > 0) { - sum.mulLocal(1.0/count); - return seek(sum); // Steer towards the location - } - return sum; - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_, Vec2 vel, float avel) { - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - // Define the body and make it from the shape - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - - body = box2d.createBody(bd); - body.createFixture(fd); - - body.setLinearVelocity(vel); - body.setAngularVelocity(avel); - - } - - -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Flock.pde b/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Flock.pde deleted file mode 100644 index 47b0e7b16..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Flock.pde +++ /dev/null @@ -1,27 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flocking - -// Flock class -// Does very little, simply manages the ArrayList of all the boids - -class Flock { - ArrayList boids; // An arraylist for all the boids - - Flock() { - boids = new ArrayList(); // Initialize the arraylist - } - - void run() { - for (Boid b : boids) { - b.run(boids); // Passing the entire list of boids to each boid individually - } - } - - void addBoid(Boid b) { - boids.add(b); - } - -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Flocking_box2d.pde b/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Flocking_box2d.pde deleted file mode 100644 index e037a4db9..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Flocking_box2d.pde +++ /dev/null @@ -1,54 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flocking - -// Demonstration of Craig Reynolds' "Flocking" behavior -// See: http://www.red3d.com/cwr/ -// Rules: Cohesion, Separation, Alignment - -// Click mouse to add boids into the system - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -Flock flock; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0,0); - - flock = new Flock(); - // Add an initial set of boids into the system - for (int i = 0; i < 50; i++) { - flock.addBoid(new Boid(new PVector(random(width),random(height)))); - } -} - -void draw() { - // We must always step through time! - box2d.step(); - - background(255); - flock.run(); -} - -void mousePressed() { - flock.addBoid(new Boid(new PVector(mouseX,mouseY))); -} - -void mouseDragged() { - flock.addBoid(new Boid(new PVector(mouseX,mouseY))); -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/Boid.pde b/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/Boid.pde deleted file mode 100644 index 808b7c6d5..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/Boid.pde +++ /dev/null @@ -1,185 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float swt = 25.0; //sep.mult(25.0f); -float awt = 4.0; //ali.mult(4.0f); -float cwt = 5.0; //coh.mult(5.0f); -float maxspeed = 1; -float maxforce = 0.025; - - -// Flocking -// Daniel Shiffman -// The Nature of Code, Spring 2009 - -// Boid class -// Methods for Separation, Cohesion, Alignment added - -class Boid { - - PVector loc; - PVector vel; - PVector acc; - float r; - - Boid(float x, float y) { - acc = new PVector(0,0); - vel = new PVector(random(-1,1),random(-1,1)); - loc = new PVector(x,y); - r = 2.0; - } - - void run(ArrayList boids) { - flock(boids); - update(); - borders(); - render(); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acc.add(force); - } - - // We accumulate a new acceleration each time based on three rules - void flock(ArrayList boids) { - PVector sep = separate(boids); // Separation - PVector ali = align(boids); // Alignment - PVector coh = cohesion(boids); // Cohesion - // Arbitrarily weight these forces - sep.mult(swt); - ali.mult(awt); - coh.mult(cwt); - // Add the force vectors to acceleration - applyForce(sep); - applyForce(ali); - applyForce(coh); - } - - // Method to update location - void update() { - // Update velocity - vel.add(acc); - // Limit speed - vel.limit(maxspeed); - loc.add(vel); - // Reset accelertion to 0 each cycle - acc.mult(0); - } - - // A method that calculates and applies a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - PVector seek(PVector target) { - PVector desired = PVector.sub(target,loc); // A vector pointing from the location to the target - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus Velocity - PVector steer = PVector.sub(desired,vel); - steer.limit(maxforce); // Limit to maximum steering force - - return steer; - } - - void render() { - // Draw a triangle rotated in the direction of velocity - float theta = vel.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(loc.x,loc.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders() { - if (loc.x < -r) loc.x = width+r; - if (loc.y < -r) loc.y = height+r; - if (loc.x > width+r) loc.x = -r; - if (loc.y > height+r) loc.y = -r; - } - - // Separation - // Method checks for nearby boids and steers away - PVector separate (ArrayList boids) { - float desiredseparation = 25.0; - PVector steer = new PVector(0,0); - int count = 0; - // For every boid in the system, check if it's too close - for (Boid other : boids) { - float d = PVector.dist(loc,other.loc); - // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) - if ((d > 0) && (d < desiredseparation)) { - // Calculate vector pointing away from neighbor - PVector diff = PVector.sub(loc,other.loc); - diff.normalize(); - diff.div(d); // Weight by distance - steer.add(diff); - count++; // Keep track of how many - } - } - // Average -- divide by how many - if (count > 0) { - steer.div((float)count); - // Implement Reynolds: Steering = Desired - Velocity - steer.normalize(); - steer.mult(maxspeed); - steer.sub(vel); - steer.limit(maxforce); - } - return steer; - } - - // Alignment - // For every nearby boid in the system, calculate the average velocity - PVector align (ArrayList boids) { - float neighbordist = 50.0; - PVector steer = new PVector(); - int count = 0; - for (Boid other : boids) { - float d = PVector.dist(loc,other.loc); - if ((d > 0) && (d < neighbordist)) { - steer.add(other.vel); - count++; - } - } - if (count > 0) { - steer.div((float)count); - // Implement Reynolds: Steering = Desired - Velocity - steer.normalize(); - steer.mult(maxspeed); - steer.sub(vel); - steer.limit(maxforce); - } - return steer; - } - - // Cohesion - // For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location - PVector cohesion (ArrayList boids) { - float neighbordist = 50.0; - PVector sum = new PVector(0,0); // Start with empty vector to accumulate all locations - int count = 0; - for (Boid other : boids) { - float d = PVector.dist(loc,other.loc); - if ((d > 0) && (d < neighbordist)) { - sum.add(other.loc); // Add location - count++; - } - } - if (count > 0) { - sum.div((float)count); - return seek(sum); // Steer towards the location - } - return sum; - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/Flock.pde b/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/Flock.pde deleted file mode 100644 index b548b2469..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/Flock.pde +++ /dev/null @@ -1,25 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flock class -// Does very little, simply manages the ArrayList of all the boids - -class Flock { - ArrayList boids; // An ArrayList for all the boids - - Flock() { - boids = new ArrayList(); // Initialize the ArrayList - } - - void run() { - for (Boid b : boids) { - b.run(boids); // Passing the entire list of boids to each boid individually - } - } - - void addBoid(Boid b) { - boids.add(b); - } - -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/flocking_sliders.pde b/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/flocking_sliders.pde deleted file mode 100644 index afbf53ec4..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/flocking_sliders.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - - -// Flocking -// Demonstration of Craig Reynolds' "Flocking" behavior -// See: http://www.red3d.com/cwr/ -// Rules: Cohesion, Separation, Alignment - -// Click mouse to add boids into the system -Flock flock; -PVector center; - -boolean showvalues = true; -boolean scrollbar = false; - - -void setup() { - size(displayWidth,displayHeight,P2D); - setupScrollbars(); - center = new PVector(width/2,height/2); - colorMode(RGB,255,255,255,100); - flock = new Flock(); - // Add an initial set of boids into the system - for (int i = 0; i < 120; i++) { - flock.addBoid(new Boid(width/2,height/2)); - } - smooth(); -} - - -void draw() { - - background(255); - flock.run(); - drawScrollbars(); - - if (mousePressed && !scrollbar) { - flock.addBoid(new Boid(mouseX,mouseY)); - } - - - if (showvalues) { - fill(0); - textAlign(LEFT); - text("Total boids: " + flock.boids.size() + "\n" + "Framerate: " + round(frameRate) + "\nPress any key to show/hide sliders and text\nClick mouse to add more boids",5,100); - } -} - -void keyPressed() { - showvalues = !showvalues; -} - -void mousePressed() { -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/keyPressed.pde b/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/keyPressed.pde deleted file mode 100644 index b28b04f64..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/keyPressed.pde +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/scrollbar.pde b/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/scrollbar.pde deleted file mode 100644 index 3a6bc39be..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/scrollbar.pde +++ /dev/null @@ -1,137 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Code based on "Scrollbar" by Casey Reas - -HScrollbar[] hs = new HScrollbar[5];// -String[] labels = {"separation", "alignment","cohesion","maxspeed","maxforce"}; - -int x = 5; -int y = 20; -int w = 50; -int h = 8; -int l = 2; -int spacing = 4; - -void setupScrollbars() { - for (int i = 0; i < hs.length; i++) { - hs[i] = new HScrollbar(x, y + i*(h+spacing), w, h, l); - } - - hs[0].setPos(0.5); - hs[1].setPos(0.5); - hs[2].setPos(0.5); - hs[3].setPos(0.5); - hs[4].setPos(0.05); - -} - -void drawScrollbars() { - //if (showvalues) { - swt = hs[0].getPos()*10.0f; //sep.mult(25.0f); - awt = hs[1].getPos()*2.0f; //sep.mult(25.0f); - cwt = hs[2].getPos()*2.0f; //sep.mult(25.0f); - maxspeed = hs[3].getPos()*10.0f; - maxforce = hs[4].getPos()*0.5; - - - if (showvalues) { - for (int i = 0; i < hs.length; i++) { - hs[i].update(); - hs[i].draw(); - fill(0); - textAlign(LEFT); - text(labels[i],x+w+spacing,y+i*(h+spacing)+spacing); - //text(hs[i].getPos(),x+w+spacing+75,y+i*(h+spacing)+spacing); - } - } -} - - -class HScrollbar -{ - int swidth, sheight; // width and height of bar - int xpos, ypos; // x and y position of bar - float spos, newspos; // x position of slider - int sposMin, sposMax; // max and min values of slider - int loose; // how loose/heavy - boolean over; // is the mouse over the slider? - boolean locked; - float ratio; - - HScrollbar (int xp, int yp, int sw, int sh, int l) { - swidth = sw; - sheight = sh; - int widthtoheight = sw - sh; - ratio = (float)sw / (float)widthtoheight; - xpos = xp; - ypos = yp-sheight/2; - spos = xpos; - newspos = spos; - sposMin = xpos; - sposMax = xpos + swidth - sheight; - loose = l; - } - - void update() { - if(over()) { - over = true; - } - else { - over = false; - } - if(mousePressed && over) { - scrollbar = true; - locked = true; - } - if(!mousePressed) { - locked = false; - scrollbar = false; - } - if(locked) { - newspos = constrain(mouseX-sheight/2, sposMin, sposMax); - } - if(abs(newspos - spos) > 0) { - spos = spos + (newspos-spos)/loose; - } - } - - int constrain(int val, int minv, int maxv) { - return min(max(val, minv), maxv); - } - - boolean over() { - if(mouseX > xpos && mouseX < xpos+swidth && - mouseY > ypos && mouseY < ypos+sheight) { - return true; - } - else { - return false; - } - } - - void draw() { - fill(255); - rectMode(CORNER); - rect(xpos, ypos, swidth, sheight); - if(over || locked) { - fill(153, 102, 0); - } - else { - fill(102, 102, 102); - } - rect(spos, ypos, sheight, sheight); - } - - void setPos(float s) { - spos = xpos + s*(sposMax-sposMin); - newspos = spos; - } - - float getPos() { - // convert spos to be values between - // 0 and the total width of the scrollbar - return ((spos-xpos))/(sposMax-sposMin);// * ratio; - } -} diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_01_WolframCA_randomizedrules/CA.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_01_WolframCA_randomizedrules/CA.pde deleted file mode 100644 index 57f208c2c..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_01_WolframCA_randomizedrules/CA.pde +++ /dev/null @@ -1,98 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// A class to manage the CA - -class CA { - - int[] cells; // An array of 0s and 1s - int generation; // How many generations? - - int[] ruleset; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1} - - int w = 5; - - CA(int[] r) { - ruleset = r; - cells = new int[width/w]; - restart(); - } - - // Make a random ruleset - void randomize() { - for (int i = 0; i < 8; i++) { - ruleset[i] = int(random(2)); - } - } - - // Reset to generation 0 - void restart() { - for (int i = 0; i < cells.length; i++) { - cells[i] = 0; - } - cells[cells.length/2] = 1; // We arbitrarily start with just the middle cell having a state of "1" - generation = 0; - } - - - // The process of creating the new generation - void generate() { - // First we create an empty array for the new values - int[] nextgen = new int[cells.length]; - // For every spot, determine new state by examing current state, and neighbor states - // Ignore edges that only have one neighor - for (int i = 1; i < cells.length-1; i++) { - int left = cells[i-1]; // Left neighbor state - int me = cells[i]; // Current state - int right = cells[i+1]; // Right neighbor state - nextgen[i] = rules(left, me, right); // Compute next generation state based on ruleset - } - // The current generation is the new generation - cells = nextgen; - generation++; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - for (int i = 0; i < cells.length; i++) { - if (cells[i] == 1) fill(0); - else fill(255); - noStroke(); - rect(i*w, generation*w, w, w); - } - } - - // Implementing the Wolfram rules - // This is the concise conversion to binary way - /*int rules (int a, int b, int c) { - String s = "" + a + b + c; - int index = Integer.parseInt(s, 2); - return ruleset[index]; - }*/ - // For JavaScript Mode - int rules (int a, int b, int c) { - if (a == 1 && b == 1 && c == 1) return ruleset[0]; - if (a == 1 && b == 1 && c == 0) return ruleset[1]; - if (a == 1 && b == 0 && c == 1) return ruleset[2]; - if (a == 1 && b == 0 && c == 0) return ruleset[3]; - if (a == 0 && b == 1 && c == 1) return ruleset[4]; - if (a == 0 && b == 1 && c == 0) return ruleset[5]; - if (a == 0 && b == 0 && c == 1) return ruleset[6]; - if (a == 0 && b == 0 && c == 0) return ruleset[7]; - return 0; - } - - // The CA is done if it reaches the bottom of the screen - boolean finished() { - if (generation > height/w) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_01_WolframCA_randomizedrules/Exercise_7_01_WolframCA_randomizedrules.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_01_WolframCA_randomizedrules/Exercise_7_01_WolframCA_randomizedrules.pde deleted file mode 100644 index f39ae6b7f..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_01_WolframCA_randomizedrules/Exercise_7_01_WolframCA_randomizedrules.pde +++ /dev/null @@ -1,45 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// Simple demonstration of a Wolfram 1-dimensional cellular automata -// When the system reaches bottom of the window, it restarts with a new ruleset -// Mouse click restarts as well - -CA ca; // An object to describe a Wolfram elementary Cellular Automata - -int delay = 0; - -void setup() { - size(800, 200); - background(255); - int[] ruleset = { - 0, 1, 0, 1, 1, 0, 1, 0 - }; // An initial rule system - ca = new CA(ruleset); // Initialize CA - frameRate(30); -} - -void draw() { - ca.display(); // Draw the CA - ca.generate(); - - if (ca.finished()) { // If we're done, clear the screen, pick a new ruleset and restart - delay++; - if (delay > 30) { - background(255); - ca.randomize(); - ca.restart(); - delay = 0; - } - } -} - -void mousePressed() { - background(255); - ca.randomize(); - ca.restart(); -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling/CA.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling/CA.pde deleted file mode 100644 index aadb60528..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling/CA.pde +++ /dev/null @@ -1,97 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// A class to manage the CA - -class CA { - - int generation; // How many generations? - int[] ruleset; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1} - int w = 4; - int[][] matrix; // Store a history of generations in 2D array, not just one - - int cols; - int rows; - - - CA(int[] r) { - ruleset = r; - cols = width/w; - rows = height/w; - matrix = new int[cols][rows]; - restart(); - } - - // Make a random ruleset - void randomize() { - for (int i = 0; i < 8; i++) { - ruleset[i] = int(random(2)); - } - } - - // Reset to generation 0 - void restart() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - matrix[i][j] = 0; - } - } - matrix[cols/2][0] = 1; // We arbitrarily start with just the middle cell having a state of "1" - generation = 0; - } - - - // The process of creating the new generation - void generate() { - - // For every spot, determine new state by examing current state, and neighbor states - // Ignore edges that only have one neighor - for (int i = 0; i < cols; i++) { - int left = matrix[(i+cols-1)%cols][generation%rows]; // Left neighbor state - int me = matrix[i][generation%rows]; // Current state - int right = matrix[(i+1)%cols][generation%rows]; // Right neighbor state - matrix[i][(generation+1)%rows] = rules(left, me, right); // Compute next generation state based on ruleset - } - generation++; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - int offset = generation%rows; - - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - int y = j - offset; - if (y <= 0) y = rows + y; - // Only draw if cell state is 1 - if (matrix[i][j] == 1) { - fill(0); - noStroke(); - rect(i*w, (y-1)*w, w, w); - } - } - } - } - - // Implementing the Wolfram rules - // This is the concise conversion to binary way - int rules (int a, int b, int c) { - String s = "" + a + b + c; - int index = Integer.parseInt(s, 2); - return ruleset[index]; - } - - // The CA is done if it reaches the bottom of the screen - boolean finished() { - if (generation > height/w) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling/Exercise_7_04_WolframCA_scrolling.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling/Exercise_7_04_WolframCA_scrolling.pde deleted file mode 100644 index 4107ec882..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling/Exercise_7_04_WolframCA_scrolling.pde +++ /dev/null @@ -1,31 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// Simple demonstration of a Wolfram 1-dimensional cellular automata -// with the system scrolling by -// Also implements wrap around - -CA ca; // An object to describe a Wolfram elementary Cellular Automata - - -void setup() { - size(640, 800); - frameRate(24); - background(255); - //int[] ruleset = {0,1,1,1,1,0,1,1}; // Rule 222 - //int[] ruleset = {0,1,1,1,1,1,0,1}; // Rule 190 - //int[] ruleset = {0,1,1,1,1,0,0,0}; // Rule 30 - //int[] ruleset = {0,1,1,1,0,1,1,0}; // Rule 110 - int[] ruleset = {0,1,0,1,1,0,1,0}; // Rule 90 - - ca = new CA(ruleset); // Initialize CA -} - -void draw() { - background(255); - ca.display(); // Draw the CA - ca.generate(); -} diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_110/CA.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_110/CA.pde deleted file mode 100644 index fa62c817f..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_110/CA.pde +++ /dev/null @@ -1,107 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// A class to manage the CA - -class CA { - - int generation; // How many generations? - int[] ruleset; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1} - int w = 5; - int[][] matrix; // Store a history of generations in 2D array, not just one - - int cols; - int rows; - - - CA(int[] r) { - ruleset = r; - cols = width/w; - rows = height/w; - matrix = new int[cols][rows]; - restart(); - } - - // Make a random ruleset - void randomize() { - for (int i = 0; i < 8; i++) { - ruleset[i] = int(random(2)); - } - } - - // Reset to generation 0 - void restart() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - matrix[i][j] = 0; - } - } - matrix[cols/2][0] = 1; // We arbitrarily start with just the middle cell having a state of "1" - generation = 0; - } - - - // The process of creating the new generation - void generate() { - - // For every spot, determine new state by examing current state, and neighbor states - // Ignore edges that only have one neighor - for (int i = 0; i < cols; i++) { - int left = matrix[(i+cols-1)%cols][generation%rows]; // Left neighbor state - int me = matrix[i][generation%rows]; // Current state - int right = matrix[(i+1)%cols][generation%rows]; // Right neighbor state - matrix[i][(generation+1)%rows] = rules(left, me, right); // Compute next generation state based on ruleset - } - generation++; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - int offset = generation%rows; - - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - int y = j - offset; - if (y <= 0) y = rows + y; - if (matrix[i][j] == 1) fill(0); - else fill(255); - noStroke(); - rect(i*w, (y-1)*w, w, w); - } - } - } - - // Implementing the Wolfram rules - // This is the concise conversion to binary way - /*int rules (int a, int b, int c) { - String s = "" + a + b + c; - int index = Integer.parseInt(s, 2); - return ruleset[index]; - }*/ - // For JavaScript Mode - int rules (int a, int b, int c) { - if (a == 1 && b == 1 && c == 1) return ruleset[7]; - if (a == 1 && b == 1 && c == 0) return ruleset[6]; - if (a == 1 && b == 0 && c == 1) return ruleset[5]; - if (a == 1 && b == 0 && c == 0) return ruleset[4]; - if (a == 0 && b == 1 && c == 1) return ruleset[3]; - if (a == 0 && b == 1 && c == 0) return ruleset[2]; - if (a == 0 && b == 0 && c == 1) return ruleset[1]; - if (a == 0 && b == 0 && c == 0) return ruleset[0]; - return 0; - } - - // The CA is done if it reaches the bottom of the screen - boolean finished() { - if (generation > height/w) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_110/Exercise_7_04_WolframCA_scrolling_110.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_110/Exercise_7_04_WolframCA_scrolling_110.pde deleted file mode 100644 index fbf426702..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_110/Exercise_7_04_WolframCA_scrolling_110.pde +++ /dev/null @@ -1,29 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// Simple demonstration of a Wolfram 1-dimensional cellular automata -// with the system scrolling by -// Also implements wrap around - -CA ca; // An object to describe a Wolfram elementary Cellular Automata - - -void setup() { - size(800, 100); - frameRate(30); - background(255); - //int[] ruleset = {0,1,1,1,1,0,1,1}; // Rule 222 - //int[] ruleset = {0,1,1,1,1,1,0,1}; // Rule 190 - //int[] ruleset = {0,1,1,1,1,0,0,0}; // Rule 30 - int[] ruleset = {0,1,1,1,0,1,1,0}; // Rule 110 - - ca = new CA(ruleset); // Initialize CA -} - -void draw() { - ca.display(); // Draw the CA - ca.generate(); -} diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_190/CA.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_190/CA.pde deleted file mode 100644 index fa62c817f..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_190/CA.pde +++ /dev/null @@ -1,107 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// A class to manage the CA - -class CA { - - int generation; // How many generations? - int[] ruleset; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1} - int w = 5; - int[][] matrix; // Store a history of generations in 2D array, not just one - - int cols; - int rows; - - - CA(int[] r) { - ruleset = r; - cols = width/w; - rows = height/w; - matrix = new int[cols][rows]; - restart(); - } - - // Make a random ruleset - void randomize() { - for (int i = 0; i < 8; i++) { - ruleset[i] = int(random(2)); - } - } - - // Reset to generation 0 - void restart() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - matrix[i][j] = 0; - } - } - matrix[cols/2][0] = 1; // We arbitrarily start with just the middle cell having a state of "1" - generation = 0; - } - - - // The process of creating the new generation - void generate() { - - // For every spot, determine new state by examing current state, and neighbor states - // Ignore edges that only have one neighor - for (int i = 0; i < cols; i++) { - int left = matrix[(i+cols-1)%cols][generation%rows]; // Left neighbor state - int me = matrix[i][generation%rows]; // Current state - int right = matrix[(i+1)%cols][generation%rows]; // Right neighbor state - matrix[i][(generation+1)%rows] = rules(left, me, right); // Compute next generation state based on ruleset - } - generation++; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - int offset = generation%rows; - - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - int y = j - offset; - if (y <= 0) y = rows + y; - if (matrix[i][j] == 1) fill(0); - else fill(255); - noStroke(); - rect(i*w, (y-1)*w, w, w); - } - } - } - - // Implementing the Wolfram rules - // This is the concise conversion to binary way - /*int rules (int a, int b, int c) { - String s = "" + a + b + c; - int index = Integer.parseInt(s, 2); - return ruleset[index]; - }*/ - // For JavaScript Mode - int rules (int a, int b, int c) { - if (a == 1 && b == 1 && c == 1) return ruleset[7]; - if (a == 1 && b == 1 && c == 0) return ruleset[6]; - if (a == 1 && b == 0 && c == 1) return ruleset[5]; - if (a == 1 && b == 0 && c == 0) return ruleset[4]; - if (a == 0 && b == 1 && c == 1) return ruleset[3]; - if (a == 0 && b == 1 && c == 0) return ruleset[2]; - if (a == 0 && b == 0 && c == 1) return ruleset[1]; - if (a == 0 && b == 0 && c == 0) return ruleset[0]; - return 0; - } - - // The CA is done if it reaches the bottom of the screen - boolean finished() { - if (generation > height/w) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_190/Exercise_7_04_WolframCA_scrolling_190.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_190/Exercise_7_04_WolframCA_scrolling_190.pde deleted file mode 100644 index bf9542216..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_190/Exercise_7_04_WolframCA_scrolling_190.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// Simple demonstration of a Wolfram 1-dimensional cellular automata -// with the system scrolling by -// Also implements wrap around - -CA ca; // An object to describe a Wolfram elementary Cellular Automata - - -void setup() { - size(800, 100); - frameRate(30); - background(255); - //int[] ruleset = {0,1,1,1,1,0,1,1}; // Rule 222 - int[] ruleset = {0,1,1,1,1,1,0,1}; // Rule 190 - //int[] ruleset = {0,1,1,1,1,0,0,0}; // Rule 30 - //int[] ruleset = {0,1,1,1,0,1,1,0}; // Rule 110 - - ca = new CA(ruleset); // Initialize CA -} - -void draw() { - ca.display(); // Draw the CA - ca.generate(); -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_222/CA.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_222/CA.pde deleted file mode 100644 index fa62c817f..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_222/CA.pde +++ /dev/null @@ -1,107 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// A class to manage the CA - -class CA { - - int generation; // How many generations? - int[] ruleset; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1} - int w = 5; - int[][] matrix; // Store a history of generations in 2D array, not just one - - int cols; - int rows; - - - CA(int[] r) { - ruleset = r; - cols = width/w; - rows = height/w; - matrix = new int[cols][rows]; - restart(); - } - - // Make a random ruleset - void randomize() { - for (int i = 0; i < 8; i++) { - ruleset[i] = int(random(2)); - } - } - - // Reset to generation 0 - void restart() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - matrix[i][j] = 0; - } - } - matrix[cols/2][0] = 1; // We arbitrarily start with just the middle cell having a state of "1" - generation = 0; - } - - - // The process of creating the new generation - void generate() { - - // For every spot, determine new state by examing current state, and neighbor states - // Ignore edges that only have one neighor - for (int i = 0; i < cols; i++) { - int left = matrix[(i+cols-1)%cols][generation%rows]; // Left neighbor state - int me = matrix[i][generation%rows]; // Current state - int right = matrix[(i+1)%cols][generation%rows]; // Right neighbor state - matrix[i][(generation+1)%rows] = rules(left, me, right); // Compute next generation state based on ruleset - } - generation++; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - int offset = generation%rows; - - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - int y = j - offset; - if (y <= 0) y = rows + y; - if (matrix[i][j] == 1) fill(0); - else fill(255); - noStroke(); - rect(i*w, (y-1)*w, w, w); - } - } - } - - // Implementing the Wolfram rules - // This is the concise conversion to binary way - /*int rules (int a, int b, int c) { - String s = "" + a + b + c; - int index = Integer.parseInt(s, 2); - return ruleset[index]; - }*/ - // For JavaScript Mode - int rules (int a, int b, int c) { - if (a == 1 && b == 1 && c == 1) return ruleset[7]; - if (a == 1 && b == 1 && c == 0) return ruleset[6]; - if (a == 1 && b == 0 && c == 1) return ruleset[5]; - if (a == 1 && b == 0 && c == 0) return ruleset[4]; - if (a == 0 && b == 1 && c == 1) return ruleset[3]; - if (a == 0 && b == 1 && c == 0) return ruleset[2]; - if (a == 0 && b == 0 && c == 1) return ruleset[1]; - if (a == 0 && b == 0 && c == 0) return ruleset[0]; - return 0; - } - - // The CA is done if it reaches the bottom of the screen - boolean finished() { - if (generation > height/w) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_222/Exercise_7_04_WolframCA_scrolling_222.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_222/Exercise_7_04_WolframCA_scrolling_222.pde deleted file mode 100644 index 24f356e7e..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_222/Exercise_7_04_WolframCA_scrolling_222.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// Simple demonstration of a Wolfram 1-dimensional cellular automata -// with the system scrolling by -// Also implements wrap around - -CA ca; // An object to describe a Wolfram elementary Cellular Automata - - -void setup() { - size(800, 100); - frameRate(30); - background(255); - int[] ruleset = {0,1,1,1,1,0,1,1}; // Rule 222 - //int[] ruleset = {0,1,1,1,1,1,0,1}; // Rule 190 - //int[] ruleset = {0,1,1,1,1,0,0,0}; // Rule 30 - //int[] ruleset = {0,1,1,1,0,1,1,0}; // Rule 110 - - ca = new CA(ruleset); // Initialize CA -} - -void draw() { - ca.display(); // Draw the CA - ca.generate(); -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_30/CA.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_30/CA.pde deleted file mode 100644 index 2353dcb9b..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_30/CA.pde +++ /dev/null @@ -1,106 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// A class to manage the CA - -class CA { - - int generation; // How many generations? - int[] ruleset; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1} - int w = 5; - int[][] matrix; // Store a history of generations in 2D array, not just one - - int cols; - int rows; - - - CA(int[] r) { - ruleset = r; - cols = width/w; - rows = height/w; - matrix = new int[cols][rows]; - restart(); - } - - // Make a random ruleset - void randomize() { - for (int i = 0; i < 8; i++) { - ruleset[i] = int(random(2)); - } - } - - // Reset to generation 0 - void restart() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - matrix[i][j] = 0; - } - } - matrix[cols/2][0] = 1; // We arbitrarily start with just the middle cell having a state of "1" - generation = 0; - } - - - // The process of creating the new generation - void generate() { - - // For every spot, determine new state by examing current state, and neighbor states - // Ignore edges that only have one neighor - for (int i = 0; i < cols; i++) { - int left = matrix[(i+cols-1)%cols][generation%rows]; // Left neighbor state - int me = matrix[i][generation%rows]; // Current state - int right = matrix[(i+1)%cols][generation%rows]; // Right neighbor state - matrix[i][(generation+1)%rows] = rules(left, me, right); // Compute next generation state based on ruleset - } - generation++; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - int offset = generation%rows; - - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - int y = j - offset; - if (y <= 0) y = rows + y; - if (matrix[i][j] == 1) fill(0); - else fill(255); - noStroke(); - rect(i*w, (y-1)*w, w, w); - } - } - } - // Implementing the Wolfram rules - // This is the concise conversion to binary way - /*int rules (int a, int b, int c) { - String s = "" + a + b + c; - int index = Integer.parseInt(s, 2); - return ruleset[index]; - }*/ - // For JavaScript Mode - int rules (int a, int b, int c) { - if (a == 1 && b == 1 && c == 1) return ruleset[7]; - if (a == 1 && b == 1 && c == 0) return ruleset[6]; - if (a == 1 && b == 0 && c == 1) return ruleset[5]; - if (a == 1 && b == 0 && c == 0) return ruleset[4]; - if (a == 0 && b == 1 && c == 1) return ruleset[3]; - if (a == 0 && b == 1 && c == 0) return ruleset[2]; - if (a == 0 && b == 0 && c == 1) return ruleset[1]; - if (a == 0 && b == 0 && c == 0) return ruleset[0]; - return 0; - } - - // The CA is done if it reaches the bottom of the screen - boolean finished() { - if (generation > height/w) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_30/Exercise_7_04_WolframCA_scrolling_30.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_30/Exercise_7_04_WolframCA_scrolling_30.pde deleted file mode 100644 index f77d59cb1..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_30/Exercise_7_04_WolframCA_scrolling_30.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// Simple demonstration of a Wolfram 1-dimensional cellular automata -// with the system scrolling by -// Also implements wrap around - -CA ca; // An object to describe a Wolfram elementary Cellular Automata - - -void setup() { - size(800, 100); - frameRate(30); - background(255); - //int[] ruleset = {0,1,1,1,1,0,1,1}; // Rule 222 - //int[] ruleset = {0,1,1,1,1,1,0,1}; // Rule 190 - int[] ruleset = {0,1,1,1,1,0,0,0}; // Rule 30 - //int[] ruleset = {0,1,1,1,0,1,1,0}; // Rule 110 - - ca = new CA(ruleset); // Initialize CA -} - -void draw() { - ca.display(); // Draw the CA - ca.generate(); -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/Cell.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/Cell.pde deleted file mode 100644 index 13acf5b88..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/Cell.pde +++ /dev/null @@ -1,42 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Cell { - - float x, y; - float w; - float xoff; - float yoff; - - int state; - - Cell(float x_, float y_, float w_) { - x = x_; - y = y_; - w = w_; - xoff = w/2; - yoff = sin(radians(60))*w; - state = int(random(2)); - } - - - void display() { - - fill(state*255); - stroke(0); - pushMatrix(); - translate(x,y); - beginShape(); - vertex(0, yoff); - vertex(xoff, 0); - vertex(xoff+w, 0); - vertex(2*w, yoff); - vertex(xoff+w, 2*yoff); - vertex(xoff, 2*yoff); - vertex(0, yoff); - endShape(); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/Exercise_7_09_HexagonCells.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/Exercise_7_09_HexagonCells.pde deleted file mode 100644 index 38b7e4e27..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/Exercise_7_09_HexagonCells.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Outline for game of life -// This is just a grid of hexagons right now - -GOL gol; - -void setup() { - size(640, 360); - gol = new GOL(); -} - -void draw() { - background(255); - gol.display(); -} - -// reset board when mouse is pressed -void mousePressed() { - gol.init(); -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/GOL.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/GOL.pde deleted file mode 100644 index 1f1491abe..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/GOL.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class GOL { - - float w = 20; - float h = sin(radians(60))*w; - int columns, rows; - - // Game of life board - Cell[][] board; - - - GOL() { - // Initialize rows, columns and set-up arrays - columns = width/int(w*3); - rows = height/int(h); - board = new Cell[columns][rows]; - init(); - } - - void init() { - float h = sin(radians(60))*w; - for (int i = 0; i < columns; i++) { - for (int j = 0; j < rows; j++) { - if (j % 2 == 0) board[i][j] = new Cell(i*w*3, j*h,w); - else board[i][j] = new Cell(i*w*3+w+h/2, j*h, w); - } - } - } - - - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - for ( int i = 0; i < columns;i++) { - for ( int j = 0; j < rows;j++) { - board[i][j].display(); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Figure_7_17_cells/Figure_7_17_cells.pde b/java/examples/Books/Nature of Code/chp7_CA/Figure_7_17_cells/Figure_7_17_cells.pde deleted file mode 100644 index ef16d1b06..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Figure_7_17_cells/Figure_7_17_cells.pde +++ /dev/null @@ -1,31 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -size(1800,90); - -int w = 90; - -int total = width/w; - -int[] cells = {1,0,1,0,0,0,0,1,0,1,1,1,0,0,0,1,1,1,0,0}; - - -print("int[] cells = {"); -for (int i = 0; i < cells.length; i++) { - if (cells[i] == 0) fill(255); - else fill(64); - stroke(0); - rect(i*w,0,w-1,w-1); - print(cells[i] +","); -} - -saveFrame("cells.png"); - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Figure_7_17_cells/cells.tif b/java/examples/Books/Nature of Code/chp7_CA/Figure_7_17_cells/cells.tif deleted file mode 100644 index 38ef13501..000000000 Binary files a/java/examples/Books/Nature of Code/chp7_CA/Figure_7_17_cells/cells.tif and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp7_CA/GameOfLifeWrapAround/GOL.pde b/java/examples/Books/Nature of Code/chp7_CA/GameOfLifeWrapAround/GOL.pde deleted file mode 100644 index 3fd3a82d5..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/GameOfLifeWrapAround/GOL.pde +++ /dev/null @@ -1,77 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class GOL { - - int w = 8; - int columns, rows; - - // Game of life board - int[][] board; - - - GOL() { - // Initialize rows, columns and set-up arrays - columns = width/w; - rows = height/w; - board = new int[columns][rows]; - //next = new int[columns][rows]; - // Call function to fill array with random values 0 or 1 - init(); - } - - void init() { - for (int i =1;i < columns-1;i++) { - for (int j =1;j < rows-1;j++) { - board[i][j] = int(random(2)); - } - } - } - - // The process of creating the new generation - void generate() { - - int[][] next = new int[columns][rows]; - - // Loop through every spot in our 2D array and check spots neighbors - for (int x = 0; x < columns; x++) { - for (int y = 0; y < rows; y++) { - - // Add up all the states in a 3x3 surrounding grid - int neighbors = 0; - for (int i = -1; i <= 1; i++) { - for (int j = -1; j <= 1; j++) { - neighbors += board[(x+i+columns)%columns][(y+j+rows)%rows]; - } - } - - // A little trick to subtract the current cell's state since - // we added it in the above loop - neighbors -= board[x][y]; - - // Rules of Life - if ((board[x][y] == 1) && (neighbors < 2)) next[x][y] = 0; // Loneliness - else if ((board[x][y] == 1) && (neighbors > 3)) next[x][y] = 0; // Overpopulation - else if ((board[x][y] == 0) && (neighbors == 3)) next[x][y] = 1; // Reproduction - else next[x][y] = board[x][y]; // Stasis - } - } - - // Next is now our board - board = next; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - for ( int i = 0; i < columns;i++) { - for ( int j = 0; j < rows;j++) { - if ((board[i][j] == 1)) fill(0); - else fill(255); - stroke(0); - rect(i*w, j*w, w, w); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/GameOfLifeWrapAround/GameOfLifeWrapAround.pde b/java/examples/Books/Nature of Code/chp7_CA/GameOfLifeWrapAround/GameOfLifeWrapAround.pde deleted file mode 100644 index f807dbebc..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/GameOfLifeWrapAround/GameOfLifeWrapAround.pde +++ /dev/null @@ -1,33 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Daniel Shiffman, Nature of Code - -// A basic implementation of John Conway's Game of Life CA -// how could this be improved to use object oriented programming? -// think of it as similar to our particle system, with a "cell" class -// to describe each individual cell and a "cellular automata" class -// to describe a collection of cells - -// Cells wrap around - -GOL gol; - -void setup() { - size(400, 400); - gol = new GOL(); -} - -void draw() { - background(255); - - gol.generate(); - gol.display(); -} - -// reset board when mouse is pressed -void mousePressed() { - gol.init(); -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/Cell.pde b/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/Cell.pde deleted file mode 100644 index 13acf5b88..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/Cell.pde +++ /dev/null @@ -1,42 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Cell { - - float x, y; - float w; - float xoff; - float yoff; - - int state; - - Cell(float x_, float y_, float w_) { - x = x_; - y = y_; - w = w_; - xoff = w/2; - yoff = sin(radians(60))*w; - state = int(random(2)); - } - - - void display() { - - fill(state*255); - stroke(0); - pushMatrix(); - translate(x,y); - beginShape(); - vertex(0, yoff); - vertex(xoff, 0); - vertex(xoff+w, 0); - vertex(2*w, yoff); - vertex(xoff+w, 2*yoff); - vertex(xoff, 2*yoff); - vertex(0, yoff); - endShape(); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/GOL.pde b/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/GOL.pde deleted file mode 100644 index 1f1491abe..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/GOL.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class GOL { - - float w = 20; - float h = sin(radians(60))*w; - int columns, rows; - - // Game of life board - Cell[][] board; - - - GOL() { - // Initialize rows, columns and set-up arrays - columns = width/int(w*3); - rows = height/int(h); - board = new Cell[columns][rows]; - init(); - } - - void init() { - float h = sin(radians(60))*w; - for (int i = 0; i < columns; i++) { - for (int j = 0; j < rows; j++) { - if (j % 2 == 0) board[i][j] = new Cell(i*w*3, j*h,w); - else board[i][j] = new Cell(i*w*3+w+h/2, j*h, w); - } - } - } - - - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - for ( int i = 0; i < columns;i++) { - for ( int j = 0; j < rows;j++) { - board[i][j].display(); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/HexagonCells.pde b/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/HexagonCells.pde deleted file mode 100644 index 6bd52053b..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/HexagonCells.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Outline for game of life -// This is just a grid of hexagons right now - -GOL gol; - -void setup() { - size(600, 600); - gol = new GOL(); -} - -void draw() { - background(255); - gol.display(); -} - -// reset board when mouse is pressed -void mousePressed() { - gol.init(); -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_figures/CA.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_figures/CA.pde deleted file mode 100644 index b0309e63b..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_figures/CA.pde +++ /dev/null @@ -1,95 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// A class to manage the CA - -class CA { - - int[] cells; // An array of 0s and 1s - int generation; // How many generations? - - int[] ruleset; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1} - - CA(int[] r) { - ruleset = r; - cells = new int[width/scl]; - restart(); - } - - CA() { - scl = 1; - cells = new int[width/scl]; - randomize(); - restart(); - } - - // Set the rules of the CA - void setRules(int[] r) { - ruleset = r; - } - - // Make a random ruleset - void randomize() { - for (int i = 0; i < 8; i++) { - ruleset[i] = int(random(2)); - } - } - - // Reset to generation 0 - void restart() { - for (int i = 0; i < cells.length; i++) { - cells[i] = 0; - } - cells[cells.length/2] = 1; // We arbitrarily start with just the middle cell having a state of "1" - generation = 0; - } - - // The process of creating the new generation - void generate() { - // First we create an empty array for the new values - int[] nextgen = new int[cells.length]; - // For every spot, determine new state by examing current state, and neighbor states - // Ignore edges that only have one neighor - for (int i = 1; i < cells.length-1; i++) { - int left = cells[i-1]; // Left neighbor state - int me = cells[i]; // Current state - int right = cells[i+1]; // Right neighbor state - nextgen[i] = rules(left, me, right); // Compute next generation state based on ruleset - } - // The current generation is the new generation - cells = nextgen; - generation++; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void render() { - for (int i = 0; i < cells.length; i++) { - if (cells[i] == 1) fill(0); - else fill(255); - stroke(0); - rect(i*scl, generation*scl, scl, scl); - } - } - - // Implementing the Wolfram rules - // Could be improved and made more concise, but here we can explicitly see what is going on for each case - int rules (int a, int b, int c) { - String s = "" + a + b + c; - int index = Integer.parseInt(s,2); - return ruleset[index]; - } - - // The CA is done if it reaches the bottom of the screen - boolean finished() { - if (generation > height/scl) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_figures/NOC_7_01_WolframCA_figures.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_figures/NOC_7_01_WolframCA_figures.pde deleted file mode 100644 index 8e7ea3f4c..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_figures/NOC_7_01_WolframCA_figures.pde +++ /dev/null @@ -1,38 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// Simple demonstration of a Wolfram 1-dimensional cellular automata -// When the system reaches bottom of the window, it restarts with a new ruleset -// Mouse click restarts as well - - -CA ca; // An instance object to describe the Wolfram basic Cellular Automata - -int scl = 20; - -void setup() { - size(1800,600); - background(255); - //int[] ruleset = {0,1,0,1,1,0,1,0}; // 90 - int[] ruleset = {0,1,1,1,1,0,1,1}; // An initial rule system - ca = new CA(ruleset); // Initialize CA -} - -void draw() { - ca.render(); // Draw the CA - ca.generate(); // Generate the next level - - if (ca.finished()) { // If we're done, clear the screen, pick a new ruleset and restart - saveFrame("rule222.png"); - noLoop(); - } -} - -void mousePressed() { - background(255); - ca.randomize(); - ca.restart(); -} diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_simple/CA.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_simple/CA.pde deleted file mode 100644 index a6e158470..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_simple/CA.pde +++ /dev/null @@ -1,70 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Wolfram Cellular Automata - -// A class to manage the CA - -class CA { - - int[] cells; // An array of 0s and 1s - int generation; // How many generations? - - int[] ruleset = {0, 1, 0, 1, 1, 0, 1, 0}; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1} - - int w = 10; - - CA() { - cells = new int[width/w]; - for (int i = 0; i < cells.length; i++) { - cells[i] = 0; - } - cells[cells.length/2] = 1; // We arbitrarily start with just the middle cell having a state of "1" - generation = 0; - } - - // The process of creating the new generation - void generate() { - // First we create an empty array for the new values - int[] nextgen = new int[cells.length]; - // For every spot, determine new state by examing current state, and neighbor states - // Ignore edges that only have one neighor - for (int i = 1; i < cells.length-1; i++) { - int left = cells[i-1]; // Left neighbor state - int me = cells[i]; // Current state - int right = cells[i+1]; // Right neighbor state - nextgen[i] = rules(left, me, right); // Compute next generation state based on ruleset - } - // The current generation is the new generation - cells = nextgen; - generation++; - - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - for (int i = 0; i < cells.length; i++) { - if (cells[i] == 1) fill(0); - else fill(255); - noStroke(); - rect(i*w, generation*w, w, w); - } - } - - - - // Implementing the Wolfram rules - // Could be improved and made more concise, but here we can explicitly see what is going on for each case - int rules (int a, int b, int c) { - if (a == 1 && b == 1 && c == 1) return ruleset[0]; - if (a == 1 && b == 1 && c == 0) return ruleset[1]; - if (a == 1 && b == 0 && c == 1) return ruleset[2]; - if (a == 1 && b == 0 && c == 0) return ruleset[3]; - if (a == 0 && b == 1 && c == 1) return ruleset[4]; - if (a == 0 && b == 1 && c == 0) return ruleset[5]; - if (a == 0 && b == 0 && c == 1) return ruleset[6]; - if (a == 0 && b == 0 && c == 0) return ruleset[7]; - return 0; - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_simple/NOC_7_01_WolframCA_simple.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_simple/NOC_7_01_WolframCA_simple.pde deleted file mode 100644 index e26b35453..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_simple/NOC_7_01_WolframCA_simple.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Wolfram Cellular Automata - -// Simple demonstration of a Wolfram 1-dimensional cellular automata - -CA ca; // An instance object to describe the Wolfram basic Cellular Automata - - -void setup() { - size(800, 400); - background(255); - ca = new CA(); // Initialize CA -} - -void draw() { - ca.display(); // Draw the CA - if (ca.generation < height/ca.w) { - ca.generate(); - } - -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_02_GameOfLifeSimple/GOL.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_02_GameOfLifeSimple/GOL.pde deleted file mode 100644 index 413318d9d..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_02_GameOfLifeSimple/GOL.pde +++ /dev/null @@ -1,77 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class GOL { - - int w = 8; - int columns, rows; - - // Game of life board - int[][] board; - - - GOL() { - // Initialize rows, columns and set-up arrays - columns = width/w; - rows = height/w; - board = new int[columns][rows]; - //next = new int[columns][rows]; - // Call function to fill array with random values 0 or 1 - init(); - } - - void init() { - for (int i =1;i < columns-1;i++) { - for (int j =1;j < rows-1;j++) { - board[i][j] = int(random(2)); - } - } - } - - // The process of creating the new generation - void generate() { - - int[][] next = new int[columns][rows]; - - // Loop through every spot in our 2D array and check spots neighbors - for (int x = 1; x < columns-1; x++) { - for (int y = 1; y < rows-1; y++) { - - // Add up all the states in a 3x3 surrounding grid - int neighbors = 0; - for (int i = -1; i <= 1; i++) { - for (int j = -1; j <= 1; j++) { - neighbors += board[x+i][y+j]; - } - } - - // A little trick to subtract the current cell's state since - // we added it in the above loop - neighbors -= board[x][y]; - - // Rules of Life - if ((board[x][y] == 1) && (neighbors < 2)) next[x][y] = 0; // Loneliness - else if ((board[x][y] == 1) && (neighbors > 3)) next[x][y] = 0; // Overpopulation - else if ((board[x][y] == 0) && (neighbors == 3)) next[x][y] = 1; // Reproduction - else next[x][y] = board[x][y]; // Stasis - } - } - - // Next is now our board - board = next; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - for ( int i = 0; i < columns;i++) { - for ( int j = 0; j < rows;j++) { - if ((board[i][j] == 1)) fill(0); - else fill(255); - stroke(0); - rect(i*w, j*w, w, w); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_02_GameOfLifeSimple/NOC_7_02_GameOfLifeSimple.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_02_GameOfLifeSimple/NOC_7_02_GameOfLifeSimple.pde deleted file mode 100644 index 4526630f8..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_02_GameOfLifeSimple/NOC_7_02_GameOfLifeSimple.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A basic implementation of John Conway's Game of Life CA -// how could this be improved to use object oriented programming? -// think of it as similar to our particle system, with a "cell" class -// to describe each individual cell and a "cellular automata" class -// to describe a collection of cells - -GOL gol; - -void setup() { - size(640, 360); - frameRate(24); - gol = new GOL(); -} - -void draw() { - background(255); - - gol.generate(); - gol.display(); -} - -// reset board when mouse is pressed -void mousePressed() { - gol.init(); -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/Cell.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/Cell.pde deleted file mode 100644 index d18e16933..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/Cell.pde +++ /dev/null @@ -1,40 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Cell { - - float x, y; - float w; - - int state; - int previous; - - Cell(float x_, float y_, float w_) { - x = x_; - y = y_; - w = w_; - - state = int(random(2)); - previous = state; - } - - void savePrevious() { - previous = state; - } - - void newState(int s) { - state = s; - } - - void display() { - if (previous == 0 && state == 1) fill(0,0,255); - else if (state == 1) fill(0); - else if (previous == 1 && state == 0) fill(255,0,0); - else fill(255); - stroke(0); - rect(x, y, w, w); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/GOL.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/GOL.pde deleted file mode 100644 index cdf3f3ad2..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/GOL.pde +++ /dev/null @@ -1,73 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class GOL { - - int w = 8; - int columns, rows; - - // Game of life board - Cell[][] board; - - - GOL() { - // Initialize rows, columns and set-up arrays - columns = width/w; - rows = height/w; - board = new Cell[columns][rows]; - init(); - } - - void init() { - for (int i = 0; i < columns; i++) { - for (int j = 0; j < rows; j++) { - board[i][j] = new Cell(i*w, j*w, w); - } - } - } - - // The process of creating the new generation - void generate() { - for ( int i = 0; i < columns;i++) { - for ( int j = 0; j < rows;j++) { - board[i][j].savePrevious(); - } - } - - - // Loop through every spot in our 2D array and check spots neighbors - for (int x = 0; x < columns; x++) { - for (int y = 0; y < rows; y++) { - - // Add up all the states in a 3x3 surrounding grid - int neighbors = 0; - for (int i = -1; i <= 1; i++) { - for (int j = -1; j <= 1; j++) { - neighbors += board[(x+i+columns)%columns][(y+j+rows)%rows].previous; - } - } - - // A little trick to subtract the current cell's state since - // we added it in the above loop - neighbors -= board[x][y].previous; - - // Rules of Life - if ((board[x][y].state == 1) && (neighbors < 2)) board[x][y].newState(0); // Loneliness - else if ((board[x][y].state == 1) && (neighbors > 3)) board[x][y].newState(0); // Overpopulation - else if ((board[x][y].state == 0) && (neighbors == 3)) board[x][y].newState(1); // Reproduction - // else do nothing! - } - } - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - for ( int i = 0; i < columns;i++) { - for ( int j = 0; j < rows;j++) { - board[i][j].display(); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/NOC_7_03_GameOfLifeOOP.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/NOC_7_03_GameOfLifeOOP.pde deleted file mode 100644 index 32227dd01..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/NOC_7_03_GameOfLifeOOP.pde +++ /dev/null @@ -1,27 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A basic implementation of John Conway's Game of Life CA - -// Each cell is now an object! - -GOL gol; - -void setup() { - size(640, 360); - gol = new GOL(); -} - -void draw() { - background(255); - - gol.generate(); - gol.display(); -} - -// reset board when mouse is pressed -void mousePressed() { - gol.init(); -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/CantorSetArrayList/CantorSetArrayList.pde b/java/examples/Books/Nature of Code/chp8_fractals/CantorSetArrayList/CantorSetArrayList.pde deleted file mode 100644 index 3c3d86023..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/CantorSetArrayList/CantorSetArrayList.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Cantor Set -// Renders a simple fractal, the Cantor Set -// Uses an ArrayList to store list of objects -// Generates when mouse is pressed - -float h = 30; - -// List of line objects -ArrayList cantor; - -void setup() { - size(729, 200); - - // Start with one line - cantor = new ArrayList(); - cantor.add(new CantorLine(0, 100, width)); -} - -// Click the mouse to advance the sequence -void mousePressed() { - generate(); -} - -void draw() { - background(255); - // Always show all the lines - for (CantorLine cl : cantor) { - cl.display(); - } - - fill(0); - text("Click mouse to generate",10,height-20); -} - -void generate() { - // Generate the next set of lines - ArrayList next = new ArrayList(); - for (CantorLine cl : cantor) { - next.add(new CantorLine(cl.x,cl.y,cl.len/3)); - next.add(new CantorLine(cl.x+cl.len*2/3,cl.y,cl.len/3)); - } - cantor = next; -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/CantorSetArrayList/Line.pde b/java/examples/Books/Nature of Code/chp8_fractals/CantorSetArrayList/Line.pde deleted file mode 100644 index 2677ac37b..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/CantorSetArrayList/Line.pde +++ /dev/null @@ -1,23 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Cantor line is a simple horizontal line with a starting point -// and length - -class CantorLine { - float x,y; - float len; - - CantorLine(float x_, float y_, float len_) { - x = x_; - y = y_; - len = len_; - } - - void display() { - stroke(0); - line(x,y,x+len,y); - } - -} diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_01_RecursionLines/Exercise_8_01_RecursionLines.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_01_RecursionLines/Exercise_8_01_RecursionLines.pde deleted file mode 100644 index e90258a0b..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_01_RecursionLines/Exercise_8_01_RecursionLines.pde +++ /dev/null @@ -1,36 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Recursion - -void setup() { - size(800, 200); -} - -void draw() { - background(255); - drawLines(100,100,700,100); - noLoop(); -} - -void drawLines(float x1, float y1, float x2, float y2) { - - line(x1,y1,x2,y2); - - float dx = x2-x1; - float dy = y2-y1; - - //println(dx + " " + dy); - - if (dx == 0 && dy > 4) { - //println(dy); - drawLines(x1-dy/3,y1,x1+dy/3,y1); - drawLines(x1-dy/3,y2,x1+dy/3,y2); - } else if (dy == 0 && dx > 4) { - //println(dx); - drawLines(x1,y1-dx/3,x1,y1+dx/3); - drawLines(x2,y1-dx/3,x2,y1+dx/3); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_02_KochSnowFlake/Exercise_8_02_KochSnowFlake.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_02_KochSnowFlake/Exercise_8_02_KochSnowFlake.pde deleted file mode 100644 index c5e5f6b86..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_02_KochSnowFlake/Exercise_8_02_KochSnowFlake.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Koch Snowflake - -// Renders a simple fractal, the Koch snowflake -// Each recursive level drawn in sequence - -ArrayList lines ; // A list to keep track of all the lines - -void setup() { - size(600, 692); - background(255); - lines = new ArrayList(); - PVector a = new PVector(0, 173); - PVector b = new PVector(width, 173); - PVector c = new PVector(width/2, 173+width*cos(radians(30))); - - // Starting with additional lines - lines.add(new KochLine(a, b)); - lines.add(new KochLine(b, c)); - lines.add(new KochLine(c, a)); - - for (int i = 0; i < 5; i++) { - generate(); - } -} - -void draw() { - background(255); - for (KochLine l : lines) { - l.display(); - } -} - -void generate() { - ArrayList next = new ArrayList(); // Create emtpy list - for (KochLine l : lines) { - // Calculate 5 koch PVectors (done for us by the line object) - PVector a = l.kochA(); - PVector b = l.kochB(); - PVector c = l.kochC(); - PVector d = l.kochD(); - PVector e = l.kochE(); - // Make line segments between all the PVectors and add them - next.add(new KochLine(a, b)); - next.add(new KochLine(b, c)); - next.add(new KochLine(c, d)); - next.add(new KochLine(d, e)); - } - lines = next; -} - - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_02_KochSnowFlake/KochLine.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_02_KochSnowFlake/KochLine.pde deleted file mode 100644 index 8b2b5aab9..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_02_KochSnowFlake/KochLine.pde +++ /dev/null @@ -1,75 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Koch Curve - -// A class to describe one line segment in the fractal -// Includes methods to calculate midPVectors along the line according to the Koch algorithm - -class KochLine { - - // Two PVectors, - // a is the "left" PVector and - // b is the "right PVector - PVector start; - PVector end; - - KochLine(PVector a, PVector b) { - start = a.get(); - end = b.get(); - } - - void display() { - stroke(0); - strokeWeight(2); - line(start.x, start.y, end.x, end.y); - } - - PVector kochA() { - return start.get(); - } - - - // This is easy, just 1/3 of the way - PVector kochB() { - PVector v = PVector.sub(end, start); - v.div(3); - v.add(start); - return v; - } - - // More complicated, have to use a little trig to figure out where this PVector is! - PVector kochC() { - PVector a = start.get(); // Start at the beginning - - PVector v = PVector.sub(end, start); - v.div(3); - a.add(v); // Move to point B - - rotate(v, -radians(60)); // Rotate 60 degrees - a.add(v); // Move to point C - - return a; - } - - // Easy, just 2/3 of the way - PVector kochD() { - PVector v = PVector.sub(end, start); - v.mult(2/3.0); - v.add(start); - return v; - } - - PVector kochE() { - return end.get(); - } -} - -public void rotate(PVector v, float theta) { - float xTemp = v.x; - // Might need to check for rounding errors like with angleBetween function? - v.x = v.x*PApplet.cos(theta) - v.y*PApplet.sin(theta); - v.y = xTemp*PApplet.sin(theta) + v.y*PApplet.cos(theta); -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_06_Tree/Exercise_8_06_Tree.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_06_Tree/Exercise_8_06_Tree.pde deleted file mode 100644 index ced569b79..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_06_Tree/Exercise_8_06_Tree.pde +++ /dev/null @@ -1,58 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Recursive Tree - -// Renders a simple tree-like structure via recursion -// Branching angle calculated as a function of horizontal mouse location - -float theta; - -void setup() { - size(1800, 500); - smooth(); -} - -void draw() { - background(255); - // Let's pick an angle 0 to 90 degrees based on the mouse position - theta = PI/6;//map(mouseX,0,width,0,PI/2); - - // Start the tree from the bottom of the screen - translate(width/2, height); - stroke(0); - branch(200,0); - save("chapter08_exc06.png"); - noLoop(); -} - -void branch(float len, int level) { - // Each branch will be 2/3rds the size of the previous one - - //float sw = map(len,2,120,1,10); - //strokeWeight(sw); - strokeWeight(2); - - line(0, 0, 0, -len); - // Move to the end of that line - translate(0, -len); - - len *= 0.66; - level++; - // All recursive functions must have an exit condition!!!! - // Here, ours is when the length of the branch is 2 pixels or less - if (level < 5) { - pushMatrix(); // Save the current state of transformation (i.e. where are we now) - rotate(theta); // Rotate by theta - branch(len,level); // Ok, now call myself to draw two new branches!! - popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state - - // Repeat the same thing, only branch off to the "left" this time! - pushMatrix(); - rotate(-theta); - branch(len,level); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_07_Tree/Exercise_8_07_Tree.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_07_Tree/Exercise_8_07_Tree.pde deleted file mode 100644 index 3019d44ca..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_07_Tree/Exercise_8_07_Tree.pde +++ /dev/null @@ -1,51 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Recursive Tree -// Renders a simple tree-like structure via recursion -// Branching angle calculated as a function of horizontal mouse location - -float theta; - -void setup() { - size(640, 360); -} - -void draw() { - background(255); - // Let's pick an angle 0 to 90 degrees based on the mouse position - theta = map(mouseX,0,width,0,PI/2); - - // Start the tree from the bottom of the screen - translate(width/2, height); - stroke(0); - branch(60); -} - -void branch(float len) { - // Each branch will be 2/3rds the size of the previous one - float sw = map(len,2,120,1,10); - strokeWeight(sw); - - line(0, 0, 0, -len); - // Move to the end of that line - translate(0, -len); - - len *= 0.66; - // All recursive functions must have an exit condition!!!! - // Here, ours is when the length of the branch is 2 pixels or less - if (len > 2) { - pushMatrix(); // Save the current state of transformation (i.e. where are we now) - rotate(theta); // Rotate by theta - branch(len); // Ok, now call myself to draw two new branches!! - popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state - - // Repeat the same thing, only branch off to the "left" this time! - pushMatrix(); - rotate(-theta); - branch(len); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Branch.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Branch.pde deleted file mode 100644 index 7c5e8b9c8..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Branch.pde +++ /dev/null @@ -1,68 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Recursive Tree (w/ ArrayList) - -// A class for one branch in the system - -class Branch { - // Each has a location, velocity, and timer - // We could implement this same idea with different data - PVector start; - PVector end; - PVector vel; - float timer; - float timerstart; - - boolean growing = true; - - Branch(PVector l, PVector v, float n) { - start = l.get(); - end = l.get(); - vel = v.get(); - timerstart = n; - timer = timerstart; - } - - // Move location - void update() { - if (growing) { - end.add(vel); - } - } - - // Draw a dot at location - void render() { - stroke(0); - line(start.x,start.y,end.x,end.y); - } - - // Did the timer run out? - boolean timeToBranch() { - timer--; - if (timer < 0 && growing) { - growing = false; - return true; - } - else { - return false; - } - } - - // Create a new branch at the current location, but change direction by a given angle - Branch branch(float angle) { - // What is my current heading - float theta = vel.heading2D(); - // What is my current speed - float mag = vel.mag(); - // Turn me - theta += radians(angle); - // Look, polar coordinates to cartesian!! - PVector newvel = new PVector(mag*cos(theta),mag*sin(theta)); - // Return a new Branch - return new Branch(end,newvel,timerstart*0.66f); - } - -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Exercise_8_08_09_TreeArrayListLeaves.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Exercise_8_08_09_TreeArrayListLeaves.pde deleted file mode 100644 index 2900307cf..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Exercise_8_08_09_TreeArrayListLeaves.pde +++ /dev/null @@ -1,59 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Recursive Tree (w/ ArrayList) -// Nature of Code, Chapter 8 - -// Recursive branching "structure" without an explicitly recursive function -// Instead we have an ArrayList to hold onto N number of elements -// For every element in the ArrayList, we add 2 more elements, etc. (this is the recursion) - -// An arraylist that will keep track of all current branches -ArrayList tree; -ArrayList leaves; - -void setup() { - size(640,360); - background(255); - // Setup the arraylist and add one branch to it - tree = new ArrayList(); - leaves = new ArrayList(); - // A branch has a starting location, a starting "velocity", and a starting "timer" - Branch b = new Branch(new PVector(width/2,height),new PVector(0,-1),100); - // Add to arraylist - tree.add(b); -} - -void draw() { - background(255); - - // Let's stop when the arraylist gets too big - // For every branch in the arraylist - for (int i = tree.size()-1; i >= 0; i--) { - // Get the branch, update and draw it - Branch b = tree.get(i); - b.update(); - b.render(); - // If it's ready to split - if (b.timeToBranch()) { - if (tree.size() < 1024) { - //tree.remove(i); // Delete it - tree.add(b.branch( 30)); // Add one going right - tree.add(b.branch(-25)); // Add one going left - } - else { - leaves.add(new Leaf(b.end)); - } - } - } - - for (Leaf leaf : leaves) { - leaf.display(); - } - -} - - - - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Leaf.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Leaf.pde deleted file mode 100644 index 94ffd407e..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Leaf.pde +++ /dev/null @@ -1,23 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Recursive Tree (w/ ArrayList) - -// A class for a leaf that gets placed at the end of -// the last branches - -class Leaf { - PVector loc; - - Leaf(PVector l) { - loc = l.get(); - } - - void display() { - noStroke(); - fill(50,100); - ellipse(loc.x,loc.y,4,4); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_10_TreeStochasticNoise/Exercise_8_10_TreeStochasticNoise.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_10_TreeStochasticNoise/Exercise_8_10_TreeStochasticNoise.pde deleted file mode 100644 index 5a0bf3792..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_10_TreeStochasticNoise/Exercise_8_10_TreeStochasticNoise.pde +++ /dev/null @@ -1,74 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Stochastic Tree with angles fluctuating with Perlin noise -// Nature of Code, Chapter 8 - -// Perlin noise offset -float yoff = 0; -// Random seed to control randomness while drawing the tree -int seed = 5; - - -void setup() { - size(800, 200); - smooth(); -} - -void draw() { - background(255); - fill(0); - //text("Click mouse to generate a new tree", 10, height-20); - - stroke(0); - // Start the tree from the bottom of the screen - translate(width/2, height); - // Move alogn through noise - yoff += 0.005; - randomSeed(seed); - // Start the recursive branching! - branch(60, 0); -} - - -void mousePressed() { - // New tree starts with new noise offset and new random seed - yoff = random(1000); - seed = millis(); -} - - -void branch(float h, float xoff) { - // thickness of the branch is mapped to its length - float sw = map(h, 2, 100, 1, 5); - strokeWeight(sw); - // Draw the branch - line(0, 0, 0, -h); - // Move along to end - translate(0, -h); - - // Each branch will be 2/3rds the size of the previous one - h *= 0.7f; - - // Move along through noise space - xoff += 0.1; - - if (h > 4) { - // Random number of branches - int n = int(random(0, 5)); - for (int i = 0; i < n; i++) { - - // Here the angle is controlled by perlin noise - // This is a totally arbitrary way to do it, try others! - float theta = map(noise(xoff+i, yoff), 0, 1, -PI/3, PI/3); - if (n%2==0) theta *= -1; - - pushMatrix(); // Save the current state of transformation (i.e. where are we now) - rotate(theta); // Rotate by theta - branch(h, xoff); // Ok, now call myself to branch again - popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_02_Mandelbrot/Figure_8_02_Mandelbrot.pde b/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_02_Mandelbrot/Figure_8_02_Mandelbrot.pde deleted file mode 100644 index 6883037b6..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_02_Mandelbrot/Figure_8_02_Mandelbrot.pde +++ /dev/null @@ -1,80 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// The Mandelbrot Set - -// Simple rendering of the Mandelbrot set -// c = a + bi -// Iterate z = z^2 + c, i.e. -// z(0) = 0 -// z(1) = 0*0 + c -// z(2) = c*c + c -// z(3) = (c*c + c) * (c*c + c) + c -// etc. - -// c*c = (a+bi) * (a+bi) = a^2 - b^2 + 2abi - -// Establish a range of values on the complex plane -double xmin = -2.5; double ymin = -1; double w = 4; double h = 2; -// A different range will allow us to "zoom" in or out on the fractal -// double xmin = -1.5; double ymin = -.1; double wh = 0.15; - -void setup() { - size(863,863/2); -} - -void draw() { - - loadPixels(); - - // Maximum number of iterations for each point on the complex plane - int maxiterations = 200; - - // x goes from xmin to xmax - double xmax = xmin + w; - // y goes from ymin to ymax - double ymax = ymin + h; - - // Calculate amount we increment x,y for each pixel - double dx = (xmax - xmin) / (width); - double dy = (ymax - ymin) / (height); - - // Start y - double y = ymin; - for(int j = 0; j < height; j++) { - // Start x - double x = xmin; - for(int i = 0; i < width; i++) { - - // Now we test, as we iterate z = z^2 + cm does z tend towards infinity? - double a = x; - double b = y; - int n = 0; - while (n < maxiterations) { - double aa = a * a; - double bb = b * b; - double twoab = 2.0 * a * b; - a = aa - bb + x; - b = twoab + y; - // Infinty in our finite world is simple, let's just consider it 16 - if(aa + bb > 16.0f) { - break; // Bail - } - n++; - } - - // We color each pixel based on how long it takes to get to infinity - // If we never got there, let's pick the color black - if (n == maxiterations) pixels[i+j*width] = color(0); - else pixels[i+j*width] = color(n*16 % 255); // Gosh, we could make fancy colors here if we wanted - x += dx; - } - y += dy; - } - updatePixels(); - - save("chapter08_02.png"); - noLoop(); -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_14_Koch/Figure_8_14_Koch.pde b/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_14_Koch/Figure_8_14_Koch.pde deleted file mode 100644 index d9d8b0bee..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_14_Koch/Figure_8_14_Koch.pde +++ /dev/null @@ -1,67 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Koch Curve - -// Renders a simple fractal, the Koch snowflake -// Each recursive level drawn in sequence - -ArrayList lines ; // A list to keep track of all the lines - -void setup() { - size(1820, 200); - - - smooth(); -} - - - -void draw() { - translate(10,0); - int spacing = 10; - int total = 5; - - background(255); - float w = (1800-spacing*(total-1))/5; - for (int n = 0; n < total; n++) { - lines = new ArrayList(); - PVector start = new PVector(0, height*2/3); - PVector end = new PVector(w, height*2/3); - lines.add(new KochLine(start, end)); - for (int i = 0; i < n; i++) { - generate(); - } - strokeWeight(2); - for (KochLine l : lines) { - l.display(); - } - noFill(); - strokeWeight(1); - stroke(127); - rect(0, 10, w,height-20); - translate(w+spacing, 0); - } - save("chapter08_14.png"); - noLoop(); -} - -void generate() { - ArrayList next = new ArrayList(); // Create emtpy list - for (KochLine l : lines) { - // Calculate 5 koch PVectors (done for us by the line object) - PVector a = l.kochA(); - PVector b = l.kochB(); - PVector c = l.kochC(); - PVector d = l.kochD(); - PVector e = l.kochE(); - // Make line segments between all the PVectors and add them - next.add(new KochLine(a, b)); - next.add(new KochLine(b, c)); - next.add(new KochLine(c, d)); - next.add(new KochLine(d, e)); - } - lines = next; -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_14_Koch/KochLine.pde b/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_14_Koch/KochLine.pde deleted file mode 100644 index 54ed28120..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_14_Koch/KochLine.pde +++ /dev/null @@ -1,74 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Koch Curve - -// A class to describe one line segment in the fractal -// Includes methods to calculate midPVectors along the line according to the Koch algorithm - -class KochLine { - - // Two PVectors, - // a is the "left" PVector and - // b is the "right PVector - PVector start; - PVector end; - - KochLine(PVector a, PVector b) { - start = a.get(); - end = b.get(); - } - - void display() { - stroke(0); - line(start.x, start.y, end.x, end.y); - } - - PVector kochA() { - return start.get(); - } - - - // This is easy, just 1/3 of the way - PVector kochB() { - PVector v = PVector.sub(end, start); - v.div(3); - v.add(start); - return v; - } - - // More complicated, have to use a little trig to figure out where this PVector is! - PVector kochC() { - PVector a = start.get(); // Start at the beginning - - PVector v = PVector.sub(end, start); - v.div(3); - a.add(v); // Move to point B - - rotate(v, -radians(60)); // Rotate 60 degrees - a.add(v); // Move to point C - - return a; - } - - // Easy, just 2/3 of the way - PVector kochD() { - PVector v = PVector.sub(end, start); - v.mult(2/3.0); - v.add(start); - return v; - } - - PVector kochE() { - return end.get(); - } -} - -public void rotate(PVector v, float theta) { - float xTemp = v.x; - // Might need to check for rounding errors like with angleBetween function? - v.x = v.x*PApplet.cos(theta) - v.y*PApplet.sin(theta); - v.y = xTemp*PApplet.sin(theta) + v.y*PApplet.cos(theta); -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_20_Tree/Figure_8_20_Tree.pde b/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_20_Tree/Figure_8_20_Tree.pde deleted file mode 100644 index a81bd3fe8..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_20_Tree/Figure_8_20_Tree.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Recursive Tree - -// Renders a simple tree-like structure via recursion -// Branching angle calculated as a function of horizontal mouse location - -float theta; - -void setup() { - size(800, 200); - smooth(); -} - -void draw() { - background(255); - // Let's pick an angle 0 to 90 degrees based on the mouse position - theta = map(mouseX,0,width,0,PI/2); - - // Start the tree from the bottom of the screen - translate(width/2, height); - stroke(0); - branch(60); -} - -void branch(float len) { - // Each branch will be 2/3rds the size of the previous one - - //float sw = map(len,2,120,1,10); - //strokeWeight(sw); - strokeWeight(2); - - line(0, 0, 0, -len); - // Move to the end of that line - translate(0, -len); - - len *= 0.66; - // All recursive functions must have an exit condition!!!! - // Here, ours is when the length of the branch is 2 pixels or less - if (len > 2) { - pushMatrix(); // Save the current state of transformation (i.e. where are we now) - rotate(theta); // Rotate by theta - branch(len); // Ok, now call myself to draw two new branches!! - popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state - - // Repeat the same thing, only branch off to the "left" this time! - pushMatrix(); - rotate(-theta); - branch(len); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_CantorLine/Figure_8_CantorLine.pde b/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_CantorLine/Figure_8_CantorLine.pde deleted file mode 100644 index 135d12ac9..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_CantorLine/Figure_8_CantorLine.pde +++ /dev/null @@ -1,23 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -void setup() { - size(800, 60); - background(255); -} - -void cantor(float x, float y, float len) { - line(x, y, x+len, y); - - y += 20; - line(x,y,x+len/3,y); //[bold] - line(x+len*2/3,y,x+len,y); //[bold] -} - -void draw() { - cantor(10, 20, width-20); - save("chapter08_12.png"); - noLoop(); -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_01_Recursion/NOC_8_01_Recursion.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_01_Recursion/NOC_8_01_Recursion.pde deleted file mode 100644 index 84b600182..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_01_Recursion/NOC_8_01_Recursion.pde +++ /dev/null @@ -1,27 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Recursion - -void setup() { - size(640,360); -} - -void draw() { - background(255); - drawCircle(width/2,height/2,width); - noLoop(); -} - -// Very simple function that draws one circle -// and recursively calls itself -void drawCircle(int x, int y, float r) { - ellipse(x, y, r, r); - // Exit condition, stop when radius is too small - if(r > 2) { - r *= 0.75f; - // Call the function inside the function! (recursion!) - drawCircle(x, y, r); - } -} diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_02_Recursion/NOC_8_02_Recursion.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_02_Recursion/NOC_8_02_Recursion.pde deleted file mode 100644 index b02eda5fe..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_02_Recursion/NOC_8_02_Recursion.pde +++ /dev/null @@ -1,28 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Recursion - -void setup() { - size(640,360); -} - -void draw() { - background(255); - drawCircle(width/2,height/2,400); - noLoop(); -} - -// Recursive function -void drawCircle(float x, float y, float r) { - stroke(0); - noFill(); - ellipse(x, y, r, r); - if(r > 2) { - // Now we draw two more circles, one to the left - // and one to the right - drawCircle(x + r/2, y, r/2); - drawCircle(x - r/2, y, r/2); - } -} diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_03_Recursion/NOC_8_03_Recursion.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_03_Recursion/NOC_8_03_Recursion.pde deleted file mode 100644 index c7257d242..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_03_Recursion/NOC_8_03_Recursion.pde +++ /dev/null @@ -1,29 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Recursion - -void setup() { - size(640, 360); -} - -void draw() { - background(255); - drawCircle(width/2, height/2, 400); - noLoop(); -} - -void drawCircle(float x, float y, float radius) { - noFill(); - stroke(0); - ellipse(x, y, radius, radius); - if (radius > 8) { - // Four circles! left right, up and down - drawCircle(x + radius/2, y, radius/2); - drawCircle(x - radius/2, y, radius/2); - drawCircle(x, y + radius/2, radius/2); - drawCircle(x, y - radius/2, radius/2); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_04_CantorSet/NOC_8_04_CantorSet.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_04_CantorSet/NOC_8_04_CantorSet.pde deleted file mode 100644 index 47da39851..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_04_CantorSet/NOC_8_04_CantorSet.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Cantor Set -// Renders a simple fractal, the Cantor Set - -void setup() { - size(800, 200); - background(255); - - // Call the recursive function - cantor(35, 0, 730); -} - -void draw() { - // No need to loop - noLoop(); -} - - -void cantor(float x, float y, float len) { - - float h = 30; - - // recursive exit condition - if (len >= 1) { - // Draw line (as rectangle to make it easier to see) - noStroke(); - fill(0); - rect(x, y, len, h/3); - // Go down to next y position - y += h; - // Draw 2 more lines 1/3rd the length (without the middle section) - cantor(x, y, len/3); - cantor(x+len*2/3, y, len/3); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_04_Tree/NOC_8_04_Tree.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_04_Tree/NOC_8_04_Tree.pde deleted file mode 100644 index cb35ab15f..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_04_Tree/NOC_8_04_Tree.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Recursive Tree -// Renders a simple tree-like structure via recursion -// Branching angle calculated as a function of horizontal mouse location - -float theta; - -void setup() { - size(300, 200); - smooth(); -} - -void draw() { - background(255); - // Let's pick an angle 0 to 90 degrees based on the mouse position - theta = map(mouseX,0,width,0,PI/2); - - // Start the tree from the bottom of the screen - translate(width/2, height); - stroke(0); - branch(60); -} - -void branch(float len) { - // Each branch will be 2/3rds the size of the previous one - - float sw = map(len,2,120,1,10); - strokeWeight(sw); - - line(0, 0, 0, -len); - // Move to the end of that line - translate(0, -len); - - len *= 0.66; - // All recursive functions must have an exit condition!!!! - // Here, ours is when the length of the branch is 2 pixels or less - if (len > 2) { - pushMatrix(); // Save the current state of transformation (i.e. where are we now) - rotate(theta); // Rotate by theta - branch(len); // Ok, now call myself to draw two new branches!! - popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state - - // Repeat the same thing, only branch off to the "left" this time! - pushMatrix(); - rotate(-theta); - branch(len); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/KochFractal.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/KochFractal.pde deleted file mode 100644 index 76a8f1cd7..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/KochFractal.pde +++ /dev/null @@ -1,71 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Koch Curve -// A class to manage the list of line segments in the snowflake pattern - -class KochFractal { - PVector start; // A PVector for the start - PVector end; // A PVector for the end - ArrayList lines; // A list to keep track of all the lines - int count; - - public KochFractal() { - start = new PVector(0,height-20); - end = new PVector(width,height-20); - lines = new ArrayList(); - restart(); - } - - void nextLevel() { - // For every line that is in the arraylist - // create 4 more lines in a new arraylist - lines = iterate(lines); - count++; - } - - void restart() { - count = 0; // Reset count - lines.clear(); // Empty the array list - lines.add(new KochLine(start,end)); // Add the initial line (from one end PVector to the other) - } - - int getCount() { - return count; - } - - // This is easy, just draw all the lines - void render() { - for(KochLine l : lines) { - l.display(); - } - } - - // This is where the **MAGIC** happens - // Step 1: Create an empty arraylist - // Step 2: For every line currently in the arraylist - // - calculate 4 line segments based on Koch algorithm - // - add all 4 line segments into the new arraylist - // Step 3: Return the new arraylist and it becomes the list of line segments for the structure - - // As we do this over and over again, each line gets broken into 4 lines, which gets broken into 4 lines, and so on. . . - ArrayList iterate(ArrayList before) { - ArrayList now = new ArrayList(); // Create emtpy list - for(KochLine l : before) { - // Calculate 5 koch PVectors (done for us by the line object) - PVector a = l.start(); - PVector b = l.kochleft(); - PVector c = l.kochmiddle(); - PVector d = l.kochright(); - PVector e = l.end(); - // Make line segments between all the PVectors and add them - now.add(new KochLine(a,b)); - now.add(new KochLine(b,c)); - now.add(new KochLine(c,d)); - now.add(new KochLine(d,e)); - } - return now; - } - -} diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/KochLine.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/KochLine.pde deleted file mode 100644 index 6f3ff6913..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/KochLine.pde +++ /dev/null @@ -1,74 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Koch Curve -// A class to describe one line segment in the fractal -// Includes methods to calculate midPVectors along the line according to the Koch algorithm - -class KochLine { - - // Two PVectors, - // a is the "left" PVector and - // b is the "right PVector - PVector a; - PVector b; - - KochLine(PVector start, PVector end) { - a = start.get(); - b = end.get(); - } - - void display() { - stroke(0); - line(a.x, a.y, b.x, b.y); - } - - PVector start() { - return a.get(); - } - - PVector end() { - return b.get(); - } - - // This is easy, just 1/3 of the way - PVector kochleft() { - PVector v = PVector.sub(b, a); - v.div(3); - v.add(a); - return v; - } - - // More complicated, have to use a little trig to figure out where this PVector is! - PVector kochmiddle() { - PVector v = PVector.sub(b, a); - v.div(3); - - PVector p = a.get(); - p.add(v); - - rotate(v,-radians(60)); - p.add(v); - - return p; - } - - - // Easy, just 2/3 of the way - PVector kochright() { - PVector v = PVector.sub(a, b); - v.div(3); - v.add(b); - return v; - } -} - - public void rotate(PVector v, float theta) { - float xTemp = v.x; - // Might need to check for rounding errors like with angleBetween function? - v.x = v.x*cos(theta) - v.y*sin(theta); - v.y = xTemp*sin(theta) + v.y*cos(theta); - } - - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/NOC_8_05_Koch.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/NOC_8_05_Koch.pde deleted file mode 100644 index f61293171..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/NOC_8_05_Koch.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Koch Curve - -// Renders a simple fractal, the Koch snowflake -// Each recursive level drawn in sequence - -KochFractal k; - -void setup() { - size(800,250); - background(255); - frameRate(1); // Animate slowly - k = new KochFractal(); - smooth(); -} - -void draw() { - background(255); - // Draws the snowflake! - k.render(); - // Iterate - k.nextLevel(); - // Let's not do it more than 5 times. . . - if (k.getCount() > 5) { - k.restart(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_KochSimple/KochLine.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_KochSimple/KochLine.pde deleted file mode 100644 index f66510428..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_KochSimple/KochLine.pde +++ /dev/null @@ -1,73 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Koch Curve -// A class to describe one line segment in the fractal -// Includes methods to calculate midPVectors along the line according to the Koch algorithm - -class KochLine { - - // Two PVectors, - // a is the "left" PVector and - // b is the "right PVector - PVector start; - PVector end; - - KochLine(PVector a, PVector b) { - start = a.get(); - end = b.get(); - } - - void display() { - stroke(0); - line(start.x, start.y, end.x, end.y); - } - - PVector kochA() { - return start.get(); - } - - - // This is easy, just 1/3 of the way - PVector kochB() { - PVector v = PVector.sub(end, start); - v.div(3); - v.add(start); - return v; - } - - // More complicated, have to use a little trig to figure out where this PVector is! - PVector kochC() { - PVector a = start.get(); // Start at the beginning - - PVector v = PVector.sub(end, start); - v.div(3); - a.add(v); // Move to point B - - rotate(v, -radians(60)); // Rotate 60 degrees - a.add(v); // Move to point C - - return a; - } - - // Easy, just 2/3 of the way - PVector kochD() { - PVector v = PVector.sub(end, start); - v.mult(2/3.0); - v.add(start); - return v; - } - - PVector kochE() { - return end.get(); - } -} - -public void rotate(PVector v, float theta) { - float xTemp = v.x; - // Might need to check for rounding errors like with angleBetween function? - v.x = v.x*PApplet.cos(theta) - v.y*PApplet.sin(theta); - v.y = xTemp*PApplet.sin(theta) + v.y*PApplet.cos(theta); -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_KochSimple/NOC_8_05_KochSimple.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_KochSimple/NOC_8_05_KochSimple.pde deleted file mode 100644 index b8268ee9f..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_KochSimple/NOC_8_05_KochSimple.pde +++ /dev/null @@ -1,51 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Koch Curve -// Renders a simple fractal, the Koch snowflake -// Each recursive level drawn in sequence - -ArrayList lines ; // A list to keep track of all the lines - -void setup() { - size(383, 200); - background(255); - lines = new ArrayList(); - PVector start = new PVector(0, 150); - PVector end = new PVector(width, 150); - lines.add(new KochLine(start, end)); - - for (int i = 0; i < 5; i++) { - generate(); - } - - smooth(); -} - -void draw() { - background(255); - for (KochLine l : lines) { - l.display(); - } -} - -void generate() { - ArrayList next = new ArrayList(); // Create emtpy list - for (KochLine l : lines) { - // Calculate 5 koch PVectors (done for us by the line object) - PVector a = l.kochA(); - PVector b = l.kochB(); - PVector c = l.kochC(); - PVector d = l.kochD(); - PVector e = l.kochE(); - // Make line segments between all the PVectors and add them - next.add(new KochLine(a, b)); - next.add(new KochLine(b, c)); - next.add(new KochLine(c, d)); - next.add(new KochLine(d, e)); - } - lines = next; -} - - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_SimpleLSystem/NOC_8_06_SimpleLSystem.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_SimpleLSystem/NOC_8_06_SimpleLSystem.pde deleted file mode 100644 index b14d7b021..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_SimpleLSystem/NOC_8_06_SimpleLSystem.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// L-System -// Just demonstrating working with L-System strings -// No drawing - -// Start with "A" -String current = "A"; -// Number of generations -int count = 0; - -void setup() { - size(200, 200); - println("Generation " + count + ": " + current); -} - -void draw() { - background(255); - fill(0); - text("Click mouse to generate", 10, height-20); - noLoop(); -} - -void mousePressed() { - // A new StringBuffer for the next generation - StringBuffer next = new StringBuffer(); - - // Look through the current String to replace according to L-System rules - for (int i = 0; i < current.length(); i++) { - char c = current.charAt(i); - if (c == 'A') { - // If we find A replace with AB - next.append("AB"); - } else if (c == 'B') { - // If we find B replace with A - next.append("A"); - } - } - // The current String is now the next one - current = next.toString(); - count++; - // Print to message console - println("Generation " + count + ": " + current); - println(count + " " + current.length()); -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_Tree/NOC_8_06_Tree.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_Tree/NOC_8_06_Tree.pde deleted file mode 100644 index f2853c124..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_Tree/NOC_8_06_Tree.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Recursive Tree -// Renders a simple tree-like structure via recursion -// Branching angle calculated as a function of horizontal mouse location - -float theta; - -void setup() { - size(640, 360); -} - -void draw() { - background(255); - // Let's pick an angle 0 to 90 degrees based on the mouse position - theta = map(mouseX,0,width,0,PI/2); - - // Start the tree from the bottom of the screen - translate(width/2, height); - stroke(0); - branch(60); -} - -void branch(float len) { - // Each branch will be 2/3rds the size of the previous one - - //float sw = map(len,2,120,1,10); - //strokeWeight(sw); - strokeWeight(2); - - line(0, 0, 0, -len); - // Move to the end of that line - translate(0, -len); - - len *= 0.66; - // All recursive functions must have an exit condition!!!! - // Here, ours is when the length of the branch is 2 pixels or less - if (len > 2) { - pushMatrix(); // Save the current state of transformation (i.e. where are we now) - rotate(theta); // Rotate by theta - branch(len); // Ok, now call myself to draw two new branches!! - popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state - - // Repeat the same thing, only branch off to the "left" this time! - pushMatrix(); - rotate(-theta); - branch(len); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_Tree_static/NOC_8_06_Tree_static.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_Tree_static/NOC_8_06_Tree_static.pde deleted file mode 100644 index 92805fdb4..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_Tree_static/NOC_8_06_Tree_static.pde +++ /dev/null @@ -1,45 +0,0 @@ -// Recursive Tree -// Daniel Shiffman -// Nature of Code, Chapter 8 - -// Renders a simple tree-like structure via recursion -// Branching angle calculated as a function of horizontal mouse location - -void setup() { - size(800, 200); - smooth(); -} - -void draw() { - background(255); - // Start the tree from the bottom of the screen - translate(width/2, height); - stroke(0); - branch(60); - noLoop(); -} - -void branch(float len) { - strokeWeight(2); - - line(0, 0, 0, -len); - // Move to the end of that line - translate(0, -len); - - len *= 0.66; - // All recursive functions must have an exit condition!!!! - // Here, ours is when the length of the branch is 2 pixels or less - if (len > 2) { - pushMatrix(); // Save the current state of transformation (i.e. where are we now) - rotate(PI/5); // Rotate by theta - branch(len); // Ok, now call myself to draw two new branches!! - popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state - - // Repeat the same thing, only branch off to the "left" this time! - pushMatrix(); - rotate(-PI/5); - branch(len); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_07_TreeStochastic/NOC_8_07_TreeStochastic.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_07_TreeStochastic/NOC_8_07_TreeStochastic.pde deleted file mode 100644 index c0e22fb7b..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_07_TreeStochastic/NOC_8_07_TreeStochastic.pde +++ /dev/null @@ -1,66 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Stochastic Tree -// Renders a simple tree-like structure via recursion -// Angles and number of branches are random - -void setup() { - size(800, 200); - newTree(); -} - -void draw() { - noLoop(); -} - -void mousePressed() { - newTree(); - redraw(); -} - -void newTree() { - background(255); - fill(0); - text("Click mouse to generate a new tree", 10, height-10); - - stroke(0); - pushMatrix(); - // Start the tree from the bottom of the screen - translate(width/2, height); - // Start the recursive branching! - branch(80); - popMatrix(); -} - - - -void branch(float h) { - // thickness of the branch is mapped to its length - float sw = map(h, 2, 120, 1, 5); - strokeWeight(sw); - // Draw the actual branch - line(0, 0, 0, -h); - // Move along to end - translate(0, -h); - - // Each branch will be 2/3rds the size of the previous one - h *= 0.66f; - - // All recursive functions must have an exit condition!!!! - // Here, ours is when the length of the branch is 2 pixels or less - if (h > 2) { - // A random number of branches - int n = int(random(1, 4)); - for (int i = 0; i < n; i++) { - // Picking a random angle - float theta = random(-PI/2, PI/2); - pushMatrix(); // Save the current state of transformation (i.e. where are we now) - rotate(theta); // Rotate by theta - branch(h); // Ok, now call myself to branch again - popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_07_TreeStochastic_angleonly/NOC_8_07_TreeStochastic_angleonly.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_07_TreeStochastic_angleonly/NOC_8_07_TreeStochastic_angleonly.pde deleted file mode 100644 index 5c73557a5..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_07_TreeStochastic_angleonly/NOC_8_07_TreeStochastic_angleonly.pde +++ /dev/null @@ -1,59 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Stochastic Tree -// Renders a simple tree-like structure via recursion -// Angles and number of branches are random - -void setup() { - size(800, 200); - newTree(); -} - -void draw() { - noLoop(); -} - -void mousePressed() { - pushMatrix(); - newTree(); - popMatrix(); - redraw(); -} - -void newTree() { - background(255); - fill(0); - text("Click mouse to generate a new tree", 10, height-10); - - stroke(0); - // Start the tree from the bottom of the screen - translate(width/2, height); - // Start the recursive branching! - branch(60); -} - - - -void branch(float h) { - // thickness of the branch is mapped to its length - float sw = map(h, 2, 120, 1, 5); - strokeWeight(sw); - float theta = random(0,PI/3); - - line(0, 0, 0, -h); - translate(0, -h); - h *= 0.66; - if (h > 2) { - pushMatrix(); - rotate(theta); - branch(h); - popMatrix(); - pushMatrix(); - rotate(-theta); - branch(h); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_08_SimpleLSystem/NOC_8_08_SimpleLSystem.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_08_SimpleLSystem/NOC_8_08_SimpleLSystem.pde deleted file mode 100644 index 9f1b0dac3..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_08_SimpleLSystem/NOC_8_08_SimpleLSystem.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// L-System -// Just demonstrating working with L-System strings -// No drawing - -// Start with "A" -String current = "A"; -// Number of generations -int count = 0; - -void setup() { - size(800, 200); - println("Generation " + count + ": " + current); -} - -void draw() { - background(255); - fill(0); - text("Click mouse to generate", 10, height-20); - noLoop(); -} - -void mousePressed() { - // A new StringBuffer for the next generation - StringBuffer next = new StringBuffer(); - - // Look through the current String to replace according to L-System rules - for (int i = 0; i < current.length(); i++) { - char c = current.charAt(i); - if (c == 'A') { - // If we find A replace with AB - next.append("AB"); - } else if (c == 'B') { - // If we find B replace with A - next.append("A"); - } - } - // The current String is now the next one - current = next.toString(); - count++; - // Print to message console - println("Generation " + count + ": " + current); - //println(count + " " + current.length()); -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/LSystem.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/LSystem.pde deleted file mode 100644 index a51c255ee..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/LSystem.pde +++ /dev/null @@ -1,63 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An LSystem has a starting sentence -// An a ruleset -// Each generation recursively replaces characteres in the sentence -// Based on the rulset - -class LSystem { - - String sentence; // The sentence (a String) - Rule[] ruleset; // The ruleset (an array of Rule objects) - int generation; // Keeping track of the generation # - - // Construct an LSystem with a startin sentence and a ruleset - LSystem(String axiom, Rule[] r) { - sentence = axiom; - ruleset = r; - generation = 0; - } - - // Generate the next generation - void generate() { - // An empty StringBuffer that we will fill - StringBuffer nextgen = new StringBuffer(); - // For every character in the sentence - for (int i = 0; i < sentence.length(); i++) { - // What is the character - char curr = sentence.charAt(i); - // We will replace it with itself unless it matches one of our rules - String replace = "" + curr; - // Check every rule - for (int j = 0; j < ruleset.length; j++) { - char a = ruleset[j].getA(); - // if we match the Rule, get the replacement String out of the Rule - if (a == curr) { - replace = ruleset[j].getB(); - break; - } - } - // Append replacement String - nextgen.append(replace); - } - // Replace sentence - sentence = nextgen.toString(); - // Increment generation - generation++; - } - - String getSentence() { - return sentence; - } - - int getGeneration() { - return generation; - } - - -} - - - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/NOC_8_09_LSystem.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/NOC_8_09_LSystem.pde deleted file mode 100644 index 94a960d42..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/NOC_8_09_LSystem.pde +++ /dev/null @@ -1,63 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -LSystem lsys; -Turtle turtle; - -void setup() { - size(600, 600); - /* - // Create an empty ruleset - Rule[] ruleset = new Rule[2]; - // Fill with two rules (These are rules for the Sierpinksi Gasket Triangle) - ruleset[0] = new Rule('F',"F--F--F--G"); - ruleset[1] = new Rule('G',"GG"); - // Create LSystem with axiom and ruleset - lsys = new LSystem("F--F--F",ruleset); - turtle = new Turtle(lsys.getSentence(),width*2,TWO_PI/3); - */ - - /*Rule[] ruleset = new Rule[1]; - //ruleset[0] = new Rule('F',"F[F]-F+F[--F]+F-F"); - ruleset[0] = new Rule['F',"FF+[+F-F-F]-[-F+F+F]"); - lsys = new LSystem("F-F-F-F",ruleset); - turtle = new Turtle(lsys.getSentence(),width-1,PI/2); - */ - - Rule[] ruleset = new Rule[1]; - ruleset[0] = new Rule('F', "FF+[+F-F-F]-[-F+F+F]"); - lsys = new LSystem("F", ruleset); - turtle = new Turtle(lsys.getSentence(), height/3, radians(25)); - - - - smooth(); -} - -void draw() { - background(255); - fill(0); - //text("Click mouse to generate", 10, height-10); - - translate(width/2, height); - rotate(-PI/2); - turtle.render(); - noLoop(); -} - -int counter = 0; - -void mousePressed() { - if (counter < 5) { - pushMatrix(); - lsys.generate(); - //println(lsys.getSentence()); - turtle.setToDo(lsys.getSentence()); - turtle.changeLen(0.5); - popMatrix(); - redraw(); - counter++; - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/Rule.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/Rule.pde deleted file mode 100644 index 49353e772..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/Rule.pde +++ /dev/null @@ -1,26 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// LSystem Rule class - -class Rule { - char a; - String b; - - Rule(char a_, String b_) { - a = a_; - b = b_; - } - - char getA() { - return a; - } - - String getB() { - return b; - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/Turtle.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/Turtle.pde deleted file mode 100644 index cede7d5c7..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/Turtle.pde +++ /dev/null @@ -1,54 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Turtle { - - String todo; - float len; - float theta; - - Turtle(String s, float l, float t) { - todo = s; - len = l; - theta = t; - } - - void render() { - stroke(0,175); - for (int i = 0; i < todo.length(); i++) { - char c = todo.charAt(i); - if (c == 'F' || c == 'G') { - line(0,0,len,0); - translate(len,0); - } - else if (c == '+') { - rotate(theta); - } - else if (c == '-') { - rotate(-theta); - } - else if (c == '[') { - pushMatrix(); - } - else if (c == ']') { - popMatrix(); - } - } - } - - void setLen(float l) { - len = l; - } - - void changeLen(float percent) { - len *= percent; - } - - void setToDo(String s) { - todo = s; - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/DNA.pde b/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/DNA.pde deleted file mode 100644 index 54d988426..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/DNA.pde +++ /dev/null @@ -1,82 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding w/ Genetic Algorithms - -// DNA is an array of vectors - -class DNA { - - // The genetic sequence - PVector[] genes; - - // Constructor (makes a DNA of random PVectors) - DNA(int num) { - genes = new PVector[num]; - for (int i = 0; i < genes.length; i++) { - genes[i] = PVector.random2D(); - } - } - - // Constructor #2, creates the instance based on an existing array - DNA(PVector[] newgenes) { - // We could make a copy if necessary - // genes = (PVector []) newgenes.clone(); - genes = newgenes; - } - - // CROSSOVER - // Creates new DNA sequence from two (this & and a partner) - DNA crossover(DNA partner) { - PVector[] child = new PVector[genes.length]; - // Pick a midpoint - int crossover = int(random(genes.length)); - // Take "half" from one and "half" from the other - for (int i = 0; i < genes.length; i++) { - if (i > crossover) child[i] = genes[i]; - else child[i] = partner.genes[i]; - } - DNA newgenes = new DNA(child); - return newgenes; - } - - // Based on a mutation probability, picks a new random Vector - void mutate(float m) { - for (int i = 0; i < genes.length; i++) { - if (random(1) < m) { - genes[i] = PVector.random2D(); - } - } - } - - void debugDraw() { - int cols = width / gridscale; - int rows = height / gridscale; - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - drawVector(genes[i+j*cols],i*gridscale,j*gridscale,gridscale-2); - } - } - } - - // Renders a vector object 'v' as an arrow and a location 'x,y' - void drawVector(PVector v, float x, float y, float scayl) { - pushMatrix(); - float arrowsize = 4; - // Translate to location to render vector - translate(x+gridscale/2,y); - stroke(0,100); - // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate - rotate(v.heading()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) - line(-len/2,0,len/2,0); - //noFill(); - //ellipse(-len/2,0,2,2); - popMatrix(); - } - -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/EvolveFlowField.pde b/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/EvolveFlowField.pde deleted file mode 100644 index 433924997..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/EvolveFlowField.pde +++ /dev/null @@ -1,121 +0,0 @@ - // The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding Flowfield w/ Genetic Algorithms - -// This example produces an obstacle course with a start and finish -// Virtual "creatures" are rewarded for making it closer to the finish - -// Each creature's DNA is a "flowfield" of PVectors that -// determine steering vectors for each cell on the screen - -import java.awt.Rectangle; - -int gridscale = 10; // Scale of grid is 1/24 of screen size - -// DNA needs one vector for every spot on the grid -// (it's like a pixel array, but with vectors instead of colors) -int dnasize; - -int lifetime; // How long should each generation live - - -Population population; // Population -int lifecycle; // Timer for cycle of generation -int recordtime; // Fastest time to target -Obstacle target; // Target location -Obstacle start; // Start location -int diam = 24; // Size of target - -ArrayList obstacles; //an array list to keep track of all the obstacles! - -boolean debug = false; - -Rectangle newObstacle = null; - -void setup() { - size(640,360); - dnasize = (width / gridscale) * (height / gridscale); - lifetime = width/3; - - // Initialize variables - lifecycle = 0; - recordtime = lifetime; - target = new Obstacle(width-diam-diam/2,height/2-diam/2,diam,diam); - start = new Obstacle(diam/2,height/2-diam/2,diam,diam); - - // Create a population with a mutation rate, and population max - int popmax = 1000; - float mutationRate = 0.02; - population = new Population(mutationRate,popmax); - - // Create the obstacle course - obstacles = new ArrayList(); - - - /*obstacles.add(new Obstacle(width/4,80,10,height-160)); - obstacles.add(new Obstacle(width/2,0,10,height/2-20)); - obstacles.add(new Obstacle(width/2,height-height/2+20,10,height/2-20)); - obstacles.add(new Obstacle(2*width/3,height/2-height/8,10,height/4));*/ -} - -void draw() { - background(255); - - // Draw the target locations - target.display(); - - // Draw the obstacles - for (Obstacle obs : obstacles) { - obs.display(); - } - - - // If the generation hasn't ended yet - if (lifecycle < lifetime) { - population.live(obstacles); - if ((population.targetReached()) && (lifecycle < recordtime)) { - recordtime = lifecycle; - } - lifecycle++; - // Otherwise a new generation - } else { - lifecycle = 0; - population.calcFitness(); - population.naturalSelection(); - population.generate(); - } - - // Display some info - textAlign(RIGHT); - fill(0); - text("Generation #:" + population.getGenerations(),width-10,18); - text("Cycles left:" + ((lifetime-lifecycle)),width-10,36); - text("Record cycles: " + recordtime,width-10,54); - - if (newObstacle != null) { - rect(newObstacle.x,newObstacle.y,newObstacle.width,newObstacle.height); - } - -} - -void keyPressed() { - if (key == 'd') { - debug = !debug; - } -} - -void mousePressed() { - newObstacle = new Rectangle(mouseX,mouseY,0,0); -} - -void mouseDragged() { - newObstacle.width = mouseX-newObstacle.x; - newObstacle.height = mouseY-newObstacle.y; -} - -void mouseReleased() { - obstacles.add(new Obstacle(newObstacle)); - newObstacle = null; -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Obstacle.pde b/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Obstacle.pde deleted file mode 100644 index 2658d7bd5..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Obstacle.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding w/ Genetic Algorithms - -// A class for an obstacle, just a simple rectangle that is drawn -// and can check if a creature touches it - -// Also using this class for starting point and target location - -class Obstacle { - - Rectangle r; - - Obstacle(int x, int y, int w, int h) { - r = new Rectangle(x,y,w,h); - } - - Obstacle(Rectangle r_) { - r = r_; - } - - void display() { - stroke(0); - fill(175); - rectMode(CORNER); - rect(r.x,r.y,r.width,r.height); - } - - boolean contains(PVector spot) { - if (r.contains((int)spot.x,(int)spot.y)) { - return true; - } else { - return false; - } - } - -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Population.pde b/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Population.pde deleted file mode 100644 index baa32703a..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Population.pde +++ /dev/null @@ -1,142 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A class to describe a population of "creatures" - -class Population { - - float mutationRate; // Mutation rate - Rocket[] population; // Array to hold the current population - ArrayList darwin; // ArrayList which we will use for our "mating pool" - int generations; // Number of generations - - int order; // Keep track of the order of creature's finishing the maze - - - - // Initialize the population - Population(float m, int num) { - mutationRate = m; - population = new Rocket[num]; - darwin = new ArrayList(); - generations = 0; - //make a new set of creatures - for (int i = 0; i < population.length; i++) { - PVector location = new PVector(start.r.x+start.r.width/2, start.r.y+start.r.height/2); - population[i] = new Rocket(location, new DNA(dnasize)); - } - order = 1; // The first one to finish will be #1 - } - - void live (ArrayList o) { - // For every creature - - - - float record = 100000; - int closest = 0; - - for (int i = 0; i < population.length; i++) { - // If it finishes, mark it down as done! - if ((population[i].finished())) { - population[i].setFinish(order); - order++; - } - // Run it - population[i].run(o); - - if (population[i].recordDist < record) {// && !population[i].dead) { - record = population[i].recordDist; - closest = i; - } - } - - population[closest].highlight(); - // Drawing one example of the DNA - if (debug) { - population[closest].dna.debugDraw(); - } - } - - // Did anything finish? - boolean targetReached() { - for (int i = 0; i < population.length; i++) { - if (population[i].finished()) return true; - } - return false; - } - - // Calculate fitness for each creature - void calcFitness() { - for (int i = 0; i < population.length; i++) { - population[i].calcFitness(); - } - order = 1; // Hmmm, awkward place for this, we have to reset this for the next generation - } - - // Generate a mating pool - void naturalSelection() { - // Clear the ArrayList - darwin.clear(); - - // Calculate total fitness of whole population - float totalFitness = getTotalFitness(); - float avgFitness = totalFitness/population.length; - - // Calculate normalized fitness for each member of the population - // Based on normalized fitness, each member will get added to the mating pool a certain number of times a la roulette wheel - // A higher fitness = more entries to mating pool = more likely to be picked as a parent - // A lower fitness = fewer entries to mating pool = less likely to be picked as a parent - int count = 0; - for (int i = 0; i < population.length; i++) { - float fitness = population[i].getFitness(); - //if (fitness > avgFitness) { - count++; - float fitnessNormal = fitness / totalFitness; - int n = (int) (fitnessNormal * 50000); // Arbitrary multiplier, consider mapping fix - for (int j = 0; j < n; j++) { - darwin.add(population[i]); - } - //} - } - //println("Total: " + count + " " + population.length); - } - - // Making the next generation - void generate() { - // Refill the population with children from the mating pool - for (int i = 0; i < population.length; i++) { - int m = int(random(darwin.size())); - int d = int(random(darwin.size())); - // Pick two parents - Rocket mom = darwin.get(m); - Rocket dad = darwin.get(d); - // Get their genes - DNA momgenes = mom.getDNA(); - DNA dadgenes = dad.getDNA(); - // Mate their genes - DNA child = momgenes.crossover(dadgenes); - // Mutate their genes - child.mutate(mutationRate); - // Fill the new population with the new child - PVector location = new PVector(start.r.x+start.r.width/2, start.r.y+start.r.height/2); - population[i] = new Rocket(location, child); - } - generations++; - } - - int getGenerations() { - return generations; - } - - //compute total fitness for the population - float getTotalFitness() { - float total = 0; - for (int i = 0; i < population.length; i++) { - total += population[i].getFitness(); - } - return total; - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Rocket.pde b/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Rocket.pde deleted file mode 100644 index dab8d959c..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Rocket.pde +++ /dev/null @@ -1,171 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding w/ Genetic Algorithms - -// Rocket class -- this is just like our Boid / Particle class -// the only difference is that it has DNA & fitness - -class Rocket { - - // All of our physics stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float recordDist; - - float fitness; - DNA dna; - - // Could make this part of DNA??) - float maxspeed = 6.0; - float maxforce = 1.0; - - boolean stopped; // Am I stuck? - boolean dead; // Did I hit an obstacle? - - int finish; // What was my finish? (first, second, etc. . . ) - - //constructor - Rocket(PVector l, DNA dna_) { - acceleration = new PVector(); - velocity = new PVector(); - location = l.get(); - r = 2; - dna = dna_; - stopped = false; - finish = 100000; // Some high number to begin with - recordDist = width; - } - - // FITNESS FUNCTION - // distance = distance from target - // finish = what order did i finish (first, second, etc. . .) - // f(distance,finish) = (1.0f / finish^1.5) * (1.0f / distance^6); - // a lower finish is rewarded (exponentially) and/or shorter distance to target (exponetially) - void calcFitness() { - float d = recordDist; - if (d < diam/2) { - d = 1.0; - } - // Reward finishing faster and getting closer - fitness = (1.0f / pow(finish,1.5)) * (1 / (pow(d,6))); - - //if (dead) fitness = 0; - } - - void setFinish(int f) { - finish = f; - } - - // Run in relation to all the obstacles - // If I'm stuck, don't bother updating or checking for intersection - void run(ArrayList o) { - if (!stopped) { - update(); - // If I hit an edge or an obstacle - if ((borders()) || (obstacles(o))) { - stopped = true; - dead = true; - } - } - // Draw me! - display(); - } - - // Did I hit an edge? - boolean borders() { - if ((location.x < 0) || (location.y < 0) || (location.x > width) || (location.y > height)) { - return true; - } else { - return false; - } - } - - // Did I make it to the target? - boolean finished() { - float d = dist(location.x,location.y,target.r.x,target.r.y); - if (d < recordDist) { - recordDist = d; - } - if (target.contains(location)) { - stopped = true; - return true; - } - return false; - } - - // Did I hit an obstacle? - boolean obstacles(ArrayList o) { - for (Obstacle obs : o) { - if (obs.contains(location)) { - return true; - } - } - return false; - } - - void update() { - if (!finished()) { - // Where are we? Our location will tell us what steering vector to look up in our DNA; - int x = (int) location.x/gridscale; - int y = (int) location.y/gridscale; - x = constrain(x,0,width/gridscale-1); // Make sure we are not off the edge - y = constrain(y,0,height/gridscale-1); // Make sure we are not off the edge - - // Get the steering vector out of our genes in the right spot - // A little Reynolds steering here - PVector desired = dna.genes[x+y*(width/gridscale)].get(); - desired.mult(maxspeed); - PVector steer = PVector.sub(desired,velocity); - acceleration.add(steer); - acceleration.limit(maxforce); - - velocity.add(acceleration); - velocity.limit(maxspeed); - location.add(velocity); - acceleration.mult(0); - } - } - - void display() { - //fill(0,150); - //stroke(0); - //ellipse(location.x,location.y,r,r); - float theta = velocity.heading() + PI/2; - fill(200,100); - stroke(0); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - void highlight() { - stroke(0); - line(location.x,location.y,target.r.x,target.r.y); - fill(255,0,0,100); - ellipse(location.x,location.y,16,16); - - } - - float getFitness() { - return fitness; - } - - DNA getDNA() { - return dna; - } - - boolean stopped() { - return stopped; - } - -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/DNA.pde b/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/DNA.pde deleted file mode 100644 index 8286ab0c0..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/DNA.pde +++ /dev/null @@ -1,70 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Genetic Algorithm, Evolving Shakespeare - -// A class to describe a psuedo-DNA, i.e. genotype -// Here, a virtual organism's DNA is an array of character. -// Functionality: -// -- convert DNA into a string -// -- calculate DNA's "fitness" -// -- mate DNA with another set of DNA -// -- mutate DNA - - -class DNA { - - // The genetic sequence - char[] genes; - - float fitness; - - // Constructor (makes a random DNA) - DNA(int num) { - genes = new char[num]; - for (int i = 0; i < genes.length; i++) { - genes[i] = (char) random(32,128); // Pick from range of chars - } - } - - // Converts character array to a String - String getPhrase() { - return new String(genes); - } - - // Fitness function (returns floating point % of "correct" characters) - void fitness (String target) { - int score = 0; - for (int i = 0; i < genes.length; i++) { - if (genes[i] == target.charAt(i)) { - score++; - } - } - fitness = pow(2,score); - } - - // Crossover - DNA crossover(DNA partner) { - // A new child - DNA child = new DNA(genes.length); - - int midpoint = int(random(genes.length)); // Pick a midpoint - - // Half from one, half from the other - for (int i = 0; i < genes.length; i++) { - if (i > midpoint) child.genes[i] = genes[i]; - else child.genes[i] = partner.genes[i]; - } - return child; - } - - // Based on a mutation probability, picks a new random character - void mutate(float mutationRate) { - for (int i = 0; i < genes.length; i++) { - if (random(1) < mutationRate) { - genes[i] = (char) random(32,128); - } - } - } -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/GA_Shakespeare_fancyfitness.pde b/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/GA_Shakespeare_fancyfitness.pde deleted file mode 100644 index a50ef3319..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/GA_Shakespeare_fancyfitness.pde +++ /dev/null @@ -1,89 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Genetic Algorithm, Evolving Shakespeare - -// Demonstration of using a genetic algorithm to perform a search - -// setup() -// # Step 1: The populationation -// # Create an empty populationation (an array or ArrayList) -// # Fill it with DNA encoded objects (pick random values to start) - -// draw() -// # Step 1: Selection -// # Create an empty mating pool (an empty ArrayList) -// # For every member of the populationation, evaluate its fitness based on some criteria / function, -// and add it to the mating pool in a manner consistant with its fitness, i.e. the more fit it -// is the more times it appears in the mating pool, in order to be more likely picked for reproduction. - -// # Step 2: Reproduction Create a new empty populationation -// # Fill the new populationation by executing the following steps: -// 1. Pick two "parent" objects from the mating pool. -// 2. Crossover -- create a "child" object by mating these two parents. -// 3. Mutation -- mutate the child's DNA based on a given probability. -// 4. Add the child object to the new populationation. -// # Replace the old populationation with the new populationation -// -// # Rinse and repeat - - -PFont f; -String target; -int popmax; -float mutationRate; -Population population; - -void setup() { - size(600, 200); - f = createFont("Courier", 32, true); - target = "To be or not to be."; - popmax = 150; - mutationRate = 0.01; - - // Create a populationation with a target phrase, mutation rate, and populationation max - population = new Population(target, mutationRate, popmax); -} - -void draw() { - // Generate mating pool - population.naturalSelection(); - //Create next generation - population.generate(); - // Calculate fitness - population.calcFitness(); - displayInfo(); - - // If we found the target phrase, stop - if (population.finished()) { - println(millis()/1000.0); - noLoop(); - } -} - -void displayInfo() { - background(255); - // Display current status of populationation - String answer = population.getBest(); - textFont(f); - textAlign(LEFT); - fill(0); - - - textSize(16); - text("Best phrase:",20,30); - textSize(32); - text(answer, 20, 75); - - textSize(12); - text("total generations: " + population.getGenerations(), 20, 140); - text("average fitness: " + nf(population.getAverageFitness(), 0, 2), 20, 155); - text("total populationation: " + popmax, 20, 170); - text("mutation rate: " + int(mutationRate * 100) + "%", 20, 185); - - textSize(10); - text("All phrases:\n" + population.allPhrases(), 450, 10); -} - - diff --git a/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/Population.pde b/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/Population.pde deleted file mode 100644 index 03630a706..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/Population.pde +++ /dev/null @@ -1,127 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Genetic Algorithm, Evolving Shakespeare - -// A class to describe a population of virtual organisms -// In this case, each organism is just an instance of a DNA object - -class Population { - - float mutationRate; // Mutation rate - DNA[] population; // Array to hold the current population - ArrayList matingPool; // ArrayList which we will use for our "mating pool" - String target; // Target phrase - int generations; // Number of generations - boolean finished; // Are we finished evolving? - int perfectScore; - - Population(String p, float m, int num) { - target = p; - mutationRate = m; - population = new DNA[num]; - for (int i = 0; i < population.length; i++) { - population[i] = new DNA(target.length()); - } - calcFitness(); - matingPool = new ArrayList(); - finished = false; - generations = 0; - - perfectScore = int(pow(2,target.length())); - } - - // Fill our fitness array with a value for every member of the population - void calcFitness() { - for (int i = 0; i < population.length; i++) { - population[i].fitness(target); - } - } - - // Generate a mating pool - void naturalSelection() { - // Clear the ArrayList - matingPool.clear(); - - float maxFitness = 0; - for (int i = 0; i < population.length; i++) { - if (population[i].fitness > maxFitness) { - maxFitness = population[i].fitness; - } - } - - // Based on fitness, each member will get added to the mating pool a certain number of times - // a higher fitness = more entries to mating pool = more likely to be picked as a parent - // a lower fitness = fewer entries to mating pool = less likely to be picked as a parent - for (int i = 0; i < population.length; i++) { - - float fitness = map(population[i].fitness,0,maxFitness,0,1); - int n = int(fitness * 100); // Arbitrary multiplier, we can also use monte carlo method - for (int j = 0; j < n; j++) { // and pick two random numbers - matingPool.add(population[i]); - } - } - } - - // Create a new generation - void generate() { - // Refill the population with children from the mating pool - for (int i = 0; i < population.length; i++) { - int a = int(random(matingPool.size())); - int b = int(random(matingPool.size())); - DNA partnerA = matingPool.get(a); - DNA partnerB = matingPool.get(b); - DNA child = partnerA.crossover(partnerB); - child.mutate(mutationRate); - population[i] = child; - } - generations++; - } - - - // Compute the current "most fit" member of the population - String getBest() { - float worldrecord = 0.0f; - int index = 0; - for (int i = 0; i < population.length; i++) { - if (population[i].fitness > worldrecord) { - index = i; - worldrecord = population[i].fitness; - } - } - - if (worldrecord == perfectScore ) finished = true; - return population[index].getPhrase(); - } - - boolean finished() { - return finished; - } - - int getGenerations() { - return generations; - } - - // Compute average fitness for the population - float getAverageFitness() { - float total = 0; - for (int i = 0; i < population.length; i++) { - total += population[i].fitness; - } - return total / (population.length); - } - - String allPhrases() { - String everything = ""; - - int displayLimit = min(population.length,50); - - - for (int i = 0; i < displayLimit; i++) { - everything += population[i].getPhrase() + "\n"; - } - return everything; - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/DNA.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/DNA.pde deleted file mode 100644 index d3ceb1ce3..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/DNA.pde +++ /dev/null @@ -1,72 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Genetic Algorithm, Evolving Shakespeare - -// A class to describe a psuedo-DNA, i.e. genotype -// Here, a virtual organism's DNA is an array of character. -// Functionality: -// -- convert DNA into a string -// -- calculate DNA's "fitness" -// -- mate DNA with another set of DNA -// -- mutate DNA - - -class DNA { - - // The genetic sequence - char[] genes; - - float fitness; - - // Constructor (makes a random DNA) - DNA(int num) { - genes = new char[num]; - for (int i = 0; i < genes.length; i++) { - genes[i] = (char) random(32,128); // Pick from range of chars - } - } - - // Converts character array to a String - String getPhrase() { - return new String(genes); - } - - // Fitness function (returns floating point % of "correct" characters) - void fitness (String target) { - int score = 0; - for (int i = 0; i < genes.length; i++) { - if (genes[i] == target.charAt(i)) { - score++; - } - } - - - fitness = (float)score / (float)target.length(); - } - - // Crossover - DNA crossover(DNA partner) { - // A new child - DNA child = new DNA(genes.length); - - int midpoint = int(random(genes.length)); // Pick a midpoint - - // Half from one, half from the other - for (int i = 0; i < genes.length; i++) { - if (i > midpoint) child.genes[i] = genes[i]; - else child.genes[i] = partner.genes[i]; - } - return child; - } - - // Based on a mutation probability, picks a new random character - void mutate(float mutationRate) { - for (int i = 0; i < genes.length; i++) { - if (random(1) < mutationRate) { - genes[i] = (char) random(32,128); - } - } - } -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/NOC_9_01_GA_Shakespeare.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/NOC_9_01_GA_Shakespeare.pde deleted file mode 100644 index d4e72a1fc..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/NOC_9_01_GA_Shakespeare.pde +++ /dev/null @@ -1,90 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Genetic Algorithm, Evolving Shakespeare - -// Demonstration of using a genetic algorithm to perform a search - -// setup() -// # Step 1: The Population -// # Create an empty population (an array or ArrayList) -// # Fill it with DNA encoded objects (pick random values to start) - -// draw() -// # Step 1: Selection -// # Create an empty mating pool (an empty ArrayList) -// # For every member of the population, evaluate its fitness based on some criteria / function, -// and add it to the mating pool in a manner consistant with its fitness, i.e. the more fit it -// is the more times it appears in the mating pool, in order to be more likely picked for reproduction. - -// # Step 2: Reproduction Create a new empty population -// # Fill the new population by executing the following steps: -// 1. Pick two "parent" objects from the mating pool. -// 2. Crossover -- create a "child" object by mating these two parents. -// 3. Mutation -- mutate the child's DNA based on a given probability. -// 4. Add the child object to the new population. -// # Replace the old population with the new population -// -// # Rinse and repeat - - -PFont f; -String target; -int popmax; -float mutationRate; -Population population; - -void setup() { - size(640, 360); - f = createFont("Courier", 32, true); - target = "To be or not to be."; - popmax = 150; - mutationRate = 0.01; - - // Create a populationation with a target phrase, mutation rate, and populationation max - population = new Population(target, mutationRate, popmax); -} - -void draw() { - // Generate mating pool - population.naturalSelection(); - //Create next generation - population.generate(); - // Calculate fitness - population.calcFitness(); - displayInfo(); - - // If we found the target phrase, stop - if (population.finished()) { - println(millis()/1000.0); - noLoop(); - } -} - -void displayInfo() { - background(255); - // Display current status of populationation - String answer = population.getBest(); - textFont(f); - textAlign(LEFT); - fill(0); - - - textSize(24); - text("Best phrase:",20,30); - textSize(40); - text(answer, 20, 100); - - textSize(18); - text("total generations: " + population.getGenerations(), 20, 160); - text("average fitness: " + nf(population.getAverageFitness(), 0, 2), 20, 180); - text("total population: " + popmax, 20, 200); - text("mutation rate: " + int(mutationRate * 100) + "%", 20, 220); - - textSize(10); - text("All phrases:\n" + population.allPhrases(), 500, 10); -} - - - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/Population.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/Population.pde deleted file mode 100644 index d48ac6c3f..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/Population.pde +++ /dev/null @@ -1,127 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Genetic Algorithm, Evolving Shakespeare - -// A class to describe a population of virtual organisms -// In this case, each organism is just an instance of a DNA object - -class Population { - - float mutationRate; // Mutation rate - DNA[] population; // Array to hold the current population - ArrayList matingPool; // ArrayList which we will use for our "mating pool" - String target; // Target phrase - int generations; // Number of generations - boolean finished; // Are we finished evolving? - int perfectScore; - - Population(String p, float m, int num) { - target = p; - mutationRate = m; - population = new DNA[num]; - for (int i = 0; i < population.length; i++) { - population[i] = new DNA(target.length()); - } - calcFitness(); - matingPool = new ArrayList(); - finished = false; - generations = 0; - - perfectScore = 1; - } - - // Fill our fitness array with a value for every member of the population - void calcFitness() { - for (int i = 0; i < population.length; i++) { - population[i].fitness(target); - } - } - - // Generate a mating pool - void naturalSelection() { - // Clear the ArrayList - matingPool.clear(); - - float maxFitness = 0; - for (int i = 0; i < population.length; i++) { - if (population[i].fitness > maxFitness) { - maxFitness = population[i].fitness; - } - } - - // Based on fitness, each member will get added to the mating pool a certain number of times - // a higher fitness = more entries to mating pool = more likely to be picked as a parent - // a lower fitness = fewer entries to mating pool = less likely to be picked as a parent - for (int i = 0; i < population.length; i++) { - - float fitness = map(population[i].fitness,0,maxFitness,0,1); - int n = int(fitness * 100); // Arbitrary multiplier, we can also use monte carlo method - for (int j = 0; j < n; j++) { // and pick two random numbers - matingPool.add(population[i]); - } - } - } - - // Create a new generation - void generate() { - // Refill the population with children from the mating pool - for (int i = 0; i < population.length; i++) { - int a = int(random(matingPool.size())); - int b = int(random(matingPool.size())); - DNA partnerA = matingPool.get(a); - DNA partnerB = matingPool.get(b); - DNA child = partnerA.crossover(partnerB); - child.mutate(mutationRate); - population[i] = child; - } - generations++; - } - - - // Compute the current "most fit" member of the population - String getBest() { - float worldrecord = 0.0; - int index = 0; - for (int i = 0; i < population.length; i++) { - if (population[i].fitness > worldrecord) { - index = i; - worldrecord = population[i].fitness; - } - } - - if (worldrecord == perfectScore ) finished = true; - return population[index].getPhrase(); - } - - boolean finished() { - return finished; - } - - int getGenerations() { - return generations; - } - - // Compute average fitness for the population - float getAverageFitness() { - float total = 0; - for (int i = 0; i < population.length; i++) { - total += population[i].fitness; - } - return total / (population.length); - } - - String allPhrases() { - String everything = ""; - - int displayLimit = min(population.length,50); - - - for (int i = 0; i < displayLimit; i++) { - everything += population[i].getPhrase() + "\n"; - } - return everything; - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare_simplified/DNA.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare_simplified/DNA.pde deleted file mode 100644 index e4ce06c31..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare_simplified/DNA.pde +++ /dev/null @@ -1,70 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Genetic Algorithm, Evolving Shakespeare - -// A class to describe a psuedo-DNA, i.e. genotype -// Here, a virtual organism's DNA is an array of character. -// Functionality: -// -- convert DNA into a string -// -- calculate DNA's "fitness" -// -- mate DNA with another set of DNA -// -- mutate DNA - - -class DNA { - - // The genetic sequence - char[] genes; - - float fitness; - - // Constructor (makes a random DNA) - DNA(int num) { - genes = new char[num]; - for (int i = 0; i < genes.length; i++) { - genes[i] = (char) random(32,128); // Pick from range of chars - } - } - - // Converts character array to a String - String getPhrase() { - return new String(genes); - } - - // Fitness function (returns floating point % of "correct" characters) - void calcFitness (String target) { - int score = 0; - for (int i = 0; i < genes.length; i++) { - if (genes[i] == target.charAt(i)) { - score++; - } - } - fitness = (float)score / (float)target.length(); - } - - // Crossover - DNA crossover(DNA partner) { - // A new child - DNA child = new DNA(genes.length); - - int midpoint = int(random(genes.length)); // Pick a midpoint - - // Half from one, half from the other - for (int i = 0; i < genes.length; i++) { - if (i > midpoint) child.genes[i] = genes[i]; - else child.genes[i] = partner.genes[i]; - } - return child; - } - - // Based on a mutation probability, picks a new random character - void mutate(float mutationRate) { - for (int i = 0; i < genes.length; i++) { - if (random(1) < mutationRate) { - genes[i] = (char) random(32,128); - } - } - } -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare_simplified/NOC_9_01_GA_Shakespeare_simplified.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare_simplified/NOC_9_01_GA_Shakespeare_simplified.pde deleted file mode 100644 index a46d90a23..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare_simplified/NOC_9_01_GA_Shakespeare_simplified.pde +++ /dev/null @@ -1,89 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Genetic Algorithm, Evolving Shakespeare - -// Demonstration of using a genetic algorithm to perform a search - -// setup() -// # Step 1: The Population -// # Create an empty population (an array or ArrayList) -// # Fill it with DNA encoded objects (pick random values to start) - -// draw() -// # Step 1: Selection -// # Create an empty mating pool (an empty ArrayList) -// # For every member of the population, evaluate its fitness based on some criteria / function, -// and add it to the mating pool in a manner consistant with its fitness, i.e. the more fit it -// is the more times it appears in the mating pool, in order to be more likely picked for reproduction. - -// # Step 2: Reproduction Create a new empty population -// # Fill the new population by executing the following steps: -// 1. Pick two "parent" objects from the mating pool. -// 2. Crossover -- create a "child" object by mating these two parents. -// 3. Mutation -- mutate the child's DNA based on a given probability. -// 4. Add the child object to the new population. -// # Replace the old population with the new population -// -// # Rinse and repeat - - -float mutationRate = 0.01; // Mutation rate -int totalPopulation = 150; // Total Population - -DNA[] population; // Array to hold the current population -ArrayList matingPool; // ArrayList which we will use for our "mating pool" -String target; // Target phrase - -PFont f; - -void setup() { - size(800, 200); - target = "to be or not to be"; - - population = new DNA[totalPopulation]; - - for (int i = 0; i < population.length; i++) { - population[i] = new DNA(target.length()); - } - - f = createFont("Courier",12,true); -} - -void draw() { - for (int i = 0; i < population.length; i++) { - population[i].calcFitness(target); - } - - ArrayList matingPool = new ArrayList(); // ArrayList which we will use for our "mating pool" - - for (int i = 0; i < population.length; i++) { - int nnnn = int(population[i].fitness * 100); // Arbitrary multiplier, we can also use monte carlo method - for (int j = 0; j crossover) child[i] = genes[i]; - else child[i] = partner.genes[i]; - } - DNA newgenes = new DNA(child); - return newgenes; - } - - // Based on a mutation probability, picks a new random Vector - void mutate(float m) { - for (int i = 0; i < genes.length; i++) { - if (random(1) < m) { - float angle = random(TWO_PI); - genes[i] = new PVector(cos(angle), sin(angle)); - genes[i].mult(random(0, maxforce)); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/NOC_9_02_SmartRockets_superbasic.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/NOC_9_02_SmartRockets_superbasic.pde deleted file mode 100644 index 3ae68e806..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/NOC_9_02_SmartRockets_superbasic.pde +++ /dev/null @@ -1,74 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Smart Rockets w/ Genetic Algorithms - -// Each Rocket's DNA is an array of PVectors -// Each PVector acts as a force for each frame of animation -// Imagine an booster on the end of the rocket that can point in any direction -// and fire at any strength every frame - -// The Rocket's fitness is a function of how close it gets to the target as well as how fast it gets there - -// This example is inspired by Jer Thorp's Smart Rockets -// http://www.blprnt.com/smartrockets/ - -int lifetime; // How long should each generation live - -Population population; // Population - -int lifeCounter; // Timer for cycle of generation - -PVector target; // Target location - -void setup() { - size(640, 360); - // The number of cycles we will allow a generation to live - lifetime = height; - - // Initialize variables - lifeCounter = 0; - - target = new PVector(width/2, 24); - - // Create a population with a mutation rate, and population max - float mutationRate = 0.01; - population = new Population(mutationRate, 50); - -} - -void draw() { - background(255); - - // Draw the start and target locations - fill(0); - ellipse(target.x,target.y,24,24); - - - // If the generation hasn't ended yet - if (lifeCounter < lifetime) { - population.live(); - lifeCounter++; - // Otherwise a new generation - } - else { - lifeCounter = 0; - population.fitness(); - population.selection(); - population.reproduction(); - } - - // Display some info - fill(0); - text("Generation #: " + population.getGenerations(), 10, 18); - text("Cycles left: " + (lifetime-lifeCounter), 10, 36); -} - -// Move the target if the mouse is pressed -// System will adapt to new target -void mousePressed() { - target.x = mouseX; - target.y = mouseY; -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/Population.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/Population.pde deleted file mode 100644 index 128d38636..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/Population.pde +++ /dev/null @@ -1,103 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding w/ Genetic Algorithms - -// A class to describe a population of "creatures" - -class Population { - - float mutationRate; // Mutation rate - Rocket[] population; // Array to hold the current population - ArrayList matingPool; // ArrayList which we will use for our "mating pool" - int generations; // Number of generations - - // Initialize the population - Population(float m, int num) { - mutationRate = m; - population = new Rocket[num]; - matingPool = new ArrayList(); - generations = 0; - //make a new set of creatures - for (int i = 0; i < population.length; i++) { - PVector location = new PVector(width/2,height+20); - population[i] = new Rocket(location, new DNA()); - } - } - - void live () { - // Run every rocket - for (int i = 0; i < population.length; i++) { - population[i].run(); - } - } - - // Calculate fitness for each creature - void fitness() { - for (int i = 0; i < population.length; i++) { - population[i].fitness(); - } - } - - // Generate a mating pool - void selection() { - // Clear the ArrayList - matingPool.clear(); - - // Calculate total fitness of whole population - float maxFitness = getMaxFitness(); - - // Calculate fitness for each member of the population (scaled to value between 0 and 1) - // Based on fitness, each member will get added to the mating pool a certain number of times - // A higher fitness = more entries to mating pool = more likely to be picked as a parent - // A lower fitness = fewer entries to mating pool = less likely to be picked as a parent - for (int i = 0; i < population.length; i++) { - float fitnessNormal = map(population[i].getFitness(),0,maxFitness,0,1); - int n = (int) (fitnessNormal * 100); // Arbitrary multiplier - for (int j = 0; j < n; j++) { - matingPool.add(population[i]); - } - } - } - - // Making the next generation - void reproduction() { - // Refill the population with children from the mating pool - for (int i = 0; i < population.length; i++) { - // Sping the wheel of fortune to pick two parents - int m = int(random(matingPool.size())); - int d = int(random(matingPool.size())); - // Pick two parents - Rocket mom = matingPool.get(m); - Rocket dad = matingPool.get(d); - // Get their genes - DNA momgenes = mom.getDNA(); - DNA dadgenes = dad.getDNA(); - // Mate their genes - DNA child = momgenes.crossover(dadgenes); - // Mutate their genes - child.mutate(mutationRate); - // Fill the new population with the new child - PVector location = new PVector(width/2,height+20); - population[i] = new Rocket(location, child); - } - generations++; - } - - int getGenerations() { - return generations; - } - - // Find highest fintess for the population - float getMaxFitness() { - float record = 0; - for (int i = 0; i < population.length; i++) { - if(population[i].getFitness() > record) { - record = population[i].getFitness(); - } - } - return record; - } - -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/Rocket.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/Rocket.pde deleted file mode 100644 index 2456856e4..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/Rocket.pde +++ /dev/null @@ -1,108 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding w/ Genetic Algorithms - -// Rocket class -- this is just like our Boid / Particle class -// the only difference is that it has DNA & fitness - -class Rocket { - - // All of our physics stuff - PVector location; - PVector velocity; - PVector acceleration; - - // Size - float r; - - // Fitness and DNA - float fitness; - DNA dna; - // To count which force we're on in the genes - int geneCounter = 0; - - boolean hitTarget = false; // Did I reach the target - - //constructor - Rocket(PVector l, DNA dna_) { - acceleration = new PVector(); - velocity = new PVector(); - location = l.get(); - r = 4; - dna = dna_; - } - - // Fitness function - // fitness = one divided by distance squared - void fitness() { - float d = dist(location.x, location.y, target.x, target.y); - fitness = pow(1/d, 2); - } - - // Run in relation to all the obstacles - // If I'm stuck, don't bother updating or checking for intersection - void run() { - checkTarget(); // Check to see if we've reached the target - if (!hitTarget) { - applyForce(dna.genes[geneCounter]); - geneCounter = (geneCounter + 1) % dna.genes.length; - update(); - } - display(); - } - - // Did I make it to the target? - void checkTarget() { - float d = dist(location.x, location.y, target.x, target.y); - if (d < 12) { - hitTarget = true; - } - } - - void applyForce(PVector f) { - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - float theta = velocity.heading2D() + PI/2; - fill(200, 100); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - rotate(theta); - - // Thrusters - rectMode(CENTER); - fill(0); - rect(-r/2, r*2, r/2, r); - rect(r/2, r*2, r/2, r); - - // Rocket body - fill(175); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - - popMatrix(); - } - - float getFitness() { - return fitness; - } - - DNA getDNA() { - return dna; - } - -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/DNA.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/DNA.pde deleted file mode 100644 index b4eefe1cf..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/DNA.pde +++ /dev/null @@ -1,68 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding w/ Genetic Algorithms - -// DNA is an array of vectors - -class DNA { - - // The genetic sequence - PVector[] genes; - - // The maximum strength of the forces - float maxforce = 0.1; - - // Constructor (makes a DNA of random PVectors) - DNA() { - genes = new PVector[lifetime]; - for (int i = 0; i < genes.length; i++) { - float angle = random(TWO_PI); - genes[i] = new PVector(cos(angle), sin(angle)); - genes[i].mult(random(0, maxforce)); - } - - // Let's give each Rocket an extra boost of strength for its first frame - genes[0].normalize(); - } - - // Constructor #2, creates the instance based on an existing array - DNA(PVector[] newgenes) { - // We could make a copy if necessary - // genes = (PVector []) newgenes.clone(); - genes = newgenes; - } - - // CROSSOVER - // Creates new DNA sequence from two (this & and a partner) - DNA crossover(DNA partner) { - PVector[] child = new PVector[genes.length]; - // Pick a midpoint - int crossover = int(random(genes.length)); - // Take "half" from one and "half" from the other - for (int i = 0; i < genes.length; i++) { - if (i > crossover) child[i] = genes[i]; - else child[i] = partner.genes[i]; - } - DNA newgenes = new DNA(child); - return newgenes; - } - - // Based on a mutation probability, picks a new random Vector - void mutate(float m) { - for (int i = 0; i < genes.length; i++) { - if (random(1) < m) { - float angle = random(TWO_PI); - genes[i] = new PVector(cos(angle), sin(angle)); - genes[i].mult(random(0, maxforce)); - // float angle = random(-0.1,0.1); - // genes[i].rotate(angle); - // float factor = random(0.9,1.1); - // genes[i].mult(factor); - if (i ==0) genes[i].normalize(); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/NOC_9_03_SmartRockets.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/NOC_9_03_SmartRockets.pde deleted file mode 100644 index 2ac224f66..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/NOC_9_03_SmartRockets.pde +++ /dev/null @@ -1,94 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Smart Rockets w/ Genetic Algorithms - -// Each Rocket's DNA is an array of PVectors -// Each PVector acts as a force for each frame of animation -// Imagine an booster on the end of the rocket that can point in any direction -// and fire at any strength every frame - -// The Rocket's fitness is a function of how close it gets to the target as well as how fast it gets there - -// This example is inspired by Jer Thorp's Smart Rockets -// http://www.blprnt.com/smartrockets/ - -int lifetime; // How long should each generation live - -Population population; // Population - -int lifecycle; // Timer for cycle of generation -int recordtime; // Fastest time to target - -Obstacle target; // Target location - -//int diam = 24; // Size of target - -ArrayList obstacles; //an array list to keep track of all the obstacles! - -void setup() { - size(640, 360); - // The number of cycles we will allow a generation to live - lifetime = 300; - - // Initialize variables - lifecycle = 0; - recordtime = lifetime; - - target = new Obstacle(width/2-12, 24, 24, 24); - - // Create a population with a mutation rate, and population max - float mutationRate = 0.01; - population = new Population(mutationRate, 50); - - // Create the obstacle course - obstacles = new ArrayList(); - obstacles.add(new Obstacle(width/2-100, height/2, 200, 10)); -} - -void draw() { - background(255); - - // Draw the start and target locations - target.display(); - - - // If the generation hasn't ended yet - if (lifecycle < lifetime) { - population.live(obstacles); - if ((population.targetReached()) && (lifecycle < recordtime)) { - recordtime = lifecycle; - } - lifecycle++; - // Otherwise a new generation - } - else { - lifecycle = 0; - population.fitness(); - population.selection(); - population.reproduction(); - } - - // Draw the obstacles - for (Obstacle obs : obstacles) { - obs.display(); - } - - // Display some info - fill(0); - text("Generation #: " + population.getGenerations(), 10, 18); - text("Cycles left: " + (lifetime-lifecycle), 10, 36); - text("Record cycles: " + recordtime, 10, 54); - - -} - -// Move the target if the mouse is pressed -// System will adapt to new target -void mousePressed() { - target.location.x = mouseX; - target.location.y = mouseY; - recordtime = lifetime; -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Obstacle.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Obstacle.pde deleted file mode 100644 index e7d3d249f..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Obstacle.pde +++ /dev/null @@ -1,40 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding w/ Genetic Algorithms - -// A class for an obstacle, just a simple rectangle that is drawn -// and can check if a Rocket touches it - -// Also using this class for target location - - -class Obstacle { - - PVector location; - float w,h; - - Obstacle(float x, float y, float w_, float h_) { - location = new PVector(x,y); - w = w_; - h = h_; - } - - void display() { - stroke(0); - fill(175); - strokeWeight(2); - rectMode(CORNER); - rect(location.x,location.y,w,h); - } - - boolean contains(PVector spot) { - if (spot.x > location.x && spot.x < location.x + w && spot.y > location.y && spot.y < location.y + h) { - return true; - } else { - return false; - } - } - -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Population.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Population.pde deleted file mode 100644 index 432bf3b14..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Population.pde +++ /dev/null @@ -1,113 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding w/ Genetic Algorithms - -// A class to describe a population of "creatures" - -class Population { - - float mutationRate; // Mutation rate - Rocket[] population; // Array to hold the current population - ArrayList matingPool; // ArrayList which we will use for our "mating pool" - int generations; // Number of generations - - // Initialize the population - Population(float m, int num) { - mutationRate = m; - population = new Rocket[num]; - matingPool = new ArrayList(); - generations = 0; - //make a new set of creatures - for (int i = 0; i < population.length; i++) { - PVector location = new PVector(width/2,height+20); - population[i] = new Rocket(location, new DNA(),population.length); - } - } - - void live (ArrayList os) { - // For every creature - for (int i = 0; i < population.length; i++) { - // If it finishes, mark it down as done! - population[i].checkTarget(); - population[i].run(os); - } - } - - // Did anything finish? - boolean targetReached() { - for (int i = 0; i < population.length; i++) { - if (population[i].hitTarget) return true; - } - return false; - } - - // Calculate fitness for each creature - void fitness() { - for (int i = 0; i < population.length; i++) { - population[i].fitness(); - } - } - - // Generate a mating pool - void selection() { - // Clear the ArrayList - matingPool.clear(); - - // Calculate total fitness of whole population - float maxFitness = getMaxFitness(); - - // Calculate fitness for each member of the population (scaled to value between 0 and 1) - // Based on fitness, each member will get added to the mating pool a certain number of times - // A higher fitness = more entries to mating pool = more likely to be picked as a parent - // A lower fitness = fewer entries to mating pool = less likely to be picked as a parent - for (int i = 0; i < population.length; i++) { - float fitnessNormal = map(population[i].getFitness(),0,maxFitness,0,1); - int n = (int) (fitnessNormal * 100); // Arbitrary multiplier - for (int j = 0; j < n; j++) { - matingPool.add(population[i]); - } - } - } - - // Making the next generation - void reproduction() { - // Refill the population with children from the mating pool - for (int i = 0; i < population.length; i++) { - // Sping the wheel of fortune to pick two parents - int m = int(random(matingPool.size())); - int d = int(random(matingPool.size())); - // Pick two parents - Rocket mom = matingPool.get(m); - Rocket dad = matingPool.get(d); - // Get their genes - DNA momgenes = mom.getDNA(); - DNA dadgenes = dad.getDNA(); - // Mate their genes - DNA child = momgenes.crossover(dadgenes); - // Mutate their genes - child.mutate(mutationRate); - // Fill the new population with the new child - PVector location = new PVector(width/2,height+20); - population[i] = new Rocket(location, child,population.length); - } - generations++; - } - - int getGenerations() { - return generations; - } - - // Find highest fintess for the population - float getMaxFitness() { - float record = 0; - for (int i = 0; i < population.length; i++) { - if(population[i].getFitness() > record) { - record = population[i].getFitness(); - } - } - return record; - } - -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Rocket.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Rocket.pde deleted file mode 100644 index 5ce1b313b..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Rocket.pde +++ /dev/null @@ -1,148 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Rocket class -- this is just like our Boid / Particle class -// the only difference is that it has DNA & fitness - -class Rocket { - - // All of our physics stuff - PVector location; - PVector velocity; - PVector acceleration; - - // Size - float r; - - // How close did it get to the target - float recordDist; - - // Fitness and DNA - float fitness; - DNA dna; - // To count which force we're on in the genes - int geneCounter = 0; - - boolean hitObstacle = false; // Am I stuck on an obstacle? - boolean hitTarget = false; // Did I reach the target - int finishTime; // What was my finish time? - - //constructor - Rocket(PVector l, DNA dna_, int totalRockets) { - acceleration = new PVector(); - velocity = new PVector(); - location = l.get(); - r = 4; - dna = dna_; - finishTime = 0; // We're going to count how long it takes to reach target - recordDist = 10000; // Some high number that will be beat instantly - } - - // FITNESS FUNCTION - // distance = distance from target - // finish = what order did i finish (first, second, etc. . .) - // f(distance,finish) = (1.0f / finish^1.5) * (1.0f / distance^6); - // a lower finish is rewarded (exponentially) and/or shorter distance to target (exponetially) - void fitness() { - if (recordDist < 1) recordDist = 1; - - // Reward finishing faster and getting close - fitness = (1/(finishTime*recordDist)); - - // Make the function exponential - fitness = pow(fitness, 4); - - if (hitObstacle) fitness *= 0.1; // lose 90% of fitness hitting an obstacle - if (hitTarget) fitness *= 2; // twice the fitness for finishing! - } - - // Run in relation to all the obstacles - // If I'm stuck, don't bother updating or checking for intersection - void run(ArrayList os) { - if (!hitObstacle && !hitTarget) { - applyForce(dna.genes[geneCounter]); - geneCounter = (geneCounter + 1) % dna.genes.length; - update(); - // If I hit an edge or an obstacle - obstacles(os); - } - // Draw me! - if (!hitObstacle) { - display(); - } - } - - // Did I make it to the target? - void checkTarget() { - float d = dist(location.x, location.y, target.location.x, target.location.y); - if (d < recordDist) recordDist = d; - - if (target.contains(location) && !hitTarget) { - hitTarget = true; - } - else if (!hitTarget) { - finishTime++; - } - } - - // Did I hit an obstacle? - void obstacles(ArrayList os) { - for (Obstacle obs : os) { - if (obs.contains(location)) { - hitObstacle = true; - } - } - } - - void applyForce(PVector f) { - acceleration.add(f); - } - - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - //background(255,0,0); - float theta = velocity.heading2D() + PI/2; - fill(200, 100); - stroke(0); - strokeWeight(1); - pushMatrix(); - translate(location.x, location.y); - rotate(theta); - - // Thrusters - rectMode(CENTER); - fill(0); - rect(-r/2, r*2, r/2, r); - rect(r/2, r*2, r/2, r); - - // Rocket body - fill(175); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - - popMatrix(); - } - - float getFitness() { - return fitness; - } - - DNA getDNA() { - return dna; - } - - boolean stopped() { - return hitObstacle; - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Button.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Button.pde deleted file mode 100644 index eb35675ce..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Button.pde +++ /dev/null @@ -1,56 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Interactive Selection -// http://www.genarts.com/karl/papers/siggraph91.html - -//import java.awt.Rectangle; - -class Button { - Rectangle r; // Button's rectangle - String txt; // Button's text - boolean clickedOn; // Did i click on it? - boolean rolloverOn; // Did i rollover it? - - Button(int x, int y, int w, int h, String s) { - r = new Rectangle(x,y,w,h); - txt = s; - } - - void display() { - // Draw rectangle and text based on whether rollover or clicked - rectMode(CORNER); - stroke(0); noFill(); - if (rolloverOn) fill(0.5); - if (clickedOn) fill(0); - rect(r.x,r.y,r.width,r.height); - float b = 0.0; - if (clickedOn) b = 1; - else if (rolloverOn) b = 0.2; - else b = 0; - fill(b); - textAlign(LEFT); - text(txt,r.x+10,r.y+14); - - } - - - // Methods to check rollover, clicked, or released (must be called from appropriate - // Places in draw, mousePressed, mouseReleased - boolean rollover(int mx, int my) { - if (r.contains(mx,my)) rolloverOn = true; - else rolloverOn = false; - return rolloverOn; - } - - boolean clicked(int mx, int my) { - if (r.contains(mx,my)) clickedOn = true; - return clickedOn; - } - - void released() { - clickedOn = false; - } - -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/DNA.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/DNA.pde deleted file mode 100644 index 8825979b1..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/DNA.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Interactive Selection -// http://www.genarts.com/karl/papers/siggraph91.html - -class DNA { - - // The genetic sequence - float[] genes; - int len = 20; // Arbitrary length - - //Constructor (makes a random DNA) - DNA() { - // DNA is random floating point values between 0 and 1 (!!) - genes = new float[len]; - for (int i = 0; i < genes.length; i++) { - genes[i] = random(0,1); - } - } - - DNA(float[] newgenes) { - genes = newgenes; - } - - - // Crossover - // Creates new DNA sequence from two (this & - DNA crossover(DNA partner) { - float[] child = new float[genes.length]; - int crossover = int(random(genes.length)); - for (int i = 0; i < genes.length; i++) { - if (i > crossover) child[i] = genes[i]; - else child[i] = partner.genes[i]; - } - DNA newgenes = new DNA(child); - return newgenes; - } - - // Based on a mutation probability, picks a new random character in array spots - void mutate(float m) { - for (int i = 0; i < genes.length; i++) { - if (random(1) < m) { - genes[i] = random(0,1); - } - } - } -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Face.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Face.pde deleted file mode 100644 index 4a2992b6f..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Face.pde +++ /dev/null @@ -1,103 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Interactive Selection -// http://www.genarts.com/karl/papers/siggraph91.html - -// The class for our "face", contains DNA sequence, fitness value, position on screen - -// Fitness Function f(t) = t (where t is "time" mouse rolls over face) - -class Face { - - DNA dna; // Face's DNA - float fitness; // How good is this face? - float x, y; // Position on screen - int wh = 70; // Size of square enclosing face - boolean rolloverOn; // Are we rolling over this face? - - Rectangle r; - - // Create a new face - Face(DNA dna_, float x_, float y_) { - dna = dna_; - x = x_; - y = y_; - fitness = 1; - // Using java.awt.Rectangle (see: http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Rectangle.html) - r = new Rectangle(int(x-wh/2), int(y-wh/2), int(wh), int(wh)); - } - - // Display the face - void display() { - // We are using the face's DNA to pick properties for this face - // such as: head size, color, eye position, etc. - // Now, since every gene is a floating point between 0 and 1, we map the values - float r = map(dna.genes[0],0,1,0,70); - color c = color(dna.genes[1],dna.genes[2],dna.genes[3]); - float eye_y = map(dna.genes[4],0,1,0,5); - float eye_x = map(dna.genes[5],0,1,0,10); - float eye_size = map(dna.genes[5],0,1,0,10); - color eyecolor = color(dna.genes[4],dna.genes[5],dna.genes[6]); - color mouthColor = color(dna.genes[7],dna.genes[8],dna.genes[9]); - float mouth_y = map(dna.genes[5],0,1,0,25); - float mouth_x = map(dna.genes[5],0,1,-25,25); - float mouthw = map(dna.genes[5],0,1,0,50); - float mouthh = map(dna.genes[5],0,1,0,10); - - // Once we calculate all the above properties, we use those variables to draw rects, ellipses, etc. - pushMatrix(); - translate(x, y); - noStroke(); - - // Draw the head - fill(c); - ellipseMode(CENTER); - ellipse(0, 0, r, r); - - // Draw the eyes - fill(eyecolor); - rectMode(CENTER); - rect(-eye_x, -eye_y, eye_size, eye_size); - rect( eye_x, -eye_y, eye_size, eye_size); - - // Draw the mouth - fill(mouthColor); - rectMode(CENTER); - rect(mouth_x, mouth_y, mouthw, mouthh); - - // Draw the bounding box - stroke(0.25); - if (rolloverOn) fill(0, 0.25); - else noFill(); - rectMode(CENTER); - rect(0, 0, wh, wh); - popMatrix(); - - // Display fitness value - textAlign(CENTER); - if (rolloverOn) fill(0); - else fill(0.25); - text(int(fitness), x, y+55); - } - - float getFitness() { - return fitness; - } - - DNA getDNA() { - return dna; - } - - // Increment fitness if mouse is rolling over face - void rollover(int mx, int my) { - if (r.contains(mx, my)) { - rolloverOn = true; - fitness += 0.25; - } else { - rolloverOn = false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/NOC_9_04_Faces_interactiveselection.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/NOC_9_04_Faces_interactiveselection.pde deleted file mode 100644 index e85545805..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/NOC_9_04_Faces_interactiveselection.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Interactive Selection -// http://www.genarts.com/karl/papers/siggraph91.html - -Population population; -Button button; - -void setup() { - size(800,200); - colorMode(RGB,1.0); - int popmax = 10; - float mutationRate = 0.05; // A pretty high mutation rate here, our population is rather small we need to enforce variety - // Create a population with a target phrase, mutation rate, and population max - population = new Population(mutationRate,popmax); - // A simple button class - button = new Button(15,150,160,20, "evolve new generation"); -} - -void draw() { - background(1.0); - // Display the faces - population.display(); - population.rollover(mouseX,mouseY); - // Display some text - textAlign(LEFT); - fill(0); - text("Generation #:" + population.getGenerations(),15,190); - - // Display the button - button.display(); - button.rollover(mouseX,mouseY); - -} - -// If the button is clicked, evolve next generation -void mousePressed() { - if (button.clicked(mouseX,mouseY)) { - population.selection(); - population.reproduction(); - } -} - -void mouseReleased() { - button.released(); -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Population.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Population.pde deleted file mode 100644 index 625c6f9d1..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Population.pde +++ /dev/null @@ -1,102 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Interactive Selection -// http://www.genarts.com/karl/papers/siggraph91.html - -// A class to describe a population of faces -// this hasn't changed very much from example to example - -class Population { - - float mutationRate; // Mutation rate - Face[] population; // array to hold the current population - ArrayList matingPool; // ArrayList which we will use for our "mating pool" - int generations; // Number of generations - - // Create the population - Population(float m, int num) { - mutationRate = m; - population = new Face[num]; - matingPool = new ArrayList(); - generations = 0; - for (int i = 0; i < population.length; i++) { - population[i] = new Face(new DNA(), 50+i*75, 60); - } - } - - // Display all faces - void display() { - for (int i = 0; i < population.length; i++) { - population[i].display(); - } - } - - // Are we rolling over any of the faces? - void rollover(int mx, int my) { - for (int i = 0; i < population.length; i++) { - population[i].rollover(mx, my); - } - } - - // Generate a mating pool - void selection() { - // Clear the ArrayList - matingPool.clear(); - - // Calculate total fitness of whole population - float maxFitness = getMaxFitness(); - - // Calculate fitness for each member of the population (scaled to value between 0 and 1) - // Based on fitness, each member will get added to the mating pool a certain number of times - // A higher fitness = more entries to mating pool = more likely to be picked as a parent - // A lower fitness = fewer entries to mating pool = less likely to be picked as a parent - for (int i = 0; i < population.length; i++) { - float fitnessNormal = map(population[i].getFitness(), 0, maxFitness, 0, 1); - int n = (int) (fitnessNormal * 100); // Arbitrary multiplier - for (int j = 0; j < n; j++) { - matingPool.add(population[i]); - } - } - } - - // Making the next generation - void reproduction() { - // Refill the population with children from the mating pool - for (int i = 0; i < population.length; i++) { - // Sping the wheel of fortune to pick two parents - int m = int(random(matingPool.size())); - int d = int(random(matingPool.size())); - // Pick two parents - Face mom = matingPool.get(m); - Face dad = matingPool.get(d); - // Get their genes - DNA momgenes = mom.getDNA(); - DNA dadgenes = dad.getDNA(); - // Mate their genes - DNA child = momgenes.crossover(dadgenes); - // Mutate their genes - child.mutate(mutationRate); - // Fill the new population with the new child - population[i] = new Face(child, 50+i*75, 60); - } - generations++; - } - - int getGenerations() { - return generations; - } - - // Find highest fintess for the population - float getMaxFitness() { - float record = 0; - for (int i = 0; i < population.length; i++) { - if (population[i].getFitness() > record) { - record = population[i].getFitness(); - } - } - return record; - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Rectangle.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Rectangle.pde deleted file mode 100644 index ed6d6d70c..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Rectangle.pde +++ /dev/null @@ -1,25 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Re-implementing java.awt.Rectangle -// so JS mode works - -class Rectangle { - int x; - int y; - int width; - int height; - - Rectangle(int x_, int y_, int w, int h) { - x = x_; - y = y_; - width = w; - height = h; - } - - boolean contains(int px, int py) { - return (px > x && px < x + width && py > y && py < y + height); - } - -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/Bloop.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/Bloop.pde deleted file mode 100644 index 7859b6630..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/Bloop.pde +++ /dev/null @@ -1,108 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Evolution EcoSystem - -// Creature class - -class Bloop { - PVector location; // Location - DNA dna; // DNA - float health; // Life timer - float xoff; // For perlin noise - float yoff; - // DNA will determine size and maxspeed - float r; - float maxspeed; - - // Create a "bloop" creature - Bloop(PVector l, DNA dna_) { - location = l.get(); - health = 200; - xoff = random(1000); - yoff = random(1000); - dna = dna_; - // Gene 0 determines maxspeed and r - // The bigger the bloop, the slower it is - maxspeed = map(dna.genes[0], 0, 1, 15, 0); - r = map(dna.genes[0], 0, 1, 0, 50); - } - - void run() { - update(); - borders(); - display(); - } - - // A bloop can find food and eat it - void eat(Food f) { - ArrayList food = f.getFood(); - // Are we touching any food objects? - for (int i = food.size()-1; i >= 0; i--) { - PVector foodLocation = food.get(i); - float d = PVector.dist(location, foodLocation); - // If we are, juice up our strength! - if (d < r/2) { - health += 100; - food.remove(i); - } - } - } - - // At any moment there is a teeny, tiny chance a bloop will reproduce - Bloop reproduce() { - // asexual reproduction - if (random(1) < 0.0005) { - // Child is exact copy of single parent - DNA childDNA = dna.copy(); - // Child DNA can mutate - childDNA.mutate(0.01); - return new Bloop(location, childDNA); - } - else { - return null; - } - } - - // Method to update location - void update() { - // Simple movement based on perlin noise - float vx = map(noise(xoff),0,1,-maxspeed,maxspeed); - float vy = map(noise(yoff),0,1,-maxspeed,maxspeed); - PVector velocity = new PVector(vx,vy); - xoff += 0.01; - yoff += 0.01; - - location.add(velocity); - // Death always looming - health -= 0.2; - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } - - // Method to display - void display() { - ellipseMode(CENTER); - stroke(0,health); - fill(0, health); - ellipse(location.x, location.y, r, r); - } - - // Death - boolean dead() { - if (health < 0.0) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/DNA.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/DNA.pde deleted file mode 100644 index 807e776a7..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/DNA.pde +++ /dev/null @@ -1,44 +0,0 @@ -// Evolution EcoSystem -// Daniel Shiffman - -// Class to describe DNA -// Has more features for two parent mating (not used in this example) - -class DNA { - - // The genetic sequence - float[] genes; - - // Constructor (makes a random DNA) - DNA() { - // DNA is random floating point values between 0 and 1 (!!) - genes = new float[1]; - for (int i = 0; i < genes.length; i++) { - genes[i] = random(0,1); - } - } - - DNA(float[] newgenes) { - genes = newgenes; - } - - DNA copy() { - float[] newgenes = new float[genes.length]; - //arraycopy(genes,newgenes); - // JS mode not supporting arraycopy - for (int i = 0; i < newgenes.length; i++) { - newgenes[i] = genes[i]; - } - - return new DNA(newgenes); - } - - // Based on a mutation probability, picks a new random character in array spots - void mutate(float m) { - for (int i = 0; i < genes.length; i++) { - if (random(1) < m) { - genes[i] = random(0,1); - } - } - } -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/Food.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/Food.pde deleted file mode 100644 index ea0cb59b1..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/Food.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Evolution EcoSystem - -// A collection of food in the world - -class Food { - ArrayList food; - - Food(int num) { - // Start with some food - food = new ArrayList(); - for (int i = 0; i < num; i++) { - food.add(new PVector(random(width),random(height))); - } - } - - // Add some food at a location - void add(PVector l) { - food.add(l.get()); - } - - // Display the food - void run() { - for (PVector f : food) { - rectMode(CENTER); - stroke(0); - fill(175); - rect(f.x,f.y,8,8); - } - - // There's a small chance food will appear randomly - if (random(1) < 0.001) { - food.add(new PVector(random(width),random(height))); - } - } - - // Return the list of food - ArrayList getFood() { - return food; - } -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/NOC_9_05_EvolutionEcosystem.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/NOC_9_05_EvolutionEcosystem.pde deleted file mode 100644 index f273cfd68..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/NOC_9_05_EvolutionEcosystem.pde +++ /dev/null @@ -1,37 +0,0 @@ -// Evolution EcoSystem -// Daniel Shiffman -// The Nature of Code - -// A World of creatures that eat food -// The more they eat, the longer they survive -// The longer they survive, the more likely they are to reproduce -// The bigger they are, the easier it is to land on food -// The bigger they are, the slower they are to find food -// When the creatures die, food is left behind - - -World world; - -void setup() { - size(640, 360); - // World starts with 20 creatures - // and 20 pieces of food - world = new World(20); - smooth(); -} - -void draw() { - background(255); - world.run(); -} - -// We can add a creature manually if we so desire -void mousePressed() { - world.born(mouseX,mouseY); -} - -void mouseDragged() { - world.born(mouseX,mouseY); -} - - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/World.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/World.pde deleted file mode 100644 index c0789604d..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/World.pde +++ /dev/null @@ -1,56 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Evolution EcoSystem - -// The World we live in -// Has bloops and food - -class World { - - ArrayList bloops; // An arraylist for all the creatures - Food food; - - // Constructor - World(int num) { - // Start with initial food and creatures - food = new Food(num); - bloops = new ArrayList(); // Initialize the arraylist - for (int i = 0; i < num; i++) { - PVector l = new PVector(random(width),random(height)); - DNA dna = new DNA(); - bloops.add(new Bloop(l,dna)); - } - } - - // Make a new creature - void born(float x, float y) { - PVector l = new PVector(x,y); - DNA dna = new DNA(); - bloops.add(new Bloop(l,dna)); - } - - // Run the world - void run() { - // Deal with food - food.run(); - - // Cycle through the ArrayList backwards b/c we are deleting - for (int i = bloops.size()-1; i >= 0; i--) { - // All bloops run and eat - Bloop b = bloops.get(i); - b.run(); - b.eat(food); - // If it's dead, kill it and make food - if (b.dead()) { - bloops.remove(i); - food.add(b.location); - } - // Perhaps this bloop would like to make a baby? - Bloop child = b.reproduce(); - if (child != null) bloops.add(child); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/bruteforce/bruteforce.pde b/java/examples/Books/Nature of Code/chp9_ga/bruteforce/bruteforce.pde deleted file mode 100644 index d502a7151..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/bruteforce/bruteforce.pde +++ /dev/null @@ -1,18 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -int now = millis(); - -int passedTime = millis() - now; -int count = 0; -while (passedTime < 1000) { - for (int i = 0; i < 33; i++) { - float r = random(27); - } - count++; - passedTime = millis() - now; -} -println(count); - - diff --git a/java/examples/Books/Nature of Code/introduction/Exercise_I_10_NoiseLandscape/Exercise_I_10_NoiseLandscape.pde b/java/examples/Books/Nature of Code/introduction/Exercise_I_10_NoiseLandscape/Exercise_I_10_NoiseLandscape.pde deleted file mode 100644 index aae2bf669..000000000 --- a/java/examples/Books/Nature of Code/introduction/Exercise_I_10_NoiseLandscape/Exercise_I_10_NoiseLandscape.pde +++ /dev/null @@ -1,32 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Landscape with height values according to Perlin noise - -Landscape land; -float theta = 0.0; - -void setup() { - - size(800,200,P3D); - - // Create a landscape object - land = new Landscape(20,800,400); -} - -void draw() { - - // Ok, visualize the landscape space - background(255); - pushMatrix(); - translate(width/2,height/2+20,-160); - rotateX(PI/3); - rotateZ(theta); - land.render(); - popMatrix(); - - land.calculate(); - - theta += 0.0025; -} diff --git a/java/examples/Books/Nature of Code/introduction/Exercise_I_10_NoiseLandscape/Landscape.pde b/java/examples/Books/Nature of Code/introduction/Exercise_I_10_NoiseLandscape/Landscape.pde deleted file mode 100644 index 661e5502d..000000000 --- a/java/examples/Books/Nature of Code/introduction/Exercise_I_10_NoiseLandscape/Landscape.pde +++ /dev/null @@ -1,67 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// "Landscape" example - -class Landscape { - - int scl; // size of each cell - int w, h; // width and height of thingie - int rows, cols; // number of rows and columns - float zoff = 0.0; // perlin noise argument - float[][] z; // using an array to store all the height values - - Landscape(int scl_, int w_, int h_) { - scl = scl_; - w = w_; - h = h_; - cols = w/scl; - rows = h/scl; - z = new float[cols][rows]; - } - - - // Calculate height values (based off a neural netork) - void calculate() { - float xoff = 0; - for (int i = 0; i < cols; i++) - { - float yoff = 0; - for (int j = 0; j < rows; j++) - { - z[i][j] = map(noise(xoff, yoff,zoff), 0, 1, -120, 120); - yoff += 0.1; - } - xoff += 0.1; - } - zoff+=0.01; - } - - // Render landscape as grid of quads - void render() { - // Every cell is an individual quad - // (could use quad_strip here, but produces funny results, investigate this) - for (int x = 0; x < z.length-1; x++) - { - for (int y = 0; y < z[x].length-1; y++) - { - // one quad at a time - // each quad's color is determined by the height value at each vertex - // (clean this part up) - stroke(0); - fill(100, 100); - pushMatrix(); - beginShape(QUADS); - translate(x*scl-w/2, y*scl-h/2, 0); - vertex(0, 0, z[x][y]); - vertex(scl, 0, z[x+1][y]); - vertex(scl, scl, z[x+1][y+1]); - vertex(0, scl, z[x][y+1]); - endShape(); - popMatrix(); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/Exercise_I_1_WalkerTendsToDownRight/Exercise_I_1_WalkerTendsToDownRight.pde b/java/examples/Books/Nature of Code/introduction/Exercise_I_1_WalkerTendsToDownRight/Exercise_I_1_WalkerTendsToDownRight.pde deleted file mode 100644 index e1c34a553..000000000 --- a/java/examples/Books/Nature of Code/introduction/Exercise_I_1_WalkerTendsToDownRight/Exercise_I_1_WalkerTendsToDownRight.pde +++ /dev/null @@ -1,20 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(800,200); - // Create a walker object - w = new Walker(); - background(255); -} - -void draw() { - // Run the walker object - w.step(); - w.render(); -} - - diff --git a/java/examples/Books/Nature of Code/introduction/Exercise_I_1_WalkerTendsToDownRight/Walker.pde b/java/examples/Books/Nature of Code/introduction/Exercise_I_1_WalkerTendsToDownRight/Walker.pde deleted file mode 100644 index 42a020bce..000000000 --- a/java/examples/Books/Nature of Code/introduction/Exercise_I_1_WalkerTendsToDownRight/Walker.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker object! - -class Walker { - int x,y; - - Walker() { - x = width/2; - y = height/2; - } - - void render() { - stroke(0); - strokeWeight(2); - point(x,y); - } - - // Randomly move up, down, left, right, or stay in one place - void step() { - - float r = random(1); - // A 40% of moving to the right! - if (r < 0.4) { - x++; - } else if (r < 0.5) { - x--; - } else if (r < 0.9) { - y++; - } else { - y--; - } - - x = constrain(x,0,width-1); - y = constrain(y,0,height-1); - } -} diff --git a/java/examples/Books/Nature of Code/introduction/Exercise_I_9_Noise3D/Exercise_I_9_Noise3D.pde b/java/examples/Books/Nature of Code/introduction/Exercise_I_9_Noise3D/Exercise_I_9_Noise3D.pde deleted file mode 100644 index 3b839de9c..000000000 --- a/java/examples/Books/Nature of Code/introduction/Exercise_I_9_Noise3D/Exercise_I_9_Noise3D.pde +++ /dev/null @@ -1,47 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float increment = 0.01; -// The noise function's 3rd argument, a global variable that increments once per cycle -float zoff = 0.0; -// We will increment zoff differently than xoff and yoff -float zincrement = 0.02; - -void setup() { - size(200,200); -} - -void draw() { - background(0); - - // Optional: adjust noise detail here - // noiseDetail(8,0.65f); - - loadPixels(); - - float xoff = 0.0; // Start xoff at 0 - - // For every x,y coordinate in a 2D space, calculate a noise value and produce a brightness value - for (int x = 0; x < width; x++) { - xoff += increment; // Increment xoff - float yoff = 0.0; // For every xoff, start yoff at 0 - for (int y = 0; y < height; y++) { - yoff += increment; // Increment yoff - - // Calculate noise and scale by 255 - float bright = noise(xoff,yoff,zoff)*255; - - // Try using this line instead - //float bright = random(0,255); - - // Set each pixel onscreen to a grayscale value - pixels[x+y*width] = color(bright,bright,bright); - } - } - updatePixels(); - - zoff += zincrement; // Increment zoff - - -} diff --git a/java/examples/Books/Nature of Code/introduction/Figure_I_2_BellCurve/Figure_I_2_BellCurve.pde b/java/examples/Books/Nature of Code/introduction/Figure_I_2_BellCurve/Figure_I_2_BellCurve.pde deleted file mode 100644 index af69b84fd..000000000 --- a/java/examples/Books/Nature of Code/introduction/Figure_I_2_BellCurve/Figure_I_2_BellCurve.pde +++ /dev/null @@ -1,38 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float[] heights; - -void setup() { - size(400, 200); - smooth(); -} - -void draw() { - background(255); - float e = 2.71828183; //"e", see http://mathforum.org/dr.math/faq/faq.e.html for more info - float[] heights = new float[width]; //use an array to store all the "y" values - float m = 0; //default mean of 0 - float sd = map(mouseX,0,width,0.4,2); //standard deviation based on mouseX - for (int i = 0; i < heights.length; i++) { - float xcoord = map(i,0,width,-3,3); - float sq2pi = sqrt(2*PI); //square root of 2 * PI - float xmsq = -1*(xcoord-m)*(xcoord-m); //-(x - mu)^2 - float sdsq = sd*sd; //variance (standard deviation squared) - heights[i] = (1 / (sd * sq2pi)) * (pow(e, (xmsq/sdsq))); //P(x) function - } - - // a little for loop that draws a line between each point on the graph - stroke(0); - strokeWeight(2); - noFill(); - beginShape(); - for (int i = 0; i < heights.length-1; i++) { - float x = i; - float y = map(heights[i], 0, 1, height-2, 2); - vertex(x, y); - } - endShape(); -} - diff --git a/java/examples/Books/Nature of Code/introduction/Figure_I_5_Noise1DGraph/Figure_I_5_Noise1DGraph.pde b/java/examples/Books/Nature of Code/introduction/Figure_I_5_Noise1DGraph/Figure_I_5_Noise1DGraph.pde deleted file mode 100644 index 1d3dc21d8..000000000 --- a/java/examples/Books/Nature of Code/introduction/Figure_I_5_Noise1DGraph/Figure_I_5_Noise1DGraph.pde +++ /dev/null @@ -1,28 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// TIME -float t = 0.0; - -void setup() { - size(400,200); - smooth(); -} - - -void draw() { - background(255); - float xoff = t; - noFill(); - stroke(0); - strokeWeight(2); - beginShape(); - for (int i = 0; i < width; i++) { - float y = noise(xoff)*height; - xoff += 0.01; - vertex(i,y); - } - endShape(); - t+= 0.01; -} diff --git a/java/examples/Books/Nature of Code/introduction/Figure_I_6_RandomGraph/Figure_I_6_RandomGraph.pde b/java/examples/Books/Nature of Code/introduction/Figure_I_6_RandomGraph/Figure_I_6_RandomGraph.pde deleted file mode 100644 index fad4fe2d7..000000000 --- a/java/examples/Books/Nature of Code/introduction/Figure_I_6_RandomGraph/Figure_I_6_RandomGraph.pde +++ /dev/null @@ -1,23 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -void setup() { - size(400,200); - smooth(); -} - - -void draw() { - background(255); - noFill(); - stroke(0); - strokeWeight(2); - beginShape(); - for (int i = 0; i < width; i++) { - float y = random(height); - vertex(i,y); - } - endShape(); - noLoop(); -} diff --git a/java/examples/Books/Nature of Code/introduction/Gaussian2/Gaussian2.pde b/java/examples/Books/Nature of Code/introduction/Gaussian2/Gaussian2.pde deleted file mode 100644 index 50eb81f69..000000000 --- a/java/examples/Books/Nature of Code/introduction/Gaussian2/Gaussian2.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Random generator; - -void setup() { - size(200,200); - background(0); - generator = new Random(); -} - -void draw() { - //create an alpha blended background - fill(0,1); - rect(0,0,width,height); - - //get 3 gaussian random numbers w/ mean of 0 and standard deviation of 1.0 - float r = (float) generator.nextGaussian(); - float g = (float) generator.nextGaussian(); - float b = (float) generator.nextGaussian(); - - //define standard deviation and mean - float sd = 100; float mean = 100; - //scale by standard deviation and mean - //also constrain to between (0,255) since we are dealing with color - r = constrain((r * sd) + mean,0,255); - - //repeat for g & b - sd = 20; mean = 200; - g = constrain((g * sd) + mean,0,255); - sd = 50; mean = 0; - b = constrain((b * sd) + mean,0,255); - - //get more gaussian numbers, this time for location - float xloc = (float) generator.nextGaussian(); - float yloc = (float) generator.nextGaussian(); - sd = width/10; - mean = width/2; - xloc = ( xloc * sd ) + mean; - yloc = ( yloc * sd ) + mean; - - //draw an ellipse with gaussian generated color and location - noStroke(); - fill(r,g,b); - ellipse(xloc,yloc,8,8); -} - diff --git a/java/examples/Books/Nature of Code/introduction/MonteCarloDistribution/MonteCarloDistribution.pde b/java/examples/Books/Nature of Code/introduction/MonteCarloDistribution/MonteCarloDistribution.pde deleted file mode 100644 index ea68bef4b..000000000 --- a/java/examples/Books/Nature of Code/introduction/MonteCarloDistribution/MonteCarloDistribution.pde +++ /dev/null @@ -1,65 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float[] vals; // Array to count how often a random # is picked -float[] norms; // Normalized version of above - -void setup() { - size(200, 200); - vals = new float[width]; - norms = new float[width]; -} - -void draw() { - background(100); - - // Pick a random number between 0 and 1 based on custom probability function - float n = montecarlo(); - - // What spot in the array did we pick - int index = int(n*width); - vals[index]++; - stroke(255); - - boolean normalization = false; - float maxy = 0.0; - - // Draw graph based on values in norms array - // If a value is greater than the height, set normalization to true - for (int x = 0; x < vals.length; x++) { - line(x, height, x, height-norms[x]); - if (vals[x] > height) normalization = true; - if (vals[x] > maxy) maxy = vals[x]; - } - - // If normalization is true then normalize to height - // Otherwise, just copy the info - for (int x = 0; x < vals.length; x++) { - if (normalization) norms[x] = (vals[x] / maxy) * (height); - else norms[x] = vals[x]; - } -} - -// An algorithm for picking a random number based on monte carlo method -// Here probability is determined by formula y = x -float montecarlo() { - // Have we found one yet - boolean foundone = false; - int hack = 0; // let's count just so we don't get stuck in an infinite loop by accident - while (!foundone && hack < 10000) { - // Pick two random numbers - float r1 = (float) random(1); - float r2 = (float) random(1); - float y = r1*r1; // y = x*x (change for different results) - // If r2 is valid, we'll use this one - if (r2 < y) { - foundone = true; - return r1; - } - hack++; - } - // Hack in case we run into a problem (need to improve this) - return 0; -} - diff --git a/java/examples/Books/Nature of Code/introduction/MultipleProbability/MultipleProbability.pde b/java/examples/Books/Nature of Code/introduction/MultipleProbability/MultipleProbability.pde deleted file mode 100644 index 21ac11af4..000000000 --- a/java/examples/Books/Nature of Code/introduction/MultipleProbability/MultipleProbability.pde +++ /dev/null @@ -1,38 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -int x,y; - -void setup() { - size(200,200); - background(0); - smooth(); -} - -void draw() { - //create an alpha blended background - fill(0,1); - rect(0,0,width,height); - - //probabilities for 3 different cases (these need to add up to 100% since something always occurs here!) - float p1 = 0.05; // 5% chance of pure white occurring - float p2 = 0.80 + p1; // 80% chance of gray occuring - //float p3 = 1.0 - p2 ; // 15% chance of black (we don't actually need this line since it is - // by definit n, the "in all other cases" part of our else - float num = random(1); // pick a random number between 0 and 1 - if (num height) normalization = true; - if(vals[x] > maxy) maxy = vals[x]; - } - for (int x = 0; x < vals.length; x++) { - if (normalization) norms[x] = (vals[x] / maxy) * (height); - else norms[x] = vals[x]; - } -} diff --git a/java/examples/Books/Nature of Code/introduction/NoiseWalkAcceleration/NoiseWalkAcceleration.pde b/java/examples/Books/Nature of Code/introduction/NoiseWalkAcceleration/NoiseWalkAcceleration.pde deleted file mode 100644 index 0f516cb1a..000000000 --- a/java/examples/Books/Nature of Code/introduction/NoiseWalkAcceleration/NoiseWalkAcceleration.pde +++ /dev/null @@ -1,22 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(640,360); - // Create a walker object - w = new Walker(); - -} - -void draw() { - background(255); - // Run the walker object - w.walk(); - w.display(); -} - - - diff --git a/java/examples/Books/Nature of Code/introduction/NoiseWalkAcceleration/Walker.pde b/java/examples/Books/Nature of Code/introduction/NoiseWalkAcceleration/Walker.pde deleted file mode 100644 index ebedbbd66..000000000 --- a/java/examples/Books/Nature of Code/introduction/NoiseWalkAcceleration/Walker.pde +++ /dev/null @@ -1,65 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker class! - -class Walker { - PVector location; - PVector velocity; - PVector acceleration; - - ArrayList history; - - PVector noff; - - - Walker() { - location = new PVector(width/2, height/2); - history = new ArrayList(); - noff = new PVector(random(1000), random(1000)); - velocity = new PVector(); - acceleration = new PVector(); - } - - void display() { - stroke(0); - fill(175); - rectMode(CENTER); - rect(location.x, location.y, 16, 16); - - beginShape(); - stroke(0); - noFill(); - for (PVector v: history) { - vertex(v.x, v.y); - } - endShape(); - } - - // Randomly move up, down, left, right, or stay in one place - void walk() { - - - acceleration.x = map(noise(noff.x), 0, 1, -1, 1); - acceleration.y = map(noise(noff.y), 0, 1, -1, 1); - acceleration.mult(0.1); - - noff.add(0.01, 0.01, 0); - - velocity.add(acceleration); - velocity.limit(1); - location.add(velocity); - - - history.add(location.get()); - if (history.size() > 1000) { - history.remove(0); - } - - // Stay on the screen - location.x = constrain(location.x, 0, width-1); - location.y = constrain(location.y, 0, height-1); - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/NoiseWalkVelocity/NoiseWalkVelocity.pde b/java/examples/Books/Nature of Code/introduction/NoiseWalkVelocity/NoiseWalkVelocity.pde deleted file mode 100644 index aaca5448a..000000000 --- a/java/examples/Books/Nature of Code/introduction/NoiseWalkVelocity/NoiseWalkVelocity.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(400,400); - frameRate(30); - - // Create a walker object - w = new Walker(); - -} - -void draw() { - background(255); - // Run the walker object - w.walk(); - w.display(); -} - - - diff --git a/java/examples/Books/Nature of Code/introduction/NoiseWalkVelocity/Walker.pde b/java/examples/Books/Nature of Code/introduction/NoiseWalkVelocity/Walker.pde deleted file mode 100644 index 2749b5095..000000000 --- a/java/examples/Books/Nature of Code/introduction/NoiseWalkVelocity/Walker.pde +++ /dev/null @@ -1,60 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker class! - -class Walker { - PVector location; - PVector velocity; - - ArrayList history; - - PVector noff; - - - Walker() { - location = new PVector(width/2, height/2); - history = new ArrayList(); - noff = new PVector(random(1000), random(1000)); - velocity = new PVector(); - } - - void display() { - stroke(0); - fill(175); - rectMode(CENTER); - rect(location.x, location.y, 16, 16); - - beginShape(); - stroke(0); - noFill(); - for (PVector v: history) { - vertex(v.x, v.y); - } - endShape(); - } - - // Randomly move up, down, left, right, or stay in one place - void walk() { - - - velocity.x = map(noise(noff.x), 0, 1, -1, 1); - velocity.y = map(noise(noff.y), 0, 1, -1, 1); - velocity.mult(5); - - noff.add(0.01, 0.01, 0); - - location.add(velocity); - - history.add(location.get()); - if (history.size() > 1000) { - history.remove(0); - } - - // Stay on the screen - location.x = constrain(location.x, 0, width-1); - location.y = constrain(location.y, 0, height-1); - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/NoiseWalk_Many/NoiseWalk_Many.pde b/java/examples/Books/Nature of Code/introduction/NoiseWalk_Many/NoiseWalk_Many.pde deleted file mode 100644 index 9c37a168a..000000000 --- a/java/examples/Books/Nature of Code/introduction/NoiseWalk_Many/NoiseWalk_Many.pde +++ /dev/null @@ -1,35 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker[] w; - -int total = 0; - -void setup() { - size(600, 400); - - w = new Walker[10]; - for (int i = 0; i < w.length; i++) { - w[i] = new Walker(); - } -} - -void draw() { - background(255); - int o = int(map(mouseX,0,width,1,8)); - noiseDetail(o,0.3); - - if (frameCount % 30 == 0) { - total = total + 1; - if (total > w.length-1) { - total = w.length-1; - } - } - - for (int i = 0; i < total; i++) { - w[i].walk(); - w[i].display(); - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/NoiseWalk_Many/Walker.pde b/java/examples/Books/Nature of Code/introduction/NoiseWalk_Many/Walker.pde deleted file mode 100644 index 19a42fd4a..000000000 --- a/java/examples/Books/Nature of Code/introduction/NoiseWalk_Many/Walker.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker class! - -class Walker { - PVector location; - - PVector noff; - - Walker() { - location = new PVector(width/2, height/2); - noff = new PVector(random(1000),random(1000)); - } - - void display() { - strokeWeight(2); - fill(127); - stroke(0); - ellipse(location.x, location.y, 48, 48); - } - - // Randomly move up, down, left, right, or stay in one place - void walk() { - - location.x = map(noise(noff.x),0,1,0,width); - location.y = map(noise(noff.y),0,1,0,height); - - noff.x += 0.01; - noff.y += 0.01; - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalk/RandomWalk.pde b/java/examples/Books/Nature of Code/introduction/RandomWalk/RandomWalk.pde deleted file mode 100644 index 7832e2b77..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalk/RandomWalk.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(400,400); - frameRate(30); - - // Create a walker object - w = new Walker(); - -} - -void draw() { - background(255); - // Run the walker object - w.walk(); - w.render(); -} - - - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalk/Walker.pde b/java/examples/Books/Nature of Code/introduction/RandomWalk/Walker.pde deleted file mode 100644 index 55d0dc60a..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalk/Walker.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker class! - -class Walker { - float x, y; - - Walker() { - x = width/2; - y = height/2; - } - - void render() { - stroke(0); - fill(175); - rectMode(CENTER); - rect(x, y, 40, 40); - } - - // Randomly move up, down, left, right, or stay in one place - void walk() { - float vx = random(-2, 2); - float vy = random(-2, 2); - x += vx; - y += vy; - - // Stay on the screen - x = constrain(x, 0, width-1); - y = constrain(y, 0, height-1); - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkLevy/RandomWalkLevy.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkLevy/RandomWalkLevy.pde deleted file mode 100644 index 32a0d4a54..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkLevy/RandomWalkLevy.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Daniel Shiffman -// The Nature of Code -// http://natureofcode.com - -Walker w; - -void setup() { - size(640,480); - // Create a walker object - w = new Walker(); - background(0); -} - -void draw() { - // Run the walker object - w.step(); - w.render(); -} - - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkLevy/Walker.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkLevy/Walker.pde deleted file mode 100644 index fa48396e2..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkLevy/Walker.pde +++ /dev/null @@ -1,54 +0,0 @@ -// Daniel Shiffman -// The Nature of Code -// http://natureofcode.com - -// A random walker object! - -class Walker { - float x, y; - - float prevX, prevY; - - Walker() { - x = width/2; - y = height/2; - } - - void render() { - stroke(255); - line(prevX,prevY,x, y); - } - - // Randomly move according to floating point values - void step() { - prevX = x; - prevY = y; - - float stepx = random(-1, 1); - float stepy = random(-1, 1); - - float stepsize = montecarlo()*50; - stepx *= stepsize; - stepy *= stepsize; - - x += stepx; - y += stepy; - x = constrain(x, 0, width-1); - y = constrain(y, 0, height-1); - } -} - - -float montecarlo() { - while (true) { - - float r1 = random(1); - float probability = pow(1.0 - r1,8); - - float r2 = random(1); - if (r2 < probability) { - return r1; - } - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkNoise/RandomWalkNoise.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkNoise/RandomWalkNoise.pde deleted file mode 100644 index cb1143921..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkNoise/RandomWalkNoise.pde +++ /dev/null @@ -1,19 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(640,360); - w = new Walker(); - background(0); -} - -void draw() { - // Run the walker object - w.step(); - w.render(); -} - - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkNoise/Walker.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkNoise/Walker.pde deleted file mode 100644 index be8f1b716..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkNoise/Walker.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker object! - -class Walker { - float x, y; - float tx, ty; - - float prevX, prevY; - - Walker() { - tx = 0; - ty = 10000; - x = map(noise(tx), 0, 1, 0, width); - y = map(noise(ty), 0, 1, 0, height); - } - - void render() { - stroke(255); - line(prevX, prevY, x, y); - } - - // Randomly move according to floating point values - void step() { - - prevX = x; - prevY = y; - - x = map(noise(tx), 0, 1, 0, width); - y = map(noise(ty), 0, 1, 0, height); - - tx += 0.01; - ty += 0.01; - - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkPVector/RandomWalkPVector.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkPVector/RandomWalkPVector.pde deleted file mode 100644 index 7832e2b77..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkPVector/RandomWalkPVector.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(400,400); - frameRate(30); - - // Create a walker object - w = new Walker(); - -} - -void draw() { - background(255); - // Run the walker object - w.walk(); - w.render(); -} - - - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkPVector/Walker.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkPVector/Walker.pde deleted file mode 100644 index 27e4f6a22..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkPVector/Walker.pde +++ /dev/null @@ -1,31 +0,0 @@ -// Daniel Shiffman -// The Nature of Code -// http://natureofcode.com - -// A random walker class! - -class Walker { - PVector loc; - - Walker() { - loc = new PVector(width/2,height/2); - } - - void render() { - stroke(0); - fill(175); - rectMode(CENTER); - rect(loc.x,loc.y,40,40); - } - - // Randomly move up, down, left, right, or stay in one place - void walk() { - PVector vel = new PVector(random(-2,2),random(-2,2)); - loc.add(vel); - - // Stay on the screen - loc.x = constrain(loc.x,0,width-1); - loc.y = constrain(loc.y,0,height-1); - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional2/RandomWalkTraditional2.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional2/RandomWalkTraditional2.pde deleted file mode 100644 index 9cb6af8c6..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional2/RandomWalkTraditional2.pde +++ /dev/null @@ -1,20 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(200,200); - // Create a walker object - w = new Walker(); - background(0); -} - -void draw() { - // Run the walker object - w.step(); - w.render(); -} - - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional2/Walker.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional2/Walker.pde deleted file mode 100644 index 856cf0bb5..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional2/Walker.pde +++ /dev/null @@ -1,29 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker object! - -class Walker { - int x,y; - - Walker() { - x = width/2; - y = height/2; - } - - void render() { - stroke(255); - point(x,y); - } - - // Randomly move to any neighboring pixel (or stay in the same spot) - void step() { - int stepx = int(random(3))-1; - int stepy = int(random(3))-1; - x += stepx; - y += stepy; - x = constrain(x,0,width-1); - y = constrain(y,0,height-1); - } -} diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional3/RandomWalkTraditional3.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional3/RandomWalkTraditional3.pde deleted file mode 100644 index 9cb6af8c6..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional3/RandomWalkTraditional3.pde +++ /dev/null @@ -1,20 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(200,200); - // Create a walker object - w = new Walker(); - background(0); -} - -void draw() { - // Run the walker object - w.step(); - w.render(); -} - - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional3/Walker.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional3/Walker.pde deleted file mode 100644 index fdd0271d0..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional3/Walker.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker object! - -class Walker { - float x, y; - - Walker() { - x = width/2; - y = height/2; - } - - void render() { - stroke(255); - point(x, y); - } - - // Randomly move according to floating point values - void step() { - float stepx = random(-1, 1); - float stepy = random(-1, 1); - x += stepx; - y += stepy; - x = constrain(x, 0, width-1); - y = constrain(y, 0, height-1); - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkTrail/RandomWalkTrail.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkTrail/RandomWalkTrail.pde deleted file mode 100644 index aaca5448a..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkTrail/RandomWalkTrail.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(400,400); - frameRate(30); - - // Create a walker object - w = new Walker(); - -} - -void draw() { - background(255); - // Run the walker object - w.walk(); - w.display(); -} - - - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkTrail/Walker.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkTrail/Walker.pde deleted file mode 100644 index d0dddfa8b..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkTrail/Walker.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker class! - -class Walker { - PVector location; - - ArrayList history; - - - Walker() { - location = new PVector(width/2, height/2); - history = new ArrayList(); - } - - void display() { - stroke(0); - fill(175); - rectMode(CENTER); - rect(location.x, location.y, 16, 16); - - beginShape(); - stroke(0); - noFill(); - for (PVector v: history) { - vertex(v.x, v.y); - } - endShape(); - } - - // Randomly move up, down, left, right, or stay in one place - void walk() { - PVector vel = new PVector(random(-2, 2), random(-2, 2)); - location.add(vel); - - // Stay on the screen - location.x = constrain(location.x, 0, width-1); - location.y = constrain(location.y, 0, height-1); - - - history.add(location.get()); - if (history.size() > 1000) { - history.remove(0); - } - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkTrailCurve/RandomWalkTrailCurve.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkTrailCurve/RandomWalkTrailCurve.pde deleted file mode 100644 index 763c3db0d..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkTrailCurve/RandomWalkTrailCurve.pde +++ /dev/null @@ -1,20 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(400, 300); - // Create a walker object - w = new Walker(); -} - -void draw() { - background(255); - - // Run the walker object - w.step(); - w.render(); -} - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkTrailCurve/Walker.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkTrailCurve/Walker.pde deleted file mode 100644 index fc5eba07d..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkTrailCurve/Walker.pde +++ /dev/null @@ -1,42 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker object! - -class Walker { - PVector position; - - ArrayList history = new ArrayList(); - - Walker() { - position = new PVector(width/2, height/2); - } - - void render() { - stroke(0); - beginShape(); - for (PVector v : history) { - curveVertex(v.x, v.y); - } - endShape(); - - noFill(); - stroke(0); - ellipse(position.x, position.y, 16, 16); - } - - // Randomly move up, down, left, right, or stay in one place - void step() { - - position.x += random(-10, 10); - position.y += random(-10, 10); - - - position.x = constrain(position.x, 0, width-1); - position.y = constrain(position.y, 0, height-1); - - history.add(position.get()); - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/SelfAvoidingWalk.pde b/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/SelfAvoidingWalk.pde deleted file mode 100644 index 6e7cbb253..000000000 --- a/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/SelfAvoidingWalk.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Daniel Shiffman -// The Nature of Code -// http://www.shiffman.net/ - -Walker w; - -void setup() { - size(600,400); - // Create a walker object - w = new Walker(); - background(255); -} - -void draw() { - // Run the walker object - w.step(); - w.render(); -} - - diff --git a/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/Walker.pde b/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/Walker.pde deleted file mode 100644 index b36cdf45b..000000000 --- a/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/Walker.pde +++ /dev/null @@ -1,73 +0,0 @@ -// Daniel Shiffman -// The Nature of Code -// http://www.shiffman.net/ - -// A random walker object! - -class Walker { - int x, y; - - boolean[][] grid; - - Walker() { - x = width/2; - y = height/2; - grid = new boolean[width][height]; - } - - void render() { - stroke(0); - line(x,y,x,y); - } - - // Randomly move up, down, left, right, or stay in one place - void step() { - - boolean ok = false; - - int helpme = 0; - - while (!ok) { - - int choice = int(random(4)); - - int saveX = x; - int saveY = y; - - if (choice == 0) { - x++; - } - else if (choice == 1) { - x--; - } - else if (choice == 2) { - y++; - } - else { - y--; - } - - x = constrain(x, 0, width-1); - y = constrain(y, 0, height-1); - - if (grid[x][y] == false) { - ok = true; - grid[x][y] = true; - } - else { - x = saveX; - y = saveY; - } - - - helpme++; - - if (helpme > 1000) { - println("STUCK"); - noLoop(); - ok = true; - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/goal.svg b/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/goal.svg deleted file mode 100644 index 62563a04d..000000000 --- a/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/goal.svg +++ /dev/null @@ -1,2353 +0,0 @@ - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/introduction/SimpleProbablility/SimpleProbablility.pde b/java/examples/Books/Nature of Code/introduction/SimpleProbablility/SimpleProbablility.pde deleted file mode 100644 index d3d5511be..000000000 --- a/java/examples/Books/Nature of Code/introduction/SimpleProbablility/SimpleProbablility.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -int x,y; - -void setup() { - size(200,200); - background(0); - smooth(); -} - -void draw() { - //create an alpha blended background - fill(0,1); - rect(0,0,width,height); - - //calculate a probability between 0 and 100% based on mouseX location - float prob = (mouseX / (float) width); - - //get a random floating point value between 0 and 1 - float r = random(1); - - //test the random value against the probability and trigger an event - if (r < prob) { - noStroke(); - fill(255); - ellipse(x,y,10,10); - } - - // X and Y walk through a grid - x = (x + 10) % width; - if (x == 0) y = (y + 10) % width; -} diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_01/Ex_01.pde deleted file mode 100755 index 4b29336b7..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_01/Ex_01.pde +++ /dev/null @@ -1,3 +0,0 @@ -// The expression 4 + 5 evaluates to 9, then the -// value 9 is assigned to the variable x -int x = 4 + 5; \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_02/Ex_02.pde deleted file mode 100755 index 2d9c2fff9..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_02/Ex_02.pde +++ /dev/null @@ -1,4 +0,0 @@ -// The expression 5 * 10 evaluates to 50, then the -// expression 4 + 50 evaluates to 54, then the -// value 54 is then assigned to the variable x -int x = 4 + 5 * 10; \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_03/Ex_03.pde deleted file mode 100755 index 5adf4599e..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -// The expression 4 + 5 evaluates to 9, then the -// expression 9 * 10 evaluates to 90, then the -// value 90 is assigned to the variable x -int x = (4 + 5) * 10; \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_04/Ex_04.pde deleted file mode 100755 index 8e91ed6a5..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_04/Ex_04.pde +++ /dev/null @@ -1,4 +0,0 @@ -float w = 12.0 - 6.0 + 3.0; // Assigns 9 to w -float x = 3.0 + 6.0 / 12.0; // Assigns 3.5 to x -float y = 12.0 / 6.0 * 3.0; // Assigns 6 to y -float z = 3.0 * 6.0 / 12.0; // Assigns 1.5 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix B/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix B/Ex_01/Ex_01.pde deleted file mode 100644 index ca4ac5adb..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix B/Ex_01/Ex_01.pde +++ /dev/null @@ -1,2 +0,0 @@ -float int = 50; // ERROR! Unexpected token: float -line(int, 0, int, 100); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix B/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix B/Ex_02/Ex_02.pde deleted file mode 100644 index 943b6a544..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix B/Ex_02/Ex_02.pde +++ /dev/null @@ -1,2 +0,0 @@ -int line = 50; // This does not create a program error -line(line, 0, line, 100); // but it's very confusing \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix D/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix D/Ex_01/Ex_01.pde deleted file mode 100644 index d9dbe821d..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix D/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -int a = 205; // In binary: 00000000000000000000000011001101 -int b = 45; // In binary: 00000000000000000000000000101101 -a = a << 24; // Converts to 11001101000000000000000000000000 -b = b << 8; // Converts to 00000000000000000010110100000000 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_01/Ex_01.pde deleted file mode 100644 index 16482ecfd..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_01/Ex_01.pde +++ /dev/null @@ -1,6 +0,0 @@ -color c = color(204, 153, 102, 255); -float r = (c >> 16) & 0xFF; // Faster version of red(c) -float g = (c >> 8) & 0xFF; // Faster version of green(c) -float b = c & 0xFF; // Faster version of blue(c) -float a = (c >> 24) & 0xFF; // Faster version of alpha(c) -println(r + ", " + g + ", " + b + ", " + a); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_02/Ex_02.pde deleted file mode 100644 index b708d9097..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_02/Ex_02.pde +++ /dev/null @@ -1,5 +0,0 @@ -int a = 255; -int r = 102; -int g = 51; -int b = 255; -color c = (a << 24) | (r << 16) | (g << 8) | b; \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_03/Ex_03.pde deleted file mode 100644 index c4d3f97d3..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_03/Ex_03.pde +++ /dev/null @@ -1,5 +0,0 @@ -// AVOID loading an image within draw(), it is slow -void draw() { - PImage img = loadImage("tower.jpg"); - image(img, 0, 0); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_04/Ex_04.pde deleted file mode 100644 index 14db1cb30..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_04/Ex_04.pde +++ /dev/null @@ -1,5 +0,0 @@ -// AVOID creating an array inside draw(), it is slow -void draw() { - int[] values = new int[200]; - // Do something with the array here -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_05/Ex_05.pde deleted file mode 100644 index 5525bdb18..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_05/Ex_05.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Converts (x,y) coordinates into a position in the pixels[] array -loadPixels(); -for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - pixels[y*height + x] = color(102); - } -} -updatePixels(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_06/Ex_06.pde deleted file mode 100644 index a3d95a9de..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_06/Ex_06.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Replaces the multiplication y*height with an addition -int offset = 0; -loadPixels(); -for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - pixels[offset + x] = color(102); - } - offset += width; // Avoids the multiply -} -updatePixels(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_07/Ex_07.pde deleted file mode 100644 index bac1a3f05..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_07/Ex_07.pde +++ /dev/null @@ -1,9 +0,0 @@ -// Avoid the calculation y*height+width -int index = 0; -loadPixels(); -for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - pixels[index++] = color(102); - } -} -updatePixels(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_08/Ex_08.pde deleted file mode 100644 index 2ef67c770..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_08/Ex_08.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Avoids (x,y) coordinates -int wh = width*height; -loadPixels(); -for (int index = 0; index < wh; index++) { - pixels[index] = color(102); -} -updatePixels(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_09/Ex_09.pde deleted file mode 100644 index cd0949c3e..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_09/Ex_09.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Only calculate the color once -int wh = width*height; -color c = color(102); -loadPixels(); -for (int index = 0; index < wh; index++) { - pixels[index] = c; -} -updatePixels(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_10/Ex_10.pde deleted file mode 100644 index 8e22c85cc..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_10/Ex_10.pde +++ /dev/null @@ -1,17 +0,0 @@ -int res = 16; // Number of data elements -float[] x = new float[res]; // Create x-coordinate array -float[] y = new float[res]; // Create y-coordinate array - -void setup() { - size(100, 100); - for (int i = 0; i < res; i++) { - x[i] = cos(PI/res * i); // Sets x-coordinates - y[i] = sin(PI/res * i); // Sets y-coordinates - } -} - -void draw() { - for (int i = 0; i < res; i++) { // Access each point - point(50 + x[i]*40, 50 + y[i]*40); // Draws point on a curve - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_01/Ex_01.pde deleted file mode 100755 index 7ecd97454..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_01/Ex_01.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Rotate a rectangle around the y-axis and x-axis -void setup() { - size(400, 400, P3D); - fill(204); -} - -void draw() { - background(0); - translate(width / 2, height / 2, -width); - rotateY(map(mouseX, 0, width, -PI, PI)); - rotateX(map(mouseY, 0, height, -PI, PI)); - noStroke(); - rect(-200, -200, 400, 400); - stroke(255); - line(0, 0, -200, 0, 0, 200); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_02/Ex_02.pde deleted file mode 100755 index 290b6bc36..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_02/Ex_02.pde +++ /dev/null @@ -1,22 +0,0 @@ -// Draw a sphere on top of a box and moves the coordinates with the mouse -// Press a mouse button to turn on the lights -void setup() { - size(400, 400, P3D); -} - -void draw() { - background(0); - if (mousePressed == true) { // If the mouse is pressed, - lights(); // turn on lights - } - noStroke(); - pushMatrix(); - translate(mouseX, mouseY, -500); - rotateY(PI / 6); // Rotate around y-axis - box(400, 100, 400); // Draw box - pushMatrix(); - popMatrix(); - translate(0, -200, 0); // Position the sphere - sphere(150); // Draw sphere on top of box - popMatrix(); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_03/Ex_03.pde deleted file mode 100755 index f0b73f079..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_03/Ex_03.pde +++ /dev/null @@ -1,61 +0,0 @@ -// Draw a cylinder centered on the y-axis, going down from y=0 to y=height. -// The radius at the top can be different from the radius at the bottom, -// and the number of sides drawn is variable. - -void setup() { - size(400, 400, P3D); -} - -void draw() { - background(0); - lights(); - translate(width / 2, height / 2); - rotateY(map(mouseX, 0, width, 0, PI)); - rotateZ(map(mouseY, 0, height, 0, -PI)); - noStroke(); - fill(255, 255, 255); - translate(0, -40, 0); - drawCylinder(10, 180, 200, 16); // Draw a mix between a cylinder and a cone -//drawCylinder(70, 70, 120, 64); // Draw a cylinder -//drawCylinder(0, 180, 200, 4); // Draw a pyramid -} - -void drawCylinder(float topRadius, float bottomRadius, float tall, int sides) { - float angle = 0; - float angleIncrement = TWO_PI / sides; - beginShape(QUAD_STRIP); - for (int i = 0; i < sides + 1; ++i) { - vertex(topRadius*cos(angle), 0, topRadius*sin(angle)); - vertex(bottomRadius*cos(angle), tall, bottomRadius*sin(angle)); - angle += angleIncrement; - } - endShape(); - - // If it is not a cone, draw the circular top cap - if (topRadius != 0) { - angle = 0; - beginShape(TRIANGLE_FAN); - - // Center point - vertex(0, 0, 0); - for (int i = 0; i < sides + 1; i++) { - vertex(topRadius * cos(angle), 0, topRadius * sin(angle)); - angle += angleIncrement; - } - endShape(); - } - - // If it is not a cone, draw the circular bottom cap - if (bottomRadius != 0) { - angle = 0; - beginShape(TRIANGLE_FAN); - - // Center point - vertex(0, tall, 0); - for (int i = 0; i < sides + 1; i++) { - vertex(bottomRadius * cos(angle), tall, bottomRadius * sin(angle)); - angle += angleIncrement; - } - endShape(); - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_04/Ex_04.pde deleted file mode 100755 index 870329256..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_04/Ex_04.pde +++ /dev/null @@ -1,41 +0,0 @@ -// Export a DXF file when the R key is pressed -import processing.dxf.*; -boolean record = false; - -void setup() { - size(400, 400, P3D); - noStroke(); - sphereDetail(12); -} - -void draw() { - if (record == true) { - beginRaw(DXF, "output.dxf"); // Start recording to the file - } - lights(); - background(0); - translate(width / 3, height / 3, -200); - rotateZ(map(mouseY, 0, height, 0, PI)); - rotateY(map(mouseX, 0, width, 0, HALF_PI)); - for (int y = -2; y < 2; y++) { - for (int x = -2; x < 2; x++) { - for (int z = -2; z < 2; z++) { - pushMatrix(); - translate(120*x, 120*y, -120*z); - sphere(30); - popMatrix(); - } - } - } - if (record == true) { - endRaw(); - record = false; // Stop recording to the file - } -} - -void keyPressed() { - if (key == 'R' || key == 'r') { // Press R to save the file - record = true; - } -} - diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_05/Ex_05.pde deleted file mode 100755 index 526632607..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_05/Ex_05.pde +++ /dev/null @@ -1,24 +0,0 @@ -// Import and display an OBJ model -// requires OBJ loader from: http://users.design.ucla.edu/%7Etatsuyas/tools/objloader/index.htm -import saito.objloader.*; -OBJModel model; - -void setup() { - size(400, 400, P3D); - model = new OBJModel(this); - model.load("chair.obj"); // Model must be in the data directory - model.drawMode(POLYGON); - noStroke(); -} - -void draw() { - background(0); - lights(); - pushMatrix(); - translate(width / 2, height, -width); - rotateY(map(mouseX, 0, width, -PI, PI)); - rotateX(PI / 4); - scale(6.0); - model.draw(); - popMatrix(); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_05/data/chair.obj b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_05/data/chair.obj deleted file mode 100755 index e5d68177d..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_05/data/chair.obj +++ /dev/null @@ -1,418 +0,0 @@ -# Max2Obj Version 6.0 Jul 29th, 2003 -# -# object Zidle_A_01 to come ... -# -v 25.899904251099 23.408611297607 -0.629936158657 -v 25.836200714111 25.364303588867 -0.263177931309 -v 27.800601959229 25.365760803223 0.069837525487 -v 27.862743377686 23.408617019653 -0.297489136457 -v 18.490375518799 14.684046745300 47.418430328369 -v 18.440059661865 16.955835342407 47.789150238037 -v 20.043802261353 16.503309249878 49.659057617188 -v 20.093072891235 14.531045913696 49.332595825195 -v -16.846343994141 14.688239097595 46.918945312500 -v -16.802133560181 16.952724456787 47.287803649902 -v -18.368827819824 16.504928588867 49.132251739502 -v -18.412220001221 14.528832435608 48.805358886719 -v -25.921289443970 23.417802810669 -0.664852082729 -v -25.860712051392 25.372976303101 -0.295692503452 -v -27.811634063721 25.357145309448 0.108631089330 -v -27.870645523071 23.400211334229 -0.261199921370 -v 25.899911880493 -23.408607482910 -0.629936039448 -v 18.490377426147 -14.684038162231 47.418426513672 -v 18.440063476563 -16.955827713013 47.789150238037 -v 25.836208343506 -25.364299774170 -0.263179510832 -v 20.043806076050 -16.503301620483 49.659053802490 -v 27.800609588623 -25.365755081177 0.069835931063 -v 20.093074798584 -14.531042098999 49.332595825195 -v 27.862751007080 -23.408609390259 -0.297488987446 -v -16.846340179443 -14.688243865967 46.918941497803 -v -16.802129745483 -16.952732086182 47.287799835205 -v -18.368824005127 -16.504932403564 49.132247924805 -v -18.412216186523 -14.528839111328 48.805355072021 -v -25.921281814575 -23.417812347412 -0.664851963520 -v -25.860704421997 -25.372985839844 -0.295694082975 -v -27.811626434326 -25.357158660889 0.108629494905 -v -27.870637893677 -23.400218963623 -0.261199772358 -v -18.623430252075 16.727024078369 47.560352325439 -v -16.677518844604 16.706054687500 47.985088348389 -v -16.678075790405 14.717395782471 47.891605377197 -v -18.623422622681 14.736910820007 47.466884613037 -v -27.272499084473 15.222574234009 84.866127014160 -v -25.269447326660 15.205821037292 85.282051086426 -v -24.996809005737 13.190135955811 84.316917419434 -v -27.163030624390 13.216644287109 83.865890502930 -v -28.435161590576 9.060468673706 90.615600585938 -v -26.399826049805 9.061535835266 91.022407531738 -v -25.888158798218 8.663914680481 88.721542358398 -v -28.023075103760 8.663537025452 88.295997619629 -v -27.277370452881 -14.577423095703 84.897369384766 -v -25.276775360107 -14.559969902039 85.312210083008 -v -24.988948822021 -12.567503929138 84.289779663086 -v -27.159948348999 -12.594882965088 83.838508605957 -v -18.626295089722 -16.608646392822 47.575656890869 -v -16.680219650269 -16.586662292480 48.000041961670 -v -16.675401687622 -14.599632263184 47.876705169678 -v -18.620721817017 -14.620159149170 47.452362060547 -v -28.497978210449 -7.499320507050 90.926193237305 -v -26.461677551270 -7.500489711761 91.333389282227 -v -25.948324203491 -7.194749355316 89.017547607422 -v -28.081348419189 -7.194259643555 88.592170715332 -v -28.929925918579 0.780594170094 93.339157104492 -v -26.910228729248 0.780539214611 93.742111206055 -v -26.363113403320 0.734772324562 91.350273132324 -v -28.515964508057 0.734819710255 90.918952941895 -v 19.686010360718 14.649426460266 47.787284851074 -v -17.228097915649 14.649420738220 47.787284851074 -v 19.686014175415 -14.441827774048 47.787284851074 -v -17.228094100952 -14.441833496094 47.787284851074 -v 19.686010360718 14.649426460266 48.887374877930 -v -17.228097915649 14.649420738220 48.887374877930 -v 19.686014175415 -14.441827774048 48.887374877930 -v -17.228094100952 -14.441833496094 48.887374877930 -v 19.105789184570 14.173642158508 49.527408599854 -v -16.647876739502 14.173636436462 49.527408599854 -v -16.647872924805 -13.966049194336 49.527408599854 -v 19.105792999268 -13.966043472290 49.527408599854 -v 12.830347061157 9.088206291199 49.338916778564 -v -10.372433662415 9.088202476501 49.338916778564 -v -10.372431755066 -8.880614280701 49.338916778564 -v 12.830348968506 -8.880610466003 49.338916778564 -v 22.474662780762 4.952341556549 44.959941864014 -v 22.474662780762 -4.744742870331 44.959941864014 -v 23.136726379395 -4.744740962982 45.838500976563 -v 23.136726379395 4.952343463898 45.838500976563 -v 23.058534622192 -4.586146831512 46.698844909668 -v 23.058536529541 4.793749332428 46.698841094971 -v 16.227718353271 -2.891003131866 49.338916778564 -v 16.227716445923 3.098601818085 49.338916778564 -v -26.214628219604 -13.175243377686 83.052528381348 -v -19.325101852417 -14.434352874756 53.286815643311 -v -26.214639663696 13.382827758789 83.052528381348 -v -19.325113296509 14.641944885254 53.286819458008 -v -25.143526077271 -13.175243377686 83.303398132324 -v -18.253999710083 -14.434352874756 53.537693023682 -v -25.143537521362 13.382827758789 83.303405761719 -v -18.254011154175 14.641945838928 53.537693023682 -v -24.388038635254 -12.740889549255 82.884429931641 -v -17.763151168823 -13.958812713623 54.248584747314 -v -17.763162612915 14.166405677795 54.248584747314 -v -24.388048171997 12.948475837708 82.884429931641 -v -22.705802917480 -8.098277091980 76.833168029785 -v -18.943153381348 -8.875991821289 60.417484283447 -v -18.943161010742 9.083584785461 60.417484283447 -v -22.705812454224 8.305867195129 76.833168029785 -v -26.989404678345 -4.322551250458 86.360374450684 -v -26.989406585693 4.530138492584 86.360374450684 -v -25.918304443359 4.530136585236 86.611251831055 -v -25.918302536011 -4.322553157806 86.611244201660 -v -25.162815093994 4.385353565216 86.192276000977 -v -25.162813186646 -4.177768230438 86.192276000977 -v -23.480581283569 2.837816715240 80.141014099121 -v -23.480579376221 -2.630231380463 80.141014099121 -v -19.325109481812 4.949844360352 53.286819458008 -v -19.325107574463 -4.742256164551 53.286819458008 -v -18.254005432129 -4.742254257202 53.537693023682 -v -18.254007339478 4.949846267700 53.537693023682 -v -17.763156890869 -4.583739757538 54.248584747314 -v -17.763158798218 4.791332721710 54.248584747314 -v -18.943157196045 -2.889466762543 60.417484283447 -v -18.943159103394 3.097059726715 60.417484283447 -# 116 vertices - -vt -24.983833312988 -26.063531875610 -0.694362461567 -vt -24.938697814941 -25.800083160400 0.694362521172 -vt -26.332603454590 -25.561277389526 0.694362461567 -vt -26.377738952637 -25.824726104736 -0.694362521172 -vt -17.487480163574 21.850849151611 -9.238789558411 -vt -17.448310852051 22.079463958740 -7.843263626099 -vt -18.641181945801 23.491695404053 -8.072401046753 -vt -18.680351257324 23.263076782227 -9.467928886414 -vt 18.140369415283 21.356575012207 -9.239566802979 -vt 18.105138778687 21.584888458252 -7.843820571899 -vt 19.258998870850 22.964744567871 -8.071624755859 -vt 19.294229507446 22.736431121826 -9.467370033264 -vt 27.285417556763 -26.089975357056 -0.687983930111 -vt 27.242393493652 -25.824773788452 0.700474679470 -vt 28.626508712769 -25.534833908081 0.687984049320 -vt 28.669532775879 -25.800035476685 -0.700474560261 -vt -24.983833312988 -26.063533782959 -47.974983215332 -vt -17.487480163574 21.850845336914 -39.430557250977 -vt -17.448310852051 22.079463958740 -40.826084136963 -vt -24.938697814941 -25.800086975098 -49.363708496094 -vt -18.641181945801 23.491691589355 -40.596946716309 -vt -26.332603454590 -25.561281204224 -49.363708496094 -vt -18.680351257324 23.263076782227 -39.201419830322 -vt -26.377738952637 -25.824728012085 -47.974983215332 -vt 18.140369415283 21.356571197510 -39.429779052734 -vt 18.105138778687 21.584884643555 -40.825527191162 -vt 19.258998870850 22.964740753174 -40.597721099854 -vt 19.294229507446 22.736427307129 -39.201976776123 -vt 27.285417556763 -26.089977264404 -47.981361389160 -vt 27.242393493652 -25.824777603149 -49.369819641113 -vt 28.626508712769 -25.534837722778 -49.357330322266 -vt 28.669532775879 -25.800037384033 -47.968868255615 -vt 19.550821304321 22.079088211060 -7.911951065063 -vt 18.168672561646 22.378185272217 -7.926216125488 -vt 18.168672561646 22.310815811157 -9.338824272156 -vt 19.550821304321 22.011718750000 -9.324559211731 -vt 28.077938079834 58.962402343750 -9.466709136963 -vt 26.692619323730 59.246894836426 -9.480277061462 -vt 26.553951263428 58.540180206299 -10.862394332886 -vt 27.939270019531 58.255687713623 -10.848826408386 -vt 29.193300247192 64.552856445313 -15.466491699219 -vt 27.806550979614 64.830207824707 -15.467369079590 -vt 27.461914062500 63.104469299316 -15.501105308533 -vt 28.848716735840 62.827384948730 -15.500129699707 -vt 28.081987380981 58.982704162598 -38.561283111572 -vt 26.696582794189 59.266757965088 -38.547275543213 -vt 26.549911499023 58.519870758057 -37.177703857422 -vt 27.935316085815 58.235816955566 -37.191711425781 -vt 19.552829742432 22.089979171753 -40.634887695313 -vt 18.170631408691 22.388816833496 -40.619941711426 -vt 18.166673660278 22.299924850464 -39.208530426025 -vt 19.548871994019 22.001087188721 -39.223476409912 -vt 29.254201889038 64.856658935547 -31.654993057251 -vt 27.867467880249 65.134078979492 -31.654163360596 -vt 27.522718429565 63.408370971680 -31.687810897827 -vt 28.909502029419 63.131198883057 -31.688722610474 -vt 29.685031890869 67.214920043945 -23.560743331909 -vt 28.298290252686 67.492309570313 -23.560766220093 -vt 27.953598022461 65.766586303711 -23.594459533691 -vt 29.340389251709 65.489463806152 -23.594427108765 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 0.333333343267 0.000000000000 -vt 1.000000000000 0.666666686535 0.000000000000 -vt 0.666666626930 0.000000000000 0.000000000000 -vt 0.333333313465 0.000000000000 0.000000000000 -vt 0.333333343267 1.000000000000 0.000000000000 -vt 0.666666686535 1.000000000000 0.000000000000 -vt 0.000000000000 0.666666626930 0.000000000000 -vt 0.000000000000 0.333333313465 0.000000000000 -vt 0.000000000000 0.666666626930 0.000000000000 -vt 0.000000000000 0.333333313465 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 0.333333343267 0.000000000000 -vt 1.000000000000 0.666666686535 0.000000000000 -vt 0.666666626930 0.000000000000 0.000000000000 -vt 0.333333313465 0.000000000000 0.000000000000 -vt 0.333333343267 1.000000000000 0.000000000000 -vt 0.666666686535 1.000000000000 0.000000000000 -vt 0.000000000000 0.666666626930 0.000000000000 -vt 0.000000000000 0.333333313465 0.000000000000 -vt 0.000000000000 0.666666626930 0.000000000000 -vt 0.000000000000 0.333333313465 0.000000000000 -vt 0.000000000000 0.666666626930 0.000000000000 -vt 0.000000000000 0.333333313465 0.000000000000 -vt 0.666666626930 0.000000000000 0.000000000000 -vt 0.333333313465 0.000000000000 0.000000000000 -vt 0.333333343267 1.000000000000 0.000000000000 -vt 0.666666686535 1.000000000000 0.000000000000 -vt 1.000000000000 0.333333343267 0.000000000000 -vt 1.000000000000 0.666666686535 0.000000000000 -vt 1.000000000000 0.333333343267 0.000000000000 -vt 1.000000000000 0.666666686535 0.000000000000 -# 146 texture vertices - -g Zidle_A_01 -s 1 -f 1/1 5/5 6/6 2/2 -f 2/2 6/6 7/7 3/3 -f 3/3 7/7 8/8 4/4 -f 4/4 8/8 5/5 1/1 -f 5/5 9/9 10/10 6/6 -f 6/6 10/10 11/11 7/7 -f 7/7 11/11 12/12 8/8 -f 8/8 12/12 9/9 5/5 -f 9/9 13/13 14/14 10/10 -f 10/10 14/14 15/15 11/11 -f 11/11 15/15 16/16 12/12 -f 12/12 16/16 13/13 9/9 -f 1/1 2/2 3/3 4/4 -f 17/17 20/20 19/19 18/18 -f 20/20 22/22 21/21 19/19 -f 22/22 24/24 23/23 21/21 -f 24/24 17/17 18/18 23/23 -f 18/18 19/19 26/26 25/25 -f 19/19 21/21 27/27 26/26 -f 21/21 23/23 28/28 27/27 -f 23/23 18/18 25/25 28/28 -f 25/25 26/26 30/30 29/29 -f 26/26 27/27 31/31 30/30 -f 27/27 28/28 32/32 31/31 -f 28/28 25/25 29/29 32/32 -f 17/17 24/24 22/22 20/20 -f 33/33 37/37 38/38 34/34 -f 34/34 38/38 39/39 35/35 -f 35/35 39/39 40/40 36/36 -f 36/36 40/40 37/37 33/33 -f 37/37 41/41 42/42 38/38 -f 38/38 42/42 43/43 39/39 -f 39/39 43/43 44/44 40/40 -f 40/40 44/44 41/41 37/37 -f 53/53 45/45 46/46 54/54 -f 54/54 46/46 47/47 55/55 -f 55/55 47/47 48/48 56/56 -f 56/56 48/48 45/45 53/53 -f 45/45 49/49 50/50 46/46 -f 46/46 50/50 51/51 47/47 -f 47/47 51/51 52/52 48/48 -f 48/48 52/52 49/49 45/45 -f 33/33 34/34 35/35 36/36 -f 42/42 41/41 57/57 58/58 -f 43/43 42/42 58/58 59/59 -f 44/44 43/43 59/59 60/60 -f 41/41 44/44 60/60 57/57 -f 58/58 57/57 53/53 54/54 -f 59/59 58/58 54/54 55/55 -f 60/60 59/59 55/55 56/56 -f 57/57 60/60 56/56 53/53 -s 0 -f 64/64 77/89 78/90 63/63 -f 64/64 62/62 61/61 77/89 -s 1 -f 75/87 84/98 73/85 74/86 -f 83/97 84/98 75/87 76/88 -s 2 -f 66/68 65/67 61/65 62/66 -s 4 -f 68/72 66/71 62/69 64/70 -s 2 -f 67/76 68/75 64/73 63/74 -s 4 -f 79/93 78/92 77/91 80/94 -s 2 -f 70/82 69/81 65/67 66/68 -s 4 -f 71/83 70/82 66/71 68/72 -s 2 -f 72/84 71/83 68/75 67/76 -s 5 -f 81/95 79/93 80/94 82/96 -s 3 -f 74/86 73/85 69/81 70/82 -s 5 -f 75/87 74/86 70/82 71/83 -s 3 -f 76/88 75/87 71/83 72/84 -s 1 -f 83/97 81/95 82/96 84/98 -s 4 -f 80/94 77/91 61/78 65/80 -f 78/92 79/93 67/79 63/77 -f 69/81 82/96 80/94 65/80 -f 79/93 81/95 72/84 67/79 -s 5 -f 73/85 84/98 82/96 69/81 -f 81/95 83/97 76/88 72/84 -s 2 -f 110/138 86/100 85/99 101/127 -s 1 -f 115/145 116/146 97/123 98/124 -f 99/125 108/136 97/123 116/146 -f 107/135 108/136 99/125 100/126 -s 4 -f 90/106 89/105 85/103 86/104 -s 8 -f 111/141 110/140 109/139 112/142 -s 4 -f 91/114 92/113 88/111 87/112 -f 103/131 102/130 101/129 104/132 -f 94/120 93/119 89/105 90/106 -s 9 -f 113/143 111/141 112/142 114/144 -s 4 -f 96/122 95/121 92/113 91/114 -s 5 -f 105/133 103/131 104/132 106/134 -f 98/124 97/123 93/119 94/120 -s 1 -f 115/145 113/143 114/144 116/146 -s 5 -f 100/126 99/125 95/121 96/122 -s 1 -f 107/135 105/133 106/134 108/136 -s 4 -f 104/132 101/129 85/116 89/118 -f 102/130 103/131 91/117 87/115 -s 5 -f 93/119 106/134 104/132 89/118 -f 103/131 105/133 96/122 91/117 -s 1 -f 97/123 108/136 106/134 93/119 -f 105/133 107/135 100/126 96/122 -s 8 -f 112/142 109/139 88/108 92/110 -f 110/140 111/141 90/109 86/107 -f 95/121 114/144 112/142 92/110 -f 111/141 113/143 94/120 90/109 -s 9 -f 99/125 116/146 114/144 95/121 -f 113/143 115/145 98/124 94/120 -s 2 -f 109/137 102/128 87/101 88/102 -f 110/138 101/127 102/128 109/137 -s 1 -f 15/15 14/14 13/13 -f 16/16 15/15 13/13 -f 31/31 29/29 30/30 -f 32/32 29/29 31/31 -f 51/51 50/50 49/49 -f 52/52 51/51 49/49 -# 109 faces - -g diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_06/Ex_06.pde deleted file mode 100755 index 23ca4b7fa..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_06/Ex_06.pde +++ /dev/null @@ -1,20 +0,0 @@ -// The camera lifts up while looking at the same point -void setup() { - size(400, 400, P3D); - fill(204); -} - -void draw() { - lights(); - background(0); - // Change height of the camera with mouseY - camera(30.0, mouseY, 220.0, // eyeX, eyeY, eyeZ - 0.0, 0.0, 0.0, // centerX, centerY, centerZ - 0.0, 1.0, 0.0); // upX, upY, upZ - noStroke(); - box(90); - stroke(255); - line(-100, 0, 0, 100, 0, 0); - line(0, -100, 0, 0, 100, 0); - line(0, 0, -100, 0, 0, 100); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_07/Ex_07.pde deleted file mode 100755 index a0dc5c7ca..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_07/Ex_07.pde +++ /dev/null @@ -1,19 +0,0 @@ -// Vary the specular reflection component of a material -// with vertical position of the mouse -void setup() { - size(400, 400, P3D); - noStroke(); - colorMode(RGB, 1); - fill(0.4); -} - -void draw() { - background(0); - translate(width / 2, height / 2); - // Set the specular color of lights that follow - lightSpecular(1, 1, 1); - directionalLight(0.8, 0.8, 0.8, 0, 0, -1); - float s = mouseX / float(width); - specular(s, s, s); - sphere(100); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_08/Ex_08.pde deleted file mode 100755 index a9125aba5..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_08/Ex_08.pde +++ /dev/null @@ -1,27 +0,0 @@ -// Draw a box with three different kinds of lights -void setup() { - size(400, 400, P3D); - noStroke(); -} - -void draw() { - background(0); - translate(width / 2, height / 2); - // Orange point light on the right - pointLight(150, 100, 0, // Color - 200, -150, 0); // Position - - // Blue directional light from the left - directionalLight(0, 102, 255, // Color - 1, 0, 0); // The x-, y-, z-axis direction - - // Yellow spotlight from the front - spotLight(255, 255, 109, // Color - 0, 40, 200, // Position - 0, -0.5, -0.5, // Direction - PI / 2, 2); // Angle, concentration - - rotateY(map(mouseX, 0, width, 0, PI)); - rotateX(map(mouseY, 0, height, 0, PI)); - box(200); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_09/Ex_09.pde deleted file mode 100755 index 49a3f3f5d..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_09/Ex_09.pde +++ /dev/null @@ -1,40 +0,0 @@ -// Load an image and draw it onto a cylinder and a quad -int tubeRes = 32; -float[] tubeX = new float[tubeRes]; -float[] tubeY = new float[tubeRes]; -PImage img; - -void setup() { - size(400, 400, P3D); - img = loadImage("berlin-1.jpg"); - float angle = 270.0 / tubeRes; - for (int i = 0; i < tubeRes; i++) { - tubeX[i] = cos(radians(i * angle)); - tubeY[i] = sin(radians(i * angle)); - } - noStroke(); -} - -void draw() { - background(0); - translate(width / 2, height / 2); - rotateX(map(mouseY, 0, height, -PI, PI)); - rotateY(map(mouseX, 0, width, -PI, PI)); - beginShape(QUAD_STRIP); - texture(img); - for (int i = 0; i < tubeRes; i++) { - float x = tubeX[i] * 100; - float z = tubeY[i] * 100; - float u = img.width / tubeRes * i; - vertex(x, -100, z, u, 0); - vertex(x, 100, z, u, img.height); - } - endShape(); - beginShape(QUADS); - texture(img); - vertex(0, -100, 0, 0, 0); - vertex(100, -100, 0, 100, 0); - vertex(100, 100, 0, 100, 100); - vertex(0, 100, 0, 0, 100); - endShape(); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_01A/Ex_01A.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_01A/Ex_01A.pde deleted file mode 100755 index d7a6b1af7..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_01A/Ex_01A.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Code for sensing a switch status and writing the value to the serial port -int switchPin = 0; // Switch connected to pin 0 - -void setup() { - pinMode(switchPin, INPUT); // Set pin 0 as an input - Serial.begin(9600); // Start serial communication at 9600 bps -} - -void loop() { - if (digitalRead(switchPin) == HIGH) { // If switch is ON, - Serial.print(1, BYTE); // send 1 to Processing - } else { // If the switch is not ON, - Serial.print(0, BYTE); // send 0 to Processing - } - delay(100); // Wait 100 milliseconds -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_01B/Ex_01B.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_01B/Ex_01B.pde deleted file mode 100755 index b6284fa05..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_01B/Ex_01B.pde +++ /dev/null @@ -1,25 +0,0 @@ -// Read data from the serial port and change the color of a rectangle -// when a switch connected to the board is pressed and released -import processing.serial.*; -Serial port; // Create object from Serial class -int val; // Data received from the serial port - -void setup() { - size(200, 200); - frameRate(10); -// Open the port that the board is connected to and use the same speed (9600 bps) - port = new Serial(this, 9600); -} - -void draw() { - if (0 < port.available()) { // If data is available, - val = port.read(); // read it and store it in val - } - background(255); // Set background to white - if (val == 0) { // If the serial value is 0, - fill(0); // set fill to black - } else { // If the serial value is not 0, - fill(204); // set fill to light gray - } - rect(50, 50, 100, 100); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_02A/Ex_02A.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_02A/Ex_02A.pde deleted file mode 100755 index 586b5804d..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_02A/Ex_02A.pde +++ /dev/null @@ -1,13 +0,0 @@ -// Code to read an analog value and write it to the serial port -int val; -int inputPin = 0; // Set the input to analog in pin 0 - -void setup() { - Serial.begin(9600); // Start serial communication at 9600 bps -} - -void loop() { - val = analogRead(inputPin) / 4; // Read analog input pin, put in range 0 to 255 - Serial.print(val, BYTE); // Send the value - delay(100); // Wait 100ms for next reading -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_02B/Ex_02B.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_02B/Ex_02B.pde deleted file mode 100755 index 463173016..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_02B/Ex_02B.pde +++ /dev/null @@ -1,23 +0,0 @@ -// Read data from the serial port and assign it to a variable. Set the fill a -// rectangle on the screen using the value read from a light sensor connected -// to the Wiring or Arduino board -import processing.serial.*; -Serial port; // Create object from Serial class -int val; // Data received from the serial port - -void setup() { - size(200, 200); - noStroke(); - frameRate(10); // Run 10 frames per second -// Open the port that the board is connected to and use the same speed (9600 bps) - port = new Serial(this, 9600); -} - -void draw() { - if (0 < port.available()) { // If data is available to read, - val = port.read(); // read it and store it in val - } - background(204); // Clear background - fill(val); // Set fill color with the value read - rect(50, 50, 100, 100); // Draw square -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_03A/Ex_03A.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_03A/Ex_03A.pde deleted file mode 100755 index af0a68de7..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_03A/Ex_03A.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Read data from the serial and turn ON or OFF a light depending on the value -char val; // Data received from the serial port -int ledPin = 0; // Set the pin to digital I/O 0 - -void setup() { - pinMode(ledPin, OUTPUT); // Set pin as OUTPUT - Serial.begin(9600); // Start serial communication at 9600 bps -} - -void loop() { - if (Serial.available()) { // If data is available to read, - val = Serial.read(); // read it and store it in val - } - if (val == 'H') { // If H was received - digitalWrite(ledPin, HIGH); // turn the LED on - } else { - digitalWrite(ledPin, LOW); // Otherwise turn it OFF - } - delay(100); // Wait 100 milliseconds for next reading -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_03B/Ex_03B.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_03B/Ex_03B.pde deleted file mode 100755 index 2241f664f..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_03B/Ex_03B.pde +++ /dev/null @@ -1,28 +0,0 @@ -// Check if the mouse is over a rectangle and writes the status to the serial port -import processing.serial.*; - -Serial port; // Create object from Serial class - -void setup() { - size(200, 200); - noStroke(); - frameRate(10); -// Open the port that the board is connected to and use the same speed (9600 bps) - port = new Serial(this, 9600); -} - -void draw() { - background(255); - if (mouseOverRect() == true) { // If mouse is over square, - fill(204); // change color and - port.write('H'); // send an H to indicate mouse is over square - } else { // If mouse is not over square, - fill(0); // change color and - port.write('L'); // send an L otherwise - } - rect(50, 50, 100, 100); // Draw a square -} - -boolean mouseOverRect() { // Test if mouse is over square - return ((mouseX >= 50) && (mouseX <= 150) && (mouseY >= 50) && (mouseY <= 150)); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_04A/Ex_04A.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_04A/Ex_04A.pde deleted file mode 100755 index d5203ea31..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_04A/Ex_04A.pde +++ /dev/null @@ -1,19 +0,0 @@ -// Read data from the serial port and set the position of a servomotor -// according to the value -Servo myservo; // Create servo object to control a servo - -int servoPin = 0; // Connect yellow servo wire to digital I/O pin 0 -int val = 0; // Data received from the serial port - -void setup() { - myservo.attach(servoPin); // Attach the servo to the PWM pin - Serial.begin(9600); // Start serial communication at 9600 bps -} - -void loop() { - if (Serial.available()) { // If data is available to read, - val = Serial.read(); // read it and store it in val - } - myservo.write(val); // Set the servo position - delay(15); // Wait for the servo to get there -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_04B/Ex_04B.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_04B/Ex_04B.pde deleted file mode 100755 index 3382f1fa2..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_04B/Ex_04B.pde +++ /dev/null @@ -1,32 +0,0 @@ -// Write data to the serial port according to the mouseX value -import processing.serial.*; - -Serial port; // Create object from Serial class -float mx = 0.0; - -void setup() { - size(200, 200); - noStroke(); - frameRate(10); -// Open the port that the board is connected to and use the same speed (9600 bps) - port = new Serial(this, 9600); -} - -void draw() { - background(0); // Clear background - fill(204); // Set fill color - rect(40, height / 2 - 15, 120, 25); // Draw square - float dif = mouseX - mx; - if (abs(dif) > 1.0) { - mx += dif / 4.0; - } - mx = constrain(mx, 50, 149); // Keeps marker on the screen - noStroke(); - fill(255); - rect(50, (height / 2) - 5, 100, 5); - fill(204, 102, 0); - rect(mx - 2, height / 2 - 5, 4, 5); // Draw the position marker - int angle = int(map(mx, 50, 149, 0, 180)); // Scale the value the range 0-180 -//print(angle + " "); // Print the current angle (debug) - port.write(angle); // Write the angle to the serial port -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_05A/Ex_05A.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_05A/Ex_05A.pde deleted file mode 100755 index 85fe0be50..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_05A/Ex_05A.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Read data from the serial and turns a DC motor on or off according to the value -char val; // Data received from the serial port -int motorpin = 0; // Wiring: Connect L293D Pin En1 connected to Pin PWM 0 -// int motorpin = 9; // Arduino: Connect L293D Pin En1 to Pin PWM 9 - -void setup() { - Serial.begin(9600); // Start serial communication at 9600 bps -} - -void loop() { - if (Serial.available()) { // If data is available, - val = Serial.read(); // read it and store it in val - } - if (val == 'H') { // If 'H' was received, - analogWrite(motorpin, 125); // turn the motor on at medium speed - } else { // If 'H' was not received - analogWrite(motorpin, 0); // turn the motor off - } - delay(100); // Wait 100 milliseconds for next reading -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_05B/Ex_05B.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_05B/Ex_05B.pde deleted file mode 100755 index dae509627..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_05B/Ex_05B.pde +++ /dev/null @@ -1,56 +0,0 @@ -// Write data to the serial port according to the status of a button controlled -// by the mouse -import processing.serial.*; -Serial port; // Create serial port object -boolean rectOver = false; -int rectX, rectY; // Position of square button -int rectSize = 100; // Diameter of rect -color rectColor; -boolean buttonOn = false; // Status of the button - -void setup() { - size(200, 200); - noStroke(); - frameRate(10); - rectColor = color(100); - rectX = width / 2 - rectSize / 2; - rectY = height / 2 - rectSize / 2; -// Open the port that the board is connected to and use the same speed (9600 bps) - port = new Serial(this, 9600); -} - -void draw() { - update(mouseX, mouseY); - background(0); // Clear background to black - fill(rectColor); - rect(rectX, rectY, rectSize, rectSize); -} -void update(int x, int y) { - if (overRect(rectX, rectY, rectSize, rectSize) == true) { - rectOver = true; - } else { - rectOver = false; - } -} - -void mouseReleased() { - if (rectOver == true) { - if (buttonOn == true) { - rectColor = color(100); - buttonOn = false; - port.write('L'); // Send an L to indicate button is OFF - } else { - rectColor = color(180); - buttonOn = true; - port.write('H'); // Send an H to indicate button is ON - } - } -} -boolean overRect(int x, int y, int width, int height) { - if ((mouseX >= x) && (mouseX <= x + width) && - (mouseY >= y) && (mouseY <= y + height)) { - return true; - } else { - return false; - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_01/Ex_01.pde deleted file mode 100755 index 160fa2647..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_01/Ex_01.pde +++ /dev/null @@ -1,10 +0,0 @@ -// The image file, named sprite.png in this example, must be located in the -// sketch data folder. From the Sketch menu, choose "Add File" to copy files into -// the sketch data folder. -PImage img = loadImage("sprite.png"); -// The coordinates (0, 0) refer to the top-left corder of the screen -image(img, 0, 0); -// The following coordinate calculations will center the image in the screen -image(img, (width - img.width) / 2, (height - img.height) / 2); -// Finally, the next line will position the image in the bottom-right corner -image(img, width - img.width, height - img.height); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_02/Ex_02.pde deleted file mode 100755 index c54213f18..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_02/Ex_02.pde +++ /dev/null @@ -1,21 +0,0 @@ -String s; -PFont font; -void setup() { - font = loadFont(); // Load and set the default font for drawing text - textFont(font); - softkey("Input"); // Create a softkey called Input - s = "No input"; // Initialize s with an initial message -} -void draw() { - background(200); - text(s, 0, height / 2); // Draw the String s in the middle of the screen -} - -void softkeyPressed(String label) { -// Check the value of the softkey label to determine the action to take - if (label.equals("Input")) { -// If the Input softkey is pressed, open a textInput window for the user -// to type text. It will be drawn on the screen by the draw() method - s = textInput(); - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_03/Ex_03.pde deleted file mode 100755 index 3753a6162..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_03/Ex_03.pde +++ /dev/null @@ -1,18 +0,0 @@ -PFont font; - -void setup() { - font = loadFont(); - textFont(font); - softkey("Delete"); // Use softkey to to delete characters from the multitap buffer - multitap(); // Turn on multitap key input -} - -void draw() { - background(200); - text(multitapText, 0, height / 2); // Draw the text captured with multitap -} -void softkeyPressed(String label) { - if (label.equals("Delete")) { - multitapDeleteChar(); // Delete a character - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_04/Ex_04.pde deleted file mode 100755 index aef2e609e..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_04/Ex_04.pde +++ /dev/null @@ -1,80 +0,0 @@ -// The PClient object is used to initiate requests to the server -PClient c; -// The PRequest object represents an active request from which we receive -// status information and data from the server -PRequest request; -int counter; -PFont font; -PImage img; -String version; -String error; - -void setup() { - font = loadFont(); // Load and set the default font for drawing text - textFont(font); - fill(0); -// Create a new network connection to connect to the Mobile Processing website - c = new PClient(this, "mobile.processing.org"); -// Start by fetching the logo for Mobile Processing the filename is a relative path -// specified in the same way as a URL in a webpage - request = c.GET("/images/mobile.png"); -// Use the counter to keep track of what we're fetching - counter = 0; -} - -void draw() { - background(255); - int y = 0; - if (error != null) { -// A network error has occured, so display the message - y += font.baseline; - text(error, 0, y); - } else if (img == null) { -// The img is not yet fetched, so draw a status message - y += font.baseline; - text("Fetching image...", 0, y); - } else { -// Draw the image - image(img, (width - img.width) / 2, y); - y += img.height + font.baseline; - if (version == null) { -// The version text is not yet fetched, so draw a status message - text("Checking version...", 0, y); - } else { -// Draw the version as reported by the website - text("Latest version: " + version, 0, y); - } - } -} -// The libraryEvent() will be called when a library, in this case the Net -// library, has an event to report back to the program -void libraryEvent(Object library, int event, Object data) { -// Make sure we handle the event from the right library - if (library == request) { - if (event == PRequest.EVENT_CONNECTED) { -// This event occurs when the connection is complete, so we can start -// reading the data. The readBytes() method will read all the data returned -// by the server and send another event when completed. - request.readBytes(); - } else if (event == PRequest.EVENT_DONE) { -// Reading is complete! Check the counter to see what we're transferring, -// then process the data. The data object in this case is an array of bytes. - byte[] bytes = (byte[]) data; - if (counter == 0) { -// This is the logo, so create an image from the bytes - img = new PImage(bytes); -// Now that we have the logo image, fetch the latest version text for -// Mobile Processing. We use the client object to initiate a new request - request = c.GET("/download/latest.txt"); -// Set the counter to 1 to represent the tex - counter = 1; - } else if (counter == 1) { -// This is the version text, so create a string from the bytes - version = new String(bytes); - } - } else if (event == PRequest.EVENT_ERROR) { -// The data object in this case is an error message - error = (String) data; - } - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_05/Ex_05.pde deleted file mode 100755 index a0c20636c..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_05/Ex_05.pde +++ /dev/null @@ -1,14 +0,0 @@ -import processing.sound.*; -// Notes range from 0 to 127 as in the MIDI specification -int[] notes = { 60, 62, 64, 65, 67, 69, 71, 72, 74 }; - -void setup() { - noLoop(); // No drawing in this sketch, so we don't need to run the draw() loop -} - -void keyPressed() { - if ((key >= '1') && (key <= '9')) { -// Use the key as an index into the array of notes - Sound.playTone(notes[key - '1'], 500, 80); - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_06/Ex_06.pde deleted file mode 100755 index 6054f8b1c..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_06/Ex_06.pde +++ /dev/null @@ -1,18 +0,0 @@ -import processing.sound.*; -Sound s; - -void setup() { -// The file, soundtrack.mid, must be copied into the data folder of this sketch - s = new Sound("soundtrack.mid"); - softkey("Play"); - noLoop(); -} -void softkeyPressed(String label) { - if (label.equals("Play")) { - s.play(); - softkey("Pause"); // Change the label of the softkey to Pause - } else if (label.equals("Pause")) { - s.pause(); - softkey("Play"); // Change the label of the softkey back to Play - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_07/Ex_07.pde deleted file mode 100755 index 43dcc79eb..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_07/Ex_07.pde +++ /dev/null @@ -1,18 +0,0 @@ -import processing.sound.*; -PFont font = loadFont(); -textFont(font); -background(255); -fill(0); - -// Get a list of the supported types of media on the phone -String[] types = Sound.supportedTypes(); -// Start at the top of the screen -int y = font.baseline; -// Draw each of the supported types on the screen -for (int i = 0, length = types.length; i < length; i++) { -// Draw the supported type (represented as an -// Internet MIME type string, such as audio/x-wav) - text(types[i], 0, y); -// Go to the next line - y += font.height; -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_08/Ex_08.pde deleted file mode 100755 index 71a8cb2a3..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_08/Ex_08.pde +++ /dev/null @@ -1,30 +0,0 @@ -import processing.phone.*; -Phone p; - -void setup() { - p = new Phone(this); - noLoop(); // No drawing in this sketch, so we don't need to run the draw() loop -} - -void keyPressed() { - switch (key) { - case '1': - // Vibrate the phone for 200 milliseconds - p.vibrate(200); - break; - - case '2': - // Flash the backlight for 200 milliseconds - p.flash(200); - break; - - case '3': - // Dial 411 on the phone - p.call("411"); - break; - case '4': - // Launch the Web browser - p.launch("http://mobile.processing.org/"); - break; - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Extensions/Network/Ex_01/Ex_01.pde deleted file mode 100755 index b95744578..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_01/Ex_01.pde +++ /dev/null @@ -1,21 +0,0 @@ -// A simple Web client using HTTP -import processing.net.*; - -Client c; -String data; - -void setup() { - size(200, 200); - background(50); - fill(200); - c = new Client(this, "www.processing.org", 80); // Connect to server on port 80 - c.write("GET / HTTP/1.0\n"); // Use the HTTP "GET" command to ask for a Web page - c.write("Host: my_domain_name.com\n\n"); // Be polite and say who we are -} - -void draw() { - if (c.available() > 0) { // If there's incoming data from the client... - data += c.readString(); // ...then grab it and print it - println(data); - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_02A/Ex_02A.pde b/java/examples/Books/Processing Handbook/Extensions/Network/Ex_02A/Ex_02A.pde deleted file mode 100755 index 688f76f34..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_02A/Ex_02A.pde +++ /dev/null @@ -1,34 +0,0 @@ -import processing.net.*; - -Server s; -Client c; -String input; -int data[]; - -void setup() { - size(450, 255); - background(204); - stroke(0); - frameRate(5); // Slow it down a little - s = new Server(this, 12345); // Start a simple server on a port -} - -void draw() { - if (mousePressed == true) { -// Draw our line - stroke(255); - line(pmouseX, pmouseY, mouseX, mouseY); -// Send mouse coords to other person - s.write(pmouseX + " " + pmouseY + " " + mouseX + " " + mouseY + "\n"); - } -// Receive data from client - c = s.available(); - if (c != null) { - input = c.readString(); - input = input.substring(0, input.indexOf("\n")); // Only up to the newline - data = int(split(input, ' ')); // Split values into an array -// Draw line using received coords - stroke(0); - line(data[0], data[1], data[2], data[3]); - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_02B/Ex_02B.pde b/java/examples/Books/Processing Handbook/Extensions/Network/Ex_02B/Ex_02B.pde deleted file mode 100755 index e15c2ed5c..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_02B/Ex_02B.pde +++ /dev/null @@ -1,33 +0,0 @@ -import processing.net.*; - -Client c; -String input; -int data[]; - -void setup() { - size(450, 255); - background(204); - stroke(0); - frameRate(5); // Slow it down a little -// Connect to the server’s IP address and port - c = new Client(this, "127.0.0.1", 12345); // Replace with your server’s IP and port -} - -void draw() { - if (mousePressed == true) { -// Draw our line - stroke(255); - line(pmouseX, pmouseY, mouseX, mouseY); -// Send mouse coords to other person - c.write(pmouseX + " " + pmouseY + " " + mouseX + " " + mouseY + "\n"); - } -// Receive data from server - if (c.available() > 0) { - input = c.readString(); - input = input.substring(0, input.indexOf("\n")); // Only up to the newline - data = int(split(input, ' ')); // Split values into an array -// Draw line using received coords - stroke(0); - line(data[0], data[1], data[2], data[3]); - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Extensions/Network/Ex_03/Ex_03.pde deleted file mode 100755 index caedf07ae..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_03/Ex_03.pde +++ /dev/null @@ -1,40 +0,0 @@ -// Download the Yahoo! Search SDK from http://developer.yahoo.com/download -// Inside the download, find the yahoo_search-2.X.X.jar file somewhere inside -// the "Java" subdirectory. Drag the jar file to your sketch and it will be -// added to your 'code' folder for use. -// This example is based on the based on yahoo api example -// Replace this with a developer key from http://developer.yahoo.com -String appid = "YOUR_DEVELOPER_KEY_HERE"; -SearchClient client = new SearchClient(appid); -String query = "processing.org"; -WebSearchRequest request = new WebSearchRequest(query); - -// (Optional) Set the maximum number of results to download -//request.setResults(30); - -try { - WebSearchResults results = client.webSearch(request); - // Print out how many hits were found - println("Displaying " + results.getTotalResultsReturned() + - " out of " + results.getTotalResultsAvailable() + " hits."); - println(); - // Get a list of the search results - WebSearchResult[] resultList = results.listResults(); - // Loop through the results and print them to the console - - for (int i = 0; i < resultList.length; i++) { - // Print out the document title and URL. - println((i + 1) + "."); - println(resultList[i].getTitle()); - println(resultList[i].getUrl()); - println(); - } - -// Error handling below, see the documentation of the Yahoo! API for details -} catch (IOException e) { - println("Error calling Yahoo! Search Service: " + e.toString()); - e.printStackTrace(); -} catch (SearchException e) { - println("Error calling Yahoo! Search Service: " + e.toString()); - e.printStackTrace(); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Extensions/Network/Ex_04/Ex_04.pde deleted file mode 100755 index 0931acf86..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_04/Ex_04.pde +++ /dev/null @@ -1,68 +0,0 @@ -// Note: requires Carnivore Library for Processing v2.2 (http://r-s-g.org/carnivore) -// Windows, first install winpcap (http://winpcap.org) -// Mac, first open a Terminal and execute this commmand: sudo chmod 777 /dev/bpf* -// (must be done each time you reboot your mac) -import java.util.Iterator; -import org.rsg.carnivore.*; -import org.rsg.carnivore.net.*; -HashMap nodes = new HashMap(); -float startDiameter = 100.0; -float shrinkSpeed = 0.97; -int splitter, x, y; -PFont font; -void setup() { - size(800, 600); - background(255); - frameRate(10); - Log.setDebug(true); // Uncomment this for verbose mode - CarnivoreP5 c = new CarnivoreP5(this); -//c.setVolumeLimit(4); -// Use the "Create Font" tool to add a 12 point font to your sketch, -// then use its name as the parameter to loadFont(). - font = loadFont("CourierNew-12.vlw"); - textFont(font); -} - -void draw() { - background(255); - drawNodes(); -} - -// Iterate through each node -synchronized void drawNodes() { - Iterator it = nodes.keySet().iterator(); - while (it.hasNext()) { - String ip = (String)it.next(); - float d = float(nodes.get(ip).toString()); - - // Use last two IP address bytes for x/y coords - splitter = ip.lastIndexOf("."); - y = int(ip.substring(splitter + 1)) * height / 255; // Scale to applet size - String tmp = ip.substring(0, splitter); - splitter = tmp.lastIndexOf("."); - x = int(tmp.substring(splitter + 1)) * width / 255; // Scale to applet size - - // Draw the node - stroke(0); - fill(color(100, 200)); // Rim - ellipse(x, y, d, d); // Node circle - noStroke(); - fill(color(100, 50)); // Halo - ellipse(x, y, d + 20, d + 20); - - // Draw the text - fill(0); - text(ip, x, y); - - // Shrink the nodes a little - nodes.put(ip, str(d * shrinkSpeed)); - } -} - -// Called each time a new packet arrives -synchronized void packetEvent(CarnivorePacket packet) { - println("[PDE] packetEvent: " + packet); -// Remember these nodes in our hash map - nodes.put(packet.receiverAddress.toString(), str(startDiameter)); - nodes.put(packet.senderAddress.toString(), str(startDiameter)); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_04/data/CourierNew-12.vlw b/java/examples/Books/Processing Handbook/Extensions/Network/Ex_04/data/CourierNew-12.vlw deleted file mode 100755 index a4e5d9737..000000000 Binary files a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_04/data/CourierNew-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Extensions/Print/Ex_01/Ex_01.pde deleted file mode 100755 index c8b239cdb..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_01/Ex_01.pde +++ /dev/null @@ -1,7 +0,0 @@ -import processing.pdf.*; // Import PDF code - -size(600, 600, PDF, "line.pdf"); // Set PDF as the renderer -background(255); -stroke(0); -line(200, 0, width/2, height); // Draw line to PDF -exit(); // Stop the program \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Extensions/Print/Ex_02/Ex_02.pde deleted file mode 100755 index c4909ef60..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_02/Ex_02.pde +++ /dev/null @@ -1,9 +0,0 @@ -import processing.pdf.*; // Import PDF code - -size(600, 600); -beginRecord(PDF, "line.pdf"); // Start writing to PDF -background(255); -stroke(0, 20); -strokeWeight(20); -line(200, 0, 400, height); // Draw line to screen and to PDF -endRecord(); // Stop writing to PDF \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Extensions/Print/Ex_03/Ex_03.pde deleted file mode 100755 index a4fed7165..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_03/Ex_03.pde +++ /dev/null @@ -1,25 +0,0 @@ -import processing.pdf.*; // Import PDF code - -boolean saveOneFrame = false; - -void setup() { - size(600, 600); -} - -void draw() { - if (saveOneFrame == true) { // When the saveOneFrame boolean is true, - beginRecord(PDF, "line-####.pdf"); // start recording to the PDF - } - background(255); - stroke(0, 20); - strokeWeight(20); - line(mouseX, 0, width - mouseY, height); - if (saveOneFrame == true) { // If the PDF has been recording, - endRecord(); // stop recording, - saveOneFrame = false; // and set the boolean value to false - } -} - -void mousePressed() { // When a mouse button is pressed, - saveOneFrame = true; // trigger PDF recording within the draw() -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Extensions/Print/Ex_04/Ex_04.pde deleted file mode 100755 index ff4664d9a..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_04/Ex_04.pde +++ /dev/null @@ -1,22 +0,0 @@ -import processing.pdf.*; // Import PDF code - -void setup() { - size(600, 600); - background(255); -} - -void draw() { - stroke(0, 20); - strokeWeight(20); - line(mouseX, 0, width - mouseY, height); -} - -void keyPressed() { - if (key == 'B' || key == 'b') { // When 'B' or 'b' is pressed, - beginRecord(PDF, "lines.pdf"); // start recording to the PDF - background(255); // Set a white background - } else if (key == 'E' || key == 'e') { // When 'E' or 'e' is pressed, - endRecord(); // stop recording the PDF and - exit(); // quit the program - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Extensions/Print/Ex_05/Ex_05.pde deleted file mode 100755 index 2ab41b3ad..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_05/Ex_05.pde +++ /dev/null @@ -1,10 +0,0 @@ -PGraphics big; // Declare a PGraphics variable - -void setup() { - big = createGraphics(3000, 3000); // Create a new PGraphics object - big.beginDraw(); // Start drawing to the PGraphics object - big.background(128); // Set the background - big.line(20, 1800, 1800, 900); // Draw a line - big.endDraw(); // Stop drawing to the PGraphics object - big.save("big.tif"); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Extensions/Print/Ex_06/Ex_06.pde deleted file mode 100755 index a9c09e569..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_06/Ex_06.pde +++ /dev/null @@ -1,31 +0,0 @@ -// Draws an image larger than the screen by tiling it into small sections. -// The scaleValue variable sets amount of scaling: 1 is 100%, 2 is 200%, etc. -int scaleValue = 3; // Multiplication factor -int xoffset = 0; // x-axis offset -int yoffset = 0; // y-axis offset - -void setup() { - size(600, 600); - stroke(0, 100); -} - -void draw() { - scale(scaleValue); - translate(xoffset *(-width / scaleValue), yoffset *(-height / scaleValue)); - line(10, 150, 500, 50); - line(0, 600, 600, 0); - setOffset(); -} - -void setOffset() { - save("lines-" + xoffset + "-" + yoffset + ".jpg"); - xoffset++; - if (xoffset == scaleValue) { - xoffset = 0; - yoffset++; - if (yoffset == scaleValue) { - exit(); - } - } - background(204); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_01/Ex_01.pde deleted file mode 100755 index 673c05f0f..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_01/Ex_01.pde +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Sound is generated in real time by summing together harmonically related - * sine tones. Overall pitch and harmonic detuning is controlled by the mouse. - * Based on the Spooky Stream Save Ess example - */ - -import krister.Ess.*; - -int numSines = 5; // Number of oscillators to use -AudioStream myStream; // Audio stream to write into -SineWave[] myWave; // Array of sines -FadeOut myFadeOut; // Amplitude ramp function -FadeIn myFadeIn; // Amplitude ramp function - -void setup() { - size(256, 200); - Ess.start(this); // Start Ess - myStream = new AudioStream(); // Create a new AudioStream - myStream.smoothPan = true; - myWave = new SineWave[numSines]; // Initialize the oscillators - for (int i = 0; i < myWave.length; i++) { - float sinVolume = (1.0 / myWave.length) / (i + 1); - myWave[i] = new SineWave(0, sinVolume); - } - myFadeOut = new FadeOut(); // Create amplitude ramp - myFadeIn = new FadeIn(); // Create amplitude ramp - myStream.start(); // Start audio -} - -void draw() { - noStroke(); - fill(0, 20); - rect(0, 0, width, height); // Draw the background - float offset = millis() - myStream.bufferStartTime; - int interp = int((offset / myStream.duration) * myStream.size); - stroke(255); - for (int i = 0; i < width; i++) { - float y1 = mouseY; - float y2 = y1; - if (i + interp + 1 < myStream.buffer2.length) { - y1 -= myStream.buffer2[i+interp] * height / 2; - y2 -= myStream.buffer2[i+interp+1] * height / 2; - } - line(i, y1, i + 1, y2); // Draw the waves - } -} -void audioStreamWrite(AudioStream s) { - // Figure out frequencies and detune amounts from the mouse - // using exponential scaling to approximate pitch perception - float yoffset = (height - mouseY) / float(height); - float frequency = pow(1000, yoffset) + 150; - float detune = float(mouseX) / width - 0.5; - myWave[0].generate(myStream); // Generate first sine, replace Stream - myWave[0].phase += myStream.size; // Increment the phase - myWave[0].phase %= myStream.sampleRate; - for (int i = 1; i < myWave.length; i++) { // Add remaining sines into the Stream - myWave[i].generate(myStream, Ess.ADD); - myWave[i].phase = myWave[0].phase; - } - myFadeOut.filter(myStream); // Fade down the audio - for (int i = 0; i < myWave.length; i++) { // Set the frequencies - myWave[i].frequency = round(frequency * (i + 1 + i * detune)); - myWave[i].phase = 0; - } - myFadeIn.filter(myStream); // Fade up the audio -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_02/Ex_02.pde deleted file mode 100755 index 7dd298db6..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_02/Ex_02.pde +++ /dev/null @@ -1,47 +0,0 @@ -/** -Sound is generated at setup with a triangle waveform and a simple envelope -generator. Insert your own array of notes as 'rawSequence' and let it roll. -*/ -import krister.Ess.*; -AudioChannel myChannel; // Create channel -TriangleWave myWave; // Create triangle waveform -Envelope myEnvelope; // Create envelope -int numNotes = 200; // Number of notes -int noteDuration = 300; // Duration of each note in milliseconds -float[] rawSequence = { 293.6648, 293.6648, 329.62756, 329.62756, 391.995, 369.99445 , 293.6648, 293.6648, - 329.62756, 293.6648, 439.997, 391.995, 293.6648, 293.6648, 587.3294, 493.8834, - 391.995, 369.9945, 329.62756, 523.2516, 523.2516, 493.8834, 391.995, - 439.997, 391.995 }; // Happy birthday - -void setup() { - size(100, 100); - Ess.start(this); // Start Ess - myChannel = new AudioChannel(); // Create a new AudioChannel - myChannel.initChannel(myChannel.frames(rawSequence.length * noteDuration)); - int current = 0; - myWave = new TriangleWave(480, 0.3); // Create triangle wave - EPoint[] myEnv = new EPoint[3]; // Three-step breakpoint function - myEnv[0] = new EPoint(0, 0); // Start at 0 - myEnv[1] = new EPoint(0.25, 1); // Attack - myEnv[2] = new EPoint(2, 0); // Release - myEnvelope = new Envelope(myEnv); // Bind Envelope to the breakpoint function - int time = 0; - for (int i = 0; i < rawSequence.length; i++) { - myWave.frequency = rawSequence[current]; // Update waveform frequency - int begin = myChannel.frames(time); // Starting position within Channel - int e = int(noteDuration * 0.8); - int end = myChannel.frames(e); // Ending position with Channel - myWave.generate(myChannel, begin, end); // Render triangle wave - myEnvelope.filter(myChannel, begin, end); // Apply envelope - current++; // Move to next note - time += noteDuration; // Increment the Channel output point - } - myChannel.play(); // Play the sound! -} - -void draw() { } // Empty draw() keeps the program running - -public void stop() { - Ess.stop(); // When program stops, stop Ess too - super.stop(); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_03/Ex_03.pde deleted file mode 100755 index 61810b8c8..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_03/Ex_03.pde +++ /dev/null @@ -1,88 +0,0 @@ -/** -Loads a sound file off disk and plays it in multiple voices at multiple sampling -increments (demonstrating voice allocation), panning it back and forth between -the speakers. Based on Ping Pong by Krister Olsson -*/ -import krister.Ess.*; - -AudioChannel[] mySound = new AudioChannel[6]; // Six channels of audio playback -Envelope myEnvelope; // Create Envelope -boolean left = true; -boolean middle = false; -boolean right = false; -// Sampling rates to choose from -int[] rates = { 44100, 22050, 2943, 49500, 11025, 37083 }; - -void setup() { - size(256, 200); - stroke(255); - Ess.start(this); // Start Ess -// Load sounds and set initial panning -// Sounds must be located in the sketch's "data" folder - for (int i = 0; i < 6; i++) { - mySound[i] = new AudioChannel("cela3.aif"); - mySound[i].smoothPan = true; - mySound[i].pan(Ess.LEFT); - mySound[i].panTo(1, 4000); - } - EPoint[] myEnv = new EPoint[3]; // Three-step breakpoint function - myEnv[0] = new EPoint(0, 0); // Start at 0 - myEnv[1] = new EPoint(0.25, 1); // Attack - myEnv[2] = new EPoint(2, 0); // Release - myEnvelope = new Envelope(myEnv); // Bind an Envelope to the breakpoint function -} - -void draw() { - int playSound = 0; // How many sounds do we play on this frame? - int which = -1; // If so, on which voice? - noStroke(); - fill(0, 15); - rect(0, 0, width, height); // Fade background - stroke(102); - line(width / 2, 0, width / 2, height); // Center line - float interp = lerp(0, width, (mySound[0].pan + 1) / 2.0); - stroke(255); - line(interp, 0, interp, height); // Moving line -// Trigger 1-3 samples when the line passes the center line or hits an edge - if ((mySound[0].pan < 0) && (middle == true)) { - playSound = int(random(1, 3)); - middle = false; - } else if ((mySound[0].pan > 0) && (middle == false)) { - playSound = int(random(1, 3)); - middle = true; - } else if ((mySound[0].pan < -0.9) && (left == true)) { - playSound = int(random(1, 3)); - left = false; - } else if ((mySound[0].pan > -0.9) && (left == false)) { - left = true; - } else if ((mySound[0].pan > 0.9) && (right == true)) { - playSound = int(random(1, 3)); - right = false; - } else if ((mySound[0].pan < 0.9) && (right == false)) { - right = true; - } -// Voice allocation block, figure out which AudioChannels are free - while (playSound > 0) { - for (int i = 0; i < mySound.length; i++) { - if (mySound[i].state == Ess.STOPPED) { - which = i; // Find a free voice - } - } -// If a voice is available and selected, play it - if (which != -1) { - mySound[which].sampleRate(rates[int(random(0,6))], false); - mySound[which].play(); - myEnvelope.filter(mySound[which]); // Apply envelope - } - playSound--; - } -} - -public void stop() { - Ess.stop(); // When program stops, stop Ess too - super.stop(); -} - -void audioOutputPan(AudioOutput c) { - c.panTo(-c.pan, 4000); // Reverse pan direction -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_03/data/cela3.aif b/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_03/data/cela3.aif deleted file mode 100755 index bf5693586..000000000 Binary files a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_03/data/cela3.aif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_04/Ex_04.pde deleted file mode 100755 index 9eb3ae08d..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_04/Ex_04.pde +++ /dev/null @@ -1,51 +0,0 @@ -/** -Applies reverb 10 times to a succession of guitar chords. -Inspired by Alvin Lucier's "I am Sitting in a Room." -Based on Reverb by Krister Olsson -*/ -import krister.Ess.*; - -AudioChannel myChannel; -Reverb myReverb; -Normalize myNormalize; -int numRepeats = 9; -int repeats = 0; -float rectWidth; - -void setup() { - size(256, 200); - noStroke(); - background(0); - rectWidth = width / (numRepeats + 1.0); - Ess.start(this); // Start Ess -// Load audio file into a AudioChannel, file must be in the sketch's "data" folder - myChannel = new AudioChannel("guitar.aif"); - myReverb = new Reverb(); - myNormalize = new Normalize(); - myNormalize.filter(myChannel); // Normalize the audio - myChannel.play(1); -} - -void draw() { - if (repeats < numRepeats) { - if (myChannel.state == Ess.STOPPED) { // If the audio isn't playing - myChannel.adjustChannel(myChannel.size / 16, Ess.END); - myChannel.out(myChannel.size); -// Apply reverberation "in place" to the audio in the channel - myReverb.filter(myChannel); -// Normalize the signal - myNormalize.filter(myChannel); - myChannel.play(1); - repeats++; - } - } else { - exit(); // Quit the program - } -// Draw rectangle to show the current repeat (1 of 9) - rect(rectWidth * repeats, 0, rectWidth - 1, height); -} - -public void stop() { - Ess.stop(); // When program stops, stop Ess too - super.stop(); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_04/data/guitar.aif b/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_04/data/guitar.aif deleted file mode 100755 index e9a55c5b1..000000000 Binary files a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_04/data/guitar.aif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_05/Ex_05.pde deleted file mode 100755 index 9ead96051..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_05/Ex_05.pde +++ /dev/null @@ -1,43 +0,0 @@ -/** -Analyzes a sound file using a Fast Fourier Transform, and plots both the current -spectral frame and a "peak-hold" plot of the maximum over time using logarithmic -scaling. Based on examples by Krister Olsson -*/ -import krister.Ess.*; - -AudioChannel myChannel; -FFT myFFT; -int bands = 256; // Number of FFT frequency bands to calculate - -void setup() { - size(1024, 200); - Ess.start(this); // Start Ess -// Load "test.aif" into a new AudioChannel, file must be in the "data" folder - myChannel = new AudioChannel("test.aif"); - myChannel.play(Ess.FOREVER); - myFFT = new FFT(bands * 2); // We want 256 frequency bands, so we pass in 512 -} - -void draw() { - background(176); -// Get spectrum - myFFT.getSpectrum(myChannel); -// Draw FFT data - stroke(255); - for (int i = 0; i < bands; i++) { - float x = width - pow(1024, (255.0 - i) / bands); - float maxY = max(0, myFFT.maxSpectrum[i] * height * 2); - float freY = max(0, myFFT.spectrum[i] * height * 2); -// Draw maximum lines - stroke(255); - line(x, height, x, height - maxY); -// Draw frequency lines - stroke(0); - line(x, height, x, height - freY); - } -} - -public void stop() { - Ess.stop(); // When program stops, stop Ess too - super.stop(); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_05/data/test.aif b/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_05/data/test.aif deleted file mode 100755 index c119326a7..000000000 Binary files a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_05/data/test.aif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_01/Ex_01.pde deleted file mode 100755 index c196d9c34..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_01/Ex_01.pde +++ /dev/null @@ -1,54 +0,0 @@ -// Quantify the amount of movement in the video frame using frame-differencing -import processing.video.*; - -int numPixels; -int[] previousFrame; -Capture video; -void setup() { - size(640, 480); // Change size to 320 x 240 if too slow at 640 x 480 - video = new Capture(this, width, height, 24); - numPixels = video.width * video.height; - // Create an array to store the previously captured frame - previousFrame = new int[numPixels]; -} - -void draw() { - if (video.available()) { - // When using video to manipulate the screen, use video.available() and - // video.read() inside the draw() method so that it's safe to draw to the screen - video.read(); // Read the new frame from the camera - video.loadPixels(); // Make its pixels[] array available - int movementSum = 0; // Amount of movement in the frame - loadPixels(); - for (int i = 0; i < numPixels; i++) { // For each pixel in the video frame... - color currColor = video.pixels[i]; - color prevColor = previousFrame[i]; - // Extract the red, green, and blue components from current pixel - int currR = (currColor >> 16) & 0xFF; // Like red(), but faster (see p. 673) - int currG = (currColor >> 8) & 0xFF; - int currB = currColor & 0xFF; - // Extract red, green, and blue components from previous pixel - int prevR = (prevColor >> 16) & 0xFF; - int prevG = (prevColor >> 8) & 0xFF; - int prevB = prevColor & 0xFF; - // Compute the difference of the red, green, and blue values - int diffR = abs(currR - prevR); - int diffG = abs(currG - prevG); - int diffB = abs(currB - prevB); - // Add these differences to the running tally - movementSum += diffR + diffG + diffB; - // Render the difference image to the screen - pixels[i] = color(diffR, diffG, diffB); - // The following line is much faster, but more confusing to read - //pixels[i] = 0xff000000 | (diffR << 16) | (diffG << 8) | diffB; - // Save the current color into the 'previous' buffer - previousFrame[i] = currColor; - } - // To prevent flicker from frames that are all black (no movement), - // only update the screen if the image has changed. - if (movementSum > 0) { - updatePixels(); - println(movementSum); // Print the total amount of movement to the console - } - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_02/Ex_02.pde deleted file mode 100755 index e5650ef35..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_02/Ex_02.pde +++ /dev/null @@ -1,59 +0,0 @@ -// Detect the presence of people and objects in the frame using a simple -// background-subtraction technique. To initialize the background, press a key. -import processing.video.*; - -int numPixels; -int[] backgroundPixels; -Capture video; - -void setup() { - size(640, 480); // Change size to 320 x 240 if too slow at 640 x 480 - video = new Capture(this, width, height, 24); - numPixels = video.width * video.height; - // Create array to store the background image - backgroundPixels = new int[numPixels]; - // Make the pixels[] array available for direct manipulation - loadPixels(); -} - -void draw() { - if (video.available()) { - video.read(); // Read a new video frame - video.loadPixels(); // Make the pixels of video available - // Difference between the current frame and the stored background - int presenceSum = 0; - for (int i = 0; i < numPixels; i++) { // For each pixel in the video frame... - // Fetch the current color in that location, and also the color - // of the background in that spot - color currColor = video.pixels[i]; - color bkgdColor = backgroundPixels[i]; - // Extract the red, green, and blue components of the current pixels color - int currR = (currColor >> 16) & 0xFF; - int currG = (currColor >> 8) & 0xFF; - int currB = currColor & 0xFF; - // Extract the red, green, and blue components of the background pixels color - int bkgdR = (bkgdColor >> 16) & 0xFF; - int bkgdG = (bkgdColor >> 8) & 0xFF; - int bkgdB = bkgdColor & 0xFF; - // Compute the difference of the red, green, and blue values - int diffR = abs(currR - bkgdR); - int diffG = abs(currG - bkgdG); - int diffB = abs(currB - bkgdB); - // Add these differences to the running tally - presenceSum += diffR + diffG + diffB; - // Render the difference image to the screen - pixels[i] = color(diffR, diffG, diffB); - // The following line does the same thing much faster, but is more technical - //pixels[i] = 0xFF000000 | (diffR << 16) | (diffG << 8) | diffB; - } - updatePixels(); // Notify that the pixels[] array has changed - println(presenceSum); // Print out the total amount of movement - } -} - -// When a key is pressed, capture the background image into the backgroundPixels -// buffer, by copying each of the current frames pixels into it. -void keyPressed() { - video.loadPixels(); - arraycopy(video.pixels, backgroundPixels); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_03/Ex_03.pde deleted file mode 100755 index 5a0646e02..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_03/Ex_03.pde +++ /dev/null @@ -1,49 +0,0 @@ -// Determines whether a test location (such as the cursor) is contained within -// the silhouette of a dark object -import processing.video.*; - -color black = color(0); -color white = color(255); -int numPixels; -Capture video; - -void setup() { - size(640, 480); // Change size to 320 x 240 if too slow at 640 x 480 - strokeWeight(5); - video = new Capture(this, width, height, 24); - numPixels = video.width * video.height; - noCursor(); - smooth(); -} - -void draw() { - if (video.available()) { - video.read(); - video.loadPixels(); - int threshold = 127; // Set the threshold value - float pixelBrightness; // Declare variable to store a pixel's color - // Turn each pixel in the video frame black or white depending on its brightness - loadPixels(); - for (int i = 0; i < numPixels; i++) { - pixelBrightness = brightness(video.pixels[i]); - if (pixelBrightness > threshold) { // If the pixel is brighter than the - pixels[i] = white; // threshold value, make it white - } - else { // Otherwise, - pixels[i] = black; // make it black - } - } - updatePixels(); - // Test a location to see where it is contained. Fetch the pixel at the test - // location (the cursor), and compute its brightness - int testValue = get(mouseX, mouseY); - float testBrightness = brightness(testValue); - if (testBrightness > threshold) { // If the test location is brighter than - fill(black); // the threshold set the fill to black - } - else { // Otherwise, - fill(white); // set the fill to white - } - ellipse(mouseX, mouseY, 20, 20); - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_04/Ex_04.pde deleted file mode 100755 index 3d3d3d3ca..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_04/Ex_04.pde +++ /dev/null @@ -1,44 +0,0 @@ -// Tracks the brightest pixel in a live video signal -import processing.video.*; - -Capture video; - -void setup() { - size(640, 480); // Change size to 320 x 240 if too slow at 640 x 480 - video = new Capture(this, width, height, 30); - noStroke(); - smooth(); -} - -void draw() { - if (video.available()) { - video.read(); - image(video, 0, 0, width, height); // Draw the webcam video onto the screen - int brightestX = 0; // X-coordinate of the brightest video pixel - int brightestY = 0; // Y-coordinate of the brightest video pixel - float brightestValue = 0; // Brightness of the brightest video pixel - // Search for the brightest pixel: For each row of pixels in the video image and - // for each pixel in the yth row, compute each pixel's index in the video - video.loadPixels(); - int index = 0; - for (int y = 0; y < video.height; y++) { - for (int x = 0; x < video.width; x++) { - // Get the color stored in the pixel - int pixelValue = video.pixels[index]; - // Determine the brightness of the pixel - float pixelBrightness = brightness(pixelValue); - // If that value is brighter than any previous, then store the - // brightness of that pixel, as well as its (x,y) location - if (pixelBrightness > brightestValue) { - brightestValue = pixelBrightness; - brightestY = y; - brightestX = x; - } - index++; - } - } - // Draw a large, yellow circle at the brightest pixel - fill(255, 204, 0, 128); - ellipse(brightestX, brightestY, 200, 200); - } -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_022/page_022.pde b/java/examples/Books/Processing Handbook/Illustrations/page_022/page_022.pde deleted file mode 100644 index d1dd79b7c..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_022/page_022.pde +++ /dev/null @@ -1,32 +0,0 @@ - -// Based on code from Shape 1 (p. 23) and code 6-07 (p. 65) - - -size(713, 938); -//size(713, 938, PDF, "page_022.pdf"); -background(255); -int ydiv = height/54; - -strokeWeight(0.25); -noStroke(); -fill(0); -rectMode(CENTER); - -for (int y = 0; y < height; y += ydiv) { - for (int x = 0; x < width; x += ydiv) { - ellipse(x, y, 0.5, 0.5); - } -} - -float s = ydiv * 10; -float x = ydiv * 28; - -ellipse(x, ydiv * 12, s, s); -rect(x, ydiv*26, ydiv*12, ydiv*12); -fill(255); -ellipse(x, ydiv*26, s, s); - -fill(0); -ellipse(x, ydiv*40, s*1.07, s*1.07); -fill(255); -rect(x, ydiv*40, s*.7, s*.7); diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_042/page_042.pde b/java/examples/Books/Processing Handbook/Illustrations/page_042/page_042.pde deleted file mode 100644 index a004e2571..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_042/page_042.pde +++ /dev/null @@ -1,35 +0,0 @@ - -// Based on code 4-02 (p. 44) and code 6-01 (p. 63) - - -size(442, 550); -//size(442, 550, PDF, "page_042.pdf"); -background(255); -strokeWeight(0.25); -strokeCap(SQUARE); - -float x1 = 0; -float x2 = 0; -float x3 = 0; -float x5 = 0; -float x4 = 0; - -for(int i = 0; i <= 50; i++) { - - line(width-x2, height * 0.0, width-x2, height * 0.2); - x2 += 4.5; - - line(width-x1, height * 0.2, width-x1, height * 0.4); - x1 += 9; - - line(width-x3, height * 0.4, width-x3, height * 0.6); - x3 += 6.25; - - line(width-x5, height * 0.6, width-x5, height * 0.8); - x5 += 3.125; - - line(width-x4, height * 0.8, width-x4, height); - x4 += 5.375; - -} - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_060/page_060.pde b/java/examples/Books/Processing Handbook/Illustrations/page_060/page_060.pde deleted file mode 100644 index 6f3bbdabc..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_060/page_060.pde +++ /dev/null @@ -1,21 +0,0 @@ - -// Based on the code examples on page 66 - - -size(180, 666); -//size(180, 666, PDF, "page_060.pdf"); -background(255); -strokeWeight(0.25); -strokeCap(SQUARE); - -for (int y = 0; y <= height; y += 5) { - for (int x = 0; x <= width; x += 5) { - if (x % 20 == 0) { - line(x, y, x-3, y-3); - } - else { - line(x, y, x-3, y+3); - } - } -} - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_078/page_078.pde b/java/examples/Books/Processing Handbook/Illustrations/page_078/page_078.pde deleted file mode 100644 index ab58fb65c..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_078/page_078.pde +++ /dev/null @@ -1,28 +0,0 @@ - -// Based on code 8-08 (p. 83) - - -size(360, 550); -//size(360, 550, PDF, "page_078.pdf"); -background(255); -stroke(0); -noFill(); - -float ax = 0.0; -float ay = 0.0; - -for (float e = 2; e < 36; e += 1.0) { - for (int x = 0; x < width; x += 2) { - float n = norm(x, 0.0, width); // Range 0.0 to 1.0 - float y = 1 - pow(n, e); // Calculate curve - y *= height; // Range 0.0 to height - if (x > 0) { - line(ax, ay, x, y); - } - ax = x; - ay = y; - } -} - - - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_094/page_094.pde b/java/examples/Books/Processing Handbook/Illustrations/page_094/page_094.pde deleted file mode 100644 index 8ef404ee6..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_094/page_094.pde +++ /dev/null @@ -1,21 +0,0 @@ - -// Based on code 10-07 (p. 98) and code 35-03 (p. 322) - - -size(2400, 1200); -background(255); -noStroke(); -fill(0); - -PImage img = loadImage("rockies-color.jpg"); - -for(int i = 0; i < width; i += 50) { - int x = int(random(img.width-50)); - PImage crop = img.get(x, 0, 50, height); - image(crop, i, 0); -} - -//saveFrame("page_094.tif"); - - - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_100/page_100.pde b/java/examples/Books/Processing Handbook/Illustrations/page_100/page_100.pde deleted file mode 100755 index 811e6a192..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_100/page_100.pde +++ /dev/null @@ -1,45 +0,0 @@ - -// Based on code 11-04 (p. 103) and code 13-01 (p. 113) - - -//size(360, 666, PDF, "page_100.pdf"); -size(360, 666); -background(255); - -println(PFont.list()); // List the available fonts -String s = "Ziggurat-HTF-Black"; -PFont font = createFont(s, 34); -textFont(font); - -fill(204); - -int a = 37; - -for (int i = 20; i < height+40; i += 38) { - textSize(34); - text(char(a), 50, i); - textSize(10); - text(a, 10, i-9); - a++; -} - -for (int i = 20; i < height+40; i += 38) { - textSize(34); - text(char(a), 170, i); - textSize(10); - text(a, 130, i-9); - a++; -} - -for (int i = 20; i < height+40; i += 38) { - textSize(34); - text(char(a), 290, i); - textSize(10); - text(a, 250, i-9); - a++; -} - - - - - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_110/page_110.pde b/java/examples/Books/Processing Handbook/Illustrations/page_110/page_110.pde deleted file mode 100755 index 10f5d1489..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_110/page_110.pde +++ /dev/null @@ -1,32 +0,0 @@ - -// Based on code 13-05 (p. 113) - - -size(360, 550); -//size(360, 550, PDF, "page_110.pdf"); -background(255); - -println(PFont.list()); // List the available fonts -String s = "Ziggurat-HTF-Black"; -PFont font = createFont(s, 34); -//PFont font = createFont("ZigguratHTFBlack", 34); -textFont(font); - -textAlign(CENTER); - -fill(0, 50); // Black with low opacity - -textSize(460); - -for(int i=0; i<6; i++) { - text(i, width/2, height*0.98 - i*40); -} - - -/* -text("1", width/2, height*.9); -text("2", width/2, height*.9); -text("3", width/2, height*.9); -text("4", width/2, height*.9); -text("5", width/2, height*.9); -*/ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_126/page_126.pde b/java/examples/Books/Processing Handbook/Illustrations/page_126/page_126.pde deleted file mode 100755 index adf977af3..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_126/page_126.pde +++ /dev/null @@ -1,21 +0,0 @@ - -// Based on code 15-09 (p. 131) - - -size(750, 2775); - -float xnoise = 0.0; -float ynoise = 0.0; -float inc = 0.005; -for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - float gray = noise(xnoise, ynoise) * 255; - stroke(gray); - point(x, y); - xnoise = xnoise + inc; - } - xnoise = 0; - ynoise = ynoise + inc; -} - -//saveFrame("page_126.tif"); diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_136/page_136.pde b/java/examples/Books/Processing Handbook/Illustrations/page_136/page_136.pde deleted file mode 100755 index 791f1c8a1..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_136/page_136.pde +++ /dev/null @@ -1,17 +0,0 @@ - -// Based on code 17-14 (p. 142) - - -size(360, 550); -//size(360, 550, PDF, "page_136.pdf"); -background(255); - -smooth(); -noStroke(); -fill(0, 10); - -translate(33, 66); // Set initial offset -for (int i = 0; i < 45; i++) { // 12 repetitions - scale(1.02); // Accumulate the scaling - ellipse(25, 90, 200, 200); -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_144/page_144.pde b/java/examples/Books/Processing Handbook/Illustrations/page_144/page_144.pde deleted file mode 100755 index 6edb06bbd..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_144/page_144.pde +++ /dev/null @@ -1,23 +0,0 @@ - -// Based on code 14-11 (p. 123) - - -size(440, 666); -//size(440, 666, PDF, "page_144.pdf"); -background(255); -stroke(0); -strokeWeight(0.25); -fill(0); - -float scaleVal = 16.0; -float angleInc = PI/24.0; -float angle = 0.0; - -for (int offset = 20; offset < width-20; offset += 5) { - for (int y = 0; y <= height; y += 2) { - float x = offset + (sin(angle) * scaleVal); - line(x, y, x+0.125, y+0.125); - angle += angleInc; - } - angle += PI; -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_148/data/Thumbs.db b/java/examples/Books/Processing Handbook/Illustrations/page_148/data/Thumbs.db deleted file mode 100755 index 64650786a..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_148/data/Thumbs.db and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_148/page_148.pde b/java/examples/Books/Processing Handbook/Illustrations/page_148/page_148.pde deleted file mode 100755 index 751477073..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_148/page_148.pde +++ /dev/null @@ -1,304 +0,0 @@ - -// Based on the Collage Engine code on page 150 - - -PImage nyt01 = loadImage("nyt_01.jpg"); -PImage nyt02 = loadImage("nyt_02.jpg"); -PImage nyt03 = loadImage("nyt_03.jpg"); -PImage nyt04 = loadImage("nyt_04.jpg"); -PImage nyt05 = loadImage("nyt_05.jpg"); -PImage nyt06 = loadImage("nyt_06.jpg"); -PImage nyt07 = loadImage("nyt_07.jpg"); -PImage nyt08 = loadImage("nyt_08.jpg"); -PImage nyt09 = loadImage("nyt_09.jpg"); -PImage nyt10 = loadImage("nyt_10.jpg"); -PImage nyt11 = loadImage("nyt_11.jpg"); -PImage nyt12 = loadImage("nyt_12.jpg"); -PImage nyt13 = loadImage("nyt_13.jpg"); -PImage nyt14 = loadImage("nyt_14.jpg"); -PImage nyt15 = loadImage("nyt_15.jpg"); -PImage nyt16 = loadImage("nyt_16.jpg"); -PImage nyt17 = loadImage("nyt_17.jpg"); -PImage nyt18 = loadImage("nyt_18.jpg"); -PImage nyt19 = loadImage("nyt_19.jpg"); -PImage nyt20 = loadImage("nyt_20.jpg"); -PImage nyt21 = loadImage("nyt_21.jpg"); -PImage nyt22 = loadImage("nyt_22.jpg"); -PImage nyt23 = loadImage("nyt_23.jpg"); -PImage nyt24 = loadImage("nyt_24.jpg"); -PImage nyt25 = loadImage("nyt_25.jpg"); -PImage nyt26 = loadImage("nyt_26.jpg"); -PImage nyt27 = loadImage("nyt_27.jpg"); -PImage nyt28 = loadImage("nyt_28.jpg"); -PImage nyt29 = loadImage("nyt_29.jpg"); - -float x, y, r; - -size(750, 2275); -smooth(); -background(255); -tint(255, 204); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt01, -nyt01.width/2, -nyt01.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt02, -nyt02.width/2, -nyt02.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt03, -nyt03.width/2, -nyt03.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt04, -nyt04.width/2, -nyt04.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt05, -nyt05.width/2, -nyt05.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt06, -nyt06.width/2, -nyt06.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt07, -nyt07.width/2, -nyt07.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt08, -nyt08.width/2, -nyt08.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt09, -nyt09.width/2, -nyt09.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt10, -nyt10.width/2, -nyt10.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt11, -nyt11.width/2, -nyt11.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt12, -nyt12.width/2, -nyt12.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt13, -nyt13.width/2, -nyt13.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt14, -nyt14.width/2, -nyt14.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt15, -nyt15.width/2, -nyt15.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt16, -nyt16.width/2, -nyt16.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt17, -nyt17.width/2, -nyt17.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt18, -nyt18.width/2, -nyt18.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt19, -nyt19.width/2, -nyt19.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt20, -nyt20.width/2, -nyt20.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt21, -nyt21.width/2, -nyt21.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt22, -nyt22.width/2, -nyt22.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt23, -nyt23.width/2, -nyt23.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt24, -nyt24.width/2, -nyt24.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt25, -nyt25.width/2, -nyt25.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt26, -nyt26.width/2, -nyt26.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt27, -nyt27.width/2, -nyt27.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt28, -nyt28.width/2, -nyt28.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt29, -nyt29.width/2, -nyt29.height/2); -popMatrix(); - - -//saveFrame("page-148--" + int(random(0, 1000)) + ".tif"); diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_172/page_172.pde b/java/examples/Books/Processing Handbook/Illustrations/page_172/page_172.pde deleted file mode 100755 index 862324f2f..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_172/page_172.pde +++ /dev/null @@ -1,48 +0,0 @@ - -// Based on code 21-14 (p. 192) - - -void setup() { - size(200, 666); - //size(200, 666, PDF, "page_172.pdf"); - background(255); - smooth(); - noStroke(); - noLoop(); - fill(100); - randomSeed(0); - strokeWeight(0.25); -} - -void draw() { - for(int i=0; i<12; i++) { - vine(10+int(random(width-20)), int(random(10, 50)), int(random(2, 6))); - } - //exit(); -} - -void vine(int x, int numLeaves, int leafSize ) { - stroke(0); - line(x, 0, x, height); - noStroke(); - int gap = (height)/numLeaves; - int direction = 1; - for (int i = 0; i < numLeaves; i++) { - int r = int(random(gap)); - leaf( x, gap*i + r, leafSize, direction); - direction = direction * -1; - } -} - -void leaf(int x, int y, int size, int d) { - pushMatrix(); - translate(x, y); // Move to position - scale(size); // Scale to size - beginShape(); // Draw the shape - vertex(1.0*d, -0.7); - bezierVertex(1.0*d, -0.7, 0.4*d, -1.0, 0.0, 0.0); - bezierVertex(0.0, 0.0, 1.0*d, 0.4, 1.0*d, -0.7); - endShape(); - popMatrix(); -} - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_216/page_216.pde b/java/examples/Books/Processing Handbook/Illustrations/page_216/page_216.pde deleted file mode 100755 index dff651a1b..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_216/page_216.pde +++ /dev/null @@ -1,25 +0,0 @@ - -// Based on code 24-08 (p. 221) - - -PImage lineImage; -int x; - -void setup() { - size(750/2, 2292/2); - background(255); - lineImage = loadImage("paris-line.jpg"); -} - -void draw() { - if(mousePressed) { - x = mouseX; - } - - image(lineImage, x-lineImage.width/2, mouseY); - image(lineImage, x-lineImage.width/2, height-mouseY); -} - -void keyPressed() { - saveFrame("page-216-####.tif"); -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_222/page_222.pde b/java/examples/Books/Processing Handbook/Illustrations/page_222/page_222.pde deleted file mode 100755 index 797fd2b64..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_222/page_222.pde +++ /dev/null @@ -1,52 +0,0 @@ - -// Based on code 13-01 (p. 113) and code 33-11 (p. 305) - - -size(460, 225); -//size(460, 225, PDF, "page_222.pdf"); -background(255); -fill(204); - -println(PFont.list()); // Select a font from this list -String s = "Ziggurat-HTF-Black"; -PFont font = createFont(s, 34); -textFont(font); - -char[] c1 = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '='}; -char[] c2 = {'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '[', ']'}; -char[] c3 = {'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ';'}; -char[] c4 = {'Z', 'X', 'C', 'V', 'B', 'N', 'M', ',', '.', '/'}; - -textAlign(CENTER); -textSize(50); -stroke(204); - -strokeWeight(0.5); - -for (int i = 0; i < c1.length; i++) { - text(c1[i], 20+i*78, 50); - if(i%2 != 0) { - line(20+i*39, 40, 20+i*39, 20); - } -} - -for (int i = 0; i < c2.length; i++) { - text(c2[i], 46+i*78, 105); - if(i%2 != 0) { - line(46+i*39, 95, 46+i*39, 75); - } -} - -for (int i = 0; i < c3.length; i++) { - text(c3[i], 65+i*78, 160); - if(i%2 != 0) { - line(65+i*39, 150, 65+i*39, 130); - } -} - -for (int i = 0; i < c4.length; i++) { - text(c4[i], 90+i*78, 215); - if(i%2 != 0) { - line(90+i*39, 205, 90+i*39, 185); - } -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_228/page_228.pde b/java/examples/Books/Processing Handbook/Illustrations/page_228/page_228.pde deleted file mode 100755 index e7c782ebd..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_228/page_228.pde +++ /dev/null @@ -1,46 +0,0 @@ - -// Based on code 26-04 (p. 231) - -import processing.pdf.*; - -int dragX, dragY, moveX, moveY; -boolean record = false; - -void setup() { - size(360, 666); -} - -void draw() { - if (record) { - beginRecord(PDF, "page_228.pdf"); - } - - background(255); - noFill(); - stroke(0); - ellipse(dragX, dragY, 200, 200); // Black circle - fill(153); - noStroke(); - ellipse(moveX, moveY, 200, 200); // Gray circle - - if (record) { - endRecord(); - record = false; - } - -} - -void mouseMoved() { // Move gray circle - moveX = mouseX; - moveY = mouseY; -} - -void mouseDragged() { // Move black circle - dragX = mouseX; - dragY = mouseY; -} - -void keyReleased() { - record = true; -} - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_250/page_250.pde b/java/examples/Books/Processing Handbook/Illustrations/page_250/page_250.pde deleted file mode 100755 index b4a270f54..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_250/page_250.pde +++ /dev/null @@ -1,40 +0,0 @@ - -size(442, 500); -//size(442, 500, PDF, "page_250.pdf"); -background(255); -fill(0); - -println(PFont.list()); -String s = "TheSansMono Light Italic"; -PFont font = createFont(s, 24); -textFont(font); - -String s1 = "void draw() {"; -String s2 = " background(126);"; -String s3 = " ellipse(mouseX, mouseY, 33, 33);"; -String s4 = "}"; - -String s5 = "void Draw() ("; -String s6 = " background(126)"; -String s7 = " ellipse(mouseX. mousey, 33, 33);"; -String s8 = "}"; - -textAlign(LEFT); -textSize(26); -stroke(204); - -text(s5, 0, 30); -text(s6, 0, 70); -text(s7, 0, 110); -text(s8, 0, 150); - -text(s1, 0, 250); -text(s2, 0, 290); -text(s3, 0, 320); -text(s4, 0, 370); - - - - - - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_254/page_254.pde b/java/examples/Books/Processing Handbook/Illustrations/page_254/page_254.pde deleted file mode 100755 index 3fdfe638c..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_254/page_254.pde +++ /dev/null @@ -1,108 +0,0 @@ - -// Based on the Cursor example on page 257 - - -import processing.pdf.*; - -boolean record = false; - -int gx, gy; -int mode, nextmode; -int nummodes; -boolean forapplet = false; - -float mx, my, lastmx, lastmy; -float lastrot, lastsc; - -float bgx, bgy; - -float p_x, p_y; -float p_fx, p_fy; -float p_v2, p_vx, p_vy; -float p_a2, p_ax, p_ay; -float p_mass, p_drag; - -void setup() { - size(442, 550); - gx = width; - gy = height; - colorMode(RGB, 1.0); - strokeWeight(0.5); - strokeJoin(ROUND); - - nummodes = 4; - mode = 4; - - bgx = 0; - bgy = 0; - mx = gx/2; - my = gy/2; -} - - -void draw() { - - if(record) { - beginRecord(PDF, "page_254.pdf"); // Start writing to PDF - } - - lastmx = mx; - lastmy = my; - - mx = mouseX; - my = mouseY; - - background(1.0); - - // Grid - fill(1,1,1); - stroke(.2,.2,.2); - - float rot; - for (int i=16; i width-radius) || (x < radius)) { - directionX = -directionX; // Change direction - } - y += speedY * directionY; - if ((y > height-radius) || (y < radius)) { - directionY = -directionY; // Change direction - } - } - -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_290/page_290.pde b/java/examples/Books/Processing Handbook/Illustrations/page_290/page_290.pde deleted file mode 100755 index 1234f6316..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_290/page_290.pde +++ /dev/null @@ -1,60 +0,0 @@ - -// Based on code 32-07 (p. 297) - -import processing.pdf.*; - -float inc = 0.0; - -boolean record = false; - -void setup() { - size(513, 462); - smooth(); -} - -void draw() { - - if(record) { - beginRecord(PDF, "page_290.pdf"); - } - - stroke(0, 143); - randomSeed(0); - background(255); - inc += 0.01; - float angle = sin(inc)/10.0 + sin(inc*1.2)/20.0; - //tail(18, 9, angle/1.3); - //tail(33, 12, angle); - //tail(44, 10, angle/1.3); - //tail(62, 5, angle); - //tail(88, 7, angle*2); - for(int i=-20; i 0; i--) { - strokeWeight(i/2.0); - line(0, 0, 0, -8); - translate(0.0, -8); - rotate(angle); - } - popMatrix(); -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_300/page_300.pde b/java/examples/Books/Processing Handbook/Illustrations/page_300/page_300.pde deleted file mode 100755 index f223d90e7..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_300/page_300.pde +++ /dev/null @@ -1,76 +0,0 @@ - -// Based on code 33-14 (p. 307) - -import processing.pdf.*; - -float inc = 0.0; - -boolean record = false; - -int numLines = 170; -float[] y; -float[] x; - -float mx; -float my; - -void setup() { - size(180, 666); - smooth(); - noFill(); - strokeWeight(0.25); - y = new float[height]; - x = new float[height]; - -} - -void draw() { - - if(record) { - beginRecord(PDF, "page_300.pdf"); - } - - background(255); - - // Shift the values to the right - for (int i = y.length-1; i > 0; i--) { - y[i] = y[i-1]; - } - // Add new values to the beginning - my += (mouseX-my) * 0.1; - y[0] = my; - - beginShape(); - for (int i = 1; i < y.length; i++) { - vertex(y[i], i); - } - endShape(); - - // Shift the values to the right - for (int i = x.length-1; i > 0; i--) { - x[i] = x[i-1]; - } - // Add new values to the beginning - mx += (mouseY-mx) * 0.1; - x[0] = mx; - - - beginShape(); - for (int i = 1; i < x.length; i++) { - vertex(x[i] * float(width)/height, i); - } - endShape(); - - if(record) { - endRecord(); - record = false; - } - -} - -void mousePressed() { - record = true; -} - - - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0000.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0000.gif deleted file mode 100755 index 1a9893ad2..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0000.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0001.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0001.gif deleted file mode 100755 index 1a9893ad2..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0001.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0002.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0002.gif deleted file mode 100755 index c53edb943..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0002.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0003.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0003.gif deleted file mode 100755 index b9c4fc675..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0003.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0004.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0004.gif deleted file mode 100755 index b43d0b308..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0004.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0005.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0005.gif deleted file mode 100755 index 36f373249..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0005.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0006.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0006.gif deleted file mode 100755 index b4c6ab5e6..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0006.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0007.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0007.gif deleted file mode 100755 index a53c6abc7..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0007.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0008.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0008.gif deleted file mode 100755 index 1ce59b9a6..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0008.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0009.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0009.gif deleted file mode 100755 index 557bedf8e..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0009.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0010.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0010.gif deleted file mode 100755 index 31fd776e4..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0010.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0011.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0011.gif deleted file mode 100755 index a69083697..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0011.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0012.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0012.gif deleted file mode 100755 index fe81e42ac..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0012.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0013.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0013.gif deleted file mode 100755 index c8ede5df6..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0013.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0014.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0014.gif deleted file mode 100755 index 1f1413761..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0014.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0015.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0015.gif deleted file mode 100755 index de472dfe7..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0015.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0016.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0016.gif deleted file mode 100755 index 5bc583f0a..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0016.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0017.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0017.gif deleted file mode 100755 index 8ff438690..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0017.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0018.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0018.gif deleted file mode 100755 index 0b99e3727..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0018.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0019.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0019.gif deleted file mode 100755 index 7a9217ad3..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0019.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0020.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0020.gif deleted file mode 100755 index fe8fdae31..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0020.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0021.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0021.gif deleted file mode 100755 index ab36afe0d..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0021.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0022.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0022.gif deleted file mode 100755 index 98dc00b57..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0022.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0023.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0023.gif deleted file mode 100755 index a3dd7f38c..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0023.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0024.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0024.gif deleted file mode 100755 index f8287855a..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0024.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0025.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0025.gif deleted file mode 100755 index 0107f470c..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0025.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0026.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0026.gif deleted file mode 100755 index e05a13944..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0026.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0027.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0027.gif deleted file mode 100755 index decdebe59..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0027.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0028.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0028.gif deleted file mode 100755 index ec2bae766..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0028.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0029.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0029.gif deleted file mode 100755 index 67d14b168..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0029.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0030.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0030.gif deleted file mode 100755 index 619c30c94..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0030.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0031.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0031.gif deleted file mode 100755 index aae6bfbf3..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0031.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0032.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0032.gif deleted file mode 100755 index 7cdd3561b..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0032.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0033.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0033.gif deleted file mode 100755 index 97fc08480..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0033.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0034.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0034.gif deleted file mode 100755 index 85e71dd53..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0034.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0035.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0035.gif deleted file mode 100755 index 752393673..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0035.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0036.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0036.gif deleted file mode 100755 index 92bf1c3da..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0036.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0037.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0037.gif deleted file mode 100755 index 397590e38..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0037.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/page_314.pde b/java/examples/Books/Processing Handbook/Illustrations/page_314/page_314.pde deleted file mode 100755 index 262e8e167..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_314/page_314.pde +++ /dev/null @@ -1,61 +0,0 @@ - -// Based on code 34-05 (p. 319) - - -int numFrames = 37; // The number of frames in the animation -PImage[] images = new PImage[numFrames]; -int which = 0; - -void setup() { - size(200*11, 200); - for (int i = 0; i < images.length; i++) { - String imageName = "PT_Shifty_" + nf(i, 4) + ".gif"; - images[i] = loadImage(imageName); - } - noLoop(); -} - - -void draw() { - background(255); - - for(int i=0; i < 11; i++) { - image(images[which], i*200, 0); - which = (which+1)%images.length; - } - save("page_314-1.tif"); - - background(255); - - for(int i=0; i < 11; i++) { - image(images[which], i*200, 0); - which = (which+1)%images.length; - } - save("page_314-2.tif"); - - background(255); - - for(int i=0; i < 11; i++) { - image(images[which], i*200, 0); - which = (which+1)%images.length; - } - save("page_314-3.tif"); - - background(255); - - for(int i=0; i < 11; i++) { - image(images[which], i*200, 0); - which = (which+1)%images.length; - } - save("page_314-4.tif"); - - background(255); - - for(int i=0; i < 11; i++) { - image(images[which], i*200, 0); - which = (which+1)%images.length; - } - save("page_314-5.tif"); - -} - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_326/page_326.pde b/java/examples/Books/Processing Handbook/Illustrations/page_326/page_326.pde deleted file mode 100755 index efbbbfa1b..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_326/page_326.pde +++ /dev/null @@ -1,99 +0,0 @@ - -// Based on code 36-07 (p. 331) - -import processing.pdf.*; - -PFont f; -String s = "012345678901234567890123456789"; -float angle = 0.0; - -boolean record = false; - -void setup() { - size(842, 550); - println(PFont.list()); // Select a font from this list - String s = "TheSansMono-ExtraLightItalic-48"; - f = createFont(s, 24); - textFont(f); - fill(204); -} - -void draw() { - - if(record) { - beginRecord(PDF, "page_326.pdf"); - } - - textFont(f); - background(255); - translate(10, 0); - angle += 0.1; - - float cw = 0; - //for (int i = 0; i < s.length(); i++) { - for (int i = 0; i < s.length(); i++) { - float c = sin(angle + i/PI); - textSize((c + 1.0) * 18 + 6); - text(s.charAt(i), cw, 60); - cw += textWidth(s.charAt(i)) * 1.2; - } - - cw = 0; - for (int i = 0; i < s.length(); i++) { - float c = sin((angle+QUARTER_PI/2) + i/PI); - textSize((c + 1.0) * 18 + 6); - text(s.charAt(i), cw, 120); - cw += textWidth(s.charAt(i)) * 1.2; - } - - cw = 0; - for (int i = 0; i < s.length(); i++) { - float c = sin((angle+QUARTER_PI) + i/PI); - textSize((c + 1.0) * 18 + 6); - text(s.charAt(i), cw, 180); - cw += textWidth(s.charAt(i)) * 1.2; - } - - cw = 0; - for (int i = 0; i < s.length(); i++) { - float c = sin((angle+QUARTER_PI+QUARTER_PI/2) + i/PI); - textSize((c + 1.0) * 18 + 6); - text(s.charAt(i), cw, 240); - cw += textWidth(s.charAt(i)) * 1.2; - } - - cw = 0; - for (int i = 0; i < s.length(); i++) { - float c = sin((angle+HALF_PI) + i/PI); - textSize((c + 1.0) * 18 + 6); - text(s.charAt(i), cw, 300); - cw += textWidth(s.charAt(i)) * 1.2; - } - - cw = 0; - for (int i = 0; i < s.length(); i++) { - float c = sin((angle+HALF_PI+QUARTER_PI/2) + i/PI); - textSize((c + 1.0) * 18 + 6); - text(s.charAt(i), cw, 360); - cw += textWidth(s.charAt(i)) * 1.2; - } - - cw = 0; - for (int i = 0; i < s.length(); i++) { - float c = sin((angle+HALF_PI+QUARTER_PI) + i/PI); - textSize((c + 1.0) * 18 + 6); - text(s.charAt(i), cw, 420); - cw += textWidth(s.charAt(i)) * 1.2; - } - - if(record) { - endRecord(); - record = false; - } - -} - - -void keyPressed() { - record = true; -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_346/page_346.pde b/java/examples/Books/Processing Handbook/Illustrations/page_346/page_346.pde deleted file mode 100755 index a642b5c4c..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_346/page_346.pde +++ /dev/null @@ -1,19 +0,0 @@ - -// Based on code 39-03 (p. 349) - - -size(750, 2775); -background(255); -smooth(); -strokeWeight(1.0); - -for(int i = 20; i < height-50; i += 50) { - filter(BLUR, 1); - line(0, i, width, i+20); -} - -saveFrame("page_346.tif"); - - - - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_366/page_366.pde b/java/examples/Books/Processing Handbook/Illustrations/page_366/page_366.pde deleted file mode 100755 index 763a1cd2c..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_366/page_366.pde +++ /dev/null @@ -1,37 +0,0 @@ - -// Based on code 32-04 (p. 294) - - -float angle = 0.0; // Changing angle -float speed = 0.2; // Speed of growth - -void setup() { - size(200*11, 200*10); - noStroke(); - smooth(); - fill(0, 60); -} - -void draw() { - background(255); - - for(int y = 0; y < 10; y++) { - for(int i = 0; i < 11; i++) { - pushMatrix(); - translate(i*200, y*220); - circlePhase(0.0); - circlePhase(QUARTER_PI); - circlePhase(HALF_PI); - angle += speed; - popMatrix(); - } - - } - save("page_366.tif"); - exit(); -} - -void circlePhase(float phase) { - float diameter = 65 + (sin(angle + phase) * 130); - ellipse(100, 100, diameter, diameter); -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_394/page_394.pde b/java/examples/Books/Processing Handbook/Illustrations/page_394/page_394.pde deleted file mode 100755 index 23f66b34e..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_394/page_394.pde +++ /dev/null @@ -1,81 +0,0 @@ - -// Based on code 43-02 (p. 409) - -import processing.pdf.*; - -Ring[] rings; // Declare the array -int numRings = 50; -int currentRing = 0; - -boolean record = false; - -void setup() { - size(513, 666); - smooth(); - rings = new Ring[numRings]; // Construct the array - for (int i = 0; i < numRings; i++) { - rings[i] = new Ring(); // Construct each object - } -} - -void draw() { - if(record) { - beginRecord(PDF, "page_394-alt.pdf"); - } - - background(255); - for (int i = 0; i < numRings; i++) { - rings[i].grow(); - rings[i].display(); - } - - if(record) { - endRecord(); - record = false; - } - -} - -void keyPressed() { - record = true; -} - -// Click to create a new Ring -void mousePressed() { - rings[currentRing].start(mouseX, mouseY); - currentRing++; - if (currentRing >= numRings) { - currentRing = 0; - } -} - -class Ring { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the ring - boolean on = false; // Turns the display on and off - - void start(float xpos, float ypos) { - x = xpos; - y = ypos; - on = true; - diameter = 1; - } - - void grow() { - if (on == true) { - diameter += 0.5; - if (diameter > height*2) { - on = false; - } - } - } - - void display() { - if (on == true) { - noFill(); - strokeWeight(1); - stroke(102, 153); - ellipse(x, y, diameter, diameter); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_412/page_412.pde b/java/examples/Books/Processing Handbook/Illustrations/page_412/page_412.pde deleted file mode 100755 index 53b974596..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_412/page_412.pde +++ /dev/null @@ -1,29 +0,0 @@ - -// Based on code 44-01 (p. 414) - - -void setup() { - size(400, 666); - smooth(); -} - -void draw() { - if(mouseX != 0 && mouseY != 0 && pmouseX !=0 && pmouseY != 0) { - float s = dist(mouseX, mouseY, pmouseX, pmouseY) + 1; - noStroke(); - fill(0, 102); - ellipse(mouseX, mouseY, s, s); - stroke(255); - point(mouseX, mouseY); - } -} - -void mousePressed() { - beginRecord(PDF, "page_412.pdf"); - background(255); -} - -void mouseReleased() { - endRecord(); - exit(); -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_420/page_420.pde b/java/examples/Books/Processing Handbook/Illustrations/page_420/page_420.pde deleted file mode 100755 index ecdc57fd3..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_420/page_420.pde +++ /dev/null @@ -1,30 +0,0 @@ - -// Based on code 45-04 (p. 424) - -import processing.pdf.*; - -void setup() { - size(513, 666); -} - -void draw() { - if (mousePressed == true) { - point(mouseX, mouseY); - println("hi"); - } -} - -void mousePressed() { - beginRecord(PDF, "page_420.pdf"); - background(255); - stroke(0); - strokeCap(ROUND); -} - -void mouseReleased() { - endRecord(); -} - - - - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_476/ArrowParticle.pde b/java/examples/Books/Processing Handbook/Illustrations/page_476/ArrowParticle.pde deleted file mode 100755 index d53213436..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_476/ArrowParticle.pde +++ /dev/null @@ -1,26 +0,0 @@ -class ArrowParticle extends Particle { - float angle = 0.0; - float shaftLength = 20.0; - - ArrowParticle(int ix, int iy, float ivx, float ivy, float ir) { - super(ix, iy, ivx, ivy, ir); - } - - void update() { - super.update(); - angle = atan2(vy, vx); - } - - void display() { - stroke(0); - pushMatrix(); - translate(x, y); - rotate(angle); - scale(shaftLength); - strokeWeight(1.0/shaftLength); - line(0, 0, .25, 0); - line(.25, 0, .174, -.075); - line(.25, 0, .174, .075); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_476/Particle.pde b/java/examples/Books/Processing Handbook/Illustrations/page_476/Particle.pde deleted file mode 100755 index ff23912c2..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_476/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -class Particle { - float x, y; // X-coordinate, y-coordinate - float vx, vy; // X velocity, y velocity - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xpos, int ypos, float velx, float vely, float r) { - x = xpos; - y = ypos; - vx = velx; - vy = vely; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_476/page_476.pde b/java/examples/Books/Processing Handbook/Illustrations/page_476/page_476.pde deleted file mode 100755 index f08f7efe8..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_476/page_476.pde +++ /dev/null @@ -1,45 +0,0 @@ - -// Based on code 50-12 (p. 486) -// Requires Particle, ArrowParticle classes - -import processing.pdf.*; - -int num = 900; -ArrowParticle[] p = new ArrowParticle[num]; -float radius = 1.2; - -boolean record = false; - -void setup() { - size(513, 666); - strokeWeight(0.25); - smooth(); - for (int i = 0; i < p.length; i++) { - float velX = random(-1, 10); - float velY = random(-20, -6); - // Parameters: X, Y, X velocity, Y velocity, Radius - p[i] = new ArrowParticle(width/4, height, velX, velY, 0.4); - } -} - -void draw() { - if(record) { - beginRecord(PDF, "page_476-alt.pdf"); - } - background(255); - for (int i = 0; i < p.length; i++) { - p[i].update(); - p[i].display(); - } - if(record) { - endRecord(); - record = false; - } -} - - -void mousePressed() { - record = true; -} - - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_xx/page_xx.pde b/java/examples/Books/Processing Handbook/Illustrations/page_xx/page_xx.pde deleted file mode 100755 index ed2b00bb4..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_xx/page_xx.pde +++ /dev/null @@ -1,44 +0,0 @@ - -// Based on code 22-11 (p. 204) - - -import processing.pdf.*; - -int x; // X-coordinate -int y; // Y-coordinate -int r = 350; // Starting radius -int n = 8; // Number of recursions -int rs = 12; // Random seed value - -void setup() { - size(250, 925); - //size(250, 925, PDF, "page_xx.pdf"); - noStroke(); - smooth(); - randomSeed(rs); - y = int (height * 0.33); - x = width/2; - noLoop(); -} - -void draw() { - background(255); - drawCircle(x, y, r, n); - exit(); -} - -void drawCircle(float x, float y, int radius, int num) { - float value = 126 * num / 6.0; - fill(value, 153); - ellipse(x, y, radius*2, radius*2); - if (num > 1) { - num = num - 1; - int branches = int(random(2, 6)); - for (int i = 0; i < branches; i++) { - float a = random(0, TWO_PI); - float newx = x + cos(a) * 6.0 * num; - float newy = y + sin(a) * 6.0 * num; - drawCircle(newx, newy+26, radius/2, num); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_01_collage_01/Synthesis_01_collage_01.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_01_collage_01/Synthesis_01_collage_01.pde deleted file mode 100644 index a1fa62960..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_01_collage_01/Synthesis_01_collage_01.pde +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Synthesis 1: Form and Code, - * Collage Engine by Casey Reas (www.processing.org) - * p. 150 - * - * Step 1, working with one image. -*/ - -// Load the image -PImage nyt01 = loadImage("nyt_01.jpg"); - -float x, y; // Image position -float r; // Image rotation - -size(400, 300); -background(255); -tint(255, 204); - -x = random(width); // Set random x-coordinate -y = random(height); // Set random y-coordinate -r = random(0, TWO_PI); // Set random rotation -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt01, -nyt01.width/2, -nyt01.height/2); -popMatrix(); diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_01_collage_02/Synthesis_01_collage_02.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_01_collage_02/Synthesis_01_collage_02.pde deleted file mode 100644 index ec63f26f2..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_01_collage_02/Synthesis_01_collage_02.pde +++ /dev/null @@ -1,313 +0,0 @@ -/** - * Synthesis 1: Form and Code, - * Collage Engine by Casey Reas (www.processing.org) - * p. 150 - * - * Step 2, working with many images. - * - * More advanced code structures such - * as functions, arrays, and objects can make - * this code shorter. -*/ - - -PImage nyt01 = loadImage("nyt_01.jpg"); -PImage nyt02 = loadImage("nyt_02.jpg"); -PImage nyt03 = loadImage("nyt_03.jpg"); -PImage nyt04 = loadImage("nyt_04.jpg"); -PImage nyt05 = loadImage("nyt_05.jpg"); -PImage nyt06 = loadImage("nyt_06.jpg"); -PImage nyt07 = loadImage("nyt_07.jpg"); -PImage nyt08 = loadImage("nyt_08.jpg"); -PImage nyt09 = loadImage("nyt_09.jpg"); -PImage nyt10 = loadImage("nyt_10.jpg"); -PImage nyt11 = loadImage("nyt_11.jpg"); -PImage nyt12 = loadImage("nyt_12.jpg"); -PImage nyt13 = loadImage("nyt_13.jpg"); -PImage nyt14 = loadImage("nyt_14.jpg"); -PImage nyt15 = loadImage("nyt_15.jpg"); -PImage nyt16 = loadImage("nyt_16.jpg"); -PImage nyt17 = loadImage("nyt_17.jpg"); -PImage nyt18 = loadImage("nyt_18.jpg"); -PImage nyt19 = loadImage("nyt_19.jpg"); -PImage nyt20 = loadImage("nyt_20.jpg"); -PImage nyt21 = loadImage("nyt_21.jpg"); -PImage nyt22 = loadImage("nyt_22.jpg"); -PImage nyt23 = loadImage("nyt_23.jpg"); -PImage nyt24 = loadImage("nyt_24.jpg"); -PImage nyt25 = loadImage("nyt_25.jpg"); -PImage nyt26 = loadImage("nyt_26.jpg"); -PImage nyt27 = loadImage("nyt_27.jpg"); -PImage nyt28 = loadImage("nyt_28.jpg"); -PImage nyt29 = loadImage("nyt_29.jpg"); - -float x, y, r; - -size(600, 600); -smooth(); -background(255); -tint(255, 204); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt01, -nyt01.width/2, -nyt01.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt02, -nyt02.width/2, -nyt02.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt03, -nyt03.width/2, -nyt03.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt04, -nyt04.width/2, -nyt04.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt05, -nyt05.width/2, -nyt05.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt06, -nyt06.width/2, -nyt06.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt07, -nyt07.width/2, -nyt07.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt08, -nyt08.width/2, -nyt08.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt09, -nyt09.width/2, -nyt09.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt10, -nyt10.width/2, -nyt10.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt11, -nyt11.width/2, -nyt11.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt12, -nyt12.width/2, -nyt12.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt13, -nyt13.width/2, -nyt13.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt14, -nyt14.width/2, -nyt14.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt15, -nyt15.width/2, -nyt15.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt16, -nyt16.width/2, -nyt16.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt17, -nyt17.width/2, -nyt17.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt18, -nyt18.width/2, -nyt18.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt19, -nyt19.width/2, -nyt19.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt20, -nyt20.width/2, -nyt20.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt21, -nyt21.width/2, -nyt21.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt22, -nyt22.width/2, -nyt22.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt23, -nyt23.width/2, -nyt23.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt24, -nyt24.width/2, -nyt24.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt25, -nyt25.width/2, -nyt25.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt26, -nyt26.width/2, -nyt26.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt27, -nyt27.width/2, -nyt27.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt28, -nyt28.width/2, -nyt28.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt29, -nyt29.width/2, -nyt29.height/2); -popMatrix(); - - -// saveFrame("Synthesis-1--" + int(random(0, 1000)) + ".tif"); diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_01/Synthesis_02_waves_01.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_01/Synthesis_02_waves_01.pde deleted file mode 100644 index 31d2dd90f..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_01/Synthesis_02_waves_01.pde +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Synthesis 1: Form and Code - * Riley Waves by Casey Reas (www.processing.org) - * p. 151 - * - * Step 1, creating the basic form. -*/ - - -size(400, 400); -background(255); -float angle = 0.0; -float magnitude = 24.0; - -beginShape(TRIANGLE_STRIP); -for(int x=0; x<=width; x=x+8) { - float y = 50 + (sin(angle)* magnitude); - angle += PI/48.0; - float y2 = 70 + (sin(angle+PI/6)* magnitude); - vertex(x, y); - vertex(x, y2); -} -endShape(); diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_02/Synthesis_02_waves_02.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_02/Synthesis_02_waves_02.pde deleted file mode 100644 index b923a3b55..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_02/Synthesis_02_waves_02.pde +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Synthesis 1: Form and Code - * Riley Waves by Casey Reas (www.processing.org) - * p. 151 - * - * Step 2, the basic form is drawn many times inside a for structure. -*/ - - -size(400, 400); -background(255); -float angle = 0.0; -int magnitude = 18; - -for(int i =- magnitude; i < height+magnitude; i = i+24) { - - beginShape(TRIANGLE_STRIP); - for(int x = 0; x <= width; x = x+8) { - float y = i + (sin(angle)* magnitude); - angle += PI/24.0; - float y2 = i+10 + (sin(angle+PI/12) * magnitude); - vertex(x, y); - vertex(x, y2); - } - endShape(); - -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_03/Synthesis_02_waves_03.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_03/Synthesis_02_waves_03.pde deleted file mode 100644 index 5932fa877..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_03/Synthesis_02_waves_03.pde +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Synthesis 1: Form and Code - * Riley Waves by Casey Reas (www.processing.org) - * p. 151 - * - * Step 3, values are modified to create a new pattern. -*/ - - -size(1200, 280); -background(255); -smooth(); -noStroke(); -float angle = 0.0; -float angle2 = 0.0; -int magnitude = 8; - -for(int i = -magnitude; i < height+magnitude; i = i+18) { - - angle2 = angle; - - fill(0); - beginShape(TRIANGLE_STRIP); - for(int x=0; x<=width; x=x+8) { - float y = i + (sin(angle)* magnitude); - angle += PI/24.0; - float y2 = i+4 + (sin(angle+PI/12)* magnitude); - vertex(x, y); - vertex(x, y2); - } - endShape(); - - fill(204); - beginShape(TRIANGLE_STRIP); - for(int x=0; x<=width; x=x+8) { - float y = i+4 + (sin(angle2+PI/12)* magnitude); - angle2 += PI/24.0; - float y2 = i+8 + (sin(angle2+PI/12)* magnitude); - vertex(x, y); - vertex(x, y2); - } - endShape(); - - /* - fill(0); - beginShape(TRIANGLE_STRIP); - for(int x=0; x<=width; x=x+8) { - float y = i + (sin(angle)* magnitude); - angle += PI/16.0; - float y2 = i+4 + (sin(angle+PI/24)* magnitude); - vertex(x, y); - vertex(x, y2); - } - endShape(); - - fill(204); - beginShape(TRIANGLE_STRIP); - for(int x=0; x<=width; x=x+8) { - float y = i+4 + (sin(angle2+PI/24)* magnitude); - angle2 += PI/16.0; - float y2 = i+8 + (sin(angle2+PI/24)* magnitude); - vertex(x, y); - vertex(x, y2); - } - endShape(); - */ -} - - -// save("Synthesis-2--1.tif"); diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_04/Synthesis_02_waves_04.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_04/Synthesis_02_waves_04.pde deleted file mode 100644 index fb80ac2bd..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_04/Synthesis_02_waves_04.pde +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Synthesis 1: Form and Code - * Riley Waves by Casey Reas (www.processing.org) - * p. 151 - * - * Step 3, values are modified to create a new pattern. -*/ - - -size(1200, 280); -background(255); -smooth(); -noStroke(); -fill(0); -float angle = 0.0; -int magnitude = 16; - -for(int i = -magnitude; i < width+magnitude; i = i+16) { - - fill(float(i)/width * 255); - - beginShape(TRIANGLE_STRIP); - for(int y = 0; y <= height; y = y+6) { - float x = i + (sin(angle)* magnitude); - angle += PI/22.0; - float x2 = i+8 + (sin(angle+PI/22)* magnitude); - vertex(x, y); - vertex(x2, y); - } - endShape(); - -} - -// saveFrame("Synthesis-2--2.tif"); diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_05/Synthesis_02_waves_05.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_05/Synthesis_02_waves_05.pde deleted file mode 100644 index 423453ad9..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_05/Synthesis_02_waves_05.pde +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Synthesis 1: Form and Code - * Riley Waves by Casey Reas (www.processing.org) - * p. 151 - * - * Step 3, values are modified to create a new pattern. -*/ - - -size(1200, 280); -background(255); -smooth(); -noStroke(); -//fill(0); -float angle = PI; -float angle2 = PI; -int magnitude = 3; - -for(int i = -magnitude; i < height+magnitude; i = i+12) { - - angle2 = angle; - - fill(0); - beginShape(TRIANGLE_STRIP); - for(int x = 0; x <= width; x = x+8) { - float y = i + (sin(angle)* magnitude); - angle += PI/24.0; - float y2 = i+4 + (sin(angle+PI/12)* magnitude); - vertex(x, y); - vertex(x, y2); - } - endShape(); - -} - - -// save("Synthesis-2--3.tif"); diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_01/Synthesis_03_grids_01.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_01/Synthesis_03_grids_01.pde deleted file mode 100644 index fe719e4f3..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_01/Synthesis_03_grids_01.pde +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Synthesis 1: Form and Code - * Wilson Grids by Casey Reas (www.processing.org) - * p. 152 - * - * Step 1, basic embedded for structure. -*/ - - -size(600, 600); -background(255); -int sqNum = 12; -int sqSize = width/sqNum; -int halfSize = sqSize/2; - -for (int y = halfSize; y < width; y = y+sqSize) { - for (int x = halfSize; x < height; x = x+sqSize) { - rect(x-halfSize+2, y-halfSize+2, sqSize-4, sqSize-4); - } -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_02/Synthesis_03_grids_02.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_02/Synthesis_03_grids_02.pde deleted file mode 100644 index 8f5b4a361..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_02/Synthesis_03_grids_02.pde +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Synthesis 1: Form and Code - * Wilson Grids by Casey Reas (www.processing.org) - * p. 152 - * - * Step 2, textures inside the grid by adding a third for structure. -*/ - - -size(600, 600); -background(255); -int numSquares = 12; -int gap = 4; -int sqSize = (width-gap*2)/numSquares; -int halfSize = sqSize/2; -int offset = halfSize+gap; -int ydiv = sqSize/12; - -for(int y = 0; y < numSquares; y++) { - for(int x = 0; x < numSquares; x++) { - float xp = offset + (x*sqSize); - float yp = offset + (y*sqSize); - for(int i=0; i<=sqSize-gap*2; i=i+ydiv) { - float yy = i*halfSize+gap+i; - line(xp-halfSize+gap, yp-halfSize+gap+i, xp+halfSize-gap, yp-halfSize+gap+i); - } - } - -} - diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_03/Synthesis_03_grids_03.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_03/Synthesis_03_grids_03.pde deleted file mode 100644 index 9d4d5f670..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_03/Synthesis_03_grids_03.pde +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Synthesis 1: Form and Code - * Wilson Grids by Casey Reas (www.processing.org) - * p. 152 - * - * Step 3, changing the size of each grid element. -*/ - - -size(600, 600); -background(0); -stroke(255, 204); -int numSquares = 6; -int gap = 8; -int sqSize = (width-gap*2)/numSquares; - -for (float y=0; y 2 ) { - co = 1 - k/float(accuracy); - break; // NOTE: This is new syntax!!! - } - } - stroke(color(255*co, 255*co, 255*co)); - point(i, j); - } -} - - -// save("Synthesis-04--" + zoom + ".tif"); diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_05_tennis/Synthesis_05_tennis.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_05_tennis/Synthesis_05_tennis.pde deleted file mode 100644 index 4dc267f43..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_05_tennis/Synthesis_05_tennis.pde +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Synthesis 2: Input and Response - * Tennis by Casey Reas (www.processing.org) - * p. 256 - * - * Only the right paddle works. As a challenge, try to - * add code to activate the left paddle. You can make decide to make - * it a one-player or two-player game. As an additional challenge, - * have the program keep score. - */ - - -int ballX; -int ballY; -int ballDir = 1; -int ballSize = 10; // Radius -float ballAngle = 0.0; // Direction - -// Global variables for the paddle -int paddleWidth = 20; -int paddleHeight = 40; - -int wallGap = 50; - -int netSegment; - -void setup() { - size(640, 480); - noStroke(); - ballY = height/2; - ballX = 0; - noCursor(); - netSegment = height/32; -} - -void draw() { - background(0); - - stroke(255); - // Draw Net - for(int i=0; i width+ballSize*2) { - ballX = -ballSize; - ballY = int(random(0, height-ballSize)); - ballAngle = 0; - println(ballX + ":" + ballY + ":" + ballAngle); - } - - if(ballX < -ballSize*2) { - ballX = width; - ballY = int(random(0, height-ballSize)); - ballAngle = 0; - println(ballX + ":" + ballY + ":" + ballAngle); - } - - // Constrain paddle to screen - float paddleY = constrain(mouseY, 0, height-paddleHeight); - - // Test to see if the ball is touching the paddle - float py = width-wallGap-ballSize; - if(ballX >= py && ( ballY+ballSize >= paddleY && ballY <= paddleY + paddleHeight)) { - - ballDir *= -1; - if(mouseY != pmouseY) { - ballAngle = (mouseY-pmouseY)/2.0; - ballAngle = constrain(ballAngle, -5, 5); - } - } - - // If ball hits back wall, reverse direction - if(ballX < 0) { - ballDir *= -1; - } - - // If the ball is touching top or bottom edge, reverse direction - if((ballY > height-ballSize) || (ballY < 0)) { - ballAngle = ballAngle * -1; - } - - // Draw ball - fill(255); - rect(ballX, ballY, ballSize, ballSize); - - // Draw the paddle - fill(153); - rect(width-wallGap, paddleY, paddleWidth, paddleHeight); - - // Draw the paddle - rect(wallGap, height-paddleY-paddleHeight, paddleWidth, paddleHeight); -} - - -void keyPressed() { - //saveFrame("pong-####.tif"); -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_06_cursor/Synthesis_06_cursor.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_06_cursor/Synthesis_06_cursor.pde deleted file mode 100644 index ef52995ee..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_06_cursor/Synthesis_06_cursor.pde +++ /dev/null @@ -1,304 +0,0 @@ -/** - * Synthesis 2: Input and Response - * Cursor by Peter Cho (www.typotopo.com) - * p. 257 - * - * There are four modes, each is a different - * way to use the input from the mouse to control - * the cursor(s). Click on a number to select that - * mode. - */ - - -PFont fontA; -int gx, gy; -int mode, nextmode; -int nummodes; -boolean forapplet = false; - -float mx, my, lastmx, lastmy; -float lastrot, lastsc; - -float bgx, bgy; - - -float p_x, p_y; -float p_fx, p_fy; -float p_v2, p_vx, p_vy; -float p_a2, p_ax, p_ay; -float p_mass, p_drag; - - -void setup() -{ - size(600, 600); - gx = width; - gy = height; - size(gx, gy); - colorMode(RGB, 1.0); - strokeWeight(1.3); - loop(); - smooth(); - strokeJoin(ROUND); - - init_particle(0.6, 0.9, width/2, height/2); - - fontA = loadFont("NewsGothicBT-Bold-48.vlw"); - nummodes = 4; - mode = 1; - - bgx = 0; - bgy = 0; - mx = gx/2; - my = gy/2; - - noCursor(); - - if (forapplet) { - cursor(CROSS); - } -} - - -void init_particle(float _mass, float _drag, float ox, float oy) -{ - p_x = ox; - p_y = oy; - p_v2 = 0.0f; - p_vx = 0.0f; - p_vy = 0.0f; - p_a2 = 0.0f; - p_ax = 0.0f; - p_ay = 0.0f; - p_mass = _mass; - p_drag = _drag; -} - -void iterate_particle(float fkx, float fky) -{ - // iterate for a single force acting on the particle - p_fx = fkx; - p_fy = fky; - p_a2 = p_fx*p_fx + p_fy*p_fy; - if (p_a2 < 0.0000001) return; - p_ax = p_fx/p_mass; - p_ay = p_fy/p_mass; - p_vx += p_ax; - p_vy += p_ay; - p_v2 = p_vx*p_vx + p_vy*p_vy; - if (p_v2 < 0.0000001) return; - p_vx *= (1.0 - p_drag); - p_vy *= (1.0 - p_drag); - p_x += p_vx; - p_y += p_vy; -} - -void drawCursor(float x, float y, float myscale, float myrot) { - // draw generic arrow cursor - if (forapplet) y -= gy/2; - pushMatrix(); - translate(x, y); - rotate(myrot); - scale(myscale, myscale); - beginShape(POLYGON); - vertex(7, 21); - vertex(4, 13); - vertex(1, 16); - vertex(0, 16); - vertex(0, 0); // tip of cursor shape - vertex(1, 0); - vertex(12, 11); - vertex(12, 12); - vertex(7, 12); - vertex(10, 20); - vertex(9, 21); - vertex(7, 21); - endShape(); - popMatrix(); -} - -void blurdot(float x, float y, float sc) { - ellipse(x, y, sc*5, sc*5); - ellipse(x, y, sc*23, sc*23); - ellipse(x, y, sc*57, sc*57); - ellipse(x, y, sc*93, sc*93); -} - -void drawBlurCursor(float x, float y, float myscale, float dotval) { - // draw generic arrow cursor - if (forapplet) y -= gy/2; - pushMatrix(); - translate(x, y); - scale(myscale, myscale); - float dotval2 = .5 + (1-dotval)*5; - dotval = .5 + (1-dotval)*9; - blurdot(7, 21, dotval2); - blurdot(1, 16, dotval); - blurdot(0, 8, dotval2); // midpt - blurdot(0, 0, dotval); // tip of cursor shape - blurdot(1, 0, dotval2); - blurdot(6, 6, dotval); // midpt - blurdot(12, 12, dotval2); - blurdot(10, 20, dotval); - popMatrix(); -} - - -int n = 1; -void keyPressed() { - if (key == '1') { - mode = 1; - } else if (key == '2') { - mode = 2; - } else if (key == '3') { - mode = 3; - } else if (key == '4') { - mode = 4; - } - - // saveFrame("cursor--" + mode + "-" + n + ".tif"); - n++; -} - -boolean isInside(float x, float y, float rx, float ry, float rw, float rh) { - return (x >= rx && x <= rx+rw && y >= ry && y <= ry+rh); -} - -void scrollbg(float x, float y) { - // scroll the bg - float amt = 30; - if (x < gx*.5) { - bgx += amt*(gx*.5 - x)*(gx*.5 - x)/(gx*gx); - } else if (x > gx - gx*.5) { - bgx -= amt*(x - (gx-gx*.5))*(x - (gx-gx*.5))/(gx*gx); - } - bgx = bgx % gx; - if (bgx < 0) bgx += gx; - - if (y < gy*.5) { - bgy += amt*(gy*.5 - y)*(gy*.5 - y)/(gy*gy); - } else if (y > gy - gy*.5) { - bgy -= amt*(y - (gy-gy*.5))*(y - (gy-gy*.5))/(gy*gy); - } - bgy = bgy % gy; - if (bgy < 0) bgy += gy; -} - -void draw() -{ - lastmx = mx; - lastmy = my; - - mx = mouseX; - my = mouseY; - - if (mode == 3) { - mx = mx*.01 + lastmx*.99; - my = my*.01 + lastmy*.99; - - } else if (mode == 4) { - mx = mx*.25 + lastmx*.75; - my = my*.25 + lastmy*.75; - - } else { - mx = mx*.5 + lastmx*.5; - my = my*.5 + lastmy*.5; - } - - iterate_particle(.15*(-p_x+mx), .15*(-p_y+my)); - scrollbg(p_x, p_y); - - background(.8,.8,.8); - // Set the font and its size (in units of pixels) - textFont(fontA, 24); - - float x, y; - int w=95, h=75; - for (int i=0; i 5) { - mode = 1; - } - } - else if (key == BACKSPACE) { - if(mode == 1) { - if(text1.length() > 0) { - text1 = text1.substring(0, text1.length() - 1); - } - } - else if (mode ==2 ) { - if(text2.length() > 0) { - text2 = text2.substring(0, text2.length() - 1); - } - } - else if (mode == 3) { - if(text3.length() > 0) { - text3 = text3.substring(0, text3.length() - 1); - } - } - else if (mode == 4) { - if(text4.length() > 0) { - text4 = text4.substring(0, text4.length() - 1); - } - } - else if (mode == 5) { - if(text5.length() > 0) { - text5 = text5.substring(0, text5.length() - 1); - } - } - } - else { - if(mode == 1) { - text1 += key; - } - else if (mode ==2 ) { - text2 += key; - } - else if (mode == 3) { - text3 += key; - } - else if (mode == 4) { - text4 += key; - } - else if (mode == 5) { - text5 += key; - } - } -} - -void mousePressed() { - mx = mouseX; - my = mouseY; -} - -void mouseMoved() { - x = mouseX; - y = mouseY; - mx = mouseX; - my = mouseY; - - if(mode == 1) { - x1 = x; - y1 = y; - } - else if (mode ==2 ) { - x2 = x; - y2 = y; - } - else if (mode == 3) { - x3 = x; - y3 = y; - } - else if (mode == 4) { - x4 = x; - y4 = y; - } - else if (mode == 5) { - x5 = x; - y5 = y; - } -} - -void mouseDragged() { - //float mr = float(mouseX - mx) / width * TWO_PI; - - - float mr = atan2(mouseY-my, mouseX-mx); - //float ms = abs(float(mouseY-my) / height * 5.0) + 0.25; - float ms = dist(mouseX, mouseY, mx, my) / 100.0; - if(mode == 1) { - r1 = mr; - s1 = ms; - } - else if (mode ==2 ) { - r2 = mr; - s2 = ms; - } - else if (mode == 3) { - r3 = mr; - s3 = ms; - } - else if (mode == 4) { - r4 = mr; - s4 = ms; - } - else if (mode == 5) { - r5 = mr; - s5 = ms; - } -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_07_typing/data/TheSerif-Plain-128.vlw b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_07_typing/data/TheSerif-Plain-128.vlw deleted file mode 100644 index d03189b65..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_07_typing/data/TheSerif-Plain-128.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_07_typing/data/TheSerif-Plain-96.vlw b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_07_typing/data/TheSerif-Plain-96.vlw deleted file mode 100644 index 246476063..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_07_typing/data/TheSerif-Plain-96.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_08_clock/Synthesis_08_clock.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_08_clock/Synthesis_08_clock.pde deleted file mode 100644 index c11ce559d..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_08_clock/Synthesis_08_clock.pde +++ /dev/null @@ -1,190 +0,0 @@ -/** - * Synthesis 2: Input and Response - * Banded Clock by Golan Levin (www.flong.com) - * p. 259 - * - * - * - */ - - -//================================================ -int prevX = 0; -int prevY = 0; -int clickX = 0; -int clickY = 0; - -final int NCOLORS = 256; -color colorArray[]; -float S, M, H; -int Scolors[]; -int Mcolors[]; -int Hcolors[]; -int ys0, ys1; -int ym0, ym1; -int yh0, yh1; - -float Soffset = 0; -float Hoffset = 0; -float Moffset = 0; -float Svel = 0; -float Hvel = 0; -float Mvel = 0; -float damp = 0.94f; - -int mil, sec, minut, hou; -int milError = 0; -int canvasWidth; -int canvasHeight; - -//================================================ -void setup(){ - - size(600, 600); - canvasWidth = width; - canvasHeight = height; - - Scolors = new int[canvasWidth]; - Mcolors = new int[canvasWidth]; - Hcolors = new int[canvasWidth]; - colorArray = new color[NCOLORS]; - for (int i=0; i sec){ - milError = millis()%1000; - } -} - -//------------------ -float GMOD (float A, float B){ - return (float)(A - (floor(A/B)*B)); -} - -//------------------ -int wave(float a){ - // inexpensive ramp function, - // but not as nice as true sine wave (below) - int val = 0; - float cscale = 2.0f*255.0f; - if (a < 0.5){ - val = (int) round (a *cscale); - } - else { - val = (int) round ((1.0f-a)*cscale); - } - return val; -} - -//------------------ -int sinWave (float a){ - // expensive trigonometric function, but nicer looking - float sina = (1.0+sin(TWO_PI*a))*255.0/2.0; - int val = (int)round(sina); - return val; -} - -//-------------------------------------------------------------------------- -// interaction methods - -void mousePressed (){ - prevX = mouseX; - prevY = mouseY; - clickX = mouseX; - clickY = mouseY; -} - -void mouseDragged() { - // allow bands to be shifted around, for "fun" - float accel = (prevX - mouseX)*0.004f; - if ((clickY >= ys0) && (clickY < ys1)){ - Svel += accel; - } - else if ((clickY >= ym0) && (clickY < ym1)){ - Mvel += accel; - } - else if ((clickY >= yh0) && (clickY < yh1)){ - Hvel += accel; - } - prevX = mouseX; - prevY = mouseY; -} - - - - -void keyPressed() { - saveFrame("clock--" + hour() + "-" + minute() + "-" + second() + ".tif"); -} - - diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_09_centipede/Synthesis_09_centipede.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_09_centipede/Synthesis_09_centipede.pde deleted file mode 100644 index 76959237a..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_09_centipede/Synthesis_09_centipede.pde +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Synthesis 3: Motion and Arrays - * Centipede by Ariel Malka (www.chronotext.org) - * p. 372 - */ - - -float x, y; -float node_length = 30; -float node_size = node_length-1; -int n_nodes = 70; -float[] nodes_x; -float[] nodes_y; -float delay = 20; -color col_head = color(255, 0, 0); -color col_body = color(0); - - -void setup() -{ - size(600, 600); - smooth(); - noStroke(); - - x = width/2; - y = height/2; - - int r1 = 10; - int r2 = 100; - int dr = r2-r1; - float D = 0; - - nodes_x = new float[n_nodes]; - nodes_y = new float[n_nodes]; - - for (int i=0; i= 0) && (mouseX < width) && (mouseY >= 0) && (mouseY < height)){ - drawline(mouseX, mouseY, pmouseX, pmouseY); - if (fat) { - drawthickline(mouseX, mouseY, pmouseX, pmouseY, 2); - drawdot(mouseX+1, mouseY); - drawdot(mouseX, mouseY+1); - drawdot(mouseX, mouseY-1); - drawdot(mouseX-1, mouseY); - drawdot(mouseX+1, mouseY-1); - drawdot(mouseX+1, mouseY+1); - drawdot(mouseX-1, mouseY-1); - drawdot(mouseX-1, mouseY+1); - } - } - } - - // draw frames - int p = currentpic; - for (int j=0; j= framerest) { - framecounter = 0; - currentpic--; - if (currentpic < 0) { - currentpic = buflength - 1; - } - } - - // btncheck - if (keyPressed && key==' ') { - btnheight = height / 2; - if (mouseY < btnheight && mouseY >=0){ - framestep = - int(btnreso / 2) + int(mouseX/(width/btnreso)); - //println(framestep); - } else if (mouseY > btnheight && mouseY < height){ - framerest = int(mouseX/(width/btnreso))*btnresomulti; - } - } else { - btnheight = 8; - } - - // drawgrid - if (grid) { - drawgrid(); - } - - // drawbtn1 - noStroke(); - fill(0,0,255,60); - int btnxoffset = width/btnreso * (btnreso / 2 + framestep); - rect(btnxoffset, 0, width/btnreso, btnheight); - - // drawbtn2 - fill(255,0,0,60); - btnxoffset = width/btnreso * framerest / btnresomulti; - rect(btnxoffset, height - btnheight, width/btnreso, btnheight); -} - -void clearall(){ - for (int i=0; i=sizey) { - y=sizex>>1; - for(int i=0;i=sizex) { - y-=sizex; - county+=incy; - } - countx+=incx; - drawdot(countx, county); - } - } else { - x=sizey>>1; - for(int i=0;i=sizey) { - x-=sizey; - countx+=incx; - } - county+=incy; - drawdot(countx, county); - } - } -} - - -//idem -void drawthickline(int x1, int y1, int x2, int y2, int thickness) { - - int dX = x2 - x1; - int dY = y2 - y1; - - double lineLength = Math.sqrt(dX * dX + dY * dY); - double scale = (double)(thickness) / (2 * lineLength); - double ddx = -scale * (double)dY; - double ddy = scale * (double)dX; - ddx += (ddx > 0) ? 0.5 : -0.5; - ddy += (ddy > 0) ? 0.5 : -0.5; - int dx = (int)ddx; - int dy = (int)ddy; - - int xPoints[] = new int[4]; - int yPoints[] = new int[4]; - - xPoints[0] = x1 + dx; yPoints[0] = y1 + dy; - xPoints[1] = x1 - dx; yPoints[1] = y1 - dy; - xPoints[2] = x2 - dx; yPoints[2] = y2 - dy; - xPoints[3] = x2 + dx; yPoints[3] = y2 + dy; - - drawline(xPoints[0], yPoints[0], xPoints[1], yPoints[1]); - drawline(xPoints[1], yPoints[1], xPoints[2], yPoints[2]); - drawline(xPoints[2], yPoints[2], xPoints[3], yPoints[3]); - drawline(xPoints[3], yPoints[3], xPoints[0], yPoints[0]); -} - - - diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_11_amoebaAbstract/Synthesis_11_amoebaAbstract.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_11_amoebaAbstract/Synthesis_11_amoebaAbstract.pde deleted file mode 100644 index 607b23578..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_11_amoebaAbstract/Synthesis_11_amoebaAbstract.pde +++ /dev/null @@ -1,175 +0,0 @@ -/** - * Synthesis 3: Motion and Arrays - * AmoebaAbstract_03 by Marius Watz - * p. 374 - * - * Move the mouse to control the speed of the elements. Click to - * restart with different colors. - * - * Notes from Marius: - * Abstract computational animation for the exhibition "Abstraction Now", - * Kunstlerhaus Vienna, 29.08-28.09 2003. - * You are allowed to play with this code as much as you like, but - * you may not publish pieces based directly on it. -*/ - - -int num,cnt,colNum,colScheme; -float h,maxSpeed; -float[] x,y,speed; -boolean initialised; -float[] colR,colG,colB; - -void setup() { - size(700, 400); - background(255); - smooth(); - frameRate(30); - - cnt=0; - maxSpeed=8; - num=20; - x=new float[num]; - y=new float[num]; - speed=new float[num]; - h=height/num; - for(int i=0; i50) speed[i]=-speed[i]; - } - noStroke(); - - colR=new float[1000]; - colG=new float[1000]; - colB=new float[1000]; - - colScheme=-1; - initColors(); -} - -void draw() { - int c; - - cnt++; - for(int i=0; i width) { - x[i] -= width; - } - - c = ((i*11+cnt*3+int(speed[i]*10))/20)%colNum; - if(c<0) { - c=0; - } - fill(colR[c],colG[c],colB[c],150); - - if(i%2==0) { - rect(x[i]%width, y[i], 6, h); - } - else { - ellipse(x[i]%width, y[i]+h/2, h-6, h-6); - } - } - - stroke(255,255,255,10); - noFill(); - strokeWeight(2); - for(int i=0; i < num-3; i++) { - line(x[i], y[i]+h/2, x[(i+3)%num], y[(i+3)%num]+h/2); - line(x[num-i-1], y[num-i-1]+h/2, x[(num-i-2)%num], y[(num-i-2)%num]+h/2); - } - noStroke(); - fill(255); - rect(0, 0, 2, height); - rect(width-2, 0, 2, height); -} - -void initColors() { - colNum=0; - colScheme=(colScheme+1)%3; - if(colScheme==0) { - addColor(12, 100,200,255, 50,100,128); - addColor(8, 26,41,58, 50,100,128); - addColor(2, 255,255,255, 255,255,255); - addColor(16, 0,0,50, 40,40,80); - addColor(12, 100,200,255, 50,100,128); - addColor(8, 26,41,58, 50,100,128); - addColor(6, 0,200,20, 0,255,100); - addColor(2, 255,255,255, 255,255,255); - addColor(16, 0,0,50, 40,40,80); - addColor(5, 255,200,0, 255,170,0); - } - else if(colScheme==1) { - addColor(20, 255,0,100, 128,0,0); - addColor(6, 255,100,0, 255,150,0); - addColor(6, 128,0,0, 50,20,20); - addColor(12, 255,255,255, 255,100,100); - addColor(4, 255,100,0, 102,0,0); - } - else if(colScheme==2) { - addColor(14, 128,163,120, 27,53,38); - addColor(8, 64,95,0, 225,227,0); - addColor(8, 0,150,150, 215,255,255); - addColor(4, 168,106,170, 235,183,237); - addColor(14, 128,163,120, 27,53,38); - addColor(8, 64,95,0, 225,227,0); - addColor(8, 0,150,150, 215,255,255); - addColor(12, 92,18,96, 217,111,226); - } -} - -void addColor(float r,float g,float b) { - colR[colNum]=r; - colG[colNum]=g; - colB[colNum]=b; - colNum++; -} - -void addColor(int num, float r1,float g1,float b1, float r2,float g2,float b2) { - - r2=(r2-r1)/float(num-1); - g2=(g2-g1)/float(num-1); - b2=(b2-b1)/float(num-1); - - for(int i=0; i20 && abs(mx-mouseX)>5){ - image (body,0,135); - image (head,0,sinval*20-40); - } - else{ - image (body2,0,135); - image (head2,0,sinval*20-40); - } - interpolate(); - popMatrix(); - pushMatrix(); - if (abs(my-mouseY)>20 && abs(mx-mouseX)>5){ - battery(true); - } - else{ - battery (false); - } - popMatrix(); -} - -void battery(boolean test){ - if (test==true){ - image (batt, mouseX-50, mouseY-20); - } - else{ - image (batteat, mouseX-50+random(-20,20), mouseY-20+random(-20,20)); - } -} - -void interpolate(){ - float diffx = mouseX-mx; - if(abs(diffx) > 1) { - mx = mx + diffx/delay; - } - float diffy = mouseY-my; - if(abs(diffy) > 1) { - my = my + diffy/delay; - } -} - -void keyPressed() { - // saveFrame("robot-####.tif"); -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/battalpha.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/battalpha.gif deleted file mode 100644 index 8c2ed3ea0..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/battalpha.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/batteat.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/batteat.gif deleted file mode 100644 index 36a12ae34..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/batteat.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/batteatalpha.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/batteatalpha.gif deleted file mode 100644 index 19ce7a9be..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/batteatalpha.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/headalpha.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/headalpha.gif deleted file mode 100644 index 0527d026f..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/headalpha.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/Module.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/Module.pde deleted file mode 100644 index 83b628975..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/Module.pde +++ /dev/null @@ -1,18 +0,0 @@ - -class Module { - int i; - float x, y, myAngle, myRadius, dir; - float mx = width/2; - float my = height/2; - float delay = 40.0; - - Module(int spriteNum, float xx, float yy, float deg, float rad, float pp) { - i = spriteNum; - x = xx; - y = yy; - myAngle = deg; - myRadius = rad; - dir = pp; - } - -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/ModuleA.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/ModuleA.pde deleted file mode 100644 index 4743b5b66..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/ModuleA.pde +++ /dev/null @@ -1,33 +0,0 @@ - -class ModuleA extends Module { - - ModuleA(int spriteNum, float xx, float yy, float deg, float rad, float pp) { - super(spriteNum, xx, yy, deg, rad, pp); - } - - void updateMe() { - float mh = x - mouseX; - float mv = y - mouseY; - float mdif = sqrt(mh*mh+mv*mv); - float dh = width/2 - mouseX; - float dv = height/2 - mouseY; - float ddif = sqrt(dh*dh+dv*dv); - if(dir == 1){ - myAngle += abs(ddif - mdif)/50.0; - } - else{ - myAngle -= abs(ddif - mdif)/50.0; - } - myRadius += mdif/100.00; - if(myRadius > width){ - myRadius = random(10,40); - } - mx += (mouseX - mx)/delay; - my += (mouseY - my)/delay; - x = mx + (myRadius * cos(radians(myAngle))); - y = my + (myRadius * sin(radians(myAngle))); - stroke(num/(i+1), num/(i+1), num/(i+1)); - point(x,y); - } - -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/ModuleB.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/ModuleB.pde deleted file mode 100644 index 50bb85667..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/ModuleB.pde +++ /dev/null @@ -1,27 +0,0 @@ - -class ModuleB extends Module { - - ModuleB(int spriteNum, float xx, float yy, float deg, float rad, float pp) { - super(spriteNum, xx, yy, deg, rad, pp); - } - - void updateMe(){ - mx += (mouseX - mx)/delay; - my += (mouseY - my)/delay; - x = mx + (myRadius * cos(radians(myAngle))); - y = my + (myRadius * sin(radians(myAngle))); - stroke(num/2, num/2, num/2); - point(x,y); - - // from connectMe2 - noStroke(); - fill(0, num/7.0, num/(i+1)+num/4.0, 20); - beginShape(QUADS); - vertex(modsA[i].x, modsA[i].y); - vertex(modsA[i].x+1, modsA[i].y+1); - vertex(x, y); - vertex(x+1, y+1); - endShape(); - } - -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/Synthesis_13_withoutTitle.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/Synthesis_13_withoutTitle.pde deleted file mode 100644 index 1e5ccb570..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/Synthesis_13_withoutTitle.pde +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Synthesis 4: Structure and Interface - * WithoutTitle by Lia (http://lia.sil.at) - * p. 496 - * - * Move the mouse to create the drawing. Click to refresh the window. - */ - - -int num = 50; -ModuleA[] modsA; -ModuleB[] modsB; -boolean initialized = false; - -void setup() { - size(600, 600); - colorMode(RGB, num); - background(num); - smooth(); - - modsA = new ModuleA[num]; - modsB = new ModuleB[num]; - - for (int i=0; i 0.5) { - qq = 1; - } else { - qq = -1; - } - float x = random(width); - float y = random(height); - float angle = random(360); - float direction = random(10, 40); - modsA[i] = new ModuleA(i, x, y, angle, direction, qq); - modsB[i] = new ModuleB(i, x, y, angle, direction, qq); - } - -} - -void draw() { - if(initialized == true){ - for (int i=0; i width) || (modsA[i].y < 0) || (modsA[i].y > height) ){ - modsA[i].x = mouseX; - modsA[i].y = mouseY; - modsB[i].x = mouseX; - modsB[i].y = mouseY; - float a = random(360); - modsA[i].myAngle = a; - modsB[i].myAngle = a; - float r = random(10, 40); - modsA[i].myRadius = r; - modsB[i].myRadius = r+i*i; - } - } - } -} - -void mousePressed() { - background(num); -} - -void mouseMoved() { - initialized = true; -} - -void keyPressed() { - // saveFrame("withouttitle-####.tif"); -} - - diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/Thumbs.db b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/Thumbs.db deleted file mode 100644 index 4d6134850..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/Thumbs.db and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_down.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_down.gif deleted file mode 100644 index 2b300b2c2..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_down.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_hi.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_hi.gif deleted file mode 100644 index 6f971e9e0..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_hi.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_lo.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_lo.gif deleted file mode 100644 index 5db0ee614..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_lo.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_down.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_down.gif deleted file mode 100644 index 0a2367d69..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_down.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_hi.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_hi.gif deleted file mode 100644 index 10bf1e299..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_hi.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_lo.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_lo.gif deleted file mode 100644 index e919d4bb6..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_lo.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_14_pond/Synthesis_14_pond.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_14_pond/Synthesis_14_pond.pde deleted file mode 100644 index e663426f3..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_14_pond/Synthesis_14_pond.pde +++ /dev/null @@ -1,671 +0,0 @@ -/** - * Synthesis 4: Structure and Interface - * Pond by William Ngan (www.metaphorical.net) - * p. 197 - * - * Click to generate ripples and attract the fish. - * Press keys 0-3 to turn that number of big fish ON or OFF. - */ - - -int NUM = 75; // number of fish - -Fish[] flock = new Fish[NUM]; -Fish bigfish1; -Fish bigfish2; -Fish bigfish3; - -//ripple -float rippleX, rippleY; -float[] ripple = new float[20]; -boolean hasRipple; -int countRipple; - -int hasPredator = 1; // Number of predator (big fish) - - -void setup() { - - size(600, 600); - - colorMode(HSB, 360, 100, 100); - background(85,46,83); - - frameRate(30); - - // Small fish - for (int i=0; i0) { - - bigfish1.scanPrey( flock, 150f ); - bigfish1.predator( bigfish2.x, bigfish2.y, 100f, 6*PI/180f, 2f); - bigfish1.predator( bigfish3.x, bigfish3.y, 100f, 6*PI/180f, 2f); - bigfish1.predator( mouseX, mouseY, 50f, 5*PI/180f, 1f); - bigfish1.move(); - stroke( bigfish1.colour[0], bigfish1.colour[1], bigfish1.colour[2]); - bigfish1.getFish(); - - if (hasPredator>1) { - bigfish2.scanPrey( flock, 120f ); - bigfish2.predator( bigfish1.x, bigfish1.y, 100f, 5*PI/180f, 1.5f); - bigfish2.predator( bigfish3.x, bigfish3.y, 100f, 5*PI/180f, 1.5f); - bigfish2.predator( mouseX, mouseY, 50f, 4*PI/180f, 0.8f); - bigfish2.move(); - stroke( bigfish2.colour[0], bigfish2.colour[1], bigfish2.colour[2]); - bigfish2.getFish(); - - if (hasPredator>2) { - bigfish3.scanPrey( flock, 100f ); - bigfish3.predator( bigfish1.x, bigfish1.y, 100f, 5*PI/180f, 1.5f); - bigfish3.predator( bigfish2.x, bigfish2.y, 100f, 5*PI/180f, 1.5f); - bigfish3.predator( mouseX, mouseY, 50f, 3*PI/180f, 0.5f); - bigfish3.move(); - stroke( bigfish3.colour[0], bigfish3.colour[1], bigfish3.colour[2]); - bigfish3.getFish(); - } - } - } - - - // Draw small fish - noStroke(); - for (int i=0; i0) { - flock[i].predator( bigfish1.x, bigfish1.y, 100f, 8*PI/180f, 1.5f); - if (hasPredator>1) { - flock[i].predator( bigfish2.x, bigfish2.y, 100f, 8*PI/180f, 1.5f); - if (hasPredator>2) flock[i].predator( bigfish3.x, bigfish3.y, 100f, 8*PI/180f, 1.5f); - } - } - if (!hasRipple) flock[i].predator( mouseX, mouseY, 100f, 5*PI/180f, 1f); - flock[i].move(); - flock[i].getFish(); - - } - - // Draw ripple - stroke(84,66,96); - noFill(); - - if (hasRipple) { - if (countRipple>0) { // ripple done, but active for another second - countRipple++; - } - else { // draw ripple - countRipple = 1; - for (int k=0; k60) ? false : true; - } - -} - - -void mouseDragged() { - rippleX = mouseX; - rippleY = mouseY; -} - -void mousePressed() { - rippleX = mouseX; - rippleY = mouseY; -} - -void mouseReleased() { - if (!hasRipple) { - for (int k=0; k 1) { // if it has energy - wcount+=energy*2; // tail sine-wave movement - } - - // Sine-wave oscillation - if (wcount>120) { - wcount = 0; - energy =0; - } - - wave = sin( wcount*3*PI/180 ); //sine wave - float strength = energy/5 * tailLength/2; //tail strength - - // Set tail position - setTail( strength, wave ); - move(); - } - - - ////////////////////////////////// / - - - // Find distance - float dist( float px, float py ) { - px -= x; - py -= y; - return sqrt( px*px + py*py ); - } - - float dist( Fish p ) { - float dx = p.x - x; - float dy = p.y - y; - return sqrt( dx*dx + dy*dy ); - } - - // Find angle - float angle( float px, float py ) { - return atan2( (py-y), (px-x) ); - } - - float angle( Fish p ) { - return atan2( (p.y-y), (p.x-x) ); - } - - // Move one step - void move() { - x = x+( cos(angle)*speed ); - y = y+( sin(angle)*speed ); - } - - // Speed change - void speedChange( float inc ) { - speed += inc; - if (speedmaxSpeed) { speed=maxSpeed; } - } - - // Direction change - void angleChange( float inc ) { - angle += inc; - } - - // Set speed limit - void setSpeedLimit( float max, float min ) { - maxSpeed = max; - minSpeed = min; - } - - // Set angle - void setAngle( float a ) { - angle = a; - } - - // Turn towards an angle - void turnTo( float ta, float inc ) { - - if (angle < ta) { - angleChange( inc ); - } - else { - angleChange( inc*-1 ); - } - } - - - // Set Color - void setColor( float c1, float c2, float c3 ) { - colour[0] = c1; - colour[1] = c2; - colour[2] = c3; - } - - - // Copy another fish's angle and pos - void copyFish( Fish f ) { - x = f.x; - y = f.y; - angle = f.angle; - speed = f.speed; - } - - ////////////////////////////////// - - // Check bounds and U-turn when near bounds - boolean checkBounds( float turn ) { - - boolean inbound = false; - - turn += boundTime/100; - - // Calculate the "buffer area" and turning angle - float gap = speed * PI/2/turn; - if (gap > width/4) { - gap = width/4; - turn = (gap/speed)/PI/2; - } - - // Which direction to u-turn? - if ( x-gap < 0 || x+gap > width || y-gap < 0 || y+gap > height) { - - if (uturn == 0) { - - float temp = angle; - if (temp < 0) temp += PI*2; - - if ( temp >0 && tempPI/2 && tempPI && tempPI*3/2 && temp height) uturn *=-1; - } - - // Turn - angleChange( turn*uturn ); - - inbound = true; - - } - else { // when out, clear uturn - uturn = 0; - inbound = false; - } - - x = (x<0) ? 0 : ( (x>width) ? width : x ); - y = (y<0) ? 0 : ( (y>height) ? height : y ); - - isBound = inbound; - boundTime = (inbound) ? boundTime+1 : 0; - - return inbound; - - } - - - // Alignment -- move towards the same direction as the flock within sight - void align( Fish fp, float angleSpeed, float moveSpeed ) { - - turnTo( fp.angle, angleSpeed+random(angleSpeed*3) ); // 0.001 - - if ( speed > fp.speed ) { - speedChange( moveSpeed*(-1-random(1)) ); //0.2 - } - else { - speedChange( moveSpeed ); - } - - } - - - // Cohesion -- move towards the center of the flock within sight - void cohere( Fish[] flocks, float angleSpeed, float moveSpeed ) { - - // get normalised position - float nx = 0; - float ny = 0; - - for (int i=0; i0) tone-=2; - } - - speedChange( moveSpeed ); - } - - - // Attracts towards a point (ie, ripple) - void swarm( float px, float py, float d ) { - float dA = angle(px, py); - - turnTo( dA, d ); - if (isBound) { - turnTo( dA, d ); - } - } - - //////////////////////////// // - - // Scan for the environment and determines behaviour - void scanFlock( Fish[] flocks, float cohereR, float avoidR ) { - - - Fish[] near = new Fish[NUM]; - int nCount = 0; - Fish[] tooNear = new Fish[NUM]; - int tnCount = 0; - Fish[] collide = new Fish[NUM]; - int cCount = 0; - Fish nearest = null; - float dist = 99999; - - float tempA = angle; - - // Check boundaries - boolean inbound = (hasPredator>0) ? checkBounds(PI/16) : checkBounds( PI/24); - - - for (int i=0; i d ) { - dist = d; - nearest = fp; - } - if ( d <= avoidR ) { - tooNear[tnCount++] = fp; - if ( d <= avoidR/2 ) { - collide[cCount++] = fp; - } - } - } - } - - // Calc and make flocking behaviours - Fish[] near2 = new Fish[nCount]; - Fish[] tooNear2 = new Fish[tnCount]; - Fish[] collide2 = new Fish[cCount]; - - int j=0; - for (j=0; j d ) { - dist = d; - nearest = flocks[i]; - } - } - - // Move towards food - if (dist < range) { - - if (dist > range/2) { - speedChange( 0.5f ); - } - else { - speedChange( -0.5f ); - } - - turnTo( angle( nearest ), 0.05f ); - - float diffA = (angle - tempA)*10; - - float c = diffA*180/PI; - - energy += abs( c/150 ); - } - - // Check boundaries - checkBounds( PI/16 ); - - // Wriggle tail - wriggle(); - - } - - -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Branch.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Branch.pde deleted file mode 100644 index 4db33ac72..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Branch.pde +++ /dev/null @@ -1,69 +0,0 @@ - -class Branch { - int x1, y1, z1, x2, y2, z2, id; - String xyz1, xyz2; // xyz1 = starting point; xyz2 = endingpoint - - Branch parent = null; - Branch[] children; - int childCounter = 0; - float len,angle; - - Branch(String _id, String _xyz1, String _xyz2) { - id = stringToInt(_id); - String[] tmpList = split(_xyz1,' '); - x1 = stringToInt(tmpList[0]); - y1 = stringToInt(tmpList[1]); - z1 = stringToInt(tmpList[2]); - tmpList = split(_xyz2,' '); - x2 = stringToInt(tmpList[0]); - y2 = stringToInt(tmpList[1]); - z2 = stringToInt(tmpList[2]); - xyz1 = _xyz1; - xyz2 = _xyz2; - children = new Branch[4]; - calc2Dcoords(); - } - - void calc2Dcoords() { - len = sqrt(sq(this.x2-this.x1)+sq(this.y2-this.y1)); - angle = atan2(this.y2-this.y1,this.x2-this.x1); - } - - int stringToInt(String s) { - Integer tmp = new Integer(s); - return tmp.intValue(); - } - - boolean checkParent(Branch _b) { - if((x2==_b.x1) && (y2==_b.y1) && (z2==_b.z1)) { - children[this.childCounter++] = _b; - return true; - } else { - return false; - } - } - - void checkForParents() { - for(int i=0;i"+this.id+" *** child(s) ->"); - for(int i=0;i"+parent.id); - } else { - print(" *** ROOT"); - } - println(""); - } - -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Segment.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Segment.pde deleted file mode 100644 index bd0f99cef..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Segment.pde +++ /dev/null @@ -1,156 +0,0 @@ - -class Segment { - - float x, y, z, len, angle; - float xAbsolute, yAbsolute, zAbsolute, angleAbsolute; - float originLength, futureLength; - - Segment parent = null; - Segment[] children = new Segment[4]; - int childCounter = 0; - int id; - int depth; - Branch branch = null; - - Segment(int _id) { id = _id;} - - void addChild(Segment _c) {children[childCounter++] = _c;} // println("adding child ->"+_c.id+" "+childCounter); - void setParent(Segment _p) {parent = _p;} - - void setXY(float _x,float _y) {x = _x; y = _y;} - void setX(float _x) {x = _x;} - void setY(float _y) {y = _y;} - void setZ(float _z) {z = _z;} - - void setAngle(float _a) {angle = _a;} - void setLength(float _len) {len = _len; originLength = _len; } - void setFutureToOrigin() {futureLength = originLength;} - void setFutureLength(float _len) {futureLength = _len;} - - void setXabsolute(float _xAbsolute) {xAbsolute = _xAbsolute;} - void setYabsolute(float _yAbsolute) {yAbsolute = _yAbsolute;} - void setZabsolute(float _zAbsolute) {zAbsolute = _zAbsolute;} - void setAngleAbsolute(float _angleAbsolute) {angleAbsolute = _angleAbsolute;} - - void scaleLength(float _scalar) {len *= _scalar;} - void scaleLengthFromOrigin(float _scalar) {len = originLength*_scalar;} - void scaleFutureLength(float _scalar) {futureLength *= _scalar;} - - float getX() {return x;} - float getY() {return y;} - float getZ() {return z;} - float getAngle() {return angle;} - float getLength() {return len;} - float getXabsolute() {return xAbsolute;} - float getYabsolute() {return yAbsolute;} - float getZabsolute() {return zAbsolute;} - float getAngleAbsolute() {return angleAbsolute;} - - void calcCoords() { - if(parent==null) { - angleAbsolute = angle; - setX(cos(radToPol(angle))*len); - setY(sin(radToPol(angle))*len); - setXabsolute(rootX+x); - setYabsolute(rootY-y); - } else { - angleAbsolute += ((parent.getAngleAbsolute()+angle)-angleAbsolute)/20; - setX(cos(radToPol(angleAbsolute))*len); - setY(sin(radToPol(angleAbsolute))*len); - setXabsolute(parent.getXabsolute()+x); - setYabsolute(parent.getYabsolute()-y); - } - } - - float radToPol(float _deg) { return _deg/57.2958; } - float polToRad(float _pol) { return _pol*57.2958; } - - void render() { - calcCoords(); - activateChildren(); - - originLength += (futureLength-originLength)/100; - len = originLength; - - if(parent==null) { - drawAsLine(rootX,rootY,getXabsolute(), getYabsolute()); - } else { - drawAsLine( parent.getXabsolute(), - parent.getYabsolute(), - getXabsolute(), - getYabsolute() - ); - } - } - - void activateChildren() { - for(int i=0;i<4;i++) { - if(children[i]!=null) { - children[i].render(); - } - } - } - - void setBranch(Branch _branch) { - branch = _branch; - try { - parent = s[branch.parent.id]; - for(int i=0;i<4;i++) { - if(branch.children[i]!=null) { - addChild(s[branch.children[i].id]); - } - } - } catch (NullPointerException npe) { - for(int i=0; i<4; i++) { - if(branch.children[i] != null) { - addChild(s[branch.children[i].id]); - } - } - } - } - - void setParamsFromBranch() { - try { - int tmp = branch.parent.id; - setParent(s[tmp]); - setAngle(polToRad(branch.angle)); - setAngleAbsolute(polToRad(branch.angle)); - } catch (NullPointerException npe){ - setParent(null); - setAngle(polToRad(branch.angle)); - setAngleAbsolute(polToRad(branch.angle)); - println("NULLPOINTER"); - } - setLength(branch.len); - } - - void adjustAngle(float _angle) { - for(int i=0;i<4;i++) { - if(children[i]!=null) { - children[i].adjustAngle(angle); - } - } - angle -= _angle; - } - - void adjustDepth(int _depth) { - depth = _depth; - for(int i=0;i<4;i++) { - if(children[i]!=null) { - children[i].adjustDepth(depth-1); - } - } - } - - void drawAsLine(float _x1, float _y1, float _x2, float _y2) { - strokeWeight(2); - if(id == redNum) { - stroke(255,0,0); - } else { - stroke(0, 80); - } - line(_x1,_y1,_x2,_y2); - } - -} - diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Synthesis_15_tree.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Synthesis_15_tree.pde deleted file mode 100644 index 63c691c29..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Synthesis_15_tree.pde +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Synthesis 4: Structure and Interface - * Swingtree by Andreas Schlegel (www.sojamo.de) at ART+COM (www.artcom.de) - * p. 498 - * - * Loads a data file to create the connections of the tree elements. - * The size and motion is affected by the mouse. - */ - - -Branch[] b; -Segment[] s; - -int rootX; -int rootY; -int rootId; -int redNum = 139; - -float pX,pY; -int frameCounter = 0; - -void setup() { - size(400, 900); - rootX = width/2; - rootY = height; - parseTree(); - for(int i=0; i " + rootId); - - for(int i=0; ix&&mouseXy&&mouseYspeedFrictionThreshold) - fs *= speedFrictionThreshold/speed; - xv *= fs; - yv *= fs; - - x += xv; - y += yv; - - if (xwidth-radius) { - x -= x-(width-radius); - xv = -xv; - } - if (yheight-radius) { - y -= y-(height-radius); - yv = -yv; - } - } - - void clamp() { - if (xwidth-radius) { - x = width-radius; - } - if (yheight-radius) { - y = height-radius; - } - } - - void display() { - if (this == overMass) { - stroke(0x00,0x99,0xFF); - line(x,y,mouseX,mouseY); - noStroke(); - fill(0x00,0x99,0xFF); - } - else { - noStroke(); - fill(0); - } - ellipse(x,y,diamter,diamter); - } - - float distanceTo(Mass m) { - return distanceTo(m.x,m.y); - } - - float distanceTo(float x,float y) { - float dx = this.x-x; - float dy = this.y-y; - return sqrt(dx*dx+dy*dy); - } -} - diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Slider.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Slider.pde deleted file mode 100644 index 25a9b1772..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Slider.pde +++ /dev/null @@ -1,48 +0,0 @@ - -class Slider extends Control { - float min,max,value; - int labelW = 8; - - Slider(int x, int y, int w, int h, float min, float max, float value,String label) { - super(x,y,w,h,label); - this.min = min; - this.max = max; - this.value = value; - } - - void mouseDragged() { - setValueToMouse(); - } - - boolean mousePressed() { - boolean down; - if (down = super.mousePressed()) - setValueToMouse(); - return down; - } - - void setValueToMouse() { - int mw = (w-labelW)-1; - float mv = (mouseX-(x+labelW+1.0))/mw; - if (mv>0) - value = min+(mv*mv)*(max-min); - else - value = min; - value = min(value,max); - } - - void drawContents() { - fill(0x00,0x99,0xFF); - noStroke(); - int mw = (w-labelW)-1; - float vw = sqrt((value-min)/(max-min))*mw; - rect(x+labelW+1,y+1,vw,h-1); - } - - void display() { - super.display(); - stroke(0x00,0x99,0xFF); - line(x+labelW,y,x+labelW,y+h); - } -} - diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Spring.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Spring.pde deleted file mode 100644 index ba5cb5514..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Spring.pde +++ /dev/null @@ -1,81 +0,0 @@ - -class Spring { - Mass a,b; - float restLength; - - Spring(Mass a,Mass b) { - this.a = a; - this.b = b; - restLength = a.distanceTo(b); - } - - void display() { - if (this == overSpring) { - stroke(0x00,0x99,0xFF); - float vx = b.x-a.x; - float vy = b.y-a.y; - float dot = (vx*vx + vy*vy); - float rx = mouseX-a.x; - float ry = mouseY-a.y; - float dot2 = (vx*rx + vy*ry); - float value = dot2/dot; - value = min(value,1); - value = max(value,0); - float x = ((b.x*value)+(a.x*(1-value))); - float y = ((b.y*value)+(a.y*(1-value))); - line(x,y,mouseX,mouseY); - } - else { - stroke(0); - } - line(a.x,a.y,b.x,b.y); - } - - void applyForces() { - double d = a.distanceTo(b); - if (d>0) - { - double f = (d-restLength)*k.value; - double fH = (f/d)*(a.x-b.x); - double fV = (f/d)*(a.y-b.y); - a.xv -= fH; - a.yv -= fV; - b.xv += fH; - b.yv += fV; - } - } - - float distanceTo(float x,float y) { - if (x>(min(a.x,b.x)-mouseTolerance) - &&x<(max(a.x,b.x)+mouseTolerance) - &&y>(min(a.y,b.y)-mouseTolerance) - &&y<(max(a.y,b.y)+mouseTolerance)) - { - float vx = b.x-a.x; - float vy = b.y-a.y; - float dot = (vx*vx + vy*vy); - float rx = x-a.x; - float ry = y-a.y; - float dot2 = (vx*rx + vy*ry); - float value = dot2/dot; - - if (value<0) { - float d = a.distanceTo(x,y); - return d <= mouseTolerance?d:-1; - } else if (value>1) { - float d = b.distanceTo(x,y); - return d <= mouseTolerance?d:-1; - } - - float px = ((b.x*value)+(a.x*(1-value)))-x; - float py = ((b.y*value)+(a.y*(1-value)))-y; - - float d = sqrt(px*px+py*py); - - return d <= mouseTolerance?d:-1; - } - else - return -1; - } -} - diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Synthesis_16_sodaprocessing.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Synthesis_16_sodaprocessing.pde deleted file mode 100644 index 29e93cee5..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Synthesis_16_sodaprocessing.pde +++ /dev/null @@ -1,329 +0,0 @@ -/** - * Synthesis 4: Structure and Interface - * SodaProcessing by Ed Burton (www.soda.co.k) - * p. 499 - * - * A simplified version of the Soda Constructor to demonstrate how it works. - * The complete Soda Constructor may be visited at http://www.sodaplay.com. - */ - -Mass masses[]; -int massCount = 0; - -float mouseTolerance = 15; - -Mass dragMass = null; -float dragDx,dragDy; -float tempDistance; - -Mass drawMass = null; -Mass overMass; - -Spring springs[]; -int springCount = 0; -Spring overSpring; - -Control controls[]; -Control activeControl = null; - -Button make,move,delete; -Slider g,f,k; -int sliderHeight = 13; - -float speedFrictionThreshold = 20; - -PFont font; - -int mode; -static final int MAKE = 0; -static final int MOVE = 1; -static final int DELETE = 2; - -String toolTips[]; - -void setup() -{ - size(600, 600); - background(0xFF); - - masses = new Mass[8]; - springs = new Spring[8]; - - font = loadFont("RotisSanSer-Bold.vlw.gz"); - textFont(font, 15); - //hint(SMOOTH_IMAGES); - smooth(); - controls = new Control[6]; - int x = 0; - int i = 0; - int controlWidth = width/(controls.length)+1; - controls[i++] = make = new Button(0,0,controlWidth-1,sliderHeight,"make"); - controls[i++] = move = new Button(controls[i-2].x+controls[i-2].w,0,controlWidth-1,sliderHeight,"move"); - controls[i++] = delete = new Button(controls[i-2].x+controls[i-2].w,0,controlWidth-1,sliderHeight,"delete"); - controls[i++] = g = new Slider(controls[i-2].x+controls[i-2].w,0,controlWidth,sliderHeight,0,4,0.0,"g"); - controls[i++] = f = new Slider(controls[i-2].x+controls[i-2].w,0,controlWidth,sliderHeight,0,1,0.1,"f"); - controls[i++] = k = new Slider(controls[i-2].x+controls[i-2].w,0,controlWidth,sliderHeight,0,0.75,0.5,"k"); - make.selected = true; - checkMode(); - - toolTips = new String [] { - ": click to make masses and springs" - ,": click, drag and throw masses" - ,": click to delete masses and springs" - ," = gravity (hint, set to zero to before choosing to make)" - ," = friction" - ," = spring stiffness"}; -} - -void draw() -{ - doUpdate(); - display(); -} - -void checkMode() { - for (int i = 0;i= 0) - deleteMassIndex(index); -} - -void deleteMassIndex(int index) { - if (index= 0) - deleteSpringIndex(index); -} - -void deleteSpringIndex(int index) { - if (index 100) { // If x is greater than 100 - x = -40; // Assign -40 to x - } -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_05/Ex_05.pde deleted file mode 100755 index 0dc1ffce8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_05/Ex_05.pde +++ /dev/null @@ -1,14 +0,0 @@ -void setup() { - size(100, 100); -} - -void draw() { - background(204); - // Assigns the horizontal value of the cursor to x - float x = mouseX; - // Assigns the vertical value of the cursor to y - float y = mouseY; - line(x, y, x+20, y-40); - line(x+10, y, x+30, y-40); - line(x+20, y, x+40, y-40); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_06/Ex_06.pde deleted file mode 100755 index 1d6623ab1..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_06/Ex_06.pde +++ /dev/null @@ -1,16 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); -} - -void draw() { - diagonals(40, 90); - diagonals(60, 62); - diagonals(20, 40); -} - -void diagonals(int x, int y) { - line(x, y, x+20, y-40); - line(x+10, y, x+30, y-40); - line(x+20, y, x+40, y-40); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_07/Ex_07.pde deleted file mode 100755 index 5e2ee9ca5..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_07/Ex_07.pde +++ /dev/null @@ -1,28 +0,0 @@ -int num = 20; -int[] dx = new int[num]; // Declare and create an array -int[] dy = new int[num]; // Declare and create an array - -void setup() { - size(100, 100); - for (int i=0; i 100) { - dx[i] = -100; - } - diagonals(dx[i], dy[i]); - } -} - -void diagonals(int x, int y) { - line(x, y, x+20, y-40); - line(x+10, y, x+30, y-40); - line(x+20, y, x+40, y-40); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_08/Ex_08.pde deleted file mode 100755 index 4df9de71b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_08/Ex_08.pde +++ /dev/null @@ -1,38 +0,0 @@ -Diagonals da, db; - -void setup() { - size(100, 100); - smooth(); - // Inputs: x, y, speed, thick, gray - da = new Diagonals(0, 80, 1, 2, 0); - db = new Diagonals(0, 55, 2, 6, 255); -} - -void draw() { - background(204); - da.update(); - db.update(); -} - -class Diagonals { - int x, y, speed, thick, gray; - - Diagonals(int xpos, int ypos, int s, int t, int g) { - x = xpos; - y = ypos; - speed = s; - thick = t; - gray = g; - } - void update() { - strokeWeight(thick); - stroke(gray); - line(x, y, x+20, y-40); - line(x+10, y, x+30, y-40); - line(x+20, y, x+40, y-40); - x = x + speed; - if (x > 100) { - x = -100; - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_01/Ex_01.pde deleted file mode 100755 index 95baefd49..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Two forward slashes are used to denote a comment. -// All text on the same line is a part of the comment. -// There must be no spaces between the slashes. For example, -// the code "/ /" is not a comment and will cause an error -// If you want to have a comment that is many -// lines long, you may prefer to use the syntax for a -// multiline comment - -/* - A forward slash followed by an asterisk allows the - comment to continue until the opposite -*/ - -// All letters and symbols that are not comments are translated -// by the compiler. Because the following lines are not comments, -// they are run and draw a display window of 200 x 200 pixels -size(200, 200); -background(102); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_02/Ex_02.pde deleted file mode 100755 index 96380a327..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,8 +0,0 @@ -// The size function has two parameters. The first sets the width -// of the display window and the second sets the height -size(200, 200); - -// This version of the background function has one parameter. -// It sets the gray value for the background of the display window -// in the range of 0 (black) to 255 (white) -background(102); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_03/Ex_03.pde deleted file mode 100755 index fd281381b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -size(200, 200); // Runs the size() function -int x; // Declares a new variable x -x = 102; // Assigns the value 102 to the variable x -background(x); // Runs the background() function diff --git a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_04/Ex_04.pde deleted file mode 100755 index 59791b825..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,2 +0,0 @@ -size(200, 200); -Background(102); // ERROR! The B in "background" is capitalized \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_05/Ex_05.pde deleted file mode 100755 index 061c8de5a..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,2 +0,0 @@ -size(200, 200); -background(102); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_06/Ex_06.pde deleted file mode 100755 index b28dbf6a3..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,5 +0,0 @@ -size -( 200, - 200) ; -background ( 102) - ; diff --git a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_07/Ex_07.pde deleted file mode 100755 index 802b49bf6..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,19 +0,0 @@ -// To print text to the screen, place the desired output in quotes -println("Processing..."); // Prints "Processing..." to the console - -// To print the value of a variable, rather than its name, don't put -// the name of the variable in quotes. -int x = 20; -println(x); // Prints "20" to the console - -// While println() moves to the next line after the text -// is output, print() does not. -print("10"); -println("20"); // Prints "1020" to the console -println("30"); // Prints "30" to the console - -// The "+" operator can be used for combining multiple text -// elements into one line. -int x2 = 20; -int y2 = 80; -println(x2 + " : " + y2); // Prints "20 : 80" to the message window diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_01/Ex_01.pde deleted file mode 100755 index 5156eb781..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,3 +0,0 @@ -// Draw the display window 120 pixels wide -// and 200 pixels high -size(120, 200); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_02/Ex_02.pde deleted file mode 100755 index 3022a4fd7..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,3 +0,0 @@ -// Draw the display window 320 pixels wide -// and 240 pixels high -size(320, 240); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_03/Ex_03.pde deleted file mode 100755 index 95db6395e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,3 +0,0 @@ -// Draw the display window 200 pixels wide -// and 120 pixels high -size(200, 120); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_04/Ex_04.pde deleted file mode 100755 index c6fa1fcbd..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Points with the same X and Y parameters -// form a diagonal line from the -// upper-left corner to the lower-right corner -point(20, 20); -point(30, 30); -point(40, 40); -point(50, 50); -point(60, 60); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_05/Ex_05.pde deleted file mode 100755 index 436a2f573..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Points with the same Y parameter have the -// same distance from the top and bottom -// edges of the frame -point(50, 30); -point(55, 30); -point(60, 30); -point(65, 30); -point(70, 30); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_06/Ex_06.pde deleted file mode 100755 index 976e508e4..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Points with the same X parameter have the -// same distance from the left and right -// edge of the frame -point(70, 50); -point(70, 55); -point(70, 60); -point(70, 65); -point(70, 70); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_07/Ex_07.pde deleted file mode 100755 index f54a56f78..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Placing a group of points next to one -// another creates a line -point(50, 50); -point(50, 51); -point(50, 52); -point(50, 53); -point(50, 54); -point(50, 55); -point(50, 56); -point(50, 57); -point(50, 58); -point(50, 59); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_08/Ex_08.pde deleted file mode 100755 index a734e6b9e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Setting points outside the display -// area will not cause an error, -// but the points won't be visible -point(-500, 100); -point(400, -600); -point(140, 2500); -point(2500, 100); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_09/Ex_09.pde deleted file mode 100755 index 1a3fd4cf1..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,5 +0,0 @@ -// When the y-coordinates for a line are the -// same, the line is horizontal -line(10, 30, 90, 30); -line(10, 40, 90, 40); -line(10, 50, 90, 50); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_10/Ex_10.pde deleted file mode 100755 index 46419eb9f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_10/Ex_10.pde +++ /dev/null @@ -1,5 +0,0 @@ -// When the x-coordinates for a line are the -// same, the line is vertical -line(40, 10, 40, 90); -line(50, 10, 50, 90); -line(60, 10, 60, 90); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_11/Ex_11.pde deleted file mode 100755 index b884549a8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_11/Ex_11.pde +++ /dev/null @@ -1,5 +0,0 @@ -// When all four parameters are different, -// the lines are diagonal -line(25, 90, 80, 60); -line(50, 12, 42, 90); -line(45, 30, 18, 36); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_12/Ex_12.pde deleted file mode 100755 index 2b40abf11..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_12/Ex_12.pde +++ /dev/null @@ -1,3 +0,0 @@ -// When two lines share the same point they connect -line(15, 20, 5, 80); -line(90, 65, 5, 80); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_13/Ex_13.pde deleted file mode 100755 index f3ae8f1e0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_13/Ex_13.pde +++ /dev/null @@ -1,4 +0,0 @@ -triangle(60, 10, 25, 60, 75, 65); // Filled triangle -line(60, 30, 25, 80); // Outlined triangle edge -line(25, 80, 75, 85); // Outlined triangle edge -line(75, 85, 60, 30); // Outlined triangle edge diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_14/Ex_14.pde deleted file mode 100755 index 02f6b57e4..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_14/Ex_14.pde +++ /dev/null @@ -1,4 +0,0 @@ -triangle(55, 9, 110, 100, 85, 100); -triangle(55, 9, 85, 100, 75, 100); -triangle(-1, 46, 16, 34, -7, 100); -triangle(16, 34, -7, 100, 40, 100); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_15/Ex_15.pde deleted file mode 100755 index 0e1b88969..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_15/Ex_15.pde +++ /dev/null @@ -1 +0,0 @@ -quad(38, 31, 86, 20, 69, 63, 30, 76); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_16/Ex_16.pde deleted file mode 100755 index 670399eee..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_16/Ex_16.pde +++ /dev/null @@ -1,2 +0,0 @@ -quad(20, 20, 20, 70, 60, 90, 60, 40); -quad(20, 20, 70, -20, 110, 0, 60, 40); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_17/Ex_17.pde deleted file mode 100755 index a4053738e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_17/Ex_17.pde +++ /dev/null @@ -1,2 +0,0 @@ -rect(15, 15, 40, 40); // Large square -rect(55, 55, 25, 25); // Small square diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_18/Ex_18.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_18/Ex_18.pde deleted file mode 100755 index 1b528ab03..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_18/Ex_18.pde +++ /dev/null @@ -1,6 +0,0 @@ -rect(0, 0, 90, 50); -rect(5, 50, 75, 4); -rect(24, 54, 6, 6); -rect(64, 54, 6, 6); -rect(20, 60, 75, 10); -rect(10, 70, 80, 2); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_19/Ex_19.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_19/Ex_19.pde deleted file mode 100755 index 1778c4c51..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_19/Ex_19.pde +++ /dev/null @@ -1,2 +0,0 @@ -ellipse(40, 40, 60, 60); // Large circle -ellipse(75, 75, 32, 32); // Small circle diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_20/Ex_20.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_20/Ex_20.pde deleted file mode 100755 index c86e00271..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_20/Ex_20.pde +++ /dev/null @@ -1,3 +0,0 @@ -ellipse(35, 0, 120, 120); -ellipse(38, 62, 6, 6); -ellipse(40, 100, 70, 70); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_21/Ex_21.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_21/Ex_21.pde deleted file mode 100755 index be92b8d79..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_21/Ex_21.pde +++ /dev/null @@ -1,6 +0,0 @@ -bezier(32, 20, 80, 5, 80, 75, 30, 75); -// Draw the control points -line(32, 20, 80, 5); -ellipse(80, 5, 4, 4); -line(80, 75, 30, 75); -ellipse(80, 75, 4, 4); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_22/Ex_22.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_22/Ex_22.pde deleted file mode 100755 index 0cef70aae..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_22/Ex_22.pde +++ /dev/null @@ -1,6 +0,0 @@ -bezier(85, 20, 40, 10, 60, 90, 15, 80); -// Draw the control points -line(85, 20, 40, 10); -ellipse(40, 10, 4, 4); -line(60, 90, 15, 80); -ellipse(60, 90, 4, 4); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_23/Ex_23.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_23/Ex_23.pde deleted file mode 100755 index 52fa4d21c..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_23/Ex_23.pde +++ /dev/null @@ -1,2 +0,0 @@ -rect(15, 15, 50, 50); // Bottom -ellipse(60, 60, 55, 55); // Top diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_24/Ex_24.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_24/Ex_24.pde deleted file mode 100755 index 9f3e7a90c..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_24/Ex_24.pde +++ /dev/null @@ -1,2 +0,0 @@ -ellipse(60, 60, 55, 55); // Bottom -rect(15, 15, 50, 50); // Top diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_25/Ex_25.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_25/Ex_25.pde deleted file mode 100755 index 7ebef58c1..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_25/Ex_25.pde +++ /dev/null @@ -1 +0,0 @@ -background(0); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_26/Ex_26.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_26/Ex_26.pde deleted file mode 100755 index e48c9887a..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_26/Ex_26.pde +++ /dev/null @@ -1 +0,0 @@ -background(124); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_27/Ex_27.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_27/Ex_27.pde deleted file mode 100755 index 34d4c0da7..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_27/Ex_27.pde +++ /dev/null @@ -1 +0,0 @@ -background(230); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_28/Ex_28.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_28/Ex_28.pde deleted file mode 100755 index 1feed8ca2..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_28/Ex_28.pde +++ /dev/null @@ -1,7 +0,0 @@ -rect(10, 10, 50, 50); -fill(204); // Light gray -rect(20, 20, 50, 50); -fill(153); // Middle gray -rect(30, 30, 50, 50); -fill(102); // Dark gray -rect(40, 40, 50, 50); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_29/Ex_29.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_29/Ex_29.pde deleted file mode 100755 index 36a0de381..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_29/Ex_29.pde +++ /dev/null @@ -1,8 +0,0 @@ -background(0); -rect(10, 10, 50, 50); -stroke(102); // Dark gray -rect(20, 20, 50, 50); -stroke(153); // Middle gray -rect(30, 30, 50, 50); -stroke(204); // Light gray -rect(40, 40, 50, 50); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_30/Ex_30.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_30/Ex_30.pde deleted file mode 100755 index 66989a9e0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_30/Ex_30.pde +++ /dev/null @@ -1,6 +0,0 @@ -fill(255); // White -rect(10, 10, 50, 50); -rect(20, 20, 50, 50); -rect(30, 30, 50, 50); -fill(0); // Black -rect(40, 40, 50, 50); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_31/Ex_31.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_31/Ex_31.pde deleted file mode 100755 index a386aaa96..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_31/Ex_31.pde +++ /dev/null @@ -1,4 +0,0 @@ -background(0); -fill(255, 220); -rect(15, 15, 50, 50); -rect(35, 35, 50, 50); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_32/Ex_32.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_32/Ex_32.pde deleted file mode 100755 index cecfa7513..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_32/Ex_32.pde +++ /dev/null @@ -1,8 +0,0 @@ -fill(0); -rect(0, 40, 100, 20); -fill(255, 51); // Low opacity -rect(0, 20, 33, 60); -fill(255, 127); // Medium opacity -rect(33, 20, 33, 60); -fill(255, 204); // High opacity -rect(66, 20, 33, 60); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_33/Ex_33.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_33/Ex_33.pde deleted file mode 100755 index 24cc6d6e9..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_33/Ex_33.pde +++ /dev/null @@ -1,4 +0,0 @@ -rect(10, 10, 50, 50); -noFill(); // Disable the fill -rect(20, 20, 50, 50); -rect(30, 30, 50, 50); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_34/Ex_34.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_34/Ex_34.pde deleted file mode 100755 index d7f85b70f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_34/Ex_34.pde +++ /dev/null @@ -1,4 +0,0 @@ -rect(20, 15, 20, 70); -noStroke(); // Disable the stroke -rect(50, 15, 20, 70); -rect(80, 15, 20, 70); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_35/Ex_35.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_35/Ex_35.pde deleted file mode 100755 index c37670bbf..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_35/Ex_35.pde +++ /dev/null @@ -1,3 +0,0 @@ -ellipse(30, 48, 36, 36); -smooth(); -ellipse(70, 48, 36, 36); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_36/Ex_36.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_36/Ex_36.pde deleted file mode 100755 index 736a97f35..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_36/Ex_36.pde +++ /dev/null @@ -1,4 +0,0 @@ -smooth(); -ellipse(30, 48, 36, 36); -noSmooth(); -ellipse(70, 48, 36, 36); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_37/Ex_37.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_37/Ex_37.pde deleted file mode 100755 index 7a1293551..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_37/Ex_37.pde +++ /dev/null @@ -1,6 +0,0 @@ -smooth(); -line(20, 20, 80, 20); // Default line weight of 1 -strokeWeight(6); -line(20, 40, 80, 40); // Thicker line -strokeWeight(18); -line(20, 70, 80, 70); // Beastly line \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_38/Ex_38.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_38/Ex_38.pde deleted file mode 100755 index 2d9c0876b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_38/Ex_38.pde +++ /dev/null @@ -1,8 +0,0 @@ -smooth(); -strokeWeight(12); -strokeCap(ROUND); -line(20, 30, 80, 30); // Top line -strokeCap(SQUARE); -line(20, 50, 80, 50); // Middle line -strokeCap(PROJECT); -line(20, 70, 80, 70); // Bottom line diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_39/Ex_39.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_39/Ex_39.pde deleted file mode 100755 index e504a13a4..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_39/Ex_39.pde +++ /dev/null @@ -1,8 +0,0 @@ -smooth(); -strokeWeight(12); -strokeJoin(BEVEL); -rect(12, 33, 15, 33); // Left shape -strokeJoin(MITER); -rect(42, 33, 15, 33); // Middle shape -strokeJoin(ROUND); -rect(72, 33, 15, 33); // Right shape diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_40/Ex_40.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_40/Ex_40.pde deleted file mode 100755 index 2444927e2..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_40/Ex_40.pde +++ /dev/null @@ -1,11 +0,0 @@ -smooth(); -noStroke(); -ellipseMode(RADIUS); -fill(126); -ellipse(33, 33, 60, 60); // Gray ellipse -fill(255); -ellipseMode(CORNER); -ellipse(33, 33, 60, 60); // White ellipse -fill(0); -ellipseMode(CORNERS); -ellipse(33, 33, 60, 60); // Black ellipse \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_41/Ex_41.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_41/Ex_41.pde deleted file mode 100755 index 45e26b32e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_41/Ex_41.pde +++ /dev/null @@ -1,10 +0,0 @@ -noStroke(); -rectMode(CORNER); -fill(126); -rect(40, 40, 60, 60); // Gray ellipse -rectMode(CENTER); -fill(255); -rect(40, 40, 60, 60); // White ellipse -rectMode(CORNERS); -fill(0); -rect(40, 40, 60, 60); // Black ellipse \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_01/Ex_01.pde deleted file mode 100755 index 89594ff23..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,6 +0,0 @@ -int x; // Declare the variable x of type int -float y; // Declare the variable y of type float -boolean b; // Declare the variable b of type boolean -x = 50; // Assign the value 50 to x -y = 12.6; // Assign the value 12.6 to f -b = true; // Assign the value true to b diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_02/Ex_02.pde deleted file mode 100755 index b00dc26eb..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,3 +0,0 @@ -int x = 50; -float y = 12.6; -boolean b = true; diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_03/Ex_03.pde deleted file mode 100755 index 1f8fc600b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -float x, y, z; -x = -3.9; -y = 10.1; -z = 124.23; diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_04/Ex_04.pde deleted file mode 100755 index 99266daf6..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,3 +0,0 @@ -int x = 69; // Assign 69 to x -x = 70; // Assign 70 to x -int x = 71; // ERROR! The data type for x is duplicated diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_05/Ex_05.pde deleted file mode 100755 index 713822fa1..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,2 +0,0 @@ -// Error! The left side of an assignment must be a variable -5 = 12; diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_06/Ex_06.pde deleted file mode 100755 index 06c4a4f37..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,2 +0,0 @@ -// Error! It's not possible to fit a floating point number into an int -int x = 24.8; diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_07/Ex_07.pde deleted file mode 100755 index ae7c113a8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,3 +0,0 @@ -float f = 12.5; -// Error! It's not possible to fit a floating point number into an int -int y = f; diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_08/Ex_08.pde deleted file mode 100755 index 905e9f715..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1 +0,0 @@ -println(width + ", " + height); // Prints 100, 100 to the console diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_09/Ex_09.pde deleted file mode 100755 index d609463d9..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,2 +0,0 @@ -size(300, 400); -println(width + ", " + height); // Prints 300, 400 to the console diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_10/Ex_10.pde deleted file mode 100755 index 560cb6fe8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_10/Ex_10.pde +++ /dev/null @@ -1,2 +0,0 @@ -size(1280, 1024); -println(width + ", " + height); // Prints 1280, 1024 to the console diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_11/Ex_11.pde deleted file mode 100755 index cfb9681c3..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_11/Ex_11.pde +++ /dev/null @@ -1,4 +0,0 @@ -size(100, 100); -ellipse(width*0.5, height*0.5, width*0.66, height*0.66); -line(width*0.5, 0, width*0.5, height); -line(0, height*0.5, width, height*0.5); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_01/Ex_01.pde deleted file mode 100755 index 686245d97..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,6 +0,0 @@ -int grayVal = 153; -fill(grayVal); -rect(10, 10, 55, 55); // Draw gray rectangle -grayVal = grayVal + 102; // Assign 255 to grayVal -fill(grayVal); -rect(35, 30, 55, 55); // Draw white triangle diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_02/Ex_02.pde deleted file mode 100755 index c72317580..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,5 +0,0 @@ -int a = 30; -line(a, 0, a, height); -a = a + 40; // Assign 70 to a -strokeWeight(4); -line(a, 0, a, height); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_03/Ex_03.pde deleted file mode 100755 index 59aabc84c..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,7 +0,0 @@ -int a = 30; -int b = 40; -line(a, 0, a, height); -line(b, 0, b, height); -strokeWeight(4); -// The result of a calculation can be used as input to a function -line(b-a, 0, b-a, height); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_04/Ex_04.pde deleted file mode 100755 index eda7bca7e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,6 +0,0 @@ -int a = 8; -int b = 10; -line(a, 0, a, height); -line(b, 0, b, height); -strokeWeight(4); -line(a*b, 0, a*b, height); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_05/Ex_05.pde deleted file mode 100755 index 7436baf8b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,6 +0,0 @@ -int a = 8; -int b = 10; -line(a, 0, a, height); -line(b, 0, b, height); -strokeWeight(4); -line(a/b, 0, a/b, height); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_06/Ex_06.pde deleted file mode 100755 index 5e7006a90..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,8 +0,0 @@ -int y = 20; -line(0, y, width, y); -y = y + 6; // Assign 26 to y -line(0, y, width, y); -y = y + 6; // Assign 32 to y -line(0, y, width, y); -y = y + 6; // Assign 38 to y -line(0, y, width, y); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_07/Ex_07.pde deleted file mode 100755 index ab521185e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,8 +0,0 @@ -float y = 20; -line(0, y, width, y); -y = y * 1.6; // Assign 32 to y -line(0, y, width, y); -y = y * 1.6; // Assign 51.2 to y -line(0, y, width, y); -y = y * 1.6; // Assign 81.920006 to y -line(0, y, width, y); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_08/Ex_08.pde deleted file mode 100755 index a3b824bb5..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,4 +0,0 @@ -println(4/3); // Prints "1" -println(4.0/3); // Prints "1.3333334" -println(4/3.0); // Prints "1.3333334" -println(4.0/3.0); // Prints "1.3333334" diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_09/Ex_09.pde deleted file mode 100755 index 605673c03..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,6 +0,0 @@ -int a = 4/3; // Assign 1 to a -int b = 3/4; // Assign 0 to b -int c = 4.0/3; // ERROR! -int d = 4.0/3.0; // ERROR! -float e = 4.0/3; // Assign 1.3333334 to e -float f = 4.0/3.0; // Assign 1.3333334 to f diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_10/Ex_10.pde deleted file mode 100755 index 591ba1406..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_10/Ex_10.pde +++ /dev/null @@ -1,2 +0,0 @@ -float a = 4/3; // Assign 1.0 to a -float b = 3/4; // Assign 0.0 to b diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_11/Ex_11.pde deleted file mode 100755 index d18af8dc7..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_11/Ex_11.pde +++ /dev/null @@ -1,4 +0,0 @@ -int i = 4; -float f = 3.0; -int a = i/f; // ERROR! Assigning a float value to an int variable -float b = i/f; // Assign 1.3333334 to b diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_12/Ex_12.pde deleted file mode 100755 index dbbefddb4..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_12/Ex_12.pde +++ /dev/null @@ -1,2 +0,0 @@ -int a = 0; -int b = 12/a; // ERROR! ArithmeticException: / by zero diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_13/Ex_13.pde deleted file mode 100755 index 447cb965f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_13/Ex_13.pde +++ /dev/null @@ -1,4 +0,0 @@ -float a = 0.0001; -float b = 12/a; // Assign 120000.0 to b - - diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_14/Ex_14.pde deleted file mode 100755 index 832d87edf..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_14/Ex_14.pde +++ /dev/null @@ -1,2 +0,0 @@ -int x = 3 + 4 * 5; // Assign 23 to x -int y = (3 + 4) * 5; // Assign 35 to y diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_15/Ex_15.pde deleted file mode 100755 index f6e891a30..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_15/Ex_15.pde +++ /dev/null @@ -1,2 +0,0 @@ -int x = 10 * 20 + 5; // Assign 205 to x -int y = (10 * 20) + 5; // Assign 205 to y diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_16/Ex_16.pde deleted file mode 100755 index 43b78c19f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_16/Ex_16.pde +++ /dev/null @@ -1,9 +0,0 @@ -int x = 1; -println(x); // Prints "1" to the console -x++; // Equivalent to x = x + 1 -println(x); // Prints "2" to the console - -int y = 1; -println(y); // Prints "1" to the console -y--; // Equivalent to y = y - 1 -println(y); // Prints "0" to the console \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_17/Ex_17.pde deleted file mode 100755 index caff0cc8a..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_17/Ex_17.pde +++ /dev/null @@ -1,3 +0,0 @@ -int x = 1; -println(x++); // Prints "1" to the console -println(x); // Prints "2" to the console \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_18/Ex_18.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_18/Ex_18.pde deleted file mode 100755 index 89b1981a4..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_18/Ex_18.pde +++ /dev/null @@ -1,3 +0,0 @@ -int x = 1; -println(++x); // Prints "2" to the console -println(x); // Prints "2" to the console diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_19/Ex_19.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_19/Ex_19.pde deleted file mode 100755 index daf8a63fb..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_19/Ex_19.pde +++ /dev/null @@ -1,9 +0,0 @@ -int x = 1; -println(x); // Prints "1" to the console -x += 5; // Equivalent to x = x + 5 -println(x); // Prints "6" to the console - -int y = 1; -println(y); // Prints "1" to the console -y -= 5; // Equivalent to y = y - 5 -println(y); // Prints "-4" to the console \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_20/Ex_20.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_20/Ex_20.pde deleted file mode 100755 index b7a9db96c..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_20/Ex_20.pde +++ /dev/null @@ -1,9 +0,0 @@ -int x = 4; -println(x); // Prints "4" to the console -x *= 2; // Equivalent to x = x * 2 -println(x); // Prints "8" to the console - -int y = 4; -println(y); // Prints "4" to the console -y /= 2; // Equivalent to y = y / 2 -println(y); // Prints "2" to the console \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_21/Ex_21.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_21/Ex_21.pde deleted file mode 100755 index 27e0d2f4b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_21/Ex_21.pde +++ /dev/null @@ -1,3 +0,0 @@ -int x = 5; // Assigns 5 to x -x = -x; // Equivalent to x = x * -1 -println(x); // Prints "-5" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_22/Ex_22.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_22/Ex_22.pde deleted file mode 100755 index 40eb07cff..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_22/Ex_22.pde +++ /dev/null @@ -1,4 +0,0 @@ -int w = ceil(2.0); // Assign 2 to w -int x = ceil(2.1); // Assign 3 to x -int y = ceil(2.5); // Assign 3 to y -int z = ceil(2.9); // Assign 3 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_23/Ex_23.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_23/Ex_23.pde deleted file mode 100755 index 1b98ad531..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_23/Ex_23.pde +++ /dev/null @@ -1,4 +0,0 @@ -int w = floor(2.0); // Assign 2 to w -int x = floor(2.1); // Assign 2 to x -int y = floor(2.5); // Assign 2 to y -int z = floor(2.9); // Assign 2 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_24/Ex_24.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_24/Ex_24.pde deleted file mode 100755 index 5fcba8f53..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_24/Ex_24.pde +++ /dev/null @@ -1,4 +0,0 @@ -int w = round(2.0); // Assign 2 to w -int x = round(2.1); // Assign 2 to x -int y = round(2.5); // Assign 3 to y -int z = round(2.9); // Assign 3 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_25/Ex_25.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_25/Ex_25.pde deleted file mode 100755 index c03e6bce8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_25/Ex_25.pde +++ /dev/null @@ -1 +0,0 @@ -float w = round(2.1); // Assign 2.0 to w \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_26/Ex_26.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_26/Ex_26.pde deleted file mode 100755 index 5b095d326..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_26/Ex_26.pde +++ /dev/null @@ -1,6 +0,0 @@ -int u = min(5, 9); // Assign 5 to u -int v = min(-4, -12, -9); // Assign -12 to v -float w = min(12.3, 230.24); // Assign 12.3 to w -int x = max(5, 9); // Assign 9 to x -int y = max(-4, -12, -9); // Assign -4 to y -float z = max(12.3, 230.24); // Assign 230.24 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_01/Ex_01.pde deleted file mode 100755 index d95a460e1..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,15 +0,0 @@ -println(3 > 5); // Prints "false" -println(5 > 3); // Prints "true" -println(5 > 5); // Prints "false" - -println(3 < 5); // Prints "true" -println(5 < 3); // Prints "false" -println(5 < 5); // Prints "false" - -println(3 >= 5); // Prints "false" -println(5 >= 3); // Prints "true" -println(5 >= 5); // Prints "true" - -println(3 <= 5); // Prints "true" -println(5 <= 3); // Prints "false" -println(5 <= 5); // Prints "true" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_02/Ex_02.pde deleted file mode 100755 index af88e9c89..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,7 +0,0 @@ -println(3 == 5); // Prints "false" -println(5 == 3); // Prints "false" -println(5 == 5); // Prints "true" - -println(3 != 5); // Prints "true" -println(5 != 3); // Prints "true" -println(5 != 5); // Prints "false" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_03/Ex_03.pde deleted file mode 100755 index 2fc67ae01..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,12 +0,0 @@ -// The text expressions are "x > 100" and "x < 100" -// Because x is 150, the code inside the first block -// runs and the ellipse draws, but the code in the second -// block is not run and the rectangle is not drawn -int x = 150; -if (x > 100) { // If x is greater than 100, - ellipse(50, 50, 36, 36); // draw this ellipse -} -if (x < 100) { // If x is less than 100 - rect(35, 35, 30, 30); // draw this rectangle -} -line(20, 20, 80, 80); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_04/Ex_04.pde deleted file mode 100755 index f3627ed1b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,9 +0,0 @@ -// Because x is 50, only the rectangle draws -int x = 50; -if (x > 100) { // If x is greater than 100, - ellipse(50, 50, 36, 36); // draw this ellipse -} -if (x < 100) { // If x is less than 100, - rect(33, 33, 34, 34); // draw this rectangle -} -line(20, 20, 80, 80); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_05/Ex_05.pde deleted file mode 100755 index d0de5a65e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Because x is 100, only the line draws -int x = 100; -if (x > 100) { // If x is greater than 100, - ellipse(50, 50, 36, 36); // draw this ellipse -} -if (x < 100) { // If x is less than 100, - rect(33, 33, 34, 34); // draw this rectangle -} -line(20, 20, 80, 80); - - - diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_06/Ex_06.pde deleted file mode 100755 index 7dcfdda6d..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Because x is 90, only the rectangle draws -int x = 90; -if (x > 100) { // If x is greater than 100, - ellipse(50, 50, 36, 36); // draw this ellipse. -} else { // Otherwise, - rect(33, 33, 34, 34); // draw this rectangle -} -line(20, 20, 80, 80); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_07/Ex_07.pde deleted file mode 100755 index 84d03bf1b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,9 +0,0 @@ -// Because x is 190, only the ellipse draws -int x = 290; -if (x > 100) { // If x is greater than 100, - ellipse(50, 50, 36, 36); // draw this ellipse. -} else { // Otherwise, - rect(33, 33, 34, 34); // draw this rectangle -} -line(20, 20, 80, 80); - diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_08/Ex_08.pde deleted file mode 100755 index a3ec4acba..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,14 +0,0 @@ -// If x is greater than 100 and less than 300, draw the -// ellipse. If x is greater than or equal to 300, draw -// the line. If x is not greater than 100, draw the -// rectangle. Because x is 420, only the line draws. -int x = 420; -if (x > 100) { // First test to draw ellipse or line - if (x < 300) { // Second test determines which to draw - ellipse(50, 50, 36, 36); - } else { - line(50, 0, 50, 100); - } -} else { - rect(33, 33, 34, 34); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_09/Ex_09.pde deleted file mode 100755 index 6e470009b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,13 +0,0 @@ -// If x is less than or equal to 100, then draw -// the rectangle. Otherwise, if x is greater than -// or equal to 300, draw the line. If x is between -// 100 and 300, draw the ellipse. Because x is 101, -// only the ellipse draws. -int x = 101; -if (x <= 100) { - rect(33, 33, 34, 34); -} else if (x >= 300) { - line(50, 0, 50, 100); -} else { - ellipse(50, 50, 36, 36); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_10/Ex_10.pde deleted file mode 100755 index 6954152b7..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_10/Ex_10.pde +++ /dev/null @@ -1,15 +0,0 @@ -int a = 10; -int b = 20; -// The expression "a > 5" must be true OR "b < 30" -// must be true. Because they are both true, the code -// in the block will run. -if ((a > 5) || (b < 30)) { - line(20, 50, 80, 50); -} -// The expression "a > 15" is false, but "b < 30" -// is true. Because the OR operator requires only one part -// to be true in the entire expression, the code in the -// block will run. -if ((a > 15) || (b < 30)) { - ellipse(50, 50, 36, 36); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_11/Ex_11.pde deleted file mode 100755 index cce0901ce..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_11/Ex_11.pde +++ /dev/null @@ -1,14 +0,0 @@ -int a = 10; -int b = 20; -// The expression "a > 5" must be true AND "b < 30" -// must be true. Because they are both true, the code -// in the block will run. -if ((a > 5) && (b < 30)) { - line(20, 50, 80, 50); -} -// The expression "a > 15" is false, but "b < 30" is -// true. Because the AND operator requires both to be -// true, the code in the block will not run. -if ((a > 15) && (b < 30)) { - ellipse(50, 50, 36, 36); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_12/Ex_12.pde deleted file mode 100755 index e46a25927..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_12/Ex_12.pde +++ /dev/null @@ -1,10 +0,0 @@ -boolean b = true; // Assign true to b -println(b); // Prints "true" -println(!b); // Prints "false" -b = !b; // Assign false to b -println(b); // Prints "false" -println(!b); // Prints "true" -println(5 > 3); // Prints "true" -println(!(5 > 3)); // Prints "false" -int x = 5; -println(!x); // ERROR! It's only possible to ! a boolean variable \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_13/Ex_13.pde deleted file mode 100755 index 48edc1f46..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_13/Ex_13.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Because b is true, the line draws -boolean b = true; -if (b == true) { // If b is true, - line(20, 50, 80, 50); // draw the line -} -if (!b == true) { // If b is false, - ellipse(50, 50, 36, 36); // draw the ellipse -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_01/Ex_01.pde deleted file mode 100755 index 977a31635..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,8 +0,0 @@ -// The init is "int i = 20", the test is "i < 80", -// and the update is "i += 5". Notice the semicolon -// terminating the first two elements -for (int i = 20; i < 80; i += 5) { - // This line will continue to run until "i" - // is greater than or equal to 80 - line(20, i, 80, i+15); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_02/Ex_02.pde deleted file mode 100755 index 6e2bc070a..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,7 +0,0 @@ -for (int x=-16; x<100; x+=10) { - line(x, 0, x+15, 50); -} -strokeWeight(4); -for (int x=-8; x<100; x+=10) { - line(x, 50, x+15, 100); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_03/Ex_03.pde deleted file mode 100755 index 5b1c885c0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -noFill(); -for (int d = 150; d > 0; d -= 10) { - ellipse(50, 50, d, d); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_04/Ex_04.pde deleted file mode 100755 index 715f172ae..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,4 +0,0 @@ -for (int i=0; i<100; i+=2) { - stroke(255-i); - line(i, 0, i, 200); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_05/Ex_05.pde deleted file mode 100755 index e5862b727..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,3 +0,0 @@ -for (int y=10; y<100; y+=10) { - point(10, y); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_06/Ex_06.pde deleted file mode 100755 index c615a3f7e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,3 +0,0 @@ -for (int x = 10; x < 100; x += 10) { - point(x, 10); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_07/Ex_07.pde deleted file mode 100755 index 0a9b7dc19..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,5 +0,0 @@ -for (int y = 10; y < 100; y += 10) { - for (int x = 10; x < 100; x += 10) { - point(x, y); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_08/Ex_08.pde deleted file mode 100755 index 911131456..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,8 +0,0 @@ -fill(0, 76); -noStroke(); -smooth(); -for (int y = -10; y <= 100; y += 10) { - for (int x = -10; x <= 100; x += 10) { - ellipse(x + y/8.0, y + x/8.0, 15 + x/2, 10); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_09/Ex_09.pde deleted file mode 100755 index d434817f7..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_09/Ex_09.pde +++ /dev/null @@ -1,7 +0,0 @@ -noStroke(); -for (int y=0; y<100; y+=10) { - for (int x=0; x<100; x+=10) { - fill((x+y) * 1.4); - rect(x, y, 10, 10); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_10/Ex_10.pde deleted file mode 100755 index 1e9a2069d..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_10/Ex_10.pde +++ /dev/null @@ -1,6 +0,0 @@ -for (int y=1; y<100; y+=10) { - for (int x=1; x 100) { - line(20, 20, 80, 80); -} else { - line(80, 20, 20, 80); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_12/Ex_12.pde deleted file mode 100755 index 093d77cc1..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_12/Ex_12.pde +++ /dev/null @@ -1,10 +0,0 @@ -int x = 50; - -if (x > 100) -{ - line(20, 20, 80, 80); -} -else -{ - line(20, 80, 80, 20); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_13/Ex_13.pde deleted file mode 100755 index 6a715a41c..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_13/Ex_13.pde +++ /dev/null @@ -1,11 +0,0 @@ -int x = 50; - -if (x > 100) { -line(20, 20, 80, 80); -} else { -line(80, 20, 20, 80); -} - -for (int i=0; i<100; i+=2) { -line(20, i, 80, i); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_01/Ex_01.pde deleted file mode 100755 index c7a59bb3d..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,7 +0,0 @@ -noFill(); -beginShape(); -vertex(30, 20); -vertex(85, 20); -vertex(85, 75); -vertex(30, 75); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_02/Ex_02.pde deleted file mode 100755 index 2f9e656c3..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,7 +0,0 @@ -noFill(); -beginShape(); -vertex(30, 20); -vertex(85, 20); -vertex(85, 75); -vertex(30, 75); -endShape(CLOSE); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_03/Ex_03.pde deleted file mode 100755 index fa638ff28..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,7 +0,0 @@ -noFill(); -beginShape(); -vertex(30, 20); -vertex(85, 20); -vertex(30, 75); -vertex(85, 75); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_04/Ex_04.pde deleted file mode 100755 index 535d46c6b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,11 +0,0 @@ -fill(0); -noStroke(); -smooth(); -beginShape(); -vertex(10, 0); -vertex(100, 30); -vertex(90, 70); -vertex(100, 70); -vertex(10, 90); -vertex(50, 40); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_05/Ex_05.pde deleted file mode 100755 index 3f5cd6c1c..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,11 +0,0 @@ -noFill(); -smooth(); -strokeWeight(20); -beginShape(); -vertex(52, 29); -vertex(74, 35); -vertex(60, 52); -vertex(61, 75); -vertex(40, 69); -vertex(19, 75); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_06/Ex_06.pde deleted file mode 100755 index 55cf3542f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,10 +0,0 @@ -noStroke(); -fill(0); -beginShape(); -vertex(40, 10); -for (int i = 20; i <= 100; i += 5) { - vertex(20, i); - vertex(30, i); -} -vertex(40, 100); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_07/Ex_07.pde deleted file mode 100755 index cd29d6421..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Draws a point at each vertex -beginShape(POINTS); -vertex(30, 20); -vertex(85, 20); -vertex(85, 75); -vertex(30, 75); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_08/Ex_08.pde deleted file mode 100755 index 69f8f1a41..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Draws a line between each pair of vertices -beginShape(LINES); -vertex(30, 20); -vertex(85, 20); -vertex(85, 75); -vertex(30, 75); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_09/Ex_09.pde deleted file mode 100755 index 05d590723..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_09/Ex_09.pde +++ /dev/null @@ -1,9 +0,0 @@ -// Connects each grouping of three vertices as a triangle -beginShape(TRIANGLES); -vertex(75, 30); -vertex(10, 20); -vertex(75, 50); -vertex(20, 60); -vertex(90, 70); -vertex(35, 85); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_10/Ex_10.pde deleted file mode 100755 index 9f60ff566..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_10/Ex_10.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Starting with the third vertex, connects each -// subsequent vertex to the previous two -beginShape(TRIANGLE_STRIP); -vertex(75, 30); -vertex(10, 20); -vertex(75, 50); -vertex(20, 60); -vertex(90, 70); -vertex(35, 85); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_11/Ex_11.pde deleted file mode 100755 index a2714ae29..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_11/Ex_11.pde +++ /dev/null @@ -1,7 +0,0 @@ -beginShape(TRIANGLE_FAN); -vertex(10, 20); -vertex(75, 30); -vertex(75, 50); -vertex(90, 70); -vertex(10, 20); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_12/Ex_12.pde deleted file mode 100755 index f5d979e3a..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_12/Ex_12.pde +++ /dev/null @@ -1,10 +0,0 @@ -beginShape(QUADS); -vertex(30, 25); -vertex(85, 30); -vertex(85, 50); -vertex(30, 45); -vertex(30, 60); -vertex(85, 65); -vertex(85, 85); -vertex(30, 80); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_13/Ex_13.pde deleted file mode 100755 index deafeb3b6..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_13/Ex_13.pde +++ /dev/null @@ -1,10 +0,0 @@ -beginShape(QUAD_STRIP); -vertex(30, 25); -vertex(85, 30); -vertex(30, 45); -vertex(85, 50); -vertex(30, 60); -vertex(85, 65); -vertex(30, 80); -vertex(85, 85); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_14/Ex_14.pde deleted file mode 100755 index 8033658e0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_14/Ex_14.pde +++ /dev/null @@ -1,9 +0,0 @@ -smooth(); -noFill(); -beginShape(); -curveVertex(20, 80); // C1 (see p.76) -curveVertex(20, 40); // V1 -curveVertex(30, 30); // V2 -curveVertex(40, 80); // V3 -curveVertex(80, 80); // C2 -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_15/Ex_15.pde deleted file mode 100755 index 788a9bb75..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_15/Ex_15.pde +++ /dev/null @@ -1,5 +0,0 @@ -noFill(); -beginShape(); -vertex(32, 20); // V1 (see p.76) -bezierVertex(80, 5, 80, 75, 30, 75); // C1, C2, V2 -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_16/Ex_16.pde deleted file mode 100755 index caebf4d86..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_16/Ex_16.pde +++ /dev/null @@ -1,7 +0,0 @@ -smooth(); -noFill(); -beginShape(); -vertex(15, 30); // V1 (see p.76) -bezierVertex(20, -5, 70, 5, 40, 35); // C1, C2, V2 -bezierVertex(5, 70, 45, 105, 70, 70); // C3, C4, V3 -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_17/Ex_17.pde deleted file mode 100755 index caebf4d86..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_17/Ex_17.pde +++ /dev/null @@ -1,7 +0,0 @@ -smooth(); -noFill(); -beginShape(); -vertex(15, 30); // V1 (see p.76) -bezierVertex(20, -5, 70, 5, 40, 35); // C1, C2, V2 -bezierVertex(5, 70, 45, 105, 70, 70); // C3, C4, V3 -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_18/Ex_18.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_18/Ex_18.pde deleted file mode 100755 index 179527d4b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_18/Ex_18.pde +++ /dev/null @@ -1,9 +0,0 @@ -smooth(); -noFill(); -beginShape(); -vertex(15, 40); // V1 (see p.76) -bezierVertex(5, 0, 80, 0, 50, 55); // C1, C2, V2 -vertex(30, 45); // V3 -vertex(25, 75); // V4 -bezierVertex(50, 70, 75, 90, 80, 70); // C3, C4, V5 -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_01/Ex_01.pde deleted file mode 100755 index c5fc7d6fa..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,3 +0,0 @@ -float a = sq(1); // Assign 1 to a: Equivalent to 1 * 1 -float b = sq(-5); // Assign 25 to b: Equivalent to -5 * -5 -float c = sq(9); // Assign 81 to c: Equivalent to 9 * 9 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_02/Ex_02.pde deleted file mode 100755 index d55bd3631..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,3 +0,0 @@ -float a = sqrt(6561); // Assign 81 to a -float b = sqrt(625); // Assign 25 to b -float c = sqrt(1); // Assign 1 to c \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_03/Ex_03.pde deleted file mode 100755 index 7c1c3cff0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -float a = pow(1, 3); // Assign 1.0 to a: Equivalent to 1*1*1 -float b = pow(3, 4); // Assign 81.0 to b: Equivalent to 3*3*3*3 -float c = pow(3, -2); // Assign 0.11 to c: Equivalent to 1 / 3*3 -float d = pow(-3, 3); // Assign -27.0 to d: Equivalent to -3*-3*-3 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_04/Ex_04.pde deleted file mode 100755 index 6a11fa3a9..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,3 +0,0 @@ -float a = pow(8, 0); // Assign 1 to a -float b = pow(3, 1); // Assign 3 to b -float c = pow(4, 1); // Assign 4 to c \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_05/Ex_05.pde deleted file mode 100755 index 9d042c510..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,3 +0,0 @@ -float x = norm(0.0, 0.0, 255.0); // Assign 0.0 to x -float y = norm(102.0, 0.0, 255.0); // Assign 0.4 to y -float z = norm(255.0, 0.0, 255.0); // Assign 1.0 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_06/Ex_06.pde deleted file mode 100755 index fe309ed57..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,3 +0,0 @@ -float x = lerp(-20.0, 60.0, 0.0); // Assign -20.0 to x -float y = lerp(-20.0, 60.0, 0.5); // Assign 20.0 to y -float z = lerp(-20.0, 60.0, 1.0); // Assign 60.0 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_07/Ex_07.pde deleted file mode 100755 index bbd1f1d92..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,3 +0,0 @@ -float x = map(20.0, 0.0, 255.0, -1.0, 1.0); // Assign -0.84 to x -float y = map(0.0, 0.0, 255.0, -1.0, 1.0); // Assign -1.0 to y -float z = map(255.0, 0.0, 255.0, -1.0, 1.0); // Assign 1.0 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_08/Ex_08.pde deleted file mode 100755 index c0b7d668e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,6 +0,0 @@ -for (int x = 0; x < 100; x++) { - float n = norm(x, 0.0, 100.0); // Range 0.0 to 1.0 - float y = pow(n, 4); // Calculate curve - y *= 100; // Range 0.0 to 100.0 - point(x, y); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_09/Ex_09.pde deleted file mode 100755 index f0f9e967d..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_09/Ex_09.pde +++ /dev/null @@ -1,6 +0,0 @@ -for (int x = 0; x < 100; x++) { - float n = norm(x, 0.0, 100.0); // Range 0.0 to 1.0 - float y = pow(n, 0.4); // Calculate curve - y *= 100; // Range 0.0 to 100.0 - point(x, y); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_10/Ex_10.pde deleted file mode 100755 index 2f2e56c5f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_10/Ex_10.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Draw circles at points along the curve y = x^4 -noFill(); -smooth(); -for (int x = 0; x < 100; x += 5) { - float n = norm(x, 0.0, 100.0); // Range 0.0 to 1.0 - float y = pow(n, 4); // Calculate curve - y *= 100; // Scale y to range 0.0 to 100.0 - strokeWeight(n * 5); // Increase thickness - ellipse(x, y, 120, 120); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_11/Ex_11.pde deleted file mode 100755 index de5275bde..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_11/Ex_11.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Draw a line from the top of the display window to -// points on a curve y = x^4 from x in range -1.0 to 1.0 -for (int x = 5; x < 100; x += 5) { - float n = map(x, 5, 95, -1, 1); - float p = pow(n, 4); - float ypos = lerp(20, 80, p); - line(x, 0, x, ypos); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_12/Ex_12.pde deleted file mode 100755 index de5275bde..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_12/Ex_12.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Draw a line from the top of the display window to -// points on a curve y = x^4 from x in range -1.0 to 1.0 -for (int x = 5; x < 100; x += 5) { - float n = map(x, 5, 95, -1, 1); - float p = pow(n, 4); - float ypos = lerp(20, 80, p); - line(x, 0, x, ypos); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_01/Ex_01.pde deleted file mode 100755 index 92971b4d7..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1 +0,0 @@ -background(242, 204, 47); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_02/Ex_02.pde deleted file mode 100755 index 01994bba4..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1 +0,0 @@ -background(174, 221, 60); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_03/Ex_03.pde deleted file mode 100755 index a117663ae..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -background(129, 130, 87); -noStroke(); -fill(174, 221, 60); -rect(17, 17, 66, 66); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_04/Ex_04.pde deleted file mode 100755 index e0fba09ea..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,5 +0,0 @@ -background(129, 130, 87); -noFill(); -strokeWeight(4); -stroke(174, 221, 60); -rect(19, 19, 62, 62); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_05/Ex_05.pde deleted file mode 100755 index e105c7947..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,6 +0,0 @@ -background(116, 193, 206); -noStroke(); -fill(129, 130, 87, 102); // More transparent -rect(20, 20, 30, 60); -fill(129, 130, 87, 204); // Less transparent -rect(50, 20, 30, 60); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_06/Ex_06.pde deleted file mode 100755 index d62471109..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,8 +0,0 @@ -background(116, 193, 206); -int x = 0; -noStroke(); -for (int i = 51; i <= 255; i += 51) { - fill(129, 130, 87, i); - rect(x, 20, 20, 60); - x += 20; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_07/Ex_07.pde deleted file mode 100755 index 2e789774c..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,7 +0,0 @@ -background(56, 90, 94); -smooth(); -strokeWeight(12); -stroke(242, 204, 47, 102); // More transparency -line(30, 20, 50, 80); -stroke(242, 204, 47, 204); // Less transparency -line(50, 20, 70, 80); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_08/Ex_08.pde deleted file mode 100755 index b5a058e58..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,9 +0,0 @@ -background(56, 90, 94); -smooth(); -int x = 0; -strokeWeight(12); -for (int i = 51; i <= 255; i += 51) { - stroke(242, 204, 47, i); - line(x, 20, x+20, 80); - x += 20; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_09/Ex_09.pde deleted file mode 100755 index fc730d6e8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,9 +0,0 @@ -background(0); -noStroke(); -smooth(); -fill(242, 204, 47, 160); // Yellow -ellipse(47, 36, 64, 64); -fill(174, 221, 60, 160); // Green -ellipse(90, 47, 64, 64); -fill(116, 193, 206, 160); // Blue -ellipse(57, 79, 64, 64); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_10/Ex_10.pde deleted file mode 100755 index 1ee13d798..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_10/Ex_10.pde +++ /dev/null @@ -1,9 +0,0 @@ -background(255); -noStroke(); -smooth(); -fill(242, 204, 47, 160); // Yellow -ellipse(47, 36, 64, 64); -fill(174, 221, 60, 160); // Green -ellipse(90, 47, 64, 64); -fill(116, 193, 206, 160); // Blue -ellipse(57, 79, 64, 64); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_11/Ex_11.pde deleted file mode 100755 index 73f49eb06..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_11/Ex_11.pde +++ /dev/null @@ -1,4 +0,0 @@ -color c1 = color(51); // Creates gray -color c2 = color(51, 204); // Creates gray with transparency -color c3 = color(51, 102, 153); // Creates blue -color c4 = color(51, 102, 153, 51); // Creates blue with transparency \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_12/Ex_12.pde deleted file mode 100755 index 545a9b9dd..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_12/Ex_12.pde +++ /dev/null @@ -1,6 +0,0 @@ -color ruby = color(211, 24, 24, 160); -color pink = color(237, 159, 176); -background(pink); -noStroke(); -fill(ruby); -rect(35, 0, 20, 100); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_13/Ex_13.pde deleted file mode 100755 index 93c72f1ea..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_13/Ex_13.pde +++ /dev/null @@ -1,2 +0,0 @@ -// Set the range for the red, green, and blue values from 0.0 to 1.0 -colorMode(RGB, 1.0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_14/Ex_14.pde deleted file mode 100755 index 1a07807a0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_14/Ex_14.pde +++ /dev/null @@ -1,3 +0,0 @@ -// Set the range for the hue to values from 0 to 360 and the -// saturation and brightness to values between 0 and 100 -colorMode(HSB, 360, 100, 100); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_15/Ex_15.pde deleted file mode 100755 index 9ddcb65c6..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_15/Ex_15.pde +++ /dev/null @@ -1,6 +0,0 @@ -// Change the hue, saturation and brightness constant -colorMode(HSB); -for (int i = 0; i < 100; i++) { - stroke(i*2.5, 255, 255); - line(i, 0, i, 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_16/Ex_16.pde deleted file mode 100755 index 5b56d2993..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_16/Ex_16.pde +++ /dev/null @@ -1,6 +0,0 @@ -// Change the saturation, hue and brightness constant -colorMode(HSB); -for (int i = 0; i < 100; i++) { - stroke(132, i*2.5, 204); - line(i, 0, i, 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_17/Ex_17.pde deleted file mode 100755 index 8f4dd60b5..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_17/Ex_17.pde +++ /dev/null @@ -1,6 +0,0 @@ -// Change the brightness, hue and saturation constant -colorMode(HSB); -for (int i = 0; i < 100; i++) { - stroke(132, 108, i*2.5); - line(i, 0, i, 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_18/Ex_18.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_18/Ex_18.pde deleted file mode 100755 index 090d7e3a1..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_18/Ex_18.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Change the saturation and brightness, hue constant -colorMode(HSB); -for (int i = 0; i < 100; i++) { - for (int j = 0; j < 100; j++) { - stroke(132, j*2.5, i*2.5); - point(i, j); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_19/Ex_19.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_19/Ex_19.pde deleted file mode 100755 index a86450793..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_19/Ex_19.pde +++ /dev/null @@ -1,9 +0,0 @@ -// Shift from blue to green in RGB mode -colorMode(RGB); -for (int i = 0; i < 100; i++) { - float r = 61 + (i*0.92); - float g = 156 + (i*0.48); - float b = 204 - (i*1.43); - stroke(r, g, b); - line(i, 0, i, 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_20/Ex_20.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_20/Ex_20.pde deleted file mode 100755 index 0cda24fa8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_20/Ex_20.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Shift from blue to green in HSB mode -colorMode(HSB, 360, 100, 100); -for (int i = 0; i < 100; i++) { - float newHue = 200 - (i*1.2); - stroke(newHue, 70, 80); - line(i, 0, i, 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_21/Ex_21.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_21/Ex_21.pde deleted file mode 100755 index f4d689915..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_21/Ex_21.pde +++ /dev/null @@ -1,5 +0,0 @@ -// Code 9-03 rewritten using hex numbers -background(#818257); -noStroke(); -fill(#AEDD3C); -rect(17, 17, 66, 66); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_01/Ex_01.pde deleted file mode 100755 index 5bee29af8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -PImage img; -// Image must be in the sketch's "data" folder -img = loadImage("arch.jpg"); -image(img, 0, 0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_02/Ex_02.pde deleted file mode 100755 index ce5f8a972..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,4 +0,0 @@ -PImage img; -// Image must be in the sketch's "data" folder to load -img = loadImage("arch.jpg"); -image(img, 20, 20, 60, 60); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_03/Ex_03.pde deleted file mode 100755 index 175ab183e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,6 +0,0 @@ -PImage img; -img = loadImage("arch.jpg"); -tint(102); // Tint gray -image(img, 0, 0); -noTint(); // Disable tint -image(img, 50, 0); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_04/Ex_04.pde deleted file mode 100755 index 9fe123241..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,6 +0,0 @@ -PImage img; -img = loadImage("arch.jpg"); -tint(0, 153, 204); // Tint blue -image(img, 0, 0); -noTint(); // Disable tint -image(img, 50, 0); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_05/Ex_05.pde deleted file mode 100755 index 3c3f26f77..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,11 +0,0 @@ -color yellow = color(220, 214, 41); -color green = color(110, 164, 32); -color tan = color(180, 17, 132); -PImage img; -img = loadImage("arch.jpg"); -tint(yellow); -image(img, 0, 0); -tint(green); -image(img, 33, 0); -tint(tan); -image(img, 66, 0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_06/Ex_06.pde deleted file mode 100755 index 449c956d5..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,7 +0,0 @@ -PImage img; -img = loadImage("arch.jpg"); -background(255); -tint(255, 102); // Alpha to 102 without changing the tint -image(img, 0, 0, 100, 100); -tint(255, 204, 0, 153); // Tint to yellow, alpha to 153 -image(img, 20, 20, 100, 100); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_07/Ex_07.pde deleted file mode 100755 index c9bdfc77b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,8 +0,0 @@ -PImage img; -img = loadImage("arch.jpg"); -background(255); -tint(255, 51); -// Draw the image 10 times, moving each to the right -for (int i = 0; i < 10; i++) { - image(img, i*10, 0); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/Ex_08.pde deleted file mode 100755 index 6b584835b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,6 +0,0 @@ -// Loads a GIF image with 1-bit transparency -PImage img; -img = loadImage("archTrans.gif"); -background(255); -image(img, 0, 0); -image(img, -20, 0); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/data/archTrans.gif b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/data/archTrans.gif deleted file mode 100755 index d4b0348a1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/data/archTrans.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/data/mud-trans.gif b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/data/mud-trans.gif deleted file mode 100755 index 808499d3f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/data/mud-trans.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_09/Ex_09.pde deleted file mode 100755 index e5260d770..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,6 +0,0 @@ -// Loads a PNG image with 8-bit transparency -PImage img; -img = loadImage("arch.png"); -background(255); -image(img, 0, 0); -image(img, -20, 0); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_01/Ex_01.pde deleted file mode 100755 index 02d482311..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -char a = 'n'; // Assigns 'n' to variable a -char b = n; // ERROR! Without the '', n expected to be a variable -char c = "n"; // ERROR! The "" defines n as a String, not a char -char d = 'not'; // ERROR! The char type can hold only one character diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_01/data/archTrans.gif b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_01/data/archTrans.gif deleted file mode 100755 index d4b0348a1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_01/data/archTrans.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_02/Ex_02.pde deleted file mode 100755 index daea5872f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,5 +0,0 @@ -char letter; -letter = 'A'; // Assign 'A' to variable letter -println(letter); // Prints "A" to the console -letter = 'B'; // Assign 'B' to variable letter -println(letter); // Prints "B" to the console diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_02/data/archTrans.gif b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_02/data/archTrans.gif deleted file mode 100755 index d4b0348a1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_02/data/archTrans.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_03/Ex_03.pde deleted file mode 100755 index 07488bcdc..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -char letter = 'A'; // Declare variable letter and assign 'A' -println(letter); // Prints "A" to the console -int n = letter; // Assign the numerical value 'A' to variable n -println(n); // Prints "65" to the console diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_03/data/archTrans.gif b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_03/data/archTrans.gif deleted file mode 100755 index d4b0348a1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_03/data/archTrans.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_04/Ex_04.pde deleted file mode 100755 index df97c271f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,6 +0,0 @@ -char letter = 'A'; // Declare variable letter and assign 'A' -for (int i=0; i<26; i++) { - print(letter); // Prints a character to the console - letter++; // Add 1 to the value of the character -} -println('.'); // Adds a period to the end of the alphabet diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_04/data/archTrans.gif b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_04/data/archTrans.gif deleted file mode 100755 index d4b0348a1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_04/data/archTrans.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_05/Ex_05.pde deleted file mode 100755 index 8cf506b59..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,4 +0,0 @@ -String a = "Eponymous"; // Assign "Eponymous" to a -String b = 'E'; // ERROR! The '' define E as a char -String c = "E"; // Assign "E" to c -string d = "E"; // ERROR! String must be capitalized diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_05/data/archTrans.gif b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_05/data/archTrans.gif deleted file mode 100755 index d4b0348a1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_05/data/archTrans.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_06/Ex_06.pde deleted file mode 100755 index 40e8806ef..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,11 +0,0 @@ -// The String data type can contain long and short text elements -String s1 = "Rakete bee bee?"; -String s2 = "Rrrrrrrrrrrrrrrrummmmmpffff tillffff tooooooo?"; -println(s1); // Prints "Rakete bee bee?" -println(s2); // Prints "Rrrrrrrrrrrrrrrrummmmmpffff tillffff tooooooo?" - -// Strings can be combined with the + operator -String s3 = "Rakete "; -String s4 = "rinnzekete"; -String s5 = s3 + s4; -println(s5); // Prints "Rakete rinnzekete" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_06/data/archTrans.gif b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_06/data/archTrans.gif deleted file mode 100755 index d4b0348a1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_06/data/archTrans.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_01/Ex_01.pde deleted file mode 100755 index cd6c249cd..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -float f = 12.6; -int i = 127; -f = i; // Converts 127 to 127.0 -i = f; // Error: Can't automatically convert a float to an int diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_02/Ex_02.pde deleted file mode 100755 index 7978747d3..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_02/Ex_02.pde +++ /dev/null @@ -1,6 +0,0 @@ -int i = 0; -boolean b = boolean(i); // Assign false to b -int n = 12; -b = boolean(n); // Assign true to b -String s = "false"; -b = boolean(s); // Assign false to b \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_03/Ex_03.pde deleted file mode 100755 index d3d911a26..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_03/Ex_03.pde +++ /dev/null @@ -1,6 +0,0 @@ -float f = 65.0; -byte b = byte(f); // Assign 65 to b -char c = 'E'; -b = byte(c); // Assign 69 to b -f = 130.0; -b = byte(f); // Assign -126 to b \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_04/Ex_04.pde deleted file mode 100755 index b3f58a05a..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_04/Ex_04.pde +++ /dev/null @@ -1,4 +0,0 @@ -int i = 65; -byte y = 72; -char c = char(i); // Assign 'A' to c -c = char(y); // Assign 'H' to c diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_05/Ex_05.pde deleted file mode 100755 index 18e544d21..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_05/Ex_05.pde +++ /dev/null @@ -1,4 +0,0 @@ -int i = 2; -int j = 3; -float f1 = i/j; // Assign 0.0 to f1 -float f2 = i/float(j); // Assign 0.6666667 to f2 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_06/Ex_06.pde deleted file mode 100755 index 45e800a0f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_06/Ex_06.pde +++ /dev/null @@ -1,4 +0,0 @@ -float f = 65.3; -int i = int(f); // Assign 65 to i -char c = 'E'; -i = int(c); // Assign 69 to i diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_07/Ex_07.pde deleted file mode 100755 index 02ff8dbe9..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_07/Ex_07.pde +++ /dev/null @@ -1,6 +0,0 @@ -int i = 3; -String s = str(i); // Assign "3" to s -float f = -12.6; -s = str(f); // Assign "-12.6" to s -boolean b = true; -s = str(b); // Assign "true" to s diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_08/Ex_08.pde deleted file mode 100755 index 044618d25..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_08/Ex_08.pde +++ /dev/null @@ -1,6 +0,0 @@ -// Loads an image that is 320 pixels wide and 240 pixels high -PImage img = loadImage("ohio.jpg"); -int w = img.width; // Assign 320 to w -int h = img.height; // Assign 240 to h -println(w); // Prints "320" -println(h); // Prints "240" diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_09/Ex_09.pde deleted file mode 100755 index ea8fe761e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_09/Ex_09.pde +++ /dev/null @@ -1,4 +0,0 @@ -String s1 = "Player Piano"; -String s2 = "P"; -println( s1.length() ); // Prints "12" -println( s2.length() ); // Prints "1" diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_10/Ex_10.pde deleted file mode 100755 index 4a643846f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_10/Ex_10.pde +++ /dev/null @@ -1,4 +0,0 @@ -String s1 = "Slaughterhouse Five"; -println(s1.startsWith("S")); // Prints "true" -println(s1.startsWith("Five")); // Prints "false" -println(s1.endsWith("Five")); // Prints "true" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_11/Ex_11.pde deleted file mode 100755 index 4d1ebc2f6..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_11/Ex_11.pde +++ /dev/null @@ -1,4 +0,0 @@ -String s = "Verde"; -println(s.charAt(0)); // Prints "V" -println(s.charAt(2)); // Prints "r" -println(s.charAt(4)); // Prints "e" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_12/Ex_12.pde deleted file mode 100755 index 2ab240e22..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_12/Ex_12.pde +++ /dev/null @@ -1,4 +0,0 @@ -String s = "Azzurro"; -char[] c = s.toCharArray(); -println(c[0]); // Prints "A" -println(c[1]); // Prints "z" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_13/Ex_13.pde deleted file mode 100755 index 12256f153..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_13/Ex_13.pde +++ /dev/null @@ -1,5 +0,0 @@ -String s = "Giallo"; -println(s.substring(2)); // Prints "allo" -println(s.substring(4)); // Prints "lo" -println(s.substring(1, 4)); // Prints "ial" -println(s.substring(0, s.length()-1)); // Prints "Giall" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_14/Ex_14.pde deleted file mode 100755 index e6bc979cb..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_14/Ex_14.pde +++ /dev/null @@ -1,3 +0,0 @@ -String s = "Nero"; -println(s.toLowerCase()); // Prints "nero" -println(s.toUpperCase()); // Prints "NERO" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_15/Ex_15.pde deleted file mode 100755 index 0bd59b105..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_15/Ex_15.pde +++ /dev/null @@ -1,5 +0,0 @@ -String s1 = "Bianco"; -String s2 = "Bianco"; -String s3 = "Nero"; -println(s1.equals(s2)); // Prints "true" -println(s1.equals(s3)); // Prints "false" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_01/Ex_01.pde deleted file mode 100755 index b33b593cd..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,7 +0,0 @@ -PFont font; // Declare the variable -font = loadFont("Ziggurat-32.vlw"); // Load the font -textFont(font); // Set the current text font -fill(0); -text("LAX", 0, 40); // Write "LAX" at coordinate (0,40) -text("AMS", 0, 70); // Write "AMS" at coordinate (0,70) -text("FRA", 0, 100); // Write "FRA" at coordinate (0,100) \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_01/data/Ziggurat-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_01/data/Ziggurat-32.vlw deleted file mode 100755 index abe7061e7..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_01/data/Ziggurat-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_02/Ex_02.pde deleted file mode 100755 index 2f39988b2..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,7 +0,0 @@ -PFont font; -font = loadFont("Ziggurat-32.vlw"); -textFont(font); -fill(0); -text(19, 0, 36); // Write 19 at coordinate (0,36) -text(72, 0, 70); // Write 72 at coordinate (0,70) -text('R', 62, 70); // Write 'R' at coordinate (62,70) \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_02/data/Ziggurat-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_02/data/Ziggurat-32.vlw deleted file mode 100755 index abe7061e7..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_02/data/Ziggurat-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/Ex_03.pde deleted file mode 100755 index 2cc8b7f2c..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,6 +0,0 @@ -PFont font; -font = loadFont("Ziggurat-12.vlw"); -textFont(font); -fill(0); -String s = "Response is the medium"; -text(s, 10, 20, 80, 50); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/data/Courier-12.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/data/Courier-12.vlw deleted file mode 100755 index fe569b3dc..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/data/Courier-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/data/Ziggurat-12.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/data/Ziggurat-12.vlw deleted file mode 100755 index c6bde4e4d..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/data/Ziggurat-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/Ex_04.pde deleted file mode 100755 index 51fbb19c8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,9 +0,0 @@ -PFont font; -font = loadFont("Ziggurat-32.vlw"); -textFont(font); -fill(255); // White -text("DAY", 0, 40); -fill(0); // Black -text("CVG", 0, 70); -fill(102); // Gray -text("ATL", 0, 100); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/data/Courier-48.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/data/Courier-48.vlw deleted file mode 100755 index e87ef86b2..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/data/Courier-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/data/Ziggurat-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/data/Ziggurat-32.vlw deleted file mode 100755 index abe7061e7..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/data/Ziggurat-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/Ex_05.pde deleted file mode 100755 index ab8c060f4..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,9 +0,0 @@ -PFont font; -font = loadFont("Ziggurat-72.vlw"); -textFont(font); -fill(0, 160); // Black with low opacity -text("1", 0, 80); -text("2", 15, 80); -text("3", 30, 80); -text("4", 45, 80); -text("5", 60, 80); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Courier-96.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Courier-96.vlw deleted file mode 100755 index 5609ca52f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Courier-96.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-32.vlw deleted file mode 100755 index abe7061e7..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-48.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-48.vlw deleted file mode 100755 index 2517b88aa..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-72.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-72.vlw deleted file mode 100755 index fe2da33e9..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-72.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/Ex_06.pde deleted file mode 100755 index b50ccd6d5..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,10 +0,0 @@ -PFont font1, font2; -font1 = loadFont("Ziggurat-32.vlw"); -font2 = loadFont("ZigguratItalic-32.vlw"); -fill(0); -// Set the font to Ziggurat-32.vlw -textFont(font1); -text("GNU", 6, 45); -// Set the font to ZigguratItalic-32.vlw -textFont(font2); -text("GNU", 2, 80); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/Courier-48.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/Courier-48.vlw deleted file mode 100755 index e87ef86b2..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/Courier-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/CourierItalic-48.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/CourierItalic-48.vlw deleted file mode 100755 index 1c54c2188..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/CourierItalic-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/Ziggurat-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/Ziggurat-32.vlw deleted file mode 100755 index abe7061e7..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/Ziggurat-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/ZigguratItalic-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/ZigguratItalic-32.vlw deleted file mode 100755 index 7bbb1f6bd..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/ZigguratItalic-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/ZigguratItalic-48.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/ZigguratItalic-48.vlw deleted file mode 100755 index 83a1668d5..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/ZigguratItalic-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/Ex_07.pde deleted file mode 100755 index b14ac71e0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Reducing a font created at 32 pixels -PFont font; -font = loadFont("Ziggurat-32.vlw"); -textFont(font); -fill(0); -text("LNZ", 0, 40); // Large -textSize(18); -text("STN", 0, 75); // Medium -textSize(12); -text("BOS", 0, 100); // Small \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/Courier-48.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/Courier-48.vlw deleted file mode 100755 index e87ef86b2..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/Courier-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/CourierItalic-48.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/CourierItalic-48.vlw deleted file mode 100755 index 1c54c2188..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/CourierItalic-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/Ziggurat-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/Ziggurat-32.vlw deleted file mode 100755 index abe7061e7..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/Ziggurat-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/Ex_08.pde deleted file mode 100755 index a8fb96eaf..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Enlarging a font created at 12 pixels -PFont font; -font = loadFont("Ziggurat-12.vlw"); -textFont(font); -textSize(32); -fill(0); -text("LNZ", 0, 40); // Large -textSize(18); -text("STN", 0, 75); // Medium -textSize(12); -text("BOS", 0, 100); // Small \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/data/Courier-12.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/data/Courier-12.vlw deleted file mode 100755 index a4e5d9737..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/data/Courier-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/data/Ziggurat-12.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/data/Ziggurat-12.vlw deleted file mode 100755 index c6bde4e4d..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/data/Ziggurat-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/Ex_09.pde deleted file mode 100755 index f63c75d40..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,11 +0,0 @@ -PFont font; -font = loadFont("Ziggurat-12.vlw"); -textFont(font); -String lines = "L1 L2 L3"; -textLeading(10); -fill(0); -text(lines, 5, 15, 30, 100); -textLeading(20); -text(lines, 36, 15, 30, 100); -textLeading(30); -text(lines, 68, 15, 30, 100); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/data/Courier-12.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/data/Courier-12.vlw deleted file mode 100755 index fe569b3dc..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/data/Courier-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/data/Ziggurat-12.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/data/Ziggurat-12.vlw deleted file mode 100755 index c6bde4e4d..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/data/Ziggurat-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/Ex_10.pde deleted file mode 100755 index a5d4706e5..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/Ex_10.pde +++ /dev/null @@ -1,11 +0,0 @@ -PFont font; -font = loadFont("Ziggurat-12.vlw"); -textFont(font); -line(50, 0, 50, 100); -fill(0); -textAlign(LEFT); -text("Left", 50, 20); -textAlign(RIGHT); -text("Right", 50, 40); -textAlign(CENTER); -text("Center", 50, 80); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/data/Courier-12.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/data/Courier-12.vlw deleted file mode 100755 index fe569b3dc..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/data/Courier-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/data/Ziggurat-12.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/data/Ziggurat-12.vlw deleted file mode 100755 index c6bde4e4d..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/data/Ziggurat-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/Ex_11.pde deleted file mode 100755 index f7ed3ef76..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/Ex_11.pde +++ /dev/null @@ -1,12 +0,0 @@ -PFont font; -font = loadFont("Ziggurat-32.vlw"); -textFont(font); -fill(0); -char c = 'U'; -float cw = textWidth(c); -text(c, 22, 40); -rect(22, 42, cw, 5); -String s = "UC"; -float sw = textWidth(s); -text(s, 22, 76); -rect(22, 78, sw, 5); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/data/Courier-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/data/Courier-32.vlw deleted file mode 100755 index 1dbdeb8f1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/data/Courier-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/data/Ziggurat-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/data/Ziggurat-32.vlw deleted file mode 100755 index abe7061e7..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/data/Ziggurat-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_01/Ex_01.pde deleted file mode 100755 index db8c53f67..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_01/Ex_01.pde +++ /dev/null @@ -1 +0,0 @@ -println(PI); // Prints the value of PI to the text area \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_02/Ex_02.pde deleted file mode 100755 index 929c64dd6..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_02/Ex_02.pde +++ /dev/null @@ -1,8 +0,0 @@ -float r1 = radians(90); -float r2 = radians(180); -println(r1); // Prints "1.5707964" -println(r2); // Prints "3.1415927" -float d1 = degrees(PI); -float d2 = degrees(TWO_PI); -println(d1); // Prints "180.0" -println(d2); // Prints "360.0" diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_03/Ex_03.pde deleted file mode 100755 index ca7e77bd9..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_03/Ex_03.pde +++ /dev/null @@ -1,3 +0,0 @@ -for (float angle = 0; angle < TWO_PI; angle += PI/24.0) { - println(sin(angle)); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_04/Ex_04.pde deleted file mode 100755 index 985954b01..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_04/Ex_04.pde +++ /dev/null @@ -1,3 +0,0 @@ -for (float angle = 0; angle < TWO_PI; angle += PI/24.0) { - println(sin(angle) * 50.0); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_05/Ex_05.pde deleted file mode 100755 index 2713dd807..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_05/Ex_05.pde +++ /dev/null @@ -1,4 +0,0 @@ -for (float angle = 0; angle < TWO_PI; angle += PI/24.0) { - float newValue = map(sin(angle), -1, 1, 0, 1000); - println(newValue); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_06/Ex_06.pde deleted file mode 100755 index c3cecdee9..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_06/Ex_06.pde +++ /dev/null @@ -1,9 +0,0 @@ -size(700, 100); -noStroke(); -fill(0); -float angle = 0.0; -for (int x = 0; x <= width; x += 5) { - float y = 50 + (sin(angle) * 35.0); - rect(x, y, 2, 4); - angle += PI/40.0; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_07/Ex_07.pde deleted file mode 100755 index 34804510d..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_07/Ex_07.pde +++ /dev/null @@ -1,13 +0,0 @@ -size(700, 100); -noStroke(); -smooth(); -fill(0); -float offset = 50.0; // Y offset -float scaleVal = 35.0; // Scale value for the wave magnitude -float angleInc = PI/28.0; // Increment between the next angle -float angle = 0.0; // Angle to receive sine values from -for (int x = 0; x <= width; x += 5) { - float y = offset + (sin(angle) * scaleVal); - rect(x, y, 2, 4); - angle += angleInc; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_08/14-08.tif b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_08/14-08.tif deleted file mode 100644 index a3dce6057..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_08/14-08.tif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_08/Ex_08.pde deleted file mode 100755 index fc434aa61..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_08/Ex_08.pde +++ /dev/null @@ -1,16 +0,0 @@ -size(700, 100); -noStroke(); -smooth(); -float offset = 50.0; -float scaleVal = 20.0; -float angleInc = PI/18.0; -float angle = 0.0; -for (int x = 0; x <= width; x += 5) { - float y = offset + (sin(angle) * scaleVal); - fill(255); - rect(x, y, 2, 4); - y = offset + (cos(angle) * scaleVal); - fill(0); - rect(x, y, 2, 4); - angle += angleInc; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_09/Ex_09.pde deleted file mode 100755 index 99ab6a969..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_09/Ex_09.pde +++ /dev/null @@ -1,16 +0,0 @@ -size(700, 100); -float offset = 50; -float scaleVal = 30.0; -float angleInc = PI/56.0; -float angle = 0.0; -beginShape(TRIANGLE_STRIP); -for (int x = 4 ; x <= width+5; x += 5) { - float y = sin(angle) * scaleVal; - if ((x % 2) == 0) { // Every other time through the loop - vertex(x, offset + y); - } else { - vertex(x, offset - y); - } - angle += angleInc; -} -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_10/Ex_10.pde deleted file mode 100755 index 162b12988..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_10/Ex_10.pde +++ /dev/null @@ -1,13 +0,0 @@ -size(700, 100); -smooth(); -strokeWeight(2); -float offset = 126.0; -float scaleVal = 126.0; -float angleInc = 0.42; -float angle = 0.0; -for (int x = -52; x <= width; x += 5) { - float y = offset + (sin(angle) * scaleVal); - stroke(y); - line(x, 0, x+50, height); - angle += angleInc; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_11/Ex_11.pde deleted file mode 100755 index 07f589c83..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_11/Ex_11.pde +++ /dev/null @@ -1,17 +0,0 @@ -size(700, 100); -smooth(); -fill(255, 20); -float scaleVal = 18.0; -float angleInc = PI/28.0; -float angle = 0.0; -for (int offset = -10; offset < width+10; offset += 5) { - for (int y = 0; y <= height; y += 2) { - float x = offset + (sin(angle) * scaleVal); - noStroke(); - ellipse(x, y, 10, 10); - stroke(0); - point(x, y); - angle += angleInc; - } - angle += PI; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_12/Ex_12.pde deleted file mode 100755 index 77e40dda6..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_12/Ex_12.pde +++ /dev/null @@ -1,9 +0,0 @@ -noStroke(); -smooth(); -int radius = 38; -for (int deg = 0; deg < 360; deg += 12) { - float angle = radians(deg); - float x = 50 + (cos(angle) * radius); - float y = 50 + (sin(angle) * radius); - ellipse(x, y, 6, 6); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_13/Ex_13.pde deleted file mode 100755 index 5e94fcf10..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_13/Ex_13.pde +++ /dev/null @@ -1,9 +0,0 @@ -noStroke(); -smooth(); -int radius = 38; -for (int deg = 0; deg < 220; deg += 12) { - float angle = radians(deg); - float x = 50 + (cos(angle) * radius); - float y = 50 + (sin(angle) * radius); - ellipse(x, y, 6, 6); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_14/Ex_14.pde deleted file mode 100755 index 92d2b0f07..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_14/Ex_14.pde +++ /dev/null @@ -1,6 +0,0 @@ -strokeWeight(2); -arc(50, 55, 50, 50, 0, HALF_PI); -arc(50, 55, 60, 60, HALF_PI, PI); -arc(50, 55, 70, 70, PI, TWO_PI - HALF_PI); -noFill(); -arc(50, 55, 80, 80, TWO_PI - HALF_PI, TWO_PI); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_15/Ex_15.pde deleted file mode 100755 index c27b94ba1..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_15/Ex_15.pde +++ /dev/null @@ -1,10 +0,0 @@ -smooth(); -noFill(); -randomSeed(0); -strokeWeight(10); -stroke(0, 150); -for (int i = 0; i < 160; i += 10) { - float begin = radians(i); - float end = begin + HALF_PI; - arc(67, 37, i, i, begin, end); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_16/Ex_16.pde deleted file mode 100755 index 461f67988..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_16/Ex_16.pde +++ /dev/null @@ -1,10 +0,0 @@ -noStroke(); -smooth(); -float radius = 1.0; -for (int deg = 0; deg < 360*6; deg += 11) { - float angle = radians(deg); - float x = 75 + (cos(angle) * radius); - float y = 42 + (sin(angle) * radius); - ellipse(x, y, 6, 6); - radius = radius + 0.34; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_17/Ex_17.pde deleted file mode 100755 index 5a608b373..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_17/Ex_17.pde +++ /dev/null @@ -1,15 +0,0 @@ -smooth(); -float radius = 0.15; -float cx = 33; // Center x- and y-coordinates -float cy = 66; -float px = cx; // Start with center as the -float py = cy; // previous coordinate -for (int deg = 0; deg < 360*5; deg += 12) { - float angle = radians(deg); - float x = cx + (cos(angle) * radius); - float y = cy + (sin(angle) * radius); - line(px, py, x, y); - radius = radius * 1.045; - px = x; - py = y; -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_01/Ex_01.pde deleted file mode 100755 index af1057026..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_01/Ex_01.pde +++ /dev/null @@ -1,3 +0,0 @@ -float f = random(5.2); // Assign f a float value from 0 to 5.2 -int i = random(5.2); // ERROR! Can't assign a float to an int -int j = int(random(5.2)); // Assign j an int value from 0 to 5 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_02/Ex_02.pde deleted file mode 100755 index 5316e4ac0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_02/Ex_02.pde +++ /dev/null @@ -1,8 +0,0 @@ -smooth(); -strokeWeight(10); -stroke(0, 130); -line(0, random(100), 100, random(100)); -line(0, random(100), 100, random(100)); -line(0, random(100), 100, random(100)); -line(0, random(100), 100, random(100)); -line(0, random(100), 100, random(100)); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_03/Ex_03.pde deleted file mode 100755 index 13e0ca06f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_03/Ex_03.pde +++ /dev/null @@ -1,12 +0,0 @@ -smooth(); -strokeWeight(20); -stroke(0, 230); -float r = random(5, 45); -stroke(r * 5.6, 230); -line(0, r, 100, random(55, 95)); -r = random(5, 45); -stroke(r * 5.6, 230); -line(0, r, 100, random(55, 95)); -r = random(5, 45); -stroke(r * 5.6, 230); -line(0, r, 100, random(55, 95)); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_04/Ex_04.pde deleted file mode 100755 index f584dcaa5..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_04/Ex_04.pde +++ /dev/null @@ -1,8 +0,0 @@ -background(0); -stroke(255, 60); -for (int i = 0; i < 100; i++) { - float r = random(10); - strokeWeight(r); - float offset = r * 5.0; - line(i-20, 100, i+offset, 0); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_05/Ex_05.pde deleted file mode 100755 index 2edfe0ab3..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_05/Ex_05.pde +++ /dev/null @@ -1,6 +0,0 @@ -float r = random(100); -if (r < 50.0) { - line(0, 0, 100, 100); -} else { - ellipse(50, 50, 75, 75); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_06/Ex_06.pde deleted file mode 100755 index c4bd1d123..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_06/Ex_06.pde +++ /dev/null @@ -1,4 +0,0 @@ -int num = int(random(50)) + 1; -for (int i = 0; i < num; i++) { - line(i * 2, 0, i * 2, 100); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_07/Ex_07.pde deleted file mode 100755 index 4eb73ad11..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_07/Ex_07.pde +++ /dev/null @@ -1,10 +0,0 @@ -int s = 6; // Seed value -background(0); -stroke(255, 60); -randomSeed(s); // Produce the same numbers each time -for (int i = 0; i < 100; i++) { - float r = random(10); - strokeWeight(r); - float offset = r * 5; - line(i-20, 100, i+offset, 0); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_08/Ex_08.pde deleted file mode 100755 index a9291783f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_08/Ex_08.pde +++ /dev/null @@ -1,11 +0,0 @@ -size(600, 100); -float v = 0.0; -float inc = 0.1; -noStroke(); -fill(0); -noiseSeed(0); -for (int i = 0; i < width; i = i+4) { - float n = noise(v) * 70.0; - rect(i, 10 + n, 3, 20); - v = v + inc; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_09/Ex_09.pde deleted file mode 100755 index be65dd2c0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_09/Ex_09.pde +++ /dev/null @@ -1,13 +0,0 @@ -float xnoise = 0.0; -float ynoise = 0.0; -float inc = 0.04; -for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - float gray = noise(xnoise, ynoise) * 255; - stroke(gray); - point(x, y); - xnoise = xnoise + inc; - } - xnoise = 0; - ynoise = ynoise + inc; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_10/Ex_10.pde deleted file mode 100755 index 1a0015f78..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_10/Ex_10.pde +++ /dev/null @@ -1,17 +0,0 @@ -float power = 3; // Turbulence power -float d = 8; // Turbulence density -noStroke(); -for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - float total = 0.0; - for (float i = d; i >= 1; i = i/2.0) { - total += noise(x/d, y/d) * d; - } - float turbulence = 128.0 * total / d; - float base = (x * 0.2) + (y * 0.12); - float offset = base + (power * turbulence / 256.0); - float gray = abs(sin(offset)) * 256.0; - stroke(gray); - point(x, y); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_01/Ex_01.pde deleted file mode 100755 index a9f96ae5f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,5 +0,0 @@ -// The same rectangle is drawn, but only the second is -// affected by translate() because it is drawn after -rect(0, 5, 70, 30); -translate(10, 30); // Shifts 10 pixels right and 30 down -rect(0, 5, 70, 30); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_02/Ex_02.pde deleted file mode 100755 index 60d64375b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,5 +0,0 @@ -// A negative number used as a parameter to translate() -// moves the coordinates in the opposite direction -rect(0, 5, 70, 30); -translate(10, -10); // Shifts 10 pixels right and up -rect(0, 5, 70, 30); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_03/Ex_03.pde deleted file mode 100755 index c7a24fc6a..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,5 +0,0 @@ -rect(0, 5, 70, 30); -translate(10, 30); // Shifts 10 pixels right and 30 down -rect(0, 5, 70, 30); -translate(10, 30); // Shifts everything again for a total -rect(0, 5, 70, 30); // 20 pixels right and 60 down \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_04/Ex_04.pde deleted file mode 100755 index a89653ec9..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,3 +0,0 @@ -translate(33, 0); // Shift 33 pixels right -rect(0, 20, 66, 30); -rect(0, 50, 66, 30); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_05/Ex_05.pde deleted file mode 100755 index 838e913b2..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,8 +0,0 @@ -pushMatrix(); -translate(33, 0); // Shift 33 pixels right -rect(0, 20, 66, 30); -popMatrix(); // Remove the shift -// This shape is not affected by translate() because -// the transformation is isolated between the pushMatrix() -// and popMatrix() -rect(0, 50, 66, 30); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_06/Ex_06.pde deleted file mode 100755 index a15e7466d..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,10 +0,0 @@ -pushMatrix(); -translate(20, 0); -rect(0, 10, 70, 20); // Draws at (20, 30) -pushMatrix(); -translate(30, 0); -rect(0, 30, 70, 20); // Draws at (50, 30) -popMatrix(); -rect(0, 50, 70, 20); // Draws at (20, 50) -popMatrix(); -rect(0, 70, 70, 20); // Draws at (0, 70) \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_01/Ex_01.pde deleted file mode 100755 index 8c61af522..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -smooth(); -rect(55, 0, 30, 45); -rotate(PI/8); -rect(55, 0, 30, 45); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_02/Ex_02.pde deleted file mode 100755 index 4842e75ed..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,6 +0,0 @@ -smooth(); -rect(10, 60, 70, 20); -rotate(-PI/16); -rect(10, 60, 70, 20); -rotate(-PI/8); -rect(10, 60, 70, 20); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_03/Ex_03.pde deleted file mode 100755 index 4168dbbbd..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -smooth(); -ellipse(32, 32, 30, 30); -scale(1.8); -ellipse(32, 32, 30, 30); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_04/Ex_04.pde deleted file mode 100755 index 843563dca..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,4 +0,0 @@ -smooth(); -ellipse(32, 32, 30, 30); -scale(2.8, 1.8); -ellipse(32, 32, 30, 30); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_05/Ex_05.pde deleted file mode 100755 index aade47402..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,6 +0,0 @@ -float s = 1.8; -smooth(); -ellipse(32, 32, 30, 30); -scale(s); -strokeWeight(1.0 / s); -ellipse(32, 32, 30, 30); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_06/Ex_06.pde deleted file mode 100755 index 6ef427e53..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,5 +0,0 @@ -rect(10, 20, 70, 20); -scale(1.7); -rect(10, 20, 70, 20); -scale(1.7); -rect(10, 20, 70, 20); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_07/Ex_07.pde deleted file mode 100755 index 741431c35..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,3 +0,0 @@ -translate(width/2, height/2); -rotate(PI/8); -rect(-25, -25, 50, 50); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_08/Ex_08.pde deleted file mode 100755 index 8f0a73169..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,3 +0,0 @@ -rotate(PI/8); -translate(width/2, height/2); -rect(-25, -25, 50, 50); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_09/Ex_09.pde deleted file mode 100755 index 42db71d49..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_09/Ex_09.pde +++ /dev/null @@ -1,6 +0,0 @@ -translate(10, 60); -rect(0, 0, 70, 20); -rotate(-PI/12); -rect(0, 0, 70, 20); -rotate(-PI/6); -rect(0, 0, 70, 20); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_10/Ex_10.pde deleted file mode 100755 index 049a5b4de..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_10/Ex_10.pde +++ /dev/null @@ -1,6 +0,0 @@ -translate(45, 60); -rect(-35, -5, 70, 10); -rotate(-PI/8); -rect(-35, -5, 70, 10); -rotate(-PI/8); -rect(-35, -5, 70, 10); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_11/Ex_11.pde deleted file mode 100755 index f10a4b270..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_11/Ex_11.pde +++ /dev/null @@ -1,7 +0,0 @@ -noFill(); -translate(10, 20); -rect(0, 0, 20, 10); -scale(2.2); -rect(0, 0, 20, 10); -scale(2.2); -rect(0, 0, 20, 10); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_12/Ex_12.pde deleted file mode 100755 index 80411886f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_12/Ex_12.pde +++ /dev/null @@ -1,5 +0,0 @@ -noFill(); -translate(50, 30); -rect(-10, 5, 20, 10); -scale(2.5); -rect(-10, 5, 20, 10); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_13/Ex_13.pde deleted file mode 100755 index 7b7298cec..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_13/Ex_13.pde +++ /dev/null @@ -1,9 +0,0 @@ -background(0); -smooth(); -stroke(255, 120); -translate(66, 33); // Set initial offset -for (int i = 0; i < 18; i++) { // 18 repetitions - strokeWeight(i); // Increase stroke weight - rotate(PI/12); // Accumulate the rotation - line(0, 0, 55, 0); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_14/Ex_14.pde deleted file mode 100755 index 6275686a8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_14/Ex_14.pde +++ /dev/null @@ -1,9 +0,0 @@ -background(0); -smooth(); -noStroke(); -fill(255, 48); -translate(33, 66); // Set initial offset -for (int i = 0; i < 12; i++) { // 12 repetitions - scale(1.2); // Accumulate the scaling - ellipse(4, 2, 20, 20); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_15/Ex_15.pde deleted file mode 100755 index f7ee067b8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_15/Ex_15.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Shift the origin (0,0) to the center -size(100, 100); -translate(width/2, height/2); -line(-width/2, 0, width/2, 0); // Draw x-axis -line(0, -height/2, 0, height/2); // Draw y-axis -smooth(); -noStroke(); -fill(255, 204); -ellipse(0, 0, 45, 45); // Draw at the origin -ellipse(-width/2, height/2, 45, 45); -ellipse(width/2, -height/2, 45, 45); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_16/Ex_16.pde deleted file mode 100755 index b59304907..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_16/Ex_16.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Shift the origin (0,0) to the center -// and resizes the coordinate system -size(100, 100); -scale(width/2, height/2); -translate(1.0, 1.0); -strokeWeight(1.0/width); -line(-1, 0, 1, 0); // Draw x-axis -line(0, -1, 0, 1); // Draw y-axis -smooth(); -noStroke(); -fill(255, 204); -ellipse(0, 0, 0.9, 0.9); // Draw at the origin -ellipse(-1.0, 1.0, 0.9, 0.9); -ellipse(1.0, -1.0, 0.9, 0.9); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_17/Ex_17.pde deleted file mode 100755 index 20b681469..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_17/Ex_17.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Shift the origin (0,0) to the lower-left corner -size(100, 100); -translate(0, height); -scale(1.0, -1.0); -line(0, 1, width, 1); // Draw x-axis -line(0, 1, 0, height ); // Draw y-axis -smooth(); -noStroke(); -fill(255, 204); -ellipse(0, 0, 45, 45); // Draw at the origin -ellipse(width/2, height/2, 45, 45); -ellipse(width, height, 45, 45); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_01/Ex_01.pde deleted file mode 100755 index 0c78fd42b..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -// Reveals each frame passing as a number drawn to the console -void draw() { - println(frameCount); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_02/Ex_02.pde deleted file mode 100755 index 73c1b9341..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,5 +0,0 @@ -// Runs at around 4 fps, prints each frame number to the console -void draw() { -frameRate(4); -println(frameCount); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_03/Ex_03.pde deleted file mode 100755 index 1cb730154..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,6 +0,0 @@ -float y = 0.0; -void draw() { - frameRate(30); - line(0, y, 100, y); - y = y + 0.5; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_04/Ex_04.pde deleted file mode 100755 index 91eefe57c..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,8 +0,0 @@ -float y = 0.0; - -void draw() { - frameRate(30); - background(204); - y = y + 0.5; - line(0, y, 100, y); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_05/Ex_05.pde deleted file mode 100755 index 635991950..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,8 +0,0 @@ -float y = 0.0; - -void draw() { - frameRate(30); - background(y * 2.5); - y = y + 0.5; - line(0, y, 100, y); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_06/Ex_06.pde deleted file mode 100755 index 934c3f24f..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,10 +0,0 @@ -float y = 0.0; -void draw() { - frameRate(30); - background(y * 2.5); - y = y + 0.5; - line(0, y, 100, y); - if (y > 100) { - y = 0; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_07/Ex_07.pde deleted file mode 100755 index 10e155cac..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,16 +0,0 @@ -float y = 0.0; - -void setup() { - size(100, 100); - smooth(); - fill(0); -} - -void draw() { - background(204); - ellipse(50, y, 70, 70); - y += 0.5; - if (y > 150) { - y = -50.0; - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_08/Ex_08.pde deleted file mode 100755 index 4f428dc56..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,6 +0,0 @@ -void setup() { - size(100, 100); - smooth(); - fill(0); - ellipse(50, 50, 66, 66); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_09/Ex_09.pde deleted file mode 100755 index 3339c6df8..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_09/Ex_09.pde +++ /dev/null @@ -1,10 +0,0 @@ -void setup() { - size(100, 100); - smooth(); - fill(0); - noLoop(); -} - -void draw() { - ellipse(50, 50, 66, 66); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_10/Ex_10.pde deleted file mode 100755 index b27580e0d..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_10/Ex_10.pde +++ /dev/null @@ -1,14 +0,0 @@ -int d = 51; // Variable d can be used everywhere - -void setup() { - size(100, 100); - int val = d * 2; // Local variable val can only be used in setup() - fill(val); -} - -void draw() { - int y = 60; // Local variable y can only be used in draw() - line(0, y, d, y); - y -= 25; - line(0, y, d, y); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_11/Ex_11.pde deleted file mode 100755 index d23c36ef8..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_11/Ex_11.pde +++ /dev/null @@ -1,9 +0,0 @@ -void draw() { - int d = 80; // This variable can be used everywhere in draw() - if (d > 50) { - int x = 10; // This variable can be used only in this if block - line(x, 40, x+d, 40); - } - line(0, 50, d, 50); - line(x, 60, x+d, 60); // ERROR! x can't be read outside block -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_12/Ex_12.pde deleted file mode 100755 index 64cdee44f..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_12/Ex_12.pde +++ /dev/null @@ -1,6 +0,0 @@ -void draw() { - for (int y = 20; y < 80; y += 6) { // The variable y can be used - line(20, y, 50, y); // only within the for block - } - line(y, 0, y, 100); // ERROR! y can't be accessed outside for -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_13/Ex_13.pde deleted file mode 100755 index 62e55b2b3..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_13/Ex_13.pde +++ /dev/null @@ -1,11 +0,0 @@ -int d = 45; // Assign 45 to variable d - -void setup() { - size(100, 100); - int d = 90; // Assign 90 to local variable d - rect(0, 0, 33, d); // Use local d with value 90 -} - -void draw() { - rect(33, 0, 33, d); // Use d with value 45 -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_01/Ex_01.pde deleted file mode 100755 index fdc759392..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_01/Ex_01.pde +++ /dev/null @@ -1,15 +0,0 @@ -void setup() { - size(100, 100); - noStroke(); - smooth(); - noLoop(); -} - -void draw() { - fill(255); - ellipse(50, 50, 60, 60); // White circle - fill(0); - ellipse(50+10, 50, 30, 30); // Black circle - fill(255); - ellipse(50+16, 45, 6, 6); // Small, white circle -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_02/Ex_02.pde deleted file mode 100755 index 62ccb124d..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_02/Ex_02.pde +++ /dev/null @@ -1,23 +0,0 @@ -void setup() { - size(100, 100); - noStroke(); - noLoop(); - smooth(); -} - -void draw() { - // Right shape - fill(255); - ellipse(65, 44, 60, 60); - fill(0); - ellipse(75, 44, 30, 30); - fill(255); - ellipse(81, 39, 6, 6); - // Left shape - fill(255); - ellipse(20, 50, 60, 60); - fill(0); - ellipse(30, 50, 30, 30); - fill(255); - ellipse(36, 45, 6, 6); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_03/Ex_03.pde deleted file mode 100755 index 571666c97..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_03/Ex_03.pde +++ /dev/null @@ -1,20 +0,0 @@ -void setup() { - size(100, 100); - noStroke(); - smooth(); - noLoop(); -} - -void draw() { - eye(65, 44); - eye(20, 50); -} - -void eye(int x, int y) { - fill(255); - ellipse(x, y, 60, 60); - fill(0); - ellipse(x+10, y, 30, 30); - fill(255); - ellipse(x+16, y-5, 6, 6); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_04/Ex_04.pde deleted file mode 100755 index 41089ca7f..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_04/Ex_04.pde +++ /dev/null @@ -1,24 +0,0 @@ -void setup() { - size(100, 100); - noStroke(); - smooth(); - noLoop(); -} - -void draw() { - eye(65, 44); - eye(20, 50); - eye(65, 74); - eye(20, 80); - eye(65, 104); - eye(20, 110); -} - -void eye(int x, int y) { - fill(255); - ellipse(x, y, 60, 60); - fill(0); - ellipse(x+10, y, 30, 30); - fill(255); - ellipse(x+16, y-5, 6, 6); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_05/Ex_05.pde deleted file mode 100755 index 09da61101..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_05/Ex_05.pde +++ /dev/null @@ -1,23 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); - smooth(); -} - -void draw() { - stroke(160); // Thick, light gray - strokeWeight(20); - line(0, 5, 60, 65); - line(60, 5, 0, 65); - - stroke(0); // Medium, black - strokeWeight(10); - line(30, 20, 90, 80); - line(90, 20, 30, 80); - - // Draw thin, white X - stroke(255); - strokeWeight(2); - line(20, 38, 80, 98); - line(80, 38, 20, 98); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_06/Ex_06.pde deleted file mode 100755 index 8111884a2..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_06/Ex_06.pde +++ /dev/null @@ -1,16 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); - smooth(); -} - -void draw() { - drawX(); -} - -void drawX() { - stroke(160); - strokeWeight(20); - line(0, 5, 60, 65); - line(60, 5, 0, 65); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_07/Ex_07.pde deleted file mode 100755 index 0657d690c..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_07/Ex_07.pde +++ /dev/null @@ -1,16 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); - smooth(); -} - -void draw() { - drawX(0); // Passes 0 to drawX(), runs drawX() -} - -void drawX(int gray) { // Declares and assigns gray - stroke(gray); // Uses gray to set the stroke - strokeWeight(20); - line(0, 5, 60, 65); - line(60, 5, 0, 65); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_08/Ex_08.pde deleted file mode 100755 index 73ddd6861..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_08/Ex_08.pde +++ /dev/null @@ -1,16 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); - smooth(); -} - -void draw() { - drawX(0, 30); -} - -void drawX(int gray, int weight) { - stroke(gray); - strokeWeight(weight); - line(0, 5, 60, 65); - line(60, 5, 0, 65); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_09/Ex_09.pde deleted file mode 100755 index 3186367ef..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_09/Ex_09.pde +++ /dev/null @@ -1,16 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); - smooth(); -} - -void draw() { - drawX(0, 30, 40, 30, 36); -} - -void drawX(int gray, int weight, int x, int y, int size) { - stroke(gray); - strokeWeight(weight); - line(x, y, x+size, y+size); - line(x+size, y, x, y+size); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_10/Ex_10.pde deleted file mode 100755 index ea810cc76..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_10/Ex_10.pde +++ /dev/null @@ -1,18 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); - smooth(); -} - -void draw() { - drawX(160, 20, 0, 5, 60); // Draw thick, light gray X - drawX(0, 10, 30, 20, 60); // Draw medium, black X - drawX(255, 2, 20, 38, 60); // Draw thin, white X -} - -void drawX(int gray, int weight, int x, int y, int size) { - stroke(gray); - strokeWeight(weight); - line(x, y, x+size, y+size); - line(x+size, y, x, y+size); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_11/Ex_11.pde deleted file mode 100755 index c96e0351e..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_11/Ex_11.pde +++ /dev/null @@ -1,18 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); - smooth(); -} - -void draw() { - for (int i=0; i<20; i++) { - drawX(200-(i*10), (20-i)*2, i, i/2, 70); - } -} - -void drawX(int gray, int weight, int x, int y, int size) { - stroke(gray); - strokeWeight(weight); - line(x, y, x+size, y+size); - line(x+size, y, x, y+size); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_12/Ex_12.pde deleted file mode 100755 index 7c1ed23c9..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_12/Ex_12.pde +++ /dev/null @@ -1,19 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); - smooth(); -} - -void draw() { - for (int i = 0; i < 70; i++) { // Draw 70 X shapes - drawX(int(random(255)), int(random(30)), - int(random(width)), int(random(height)), 100); - } -} - -void drawX(int gray, int weight, int x, int y, int size) { - stroke(gray); - strokeWeight(weight); - line(x, y, x+size, y+size); - line(x+size, y, x, y+size); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_13/Ex_13.pde deleted file mode 100755 index 08925e387..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_13/Ex_13.pde +++ /dev/null @@ -1,22 +0,0 @@ -void setup() { - size(100, 100); - smooth(); - noStroke(); - noLoop(); -} - -void draw() { - leaf(26, 83, 60, 1); -} - -void leaf(int x, int y, int size, int dir) { - pushMatrix(); - translate(x, y); // Move to position - scale(size); // Scale to size - beginShape(); // Draw the shape - vertex(1.0*dir, -0.7); - bezierVertex(1.0*dir, -0.7, 0.4*dir, -1.0, 0.0, 0.0); - bezierVertex(0.0, 0.0, 1.0*dir, 0.4, 1.0*dir, -0.7); - endShape(); - popMatrix(); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_14/Ex_14.pde deleted file mode 100755 index 9b21411c9..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_14/Ex_14.pde +++ /dev/null @@ -1,35 +0,0 @@ -void setup() { - size(100, 100); - smooth(); - noStroke(); - noLoop(); -} - -void draw() { - vine(33, 9, 16); -} - -void vine(int x, int numLeaves, int leafSize ) { - stroke(255); - line(x, 0, x, height); - noStroke(); - int gap = height / numLeaves; - int direction = 1; - for (int i = 0; i < numLeaves; i++) { - int r = int(random(gap)); - leaf(x, gap*i + r, leafSize, direction); - direction = -direction; - } -} - -void leaf(int x, int y, int size, int dir) { - pushMatrix(); - translate(x, y); // Move to position - scale(size); // Scale to size - beginShape(); // Draw the shape - vertex(1.0*dir, -0.7); - bezierVertex(1.0*dir, -0.7, 0.4*dir, -1.0, 0.0, 0.0); - bezierVertex(0.0, 0.0, 1.0*dir, 0.4, 1.0*dir, -0.7); - endShape(); - popMatrix(); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_15/Ex_15.pde deleted file mode 100755 index 2c3675433..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_15/Ex_15.pde +++ /dev/null @@ -1,36 +0,0 @@ -void setup() { - size(100, 100); - smooth(); - noLoop(); -} - -void draw() { - drawX(255); // Run first drawX() - drawX(5.5); // Run second drawX() - drawX(0, 2, 44, 48, 36); // Run third drawX() -} - -// Draw an X with the gray value set by the parameter -void drawX(int gray) { - stroke(gray); - strokeWeight(20); - line(0, 5, 60, 65); - line(60, 5, 0, 65); -} - -// Draw a black X with the thickness set by the parameter -void drawX(float weight) { - stroke(0); - strokeWeight(weight); - line(0, 5, 60, 65); - line(60, 5, 0, 65); -} - -// Draws an X with the gray value, thickness, -// position, and size set by the parameters -void drawX(int gray, int weight, int x, int y, int s) { - stroke(gray); - strokeWeight(weight); - line(x, y, x+s, y+s); - line(x+s, y, x, y+s); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_16/Ex_16.pde deleted file mode 100755 index 6ca652e7d..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_16/Ex_16.pde +++ /dev/null @@ -1,2 +0,0 @@ -float d = random(0, 100); -ellipse(50, 50, d, d); diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_17/Ex_17.pde deleted file mode 100755 index 67af87054..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_17/Ex_17.pde +++ /dev/null @@ -1,2 +0,0 @@ -int d = random(0, 100); // ERROR! random() returns floats -ellipse(50, 50, d, d); diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_18/Ex_18.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_18/Ex_18.pde deleted file mode 100755 index 9c0e638d2..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_18/Ex_18.pde +++ /dev/null @@ -1,2 +0,0 @@ -int d = int(random(0, 100)); // int() converts the float value -ellipse(50, 50, d, d); diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_19/Ex_19.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_19/Ex_19.pde deleted file mode 100755 index 7e476d1eb..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_19/Ex_19.pde +++ /dev/null @@ -1,10 +0,0 @@ -void setup() { - size(100, 100); - float f = average(12.0, 6.0); // Assign 9.0 to f - println(f); -} - -float average(float num1, float num2) { - float av = (num1 + num2) / 2.0; - return av; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_20/Ex_20.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_20/Ex_20.pde deleted file mode 100755 index 86d6ed202..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_20/Ex_20.pde +++ /dev/null @@ -1,10 +0,0 @@ -void setup() { - size(100, 100); - float c = fahrenheitToCelsius(451.0); // Assign 232.77779 to c - println(c); -} - -float fahrenheitToCelsius(float t) { - float f = (t-32.0) * (5.0/9.0); - return f; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_01/Ex_01.pde deleted file mode 100755 index 34f971cdf..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_01/Ex_01.pde +++ /dev/null @@ -1,7 +0,0 @@ -size(120, 100); -int front = int(random(1, 10)); // Select the front card -int back = int(random(1, 10)); // Select the back card -PImage imgFront = loadImage(front + "f.jpg"); -PImage imgBack = loadImage(back + "b.jpg"); -image(imgFront, 0, 0); -image(imgBack, 60, 0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_02/Ex_02.pde deleted file mode 100755 index 5e0b66a83..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_02/Ex_02.pde +++ /dev/null @@ -1,22 +0,0 @@ -float c = 25.0; - -void setup() { - size(100, 100); - smooth(); - noLoop(); -} - -void draw() { - arch(c); -} - -void arch(float curvature) { - float y = 90.0; - strokeWeight(6); - noFill(); - beginShape(); - vertex(15.0, y); - bezierVertex(15.0, y-curvature, 30.0, 55.0, 50.0, 55.0); - bezierVertex(70.0, 55.0, 85.0, y-curvature, 85.0, y); - endShape(); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_03/Ex_03.pde deleted file mode 100755 index b42c79d6b..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_03/Ex_03.pde +++ /dev/null @@ -1,23 +0,0 @@ -float c = 25.0; - -void setup() { - size(100, 100); - smooth(); - noLoop(); -} - -void draw() { - arch(c); -} - -void arch(float curvature) { - float y = 90.0; - float sw = (65.0 - curvature) / 4.0; - strokeWeight(sw); - noFill(); - beginShape(); - vertex(15.0, y); - bezierVertex(15.0, y-curvature, 30.0, 55.0, 50.0, 55.0); - bezierVertex(70.0, 55.0, 85.0, y-curvature, 85.0, y); - endShape(); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_04/Ex_04.pde deleted file mode 100755 index 4543603f5..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_04/Ex_04.pde +++ /dev/null @@ -1,27 +0,0 @@ -int x = 20; // X-coordinate -int u = 14; // Units -float a = -0.12; // Angle - -void setup() { - size(100, 100); - stroke(0, 153); - smooth(); - noLoop(); -} - -void draw() { - background(204); - tail(x, u, a); -} - -void tail(int xpos, int units, float angle) { - pushMatrix(); - translate(xpos, 0); - for (int i = units; i > 0; i--) { // Count in reverse - strokeWeight(i); - line(0, 0, 0, 8); - translate(0, 8); - rotate(angle); - } - popMatrix(); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_05/Ex_05.pde deleted file mode 100755 index a3925adb3..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_05/Ex_05.pde +++ /dev/null @@ -1,25 +0,0 @@ -int x = 40; // X-coordinate -int y = 30; // Y-coordinate -int g = 20; // Gap between eyes -void setup() { - size(100, 100); - smooth(); - fill(0); - noLoop(); -} - -void draw() { - background(204); - face(x, y, g); -} - -void face(int x, int y, int gap) { - line(x, 0, x, y); // Nose Bridge - line(x, y, x+gap, y); // Nose - line(x+gap, y, x+gap, 100); - int mouthY = height - (height-y)/2; - line(x, mouthY, x+gap, mouthY); // Mouth - noStroke(); - ellipse(x-gap/2, y/2, 5, 5); // Left eye - ellipse(x+gap, y/2, 5, 5); // Right eye -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_06/Ex_06.pde deleted file mode 100755 index 5b3b93d73..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_06/Ex_06.pde +++ /dev/null @@ -1,6 +0,0 @@ -int x = 5; - -for (int num = 15; num >= 0; num -= 1) { - line(x, 20, x, 80); - x += 5; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_07/Ex_07.pde deleted file mode 100755 index 4f7131402..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_07/Ex_07.pde +++ /dev/null @@ -1,10 +0,0 @@ -void setup() { - drawLines(5, 15); -} - -void drawLines(int x, int num) { - line(x, 20, x, 80); - if (num > 0) { - drawLines(x+5, num-1); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_08/Ex_08.pde deleted file mode 100755 index 403d6d295..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_08/Ex_08.pde +++ /dev/null @@ -1,17 +0,0 @@ -int x = 50; // X-coordinate of the center -int y = 100; // Y-coordinate of the bottom -int a = 35; // Half the width of the top bar - -void setup() { - size(100, 100); - noLoop(); -} - -void draw() { - drawT(x, y, a); -} - -void drawT(int xpos, int ypos, int apex) { - line(xpos, ypos, xpos, ypos-apex); - line(xpos-(apex/2), ypos-apex, xpos+(apex/2), ypos-apex); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_09/Ex_09.pde deleted file mode 100755 index 4fdd2a440..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_09/Ex_09.pde +++ /dev/null @@ -1,24 +0,0 @@ -int x = 50; // X-coordinate of the center -int y = 100; // Y-coordinate of the bottom -int a = 35; // Half the width of the top bar -int n = 3; // Number of recursions - -void setup() { - size(100, 100); - noLoop(); -} - -void draw() { - drawT(x, y, a, n); -} - -void drawT(int x, int y, int apex, int num) { - line(x, y, x, y-apex); - line(x-apex, y-apex, x+apex, y-apex); - // This relational expression must eventually be - // false to stop the recursion and draw the lines - if (num > 0) { - drawT(x-apex, y-apex, apex/2, num-1); - drawT(x+apex, y-apex, apex/2, num-1); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_10/Ex_10.pde deleted file mode 100755 index 0dfa95f7d..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_10/Ex_10.pde +++ /dev/null @@ -1,25 +0,0 @@ -int x = 63; // X-coordinate -int r = 85; // Starting radius -int n = 6; // Number of recursions - -void setup() { - size(100, 100); - noStroke(); - smooth(); - noLoop(); -} - -void draw() { - drawCircle(63, 85, 6); -} - -void drawCircle(int x, int radius, int num) { - float tt = 126 * num/4.0; - fill(tt); - ellipse(x, 50, radius*2, radius*2); - if (num > 1) { - num = num - 1; - drawCircle(x - radius/2, radius/2, num); - drawCircle(x + radius/2, radius/2, num); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_11/Ex_11.pde deleted file mode 100755 index 18edd3be3..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_11/Ex_11.pde +++ /dev/null @@ -1,33 +0,0 @@ -int x = 63; // X-coordinate -int y = 50; // Y-coordinate -int r = 80; // Starting radius -int n = 7; // Number of recursions -int rs = 12; // Random seed value - -void setup() { - size(100, 100); - noStroke(); - smooth(); - noLoop(); - randomSeed(rs); -} - -void draw() { - drawCircle(x, y, r, n); -} - -void drawCircle(float x, float y, int radius, int num) { - float value = 126 * num / 6.0; - fill(value, 153); - ellipse(x, y, radius*2, radius*2); - if (num > 1) { - num = num - 1; - int branches = int(random(2, 6)); - for (int i = 0; i < branches; i++) { - float a = random(0, TWO_PI); - float newx = x + cos(a) * 6.0 * num; - float newy = y + sin(a) * 6.0 * num; - drawCircle(newx, newy, radius/2, num); - } - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_01/Ex_01.pde deleted file mode 100755 index 0eba0d87a..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -void draw() { - frameRate(12); - println(mouseX + " : " + mouseY); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_02/Ex_02.pde deleted file mode 100755 index 0f7761fc8..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Circle follows the cursor -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - background(126); - ellipse(mouseX, mouseY, 33, 33); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_03/Ex_03.pde deleted file mode 100755 index cb71a9cb0..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Add and subtract to create offsets -void setup() { -size(100, 100); - smooth(); - noStroke(); -} -void draw() { - background(126); - ellipse(mouseX, 16, 33, 33); // Top circle - ellipse(mouseX+20, 50, 33, 33); // Middle circle - ellipse(mouseX-20, 84, 33, 33); // Bottom circle -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_04/Ex_04.pde deleted file mode 100755 index f8a623a07..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Multiplying and dividing creates scaling offsets -void setup() { - size(100, 100); - smooth(); - noStroke(); -} -void draw() { - background(126); - ellipse(mouseX, 16, 33, 33); // Top circle - ellipse(mouseX/2, 50, 33, 33); // Middle circle - ellipse(mouseX*2, 84, 33, 33); // Bottom circle -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_05/Ex_05.pde deleted file mode 100755 index 0e8666809..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Invert cursor position to create a secondary response -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - float x = mouseX; - float y = mouseY; - float ix = width - mouseX; // Inverse X - float iy = mouseY - height; // Inverse Y - background(126); - fill(255, 150); - ellipse(x, height/2, y, y); - fill(0, 159); - ellipse(ix, height/2, iy, iy); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_06/Ex_06.pde deleted file mode 100755 index 788a2b954..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,15 +0,0 @@ -// Exponential functions can create nonlinear relations -// between the mouse and shapes affected by the mouse -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - background(126); - float normX = mouseX / float(width); - ellipse(mouseX, 16, 33, 33); // Top - ellipse(pow(normX, 4) * width, 50, 33, 33); // Middle - ellipse(pow(normX, 8) * width, 84, 33, 33); // Bottom -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_07/Ex_07.pde deleted file mode 100755 index 335fc65ae..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,4 +0,0 @@ -void draw() { - frameRate(12); - println(pmouseX - mouseX); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_08/Ex_08.pde deleted file mode 100755 index 8285f3d3c..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Draw a line between the current and previous positions -void setup() { - size(100, 100); - strokeWeight(8); - smooth(); -} - -void draw() { - background(204); - line(mouseX, mouseY, pmouseX, pmouseY); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_09/Ex_09.pde deleted file mode 100755 index c9516fde7..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Use translate() to move a shape -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - background(126); - translate(mouseX, mouseY); - ellipse(0, 0, 33, 33); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_10/Ex_10.pde deleted file mode 100755 index e3e83b132..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_10/Ex_10.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Use rotate() to move a shape -void setup() { - size(100, 100); - strokeWeight(8); - smooth(); -} - -void draw() { - background(204); - float angle = map(mouseX, 0, width, 0, TWO_PI); - translate(50, 50); - rotate(angle); - line(0, 0, 40, 0); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_11/Ex_11.pde deleted file mode 100755 index ef60afd06..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_11/Ex_11.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Cursor position selects the left or right half -// of the display window -void setup() { - size(100, 100); - noStroke(); - fill(0); -} - -void draw() { - background(204); - if (mouseX < 50) { - rect(0, 0, 50, 100); // Left - } else { - rect(50, 0, 50, 100); // Right - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_12/Ex_12.pde deleted file mode 100755 index 78026ab79..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_12/Ex_12.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Cursor position selects the left, middle, -// or right third of the display window -void setup() { - size(100, 100); - noStroke(); - fill(0); -} - -void draw() { - background(204); - if (mouseX < 33) { - rect(0, 0, 33, 100); // Left - } else if ((mouseX >= 33) && (mouseX <= 66)) { - rect(33, 0, 33, 100); // Middle - } else { - rect(66, 0, 33, 100); // Right - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_13/Ex_13.pde deleted file mode 100755 index d1975513c..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_13/Ex_13.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Cursor position selects a quadrant of -// the display window -void setup() { - size(100, 100); - noStroke(); - fill(0); -} - -void draw() { - background(204); - if ((mouseX <= 50) && (mouseY <= 50)) { - rect(0, 0, 50, 50); // Upper-left - } else if ((mouseX <= 50) && (mouseY > 50)) { - rect(0, 50, 50, 50); // Lower-left - } else if ((mouseX > 50) && (mouseY < 50)) { - rect(50, 0, 50, 50); // Upper-right - } else { - rect(50, 50, 50, 50); // Lower-right - } -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_14/Ex_14.pde deleted file mode 100755 index 389639ba2..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_14/Ex_14.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Cursor position selects a rectangular area to -// change the fill color -void setup() { - size(100, 100); - noStroke(); - fill(0); -} - -void draw() { - background(204); - if ((mouseX > 40) && (mouseX < 80) && - (mouseY > 20) && (mouseY < 80)) { - fill(255); - } else { - fill(0); - } - rect(40, 20, 40, 60); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_15/Ex_15.pde deleted file mode 100755 index a1a808ada..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_15/Ex_15.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Set the square to white when a mouse button is pressed -void setup() { - size(100, 100); -} - -void draw() { - background(204); - if (mousePressed == true) { - fill(255); // White - } else { - fill(0); // Black - } - rect(25, 25, 50, 50); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_16/Ex_16.pde deleted file mode 100755 index 5b5202845..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_16/Ex_16.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Set the square to black when the left mouse button -// is pressed and white when the right button is pressed -void setup() { - size(100, 100); -} - -void draw() { - if (mouseButton == LEFT) { - fill(0); // Black - } else if (mouseButton == RIGHT) { - fill(255); // White - } else { - fill(126); // Gray - } - rect(25, 25, 50, 50); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_17/Ex_17.pde deleted file mode 100755 index a5b3c8638..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_17/Ex_17.pde +++ /dev/null @@ -1,19 +0,0 @@ -// Set the square to black when the left mouse button -// is pressed, white when the right button is pressed, -// and gray when a button is not pressed -void setup() { - size(100, 100); -} - -void draw() { - if (mousePressed == true) { - if (mouseButton == LEFT) { - fill(0); // Black - } else if (mouseButton == RIGHT) { - fill(255); // White - } - } else { - fill(126); // Gray - } - rect(25, 25, 50, 50); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_18/Ex_18.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_18/Ex_18.pde deleted file mode 100755 index 1b2062e3e..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_18/Ex_18.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Draw an ellipse to show the position of the hidden cursor -void setup() { - size(100, 100); - strokeWeight(7); - smooth(); - noCursor(); -} - -void draw() { - background(204); - ellipse(mouseX, mouseY, 10, 10); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_19/Ex_19.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_19/Ex_19.pde deleted file mode 100755 index c92d14fec..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_19/Ex_19.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Hides the cursor until a mouse button is pressed -void setup() { - size(100, 100); - noCursor(); -} - -void draw() { - background(204); - if (mousePressed == true) { - cursor(); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_20/Ex_20.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_20/Ex_20.pde deleted file mode 100755 index 118df4e86..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_20/Ex_20.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Draws the cursor as a hand when a mouse button is pressed -void setup() { - size(100, 100); - smooth(); -} - -void draw() { - background(204); - if (mousePressed == true) { - cursor(HAND); - } else { - cursor(MOVE); - } - line(mouseX, 0, mouseX, height); - line(0, mouseY, height, mouseY); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_01/24-01--1.tif b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_01/24-01--1.tif deleted file mode 100644 index dd71e9d91..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_01/24-01--1.tif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_01/Ex_01.pde deleted file mode 100755 index 7f6a25bcb..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Draw dots at the position of the cursor -void setup() { - size(100, 100); -} - -void draw() { - point(mouseX, mouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_02/Ex_02.pde deleted file mode 100755 index 84198c2cd..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,9 +0,0 @@ -// Draw from the previous mouse location to the current -// mouse location to create a continuous line -void setup() { - size(100, 100); -} - -void draw() { - line(mouseX, mouseY, pmouseX, pmouseY); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_03/24-03--34556.tif b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_03/24-03--34556.tif deleted file mode 100644 index 3bfde5772..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_03/24-03--34556.tif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_03/Ex_03.pde deleted file mode 100755 index a3dd0e0bb..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Draw a line only when a mouse button is pressed -void setup() { - size(100, 100); -} - -void draw() { - if (mousePressed == true) { - line(mouseX, mouseY, pmouseX, pmouseY); - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_04/Ex_04.pde deleted file mode 100755 index 859910488..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Draw lines with different gray values when a mouse -// button is pressed or not pressed -void setup() { - size(100, 100); -} - -void draw() { - if (mousePressed == true) { // If mouse is pressed, - stroke(255); // set the stroke to white - } else { // Otherwise, - stroke(0); // set to black - } - line(mouseX, mouseY, pmouseX, pmouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_05/Ex_05.pde deleted file mode 100755 index 026ea5c07..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,9 +0,0 @@ -void setup() { - size(100, 100); -} - -void draw() { - for (int i = 0; i < 50; i += 2) { - point(mouseX+i, mouseY+i); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_06/Ex_06.pde deleted file mode 100755 index 4c873a25c..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,9 +0,0 @@ -void setup() { - size(100, 100); -} - -void draw() { - for (int i = -14; i <= 14; i += 2) { - point(mouseX+i, mouseY); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_07/Ex_07.pde deleted file mode 100755 index 69d37d01a..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,18 +0,0 @@ -void setup() { - size(100, 100); - noStroke(); - fill(255, 40); - background(0); -} - -void draw() { - if (mousePressed == true) { - fill(0, 26); - } else { - fill(255, 26); - } - - for (int i = 0; i < 6; i++) { - ellipse(mouseX + i*i, mouseY, i, i); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_08/Ex_08.pde deleted file mode 100755 index 2e95df14d..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Draw with an image sliver -PImage lineImage; - -void setup() { - size(100, 100); - // This image is 100 pixels wide, but one pixel tall - lineImage = loadImage("imageline.jpg"); -} - -void draw() { - image(lineImage, mouseX-lineImage.width/2, mouseY); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_09/Ex_09.pde deleted file mode 100755 index 1b7e56802..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Draw with an image that has transparency -PImage alphaImg; - -void setup() { - size(100, 100); - // This image is partially transparent - alphaImg = loadImage("alphaArch.png"); -} - -void draw() { - int ix = mouseX - alphaImg.width/2; - int iy = mouseY - alphaImg.height/2; - image(alphaImg, ix, iy); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_01/Ex_01.pde deleted file mode 100755 index e626ac6af..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,15 +0,0 @@ -// Draw a rectangle when any key is pressed -void setup() { - size(100, 100); - smooth(); - strokeWeight(4); -} - -void draw() { - background(204); - if (keyPressed == true) { // If the key is pressed, - line(20, 20, 80, 80); // draw a line - } else { // Otherwise, - rect(40, 40, 20, 20); // draw a rectangle - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_02/Ex_02.pde deleted file mode 100755 index bd36ce149..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Move a line while any key is pressed -int x = 20; - -void setup() { - size(100, 100); - smooth(); - strokeWeight(4); -} - -void draw() { - background(204); - if (keyPressed == true) { // If the key is pressed - x++; // add 1 to x - } - line(x, 20, x-60, 80); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_03/Ex_03.pde deleted file mode 100755 index 500cd0898..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,12 +0,0 @@ -PFont font; - -void setup() { - size(100, 100); - font = loadFont("ThesisMonoLight-72.vlw"); - textFont(font); -} - -void draw() { - background(0); - text(key, 28, 75); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_03/data/ThesisMonoLight-72.vlw b/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_03/data/ThesisMonoLight-72.vlw deleted file mode 100755 index 17627ddd8..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_03/data/ThesisMonoLight-72.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_04/Ex_04.pde deleted file mode 100755 index 1b1533d76..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,15 +0,0 @@ -void setup() { - size(100, 100); - smooth(); - strokeWeight(4); -} - -void draw() { - background(204); - // If the 'A' key is pressed draw a line - if ((keyPressed == true) && (key == 'A')) { - line(50, 25, 50, 75); - } else { // Otherwise, draw an ellipse - ellipse(50, 50, 50, 50); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_05/Ex_05.pde deleted file mode 100755 index c38a6d80f..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,12 +0,0 @@ -int x = 0; - -void setup() { - size(100, 100); -} - -void draw() { - if (keyPressed == true) { - x = key - 32; - rect(x, -1, 20, 101); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_06/Ex_06.pde deleted file mode 100755 index 7eb2dea99..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,19 +0,0 @@ -float angle = 0; - -void setup() { - size(100, 100); - smooth(); - strokeWeight(8); -} - -void draw() { - background(204); - if (keyPressed == true) { - if ((key >= 32) && (key <= 126)) { - // If the key is alphanumeric, - // convert its value into an angle - angle = map(key, 32, 126, 0, TWO_PI); - } - } - arc(50, 50, 66, 66, angle-PI/6, angle+PI/6); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_07/Ex_07.pde deleted file mode 100755 index 4d9d838d6..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,20 +0,0 @@ -color y = 35; - -void setup() { - size(100, 100); -} - -void draw() { - background(204); - line(10, 50, 90, 50); - if (key == CODED) { - if (keyCode == UP) { - y = 20; - } else if (keyCode == DOWN) { - y = 50; - } - } else { - y = 35; - } - rect(25, y, 50, 30); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_01/Ex_01.pde deleted file mode 100755 index 7b9bb18c9..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_01/Ex_01.pde +++ /dev/null @@ -1,13 +0,0 @@ -float gray = 0; - -void setup() { - size(100, 100); -} - -void draw() { - background(gray); -} - -void mousePressed() { - gray += 20; -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_02/Ex_02.pde deleted file mode 100755 index 4e8e38c01..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_02/Ex_02.pde +++ /dev/null @@ -1,13 +0,0 @@ -float gray = 0; - -void setup() { - size(100, 100); -} - -void draw() { - background(gray); -} - -void mouseReleased() { - gray += 20; -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_03/Ex_03.pde deleted file mode 100755 index 40860c9ee..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_03/Ex_03.pde +++ /dev/null @@ -1,10 +0,0 @@ -void setup() { - size(100, 100); - fill(0, 102); -} - -void draw() { } // Empty draw() keeps the program running - -void mousePressed() { - rect(mouseX, mouseY, 33, 33); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_04/Ex_04.pde deleted file mode 100755 index d1f2bb46f..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_04/Ex_04.pde +++ /dev/null @@ -1,25 +0,0 @@ -int dragX, dragY, moveX, moveY; - -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - background(204); - fill(0); - ellipse(dragX, dragY, 33, 33); // Black circle - fill(153); - ellipse(moveX, moveY, 33, 33); // Gray circle -} - -void mouseMoved() { // Move gray circle - moveX = mouseX; - moveY = mouseY; -} - -void mouseDragged() { // Move black circle - dragX = mouseX; - dragY = mouseY; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_05/Ex_05.pde deleted file mode 100755 index e9dd201c9..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_05/Ex_05.pde +++ /dev/null @@ -1,12 +0,0 @@ -void setup() { - size(100, 100); - noStroke(); - fill(255, 51); -} - -void draw() { } // Empty draw() keeps the program running - -void keyPressed() { - int y = key - 32; - rect(0, y, 100, 4); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_06/Ex_06.pde deleted file mode 100755 index d9c93e79f..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_06/Ex_06.pde +++ /dev/null @@ -1,24 +0,0 @@ -boolean drawT = false; - -void setup() { - size(100, 100); - noStroke(); -} - -void draw() { - background(204); - if (drawT == true) { - rect(20, 20, 60, 20); - rect(39, 40, 22, 45); - } -} - -void keyPressed() { - if ((key == 'T') || (key == 't')) { - drawT = true; - } -} - -void keyReleased() { - drawT = false; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_07/Ex_07.pde deleted file mode 100755 index 11b7189fb..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_07/Ex_07.pde +++ /dev/null @@ -1,29 +0,0 @@ -// An extremely minimal text editor, it can only insert -// and remove characters from a single line -PFont font; -String letters = ""; - -void setup() { - size(100, 100); - font = loadFont("Eureka-24.vlw"); - textFont(font); - stroke(255); - fill(0); -} - -void draw() { - background(204); - float cursorPosition = textWidth(letters); - line(cursorPosition, 0, cursorPosition, 100); - text(letters, 0, 50); -} - -void keyPressed() { - if (key == BACKSPACE) { // Backspace - if (letters.length() > 0) { - letters = letters.substring(0, letters.length()-1); - } - } else if (textWidth(letters+key) < width){ - letters = letters+key; - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_07/data/Eureka-24.vlw b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_07/data/Eureka-24.vlw deleted file mode 100755 index 9d4083d6b..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_07/data/Eureka-24.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_08/Ex_08.pde deleted file mode 100755 index d5a2688a6..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_08/Ex_08.pde +++ /dev/null @@ -1,32 +0,0 @@ -PFont font; -String letters = ""; -int back = 102; - -void setup() { - size(100, 100); - font = loadFont("Eureka-24.vlw"); - textFont(font); - textAlign(CENTER); -} - -void draw() { - background(back); - text(letters, 50, 50); -} - -void keyPressed() { - if ((key == ENTER) || (key == RETURN)) { - letters = letters.toLowerCase(); - println(letters); // Print to console to see input - if (letters.equals("black")) { - back = 0; - } else if (letters.equals("gray")) { - back = 204; - } - letters = ""; // Clear the variable - - } else if ((key > 31) && (key != CODED)) { - // If the key is alphanumeric, add it to the String - letters = letters + key; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_08/data/Eureka-24.vlw b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_08/data/Eureka-24.vlw deleted file mode 100755 index 9d4083d6b..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_08/data/Eureka-24.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_09/Ex_09.pde deleted file mode 100755 index adf0cece0..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_09/Ex_09.pde +++ /dev/null @@ -1,23 +0,0 @@ -int frame = 0; - -void setup() { - size(100, 100); - frameRate(30); -} - -void draw() { - if (frame > 60) { // If 60 frames since the mouse - noLoop(); // was pressed, stop the program - background(0); // and turn the background black. - } else { // Otherwise, set the background - background(204); // to light gray and draw lines - line(mouseX, 0, mouseX, 100); // at the mouse position - line(0, mouseY, 100, mouseY); - frame++; - } -} - -void mousePressed() { - loop(); - frame = 0; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_10/Ex_10.pde deleted file mode 100755 index 138cfdd18..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_10/Ex_10.pde +++ /dev/null @@ -1,13 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); -} - -void draw() { - background(204); - line(mouseX, 0, mouseX, 100); -} - -void mousePressed() { - redraw(); // Run the code in draw one time -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_01/Ex_01.pde deleted file mode 100755 index deb22e72a..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_01/Ex_01.pde +++ /dev/null @@ -1,3 +0,0 @@ -int x = constrain(35, 10, 90); // Assign 35 to x -int y = constrain(5, 10, 90); // Assign 10 to y -int z = constrain(91, 10, 90); // Assign 90 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_02/Ex_02.pde deleted file mode 100755 index 97cd57125..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_02/Ex_02.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Constrains the position of the ellipse to a region -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - background(0); - // Limits mx between 35 and 65 - float mx = constrain(mouseX, 35, 65); - // Limits my between 40 and 60 - float my = constrain(mouseY, 40, 60); - fill(102); - rect(20, 25, 60, 50); - fill(255); - ellipse(mx, my, 30, 30); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_03/Ex_03.pde deleted file mode 100755 index b6715b22e..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_03/Ex_03.pde +++ /dev/null @@ -1,3 +0,0 @@ -float x = dist(0, 0, 50, 0); // Assign 50.0 to x -float y = dist(50, 0, 50, 90); // Assign 90.0 to y -float z = dist(30, 20, 80, 90); // Assign 86.023254 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_04/Ex_04.pde deleted file mode 100755 index 7fc06d7d9..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_04/Ex_04.pde +++ /dev/null @@ -1,12 +0,0 @@ -// The distance between the center of the display -// window and the cursor sets the diameter of the circle -void setup() { - size(100, 100); - smooth(); -} - -void draw() { - background(0); - float d = dist(width/2, height/2, mouseX, mouseY); - ellipse(width/2, height/2, d*2, d*2); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_05/Ex_05.pde deleted file mode 100755 index 5aad01531..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_05/Ex_05.pde +++ /dev/null @@ -1,22 +0,0 @@ -// Draw a grid of circles and calculate the -// distance to each to set the size -float maxDistance; - -void setup() { - size(100, 100); - noStroke(); - smooth(); - fill(0); - maxDistance = dist(0, 0, width, height); -} - -void draw() { - background(204); - for (int i = 0; i <= width; i += 20) { - for (int j = 0; j <= height; j += 20) { - float mouseDist = dist(mouseX, mouseY, i, j); - float diameter = (mouseDist / maxDistance) * 66.0; - ellipse(i, j, diameter, diameter); - } - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_06/Ex_06.pde deleted file mode 100755 index d7f7b6d90..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_06/Ex_06.pde +++ /dev/null @@ -1,15 +0,0 @@ -float x = 0.0; -float easing = 0.05; // Numbers 0.0 to 1.0 - -void setup() { - size(100, 100); - smooth(); -} - -void draw() { - background(0); - float targetX = mouseX; - x += (targetX - x) * easing; - ellipse(mouseX, 30, 40, 40); - ellipse(x, 70, 40, 40); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_07/Ex_07.pde deleted file mode 100755 index f2943279d..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_07/Ex_07.pde +++ /dev/null @@ -1,20 +0,0 @@ -float x = 0; -float y = 0; -float easing = 0.05; // Numbers 0.0 to 1.0 -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - background(0); - float targetX = mouseX; - float targetY = mouseY; - x += (targetX - x) * easing; - y += (targetY - y) * easing; - fill(153); - ellipse(mouseX, mouseY, 20, 20); - fill(255); - ellipse(x, y, 40, 40); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_08/Ex_08.pde deleted file mode 100755 index aa0059873..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_08/Ex_08.pde +++ /dev/null @@ -1,21 +0,0 @@ -float x = 0.0; -float easing = 0.05; // Numbers 0.0 to 1.0 - -void setup() { - size(100, 100); - smooth(); -} - -void draw() { - background(0); - float targetX = mouseX; - // Distance from position and target - float dx = targetX - x; - // If the distance between the current position and the - // destination is greater than 1.0, update the position - if (abs(dx) > 1.0) { - x += dx * easing; - } - ellipse(mouseX, 30, 40, 40); - ellipse(x, 70, 40, 40); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_09/Ex_09.pde deleted file mode 100755 index 0ef36f37b..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_09/Ex_09.pde +++ /dev/null @@ -1,12 +0,0 @@ -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - background(0); - float speed = dist(mouseX, mouseY, pmouseX, pmouseY); - float diameter = speed * 3.0; - ellipse(50, 50, diameter, diameter); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_10/Ex_10.pde deleted file mode 100755 index a0db3adca..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_10/Ex_10.pde +++ /dev/null @@ -1,16 +0,0 @@ -float speed = 0.0; -float easing = 0.05; // Numbers 0.0 to 1.0 - -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - background(0); - float target = dist(mouseX, mouseY, pmouseX, pmouseY); - speed += (target - speed) * easing; - rect(0, 33, target, 17); - rect(0, 50, speed, 17); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_11/Ex_11.pde deleted file mode 100755 index 2aa9a315c..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_11/Ex_11.pde +++ /dev/null @@ -1,18 +0,0 @@ -// The angles increase as the mouse moves from the upper-right -// corner of the screen to the lower-left corner - -void setup() { - size(100, 100); - frameRate(15); - fill(0); -} - -void draw() { - float angle = atan2(mouseY, mouseX); - float deg = degrees(angle); - println(deg); - background(204); - ellipse(mouseX, mouseY, 8, 8); - rotate(angle); - line(0, 0, 150, 0); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_12/Ex_12.pde deleted file mode 100755 index 41155ae59..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_12/Ex_12.pde +++ /dev/null @@ -1,31 +0,0 @@ -// Rotate the triangles so they always point -// to the cursor -float x = 50; -float y1 = 33; -float y2 = 66; - -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - background(0); - - // Top triangle - float angle = atan2(mouseY-y1, mouseX-x); - pushMatrix(); - translate(x, y1); - rotate(angle); - triangle(-20, -8, 20, 0, -20, 8); - popMatrix(); - pushMatrix(); - - // Bottom triangle - float angle2 = atan2(mouseY-(y2), mouseX-x); - translate(x, y2); - rotate(angle2); - triangle(-20, -8, 20, 0, -20, 8); - popMatrix(); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_01/Ex_01.pde deleted file mode 100755 index 3047aa80e..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -int s = second(); // Returns values from 0 to 59 -int m = minute(); // Returns values from 0 to 59 -int h = hour(); // Returns values from 0 to 23 -println(h + ":" + m + ":" + s); // Prints the time to the console \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_02/Ex_02.pde deleted file mode 100755 index f02327e4c..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_02/Ex_02.pde +++ /dev/null @@ -1,16 +0,0 @@ -int lastSecond = 0; - -void setup() { - size(100, 100); -} - -void draw() { - int s = second(); - int m = minute(); - int h = hour(); - // Only prints once when the second changes - if (s != lastSecond) { - println(h + ":" + m + ":" + s); - lastSecond = s; - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_03/Ex_03.pde deleted file mode 100755 index 5d33c3a6d..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_03/Ex_03.pde +++ /dev/null @@ -1,17 +0,0 @@ -PFont font; - -void setup() { - size(100, 100); - font = loadFont("Pro-20.vlw"); - textFont(font); -} - -void draw() { - background(0); - int s = second(); - int m = minute(); - int h = hour(); - // The nf() function spaces the numbers nicely - String t = nf(h,2) + ":" + nf(m,2) + ":" + nf(s,2); - text(t, 10, 55); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_03/data/Pro-20.vlw b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_03/data/Pro-20.vlw deleted file mode 100755 index 52c855953..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_03/data/Pro-20.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_04/Ex_04.pde deleted file mode 100755 index 5fae747b9..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_04/Ex_04.pde +++ /dev/null @@ -1,14 +0,0 @@ -void setup() { - size(100, 100); - stroke(255); -} - -void draw() { - background(0); - float s = map(second(), 0, 60, 0, 100); - float m = map(minute(), 0, 60, 0, 100); - float h = map(hour(), 0, 24, 0, 100); - line(s, 0, s, 33); - line(m, 34, m, 66); - line(h, 67, h, 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_05/Ex_05.pde deleted file mode 100755 index 3fe885b5c..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_05/Ex_05.pde +++ /dev/null @@ -1,20 +0,0 @@ -void setup() { - size(100, 100); - stroke(255); -} - -void draw() { - background(0); - fill(80); - noStroke(); - // Angles for sin() and cos() start a 3 o'clock, - // subtract HALF_PI to make them start at the top - ellipse(50, 50, 80, 80); - float s = map(second(), 0, 60, 0, TWO_PI) - HALF_PI; - float m = map(minute(), 0, 60, 0, TWO_PI) - HALF_PI; - float h = map(hour() % 12, 0, 12, 0, TWO_PI) - HALF_PI; - stroke(255); - line(50, 50, cos(s) * 38 + 50, sin(s) * 38 + 50); - line(50, 50, cos(m) * 30 + 50, sin(m) * 30 + 50); - line(50, 50, cos(h) * 25 + 50, sin(h) * 25 + 50); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_06/Ex_06.pde deleted file mode 100755 index 5515a3c31..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_06/Ex_06.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Uses millis() to start a line in motion three seconds -// after the program starts -int x = 0; - -void setup() { - size(100, 100); -} - -void draw() { - if (millis() > 3000) { - x++; - } - line(x, 0, x, 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_07/Ex_07.pde deleted file mode 100755 index bd5377213..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_07/Ex_07.pde +++ /dev/null @@ -1,12 +0,0 @@ -int x = 0; -void setup() { - size(100, 100); -} - -void draw() { - float sec = millis() / 1000.0; - if (sec > 3.0) { - x++; - } - line(x, 0, x, 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_08/Ex_08.pde deleted file mode 100755 index fa53f16ec..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_08/Ex_08.pde +++ /dev/null @@ -1,4 +0,0 @@ -int d = day(); // Returns values from 1 to 31 -int m = month(); // Returns values from 1 to 12 -int y = year(); // Returns four-digit year (2007, 2008, etc.) -println(d + " " + m + " " + y); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_09/Ex_09.pde deleted file mode 100755 index 8fb04d418..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_09/Ex_09.pde +++ /dev/null @@ -1,6 +0,0 @@ -void draw() { - int d = day(); // Values from 1 to 31 - if (d == 1) { - println("Welcome to a new month."); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_10/Ex_10.pde deleted file mode 100755 index 3b9e6a8db..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_10/Ex_10.pde +++ /dev/null @@ -1,7 +0,0 @@ -void draw() { - int d = day(); // Values from 1 to 31 - int m = month(); // Values from 1 to 12 - if ((d == 1) && (m == 1)) { - println("Today is the first day of the year!"); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_01/Ex_01.pde deleted file mode 100755 index 035e7cdd3..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,19 +0,0 @@ -float y = 50.0; -float speed = 1.0; -float radius = 15.0; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - background(0); - ellipse(33, y, radius, radius); - y = y + speed; - if (y > height+radius) { - y = -radius; - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_02/Ex_02.pde deleted file mode 100755 index 82fa086f7..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,22 +0,0 @@ -float y = 50.0; -float speed = 1.0; -float radius = 15.0; -int direction = 1; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - ellipse(33, y, radius, radius); - y += speed * direction; - if ((y > height-radius) || (y < radius)) { - direction = -direction; - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_03/Ex_03.pde deleted file mode 100755 index 46fb94ebf..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,30 +0,0 @@ -float x = 50.0; // X-coordinate -float y = 50.0; // Y-coordinate -float radius = 15.0; // Radius of the circle -float speedX = 1.0; // Speed of motion on the x-axis -float speedY = 0.4; // Speed of motion on the y-axis -int directionX = 1; // Direction of motion on the x-axis -int directionY = -1; // Direction of motion on the y-axis - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - ellipse(x, y, radius, radius); - x += speedX * directionX; - if ((x > width-radius) || (x < radius)) { - directionX = -directionX; // Change direction - } - y += speedY * directionY; - - if ((y > height-radius) || (y < radius)) { - directionY = -directionY; // Change direction - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_04/Ex_04.pde deleted file mode 100755 index 6fb32e634..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,25 +0,0 @@ -float d = 20.0; -float speed = 1.0; -int direction = 1; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - fill(255, 204); -} - -void draw() { - background(0); - ellipse(0, 50, d, d); - ellipse(100, 50, d, d); - ellipse(50, 0, d, d); - ellipse(50, 100, d, d); - d += speed * direction; - if ((d > width) || (d < width / 10)) { - direction = -direction; - } -} - - - diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_05/Ex_05.pde deleted file mode 100755 index 677f774bf..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,34 +0,0 @@ -float beginX = 20.0; // Initial x-coordinate -float beginY = 10.0; // Initial y-coordinate -float endX = 70.0; // Final x-coordinate -float endY = 80.0; // Final y-coordinate -float distX; // X-axis distance to move -float distY; // Y-axis distance to move -float x = 0.0; // Current x-coordinate -float y = 0.0; // Current y-coordinate -float step = 0.02; // Size of each step (0.0 to 1.0) -float pct = 0.0; // Percentage traveled (0.0 to 1.0) - -void setup() { - size(100, 100); - noStroke(); - smooth(); - distX = endX - beginX; - distY = endY - beginY; -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - pct += step; - - if (pct < 1.0) { - x = beginX + (pct * distX); - y = beginY + (pct * distY); - } - - fill(255); - - ellipse(x, y, 20, 20); -} - diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_06/Ex_06.pde deleted file mode 100755 index 5dd00950e..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,26 +0,0 @@ -float x = 20.0; // Initial x-coordinate -float y = 10.0; // Initial y-coordinate -float targetX = 70.0; // Destination x-coordinate -float targetY = 80.0; // Destination y-coordinate -float easing = 0.05; // Size of each step along the path - -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - float d = dist(x, y, targetX, targetY); - - if (d > 1.0) { - x += (targetX - x) * easing; - y += (targetY - y) * easing; - } - - fill(255); - - ellipse(x, y, 20, 20); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_07/Ex_07.pde deleted file mode 100755 index 58d8372ef..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,34 +0,0 @@ -float beginX = 20.0; // Initial x-coordinate -float beginY = 10.0; // Initial y-coordinate -float endX = 70.0; // Final x-coordinate -float endY = 80.0; // Final y-coordinate -float distX; // X-axis distance to move -float distY; // Y-axis distance to move -float exponent = 0.5; // Determines the curve -float x = 0.0; // Current x-coordinate -float y = 0.0; // Current y-coordinate -float step = 0.01; // Size of each step along the path -float pct = 0.0; // Percentage traveled (0.0 to 1.0) - -void setup() { - size(100, 100); - noStroke(); - smooth(); - distX = endX - beginX; - distY = endY - beginY; -} - -void draw() { - fill(0, 2); - rect(0, 0, width, height); - pct += step; - - if (pct < 1.0) { - x = beginX + (pct * distX); - y = beginY + (pow(pct, exponent) * distY); - } - - fill(255); - - ellipse(x, y, 20, 20); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_08/Ex_08.pde deleted file mode 100755 index 27033702d..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,40 +0,0 @@ -float beginX = 20.0; // Initial x-coordinate -float beginY = 10.0; // Initial y-coordinate -float endX = 70.0; // Final x-coordinate -float endY = 80.0; // Final y-coordinate -float distX; // X-axis distance to move -float distY; // Y-axis distance to move -float exponent = 3.0; // Determines the curve -float x = 0.0; // Current x-coordinate -float y = 0.0; // Current y-coordinate -float step = 0.01; // Size of each step along the path -float pct = 0.0; // Percentage traveled (0.0 to 1.0) -int direction = 1; - -void setup() { - size(100, 100); - noStroke(); - smooth(); - distX = endX - beginX; - distY = endY - beginY; -} - -void draw() { - fill(0, 2); - rect(0, 0, width, height); - pct += step * direction; - if ((pct > 1.0) || (pct < 0.0)) { - direction = direction * -1; - } - if (direction == 1) { - x = beginX + (pct * distX); - float e = pow(pct, exponent); - y = beginY + (e * distY); - } else { - x = beginX + (pct * distX); - float e = pow(1.0 - pct, exponent * 2); - y = beginY + (e * -distY) + distY; - } - fill(255); - ellipse(x, y, 20, 20); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_09/Ex_09.pde deleted file mode 100755 index 58d2d906d..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,39 +0,0 @@ -float beginX = 20.0; // Initial x-coordinate -float beginY = 10.0; // Initial y-coordinate -float endX = 70.0; // Final x-coordinate -float endY = 80.0; // Final y-coordinate -float distX; // X-axis distance to move -float distY; // Y-axis distance to move -float exponent = 3.0; // Determines the curve -float x = 0.0; // Current x-coordinate -float y = 0.0; // Current y-coordinate -float step = 0.01; // Size of each step along the path -float pct = 0.0; // Percentage traveled (0.0 to 1.0) - -void setup() { - size(100, 100); - noStroke(); - smooth(); - distX = endX - beginX; - distY = endY - beginY; -} - -void draw() { - fill(0, 2); - rect(0, 0, width, height); - if (pct < 1.0) { - pct = pct + step; - float rate = pow(pct, exponent); - x = beginX + (rate * distX); - y = beginY + (rate * distY); - } - fill(255); - ellipse(x, y, 20, 20); -} -void mousePressed() { - pct = 0.0; - beginX = x; - beginY = y; - distX = mouseX - x; - distY = mouseY - y; -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_10/Ex_10.pde deleted file mode 100755 index d644d6532..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_10/Ex_10.pde +++ /dev/null @@ -1,11 +0,0 @@ -void setup() { - size(100, 100); - smooth(); - noLoop(); - translate(50, 0); // Has no effect -} - -void draw() { - background(0); - ellipse(0, 50, 60, 60); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_11/Ex_11.pde deleted file mode 100755 index 9011447f0..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_11/Ex_11.pde +++ /dev/null @@ -1,22 +0,0 @@ -float y = 50.0; -float speed = 1.0; -float radius = 15.0; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - translate(0, y); // Set the y-coordinate of the circle - ellipse(33, 0, radius, radius); - y += speed; - if (y > height + radius) { - y = -radius; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_12/Ex_12.pde deleted file mode 100755 index c4069c47b..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_12/Ex_12.pde +++ /dev/null @@ -1,33 +0,0 @@ -float y = 50.0; -float speed = 1.0; -float radius = 15.0; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - pushMatrix(); - translate(0, y); - - // Affected by first translate() - ellipse(33, 0, radius, radius); - translate(0, y); - - // Affected by first and second translate() - ellipse(66, 0, radius, radius); - popMatrix(); - - // Not affected by either translate() - ellipse(99, 50, radius, radius); - y = y + speed; - if (y > height + radius) { - y = -radius; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_13/Ex_13.pde deleted file mode 100755 index d95f3ed1f..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_13/Ex_13.pde +++ /dev/null @@ -1,17 +0,0 @@ -float angle = 0.0; - -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - angle = angle + 0.02; - translate(70, 40); - rotate(angle); - rect(-30, -30, 60, 60); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_01/Ex_01.pde deleted file mode 100755 index 0c4feb2ed..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,19 +0,0 @@ -float angle = 0.0; // Current angle -float speed = 0.1; // Speed of motion -float radius = 40.0; // Range of motion - -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - angle += speed; - float sinval = sin(angle); - float yoffset = sinval * radius; - ellipse(50, 50 + yoffset, 80, 80); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_02/Ex_02.pde deleted file mode 100755 index 6282c4924..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,32 +0,0 @@ -float angle = 0.0; // Current angle -float speed = 0.05; // Speed of motion -float radius = 30.0; // Range of motion -float sx = 2.0; -float sy = 2.0; - -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - fill(0, 4); - rect(0, 0, width, height); - angle += speed; // Update the angle - float sinval = sin(angle); - float cosval = cos(angle); - - // Set the position of the small circle based on new - // values from sine and cosine - float x = 50 + (cosval * radius); - float y = 50 + (sinval * radius); - fill(255); - ellipse(x, y, 2, 2); // Draw smaller circle - - // Set the position of the large circles based on the - // new position of the small circle - float x2 = x + cos(angle * sx) * radius / 2; - float y2 = y + sin(angle * sy) * radius / 2; - ellipse(x2, y2, 6, 6); // Draw larger circle -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_03/Ex_03.pde deleted file mode 100755 index 73b2fa5ef..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,16 +0,0 @@ -float angle = 0.0; -float speed = 0.1; - -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - background(0); - angle = angle + speed; - ellipse(50 + (sin(angle + PI) * 5), 25, 30, 30); - ellipse(50 + (sin(angle + HALF_PI) * 5), 55, 30, 30); - ellipse(50 + (sin(angle + QUARTER_PI) * 5), 85, 30, 30); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_04/Ex_04.pde deleted file mode 100755 index 8da3b3df1..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,21 +0,0 @@ -float angle = 0.0; // Changing angle -float speed = 0.05; // Speed of growth - -void setup() { - size(100, 100); - noStroke(); - smooth(); - fill(255, 180); -} - -void draw() { - background(0); - circlePhase(0.0); - circlePhase(QUARTER_PI); - circlePhase(HALF_PI); - angle += speed; -} -void circlePhase(float phase) { - float diameter = 65 + (sin(angle + phase) * 45); - ellipse(50, 50, diameter, diameter); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_05/Ex_05.pde deleted file mode 100755 index f5ce8b674..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,15 +0,0 @@ -float x = 50.0; // X-coordinate -float y = 80.0; // Y-coordinate - -void setup() { - size(100, 100); - randomSeed(0); // Force the same random values - background(0); - stroke(255); -} - -void draw() { - x += random(-2, 2); // Assign new x-coordinate - y += random(-2, 2); // Assign new y-coordinate - point(x, y); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_06/Ex_06.pde deleted file mode 100755 index 6b10511ed..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,20 +0,0 @@ -float x = 0.0; // X-coordinate -float y = 50.0; // Y-coordinate -float angle = 0.0; // Direction of motion -float speed = 0.5; // Speed of motion - -void setup() { - size(100, 100); - background(0); - stroke(255, 130); - randomSeed(121); // Force the same random values -} - -void draw() { - angle += random(-0.3, 0.3); - x += cos(angle) * speed; // Update x-coordinate - y += sin(angle) * speed; // Update y-coordinate - translate(x, y); - rotate(angle); - line(0, -10, 0, 10); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_07/Ex_07.pde deleted file mode 100755 index 204d6b224..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,29 +0,0 @@ -float inc = 0.0; - -void setup() { - size(100, 100); - stroke(255, 204); - smooth(); -} - -void draw() { - background(0); - inc += 0.01; - float angle = sin(inc) / 10.0 + sin(inc * 1.2) / 20.0; - tail(18, 9, angle / 1.3); - tail(33, 12, angle); - tail(44, 10, angle / 1.3); - tail(62, 5, angle); - tail(88, 7, angle*2); -} -void tail(int x, int units, float angle) { - pushMatrix(); - translate(x, 100); - for (int i = units; i > 0; i--) { - strokeWeight(i); - line(0, 0, 0, -8); - translate(0, -8); - rotate(angle); - } - popMatrix(); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_08/Ex_08.pde deleted file mode 100755 index 0ebda1665..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,21 +0,0 @@ -float inc1 = 0.1; -float n1 = 0.0; -float inc2 = 0.09; -float n2 = 0.0; - -void setup() { - size(100, 100); - stroke(255); - strokeWeight(20); - smooth(); -} - -void draw() { - background(0); - float y1 = (noise(n1) - 0.5) * 30.0; // Values -15 to 15 - float y2 = (noise(n2) - 0.5) * 30.0; // Values -15 to 15 - line(0, 50, 40, 50 + y1); - line(100, 50, 60, 50 + y2); - n1 += inc1; - n2 += inc2; -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_09/Ex_09.pde deleted file mode 100755 index 985f10237..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_09/Ex_09.pde +++ /dev/null @@ -1,24 +0,0 @@ -float inc = 0.06; -int density = 4; -float znoise = 0.0; - -void setup() { - size(100, 100); - noStroke(); -} - -void draw() { - float xnoise = 0.0; - float ynoise = 0.0; - for (int y = 0; y < height; y += density) { - for (int x = 0; x < width; x += density) { - float n = noise(xnoise, ynoise, znoise) * 256; - fill(n); - rect(y, x, density, density); - xnoise += inc; - } - xnoise = 0; - ynoise += inc; - } - znoise += inc; -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_01/Ex_01.pde deleted file mode 100755 index 982f35faa..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_01/Ex_01.pde +++ /dev/null @@ -1,9 +0,0 @@ -int[] x = {50, 61, 83, 69, 71, 50, 29, 31, 17, 39}; -int[] y = { 18, 37, 43, 60, 82, 73, 82, 60, 43, 37 }; - -beginShape(); -// Reads one array element every time through the for() -for (int i = 0; i < x.length; i++) { - vertex(x[i], y[i]); -} -endShape(CLOSE); diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_02/Ex_02.pde deleted file mode 100755 index 6b01e006b..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_02/Ex_02.pde +++ /dev/null @@ -1,11 +0,0 @@ -int[] data; // Declare - -void setup() { - size(100, 100); - data = new int[5]; // Create - data[0] = 19; // Assign - data[1] = 40; - data[2] = 75; - data[3] = 76; - data[4] = 90; -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_03/Ex_03.pde deleted file mode 100755 index 0593fc8e0..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_03/Ex_03.pde +++ /dev/null @@ -1,10 +0,0 @@ -int[] data = new int[5]; // Declare and create - -void setup() { - size(100, 100); - data[0] = 19; // Assign - data[1] = 40; - data[2] = 75; - data[3] = 76; - data[4] = 90; -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_04/Ex_04.pde deleted file mode 100755 index a3e2de725..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_04/Ex_04.pde +++ /dev/null @@ -1,4 +0,0 @@ -int[] data = { 19, 40, 75, 76, 90 }; // Declare, create, and assign -void setup() { - size(100, 100); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_05/Ex_05.pde deleted file mode 100755 index 3313dbf4f..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_05/Ex_05.pde +++ /dev/null @@ -1,7 +0,0 @@ -int[] data; // Declare -data = new int[5]; // Create -data[0] = 19; // Assign -data[1] = 40; -data[2] = 75; -data[3] = 76; -data[4] = 90; diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_06/Ex_06.pde deleted file mode 100755 index f68b34e99..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_06/Ex_06.pde +++ /dev/null @@ -1,6 +0,0 @@ -int[] data = new int[5]; // Declare and create -data[0] = 19; // Assign -data[1] = 40; -data[2] = 75; -data[3] = 76; -data[4] = 90; diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_07/Ex_07.pde deleted file mode 100755 index ada474042..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_07/Ex_07.pde +++ /dev/null @@ -1 +0,0 @@ -int[] data = { 19, 40, 75, 76, 90 }; // Declare, create, and assign diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_08/Ex_08.pde deleted file mode 100755 index a47eb0cf9..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_08/Ex_08.pde +++ /dev/null @@ -1,6 +0,0 @@ -int[] data = { 19, 40, 75, 76, 90 }; -line(data[0], 0, data[0], 100); -line(data[1], 0, data[1], 100); -line(data[2], 0, data[2], 100); -line(data[3], 0, data[3], 100); -line(data[4], 0, data[4], 100); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_09/Ex_09.pde deleted file mode 100755 index b8ff1471d..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_09/Ex_09.pde +++ /dev/null @@ -1,4 +0,0 @@ -int[] data = { 19, 40, 75, 76, 90 }; -println(data[0]); // Prints 19 to the console -println(data[2]); // Prints 75 to the console -println(data[5]); // ERROR! The last element of the array is 4 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_10/Ex_10.pde deleted file mode 100755 index abaa7d214..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_10/Ex_10.pde +++ /dev/null @@ -1,6 +0,0 @@ -int[] data1 = { 19, 40, 75, 76, 90 }; -int[] data2 = { 19, 40 }; -int[] data3 = new int[127]; -println(data1.length); // Prints "5" to the console -println(data2.length); // Prints "2" to the console -println(data3.length); // Prints "127" to the console \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_11/Ex_11.pde deleted file mode 100755 index 94ab3ba81..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_11/Ex_11.pde +++ /dev/null @@ -1,4 +0,0 @@ -int[] data = { 19, 40, 75, 76, 90 }; -for (int i = 0; i < data.length; i++) { - line(data[i], 0, data[i], 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_12/Ex_12.pde deleted file mode 100755 index 301b5d563..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_12/Ex_12.pde +++ /dev/null @@ -1,13 +0,0 @@ -float[] sineWave = new float[width]; - -for (int i = 0; i < width; i++) { - // Fill the array with values from sin() - float r = map(i, 0, width, 0, TWO_PI); - sineWave[i] = abs(sin(r)); -} - -for (int i = 0; i < sineWave.length; i++) { - // Set the stroke values to numbers read from the array - stroke(sineWave[i] * 255); - line(i, 0, i, height); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_13/Ex_13.pde deleted file mode 100755 index ec939e409..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_13/Ex_13.pde +++ /dev/null @@ -1,26 +0,0 @@ -int numLines = 12; -float[] x = new float[numLines]; -float[] speed = new float[numLines]; -float offset = 8; // Set space between lines - -void setup() { - size(100, 100); - smooth(); - strokeWeight(10); - for (int i = 0; i < numLines; i++) { - x[i] = i; // Set initial position - speed[i] = 0.1 + (i / offset); // Set initial speed - } -} - -void draw() { - background(204); - for (int i = 0; i < x.length; i++) { - x[i] += speed[i]; // Update line position - if (x[i] > (width + offset)) { // If off the right, - x[i] = -offset * 2; // return to the left - } - float y = i * offset; // Set y-coordinate for line - line(x[i], y, x[i] + offset, y + offset); // Draw line - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_14/Ex_14.pde deleted file mode 100755 index 810210c2a..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_14/Ex_14.pde +++ /dev/null @@ -1,20 +0,0 @@ -int[] y; - -void setup() { - size(100, 100); - y = new int[width]; -} - -void draw() { - background(204); -// Shift the values to the right - for (int i = y.length - 1; i > 0; i--) { - y[i] = y[i-1]; - } -// Add new values to the beginning - y[0] = constrain(mouseY, 0, height - 1); -// Display each pair of values as a line - for (int i = 1; i < y.length; i++) { - line(i, y[i], i - 1, y[i-1]); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_15/Ex_15.pde deleted file mode 100755 index 2640e3799..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_15/Ex_15.pde +++ /dev/null @@ -1,26 +0,0 @@ -int num = 50; -int[] x = new int[num]; -int[] y = new int[num]; - -void setup() { - size(100, 100); - noStroke(); - smooth(); - fill(255, 102); -} - -void draw() { - background(0); -// Shift the values to the right - for (int i = num - 1; i > 0; i--) { - x[i] = x[i-1]; - y[i] = y[i-1]; - } -// Add the new values to the beginning of the array - x[0] = mouseX; - y[0] = mouseY; -// Draw the circles - for (int i = 0; i < num; i++) { - ellipse(x[i], y[i], i / 2.0, i / 2.0); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_16/Ex_16.pde deleted file mode 100755 index 9ba9478b7..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_16/Ex_16.pde +++ /dev/null @@ -1,25 +0,0 @@ -int num = 50; -int[] x = new int[num]; -int[] y = new int[num]; -int indexPosition = 0; - -void setup() { - size(100, 100); - noStroke(); - smooth(); - fill(255, 102); -} - -void draw() { - background(0); - x[indexPosition] = mouseX; - y[indexPosition] = mouseY; -// Cycle between 0 and the number of elements - indexPosition = (indexPosition + 1) % num; - for (int i = 0; i < num; i++) { -// Set the array position to read - int pos = (indexPosition + i) % num; - float radius = (num - i) / 2.0; - ellipse(x[pos], y[pos], radius, radius); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_17/Ex_17.pde deleted file mode 100755 index d06f3c965..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_17/Ex_17.pde +++ /dev/null @@ -1,11 +0,0 @@ -String[] trees = { "ash", "oak" }; -append(trees, "maple"); // INCORRECT! Does not change the array -print(trees); // Prints "ash oak" -println(); -trees = append(trees, "maple"); // Add "maple" to the end -print(trees); // Prints "ash oak maple" -println(); -// Add "beech" to the end of the trees array, and creates a new -// array to store the change -String[] moretrees = append(trees, "beech"); -print(moretrees); // Prints "ash oak maple beech" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_18/Ex_18.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_18/Ex_18.pde deleted file mode 100755 index a2dbc480c..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_18/Ex_18.pde +++ /dev/null @@ -1,6 +0,0 @@ -String[] trees = { "lychee", "coconut", "fig"}; -trees = shorten(trees); // Remove the last element from the array -println(trees); // Prints "lychee coconut" - -trees = shorten(trees); // Remove the last element from the array -println(trees); // Prints "lychee" diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_19/Ex_19.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_19/Ex_19.pde deleted file mode 100755 index e3efad100..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_19/Ex_19.pde +++ /dev/null @@ -1,15 +0,0 @@ -int[] x = new int[100]; // Array to store x-coordinates -int count; // Store the number of array positions - -void setup() { - size(100, 100); -} - -void draw() { - x[count] = mouseX; // Assign new x-coordinate to the array - count++; // Increment the counter - if (count == x.length) { // If the x array is full, - x = expand(x); // double the size of x - println(x.length); // Write the new size to the console - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_20/Ex_20.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_20/Ex_20.pde deleted file mode 100755 index fe953a888..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_20/Ex_20.pde +++ /dev/null @@ -1,9 +0,0 @@ -String[] north = { "OH", "IN", "MI" }; -String[] south = { "GA", "FL", "NC" }; -arraycopy(north, south); // Copy from north array to south array -print(south); // Prints "OH IN MI" -println(); -String[] east = { "MA", "NY", "RI" }; -String[] west = new String[east.length]; // Create a new array -arraycopy(east, west); // Copy from east array to west array -print(west); // Prints "MA NY RI" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_21/Ex_21.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_21/Ex_21.pde deleted file mode 100755 index d0a2a7c46..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_21/Ex_21.pde +++ /dev/null @@ -1,15 +0,0 @@ -float[] data = {19.0, 40.0, 75.0, 76.0, 90.0}; - -void setup() { - halve(data); - println(data[0]); // Prints "9.5" - println(data[1]); // Prints "20.0" - println(data[2]); // Prints "37.5" - println(data[3]); // Prints "38.0" - println(data[4]); // Prints "45.0" -} -void halve(float[] d) { - for (int i = 0; i < d.length; i++) { // For each array element, - d[i] = d[i] / 2.0; // divide the value by 2 - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_22/Ex_22.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_22/Ex_22.pde deleted file mode 100755 index 900526da1..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_22/Ex_22.pde +++ /dev/null @@ -1,19 +0,0 @@ -float[] data = {19.0, 40.0, 75.0, 76.0, 90.0}; -float[] halfData; - -void setup() { - halfData = halve(data); // Run the halve() function - println(data[0] + ", " + halfData[0]); // Prints "19.0, 9.5" - println(data[1] + ", " + halfData[1]); // Prints "40.0, 20.0" - println(data[2] + ", " + halfData[2]); // Prints "75.0, 37.5" - println(data[3] + ", " + halfData[3]); // Prints "76.0, 38.0" - println(data[4] + ", " + halfData[4]); // Prints "90.0, 45.0" -} -float[] halve(float[] d) { - float[] numbers = new float[d.length]; // Create a new array - arraycopy(d, numbers); - for (int i = 0; i < numbers.length; i++) { // For each element, - numbers[i] = numbers[i] / 2; // divide the value by 2 - } - return numbers; // Return the new array -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_23/Ex_23.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_23/Ex_23.pde deleted file mode 100755 index 9599e1d64..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_23/Ex_23.pde +++ /dev/null @@ -1,7 +0,0 @@ -int[][] points = { {50,18}, {61,37}, {83,43}, {69,60}, {71,82}, - {50,73}, {29,82}, {31,60}, {17,43}, {39,37} }; -println(points[4][0]); // Prints 71 -println(points[4][1]); // Prints 82 -println(points[4][2]); // ERROR! This element is outside the array -println(points[0][0]); // Prints 50 -println(points[9][1]); // Prints 37 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_24/Ex_24.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_24/Ex_24.pde deleted file mode 100755 index c86a4d44d..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_24/Ex_24.pde +++ /dev/null @@ -1,19 +0,0 @@ -int[][] points = { {50, 18}, {61, 37}, {83, 43}, {69, 60}, - {71, 82}, {50, 73}, {29, 82}, {31, 60}, - {17, 43}, {39, 37} }; - -void setup() { - size(100, 100); - fill(0); - smooth(); -} - -void draw() { - background(204); - translate(mouseX - 50, mouseY - 50); - beginShape(); - for (int i = 0; i < points.length; i++) { - vertex(points[i][0], points[i][1]); - } - endShape(); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/Ex_01.pde deleted file mode 100755 index 86648c705..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,28 +0,0 @@ -int numFrames = 12; // The number of animation frames -int frame = 0; // The frame to display -PImage[] images = new PImage[numFrames]; // Image array - -void setup() { - size(100, 100); - frameRate(30); // Maximum 30 frames per second - images[0] = loadImage("ani-000.gif"); - images[1] = loadImage("ani-001.gif"); - images[2] = loadImage("ani-002.gif"); - images[3] = loadImage("ani-003.gif"); - images[4] = loadImage("ani-004.gif"); - images[5] = loadImage("ani-005.gif"); - images[6] = loadImage("ani-006.gif"); - images[7] = loadImage("ani-007.gif"); - images[8] = loadImage("ani-008.gif"); - images[9] = loadImage("ani-009.gif"); - images[10] = loadImage("ani-010.gif"); - images[11] = loadImage("ani-011.gif"); -} - -void draw() { - frame++; - if (frame == numFrames) { - frame = 0; - } - image(images[frame], 0, 0); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-000.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-000.gif deleted file mode 100755 index 1a62c89dd..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-000.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-001.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-001.gif deleted file mode 100755 index 8fa73ba5f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-001.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-002.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-002.gif deleted file mode 100755 index b9862cdb9..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-002.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-003.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-003.gif deleted file mode 100755 index 78d757200..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-003.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-004.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-004.gif deleted file mode 100755 index bc9a90347..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-004.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-005.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-005.gif deleted file mode 100755 index 55454e80f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-005.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-006.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-006.gif deleted file mode 100755 index ed3fd318f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-006.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-007.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-007.gif deleted file mode 100755 index b91b69d94..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-007.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-008.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-008.gif deleted file mode 100755 index b32af1571..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-008.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-009.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-009.gif deleted file mode 100755 index da247b92e..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-009.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-010.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-010.gif deleted file mode 100755 index 6752a466e..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-010.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-011.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-011.gif deleted file mode 100755 index 332652d91..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-011.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/Ex_02.pde deleted file mode 100755 index 163a551e2..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,21 +0,0 @@ -int numFrames = 12; // The number of animation frames -PImage[] images = new PImage[numFrames]; // Image array - -void setup() { - size(100, 100); - frameRate(30); // Maximum 30 frames per second - - // Automate the image loading procedure. Numbers less than 100 - // need an extra zero added to fit the names of the files. - for (int i = 0; i < images.length; i++) { - // Construct the name of the image to load - String imageName = "ani-" + nf(i, 3) + ".gif"; - images[i] = loadImage(imageName); - } -} - -void draw() { - // Calculate the frame to display, use % to cycle through frames - int frame = frameCount % numFrames; - image(images[frame], 0, 0); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-000.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-000.gif deleted file mode 100755 index 1a62c89dd..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-000.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-001.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-001.gif deleted file mode 100755 index 8fa73ba5f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-001.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-002.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-002.gif deleted file mode 100755 index b9862cdb9..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-002.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-003.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-003.gif deleted file mode 100755 index 78d757200..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-003.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-004.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-004.gif deleted file mode 100755 index bc9a90347..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-004.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-005.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-005.gif deleted file mode 100755 index 55454e80f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-005.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-006.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-006.gif deleted file mode 100755 index ed3fd318f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-006.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-007.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-007.gif deleted file mode 100755 index b91b69d94..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-007.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-008.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-008.gif deleted file mode 100755 index b32af1571..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-008.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-009.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-009.gif deleted file mode 100755 index da247b92e..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-009.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-010.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-010.gif deleted file mode 100755 index 6752a466e..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-010.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-011.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-011.gif deleted file mode 100755 index 332652d91..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-011.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/Ex_03.pde deleted file mode 100755 index d8112bcdd..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,16 +0,0 @@ -int numFrames = 5; // The number of animation frames -PImage[] images = new PImage[numFrames]; - -void setup() { - size(100, 100); - for (int i = 0; i < images.length; i++) { - String imageName = "ani-" + nf(i, 3) + ".gif"; - images[i] = loadImage(imageName); - } -} - -void draw() { - int frame = int(random(0, numFrames)); // The frame to display - image(images[frame], 0, 0); - frameRate(random(1, 60.0)); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-000.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-000.gif deleted file mode 100755 index 1a62c89dd..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-000.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-001.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-001.gif deleted file mode 100755 index 8fa73ba5f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-001.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-002.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-002.gif deleted file mode 100755 index b9862cdb9..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-002.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-003.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-003.gif deleted file mode 100755 index 78d757200..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-003.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-004.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-004.gif deleted file mode 100755 index bc9a90347..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-004.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-005.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-005.gif deleted file mode 100755 index 55454e80f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-005.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-006.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-006.gif deleted file mode 100755 index ed3fd318f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-006.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-007.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-007.gif deleted file mode 100755 index b91b69d94..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-007.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-008.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-008.gif deleted file mode 100755 index b32af1571..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-008.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-009.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-009.gif deleted file mode 100755 index da247b92e..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-009.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-010.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-010.gif deleted file mode 100755 index 6752a466e..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-010.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-011.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-011.gif deleted file mode 100755 index 332652d91..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-011.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/Ex_04.pde deleted file mode 100755 index c0ef62a79..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,24 +0,0 @@ -int numFrames = 12; // The number of animation frames -int topFrame = 0; // The top frame to display -int bottomFrame = 0; // The bottom frame to display -PImage[] images = new PImage[numFrames]; -int lastTime = 0; - -void setup() { - size(100, 100); - frameRate(30); - for (int i = 0; i < images.length; i++) { - String imageName = "ani-" + nf(i, 3) + ".gif"; - images[i] = loadImage(imageName); - } -} - -void draw() { - topFrame = (topFrame + 1) % numFrames; - image(images[topFrame], 0, 0); - if ((millis() - lastTime) > 500) { - bottomFrame = (bottomFrame + 1) % numFrames; - lastTime = millis(); - } - image(images[bottomFrame], 0, 50); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-000.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-000.gif deleted file mode 100755 index 1a62c89dd..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-000.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-001.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-001.gif deleted file mode 100755 index 8fa73ba5f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-001.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-002.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-002.gif deleted file mode 100755 index b9862cdb9..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-002.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-003.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-003.gif deleted file mode 100755 index 78d757200..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-003.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-004.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-004.gif deleted file mode 100755 index bc9a90347..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-004.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-005.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-005.gif deleted file mode 100755 index 55454e80f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-005.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-006.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-006.gif deleted file mode 100755 index ed3fd318f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-006.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-007.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-007.gif deleted file mode 100755 index b91b69d94..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-007.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-008.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-008.gif deleted file mode 100755 index b32af1571..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-008.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-009.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-009.gif deleted file mode 100755 index da247b92e..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-009.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-010.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-010.gif deleted file mode 100755 index 6752a466e..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-010.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-011.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-011.gif deleted file mode 100755 index 332652d91..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-011.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_05/Ex_05.pde deleted file mode 100755 index f6de70c87..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,16 +0,0 @@ -PImage img; -float x; - -void setup() { - size(100, 100); - img = loadImage("PT-Shifty-0020.gif"); -} - -void draw() { - background(204); - x += 0.5; - if (x > width) { - x = -width; - } - image(img, x, 0); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_05/data/PT-Shifty-0020.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_05/data/PT-Shifty-0020.gif deleted file mode 100755 index 1bd580361..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_05/data/PT-Shifty-0020.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_06/Ex_06.pde deleted file mode 100755 index 38805ecd6..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,15 +0,0 @@ -PImage img; -float angle; - -void setup() { - size(100, 100); - img = loadImage("PT-Shifty-0023.gif"); -} - -void draw() { - background(204); - angle += 0.01; - translate(50, 50); - rotate(angle); - image(img, -100, -100); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_06/data/PT-Shifty-0023.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_06/data/PT-Shifty-0023.gif deleted file mode 100755 index a3dd7f38c..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_06/data/PT-Shifty-0023.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_07/Ex_07.pde deleted file mode 100755 index 42c78090b..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,16 +0,0 @@ -PImage img; -float opacity = 0; // Set opacity to the minimum - -void setup() { - size(100, 100); - img = loadImage("PT-Teddy-0017.gif"); -} - -void draw() { - background(0); - if (opacity < 255) { // When less than the maximum, - opacity += 0.5; // increase opacity - } - tint(255, opacity); - image(img, -25, -75); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_07/data/PT-Teddy-0017.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_07/data/PT-Teddy-0017.gif deleted file mode 100755 index be36c20b1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_07/data/PT-Teddy-0017.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_01/Ex_01.pde deleted file mode 100755 index 4a873ca22..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_01/Ex_01.pde +++ /dev/null @@ -1,5 +0,0 @@ -strokeWeight(8); -line(0, 0, width, height); -line(0, height, width, 0); -PImage cross = get(); // Get the entire window -image(cross, 0, 50); // Draw the image in a new position \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_02/Ex_02.pde deleted file mode 100755 index b5f90a720..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_02/Ex_02.pde +++ /dev/null @@ -1,8 +0,0 @@ -smooth(); -strokeWeight(8); -line(0, 0, width, height); -line(0, height, width, 0); -noStroke(); -ellipse(18, 50, 16, 16); -PImage cross = get(); // Get the entire window -image(cross, 42, 30, 40, 40); // Resize to 40 x 40 pixels \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_03/Ex_03.pde deleted file mode 100755 index 2bcd09949..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_03/Ex_03.pde +++ /dev/null @@ -1,6 +0,0 @@ -strokeWeight(8); -line(0, 0, width, height); -line(0, height, width, 0); -PImage slice = get(0, 0, 20, 100); // Get window section -set(18, 0, slice); -set(50, 0, slice); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_04/Ex_04.pde deleted file mode 100755 index 185b449b5..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_04/Ex_04.pde +++ /dev/null @@ -1,5 +0,0 @@ -PImage trees; -trees = loadImage("topanga.jpg"); -image(trees, 0, 0); -PImage crop = get(); // Get the entire window -image(crop, 0, 50); // Draw the image in a new position \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_05/Ex_05.pde deleted file mode 100755 index 9f62f3cdb..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_05/Ex_05.pde +++ /dev/null @@ -1,7 +0,0 @@ -PImage trees; -trees = loadImage("topanga.jpg"); -noStroke(); -image(trees, 0, 0); -color c = get(20, 30); // Get color at (20, 30) -fill(c); -rect(20, 30, 40, 40); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_06/Ex_06.pde deleted file mode 100755 index 37246b24d..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_06/Ex_06.pde +++ /dev/null @@ -1,14 +0,0 @@ -PImage trees; - -void setup() { - size(100, 100); - noStroke(); - trees = loadImage("topangaCrop.jpg"); -} - -void draw() { - image(trees, 0, 0); - color c = get(mouseX, mouseY); - fill(c); - rect(50, 0, 50, 100); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_07/Ex_07.pde deleted file mode 100755 index f6cb47176..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_07/Ex_07.pde +++ /dev/null @@ -1,19 +0,0 @@ -PImage trees; -int y = 0; - -void setup() { - size(100, 100); - trees = loadImage("topangaCrop.jpg"); -} - -void draw() { - image(trees, 0, 0); - y = constrain(mouseY, 0, 99); - for (int i = 0; i < 49; i++) { - color c = get(i, y); - stroke(c); - line(i + 50, 0, i + 50, 100); - } - stroke(255); - line(0, y, 49, y); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_08/Ex_08.pde deleted file mode 100755 index 1853c59ac..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_08/Ex_08.pde +++ /dev/null @@ -1,9 +0,0 @@ -PImage trees; -trees = loadImage("topanga.jpg"); -stroke(255); -strokeWeight(12); -image(trees, 0, 0); -line(0, 0, width, height); -line(0, height, width, 0); -PImage treesCrop = trees.get(20, 20, 60, 60); -image(treesCrop, 20, 20); diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_09/Ex_09.pde deleted file mode 100755 index 34b01cbe3..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_09/Ex_09.pde +++ /dev/null @@ -1,5 +0,0 @@ -color black = color(0); -set(20, 80, black); -set(20, 81, black); -set(20, 82, black); -set(20, 83, black); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_10/Ex_10.pde deleted file mode 100755 index 29c18f6aa..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_10/Ex_10.pde +++ /dev/null @@ -1,6 +0,0 @@ -for (int i = 0; i < 55; i++) { - for (int j = 0; j < 55; j++) { - color c = color((i + j) * 1.8); - set(30 + i, 20 + j, c); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_11/Ex_11.pde deleted file mode 100755 index df70f1f2e..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_11/Ex_11.pde +++ /dev/null @@ -1,11 +0,0 @@ -PImage trees; - -void setup() { - size(100, 100); - trees = loadImage("topangaCrop.jpg"); -} - -void draw() { - int x = constrain(mouseX, 0, 50); - set(x, 0, trees); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_12/Ex_12.pde deleted file mode 100755 index 78f585f75..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_12/Ex_12.pde +++ /dev/null @@ -1,9 +0,0 @@ -PImage trees; -trees = loadImage("topangaCrop.jpg"); -background(0); -color white = color(255); -trees.set(0, 50, white); -trees.set(1, 50, white); -trees.set(2, 50, white); -trees.set(3, 50, white); -image(trees, 20, 0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_01/Ex_01.pde deleted file mode 100755 index 230e422e1..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,14 +0,0 @@ -PFont font; -String s = "Pea"; - -void setup() { - size(100, 100); - font = loadFont("Eureka-48.vlw"); - textFont(font); - fill(0); -} - -void draw() { - background(204); - text(s, 22, 20); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_01/data/Eureka-48.vlw b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_01/data/Eureka-48.vlw deleted file mode 100755 index 9d4083d6b..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_01/data/Eureka-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_02/Ex_02.pde deleted file mode 100755 index 23ac07e89..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,24 +0,0 @@ -PFont font; -float x1 = 0; -float x2 = 100; - -void setup() { - size(100, 100); - font = loadFont("Eureka-48.vlw"); - textFont(font); - fill(0); -} - -void draw() { - background(204); - text("Right", x1, 50); - text("Left", x2, 100); - x1 += 1.0; - if (x1 > 100) { - x1 = -150; - } - x2 -= 0.8; - if (x2 < -150) { - x2 = 100; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_02/data/Eureka-48.vlw b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_02/data/Eureka-48.vlw deleted file mode 100755 index 9d4083d6b..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_02/data/Eureka-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_03/Ex_03.pde deleted file mode 100755 index 7f25250d3..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,15 +0,0 @@ -PFont font; - -void setup() { - size(100, 100); - font = loadFont("Eureka-48.vlw"); - textFont(font); - noStroke(); -} - -void draw() { - fill(204, 24); - rect(0, 0, width, height); - fill(0); - text("flicker", random(-100, 100), random(-20, 120)); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_03/data/Eureka-48.vlw b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_03/data/Eureka-48.vlw deleted file mode 100755 index 9d4083d6b..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_03/data/Eureka-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_04/Ex_04.pde deleted file mode 100755 index f61e7a883..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,19 +0,0 @@ -PFont font; -int opacity = 0; -int direction = 1; - -void setup() { - size(100, 100); - font = loadFont("EurekaSmallCaps-36.vlw"); - textFont(font); -} - -void draw() { - background(204); - opacity += 2 * direction; - if ((opacity < 0) || (opacity > 255)) { - direction = -direction; - } - fill(0, opacity); - text("fade", 4, 60); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_04/data/EurekaSmallCaps-36.vlw b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_04/data/EurekaSmallCaps-36.vlw deleted file mode 100755 index c59430232..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_04/data/EurekaSmallCaps-36.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_05/Ex_05.pde deleted file mode 100755 index 87f2cb32e..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,21 +0,0 @@ -PFont font; -String s = "VERTIGO"; -float angle = 0.0; - -void setup() { - size(100, 100); - font = loadFont("Eureka-90.vlw"); - textFont(font, 24); - fill(0); -} - -void draw() { - background(204); - angle += 0.02; - pushMatrix(); - translate(33, 50); - scale((cos(angle / 4.0) + 1.2) * 2.0); - rotate(angle); - text(s, 0, 0); - popMatrix(); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_05/data/Eureka-90.vlw b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_05/data/Eureka-90.vlw deleted file mode 100755 index 9da1ffa8d..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_05/data/Eureka-90.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_06/Ex_06.pde deleted file mode 100755 index 05551c47a..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,20 +0,0 @@ -PFont font; -String[] words = { "Three", "strikes", "and", "you're", "out...", " " }; -int whichWord = 0; - -void setup() { - size(100, 100); - font = loadFont("Eureka-32.vlw"); - textFont(font); - textAlign(CENTER); - frameRate(4); -} - -void draw() { - background(204); - whichWord++; - if (whichWord == words.length) { - whichWord = 0; - } - text(words[whichWord], width / 2, 55); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_06/data/Eureka-32.vlw b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_06/data/Eureka-32.vlw deleted file mode 100755 index baa632fc8..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_06/data/Eureka-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_07/Ex_07.pde deleted file mode 100755 index e99f7ff8e..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,22 +0,0 @@ -// The size of each letter grows and shrinks from -// left to right -PFont font; -String s = "AREA"; -float angle = 0.0; - -void setup() { - size(100, 100); - font = loadFont("EurekaMono-48.vlw"); - textFont(font); - fill(0); -} - -void draw() { - background(204); - angle += 0.1; - for (int i = 0; i < s.length(); i++) { - float c = sin(angle + i / PI); - textSize((c + 1.0) * 32 + 10); - text(s.charAt(i), i*26, 60); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_07/data/EurekaMono-48.vlw b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_07/data/EurekaMono-48.vlw deleted file mode 100755 index 90ed8654d..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_07/data/EurekaMono-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_08/Ex_08.pde deleted file mode 100755 index 676fe996d..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,36 +0,0 @@ -// Each letter enters from the bottom in sequence and -// stops when it reaches its destination -PFont font; -String word = "rise"; -char[] letters; -float[] y; // Y-coordinate for each letter -int currentLetter = 0; // Letter currently in motion - -void setup() { - size(100, 100); - font = loadFont("EurekaSmallCaps-36.vlw"); - textFont(font); - letters = word.toCharArray(); - y = new float[letters.length]; - for (int i = 0; i < letters.length; i++) { - y[i] = 130; // Position off the screen - } - fill(0); -} - -void draw() { - background(204); - if (y[currentLetter] > 35) { - y[currentLetter] -= 3; // Move current letter up - } else { - if (currentLetter < letters.length - 1) { - currentLetter++; // Switch to next letter - } - } -// Calculate x to center the word on screen - float x = (width - textWidth(word)) / 2; - for (int i = 0; i < letters.length; i++) { - text(letters[i], x, y[i]); - x += textWidth(letters[i]); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_08/data/EurekaSmallCaps-36.vlw b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_08/data/EurekaSmallCaps-36.vlw deleted file mode 100755 index c59430232..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_08/data/EurekaSmallCaps-36.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_01/Ex_01.pde deleted file mode 100755 index c3662720e..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_01/Ex_01.pde +++ /dev/null @@ -1,16 +0,0 @@ -// The word "avoid" stays away from the mouse because its -// position is set to the inverse of the cursor position -PFont f; - -void setup() { - size(100, 100); - f = loadFont("Eureka-24.vlw"); - textFont(f); - textAlign(CENTER); - fill(0); -} - -void draw() { - background(204); - text("avoid", width - mouseX, height - mouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_01/data/Eureka-24.vlw b/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_01/data/Eureka-24.vlw deleted file mode 100755 index d827a031f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_01/data/Eureka-24.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_02/Ex_02.pde deleted file mode 100755 index a7d786ac6..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_02/Ex_02.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The word "tickle" jitters when the cursor hovers over -PFont f; -float x = 33; // X-coordinate of text -float y = 60; // Y-coordinate of text - -void setup() { - size(100, 100); - f = loadFont("Eureka-24.vlw"); - textFont(f); - noStroke(); -} - -void draw() { - fill(204, 120); - rect(0, 0, width, height); - fill(0); -// If the cursor is over the text, change the position - if ((mouseX >= x) && (mouseX <= x + 55) && - (mouseY >= y - 24) && (mouseY <= y)) { - x += random(-5, 5); - y += random(-5, 5); - } - text("tickle", x, y); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_02/data/Eureka-24.vlw b/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_02/data/Eureka-24.vlw deleted file mode 100755 index d827a031f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_02/data/Eureka-24.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_03/Ex_03.pde deleted file mode 100755 index 15110a981..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_03/Ex_03.pde +++ /dev/null @@ -1,28 +0,0 @@ -// The horizontal position of the mouse determines the -// rotation angle. The angle accumulates with each letter -// drawn to make the typography curve. -String word = "Flexibility"; -PFont f; -char[] letters; - -void setup() { - size(100, 100); - f = loadFont("Eureka-24.vlw"); - textFont(f); - letters = word.toCharArray(); - fill(0); -} - -void draw() { - background(204); - pushMatrix(); - translate(0, 33); - for (int i = 0; i < letters.length; i++) { - float angle = map(mouseX, 0, width, 0, PI / 8); - rotate(angle); - text(letters[i], 0, 0); -// Offset by the width of the current letter - translate(textWidth(letters[i]), 0); - } - popMatrix(); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_03/data/Eureka-24.vlw b/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_03/data/Eureka-24.vlw deleted file mode 100755 index d827a031f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_03/data/Eureka-24.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_04/Ex_04.pde deleted file mode 100755 index 308db6aee..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_04/Ex_04.pde +++ /dev/null @@ -1,35 +0,0 @@ -// Calculates the size of each letter based on the -// position of the cursor so the letters are larger -// when the cursor is closer -String word = "BULGE"; -char[] letters; -float totalOffset = 0; -PFont font; - -void setup() { - size(100, 100); - font = loadFont("Eureka-48.vlw"); - textFont(font); - letters = word.toCharArray(); - textAlign(CENTER); - fill(0); -} - -void draw() { - background(204); - translate((width - totalOffset) / 2, 0); - totalOffset = 0; - float firstWidth = (width / letters.length) / 4.0; - translate(firstWidth, 0); - for (int i = 0; i < letters.length; i++) { - float distance = abs(totalOffset - mouseX); - distance = constrain(distance, 24, 60); - textSize(84 - distance); - text(letters[i], 0, height - 2); - float letterWidth = textWidth(letters[i]); - if (i != letters.length - 1) { - totalOffset = totalOffset + letterWidth; - translate(letterWidth, 0); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_04/data/Eureka-48.vlw b/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_04/data/Eureka-48.vlw deleted file mode 100755 index 9d4083d6b..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_04/data/Eureka-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_01/Ex_01.pde deleted file mode 100755 index e46c7e453..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,10 +0,0 @@ -color c1 = color(0, 126, 255); // Create a new color -float r = red(c1); // Assign 0.0 to r -float g = green(c1); // Assign 126.0 to g -float b = blue(c1); // Assign 255.0 to b -println(r + ", " + g + ", " + b); // Prints "0.0, 126.0, 255.0" -color c2 = color(102); // Create a new gray value -float r2 = red(c2); // Assign 102.0 to r2 -float g2 = green(c2); // Assign 102.0 to g2 -float b2 = blue(c2); // Assign 102.0 to b2 -println(r2 + ", " + g2 + ", " + b2); // Prints "102.0, 102.0, 102.0" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_02/Ex_02.pde deleted file mode 100755 index 48578ef0b..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,5 +0,0 @@ -color c = color(0, 51, 102); // Create a new color -color g = color(0, 126, 255, 220); // Create a new color -float a = alpha(c); // Assign 255.0 to a -float b = alpha(g); // Assign 220.0 to b -println(a + ", " + b); // Prints "255.0, 220.0" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_03/Ex_03.pde deleted file mode 100755 index 193a7adff..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,6 +0,0 @@ -colorMode(HSB, 360, 100, 100); // Set color mode to HSB -color c = color(210, 100, 40); // Create a new color -float h = hue(c); // Assign 210.0 to h -float s = saturation(c); // Assign 100.0 to s -float b = brightness(c); // Assign 40.0 to b -println(h + ", " + s + ", " + b); // Prints "210.0, 100.0, 40.0" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_04/Ex_04.pde deleted file mode 100755 index 0c6cc1b91..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,4 +0,0 @@ -color c = color(217, 41, 117); // Create a new color -float r = red(c); // Assign 217.0 to r -float h = hue(c); // Assign 236.64774 to h -println(r + ", " + h); // Prints "217.0, 236.64774" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_05/Ex_05.pde deleted file mode 100755 index 066e89c26..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,5 +0,0 @@ -colorMode(RGB, 1.0); // Sets color mode to HSB -color c = color(0.2, 0.8, 1.0); // Creates a new color -float r = red(c); // Assign 0.2 to r -float h = hue(c); // Assign 0.5416667 to h -println(r + ", " + h); // Prints "0.2, 0.5416667" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_06/Ex_06.pde deleted file mode 100755 index eb01830ac..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,4 +0,0 @@ -color c = color(118, 22, 24); // Create a new color -int r1 = red(c); // ERROR! red() returns a float -float r2 = red(c); // Assign 118.0 to r2 -int r3 = int(red(c)); // Assign 118 to r3 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_07/Ex_07.pde deleted file mode 100755 index be9bae4b1..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,19 +0,0 @@ -// Sets the stroke color of the lines to the -// red component of the pixel below their intersection - -void setup() { - size(100, 100); - smooth(); - fill(204, 0, 0); -} - -void draw() { - background(0); - noStroke(); - ellipse(66, 46, 80, 80); - color c = get(mouseX, mouseY); - float r = red(c); // Extract red component - stroke(255 - r); // Set the stroke based on red value - line(mouseX, 0, mouseX, height); - line(0, mouseY, width, mouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_08/Ex_08.pde deleted file mode 100755 index b023881e3..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,22 +0,0 @@ -// Simulates one pixel of a flat-panel display -PImage wall; - -void setup() { - size(100, 100); - wall = loadImage("veg.jpg"); - stroke(255); -} - -void draw() { - background(wall); - color c = get(mouseX, mouseY); - float r = red(c); // Extract red - float g = green(c); // Extract green - float b = blue(c); // Extract blue - fill(r, 0, 0); - rect(32, 20, 12, 60); // Red component - fill(0, g, 0); - rect(44, 20, 12, 60); // Green component - fill(0, 0, b); - rect(56, 20, 12, 60); // Blue component -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_09/Ex_09.pde deleted file mode 100755 index 83ccd475c..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_09/Ex_09.pde +++ /dev/null @@ -1,29 +0,0 @@ -int num = 400; -float[] x = new float[num]; -float[] y = new float[num]; -PImage img; - -void setup() { - size(100, 100); - img = loadImage("standing-alt.jpg"); - for (int i = 0; i < num; i++) { - x[i] = random(width); - y[i] = random(height); - } - stroke(255); -} - -void draw() { - background(0); - for (int i = 0; i < num; i++) { - color c = img.get(int(x[i]), int(y[i])); - float b = brightness(c) / 255.0; - float speed = pow(b, 2) + 0.05; - x[i] += speed; - if (x[i] > width) { - x[i] = 0; - y[i] = random(height); - } - point(x[i], y[i]); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_10/Ex_10.pde deleted file mode 100755 index bbb4763e1..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_10/Ex_10.pde +++ /dev/null @@ -1,23 +0,0 @@ -color olive, gray; - -void setup() { - size(100, 100); - colorMode(HSB, 360, 100, 100, 100); - noStroke(); - smooth(); - olive = color(75, 61, 59); - gray = color(30, 17, 42); -} - -void draw() { - float y = mouseY / float(height); - background(gray); - fill(olive); - quad(70 + y*6, 0, 100, 0, 100, 100, 30 - y*6, 100); - color yellow = color(48 + y * 20, 100, 88 - y * 20); - fill(yellow); - ellipse(50, 45 + y*10, 60, 60); - color orange = color(29, 100, 83 - y * 10); - fill(orange); - ellipse(54, 42 + y*16, 24, 24); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_11/Ex_11.pde deleted file mode 100755 index c3ddc1282..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_11/Ex_11.pde +++ /dev/null @@ -1,21 +0,0 @@ -PImage img; - -void setup() { - size(100, 100); - smooth(); - frameRate(0.5); - img = loadImage("palette10x10.jpg"); -} - -void draw() { - background(0); - for (int x = 0; x < img.width; x++) { - for (int y = 0; y < img.height; y++) { - float xpos1 = random(x * 10); - float xpos2 = width - random(y * 10); - color c = img.get(x, y); - stroke(c); - line(xpos1, 0, xpos2, height); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_12/Ex_12.pde deleted file mode 100755 index 898b226a3..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_12/Ex_12.pde +++ /dev/null @@ -1,17 +0,0 @@ -PImage img; - -void setup() { - size(100, 100); - noStroke(); - img = loadImage("palette10x10.jpg"); -} - -void draw() { - int ix = int(random(img.width)); - int iy = int(random(img.height)); - color c = img.get(ix, iy); - fill(c, 102); - int xgrid = int(random(-2, 5)) * 25; - int ygrid = int(random(-2, 5)) * 25; - rect(xgrid, ygrid, 40, 40); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_13/Ex_13.pde deleted file mode 100755 index dca011728..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_13/Ex_13.pde +++ /dev/null @@ -1,42 +0,0 @@ -PImage img; -color[] imageColors; - -void setup() { - size(100, 100); - frameRate(0.5); - smooth(); - noFill(); - img = loadImage("palette10x10.jpg"); - imageColors = new color[img.width*img.height]; - for (int y = 0; y < img.height; y++) { - for (int x = 0; x < img.width; x++) { - imageColors[y*img.height + x] = img.get(x, y); - } - } - imageColors = sortColors(imageColors); -} - -void draw() { - background(255); - for (int x = 10; x < width; x += 10) { - int r = int(random(imageColors.length)); - float thick = ((100 - r) / 4.0) + 1.0; - stroke(imageColors[r]); - strokeWeight(thick); - line(x, height, x, height - r + thick); - line(x, 0, x, height - r - thick); - } -} -color[] sortColors(color[] colors) { - color[] sorted = new color[colors.length]; - int num = 0; - for (int i = 0; i <= 255; i++) { - for (int j = 0; j < colors.length; j++) { - if (int(brightness(colors[j])) == i) { - sorted[num] = colors[j]; - num++; - } - } - } - return sorted; -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_01/Ex_01.pde deleted file mode 100755 index 0fa02b463..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_01/Ex_01.pde +++ /dev/null @@ -1,3 +0,0 @@ -PImage img = loadImage("topanga.jpg"); -image(img, 0, 0); -filter(THRESHOLD, 0.3); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_02/Ex_02.pde deleted file mode 100755 index 8ed3b646f..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_02/Ex_02.pde +++ /dev/null @@ -1,6 +0,0 @@ -smooth(); -strokeWeight(5); -noFill(); -line(0, 30, 100, 60); -filter(BLUR, 3); -line(0, 50, 100, 80); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_03/Ex_03.pde deleted file mode 100755 index 89c7c083d..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_03/Ex_03.pde +++ /dev/null @@ -1,18 +0,0 @@ -float fuzzy = 0.0; - -void setup() { - size(100, 100); - smooth(); - strokeWeight(5); - noFill(); -} - -void draw() { - background(204); - if (fuzzy < 16.0) { - fuzzy += 0.05; - } - line(0, 30, 100, 60); - filter(BLUR, fuzzy); - line(0, 50, 100, 80); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_04/Ex_04.pde deleted file mode 100755 index 08fd4b9b0..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_04/Ex_04.pde +++ /dev/null @@ -1,4 +0,0 @@ -PImage img = loadImage("forest.jpg"); -image(img, 0, 0); -img.filter(INVERT); -image(img, 50, 0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_05/Ex_05.pde deleted file mode 100755 index b3d8dd0c0..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_05/Ex_05.pde +++ /dev/null @@ -1,7 +0,0 @@ -background(0); -stroke(153); -strokeWeight(24); -smooth(); -line(44, 0, 24, 80); -line(0, 24, 80, 44); -blend(0, 0, 100, 100, 16, 0, 100, 100, ADD); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_06/Ex_06.pde deleted file mode 100755 index aa5a768ed..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_06/Ex_06.pde +++ /dev/null @@ -1,8 +0,0 @@ -PImage img = loadImage("topanga.jpg"); -background(0); -stroke(255); -strokeWeight(24); -smooth(); -line(44, 0, 24, 80); -line(0, 24, 80, 44); -blend(img, 0, 0, 100, 100, 0, 0, 100, 100, DARKEST); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_07/Ex_07.pde deleted file mode 100755 index 29d149526..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_07/Ex_07.pde +++ /dev/null @@ -1,4 +0,0 @@ -PImage img = loadImage("forest.jpg"); -PImage img2 = loadImage("airport.jpg"); -img.blend(img2, 12, 12, 76, 76, 12, 12, 76, 76, ADD); -image(img, 0, 0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_08/Ex_08.pde deleted file mode 100755 index 97218ec20..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_08/Ex_08.pde +++ /dev/null @@ -1,10 +0,0 @@ -color g1 = color(102); // Middle gray -color g2 = color(51); // Dark gray -color g3 = blendColor(g1, g2, MULTIPLY); // Create black -noStroke(); -fill(g1); -rect(50, 0, 50, 100); // Right rect -fill(g2); -rect(20, 25, 30, 50); // Left rect -fill(g3); -rect(50, 25, 20, 50); // Overlay rect \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_09/Ex_09.pde deleted file mode 100755 index 8e5f4c30c..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_09/Ex_09.pde +++ /dev/null @@ -1,3 +0,0 @@ -PImage img = loadImage("forest.jpg"); -image(img, 0, 0); -copy(0, 0, 100, 50, 0, 50, 100, 50); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_10/Ex_10.pde deleted file mode 100755 index 6157a4b7e..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_10/Ex_10.pde +++ /dev/null @@ -1,14 +0,0 @@ -PImage img1, img2; - -void setup() { - size(100, 100); - img1 = loadImage("forest.jpg"); - img2 = loadImage("airport.jpg"); -} - -void draw() { - background(255); - image(img1, 0, 0); - int my = constrain(mouseY, 0, 67); - copy(img2, 0, my, 100, 33, 0, my, 100, 33); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_11/Ex_11.pde deleted file mode 100755 index e57d043cd..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_11/Ex_11.pde +++ /dev/null @@ -1,3 +0,0 @@ -PImage img = loadImage("tower.jpg"); -img.copy(50, 0, 50, 100, 0, 0, 50, 100); -image(img, 0, 0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_12/Ex_12.pde deleted file mode 100755 index b1a28faf9..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_12/Ex_12.pde +++ /dev/null @@ -1,5 +0,0 @@ -background(255); -PImage img = loadImage("airport.jpg"); -PImage maskImg = loadImage("airportmask.jpg"); -img.mask(maskImg); -image(img, 0, 0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_01/Ex_01.pde deleted file mode 100755 index 8d696e3a4..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_01/Ex_01.pde +++ /dev/null @@ -1,12 +0,0 @@ -void setup() { - size(100, 100); -} - -void draw() { - float gray = map(second(), 0, 59, 0, 255); - color c = color(gray); - int index = frameCount % (width * height); - loadPixels(); - pixels[index] = c; - updatePixels(); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_02/Ex_02.pde deleted file mode 100755 index 9cce82801..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_02/Ex_02.pde +++ /dev/null @@ -1,4 +0,0 @@ -// These 3 lines of code is equivalent to: set(25, 50, color(0)) -loadPixels(); -pixels[50*width + 25] = color(0); -updatePixels(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_03/Ex_03.pde deleted file mode 100755 index 3c55060ca..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -// These 3 lines are equivalent to: pixels[5075] = color(0) -int y = 5075 / width; -int x = 5075 % width; -set(x, y, color(0)); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_04/Ex_04.pde deleted file mode 100755 index 35f7231cf..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_04/Ex_04.pde +++ /dev/null @@ -1,12 +0,0 @@ -void setup() { - size(100, 100); -} - -void draw() { -// Constrain to not exceed the boundary of the array - int mx = constrain(mouseX, 0, 99); - int my = constrain(mouseY, 0, 99); - loadPixels(); - pixels[my*width + mx] = color(0); - updatePixels(); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_05/Ex_05.pde deleted file mode 100755 index 41995d7f9..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_05/Ex_05.pde +++ /dev/null @@ -1,18 +0,0 @@ -PImage arch; - -void setup() { - size(100, 100); - noStroke(); - arch = loadImage("arch.jpg"); -} - -void draw() { - background(arch); -// Constrain to not exceed the boundary of the array - int mx = constrain(mouseX, 0, 99); - int my = constrain(mouseY, 0, 99); - loadPixels(); - color c = pixels[my*width + mx]; - fill(c); - rect(20, 20, 60, 60); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_06/Ex_06.pde deleted file mode 100755 index 5ea2f46c5..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_06/Ex_06.pde +++ /dev/null @@ -1,16 +0,0 @@ -PImage arch; - -void setup() { - size(100, 100); - arch = loadImage("arch.jpg"); -} - -void draw() { - background(204); - int mx = constrain(mouseX, 0, 99); - int my = constrain(mouseY, 0, 99); - arch.loadPixels(); - arch.pixels[my*width + mx] = color(0); - arch.updatePixels(); - image(arch, 50, 0); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_07/Ex_07.pde deleted file mode 100755 index b403166f8..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_07/Ex_07.pde +++ /dev/null @@ -1,8 +0,0 @@ -PImage arch = loadImage("arch.jpg"); -int count = arch.width * arch.height; -arch.loadPixels(); -loadPixels(); -for (int i = 0; i < count; i += 2) { - pixels[i] = arch.pixels[i]; -} -updatePixels(); diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_08/Ex_08.pde deleted file mode 100755 index c943891a6..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_08/Ex_08.pde +++ /dev/null @@ -1,8 +0,0 @@ -PImage arch = loadImage("arch.jpg"); -int count = arch.width * arch.height; -arch.loadPixels(); -loadPixels(); -for (int i = 0; i < count; i += 3) { - pixels[i] = arch.pixels[i]; -} -updatePixels(); diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_09/Ex_09.pde deleted file mode 100755 index 2b5f5e57c..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_09/Ex_09.pde +++ /dev/null @@ -1,8 +0,0 @@ -PImage arch = loadImage("arch.jpg"); -int count = arch.width * arch.height; -arch.loadPixels(); -loadPixels(); -for (int i = 0; i < count; i++) { - pixels[i] = arch.pixels[count - i - 1]; -} -updatePixels(); diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_10/Ex_10.pde deleted file mode 100755 index bf8f4adc8..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_10/Ex_10.pde +++ /dev/null @@ -1,8 +0,0 @@ -PImage arch = loadImage("arch.jpg"); -int count = arch.width * arch.height; -arch.loadPixels(); -loadPixels(); -for (int i = 0; i < count; i++) { - pixels[i] = arch.pixels[i/2]; -} -updatePixels(); diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_11/Ex_11.pde deleted file mode 100755 index 0abc1cb2d..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_11/Ex_11.pde +++ /dev/null @@ -1,11 +0,0 @@ -PImage arch = loadImage("arch.jpg"); -background(arch); -loadPixels(); -for (int i = 0; i < width*height; i++) { - color p = pixels[i]; // Grab pixel - float r = 255 - red(p); // Modify red value - float g = 255 - green(p); // Modify green value - float b = 255 - blue(p); // Modify blue value - pixels[i] = color(r, g, b); // Assign modified value -} -updatePixels(); diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_12/Ex_12.pde deleted file mode 100755 index ff9881cf6..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_12/Ex_12.pde +++ /dev/null @@ -1,22 +0,0 @@ -PImage arch; - -void setup() { - size(100, 100); - arch = loadImage("arch.jpg"); -} - -void draw() { - background(arch); - loadPixels(); - for (int i = 0; i < width*height; i++) { - color p = pixels[i]; // Read color from screen - float r = red(p); // Modify red value - float g = green(p); // Modify green value - float b = blue(p); // Modify blue value - float bw = (r + g + b) / 3.0; - bw = constrain(bw + mouseX, 0, 255); - pixels[i] = color(bw); // Assign modified value - } - updatePixels(); - line(mouseX, 0, mouseX, height); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_13/Ex_13.pde deleted file mode 100755 index 0a53a6f65..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_13/Ex_13.pde +++ /dev/null @@ -1,31 +0,0 @@ -float[][] kernel = { {-1, 0, 1}, - {-2, 0, 2}, - {-1, 0, 1} }; -size(100, 100); -PImage img = loadImage("arch.jpg"); // Load the original image -img.loadPixels(); -// Create an opaque image of the same size as the original -PImage edgeImg = createImage(img.width, img.height, RGB); -// Loop through every pixel in the image. -for (int y = 1; y < img.height - 1; y++) { // Skip top and bottom edges - for (int x = 1; x < img.width - 1; x++) { // Skip left and right edges - float sum = 0; // Kernel sum for this pixel - for (int ky = -1; ky <= 1; ky++) { - for (int kx = -1; kx <= 1; kx++) { - // Calculate the adjacent pixel for this kernel point - int pos = (y + ky) * width + (x + kx); - // Image is grayscale, red/green/blue are identical - float val = red(img.pixels[pos]); - // Multiply adjacent pixels based on the kernel values - sum += kernel[ky+1][kx+1] * val; - } - } - // For this pixel in the new image, set the gray value - // based on the sum from the kernel - edgeImg.pixels[y*img.width + x] = color(sum); - } -} -// State that there are changes to edgeImg.pixels[] -edgeImg.updatePixels(); -image(edgeImg, 0, 0); // Draw the new image - diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_14/Ex_14.pde deleted file mode 100755 index 4bd855226..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_14/Ex_14.pde +++ /dev/null @@ -1,22 +0,0 @@ -// Convert pixel values into a circle's diameter -PImage arch; -int index; - -void setup() { - size(100, 100); - smooth(); - fill(0); - arch = loadImage("arch.jpg"); - arch.loadPixels(); -} - -void draw() { - background(204); - color c = arch.pixels[index]; // Get a pixel - float r = red(c) / 3.0; // Get the red value - ellipse(width / 2, height / 2, r, r); - index++; - if (index == width*height) { - index = 0; // Return to the first pixel - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_15/Ex_15.pde deleted file mode 100755 index 2999458b3..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_15/Ex_15.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Convert the red values of pixels to line lengths -PImage arch; - -void setup() { - size(100, 100); - arch = loadImage("arch.jpg"); - arch.loadPixels(); -} - -void draw() { - background(204); - int my = constrain(mouseY, 0, 99); - for (int i = 0; i < arch.height; i++) { - color c = arch.pixels[my*width + i]; // Get a pixel - float r = red(c); // Get the red value - line(i, 0, i, height / 2 + r / 6); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_16/Ex_16.pde deleted file mode 100755 index 3576ea260..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_16/Ex_16.pde +++ /dev/null @@ -1,25 +0,0 @@ -// Convert the blue values from one row of the image -// to the coordinates for a series of lines -PImage arch; - -void setup() { - size(100, 100); - smooth(); - arch = loadImage("arch.jpg"); - arch.loadPixels(); -} - -void draw() { - background(204); - int mx = constrain(mouseX, 0, arch.width - 1); - int offset = mx * arch.width; - beginShape(LINES); - for (int i = 0; i < arch.width; i += 2) { - float r1 = blue(arch.pixels[offset + i]); - float r2 = blue(arch.pixels[offset + i + 1]); - float vx = map(r1, 0, 255, 0, height); - float vy = map(r2, 0, 255, 0, height); - vertex(vx, vy); - } - endShape(); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_01/Ex_01.pde deleted file mode 100755 index 7e7be5678..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -line(0, 0, width, height); -line(width, 0, 0, height); -// Saves the TIFF file "x.tif" to the current sketch's folder -save("x.tif"); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_02/Ex_02.pde deleted file mode 100755 index 565a6bef4..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,4 +0,0 @@ -line(0, 0, width, height); -// Saves the TIFF file "line.tif" to the current sketch's folder -save("line.tif"); -line(width, 0, 0, height); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_03/Ex_03.pde deleted file mode 100755 index 82136d8cd..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,12 +0,0 @@ -void setup() { - size(100, 100); -} - -void draw() { - background(204); - line(0, 0, mouseX, height); - line(width, 0, 0, mouseY); -} -void mousePressed() { - save("line.tif"); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_04/Ex_04.pde deleted file mode 100755 index 6d9aca159..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Save the first 50 frames -float x = 33; -float numFrames = 50; - -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - background(0); - x += random(-2, 2); - ellipse(x, 50, 40, 40); - if (frameCount <= numFrames) { - saveFrame("circles-####.tif"); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_05/Ex_05.pde deleted file mode 100755 index 5c51a4916..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Save 24 frames, from x-1000.tif to x-1023.tif -void draw() { - background(204); - line(mouseX, mouseY, pmouseX, pmouseY); - if ((frameCount > 99) && (frameCount < 1024)) { - saveFrame("x-####.tif"); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_06/Ex_06.pde deleted file mode 100755 index 9781d98ae..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Save every fifth frame (i.e., x-0005.tif, x-0005.tif, x-0010.tif) -void draw() { - background(204); - line(mouseX, mouseY, pmouseX, pmouseY); - if ((frameCount % 5) == 0) { - saveFrame("x-####.tif"); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_01/Ex_01.pde deleted file mode 100755 index 1e16e7107..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_01/Ex_01.pde +++ /dev/null @@ -1,14 +0,0 @@ -int x = 33; -int y = 50; -int diameter = 30; - -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - background(0); - ellipse(x, y, diameter, diameter); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_02/Ex_02.pde deleted file mode 100755 index d127da35f..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_02/Ex_02.pde +++ /dev/null @@ -1,21 +0,0 @@ -Spot sp; // Declare the object - -void setup() { - size(100, 100); - smooth(); - noStroke(); - sp = new Spot(); // Construct the object - sp.x = 33; // Assign 33 to the x field - sp.y = 50; // Assign 50 to the y field - sp.diameter = 30; // Assign 30 to the diameter field -} - -void draw() { - background(0); - ellipse(sp.x, sp.y, sp.diameter, sp.diameter); -} - -class Spot { - float x, y; // The x- and y-coordinate - float diameter; // Diameter of the circle -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_03/Ex_03.pde deleted file mode 100755 index 8e9cd706a..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_03/Ex_03.pde +++ /dev/null @@ -1,23 +0,0 @@ -Spot sp; // Declare the object - -void setup() { - size(100, 100); - smooth(); - noStroke(); - sp = new Spot(); // Construct the object - sp.x = 33; - sp.y = 50; - sp.diameter = 30; -} - -void draw() { - background(0); - sp.display(); -} - -class Spot { - float x, y, diameter; - void display() { - ellipse(x, y, diameter, diameter); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_04/Ex_04.pde deleted file mode 100755 index 98814ec72..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_04/Ex_04.pde +++ /dev/null @@ -1,27 +0,0 @@ -Spot sp; // Declare the object - -void setup() { - size(100, 100); - smooth(); - noStroke(); - sp = new Spot(33, 50, 30); // Construct the object -} - -void draw() { - background(0); - sp.display(); -} - -class Spot { - float x, y, diameter; - - Spot(float xpos, float ypos, float dia) { - x = xpos; // Assign 33 to x - y = ypos; // Assign 50 to y - diameter = dia; // Assign 30 to diameter - } - - void display() { - ellipse(x, y, diameter, diameter); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_05/Ex_05.pde deleted file mode 100755 index 188240b18..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_05/Ex_05.pde +++ /dev/null @@ -1,25 +0,0 @@ -class Spot { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the circle - float speed; // Distance moved each frame - int direction = 1; // Direction of motion (1 is down, -1 is up) - - // Constructor - Spot(float xpos, float ypos, float dia, float sp) { - x = xpos; - y = ypos; - diameter = dia; - speed = sp; - } - - void move() { - y += (speed * direction); - if ((y > (height - diameter / 2)) || (y < diameter / 2)) { - direction *= -1; - } - } - - void display() { - ellipse(x, y, diameter, diameter); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_06/Ex_06.pde deleted file mode 100755 index faa47a70b..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_06/Ex_06.pde +++ /dev/null @@ -1,42 +0,0 @@ -Spot sp; // Declare the object - -void setup() { - size(100, 100); - smooth(); - noStroke(); - sp = new Spot(33, 50, 30, 1.5); // Construct the object -} - -void draw() { - fill(0, 15); - rect(0, 0, width, height); - fill(255); - sp.move(); - sp.display(); -} - -class Spot { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the circle - float speed; // Distance moved each frame - int direction = 1; // Direction of motion (1 is down, -1 is up) - - // Constructor - Spot(float xpos, float ypos, float dia, float sp) { - x = xpos; - y = ypos; - diameter = dia; - speed = sp; - } - - void move() { - y += (speed * direction); - if ((y > (height - diameter / 2)) || (y < diameter / 2)) { - direction *= -1; - } - } - - void display() { - ellipse(x, y, diameter, diameter); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_07/Ex_07.pde deleted file mode 100755 index cd31bc1f4..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_07/Ex_07.pde +++ /dev/null @@ -1,49 +0,0 @@ -Spot sp1, sp2, sp3; // Declare the objects - -void setup() { - size(100, 100); - smooth(); - noStroke(); - sp1 = new Spot(20, 50, 40, 0.5); // Construct sp1 - sp2 = new Spot(50, 50, 10, 2.0); // Construct sp2 - sp3 = new Spot(80, 50, 30, 1.5); // Construct sp3 -} - -void draw() { - fill(0, 15); - rect(0, 0, width, height); - fill(255); - sp1.move(); - sp2.move(); - sp3.move(); - sp1.display(); - sp2.display(); - sp3.display(); -} - -class Spot { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the circle - float speed; // Distance moved each frame - int direction = 1; // Direction of motion (1 is down, -1 is up) - - // Constructor - Spot(float xpos, float ypos, float dia, float sp) { - x = xpos; - y = ypos; - diameter = dia; - speed = sp; - } - - void move() { - y += (speed * direction); - if ((y > (height - diameter / 2)) || (y < diameter / 2)) { - direction *= -1; - } - } - - void display() { - ellipse(x, y, diameter, diameter); - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_08/Ex_08.pde deleted file mode 100755 index dac8bfe21..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_08/Ex_08.pde +++ /dev/null @@ -1,36 +0,0 @@ -class Egg { - float x, y; // X-coordinate, y-coordinate - float tilt; // Left and right angle offset - float angle; // Used to define the tilt - float scalar; // Height of the egg - - // Constructor - Egg(int xpos, int ypos, float t, float s) { - x = xpos; - y = ypos; - tilt = t; - scalar = s / 100.0; - } - - void wobble() { - tilt = cos(angle) / 8; - angle += 0.1; - } - - void display() { - noStroke(); - fill(255); - pushMatrix(); - translate(x, y); - rotate(tilt); - scale(scalar); - beginShape(); - vertex(0, -100); - bezierVertex(25, -100, 40, -65, 40, -40); - bezierVertex(40, -15, 25, 0, 0, 0); - bezierVertex(-25, 0, -40, -15, -40, -40); - bezierVertex(-40, -65, -25, -100, 0, -100); - endShape(); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_09/Ex_09.pde deleted file mode 100755 index 85f36def1..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_09/Ex_09.pde +++ /dev/null @@ -1,51 +0,0 @@ -Egg humpty; // Declare the object - -void setup() { - size(100, 100); - smooth(); -// Inputs: x-coordinate, y-coordinate, tilt, height - humpty = new Egg(50, 100, PI / 32, 80); -} - -void draw() { - background(0); - humpty.wobble(); - humpty.display(); -} - -class Egg { - float x, y; // X-coordinate, y-coordinate - float tilt; // Left and right angle offset - float angle; // Used to define the tilt - float scalar; // Height of the egg - - // Constructor - Egg(int xpos, int ypos, float t, float s) { - x = xpos; - y = ypos; - tilt = t; - scalar = s / 100.0; - } - - void wobble() { - tilt = cos(angle) / 8; - angle += 0.1; - } - - void display() { - noStroke(); - fill(255); - pushMatrix(); - translate(x, y); - rotate(tilt); - scale(scalar); - beginShape(); - vertex(0, -100); - bezierVertex(25, -100, 40, -65, 40, -40); - bezierVertex(40, -15, 25, 0, 0, 0); - bezierVertex(-25, 0, -40, -15, -40, -40); - bezierVertex(-40, -65, -25, -100, 0, -100); - endShape(); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_10/Ex_10.pde deleted file mode 100755 index 4c5f47eb1..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_10/Ex_10.pde +++ /dev/null @@ -1,53 +0,0 @@ -int numSpots = 6; -// Declare and create the array -Spot[] spots = new Spot[numSpots]; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - for (int i = 0; i < spots.length; i++) { - float x = 10 + i * 16; - float rate = 0.5 + i * 0.05; -// Create each object - spots[i] = new Spot(x, 50, 16, rate); - } -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - for (int i = 0; i < spots.length; i++) { - spots[i].move(); // Move each object - spots[i].display(); // Display each object - } -} - -class Spot { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the circle - float speed; // Distance moved each frame - int direction = 1; // Direction of motion (1 is down, -1 is up) - - // Constructor - Spot(float xpos, float ypos, float dia, float sp) { - x = xpos; - y = ypos; - diameter = dia; - speed = sp; - } - - void move() { - y += (speed * direction); - if ((y > (height - diameter / 2)) || (y < diameter / 2)) { - direction *= -1; - } - } - - void display() { - ellipse(x, y, diameter, diameter); - } -} - - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_11/Ex_11.pde deleted file mode 100755 index 47a8b20bc..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_11/Ex_11.pde +++ /dev/null @@ -1,30 +0,0 @@ -class Ring { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the ring - boolean on = false; // Turns the display on and off - - void start(float xpos, float ypos) { - x = xpos; - y = ypos; - on = true; - diameter = 1; - } - - void grow() { - if (on == true) { - diameter += 0.5; - if (diameter > 400) { - on = false; - } - } - } - - void display() { - if (on == true) { - noFill(); - strokeWeight(4); - stroke(15, 153); - ellipse(x, y, diameter, diameter); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_12/Ex_12.pde deleted file mode 100755 index f3ba8257c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_12/Ex_12.pde +++ /dev/null @@ -1,60 +0,0 @@ -Ring[] rings; // Declare the array -int numRings = 50; -int currentRing = 0; - -void setup() { - size(100, 100); - smooth(); - rings = new Ring[numRings]; // Create the array - for (int i = 0; i < numRings; i++) { - rings[i] = new Ring(); // Create each object - } -} - -void draw() { - background(0); - for (int i = 0; i < numRings; i++) { - rings[i].grow(); - rings[i].display(); - } -} - -// Click to create a new Ring -void mousePressed() { - rings[currentRing].start(mouseX, mouseY); - currentRing++; - if (currentRing >= numRings) { - currentRing = 0; - } -} - -class Ring { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the ring - boolean on = false; // Turns the display on and off - - void start(float xpos, float ypos) { - x = xpos; - y = ypos; - on = true; - diameter = 1; - } - - void grow() { - if (on == true) { - diameter += 0.5; - if (diameter > 400) { - on = false; - } - } - } - - void display() { - if (on == true) { - noFill(); - strokeWeight(4); - stroke(15, 153); - ellipse(x, y, diameter, diameter); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_01/Ex_01.pde deleted file mode 100755 index 9659cf1c0..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,13 +0,0 @@ -void setup() { - size(100, 100); - smooth(); -} - -void draw() { - float s = dist(mouseX, mouseY, pmouseX, pmouseY) + 1; - noStroke(); - fill(0, 102); - ellipse(mouseX, mouseY, s, s); - stroke(255); - point(mouseX, mouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_02/Ex_02.pde deleted file mode 100755 index 6bb961cc6..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,24 +0,0 @@ -int angle = 0; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - fill(0, 102); -} - -void draw() { -// Draw only when mouse is pressed - if (mousePressed == true) { - angle += 10; - float val = cos(radians(angle)) * 6.0; - for (int a = 0; a < 360; a += 75) { - float xoff = cos(radians(a)) * val; - float yoff = sin(radians(a)) * val; - fill(0); - ellipse(mouseX + xoff, mouseY + yoff, val / 2, val / 2); - } - fill(255); - ellipse(mouseX, mouseY, 2, 2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_03/Ex_03.pde deleted file mode 100755 index 78845ddcf..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,31 +0,0 @@ -Blade diagonal; - -void setup() { - size(100, 100); - diagonal = new Blade(30, 80); -} - -void draw() { - diagonal.grow(); -} - -void mouseMoved() { - diagonal.seed(mouseX, mouseY); -} - -class Blade { - float x, y; - Blade(int xpos, int ypos) { - x = xpos; - y = ypos; - } - void seed(int xpos, int ypos) { - x = xpos; - y = ypos; - } - void grow() { - x += 0.5; - y -= 1.0; - point(x, y); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_04/Ex_04.pde deleted file mode 100755 index e85a5bf81..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,19 +0,0 @@ -float x1, y1, x2, y2; - -void setup() { - size(100, 100); - smooth(); - x1 = width / 4.0; - y1 = x1; - x2 = width - x1; - y2 = x2; -} - -void draw() { - background(204); - x1 += random(-0.5, 0.5); - y1 += random(-0.5, 0.5); - x2 += random(-0.5, 0.5); - y2 += random(-0.5, 0.5); - line(x1, y1, x2, y2); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_05/Ex_05.pde deleted file mode 100755 index 9c310d4cd..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,46 +0,0 @@ -int numLines = 500; -MovingLine[] lines = new MovingLine[numLines]; -int currentLine = 0; - -void setup() { - size(100, 100); - smooth(); - frameRate(30); - for (int i = 0; i < numLines; i++) { - lines[i] = new MovingLine(); - } -} - -void draw() { - background(204); - for (int i = 0; i < currentLine; i++) { - lines[i].display(); - } -} - -void mouseDragged() { - lines[currentLine].setPosition(mouseX, mouseY, - pmouseX, pmouseY); - if (currentLine < numLines - 1) { - currentLine++; - } -} - -class MovingLine { - float x1, y1, x2, y2; - - void setPosition(int x, int y, int px, int py) { - x1 = x; - y1 = y; - x2 = px; - y2 = py; - } - - void display() { - x1 += random(-0.1, 0.1); - y1 += random(-0.1, 0.1); - x2 += random(-0.1, 0.1); - y2 += random(-0.1, 0.1); - line(x1, y1, x2, y2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--0775.tif b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--0775.tif deleted file mode 100644 index 1d12b4c3c..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--0775.tif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--1287.tif b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--1287.tif deleted file mode 100644 index 6809749fb..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--1287.tif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--2208.tif b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--2208.tif deleted file mode 100644 index e67028578..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--2208.tif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--6438.tif b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--6438.tif deleted file mode 100644 index e6218b499..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--6438.tif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/Ex_06.pde deleted file mode 100755 index 3197cc0a2..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,33 +0,0 @@ -int currentFrame = 0; -PImage[] frames = new PImage[12]; -int lastTime = 0; - -void setup() { - size(100, 100); - strokeWeight(4); - smooth(); - background(204); - for (int i = 0; i < frames.length; i++) { - frames[i] = get(); // Create a blank frame - } -} - -void draw() { - int currentTime = millis(); - if (currentTime > lastTime + 100) { - nextFrame(); - lastTime = currentTime; - } - if (mousePressed == true) { - line(pmouseX, pmouseY, mouseX, mouseY); - } -} - -void nextFrame() { - frames[currentFrame] = get(); // Get the display window - currentFrame++; // Increment to next frame - if (currentFrame >= frames.length) { - currentFrame = 0; - } - image(frames[currentFrame], 0, 0); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_01/Ex_01.pde deleted file mode 100755 index 4a5abc28d..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Prints "tab space" -println("tab\tspace"); -// Prints each word after "\n" on a new line: -// line1 -// line2 -// line3 -println("line1\nline2\nline3"); diff --git a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_02/Ex_02.pde deleted file mode 100755 index 5366abe32..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,6 +0,0 @@ -println(nf(200, 10)); // Prints "0000000200" -println(nf(40, 5)); // Prints "00040" -println(nf(90, 3)); // Prints "090" -println(nf(200.94, 10, 4)); // Prints "0000000200.9400" -println(nf(40.2, 5, 3)); // Prints "00040.200" -println(nf(9.012, 3, 5)); // Prints "009.01200" diff --git a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_03/Ex_03.pde deleted file mode 100755 index 20eb0a6f9..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,36 +0,0 @@ -int[] x = new int[0]; -int[] y = new int[0]; - -void setup() { - size(100, 100); -} - -void draw() { - background(204); - stroke(0); - noFill(); - beginShape(); - for (int i = 0; i < x.length; i++) { - vertex(x[i], y[i]); - } - endShape(); -// Show the next segment to be added - if (x.length >= 1) { - stroke(255); - line(mouseX, mouseY, x[x.length-1], y[x.length-1]); - } -} - -void mousePressed() { // Click to add a line segment - x = append(x, mouseX); - y = append(y, mouseY); -} - -void keyPressed() { // Press a key to save the data - String[] lines = new String[x.length]; - for (int i = 0; i < x.length; i++) { - lines[i] = x[i] + "\t" + y[i]; - } - saveStrings("lines.txt", lines); - exit(); // Stop the program -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_03/lines.txt b/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_03/lines.txt deleted file mode 100644 index 8c8304391..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_03/lines.txt +++ /dev/null @@ -1,9 +0,0 @@ -29 1 -68 80 -60 22 -27 71 -35 27 -90 22 -75 77 -33 94 -27 71 diff --git a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_04/Ex_04.pde deleted file mode 100755 index f33aea6f5..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,23 +0,0 @@ -PrintWriter output; - -void setup() { - size(100, 100); - // Create a new file in the sketch directory - output = createWriter("positions.txt"); - frameRate(12); -} - -void draw() { - if (mousePressed) { - point(mouseX, mouseY); - // Write the coordinate to a file with a - // "\t" (TAB character) between each entry - output.println(mouseX + "\t" + mouseY); - } -} - -void keyPressed() { // Press a key to save the data - output.flush(); // Write the remaining data - output.close(); // Finish the file - exit(); // Stop the program -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_05/Ex_05.pde deleted file mode 100755 index 31274ad55..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,31 +0,0 @@ -PFont font; -String letters = ""; -PrintWriter output; - -void setup() { - size(100, 100); - fill(0); - font = loadFont("Eureka-24.vlw"); - textFont(font); - // Create a new file in the sketch directory - output = createWriter("words.txt"); -} - -void draw() { - background(204); - text(letters, 5, 50); -} - -void keyPressed() { - if (key == ' ') { // Spacebar pressed - output.println(letters); // Write data to words.txt - letters = ""; // Clear the letter String - } else { - letters = letters + key; - } - if (key == ENTER) { - output.flush(); // Write the remaining data - output.close(); // Finish the file - exit(); // Stop the program - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_05/data/Eureka-24.vlw b/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_05/data/Eureka-24.vlw deleted file mode 100755 index d827a031f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_05/data/Eureka-24.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_05/words.txt b/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_05/words.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_01/Ex_01.pde deleted file mode 100755 index a62f84313..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_01/Ex_01.pde +++ /dev/null @@ -1,13 +0,0 @@ -String[] lines = loadStrings("positions.txt"); - -for (int i = 0; i < lines.length; i++) { -// Split this line into pieces at each tab character - String[] pieces = split(lines[i], '\t'); -// Take action only if there are two values on the line -// (this will avoid blank or incomplete lines) - if (pieces.length == 2) { - int x = int(pieces[0]); - int y = int(pieces[1]); - point(x, y); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_01/data/positions.txt b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_01/data/positions.txt deleted file mode 100755 index 3b8ff2e23..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_01/data/positions.txt +++ /dev/null @@ -1,206 +0,0 @@ -70 35 -69 35 -68 39 -67 42 -66 47 -64 51 -64 54 -63 57 -60 60 -58 64 -51 69 -48 72 -44 73 -39 75 -35 75 -30 75 -25 75 -21 75 -17 73 -13 69 -12 66 -11 61 -11 57 -10 49 -10 45 -10 38 -12 32 -13 29 -16 23 -20 19 -24 16 -27 15 -31 13 -33 13 -37 13 -40 15 -42 16 -45 19 -46 21 -47 24 -48 26 -48 29 -48 33 -47 39 -43 45 -42 47 -38 50 -35 51 -32 51 -30 51 -27 50 -27 50 -26 46 -26 41 -29 36 -30 34 -31 33 -31 33 -32 33 -33 33 -34 33 -34 33 -35 33 -37 33 -39 33 -42 32 -44 31 -46 29 -48 29 -49 27 -52 24 -53 23 -57 19 -61 16 -63 14 -67 13 -69 12 -69 12 -77 11 -77 11 -80 11 -86 16 -90 21 -93 25 -95 29 -95 32 -95 33 -95 37 -94 41 -93 44 -92 46 -91 49 -89 51 -87 55 -85 59 -82 62 -80 64 -79 67 -77 69 -74 71 -68 72 -65 73 -63 73 -62 73 -60 72 -58 69 -57 67 -57 66 -56 60 -56 56 -56 54 -58 49 -60 47 -62 47 -63 47 -67 48 -70 52 -73 55 -74 57 -74 58 -74 60 -74 62 -73 65 -70 68 -67 69 -65 70 -63 70 -62 70 -60 68 -57 65 -55 64 -50 62 -46 61 -40 60 -38 60 -36 60 -32 61 -30 62 -27 64 -26 68 -25 71 -25 77 -25 81 -26 84 -28 86 -31 87 -33 88 -36 88 -39 86 -41 85 -43 83 -44 81 -45 76 -45 74 -45 71 -40 67 -37 65 -34 63 -33 61 -33 61 -32 60 -33 49 -37 45 -41 41 -45 39 -47 38 -51 37 -54 37 -58 38 -61 41 -63 44 -65 46 -66 49 -66 51 -67 55 -67 58 -67 60 -66 62 -64 65 -63 66 -61 67 -60 68 -58 68 -55 69 -54 69 -51 69 -48 69 -46 68 -45 66 -44 65 -44 63 -44 61 -44 59 -44 56 -44 55 -45 53 -47 52 -49 50 -50 48 -51 47 -52 46 -54 46 -55 45 -55 45 -56 44 -57 44 diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_02/Ex_02.pde deleted file mode 100755 index d8680996c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_02/Ex_02.pde +++ /dev/null @@ -1,4 +0,0 @@ -String s = "a, b"; -String[] p = split(s, ", "); -println(p[0]); // Prints "a" -println(p[1]); // Prints "b" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_03/Ex_03.pde deleted file mode 100755 index 3671d0350..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -String t = "a b"; -String[] q = splitTokens(t); -println(q[0]); // Prints "a" -println(q[1]); // Prints "b" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_04/Ex_04.pde deleted file mode 100755 index 61859e11e..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_04/Ex_04.pde +++ /dev/null @@ -1,6 +0,0 @@ -String s = "a, b c ,,d "; // Despite the bad formatting, -String[] p = splitTokens(s, ", "); // the data is parsed correctly -println(p[0]); // Prints "a" -println(p[1]); // Prints "b" -println(p[2]); // Prints "c" -println(p[3]); // Prints "d" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_05/Ex_05.pde deleted file mode 100755 index 24d9ada27..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_05/Ex_05.pde +++ /dev/null @@ -1,20 +0,0 @@ -String[] lines; -int index = 0; - -void setup() { - lines = loadStrings("positions.txt"); - frameRate(12); -} - -void draw() { - if (index < lines.length) { - String[] pieces = split(lines[index], '\t'); - if (pieces.length == 2) { - int x = int(pieces[0]); - int y = int(pieces[1]); - point(x, y); - } - // Go to the next line for the next run through draw() - index = index + 1; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_05/data/positions.txt b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_05/data/positions.txt deleted file mode 100755 index 3b8ff2e23..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_05/data/positions.txt +++ /dev/null @@ -1,206 +0,0 @@ -70 35 -69 35 -68 39 -67 42 -66 47 -64 51 -64 54 -63 57 -60 60 -58 64 -51 69 -48 72 -44 73 -39 75 -35 75 -30 75 -25 75 -21 75 -17 73 -13 69 -12 66 -11 61 -11 57 -10 49 -10 45 -10 38 -12 32 -13 29 -16 23 -20 19 -24 16 -27 15 -31 13 -33 13 -37 13 -40 15 -42 16 -45 19 -46 21 -47 24 -48 26 -48 29 -48 33 -47 39 -43 45 -42 47 -38 50 -35 51 -32 51 -30 51 -27 50 -27 50 -26 46 -26 41 -29 36 -30 34 -31 33 -31 33 -32 33 -33 33 -34 33 -34 33 -35 33 -37 33 -39 33 -42 32 -44 31 -46 29 -48 29 -49 27 -52 24 -53 23 -57 19 -61 16 -63 14 -67 13 -69 12 -69 12 -77 11 -77 11 -80 11 -86 16 -90 21 -93 25 -95 29 -95 32 -95 33 -95 37 -94 41 -93 44 -92 46 -91 49 -89 51 -87 55 -85 59 -82 62 -80 64 -79 67 -77 69 -74 71 -68 72 -65 73 -63 73 -62 73 -60 72 -58 69 -57 67 -57 66 -56 60 -56 56 -56 54 -58 49 -60 47 -62 47 -63 47 -67 48 -70 52 -73 55 -74 57 -74 58 -74 60 -74 62 -73 65 -70 68 -67 69 -65 70 -63 70 -62 70 -60 68 -57 65 -55 64 -50 62 -46 61 -40 60 -38 60 -36 60 -32 61 -30 62 -27 64 -26 68 -25 71 -25 77 -25 81 -26 84 -28 86 -31 87 -33 88 -36 88 -39 86 -41 85 -43 83 -44 81 -45 76 -45 74 -45 71 -40 67 -37 65 -34 63 -33 61 -33 61 -32 60 -33 49 -37 45 -41 41 -45 39 -47 38 -51 37 -54 37 -58 38 -61 41 -63 44 -65 46 -66 49 -66 51 -67 55 -67 58 -67 60 -66 62 -64 65 -63 66 -61 67 -60 68 -58 68 -55 69 -54 69 -51 69 -48 69 -46 68 -45 66 -44 65 -44 63 -44 61 -44 59 -44 56 -44 55 -45 53 -47 52 -49 50 -50 48 -51 47 -52 46 -54 46 -55 45 -55 45 -56 44 -57 44 diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_06/Ex_06.pde deleted file mode 100755 index 2c380b7be..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_06/Ex_06.pde +++ /dev/null @@ -1,40 +0,0 @@ -Record[] records; -int recordCount; - -void setup() { - String[] lines = loadStrings("cars2.tsv"); - records = new Record[lines.length]; - for (int i = 0; i < lines.length; i++) { - String[] pieces = split(lines[i], '\t'); // Load data into array - if (pieces.length == 9) { - records[recordCount] = new Record(pieces); - recordCount++; - } - } - for (int i = 0; i < recordCount; i++) { - println(i + " -> " + records[i].name); // Print name to console - } -} - -class Record { - String name; - float mpg; - int cylinders; - float displacement; - float horsepower; - float weight; - float acceleration; - int year; - float origin; - public Record(String[] pieces) { - name = pieces[0]; - mpg = float(pieces[1]); - cylinders = int(pieces[2]); - displacement = float(pieces[3]); - horsepower = float(pieces[4]); - weight = float(pieces[5]); - acceleration = float(pieces[6]); - year = int(pieces[7]); - origin = float(pieces[8]); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_06/data/cars2.tsv b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_06/data/cars2.tsv deleted file mode 100755 index 4beddafbc..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_06/data/cars2.tsv +++ /dev/null @@ -1 +0,0 @@ -chevrolet chevelle malibu 18 8 307 130 3504 12 70 1 buick skylark 320 15 8 350 165 3693 11.5 70 1 plymouth satellite 18 8 318 150 3436 11 70 1 amc rebel sst 16 8 304 150 3433 12 70 1 ford torino 17 8 302 140 3449 10.5 70 1 ford galaxie 500 15 8 429 198 4341 10 70 1 chevrolet impala 14 8 454 220 4354 9 70 1 plymouth fury iii 14 8 440 215 4312 8.5 70 1 pontiac catalina 14 8 455 225 4425 10 70 1 amc ambassador dpl 15 8 390 190 3850 8.5 70 1 citroen ds-21 pallas NA 4 133 115 3090 17.5 70 2 chevrolet chevelle concours (sw) NA 8 350 165 4142 11.5 70 1 ford torino (sw) NA 8 351 153 4034 11 70 1 plymouth satellite (sw) NA 8 383 175 4166 10.5 70 1 amc rebel sst (sw) NA 8 360 175 3850 11 70 1 dodge challenger se 15 8 383 170 3563 10 70 1 plymouth 'cuda 340 14 8 340 160 3609 8 70 1 ford mustang boss 302 NA 8 302 140 3353 8 70 1 chevrolet monte carlo 15 8 400 150 3761 9.5 70 1 buick estate wagon (sw) 14 8 455 225 3086 10 70 1 toyota corona mark ii 24 4 113 95 2372 15 70 3 plymouth duster 22 6 198 95 2833 15.5 70 1 amc hornet 18 6 199 97 2774 15.5 70 1 ford maverick 21 6 200 85 2587 16 70 1 datsun pl510 27 4 97 88 2130 14.5 70 3 volkswagen 1131 deluxe sedan 26 4 97 46 1835 20.5 70 2 peugeot 504 25 4 110 87 2672 17.5 70 2 audi 100 ls 24 4 107 90 2430 14.5 70 2 saab 99e 25 4 104 95 2375 17.5 70 2 bmw 2002 26 4 121 113 2234 12.5 70 2 amc gremlin 21 6 199 90 2648 15 70 1 ford f250 10 8 360 215 4615 14 70 1 chevy c20 10 8 307 200 4376 15 70 1 dodge d200 11 8 318 210 4382 13.5 70 1 hi 1200d 9 8 304 193 4732 18.5 70 1 datsun pl510 27 4 97 88 2130 14.5 71 3 chevrolet vega 2300 28 4 140 90 2264 15.5 71 1 toyota corona 25 4 113 95 2228 14 71 3 ford pinto 25 4 98 NA 2046 19 71 1 volkswagen super beetle 117 NA 4 97 48 1978 20 71 2 amc gremlin 19 6 232 100 2634 13 71 1 plymouth satellite custom 16 6 225 105 3439 15.5 71 1 chevrolet chevelle malibu 17 6 250 100 3329 15.5 71 1 ford torino 500 19 6 250 88 3302 15.5 71 1 amc matador 18 6 232 100 3288 15.5 71 1 chevrolet impala 14 8 350 165 4209 12 71 1 pontiac catalina brougham 14 8 400 175 4464 11.5 71 1 ford galaxie 500 14 8 351 153 4154 13.5 71 1 plymouth fury iii 14 8 318 150 4096 13 71 1 dodge monaco (sw) 12 8 383 180 4955 11.5 71 1 ford country squire (sw) 13 8 400 170 4746 12 71 1 pontiac safari (sw) 13 8 400 175 5140 12 71 1 amc hornet sportabout (sw) 18 6 258 110 2962 13.5 71 1 chevrolet vega (sw) 22 4 140 72 2408 19 71 1 pontiac firebird 19 6 250 100 3282 15 71 1 ford mustang 18 6 250 88 3139 14.5 71 1 mercury capri 2000 23 4 122 86 2220 14 71 1 opel 1900 28 4 116 90 2123 14 71 2 peugeot 304 30 4 79 70 2074 19.5 71 2 fiat 124b 30 4 88 76 2065 14.5 71 2 toyota corolla 1200 31 4 71 65 1773 19 71 3 datsun 1200 35 4 72 69 1613 18 71 3 volkswagen model 111 27 4 97 60 1834 19 71 2 plymouth cricket 26 4 91 70 1955 20.5 71 1 toyota corona hardtop 24 4 113 95 2278 15.5 72 3 dodge colt hardtop 25 4 97.5 80 2126 17 72 1 volkswagen type 3 23 4 97 54 2254 23.5 72 2 chevrolet vega 20 4 140 90 2408 19.5 72 1 ford pinto runabout 21 4 122 86 2226 16.5 72 1 chevrolet impala 13 8 350 165 4274 12 72 1 pontiac catalina 14 8 400 175 4385 12 72 1 plymouth fury iii 15 8 318 150 4135 13.5 72 1 ford galaxie 500 14 8 351 153 4129 13 72 1 amc ambassador sst 17 8 304 150 3672 11.5 72 1 mercury marquis 11 8 429 208 4633 11 72 1 buick lesabre custom 13 8 350 155 4502 13.5 72 1 oldsmobile delta 88 royale 12 8 350 160 4456 13.5 72 1 chrysler newport royal 13 8 400 190 4422 12.5 72 1 mazda rx2 coupe 19 3 70 97 2330 13.5 72 3 amc matador (sw) 15 8 304 150 3892 12.5 72 1 chevrolet chevelle concours (sw) 13 8 307 130 4098 14 72 1 ford gran torino (sw) 13 8 302 140 4294 16 72 1 plymouth satellite custom (sw) 14 8 318 150 4077 14 72 1 volvo 145e (sw) 18 4 121 112 2933 14.5 72 2 volkswagen 411 (sw) 22 4 121 76 2511 18 72 2 peugeot 504 (sw) 21 4 120 87 2979 19.5 72 2 renault 12 (sw) 26 4 96 69 2189 18 72 2 ford pinto (sw) 22 4 122 86 2395 16 72 1 datsun 510 (sw) 28 4 97 92 2288 17 72 3 toyouta corona mark ii (sw) 23 4 120 97 2506 14.5 72 3 dodge colt (sw) 28 4 98 80 2164 15 72 1 toyota corolla 1600 (sw) 27 4 97 88 2100 16.5 72 3 buick century 350 13 8 350 175 4100 13 73 1 amc matador 14 8 304 150 3672 11.5 73 1 chevrolet malibu 13 8 350 145 3988 13 73 1 ford gran torino 14 8 302 137 4042 14.5 73 1 dodge coronet custom 15 8 318 150 3777 12.5 73 1 mercury marquis brougham 12 8 429 198 4952 11.5 73 1 chevrolet caprice classic 13 8 400 150 4464 12 73 1 ford ltd 13 8 351 158 4363 13 73 1 plymouth fury gran sedan 14 8 318 150 4237 14.5 73 1 chrysler new yorker brougham 13 8 440 215 4735 11 73 1 buick electra 225 custom 12 8 455 225 4951 11 73 1 amc ambassador brougham 13 8 360 175 3821 11 73 1 plymouth valiant 18 6 225 105 3121 16.5 73 1 chevrolet nova custom 16 6 250 100 3278 18 73 1 amc hornet 18 6 232 100 2945 16 73 1 ford maverick 18 6 250 88 3021 16.5 73 1 plymouth duster 23 6 198 95 2904 16 73 1 volkswagen super beetle 26 4 97 46 1950 21 73 2 chevrolet impala 11 8 400 150 4997 14 73 1 ford country 12 8 400 167 4906 12.5 73 1 plymouth custom suburb 13 8 360 170 4654 13 73 1 oldsmobile vista cruiser 12 8 350 180 4499 12.5 73 1 amc gremlin 18 6 232 100 2789 15 73 1 toyota carina 20 4 97 88 2279 19 73 3 chevrolet vega 21 4 140 72 2401 19.5 73 1 datsun 610 22 4 108 94 2379 16.5 73 3 maxda rx3 18 3 70 90 2124 13.5 73 3 ford pinto 19 4 122 85 2310 18.5 73 1 mercury capri v6 21 6 155 107 2472 14 73 1 fiat 124 sport coupe 26 4 98 90 2265 15.5 73 2 chevrolet monte carlo s 15 8 350 145 4082 13 73 1 pontiac grand prix 16 8 400 230 4278 9.5 73 1 fiat 128 29 4 68 49 1867 19.5 73 2 opel manta 24 4 116 75 2158 15.5 73 2 audi 100ls 20 4 114 91 2582 14 73 2 volvo 144ea 19 4 121 112 2868 15.5 73 2 dodge dart custom 15 8 318 150 3399 11 73 1 saab 99le 24 4 121 110 2660 14 73 2 toyota mark ii 20 6 156 122 2807 13.5 73 3 oldsmobile omega 11 8 350 180 3664 11 73 1 plymouth duster 20 6 198 95 3102 16.5 74 1 ford maverick 21 6 200 NA 2875 17 74 1 amc hornet 19 6 232 100 2901 16 74 1 chevrolet nova 15 6 250 100 3336 17 74 1 datsun b210 31 4 79 67 1950 19 74 3 ford pinto 26 4 122 80 2451 16.5 74 1 toyota corolla 1200 32 4 71 65 1836 21 74 3 chevrolet vega 25 4 140 75 2542 17 74 1 chevrolet chevelle malibu classic 16 6 250 100 3781 17 74 1 amc matador 16 6 258 110 3632 18 74 1 plymouth satellite sebring 18 6 225 105 3613 16.5 74 1 ford gran torino 16 8 302 140 4141 14 74 1 buick century luxus (sw) 13 8 350 150 4699 14.5 74 1 dodge coronet custom (sw) 14 8 318 150 4457 13.5 74 1 ford gran torino (sw) 14 8 302 140 4638 16 74 1 amc matador (sw) 14 8 304 150 4257 15.5 74 1 audi fox 29 4 98 83 2219 16.5 74 2 volkswagen dasher 26 4 79 67 1963 15.5 74 2 opel manta 26 4 97 78 2300 14.5 74 2 toyota corona 31 4 76 52 1649 16.5 74 3 datsun 710 32 4 83 61 2003 19 74 3 dodge colt 28 4 90 75 2125 14.5 74 1 fiat 128 24 4 90 75 2108 15.5 74 2 fiat 124 tc 26 4 116 75 2246 14 74 2 honda civic 24 4 120 97 2489 15 74 3 subaru 26 4 108 93 2391 15.5 74 3 fiat x1.9 31 4 79 67 2000 16 74 2 plymouth valiant custom 19 6 225 95 3264 16 75 1 chevrolet nova 18 6 250 105 3459 16 75 1 mercury monarch 15 6 250 72 3432 21 75 1 ford maverick 15 6 250 72 3158 19.5 75 1 pontiac catalina 16 8 400 170 4668 11.5 75 1 chevrolet bel air 15 8 350 145 4440 14 75 1 plymouth grand fury 16 8 318 150 4498 14.5 75 1 ford ltd 14 8 351 148 4657 13.5 75 1 buick century 17 6 231 110 3907 21 75 1 chevroelt chevelle malibu 16 6 250 105 3897 18.5 75 1 amc matador 15 6 258 110 3730 19 75 1 plymouth fury 18 6 225 95 3785 19 75 1 buick skyhawk 21 6 231 110 3039 15 75 1 chevrolet monza 2+2 20 8 262 110 3221 13.5 75 1 ford mustang ii 13 8 302 129 3169 12 75 1 toyota corolla 29 4 97 75 2171 16 75 3 ford pinto 23 4 140 83 2639 17 75 1 amc gremlin 20 6 232 100 2914 16 75 1 pontiac astro 23 4 140 78 2592 18.5 75 1 toyota corona 24 4 134 96 2702 13.5 75 3 volkswagen dasher 25 4 90 71 2223 16.5 75 2 datsun 710 24 4 119 97 2545 17 75 3 ford pinto 18 6 171 97 2984 14.5 75 1 volkswagen rabbit 29 4 90 70 1937 14 75 2 amc pacer 19 6 232 90 3211 17 75 1 audi 100ls 23 4 115 95 2694 15 75 2 peugeot 504 23 4 120 88 2957 17 75 2 volvo 244dl 22 4 121 98 2945 14.5 75 2 saab 99le 25 4 121 115 2671 13.5 75 2 honda civic cvcc 33 4 91 53 1795 17.5 75 3 fiat 131 28 4 107 86 2464 15.5 76 2 opel 1900 25 4 116 81 2220 16.9 76 2 capri ii 25 4 140 92 2572 14.9 76 1 dodge colt 26 4 98 79 2255 17.7 76 1 renault 12tl 27 4 101 83 2202 15.3 76 2 chevrolet chevelle malibu classic 17.5 8 305 140 4215 13 76 1 dodge coronet brougham 16 8 318 150 4190 13 76 1 amc matador 15.5 8 304 120 3962 13.9 76 1 ford gran torino 14.5 8 351 152 4215 12.8 76 1 plymouth valiant 22 6 225 100 3233 15.4 76 1 chevrolet nova 22 6 250 105 3353 14.5 76 1 ford maverick 24 6 200 81 3012 17.6 76 1 amc hornet 22.5 6 232 90 3085 17.6 76 1 chevrolet chevette 29 4 85 52 2035 22.2 76 1 chevrolet woody 24.5 4 98 60 2164 22.1 76 1 vw rabbit 29 4 90 70 1937 14.2 76 2 honda civic 33 4 91 53 1795 17.4 76 3 dodge aspen se 20 6 225 100 3651 17.7 76 1 ford granada ghia 18 6 250 78 3574 21 76 1 pontiac ventura sj 18.5 6 250 110 3645 16.2 76 1 amc pacer d/l 17.5 6 258 95 3193 17.8 76 1 volkswagen rabbit 29.5 4 97 71 1825 12.2 76 2 datsun b-210 32 4 85 70 1990 17 76 3 toyota corolla 28 4 97 75 2155 16.4 76 3 ford pinto 26.5 4 140 72 2565 13.6 76 1 volvo 245 20 4 130 102 3150 15.7 76 2 plymouth volare premier v8 13 8 318 150 3940 13.2 76 1 peugeot 504 19 4 120 88 3270 21.9 76 2 toyota mark ii 19 6 156 108 2930 15.5 76 3 mercedes-benz 280s 16.5 6 168 120 3820 16.7 76 2 cadillac seville 16.5 8 350 180 4380 12.1 76 1 chevy c10 13 8 350 145 4055 12 76 1 ford f108 13 8 302 130 3870 15 76 1 dodge d100 13 8 318 150 3755 14 76 1 honda accord cvcc 31.5 4 98 68 2045 18.5 77 3 buick opel isuzu deluxe 30 4 111 80 2155 14.8 77 1 renault 5 gtl 36 4 79 58 1825 18.6 77 2 plymouth arrow gs 25.5 4 122 96 2300 15.5 77 1 datsun f-10 hatchback 33.5 4 85 70 1945 16.8 77 3 chevrolet caprice classic 17.5 8 305 145 3880 12.5 77 1 oldsmobile cutlass supreme 17 8 260 110 4060 19 77 1 dodge monaco brougham 15.5 8 318 145 4140 13.7 77 1 mercury cougar brougham 15 8 302 130 4295 14.9 77 1 chevrolet concours 17.5 6 250 110 3520 16.4 77 1 buick skylark 20.5 6 231 105 3425 16.9 77 1 plymouth volare custom 19 6 225 100 3630 17.7 77 1 ford granada 18.5 6 250 98 3525 19 77 1 pontiac grand prix lj 16 8 400 180 4220 11.1 77 1 chevrolet monte carlo landau 15.5 8 350 170 4165 11.4 77 1 chrysler cordoba 15.5 8 400 190 4325 12.2 77 1 ford thunderbird 16 8 351 149 4335 14.5 77 1 volkswagen rabbit custom 29 4 97 78 1940 14.5 77 2 pontiac sunbird coupe 24.5 4 151 88 2740 16 77 1 toyota corolla liftback 26 4 97 75 2265 18.2 77 3 ford mustang ii 2+2 25.5 4 140 89 2755 15.8 77 1 chevrolet chevette 30.5 4 98 63 2051 17 77 1 dodge colt m/m 33.5 4 98 83 2075 15.9 77 1 subaru dl 30 4 97 67 1985 16.4 77 3 volkswagen dasher 30.5 4 97 78 2190 14.1 77 2 datsun 810 22 6 146 97 2815 14.5 77 3 bmw 320i 21.5 4 121 110 2600 12.8 77 2 mazda rx-4 21.5 3 80 110 2720 13.5 77 3 volkswagen rabbit custom diesel 43.1 4 90 48 1985 21.5 78 2 ford fiesta 36.1 4 98 66 1800 14.4 78 1 mazda glc deluxe 32.8 4 78 52 1985 19.4 78 3 datsun b210 gx 39.4 4 85 70 2070 18.6 78 3 honda civic cvcc 36.1 4 91 60 1800 16.4 78 3 oldsmobile cutlass salon brougham 19.9 8 260 110 3365 15.5 78 1 dodge diplomat 19.4 8 318 140 3735 13.2 78 1 mercury monarch ghia 20.2 8 302 139 3570 12.8 78 1 pontiac phoenix lj 19.2 6 231 105 3535 19.2 78 1 chevrolet malibu 20.5 6 200 95 3155 18.2 78 1 ford fairmont (auto) 20.2 6 200 85 2965 15.8 78 1 ford fairmont (man) 25.1 4 140 88 2720 15.4 78 1 plymouth volare 20.5 6 225 100 3430 17.2 78 1 amc concord 19.4 6 232 90 3210 17.2 78 1 buick century special 20.6 6 231 105 3380 15.8 78 1 mercury zephyr 20.8 6 200 85 3070 16.7 78 1 dodge aspen 18.6 6 225 110 3620 18.7 78 1 amc concord d/l 18.1 6 258 120 3410 15.1 78 1 chevrolet monte carlo landau 19.2 8 305 145 3425 13.2 78 1 buick regal sport coupe (turbo) 17.7 6 231 165 3445 13.4 78 1 ford futura 18.1 8 302 139 3205 11.2 78 1 dodge magnum xe 17.5 8 318 140 4080 13.7 78 1 chevrolet chevette 30 4 98 68 2155 16.5 78 1 toyota corona 27.5 4 134 95 2560 14.2 78 3 datsun 510 27.2 4 119 97 2300 14.7 78 3 dodge omni 30.9 4 105 75 2230 14.5 78 1 toyota celica gt liftback 21.1 4 134 95 2515 14.8 78 3 plymouth sapporo 23.2 4 156 105 2745 16.7 78 1 oldsmobile starfire sx 23.8 4 151 85 2855 17.6 78 1 datsun 200-sx 23.9 4 119 97 2405 14.9 78 3 audi 5000 20.3 5 131 103 2830 15.9 78 2 volvo 264gl 17 6 163 125 3140 13.6 78 2 saab 99gle 21.6 4 121 115 2795 15.7 78 2 peugeot 604sl 16.2 6 163 133 3410 15.8 78 2 volkswagen scirocco 31.5 4 89 71 1990 14.9 78 2 honda accord lx 29.5 4 98 68 2135 16.6 78 3 pontiac lemans v6 21.5 6 231 115 3245 15.4 79 1 mercury zephyr 6 19.8 6 200 85 2990 18.2 79 1 ford fairmont 4 22.3 4 140 88 2890 17.3 79 1 amc concord dl 6 20.2 6 232 90 3265 18.2 79 1 dodge aspen 6 20.6 6 225 110 3360 16.6 79 1 chevrolet caprice classic 17 8 305 130 3840 15.4 79 1 ford ltd landau 17.6 8 302 129 3725 13.4 79 1 mercury grand marquis 16.5 8 351 138 3955 13.2 79 1 dodge st. regis 18.2 8 318 135 3830 15.2 79 1 buick estate wagon (sw) 16.9 8 350 155 4360 14.9 79 1 ford country squire (sw) 15.5 8 351 142 4054 14.3 79 1 chevrolet malibu classic (sw) 19.2 8 267 125 3605 15 79 1 chrysler lebaron town @ country (sw) 18.5 8 360 150 3940 13 79 1 vw rabbit custom 31.9 4 89 71 1925 14 79 2 maxda glc deluxe 34.1 4 86 65 1975 15.2 79 3 dodge colt hatchback custom 35.7 4 98 80 1915 14.4 79 1 amc spirit dl 27.4 4 121 80 2670 15 79 1 mercedes benz 300d 25.4 5 183 77 3530 20.1 79 2 cadillac eldorado 23 8 350 125 3900 17.4 79 1 peugeot 504 27.2 4 141 71 3190 24.8 79 2 oldsmobile cutlass salon brougham 23.9 8 260 90 3420 22.2 79 1 plymouth horizon 34.2 4 105 70 2200 13.2 79 1 plymouth horizon tc3 34.5 4 105 70 2150 14.9 79 1 datsun 210 31.8 4 85 65 2020 19.2 79 3 fiat strada custom 37.3 4 91 69 2130 14.7 79 2 buick skylark limited 28.4 4 151 90 2670 16 79 1 chevrolet citation 28.8 6 173 115 2595 11.3 79 1 oldsmobile omega brougham 26.8 6 173 115 2700 12.9 79 1 pontiac phoenix 33.5 4 151 90 2556 13.2 79 1 vw rabbit 41.5 4 98 76 2144 14.7 80 2 toyota corolla tercel 38.1 4 89 60 1968 18.8 80 3 chevrolet chevette 32.1 4 98 70 2120 15.5 80 1 datsun 310 37.2 4 86 65 2019 16.4 80 3 chevrolet citation 28 4 151 90 2678 16.5 80 1 ford fairmont 26.4 4 140 88 2870 18.1 80 1 amc concord 24.3 4 151 90 3003 20.1 80 1 dodge aspen 19.1 6 225 90 3381 18.7 80 1 audi 4000 34.3 4 97 78 2188 15.8 80 2 toyota corona liftback 29.8 4 134 90 2711 15.5 80 3 mazda 626 31.3 4 120 75 2542 17.5 80 3 datsun 510 hatchback 37 4 119 92 2434 15 80 3 toyota corolla 32.2 4 108 75 2265 15.2 80 3 mazda glc 46.6 4 86 65 2110 17.9 80 3 dodge colt 27.9 4 156 105 2800 14.4 80 1 datsun 210 40.8 4 85 65 2110 19.2 80 3 vw rabbit c (diesel) 44.3 4 90 48 2085 21.7 80 2 vw dasher (diesel) 43.4 4 90 48 2335 23.7 80 2 audi 5000s (diesel) 36.4 5 121 67 2950 19.9 80 2 mercedes-benz 240d 30 4 146 67 3250 21.8 80 2 honda civic 1500 gl 44.6 4 91 67 1850 13.8 80 3 renault lecar deluxe 40.9 4 85 NA 1835 17.3 80 2 subaru dl 33.8 4 97 67 2145 18 80 3 vokswagen rabbit 29.8 4 89 62 1845 15.3 80 2 datsun 280-zx 32.7 6 168 132 2910 11.4 80 3 mazda rx-7 gs 23.7 3 70 100 2420 12.5 80 3 triumph tr7 coupe 35 4 122 88 2500 15.1 80 2 ford mustang cobra 23.6 4 140 NA 2905 14.3 80 1 honda accord 32.4 4 107 72 2290 17 80 3 plymouth reliant 27.2 4 135 84 2490 15.7 81 1 buick skylark 26.6 4 151 84 2635 16.4 81 1 dodge aries wagon (sw) 25.8 4 156 92 2620 14.4 81 1 chevrolet citation 23.5 6 173 110 2725 12.6 81 1 plymouth reliant 30 4 135 84 2385 12.9 81 1 toyota starlet 39.1 4 79 58 1755 16.9 81 3 plymouth champ 39 4 86 64 1875 16.4 81 1 honda civic 1300 35.1 4 81 60 1760 16.1 81 3 subaru 32.3 4 97 67 2065 17.8 81 3 datsun 210 mpg 37 4 85 65 1975 19.4 81 3 toyota tercel 37.7 4 89 62 2050 17.3 81 3 mazda glc 4 34.1 4 91 68 1985 16 81 3 plymouth horizon 4 34.7 4 105 63 2215 14.9 81 1 ford escort 4w 34.4 4 98 65 2045 16.2 81 1 ford escort 2h 29.9 4 98 65 2380 20.7 81 1 volkswagen jetta 33 4 105 74 2190 14.2 81 2 renault 18i 34.5 4 100 NA 2320 15.8 81 2 honda prelude 33.7 4 107 75 2210 14.4 81 3 toyota corolla 32.4 4 108 75 2350 16.8 81 3 datsun 200sx 32.9 4 119 100 2615 14.8 81 3 mazda 626 31.6 4 120 74 2635 18.3 81 3 peugeot 505s turbo diesel 28.1 4 141 80 3230 20.4 81 2 saab 900s NA 4 121 110 2800 15.4 81 2 volvo diesel 30.7 6 145 76 3160 19.6 81 2 toyota cressida 25.4 6 168 116 2900 12.6 81 3 datsun 810 maxima 24.2 6 146 120 2930 13.8 81 3 buick century 22.4 6 231 110 3415 15.8 81 1 oldsmobile cutlass ls 26.6 8 350 105 3725 19 81 1 ford granada gl 20.2 6 200 88 3060 17.1 81 1 chrysler lebaron salon 17.6 6 225 85 3465 16.6 81 1 chevrolet cavalier 28 4 112 88 2605 19.6 82 1 chevrolet cavalier wagon 27 4 112 88 2640 18.6 82 1 chevrolet cavalier 2-door 34 4 112 88 2395 18 82 1 pontiac j2000 se hatchback 31 4 112 85 2575 16.2 82 1 dodge aries se 29 4 135 84 2525 16 82 1 pontiac phoenix 27 4 151 90 2735 18 82 1 ford fairmont futura 24 4 140 92 2865 16.4 82 1 amc concord dl 23 4 151 NA 3035 20.5 82 1 volkswagen rabbit l 36 4 105 74 1980 15.3 82 2 mazda glc custom l 37 4 91 68 2025 18.2 82 3 mazda glc custom 31 4 91 68 1970 17.6 82 3 plymouth horizon miser 38 4 105 63 2125 14.7 82 1 mercury lynx l 36 4 98 70 2125 17.3 82 1 nissan stanza xe 36 4 120 88 2160 14.5 82 3 honda accord 36 4 107 75 2205 14.5 82 3 toyota corolla 34 4 108 70 2245 16.9 82 3 honda civic 38 4 91 67 1965 15 82 3 honda civic (auto) 32 4 91 67 1965 15.7 82 3 datsun 310 gx 38 4 91 67 1995 16.2 82 3 buick century limited 25 6 181 110 2945 16.4 82 1 oldsmobile cutlass ciera (diesel) 38 6 262 85 3015 17 82 1 chrysler lebaron medallion 26 4 156 92 2585 14.5 82 1 ford granada l 22 6 232 112 2835 14.7 82 1 toyota celica gt 32 4 144 96 2665 13.9 82 3 dodge charger 2.2 36 4 135 84 2370 13 82 1 chevrolet camaro 27 4 151 90 2950 17.3 82 1 ford mustang gl 27 4 140 86 2790 15.6 82 1 vw pickup 44 4 97 52 2130 24.6 82 2 dodge rampage 32 4 135 84 2295 11.6 82 1 ford ranger 28 4 120 79 2625 18.6 82 1 chevy s-10 31 4 119 82 2720 19.4 82 1 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_07/Ex_07.pde deleted file mode 100755 index 7ba6b82cb..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_07/Ex_07.pde +++ /dev/null @@ -1,30 +0,0 @@ -String[] lines = loadStrings("2895.txt"); -int totalCount = 0; // Total word count for entire book -boolean started = false; // Ignore lines until the *** START line - -for (int i = 0; i < lines.length; i++) { - if (lines[i].startsWith("*** START")) { // Start parsing text - started = true; - } else if (lines[i].startsWith("*** END")) { // Stop parsing text - started = false; - } else if (started == true) { // If we're in the useful region - // List of characters and punctuation to ignore between - // letters. WHITESPACE is all the whitespace characters - String separators = WHITESPACE + ",;.:?()\"-"; - // Split the line anywhere that we see one or more of - // these separators - String[] words = splitTokens(lines[i], separators); - // Add this number to the total - totalCount += words.length; - // Go through the list of words on the line - for (int j = 0; j < words.length; j++) { - String word = words[j].toLowerCase(); - if (word.length() > 10) { - println(word); // Print word if longer than ten letters - } - } - } -} - -// How many words are in the entire book? -println("This book has " + totalCount + " total words."); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_07/data/2895.txt b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_07/data/2895.txt deleted file mode 100755 index aae7d4327..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_07/data/2895.txt +++ /dev/null @@ -1,19485 +0,0 @@ -The Project Gutenberg EBook of Following the Equator, Complete -by Mark Twain (Samuel Clemens) - -This eBook is for the use of anyone anywhere at no cost and with -almost no restrictions whatsoever. You may copy it, give it away or -re-use it under the terms of the Project Gutenberg License included -with this eBook or online at www.gutenberg.net - - -Title: Following the Equator, Complete - -Author: Mark Twain (Samuel Clemens) - -Release Date: June 24, 2004 [EBook #2895] - -Language: English - -Character set encoding: ASCII - -*** START OF THIS PROJECT GUTENBERG EBOOK FOLLOWING THE EQUATOR, COMPLETE *** - - - - -Produced by David Widger - - - - - - FOLLOWING - THE EQUATOR - A JOURNEY AROUND THE WORLD - BY - MARK TWAIN - SAMUEL L. CLEMENS - HARTFORD, CONNECTICUT - - - - - THIS BOOK - Is affectionately inscribed to - MY YOUNG FRIEND - HARRY ROGERS - WITH RECOGNITION - OF WHAT HE IS, AND APPREHENSION OF WHAT HE MAY BECOME - UNLESS HE FORM HIMSELF A LITTLE MORE CLOSELY - UPON THE MODEL OF - THE AUTHOR. - - - - - - THE PUDD'NHEAD MAXIMS. - THESE WISDOMS ARE FOR THE LURING OF YOUTH TOWARD - HIGH MORAL ALTITUDES. THE AUTHOR DID NOT - GATHER THEM FROM PRACTICE, BUT FROM - OBSERVATION. TO BE GOOD IS NOBLE; - BUT TO SHOW OTHERS HOW - TO BE GOOD IS NOBLER - AND NO TROUBLE. - - - - - CONTENTS - -CHAPTER I. -The Party--Across America to Vancouver--On Board the Warrimo--Steamer -Chairs-The Captain-Going Home under a Cloud--A Gritty Purser--The -Brightest Passenger--Remedy for Bad Habits--The Doctor and the Lumbago ---A Moral Pauper--Limited Smoking--Remittance-men. - - -CHAPTER II. -Change of Costume--Fish, Snake, and Boomerang Stories--Tests of Memory ---A Brahmin Expert--General Grant's Memory--A Delicately Improper Tale - - -CHAPTER III. -Honolulu--Reminiscences of the Sandwich Islands--King Liholiho and His -Royal Equipment--The Tabu--The Population of the Island--A Kanaka Diver ---Cholera at Honolulu--Honolulu; Past and Present--The Leper Colony - - -CHAPTER IV. -Leaving Honolulu--Flying-fish--Approaching the Equator--Why the Ship Went -Slow--The Front Yard of the Ship--Crossing the Equator--Horse Billiards -or Shovel Board--The Waterbury Watch--Washing Decks--Ship Painters--The -Great Meridian--The Loss of a Day--A Babe without a Birthday - - -CHAPTER V. -A lesson in Pronunciation--Reverence for Robert Burns--The Southern -Cross--Troublesome Constellations--Victoria for a Name--Islands on the -Map--Alofa and Fortuna--Recruiting for the Queensland Plantations ---Captain Warren's NoteBook--Recruiting not thoroughly Popular - - -CHAPTER VI. -Missionaries Obstruct Business--The Sugar Planter and the Kanaka--The -Planter's View--Civilizing the Kanaka The Missionary's View--The Result ---Repentant Kanakas--Wrinkles--The Death Rate in Queensland - - -CHAPTER VII. -The Fiji Islands--Suva--The Ship from Duluth--Going Ashore--Midwinter in -Fiji--Seeing the Governor--Why Fiji was Ceded to England--Old time -Fijians--Convicts among the Fijians--A Case Where Marriage was a Failure -Immortality with Limitations - - -CHAPTER VIII. -A Wilderness of Islands--Two Men without a Country--A Naturalist from New -Zealand--The Fauna of Australasia--Animals, Insects, and Birds--The -Ornithorhynchus--Poetry and Plagiarism - - -CHAPTER IX. - -Close to Australia--Porpoises at Night--Entrance to Sydney Harbor--The -Loss of the Duncan Dunbar--The Harbor--The City of Sydney--Spring-time in -Australia--The Climate--Information for Travelers--The Size of Australia ---A Dust-Storm and Hot Wind - - -CHAPTER X. -The Discovery of Australia--Transportation of Convicts--Discipline ---English Laws, Ancient and Modern--Flogging Prisoners to Death--Arrival of -Settlers--New South Wales Corps--Rum Currency--Intemperance Everywhere -$100,000 for One Gallon of Rum--Development of the Country--Immense -Resources - - -CHAPTER XI. -Hospitality of English-speaking People--Writers and their Gratitude--Mr. -Gane and the Panegyrics--Population of Sydney An English City with -American Trimming--"Squatters"--Palaces and Sheep Kingdoms--Wool and -Mutton--Australians and Americans--Costermonger Pronunciation--England is -"Home"--Table Talk--English and Colonial Audiences 124 - - -CHAPTER XII. -Mr. X., a Missionary--Why Christianity Makes Slow Progress in India--A -Large Dream--Hindoo Miracles and Legends--Sampson and Hanuman--The -Sandstone Ridge--Where are the Gates? - - -CHAPTER XIII. -Public Works in Australasia--Botanical Garden of Sydney--Four Special -Socialties--The Government House--A Governor and His Functions--The -Admiralty House--The Tour of the Harbor--Shark Fishing--Cecil Rhodes' -Shark and his First Fortune--Free Board for Sharks. - - -CHAPTER XIV. -Bad Health--To Melbourne by Rail--Maps Defective--The Colony of Victoria ---A Round-trip Ticket from Sydney--Change Cars, from Wide to Narrow -Gauge, a Peculiarity at Albury--Customs-fences--"My Word"--The Blue -Mountains--Rabbit Piles--Government R. R. Restaurants--Duchesses for -Waiters--"Sheep-dip"--Railroad Coffee--Things Seen and Not Seen - - -CHAPTER XV. -Wagga-Wagga--The Tichborne Claimant--A Stock Mystery--The Plan of the -Romance--The Realization--The Henry Bascom Mystery--Bascom Hall--The -Author's Death and Funeral - - -CHAPTER XVI. -Melbourne and its Attractions--The Melbourne Cup Races--Cup Day--Great -Crowds--Clothes Regardless of Cost--The Australian Larrikin--Is He Dead? -Australian Hospitality--Melbourne Wool-brokers--The Museums--The Palaces ---The Origin of Melbourne - - -CHAPTER XVII. -The British Empire--Its Exports and Imports--The Trade of Australia--To -Adelaide--Broken Hill Silver Mine--A Roundabout road--The Scrub and its -Possibilities for the Novelist--The Aboriginal Tracker--A Test Case--How -Does One Cow-Track Differ from Another? - - -CHAPTER XVIII. -Gum Trees--Unsociable Trees--Gorse and Broom--A universal Defect--An -Adventurer--Wanted L200, got L20,000,000--A Vast Land Scheme--The -Smash-up--The Corpse Got Up and Danced--A Unique Business by One Man ---Buying the Kangaroo Skin--The Approach to Adelaide--Everything Comes to -Him who Waits--A Healthy Religious sphere--What is the Matter with the -Specter? - - -CHAPTER XIX. - -The Botanical Gardens--Contributions from all Countries--The -Zoological Gardens of Adelaide--The Laughing Jackass--The Dingo--A -Misnamed Province--Telegraphing from Melbourne to San Francisco--A Mania -for Holidays--The Temperature--The Death Rate--Celebration of the -Reading of the Proclamation of 1836--Some old Settlers at the -Commemoration--Their Staying Powers--The Intelligence of the Aboriginal ---The Antiquity of the Boomerang - - -CHAPTER XX. -A Caller--A Talk about Old Times--The Fox Hunt--An Accurate Judgment of -an Idiot--How We Passed the Custom Officers in Italy - - -CHAPTER XXI. -The "Weet-Weet"--Keeping down the Population--Victoria--Killing the -Aboriginals--Pioneer Days in Queensland--Material for a Drama--The Bush ---Pudding with Arsenic Revenge--A Right Spirit but a Wrong Method--Death of -Donga Billy - - -CHAPTER XXII. -Continued Description of Aboriginals--Manly Qualities--Dodging Balls ---Feats of Spring--Jumping--Where the Kangaroo Learned its Art 'Well -Digging--Endurance--Surgery--Artistic Abilities--Fennimore Cooper's Last -Chance--Australian Slang - - -CHAPTER XXIII. -To Horsham (Colony of Victoria)--Description of Horsham--At the Hotel ---Pepper Tree-The Agricultural College, Forty Pupils--High Temperature ---Width of Road in Chains, Perches, etc.--The Bird with a Forgettable -Name--The Magpie and the Lady--Fruit Trees--Soils--Sheep Shearing--To Stawell ---Gold Mining Country--$75,000 per Month Income and able to Keep House ---Fine Grapes and Wine--The Dryest Community on Earth--The Three Sisters ---Gum Trees and Water - - -CHAPTER XXIV. - -Road to Ballarat--The City--Great Gold Strike, 1851--Rush for Australia ---"Great Nuggets"--Taxation--Revolt and Victory--Peter Lalor and the -Eureka Stockade--"Pencil Mark"--Fine Statuary at Ballarat--Population ---Ballarat English - - -CHAPTER XXV. -Bound for Bendigo--The Priest at Castlemaine--Time Saved by Walking ---Description of Bendigo--A Valuable Nugget--Perseverence and Success ---Mr. Blank and His Influence--Conveyance of an Idea--I Had to Like the -Irishman--Corrigan Castle, and the Mark Twain Club--My Bascom Mystery -Solved - - -CHAPTER XXVI. -Where New Zealand Is--But Few Know--Things People Think They Know--The -Yale Professor and His Visitor from N. Z. - - -CHAPTER XXVII. -The South Pole Swell--Tasmania--Extermination of the Natives--The Picture -Proclamation--The Conciliator--The Formidable Sixteen - - -CHAPTER XXVIII. -When the Moment Comes the Man Appears--Why Ed. Jackson called on -Commodore Vanderbilt--Their Interview--Welcome to the Child of His Friend ---A Big Time but under Inspection--Sent on Important Business--A Visit to -the Boys on the Boat - - -CHAPTER XXIX: -Tasmania, Early Days--Description of the Town of Hobart--An Englishman's -Love of Home Surroundings--Neatest City on Earth--The Museum--A Parrot -with an Acquired Taste--Glass Arrow Beads--Refuge for the Indigent too -healthy - - -CHAPTER XXX. -Arrival at Bluff, N. Z.--Where the Rabbit Plague Began--The Natural Enemy -of the Rabbit--Dunedin--A Lovely Town--Visit to Dr. Hockin--His Museum ---A Liquified Caterpillar--The Unperfected Tape Worm--The Public Museum and -Picture - - -CHAPTER XXXI. The Express Train--"A Hell of a Hotel at Maryborough" ---Clocks and Bells--Railroad Service. - - -CHAPTER XXXII. -Description of the Town of Christ Church--A Fine Museum--Jade-stone -Trinkets--The Great Man--The First Maori in New Zealand--Women Voters ---"Person" in New Zealand Law Includes Woman--Taming an Ornithorhynchus ---A Voyage in the 'Flora' from Lyttelton--Cattle Stalls for Everybody ---A Wonderful Time. - - -CHAPTER XXXIII. -The Town of Nelson--"The Mongatapu Murders," the Great Event of the Town ---Burgess' Confession--Summit of Mount Eden--Rotorua and the Hot Lakes -and Geysers--Thermal Springs District--Kauri Gum--Tangariwa Mountains - - -CHAPTER XXXIV. -The Bay of Gisborne--Taking in Passengers by the Yard Arm--The Green -Ballarat Fly--False Teeth--From Napier to Hastings by the Ballarat Fly -Train--Kauri Trees--A Case of Mental Telegraphy - - -CHAPTER XXXV. -Fifty Miles in Four Hours--Comfortable Cars--Town of Wauganui--Plenty of -Maoris--On the Increase--Compliments to the Maoris--The Missionary Ways -all Wrong--The Tabu among the Maoris--A Mysterious Sign--Curious -War-monuments--Wellington - - -CHAPTER XXXVI. -The Poems of Mrs. Moore--The Sad Fate of William Upson--A Fellow Traveler -Imitating the Prince of Wales--A Would-be Dude--Arrival at Sydney ---Curious Town Names with Poem - - -CHAPTER XXXVII. -From Sydney for Ceylon--A Lascar Crew--A Fine Ship--Three Cats and a -Basket of Kittens--Dinner Conversations--Veuve Cliquot Wine--At Anchor in -King George's Sound Albany Harbor--More Cats--A Vulture on Board--Nearing -the Equator again--Dressing for Dinner--Ceylon, Hotel Bristol--Servant -Brampy--A Feminine Man--Japanese Jinriksha or Cart--Scenes in Ceylon--A -Missionary School--Insincerity of Clothes - - -CHAPTER XXXVIII. -Steamer Rosettes to Bombay--Limes 14 cents a Barrel--Bombay, a Bewitching -City--Descriptions of People and Dress--Woman as a Road Decoration ---India, the Land of Dreams and Romance--Fourteen Porters to Carry Baggage ---Correcting a Servant--Killing a Slave--Arranging a Bedroom--Three Hours' -Work and a Terrible Racket--The Bird of Birds, the Indian Crow - - -CHAPTER XXXIX. -God Vishnu, 108 Names--Change of Titles or Hunting for an Heir--Bombay as -a Kaleidoscope--The Native's Man Servant--Servants' Recommendations--How -Manuel got his Name and his English--Satan--A Visit from God - - -CHAPTER XL. -The Government House at Malabar Point--Mansion of Kumar Shri Samatsin Hji -Bahadur--The Indian Princess--A Difficult Game--Wardrobe and Jewels ---Ceremonials--Decorations when Leaving--The Towers of Silence--A Funeral - - -CHAPTER XLI. -Jain Temple--Mr. Roychand's Bungalow--A Decorated Six-Gun Prince--Human -Fireworks--European Dress, Past and Present--Complexions--Advantages with -the Zulu--Festivities at the Bungalow-Nautch Dancers--Entrance of the -Prince--Address to the Prince - - -CHAPTER XLII. -A Hindoo Betrothal, midnight, Sleepers on the ground, Home of the Bride -of Twelve Years Dressed as a Boy--Illumination Nautch Girls--Imitating -Snakes--Later--Illuminated Porch Filled with Sleepers--The Plague - - -CHAPTER XLIII -Murder Trial in Bombay--Confidence Swindlers--Some Specialities of India ---The Plague, Juggernaut, Suttee, etc.--Everything on Gigantic Scale ---India First in Everything--80 States, more Custom Houses than Cats--Rich -Ground for Thug Society - - -CHAPTER XLIV. -Thug Book--Supplies for Traveling, Bedding, and other Freight--Scene at -Railway Station--Making Way for White Man--Waiting Passengers, High and -Low Caste, Touch in the cars--Our Car--Beds made up--Dreaming of Thugs ---Baroda--Meet Friends--Indian Well--The Old Town--Narrow Streets--A Mad -Elephant - -CHAPTER XLV. - -Elephant Riding--Howdahs--The New Palace--The Prince's Excursion--Gold -and Silver Artillery--A Vice-royal Visit--Remarkable Dog--The Bench Show ---Augustin Daly's Back Door--Fakeer - - -CHAPTER XLVI. -The Thugs--Government Efforts to Exterminate them--Choking a Victim A -Fakeer Spared--Thief Strangled - - -CHAPTER XLVII. -Thugs, Continued--Record of Murders--A Joy of Hunting and Killing Men ---Gordon Gumming--Killing an Elephant--Family Affection among Thugs ---Burial Places - - -CHAPTER XLVIII. -Starting for Allahabad--Lower Berths in Sleepers--Elderly Ladies have -Preference of Berths--An American Lady Takes One Anyhow--How Smythe Lost -his Berth--How He Got Even--The Suttee - - -CHAPTER XLIX. -Pyjamas--Day Scene in India--Clothed in a Turban and a Pocket -Handkerchief--Land Parceled Out--Established Village Servants--Witches in -Families--Hereditary Midwifery--Destruction of Girl Babies--Wedding -Display--Tiger-Persuader--Hailstorm Discourages--The Tyranny of the -Sweeper--Elephant Driver--Water Carrier--Curious Rivers--Arrival at -Allahabad--English Quarter--Lecture Hall Like a Snowstorm--Private -Carriages--A Milliner--Early Morning--The Squatting Servant--A Religious -Fair - - -CHAPTER L. -On the Road to Benares--Dust and Waiting--The Bejeweled Crowd--A Native -Prince and his Guard--Zenana Lady--The Extremes of Fashion--The Hotel at -Benares--An Annex a Mile Away--Doors in India--The Peepul Tree--Warning -against Cold Baths--A Strange Fruit--Description of Benares--The -Beginning of Creation--Pilgrims to Benares--A Priest with a Good Business -Stand--Protestant Missionary--The Trinity Brahma, Shiva, and Vishnu ---Religion the Business at Benares - - -CHAPTER LI. -Benares a Religious Temple--A Guide for Pilgrims to Save Time in Securing -Salvation - - -CHAPTER LII. -A Curious Way to Secure Salvation--The Banks of the Ganges--Architecture -Represents Piety--A Trip on the River--Bathers and their Costumes ---Drinking the Water--A Scientific Test of the Nasty Purifier--Hindoo Faith -in the Ganges--A Cremation--Remembrances of the Suttee--All Life Sacred -Except Human Life--The Goddess Bhowanee, and the Sacrificers--Sacred -Monkeys--Ugly Idols Everywhere--Two White Minarets--A Great View with a -Monkey in it--A Picture on the Water - - -CHAPTER LIII. -Still in Benares--Another Living God--Why Things are Wonderful--Sri 108 -Utterly Perfect--How He Came so--Our Visit to Sri--A Friendly Deity -Exchanging Autographs and Books--Sri's Pupil--An Interesting Man ---Reverence and Irreverence--Dancing in a Sepulchre - - -CHAPTER LIV. -Rail to Calcutta--Population--The "City of Palaces"--A Fluted -Candle-stick--Ochterlony--Newspaper Correspondence--Average Knowledge of -Countries--A Wrong Idea of Chicago--Calcutta and the Black Hole ---Description of the Horrors--Those Who Lived--The Botanical Gardens--The -Afternoon Turnout--Grand Review--Military Tournament--Excursion on the -Hoogly--The Museum--What Winter Means Calcutta - - -CHAPTER LV -On the Road Again--Flannels in Order--Across Country--From Greenland's -Icy Mountain--Swapping Civilization--No Field women in India--How it is -in Other Countries--Canvas-covered Cars--The Tiger Country--My First Hunt -Some Elephants Get Away--The Plains of India--The Ghurkas--Women for -Pack-Horses--A Substitute for a Cab--Darjeeling--The Hotel--The Highest -Thing in the Himalayas--The Club--Kinchinjunga and Mt. Everest ---Thibetans--The Prayer Wheel--People Going to the Bazar - - -CHAPTER LVI. -On the Road Again--The Hand-Car--A Thirty-five-mile Slide--The Banyan -Tree--A Dramatic Performance--The Railroad--The Half-way House--The Brain -Fever Bird--The Coppersmith Bird--Nightingales and Cue Owls - - -CHAPTER LVII. -India the Most Extraordinary Country on Earth--Nothing Forgotten--The -Land of Wonders--Annual Statistics Everywhere about Violence--Tiger vs. -Man--A Handsome Fight--Annual Man Killing and Tiger Killing--Other -Animals--Snakes--Insurance and Snake Tables--The Cobra Bite--Muzaffurpore ---Dinapore--A Train that Stopped for Gossip--Six Hours for Thirty-five -Miles--A Rupee to the Engineer--Ninety Miles an Hour--Again to Benares, -the Piety Hive To Lucknow - - -CHAPTER LVIII. -The Great Mutiny--The Massacre in Cawnpore--Terrible Scenes in Lucknow ---The Residency--The Siege - - -CHAPTER LIX. -A Visit to the Residency--Cawnpore--The Adjutant Bird and the Hindoo -Corpse--The Tai Mahal--The True Conception--The Ice Storm--True Gems ---Syrian Fountains--An Exaggerated Niagara - - -CHAPTER LX. -To Lahore--The Governor's Elephant--Taking a Ride-No Danger from -Collision--Rawal Pindi--Back to Delhi--An Orientalized Englishman ---Monkeys and the Paint-pot--Monkey Crying over my Note-book--Arrival at -Jeypore--In Rajputana--Watching Servants--The Jeypore Hotel--Our Old and -New Satan--Satan as a Liar--The Museum--A Street Show--Blocks of Houses ---A Religious Procession - - -CHAPTER LXI. -Methods in American Deaf and Dumb Asylums--Methods in the Public Schools ---A Letter from a youth in Punjab--Highly Educated Service--A Damage to -the Country--A Little Book from Calcutta--Writing Poor English ---Embarrassed by a Beggar Girl--A Specimen Letter--An Application for -Employment--A Calcutta School Examination--Two Samples of -Literature - - -CHAPTER LXII. -Sail from Calcutta to Madras--Thence to Ceylon--Thence for Mauritius ---The Indian Ocean--Our Captain's Peculiarity The Scot Has one too--The -Flying-fish that Went Hunting in the Field--Fined for Smuggling--Lots of -pets on Board--The Color of the Sea--The Most Important Member of -Nature's Family--The Captain's Story of Cold Weather--Omissions in the -Ship's Library--Washing Decks--Pyjamas on Deck--The Cat's Toilet--No -Interest in the Bulletin--Perfect Rest--The Milky Way and the Magellan -Clouds--Mauritius--Port Louis--A Hot Country--Under French Control ---A Variety of People and Complexions--Train to Curepipe--A Wonderful -Office-holder--The Wooden Peg Ornament--The Prominent Historical Event of -Mauritius--"Paul and Virginia"--One of Virginia's Wedding Gifts--Heaven -Copied after Mauritius--Early History of Mauritius--Quarantines ---Population of all Kinds--What the World Consists of--Where Russia and -Germany are--A Picture of Milan Cathedral--Newspapers--The Language--Best -Sugar in the World--Literature of Mauritius - - -CHAPTER LXIII. -Port Louis--Matches no Good--Good Roads--Death Notices--Why European -Nations Rob Each Other--What Immigrants to Mauritius Do--Population ---Labor Wages--The Camaron--The Palmiste and other Eatables--Monkeys--The -Cyclone of 1892--Mauritius a Sunday Landscape - - -CHAPTER LXIV. -The Steamer "Arundel Castle"--Poor Beds in Ships--The Beds in Noah's Ark ---Getting a Rest in Europe--Ship in Sight--Mozambique Channel--The -Engineer and the Band--Thackeray's "Madagascar"--Africanders Going Home ---Singing on the After Deck--An Out-of-Place Story--Dynamite Explosion in -Johannesburg--Entering Delagoa Bay--Ashore--A Hot Winter--Small Town--No -Sights--No Carriages--Working Women--Barnum's Purchase of Shakespeare's -Birthplace, Jumbo, and the Nelson Monument--Arrival at Durban - - -CHAPTER LXV. -Royal Hotel Durban--Bells that Did not Ring--Early Inquiries for Comforts ---Change of Temperature after Sunset-Rickhaws--The Hotel Chameleon ---Natives not out after the Bell--Preponderance of Blacks in Natal--Hair -Fashions in Natal--Zulus for Police--A Drive round the Berea--The Cactus -and other Trees--Religion a Vital Matter--Peculiar Views about Babies ---Zulu Kings--A Trappist Monastery--Transvaal Politics--Reasons why the -Trouble came About - - -CHAPTER LXVI. -Jameson over the Border--His Defeat and Capture--Sent to England for -Trial--Arrest of Citizens by the Boers--Commuted sentences--Final Release -of all but Two--Interesting Days for a Stranger--Hard to Understand -Either Side--What the Reformers Expected to Accomplish--How They Proposed -to do it--Testimonies a Year Later--A "Woman's Part"--The Truth of the -South African Situation--"Jameson's Ride"--A Poem - - -CHAPTER LXVIL -Jameson's Raid--The Reform Committee's Difficult Task--Possible Plans ---Advice that Jameson Ought to Have--The War of 1881 and its Lessons ---Statistics of Losses of the Combatants--Jameson's Battles--Losses on Both -Sides--The Military Errors--How the Warfare Should Have Been Carried on -to Be Successful - - -CHAPTER LXVIII. -Judicious Mr. Rhodes--What South Africa Consists of--Johannesburg--The -Gold Mines--The Heaven of American Engineers--What the Author Knows about -Mining--Description of the Boer--What Should be Expected of Him--What Was -A Dizzy Jump for Rhodes--Taxes--Rhodesian Method of Reducing Native -Population--Journeying in Cape Colony--The Cars--The Country--The -Weather--Tamed Blacks--Familiar Figures in King William's Town--Boer -Dress--Boer Country Life--Sleeping Accommodations--The Reformers in Boer -Prison--Torturing a Black Prisoner - - -CHAPTER LXIX. -An Absorbing Novelty--The Kimberley Diamond Mines--Discovery of Diamonds ---The Wronged Stranger--Where the Gems Are--A Judicious Change of -Boundary--Modern Machinery and Appliances--Thrilling Excitement in -Finding a Diamond--Testing a Diamond--Fences--Deep Mining by Natives in -the Compound--Stealing--Reward for the Biggest Diamond--A Fortune in -Wine--The Great Diamond--Office of the De Beer Co.--Sorting the Gems ---Cape Town--The Most Imposing Man in British Provinces--Various Reasons -for his Supremacy--How He Makes Friends - - -CONCLUSION. -Table Rock--Table Bay--The Castle--Government and Parliament--The Club ---Dutch Mansions and their Hospitality--Dr. John Barry and his Doings--On -the Ship Norman--Madeira--Arrived in Southampton - - - - - - FOLLOWING THE EQUATOR - - -CHAPTER I. - -A man may have no bad habits and have worse. - --Pudd'nhead Wilson's New Calendar. - -The starting point of this lecturing-trip around the world was Paris, -where we had been living a year or two. - -We sailed for America, and there made certain preparations. This took -but little time. Two members of my family elected to go with me. Also a -carbuncle. The dictionary says a carbuncle is a kind of jewel. Humor is -out of place in a dictionary. - -We started westward from New York in midsummer, with Major Pond to manage -the platform-business as far as the Pacific. It was warm work, all the -way, and the last fortnight of it was suffocatingly smoky, for in Oregon -and Columbia the forest fires were raging. We had an added week of smoke -at the seaboard, where we were obliged awhile for our ship. She had been -getting herself ashore in the smoke, and she had to be docked and -repaired. - -We sailed at last; and so ended a snail-paced march across the continent, -which had lasted forty days. - -We moved westward about mid-afternoon over a rippled and summer sea; an -enticing sea, a clean and cool sea, and apparently a welcome sea to all -on board; it certainly was to the distressful dustings and smokings and -swelterings of the past weeks. The voyage would furnish a three-weeks -holiday, with hardly a break in it. We had the whole Pacific Ocean in -front of us, with nothing to do but do nothing and be comfortable. The -city of Victoria was twinkling dim in the deep heart of her smoke-cloud, -and getting ready to vanish and now we closed the field-glasses and sat -down on our steamer chairs contented and at peace. But they went to -wreck and ruin under us and brought us to shame before all the -passengers. They had been furnished by the largest furniture-dealing -house in Victoria, and were worth a couple of farthings a dozen, though -they had cost us the price of honest chairs. In the Pacific and Indian -Oceans one must still bring his own deck-chair on board or go without, -just as in the old forgotten Atlantic times--those Dark Ages of sea -travel. - -Ours was a reasonably comfortable ship, with the customary sea-going fare ---plenty of good food furnished by the Deity and cooked by the devil. -The discipline observable on board was perhaps as good as it is anywhere -in the Pacific and Indian Oceans. The ship was not very well arranged -for tropical service; but that is nothing, for this is the rule for ships -which ply in the tropics. She had an over-supply of cockroaches, but -this is also the rule with ships doing business in the summer seas--at -least such as have been long in service. Our young captain was a very -handsome man, tall and perfectly formed, the very figure to show up a -smart uniform's best effects. He was a man of the best intentions and -was polite and courteous even to courtliness. There was a soft and -finish about his manners which made whatever place he happened to be in -seem for the moment a drawing room. He avoided the smoking room. He had -no vices. He did not smoke or chew tobacco or take snuff; he did not -swear, or use slang or rude, or coarse, or indelicate language, or make -puns, or tell anecdotes, or laugh intemperately, or raise his voice above -the moderate pitch enjoined by the canons of good form. When he gave an -order, his manner modified it into a request. After dinner he and his -officers joined the ladies and gentlemen in the ladies' saloon, and -shared in the singing and piano playing, and helped turn the music. He -had a sweet and sympathetic tenor voice, and used it with taste and -effect the music he played whist there, always with the same partner and -opponents, until the ladies' bedtime. The electric lights burned there -as late as the ladies and their friends might desire; but they were not -allowed to burn in the smoking-room after eleven. There were many laws -on the ship's statute book of course; but so far as I could see, this and -one other were the only ones that were rigidly enforced. The captain -explained that he enforced this one because his own cabin adjoined the -smoking-room, and the smell of tobacco smoke made him sick. I did not -see how our smoke could reach him, for the smoking-room and his cabin -were on the upper deck, targets for all the winds that blew; and besides -there was no crack of communication between them, no opening of any sort -in the solid intervening bulkhead. Still, to a delicate stomach even -imaginary smoke can convey damage. - -The captain, with his gentle nature, his polish, his sweetness, his moral -and verbal purity, seemed pathetically out of place in his rude and -autocratic vocation. It seemed another instance of the irony of fate. - -He was going home under a cloud. The passengers knew about his trouble, -and were sorry for him. Approaching Vancouver through a narrow and -difficult passage densely befogged with smoke from the forest fires, he -had had the ill-luck to lose his bearings and get his ship on the rocks. -A matter like this would rank merely as an error with you and me; it -ranks as a crime with the directors of steamship companies. The captain -had been tried by the Admiralty Court at Vancouver, and its verdict had -acquitted him of blame. But that was insufficient comfort. A sterner -court would examine the case in Sydney--the Court of Directors, the lords -of a company in whose ships the captain had served as mate a number of -years. This was his first voyage as captain. - -The officers of our ship were hearty and companionable young men, and -they entered into the general amusements and helped the passengers pass -the time. Voyages in the Pacific and Indian Oceans are but pleasure -excursions for all hands. Our purser was a young Scotchman who was -equipped with a grit that was remarkable. He was an invalid, and looked -it, as far as his body was concerned, but illness could not subdue his -spirit. He was full of life, and had a gay and capable tongue. To all -appearances he was a sick man without being aware of it, for he did not -talk about his ailments, and his bearing and conduct were those of a -person in robust health; yet he was the prey, at intervals, of ghastly -sieges of pain in his heart. These lasted many hours, and while the -attack continued he could neither sit nor lie. In one instance he stood -on his feet twenty-four hours fighting for his life with these sharp -agonies, and yet was as full of life and cheer and activity -the next day as if nothing had happened. - -The brightest passenger in the ship, and the most interesting and -felicitous talker, was a young Canadian who was not able to let the -whisky bottle alone. He was of a rich and powerful family, and could have -had a distinguished career and abundance of effective help toward it if -he could have conquered his appetite for drink; but he could not do it, -so his great equipment of talent was of no use to him. He had often taken -the pledge to drink no more, and was a good sample of what that sort of -unwisdom can do for a man--for a man with anything short of an iron will. -The system is wrong in two ways: it does not strike at the root of the -trouble, for one thing, and to make a pledge of any kind is to declare -war against nature; for a pledge is a chain that is always clanking and -reminding the wearer of it that he is not a free man. - -I have said that the system does not strike at the root of the trouble, -and I venture to repeat that. The root is not the drinking, but the -desire to drink. These are very different things. The one merely -requires will--and a great deal of it, both as to bulk and staying -capacity--the other merely requires watchfulness--and for no long time. -The desire of course precedes the act, and should have one's first -attention; it can do but little good to refuse the act over and over -again, always leaving the desire unmolested, unconquered; the desire will -continue to assert itself, and will be almost sure to win in the long -run. When the desire intrudes, it should be at once banished out of the -mind. One should be on the watch for it all the time--otherwise it will -get in. It must be taken in time and not allowed to get a lodgment. A -desire constantly repulsed for a fortnight should die, then. That should -cure the drinking habit. The system of refusing the mere act of -drinking, and leaving the desire in full force, is unintelligent war -tactics, it seems to me. I used to take pledges--and soon violate them. -My will was not strong, and I could not help it. And then, to be tied in -any way naturally irks an otherwise free person and makes him chafe in -his bonds and want to get his liberty. But when I finally ceased from -taking definite pledges, and merely resolved that I would kill an -injurious desire, but leave myself free to resume the desire and the -habit whenever I should choose to do so, I had no more trouble. In five -days I drove out the desire to smoke and was not obliged to keep watch -after that; and I never experienced any strong desire to smoke again. At -the end of a year and a quarter of idleness I began to write a book, and -presently found that the pen was strangely reluctant to go. I tried a -smoke to see if that would help me out of the difficulty. It did. I -smoked eight or ten cigars and as many pipes a day for five months; -finished the book, and did not smoke again until a year had gone by and -another book had to be begun. - -I can quit any of my nineteen injurious habits at any time, and without -discomfort or inconvenience. I think that the Dr. Tanners and those -others who go forty days without eating do it by resolutely keeping out -the desire to eat, in the beginning, and that after a few hours the -desire is discouraged and comes no more. - -Once I tried my scheme in a large medical way. I had been confined to my -bed several days with lumbago. My case refused to improve. Finally the -doctor said,-- - -"My remedies have no fair chance. Consider what they have to fight, -besides the lumbago. You smoke extravagantly, don't you?" - -"Yes." - -"You take coffee immoderately?" - -"Yes." - -"And some tea?" - -"Yes." - -"You eat all kinds of things that are dissatisfied with each other's -company?" - -"Yes." - -"You drink two hot Scotches every night?" - -"Yes." - -"Very well, there you see what I have to contend against. We can't make -progress the way the matter stands. You must make a reduction in these -things; you must cut down your consumption of them considerably for some -days." - -"I can't, doctor." - -"Why can't you." - -"I lack the will-power. I can cut them off entirely, but I can't merely -moderate them." - -He said that that would answer, and said he would come around in -twenty-four hours and begin work again. He was taken ill himself and -could not come; but I did not need him. I cut off all those things for -two days and nights; in fact, I cut off all kinds of food, too, and all -drinks except water, and at the end of the forty-eight hours the lumbago -was discouraged and left me. I was a well man; so I gave thanks and took -to those delicacies again. - -It seemed a valuable medical course, and I recommended it to a lady. She -had run down and down and down, and had at last reached a point where -medicines no longer had any helpful effect upon her. I said I knew I -could put her upon her feet in a week. It brightened her up, it filled -her with hope, and she said she would do everything I told her to do. So -I said she must stop swearing and drinking, and smoking and eating for -four days, and then she would be all right again. And it would have -happened just so, I know it; but she said she could not stop swearing, -and smoking, and drinking, because she had never done those things. So -there it was. She had neglected her habits, and hadn't any. Now that -they would have come good, there were none in stock. She had nothing to -fall back on. She was a sinking vessel, with no freight in her to throw -over lighten ship withal. Why, even one or two little bad habits could -have saved her, but she was just a moral pauper. When she could have -acquired them she was dissuaded by her parents, who were ignorant people -though reared in the best society, and it was too late to begin now. It -seemed such a pity; but there was no help for it. These things ought to -be attended to while a person is young; otherwise, when age and disease -come, there is nothing effectual to fight them with. - -When I was a youth I used to take all kinds of pledges, and do my best to -keep them, but I never could, because I didn't strike at the root of the -habit--the desire; I generally broke down within the month. Once I tried -limiting a habit. That worked tolerably well for a while. I pledged -myself to smoke but one cigar a day. I kept the cigar waiting until -bedtime, then I had a luxurious time with it. But desire persecuted me -every day and all day long; so, within the week I found myself hunting -for larger cigars than I had been used to smoke; then larger ones still, -and still larger ones. Within the fortnight I was getting cigars made -for me--on a yet larger pattern. They still grew and grew in size. -Within the month my cigar had grown to such proportions that I could have -used it as a crutch. It now seemed to me that a one-cigar limit was no -real protection to a person, so I knocked my pledge on the head and -resumed my liberty. - -To go back to that young Canadian. He was a "remittance man," the first -one I had ever seen or heard of. Passengers explained the term to me. -They said that dissipated ne'er-do-wells belonging to important families -in England and Canada were not cast off by their people while there was -any hope of reforming them, but when that last hope perished at last, the -ne'er-do-well was sent abroad to get him out of the way. He was shipped -off with just enough money in his pocket--no, in the purser's pocket--for -the needs of the voyage--and when he reached his destined port he would -find a remittance awaiting him there. Not a large one, but just enough -to keep him a month. A similar remittance would come monthly thereafter. -It was the remittance-man's custom to pay his month's board and lodging -straightway--a duty which his landlord did not allow him to forget--then -spree away the rest of his money in a single night, then brood and mope -and grieve in idleness till the next remittance came. It is a pathetic -life. - -We had other remittance-men on board, it was said. At least they said -they were R. M.'s. There were two. But they did not resemble the -Canadian; they lacked his tidiness, and his brains, and his gentlemanly -ways, and his resolute spirit, and his humanities and generosities. One -of them was a lad of nineteen or twenty, and he was a good deal of a -ruin, as to clothes, and morals, and general aspect. He said he was a -scion of a ducal house in England, and had been shipped to Canada for the -house's relief, that he had fallen into trouble there, and was now being -shipped to Australia. He said he had no title. Beyond this remark he -was economical of the truth. The first thing he did in Australia was to -get into the lockup, and the next thing he did was to proclaim himself an -earl in the police court in the morning and fail to prove it. - - - - -CHAPTER II. - -When in doubt, tell the truth. - --Pudd'nhead Wilson's New Calendar. - -About four days out from Victoria we plunged into hot weather, and all -the male passengers put on white linen clothes. One or two days later we -crossed the 25th parallel of north latitude, and then, by order, the -officers of the ship laid away their blue uniforms and came out in white -linen ones. All the ladies were in white by this time. This prevalence -of snowy costumes gave the promenade deck an invitingly cool, and -cheerful and picnicky aspect. - -From my diary: - -There are several sorts of ills in the world from which a person can -never escape altogether, let him journey as far as he will. One escapes -from one breed of an ill only to encounter another breed of it. We have -come far from the snake liar and the fish liar, and there was rest and -peace in the thought; but now we have reached the realm of the boomerang -liar, and sorrow is with us once more. The first officer has seen a man -try to escape from his enemy by getting behind a tree; but the enemy sent -his boomerang sailing into the sky far above and beyond the tree; then it -turned, descended, and killed the man. The Australian passenger has seen -this thing done to two men, behind two trees--and by the one arrow. This -being received with a large silence that suggested doubt, he buttressed -it with the statement that his brother once saw the boomerang kill a bird -away off a hundred yards and bring it to the thrower. But these are ills -which must be borne. There is no other way. - -The talk passed from the boomerang to dreams--usually a fruitful subject, -afloat or ashore--but this time the output was poor. Then it passed to -instances of extraordinary memory--with better results. Blind Tom, the -negro pianist, was spoken of, and it was said that he could accurately -play any piece of music, howsoever long and difficult, after hearing it -once; and that six months later he could accurately play it again, -without having touched it in the interval. One of the most striking of -the stories told was furnished by a gentleman who had served on the staff -of the Viceroy of India. He read the details from his note-book, and -explained that he had written them down, right after the consummation of -the incident which they described, because he thought that if he did not -put them down in black and white he might presently come to think he had -dreamed them or invented them. - -The Viceroy was making a progress, and among the shows offered by the -Maharajah of Mysore for his entertainment was a memory-exhibition. -The Viceroy and thirty gentlemen of his suite sat in a row, and the -memory-expert, a high-caste Brahmin, was brought in and seated on the -floor in front of them. He said he knew but two languages, the English -and his own, but would not exclude any foreign tongue from the tests to -be applied to his memory. Then he laid before the assemblage his program ---a sufficiently extraordinary one. He proposed that one gentleman -should give him one word of a foreign sentence, and tell him its place in -the sentence. He was furnished with the French word 'est', and was told -it was second in a sentence of three words. The next, gentleman gave him -the German word 'verloren' and said it was the third in a sentence of -four words. He asked the next gentleman for one detail in a sum in -addition; another for one detail in a sum of subtraction; others for -single details in mathematical problems of various kinds; he got them. -Intermediates gave him single words from sentences in Greek, Latin, -Spanish, Portuguese, Italian, and other languages, and told him their -places in the sentences. When at last everybody had furnished him a -single rag from a foreign sentence or a figure from a problem, he went -over the ground again, and got a second word and a second figure and was -told their places in the sentences and the sums; and so on and so on. He -went over the ground again and again until he had collected all the parts -of the sums and all the parts of the sentences--and all in disorder, of -course, not in their proper rotation. This had occupied two hours. - -The Brahmin now sat silent and thinking, a while, then began and repeated -all the sentences, placing the words in their proper order, and untangled -the disordered arithmetical problems and gave accurate answers to them -all. - -In the beginning he had asked the company to throw almonds at him during -the two hours, he to remember how many each gentleman had thrown; but -none were thrown, for the Viceroy said that the test would be a -sufficiently severe strain without adding that burden to it. - -General Grant had a fine memory for all kinds of things, including even -names and faces, and I could have furnished an instance of it if I had -thought of it. The first time I ever saw him was early in his first term -as President. I had just arrived in Washington from the Pacific coast, a -stranger and wholly unknown to the public, and was passing the White -House one morning when I met a friend, a Senator from Nevada. He asked -me if I would like to see the President. I said I should be very glad; -so we entered. I supposed that the President would be in the midst of a -crowd, and that I could look at him in peace and security from a -distance, as another stray cat might look at another king. But it was in -the morning, and the Senator was using a privilege of his office which I -had not heard of--the privilege of intruding upon the Chief Magistrate's -working hours. Before I knew it, the Senator and I were in the presence, -and there was none there but we three. General Grant got slowly up from -his table, put his pen down, and stood before me with the iron expression -of a man who had not smiled for seven years, and was not intending to -smile for another seven. He looked me steadily in the eyes--mine lost -confidence and fell. I had never confronted a great man before, and was -in a miserable state of funk and inefficiency. The Senator said:-- - -"Mr. President, may I have the privilege of introducing Mr. Clemens?" - -The President gave my hand an unsympathetic wag and dropped it. He did -not say a word but just stood. In my trouble I could not think of -anything to say, I merely wanted to resign. There was an awkward pause, -a dreary pause, a horrible pause. Then I thought of something, and -looked up into that unyielding face, and said timidly:-- - -"Mr. President, I--I am embarrassed. Are you?" - -His face broke--just a little--a wee glimmer, the momentary flicker of a -summer-lightning smile, seven years ahead of time--and I was out and gone -as soon as it was. - -Ten years passed away before I saw him the second time. Meantime I was -become better known; and was one of the people appointed to respond to -toasts at the banquet given to General Grant in Chicago--by the Army of -the Tennessee when he came back from his tour around the world. I -arrived late at night and got up late in the morning. All the corridors -of the hotel were crowded with people waiting to get a glimpse of General -Grant when he should pass to the place whence he was to review the great -procession. I worked my way by the suite of packed drawing-rooms, and at -the corner of the house I found a window open where there was a roomy -platform decorated with flags, and carpeted. I stepped out on it, and -saw below me millions of people blocking all the streets, and other -millions caked together in all the windows and on all the house-tops -around. These masses took me for General Grant, and broke into volcanic -explosions and cheers; but it was a good place to see the procession, and -I stayed. Presently I heard the distant blare of military music, and far -up the street I saw the procession come in sight, cleaving its way -through the huzzaing multitudes, with Sheridan, the most martial -figure of the War, riding at its head in the dress uniform of a -Lieutenant-General. - -And now General Grant, arm-in-arm with Major Carter Harrison, stepped out -on the platform, followed two and two by the badged and uniformed -reception committee. General Grant was looking exactly as he had looked -upon that trying occasion of ten years before--all iron and bronze -self-possession. Mr. Harrison came over and led me to the General and -formally introduced me. Before I could put together the proper remark, -General Grant said-- - -"Mr. Clemens, I am not embarrassed. Are you?"--and that little -seven-year smile twinkled across his face again. - -Seventeen years have gone by since then, and to-day, in New York, the -streets are a crush of people who are there to honor the remains of the -great soldier as they pass to their final resting-place under the -monument; and the air is heavy with dirges and the boom of artillery, and -all the millions of America are thinking of the man who restored the -Union and the flag, and gave to democratic government a new lease of -life, and, as we may hope and do believe, a permanent place among the -beneficent institutions of men. - -We had one game in the ship which was a good time-passer--at least it was -at night in the smoking-room when the men were getting freshened up from -the day's monotonies and dullnesses. It was the completing of -non-complete stories. That is to say, a man would tell all of a story -except the finish, then the others would try to supply the ending out of -their own invention. When every one who wanted a chance had had it, the -man who had introduced the story would give it its original ending--then -you could take your choice. Sometimes the new endings turned out to be -better than the old one. But the story which called out the most -persistent and determined and ambitious effort was one which had no -ending, and so there was nothing to compare the new-made endings with. -The man who told it said he could furnish the particulars up to a certain -point only, because that was as much of the tale as he knew. He had read -it in a volume of `sketches twenty-five years ago, and was interrupted -before the end was reached. He would give any one fifty dollars who -would finish the story to the satisfaction of a jury to be appointed by -ourselves. We appointed a jury and wrestled with the tale. We invented -plenty of endings, but the jury voted them all down. The jury was right. -It was a tale which the author of it may possibly have completed -satisfactorily, and if he really had that good fortune I would like to -know what the ending was. Any ordinary man will find that the story's -strength is in its middle, and that there is apparently no way to -transfer it to the close, where of course it ought to be. In substance -the storiette was as follows: - -John Brown, aged thirty-one, good, gentle, bashful, timid, lived in a -quiet village in Missouri. He was superintendent of the Presbyterian -Sunday-school. It was but a humble distinction; still, it was his only -official one, and he was modestly proud of it and was devoted to its work -and its interests. The extreme kindliness of his nature was recognized -by all; in fact, people said that he was made entirely out of good -impulses and bashfulness; that he could always be counted upon for help -when it was needed, and for bashfulness both when it was needed and when -it wasn't. - -Mary Taylor, twenty-three, modest, sweet, winning, and in character and -person beautiful, was all in all to him. And he was very nearly all in -all to her. She was wavering, his hopes were high. Her mother had been -in opposition from the first. But she was wavering, too; he could -see it. She was being touched by his warm interest in her two -charity-proteges and by his contributions toward their support. These -were two forlorn and aged sisters who lived in a log hut in a lonely -place up a cross road four miles from Mrs. Taylor's farm. One of the -sisters was crazy, and sometimes a little violent, but not often. - -At last the time seemed ripe for a final advance, and Brown gathered his -courage together and resolved to make it. He would take along a -contribution of double the usual size, and win the mother over; with her -opposition annulled, the rest of the conquest would be sure and prompt. - -He took to the road in the middle of a placid Sunday afternoon in the -soft Missourian summer, and he was equipped properly for his mission. He -was clothed all in white linen, with a blue ribbon for a necktie, and he -had on dressy tight boots. His horse and buggy were the finest that the -livery stable could furnish. The lap robe was of white linen, it was -new, and it had a hand-worked border that could not be rivaled in that -region for beauty and elaboration. - -When he was four miles out on the lonely road and was walking his horse -over a wooden bridge, his straw hat blew off and fell in the creek, and -floated down and lodged against a bar. He did not quite know what to do. -He must have the hat, that was manifest; but how was he to get it? - -Then he had an idea. The roads were empty, nobody was stirring. Yes, he -would risk it. He led the horse to the roadside and set it to cropping -the grass; then he undressed and put his clothes in the buggy, petted the -horse a moment to secure its compassion and its loyalty, then hurried to -the stream. He swam out and soon had the hat. When he got to the top of -the bank the horse was gone! - -His legs almost gave way under him. The horse was walking leisurely -along the road. Brown trotted after it, saying, "Whoa, whoa, there's a -good fellow;" but whenever he got near enough to chance a jump for the -buggy, the horse quickened its pace a little and defeated him. And so -this went on, the naked man perishing with anxiety, and expecting every -moment to see people come in sight. He tagged on and on, imploring the -horse, beseeching the horse, till he had left a mile behind him, and was -closing up on the Taylor premises; then at last he was successful, and -got into the buggy. He flung on his shirt, his necktie, and his coat; -then reached for--but he was too late; he sat suddenly down and pulled up -the lap-robe, for he saw some one coming out of the gate--a woman; he -thought. He wheeled the horse to the left, and struck briskly up the -cross-road. It was perfectly straight, and exposed on both sides; but -there were woods and a sharp turn three miles ahead, and he was very -grateful when he got there. As he passed around the turn he slowed down -to a walk, and reached for his tr---- too late again. - -He had come upon Mrs. Enderby, Mrs. Glossop, Mrs. Taylor, and Mary. -They were on foot, and seemed tired and excited. They came at once to -the buggy and shook hands, and all spoke at once, and said eagerly and -earnestly, how glad they were that he was come, and how fortunate it was. -And Mrs. Enderby said, impressively: - -"It looks like an accident, his coming at such a time; but let no one -profane it with such a name; he was sent--sent from on high." - -They were all moved, and Mrs. Glossop said in an awed voice: - -"Sarah Enderby, you never said a truer word in your life. This is no -accident, it is a special Providence. He was sent. He is an angel--an -angel as truly as ever angel was--an angel of deliverance. I say angel, -Sarah Enderby, and will have no other word. Don't let any one ever say -to me again, that there's no such thing as special Providences; for if -this isn't one, let them account for it that can." - -"I know it's so," said Mrs. Taylor, fervently. "John Brown, I could -worship you; I could go down on my knees to you. Didn't something tell -you?--didn't you feel that you were sent? I could kiss the hem of your -laprobe." - -He was not able to speak; he was helpless with shame and fright. Mrs. -Taylor went on: - -"Why, just look at it all around, Julia Glossop. Any person can see the -hand of Providence in it. Here at noon what do we see? We see the smoke -rising. I speak up and say, 'That's the Old People's cabin afire.' -Didn't I, Julia Glossop?" - -"The very words you said, Nancy Taylor. I was as close to you as I am -now, and I heard them. You may have said hut instead of cabin, but in -substance it's the same. And you were looking pale, too." - -"Pale? I was that pale that if--why, you just compare it with this -laprobe. Then the next thing I said was, 'Mary Taylor, tell the hired -man to rig up the team-we'll go to the rescue.' And she said, 'Mother, -don't you know you told him he could drive to see his people, and stay -over Sunday?' And it was just so. I declare for it, I had forgotten it. -'Then,' said I, 'we'll go afoot.' And go we did. And found Sarah -Enderby on the road." - -"And we all went together," said Mrs. Enderby. "And found the cabin set -fire to and burnt down by the crazy one, and the poor old things so old -and feeble that they couldn't go afoot. And we got them to a shady place -and made them as comfortable as we could, and began to wonder which way -to turn to find some way to get them conveyed to Nancy Taylor's house. -And I spoke up and said--now what did I say? Didn't I say, 'Providence -will provide'?" - -"Why sure as you live, so you did! I had forgotten it." - -"So had I," said Mrs. Glossop and Mrs. Taylor; "but you certainly said -it. Now wasn't that remarkable?" - -"Yes, I said it. And then we went to Mr. Moseley's, two miles, and all -of them were gone to the camp meeting over on Stony Fork; and then we -came all the way back, two miles, and then here, another mile--and -Providence has provided. You see it yourselves" - -They gazed at each other awe-struck, and lifted their hands and said in -unison: - -"It's per-fectly wonderful." - -"And then," said Mrs. Glossop, "what do you think we had better do let -Mr. Brown drive the Old People to Nancy Taylor's one at a time, or put -both of them in the buggy, and him lead the horse?" - -Brown gasped. - -"Now, then, that's a question," said Mrs. Enderby. "You see, we are all -tired out, and any way we fix it it's going to be difficult. For if Mr. -Brown takes both of them, at least one of us must, go back to help him, -for he can't load them into the buggy by himself, and they so helpless." - -"That is so," said Mrs. Taylor. "It doesn't look-oh, how would this do? ---one of us drive there with Mr. Brown, and the rest of you go along to -my house and get things ready. I'll go with him. He and I together can -lift one of the Old People into the buggy; then drive her to my house -and---- - -"But who will take care of the other one?" said Mrs. Enderby. "We -musn't leave her there in the woods alone, you know--especially the crazy -one. There and back is eight miles, you see." - -They had all been sitting on the grass beside the buggy for a while, now, -trying to rest their weary bodies. They fell silent a moment or two, and -struggled in thought over the baffling situation; then Mrs. Enderby -brightened and said: - -"I think I've got the idea, now. You see, we can't walk any more. Think -what we've done: four miles there, two to Moseley's, is six, then back to -here--nine miles since noon, and not a bite to eat; I declare I don't see -how we've done it; and as for me, I am just famishing. Now, somebody's -got to go back, to help Mr. Brown--there's no getting mound that; but -whoever goes has got to ride, not walk. So my idea is this: one of us to -ride back with Mr. Brown, then ride to Nancy Taylor's house with one of -the Old People, leaving Mr. Brown to keep the other old one company, you -all to go now to Nancy's and rest and wait; then one of you drive back -and get the other one and drive her to Nancy's, and Mr. Brown walk." - -"Splendid!" they all cried. "Oh, that will do--that will answer -perfectly." And they all said that Mrs. Enderby had the best head for -planning, in the company; and they said that they wondered that they -hadn't thought of this simple plan themselves. They hadn't meant to take -back the compliment, good simple souls, and didn't know they had done it. -After a consultation it was decided that Mrs. Enderby should drive back -with Brown, she being entitled to the distinction because she had -invented the plan. Everything now being satisfactorily arranged and -settled, the ladies rose, relieved and happy, and brushed down their -gowns, and three of them started homeward; Mrs. Enderby set her foot on -the buggy-step and was about to climb in, when Brown found a remnant of -his voice and gasped out-- - -"Please Mrs. Enderby, call them back--I am very weak; I can't walk, I -can't, indeed." - -"Why, dear Mr. Brown! You do look pale; I am ashamed of myself that I -didn't notice it sooner. Come back-all of you! Mr. Brown is not well. -Is there anything I can do for you, Mr. Brown?--I'm real sorry. Are you -in pain?" - -"No, madam, only weak; I am not sick, but only just weak--lately; not -long, but just lately." - -The others came back, and poured out their sympathies and commiserations, -and were full of self-reproaches for not having noticed how pale he was. - -And they at once struck out a new plan, and soon agreed that it was by -far the best of all. They would all go to Nancy Taylor's house and see -to Brown's needs first. He could lie on the sofa in the parlor, and -while Mrs. Taylor and Mary took care of him the other two ladies would -take the buggy and go and get one of the Old People, and leave one of -themselves with the other one, and---- - -By this time, without any solicitation, they were at the horse's head and -were beginning to turn him around. The danger was imminent, but Brown -found his voice again and saved himself. He said-- - -"But ladies, you are overlooking something which makes the plan -impracticable. You see, if you bring one of them home, and one remains -behind with the other, there will be three persons there when one of you -comes back for that other, for some one must drive the buggy back, and -three can't come home in it." - -They all exclaimed, "Why, sure-ly, that is so!" and they were, all -perplexed again. - -"Dear, dear, what can we do?" said Mrs. Glossop; "it is the most -mixed-up thing that ever was. The fox and the goose and the corn and -things-- Oh, dear, they are nothing to it." - -They sat wearily down once more, to further torture their tormented heads -for a plan that would work. Presently Mary offered a plan; it was her -first effort. She said: - -"I am young and strong, and am refreshed, now. Take Mr. Brown to our -house, and give him help--you see how plainly he needs it. I will go -back and take care of the Old People; I can be there in twenty minutes. -You can go on and do what you first started to do--wait on the main road -at our house until somebody comes along with a wagon; then send and bring -away the three of us. You won't have to wait long; the farmers will soon -be coming back from town, now. I will keep old Polly patient and cheered -up--the crazy one doesn't need it." - -This plan was discussed and accepted; it seemed the best that could be -done, in the circumstances, and the Old People must be getting -discouraged by this time. - -Brown felt relieved, and was deeply thankful. Let him once get to the -main road and he would find a way to escape. - -Then Mrs. Taylor said: - -"The evening chill will be coming on, pretty soon, and those poor old -burnt-out things will need some kind of covering. Take the lap-robe with -you, dear." - -"Very well, Mother, I will." - -She stepped to the buggy and put out her hand to take it---- - -That was the end of the tale. The passenger who told it said that when -he read the story twenty-five years ago in a train he was interrupted at -that point--the train jumped off a bridge. - -At first we thought we could finish the story quite easily, and we set to -work with confidence; but it soon began to appear that it was not a -simple thing, but difficult and baffling. This was on account of Brown's -character--great generosity and kindliness, but complicated with unusual -shyness and diffidence, particularly in the presence of ladies. There -was his love for Mary, in a hopeful state but not yet secure--just in a -condition, indeed, where its affair must be handled with great tact, and -no mistakes made, no offense given. And there was the mother wavering, -half willing-by adroit and flawless diplomacy to be won over, now, or -perhaps never at all. Also, there were the helpless Old People yonder in -the woods waiting-their fate and Brown's happiness to be determined by -what Brown should do within the next two seconds. Mary was reaching for -the lap-robe; Brown must decide-there was no time to be lost. - -Of course none but a happy ending of the story would be accepted by the -jury; the finish must find Brown in high credit with the ladies, his -behavior without blemish, his modesty unwounded, his character for self -sacrifice maintained, the Old People rescued through him, their -benefactor, all the party proud of him, happy in him, his praises on all -their tongues. - -We tried to arrange this, but it was beset with persistent and -irreconcilable difficulties. We saw that Brown's shyness would not allow -him to give up the lap-robe. This would offend Mary and her mother; and -it would surprise the other ladies, partly because this stinginess toward -the suffering Old People would be out of character with Brown, and partly -because he was a special Providence and could not properly act so. If -asked to explain his conduct, his shyness would not allow him to tell the -truth, and lack of invention and practice would find him incapable of -contriving a lie that would wash. We worked at the troublesome problem -until three in the morning. - -Meantime Mary was still reaching for the lap-robe. We gave it up, and -decided to let her continue to reach. It is the reader's privilege to -determine for himself how the thing came out. - - - - -CHAPTER III. - -It is more trouble to make a maxim than it is to do right. - --Pudd'nhead Wilson's New Calendar. - -On the seventh day out we saw a dim vast bulk standing up out of the -wastes of the Pacific and knew that that spectral promontory was Diamond -Head, a piece of this world which I had not seen before for twenty-nine -years. So we were nearing Honolulu, the capital city of the Sandwich -Islands--those islands which to me were Paradise; a Paradise which I had -been longing all those years to see again. Not any other thing in the -world could have stirred me as the sight of that great rock did. - -In the night we anchored a mile from shore. Through my port I could see -the twinkling lights of Honolulu and the dark bulk of the mountain-range -that stretched away right and left. I could not make out the beautiful -Nuuana valley, but I knew where it lay, and remembered how it used to -look in the old times. We used to ride up it on horseback in those days ---we young people--and branch off and gather bones in a sandy region -where one of the first Kamehameha's battles was fought. He was a -remarkable man, for a king; and he was also a remarkable man for a -savage. He was a mere kinglet and of little or no consequence at the -time of Captain Cook's arrival in 1788; but about four years afterward he -conceived the idea of enlarging his sphere of influence. That is a -courteous modern phrase which means robbing your neighbor--for your -neighbor's benefit; and the great theater of its benevolences is Africa. -Kamehameha went to war, and in the course of ten years he whipped out all -the other kings and made himself master of every one of the nine or ten -islands that form the group. But he did more than that. He bought -ships, freighted them with sandal wood and other native products, and -sent them as far as South America and China; he sold to his savages the -foreign stuffs and tools and utensils which came back in these ships, and -started the march of civilization. It is doubtful if the match to this -extraordinary thing is to be found in the history of any other savage. -Savages are eager to learn from the white man any new way to kill each -other, but it is not their habit to seize with avidity and apply with -energy the larger and nobler ideas which he offers them. The details of -Kamehameha's history show that he was always hospitably ready to examine -the white man's ideas, and that he exercised a tidy discrimination in -making his selections from the samples placed on view. - -A shrewder discrimination than was exhibited by his son and successor, -Liholiho, I think. Liholiho could have qualified as a reformer, perhaps, -but as a king he was a mistake. A mistake because he tried to be both -king and reformer. This is mixing fire and gunpowder together. A king -has no proper business with reforming. His best policy is to keep things -as they are; and if he can't do that, he ought to try to make them worse -than they are. This is not guesswork; I have thought over this matter a -good deal, so that if I should ever have a chance to become a king I -would know how to conduct the business in the best way. - -When Liholiho succeeded his father he found himself possessed of an -equipment of royal tools and safeguards which a wiser king would have -known how to husband, and judiciously employ, and make profitable. The -entire country was under the one scepter, and his was that scepter. -There was an Established Church, and he was the head of it. There was a -Standing Army, and he was the head of that; an Army of 114 privates under -command of 27 Generals and a Field Marshal. There was a proud and -ancient Hereditary Nobility. There was still one other asset. This was -the tabu--an agent endowed with a mysterious and stupendous power, an -agent not found among the properties of any European monarch, a tool of -inestimable value in the business. Liholiho was headmaster of the tabu. -The tabu was the most ingenious and effective of all the inventions that -has ever been devised for keeping a people's privileges satisfactorily -restricted. - -It required the sexes to live in separate houses. It did not allow -people to eat in either house; they must eat in another place. It did -not allow a man's woman-folk to enter his house. It did not allow the -sexes to eat together; the men must eat first, and the women must wait on -them. Then the women could eat what was left--if anything was left--and -wait on themselves. I mean, if anything of a coarse or unpalatable sort -was left, the women could have it. But not the good things, the fine -things, the choice things, such as pork, poultry, bananas, cocoanuts, the -choicer varieties of fish, and so on. By the tabu, all these were sacred -to the men; the women spent their lives longing for them and wondering -what they might taste like; and they died without finding out. - -These rules, as you see, were quite simple and clear. It was easy to -remember them; and useful. For the penalty for infringing any rule in -the whole list was death. Those women easily learned to put up with -shark and taro and dog for a diet when the other things were so -expensive. - -It was death for any one to walk upon tabu'd ground; or defile a tabu'd -thing with his touch; or fail in due servility to a chief; or step upon -the king's shadow. The nobles and the King and the priests were always -suspending little rags here and there and yonder, to give notice to the -people that the decorated spot or thing was tabu, and death lurking near. -The struggle for life was difficult and chancy in the islands in those -days. - -Thus advantageously was the new king situated. Will it be believed that -the first thing he did was to destroy his Established Church, root and -branch? He did indeed do that. To state the case figuratively, he was a -prosperous sailor who burnt his ship and took to a raft. This Church was -a horrid thing. It heavily oppressed the people; it kept them always -trembling in the gloom of mysterious threatenings; it slaughtered them in -sacrifice before its grotesque idols of wood and stone; it cowed them, it -terrorized them, it made them slaves to its priests, and through the -priests to the king. It was the best friend a king could have, and the -most dependable. To a professional reformer who should annihilate so -frightful and so devastating a power as this Church, reverence and praise -would be due; but to a king who should do it, could properly be due -nothing but reproach; reproach softened by sorrow; sorrow for his -unfitness for his position. - -He destroyed his Established Church, and his kingdom is a republic today, -in consequence of that act. - -When he destroyed the Church and burned the idols he did a mighty thing -for civilization and for his people's weal--but it was not "business." -It was unkingly, it was inartistic. It made trouble for his line. The -American missionaries arrived while the burned idols were still smoking. -They found the nation without a religion, and they repaired the defect. -They offered their own religion and it was gladly received. But it was -no support to arbitrary kingship, and so the kingly power began to weaken -from that day. Forty-seven years later, when I was in the islands, -Kainehameha V. was trying to repair Liholiho's blunder, and not -succeeding. He had set up an Established Church and made himself the -head of it. But it was only a pinchbeck thing, an imitation, a bauble, -an empty show. It had no power, no value for a king. It could not harry -or burn or slay, it in no way resembled the admirable machine which -Liholiho destroyed. It was an Established Church without an -Establishment; all the people were Dissenters. - -Long before that, the kingship had itself become but a name, a show. At -an early day the missionaries had turned it into something very much like -a republic; and here lately the business whites have turned it into -something exactly like it. - -In Captain Cook's time (1778), the native population of the islands was -estimated at 400,000; in 1836 at something short of 200,000, in 1866 at -50,000; it is to-day, per census, 25,000. All intelligent people praise -Kamehameha I. and Liholiho for conferring upon their people the great -boon of civilization. I would do it myself, but my intelligence is out -of repair, now, from over-work. - -When I was in the islands nearly a generation ago, I was acquainted with -a young American couple who had among their belongings an attractive -little son of the age of seven--attractive but not practicably -companionable with me, because he knew no English. He had played from -his birth with the little Kanakas on his father's plantation, and had -preferred their language and would learn no other. The family removed to -America a month after I arrived in the islands, and straightway the boy -began to lose his Kanaka and pick up English. By the time he was twelve -be hadn't a word of Kanaka left; the language had wholly departed from -his tongue and from his comprehension. Nine years later, when he was -twenty-one, I came upon the family in one of the lake towns of New York, -and the mother told me about an adventure which her son had been having. -By trade he was now a professional diver. A passenger boat had been -caught in a storm on the lake, and had gone down, carrying her people -with her. A few days later the young diver descended, with his armor on, -and entered the berth-saloon of the boat, and stood at the foot of the -companionway, with his hand on the rail, peering through the dim water. -Presently something touched him on the shoulder, and he turned and found -a dead man swaying and bobbing about him and seemingly inspecting him -inquiringly. He was paralyzed with fright. His entry had disturbed the -water, and now he discerned a number of dim corpses making for him and -wagging their heads and swaying their bodies like sleepy people trying to -dance. His senses forsook him, and in that condition he was drawn to the -surface. He was put to bed at home, and was soon very ill. During some -days he had seasons of delirium which lasted several hours at a time; and -while they lasted he talked Kanaka incessantly and glibly; and Kanaka -only. He was still very ill, and he talked to me in that tongue; but I -did not understand it, of course. The doctor-books tell us that cases -like this are not uncommon. Then the doctors ought to study the cases -and find out how to multiply them. Many languages and things get mislaid -in a person's head, and stay mislaid for lack of this remedy. - -Many memories of my former visit to the islands came up in my mind while -we lay at anchor in front of Honolulu that night. And pictures--pictures -pictures--an enchanting procession of them! I was impatient for the -morning to come. - -When it came it brought disappointment, of course. Cholera had broken -out in the town, and we were not allowed to have any communication with -the shore. Thus suddenly did my dream of twenty-nine years go to ruin. -Messages came from friends, but the friends themselves I was not to have -any sight of. My lecture-hall was ready, but I was not to see that, -either. - -Several of our passengers belonged in Honolulu, and these were sent -ashore; but nobody could go ashore and return. There were people on -shore who were booked to go with us to Australia, but we could not -receive them; to do it would cost us a quarantine-term in Sydney. They -could have escaped the day before, by ship to San Francisco; but the bars -had been put up, now, and they might have to wait weeks before any ship -could venture to give them a passage any whither. And there were -hardships for others. An elderly lady and her son, recreation-seekers -from Massachusetts, had wandered westward, further and further from home, -always intending to take the return track, but always concluding to go -still a little further; and now here they were at anchor before Honolulu -positively their last westward-bound indulgence--they had made up their -minds to that--but where is the use in making up your mind in this world? -It is usually a waste of time to do it. These two would have to stay -with us as far as Australia. Then they could go on around the world, or -go back the way they had come; the distance and the accommodations and -outlay of time would be just the same, whichever of the two routes they -might elect to take. Think of it: a projected excursion of five hundred -miles gradually enlarged, without any elaborate degree of intention, to a -possible twenty-four thousand. However, they were used to extensions by -this time, and did not mind this new one much. - -And we had with us a lawyer from Victoria, who had been sent out by the -Government on an international matter, and he had brought his wife with -him and left the children at home with the servants and now what was to -be done? Go ashore amongst the cholera and take the risks? Most -certainly not. They decided to go on, to the Fiji islands, wait there a -fortnight for the next ship, and then sail for home. They couldn't -foresee that they wouldn't see a homeward-bound ship again for six weeks, -and that no word could come to them from the children, and no word go -from them to the children in all that time. It is easy to make plans in -this world; even a cat can do it; and when one is out in those remote -oceans it is noticeable that a cat's plans and a man's are worth about -the same. There is much the same shrinkage in both, in the matter of -values. - -There was nothing for us to do but sit about the decks in the shade of -the awnings and look at the distant shore. We lay in luminous blue -water; shoreward the water was green-green and brilliant; at the shore -itself it broke in a long white ruffle, and with no crash, no sound that -we could hear. The town was buried under a mat of foliage that looked -like a cushion of moss. The silky mountains were clothed in soft, rich -splendors of melting color, and some of the cliffs were veiled in -slanting mists. I recognized it all. It was just as I had seen it long -before, with nothing of its beauty lost, nothing of its charm wanting. - -A change had come, but that was political, and not visible from the ship. -The monarchy of my day was gone, and a republic was sitting in its seat. -It was not a material change. The old imitation pomps, the fuss and -feathers, have departed, and the royal trademark--that is about all that -one could miss, I suppose. That imitation monarchy, was grotesque -enough, in my time; if it had held on another thirty years it would have -been a monarchy without subjects of the king's race. - -We had a sunset of a very fine sort. The vast plain of the sea was -marked off in bands of sharply-contrasted colors: great stretches of dark -blue, others of purple, others of polished bronze; the billowy mountains -showed all sorts of dainty browns and greens, blues and purples and -blacks, and the rounded velvety backs of certain of them made one want to -stroke them, as one would the sleek back of a cat. The long, sloping -promontory projecting into the sea at the west turned dim and leaden and -spectral, then became suffused with pink--dissolved itself in a pink -dream, so to speak, it seemed so airy and unreal. Presently the -cloud-rack was flooded with fiery splendors, and these were copied on the -surface of the sea, and it made one drunk with delight to look upon it. - -From talks with certain of our passengers whose home was Honolulu, and -from a sketch by Mrs. Mary H. Krout, I was able to perceive what the -Honolulu of to-day is, as compared with the Honolulu of my time. In my -time it was a beautiful little town, made up of snow-white wooden -cottages deliciously smothered in tropical vines and flowers and trees -and shrubs; and its coral roads and streets were hard and smooth, and as -white as the houses. The outside aspects of the place suggested the -presence of a modest and comfortable prosperity--a general prosperity ---perhaps one might strengthen the term and say universal. There were no -fine houses, no fine furniture. There were no decorations. Tallow -candles furnished the light for the bedrooms, a whale-oil lamp furnished -it for the parlor. Native matting served as carpeting. In the parlor -one would find two or three lithographs on the walls--portraits as a -rule: Kamehameha IV., Louis Kossuth, Jenny Lind; and may be an engraving -or two: Rebecca at the Well, Moses smiting the rock, Joseph's servants -finding the cup in Benjamin's sack. There would be a center table, with -books of a tranquil sort on it: The Whole Duty of Man, Baxter's Saints' -Rest, Fox's Martyrs, Tupper's Proverbial Philosophy, bound copies of The -Missionary Herald and of Father Damon's Seaman's Friend. A melodeon; a -music stand, with 'Willie, We have Missed You', 'Star of the Evening', -'Roll on Silver Moon', 'Are We Most There', 'I Would not Live Alway', and -other songs of love and sentiment, together with an assortment of hymns. -A what-not with semi-globular glass paperweights, enclosing miniature -pictures of ships, New England rural snowstorms, and the like; sea-shells -with Bible texts carved on them in cameo style; native curios; whale's -tooth with full-rigged ship carved on it. There was nothing reminiscent -of foreign parts, for nobody had been abroad. Trips were made to San -Francisco, but that could not be called going abroad. Comprehensively -speaking, nobody traveled. - -But Honolulu has grown wealthy since then, and of course wealth has -introduced changes; some of the old simplicities have disappeared. Here -is a modern house, as pictured by Mrs. Krout: - - "Almost every house is surrounded by extensive lawns and gardens - enclosed by walls of volcanic stone or by thick hedges of the - brilliant hibiscus. - - "The houses are most tastefully and comfortably furnished; the - floors are either of hard wood covered with rugs or with fine Indian - matting, while there is a preference, as in most warm countries, for - rattan or bamboo furniture; there are the usual accessories of - bric-a-brac, pictures, books, and curios from all parts of the world, - for these island dwellers are indefatigable travelers. - - "Nearly every house has what is called a lanai. It is a large - apartment, roofed, floored, open on three sides, with a door or a - draped archway opening into the drawing-room. Frequently the roof - is formed by the thick interlacing boughs of the hou tree, - impervious to the sun and even to the rain, except in violent - storms. Vines are trained about the sides--the stephanotis or some - one of the countless fragrant and blossoming trailers which abound - in the islands. There are also curtains of matting that may be - drawn to exclude the sun or rain. The floor is bare for coolness, - or partially covered with rugs, and the lanai is prettily furnished - with comfortable chairs, sofas, and tables loaded with flowers, or - wonderful ferns in pots. - - "The lanai is the favorite reception room, and here at any social - function the musical program is given and cakes and ices are served; - here morning callers are received, or gay riding parties, the ladies - in pretty divided skirts, worn for convenience in riding astride, - --the universal mode adopted by Europeans and Americans, as well as - by the natives. - - "The comfort and luxury of such an apartment, especially at a - seashore villa, can hardly be imagined. The soft breezes sweep - across it, heavy with the fragrance of jasmine and gardenia, and - through the swaying boughs of palm and mimosa there are glimpses of - rugged mountains, their summits veiled in clouds, of purple sea with - the white surf beating eternally against the reefs, whiter still in - the yellow sunlight or the magical moonlight of the tropics." - -There: rugs, ices, pictures, lanais, worldly books, sinful bric-a-brac -fetched from everywhere. And the ladies riding astride. These are -changes, indeed. In my time the native women rode astride, but the white -ones lacked the courage to adopt their wise custom. In my time ice was -seldom seen in Honolulu. It sometimes came in sailing vessels from New -England as ballast; and then, if there happened to be a man-of-war in -port and balls and suppers raging by consequence, the ballast was worth -six hundred dollars a ton, as is evidenced by reputable tradition. But -the ice-machine has traveled all over the world, now, and brought ice -within everybody's reach. In Lapland and Spitzbergen no one uses native -ice in our day, except the bears and the walruses. - -The bicycle is not mentioned. It was not necessary. We know that it is -there, without inquiring. It is everywhere. But for it, people could -never have had summer homes on the summit of Mont Blanc; before its day, -property up there had but a nominal value. The ladies of the Hawaiian -capital learned too late the right way to occupy a horse--too late to get -much benefit from it. The riding-horse is retiring from business -everywhere in the world. In Honolulu a few years from now he will be -only a tradition. - -We all know about Father Damien, the French priest who voluntarily -forsook the world and went to the leper island of Molokai to labor among -its population of sorrowful exiles who wait there, in slow-consuming -misery, for death to cone and release them from their troubles; and we -know that the thing which he knew beforehand would happen, did happen: -that he became a leper himself, and died of that horrible disease. There -was still another case of self-sacrifice, it appears. I asked after -"Billy" Ragsdale, interpreter to the Parliament in my time--a half-white. -He was a brilliant young fellow, and very popular. As an interpreter he -would have been hard to match anywhere. He used to stand up in the -Parliament and turn the English speeches into Hawaiian and the Hawaiian -speeches into English with a readiness and a volubility that were -astonishing. I asked after him, and was told that his prosperous career -was cut short in a sudden and unexpected way, just as he was about to -marry a beautiful half-caste girl. He discovered, by some nearly -invisible sign about his skin, that the poison of leprosy was in him. -The secret was his own, and might be kept concealed for years; but he -would not be treacherous to the girl that loved him; he would not marry -her to a doom like his. And so he put his affairs in order, and went -around to all his friends and bade them good-bye, and sailed in the leper -ship to Molokai. There he died the loathsome and lingering death that -all lepers die. - -In this place let me insert a paragraph or two from "The Paradise of -the Pacific" (Rev. H. H. Gowen)-- - - "Poor lepers! It is easy for those who have no relatives or friends - among them to enforce the decree of segregation to the letter, but - who can write of the terrible, the heart-breaking scenes which that - enforcement has brought about? - - "A man upon Hawaii was suddenly taken away after a summary arrest, - leaving behind him a helpless wife about to give birth to a babe. - The devoted wife with great pain and risk came the whole journey to - Honolulu, and pleaded until the authorities were unable to resist - her entreaty that she might go and live like a leper with her leper - husband. - - "A woman in the prime of life and activity is condemned as an - incipient leper, suddenly removed from her home, and her husband - returns to find his two helpless babes moaning for their lost - mother. - - "Imagine it! The case of the babies is hard, but its bitterness is - a trifle--less than a trifle--less than nothing--compared to what - the mother must suffer; and suffer minute by minute, hour by hour, - day by day, month by month, year by year, without respite, relief, - or any abatement of her pain till she dies. - - "One woman, Luka Kaaukau, has been living with her leper husband in - the settlement for twelve years. The man has scarcely a joint left, - his limbs are only distorted ulcerated stumps, for four years his - wife has put every particle of food into his mouth. He wanted his - wife to abandon his wretched carcass long ago, as she herself was - sound and well, but Luka said that she was content to remain and - wait on the man she loved till the spirit should be freed from its - burden. - - "I myself have known hard cases enough:--of a girl, apparently in - full health, decorating the church with me at Easter, who before - Christmas is taken away as a confirmed leper; of a mother hiding her - child in the mountains for years so that not even her dearest - friends knew that she had a child alive, that he might not be taken - away; of a respectable white man taken away from his wife and - family, and compelled to become a dweller in the Leper Settlement, - where he is counted dead, even by the insurance companies." - -And one great pity of it all is, that these poor sufferers are innocent. -The leprosy does not come of sins which they committed, but of sins -committed by their ancestors, who escaped the curse of leprosy! - -Mr. Gowan has made record of a certain very striking circumstance. Would -you expect to find in that awful Leper Settlement a custom worthy to be -transplanted to your own country? They have one such, and it is -inexpressibly touching and beautiful. When death sets open the -prison-door of life there, the band salutes the freed soul with a burst -of glad music! - - - - -CHAPTER IV. - -A dozen direct censures are easier to bear than one morganatic -compliment. - --Pudd'nhead Wilson's New Calendar. - -Sailed from Honolulu.--From diary: - -Sept. 2. Flocks of flying fish-slim, shapely, graceful, and intensely -white. With the sun on them they look like a flight of silver -fruit-knives. They are able to fly a hundred yards. - -Sept. 3. In 9 deg. 50' north latitude, at breakfast. Approaching the -equator on a long slant. Those of us who have never seen the equator are -a good deal excited. I think I would rather see it than any other thing -in the world. We entered the "doldrums" last night--variable winds, -bursts of rain, intervals of calm, with chopping seas and a wobbly and -drunken motion to the ship--a condition of things findable in -other regions sometimes, but present in the doldrums always. The -globe-girdling belt called the doldrums is 20 degrees wide, and the -thread called the equator lies along the middle of it. - -Sept. 4. Total eclipse of the moon last night. At 1.30 it began to go -off. At total--or about that--it was like a rich rosy cloud with a -tumbled surface framed in the circle and projecting from it--a bulge of -strawberry-ice, so to speak. At half-eclipse the moon was like a gilded -acorn in its cup. - -Sept. 5. Closing in on the equator this noon. A sailor explained to a -young girl that the ship's speed is poor because we are climbing up the -bulge toward the center of the globe; but that when we should once get -over, at the equator, and start down-hill, we should fly. When she asked -him the other day what the fore-yard was, he said it was the front yard, -the open area in the front end of the ship. That man has a good deal of -learning stored up, and the girl is likely to get it all. - -Afternoon. Crossed the equator. In the distance it looked like a blue -ribbon stretched across the ocean. Several passengers kodak'd it. We -had no fool ceremonies, no fantastics, no horse play. All that sort of -thing has gone out. In old times a sailor, dressed as Neptune, used to -come in over the bows, with his suite, and lather up and shave everybody -who was crossing the equator for the first time, and then cleanse these -unfortunates by swinging them from the yard-arm and ducking them three -times in the sea. This was considered funny. Nobody knows why. No, that -is not true. We do know why. Such a thing could never be funny on land; -no part of the old-time grotesque performances gotten up on shipboard to -celebrate the passage of the line would ever be funny on shore--they -would seem dreary and less to shore people. But the shore people would -change their minds about it at sea, on a long voyage. On such a voyage, -with its eternal monotonies, people's intellects deteriorate; the owners -of the intellects soon reach a point where they almost seem to prefer -childish things to things of a maturer degree. One is often surprised at -the juvenilities which grown people indulge in at sea, and the interest -they take in them, and the consuming enjoyment they get out of them. -This is on long voyages only. The mind gradually becomes inert, dull, -blunted; it loses its accustomed interest in intellectual things; nothing -but horse-play can rouse it, nothing but wild and foolish grotesqueries -can entertain it. On short voyages it makes no such exposure of itself; -it hasn't time to slump down to this sorrowful level. - -The short-voyage passenger gets his chief physical exercise out of -"horse-billiards"--shovel-board. It is a good game. We play it in this -ship. A quartermaster chalks off a diagram like this-on the deck. - -The player uses a cue that is like a broom-handle with a quarter-moon of -wood fastened to the end of it. With this he shoves wooden disks the -size of a saucer--he gives the disk a vigorous shove and sends it fifteen -or twenty feet along the deck and lands it in one of the squares if he -can. If it stays there till the inning is played out, it will count as -many points in the game as the figure in the square it has stopped in -represents. The adversary plays to knock that disk out and leave his own -in its place--particularly if it rests upon the 9 or 10 or some other of -the high numbers; but if it rests in the "10off" he backs it up--lands -his disk behind it a foot or two, to make it difficult for its owner to -knock it out of that damaging place and improve his record. When the -inning is played out it may be found that each adversary has placed his -four disks where they count; it may be found that some of them are -touching chalk lines and not counting; and very often it will be found -that there has been a general wreckage, and that not a disk has been left -within the diagram. Anyway, the result is recorded, whatever it is, and -the game goes on. The game is 100 points, and it takes from twenty -minutes to forty to play it, according to luck and the condition of the -sea. It is an exciting game, and the crowd of spectators furnish -abundance of applause for fortunate shots and plenty of laughter for the -other kind. It is a game of skill, but at the same time the uneasy -motion of the ship is constantly interfering with skill; this makes it a -chancy game, and the element of luck comes largely in. - -We had a couple of grand tournaments, to determine who should be -"Champion of the Pacific"; they included among the participants nearly -all the passengers, of both sexes, and the officers of the ship, and they -afforded many days of stupendous interest and excitement, and murderous -exercise--for horse-billiards is a physically violent game. - -The figures in the following record of some of the closing games in the -first tournament will show, better than any description, how very chancy -the game is. The losers here represented had all been winners in the -previous games of the series, some of them by fine majorities: - -Chase,102 Mrs. D.,57 Mortimer, 105 The Surgeon, 92 -Miss C.,105 Mrs. T.,9 Clemens, 101 Taylor,92 -Taylor,109 Davies,95 Miss C., 108 Mortimer,55 -Thomas,102 Roper,76 Clemens, 111 Miss C.,89 -Coomber, 106 Chase,98 - -And so on; until but three couples of winners were left. Then I beat my -man, young Smith beat his man, and Thomas beat his. This reduced the -combatants to three. Smith and I took the deck, and I led off. At the -close of the first inning I was 10 worse than nothing and Smith had -scored 7. The luck continued against me. When I was 57, Smith was 97 ---within 3 of out. The luck changed then. He picked up a 10-off or so, -and couldn't recover. I beat him. - -The next game would end tournament No. 1. - -Mr. Thomas and I were the contestants. He won the lead and went to the -bat--so to speak. And there he stood, with the crotch of his cue resting -against his disk while the ship rose slowly up, sank slowly down, rose -again, sank again. She never seemed to rise to suit him exactly. She -started up once more; and when she was nearly ready for the turn, he let -drive and landed his disk just within the left-hand end of the 10. -(Applause). The umpire proclaimed "a good 10," and the game-keeper set -it down. I played: my disk grazed the edge of Mr. Thomas's disk, and -went out of the diagram. (No applause.) - -Mr. Thomas played again--and landed his second disk alongside of the -first, and almost touching its right-hand side. "Good 10." (Great -applause.) - -I played, and missed both of them. (No applause.) - -Mr. Thomas delivered his third shot and landed his disk just at the right -of the other two. "Good 10." (Immense applause.) - -There they lay, side by side, the three in a row. It did not seem -possible that anybody could miss them. Still I did it. (Immense -silence.) - -Mr. Thomas played his last disk. It seems incredible, but he actually -landed that disk alongside of the others, and just to the right of them-a -straight solid row of 4 disks. (Tumultuous and long-continued applause.) - -Then I played my last disk. Again it did not seem possible that anybody -could miss that row--a row which would have been 14 inches long if the -disks had been clamped together; whereas, with the spaces separating them -they made a longer row than that. But I did it. It may be that I was -getting nervous. - -I think it unlikely that that innings has ever had its parallel in the -history of horse-billiards. To place the four disks side by side in the -10 was an extraordinary feat; indeed, it was a kind of miracle. To miss -them was another miracle. It will take a century to produce another man -who can place the four disks in the 10; and longer than that to find a -man who can't knock them out. I was ashamed of my performance at the -time, but now that I reflect upon it I see that it was rather fine and -difficult. - -Mr. Thomas kept his luck, and won the game, and later the championship. - -In a minor tournament I won the prize, which was a Waterbury watch. I -put it in my trunk. In Pretoria, South Africa, nine months afterward, my -proper watch broke down and I took the Waterbury out, wound it, set it by -the great clock on the Parliament House (8.05), then went back to my room -and went to bed, tired from a long railway journey. The parliamentary -clock had a peculiarity which I was not aware of at the time ---a peculiarity which exists in no other clock, and would not exist in that -one if it had been made by a sane person; on the half-hour it strikes the -succeeding hour, then strikes the hour again, at the proper time. I lay -reading and smoking awhile; then, when I could hold my eyes open no -longer and was about to put out the light, the great clock began to boom, -and I counted ten. I reached for the Waterbury to see how it was getting -along. It was marking 9.30. It seemed rather poor speed for a -three-dollar watch, but I supposed that the climate was affecting it. I -shoved it half an hour ahead; and took to my book and waited to see what -would happen. At 10 the great clock struck ten again. I looked--the -Waterbury was marking half-past 10. This was too much speed for the -money, and it troubled me. I pushed the hands back a half hour, and -waited once more; I had to, for I was vexed and restless now, and my -sleepiness was gone. By and by the great clock struck 11. The Waterbury -was marking 10.30. I pushed it ahead half an hour, with some show of -temper. By and by the great clock struck 11 again. The Waterbury showed -up 11.30, now, and I beat her brains out against the bedstead. I was -sorry next day, when I found out. - -To return to the ship. - -The average human being is a perverse creature; and when he isn't that, -he is a practical joker. The result to the other person concerned is -about the same: that is, he is made to suffer. The washing down of the -decks begins at a very early hour in all ships; in but few ships are any -measures taken to protect the passengers, either by waking or warning -them, or by sending a steward to close their ports. And so the -deckwashers have their opportunity, and they use it. They send a bucket -of water slashing along the side of the ship and into the ports, -drenching the passenger's clothes, and often the passenger himself. This -good old custom prevailed in this ship, and under unusually favorable -circumstances, for in the blazing tropical regions a removable zinc thing -like a sugarshovel projects from the port to catch the wind and bring it -in; this thing catches the wash-water and brings it in, too--and in -flooding abundance. Mrs. L, an invalid, had to sleep on the locker--sofa -under her port, and every time she over-slept and thus failed to take -care of herself, the deck-washers drowned her out. - -And the painters, what a good time they had! This ship would be going -into dock for a month in Sydney for repairs; but no matter, painting was -going on all the time somewhere or other. The ladies' dresses were -constantly getting ruined, nevertheless protests and supplications went -for nothing. Sometimes a lady, taking an afternoon nap on deck near a -ventilator or some other thing that didn't need painting, would wake up -by and by and find that the humorous painter had been noiselessly daubing -that thing and had splattered her white gown all over with little greasy -yellow spots. - -The blame for this untimely painting did not lie with the ship's -officers, but with custom. As far back as Noah's time it became law that -ships must be constantly painted and fussed at when at sea; custom grew -out of the law, and at sea custom knows no death; this custom will -continue until the sea goes dry. - -Sept. 8.--Sunday. We are moving so nearly south that we cross only about -two meridians of longitude a day. This morning we were in longitude 178 -west from Greenwich, and 57 degrees west from San Francisco. To-morrow -we shall be close to the center of the globe--the 180th degree of west -longitude and 180th degree of east longitude. - -And then we must drop out a day-lose a day out of our lives, a day never -to be found again. We shall all die one day earlier than from the -beginning of time we were foreordained to die. We shall be a day -behindhand all through eternity. We shall always be saying to the other -angels, "Fine day today," and they will be always retorting, "But it -isn't to-day, it's tomorrow." We shall be in a state of confusion all the -time and shall never know what true happiness is. - -Next Day. Sure enough, it has happened. Yesterday it was September 8, -Sunday; to-day, per the bulletin-board at the head of the companionway, -it is September 10, Tuesday. There is something uncanny about it. And -uncomfortable. In fact, nearly unthinkable, and wholly unrealizable, -when one comes to consider it. While we were crossing the 180th meridian -it was Sunday in the stern of the ship where my family were, and Tuesday -in the bow where I was. They were there eating the half of a fresh apple -on the 8th, and I was at the same time eating the other half of it on the -10th--and I could notice how stale it was, already. The family were the -same age that they were when I had left them five minutes before, but I -was a day older now than I was then. The day they were living in -stretched behind them half way round the globe, across the Pacific Ocean -and America and Europe; the day I was living in stretched in front of me -around the other half to meet it. They were stupendous days for bulk and -stretch; apparently much larger days than we had ever been in before. -All previous days had been but shrunk-up little things by comparison. -The difference in temperature between the two days was very marked, their -day being hotter than mine because it was closer to the equator. - -Along about the moment that we were crossing the Great Meridian a child -was born in the steerage, and now there is no way to tell which day it -was born on. The nurse thinks it was Sunday, the surgeon thinks it was -Tuesday. The child will never know its own birthday. It will always be -choosing first one and then the other, and will never be able to make up -its mind permanently. This will breed vacillation and uncertainty in its -opinions about religion, and politics, and business, and sweethearts, and -everything, and will undermine its principles, and rot them away, and -make the poor thing characterless, and its success in life impossible. -Every one in the ship says so. And this is not all--in fact, not the -worst. For there is an enormously rich brewer in the ship who said as -much as ten days ago, that if the child was born on his birthday he would -give it ten thousand dollars to start its little life with. His birthday -was Monday, the 9th of September. - -If the ships all moved in the one direction--westward, I mean--the world -would suffer a prodigious loss--in the matter of valuable time, through -the dumping overboard on the Great Meridian of such multitudes of days by -ships crews and passengers. But fortunately the ships do not all sail -west, half of them sail east. So there is no real loss. These latter -pick up all the discarded days and add them to the world's stock again; -and about as good as new, too; for of course the salt water preserves -them. - - - - -CHAPTER V. - -Noise proves nothing. Often a hen who has merely laid an egg cackles as -if she had laid an asteroid. - --Pudd'nhead Wilson's New Calendar. - -WEDNESDAY, Sept. 11. In this world we often make mistakes of judgment. -We do not as a rule get out of them sound and whole, but sometimes we do. -At dinner yesterday evening-present, a mixture of Scotch, English, -American, Canadian, and Australasian folk--a discussion broke out about -the pronunciation of certain Scottish words. This was private ground, -and the non-Scotch nationalities, with one exception, discreetly kept -still. But I am not discreet, and I took a hand. I didn't know anything -about the subject, but I took a hand just to have something to do. At -that moment the word in dispute was the word three. One Scotchman was -claiming that the peasantry of Scotland pronounced it three, his -adversaries claimed that they didn't--that they pronounced it 'thraw'. -The solitary Scot was having a sultry time of it, so I thought I would -enrich him with my help. In my position I was necessarily quite -impartial, and was equally as well and as ill equipped to fight on the -one side as on the other. So I spoke up and said the peasantry -pronounced the word three, not thraw. It was an error of judgment. -There was a moment of astonished and ominous silence, then weather -ensued. The storm rose and spread in a surprising way, and I was snowed -under in a very few minutes. It was a bad defeat for me--a kind of -Waterloo. It promised to remain so, and I wished I had had better sense -than to enter upon such a forlorn enterprise. But just then I had a -saving thought--at least a thought that offered a chance. While the -storm was still raging, I made up a Scotch couplet, and then spoke up and -said: - -"Very well, don't say any more. I confess defeat. I thought I knew, but -I see my mistake. I was deceived by one of your Scotch poets." - -"A Scotch poet! O come! Name him." - -"Robert Burns." - -It is wonderful the power of that name. These men looked doubtful--but -paralyzed, all the same. They were quite silent for a moment; then one -of them said--with the reverence in his voice which is always present in -a Scotchman's tone when he utters the name. - -"Does Robbie Burns say--what does he say?" - -"This is what he says: - - 'There were nae bairns but only three - --Ane at the breast, twa at the knee.'" - -It ended the discussion. There was no man there profane enough, disloyal -enough, to say any word against a thing which Robert Burns had settled. -I shall always honor that great name for the salvation it brought me in -this time of my sore need. - -It is my belief that nearly any invented quotation, played with -confidence, stands a good chance to deceive. There are people who think -that honesty is always the best policy. This is a superstition; there -are times when the appearance of it is worth six of it. - -We are moving steadily southward-getting further and further down under -the projecting paunch of the globe. Yesterday evening we saw the Big -Dipper and the north star sink below the horizon and disappear from our -world. No, not "we," but they. They saw it--somebody saw it--and told -me about it. But it is no matter, I was not caring for those things, I -am tired of them, any way. I think they are well enough, but one doesn't -want them always hanging around. My interest was all in the Southern -Cross. I had never seen that. I had heard about it all my life, and it -was but natural that I should be burning to see it. No other -constellation makes so much talk. I had nothing against the Big Dipper ---and naturally couldn't have anything against it, since it is a citizen of -our own sky, and the property of the United States--but I did want it to -move out of the way and give this foreigner a chance. Judging by the -size of the talk which the Southern Cross had made, I supposed it would -need a sky all to itself. - -But that was a mistake. We saw the Cross to-night, and it is not large. -Not large, and not strikingly bright. But it was low down toward the -horizon, and it may improve when it gets up higher in the sky. It is -ingeniously named, for it looks just as a cross would look if it looked -like something else. But that description does not describe; it is too -vague, too general, too indefinite. It does after a fashion suggest a -cross across that is out of repair--or out of drawing; not correctly -shaped. It is long, with a short cross-bar, and the cross-bar is canted -out of the straight line. - -It consists of four large stars and one little one. The little one is -out of line and further damages the shape. It should have been placed at -the intersection of the stem and the cross-bar. If you do not draw an -imaginary line from star to star it does not suggest a cross--nor -anything in particular. - -One must ignore the little star, and leave it out of the combination--it -confuses everything. If you leave it out, then you can make out of the -four stars a sort of cross--out of true; or a sort of kite--out of true; -or a sort of coffin-out of true. - -Constellations have always been troublesome things to name. If you give -one of them a fanciful name, it will always refuse to live up to it; it -will always persist in not resembling the thing it has been named for. -Ultimately, to satisfy the public, the fanciful name has to be discarded -for a common-sense one, a manifestly descriptive one. The Great Bear -remained the Great Bear--and unrecognizable as such--for thousands of -years; and people complained about it all the time, and quite properly; -but as soon as it became the property of the United States, Congress -changed it to the Big Dipper, and now every body is satisfied, and there -is no more talk about riots. I would not change the Southern Cross to -the Southern Coffin, I would change it to the Southern Kite; for up there -in the general emptiness is the proper home of a kite, but not for -coffins and crosses and dippers. In a little while, now--I cannot -tell exactly how long it will be--the globe will belong to the -English-speaking race; and of course the skies also. Then the -constellations will be re-organized, and polished up, and re-named--the -most of them "Victoria," I reckon, but this one will sail thereafter as -the Southern Kite, or go out of business. Several towns and things, here -and there, have been named for Her Majesty already. - -In these past few days we are plowing through a mighty Milky Way of -islands. They are so thick on the map that one would hardly expect to -find room between them for a canoe; yet we seldom glimpse one. Once we -saw the dim bulk of a couple of them, far away, spectral and dreamy -things; members of the Horne-Alofa and Fortuna. On the larger one are -two rival native kings--and they have a time together. They are -Catholics; so are their people. The missionaries there are French -priests. - -From the multitudinous islands in these regions the "recruits" for the -Queensland plantations were formerly drawn; are still drawn from them, I -believe. Vessels fitted up like old-time slavers came here and carried -off the natives to serve as laborers in the great Australian province. -In the beginning it was plain, simple man-stealing, as per testimony of -the missionaries. This has been denied, but not disproven. Afterward it -was forbidden by law to "recruit" a native without his consent, and -governmental agents were sent in all recruiting vessels to see that the -law was obeyed--which they did, according to the recruiting people; and -which they sometimes didn't, according to the missionaries. A man could -be lawfully recruited for a three-years term of service; he could -volunteer for another term if he so chose; when his time was up he could -return to his island. And would also have the means to do it; for the -government required the employer to put money in its hands for this -purpose before the recruit was delivered to him. - -Captain Wawn was a recruiting ship-master during many years. From his -pleasant book one gets the idea that the recruiting business was quite -popular with the islanders, as a rule. And yet that did not make the -business wholly dull and uninteresting; for one finds rather frequent -little breaks in the monotony of it--like this, for instance: - - "The afternoon of our arrival at Leper Island the schooner was lying - almost becalmed under the lee of the lofty central portion of the - island, about three-quarters of a mile from the shore. The boats - were in sight at some distance. The recruiter-boat had run into a - small nook on the rocky coast, under a high bank, above which stood - a solitary hut backed by dense forest. The government agent and - mate in the second boat lay about 400 yards to the westward. - - "Suddenly we heard the sound of firing, followed by yells from the - natives on shore, and then we saw the recruiter-boat push out with a - seemingly diminished crew. The mate's boat pulled quickly up, took - her in tow, and presently brought her alongside, all her own crew - being more or less hurt. It seems the natives had called them into - the place on pretence of friendship. A crowd gathered about the - stern of the boat, and several fellows even got into her. All of a - sudden our men were attacked with clubs and tomahawks. The - recruiter escaped the first blows aimed at him, making play with his - fists until he had an opportunity to draw his revolver. 'Tom - Sayers,' a Mare man, received a tomahawk blow on the head which laid - the scalp open but did not penetrate his skull, fortunately. 'Bobby - Towns,' another Mare boatman, had both his thumbs cut in warding off - blows, one of them being so nearly severed from the hand that the - doctors had to finish the operation. Lihu, a Lifu boy, the - recruiter's special attendant, was cut and pricked in various - places, but nowhere seriously. Jack, an unlucky Tanna recruit, who - had been engaged to act as boatman, received an arrow through his - forearm, the head of which--apiece of bone seven or eight inches - long--was still in the limb, protruding from both sides, when the - boats returned. The recruiter himself would have got off scot-free - had not an arrow pinned one of his fingers to the loom of the - steering-oar just as they were getting off. The fight had been - short but sharp. The enemy lost two men, both shot dead." - -The truth is, Captain Wawn furnishes such a crowd of instances of fatal -encounters between natives and French and English recruiting-crews (for -the French are in the business for the plantations of New Caledonia), -that one is almost persuaded that recruiting is not thoroughly popular -among the islanders; else why this bristling string of attacks and -bloodcurdling slaughter? The captain lays it all to "Exeter Hall -influence." But for the meddling philanthropists, the native fathers and -mothers would be fond of seeing their children carted into exile and now -and then the grave, instead of weeping about it and trying to kill the -kind recruiters. - - - - -CHAPTER VI. - -He was as shy as a newspaper is when referring to its own merits. - --Pudd'nhead Wilson's New Calendar. - -Captain Wawn is crystal-clear on one point: He does not approve of -missionaries. They obstruct his business. They make "Recruiting," as he -calls it ("Slave-Catching," as they call it in their frank way) a trouble -when it ought to be just a picnic and a pleasure excursion. The -missionaries have their opinion about the manner in which the Labor -Traffic is conducted, and about the recruiter's evasions of the law of -the Traffic, and about the traffic itself--and it is distinctly -uncomplimentary to the Traffic and to everything connected with it, -including the law for its regulation. Captain Wawn's book is of very -recent date; I have by me a pamphlet of still later date--hot from the -press, in fact--by Rev. Wm. Gray, a missionary; and the book and the -pamphlet taken together make exceedingly interesting reading, to my mind. - -Interesting, and easy to understand--except in one detail, which I will -mention presently. It is easy to understand why the Queensland sugar -planter should want the Kanaka recruit: he is cheap. Very cheap, in -fact. These are the figures paid by the planter: L20 to the recruiter -for getting the Kanaka or "catching" him, as the missionary phrase goes; -L3 to the Queensland government for "superintending" the importation; L5 -deposited with the Government for the Kanaka's passage home when his -three years are up, in case he shall live that long; about L25 to the -Kanaka himself for three years' wages and clothing; total payment for the -use of a man three years, L53; or, including diet, L60. Altogether, a -hundred dollars a year. One can understand why the recruiter is fond of -the business; the recruit costs him a few cheap presents (given to the -recruit's relatives, not himself), and the recruit is worth L20 to the -recruiter when delivered in Queensland. All this is clear enough; but -the thing that is not clear is, what there is about it all to persuade -the recruit. He is young and brisk; life at home in his beautiful island -is one lazy, long holiday to him; or if he wants to work he can turn out -a couple of bags of copra per week and sell it for four or five shillings -a bag. In Queensland he must get up at dawn and work from eight to -twelve hours a day in the canefields--in a much hotter climate than he is -used to--and get less than four shillings a week for it. - -I cannot understand his willingness to go to Queensland. It is a deep -puzzle to me. Here is the explanation, from the planter's point of view; -at least I gather from the missionary's pamphlet that it is the -planter's: - - "When he comes from his home he is a savage, pure and simple. He - feels no shame at his nakedness and want of adornment. When he - returns home he does so well dressed, sporting a Waterbury watch, - collars, cuffs, boots, and jewelry. He takes with him one or more - boxes--["Box" is English for trunk.]--well filled with clothing, a - musical instrument or two, and perfumery and other articles of - luxury he has learned to appreciate." - -For just one moment we have a seeming flash of comprehension of, the -Kanaka's reason for exiling himself: he goes away to acquire -civilization. Yes, he was naked and not ashamed, now he is clothed and -knows how to be ashamed; he was unenlightened; now he has a Waterbury -watch; he was unrefined, now he has jewelry, and something to make him -smell good; he was a nobody, a provincial, now he has been to far -countries and can show off. - -It all looks plausible--for a moment. Then the missionary takes hold of -this explanation and pulls it to pieces, and dances on it, and damages it -beyond recognition. - - "Admitting that the foregoing description is the average one, the - average sequel is this: The cuffs and collars, if used at all, are - carried off by youngsters, who fasten them round the leg, just below - the knee, as ornaments. The Waterbury, broken and dirty, finds its - way to the trader, who gives a trifle for it; or the inside is taken - out, the wheels strung on a thread and hung round the neck. Knives, - axes, calico, and handkerchiefs are divided among friends, and there - is hardly one of these apiece. The boxes, the keys often lost on - the road home, can be bought for 2s. 6d. They are to be seen - rotting outside in almost any shore village on Tanna. (I speak of - what I have seen.) A returned Kanaka has been furiously angry with - me because I would not buy his trousers, which he declared were just - my fit. He sold them afterwards to one of my Aniwan teachers for - 9d. worth of tobacco--a pair of trousers that probably cost him 8s. - or 10s. in Queensland. A coat or shirt is handy for cold weather. - The white handkerchiefs, the 'senet' (perfumery), the umbrella, and - perhaps the hat, are kept. The boots have to take their chance, if - they do not happen to fit the copra trader. 'Senet' on the hair, - streaks of paint on the face, a dirty white handkerchief round the - neck, strips of turtle shell in the ears, a belt, a sheath and - knife, and an umbrella constitute the rig of returned Kanaka at home - the day after landing." - -A hat, an umbrella, a belt, a neckerchief. Otherwise stark naked. All -in a day the hard-earned "civilization" has melted away to this. And -even these perishable things must presently go. Indeed, there is but a -single detail of his civilization that can be depended on to stay by him: -according to the missionary, he has learned to swear. This is art, and -art is long, as the poet says. - -In all countries the laws throw light upon the past. The Queensland law -for the regulation of the Labor Traffic is a confession. It is a -confession that the evils charged by the missionaries upon the traffic -had existed in the past, and that they still existed when the law was -made. The missionaries make a further charge: that the law is evaded by -the recruiters, and that the Government Agent sometimes helps them to do -it. Regulation 31 reveals two things: that sometimes a young fool of a -recruit gets his senses back, after being persuaded to sign away his -liberty for three years, and dearly wants to get out of the engagement -and stay at home with his own people; and that threats, intimidation, and -force are used to keep him on board the recruiting-ship, and to hold him -to his contract. Regulation 31 forbids these coercions. The law -requires that he shall be allowed to go free; and another clause of it -requires the recruiter to set him ashore--per boat, because of the -prevalence of sharks. Testimony from Rev. Mr. Gray: - - "There are 'wrinkles' for taking the penitent Kanaka. My first - experience of the Traffic was a case of this kind in 1884. A vessel - anchored just out of sight of our station, word was brought to me - that some boys were stolen, and the relatives wished me to go and - get them back. The facts were, as I found, that six boys had - recruited, had rushed into the boat, the Government Agent informed - me. They had all 'signed'; and, said the Government Agent, 'on - board they shall remain.' I was assured that the six boys were of - age and willing to go. Yet on getting ready to leave the ship I - found four of the lads ready to come ashore in the boat! This I - forbade. One of them jumped into the water and persisted in coming - ashore in my boat. When appealed to, the Government Agent suggested - that we go and leave him to be picked up by the ship's boat, a - quarter mile distant at the time!" - -The law and the missionaries feel for the repentant recruit--and -properly, one may be permitted to think, for he is only a youth and -ignorant and persuadable to his hurt--but sympathy for him is not kept in -stock by the recruiter. Rev. Mr. Gray says: - - "A captain many years in the traffic explained to me how a penitent - could betaken. 'When a boy jumps overboard we just take a boat and - pull ahead of him, then lie between him and the shore. If he has - not tired himself swimming, and passes the boat, keep on heading him - in this way. The dodge rarely fails. The boy generally tires of - swimming, gets into the boat of his own accord, and goes quietly on - board." - -Yes, exhaustion is likely to make a boy quiet. If the distressed boy had -been the speaker's son, and the captors savages, the speaker would have -been surprised to see how differently the thing looked from the new point -of view; however, it is not our custom to put ourselves in the other -person's place. Somehow there is something pathetic about that -disappointed young savage's resignation. I must explain, here, that in -the traffic dialect, "boy" does not always mean boy; it means a youth -above sixteen years of age. That is by Queensland law the age of -consent, though it is held that recruiters allow themselves some latitude -in guessing at ages. - -Captain Wawn of the free spirit chafes under the annoyance of "cast-iron -regulations." They and the missionaries have poisoned his life. He -grieves for the good old days, vanished to come no more. See him weep; -hear him cuss between the lines! - - "For a long time we were allowed to apprehend and detain all - deserters who had signed the agreement on board ship, but the - 'cast-iron' regulations of the Act of 1884 put a stop to that, - allowing the Kanaka to sign the agreement for three years' service, - travel about in the ship in receipt of the regular rations, cadge - all he could, and leave when he thought fit, so long as he did not - extend his pleasure trip to Queensland." - -Rev. Mr. Gray calls this same restrictive cast-iron law a "farce." "There -is as much cruelty and injustice done to natives by acts that are legal -as by deeds unlawful. The regulations that exist are unjust and -inadequate--unjust and inadequate they must ever be." He furnishes his -reasons for his position, but they are too long for reproduction here. - -However, if the most a Kanaka advantages himself by a three-years course -in civilization in Queensland, is a necklace and an umbrella and a showy -imperfection in the art of swearing, it must be that all the profit of -the traffic goes to the white man. This could be twisted into a -plausible argument that the traffic ought to be squarely abolished. - -However, there is reason for hope that that can be left alone to achieve -itself. It is claimed that the traffic will depopulate its sources of -supply within the next twenty or thirty years. Queensland is a very -healthy place for white people--death-rate 12 in 1,000 of the population ---but the Kanaka death-rate is away above that. The vital statistics for -1893 place it at 52; for 1894 (Mackay district), 68. The first six -months of the Kanaka's exile are peculiarly perilous for him because of -the rigors of the new climate. The death-rate among the new men has -reached as high as 180 in the 1,000. In the Kanaka's native home his -death-rate is 12 in time of peace, and 15 in time of war. Thus exile to -Queensland--with the opportunity to acquire civilization, an umbrella, -and a pretty poor quality of profanity--is twelve times as deadly for him -as war. Common Christian charity, common humanity, does seem to require, -not only that these people be returned to their homes, but that war, -pestilence, and famine be introduced among them for their preservation. - -Concerning these Pacific isles and their peoples an eloquent prophet -spoke long years ago--five and fifty years ago. In fact, he spoke a -little too early. Prophecy is a good line of business, but it is full of -risks. This prophet was the Right Rev. M. Russell, LL.D., D.C.L., of -Edinburgh: - - "Is the tide of civilization to roll only to the foot of the Rocky - Mountains, and is the sun of knowledge to set at last in the waves - of the Pacific? No; the mighty day of four thousand years is - drawing to its close; the sun of humanity has performed its destined - course; but long ere its setting rays are extinguished in the west, - its ascending beams have glittered on the isles of the eastern seas - . . . . And now we see the race of Japhet setting forth to - people the isles, and the seeds of another Europe and a second - England sown in the regions of the sun. But mark the words of the - prophecy: 'He shall dwell in the tents of Shem, and Canaan shall be - his servant.' It is not said Canaan shall be his slave. To the - Anglo-Saxon race is given the scepter of the globe, but there is not - given either the lash of the slave-driver or the rack of the - executioner. The East will not be stained with the same atrocities - as the West; the frightful gangrene of an enthralled race is not to - mar the destinies of the family of Japhet in the Oriental world; - humanizing, not destroying, as they advance; uniting with, not - enslaving, the inhabitants with whom they dwell, the British race - may," etc., etc. - -And he closes his vision with an invocation from Thomson: - - "Come, bright Improvement! on the car of Time, - And rule the spacious world from clime to clime." - -Very well, Bright Improvement has arrived, you see, with her -civilization, and her Waterbury, and her umbrella, and her third-quality -profanity, and her humanizing-not-destroying machinery, and her -hundred-and-eighty death-rate, and everything is going along just as -handsome! - -But the prophet that speaks last has an advantage over the pioneer in the -business. Rev. Mr. Gray says: - - "What I am concerned about is that we as a Christian nation should - wipe out these races to enrich ourselves." - -And he closes his pamphlet with a grim Indictment which is as eloquent in -its flowerless straightforward English as is the hand-painted rhapsody of -the early prophet: - - "My indictment of the Queensland-Kanaka Labor Traffic is this - - "1. It generally demoralizes and always impoverishes the Kanaka, - deprives him of his citizenship, and depopulates the islands fitted - to his home. - - "2. It is felt to lower the dignity of the white agricultural - laborer in Queensland, and beyond a doubt it lowers his wages there. - - "3. The whole system is fraught with danger to Australia and the - islands on the score of health. - - "4. On social and political grounds the continuance of the - Queensland Kanaka Labor Traffic must be a barrier to the true - federation of the Australian colonies. - - "5. The Regulations under which the Traffic exists in Queensland are - inadequate to prevent abuses, and in the nature of things they must - remain so. - - "6. The whole system is contrary to the spirit and doctrine of the - Gospel of Jesus Christ. The Gospel requires us to help the weak, - but the Kanaka is fleeced and trodden down. - - "7. The bed-rock of this Traffic is that the life and liberty of a - black man are of less value than those of a white man. And a - Traffic that has grown out of 'slave-hunting' will certainly remain - to the end not unlike its origin." - - - - -CHAPTER VII. - -Truth is the most valuable thing we have. Let us economize it. - --Pudd'nhead Wilson's New Calendar. - -From Diary:--For a day or two we have been plowing among an invisible -vast wilderness of islands, catching now and then a shadowy glimpse of a -member of it. There does seem to be a prodigious lot of islands this -year; the map of this region is freckled and fly-specked all over with -them. Their number would seem to be uncountable. We are moving among -the Fijis now--224 islands and islets in the group. In front of us, to -the west, the wilderness stretches toward Australia, then curves upward -to New Guinea, and still up and up to Japan; behind us, to the east, the -wilderness stretches sixty degrees across the wastes of the Pacific; -south of us is New Zealand. Somewhere or other among these myriads Samoa -is concealed, and not discoverable on the map. Still, if you wish to go -there, you will have no trouble about finding it if you follow the -directions given by Robert Louis Stevenson to Dr. Conan Doyle and to Mr. -J. M. Barrie. "You go to America, cross the continent to San Francisco, -and then it's the second turning to the left." To get the full flavor of -the joke one must take a glance at the map. - -Wednesday, September 11.--Yesterday we passed close to an island or so, -and recognized the published Fiji characteristics: a broad belt of clean -white coral sand around the island; back of it a graceful fringe of -leaning palms, with native huts nestling cosily among the shrubbery at -their bases; back of these a stretch of level land clothed in tropic -vegetation; back of that, rugged and picturesque mountains. A detail -of the immediate foreground: a mouldering ship perched high up on a -reef-bench. This completes the composition, and makes the picture -artistically perfect. - -In the afternoon we sighted Suva, the capital of the group, and threaded -our way into the secluded little harbor--a placid basin of brilliant blue -and green water tucked snugly in among the sheltering hills. A few ships -rode at anchor in it--one of them a sailing vessel flying the American -flag; and they said she came from Duluth! There's a journey! Duluth is -several thousand miles from the sea, and yet she is entitled to the proud -name of Mistress of the Commercial Marine of the United States of -America. There is only one free, independent, unsubsidized American ship -sailing the foreign seas, and Duluth owns it. All by itself that ship is -the American fleet. All by itself it causes the American name and power -to be respected in the far regions of the globe. All by itself it -certifies to the world that the most populous civilized nation, in the -earth has a just pride in her stupendous stretch of sea-front, and is -determined to assert and maintain her rightful place as one of the Great -Maritime Powers of the Planet. All by itself it is making foreign eyes -familiar with a Flag which they have not seen before for forty years, -outside of the museum. For what Duluth has done, in building, equipping, -and maintaining at her sole expense the American Foreign Commercial -Fleet, and in thus rescuing the American name from shame and lifting it -high for the homage of the nations, we owe her a debt of gratitude which -our hearts shall confess with quickened beats whenever her name is named -henceforth. Many national toasts will die in the lapse of time, but -while the flag flies and the Republic survives, they who live under their -shelter will still drink this one, standing and uncovered: Health and -prosperity to Thee, O Duluth, American Queen of the Alien Seas! - -Row-boats began to flock from the shore; their crews were the first -natives we had seen. These men carried no overplus of clothing, and this -was wise, for the weather was hot. Handsome, great dusky men they were, -muscular, clean-limbed, and with faces full of character and -intelligence. It would be hard to find their superiors anywhere among -the dark races, I should think. - -Everybody went ashore to look around, and spy out the land, and have that -luxury of luxuries to sea-voyagers--a land-dinner. And there we saw more -natives: Wrinkled old women, with their flat mammals flung over their -shoulders, or hanging down in front like the cold-weather drip from the -molasses-faucet; plump and smily young girls, blithe and content, easy -and graceful, a pleasure to look at; young matrons, tall, straight, -comely, nobly built, sweeping by with chin up, and a gait incomparable -for unconscious stateliness and dignity; majestic young men athletes for -build and muscle clothed in a loose arrangement of dazzling white, with -bronze breast and bronze legs naked, and the head a cannon-swab of solid -hair combed straight out from the skull and dyed a rich brick-red. Only -sixty years ago they were sunk in darkness; now they have the bicycle. -We strolled about the streets of the white folks' little town, and around -over the hills by paths and roads among European dwellings and gardens -and plantations, and past clumps of hibiscus that made a body blink, the -great blossoms were so intensely red; and by and by we stopped to ask an -elderly English colonist a question or two, and to sympathize with him -concerning the torrid weather; but he was surprised, and said: - -"This? This is not hot. You ought to be here in the summer time once." - -"We supposed that this was summer; it has the ear-marks of it. You could -take it to almost any country and deceive people with it. But if it -isn't summer, what does it lack?" - -"It lacks half a year. This is mid-winter." - -I had been suffering from colds for several months, and a sudden change -of season, like this, could hardly fail to do me hurt. It brought on -another cold. It is odd, these sudden jumps from season to season. A -fortnight ago we left America in mid-summer, now it is midwinter; about a -week hence we shall arrive in Australia in the spring. - -After dinner I found in the billiard-room a resident whom I had known -somewhere else in the world, and presently made, some new friends and -drove with them out into the country to visit his Excellency the head of -the State, who was occupying his country residence, to escape the rigors -of the winter weather, I suppose, for it was on breezy high ground and -much more comfortable than the lower regions, where the town is, and -where the winter has full swing, and often sets a person's hair afire -when he takes off his hat to bow. There is a noble and beautiful view of -ocean and islands and castellated peaks from the governor's high-placed -house, and its immediate surroundings lie drowsing in that dreamy repose -and serenity which are the charm of life in the Pacific Islands. - -One of the new friends who went out there with me was a large man, and I -had been admiring his size all the way. I was still admiring it as he -stood by the governor on the veranda, talking; then the Fijian butler -stepped out there to announce tea, and dwarfed him. Maybe he did not -quite dwarf him, but at any rate the contrast was quite striking. -Perhaps that dark giant was a king in a condition of political -suspension. I think that in the talk there on the veranda it was said -that in Fiji, as in the Sandwich Islands, native kings and chiefs are of -much grander size and build than the commoners. This man was clothed in -flowing white vestments, and they were just the thing for him; they -comported well with his great stature and his kingly port and dignity. -European clothes would have degraded him and made him commonplace. I -know that, because they do that with everybody that wears them. - -It was said that the old-time devotion to chiefs and reverence for their -persons still survive in the native commoner, and in great force. The -educated young gentleman who is chief of the tribe that live in the -region about the capital dresses in the fashion of high-class European -gentlemen, but even his clothes cannot damn him in the reverence of his -people. Their pride in his lofty rank and ancient lineage lives on, in -spite of his lost authority and the evil magic of his tailor. He has no -need to defile himself with work, or trouble his heart with the sordid -cares of life; the tribe will see to it that he shall not want, and that -he shall hold up his head and live like a gentleman. I had a glimpse of -him down in the town. Perhaps he is a descendant of the last king--the -king with the difficult name whose memory is preserved by a notable -monument of cut-stone which one sees in the enclosure in the middle of -the town. Thakombau--I remember, now; that is the name. It is easier to -preserve it on a granite block than in your head. - -Fiji was ceded to England by this king in 1858. One of the gentlemen -present at the governor's quoted a remark made by the king at the time of -the session--a neat retort, and with a touch of pathos in it, too. The -English Commissioner had offered a crumb of comfort to Thakombau by -saying that the transfer of the kingdom to Great Britain was merely "a -sort of hermit-crab formality, you know." "Yes," said poor Thakombau, -"but with this difference--the crab moves into an unoccupied shell, but -mine isn't." - -However, as far as I can make out from the books, the King was between -the devil and the deep sea at the time, and hadn't much choice. He owed -the United States a large debt--a debt which he could pay if allowed -time, but time was denied him. He must pay up right away or the warships -would be upon him. To protect his people from this disaster he ceded his -country to Britain, with a clause in the contract providing for the -ultimate payment of the American debt. - -In old times the Fijians were fierce fighters; they were very religious, -and worshiped idols; the big chiefs were proud and haughty, and they were -men of great style in many ways; all chiefs had several wives, the -biggest chiefs sometimes had as many as fifty; when a chief was dead and -ready for burial, four or five of his wives were strangled and put into -the grave with him. In 1804 twenty-seven British convicts escaped from -Australia to Fiji, and brought guns and ammunition with them. Consider -what a power they were, armed like that, and what an opportunity they -had. If they had been energetic men and sober, and had had brains and -known how to use them, they could have achieved the sovereignty of the -archipelago twenty-seven kings and each with eight or nine islands under -his scepter. But nothing came of this chance. They lived worthless -lives of sin and luxury, and died without honor--in most cases by -violence. Only one of them had any ambition; he was an Irishman named -Connor. He tried to raise a family of fifty children, and scored -forty-eight. He died lamenting his failure. It was a foolish sort -of avarice. Many a father would have been rich enough with forty. - -It is a fine race, the Fijians, with brains in their heads, and an -inquiring turn of mind. It appears that their savage ancestors had a -doctrine of immortality in their scheme of religion--with limitations. -That is to say, their dead friend would go to a happy hereafter if he -could be accumulated, but not otherwise. They drew the line; they -thought that the missionary's doctrine was too sweeping, too -comprehensive. They called his attention to certain facts. For -instance, many of their friends had been devoured by sharks; the sharks, -in their turn, were caught and eaten by other men; later, these men were -captured in war, and eaten by the enemy. The original persons had -entered into the composition of the sharks; next, they and the sharks had -become part of the flesh and blood and bone of the cannibals. How, then, -could the particles of the original men be searched out from the final -conglomerate and put together again? The inquirers were full of doubts, -and considered that the missionary had not examined the matter with--the -gravity and attention which so serious a thing deserved. - -The missionary taught these exacting savages many valuable things, and -got from them one--a very dainty and poetical idea: Those wild and -ignorant poor children of Nature believed that the flowers, after they -perish, rise on the winds and float away to the fair fields of heaven, -and flourish there forever in immortal beauty! - - - - -CHAPTER VIII. - -It could probably be shown by facts and figures that there is no -distinctly native American criminal class except Congress. - --Pudd'nhead Wilson's New Calendar. - -When one glances at the map the members of the stupendous island -wilderness of the Pacific seem to crowd upon each other; but no, there is -no crowding, even in the center of a group; and between groups there are -lonely wide deserts of sea. Not everything is known about the islands, -their peoples and their languages. A startling reminder of this is -furnished by the fact that in Fiji, twenty years ago, were living two -strange and solitary beings who came from an unknown country and spoke an -unknown language. "They were picked up by a passing vessel many hundreds -of miles from any known land, floating in the same tiny canoe in which -they had been blown out to sea. When found they were but skin and bone. -No one could understand what they said, and they have never named their -country; or, if they have, the name does not correspond with that of any -island on any chart. They are now fat and sleek, and as happy as the day -is long. In the ship's log there is an entry of the latitude and -longitude in which they were found, and this is probably all the clue -they will ever have to their lost homes."--[Forbes's "Two Years in -Fiji."] - -What a strange and romantic episode it is; and how one is tortured with -curiosity to know whence those mysterious creatures came, those Men -Without a Country, errant waifs who cannot name their lost home, -wandering Children of Nowhere. - -Indeed, the Island Wilderness is the very home of romance and dreams and -mystery. The loneliness, the solemnity, the beauty, and the deep repose -of this wilderness have a charm which is all their own for the bruised -spirit of men who have fought and failed in the struggle for life in the -great world; and for men who have been hunted out of the great world for -crime; and for other men who love an easy and indolent existence; and for -others who love a roving free life, and stir and change and adventure; -and for yet others who love an easy and comfortable career of trading and -money-getting, mixed with plenty of loose matrimony by purchase, divorce -without trial or expense, and limitless spreeing thrown in to make life -ideally perfect. - -We sailed again, refreshed. - -The most cultivated person in the ship was a young English, man whose -home was in New Zealand. He was a naturalist. His learning in his -specialty was deep and thorough, his interest in his subject amounted to -a passion, he had an easy gift of speech; and so, when he talked about -animals it was a pleasure to listen to him. And profitable, too, though -he was sometimes difficult to understand because now and then he used -scientific technicalities which were above the reach of some of us. They -were pretty sure to be above my reach, but as he was quite willing to -explain them I always made it a point to get him to do it. I had a fair -knowledge of his subject--layman's knowledge--to begin with, but it was -his teachings which crystalized it into scientific form and clarity--in a -word, gave it value. - -His special interest was the fauna of Australasia, and his knowledge of -the matter was as exhaustive as it was accurate. I already knew a good -deal about the rabbits in Australasia and their marvelous fecundity, but -in my talks with him I found that my estimate of the great hindrance and -obstruction inflicted by the rabbit pest upon traffic and travel was far -short of the facts. He told me that the first pair of rabbits imported -into Australasia bred so wonderfully that within six months rabbits were -so thick in the land that people had to dig trenches through them to get -from town to town. - -He told me a great deal about worms, and the kangaroo, and other -coleoptera, and said he knew the history and ways of all such -pachydermata. He said the kangaroo had pockets, and carried its young in -them when it couldn't get apples. And he said that the emu was as big as -an ostrich, and looked like one, and had an amorphous appetite and would -eat bricks. Also, that the dingo was not a dingo at all, but just a wild -dog; and that the only difference between a dingo and a dodo was that -neither of them barked; otherwise they were just the same. He said that -the only game-bird in Australia was the wombat, and the only song-bird -the larrikin, and that both were protected by government. The most -beautiful of the native birds was the bird of Paradise. Next came the -two kinds of lyres; not spelt the same. He said the one kind was dying -out, the other thickening up. He explained that the "Sundowner" was not -a bird it was a man; sundowner was merely the Australian equivalent of -our word, tramp. He is a loafer, a hard drinker, and a sponge. He -tramps across the country in the sheep-shearing season, pretending to -look for work; but he always times himself to arrive at a sheep-run just -at sundown, when the day's labor ends; all he wants is whisky and supper -and bed and breakfast; he gets them and then disappears. The naturalist -spoke of the bell bird, the creature that at short intervals all day -rings out its mellow and exquisite peal from the deeps of the forest. It -is the favorite and best friend of the weary and thirsty sundowner; for -he knows that wherever the bell bird is, there is water; and he goes -somewhere else. The naturalist said that the oddest bird in Australasia -was the, Laughing Jackass, and the biggest the now extinct Great Moa. - -The Moa stood thirteen feet high, and could step over an ordinary man's -head or kick his hat off; and his head, too, for that matter. He said it -was wingless, but a swift runner. The natives used to ride it. It could -make forty miles an hour, and keep it up for four hundred miles and come -out reasonably fresh. It was still in existence when the railway was -introduced into New Zealand; still in existence, and carrying the mails. -The railroad began with the same schedule it has now: two expresses a -week-time, twenty miles an hour. The company exterminated the moa to get -the mails. - -Speaking of the indigenous coneys and bactrian camels, the naturalist -said that the coniferous and bacteriological output of Australasia was -remarkable for its many and curious departures from the accepted laws -governing these species of tubercles, but that in his opinion Nature's -fondness for dabbling in the erratic was most notably exhibited in that -curious combination of bird, fish, amphibian, burrower, crawler, -quadruped, and Christian called the Ornithorhynchus--grotesquest of -animals, king of the animalculae of the world for versatility of -character and make-up. Said he: - - "You can call it anything you want to, and be right. It is a fish, - for it lives in the river half the time; it is a land animal, for it - resides on the land half the time; it is an amphibian, since it - likes both and does not know which it prefers; it is a hybernian, - for when times are dull and nothing much going on it buries itself - under the mud at the bottom of a puddle and hybernates there a - couple of weeks at a time; it is a kind of duck, for it has a - duck-bill and four webbed paddles; it is a fish and quadruped - together, for in the water it swims with the paddles and on shore it - paws itself across country with them; it is a kind of seal, for it - has a seal's fur; it is carnivorous, herbivorous, insectivorous, and - vermifuginous, for it eats fish and grass and butterflies, and in - the season digs worms out of the mud and devours them; it is clearly - a bird, for it lays eggs, and hatches them; it is clearly a mammal, - for it nurses its young; and it is manifestly a kind of Christian, - for it keeps the Sabbath when there is anybody around, and when - there isn't, doesn't. It has all the tastes there are except - refined ones, it has all the habits there are except good ones. - - "It is a survival--a survival of the fittest. Mr. Darwin invented - the theory that goes by that name, but the Ornithorhynchus was the - first to put it to actual experiment and prove that it could be - done. Hence it should have as much of the credit as Mr. Darwin. - It was never in the Ark; you will find no mention of it there; it - nobly stayed out and worked the theory. Of all creatures in the - world it was the only one properly equipped for the test. The Ark - was thirteen months afloat, and all the globe submerged; no land - visible above the flood, no vegetation, no food for a mammal to eat, - nor water for a mammal to drink; for all mammal food was destroyed, - and when the pure floods from heaven and the salt oceans of the - earth mingled their waters and rose above the mountain tops, the - result was a drink which no bird or beast of ordinary construction - could use and live. But this combination was nuts for the - Ornithorhynchus, if I may use a term like that without offense. - Its river home had always been salted by the flood-tides of the sea. - On the face of the Noachian deluge innumerable forest trees were - floating. Upon these the Ornithorhynchus voyaged in peace; voyaged - from clime to clime, from hemisphere to hemisphere, in contentment - and comfort, in virile interest in the constant change Of scene, in - humble thankfulness for its privileges, in ever-increasing - enthusiasm in the development of the great theory upon whose - validity it had staked its life, its fortunes, and its sacred honor, - if I may use such expressions without impropriety in connection with - an episode of this nature. - - "It lived the tranquil and luxurious life of a creature of - independent means. Of things actually necessary to its existence - and its happiness not a detail was wanting. When it wished to walk, - it scrambled along the tree-trunk; it mused in the shade of the - leaves by day, it slept in their shelter by night; when it wanted - the refreshment of a swim, it had it; it ate leaves when it wanted a - vegetable diet, it dug under the bark for worms and grubs; when it - wanted fish it caught them, when it wanted eggs it laid them. If - the grubs gave out in one tree it swam to another; and as for fish, - the very opulence of the supply was an embarrassment. And finally, - when it was thirsty it smacked its chops in gratitude over a blend - that would have slain a crocodile. - - "When at last, after thirteen months of travel and research in all - the Zones it went aground on a mountain-summit, it strode ashore, - saying in its heart, 'Let them that come after me invent theories - and dream dreams about the Survival of the Fittest if they like, but - I am the first that has done it! - - "This wonderful creature dates back like the kangaroo and many other - Australian hydrocephalous invertebrates, to an age long anterior to - the advent of man upon the earth; they date back, indeed, to a time - when a causeway hundreds of miles wide, and thousands of miles long, - joined Australia to Africa, and the animals of the two countries - were alike, and all belonged to that remote geological epoch known - to science as the Old Red Grindstone Post-Pleosaurian. Later the - causeway sank under the sea; subterranean convulsions lifted the - African continent a thousand feet higher than it was before, but - Australia kept her old level. In Africa's new climate the animals - necessarily began to develop and shade off into new forms and - families and species, but the animals of Australia as necessarily - remained stationary, and have so remained until this day. In the - course of some millions of years the African Ornithorhynchus - developed and developed and developed, and sluffed off detail after - detail of its make-up until at last the creature became wholly - disintegrated and scattered. Whenever you see a bird or a beast or - a seal or an otter in Africa you know that he is merely a sorry - surviving fragment of that sublime original of whom I have been - speaking--that creature which was everything in general and nothing - in particular--the opulently endowed 'e pluribus unum' of the animal - world. - - "Such is the history of the most hoary, the most ancient, the most - venerable creature that exists in the earth today--Ornithorhynchus - Platypus Extraordinariensis--whom God preserve!" - -When he was strongly moved he could rise and soar like that with ease. -And not only in the prose form, but in the poetical as well. He had -written many pieces of poetry in his time, and these manuscripts he lent -around among the passengers, and was willing to let them be copied. It -seemed to me that the least technical one in the series, and the one -which reached the loftiest note, perhaps, was his: - - INVOCATION. - - "Come forth from thy oozy couch, - O Ornithorhynchus dear! - And greet with a cordial claw - The stranger that longs to hear - - "From thy own own lips the tale - Of thy origin all unknown: - Thy misplaced bone where flesh should be - And flesh where should be bone; - - "And fishy fin where should be paw, - And beaver-trowel tail, - And snout of beast equip'd with teeth - Where gills ought to prevail. - - "Come, Kangaroo, the good and true - Foreshortened as to legs, - And body tapered like a churn, - And sack marsupial, i' fegs, - - "And tells us why you linger here, - Thou relic of a vanished time, - When all your friends as fossils sleep, - Immortalized in lime!" - - -Perhaps no poet is a conscious plagiarist; but there seems to be warrant -for suspecting that there is no poet who is not at one time or another an -unconscious one. The above verses are indeed beautiful, and, in a way, -touching; but there is a haunting something about them which unavoidably -suggests the Sweet Singer of Michigan. It can hardly be doubted that the -author had read the works of that poet and been impressed by them. It is -not apparent that he has borrowed from them any word or yet any phrase, -but the style and swing and mastery and melody of the Sweet Singer all -are there. Compare this Invocation with "Frank Dutton"--particularly -stanzas first and seventeenth--and I think the reader will feel convinced -that he who wrote the one had read the other: - - I. - - "Frank Dutton was as fine a lad - As ever you wish to see, - And he was drowned in Pine Island Lake - On earth no more will he be, - His age was near fifteen years, - And he was a motherless boy, - He was living with his grandmother - When he was drowned, poor boy." - - - XVII. - - "He was drowned on Tuesday afternoon, - On Sunday he was found, - And the tidings of that drowned boy - Was heard for miles around. - His form was laid by his mother's side, - Beneath the cold, cold ground, - His friends for him will drop a tear - When they view his little mound." - - The Sentimental Song Book. By Mrs. Julia Moore, p. 36. - - - - -CHAPTER IX. - -It is your human environment that makes climate. - --Pudd'nhead Wilson's New Calendar. - -Sept. 15--Night. Close to Australia now. Sydney 50 miles distant. - -That note recalls an experience. The passengers were sent for, to come -up in the bow and see a fine sight. It was very dark. One could not -follow with the eye the surface of the sea more than fifty yards in any -direction it dimmed away and became lost to sight at about that distance -from us. But if you patiently gazed into the darkness a little while, -there was a sure reward for you. Presently, a quarter of a mile away you -would see a blinding splash or explosion of light on the water--a flash -so sudden and so astonishingly brilliant that it would make you catch -your breath; then that blotch of light would instantly extend itself and -take the corkscrew shape and imposing length of the fabled sea-serpent, -with every curve of its body and the "break" spreading away from its -head, and the wake following behind its tail clothed in a fierce splendor -of living fire. And my, but it was coming at a lightning gait! Almost -before you could think, this monster of light, fifty feet long, would go -flaming and storming by, and suddenly disappear. And out in the distance -whence he came you would see another flash; and another and another and -another, and see them turn into sea-serpents on the instant; and once -sixteen flashed up at the same time and came tearing towards us, a swarm -of wiggling curves, a moving conflagration, a vision of bewildering -beauty, a spectacle of fire and energy whose equal the most of those -people will not see again until after they are dead. - -It was porpoises--porpoises aglow with phosphorescent light. They -presently collected in a wild and magnificent jumble under the bows, and -there they played for an hour, leaping and frollicking and carrying on, -turning summersaults in front of the stem or across it and never getting -hit, never making a miscalculation, though the stem missed them only -about an inch, as a rule. They were porpoises of the ordinary length ---eight or ten feet--but every twist of their bodies sent a long -procession of united and glowing curves astern. That fiery jumble was -an enchanting thing to look at, and we stayed out the performance; one -cannot have such a show as that twice in a lifetime. The porpoise is the -kitten of the sea; he never has a serious thought, he cares for nothing -but fun and play. But I think I never saw him at his winsomest until -that night. It was near a center of civilization, and he could have been -drinking. - -By and by, when we had approached to somewhere within thirty miles of -Sydney Heads the great electric light that is posted on one of those -lofty ramparts began to show, and in time the little spark grew to a -great sun and pierced the firmament of darkness with a far-reaching sword -of light. - -Sydney Harbor is shut in behind a precipice that extends some miles like -a wall, and exhibits no break to the ignorant stranger. It has a break -in the middle, but it makes so little show that even Captain Cook sailed -by it without seeing it. Near by that break is a false break which -resembles it, and which used to make trouble for the mariner at night, in -the early days before the place was lighted. It caused the memorable -disaster to the Duncan Dunbar, one of the most pathetic tragedies in the -history of that pitiless ruffian, the sea. The ship was a sailing -vessel; a fine and favorite passenger packet, commanded by a popular -captain of high reputation. She was due from England, and Sydney was -waiting, and counting the hours; counting the hours, and making ready to -give her a heart-stirring welcome; for she was bringing back a great -company of mothers and daughters, the long-missed light and bloom of life -of Sydney homes; daughters that had been years absent at school, and -mothers that had been with them all that time watching over them. Of all -the world only India and Australasia have by custom freighted ships and -fleets with their hearts, and know the tremendous meaning of that phrase; -only they know what the waiting is like when this freightage is entrusted -to the fickle winds, not steam, and what the joy is like when the ship -that is returning this treasure comes safe to port and the long dread is -over. - -On board the Duncan Dunbar, flying toward Sydney Heads in the waning -afternoon, the happy home-comers made busy preparation, for it was not -doubted that they would be in the arms of their friends before the day -was done; they put away their sea-going clothes and put on clothes meeter -for the meeting, their richest and their loveliest, these poor brides of -the grave. But the wind lost force, or there was a miscalculation, and -before the Heads were sighted the darkness came on. It was said that -ordinarily the captain would have made a safe offing and waited for the -morning; but this was no ordinary occasion; all about him were appealing -faces, faces pathetic with disappointment. So his sympathy moved him to -try the dangerous passage in the dark. He had entered the Heads -seventeen times, and believed he knew the ground. So he steered straight -for the false opening, mistaking it for the true one. He did not find -out that he was wrong until it was too late. There was no saving the -ship. The great seas swept her in and crushed her to splinters and -rubbish upon the rock tushes at the base of the precipice. Not one of -all that fair and gracious company was ever seen again alive. The tale -is told to every stranger that passes the spot, and it will continue to -be told to all that come, for generations; but it will never grow old, -custom cannot stale it, the heart-break that is in it can never perish -out of it. - -There were two hundred persons in the ship, and but one survived the -disaster. He was a sailor. A huge sea flung him up the face of the -precipice and stretched him on a narrow shelf of rock midway between the -top and the bottom, and there he lay all night. At any other time he -would have lain there for the rest of his life, without chance of -discovery; but the next morning the ghastly news swept through Sydney -that the Duncan Dunbar had gone down in sight of home, and straightway -the walls of the Heads were black with mourners; and one of these, -stretching himself out over the precipice to spy out what might be seen -below, discovered this miraculously preserved relic of the wreck. Ropes -were brought and the nearly impossible feat of rescuing the man was -accomplished. He was a person with a practical turn of mind, and he -hired a hall in Sydney and exhibited himself at sixpence a head till he -exhausted the output of the gold fields for that year. - -We entered and cast anchor, and in the morning went oh-ing and ah-ing in -admiration up through the crooks and turns of the spacious and beautiful -harbor--a harbor which is the darling of Sydney and the wonder of the -world. It is not surprising that the people are proud of it, nor that -they put their enthusiasm into eloquent words. A returning citizen asked -me what I thought of it, and I testified with a cordiality which I judged -would be up to the market rate. I said it was beautiful--superbly -beautiful. Then by a natural impulse I gave God the praise. The citizen -did not seem altogether satisfied. He said: - -"It is beautiful, of course it's beautiful--the Harbor; but that isn't -all of it, it's only half of it; Sydney's the other half, and it takes -both of them together to ring the supremacy-bell. God made the Harbor, -and that's all right; but Satan made Sydney." - -Of course I made an apology; and asked him to convey it to his friend. -He was right about Sydney being half of it. It would be beautiful -without Sydney, but not above half as beautiful as it is now, with Sydney -added. It is shaped somewhat like an oak-leaf-a roomy sheet of lovely -blue water, with narrow off-shoots of water running up into the country -on both sides between long fingers of land, high wooden ridges with sides -sloped like graves. Handsome villas are perched here and there on these -ridges, snuggling amongst the foliage, and one catches alluring glimpses -of them as the ship swims by toward the city. The city clothes a cluster -of hills and a ruffle of neighboring ridges with its undulating masses of -masonry, and out of these masses spring towers and spires and other -architectural dignities and grandeurs that break the flowing lines and -give picturesqueness to the general effect. - -The narrow inlets which I have mentioned go wandering out into the land -everywhere and hiding themselves in it, and pleasure-launches are always -exploring them with picnic parties on board. It is said by trustworthy -people that if you explore them all you will find that you have covered -700 miles of water passage. But there are liars everywhere this year, -and they will double that when their works are in good going order. -October was close at hand, spring was come. It was really spring ---everybody said so; but you could have sold it for summer in Canada, and -nobody would have suspected. It was the very weather that makes our home -summers the perfection of climatic luxury; I mean, when you are out in -the wood or by the sea. But these people said it was cool, now--a person -ought to see Sydney in the summer time if he wanted to know what warm -weather is; and he ought to go north ten or fifteen hundred miles if he -wanted to know what hot weather is. They said that away up there toward -the equator the hens laid fried eggs. Sydney is the place to go to get -information about other people's climates. It seems to me that the -occupation of Unbiased Traveler Seeking Information is the pleasantest -and most irresponsible trade there is. The traveler can always find out -anything he wants to, merely by asking. He can get at all the facts, and -more. Everybody helps him, nobody hinders him. Anybody who has an old -fact in stock that is no longer negotiable in the domestic market will -let him have it at his own price. An accumulation of such goods is -easily and quickly made. They cost almost nothing and they bring par in -the foreign market. Travelers who come to America always freight up with -the same old nursery tales that their predecessors selected, and they -carry them back and always work them off without any trouble in the home -market. - -If the climates of the world were determined by parallels of latitude, -then we could know a place's climate by its position on the map; and so -we should know that the climate of Sydney was the counterpart of the -climate of Columbia, S. C., and of Little Rock, Arkansas, since Sydney is -about the same distance south of the equator that those other towns are -north of-it-thirty-four degrees. But no, climate disregards the -parallels of latitude. In Arkansas they have a winter; in Sydney they -have the name of it, but not the thing itself. I have seen the ice in -the Mississippi floating past the mouth of the Arkansas river; and at -Memphis, but a little way above, the Mississippi has been frozen over, -from bank to bank. But they have never had a cold spell in Sydney which -brought the mercury down to freezing point. Once in a mid-winter day -there, in the month of July, the mercury went down to 36 deg., and that -remains the memorable "cold day" in the history of the town. No doubt -Little Rock has seen it below zero. Once, in Sydney, in mid-summer, -about New Year's Day, the mercury went up to 106 deg. in the shade, and -that is Sydney's memorable hot day. That would about tally with Little -Rock's hottest day also, I imagine. My Sydney figures are taken from a -government report, and are trustworthy. In the matter of summer weather -Arkansas has no advantage over Sydney, perhaps, but when it comes to -winter weather, that is another affair. You could cut up an Arkansas -winter into a hundred Sydney winters and have enough left for Arkansas -and the poor. - -The whole narrow, hilly belt of the Pacific side of New South Wales has -the climate of its capital--a mean winter temperature of 54 deg. and a -mean summer one of 71 deg. It is a climate which cannot be improved upon -for healthfulness. But the experts say that 90 deg. in New South Wales -is harder to bear than 112 deg. in the neighboring colony of Victoria, -because the atmosphere of the former is humid, and of the latter dry. -The mean temperature of the southernmost point of New South Wales is the -same as that of Nice--60 deg.--yet Nice is further from the equator by -460 miles than is the former. - -But Nature is always stingy of perfect climates; stingier in the case of -Australia than usual. Apparently this vast continent has a really good -climate nowhere but around the edges. - -If we look at a map of the world we are surprised to see how big -Australia is. It is about two-thirds as large as the United States was -before we added Alaska. - -But where as one finds a sufficiently good climate and fertile land -almost everywhere in the United States, it seems settled that inside of -the Australian border-belt one finds many deserts and in spots a climate -which nothing can stand except a few of the hardier kinds of rocks. In -effect, Australia is as yet unoccupied. If you take a map of the United -States and leave the Atlantic sea-board States in their places; also the -fringe of Southern States from Florida west to the Mouth of the -Mississippi; also a narrow, inhabited streak up the Mississippi half-way -to its head waters; also a narrow, inhabited border along the Pacific -coast: then take a brushful of paint and obliterate the whole remaining -mighty stretch of country that lies between the Atlantic States and the -Pacific-coast strip, your map will look like the latest map of Australia. - -This stupendous blank is hot, not to say torrid; a part of it is fertile, -the rest is desert; it is not liberally watered; it has no towns. One -has only to cross the mountains of New South Wales and descend into the -westward-lying regions to find that he has left the choice climate behind -him, and found a new one of a quite different character. In fact, he -would not know by the thermometer that he was not in the blistering -Plains of India. Captain Sturt, the great explorer, gives us a sample of -the heat. - - "The wind, which had been blowing all the morning from the N.E., - increased to a heavy gale, and I shall never forget its withering - effect. I sought shelter behind a large gum-tree, but the blasts of - heat were so terrific that I wondered the very grass did not take - fire. This really was nothing ideal: everything both animate and - inanimate gave way before it; the horses stood with their backs to - the wind and their noses to the ground, without the muscular - strength to raise their heads; the birds were mute, and the leaves - of the trees under which we were sitting fell like a snow shower - around us. At noon I took a thermometer graded to 127 deg., out of - my box, and observed that the mercury was up to 125. Thinking that - it had been unduly influenced, I put it in the fork of a tree close - to me, sheltered alike from the wind and the sun. I went to examine - it about an hour afterwards, when I found the mercury had risen to - the-top of the instrument and had burst the bulb, a circumstance - that I believe no traveler has ever before had to record. I cannot - find language to convey to the reader's mind an idea of the intense - and oppressive nature of the heat that prevailed." - -That hot wind sweeps over Sydney sometimes, and brings with it what is -called a "dust-storm." It is said that most Australian towns are -acquainted with the dust-storm. I think I know what it is like, for the -following description by Mr. Gape tallies very well with the alkali -duststorm of Nevada, if you leave out the "shovel" part. Still the -shovel part is a pretty important part, and seems to indicate that my -Nevada storm is but a poor thing, after all. - - "As we proceeded the altitude became less, and the heat - proportionately greater until we reached Dubbo, which is only 600 - feet above sea-level. It is a pretty town, built on an extensive - plain . . . . After the effects of a shower of rain have passed - away the surface of the ground crumbles into a thick layer of dust, - and occasionally, when the wind is in a particular quarter, it is - lifted bodily from the ground in one long opaque cloud. In the - midst of such a storm nothing can be seen a few yards ahead, and the - unlucky person who happens to be out at the time is compelled to - seek the nearest retreat at hand. When the thrifty housewife sees - in the distance the dark column advancing in a steady whirl towards - her house, she closes the doors and windows with all expedition. A - drawing-room, the window of which has been carelessly left open - during a dust-storm, is indeed an extraordinary sight. A lady who - has resided in Dubbo for some years says that the dust lies so thick - on the carpet that it is necessary to use a shovel to remove it." - -And probably a wagon. I was mistaken; I have not seen a proper -duststorm. To my mind the exterior aspects and character of Australia -are fascinating things to look at and think about, they are so strange, -so weird, so new, so uncommonplace, such a startling and interesting -contrast to the other sections of the planet, the sections that are known -to us all, familiar to us all. In the matter of particulars--a detail -here, a detail there--we have had the choice climate of New South Wales' -seacoast; we have had the Australian heat as furnished by Captain Sturt; -we have had the wonderful dust-storm; and we have considered the -phenomenon of an almost empty hot wilderness half as big as the United -States, with a narrow belt of civilization, population, and good climate -around it. - - - - -CHAPTER X. - -Everything human is pathetic. The secret source of Humor itself is not -joy but sorrow. There is no humor in heaven. - --Pudd'nhead Wilson's New Calendar. - -Captain Cook found Australia in 1770, and eighteen years later the -British Government began to transport convicts to it. Altogether, New -South Wales received 83,000 in 53 years. The convicts wore heavy chains; -they were ill-fed and badly treated by the officers set over them; they -were heavily punished for even slight infractions of the rules; "the -cruelest discipline ever known" is one historian's description of their -life.--[The Story of Australasia. J. S. Laurie.] - -English law was hard-hearted in those days. For trifling offenses which -in our day would be punished by a small fine or a few days' confinement, -men, women, and boys were sent to this other end of the earth to serve -terms of seven and fourteen years; and for serious crimes they were -transported for life. Children were sent to the penal colonies for seven -years for stealing a rabbit! - -When I was in London twenty-three years ago there was a new penalty in -force for diminishing garroting and wife-beating--25 lashes on the bare -back with the cat-o'-nine-tails. It was said that this terrible -punishment was able to bring the stubbornest ruffians to terms; and that -no man had been found with grit enough to keep his emotions to himself -beyond the ninth blow; as a rule the man shrieked earlier. That penalty -had a great and wholesome effect upon the garroters and wife-beaters; but -humane modern London could not endure it; it got its law rescinded. Many -a bruised and battered English wife has since had occasion to deplore -that cruel achievement of sentimental "humanity." - -Twenty-five lashes! In Australia and Tasmania they gave a convict fifty -for almost any little offense; and sometimes a brutal officer would add -fifty, and then another fifty, and so on, as long as the sufferer could -endure the torture and live. In Tasmania I read the entry, in an old -manuscript official record, of a case where a convict was given three -hundred lashes--for stealing some silver spoons. And men got more than -that, sometimes. Who handled the cat? Often it was another convict; -sometimes it was the culprit's dearest comrade; and he had to lay on with -all his might; otherwise he would get a flogging himself for his mercy ---for he was under watch--and yet not do his friend any good: the friend -would be attended to by another hand and suffer no lack in the matter of -full punishment. - -The convict life in Tasmania was so unendurable, and suicide so difficult -to accomplish that once or twice despairing men got together and drew -straws to determine which of them should kill another of the group--this -murder to secure death to the perpetrator and to the witnesses of it by -the hand of the hangman! - -The incidents quoted above are mere hints, mere suggestions of what -convict life was like--they are but a couple of details tossed into view -out of a shoreless sea of such; or, to change the figure, they are but a -pair of flaming steeples photographed from a point which hides from sight -the burning city which stretches away from their bases on every hand. - -Some of the convicts--indeed, a good many of them--were very bad people, -even for that day; but the most of them were probably not noticeably -worse than the average of the people they left behind them at home. We -must believe this; we cannot avoid it. We are obliged to believe that a -nation that could look on, unmoved, and see starving or freezing women -hanged for stealing twenty-six cents' worth of bacon or rags, and boys -snatched from their mothers, and men from their families, and sent to the -other side of the world for long terms of years for similar trifling -offenses, was a nation to whom the term "civilized" could not in any -large way be applied. And we must also believe that a nation that knew, -during more than forty years, what was happening to those exiles and was -still content with it, was not advancing in any showy way toward a higher -grade of civilization. - -If we look into the characters and conduct of the officers and gentlemen -who had charge of the convicts and attended to their backs and stomachs, -we must grant again that as between the convict and his masters, and -between both and the nation at home, there was a quite noticeable -monotony of sameness. - -Four years had gone by, and many convicts had come. Respectable settlers -were beginning to arrive. These two classes of colonists had to be -protected, in case of trouble among themselves or with the natives. It -is proper to mention the natives, though they could hardly count they -were so scarce. At a time when they had not as yet begun to be much -disturbed--not as yet being in the way--it was estimated that in New -South Wales there was but one native to 45,000 acres of territory. - -People had to be protected. Officers of the regular army did not want -this service--away off there where neither honor nor distinction was to -be gained. So England recruited and officered a kind of militia force of -1,000 uniformed civilians called the "New South Wales Corps" and shipped -it. - -This was the worst blow of all. The colony fairly staggered under it. -The Corps was an object-lesson of the moral condition of England outside -of the jails. The colonists trembled. It was feared that next there -would be an importation of the nobility. - -In those early days the colony was non-supporting. All the necessaries -of life--food, clothing, and all--were sent out from England, and kept in -great government store-houses, and given to the convicts and sold to the -settlers--sold at a trifling advance upon cost. The Corps saw its -opportunity. Its officers went into commerce, and in a most lawless way. -They went to importing rum, and also to manufacturing it in private -stills, in defiance of the government's commands and protests. They -leagued themselves together and ruled the market; they boycotted the -government and the other dealers; they established a close monopoly and -kept it strictly in their own hands. When a vessel arrived with spirits, -they allowed nobody to buy but themselves, and they forced the owner to -sell to them at a price named by themselves--and it was always low -enough. They bought rum at an average of two dollars a gallon and sold -it at an average of ten. They made rum the currency of the country--for -there was little or no money--and they maintained their devastating hold -and kept the colony under their heel for eighteen or twenty years before -they were finally conquered and routed by the government. - -Meantime, they had spread intemperance everywhere. And they had squeezed -farm after farm out of the settlers hands for rum, and thus had -bountifully enriched themselves. When a farmer was caught in the last -agonies of thirst they took advantage of him and sweated him for a drink. -In one instance they sold a man a gallon of rum worth two dollars for a -piece of property which was sold some years later for $100,000. -When the colony was about eighteen or twenty years old it was discovered -that the land was specially fitted for the wool-culture. Prosperity -followed, commerce with the world began, by and by rich mines of the -noble metals were opened, immigrants flowed in, capital likewise. The -result is the great and wealthy and enlightened commonwealth of New South -Wales. - -It is a country that is rich in mines, wool ranches, trams, railways, -steamship lines, schools, newspapers, botanical gardens, art galleries, -libraries, museums, hospitals, learned societies; it is the hospitable -home of every species of culture and of every species of material -enterprise, and there is a, church at every man's door, and a race-track -over the way. - - - - -CHAPTER XI. - -We should be careful to get out of an experience only the wisdom that is -in it--and stop there; lest we be like the cat that sits down on a hot -stove-lid. She will never sit down on a hot stove-lid again--and that is -well; but also she will never sit down on a cold one any more. - --Pudd'nhead Wilson's New Calendar. - -All English-speaking colonies are made up of lavishly hospitable people, -and New South Wales and its capital are like the rest in this. The -English-speaking colony of the United States of America is always -called lavishly hospitable by the English traveler. As to the other -English-speaking colonies throughout the world from Canada all around, I -know by experience that the description fits them. I will not go more -particularly into this matter, for I find that when writers try to -distribute their gratitude here and there and yonder by detail they run -across difficulties and do some ungraceful stumbling. - -Mr. Gane ("New South Wales and Victoria in 1885 "), tried to distribute -his gratitude, and was not lucky: - - "The inhabitants of Sydney are renowned for their hospitality. The - treatment which we experienced at the hands of this generous-hearted - people will help more than anything else to make us recollect with - pleasure our stay amongst them. In the character of hosts and - hostesses they excel. The 'new chum' needs only the - acquaintanceship of one of their number, and he becomes at once the - happy recipient of numerous complimentary invitations and thoughtful - kindnesses. Of the towns it has been our good fortune to visit, - none have portrayed home so faithfully as Sydney." - -Nobody could say it finer than that. If he had put in his cork then, and -stayed away from Dubbo----but no; heedless man, he pulled it again. -Pulled it when he was away along in his book, and his memory of what he -had said about Sydney had grown dim: - - "We cannot quit the promising town of Dubbo without testifying, in - warm praise, to the kind-hearted and hospitable usages of its - inhabitants. Sydney, though well deserving the character it bears - of its kindly treatment of strangers, possesses a little formality - and reserve. In Dubbo, on the contrary, though the same congenial - manners prevail, there is a pleasing degree of respectful - familiarity which gives the town a homely comfort not often met with - elsewhere. In laying on one side our pen we feel contented in - having been able, though so late in this work, to bestow a - panegyric, however unpretentious, on a town which, though possessing - no picturesque natural surroundings, nor interesting architectural - productions, has yet a body of citizens whose hearts cannot but - obtain for their town a reputation for benevolence and - kind-heartedness." - -I wonder what soured him on Sydney. It seems strange that a pleasing -degree of three or four fingers of respectful familiarity should fill a -man up and give him the panegyrics so bad. For he has them, the worst -way--any one can see that. A man who is perfectly at himself does not -throw cold detraction at people's architectural productions and -picturesque surroundings, and let on that what he prefers is a Dubbonese -dust-storm and a pleasing degree of respectful familiarity, No, these are -old, old symptoms; and when they appear we know that the man has got the -panegyrics. - -Sydney has a population of 400,000. When a stranger from America steps -ashore there, the first thing that strikes him is that the place is eight -or nine times as large as he was expecting it to be; and the next thing -that strikes him is that it is an English city with American trimmings. -Later on, in Melbourne, he will find the American trimmings still more in -evidence; there, even the architecture will often suggest America; a -photograph of its stateliest business street might be passed upon him for -a picture of the finest street in a large American city. I was told that -the most of the fine residences were the city residences of squatters. -The name seemed out of focus somehow. When the explanation came, it -offered a new instance of the curious changes which words, as well as -animals, undergo through change of habitat and climate. With us, when -you speak of a squatter you are always supposed to be speaking of a poor -man, but in Australia when you speak of a squatter you are supposed to be -speaking of a millionaire; in America the word indicates the possessor of -a few acres and a doubtful title, in Australia it indicates a man whose -landfront is as long as a railroad, and whose title has been perfected in -one way or another; in America the word indicates a man who owns a dozen -head of live stock, in Australia a man who owns anywhere from fifty -thousand up to half a million head; in America the word indicates a man -who is obscure and not important, in Australia a man who is prominent and -of the first importance; in America you take off your hat to no squatter, -in Australia you do; in America if your uncle is a squatter you keep it -dark, in Australia you advertise it; in America if your friend is a -squatter nothing comes of it, but with a squatter for your friend in -Australia you may sup with kings if there are any around. - -In Australia it takes about two acres and a half of pastureland (some -people say twice as many), to support a sheep; and when the squatter has -half a million sheep his private domain is about as large as Rhode -Island, to speak in general terms. His annual wool crop may be worth a -quarter or a half million dollars. - -He will live in a palace in Melbourne or Sydney or some other of the -large cities, and make occasional trips to his sheep-kingdom several -hundred miles away in the great plains to look after his battalions of -riders and shepherds and other hands. He has a commodious dwelling out -there, and if he approve of you he will invite you to spend a week in it, -and will make you at home and comfortable, and let you see the great -industry in all its details, and feed you and slake you and smoke you -with the best that money can buy. - -On at least one of these vast estates there is a considerable town, with -all the various businesses and occupations that go to make an important -town; and the town and the land it stands upon are the property of the -squatters. I have seen that town, and it is not unlikely that there are -other squatter-owned towns in Australia. - -Australia supplies the world not only with fine wool, but with mutton -also. The modern invention of cold storage and its application in ships -has created this great trade. In Sydney I visited a huge establishment -where they kill and clean and solidly freeze a thousand sheep a day, for -shipment to England. - -The Australians did not seem to me to differ noticeably from Americans, -either in dress, carriage, ways, pronunciation, inflections, or general -appearance. There were fleeting and subtle suggestions of their English -origin, but these were not pronounced enough, as a rule, to catch one's -attention. The people have easy and cordial manners from the beginning ---from the moment that the introduction is completed. This is American. -To put it in another way, it is English friendliness with the English -shyness and self-consciousness left out. - -Now and then--but this is rare--one hears such words as piper for paper, -lydy for lady, and tyble for table fall from lips whence one would not -expect such pronunciations to come. There is a superstition prevalent in -Sydney that this pronunciation is an Australianism, but people who have -been "home"--as the native reverently and lovingly calls England--know -better. It is "costermonger." All over Australasia this pronunciation -is nearly as common among servants as it is in London among the -uneducated and the partially educated of all sorts and conditions of -people. That mislaid 'y' is rather striking when a person gets enough of -it into a short sentence to enable it to show up. In the hotel in Sydney -the chambermaid said, one morning: - -"The tyble is set, and here is the piper; and if the lydy is ready I'll -tell the wyter to bring up the breakfast." - -I have made passing mention, a moment ago, of the native Australasian's -custom of speaking of England as "home." It was always pretty to hear -it, and often it was said in an unconsciously caressing way that made it -touching; in a way which transmuted a sentiment into an embodiment, and -made one seem to see Australasia as a young girl stroking mother -England's old gray head. - -In the Australasian home the table-talk is vivacious and unembarrassed; -it is without stiffness or restraint. This does not remind one of -England so much as it does of America. But Australasia is strictly -democratic, and reserves and restraints are things that are bred by -differences of rank. - -English and colonial audiences are phenomenally alert and responsive. -Where masses of people are gathered together in England, caste is -submerged, and with it the English reserve; equality exists for the -moment, and every individual is free; so free from any consciousness of -fetters, indeed, that the Englishman's habit of watching himself and -guarding himself against any injudicious exposure of his feelings is -forgotten, and falls into abeyance--and to such a degree indeed, that he -will bravely applaud all by himself if he wants to--an exhibition of -daring which is unusual elsewhere in the world. - -But it is hard to move a new English acquaintance when he is by himself, -or when the company present is small and new to him. He is on his guard -then, and his natural reserve is to the fore. This has given him the -false reputation of being without humor and without the appreciation of -humor. - -Americans are not Englishmen, and American humor is not English humor; -but both the American and his humor had their origin in England, and have -merely undergone changes brought about by changed conditions and a new -environment. About the best humorous speeches I have yet heard were a -couple that were made in Australia at club suppers--one of them by an -Englishman, the other by an Australian. - - - - -CHAPTER XII. - -There are those who scoff at the schoolboy, calling him frivolous and -shallow: Yet it was the schoolboy who said "Faith is believing what you -know ain't so." - --Pudd'nhead Wilson's New Calendar. - -In Sydney I had a large dream, and in the course of talk I told it to a -missionary from India who was on his way to visit some relatives in New -Zealand. I dreamed that the visible universe is the physical person of -God; that the vast worlds that we see twinkling millions of miles apart -in the fields of space are the blood corpuscles in His veins; and that we -and the other creatures are the microbes that charge with multitudinous -life the corpuscles. - -Mr. X., the missionary, considered the dream awhile, then said: - - "It is not surpassable for magnitude, since its metes and bounds are - the metes and bounds of the universe itself; and it seems to me that - it almost accounts for a thing which is otherwise nearly - unaccountable--the origin of the sacred legends of the Hindoos. - Perhaps they dream them, and then honestly believe them to be divine - revelations of fact. It looks like that, for the legends are built - on so vast a scale that it does not seem reasonable that plodding - priests would happen upon such colossal fancies when awake." - -He told some of the legends, and said that they were implicitly believed -by all classes of Hindoos, including those of high social position and -intelligence; and he said that this universal credulity was a great -hindrance to the missionary in his work. Then he said something like -this: - - "At home, people wonder why Christianity does not make faster - progress in India. They hear that the Indians believe easily, and - that they have a natural trust in miracles and give them a - hospitable reception. Then they argue like this: since the Indian - believes easily, place Christianity before them and they must - believe; confirm its truths by the biblical miracles, and they will - no longer doubt, The natural deduction is, that as Christianity - makes but indifferent progress in India, the fault is with us: we - are not fortunate in presenting the doctrines and the miracles. - - "But the truth is, we are not by any means so well equipped as they - think. We have not the easy task that they imagine. To use a - military figure, we are sent against the enemy with good powder in - our guns, but only wads for bullets; that is to say, our miracles - are not effective; the Hindoos do not care for them; they have more - extraordinary ones of their own. All the details of their own - religion are proven and established by miracles; the details of ours - must be proven in the same way. When I first began my work in India - I greatly underestimated the difficulties thus put upon my task. A - correction was not long in coming. I thought as our friends think - at home--that to prepare my childlike wonder-lovers to listen with - favor to my grave message I only needed to charm the way to it with - wonders, marvels, miracles. With full confidence I told the wonders - performed by Samson, the strongest man that had ever lived--for so I - called him. - - "At first I saw lively anticipation and strong interest in the faces - of my people, but as I moved along from incident to incident of the - great story, I was distressed to see that I was steadily losing the - sympathy of my audience. I could not understand it. It was a - surprise to me, and a disappointment. Before I was through, the - fading sympathy had paled to indifference. Thence to the end the - indifference remained; I was not able to make any impression upon - it. - - "A good old Hindoo gentleman told me where my trouble lay. He said - 'We Hindoos recognize a god by the work of his hands--we accept no - other testimony. Apparently, this is also the rule with you - Christians. And we know when a man has his power from a god by the - fact that he does things which he could not do, as a man, with the - mere powers of a man. Plainly, this is the Christian's way also, of - knowing when a man is working by a god's power and not by his own. - You saw that there was a supernatural property in the hair of - Samson; for you perceived that when his hair was gone he was as - other men. It is our way, as I have said. There are many nations - in the world, and each group of nations has its own gods, and will - pay no worship to the gods of the others. Each group believes its - own gods to be strongest, and it will not exchange them except for - gods that shall be proven to be their superiors in power. Man is - but a weak creature, and needs the help of gods--he cannot do - without it. Shall he place his fate in the hands of weak gods when - there may be stronger ones to be found? That would be foolish. No, - if he hear of gods that are stronger than his own, he should not - turn a deaf ear, for it is not a light matter that is at stake. How - then shall he determine which gods are the stronger, his own or - those that preside over the concerns of other nations? By comparing - the known works of his own gods with the works of those others; - there is no other way. Now, when we make this comparison, we are - not drawn towards the gods of any other nation. Our gods are shown - by their works to be the strongest, the most powerful. The - Christians have but few gods, and they are new--new, and not strong; - as it seems to us. They will increase in number, it is true, for - this has happened with all gods, but that time is far away, many - ages and decades of ages away, for gods multiply slowly, as is meet - for beings to whom a thousand years is but a single moment. Our own - gods have been born millions of years apart. The process is slow, - the gathering of strength and power is similarly slow. In the slow - lapse of the ages the steadily accumulating power of our gods has at - last become prodigious. We have a thousand proofs of this in the - colossal character of their personal acts and the acts of ordinary - men to whom they have given supernatural qualities. To your Samson - was given supernatural power, and when he broke the withes, and slew - the thousands with the jawbone of an ass, and carried away the - gate's of the city upon his shoulders, you were amazed--and also - awed, for you recognized the divine source of his strength. But it - could not profit to place these things before your Hindoo - congregation and invite their wonder; for they would compare them - with the deed done by Hanuman, when our gods infused their divine - strength into his muscles; and they would be indifferent to them--as - you saw. In the old, old times, ages and ages gone by, when our god - Rama was warring with the demon god of Ceylon, Rama bethought him to - bridge the sea and connect Ceylon with India, so that his armies - might pass easily over; and he sent his general, Hanuman, inspired - like your own Samson with divine strength, to bring the materials - for the bridge. In two days Hanuman strode fifteen hundred miles, - to the Himalayas, and took upon his shoulder a range of those lofty - mountains two hundred miles long, and started with it toward Ceylon. - It was in the night; and, as he passed along the plain, the people - of Govardhun heard the thunder of his tread and felt the earth - rocking under it, and they ran out, and there, with their snowy - summits piled to heaven, they saw the Himalayas passing by. And as - this huge continent swept along overshadowing the earth, upon its - slopes they discerned the twinkling lights of a thousand sleeping - villages, and it was as if the constellations were filing in - procession through the sky. While they were looking, Hanuman - stumbled, and a small ridge of red sandstone twenty miles long was - jolted loose and fell. Half of its length has wasted away in the - course of the ages, but the other ten miles of it remain in the - plain by Govardhun to this day as proof of the might of the - inspiration of our gods. You must know, yourself, that Hanuman - could not have carried those mountains to Ceylon except by the - strength of the gods. You know that it was not done by his own - strength, therefore, you know that it was done by the strength of - the gods, just as you know that Samson carried the gates by the - divine strength and not by his own. I think you must concede two - things: First, That in carrying the gates of the city upon his - shoulders, Samson did not establish the superiority of his gods over - ours; secondly, That his feat is not supported by any but verbal - evidence, while Hanuman's is not only supported by verbal evidence, - but this evidence is confirmed, established, proven, by visible, - tangible evidence, which is the strongest of all testimony. We have - the sandstone ridge, and while it remains we cannot doubt, and shall - not. Have you the gates?'" - - - - -CHAPTER XIII. - -The timid man yearns for full value and asks a tenth. The bold man -strikes for double value and compromises on par. - --Pudd'nhead Wilson's New Calendar. - -One is sure to be struck by the liberal way in which Australasia spends -money upon public works--such as legislative buildings, town halls, -hospitals, asylums, parks, and botanical gardens. I should say that -where minor towns in America spend a hundred dollars on the town hall and -on public parks and gardens, the like towns in Australasia spend a -thousand. And I think that this ratio will hold good in the matter of -hospitals, also. I have seen a costly and well-equipped, and -architecturally handsome hospital in an Australian village of fifteen -hundred inhabitants. It was built by private funds furnished by the -villagers and the neighboring planters, and its running expenses were -drawn from the same sources. I suppose it would be hard to match this in -any country. This village was about to close a contract for lighting its -streets with the electric light, when I was there. That is ahead of -London. London is still obscured by gas--gas pretty widely scattered, -too, in some of the districts; so widely indeed, that except on moonlight -nights it is difficult to find the gas lamps. - -The botanical garden of Sydney covers thirty-eight acres, beautifully -laid out and rich with the spoil of all the lands and all the climes of -the world. The garden is on high ground in the middle of the town, -overlooking the great harbor, and it adjoins the spacious grounds of -Government House--fifty-six acres; and at hand also, is a recreation -ground containing eighty-two acres. In addition, there are the -zoological gardens, the race-course, and the great cricket-grounds where -the international matches are played. Therefore there is plenty of room -for reposeful lazying and lounging, and for exercise too, for such as -like that kind of work. - -There are four specialties attainable in the way of social pleasure. If -you enter your name on the Visitor's Book at Government House you will -receive an invitation to the next ball that takes place there, if nothing -can be proven against you. And it will be very pleasant; for you will -see everybody except the Governor, and add a number of acquaintances and -several friends to your list. The Governor will be in England. He -always is. The continent has four or five governors, and I do not know -how many it takes to govern the outlying archipelago; but anyway you will -not see them. When they are appointed they come out from England and get -inaugurated, and give a ball, and help pray for rain, and get aboard ship -and go back home. And so the Lieutenant-Governor has to do all the work. -I was in Australasia three months and a half, and saw only one Governor. -The others were at home. - -The Australasian Governor would not be so restless, perhaps, if he had a -war, or a veto, or something like that to call for his reserve-energies, -but he hasn't. There isn't any war, and there isn't any veto in his -hands. And so there is really little or nothing doing in his line. The -country governs itself, and prefers to do it; and is so strenuous about -it and so jealous of its independence that it grows restive if even the -Imperial Government at home proposes to help; and so the Imperial veto, -while a fact, is yet mainly a name. - -Thus the Governor's functions are much more limited than are a Governor's -functions with us. And therefore more fatiguing. He is the apparent -head of the State, he is the real head of Society. He represents -culture, refinement, elevated sentiment, polite life, religion; and by -his example he propagates these, and they spread and flourish and bear -good fruit. He creates the fashion, and leads it. His ball is the ball -of balls, and his countenance makes the horse-race thrive. - -He is usually a lord, and this is well; for his position compels him to -lead an expensive life, and an English lord is generally well equipped -for that. - -Another of Sydney's social pleasures is the visit to the Admiralty House; -which is nobly situated on high ground overlooking the water. The trim -boats of the service convey the guests thither; and there, or on board -the flag-ship, they have the duplicate of the hospitalities of Government -House. The Admiral commanding a station in British waters is a magnate -of the first degree, and he is sumptuously housed, as becomes the dignity -of his office. - -Third in the list of special pleasures is the tour of the harbor in a -fine steam pleasure-launch. Your richer friends own boats of this kind, -and they will invite you, and the joys of the trip will make a long day -seem short. - -And finally comes the shark-fishing. Sydney Harbor is populous with the -finest breeds of man-eating sharks in the world. Some people make their -living catching them; for the Government pays a cash bounty on them. The -larger the shark the larger the bounty, and some of the sharks are twenty -feet long. You not only get the bounty, but everything that is in the -shark belongs to you. Sometimes the contents are quite valuable. - -The shark is the swiftest fish that swims. The speed of the fastest -steamer afloat is poor compared to his. And he is a great gad-about, and -roams far and wide in the oceans, and visits the shores of all of them, -ultimately, in the course of his restless excursions. I have a tale to -tell now, which has not as yet been in print. In 1870 a young stranger -arrived in Sydney, and set about finding something to do; but he knew no -one, and brought no recommendations, and the result was that he got no -employment. He had aimed high, at first, but as time and his money -wasted away he grew less and less exacting, until at last he was willing -to serve in the humblest capacities if so he might get bread and shelter. -But luck was still against him; he could find no opening of any sort. -Finally his money was all gone. He walked the streets all day, thinking; -he walked them all night, thinking, thinking, and growing hungrier and -hungrier. At dawn he found himself well away from the town and drifting -aimlessly along the harbor shore. As he was passing by a nodding -shark-fisher the man looked up and said---- - -"Say, young fellow, take my line a spell, and change my luck for me." - -"How do you know I won't make it worse?" - -"Because you can't. It has been at its worst all night. If you can't -change it, no harm's done; if you do change it, it's for the better, -of course. Come." - -"All right, what will you give?" - -"I'll give you the shark, if you catch one." - -"And I will eat it, bones and all. Give me the line." - -"Here you are. I will get away, now, for awhile, so that my luck won't -spoil yours; for many and many a time I've noticed that if----there, pull -in, pull in, man, you've got a bite! I knew how it would be. Why, I -knew you for a born son of luck the minute I saw you. All right--he's -landed." - -It was an unusually large shark--"a full nineteen-footer," the fisherman -said, as he laid the creature open with his knife. - -"Now you rob him, young man, while I step to my hamper for a fresh bait. -There's generally something in them worth going for. You've changed my -luck, you see. But my goodness, I hope you haven't changed your own." - -"Oh, it wouldn't matter; don't worry about that. Get your bait. I'll -rob him." - -When the fisherman got back the young man had just finished washing his -hands in the bay, and was starting away. - -"What, you are not going?" - -"Yes. Good-bye." - -"But what about your shark?" - -"The shark? Why, what use is he to me?" - -"What use is he? I like that. Don't you know that we can go and report -him to Government, and you'll get a clean solid eighty shillings bounty? -Hard cash, you know. What do you think about it now?" - -"Oh, well, you can collect it." - -"And keep it? Is that what you mean?" - -"Yes." - -"Well, this is odd. You're one of those sort they call eccentrics, I -judge. The saying is, you mustn't judge a man by his clothes, and I'm -believing it now. Why yours are looking just ratty, don't you know; and -yet you must be rich." - -"I am." - -The young man walked slowly back to the town, deeply musing as he went. -He halted a moment in front of the best restaurant, then glanced at his -clothes and passed on, and got his breakfast at a "stand-up." There was -a good deal of it, and it cost five shillings. He tendered a sovereign, -got his change, glanced at his silver, muttered to himself, "There isn't -enough to buy clothes with," and went his way. - -At half-past nine the richest wool-broker in Sydney was sitting in his -morning-room at home, settling his breakfast with the morning paper. A -servant put his head in and said: - -"There's a sundowner at the door wants to see you, sir." - -"What do you bring that kind of a message here for? Send him about his -business." - -"He won't go, sir. I've tried." - -"He won't go? That's--why, that's unusual. He's one of two things, -then: he's a remarkable person, or he's crazy. Is he crazy?" - -"No, sir. He don't look it." - -"Then he's remarkable. What does he say he wants?" - -"He won't tell, sir; only says it's very important." - -"And won't go. Does he say he won't go?" - -"Says he'll stand there till he sees you, sir, if it's all day." - -"And yet isn't crazy. Show him up." - -The sundowner was shown in. The broker said to himself, "No, he's not -crazy; that is easy to see; so he must be the other thing." - -Then aloud, "Well, my good fellow, be quick about it; don't waste any -words; what is it you want?" - -"I want to borrow a hundred thousand pounds." - -"Scott! (It's a mistake; he is crazy . . . . No--he can't be--not -with that eye.) Why, you take my breath away. Come, who are you?" - -"Nobody that you know." - -"What is your name?" - -"Cecil Rhodes." - -"No, I don't remember hearing the name before. Now then--just for -curiosity's sake--what has sent you to me on this extraordinary errand?" - -"The intention to make a hundred thousand pounds for you and as much for -myself within the next sixty days." - -"Well, well, well. It is the most extraordinary idea that--sit down--you -interest me. And somehow you--well, you fascinate me; I think that that -is about the word. And it isn't your proposition--no, that doesn't -fascinate me; it's something else, I don't quite know what; something -that's born in you and oozes out of you, I suppose. Now then just for -curiosity's sake again, nothing more: as I understand it, it is your -desire to bor----" - -"I said intention." - -"Pardon, so you did. I thought it was an unheedful use of the word--an -unheedful valuing of its strength, you know." - -"I knew its strength." - -"Well, I must say--but look here, let me walk the floor a little, my mind -is getting into a sort of whirl, though you don't seem disturbed any. -(Plainly this young fellow isn't crazy; but as to his being remarkable ---well, really he amounts to that, and something over.) Now then, I -believe I am beyond the reach of further astonishment. Strike, and spare -not. What is your scheme?" - -"To buy the wool crop--deliverable in sixty days." - -"What, the whole of it?" - -"The whole of it." - -"No, I was not quite out of the reach of surprises, after all. Why, how -you talk! Do you know what our crop is going to foot up?" - -"Two and a half million sterling--maybe a little more." - -"Well, you've got your statistics right, any way. Now, then, do you know -what the margins would foot up, to buy it at sixty days?" - -"The hundred thousand pounds I came here to get." - -"Right, once more. Well, dear me, just to see what would happen, I wish -you had the money. And if you had it, what would you do with it?" - -"I shall make two hundred thousand pounds out of it in sixty days." - -"You mean, of course, that you might make it if----" - -"I said 'shall'." - -"Yes, by George, you did say 'shall'! You are the most definite devil I -ever saw, in the matter of language. Dear, dear, dear, look here! -Definite speech means clarity of mind. Upon my word I believe you've got -what you believe to be a rational reason, for venturing into this house, -an entire stranger, on this wild scheme of buying the wool crop of an -entire colony on speculation. Bring it out--I am prepared--acclimatized, -if I may use the word. Why would you buy the crop, and why would you -make that sum out of it? That is to say, what makes you think you----" - -"I don't think--I know." - -"Definite again. How do you know?" - -"Because France has declared war against Germany, and wool has gone up -fourteen per cent. in London and is still rising." - -"Oh, in-deed? Now then, I've got you! Such a thunderbolt as you have -just let fly ought to have made me jump out of my chair, but it didn't -stir me the least little bit, you see. And for a very simple reason: I -have read the morning paper. You can look at it if you want to. The -fastest ship in the service arrived at eleven o'clock last night, fifty -days out from London. All her news is printed here. There are no -war-clouds anywhere; and as for wool, why, it is the low-spiritedest -commodity in the English market. It is your turn to jump, now . . . . -Well, why, don't you jump? Why do you sit there in that placid fashion, -when----" - -"Because I have later news." - -"Later news? Oh, come--later news than fifty days, brought steaming hot -from London by the----" - -"My news is only ten days old." - -"Oh, Mun-chausen, hear the maniac talk! Where did you get it?" - -"Got it out of a shark." - -"Oh, oh, oh, this is too much! Front! call the police bring the gun ---raise the town! All the asylums in Christendom have broken loose in the -single person of----" - -"Sit down! And collect yourself. Where is the use in getting excited? -Am I excited? There is nothing to get excited about. When I make a -statement which I cannot prove, it will be time enough for you to begin -to offer hospitality to damaging fancies about me and my sanity." - -"Oh, a thousand, thousand pardons! I ought to be ashamed of myself, and -I am ashamed of myself for thinking that a little bit of a circumstance -like sending a shark to England to fetch back a market report----" - -"What does your middle initial stand for, sir?" - -"Andrew. What are you writing?" - -"Wait a moment. Proof about the shark--and another matter. Only ten -lines. There--now it is done. Sign it." - -"Many thanks--many. Let me see; it says--it says oh, come, this is -interesting! Why--why--look here! prove what you say here, and I'll put -up the money, and double as much, if necessary, and divide the winnings -with you, half and half. There, now--I've signed; make your promise good -if you can. Show me a copy of the London Times only ten days old." - -"Here it is--and with it these buttons and a memorandum book that -belonged to the man the shark swallowed. Swallowed him in the Thames, -without a doubt; for you will notice that the last entry in the book is -dated 'London,' and is of the same date as the Times, and says, 'Ber -confequentz der Kreigeseflarun, reife ich heute nach Deutchland ab, aur -bak ich mein leben auf dem Ultar meines Landes legen mag'----, as clean -native German as anybody can put upon paper, and means that in -consequence of the declaration of war, this loyal soul is leaving for -home to-day, to fight. And he did leave, too, but the shark had him -before the day was done, poor fellow." - -"And a pity, too. But there are times for mourning, and we will attend -to this case further on; other matters are pressing, now. I will go down -and set the machinery in motion in a quiet way and buy the crop. It will -cheer the drooping spirits of the boys, in a transitory way. Everything -is transitory in this world. Sixty days hence, when they are called to -deliver the goods, they will think they've been struck by lightning. But -there is a time for mourning, and we will attend to that case along with -the other one. Come along, I'll take you to my tailor. What did you say -your name is?" - -"Cecil Rhodes." - -"It is hard to remember. However, I think you will make it easier by and -by, if you live. There are three kinds of people--Commonplace Men, -Remarkable Men, and Lunatics. I'll classify you with the Remarkables, -and take the chances." - -The deal went through, and secured to the young stranger the first -fortune he ever pocketed. - -The people of Sydney ought to be afraid of the sharks, but for some -reason they do not seem to be. On Saturdays the young men go out in -their boats, and sometimes the water is fairly covered with the little -sails. A boat upsets now and then, by accident, a result of tumultuous -skylarking; sometimes the boys upset their boat for fun--such as it is -with sharks visibly waiting around for just such an occurrence. The -young fellows scramble aboard whole--sometimes--not always. Tragedies -have happened more than once. While I was in Sydney it was reported that -a boy fell out of a boat in the mouth of the Paramatta river and screamed -for help and a boy jumped overboard from another boat to save him from -the assembling sharks; but the sharks made swift work with the lives of -both. - -The government pays a bounty for the shark; to get the bounty the -fishermen bait the hook or the seine with agreeable mutton; the news -spreads and the sharks come from all over the Pacific Ocean to get the -free board. In time the shark culture will be one of the most successful -things in the colony. - - - - -CHAPTER XIV. - -We can secure other people's approval, if we do right and try hard; but -our own is worth a hundred of it, and no way has been found out of -securing that. - --Pudd'nhead Wilson's New Calendar. - -My health had broken down in New York in May; it had remained in a -doubtful but fairish condition during a succeeding period of 82 days; it -broke again on the Pacific. It broke again in Sydney, but not until -after I had had a good outing, and had also filled my lecture -engagements. This latest break lost me the chance of seeing Queensland. -In the circumstances, to go north toward hotter weather was not -advisable. - -So we moved south with a westward slant, 17 hours by rail to the capital -of the colony of Victoria, Melbourne--that juvenile city of sixty years, -and half a million inhabitants. On the map the distance looked small; -but that is a trouble with all divisions of distance in such a vast -country as Australia. The colony of Victoria itself looks small on the -map--looks like a county, in fact--yet it is about as large as England, -Scotland, and Wales combined. Or, to get another focus upon it, it is -just 80 times as large as the state of Rhode Island, and one-third as -large as the State of Texas. - -Outside of Melbourne, Victoria seems to be owned by a handful of -squatters, each with a Rhode Island for a sheep farm. That is the -impression which one gathers from common talk, yet the wool industry of -Victoria is by no means so great as that of New South Wales. The climate -of Victoria is favorable to other great industries--among others, -wheat-growing and the making of wine. - -We took the train at Sydney at about four in the afternoon. It was -American in one way, for we had a most rational sleeping car; also the -car was clean and fine and new--nothing about it to suggest the rolling -stock of the continent of Europe. But our baggage was weighed, and extra -weight charged for. That was continental. Continental and troublesome. -Any detail of railroading that is not troublesome cannot honorably be -described as continental. - -The tickets were round-trip ones--to Melbourne, and clear to Adelaide in -South Australia, and then all the way back to Sydney. Twelve hundred -more miles than we really expected to make; but then as the round trip -wouldn't cost much more than the single trip, it seemed well enough to -buy as many miles as one could afford, even if one was not likely to need -them. A human being has a natural desire to have more of a good thing -than he needs. - -Now comes a singular thing: the oddest thing, the strangest thing, the -most baffling and unaccountable marvel that Australasia can show. At the -frontier between New South Wales and Victoria our multitude of passengers -were routed out of their snug beds by lantern-light in the morning in the -biting-cold of a high altitude to change cars on a road that has no break -in it from Sydney to Melbourne! Think of the paralysis of intellect that -gave that idea birth; imagine the boulder it emerged from on some -petrified legislator's shoulders. - -It is a narrow-gage road to the frontier, and a broader gauge thence to -Melbourne. The two governments were the builders of the road and are the -owners of it. One or two reasons are given for this curious state of -things. One is, that it represents the jealousy existing between the -colonies--the two most important colonies of Australasia. What the other -one is, I have forgotten. But it is of no consequence. It could be but -another effort to explain the inexplicable. - -All passengers fret at the double-gauge; all shippers of freight must of -course fret at it; unnecessary expense, delay, and annoyance are imposed -upon everybody concerned, and no one is benefitted. - -Each Australian colony fences itself off from its neighbor with a -custom-house. Personally, I have no objection, but it must be a good -deal of inconvenience to the people. We have something resembling it -here and there in America, but it goes by another name. The large empire -of the Pacific coast requires a world of iron machinery, and could -manufacture it economically on the spot if the imposts on foreign iron -were removed. But they are not. Protection to Pennsylvania and Alabama -forbids it. The result to the Pacific coast is the same as if there were -several rows of custom-fences between the coast and the East. Iron -carted across the American continent at luxurious railway rates would be -valuable enough to be coined when it arrived. - -We changed cars. This was at Albury. And it was there, I think, that -the growing day and the early sun exposed the distant range called the -Blue Mountains. Accurately named. "My word!" as the Australians say, -but it was a stunning color, that blue. Deep, strong, rich, exquisite; -towering and majestic masses of blue--a softly luminous blue, a -smouldering blue, as if vaguely lit by fires within. It extinguished the -blue of the sky--made it pallid and unwholesome, whitey and washed-out. -A wonderful color--just divine. - -A resident told me that those were not mountains; he said they were -rabbit-piles. And explained that long exposure and the over-ripe -condition of the rabbits was what made them look so blue. This man may -have been right, but much reading of books of travel has made me -distrustful of gratis information furnished by unofficial residents of a -country. The facts which such people give to travelers are usually -erroneous, and often intemperately so. The rabbit-plague has indeed been -very bad in Australia, and it could account for one mountain, but not for -a mountain range, it seems to me. It is too large an order. - -We breakfasted at the station. A good breakfast, except the coffee; and -cheap. The Government establishes the prices and placards them. The -waiters were men, I think; but that is not usual in Australasia. The -usual thing is to have girls. No, not girls, young ladies--generally -duchesses. Dress? They would attract attention at any royal levee in -Europe. Even empresses and queens do not dress as they do. Not that -they could not afford it, perhaps, but they would not know how. - -All the pleasant morning we slid smoothly along over the plains, through -thin--not thick--forests of great melancholy gum trees, with trunks -rugged with curled sheets of flaking bark--erysipelas convalescents, so -to speak, shedding their dead skins. And all along were tiny cabins, -built sometimes of wood, sometimes of gray-blue corrugated iron; and -the doorsteps and fences were clogged with children--rugged little -simply-clad chaps that looked as if they had been imported from the -banks of the Mississippi without breaking bulk. - -And there were little villages, with neat stations well placarded with -showy advertisements--mainly of almost too self-righteous brands of -"sheepdip." If that is the name--and I think it is. It is a stuff like -tar, and is dabbed on to places where the shearer clips a piece out of -the sheep. It bars out the flies, and has healing properties, and a nip -to it which makes the sheep skip like the cattle on a thousand hills. It -is not good to eat. That is, it is not good to eat except when mixed -with railroad coffee. It improves railroad coffee. Without it railroad -coffee is too vague. But with it, it is quite assertive and -enthusiastic. By itself, railroad coffee is too passive; but sheep-dip -makes it wake up and get down to business. I wonder where they get -railroad coffee? - -We saw birds, but not a kangaroo, not an emu, not an ornithorhynchus, not -a lecturer, not a native. Indeed, the land seemed quite destitute of -game. But I have misused the word native. In Australia it is applied to -Australian-born whites only. I should have said that we saw no -Aboriginals--no "blackfellows." And to this day I have never seen one. -In the great museums you will find all the other curiosities, but in the -curio of chiefest interest to the stranger all of them are lacking. We -have at home an abundance of museums, and not an American Indian in them. -It is clearly an absurdity, but it never struck me before. - - - - -CHAPTER XV. - -Truth is stranger than fiction--to some people, but I am measurably -familiar with it. - --Pudd'nhead Wilson's New Calendar. - -Truth is stranger than fiction, but it is because Fiction is obliged to -stick to possibilities; Truth isn't. - --Pudd'nhead Wilson's New Calendar. - -The air was balmy and delicious, the sunshine radiant; it was a charming -excursion. In the course of it we came to a town whose odd name was -famous all over the world a quarter of a century ago--Wagga-Wagga. This -was because the Tichborne Claimant had kept a butcher-shop there. It was -out of the midst of his humble collection of sausages and tripe that he -soared up into the zenith of notoriety and hung there in the wastes of -space a time, with the telescopes of all nations leveled at him in -unappeasable curiosity--curiosity as to which of the two long-missing -persons he was: Arthur Orton, the mislaid roustabout of Wapping, or Sir -Roger Tichborne, the lost heir of a name and estates as old as English -history. We all know now, but not a dozen people knew then; and the -dozen kept the mystery to themselves and allowed the most intricate and -fascinating and marvelous real-life romance that has ever been played -upon the world's stage to unfold itself serenely, act by act, in a -British court by the long and laborious processes of judicial -development. - -When we recall the details of that great romance we marvel to see what -daring chances truth may freely take in constructing a tale, as compared -with the poor little conservative risks permitted to fiction. The -fiction-artist could achieve no success with the materials of this -splendid Tichborne romance. - -He would have to drop out the chief characters; the public would say such -people are impossible. He would have to drop out a number of the most -picturesque incidents; the public would say such things could never -happen. And yet the chief characters did exist, and the incidents did -happen. - -It cost the Tichborne estates $400,000 to unmask the Claimant and drive -him out; and even after the exposure multitudes of Englishmen still -believed in him. It cost the British Government another $400,000 to -convict him of perjury; and after the conviction the same old multitudes -still believed in him; and among these believers were many educated and -intelligent men; and some of them had personally known the real Sir -Roger. The Claimant was sentenced to 14 years' imprisonment. When he -got out of prison he went to New York and kept a whisky saloon in the -Bowery for a time, then disappeared from view. - -He always claimed to be Sir Roger Tichborne until death called for him. -This was but a few months ago--not very much short of a generation since -he left Wagga-Wagga to go and possess himself of his estates. On his -death-bed he yielded up his secret, and confessed in writing that he was -only Arthur Orton of Wapping, able seaman and butcher--that and nothing -more. But it is scarcely to be doubted that there are people whom even -his dying confession will not convince. The old habit of assimilating -incredibilities must have made strong food a necessity in their case; a -weaker article would probably disagree with them. - -I was in London when the Claimant stood his trial for perjury. I -attended one of his showy evenings in the sumptuous quarters provided for -him from the purses of his adherents and well-wishers. He was in evening -dress, and I thought him a rather fine and stately creature. There were -about twenty-five gentlemen present; educated men, men moving in good -society, none of them commonplace; some of them were men of distinction, -none of them were obscurities. They were his cordial friends and -admirers. It was "Sir Roger," always "Sir Roger," on all hands; no one -withheld the title, all turned it from the tongue with unction, and as if -it tasted good. - -For many years I had had a mystery in stock. Melbourne, and only -Melbourne, could unriddle it for me. In 1873 I arrived in London with my -wife and young child, and presently received a note from Naples signed by -a name not familiar to me. It was not Bascom, and it was not Henry; but -I will call it Henry Bascom for convenience's sake. This note, of about -six lines, was written on a strip of white paper whose end-edges were -ragged. I came to be familiar with those strips in later years. Their -size and pattern were always the same. Their contents were usually to -the same effect: would I and mine come to the writer's country-place in -England on such and such a date, by such and such a train, and stay -twelve days and depart by such and such a train at the end of the -specified time? A carriage would meet us at the station. - -These invitations were always for a long time ahead; if we were in -Europe, three months ahead; if we were in America, six to twelve months -ahead. They always named the exact date and train for the beginning and -also for the end of the visit. - -This first note invited us for a date three months in the future. It -asked us to arrive by the 4.10 p.m. train from London, August 6th. The -carriage would be waiting. The carriage would take us away seven days -later-train specified. And there were these words: "Speak to Tom -Hughes." - -I showed the note to the author of "Tom Brown at Rugby," and be said: -"Accept, and be thankful." - -He described Mr. Bascom as being a man of genius, a man of fine -attainments, a choice man in every way, a rare and beautiful character. -He said that Bascom Hall was a particularly fine example of the stately -manorial mansion of Elizabeth's days, and that it was a house worth going -a long way to see--like Knowle; that Mr. B. was of a social disposition; -liked the company of agreeable people, and always had samples of the sort -coming and going. - -We paid the visit. We paid others, in later years--the last one in 1879. -Soon after that Mr. Bascom started on a voyage around the world in a -steam yacht--a long and leisurely trip, for he was making collections, in -all lands, of birds, butterflies, and such things. - -The day that President Garfield was shot by the assassin Guiteau, we were -at a little watering place on Long Island Sound; and in the mail matter -of that day came a letter with the Melbourne post-mark on it. It was for -my wife, but I recognized Mr. Bascom's handwriting on the envelope, and -opened it. It was the usual note--as to paucity of lines--and was -written on the customary strip of paper; but there was nothing usual -about the contents. The note informed my wife that if it would be any -assuagement of her grief to know that her husband's lecture-tour in -Australia was a satisfactory venture from the beginning to the end, he, -the writer, could testify that such was the case; also, that her -husband's untimely death had been mourned by all classes, as she would -already know by the press telegrams, long before the reception of this -note; that the funeral was attended by the officials of the colonial and -city governments; and that while he, the writer, her friend and mine, had -not reached Melbourne in time to see the body, he had at least had the -sad privilege of acting as one of the pall-bearers. Signed, "Henry -Bascom." - -My first thought was, why didn't he have the coffin opened? He would -have seen that the corpse was an imposter, and he could have gone right -ahead and dried up the most of those tears, and comforted those sorrowing -governments, and sold the remains and sent me the money. - -I did nothing about the matter. I had set the law after living lecture -doubles of mine a couple of times in America, and the law had not been -able to catch them; others in my trade had tried to catch their -impostor-doubles and had failed. Then where was the use in harrying a -ghost? None--and so I did not disturb it. I had a curiosity to know -about that man's lecture-tour and last moments, but that could wait. -When I should see Mr. Bascom he would tell me all about it. But he -passed from life, and I never saw him again.. My curiosity faded away. - -However, when I found that I was going to Australia it revived. And -naturally: for if the people should say that I was a dull, poor thing -compared to what I was before I died, it would have a bad effect on -business. Well, to my surprise the Sydney journalists had never heard of -that impostor! I pressed them, but they were firm--they had never heard -of him, and didn't believe in him. - -I could not understand it; still, I thought it would all come right in -Melbourne. The government would remember; and the other mourners. At -the supper of the Institute of Journalists I should find out all about -the matter. But no--it turned out that they had never heard of it. - -So my mystery was a mystery still. It was a great disappointment. I -believed it would never be cleared up--in this life--so I dropped it out -of my mind. - -But at last! just when I was least expecting it---- - -However, this is not the place for the rest of it; I shall come to the -matter again, in a far-distant chapter. - - - - -CHAPTER XVI. - -There is a Moral sense, and there is an Immoral Sense. History shows us -that the Moral Sense enables us to perceive morality and how to avoid it, -and that the Immoral Sense enables us to perceive immorality and how to -enjoy it. - -Pudd'nhead Wilson's New Calendar. - -Melbourne spreads around over an immense area of ground. It is a stately -city architecturally as well as in magnitude. It has an elaborate system -of cable-car service; it has museums, and colleges, and schools, and -public gardens, and electricity, and gas, and libraries, and theaters, -and mining centers, and wool centers, and centers of the arts and -sciences, and boards of trade, and ships, and railroads, and a harbor, -and social clubs, and journalistic clubs, and racing clubs, and a -squatter club sumptuously housed and appointed, and as many churches and -banks as can make a living. In a word, it is equipped with everything -that goes to make the modern great city. It is the largest city of -Australasia, and fills the post with honor and credit. It has one -specialty; this must not be jumbled in with those other things. It is -the mitred Metropolitan of the Horse-Racing Cult. Its race-ground is the -Mecca of Australasia. On the great annual day of sacrifice--the 5th of -November, Guy Fawkes's Day--business is suspended over a stretch of land -and sea as wide as from New York to San Francisco, and deeper than from -the northern lakes to the Gulf of Mexico; and every man and woman, of -high degree or low, who can afford the expense, put away their other -duties and come. They begin to swarm in by ship and rail a fortnight -before the day, and they swarm thicker and thicker day after day, until -all the vehicles of transportation are taxed to their uttermost to meet -the demands of the occasion, and all hotels and lodgings are bulging -outward because of the pressure from within. They come a hundred -thousand strong, as all the best authorities say, and they pack the -spacious grounds and grandstands and make a spectacle such as is never to -be seen in Australasia elsewhere. - -It is the "Melbourne Cup" that brings this multitude together. Their -clothes have been ordered long ago, at unlimited cost, and without bounds -as to beauty and magnificence, and have been kept in concealment until -now, for unto this day are they consecrate. I am speaking of the ladies' -clothes; but one might know that. - -And so the grand-stands make a brilliant and wonderful spectacle, a -delirium of color, a vision of beauty. The champagne flows, everybody is -vivacious, excited, happy; everybody bets, and gloves and fortunes change -hands right along, all the time. Day after day the races go on, and the -fun and the excitement are kept at white heat; and when each day is done, -the people dance all night so as to be fresh for the race in the morning. -And at the end of the great week the swarms secure lodgings and -transportation for next year, then flock away to their remote homes and -count their gains and losses, and order next year's Cup-clothes, and then -lie down and sleep two weeks, and get up sorry to reflect that a whole -year must be put in somehow or other before they can be wholly happy -again. - -The Melbourne Cup is the Australasian National Day. It would be -difficult to overstate its importance. It overshadows all other holidays -and specialized days of whatever sort in that congeries of colonies. -Overshadows them? I might almost say it blots them out. Each of them -gets attention, but not everybody's; each of them evokes interest, but -not everybody's; each of them rouses enthusiasm, but not everybody's; in -each case a part of the attention, interest, and enthusiasm is a matter -of habit and custom, and another part of it is official and perfunctory. -Cup Day, and Cup Day only, commands an attention, an interest, and an -enthusiasm which are universal--and spontaneous, not perfunctory. Cup -Day is supreme it has no rival. I can call to mind no specialized annual -day, in any country, which can be named by that large name--Supreme. I -can call to mind no specialized annual day, in any country, whose -approach fires the whole land with a conflagration of conversation and -preparation and anticipation and jubilation. No day save this one; but -this one does it. - -In America we have no annual supreme day; no day whose approach makes the -whole nation glad. We have the Fourth of July, and Christmas, and -Thanksgiving. Neither of them can claim the primacy; neither of them can -arouse an enthusiasm which comes near to being universal. Eight grown -Americans out of ten dread the coming of the Fourth, with its pandemonium -and its perils, and they rejoice when it is gone--if still alive. The -approach of Christmas brings harassment and dread to many excellent -people. They have to buy a cart-load of presents, and they never know -what to buy to hit the various tastes; they put in three weeks of hard -and anxious work, and when Christmas morning comes they are so -dissatisfied with the result, and so disappointed that they want to sit -down and cry. Then they give thanks that Christmas comes but once a -year. The observance of Thanksgiving Day--as a function--has become -general of late years. The Thankfulness is not so general. This is -natural. Two-thirds of the nation have always had hard luck and a hard -time during the year, and this has a calming effect upon their -enthusiasm. - -We have a supreme day--a sweeping and tremendous and tumultuous day, a -day which commands an absolute universality of interest and excitement; -but it is not annual. It comes but once in four years; therefore it -cannot count as a rival of the Melbourne Cup. - -In Great Britain and Ireland they have two great days--Christmas and the -Queen's birthday. But they are equally popular; there is no supremacy. - -I think it must be conceded that the position of the Australasian Day is -unique, solitary, unfellowed; and likely to hold that high place a long -time. - -The next things which interest us when we travel are, first, the people; -next, the novelties; and finally the history of the places and countries -visited. Novelties are rare in cities which represent the most advanced -civilization of the modern day. When one is familiar with such cities in -the other parts of the world he is in effect familiar with the cities of -Australasia. The outside aspects will furnish little that is new. There -will be new names, but the things which they represent will sometimes be -found to be less new than their names. There may be shades of -difference, but these can easily be too fine for detection by the -incompetent eye of the passing stranger. In the larrikin he will not be -able to discover a new species, but only an old one met elsewhere, and -variously called loafer, rough, tough, bummer, or blatherskite, according -to his geographical distribution. The larrikin differs by a shade from -those others, in that he is more sociable toward the stranger than they, -more kindly disposed, more hospitable, more hearty, more friendly. At -least it seemed so to me, and I had opportunity to observe. In Sydney, -at least. In Melbourne I had to drive to and from the lecture-theater, -but in Sydney I was able to walk both ways, and did it. Every night, on -my way home at ten, or a quarter past, I found the larrikin grouped in -considerable force at several of the street corners, and he always gave -me this pleasant salutation: - -"Hello, Mark!" - -"Here's to you, old chap! - -"Say--Mark!--is he dead?"--a reference to a passage in some book of mine, -though I did not detect, at that time, that that was its source. And I -didn't detect it afterward in Melbourne, when I came on the stage for the -first time, and the same question was dropped down upon me from the dizzy -height of the gallery. It is always difficult to answer a sudden inquiry -like that, when you have come unprepared and don't know what it means. -I will remark here--if it is not an indecorum--that the welcome which an -American lecturer gets from a British colonial audience is a thing which -will move him to his deepest deeps, and veil his sight and break his -voice. And from Winnipeg to Africa, experience will teach him nothing; -he will never learn to expect it, it will catch him as a surprise each -time. The war-cloud hanging black over England and America made no -trouble for me. I was a prospective prisoner of war, but at dinners, -suppers, on the platform, and elsewhere, there was never anything to -remind me of it. This was hospitality of the right metal, and would have -been prominently lacking in some countries, in the circumstances. - -And speaking of the war-flurry, it seemed to me to bring to light the -unexpected, in a detail or two. It seemed to relegate the war-talk to -the politicians on both sides of the water; whereas whenever a -prospective war between two nations had been in the air theretofore, the -public had done most of the talking and the bitterest. The attitude of -the newspapers was new also. I speak of those of Australasia and India, -for I had access to those only. They treated the subject argumentatively -and with dignity, not with spite and anger. That was a new spirit, too, -and not learned of the French and German press, either before Sedan or -since. I heard many public speeches, and they reflected the moderation -of the journals. The outlook is that the English-speaking race will -dominate the earth a hundred years from now, if its sections do not get -to fighting each other. It would be a pity to spoil that prospect by -baffling and retarding wars when arbitration would settle their -differences so much better and also so much more definitely. - -No, as I have suggested, novelties are rare in the great capitals of -modern times. Even the wool exchange in Melbourne could not be told from -the familiar stock exchange of other countries. Wool brokers are just -like stockbrokers; they all bounce from their seats and put up their -hands and yell in unison--no stranger can tell what--and the president -calmly says "Sold to Smith & Co., threpence farthing--next!"--when -probably nothing of the kind happened; for how should he know? - -In the museums you will find acres of the most strange and fascinating -things; but all museums are fascinating, and they do so tire your eyes, -and break your back, and burn out your vitalities with their consuming -interest. You always say you will never go again, but you do go. The -palaces of the rich, in Melbourne, are much like the palaces of the rich -in America, and the life in them is the same; but there the resemblance -ends. The grounds surrounding the American palace are not often large, -and not often beautiful, but in the Melbourne case the grounds are often -ducally spacious, and the climate and the gardeners together make them as -beautiful as a dream. It is said that some of the country seats have -grounds--domains--about them which rival in charm and magnitude those -which surround the country mansion of an English lord; but I was not out -in the country; I had my hands full in town. - -And what was the origin of this majestic city and its efflorescence of -palatial town houses and country seats? Its first brick was laid and -its first house built by a passing convict. Australian history is almost -always picturesque; indeed, it is so curious and strange, that it is -itself the chiefest novelty the country has to offer, and so it pushes -the other novelties into second and third place. It does not read like -history, but like the most beautiful lies. And all of a fresh new sort, -no mouldy old stale ones. It is full of surprises, and adventures, and -incongruities, and contradictions, and incredibilities; but they are all -true, they all happened. - - - - -CHAPTER XVII. - -The English are mentioned in the Bible: Blessed are the meek, for they -shall inherit the earth. - --Pudd'nhead Wilson's New Calendar. - -When we consider the immensity of the British Empire in territory, -population, and trade, it requires a stern exercise of faith to believe -in the figures which represent Australasia's contribution to the Empire's -commercial grandeur. As compared with the landed estate of the British -Empire, the landed estate dominated by any other Power except one ---Russia--is not very impressive for size. My authorities make the British -Empire not much short of a fourth larger than the Russian Empire. -Roughly proportioned, if you will allow your entire hand to represent the -British Empire, you may then cut off the fingers a trifle above the -middle joint of the middle finger, and what is left of the hand will -represent Russia. The populations ruled by Great Britain and China are -about the same--400,000,000 each. No other Power approaches these -figures. Even Russia is left far behind. - -The population of Australasia--4,000,000--sinks into nothingness, and is -lost from sight in that British ocean of 400,000,000. Yet the statistics -indicate that it rises again and shows up very conspicuously when its -share of the Empire's commerce is the matter under consideration. The -value of England's annual exports and imports is stated at three billions -of dollars,--[New South Wales Blue Book.]--and it is claimed that more -than one-tenth of this great aggregate is represented by Australasia's -exports to England and imports from England. In addition to this, -Australasia does a trade with countries other than England, amounting to -a hundred million dollars a year, and a domestic intercolonial trade -amounting to a hundred and fifty millions. - -In round numbers the 4,000,000 buy and sell about $600,000,000 worth of -goods a year. It is claimed that about half of this represents -commodities of Australasian production. The products exported annually -by India are worth a trifle over $500,000,000. Now, here are some -faith-straining figures: - -Indian production (300,000,000 population), $500,000,000. - -Australasian production (4,000,000 population), $300,000,000. - -That is to say, the product of the individual Indian, annually (for -export some whither), is worth $1.15; that of the individual -Australasian (for export some whither), $75! Or, to put it in another -way, the Indian family of man and wife and three children sends away an -annual result worth $8.75, while the Australasian family sends away $375 -worth. - -There are trustworthy statistics furnished by Sir Richard Temple and -others, which show that the individual Indian's whole annual product, -both for export and home use, is worth in gold only $7.50; or, $37.50 -for the family-aggregate. Ciphered out on a like ratio of -multiplication, the Australasian family's aggregate production would be -nearly $1,600. Truly, nothing is so astonishing as figures, if they once -get started. - -We left Melbourne by rail for Adelaide, the capital of the vast Province -of South Australia--a seventeen-hour excursion. On the train we found -several Sydney friends; among them a Judge who was going out on circuit, -and was going to hold court at Broken Hill, where the celebrated silver -mine is. It seemed a curious road to take to get to that region. Broken -Hill is close to the western border of New South Wales, and Sydney is on -the eastern border. A fairly straight line, 700 miles long, drawn -westward from Sydney, would strike Broken Hill, just as a somewhat -shorter one drawn west from Boston would strike Buffalo. The way the -Judge was traveling would carry him over 2,000 miles by rail, he said; -southwest from Sydney down to Melbourne, then northward up to Adelaide, -then a cant back northeastward and over the border into New South Wales -once more--to Broken Hill. It was like going from Boston southwest to -Richmond, Virginia, then northwest up to Erie, Pennsylvania, then a cant -back northeast and over the border--to Buffalo, New York. - -But the explanation was simple. Years ago the fabulously rich silver -discovery at Broken Hill burst suddenly upon an unexpectant world. Its -stocks started at shillings, and went by leaps and bounds to the most -fanciful figures. It was one of those cases where the cook puts a -month's wages into shares, and comes next mouth and buys your house at -your own price, and moves into it herself; where the coachman takes a few -shares, and next month sets up a bank; and where the common sailor -invests the price of a spree, and next month buys out the steamship -company and goes into business on his own hook. In a word, it was one of -those excitements which bring multitudes of people to a common center -with a rush, and whose needs must be supplied, and at once. Adelaide was -close by, Sydney was far away. Adelaide threw a short railway across the -border before Sydney had time to arrange for a long one; it was not worth -while for Sydney to arrange at all. The whole vast trade-profit of -Broken Hill fell into Adelaide's hands, irrevocably. New South Wales -furnishes for Broken Hill and sends her Judges 2,000 miles--mainly -through alien countries--to administer it, but Adelaide takes the -dividends and makes no moan. - -We started at 4.20 in the afternoon, and moved across level until night. -In the morning we had a stretch of "scrub" country--the kind of thing -which is so useful to the Australian novelist. In the scrub the hostile -aboriginal lurks, and flits mysteriously about, slipping out from time to -time to surprise and slaughter the settler; then slipping back again, and -leaving no track that the white man can follow. In the scrub the -novelist's heroine gets lost, search fails of result; she wanders here -and there, and finally sinks down exhausted and unconscious, and the -searchers pass within a yard or two of her, not suspecting that she is -near, and by and by some rambler finds her bones and the pathetic diary -which she had scribbled with her failing hand and left behind. Nobody -can find a lost heroine in the scrub but the aboriginal "tracker," and he -will not lend himself to the scheme if it will interfere with the -novelist's plot. The scrub stretches miles and miles in all directions, -and looks like a level roof of bush-tops without a break or a crack in it ---as seamless as a blanket, to all appearance. One might as well walk -under water and hope to guess out a route and stick to it, I should -think. Yet it is claimed that the aboriginal "tracker" was able to hunt -out people lost in the scrub. Also in the "bush"; also in the desert; -and even follow them over patches of bare rocks and over alluvial ground -which had to all appearance been washed clear of footprints. - -From reading Australian books and talking with the people, I became -convinced that the aboriginal tracker's performances evince a craft, a -penetration, a luminous sagacity, and a minuteness and accuracy of -observation in the matter of detective-work not found in nearly so -remarkable a degree in any other people, white or colored. In an -official account of the blacks of Australia published by the government -of Victoria, one reads that the aboriginal not only notices the faint -marks left on the bark of a tree by the claws of a climbing opossum, but -knows in some way or other whether the marks were made to-day or -yesterday. - -And there is the case, on records where A., a settler, makes a bet with -B., that B. may lose a cow as effectually as he can, and A. will produce -an aboriginal who will find her. B. selects a cow and lets the tracker -see the cow's footprint, then be put under guard. B. then drives the cow -a few miles over a course which drifts in all directions, and frequently -doubles back upon itself; and he selects difficult ground all the time, -and once or twice even drives the cow through herds of other cows, and -mingles her tracks in the wide confusion of theirs. He finally brings -his cow home; the aboriginal is set at liberty, and at once moves around -in a great circle, examining all cow-tracks until he finds the one he is -after; then sets off and follows it throughout its erratic course, and -ultimately tracks it to the stable where B. has hidden the cow. Now -wherein does one cow-track differ from another? There must be a -difference, or the tracker could not have performed the feat; a -difference minute, shadowy, and not detectible by you or me, or by the -late Sherlock Holmes, and yet discernible by a member of a race charged -by some people with occupying the bottom place in the gradations of human -intelligence. - - - - -CHAPTER XVIII. - -It is easier to stay out than get out. - --Pudd'nhead Wilson's New Calendar. - -The train was now exploring a beautiful hill country, and went twisting -in and out through lovely little green valleys. There were several -varieties of gum trees; among them many giants. Some of them were bodied -and barked like the sycamore; some were of fantastic aspect, and reminded -one of the quaint apple trees in Japanese pictures. And there was one -peculiarly beautiful tree whose name and breed I did not know. The -foliage seemed to consist of big bunches of pine-spines, the lower half -of each bunch a rich brown or old-gold color, the upper half a most vivid -and strenuous and shouting green. The effect was altogether bewitching. -The tree was apparently rare. I should say that the first and last -samples of it seen by us were not more than half an hour apart. There -was another tree of striking aspect, a kind of pine, we were told. Its -foliage was as fine as hair, apparently, and its mass sphered itself -above the naked straight stem like an explosion of misty smoke. It was -not a sociable sort; it did not gather in groups or couples, but each -individual stood far away from its nearest neighbor. It scattered itself -in this spacious and exclusive fashion about the slopes of swelling -grassy great knolls, and stood in the full flood of the wonderful -sunshine; and as far as you could see the tree itself you could also see -the ink-black blot of its shadow on the shining green carpet at its feet. - -On some part of this railway journey we saw gorse and broom--importations -from England--and a gentleman who came into our compartment on a visit -tried to tell me which--was which; but as he didn't know, he had -difficulty. He said he was ashamed of his ignorance, but that he had -never been confronted with the question before during the fifty years and -more that he had spent in Australia, and so he had never happened to get -interested in the matter. But there was no need to be ashamed. The most -of us have his defect. We take a natural interest in novelties, but it -is against nature to take an interest in familiar things. The gorse and -the broom were a fine accent in the landscape. Here and there they burst -out in sudden conflagrations of vivid yellow against a background of -sober or sombre color, with a so startling effect as to make a body catch -his breath with the happy surprise of it. And then there was the wattle, -a native bush or tree, an inspiring cloud of sumptuous yellow bloom. It -is a favorite with the Australians, and has a fine fragrance, a quality -usually wanting in Australian blossoms. - -The gentleman who enriched me with the poverty of his formation about the -gorse and the broom told me that he came out from England a youth of -twenty and entered the Province of South Australia with thirty-six -shillings in his pocket--an adventurer without trade, profession, or -friends, but with a clearly-defined purpose in his head: he would stay -until he was worth L200, then go back home. He would allow himself five -years for the accumulation of this fortune. - -"That was more than fifty years ago," said he. "And here I am, yet." - -As he went out at the door he met a friend, and turned and introduced him -to me, and the friend and I had a talk and a smoke. I spoke of the -previous conversation and said there something very pathetic about this -half century of exile, and that I wished the L200 scheme had succeeded. - -"With him? Oh, it did. It's not so sad a case. He is modest, and he -left out some of the particulars. The lad reached South Australia just -in time to help discover the Burra-Burra copper mines. They turned out -L700,000 in the first three years. Up to now they have yielded -L120,000,000. He has had his share. Before that boy had been in the -country two years he could have gone home and bought a village; he could -go now and buy a city, I think. No, there is nothing very pathetic about -his case. He and his copper arrived at just a handy time to save South -Australia. It had got mashed pretty flat under the collapse of a land -boom a while before." There it is again; picturesque history ---Australia's specialty. In 1829 South Australia hadn't a white man in it. -In 1836 the British Parliament erected it--still a solitude--into a -Province, and gave it a governor and other governmental machinery. -Speculators took hold, now, and inaugurated a vast land scheme, and -invited immigration, encouraging it with lurid promises of sudden wealth. -It was well worked in London; and bishops, statesmen, and all ports of -people made a rush for the land company's shares. Immigrants soon began -to pour into the region of Adelaide and select town lots and farms in the -sand and the mangrove swamps by the sea. The crowds continued to come, -prices of land rose high, then higher and still higher, everybody was -prosperous and happy, the boom swelled into gigantic proportions. A -village of sheet iron huts and clapboard sheds sprang up in the sand, and -in these wigwams fashion made display; richly-dressed ladies played on -costly pianos, London swells in evening dress and patent-leather boots -were abundant, and this fine society drank champagne, and in other ways -conducted itself in this capital of humble sheds as it had been -accustomed to do in the aristocratic quarters of the metropolis of the -world. The provincial government put up expensive buildings for its own -use, and a palace with gardens for the use of its governor. The governor -had a guard, and maintained a court. Roads, wharves, and hospitals were -built. All this on credit, on paper, on wind, on inflated and fictitious -values--on the boom's moonshine, in fact. This went on handsomely during -four or five years. Then of a sudden came a smash. Bills for a huge -amount drawn the governor upon the Treasury were dishonored, the land -company's credit went up in smoke, a panic followed, values fell with a -rush, the frightened immigrants seized their grips and fled to other -lands, leaving behind them a good imitation of a solitude, where lately -had been a buzzing and populous hive of men. - -Adelaide was indeed almost empty; its population had fallen to 3,000. -During two years or more the death-trance continued. Prospect of revival -there was none; hope of it ceased. Then, as suddenly as the paralysis -had come, came the resurrection from it. Those astonishingly rich copper -mines were discovered, and the corpse got up and danced. - -The wool production began to grow; grain-raising followed--followed so -vigorously, too, that four or five years after the copper discovery, this -little colony, which had had to import its breadstuffs formerly, and pay -hard prices for them--once $50 a barrel for flour--had become an exporter -of grain. - -The prosperities continued. After many years Providence, desiring to -show especial regard for New South Wales and exhibit loving interest in -its welfare which should certify to all nations the recognition of that -colony's conspicuous righteousness and distinguished well-deserving, -conferred upon it that treasury of inconceivable riches, Broken Hill; and -South Australia went over the border and took it, giving thanks. - -Among our passengers was an American with a unique vocation. Unique is a -strong word, but I use it justifiably if I did not misconceive what the -American told me; for I understood him to say that in the world there was -not another man engaged in the business which he was following. He was -buying the kangaroo-skin crop; buying all of it, both the Australian crop -and the Tasmanian; and buying it for an American house in New York. The -prices were not high, as there was no competition, but the year's -aggregate of skins would cost him L30,000. I had had the idea that the -kangaroo was about extinct in Tasmania and well thinned out on the -continent. In America the skins are tanned and made into shoes. After -the tanning, the leather takes a new name--which I have forgotten--I only -remember that the new name does not indicate that the kangaroo furnishes -the leather. There was a German competition for a while, some years ago, -but that has ceased. The Germans failed to arrive at the secret of -tanning the skins successfully, and they withdrew from the business. Now -then, I suppose that I have seen a man whose occupation is really -entitled to bear that high epithet--unique. And I suppose that there is -not another occupation in the world that is restricted to the hands of a -sole person. I can think of no instance of it. There is more than one -Pope, there is more than one Emperor, there is even more than one living -god, walking upon the earth and worshiped in all sincerity by large -populations of men. I have seen and talked with two of these Beings -myself in India, and I have the autograph of one of them. It can come -good, by and by, I reckon, if I attach it to a "permit." - -Approaching Adelaide we dismounted from the train, as the French say, and -were driven in an open carriage over the hills and along their slopes to -the city. It was an excursion of an hour or two, and the charm of it -could not be overstated, I think. The road wound around gaps and gorges, -and offered all varieties of scenery and prospect--mountains, crags, -country homes, gardens, forests--color, color, color everywhere, and the -air fine and fresh, the skies blue, and not a shred of cloud to mar the -downpour of the brilliant sunshine. And finally the mountain gateway -opened, and the immense plain lay spread out below and stretching away -into dim distances on every hand, soft and delicate and dainty and -beautiful. On its near edge reposed the city. - -We descended and entered. There was nothing to remind one of the humble -capital, of buts and sheds of the long-vanished day of the land-boom. -No, this was a modern city, with wide streets, compactly built; with fine -homes everywhere, embowered in foliage and flowers, and with imposing -masses of public buildings nobly grouped and architecturally beautiful. - -There was prosperity, in the air; for another boom was on. Providence, -desiring to show especial regard for the neighboring colony on the west -called Western Australia--and exhibit a loving interest in its welfare -which should certify to all nations the recognition of that colony's -conspicuous righteousness and distinguished well-deserving, had recently -conferred upon it that majestic treasury of golden riches, Coolgardie; -and now South Australia had gone around the corner and taken it, giving -thanks. Everything comes to him who is patient and good, and waits. - -But South Australia deserves much, for apparently she is a hospitable -home for every alien who chooses to come; and for his religion, too. -She has a population, as per the latest census, of only 320,000-odd, and -yet her varieties of religion indicate the presence within her borders of -samples of people from pretty nearly every part of the globe you can -think of. Tabulated, these varieties of religion make a remarkable show. -One would have to go far to find its match. I copy here this -cosmopolitan curiosity, and it comes from the published census: - -Church of England,........... 89,271 -Roman Catholic,.............. 47,179 -Wesleyan,.................... 49,159 -Lutheran,.................... 23,328 -Presbyterian,................ 18,206 -Congregationalist,........... 11,882 -Bible Christian,............. 15,762 -Primitive Methodist,......... 11,654 -Baptist,..................... 17,547 -Christian Brethren,.......... 465 -Methodist New Connexion,..... 39 -Unitarian,................... 688 -Church of Christ,............ 3,367 -Society of Friends,.......... 100 -Salvation Army,.............. 4,356 -New Jerusalem Church,........ 168 -Jews,........................ 840 -Protestants (undefined),..... 6,532 -Mohammedans,................. 299 -Confucians, etc.,............ 3,884 -Other religions,............. 1,719 -Object,...................... 6,940 -Not stated,.................. 8,046 - -Total,.......................320,431 - - -The item in the above list "Other religions" includes the following as -returned: - -Agnostics, -Atheists, -Believers in Christ, -Buddhists, -Calvinists, -Christadelphians, -Christians, -Christ's Chapel, -Christian Israelites, -Christian Socialists, -Church of God, -Cosmopolitans, -Deists, -Evangelists, -Exclusive Brethren, -Free Church, -Free Methodists, -Freethinkers, -Followers of Christ, -Gospel Meetings, -Greek Church, -Infidels, -Maronites, -Memnonists, -Moravians, -Mormons, -Naturalists, -Orthodox, -Others (indefinite), -Pagans, -Pantheists, -Plymouth Brethren, -Rationalists, -Reformers, -Secularists, -Seventh-day Adventists, -Shaker, -Shintoists, -Spiritualists, -Theosophists, -Town (City) Mission, -Welsh Church, -Huguenot, -Hussite, -Zoroastrians, -Zwinglian, - - -About 64 roads to the other world. You see how healthy the religious -atmosphere is. Anything can live in it. Agnostics, Atheists, -Freethinkers, Infidels, Mormons, Pagans, Indefinites they are all there. -And all the big sects of the world can do more than merely live in it: -they can spread, flourish, prosper. All except the Spiritualists and the -Theosophists. That is the most curious feature of this curious table. -What is the matter with the specter? Why do they puff him away? He is a -welcome toy everywhere else in the world. - - - - -CHAPTER XIX. - -Pity is for the living, Envy is for the dead. - --Pudd'nhead Wilson's New Calendar. - -The successor of the sheet-iron hamlet of the mangrove marshes has that -other Australian specialty, the Botanical Gardens. We cannot have these -paradises. The best we could do would be to cover a vast acreage under -glass and apply steam heat. But it would be inadequate, the lacks would -still be so great: the confined sense, the sense of suffocation, the -atmospheric dimness, the sweaty heat--these would all be there, in place -of the Australian openness to the sky, the sunshine and the breeze. -Whatever will grow under glass with us will flourish rampantly out of -doors in Australia.--[The greatest heat in Victoria, that there is an -authoritative record of, was at Sandhurst, in January, 1862. The -thermometer then registered 117 degrees in the shade. In January, 1880, -the heat at Adelaide, South Australia, was 172 degrees in the sun.] - -When the white man came the continent was nearly as poor, in variety of -vegetation, as the desert of Sahara; now it has everything that grows on -the earth. In fact, not Australia only, but all Australasia has levied -tribute upon the flora of the rest of the world; and wherever one goes -the results appear, in gardens private and public, in the woodsy walls of -the highways, and in even the forests. If you see a curious or beautiful -tree or bush or flower, and ask about it, the people, answering, usually -name a foreign country as the place of its origin--India, Africa, Japan, -China, England, America, Java, Sumatra, New Guinea, Polynesia, and so on. - -In the Zoological Gardens of Adelaide I saw the only laughing jackass -that ever showed any disposition to be courteous to me. This one opened -his head wide and laughed like a demon; or like a maniac who was consumed -with humorous scorn over a cheap and degraded pun. It was a very human -laugh. If he had been out of sight I could have believed that the -laughter came from a man. It is an odd-looking bird, with a head and -beak that are much too large for its body. In time man will exterminate -the rest of the wild creatures of Australia, but this one will probably -survive, for man is his friend and lets him alone. Man always has a good -reason for his charities towards wild things, human or animal when he has -any. In this case the bird is spared because he kills snakes. If L. J. -he will not kill all of them. - -In that garden I also saw the wild Australian dog--the dingo. He was a -beautiful creature--shapely, graceful, a little wolfish in some of his -aspects, but with a most friendly eye and sociable disposition. The -dingo is not an importation; he was present in great force when the -whites first came to the continent. It may be that he is the oldest dog -in the universe; his origin, his descent, the place where his ancestors -first appeared, are as unknown and as untraceable as are the camel's. -He is the most precious dog in the world, for he does not bark. But in -an evil hour he got to raiding the sheep-runs to appease his hunger, and -that sealed his doom. He is hunted, now, just as if he were a wolf. -He has been sentenced to extermination, and the sentence will be carried -out. This is all right, and not objectionable. The world was made for -man--the white man. - -South Australia is confusingly named. All of the colonies have a -southern exposure except one--Queensland. Properly speaking, South -Australia is middle Australia. It extends straight up through the center -of the continent like the middle board in a center-table. It is 2,000 -miles high, from south to north, and about a third as wide. A wee little -spot down in its southeastern corner contains eight or nine-tenths of its -population; the other one or two-tenths are elsewhere--as elsewhere as -they could be in the United States with all the country between Denver -and Chicago, and Canada and the Gulf of Mexico to scatter over. There is -plenty of room. - -A telegraph line stretches straight up north through that 2,000 miles of -wilderness and desert from Adelaide to Port Darwin on the edge of the -upper ocean. South Australia built the line; and did it in 1871-2 when -her population numbered only 185,000. It was a great work; for there -were no roads, no paths; 1,300 miles of the route had been traversed but -once before by white men; provisions, wire, and poles had to be carried -over immense stretches of desert; wells had to be dug along the route to -supply the men and cattle with water. - -A cable had been previously laid from Port Darwin to Java and thence to -India, and there was telegraphic communication with England from India. -And so, if Adelaide could make connection with Port Darwin it meant -connection with the whole world. The enterprise succeeded. One could -watch the London markets daily, now; the profit to the wool-growers of -Australia was instant and enormous. - -A telegram from Melbourne to San Francisco covers approximately 20,000 -miles--the equivalent of five-sixths of the way around the globe. It has -to halt along the way a good many times and be repeated; still, but -little time is lost. These halts, and the distances between them, are -here tabulated.--[From "Round the Empire." (George R. Parkin), all but -the last two.] - - Miles. - -Melbourne-Mount Gambier,.......300 -Mount Gambier-Adelaide,........270 -Adelaide-Port Augusta,.........200 -Port Augusta-Alice Springs...1,036 -Alice Springs-Port Darwin,.....898 -Port Darwin-Banjoewangie,... 1,150 -Banjoewangie-Batavia,..........480 -Batavia-Singapore,.............553 -Singapore-Penang,..............399 -Penang-Madras,...............1,280 -Madras-Bombay,.................650 -Bombay-Aden,.................1,662 -Aden-Suez,...................1,346 -Suez-Alexandria,...............224 -Alexandria-Malta,..............828 -Malta-Gibraltar,.............1,008 -Gibraltar-Falmouth,..........1,061 -Falmouth-London,...............350 -London-New York,.............2,500 -New York-San Francisco,......3,500 - - -I was in Adelaide again, some months later, and saw the multitudes gather -in the neighboring city of Glenelg to commemorate the Reading of the -Proclamation--in 1836--which founded the Province. If I have at any time -called it a Colony, I withdraw the discourtesy. It is not a Colony, it -is a Province; and officially so. Moreover, it is the only one so named -in Australasia. There was great enthusiasm; it was the Province's -national holiday, its Fourth of July, so to speak. It is the pre-eminent -holiday; and that is saying much, in a country where they seem to have a -most un-English mania for holidays. Mainly they are workingmen's -holidays; for in South Australia the workingman is sovereign; his vote is -the desire of the politician--indeed, it is the very breath of the -politician's being; the parliament exists to deliver the will of the -workingman, and the government exists to execute it. The workingman is a -great power everywhere in Australia, but South Australia is his paradise. -He has had a hard time in this world, and has earned a paradise. I am -glad he has found it. The holidays there are frequent enough to be -bewildering to the stranger. I tried to get the hang of the system, but -was not able to do it. - -You have seen that the Province is tolerant, religious-wise. It is so -politically, also. One of the speakers at the Commemoration banquet--the -Minister of Public Works-was an American, born and reared in New England. -There is nothing narrow about the Province, politically, or in any other -way that I know of. Sixty-four religions and a Yankee cabinet minister. -No amount of horse-racing can damn this community. - -The mean temperature of the Province is 62 deg. The death-rate is 13 in -the 1,000--about half what it is in the city of New York, I should think, -and New York is a healthy city. Thirteen is the death-rate for the -average citizen of the Province, but there seems to be no death-rate for -the old people. There were people at the Commemoration banquet who could -remember Cromwell. There were six of them. These Old Settlers had all -been present at the original Reading of the Proclamation, in 1536. They -showed signs of the blightings and blastings of time, in their outward -aspect, but they were young within; young and cheerful, and ready to -talk; ready to talk, and talk all you wanted; in their turn, and out of -it. They were down for six speeches, and they made 42. The governor and -the cabinet and the mayor were down for 42 speeches, and they made 6. -They have splendid grit, the Old Settlers, splendid staying power. But -they do not hear well, and when they see the mayor going through motions -which they recognize as the introducing of a speaker, they think they are -the one, and they all get up together, and begin to respond, in the most -animated way; and the more the mayor gesticulates, and shouts "Sit down! -Sit down!" the more they take it for applause, and the more excited and -reminiscent and enthusiastic they get; and next, when they see the whole -house laughing and crying, three of them think it is about the bitter -old-time hardships they are describing, and the other three think the -laughter is caused by the jokes they have been uncorking--jokes of the -vintage of 1836--and then the way they do go on! And finally when ushers -come and plead, and beg, and gently and reverently crowd them down into -their seats, they say, "Oh, I'm not tired--I could bang along a week!" -and they sit there looking simple and childlike, and gentle, and proud of -their oratory, and wholly unconscious of what is going on at the other -end of the room. And so one of the great dignitaries gets a chance, and -begins his carefully prepared speech, impressively and with solemnity-- - - "When we, now great and prosperous and powerful, bow our heads in - reverent wonder in the contemplation of those sublimities of energy, - of wisdom, of forethought, of----" - -Up come the immortal six again, in a body, with a joyous "Hey, I've -thought of another one!" and at it they go, with might and main, hearing -not a whisper of the pandemonium that salutes them, but taking all the -visible violences for applause, as before, and hammering joyously away -till the imploring ushers pray them into their seats again. And a pity, -too; for those lovely old boys did so enjoy living their heroic youth -over, in these days of their honored antiquity; and certainly the things -they had to tell were usually worth the telling and the hearing. - -It was a stirring spectacle; stirring in more ways than one, for it was -amazingly funny, and at the same time deeply pathetic; for they had seen -so much, these time-worn veterans, end had suffered so much; and had -built so strongly and well, and laid the foundations of their -commonwealth so deep, in liberty and tolerance; and had lived to see the -structure rise to such state and dignity and hear themselves so praised -for honorable work. - -One of these old gentlemen told me some things of interest afterward; -things about the aboriginals, mainly. He thought them intelligent ---remarkably so in some directions--and he said that along with their -unpleasant qualities they had some exceedingly good ones; and he -considered it a great pity that the race had died out. He instanced -their invention of the boomerang and the "weet-weet" as evidences of -their brightness; and as another evidence of it he said he had never seen -a white man who had cleverness enough to learn to do the miracles with -those two toys that the aboriginals achieved. He said that even the -smartest whites had been obliged to confess that they could not learn the -trick of the boomerang in perfection; that it had possibilities which -they could not master. The white man could not control its motions, -could not make it obey him; but the aboriginal could. He told me some -wonderful things--some almost incredible things--which he had seen the -blacks do with the boomerang and the weet-weet. They have been confirmed -to me since by other early settlers and by trustworthy books. - -It is contended--and may be said to be conceded--that the boomerang was -known to certain savage tribes in Europe in Roman times. In support of -this, Virgil and two other Roman poets are quoted. It is also contended -that it was known to the ancient Egyptians. - -One of two things either some one with is then apparent: a boomerang -arrived in Australia in the days of antiquity before European knowledge -of the thing had been lost, or the Australian aboriginal reinvented it. -It will take some time to find out which of these two propositions is the -fact. But there is no hurry. - - - - -CHAPTER XX. - -It is by the goodness of God that in our country we have those three -unspeakably precious things: freedom of speech, freedom of conscience, -and the prudence never to practice either of them. - --Pudd'nhead Wilson's New Calendar. - -From diary: - -Mr. G. called. I had not seen him since Nauheim, Germany--several years -ago; the time that the cholera broke out at Hamburg. We talked of the -people we had known there, or had casually met; and G. said: - -"Do you remember my introducing you to an earl--the Earl of C.?" - -"Yes. That was the last time I saw you. You and he were in a carriage, -just starting--belated--for the train. I remember it." - -"I remember it too, because of a thing which happened then which I was -not looking for. He had told me a while before, about a remarkable and -interesting Californian whom he had met and who was a friend of yours, -and said that if he should ever meet you he would ask you for some -particulars about that Californian. The subject was not mentioned that -day at Nauheim, for we were hurrying away, and there was no time; but the -thing that surprised me was this: when I induced you, you said, 'I am -glad to meet your lordship gain.' The I again' was the surprise. He is -a little hard of hearing, and didn't catch that word, and I thought you -hadn't intended that he should. As we drove off I had only time to say, -'Why, what do you know about him?' and I understood you to say, 'Oh, -nothing, except that he is the quickest judge of----' Then we were gone, -and I didn't get the rest. I wondered what it was that he was such a -quick judge of. I have thought of it many times since, and still -wondered what it could be. He and I talked it over, but could not guess -it out. He thought it must be fox-hounds or horses, for he is a good -judge of those--no one is a better. But you couldn't know that, because -you didn't know him; you had mistaken him for some one else; it must be -that, he said, because he knew you had never met him before. And of -course you hadn't had you?" - -"Yes, I had." - -"Is that so? Where?" - -"At a fox-hunt, in England." - -"How curious that is. Why, he hadn't the least recollection of it. Had -you any conversation with him?" - -"Some--yes." - -"Well, it left not the least impression upon him. What did you talk -about?" - -"About the fox. I think that was all." - -"Why, that would interest him; that ought to have left an impression. -What did he talk about?" - -"The fox." - -It's very curious. I don't understand it. Did what he said leave an -impression upon you?" - -"Yes. It showed me that he was a quick judge of--however, I will tell -you all about it, then you will understand. It was a quarter of a -century ago 1873 or '74. I had an American friend in London named F., -who was fond of hunting, and his friends the Blanks invited him and me to -come out to a hunt and be their guests at their country place. In the -morning the mounts were provided, but when I saw the horses I changed my -mind and asked permission to walk. I had never seen an English hunter -before, and it seemed to me that I could hunt a fox safer on the ground. -I had always been diffident about horses, anyway, even those of the -common altitudes, and I did not feel competent to hunt on a horse that -went on stilts. So then Mrs. Blank came to my help and said I could go -with her in the dog-cart and we would drive to a place she knew of, and -there we should have a good glimpse of the hunt as it went by. - -"When we got to that place I got out and went and leaned my elbows on a -low stone wall which enclosed a turfy and beautiful great field with -heavy wood on all its sides except ours. Mrs. Blank sat in the dog-cart -fifty yards away, which was as near as she could get with the vehicle. -I was full of interest, for I had never seen a fox-hunt. I waited, -dreaming and imagining, in the deep stillness and impressive tranquility -which reigned in that retired spot. Presently, from away off in the -forest on the left, a mellow bugle-note came floating; then all of a -sudden a multitude of dogs burst out of that forest and went tearing by -and disappeared in the forest on the right; there was a pause, and then -a cloud of horsemen in black caps and crimson coats plunged out of the -left-hand forest and went flaming across the field like a prairie-fire, -a stirring sight to see. There was one man ahead of the rest, and he -came spurring straight at me. He was fiercely excited. It was fine to -see him ride; he was a master horseman. He came like, a storm till he -was within seven feet of me, where I was leaning on the wall, then he -stood his horse straight up in the air on his hind toe-nails, and shouted -like a demon: - -"'Which way'd the fox go?' - -"I didn't much like the tone, but I did not let on; for he was excited, -you know. But I was calm; so I said softly, and without acrimony: - -"'Which fox?' - -"It seemed to anger him. I don't know why; and he thundered out: - -"'WHICH fox? Why, THE fox? Which way did the FOX go?' - -"I said, with great gentleness--even argumentatively: - -"'If you could be a little more definite--a little less vague--because I -am a stranger, and there are many foxes, as you will know even better -than I, and unless I know which one it is that you desire to identify, -and----' - -"'You're certainly the damdest idiot that has escaped in a thousand -years!' and he snatched his great horse around as easily as I would -snatch a cat, and was away like a hurricane. A very excitable man. - -"I went back to Mrs. Blank, and she was excited, too--oh, all alive. She -said: - -"'He spoke to you!--didn't he?' - -"'Yes, it is what happened.' - -"'I knew it! I couldn't hear what he said, but I knew be spoke to you! Do -you know who it was? It was Lord C., and he is Master of the Buckhounds! -Tell me--what do you think of him?' - -"'Him? Well, for sizing-up a stranger, he's got the most sudden and -accurate judgment of any man I ever saw.' - -"It pleased her. I thought it would." - -G. got away from Nauheim just in time to escape being shut in by the -quarantine-bars on the frontiers; and so did we, for we left the next -day. But G. had a great deal of trouble in getting by the Italian -custom-house, and we should have fared likewise but for the -thoughtfulness of our consul-general in Frankfort. He introduced me to -the Italian consul-general, and I brought away from that consulate a -letter which made our way smooth. It was a dozen lines merely commending -me in a general way to the courtesies of servants in his Italian -Majesty's service, but it was more powerful than it looked. In addition -to a raft of ordinary baggage, we had six or eight trunks which were -filled exclusively with dutiable stuff--household goods purchased in -Frankfort for use in Florence, where we had taken a house. I was going -to ship these through by express; but at the last moment an order went -throughout Germany forbidding the moving of any parcels by train unless -the owner went with them. This was a bad outlook. We must take these -things along, and the delay sure to be caused by the examination of them -in the custom-house might lose us our train. I imagined all sorts of -terrors, and enlarged them steadily as we approached the Italian -frontier. We were six in number, clogged with all that baggage, and I -was courier for the party the most incapable one they ever employed. - -We arrived, and pressed with the crowd into the immense custom-house, and -the usual worries began; everybody crowding to the counter and begging to -have his baggage examined first, and all hands clattering and chattering -at once. It seemed to me that I could do nothing; it would be better to -give it all up and go away and leave the baggage. I couldn't speak the -language; I should never accomplish anything. Just then a tall handsome -man in a fine uniform was passing by and I knew he must be the -station-master--and that reminded me of my letter. I ran to him and put -it into his hands. He took it out of the envelope, and the moment his -eye caught the royal coat of arms printed at its top, he took off his cap -and made a beautiful bow to me, and said in English: - -"Which is your baggage? Please show it to me." - -I showed him the mountain. Nobody was disturbing it; nobody was -interested in it; all the family's attempts to get attention to it had -failed--except in the case of one of the trunks containing the dutiable -goods. It was just being opened. My officer said: - -"There, let that alone! Lock it. Now chalk it. Chalk all of the lot. -Now please come and show the hand-baggage." - -He plowed through the waiting crowd, I following, to the counter, and he -gave orders again, in his emphatic military way: - -"Chalk these. Chalk all of them." - -Then he took off his cap and made that beautiful bow again, and went his -way. By this time these attentions had attracted the wonder of that acre -of passengers, and the whisper had gone around that the royal family were -present getting their baggage chalked; and as we passed down in review on -our way to the door, I was conscious of a pervading atmosphere of envy -which gave me deep satisfaction. - -But soon there was an accident. My overcoat pockets were stuffed with -German cigars and linen packages of American smoking tobacco, and a -porter was following us around with this overcoat on his arm, and -gradually getting it upside down. Just as I, in the rear of my family, -moved by the sentinels at the door, about three hatfuls of the tobacco -tumbled out on the floor. One of the soldiers pounced upon it, gathered -it up in his arms, pointed back whence I had come, and marched me ahead -of him past that long wall of passengers again--he chattering and -exulting like a devil, they smiling in peaceful joy, and I trying to look -as if my pride was not hurt, and as if I did not mind being brought to -shame before these pleased people who had so lately envied me. But at -heart I was cruelly humbled. - -When I had been marched two-thirds of the long distance and the misery of -it was at the worst, the stately station-master stepped out from -somewhere, and the soldier left me and darted after him and overtook him; -and I could see by the soldier's excited gestures that he was betraying -to him the whole shabby business. The station-master was plainly very -angry. He came striding down toward me, and when he was come near he -began to pour out a stream of indignant Italian; then suddenly took off -his hat and made that beautiful bow and said: - -"Oh, it is you! I beg a thousands pardons! This idiot here---" He turned -to the exulting soldier and burst out with a flood of white-hot Italian -lava, and the next moment he was bowing, and the soldier and I were -moving in procession again--he in the lead and ashamed, this time, I with -my chin up. And so we marched by the crowd of fascinated passengers, and -I went forth to the train with the honors of war. Tobacco and all. - - - - -CHAPTER XXI. - -Man will do many things to get himself loved, he will do all things to -get himself envied. - --Pudd'nhead Wilson's New Calendar. - -Before I saw Australia I had never heard of the "weet-weet" at all. -I met but few men who had seen it thrown--at least I met but few who -mentioned having seen it thrown. Roughly described, it is a fat wooden -cigar with its butt-end fastened to a flexible twig. The whole thing is -only a couple of feet long, and weighs less than two ounces. This -feather--so to call it--is not thrown through the air, but is flung with -an underhanded throw and made to strike the ground a little way in front -of the thrower; then it glances and makes a long skip; glances again, -skips again, and again and again, like the flat stone which a boy sends -skating over the water. The water is smooth, and the stone has a good -chance; so a strong man may make it travel fifty or seventy-five yards; -but the weet-weet has no such good chance, for it strikes sand, grass, -and earth in its course. Yet an expert aboriginal has sent it a measured -distance of two hundred and twenty yards. It would have gone even -further but it encountered rank ferns and underwood on its passage and -they damaged its speed. Two hundred and twenty yards; and so weightless -a toy--a mouse on the end of a bit of wire, in effect; and not sailing -through the accommodating air, but encountering grass and sand and stuff -at every jump. It looks wholly impossible; but Mr. Brough Smyth saw the -feat and did the measuring, and set down the facts in his book about -aboriginal life, which he wrote by command of the Victorian Government. - -What is the secret of the feat? No one explains. It cannot be physical -strength, for that could not drive such a feather-weight any distance. -It must be art. But no one explains what the art of it is; nor how it -gets around that law of nature which says you shall not throw any -two-ounce thing 220 yards, either through the air or bumping along the -ground. Rev. J. G. Woods says: - -"The distance to which the weet-weet or kangaroo-rat can be thrown is -truly astonishing. I have seen an Australian stand at one side of -Kennington Oval and throw the kangaroo rat completely across it." (Width -of Kensington Oval not stated.) "It darts through the air with the sharp -and menacing hiss of a rifle-ball, its greatest height from the ground -being some seven or eight feet . . . . . . When properly thrown it -looks just like a living animal leaping along . . . . . . Its -movements have a wonderful resemblance to the long leaps of a -kangaroo-rat fleeing in alarm, with its long tail trailing behind it." - -The Old Settler said that he had seen distances made by the weet-weet, in -the early days, which almost convinced him that it was as extraordinary -an instrument as the boomerang. - -There must have been a large distribution of acuteness among those naked -skinny aboriginals, or they couldn't have been such unapproachable -trackers and boomerangers and weet-weeters. It must have been -race-aversion that put upon them a good deal of the low-rate intellectual -reputation which they bear and have borne this long time in the world's -estimate of them. - -They were lazy--always lazy. Perhaps that was their trouble. It is a -killing defect. Surely they could have invented and built a competent -house, but they didn't. And they could have invented and developed the -agricultural arts, but they didn't. They went naked and houseless, and -lived on fish and grubs and worms and wild fruits, and were just plain -savages, for all their smartness. - -With a country as big as the United States to live and multiply in, and -with no epidemic diseases among them till the white man came with those -and his other appliances of civilization, it is quite probable that there -was never a day in his history when he could muster 100,000 of his race -in all Australia. He diligently and deliberately kept population down by -infanticide--largely; but mainly by certain other methods. He did not -need to practise these artificialities any more after the white man came. -The white man knew ways of keeping down population which were worth -several of his. The white man knew ways of reducing a native population -80 percent. in 20 years. The native had never seen anything as fine as -that before. - -For example, there is the case of the country now called Victoria--a -country eighty times as large as Rhode Island, as I have already said. -By the best official guess there were 4,500 aboriginals in it when the -whites came along in the middle of the 'Thirties. Of these, 1,000 lived -in Gippsland, a patch of territory the size of fifteen or sixteen Rhode -Islands: they did not diminish as fast as some of the other communities; -indeed, at the end of forty years there were still 200 of them left. The -Geelong tribe diminished more satisfactorily: from 173 persons it faded -to 34 in twenty years; at the end of another twenty the tribe numbered -one person altogether. The two Melbourne tribes could muster almost 300 -when the white man came; they could muster but twenty, thirty-seven years -later, in 1875. In that year there were still odds and ends of tribes -scattered about the colony of Victoria, but I was told that natives of -full blood are very scarce now. It is said that the aboriginals continue -in some force in the huge territory called Queensland. - -The early whites were not used to savages. They could not understand the -primary law of savage life: that if a man do you a wrong, his whole tribe -is responsible--each individual of it--and you may take your change out -of any individual of it, without bothering to seek out the guilty one. -When a white killed an aboriginal, the tribe applied the ancient law, and -killed the first white they came across. To the whites this was a -monstrous thing. Extermination seemed to be the proper medicine for such -creatures as this. They did not kill all the blacks, but they promptly -killed enough of them to make their own persons safe. From the dawn of -civilization down to this day the white man has always used that very -precaution. Mrs. Campbell Praed lived in Queensland, as a child, in the -early days, and in her "Sketches of Australian life," we get informing -pictures of the early struggles of the white and the black to reform each -other. - -Speaking of pioneer days in the mighty wilderness of Queensland, Mrs. -Praed says: - - "At first the natives retreated before the whites; and, except that - they every now and then speared a beast in one of the herds, gave - little cause for uneasiness. But, as the number of squatters - increased, each one taking up miles of country and bringing two or - three men in his train, so that shepherds' huts and stockmen's camps - lay far apart, and defenseless in the midst of hostile tribes, the - Blacks' depredations became more frequent and murder was no unusual - event. - - "The loneliness of the Australian bush can hardly be painted in - words. Here extends mile after mile of primeval forest where - perhaps foot of white man has never trod--interminable vistas where - the eucalyptus trees rear their lofty trunks and spread forth their - lanky limbs, from which the red gum oozes and hangs in fantastic - pendants like crimson stalactites; ravines along the sides of which - the long-bladed grass grows rankly; level untimbered plains - alternating with undulating tracts of pasture, here and there broken - by a stony ridge, steep gully, or dried-up creek. All wild, vast - and desolate; all the same monotonous gray coloring, except where - the wattle, when in blossom, shows patches of feathery gold, or a - belt of scrub lies green, glossy, and impenetrable as Indian jungle. - - "The solitude seems intensified by the strange sounds of reptiles, - birds, and insects, and by the absence of larger creatures; of which - in the day-time, the only audible signs are the stampede of a herd - of kangaroo, or the rustle of a wallabi, or a dingo stirring the - grass as it creeps to its lair. But there are the whirring of - locusts, the demoniac chuckle of the laughing jack-ass, the - screeching of cockatoos and parrots, the hissing of the frilled - lizard, and the buzzing of innumerable insects hidden under the - dense undergrowth. And then at night, the melancholy wailing of the - curlews, the dismal howling of dingoes, the discordant croaking of - tree-frogs, might well shake the nerves of the solitary watcher." - -That is the theater for the drama. When you comprehend one or two other -details, you will perceive how well suited for trouble it was, and how -loudly it invited it. The cattlemen's stations were scattered over that -profound wilderness miles and miles apart--at each station half a dozen -persons. There was a plenty of cattle, the black natives were always -ill-nourished and hungry. The land belonged to them. The whites had not -bought it, and couldn't buy it; for the tribes had no chiefs, nobody in -authority, nobody competent to sell and convey; and the tribes themselves -had no comprehension of the idea of transferable ownership of land. The -ousted owners were despised by the white interlopers, and this opinion -was not hidden under a bushel. More promising materials for a tragedy -could not have been collated. Let Mrs. Praed speak: - - "At Nie station, one dark night, the unsuspecting hut-keeper, - having, as he believed, secured himself against assault, was lying - wrapped in his blankets sleeping profoundly. The Blacks crept - stealthily down the chimney and battered in his skull while he - slept." - -One could guess the whole drama from that little text. The curtain was -up. It would not fall until the mastership of one party or the other was -determined--and permanently: - - "There was treachery on both sides. The Blacks killed the Whites - when they found them defenseless, and the Whites slew the Blacks in - a wholesale and promiscuous fashion which offended against my - childish sense of justice. - - "They were regarded as little above the level of brutes, and in some - cases were destroyed like vermin. - - "Here is an instance. A squatter, whose station was surrounded by - Blacks, whom he suspected to be hostile and from whom he feared an - attack, parleyed with them from his house-door. He told them it was - Christmas-time--a time at which all men, black or white, feasted; - that there were flour, sugar-plums, good things in plenty in the - store, and that he would make for them such a pudding as they had - never dreamed of--a great pudding of which all might eat and be - filled. The Blacks listened and were lost. The pudding was made - and distributed. Next morning there was howling in the camp, for it - had been sweetened with sugar and arsenic!" - -The white man's spirit was right, but his method was wrong. His spirit -was the spirit which the civilized white has always exhibited toward the -savage, but the use of poison was a departure from custom. True, it was -merely a technical departure, not a real one; still, it was a departure, -and therefore a mistake, in my opinion. It was better, kinder, swifter, -and much more humane than a number of the methods which have been -sanctified by custom, but that does not justify its employment. That is, -it does not wholly justify it. Its unusual nature makes it stand out and -attract an amount of attention which it is not entitled to. It takes -hold upon morbid imaginations and they work it up into a sort of -exhibition of cruelty, and this smirches the good name of our -civilization, whereas one of the old harsher methods would have had no -such effect because usage has made those methods familiar to us and -innocent. In many countries we have chained the savage and starved him -to death; and this we do not care for, because custom has inured us to -it; yet a quick death by poison is loving-kindness to it. In many -countries we have burned the savage at the stake; and this we do not care -for, because custom has inured us to it; yet a quick death is -loving-kindness to it. In more than one country we have hunted the -savage and his little children and their mother with dogs and guns -through the woods and swamps for an afternoon's sport, and filled the -region with happy laughter over their sprawling and stumbling flight, and -their wild supplications for mercy; but this method we do not mind, -because custom has inured us to it; yet a quick death by poison is -loving-kindness to it. In many countries we have taken the savage's land -from him, and made him our slave, and lashed him every day, and broken -his pride, and made death his only friend, and overworked him till he -dropped in his tracks; and this we do not care for, because custom has -inured us to it; yet a quick death by poison is loving-kindness to it. -In the Matabeleland today--why, there we are confining ourselves to -sanctified custom, we Rhodes-Beit millionaires in South Africa and Dukes -in London; and nobody cares, because we are used to the old holy customs, -and all we ask is that no notice-inviting new ones shall be intruded upon -the attention of our comfortable consciences. Mrs. Praed says of the -poisoner, "That squatter deserves to have his name handed down to the -contempt of posterity." - -I am sorry to hear her say that. I myself blame him for one thing, and -severely, but I stop there. I blame him for, the indiscretion of -introducing a novelty which was calculated to attract attention to our -civilization. There was no occasion to do that. It was his duty, and it -is every loyal man's duty to protect that heritage in every way he can; -and the best way to do that is to attract attention elsewhere. The -squatter's judgment was bad--that is plain; but his heart was right. He -is almost the only pioneering representative of civilization in history -who has risen above the prejudices of his caste and his heredity and -tried to introduce the element of mercy into the superior race's dealings -with the savage. His name is lost, and it is a pity; for it deserves to -be handed down to posterity with homage and reverence. - -This paragraph is from a London journal: - - "To learn what France is doing to spread the blessings of - civilization in her distant dependencies we may turn with advantage - to New Caledonia. With a view to attracting free settlers to that - penal colony, M. Feillet, the Governor, forcibly expropriated the - Kanaka cultivators from the best of their plantations, with a - derisory compensation, in spite of the protests of the Council - General of the island. Such immigrants as could be induced to cross - the seas thus found themselves in possession of thousands of coffee, - cocoa, banana, and bread-fruit trees, the raising of which had cost - the wretched natives years of toil whilst the latter had a few - five-franc pieces to spend in the liquor stores of Noumea." - -You observe the combination? It is robbery, humiliation, and slow, slow -murder, through poverty and the white man's whisky. The savage's gentle -friend, the savage's noble friend, the only magnanimous and unselfish -friend the savage has ever had, was not there with the merciful swift -release of his poisoned pudding. - -There are many humorous things in the world; among them the white man's -notion that he is less savage than the other savages.--[See Chapter on -Tasmania, post.] - - - - -CHAPTER XXII. - -Nothing is so ignorant as a man's left hand, except a lady's watch. - - --Pudd'nhead Wilson's New Calendar. - -You notice that Mrs. Praed knows her art. She can place a thing before -you so that you can see it. She is not alone in that. Australia is -fertile in writers whose books are faithful mirrors of the life of the -country and of its history. The materials were surprisingly rich, both -in quality and in mass, and Marcus Clarke, Ralph Boldrewood, Cordon, -Kendall, and the others, have built out of them a brilliant and vigorous -literature, and one which must endure. Materials--there is no end to -them! Why, a literature might be made out of the aboriginal all by -himself, his character and ways are so freckled with varieties--varieties -not staled by familiarity, but new to us. You do not need to invent any -picturesquenesses; whatever you want in that line he can furnish you; and -they will not be fancies and doubtful, but realities and authentic. In -his history, as preserved by the white man's official records, he is -everything--everything that a human creature can be. He covers the -entire ground. He is a coward--there are a thousand fact to prove it. -He is brave--there are a thousand facts to prove it. He is treacherous ---oh, beyond imagination! he is faithful, loyal, true--the white man's -records supply you with a harvest of instances of it that are noble, -worshipful, and pathetically beautiful. He kills the starving stranger -who comes begging for food and shelter there is proof of it. He succors, -and feeds, and guides to safety, to-day, the lost stranger who fired on -him only yesterday--there is proof of it. He takes his reluctant bride -by force, he courts her with a club, then loves her faithfully through a -long life--it is of record. He gathers to himself another wife by the -same processes, beats and bangs her as a daily diversion, and by and by -lays down his life in defending her from some outside harm--it is of -record. He will face a hundred hostiles to rescue one of his children, -and will kill another of his children because the family is large enough -without it. His delicate stomach turns, at certain details of the white -man's food; but he likes over-ripe fish, and brazed dog, and cat, and -rat, and will eat his own uncle with relish. He is a sociable animal, -yet he turns aside and hides behind his shield when his mother-in-law -goes by. He is childishly afraid of ghosts and other trivialities that -menace his soul, but dread of physical pain is a weakness which he is not -acquainted with. He knows all the great and many of the little -constellations, and has names for them; he has a symbol-writing by means -of which he can convey messages far and wide among the tribes; he has a -correct eye for form and expression, and draws a good picture; he can -track a fugitive by delicate traces which the white man's eye cannot -discern, and by methods which the finest white intelligence cannot -master; he makes a missile which science itself cannot duplicate without -the model--if with it; a missile whose secret baffled and defeated the -searchings and theorizings of the white mathematicians for seventy years; -and by an art all his own he performs miracles with it which the white -man cannot approach untaught, nor parallel after teaching. Within -certain limits this savage's intellect is the alertest and the brightest -known to history or tradition; and yet the poor creature was never able -to invent a counting system that would reach above five, nor a vessel -that he could boil water in. He is the prize-curiosity of all the races. -To all intents and purposes he is dead--in the body; but he has features -that will live in literature. - -Mr. Philip Chauncy, an officer of the Victorian Government, contributed -to its archives a report of his personal observations of the aboriginals -which has in it some things which I wish to condense slightly and insert -here. He speaks of the quickness of their eyes and the accuracy of their -judgment of the direction of approaching missiles as being quite -extraordinary, and of the answering suppleness and accuracy of limb and -muscle in avoiding the missile as being extraordinary also. He has seen -an aboriginal stand as a target for cricket-balls thrown with great force -ten or fifteen yards, by professional bowlers, and successfully dodge -them or parry them with his shield during about half an hour. One of -those balls, properly placed, could have killed him; "Yet he depended, -with the utmost self-possession, on the quickness of his eye and his -agility." - -The shield was the customary war-shield of his race, and would not be a -protection to you or to me. It is no broader than a stovepipe, and is -about as long as a man's arm. The opposing surface is not flat, but -slopes away from the centerline like a boat's bow. The difficulty about -a cricket-ball that has been thrown with a scientific "twist" is, that it -suddenly changes it course when it is close to its target and comes -straight for the mark when apparently it was going overhead or to one -side. I should not be able to protect myself from such balls for -half-an-hour, or less. - -Mr. Chauncy once saw "a little native man" throw a cricket-ball 119 -yards. This is said to beat the English professional record by thirteen -yards. - -We have all seen the circus-man bound into the air from a spring-board -and make a somersault over eight horses standing side by side. Mr. -Chauncy saw an aboriginal do it over eleven; and was assured that he had -sometimes done it over fourteen. But what is that to this: - - "I saw the same man leap from the ground, and in going over he - dipped his head, unaided by his hands, into a hat placed in an - inverted position on the top of the head of another man sitting - upright on horseback--both man and horse being of the average size. - The native landed on the other side of the horse with the hat fairly - on his head. The prodigious height of the leap, and the precision - with which it was taken so as to enable him to dip his head into the - hat, exceeded any feat of the kind I have ever beheld." - -I should think so! On board a ship lately I saw a young Oxford athlete -run four steps and spring into the air and squirm his hips by a -side-twist over a bar that was five and one-half feet high; but he could -not have stood still and cleared a bar that was four feet high. I know -this, because I tried it myself. - -One can see now where the kangaroo learned its art. - -Sir George Grey and Mr. Eyre testify that the natives dug wells fourteen -or fifteen feet deep and two feet in diameter at the bore--dug them in -the sand--wells that were "quite circular, carried straight down, and the -work beautifully executed." - -Their tools were their hands and feet. How did they throw sand out from -such a depth? How could they stoop down and get it, with only two feet -of space to stoop in? How did they keep that sand-pipe from caving in -on them? I do not know. Still, they did manage those seeming -impossibilities. Swallowed the sand, may be. - -Mr. Chauncy speaks highly of the patience and skill and alert -intelligence of the native huntsman when he is stalking the emu, the -kangaroo, and other game: - - "As he walks through the bush his step is light, elastic, and - noiseless; every track on the earth catches his keen eye; a leaf, or - fragment of a stick turned, or a blade of grass recently bent by the - tread of one of the lower animals, instantly arrests his attention; - in fact, nothing escapes his quick and powerful sight on the ground, - in the trees, or in the distance, which may supply him with a meal - or warn him of danger. A little examination of the trunk of a tree - which may be nearly covered with the scratches of opossums ascending - and descending is sufficient to inform him whether one went up the - night before without coming down again or not." - -Fennimore Cooper lost his chance. He would have known how to value these -people. He wouldn't have traded the dullest of them for the brightest -Mohawk he ever invented. - -All savages draw outline pictures upon bark; but the resemblances are not -close, and expression is usually lacking. But the Australian -aboriginal's pictures of animals were nicely accurate in form, attitude, -carriage; and he put spirit into them, and expression. And his pictures -of white people and natives were pretty nearly as good as his pictures of -the other animals. He dressed his whites in the fashion of their day, -both the ladies and the gentlemen. As an untaught wielder of the pencil -it is not likely that he has had his equal among savage people. - -His place in art--as to drawing, not color-work--is well up, all things -considered. His art is not to be classified with savage art at all, but -on a plane two degrees above it and one degree above the lowest plane of -civilized art. To be exact, his place in art is between Botticelli and -De Maurier. That is to say, he could not draw as well as De Maurier but -better than Boticelli. In feeling, he resembles both; also in grouping -and in his preferences in the matter of subjects. His "corrobboree" of -the Australian wilds reappears in De Maurier's Belgravian ballrooms, with -clothes and the smirk of civilization added; Botticelli's "Spring" is the -"corrobboree" further idealized, but with fewer clothes and more smirk. -And well enough as to intention, but--my word! - -The aboriginal can make a fire by friction. I have tried that. - -All savages are able to stand a good deal of physical pain. The -Australian aboriginal has this quality in a well-developed degree. Do -not read the following instances if horrors are not pleasant to you. -They were recorded by the Rev. Henry N. Wolloston, of Melbourne, who had -been a surgeon before he became a clergyman: - - 1. "In the summer of 1852 I started on horseback from Albany, King - George's Sound, to visit at Cape Riche, accompanied by a native on - foot. We traveled about forty miles the first day, then camped by a - water-hole for the night. After cooking and eating our supper, I - observed the native, who had said nothing to me on the subject, - collect the hot embers of the fire together, and deliberately place - his right foot in the glowing mass for a moment, then suddenly - withdraw it, stamping on the ground and uttering a long-drawn - guttural sound of mingled pain and satisfaction. This operation he - repeated several times. On my inquiring the meaning of his strange - conduct, he only said, 'Me carpenter-make 'em' ('I am mending my - foot'), and then showed me his charred great toe, the nail of which - had been torn off by a tea-tree stump, in which it had been caught - during the journey, and the pain of which he had borne with stoical - composure until the evening, when he had an opportunity of - cauterizing the wound in the primitive manner above described." - -And he proceeded on the journey the next day, "as if nothing had -happened"--and walked thirty miles. It was a strange idea, to keep a -surgeon and then do his own surgery. - - 2. "A native about twenty-five years of age once applied to me, as - a doctor, to extract the wooden barb of a spear, which, during a - fight in the bush some four months previously, had entered his - chest, just missing the heart, and penetrated the viscera to a - considerable depth. The spear had been cut off, leaving the barb - behind, which continued to force its way by muscular action - gradually toward the back; and when I examined him I could feel a - hard substance between the ribs below the left blade-bone. I made a - deep incision, and with a pair of forceps extracted the barb, which - was made, as usual, of hard wood about four inches long and from - half an inch to an inch thick. It was very smooth, and partly - digested, so to speak, by the maceration to which it had been - exposed during its four months' journey through the body. The wound - made by the spear had long since healed, leaving only a small - cicatrix; and after the operation, which the native bore without - flinching, he appeared to suffer no pain. Indeed, judging from his - good state of health, the presence of the foreign matter did not - materially annoy him. He was perfectly well in a few days." - -But No. 3 is my favorite. Whenever I read it I seem to enjoy all that -the patient enjoyed--whatever it was: - - 3. "Once at King George's Sound a native presented himself to me - with one leg only, and requested me to supply him with a wooden leg. - He had traveled in this maimed state about ninety-six miles, for - this purpose. I examined the limb, which had been severed just - below the knee, and found that it had been charred by fire, while - about two inches of the partially calcined bone protruded through - the flesh. I at once removed this with the saw; and having made as - presentable a stump of it as I could, covered the amputated end of - the bone with a surrounding of muscle, and kept the patient a few - days under my care to allow the wound to heal. On inquiring, the - native told me that in a fight with other black-fellows a spear had - struck his leg and penetrated the bone below the knee. Finding it - was serious, he had recourse to the following crude and barbarous - operation, which it appears is not uncommon among these people in - their native state. He made a fire, and dug a hole in the earth - only sufficiently large to admit his leg, and deep enough to allow - the wounded part to be on a level with the surface of the ground. - He then surrounded the limb with the live coals or charcoal, which - was replenished until the leg was literally burnt off. The - cauterization thus applied completely checked the hemorrhage, and he - was able in a day or two to hobble down to the Sound, with the aid - of a long stout stick, although he was more than a week on the - road." - -But he was a fastidious native. He soon discarded the wooden leg made -for him by the doctor, because "it had no feeling in it." It must have -had as much as the one he burnt off, I should think. - -So much for the Aboriginals. It is difficult for me to let them alone. -They are marvelously interesting creatures. For a quarter of a century, -now, the several colonial governments have housed their remnants in -comfortable stations, and fed them well and taken good care of them in -every way. If I had found this out while I was in Australia I could have -seen some of those people--but I didn't. I would walk thirty miles to -see a stuffed one. - -Australia has a slang of its own. This is a matter of course. The vast -cattle and sheep industries, the strange aspects of the country, and the -strange native animals, brute and human, are matters which would -naturally breed a local slang. I have notes of this slang somewhere, but -at the moment I can call to mind only a few of the words and phrases. -They are expressive ones. The wide, sterile, unpeopled deserts have -created eloquent phrases like "No Man's Land" and the "Never-never -Country." Also this felicitous form: "She lives in the Never-never -Country"--that is, she is an old maid. And this one is not without -merit: "heifer-paddock"--young ladies' seminary. "Bail up" and "stick -up" equivalent of our highwayman-term to "hold up" a stage-coach or a -train. "New-chum" is the equivalent of our "tenderfoot"--new arrival. - -And then there is the immortal "My word!" "We must import it." -"M-y word!" - -"In cold print it is the equivalent of our "Ger-rreat Caesar!" but spoken -with the proper Australian unction and fervency, it is worth six of it -for grace and charm and expressiveness. Our form is rude and explosive; -it is not suited to the drawing-room or the heifer-paddock; but "M-y -word!" is, and is music to the ear, too, when the utterer knows how to -say it. I saw it in print several times on the Pacific Ocean, but it -struck me coldly, it aroused no sympathy. That was because it was the -dead corpse of the thing, the 'soul was not there--the tones were -lacking--the informing spirit--the deep feeling--the eloquence. But the -first time I heard an Australian say it, it was positively thrilling. - - - - -CHAPTER XXIII. - -Be careless in your dress if you must, but keep a tidy soul. - --Pudd'nhead Wilson's New Calendar. - -We left Adelaide in due course, and went to Horsham, in the colony of -Victoria; a good deal of a journey, if I remember rightly, but pleasant. -Horsham sits in a plain which is as level as a floor--one of those famous -dead levels which Australian books describe so often; gray, bare, sombre, -melancholy, baked, cracked, in the tedious long drouths, but a -horizonless ocean of vivid green grass the day after a rain. A country -town, peaceful, reposeful, inviting, full of snug homes, with garden -plots, and plenty of shrubbery and flowers. - -"Horsham, October 17. -At the hotel. The weather divine. Across the way, in front of the -London Bank of Australia, is a very handsome cottonwood. It is in -opulent leaf, and every leaf perfect. The full power of the on-rushing -spring is upon it, and I imagine I can see it grow. Alongside the bank -and a little way back in the garden there is a row of soaring -fountain-sprays of delicate feathery foliage quivering in the breeze, and -mottled with flashes of light that shift and play through the mass like -flash-lights through an opal--a most beautiful tree, and a striking -contrast to the cottonwood. Every leaf of the cottonwood is distinctly -defined--it is a kodak for faithful, hard, unsentimental detail; the -other an impressionist picture, delicious to look upon, full of a subtle -and exquisite charm, but all details fused in a swoon of vague and soft -loveliness." - -It turned out, upon inquiry, to be a pepper tree--an importation from -China. It has a silky sheen, soft and rich. I saw some that had long -red bunches of currant-like berries ambushed among the foliage. At a -distance, in certain lights, they give the tree a pinkish tint and a new -charm. - -There is an agricultural college eight miles from Horsham. We were -driven out to it by its chief. The conveyance was an open wagon; the -time, noonday; no wind; the sky without a cloud, the sunshine brilliant ---and the mercury at 92 deg. in the shade. In some countries an indolent -unsheltered drive of an hour and a half under such conditions would have -been a sweltering and prostrating experience; but there was nothing of -that in this case. It is a climate that is perfect. There was no sense -of heat; indeed, there was no heat; the air was fine and pure and -exhilarating; if the drive had lasted half a day I think we should not -have felt any discomfort, or grown silent or droopy or tired. Of course, -the secret of it was the exceeding dryness of the atmosphere. In that -plain 112 deg. in the shade is without doubt no harder upon a man than is -88 or 90 deg. in New York. - -The road lay through the middle of an empty space which seemed to me to -be a hundred yards wide between the fences. I was not given the width in -yards, but only in chains and perches--and furlongs, I think. I would -have given a good deal to know what the width was, but I did not pursue -the matter. I think it is best to put up with information the way you -get it; and seem satisfied with it, and surprised at it, and grateful for -it, and say, "My word!" and never let on. It was a wide space; I could -tell you how wide, in chains and perches and furlongs and things, but -that would not help you any. Those things sound well, but they are -shadowy and indefinite, like troy weight and avoirdupois; nobody knows -what they mean. When you buy a pound of a drug and the man asks you -which you want, troy or avoirdupois, it is best to say "Yes," and shift -the subject. - -They said that the wide space dates from the earliest sheep and -cattle-raising days. People had to drive their stock long distances ---immense journeys--from worn-out places to new ones where were water -and fresh pasturage; and this wide space had to be left in grass and -unfenced, or the stock would have starved to death in the transit. - -On the way we saw the usual birds--the beautiful little green parrots, -the magpie, and some others; and also the slender native bird of modest -plumage and the eternally-forgettable name--the bird that is the smartest -among birds, and can give a parrot 30 to 1 in the game and then talk him -to death. I cannot recall that bird's name. I think it begins with M. -I wish it began with G. or something that a person can remember. - -The magpie was out in great force, in the fields and on the fences. He -is a handsome large creature, with snowy white decorations, and is a -singer; he has a murmurous rich note that is lovely. He was once modest, -even diffident; but he lost all that when he found out that he was -Australia's sole musical bird. He has talent, and cuteness, and -impudence; and in his tame state he is a most satisfactory pet--never -coming when he is called, always coming when he isn't, and studying -disobedience as an accomplishment. He is not confined, but loafs all -over the house and grounds, like the laughing jackass. I think he learns -to talk, I know he learns to sing tunes, and his friends say that he -knows how to steal without learning. I was acquainted with a tame magpie -in Melbourne. He had lived in a lady's house several years, and believed -he owned it. The lady had tamed him, and in return he had tamed the -lady. He was always on deck when not wanted, always having his own way, -always tyrannizing over the dog, and always making the cat's life a slow -sorrow and a martyrdom. He knew a number of tunes and could sing them in -perfect time and tune; and would do it, too, at any time that silence was -wanted; and then encore himself and do it again; but if he was asked to -sing he would go out and take a walk. - -It was long believed that fruit trees would not grow in that baked and -waterless plain around Horsham, but the agricultural college has -dissipated that idea. Its ample nurseries were producing oranges, -apricots, lemons, almonds, peaches, cherries, 48 varieties of apples--in -fact, all manner of fruits, and in abundance. The trees did not seem to -miss the water; they were in vigorous and flourishing condition. - -Experiments are made with different soils, to see what things thrive best -in them and what climates are best for them. A man who is ignorantly -trying to produce upon his farm things not suited to its soil and its -other conditions can make a journey to the college from anywhere in -Australia, and go back with a change of scheme which will make his farm -productive and profitable. - -There were forty pupils there--a few of them farmers, relearning their -trade, the rest young men mainly from the cities--novices. It seemed a -strange thing that an agricultural college should have an attraction for -city-bred youths, but such is the fact. They are good stuff, too; they -are above the agricultural average of intelligence, and they come without -any inherited prejudices in favor of hoary ignorances made sacred by long -descent. - -The students work all day in the fields, the nurseries, and the -shearing-sheds, learning and doing all the practical work of the -business--three days in a week. On the other three they study and hear -lectures. They are taught the beginnings of such sciences as bear upon -agriculture--like chemistry, for instance. We saw the sophomore class in -sheep-shearing shear a dozen sheep. They did it by hand, not with the -machine. The sheep was seized and flung down on his side and held there; -and the students took off his coat with great celerity and adroitness. -Sometimes they clipped off a sample of the sheep, but that is customary -with shearers, and they don't mind it; they don't even mind it as much as -the sheep. They dab a splotch of sheep-dip on the place and go right -ahead. - -The coat of wool was unbelievably thick. Before the shearing the sheep -looked like the fat woman in the circus; after it he looked like a bench. -He was clipped to the skin; and smoothly and uniformly. The fleece comes -from him all in one piece and has the spread of a blanket. - -The college was flying the Australian flag--the gridiron of England -smuggled up in the northwest corner of a big red field that had the -random stars of the Southern Cross wandering around over it. - -From Horsham we went to Stawell. By rail. Still in the colony of -Victoria. Stawell is in the gold-mining country. In the bank-safe was -half a peck of surface-gold--gold dust, grain gold; rich; pure in fact, -and pleasant to sift through one's fingers; and would be pleasanter if it -would stick. And there were a couple of gold bricks, very heavy to -handle, and worth $7,500 a piece. They were from a very valuable quartz -mine; a lady owns two-thirds of it; she has an income of $75,000 a month -from it, and is able to keep house. - -The Stawell region is not productive of gold only; it has great -vineyards, and produces exceptionally fine wines. One of these -vineyards--the Great Western, owned by Mr. Irving--is regarded as a -model. Its product has reputation abroad. It yields a choice champagne -and a fine claret, and its hock took a prize in France two or three years -ago. The champagne is kept in a maze of passages under ground, cut in -the rock, to secure it an even temperature during the three-year term -required to perfect it. In those vaults I saw 120,000 bottles of -champagne. The colony of Victoria has a population of 1,000,000, and -those people are said to drink 25,000,000 bottles of champagne per year. -The dryest community on the earth. The government has lately reduced the -duty upon foreign wines. That is one of the unkindnesses of Protection. -A man invests years of work and a vast sum of money in a worthy -enterprise, upon the faith of existing laws; then the law is changed, and -the man is robbed by his own government. - -On the way back to Stawell we had a chance to see a group of boulders -called the Three Sisters--a curiosity oddly located; for it was upon high -ground, with the land sloping away from it, and no height above it from -whence the boulders could have rolled down. Relics of an early -ice-drift, perhaps. They are noble boulders. One of them has the size -and smoothness and plump sphericity of a balloon of the biggest pattern. - -The road led through a forest of great gum-trees, lean and scraggy and -sorrowful. The road was cream-white--a clayey kind of earth, apparently. -Along it toiled occasional freight wagons, drawn by long double files of -oxen. Those wagons were going a journey of two hundred miles, I was -told, and were running a successful opposition to the railway! The -railways are owned and run by the government. - -Those sad gums stood up out of the dry white clay, pictures of patience -and resignation. It is a tree that can get along without water; still it -is fond of it--ravenously so. It is a very intelligent tree and will -detect the presence of hidden water at a distance of fifty feet, and send -out slender long root-fibres to prospect it. They will find it; and will -also get at it even through a cement wall six inches thick. Once a -cement water-pipe under ground at Stawell began to gradually reduce its -output, and finally ceased altogether to deliver water. Upon examining -into the matter it was found stopped up, wadded compactly with a mass of -root-fibres, delicate and hair-like. How this stuff had gotten into the -pipe was a puzzle for some little time; finally it was found that it had -crept in through a crack that was almost invisible to the eye. A gum -tree forty feet away had tapped the pipe and was drinking the water. - - - - -CHAPTER XXIV. - -There is no such thing as "the Queen's English." The property has gone -into the hands of a joint stock company and we own the bulk of the -shares! - --Pudd'nhead Wilson's New Calendar. - -Frequently, in Australia, one has cloud-effects of an unfamiliar sort. -We had this kind of scenery, finely staged, all the way to Ballarat. -Consequently we saw more sky than country on that journey. At one time a -great stretch of the vault was densely flecked with wee ragged-edged -flakes of painfully white cloud-stuff, all of one shape and size, and -equidistant apart, with narrow cracks of adorable blue showing between. -The whole was suggestive of a hurricane of snow-flakes drifting across -the skies. By and by these flakes fused themselves together in -interminable lines, with shady faint hollows between the lines, the long -satin-surfaced rollers following each other in simulated movement, and -enchantingly counterfeiting the majestic march of a flowing sea. Later, -the sea solidified itself; then gradually broke up its mass into -innumerable lofty white pillars of about one size, and ranged these -across the firmament, in receding and fading perspective, in the -similitude of a stupendous colonnade--a mirage without a doubt flung from -the far Gates of the Hereafter. - -The approaches to Ballarat were beautiful. The features, great green -expanses of rolling pasture-land, bisected by eye contenting hedges of -commingled new-gold and old-gold gorse--and a lovely lake. One must put -in the pause, there, to fetch the reader up with a slight jolt, and keep -him from gliding by without noticing the lake. One must notice it; for a -lovely lake is not as common a thing along the railways of Australia as -are the dry places. Ninety-two in the shade again, but balmy and -comfortable, fresh and bracing. A perfect climate. - -Forty-five years ago the site now occupied by the City of Ballarat was a -sylvan solitude as quiet as Eden and as lovely. Nobody had ever heard of -it. On the 25th of August, 1851, the first great gold-strike made in -Australia was made here. The wandering prospectors who made it scraped -up two pounds and a half of gold the first day-worth $600. A few days -later the place was a hive--a town. The news of the strike spread -everywhere in a sort of instantaneous way--spread like a flash to the -very ends of the earth. A celebrity so prompt and so universal has -hardly been paralleled in history, perhaps. It was as if the name -BALLARAT had suddenly been written on the sky, where all the world could -read it at once. - -The smaller discoveries made in the colony of New South Wales three -months before had already started emigrants toward Australia; they had -been coming as a stream, but they came as a flood, now. A hundred -thousand people poured into Melbourne from England and other countries in -a single month, and flocked away to the mines. The crews of the ships -that brought them flocked with them; the clerks in the government offices -followed; so did the cooks, the maids, the coachmen, the butlers, and the -other domestic servants; so did the carpenters, the smiths, the plumbers, -the painters, the reporters, the editors, the lawyers, the clients, the -barkeepers, the bummers, the blacklegs, the thieves, the loose women, the -grocers, the butchers, the bakers, the doctors, the druggists, the -nurses; so did the police; even officials of high and hitherto envied -place threw up their positions and joined the procession. This roaring -avalanche swept out of Melbourne and left it desolate, Sunday-like, -paralyzed, everything at a stand-still, the ships lying idle at anchor, -all signs of life departed, all sounds stilled save the rasping of the -cloud-shadows as they scraped across the vacant streets. - -That grassy and leafy paradise at Ballarat was soon ripped open, and -lacerated and scarified and gutted, in the feverish search for its hidden -riches. There is nothing like surface-mining to snatch the graces and -beauties and benignities out of a paradise, and make an odious and -repulsive spectacle of it. - -What fortunes were made! Immigrants got rich while the ship unloaded and -reloaded--and went back home for good in the same cabin they had come out -in! Not all of them. Only some. I saw the others in Ballarat myself, -forty-five years later--what were left of them by time and death and the -disposition to rove. They were young and gay, then; they are patriarchal -and grave, now; and they do not get excited any more. They talk of the -Past. They live in it. Their life is a dream, a retrospection. - -Ballarat was a great region for "nuggets." No such nuggets were found in -California as Ballarat produced. In fact, the Ballarat region has -yielded the largest ones known to history. Two of them weighed about 180 -pounds each, and together were worth $90,000. They were offered to any -poor person who would shoulder them and carry them away. Gold was so -plentiful that it made people liberal like that. - -Ballarat was a swarming city of tents in the early days. Everybody was -happy, for a time, and apparently prosperous. Then came trouble. The -government swooped down with a mining tax. And in its worst form, too; -for it was not a tax upon what the miner had taken out, but upon what he -was going to take out--if he could find it. It was a license-tax license -to work his claim--and it had to be paid before he could begin digging. - -Consider the situation. No business is so uncertain as surface-mining. -Your claim may be good, and it may be worthless. It may make you well -off in a month; and then again you may have to dig and slave for half a -year, at heavy expense, only to find out at last that the gold is not -there in cost-paying quantity, and that your time and your hard work have -been thrown away. It might be wise policy to advance the miner a monthly -sum to encourage him to develop the country's riches; but to tax him -monthly in advance instead--why, such a thing was never dreamed of in -America. There, neither the claim itself nor its products, howsoever -rich or poor, were taxed. - -The Ballarat miners protested, petitioned, complained--it was of no use; -the government held its ground, and went on collecting the tax. And not -by pleasant methods, but by ways which must have been very galling to -free people. The rumblings of a coming storm began to be audible. - -By and by there was a result; and I think it may be called the finest -thing in Australasian history. It was a revolution--small in size; but -great politically; it was a strike for liberty, a struggle for a -principle, a stand against injustice and oppression. It was the Barons -and John, over again; it was Hampden and Ship-Money; it was Concord and -Lexington; small beginnings, all of them, but all of them great in -political results, all of them epoch-making. It is another instance of a -victory won by a lost battle. It adds an honorable page to history; the -people know it and are proud of it. They keep green the memory of the -men who fell at the Eureka Stockade, and Peter Lalor has his monument. - -The surface-soil of Ballarat was full of gold. This soil the miners -ripped and tore and trenched and harried and disembowled, and made it -yield up its immense treasure. Then they went down into the earth with -deep shafts, seeking the gravelly beds of ancient rivers and brooks--and -found them. They followed the courses of these streams, and gutted them, -sending the gravel up in buckets to the upper world, and washing out of -it its enormous deposits of gold. The next biggest of the two monster -nuggets mentioned above came from an old river-channel 180 feet under -ground. - -Finally the quartz lodes were attacked. That is not poor-man's mining. -Quartz-mining and milling require capital, and staying-power, and -patience. Big companies were formed, and for several decades, now, the -lodes have been successfully worked, and have yielded great wealth. -Since the gold discovery in 1853 the Ballarat mines--taking the three -kinds of mining together--have contributed to the world's pocket -something over three hundred millions of dollars, which is to say that -this nearly invisible little spot on the earth's surface has yielded -about one-fourth as much gold in forty-four years as all California has -yielded in forty-seven. The Californian aggregate, from 1848 to 1895, -inclusive, as reported by the Statistician of the United States Mint, is -$1,265,215,217. - -A citizen told me a curious thing about those mines. With all my -experience of mining I had never heard of anything of the sort before. -The main gold reef runs about north and south--of course for that is the -custom of a rich gold reef. At Ballarat its course is between walls of -slate. Now the citizen told me that throughout a stretch of twelve miles -along the reef, the reef is crossed at intervals by a straight black -streak of a carbonaceous nature--a streak in the slate; a streak no -thicker than a pencil--and that wherever it crosses the reef you will -certainly find gold at the junction. It is called the Indicator. Thirty -feet on each side of the Indicator (and down in the slate, of course) is -a still finer streak--a streak as fine as a pencil mark; and indeed, that -is its name Pencil Mark. Whenever you find the Pencil Mark you know that -thirty feet from it is the Indicator; you measure the distance, excavate, -find the Indicator, trace it straight to the reef, and sink your shaft; -your fortune is made, for certain. If that is true, it is curious. And -it is curious anyway. - -Ballarat is a town of only 40,000 population; and yet, since it is in -Australia, it has every essential of an advanced and enlightened big -city. This is pure matter of course. I must stop dwelling upon these -things. It is hard to keep from dwelling upon them, though; for it is -difficult to get away from the surprise of it. I will let the other -details go, this time, but I must allow myself to mention that this -little town has a park of 326 acres; a flower garden of 83 acres, with an -elaborate and expensive fernery in it and some costly and unusually fine -statuary; and an artificial lake covering 600 acres, equipped with a -fleet of 200 shells, small sail boats, and little steam yachts. - -At this point I strike out some other praiseful things which I was -tempted to add. I do not strike them out because they were not true or -not well said, but because I find them better said by another man--and a -man more competent to testify, too, because he belongs on the ground, and -knows. I clip them from a chatty speech delivered some years ago by Mr. -William Little, who was at that time mayor of Ballarat: - - "The language of our citizens, in this as in other parts of - Australasia, is mostly healthy Anglo-Saxon, free from Americanisms, - vulgarisms, and the conflicting dialects of our Fatherland, and is - pure enough to suit a Trench or a Latham. Our youth, aided by - climatic influence, are in point of physique and comeliness - unsurpassed in the Sunny South. Our young men are well ordered; and - our maidens, 'not stepping over the bounds of modesty,' are as fair - as Psyches, dispensing smiles as charming as November flowers." - -The closing clause has the seeming of a rather frosty compliment, but -that is apparent only, not real. November is summer-time there. - -His compliment to the local purity of the language is warranted. It is -quite free from impurities; this is acknowledged far and wide. As in the -German Empire all cultivated people claim to speak Hanovarian German, so -in Australasia all cultivated people claim to speak Ballarat English. -Even in England this cult has made considerable progress, and now that it -is favored by the two great Universities, the time is not far away when -Ballarat English will come into general use among the educated classes of -Great Britain at large. Its great merit is, that it is shorter than -ordinary English--that is, it is more compressed. At first you have some -difficulty in understanding it when it is spoken as rapidly as the orator -whom I have quoted speaks it. An illustration will show what I mean. -When he called and I handed him a chair, he bowed and said: - -"Q." - -Presently, when we were lighting our cigars, he held a match to mine and -I said: - -"Thank you," and he said: - -"Km." - -Then I saw. 'Q' is the end of the phrase "I thank you" 'Km' is the end -of the phrase "You are welcome." Mr. Little puts no emphasis upon either -of them, but delivers them so reduced that they hardly have a sound. All -Ballarat English is like that, and the effect is very soft and pleasant; -it takes all the hardness and harshness out of our tongue and gives to it -a delicate whispery and vanishing cadence which charms the ear like the -faint rustling of the forest leaves. - - - - -CHAPTER XXV. - -"Classic." A book which people praise and don't read. - --Pudd'nhead Wilson's New Calendar. - -On the rail again--bound for Bendigo. From diary: - -October 23. Got up at 6, left at 7.30; soon reached Castlemaine, one of -the rich gold-fields of the early days; waited several hours for a train; -left at 3.40 and reached Bendigo in an hour. For comrade, a Catholic -priest who was better than I was, but didn't seem to know it--a man full -of graces of the heart, the mind, and the spirit; a lovable man. He will -rise. He will be a bishop some day. Later an Archbishop. Later a -Cardinal. Finally an Archangel, I hope. And then he will recall me when -I say, "Do you remember that trip we made from Ballarat to Bendigo, when -you were nothing but Father C., and I was nothing to what I am now?" -It has actually taken nine hours to come from Ballarat to Bendigo. We -could have saved seven by walking. However, there was no hurry. - -Bendigo was another of the rich strikes of the early days. It does a -great quartz-mining business, now--that business which, more than any -other that I know of, teaches patience, and requires grit and a steady -nerve. The town is full of towering chimney-stacks, and hoisting-works, -and looks like a petroleum-city. Speaking of patience; for example, one -of the local companies went steadily on with its deep borings and -searchings without show of gold or a penny of reward for eleven years ---then struck it, and became suddenly rich. The eleven years' work had -cost $55,000, and the first gold found was a grain the size of a pin's -head. It is kept under locks and bars, as a precious thing, and is -reverently shown to the visitor, "hats off." When I saw it I had not -heard its history. - -"It is gold. Examine it--take the glass. Now how much should you say it -is worth?" - -I said: - -"I should say about two cents; or in your English dialect, four -farthings." - -"Well, it cost L11,000." - -"Oh, come!" - -"Yes, it did. Ballarat and Bendigo have produced the three monumental -nuggets of the world, and this one is the monumentalest one of the three. -The other two represent 19,000 a piece; this one a couple of thousand -more. It is small, and not much to look at, but it is entitled to (its) -name--Adam. It is the Adam-nugget of this mine, and its children run up -into the millions." - -Speaking of patience again, another of the mines was worked, under heavy -expenses, during 17 years before pay was struck, and still another one -compelled a wait of 21 years before pay was struck; then, in both -instances, the outlay was all back in a year or two, with compound -interest. - -Bendigo has turned out even more gold than Ballarat. The two together -have produced $650,000,000 worth--which is half as much as California has -produced. - -It was through Mr. Blank--not to go into particulars about his name--it -was mainly through Mr. Blank that my stay in Bendigo was made memorably -pleasant and interesting. He explained this to me himself. He told me -that it was through his influence that the city government invited me to -the town-hall to hear complimentary speeches and respond to them; that it -was through his influence that I had been taken on a long pleasure-drive -through the city and shown its notable features; that it was through his -influence that I was invited to visit the great mines; that it was -through his influence that I was taken to the hospital and allowed to see -the convalescent Chinaman who had been attacked at midnight in his lonely -hut eight weeks before by robbers, and stabbed forty-six times and -scalped besides; that it was through his influence that when I arrived -this awful spectacle of piecings and patchings and bandagings was sitting -up in his cot letting on to read one of my books; that it was through his -influence that efforts had been made to get the Catholic Archbishop of -Bendigo to invite me to dinner; that it was through his influence that -efforts had been made to get the Anglican Bishop of Bendigo to ask me to -supper; that it was through his influence that the dean of the editorial -fraternity had driven me through the woodsy outlying country and shown -me, from the summit of Lone Tree Hill, the mightiest and loveliest -expanse of forest-clad mountain and valley that I had seen in all -Australia. And when he asked me what had most impressed me in Bendigo -and I answered and said it was the taste and the public spirit which had -adorned the streets with 105 miles of shade trees, he said that it was -through his influence that it had been done. - -But I am not representing him quite correctly. He did not say it was -through his influence that all these things had happened--for that would -have been coarse; be merely conveyed that idea; conveyed it so subtly -that I only caught it fleetingly, as one catches vagrant faint breaths of -perfume when one traverses the meadows in summer; conveyed it without -offense and without any suggestion of egoism or ostentation--but conveyed -it, nevertheless. - -He was an Irishman; an educated gentleman; grave, and kindly, and -courteous; a bachelor, and about forty-five or possibly fifty years old, -apparently. He called upon me at the hotel, and it was there that we had -this talk. He made me like him, and did it without trouble. This was -partly through his winning and gentle ways, but mainly through the -amazing familiarity with my books which his conversation showed. He was -down to date with them, too; and if he had made them the study of his -life he could hardly have been better posted as to their contents than he -was. He made me better satisfied with myself than I had ever been -before. It was plain that he had a deep fondness for humor, yet he never -laughed; he never even chuckled; in fact, humor could not win to outward -expression on his face at all. No, he was always grave--tenderly, -pensively grave; but he made me laugh, all along; and this was very -trying--and very pleasant at the same time--for it was at quotations from -my own books. - -When he was going, he turned and said: - -"You don't remember me?" - -"I? Why, no. Have we met before?" - -"No, it was a matter of correspondence." - -"Correspondence?" - -"Yes, many years ago. Twelve or fifteen. Oh, longer than that. But of -course you----" A musing pause. Then he said: - -"Do you remember Corrigan Castle?" - -"N-no, I believe I don't. I don't seem to recall the name." - -He waited a moment, pondering, with the door-knob in his hand, then -started out; but turned back and said that I had once been interested in -Corrigan Castle, and asked me if I would go with him to his quarters in -the evening and take a hot Scotch and talk it over. I was a teetotaler -and liked relaxation, so I said I would. - -We drove from the lecture-hall together about half-past ten. He had a -most comfortably and tastefully furnished parlor, with good pictures on -the walls, Indian and Japanese ornaments on the mantel, and here and -there, and books everywhere-largely mine; which made me proud. The light -was brilliant, the easy chairs were deep-cushioned, the arrangements for -brewing and smoking were all there. We brewed and lit up; then he passed -a sheet of note-paper to me and said-- - -"Do you remember that?" - -"Oh, yes, indeed!" - -The paper was of a sumptuous quality. At the top was a twisted and -interlaced monogram printed from steel dies in gold and blue and red, in -the ornate English fashion of long years ago; and under it, in neat -gothic capitals was this--printed in blue: - - THE MARK TWAIN CLUB - CORRIGAN CASTLE - ............187.. - -"My!" said I, "how did you come by this?" - -"I was President of it." - -"No!--you don't mean it." - -"It is true. I was its first President. I was re-elected annually as -long as its meetings were held in my castle--Corrigan--which was five -years." - -Then he showed me an album with twenty-three photographs of me in it. -Five of them were of old dates, the others of various later crops; the -list closed with a picture taken by Falk in Sydney a month before. - -"You sent us the first five; the rest were bought." - -This was paradise! We ran late, and talked, talked, talked--subject, the -Mark Twain Club of Corrigan Castle, Ireland. - -My first knowledge of that Club dates away back; all of twenty years, I -should say. It came to me in the form of a courteous letter, written on -the note-paper which I have described, and signed "By order of the -President; C. PEMBROKE, Secretary." It conveyed the fact that the Club -had been created in my honor, and added the hope that this token of -appreciation of my work would meet with my approval. - -I answered, with thanks; and did what I could to keep my gratification -from over-exposure. - -It was then that the long correspondence began. A letter came back, by -order of the President, furnishing me the names of the members-thirty-two -in number. With it came a copy of the Constitution and By-Laws, in -pamphlet form, and artistically printed. The initiation fee and dues -were in their proper place; also, schedule of meetings--monthly--for -essays upon works of mine, followed by discussions; quarterly for -business and a supper, without essays, but with after-supper speeches -also, there was a list of the officers: President, Vice-President, -Secretary, Treasurer, etc. The letter was brief, but it was pleasant -reading, for it told me about the strong interest which the membership -took in their new venture, etc., etc. It also asked me for a photograph ---a special one. I went down and sat for it and sent it--with a letter, -of course. - -Presently came the badge of the Club, and very dainty and pretty it was; -and very artistic. It was a frog peeping out from a graceful tangle of -grass-sprays and rushes, and was done in enamels on a gold basis, and had -a gold pin back of it. After I had petted it, and played with it, and -caressed it, and enjoyed it a couple of hours, the light happened to fall -upon it at a new angle, and revealed to me a cunning new detail; with the -light just right, certain delicate shadings of the grass-blades and -rush-stems wove themselves into a monogram--mine! You can see that that -jewel was a work of art. And when you come to consider the intrinsic -value of it, you must concede that it is not every literary club that -could afford a badge like that. It was easily worth $75, in the opinion -of Messrs. Marcus and Ward of New York. They said they could not -duplicate it for that and make a profit. By this time the Club was well -under way; and from that time forth its secretary kept my off-hours well -supplied with business. He reported the Club's discussions of my books -with laborious fullness, and did his work with great spirit and ability. -As a, rule, he synopsized; but when a speech was especially brilliant, he -short-handed it and gave me the best passages from it, written out. -There were five speakers whom he particularly favored in that way: -Palmer, Forbes, Naylor, Norris, and Calder. Palmer and Forbes could -never get through a speech without attacking each other, and each in his -own way was formidably effective--Palmer in virile and eloquent abuse, -Forbes in courtly and elegant but scalding satire. I could always tell -which of them was talking without looking for his name. Naylor had a -polished style and a happy knack at felicitous metaphor; Norris's style -was wholly without ornament, but enviably compact, lucid, and strong. -But after all, Calder was the gem. He never spoke when sober, he spoke -continuously when he wasn't. And certainly they were the drunkest -speeches that a man ever uttered. They were full of good things, but so -incredibly mixed up and wandering that it made one's head swim to follow -him. They were not intended to be funny, but they were,--funny for the -very gravity which the speaker put into his flowing miracles of -incongruity. In the course of five years I came to know the styles of -the five orators as well as I knew the style of any speaker in my own -club at home. - -These reports came every month. They were written on foolscap, 600 words -to the page, and usually about twenty-five pages in a report--a good -15,000 words, I should say,--a solid week's work. The reports were -absorbingly entertaining, long as they were; but, unfortunately for me, -they did not come alone. They were always accompanied by a lot of -questions about passages and purposes in my books, which the Club wanted -answered; and additionally accompanied every quarter by the Treasurer's -report, and the Auditor's report, and the Committee's report, and the -President's review, and my opinion of these was always desired; also -suggestions for the good of the Club, if any occurred to me. - -By and by I came to dread those things; and this dread grew and grew and -grew; grew until I got to anticipating them with a cold horror. For I -was an indolent man, and not fond of letter-writing, and whenever these -things came I had to put everything by and sit down--for my own peace of -mind--and dig and dig until I got something out of my head which would -answer for a reply. I got along fairly well the first year; but for the -succeeding four years the Mark Twain Club of Corrigan Castle was my -curse, my nightmare, the grief and misery of my life. And I got so, so -sick of sitting for photographs. I sat every year for five years, trying -to satisfy that insatiable organization. Then at last I rose in revolt. -I could endure my oppressions no longer. I pulled my fortitude together -and tore off my chains, and was a free man again, and happy. From that -day I burned the secretary's fat envelopes the moment they arrived, and -by and by they ceased to come. - -Well, in the sociable frankness of that night in Bendigo I brought this -all out in full confession. Then Mr. Blank came out in the same frank -way, and with a preliminary word of gentle apology said that he was the -Mark Twain Club, and the only member it had ever had! - -Why, it was matter for anger, but I didn't feel any. He said he never -had to work for a living, and that by the time he was thirty life had -become a bore and a weariness to him. He had no interests left; they had -paled and perished, one by one, and left him desolate. He had begun to -think of suicide. Then all of a sudden he thought of that happy idea of -starting an imaginary club, and went straightway to work at it, with -enthusiasm and love. He was charmed with it; it gave him something to -do. It elaborated itself on his hands;--it became twenty times more -complex and formidable than was his first rude draft of it. Every new -addition to his original plan which cropped up in his mind gave him a -fresh interest and a new pleasure. He designed the Club badge himself, -and worked over it, altering and improving it, a number of days and -nights; then sent to London and had it made. It was the only one that -was made. It was made for me; the "rest of the Club" went without. - -He invented the thirty-two members and their names. He invented the five -favorite speakers and their five separate styles. He invented their -speeches, and reported them himself. He would have kept that Club going -until now, if I hadn't deserted, he said. He said he worked like a slave -over those reports; each of them cost him from a week to a fortnight's -work, and the work gave him pleasure and kept him alive and willing to be -alive. It was a bitter blow to him when the Club died. - -Finally, there wasn't any Corrigan Castle. He had invented that, too. - -It was wonderful--the whole thing; and altogether the most ingenious and -laborious and cheerful and painstaking practical joke I have ever heard -of. And I liked it; liked to bear him tell about it; yet I have been a -hater of practical jokes from as long back as I can remember. Finally he -said-- - -"Do you remember a note from Melbourne fourteen or fifteen years ago, -telling about your lecture tour in Australia, and your death and burial -in Melbourne?--a note from Henry Bascomb, of Bascomb Hall, Upper -Holywell Hants." - -"Yes." - -"I wrote it." - -"M-y-word!" - -"Yes, I did it. I don't know why. I just took the notion, and carried -it out without stopping to think. It was wrong. It could have done -harm. I was always sorry about it afterward. You must forgive me. I -was Mr. Bascom's guest on his yacht, on his voyage around the world. He -often spoke of you, and of the pleasant times you had had together in his -home; and the notion took me, there in Melbourne, and I imitated his -hand, and wrote the letter." - -So the mystery was cleared up, after so many, many years. - - - - -CHAPTER XXVI. - -There are people who can do all fine and heroic things but one! keep -from telling their happinesses to the unhappy. - --Pudd'nhead Wilson's New Calendar. - -After visits to Maryborough and some other Australian towns, we presently -took passage for New Zealand. If it would not look too much like showing -off, I would tell the reader where New Zealand is; for he is as I was; he -thinks he knows. And he thinks he knows where Hertzegovina is; and how -to pronounce pariah; and how to use the word unique without exposing -himself to the derision of the dictionary. But in truth, he knows none -of these things. There are but four or five people in the world who -possess this knowledge, and these make their living out of it. They -travel from place to place, visiting literary assemblages, geographical -societies, and seats of learning, and springing sudden bets that these -people do not know these things. Since all people think they know them, -they are an easy prey to these adventurers. Or rather they were an easy -prey until the law interfered, three months ago, and a New York court -decided that this kind of gambling is illegal, "because it traverses -Article IV, Section 9, of the Constitution of the United States, which -forbids betting on a sure thing." This decision was rendered by the full -Bench of the New York Supreme Court, after a test sprung upon the court -by counsel for the prosecution, which showed that none of the nine Judges -was able to answer any of the four questions. - -All people think that New Zealand is close to Australia or Asia, or -somewhere, and that you cross to it on a bridge. But that is not so. It -is not close to anything, but lies by itself, out in the water. It is -nearest to Australia, but still not near. The gap between is very wide. -It will be a surprise to the reader, as it was to me, to learn that the -distance from Australia to New Zealand is really twelve or thirteen -hundred miles, and that there is no bridge. I learned this from -Professor X., of Yale University, whom I met in the steamer on the great -lakes when I was crossing the continent to sail across the Pacific. I -asked him about New Zealand, in order to make conversation. I supposed -he would generalize a little without compromising himself, and then turn -the subject to something he was acquainted with, and my object would then -be attained; the ice would be broken, and we could go smoothly on, and -get acquainted, and have a pleasant time. But, to my surprise, he was -not only not embarrassed by my question, but seemed to welcome it, and to -take a distinct interest in it. He began to talk--fluently, confidently, -comfortably; and as he talked, my admiration grew and grew; for as the -subject developed under his hands, I saw that he not only knew where New -Zealand was, but that he was minutely familiar with every detail of its -history, politics, religions, and commerce, its fauna, flora, geology, -products, and climatic peculiarities. When he was done, I was lost in -wonder and admiration, and said to myself, he knows everything; in the -domain of human knowledge he is king. - -I wanted to see him do more miracles; and so, just for the pleasure of -hearing him answer, I asked him about Hertzegovina, and pariah, and -unique. But he began to generalize then, and show distress. I saw that -with New Zealand gone, he was a Samson shorn of his locks; he was as -other men. This was a curious and interesting mystery, and I was frank -with him, and asked him to explain it. - -He tried to avoid it at first; but then laughed and said that after all, -the matter was not worth concealment, so he would let me into the secret. -In substance, this is his story: - -"Last autumn I was at work one morning at home, when a card came up--the -card of a stranger. Under the name was printed a line which showed that -this visitor was Professor of Theological Engineering in Wellington -University, New Zealand. I was troubled--troubled, I mean, by the -shortness of the notice. College etiquette required that he be at once -invited to dinner by some member of the Faculty--invited to dine on that -day--not, put off till a subsequent day. I did not quite know what to -do. College etiquette requires, in the case of a foreign guest, that the -dinner-talk shall begin with complimentary references to his country, its -great men, its services to civilization, its seats of learning, and -things like that; and of course the host is responsible, and must either -begin this talk himself or see that it is done by some one else. I was -in great difficulty; and the more I searched my memory, the more my -trouble grew. I found that I knew nothing about New Zealand. I thought -I knew where it was, and that was all. I had an impression that it was -close to Australia, or Asia, or somewhere, and that one went over to it -on a bridge. This might turn out to be incorrect; and even if correct, -it would not furnish matter enough for the purpose at the dinner, and I -should expose my College to shame before my guest; he would see that I, a -member of the Faculty of the first University in America, was wholly -ignorant of his country, and he would go away and tell this, and laugh at -it. The thought of it made my face burn. - -"I sent for my wife and told her how I was situated, and asked for her -help, and she thought of a thing which I might have thought of myself, if -I had not been excited and worried. She said she would go and tell the -visitor that I was out but would be in in a few minutes; and she would -talk, and keep him busy while I got out the back way and hurried over and -make Professor Lawson give the dinner. For Lawson knew everything, and -could meet the guest in a creditable way and save the reputation of the -University. I ran to Lawson, but was disappointed. He did not know -anything about New Zealand. He said that, as far as his recollection -went it was close to Australia, or Asia, or somewhere, and you go over to -it on a bridge; but that was all he knew. It was too bad. Lawson was a -perfect encyclopedia of abstruse learning; but now in this hour of our -need, it turned out that he did not know any useful thing. - -"We consulted. He saw that the reputation of the University was in very -real peril, and he walked the floor in anxiety, talking, and trying to -think out some way to meet the difficulty. Presently he decided that we -must try the rest of the Faculty--some of them might know about New -Zealand. So we went to the telephone and called up the professor of -astronomy and asked him, and he said that all he knew was, that it was -close to Australia, or Asia, or somewhere, and you went over to it on---- - -"We shut him off and called up the professor of biology, and he said that -all he knew was that it was close to Aus----. - -"We shut him off, and sat down, worried and disheartened, to see if we -could think up some other scheme. We shortly hit upon one which promised -well, and this one we adopted, and set its machinery going at once. It -was this. Lawson must give the dinner. The Faculty must be notified by -telephone to prepare. We must all get to work diligently, and at the end -of eight hours and a half we must come to dinner acquainted with New -Zealand; at least well enough informed to appear without discredit before -this native. To seem properly intelligent we should have to know about -New Zealand's population, and politics, and form of government, and -commerce, and taxes, and products, and ancient history, and modern -history, and varieties of religion, and nature of the laws, and their -codification, and amount of revenue, and whence drawn, and methods of -collection, and percentage of loss, and character of climate, and--well, -a lot of things like that; we must suck the maps and cyclopedias dry. -And while we posted up in this way, the Faculty's wives must flock over, -one after the other, in a studiedly casual way, and help my wife keep the -New Zealander quiet, and not let him get out and come interfering with -our studies. The scheme worked admirably; but it stopped business, -stopped it entirely. - -"It is in the official log-book of Yale, to be read and wondered at by -future generations--the account of the Great Blank Day--the memorable -Blank Day--the day wherein the wheels of culture were stopped, a Sunday -silence prevailed all about, and the whole University stood still while -the Faculty read-up and qualified itself to sit at meat, without shame, -in the presence of the Professor of Theological Engineering from New -Zealand: - -"When we assembled at the dinner we were miserably tired and worn--but we -were posted. Yes, it is fair to claim that. In fact, erudition is a -pale name for it. New Zealand was the only subject; and it was just -beautiful to hear us ripple it out. And with such an air of -unembarrassed ease, and unostentatious familiarity with detail, and -trained and seasoned mastery of the subject-and oh, the grace and fluency -of it! - -"Well, finally somebody happened to notice that the guest was looking -dazed, and wasn't saying anything. So they stirred him up, of course. -Then that man came out with a good, honest, eloquent compliment that made -the Faculty blush. He said he was not worthy to sit in the company of -men like these; that he had been silent from admiration; that he had been -silent from another cause also--silent from shame--silent from ignorance! -'For,' said he, 'I, who have lived eighteen years in New Zealand and have -served five in a professorship, and ought to know much about that -country, perceive, now, that I know almost nothing about it. I say it -with shame, that I have learned fifty times, yes, a hundred times more -about New Zealand in these two hours at this table than I ever knew -before in all the eighteen years put together. I was silent because I -could not help myself. What I knew about taxes, and policies, and laws, -and revenue, and products, and history, and all that multitude of things, -was but general, and ordinary, and vague-unscientific, in a word--and it -would have been insanity to expose it here to the searching glare of your -amazingly accurate and all-comprehensive knowledge of those matters, -gentlemen. I beg you to let me sit silent--as becomes me. But do not -change the subject; I can at least follow you, in this one; whereas if -you change to one which shall call out the full strength of your mighty -erudition, I shall be as one lost. If you know all this about a remote -little inconsequent patch like New Zealand, ah, what wouldn't you know -about any other Subject!'" - - - - -CHAPTER XXVIL - -Man is the Only Animal that Blushes. Or needs to. - --Pudd'nhead Wilson's New Calendar. - -The universal brotherhood of man is our most precious possession, what -there is of it. - --Pudd'nhead Wilson's New Calendar. - -FROM DIARY: - -November 1--noon. A fine day, a brilliant sun. Warm in the sun, cold -in the shade--an icy breeze blowing out of the south. A solemn long -swell rolling up northward. It comes from the South Pole, with nothing -in the way to obstruct its march and tone its energy down. I have read -somewhere that an acute observer among the early explorers--Cook? or -Tasman?--accepted this majestic swell as trustworthy circumstantial -evidence that no important land lay to the southward, and so did not -waste time on a useless quest in that direction, but changed his course -and went searching elsewhere. - -Afternoon. Passing between Tasmania (formerly Van Diemen's Land) and -neighboring islands--islands whence the poor exiled Tasmanian savages -used to gaze at their lost homeland and cry; and die of broken hearts. -How glad I am that all these native races are dead and gone, or nearly -so. The work was mercifully swift and horrible in some portions of -Australia. As far as Tasmania is concerned, the extermination was -complete: not a native is left. It was a strife of years, and decades of -years. The Whites and the Blacks hunted each other, ambushed each other, -butchered each other. The Blacks were not numerous. But they were wary, -alert, cunning, and they knew their country well. They lasted a long -time, few as they were, and inflicted much slaughter upon the Whites. - -The Government wanted to save the Blacks from ultimate extermination, if -possible. One of its schemes was to capture them and coop them up, on a -neighboring island, under guard. Bodies of Whites volunteered for the -hunt, for the pay was good--L5 for each Black captured and delivered, but -the success achieved was not very satisfactory. The Black was naked, and -his body was greased. It was hard to get a grip on him that would hold. -The Whites moved about in armed bodies, and surprised little families of -natives, and did make captures; but it was suspected that in these -surprises half a dozen natives were killed to one caught--and that was -not what the Government desired. - -Another scheme was to drive the natives into a corner of the island and -fence them in by a cordon of men placed in line across the country; but -the natives managed to slip through, constantly, and continue their -murders and arsons. - -The governor warned these unlettered savages by printed proclamation that -they must stay in the desolate region officially appointed for them! The -proclamation was a dead letter; the savages could not read it. Afterward -a picture-proclamation was issued. It was painted up on boards, and -these were nailed to trees in the forest. Herewith is a photographic -reproduction of this fashion-plate. Substantially it means: - -1. The Governor wishes the Whites and the Blacks to love each other; - -2. He loves his black subjects; - -3. Blacks who kill Whites will be hanged; - -4. Whites who kill Blacks will be hanged. - -Upon its several schemes the Government spent L30,000 and employed the -labors and ingenuities of several thousand Whites for a long time with -failure as a result. Then, at last, a quarter of a century after the -beginning of the troubles between the two races, the right man was found. -No, he found himself. This was George Augustus Robinson, called in -history "The Conciliator." He was not educated, and not conspicuous in -any way. He was a working bricklayer, in Hobart Town. But he must have -been an amazing personality; a man worth traveling far to see. It may be -his counterpart appears in history, but I do not know where to look for -it. - -He set himself this incredible task: to go out into the wilderness, the -jungle, and the mountain-retreats where the hunted and implacable savages -were hidden, and appear among them unarmed, speak the language of love -and of kindness to them, and persuade them to forsake their homes and the -wild free life that was so dear to them, and go with him and surrender to -the hated Whites and live under their watch and ward, and upon their -charity the rest of their lives! On its face it was the dream of a -madman. - -In the beginning, his moral-suasion project was sarcastically dubbed the -sugar plum speculation. If the scheme was striking, and new to the -world's experience, the situation was not less so. It was this. The -White population numbered 40,000 in 1831; the Black population numbered -three hundred. Not 300 warriors, but 300 men, women, and children. The -Whites were armed with guns, the Blacks with clubs and spears. The -Whites had fought the Blacks for a quarter of a century, and had tried -every thinkable way to capture, kill, or subdue them; and could not do -it. If white men of any race could have done it, these would have -accomplished it. But every scheme had failed, the splendid 300, the -matchless 300 were unconquered, and manifestly unconquerable. They would -not yield, they would listen to no terms, they would fight to the bitter -end. Yet they had no poet to keep up their heart, and sing the marvel of -their magnificent patriotism. - -At the end of five-and-twenty years of hard fighting, the surviving 300 -naked patriots were still defiant, still persistent, still efficacious -with their rude weapons, and the Governor and the 40,000 knew not which -way to turn, nor what to do. - -Then the Bricklayer--that wonderful man--proposed to go out into the -wilderness, with no weapon but his tongue, and no protection but his -honest eye and his humane heart; and track those embittered savages to -their lairs in the gloomy forests and among the mountain snows. -Naturally, he was considered a crank. But he was not quite that. In -fact, he was a good way short of that. He was building upon his long and -intimate knowledge of the native character. The deriders of his project -were right--from their standpoint--for they believed the natives to be -mere wild beasts; and Robinson was right, from his standpoint--for he -believed the natives to be human beings. The truth did really lie -between the two. The event proved that Robinson's judgment was soundest; -but about once a month for four years the event came near to giving the -verdict to the deriders, for about that frequently Robinson barely -escaped falling under the native spears. - -But history shows that he had a thinking head, and was not a mere wild -sentimentalist. For instance, he wanted the war parties (called) in -before he started unarmed upon his mission of peace. He wanted the best -chance of success--not a half-chance. And he was very willing to have -help; and so, high rewards were advertised, for any who would go unarmed -with him. This opportunity was declined. Robinson persuaded some tamed -natives of both sexes to go with him--a strong evidence of his persuasive -powers, for those natives well knew that their destruction would be -almost certain. As it turned out, they had to face death over and over -again. - -Robinson and his little party had a difficult undertaking upon their -hands. They could not ride off, horseback, comfortably into the woods -and call Leonidas and his 300 together for a talk and a treaty the -following day; for the wild men were not in a body; they were scattered, -immense distances apart, over regions so desolate that even the birds -could not make a living with the chances offered--scattered in groups of -twenty, a dozen, half a dozen, even in groups of three. And the mission -must go on foot. Mr. Bonwick furnishes a description of those horrible -regions, whereby it will be seen that even fugitive gangs of the hardiest -and choicest human devils the world has seen--the convicts set apart to -people the "Hell of Macquarrie Harbor Station"--were never able, but -once, to survive the horrors of a march through them, but starving and -struggling, and fainting and failing, ate each other, and died: - -"Onward, still onward, was the order of the indomitable Robinson. No one -ignorant of the western country of Tasmania can form a correct idea of -the traveling difficulties. While I was resident in Hobart Town, the -Governor, Sir John Franklin, and his lady, undertook the western journey -to Macquarrie Harbor, and suffered terribly. One man who assisted to -carry her ladyship through the swamps, gave me his bitter experience of -its miseries. Several were disabled for life. No wonder that but one -party, escaping from Macquarrie Harbor convict settlement, arrived at the -civilized region in safety. Men perished in the scrub, were lost in -snow, or were devoured by their companions. This was the territory -traversed by Mr. Robinson and his Black guides. All honor to his -intrepidity, and their wonderful fidelity! When they had, in the depth -of winter, to cross deep and rapid rivers, pass among mountains six -thousand feet high, pierce dangerous thickets, and find food in a country -forsaken even by birds, we can realize their hardships. - -"After a frightful journey by Cradle Mountain, and over the lofty plateau -of Middlesex Plains, the travelers experienced unwonted misery, and the -circumstances called forth the best qualities of the noble little band. -Mr. Robinson wrote afterwards to Mr. Secretary Burnett some details of -this passage of horrors. In that letter, of Oct 2, 1834, he states that -his Natives were very reluctant to go over the dreadful mountain passes; -that 'for seven successive days we continued traveling over one solid -body of snow;' that 'the snows were of incredible depth;' that 'the -Natives were frequently up to their middle in snow.' But still the -ill-clad, ill-fed, diseased, and way-worn men and women were sustained by -the cheerful voice of their unconquerable friend, and responded most -nobly to his call." - -Mr. Bonwick says that Robinson's friendly capture of the Big River tribe -remember, it was a whole tribe--"was by far the grandest feature of the -war, and the crowning glory of his efforts." The word "war" was not well -chosen, and is misleading. There was war still, but only the Blacks were -conducting it--the Whites were holding off until Robinson could give his -scheme a fair trial. I think that we are to understand that the friendly -capture of that tribe was by far the most important thing, the highest in -value, that happened during the whole thirty years of truceless -hostilities; that it was a decisive thing, a peaceful Waterloo, the -surrender of the native Napoleon and his dreaded forces, the happy ending -of the long strife. For "that tribe was the terror of the colony," its -chief "the Black Douglas of Bush households." - -Robinson knew that these formidable people were lurking somewhere, in -some remote corner of the hideous regions just described, and he and his -unarmed little party started on a tedious and perilous hunt for them. At -last, "there, under the shadows of the Frenchman's Cap, whose grim cone -rose five thousand feet in the uninhabited westward interior," they were -found. It was a serious moment. Robinson himself believed, for once, -that his mission, successful until now, was to end here in failure, and -that his own death-hour had struck. - -The redoubtable chief stood in menacing attitude, with his eighteen-foot -spear poised; his warriors stood massed at his back, armed for battle, -their faces eloquent with their long-cherished loathing for white men. -"They rattled their spears and shouted their war-cry." Their women were -back of them, laden with supplies of weapons, and keeping their 150 eager -dogs quiet until the chief should give the signal to fall on. - -"I think we shall soon be in the resurrection," whispered a member of -Robinson's little party. - -"I think we shall," answered Robinson; then plucked up heart and began -his persuasions--in the tribe's own dialect, which surprised and pleased -the chief. Presently there was an interruption by the chief: - -"Who are you?" - -"We are gentlemen." - -"Where are your guns?" - -"We have none." - -The warrior was astonished. - -"Where your little guns?" (pistols). - -"We have none." - -A few minutes passed--in by-play--suspense--discussion among the -tribesmen--Robinson's tamed squaws ventured to cross the line and begin -persuasions upon the wild squaws. Then the chief stepped back "to confer -with the old women--the real arbiters of savage war." Mr. Bonwick -continues: - - "As the fallen gladiator in the arena looks for the signal of life - or death from the president of the amphitheatre, so waited our - friends in anxious suspense while the conference continued. In a - few minutes, before a word was uttered, the women of the tribe threw - up their arms three times. This was the inviolable sign of peace! - Down fell the spears. Forward, with a heavy sigh of relief, and - upward glance of gratitude, came the friends of peace. The - impulsive natives rushed forth with tears and cries, as each saw in - the other's rank a loved one of the past. - - "It was a jubilee of joy. A festival followed. And, while tears - flowed at the recital of woe, a corrobory of pleasant laughter - closed the eventful day." - -In four years, without the spilling of a drop of blood, Robinson brought -them all in, willing captives, and delivered them to the white governor, -and ended the war which powder and bullets, and thousands of men to use -them, had prosecuted without result since 1804. - -Marsyas charming the wild beasts with his music--that is fable; but the -miracle wrought by Robinson is fact. It is history--and authentic; and -surely, there is nothing greater, nothing more reverence-compelling in -the history of any country, ancient or modern. - -And in memory of the greatest man Australasia ever developed or ever will -develop, there is a stately monument to George Augustus Robinson, the -Conciliator in--no, it is to another man, I forget his name. - -However, Robertson's own generation honored him, and in manifesting it -honored themselves. The Government gave him a money-reward and a -thousand acres of land; and the people held mass-meetings and praised him -and emphasized their praise with a large subscription of money. - -A good dramatic situation; but the curtain fell on another: - - "When this desperate tribe was thus captured, there was much - surprise to find that the L30,000 of a little earlier day had been - spent, and the whole population of the colony placed under arms, in - contention with an opposing force of sixteen men with wooden spears! - Yet such was the fact. The celebrated Big River tribe, that had - been raised by European fears to a host, consisted of sixteen men, - nine women, and one child. With a knowledge of the mischief done by - these few, their wonderful marches and their widespread aggressions, - their enemies cannot deny to them the attributes of courage and - military tact. A Wallace might harass a large army with a small and - determined band; but the contending parties were at least equal in - arms and civilization. The Zulus who fought us in Africa, the - Maories in New Zealand, the Arabs in the Soudan, were far better - provided with weapons, more advanced in the science of war, and - considerably more numerous, than the naked Tasmanians. Governor - Arthur rightly termed them a noble race." - -These were indeed wonderful people, the natives. They ought not to have -been wasted. They should have been crossed with the Whites. It would -have improved the Whites and done the Natives no harm. - -But the Natives were wasted, poor heroic wild creatures. They were -gathered together in little settlements on neighboring islands, and -paternally cared for by the Government, and instructed in religion, and -deprived of tobacco, because the superintendent of the Sunday-school was -not a smoker, and so considered smoking immoral. - -The Natives were not used to clothes, and houses, and regular hours, and -church, and school, and Sunday-school, and work, and the other misplaced -persecutions of civilization, and they pined for their lost home and -their wild free life. Too late they repented that they had traded that -heaven for this hell. They sat homesick on their alien crags, and day by -day gazed out through their tears over the sea with unappeasable longing -toward the hazy bulk which was the specter of what had been their -paradise; one by one their hearts broke and they died. - -In a very few years nothing but a scant remnant remained alive. A -handful lingered along into age. In 1864 the last man died, in 1876 the -last woman died, and the Spartans of Australasia were extinct. - -The Whites always mean well when they take human fish out of the ocean -and try to make them dry and warm and happy and comfortable in a chicken -coop; but the kindest-hearted white man can always be depended on to -prove himself inadequate when he deals with savages. He cannot turn the -situation around and imagine how he would like it to have a well-meaning -savage transfer him from his house and his church and his clothes and his -books and his choice food to a hideous wilderness of sand and rocks and -snow, and ice and sleet and storm and blistering sun, with no shelter, no -bed, no covering for his and his family's naked bodies, and nothing to -eat but snakes and grubs and 'offal. This would be a hell to him; and if -he had any wisdom he would know that his own civilization is a hell to -the savage--but he hasn't any, and has never had any; and for lack of it -he shut up those poor natives in the unimaginable perdition of his -civilization, committing his crime with the very best intentions, and saw -those poor creatures waste away under his tortures; and gazed at it, -vaguely troubled and sorrowful, and wondered what could be the matter -with them. One is almost betrayed into respecting those criminals, they -were so sincerely kind, and tender, and humane; and well-meaning. - -They didn't know why those exiled savages faded away, and they did their -honest best to reason it out. And one man, in a like case in New South -Wales, did reason it out and arrive at a solution: - - "It is from the wrath of God, which is revealed from heaven against - cold ungodliness and unrighteousness of men." - -That settles it. - - - - -CHAPTER XXVIII. - -Let us be thankful for the fools. But for them the rest of us could not -succeed. - --Pudd'nhead Wilson's New Calendar. - -The aphorism does really seem true: "Given the Circumstances, the Man -will appear." But the man musn't appear ahead of time, or it will spoil -everything. In Robinson's case the Moment had been approaching for a -quarter of a century--and meantime the future Conciliator was tranquilly -laying bricks in Hobart. When all other means had failed, the Moment had -arrived, and the Bricklayer put down his trowel and came forward. -Earlier he would have been jeered back to his trowel again. It reminds -me of a tale that was told me by a Kentuckian on the train when we were -crossing Montana. He said the tale was current in Louisville years ago. -He thought it had been in print, but could not remember. At any rate, in -substance it was this, as nearly as I can call it back to mind. - -A few years before the outbreak of the Civil War it began to appear that -Memphis, Tennessee, was going to be a great tobacco entrepot--the wise -could see the signs of it. At that time Memphis had a wharf boat, of -course. There was a paved sloping wharf, for the accommodation of -freight, but the steamers landed on the outside of the wharfboat, and all -loading and unloading was done across it, between steamer and shore. A -number of wharfboat clerks were needed, and part of the time, every day, -they were very busy, and part of the time tediously idle. They were -boiling over with youth and spirits, and they had to make the intervals -of idleness endurable in some way; and as a rule, they did it by -contriving practical jokes and playing them upon each other. - -The favorite butt for the jokes was Ed Jackson, because he played none -himself, and was easy game for other people's--for he always believed -whatever was told him. - -One day he told the others his scheme for his holiday. He was not going -fishing or hunting this time--no, he had thought out a better plan. Out -of his $40 a month he had saved enough for his purpose, in an economical -way, and he was going to have a look at New York. - -It was a great and surprising idea. It meant travel immense travel--in -those days it meant seeing the world; it was the equivalent of a voyage -around it in ours. At first the other youths thought his mind was -affected, but when they found that he was in earnest, the next thing to -be thought of was, what sort of opportunity this venture might afford for -a practical joke. - -The young men studied over the matter, then held a secret consultation -and made a plan. The idea was, that one of the conspirators should offer -Ed a letter of introduction to Commodore Vanderbilt, and trick him into -delivering it. It would be easy to do this. But what would Ed do when -he got back to Memphis? That was a serious matter. He was good-hearted, -and had always taken the jokes patiently; but they had been jokes which -did not humiliate him, did not bring him to shame; whereas, this would be -a cruel one in that way, and to play it was to meddle with fire; for with -all his good nature, Ed was a Southerner--and the English of that was, -that when he came back he would kill as many of the conspirators as he -could before falling himself. However, the chances must be taken--it -wouldn't do to waste such a joke as that. - -So the letter was prepared with great care and elaboration. It was -signed Alfred Fairchild, and was written in an easy and friendly spirit. -It stated that the bearer was the bosom friend of the writer's son, and -was of good parts and sterling character, and it begged the Commodore to -be kind to the young stranger for the writer's sake. It went on to say, -"You may have forgotten me, in this long stretch of time, but you will -easily call me back out of your boyhood memories when I remind you of how -we robbed old Stevenson's orchard that night; and how, while he was -chasing down the road after us, we cut across the field and doubled back -and sold his own apples to his own cook for a hat-full of doughnuts; and -the time that we----" and so forth and so on, bringing in names of -imaginary comrades, and detailing all sorts of wild and absurd and, of -course, wholly imaginary schoolboy pranks and adventures, but putting -them into lively and telling shape. - -With all gravity Ed was asked if he would like to have a letter to -Commodore Vanderbilt, the great millionaire. It was expected that the -question would astonish Ed, and it did. - -"What? Do you know that extraordinary man?" - -"No; but my father does. They were schoolboys together. And if you -like, I'll write and ask father. I know he'll be glad to give it to you -for my sake." - -Ed could not find words capable of expressing his gratitude and delight. -The three days passed, and the letter was put into his bands. He started -on his trip, still pouring out his thanks while he shook good-bye all -around. And when he was out of sight his comrades let fly their laughter -in a storm of happy satisfaction--and then quieted down, and were less -happy, less satisfied. For the old doubts as to the wisdom of this -deception began to intrude again. - -Arrived in New York, Ed found his way to Commodore Vanderbilt's business -quarters, and was ushered into a large anteroom, where a score of people -were patiently awaiting their turn for a two-minute interview with the -millionaire in his private office. A servant asked for Ed's card, and -got the letter instead. Ed was sent for a moment later, and found Mr. -Vanderbilt alone, with the letter--open--in his hand. - -"Pray sit down, Mr. --er--" - -"Jackson." - -" Ah--sit down, Mr. Jackson. By the opening sentences it seems to be a -letter from an old friend. Allow me--I will run my eye through it. He -says he says--why, who is it?" He turned the sheet and found the -signature. "Alfred Fairchild--hm--Fairchild--I don't recall the name. -But that is nothing--a thousand names have gone from me. He says--he -says-hm-hmoh, dear, but it's good! Oh, it's rare! I don't quite -remember it, but I seem to it'll all come back to me presently. He says ---he says--hm--hm-oh, but that was a game! Oh, spl-endid! How it -carries me back! It's all dim, of course it's a long time ago--and the -names--some of the names are wavery and indistinct--but sho', I know it -happened--I can feel it! and lord, how it warms my heart, and brings -back my lost youth! Well, well, well, I've got to come back into this -work-a-day world now--business presses and people are waiting--I'll keep -the rest for bed to-night, and live my youth over again. And you'll -thank Fairchild for me when you see him--I used to call him Alf, I think ---and you'll give him my gratitude for--what this letter has done for the -tired spirit of a hard-worked man; and tell him there isn't anything that -I can do for him or any friend of his that I won't do. And as for you, -my lad, you are my guest; you can't stop at any hotel in New York. Sit. -where you are a little while, till I get through with these people, then -we'll go home. I'll take care of you, my boy--make yourself easy as to -that." - -Ed stayed a week, and had an immense time--and never suspected that the -Commodore's shrewd eye was on him, and that he was daily being weighed -and measured and analyzed and tried and tested. - -Yes, he had an immense time; and never wrote home, but saved it all up to -tell when he should get back. Twice, with proper modesty and decency, he -proposed to end his visit, but the Commodore said, "No--wait; leave it to -me; I'll tell you when to go." - -In those days the Commodore was making some of those vast combinations of -his--consolidations of warring odds and ends of railroads into harmonious -systems, and concentrations of floating and rudderless commerce in -effective centers--and among other things his farseeing eye had detected -the convergence of that huge tobacco-commerce, already spoken of, toward -Memphis, and he had resolved to set his grasp upon it and make it his -own. - -The week came to an end. Then the Commodore said: - -"Now you can start home. But first we will have some more talk about -that tobacco matter. I know you now. I know your abilities as well as -you know them yourself--perhaps better. You understand that tobacco -matter; you understand that I am going to take possession of it, and you -also understand the plans which I have matured for doing it. What I want -is a man who knows my mind, and is qualified to represent me in Memphis, -and be in supreme command of that important business--and I appoint you." - -"Me!" - -"Yes. Your salary will be high--of course-for you are representing me. -Later you will earn increases of it, and will get them. You will need a -small army of assistants; choose them yourself--and carefully. Take no -man for friendship's sake; but, all things being equal, take the man you -know, take your friend, in preference to the stranger." After some -further talk under this head, the Commodore said: - -"Good-bye, my boy, and thank Alf for me, for sending you to me." - -When Ed reached Memphis he rushed down to the wharf in a fever to tell -his great news and thank the boys over and over again for thinking to -give him the letter to Mr. Vanderbilt. It happened to be one of those -idle times. Blazing hot noonday, and no sign of life on the wharf. But -as Ed threaded his way among the freight piles, he saw a white linen -figure stretched in slumber upon a pile of grain-sacks under an awning, -and said to himself, "That's one of them," and hastened his step; next, -he said, "It's Charley--it's Fairchild good"; and the next moment laid an -affectionate hand on the sleeper's shoulder. The eyes opened lazily, -took one glance, the face blanched, the form whirled itself from the -sack-pile, and in an instant Ed was alone and Fairchild was flying for -the wharf-boat like the wind! - -Ed was dazed, stupefied. Was Fairchild crazy? What could be the meaning -of this? He started slow and dreamily down toward the wharf-boat; turned -the corner of a freight-pile and came suddenly upon two of the boys. -They were lightly laughing over some pleasant matter; they heard his -step, and glanced up just as he discovered them; the laugh died abruptly; -and before Ed could speak they were off, and sailing over barrels and -bales like hunted deer. Again Ed was paralyzed. Had the boys all gone -mad? What could be the explanation of this extraordinary conduct? And -so, dreaming along, he reached the wharf-boat, and stepped aboard nothing -but silence there, and vacancy. He crossed the deck, turned the corner -to go down the outer guard, heard a fervent-- - -"O lord!" and saw a white linen form plunge overboard. - -The youth came up coughing and strangling, and cried out-- - -"Go 'way from here! You let me alone. I didn't do it, I swear I -didn't!" - -"Didn't do what?" - -"Give you the----" - -"Never mind what you didn't do--come out of that! What makes you all act -so? What have I done?" - -"You? Why you haven't done anything. But----" - -"Well, then, what have you got against me? What do you all treat me so -for?" - -"I--er--but haven't you got anything against us?" - -"Of course not. What put such a thing into your head?" - -"Honor bright--you haven't? - -"Honor bright." - -"Swear it!" - -"I don't know what in the world you mean, but I swear it, anyway." - -"And you'll shake hands with me?" - -"Goodness knows I'll be glad to! Why, I'm just starving to shake hands -with somebody!" - -The swimmer muttered, "Hang him, he smelt a rat and never delivered the -letter!--but it's all right, I'm not going to fetch up the subject." And -he crawled out and came dripping and draining to shake hands. First one -and then another of the conspirators showed up cautiously--armed to the -teeth--took in the amicable situation, then ventured warily forward and -joined the love-feast. - -And to Ed's eager inquiry as to what made them act as they had been -acting, they answered evasively, and pretended that they had put it up as -a joke, to see what he would do. It was the best explanation they could -invent at such short notice. And each said to himself, "He never -delivered that letter, and the joke is on us, if he only knew it or we -were dull enough to come out and tell." - -Then, of course, they wanted to know all about the trip; and he said-- - -"Come right up on the boiler deck and order the drinks it's my treat. -I'm going to tell you all about it. And to-night it's my treat again ---and we'll have oysters and a time!" - -When the drinks were brought and cigars lighted, Ed said: - -"Well, when, I delivered the letter to Mr. Vanderbilt----" - -"Great Scott!" - -"Gracious, how you scared me. What's the matter?" - -"Oh--er--nothing. Nothing--it was a tack in the chair-seat," said one. - -"But you all said it. However, no matter. When I delivered the -letter----" - -"Did you deliver it?" And they looked at each other as people might who -thought that maybe they were dreaming. - -Then they settled to listening; and as the story deepened and its marvels -grew, the amazement of it made them dumb, and the interest of it took -their breath. They hardly uttered a whisper during two hours, but sat -like petrifactions and drank in the immortal romance. At last the tale -was ended, and Ed said-- - -"And it's all owing to you, boys, and you'll never find me ungrateful ---bless your hearts, the best friends a fellow ever had! You'll all have -places; I want every one of you. I know you--I know you 'by the back,' -as the gamblers say. You're jokers, and all that, but you're sterling, -with the hallmark on. And Charley Fairchild, you shall be my first -assistant and right hand, because of your first-class ability, and -because you got me the letter, and for your father's sake who wrote it -for me, and to please Mr. Vanderbilt, who said it would! And here's to -that great man--drink hearty!" - -Yes, when the Moment comes, the Man appears--even if he is a thousand -miles away, and has to be discovered by a practical joke. - - - - -CHAPTER XXIX. - -When people do not respect us we are sharply offended; yet deep down in -his private heart no man much respects himself. - --Pudd'nhead Wilson's New Calendar. - -Necessarily, the human interest is the first interest in the log-book of -any country. The annals of Tasmania, in whose shadow we were sailing, -are lurid with that feature. Tasmania was a convict-dump, in old times; -this has been indicated in the account of the Conciliator, where -reference is made to vain attempts of desperate convicts to win to -permanent freedom, after escaping from Macquarrie Harbor and the "Gates -of Hell." In the early days Tasmania had a great population of convicts, -of both sexes and all ages, and a bitter hard life they had. In one spot -there was a settlement of juvenile convicts--children--who had been sent -thither from their home and their friends on the other side of the globe -to expiate their "crimes." - -In due course our ship entered the estuary called the Derwent, at whose -head stands Hobart, the capital of Tasmania. The Derwent's shores -furnish scenery of an interesting sort. The historian Laurie, whose -book, "The Story of Australasia," is just out, invoices its features with -considerable truth and intemperance: "The marvelous picturesqueness of -every point of view, combined with the clear balmy atmosphere and the -transparency of the ocean depths, must have delighted and deeply -impressed" the early explorers. "If the rock-bound coasts, sullen, -defiant, and lowering, seemed uninviting, these were occasionally broken -into charmingly alluring coves floored with golden sand, clad with -evergreen shrubbery, and adorned with every variety of indigenous wattle, -she-oak, wild flower, and fern, from the delicately graceful -'maiden-hair' to the palm-like 'old man'; while the majestic gum-tree, -clean and smooth as the mast of 'some tall admiral' pierces the clear air -to the height of 230 feet or more." - -It looked so to me. "Coasting along Tasman's Peninsula, what a shock of -pleasant wonder must have struck the early mariner on suddenly sighting -Cape Pillar, with its cluster of black-ribbed basaltic columns rising to -a height of 900 feet, the hydra head wreathed in a turban of fleecy -cloud, the base lashed by jealous waves spouting angry fountains of -foam." - -That is well enough, but I did not suppose those snags were 900 feet -high. Still they were a very fine show. They stood boldly out by -themselves, and made a fascinatingly odd spectacle. But there was -nothing about their appearance to suggest the heads of a hydra. They -looked like a row of lofty slabs with their upper ends tapered to the -shape of a carving-knife point; in fact, the early voyager, ignorant of -their great height, might have mistaken them for a rusty old rank of -piles that had sagged this way and that out of the perpendicular. - -The Peninsula is lofty, rocky, and densely clothed with scrub, or brush, -or both. It is joined to the main by a low neck. At this junction was -formerly a convict station called Port Arthur--a place hard to escape -from. Behind it was the wilderness of scrub, in which a fugitive would -soon starve; in front was the narrow neck, with a cordon of chained dogs -across it, and a line of lanterns, and a fence of living guards, armed. -We saw the place as we swept by--that is, we had a glimpse of what we -were told was the entrance to Port Arthur. The glimpse was worth -something, as a remembrancer, but that was all. - -The voyage thence up the Derwent Frith displays a grand succession of -fairy visions, in its entire length elsewhere unequaled. In gliding over -the deep blue sea studded with lovely islets luxuriant to the water's -edge, one is at a loss which scene to choose for contemplation and to -admire most. When the Huon and Bruni have been passed, there seems no -possible chance of a rival; but suddenly Mount Wellington, massive and -noble like his brother Etna, literally heaves in sight, sternly guarded -on either hand by Mounts Nelson and Rumney; presently we arrive at -Sullivan's Cove--Hobart! - -It is an attractive town. It sits on low hills that slope to the harbor ---a harbor that looks like a river, and is as smooth as one. Its still -surface is pictured with dainty reflections of boats and grassy banks and -luxuriant foliage. Back of the town rise highlands that are clothed in -woodland loveliness, and over the way is that noble mountain, Wellington, -a stately bulk, a most majestic pile. How beautiful is the whole region, -for form, and grouping, and opulence, and freshness of foliage, and -variety of color, and grace and shapeliness of the hills, the capes, the, -promontories; and then, the splendor of the sunlight, the dim rich -distances, the charm of the water-glimpses! And it was in this paradise -that the yellow-liveried convicts were landed, and the Corps-bandits -quartered, and the wanton slaughter of the kangaroo-chasing black -innocents consummated on that autumn day in May, in the brutish old time. -It was all out of keeping with the place, a sort of bringing of heaven -and hell together. - -The remembrance of this paradise reminds me that it was at Hobart that we -struck the head of the procession of Junior Englands. We were to -encounter other sections of it in New Zealand, presently, and others -later in Natal. Wherever the exiled Englishman can find in his new home -resemblances to his old one, he is touched to the marrow of his being; -the love that is in his heart inspires his imagination, and these allied -forces transfigure those resemblances into authentic duplicates of the -revered originals. It is beautiful, the feeling which works this -enchantment, and it compels one's homage; compels it, and also compels -one's assent--compels it always--even when, as happens sometimes, one -does not see the resemblances as clearly as does the exile who is -pointing them out. - -The resemblances do exist, it is quite true; and often they cunningly -approximate the originals--but after all, in the matter of certain -physical patent rights there is only one England. Now that I have -sampled the globe, I am not in doubt. There is a beauty of Switzerland, -and it is repeated in the glaciers and snowy ranges of many parts of the -earth; there is a beauty of the fiord, and it is repeated in New Zealand -and Alaska; there is a beauty of Hawaii, and it is repeated in ten -thousand islands of the Southern seas; there is a beauty of the prairie -and the plain, and it is repeated here and there in the earth; each of -these is worshipful, each is perfect in its way, yet holds no monopoly of -its beauty; but that beauty which is England is alone--it has no -duplicate. - -It is made up of very simple details--just grass, and trees, and shrubs, -and roads, and hedges, and gardens, and houses, and vines, and churches, -and castles, and here and there a ruin--and over it all a mellow -dream-haze of history. But its beauty is incomparable, and all its own. - -Hobart has a peculiarity--it is the neatest town that the sun shines on; -and I incline to believe that it is also the cleanest. However that may -be, its supremacy in neatness is not to be questioned. There cannot be -another town in the world that has no shabby exteriors; no rickety gates -and fences, no neglected houses crumbling to ruin, no crazy and unsightly -sheds, no weed-grown front-yards of the poor, no back-yards littered with -tin cans and old boots and empty bottles, no rubbish in the gutters, no -clutter on the sidewalks, no outer-borders fraying out into dirty lanes -and tin-patched huts. No, in Hobart all the aspects are tidy, and all a -comfort to the eye; the modestest cottage looks combed and brushed, and -has its vines, its flowers, its neat fence, its neat gate, its comely cat -asleep on the window ledge. - -We had a glimpse of the museum, by courtesy of the American gentleman who -is curator of it. It has samples of half-a-dozen different kinds of -marsupials--[A marsupial is a plantigrade vertebrate whose specialty is -its pocket. In some countries it is extinct, in the others it is rare. -The first American marsupials were Stephen Girard, Mr. Aston and the -opossum; the principal marsupials of the Southern Hemisphere are Mr. -Rhodes, and the kangaroo. I, myself, am the latest marsupial. Also, I -might boast that I have the largest pocket of them all. But there is -nothing in that.]--one, the "Tasmanian devil;" that is, I think he was -one of them. And there was a fish with lungs. When the water dries up -it can live in the mud. Most curious of all was a parrot that kills -sheep. On one great sheep-run this bird killed a thousand sheep in a -whole year. He doesn't want the whole sheep, but only the kidney-fat. -This restricted taste makes him an expensive bird to support. To get the -fat he drives his beak in and rips it out; the wound is mortal. This -parrot furnishes a notable example of evolution brought about by changed -conditions. When the sheep culture was introduced, it presently brought -famine to the parrot by exterminating a kind of grub which had always -thitherto been the parrot's diet. The miseries of hunger made the bird -willing to eat raw flesh, since it could get no other food, and it began -to pick remnants of meat from sheep skins hung out on the fences to dry. -It soon came to prefer sheep meat to any other food, and by and by it -came to prefer the kidney-fat to any other detail of the sheep. The -parrot's bill was not well shaped for digging out the fat, but Nature -fixed that matter; she altered the bill's shape, and now the parrot can -dig out kidney-fat better than the Chief Justice of the Supreme Court, or -anybody else, for that matter--even an Admiral. - -And there was another curiosity--quite a stunning one, I thought: -Arrow-heads and knives just like those which Primeval Man made out of -flint, and thought he had done such a wonderful thing--yes, and has been -humored and coddled in that superstition by this age of admiring -scientists until there is probably no living with him in the other world -by now. Yet here is his finest and nicest work exactly duplicated in our -day; and by people who have never heard of him or his works: by -aborigines who lived in the islands of these seas, within our time. And -they not only duplicated those works of art but did it in the brittlest -and most treacherous of substances--glass: made them out of old brandy -bottles flung out of the British camps; millions of tons of them. It is -time for Primeval Man to make a little less noise, now. He has had his -day. He is not what he used to be. We had a drive through a bloomy and -odorous fairy-land, to the Refuge for the Indigent--a spacious and -comfortable home, with hospitals, etc., for both sexes. There was a -crowd in there, of the oldest people I have ever seen. It was like being -suddenly set down in a new world--a weird world where Youth has never -been, a world sacred to Age, and bowed forms, and wrinkles. Out of the -359 persons present, 223, were ex-convicts, and could have told stirring -tales, no doubt, if they had been minded to talk; 42 of the 359 were past -80, and several were close upon 90; the average age at death there is 76 -years. As for me, I have no use for that place; it is too healthy. -Seventy is old enough--after that, there is too much risk. Youth and -gaiety might vanish, any day--and then, what is left? Death in life; -death without its privileges, death without its benefits. There were 185 -women in that Refuge, and 81 of them were ex-convicts. - -The steamer disappointed us. Instead of making a long visit at Hobart, -as usual, she made a short one. So we got but a glimpse of Tasmania, and -then moved on. - - - - -CHAPTER XXX. - -Nature makes the locust with an appetite for crops; man would have made -him with an appetite for sand. - --Pudd'nhead Wilson's New Calendar. - -We spent part of an afternoon and a night at sea, and reached Bluff, in -New Zealand, early in the morning. Bluff is at the bottom of the middle -island, and is away down south, nearly forty-seven degrees below the -equator. It lies as far south of the line as Quebec lies north of it, -and the climates of the two should be alike; but for some reason or other -it has not been so arranged. Quebec is hot in the summer and cold in the -winter, but Bluff's climate is less intense; the cold weather is not very -cold, the hot weather is not very hot; and the difference between the -hottest month and the coldest is but 17 degrees Fahrenheit. - -In New Zealand the rabbit plague began at Bluff. The man who introduced -the rabbit there was banqueted and lauded; but they would hang him, now, -if they could get him. In England the natural enemy of the rabbit is -detested and persecuted; in the Bluff region the natural enemy of the -rabbit is honored, and his person is sacred. The rabbit's natural enemy -in England is the poacher, in Bluff its natural enemy is the stoat, the -weasel, the ferret, the cat, and the mongoose. In England any person -below the Heir who is caught with a rabbit in his possession must -satisfactorily explain how it got there, or he will suffer fine and -imprisonment, together with extinction of his peerage; in Bluff, the cat -found with a rabbit in its possession does not have to explain--everybody -looks the other way; the person caught noticing would suffer fine and -imprisonment, with extinction of peerage. This is a sure way to -undermine the moral fabric of a cat. Thirty years from now there will -not be a moral cat in New Zealand. Some think there is none there now. -In England the poacher is watched, tracked, hunted--he dare not show his -face; in Bluff the cat, the weasel, the stoat, and the mongoose go up and -down, whither they will, unmolested. By a law of the legislature, posted -where all may read, it is decreed that any person found in possession of -one of these creatures (dead) must satisfactorily explain the -circumstances or pay a fine of not less than L5, nor more than L20. The -revenue from this source is not large. Persons who want to pay a hundred -dollars for a dead cat are getting rarer and rarer every day. This is -bad, for the revenue was to go to the endowment of a University. All -governments are more or less short-sighted: in England they fine the -poacher, whereas he ought to be banished to New Zealand. New Zealand -would pay his way, and give him wages. - -It was from Bluff that we ought to have cut across to the west coast and -visited the New Zealand Switzerland, a land of superb scenery, made up of -snowy grandeurs, anal mighty glaciers, and beautiful lakes; and over -there, also, are the wonderful rivals of the Norwegian and Alaskan -fiords; and for neighbor, a waterfall of 1,900 feet; but we were obliged -to postpone the trip to some later and indefinite time. - -November 6. A lovely summer morning; brilliant blue sky. A few miles -out from Invercargill, passed through vast level green expanses snowed -over with sheep. Fine to see. The green, deep and very vivid sometimes; -at other times less so, but delicate and lovely. A passenger reminds me -that I am in "the England of the Far South." - -Dunedin, same date. The town justifies Michael Davitt's praises. -The people are Scotch. They stopped here on their way from home to -heaven-thinking they had arrived. The population is stated at 40,000, by -Malcolm Ross, journalist; stated by an M. P. at 60,000. A journalist -cannot lie. - -To the residence of Dr. Hockin. He has a fine collection of books -relating to New Zealand; and his house is a museum of Maori art and -antiquities. He has pictures and prints in color of many native chiefs -of the past--some of them of note in history. There is nothing of the -savage in the faces; nothing could be finer than these men's features, -nothing more intellectual than these faces, nothing more masculine, -nothing nobler than their aspect. The aboriginals of Australia and -Tasmania looked the savage, but these chiefs looked like Roman -patricians. The tattooing in these portraits ought to suggest the -savage, of course, but it does not. The designs are so flowing and -graceful and beautiful that they are a most satisfactory decoration. It -takes but fifteen minutes to get reconciled to the tattooing, and but -fifteen more to perceive that it is just the thing. After that, the -undecorated European face is unpleasant and ignoble. - -Dr. Hockiu gave us a ghastly curiosity--a lignified caterpillar with a -plant growing out of the back of its neck--a plant with a slender stem 4 -inches high. It happened not by accident, but by design--Nature's -design. This caterpillar was in the act of loyally carrying out a law -inflicted upon him by Nature--a law purposely inflicted upon him to get -him into trouble--a law which was a trap; in pursuance of this law he -made the proper preparations for turning himself into a night-moth; that -is to say, he dug a little trench, a little grave, and then stretched -himself out in it on his stomach and partially buried himself--then -Nature was ready for him. She blew the spores of a peculiar fungus -through the air with a purpose. Some of them fell into a crease in the -back of the caterpillar's neck, and began to sprout and grow--for there -was soil there--he had not washed his neck. The roots forced themselves -down into the worm's person, and rearward along through its body, sucking -up the creature's juices for sap; the worm slowly died, and turned to -wood. And here he was now, a wooden caterpillar, with every detail of -his former physique delicately and exactly preserved and perpetuated, and -with that stem standing up out of him for his monument--monument -commemorative of his own loyalty and of Nature's unfair return for it. - -Nature is always acting like that. Mrs. X. said (of course) that the -caterpillar was not conscious and didn't suffer. She should have known -better. No caterpillar can deceive Nature. If this one couldn't suffer, -Nature would have known it and would have hunted up another caterpillar. -Not that she would have let this one go, merely because it was defective. -No. She would have waited and let him turn into a night-moth; and then -fried him in the candle. - -Nature cakes a fish's eyes over with parasites, so that it shan't be able -to avoid its enemies or find its food. She sends parasites into a -star-fish's system, which clog up its prongs and swell them and make them -so uncomfortable that the poor creature delivers itself from the prong to -ease its misery; and presently it has to part with another prong for the -sake of comfort, and finally with a third. If it re-grows the prongs, -the parasite returns and the same thing is repeated. And finally, when -the ability to reproduce prongs is lost through age, that poor old -star-fish can't get around any more, and so it dies of starvation. - -In Australia is prevalent a horrible disease due to an "unperfected -tapeworm." Unperfected--that is what they call it, I do not know why, -for it transacts business just as well as if it were finished and -frescoed and gilded, and all that. - -November 9. To the museum and public picture gallery with the president -of the Society of Artists. Some fine pictures there, lent by the S. of -A. several of them they bought, the others came to them by gift. Next, -to the gallery of the S. of A.--annual exhibition--just opened. Fine. -Think of a town like this having two such collections as this, and a -Society of Artists. It is so all over Australasia. If it were a -monarchy one might understand it. I mean an absolute monarchy, where it -isn't necessary to vote money, but take it. Then art flourishes. But -these colonies are republics--republics with a wide suffrage; voters of -both sexes, this one of New Zealand. In republics, neither the -government nor the rich private citizen is much given to propagating art. -All over Australasia pictures by famous European artists are bought for -the public galleries by the State and by societies of citizens. Living -citizens--not dead ones. They rob themselves to give, not their heirs. -This S. of A. here owns its buildings built it by subscription. - - - - -CHAPTER XXXI. - -The spirit of wrath--not the words--is the sin; and the spirit of wrath -is cursing. We begin to swear before we can talk. - --Pudd'nhead Wilson's New Calendar. - -November 11. On the road. This train-express goes twenty and one-half -miles an hour, schedule time; but it is fast enough, the outlook upon sea -and land is so interesting, and the cars so comfortable. They are not -English, and not American; they are the Swiss combination of the two. -A narrow and railed porch along the side, where a person can walk -up and down. A lavatory in each car. This is progress; this is -nineteenth-century spirit. In New Zealand, these fast expresses run twice -a week. It is well to know this if you want to be a bird and fly through -the country at a 20-mile gait; otherwise you may start on one of the five -wrong days, and then you will get a train that can't overtake its own -shadow. - -By contrast, these pleasant cars call to mind the branch-road cars at -Maryborough, Australia, and the passengers' talk about the branch-road -and the hotel. - -Somewhere on the road to Maryborough I changed for a while to a -smoking-carriage. There were two gentlemen there; both riding backward, -one at each end of the compartment. They were acquaintances of each -other. I sat down facing the one that sat at the starboard window. He -had a good face, and a friendly look, and I judged from his dress that he -was a dissenting minister. He was along toward fifty. Of his own motion -he struck a match, and shaded it with his hand for me to light my cigar. -I take the rest from my diary: - -In order to start conversation I asked him something about Maryborough. -He said, in a most pleasant--even musical voice, but with quiet and -cultured decision: - -"It's a charming town, with a hell of a hotel." - -I was astonished. It seemed so odd to hear a minister swear out loud. -He went placidly on: - -"It's the worst hotel in Australia. Well, one may go further, and say in -Australasia." - -"Bad beds?" - -"No--none at all. Just sand-bags." - -"The pillows, too?" - -"Yes, the pillows, too. Just sand. And not a good quality of sand. It -packs too hard, and has never been screened. There is too much gravel in -it. It is like sleeping on nuts." - -"Isn't there any good sand?" - -"Plenty of it. There is as good bed-sand in this region as the world can -furnish. Aerated sand--and loose; but they won't buy it. They want -something that will pack solid, and petrify." - -"How are the rooms?" - -"Eight feet square; and a sheet of iced oil-cloth to step on in the -morning when you get out of the sand-quarry." - -"As to lights?" - -"Coal-oil lamp." - -"A good one?" - -"No. It's the kind that sheds a gloom." - -"I like a lamp that burns all night." - -"This one won't. You must blow it out early." - -"That is bad. One might want it again in the night. Can't find it in -the dark." - -"There's no trouble; you can find it by the stench." - -"Wardrobe?" - -"Two nails on the door to hang seven suits of clothes on if you've got -them." - -"Bells?" - -"There aren't any." - -"What do you do when you want service?" - -"Shout. But it won't fetch anybody." - -"Suppose you want the chambermaid to empty the slopjar?" - -"There isn't any slop-jar. The hotels don't keep them. That is, outside -of Sydney and Melbourne." - -"Yes, I knew that. I was only talking. It's the oddest thing in -Australia. Another thing: I've got to get up in the dark, in the -morning, to take the 5 o'clock train. Now if the boots----" - -"There isn't any." - -"Well, the porter." - -"There isn't any." - -"But who will call me?" - -"Nobody. You'll call yourself. And you'll light yourself, too. -There'll not be a light burning in the halls or anywhere. And if you -don't carry a light, you'll break your neck." - -"But who will help me down with my baggage?" - -"Nobody. However, I will tell you what to do. In Maryborough there's an -American who has lived there half a lifetime; a fine man, and prosperous -and popular. He will be on the lookout for you; you won't have any -trouble. Sleep in peace; he will rout you out, and you will make your -train. Where is your manager?" - -"I left him at Ballarat, studying the language. And besides, he had to -go to Melbourne and get us ready for New Zealand. I've not tried to -pilot myself before, and it doesn't look easy." - -"Easy! You've selected the very most difficult piece of railroad in -Australia for your experiment. There are twelve miles of this road which -no man without good executive ability can ever hope--tell me, have you -good executive ability? first-rate executive ability?" - -"I--well, I think so, but----" - -"That settles it. The tone of----oh, you wouldn't ever make it in the -world. However, that American will point you right, and you'll go. -You've got tickets?" - -"Yes--round trip; all the way to Sydney." - -"Ah, there it is, you see! You are going in the 5 o'clock by -Castlemaine--twelve miles--instead of the 7.15 by Ballarat--in order to -save two hours of fooling along the road. Now then, don't interrupt--let -me have the floor. You're going to save the government a deal of -hauling, but that's nothing; your ticket is by Ballarat, and it isn't -good over that twelve miles, and so----" - -"But why should the government care which way I go?" - -"Goodness knows! Ask of the winds that far away with fragments strewed -the sea, as the boy that stood on the burning deck used to say. The -government chooses to do its railway business in its own way, and it -doesn't know as much about it as the French. In the beginning they tried -idiots; then they imported the French--which was going backwards, you -see; now it runs the roads itself--which is going backwards again, you -see. Why, do you know, in order to curry favor with the voters, the -government puts down a road wherever anybody wants it--anybody that owns -two sheep and a dog; and by consequence we've got, in the colony of -Victoria, 800 railway stations, and the business done at eighty of them -doesn't foot up twenty shillings a week." - -"Five dollars? Oh, come!" - -"It's true. It's the absolute truth." - -"Why, there are three or four men on wages at every station." - -"I know it. And the station-business doesn't pay for the sheep-dip to -sanctify their coffee with. It's just as I say. And accommodating? -Why, if you shake a rag the train will stop in the midst of the -wilderness to pick you up. All that kind of politics costs, you see. -And then, besides, any town that has a good many votes and wants a fine -station, gets it. Don't you overlook that Maryborough station, if you -take an interest in governmental curiosities. Why, you can put the whole -population of Maryborough into it, and give them a sofa apiece, and have -room for more. You haven't fifteen stations in America that are as big, -and you probably haven't five that are half as fine. Why, it's -perfectly elegant. And the clock! Everybody will show you the clock. -There isn't a station in Europe that's got such a clock. It doesn't -strike--and that's one mercy. It hasn't any bell; and as you'll have -cause to remember, if you keep your reason, all Australia is simply -bedamned with bells. On every quarter-hour, night and day, they jingle a -tiresome chime of half a dozen notes--all the clocks in town at once, all -the clocks in Australasia at once, and all the very same notes; first, -downward scale: mi, re, do, sol--then upward scale: sol, si, re, do--down -again: mi, re, do, sol--up again: sol, si, re, do--then the clock--say at -midnight clang--clang--clang--clang--clang-clang--clang--clang--clang ---clang----and, by that time you're--hello, what's all this excitement -about? a runaway--scared by the train; why, you think this train could -scare anything. Well, when they build eighty stations at a loss and a -lot of palace-stations and clocks like Maryborough's at another loss, the -government has got to economize somewhere hasn't it? Very well look at -the rolling stock. That's where they save the money. Why, that train -from Maryborough will consist of eighteen freight-cars and two -passenger-kennels; cheap, poor, shabby, slovenly; no drinking water, no -sanitary arrangements, every imaginable inconvenience; and slow?--oh, the -gait of cold molasses; no air-brake, no springs, and they'll jolt your -head off every time they start or stop. That's where they make their -little economies, you see. They spend tons of money to house you -palatially while you wait fifteen minutes for a train, then degrade you -to six hours' convict-transportation to get the foolish outlay back. -What a rational man really needs is discomfort while he's waiting, then -his journey in a nice train would be a grateful change. But no, that -would be common sense--and out of place in a government. And then, -besides, they save in that other little detail, you know--repudiate their -own tickets, and collect a poor little illegitimate extra shilling out of -you for that twelve miles, and----" - -"Well, in any case----" - -"Wait--there's more. Leave that American out of the account and see what -would happen. There's nobody on hand to examine your ticket when you -arrive. But the conductor will come and examine it when the train is -ready to start. It is too late to buy your extra ticket now; the train -can't wait, and won't. You must climb out." - -"But can't I pay the conductor?" - -"No, he is not authorized to receive the money, and he won't. You must -climb out. There's no other way. I tell you, the railway management is -about the only thoroughly European thing here--continentally European I -mean, not English. It's the continental business in perfection; down -fine. Oh, yes, even to the peanut-commerce of weighing baggage." - -The train slowed up at his place. As he stepped out he said: - -"Yes, you'll like Maryborough. Plenty of intelligence there. It's a -charming place--with a hell of a hotel." - -Then he was gone. I turned to the other gentleman: - -"Is your friend in the ministry?" - -"No--studying for it." - - - - -CHAPTER XXXII. - -The man with a new idea is a Crank until the idea succeeds. - --Pudd'nhead Wilson's New Calendar. - -It was Junior England all the way to Christchurch--in fact, just a -garden. And Christchurch is an English town, with an English-park annex, -and a winding English brook just like the Avon--and named the Avon; but -from a man, not from Shakespeare's river. Its grassy banks are bordered -by the stateliest and most impressive weeping willows to be found in the -world, I suppose. They continue the line of a great ancestor; they were -grown from sprouts of the willow that sheltered Napoleon's grave in St. -Helena. It is a settled old community, with all the serenities, the -graces, the conveniences, and the comforts of the ideal home-life. If it -had an established Church and social inequality it would be England over -again with hardly a lack. - -In the museum we saw many curious and interesting things; among others a -fine native house of the olden time, with all the details true to the -facts, and the showy colors right and in their proper places. All the -details: the fine mats and rugs and things; the elaborate and wonderful -wood carvings--wonderful, surely, considering who did them wonderful in -design and particularly in execution, for they were done with admirable -sharpness and exactness, and yet with no better tools than flint and jade -and shell could furnish; and the totem-posts were there, ancestor above -ancestor, with tongues protruded and hands clasped comfortably over -bellies containing other people's ancestors--grotesque and ugly devils, -every one, but lovingly carved, and ably; and the stuffed natives were -present, in their proper places, and looking as natural as life; and the -housekeeping utensils were there, too, and close at hand the carved and -finely ornamented war canoe. - -And we saw little jade gods, to hang around the neck--not everybody's, -but sacred to the necks of natives of rank. Also jade weapons, and many -kinds of jade trinkets--all made out of that excessively hard stone -without the help of any tool of iron. And some of these things had small -round holes bored through them--nobody knows how it was done; a mystery, -a lost art. I think it was said that if you want such a hole bored in a -piece of jade now, you must send it to London or Amsterdam where the -lapidaries are. - -Also we saw a complete skeleton of the giant Moa. It stood ten feet -high, and must have been a sight to look at when it was a living bird. -It was a kicker, like the ostrich; in fight it did not use its beak, but -its foot. It must have been a convincing kind of kick. If a person had -his back to the bird and did not see who it was that did it, he would -think he had been kicked by a wind-mill. - -There must have been a sufficiency of moas in the old forgotten days when -his breed walked the earth. His bones are found in vast masses, all -crammed together in huge graves. They are not in caves, but in the -ground. Nobody knows how they happened to get concentrated there. Mind, -they are bones, not fossils. This means that the moa has not been -extinct very long. Still, this is the only New Zealand creature which -has no mention in that otherwise comprehensive literature, the native -legends. This is a significant detail, and is good circumstantial -evidence that the moa has been extinct 500 years, since the Maori has -himself--by tradition--been in New Zealand since the end of the fifteenth -century. He came from an unknown land--the first Maori did--then sailed -back in his canoe and brought his tribe, and they removed the aboriginal -peoples into the sea and into the ground and took the land. That is the -tradition. That that first Maori could come, is understandable, for -anybody can come to a place when he isn't trying to; but how that -discoverer found his way back home again without a compass is his secret, -and he died with it in him. His language indicates that he came from -Polynesia. He told where he came from, but he couldn't spell well, so -one can't find the place on the map, because people who could spell -better than he could, spelt the resemblance all out of it when they made -the map. However, it is better to have a map that is spelt right than -one that has information in it. - -In New Zealand women have the right to vote for members of the -legislature, but they cannot be members themselves. The law extending -the suffrage to them event into effect in 1893. The population of -Christchurch (census of 1891) was 31,454. The first election under the -law was held in November of that year. Number of men who voted, 6,313; -number of women who voted, 5,989. These figures ought to convince us -that women are not as indifferent about politics as some people would -have us believe. In New Zealand as a whole, the estimated adult female -population was 139,915; of these 109,461 qualified and registered their -names on the rolls 78.23 per cent. of the whole. Of these, 90,290 went -to the polls and voted--85.18 per cent. Do men ever turn out better than -that--in America or elsewhere? Here is a remark to the other sex's -credit, too--I take it from the official report: - -"A feature of the election was the orderliness and sobriety of the -people. Women were in no way molested." - -At home, a standing argument against woman suffrage has always been that -women could not go to the polls without being insulted. The arguments -against woman suffrage have always taken the easy form of prophecy. The -prophets have been prophesying ever since the woman's rights movement -began in 1848--and in forty-seven years they have never scored a hit. - -Men ought to begin to feel a sort of respect for their mothers and wives -and sisters by this time. The women deserve a change of attitude like -that, for they have wrought well. In forty-seven years they have swept -an imposingly large number of unfair laws from the statute books of -America. In that brief time these serfs have set themselves free -essentially. Men could not have done so much for themselves in that time -without bloodshed--at least they never have; and that is argument that -they didn't know how. The women have accomplished a peaceful revolution, -and a very beneficent one; and yet that has not convinced the average man -that they are intelligent, and have courage and energy and perseverance -and fortitude. It takes much to convince the average man of anything; -and perhaps nothing can ever make him realize that he is the average -woman's inferior--yet in several important details the evidences seems to -show that that is what he is. Man has ruled the human race from the -beginning--but he should remember that up to the middle of the present -century it was a dull world, and ignorant and stupid; but it is not such -a dull world now, and is growing less and less dull all the time. This -is woman's opportunity--she has had none before. I wonder where man will -be in another forty-seven years? - -In the New Zealand law occurs this: "The word person wherever it occurs -throughout the Act includes woman." - -That is promotion, you see. By that enlargement of the word, the matron -with the garnered wisdom and experience of fifty years becomes at one -jump the political equal of her callow kid of twenty-one. The white -population of the colony is 626,000, the Maori population is 42,000. The -whites elect seventy members of the House of Representatives, the Maoris -four. The Maori women vote for their four members. - -November 16. After four pleasant days in Christchurch, we are to leave -at midnight to-night. Mr. Kinsey gave me an ornithorhynchus, and I am -taming it. - -Sunday, 17th. Sailed last night in the Flora, from Lyttelton. - -So we did. I remember it yet. The people who sailed in the Flora that -night may forget some other things if they live a good while, but they -will not live long, enough to forget that. The Flora is about the -equivalent of a cattle-scow; but when the Union Company find it -inconvenient to keep a contract and lucrative to break it, they smuggle -her into passenger service, and "keep the change." - -They give no notice of their projected depredation; you innocently buy -tickets for the advertised passenger boat, and when you get down to -Lyttelton at midnight, you find that they have substituted the scow. -They have plenty of good boats, but no competition--and that is the -trouble. It is too late now to make other arrangements if you have -engagements ahead. - -It is a powerful company, it has a monopoly, and everybody is afraid of -it--including the government's representative, who stands at the end of -the stage-plank to tally the passengers and see that no boat receives a -greater number than the law allows her to carry. This conveniently-blind -representative saw the scow receive a number which was far in excess of -its privilege, and winked a politic wink and said nothing. The -passengers bore with meekness the cheat which had been put upon them, and -made no complaint. - -It was like being at home in America, where abused passengers act in just -the same way. A few days before, the Union Company had discharged a -captain for getting a boat into danger, and had advertised this act as -evidence of its vigilance in looking after the safety of the passengers ---for thugging a captain costs the company nothing, but when opportunity -offered to send this dangerously overcrowded tub to sea and save a little -trouble and a tidy penny by it, it forgot to worry about the passenger's -safety. - -The first officer told me that the Flora was privileged to carry 125 -passengers. She must have had all of 200 on board. All the cabins were -full, all the cattle-stalls in the main stable were full, the spaces at -the heads of companionways were full, every inch of floor and table in -the swill-room was packed with sleeping men and remained so until the -place was required for breakfast, all the chairs and benches on the -hurricane deck were occupied, and still there were people who had to walk -about all night! - -If the Flora had gone down that night, half of the people on board would -have been wholly without means of escape. - -The owners of that boat were not technically guilty of conspiracy to -commit murder, but they were morally guilty of it. - -I had a cattle-stall in the main stable--a cavern fitted up with a long -double file of two-storied bunks, the files separated by a calico -partition--twenty men and boys on one side of it, twenty women and girls -on the other. The place was as dark as the soul of the Union Company, -and smelt like a kennel. When the vessel got out into the heavy seas and -began to pitch and wallow, the cavern prisoners became immediately -seasick, and then the peculiar results that ensued laid all my previous -experiences of the kind well away in the shade. And the wails, the -groans, the cries, the shrieks, the strange ejaculations--it was -wonderful. - -The women and children and some of the men and boys spent the night in -that place, for they were too ill to leave it; but the rest of us got up, -by and by, and finished the night on the hurricane-deck. - -That boat was the foulest I was ever in; and the smell of the breakfast -saloon when we threaded our way among the layers of steaming passengers -stretched upon its floor and its tables was incomparable for efficiency. - -A good many of us got ashore at the first way-port to seek another ship. -After a wait of three hours we got good rooms in the Mahinapua, a wee -little bridal-parlor of a boat--only 205 tons burthen; clean and -comfortable; good service; good beds; good table, and no crowding. The -seas danced her about like a duck, but she was safe and capable. - -Next morning early she went through the French Pass--a narrow gateway of -rock, between bold headlands--so narrow, in fact, that it seemed no wider -than a street. The current tore through there like a mill-race, and the -boat darted through like a telegram. The passage was made in half a -minute; then we were in a wide place where noble vast eddies swept -grandly round and round in shoal water, and I wondered what they would do -with the little boat. They did as they pleased with her. They picked -her up and flung her around like nothing and landed her gently on the -solid, smooth bottom of sand--so gently, indeed, that we barely felt her -touch it, barely felt her quiver when she came to a standstill. The -water was as clear as glass, the sand on the bottom was vividly distinct, -and the fishes seemed to be swimming about in nothing. Fishing lines -were brought out, but before we could bait the hooks the boat was off and -away again. - - - - -CHAPTER XXXIII. - -Let us be grateful to Adam our benefactor. He cut us out of the -"blessing of idleness," and won for us the "curse of labor." - --Pudd'nhead Wilson's New Calendar. - -We soon reached the town of Nelson, and spent the most of the day there, -visiting acquaintances and driving with them about the garden--the whole -region is a garden, excepting the scene of the "Maungatapu Murders," of -thirty years ago. That is a wild place--wild and lonely; an ideal place -for a murder. It is at the base of a vast, rugged, densely timbered -mountain. In the deep twilight of that forest solitude four desperate -rascals--Burgess, Sullivan, Levy, and Kelley--ambushed themselves beside -the mountain-trail to murder and rob four travelers--Kempthorne, Mathieu, -Dudley, and De Pontius, the latter a New Yorker. A harmless old laboring -man came wandering along, and as his presence was an embarrassment, they -choked him, hid him, and then resumed their watch for the four. They had -to wait a while, but eventually everything turned out as they desired. - -That dark episode is the one large event in the history of Nelson. The -fame of it traveled far. Burgess made a confession. It is a remarkable -paper. For brevity, succinctness, and concentration, it is perhaps -without its peer in the literature of murder. There are no waste words -in it; there is no obtrusion of matter not pertinent to the occasion, nor -any departure from the dispassionate tone proper to a formal business -statement--for that is what it is: a business statement of a murder, by -the chief engineer of it, or superintendent, or foreman, or whatever one -may prefer to call him. - - "We were getting impatient, when we saw four men and a pack-horse - coming. I left my cover and had a look at the men, for Levy had - told me that Mathieu was a small man and wore a large beard, and - that it was a chestnut horse. I said, 'Here they come.' They were - then a good distance away; I took the caps off my gun, and put fresh - ones on. I said, 'You keep where you are, I'll put them up, and you - give me your gun while you tie them.' It was arranged as I have - described. The men came; they arrived within about fifteen yards - when I stepped up and said, 'Stand! bail up!' That means all of - them to get together. I made them fall back on the upper side of - the road with their faces up the range, and Sullivan brought me his - gun, and then tied their hands behind them. The horse was very - quiet all the time, he did not move. When they were all tied, - Sullivan took the horse up the hill, and put him in the bush; he cut - the rope and let the swags--[A "swag" is a kit, a pack, small - baggage.]--fall on the ground, and then came to me. We then marched - the men down the incline to the creek; the water at this time barely - running. Up this creek we took the men; we went, I daresay, five or - six hundred yards up it, which took us nearly half-an-hour to - accomplish. Then we turned to the right up the range; we went, I - daresay, one hundred and fifty yards from the creek, and there we - sat down with the men. I said to Sullivan, 'Put down your gun and - search these men,' which he did. I asked them their several names; - they told me. I asked them if they were expected at Nelson. They - said, 'No.' If such their lives would have been spared. In money - we took L60 odd. I said, 'Is this all you have? You had better - tell me.' Sullivan said, 'Here is a bag of gold.' I said, 'What's on - that pack-horse? Is there any gold ?' when Kempthorne said, 'Yes, - my gold is in the portmanteau, and I trust you will not take it - all.' 'Well,' I said, 'we must take you away one at a time, because - the range is steep just here, and then we will let you go.' They - said, 'All right,' most cheerfully. We tied their feet, and took - Dudley with us; we went about sixty yards with him. This was - through a scrub. It was arranged the night previously that it would - be best to choke them, in case the report of the arms might be heard - from the road, and if they were missed they never would be found. - So we tied a handkerchief over his eyes, when Sullivan took the sash - off his waist, put it round his neck, and so strangled him. - Sullivan, after I had killed the old laboring man, found fault with - the way he was choked. He said, 'The next we do I'll show you my - way.' I said, 'I have never done such a thing before. I have shot - a man, but never choked one.' We returned to the others, when - Kempthorne said, 'What noise was that?' I said it was caused by - breaking through the scrub. This was taking too much time, so it - was agreed to shoot them. With that I said, 'We'll take you no - further, but separate you, and then loose one of you, and he can - relieve the others.' So with that, Sullivan took De Pontius to the - left of where Kempthorne was sitting. I took Mathieu to the right. - I tied a strap round his legs, and shot him with a revolver. He - yelled, I ran from him with my gun in my hand, I sighted Kempthorne, - who had risen to his feet. I presented the gun, and shot him behind - the right ear; his life's blood welled from him, and he died - instantaneously. Sullivan had shot. De Pontius in the meantime, - and then came to me. I said, 'Look to Mathieu,' indicating the spot - where he lay. He shortly returned and said, 'I had to "chiv" that - fellow, he was not dead,' a cant word, meaning that he had to stab - him. Returning to the road we passed where De Pontius lay and was - dead. Sullivan said, 'This is the digger, the others were all - storekeepers; this is the digger, let's cover him up, for should the - others be found, they'll think he done it and sloped,' meaning he - had gone. So with that we threw all the stones on him, and then - left him. This bloody work took nearly an hour and a half from the - time we stopped the men." - -Anyone who reads that confession will think that the man who wrote it was -destitute of emotions, destitute of feeling. That is partly true. As -regarded others he was plainly without feeling--utterly cold and -pitiless; but as regarded himself the case was different. While he cared -nothing for the future of the murdered men, he cared a great deal for his -own. It makes one's flesh creep to read the introduction to his -confession. The judge on the bench characterized it as "scandalously -blasphemous," and it certainly reads so, but Burgess meant no blasphemy. -He was merely a brute, and whatever he said or wrote was sure to expose -the fact. His redemption was a very real thing to him, and he was as -jubilantly happy on the gallows as ever was Christian martyr at the -stake. We dwellers in this world are strangely made, and mysteriously -circumstanced. We have to suppose that the murdered men are lost, and -that Burgess is saved; but we cannot suppress our natural regrets. - - "Written in my dungeon drear this 7th of August, in the year of - Grace, 1866. To God be ascribed all power and glory in subduing the - rebellious spirit of a most guilty wretch, who has been brought, - through the instrumentality of a faithful follower of Christ, to see - his wretched and guilty state, inasmuch as hitherto he has led an - awful and wretched life, and through the assurance of this faithful - soldier of Christ, he has been led and also believes that Christ - will yet receive and cleanse him from all his deep-dyed and bloody - sins. I lie under the imputation which says, 'Come now and let us - reason together, saith the Lord: though your sins be as scarlet, - they shall be as white as snow; though they be red like crimson, - they shall be as wool.' On this promise I rely." - -We sailed in the afternoon late, spent a few hours at New Plymouth, then -sailed again and reached Auckland the next day, November 20th, and -remained in that fine city several days. Its situation is commanding, -and the sea-view is superb. There are charming drives all about, and by -courtesy of friends we had opportunity to enjoy them. From the grassy -crater-summit of Mount Eden one's eye ranges over a grand sweep and -variety of scenery--forests clothed in luxuriant foliage, rolling green -fields, conflagrations of flowers, receding and dimming stretches of -green plain, broken by lofty and symmetrical old craters--then the blue -bays twinkling and sparkling away into the dreamy distances where the -mountains loom spiritual in their veils of haze. - -It is from Auckland that one goes to Rotorua, the region of the renowned -hot lakes and geysers--one of the chief wonders of New Zealand; but I was -not well enough to make the trip. The government has a sanitorium there, -and everything is comfortable for the tourist and the invalid. The -government's official physician is almost over-cautious in his estimates -of the efficacy of the baths, when he is talking about rheumatism, gout, -paralysis, and such things; but when he is talking about the -effectiveness of the waters in eradicating the whisky-habit, he seems to -have no reserves. The baths will cure the drinking-habit no matter how -chronic it is--and cure it so effectually that even the desire to drink -intoxicants will come no more. There should be a rush from Europe and -America to that place; and when the victims of alcoholism find out what -they can get by going there, the rush will begin. - -The Thermal-springs District of New Zealand comprises an area of upwards -of 600,000 acres, or close on 1,000 square miles. Rotorua is the -favorite place. It is the center of a rich field of lake and mountain -scenery; from Rotorua as a base the pleasure-seeker makes excursions. -The crowd of sick people is great, and growing. Rotorua is the Carlsbad -of Australasia. - -It is from Auckland that the Kauri gum is shipped. For a long time now -about 8,000 tons of it have been brought into the town per year. It is -worth about $300 per ton, unassorted; assorted, the finest grades are -worth about $1,000. It goes to America, chiefly. It is in lumps, and is -hard and smooth, and looks like amber--the light-colored like new amber, -and the dark brown like rich old amber. And it has the pleasant feel of -amber, too. Some of the light-colored samples were a tolerably fair -counterfeit of uncut South African diamonds, they were so perfectly -smooth and polished and transparent. It is manufactured into varnish; a -varnish which answers for copal varnish and is cheaper. - -The gum is dug up out of the ground; it has been there for ages. It is -the sap of the Kauri tree. Dr. Campbell of Auckland told me he sent a -cargo of it to England fifty years ago, but nothing came of the venture. -Nobody knew what to do with it; so it was sold at 15 a ton, to light -fires with. - -November 26--3 P.M., sailed. Vast and beautiful harbor. Land all about -for hours. Tangariwa, the mountain that "has the same shape from every -point of view." That is the common belief in Auckland. And so it has ---from every point of view except thirteen. Perfect summer weather. Large -school of whales in the distance. Nothing could be daintier than the -puffs of vapor they spout up, when seen against the pink glory of the -sinking sun, or against the dark mass of an island reposing in the deep -blue shadow of a storm cloud . . . . Great Barrier rock standing up -out of the sea away to the left. Sometime ago a ship hit it full speed -in a fog--20 miles out of her course--140 lives lost; the captain -committed suicide without waiting a moment. He knew that, whether he was -to blame or not, the company owning the vessel would discharge him and -make a devotion--to--passengers' safety advertisement out of it, and his -chance to make a livelihood would be permanently gone. - - - - -CHAPTER XXXIV. - -Let us not be too particular. It is better to have old second-hand -diamonds than none at all. - --Pudd'nhead Wilson's New Calendar. - -November 27. To-day we reached Gisborne, and anchored in a big bay; -there was a heavy sea on, so we remained on board. - -We were a mile from shore; a little steam-tug put out from the land; she -was an object of thrilling interest; she would climb to the summit of a -billow, reel drunkenly there a moment, dim and gray in the driving storm -of spindrift, then make a plunge like a diver and remain out of sight -until one had given her up, then up she would dart again, on a steep -slant toward the sky, shedding Niagaras of water from her forecastle--and -this she kept up, all the way out to us. She brought twenty-five -passengers in her stomach--men and women mainly a traveling dramatic -company. In sight on deck were the crew, in sou'westers, yellow -waterproof canvas suits, and boots to the thigh. The deck was never -quiet for a moment, and seldom nearer level than a ladder, and noble were -the seas which leapt aboard and went flooding aft. We rove a long line -to the yard-arm, hung a most primitive basketchair to it and swung it out -into the spacious air of heaven, and there it swayed, pendulum-fashion, -waiting for its chance--then down it shot, skillfully aimed, and was -grabbed by the two men on the forecastle. A young fellow belonging to -our crew was in the chair, to be a protection to the lady-comers. At -once a couple of ladies appeared from below, took seats in his lap, we -hoisted them into the sky, waited a moment till the roll of the ship -brought them in overhead, then we lowered suddenly away, and seized the -chair as it struck the deck. We took the twenty-five aboard, and -delivered twenty-five into the tug--among them several aged ladies, and -one blind one--and all without accident. It was a fine piece of work. - -Ours is a nice ship, roomy, comfortable, well-ordered, and satisfactory. -Now and then we step on a rat in a hotel, but we have had no rats on -shipboard lately; unless, perhaps in the Flora; we had more serious -things to think of there, and did not notice. I have noticed that it is -only in ships and hotels which still employ the odious Chinese gong, that -you find rats. The reason would seem to be, that as a rat cannot tell -the time of day by a clock, he won't stay where he cannot find out when -dinner is ready. - -November 29. The doctor tells me of several old drunkards, one -spiritless loafer, and several far-gone moral wrecks who have been -reclaimed by the Salvation Army and have remained staunch people and hard -workers these two years. Wherever one goes, these testimonials to the -Army's efficiency are forthcoming . . . . This morning we had one of -those whizzing green Ballarat flies in the room, with his stunning -buzz-saw noise--the swiftest creature in the world except the -lightning-flash. It is a stupendous force that is stored up in that -little body. If we had it in a ship in the same proportion, we could spin -from Liverpool to New York in the space of an hour--the time it takes to -eat luncheon. The New Zealand express train is called the Ballarat Fly -. . . . Bad teeth in the colonies. A citizen told me they don't have -teeth filled, but pull them out and put in false ones, and that now and -then one sees a young lady with a full set. She is fortunate. I wish I -had been born with false teeth and a false liver and false carbuncles. -I should get along better. - -December 2. Monday. Left Napier in the Ballarat Fly the one that goes -twice a week. From Napier to Hastings, twelve miles; time, fifty-five -minutes--not so far short of thirteen miles an hour . . . . A perfect -summer day; cool breeze, brilliant sky, rich vegetation. Two or three -times during the afternoon we saw wonderfully dense and beautiful -forests, tumultuously piled skyward on the broken highlands--not the -customary roof-like slant of a hillside, where the trees are all the same -height. The noblest of these trees were of the Kauri breed, we were told -the timber that is now furnishing the wood-paving for Europe, and is the -best of all wood for that purpose. Sometimes these towering upheavals of -forestry were festooned and garlanded with vine-cables, and sometimes the -masses of undergrowth were cocooned in another sort of vine of a delicate -cobwebby texture--they call it the "supplejack," I think. Tree ferns -everywhere--a stem fifteen feet high, with a graceful chalice of -fern-fronds sprouting from its top--a lovely forest ornament. And there -was a ten-foot reed with a flowing suit of what looked like yellow hair -hanging from its upper end. I do not know its name, but if there is such -a thing as a scalp-plant, this is it. A romantic gorge, with a brook -flowing in its bottom, approaching Palmerston North. - -Waitukurau. Twenty minutes for luncheon. With me sat my wife and -daughter, and my manager, Mr. Carlyle Smythe. I sat at the head of the -table, and could see the right-hand wall; the others had their backs to -it. On that wall, at a good distance away, were a couple of framed -pictures. I could not see them clearly, but from the groupings of the -figures I fancied that they represented the killing of Napoleon III's son -by the Zulus in South Africa. I broke into the conversation, which was -about poetry and cabbage and art, and said to my wife-- - -"Do you remember when the news came to Paris----" - -"Of the killing of the Prince?" - -(Those were the very words I had in my mind.) "Yes, but what Prince?" - -"Napoleon. Lulu." - -"What made you think of that?" - -"I don't know." - -There was no collusion. She had not seen the pictures, and they had not -been mentioned. She ought to have thought of some recent news that came -to Paris, for we were but seven months from there and had been living -there a couple of years when we started on this trip; but instead of that -she thought of an incident of our brief sojourn in Paris of sixteen years -before. - -Here was a clear case of mental telegraphy; of mind-transference; of my -mind telegraphing a thought into hers. How do I know? Because I -telegraphed an error. For it turned out that the pictures did not -represent the killing of Lulu at all, nor anything connected with Lulu. -She had to get the error from my head--it existed nowhere else. - - - - -CHAPTER XXXV. - -The Autocrat of Russia possesses more power than any other man in the -earth; but he cannot stop a sneeze. - --Pudd'nhead Wilson's New Calendar. - -WAUGANIUI, December 3. A pleasant trip, yesterday, per Ballarat Fly. -Four hours. I do not know the distance, but it must have been well along -toward fifty miles. The Fly could have spun it out to eight hours and -not discommoded me; for where there is comfort, and no need for hurry, -speed is of no value--at least to me; and nothing that goes on wheels can -be more comfortable, more satisfactory, than the New Zealand trains. -Outside of America there are no cars that are so rationally devised. -When you add the constant presence of charming scenery and the nearly -constant absence of dust--well, if one is not content then, he ought to -get out and walk. That would change his spirit, perhaps? I think so. -At the end of an hour you would find him waiting humbly beside the track, -and glad to be taken aboard again. - -Much horseback riding, in and around this town; many comely girls in cool -and pretty summer gowns; much Salvation Army; lots of Maoris; the faces -and bodies of some of the old ones very tastefully frescoed. Maori -Council House over the river-large, strong, carpeted from end to end with -matting, and decorated with elaborate wood carvings, artistically -executed. The Maoris were very polite. - -I was assured by a member of the House of Representatives that the native -race is not decreasing, but actually increasing slightly. It is another -evidence that they are a superior breed of savages. I do not call to -mind any savage race that built such good houses, or such strong and -ingenious and scientific fortresses, or gave so much attention to -agriculture, or had military arts and devices which so nearly approached -the white man's. These, taken together with their high abilities in -boat-building, and their tastes and capacities in the ornamental arts -modify their savagery to a semi-civilization--or at least to, -a quarter-civilization. - -It is a compliment to them that the British did not exterminate them, as -they did the Australians and the Tasmanians, but were content with -subduing them, and showed no desire to go further. And it is another -compliment to them that the British did not take the whole of their -choicest lands, but left them a considerable part, and then went further -and protected them from the rapacities of landsharks--a protection which -the New Zealand Government still extends to them. And it is still -another compliment to the Maoris that the Government allows native -representation--in both the legislature and the cabinet, and gives both -sexes the vote. And in doing these things the Government also -compliments itself; it has not been the custom of the world for -conquerors to act in this large spirit toward the conquered. - -The highest class white men Who lived among the Maoris in the earliest -time had a high opinion of them and a strong affection for them. Among -the whites of this sort was the author of "Old New Zealand;" and Dr. -Campbell of Auckland was another. Dr. Campbell was a close friend of -several chiefs, and has many pleasant things to say of their fidelity, -their magnanimity, and their generosity. Also of their quaint notions -about the white man's queer civilization, and their equally quaint -comments upon it. One of them thought the missionary had got everything -wrong end first and upside down. "Why, he wants us to stop worshiping -and supplicating the evil gods, and go to worshiping and supplicating the -Good One! There is no sense in that. A good god is not going to do us -any harm." - -The Maoris had the tabu; and had it on a Polynesian scale of -comprehensiveness and elaboration. Some of its features could have been -importations from India and Judea. Neither the Maori nor the Hindoo of -common degree could cook by a fire that a person of higher caste had -used, nor could the high Maori or high Hindoo employ fire that had served -a man of low grade; if a low-grade Maori or Hindoo drank from a vessel -belonging to a high-grade man, the vessel was defiled, and had to be -destroyed. There were other resemblances between Maori tabu and Hindoo -caste-custom. - -Yesterday a lunatic burst into my quarters and warned me that the Jesuits -were going to "cook" (poison) me in my food, or kill me on the stage at -night. He said a mysterious sign was visible upon my posters and meant -my death. He said he saved Rev. Mr. Haweis's life by warning him that -there were three men on his platform who would kill him if he took his -eyes off them for a moment during his lecture. The same men were in my -audience last night, but they saw that he was there. "Will they be there -again to-night?" He hesitated; then said no, he thought they would -rather take a rest and chance the poison. This lunatic has no delicacy. -But he was not uninteresting. He told me a lot of things. He said he -had "saved so many lecturers in twenty years, that they put him in the -asylum." I think he has less refinement than any lunatic I have met. - -December 8. A couple of curious war-monuments here at Wanganui. One is -in honor of white men "who fell in defence of law and order against -fanaticism and barbarism." Fanaticism. We Americans are English in -blood, English in speech, English in religion, English in the essentials -of our governmental system, English in the essentials of our -civilization; and so, let us hope, for the honor of the blend, for the -honor of the blood, for the honor of the race, that that word got there -through lack of heedfulness, and will not be suffered to remain. If you -carve it at Thermopylae, or where Winkelried died, or upon Bunker Hill -monument, and read it again "who fell in defence of law and order against -fanaticism" you will perceive what the word means, and how mischosen it -is. Patriotism is Patriotism. Calling it Fanaticism cannot degrade it; -nothing can degrade it. Even though it be a political mistake, and a -thousand times a political mistake, that does not affect it; it is -honorable always honorable, always noble--and privileged to hold its head -up and look the nations in the face. It is right to praise these brave -white men who fell in the Maori war--they deserve it; but the presence of -that word detracts from the dignity of their cause and their deeds, and -makes them appear to have spilt their blood in a conflict with ignoble -men, men not worthy of that costly sacrifice. But the men were worthy. -It was no shame to fight them. They fought for their homes, they fought -for their country; they bravely fought and bravely fell; and it would -take nothing from the honor of the brave Englishmen who lie under the -monument, but add to it, to say that they died in defense of English laws -and English homes against men worthy of the sacrifice--the Maori -patriots. - -The other monument cannot be rectified. Except with dynamite. It is a -mistake all through, and a strangely thoughtless one. It is a monument -erected by white men to Maoris who fell fighting with the whites and -against their own people, in the Maori war. "Sacred to the memory of the -brave men who fell on the 14th of May, 1864," etc. On one side are the -names of about twenty Maoris. It is not a fancy of mine; the monument -exists. I saw it. It is an object-lesson to the rising generation. It -invites to treachery, disloyalty, unpatriotism. Its lesson, in frank -terms is, "Desert your flag, slay your people, burn their homes, shame -your nationality--we honor such." - -December 9. Wellington. Ten hours from Wanganui by the Fly. -December 12. It is a fine city and nobly situated. A busy place, and -full of life and movement. Have spent the three days partly in walking -about, partly in enjoying social privileges, and largely in idling around -the magnificent garden at Hutt, a little distance away, around the shore. -I suppose we shall not see such another one soon. - -We are packing to-night for the return-voyage to Australia. Our stay in -New Zealand has been too brief; still, we are not unthankful for the -glimpse which we have had of it. - -The sturdy Maoris made the settlement of the country by the whites rather -difficult. Not at first--but later. At first they welcomed the whites, -and were eager to trade with them--particularly for muskets; for their -pastime was internecine war, and they greatly preferred the white man's -weapons to their own. War was their pastime--I use the word advisedly. -They often met and slaughtered each other just for a lark, and when there -was no quarrel. The author of "Old New Zealand" mentions a case where a -victorious army could have followed up its advantage and exterminated the -opposing army, but declined to do it; explaining naively that "if we did -that, there couldn't be any more fighting." In another battle one army -sent word that it was out of ammunition, and would be obliged to stop -unless the opposing army would send some. It was sent, and the fight -went on. - -In the early days things went well enough. The natives sold land without -clearly understanding the terms of exchange, and the whites bought it -without being much disturbed about the native's confusion of mind. But -by and by the Maori began to comprehend that he was being wronged; then -there was trouble, for he was not the man to swallow a wrong and go aside -and cry about it. He had the Tasmanian's spirit and endurance, and a -notable share of military science besides; and so he rose against the -oppressor, did this gallant "fanatic," and started a war that was not -brought to a definite end until more than a generation had sped. - - - - -CHAPTER XXXVI. - -There are several good protections against temptations, but the surest is -cowardice. - --Pudd'nhead Wilson's New Calendar. - -Names are not always what they seem. The common Welsh name Bzjxxllwep is -pronounced Jackson. - --Pudd'nhead Wilson's New Calendar. - -Friday, December 13. Sailed, at 3 p.m., in the 'Mararoa'. Summer seas -and a good ship-life has nothing better. - -Monday. Three days of paradise. Warm and sunny and smooth; the sea a -luminous Mediterranean blue . . . . One lolls in a long chair all day -under deck-awnings, and reads and smokes, in measureless content. One -does not read prose at such a time, but poetry. I have been reading the -poems of Mrs. Julia A. Moore, again, and I find in them the same grace -and melody that attracted me when they were first published, twenty years -ago, and have held me in happy bonds ever since. - -"The Sentimental Song Book" has long been out of print, and has been -forgotten by the world in general, but not by me. I carry it with me -always--it and Goldsmith's deathless story. - -Indeed, it has the same deep charm for me that the Vicar of Wakefield -has, and I find in it the same subtle touch--the touch that makes an -intentionally humorous episode pathetic and an intentionally pathetic one -funny. In her time Mrs. Moore was called "the Sweet Singer of Michigan," -and was best known by that name. I have read her book through twice -today, with the purpose of determining which of her pieces has most -merit, and I am persuaded that for wide grasp and sustained power, -"William Upson" may claim first place: - -WILLIAM UPSON. - -Air--"The Major's Only Son." -Come all good people far and near, -Oh, come and see what you can hear, -It's of a young man true and brave, -That is now sleeping in his grave. - -Now, William Upson was his name -If it's not that, it's all the same -He did enlist in a cruel strife, -And it caused him to lose his life. - -He was Perry Upson's eldest son, -His father loved his noble son, -This son was nineteen years of age -When first in the rebellion he engaged. - -His father said that he might go, -But his dear mother she said no, -"Oh! stay at home, dear Billy," she said, -But she could not turn his head. - -He went to Nashville, in Tennessee, -There his kind friends he could not see; -He died among strangers, so far away, -They did not know where his body lay. - -He was taken sick and lived four weeks, -And Oh! how his parents weep, -But now they must in sorrow mourn, -For Billy has gone to his heavenly home. - -Oh! if his mother could have seen her son, -For she loved him, her darling son; -If she could heard his dying prayer, -It would ease her heart till she met him there. - -How it would relieve his mother's heart -To see her son from this world depart, -And hear his noble words of love, -As he left this world for that above. - -Now it will relieve his mother's heart, -For her son is laid in our graveyard; -For now she knows that his grave is near, -She will not shed so many tears. - -Although she knows not that it was her son, -For his coffin could not be opened -It might be someone in his place, -For she could not see his noble face. - - -December, 17. Reached Sydney. - -December, 19. In the train. Fellow of 30 with four valises; a slim -creature, with teeth which made his mouth look like a neglected -churchyard. He had solidified hair--solidified with pomatum; it was all -one shell. He smoked the most extraordinary cigarettes--made of some -kind of manure, apparently. These and his hair made him smell like the -very nation. He had a low-cut vest on, which exposed a deal of frayed -and broken and unclean shirtfront. Showy studs, of imitation gold--they -had made black disks on the linen. Oversized sleeve buttons of imitation -gold, the copper base showing through. Ponderous watch-chain of -imitation gold. I judge that he couldn't tell the time by it, for he -asked Smythe what time it was, once. He wore a coat which had been gay -when it was young; 5-o'clock-tea-trousers of a light tint, and -marvelously soiled; yellow mustache with a dashing upward whirl at the -ends; foxy shoes, imitation patent leather. He was a novelty--an -imitation dude. He would have been a real one if he could have afforded -it. But he was satisfied with himself. You could see it in his -expression, and in all his attitudes and movements. He was living in a -dude dreamland where all his squalid shams were genuine, and himself a -sincerity. It disarmed criticism, it mollified spite, to see him so -enjoy his imitation languors, and arts, and airs, and his studied -daintinesses of gesture and misbegotten refinements. It was plain to me -that he was imagining himself the Prince of Wales, and was doing -everything the way he thought the Prince would do it. For bringing his -four valises aboard and stowing them in the nettings, he gave his porter -four cents, and lightly apologized for the smallness of the gratuity ---just with the condescendingest little royal air in the world. He -stretched himself out on the front seat and rested his pomatum-cake on -the middle arm, and stuck his feet out of the window, and began to pose -as the Prince and work his dreams and languors for exhibition; and he -would indolently watch the blue films curling up from his cigarette, and -inhale the stench, and look so grateful; and would flip the ash away with -the daintiest gesture, unintentionally displaying his brass ring in the -most intentional way; why, it was as good as being in Marlborough House -itself to see him do it so like. - -There was other scenery in the trip. That of the Hawksbury river, in the -National Park region, fine--extraordinarily fine, with spacious views of -stream and lake imposingly framed in woody hills; and every now and then -the noblest groupings of mountains, and the most enchanting -rearrangements of the water effects. Further along, green flats, thinly -covered with gum forests, with here and there the huts and cabins of -small farmers engaged in raising children. Still further along, arid -stretches, lifeless and melancholy. Then Newcastle, a rushing town, -capital of the rich coal regions. Approaching Scone, wide farming and -grazing levels, with pretty frequent glimpses of a troublesome plant--a -particularly devilish little prickly pear, daily damned in the orisons of -the agriculturist; imported by a lady of sentiment, and contributed -gratis to the colony. Blazing hot, all day. - -December 20. Back to Sydney. Blazing hot again. From the newspaper, -and from the map, I have made a collection of curious names of -Australasian towns, with the idea of making a poem out of them: - -Tumut -Takee -Murriwillumba -Bowral -Ballarat -Mullengudgery -Murrurundi -Wagga-Wagga -Wyalong -Murrumbidgee -Goomeroo -Wolloway -Wangary -Wanilla -Worrow -Koppio -Yankalilla -Yaranyacka -Yackamoorundie -Kaiwaka -Coomooroo -Tauranga -Geelong -Tongariro -Kaikoura -Wakatipu -Oohipara -Waitpinga -Goelwa -Munno Para -Nangkita -Myponga -Kapunda -Kooringa -Penola -Nangwarry -Kongorong -Comaum -Koolywurtie -Killanoola -Naracoorte -Muloowurtie -Binnum -Wallaroo -Wirrega -Mundoora -Hauraki -Rangiriri -Teawamute -Taranaki -Toowoomba -Goondiwindi -Jerrilderie -Whangaroa -Wollongong -Woolloomooloo -Bombola -Coolgardie -Bendigo -Coonamble -Cootamundra -Woolgoolga - -Mittagong -Jamberoo -Kondoparinga -Kuitpo -Tungkillo -Oukaparinga -Talunga -Yatala -Parawirra -Moorooroo -Whangarei -Woolundunga -Booleroo -Pernatty -Parramatta -Taroom -Narrandera -Deniliquin -Kawakawa. - - -It may be best to build the poem now, and make the weather help - - A SWELTERING DAY IN AUSTRALIA. - - (To be read soft and low, with the lights turned down.) - - The Bombola faints in the hot Bowral tree, - Where fierce Mullengudgery's smothering fires - Far from the breezes of Coolgardie - Burn ghastly and blue as the day expires; - - And Murriwillumba complaineth in song - For the garlanded bowers of Woolloomooloo, - And the Ballarat Fly and the lone Wollongong - They dream of the gardens of Jamberoo; - - The wallabi sighs for the Murrubidgee, - For the velvety sod of the Munno Parah, - Where the waters of healing from Muloowurtie - Flow dim in the gloaming by Yaranyackah; - - The Koppio sorrows for lost Wolloway, - And sigheth in secret for Murrurundi, - The Whangeroo wombat lamenteth the day - That made him an exile from Jerrilderie; - - The Teawamute Tumut from Wirrega's glade, - The Nangkita swallow, the Wallaroo swan, - They long for the peace of the Timaru shade - And thy balmy soft airs, O sweet Mittagong! - - The Kooringa buffalo pants in the sun, - The Kondoparinga lies gaping for breath, - The Kongorong Camaum to the shadow has won, - But the Goomeroo sinks in the slumber of death; - - In the weltering hell of the Moorooroo plain - The Yatala Wangary withers and dies, - And the Worrow Wanilla, demented with pain, - To the Woolgoolga woodlands despairingly flies; - - Sweet Nangwarry's desolate, Coonamble wails, - And Tungkillo Kuito in sables is drest, - For the Whangerei winds fall asleep in the sails - And the Booleroo life-breeze is dead in the west. - - Mypongo, Kapunda, O slumber no more - Yankalilla, Parawirra, be warned - There's death in the air! - Killanoola, wherefore - Shall the prayer of Penola be scorned? - - Cootamundra, and Takee, and Wakatipu, - Toowoomba, Kaikoura are lost - From Onkaparinga to far Oamaru - All burn in this hell's holocaust! - - Paramatta and Binnum are gone to their rest - In the vale of Tapanni Taroom, - Kawakawa, Deniliquin--all that was best - In the earth are but graves and a tomb! - - Narrandera mourns, Cameron answers not - When the roll of the scathless we cry - Tongariro, Goondiwindi, Woolundunga, the spot - Is mute and forlorn where ye lie. - -Those are good words for poetry. Among the best I have ever seen. -There are 81 in the list. I did not need them all, but I have knocked -down 66 of them; which is a good bag, it seems to me, for a person not in -the business. Perhaps a poet laureate could do better, but a poet -laureate gets wages, and that is different. When I write poetry I do not -get any wages; often I lose money by it. The best word in that list, and -the most musical and gurgly, is Woolloomoolloo. It is a place near -Sydney, and is a favorite pleasure-resort. It has eight O's in it. - - - - -CHAPTER XXXVII. - -To succeed in the other trades, capacity must be shown; in the law, -concealment of it will do. - --Pudd'nhead Wilson's New Calendar. - -MONDAY,--December 23, 1895. Sailed from Sydney for Ceylon in the P. & O. -steamer 'Oceana'. A Lascar crew mans this ship--the first I have seen. -White cotton petticoat and pants; barefoot; red shawl for belt; straw -cap, brimless, on head, with red scarf wound around it; complexion a rich -dark brown; short straight black hair; whiskers fine and silky; lustrous -and intensely black. Mild, good faces; willing and obedient people; -capable, too; but are said to go into hopeless panics when there is -danger. They are from Bombay and the coast thereabouts. Left some of -the trunks in Sydney, to be shipped to South Africa by a vessel -advertised to sail three months hence. The proverb says: "Separate not -yourself from your baggage." - -This 'Oceana' is a stately big ship, luxuriously appointed. She has -spacious promenade decks. Large rooms; a surpassingly comfortable ship. -The officers' library is well selected; a ship's library is not usually -that . . . . For meals, the bugle call, man-of-war fashion; a -pleasant change from the terrible gong . . . . Three big cats--very -friendly loafers; they wander all over the ship; the white one follows -the chief steward around like a dog. There is also a basket of kittens. -One of these cats goes ashore, in port, in England, Australia, and India, -to see how his various families are getting along, and is seen no more -till the ship is ready to sail. No one knows how he finds out the -sailing date, but no doubt he comes down to the dock every day and takes -a look, and when he sees baggage and passengers flocking in, recognizes -that it is time to get aboard. This is what the sailors believe. The -Chief Engineer has been in the China and India trade thirty three years, -and has had but three Christmases at home in that time . . . . -Conversational items at dinner, "Mocha! sold all over the world! It is -not true. In fact, very few foreigners except the Emperor of Russia have -ever seen a grain of it, or ever will, while they live." Another man -said: "There is no sale in Australia for Australian wine. But it goes to -France and comes back with a French label on it, and then they buy it." -I have heard that the most of the French-labeled claret in New York is -made in California. And I remember what Professor S. told me once about -Veuve Cliquot--if that was the wine, and I think it was. He was the -guest of a great wine merchant whose town was quite near that vineyard, -and this merchant asked him if very much V. C. was drunk in America. - -"Oh, yes," said S., "a great abundance of it." - -"Is it easy to be had?" - -"Oh, yes--easy as water. All first and second-class hotels have it." - -"What do you pay for it?" - -"It depends on the style of the hotel--from fifteen to twenty-five francs -a bottle." - -"Oh, fortunate country! Why, it's worth 100 francs right here on the -ground." - -"No!" - -"Yes!" - -"Do you mean that we are drinking a bogus Veuve-Cliquot over there?" - -"Yes--and there was never a bottle of the genuine in America since -Columbus's time. That wine all comes from a little bit of a patch of -ground which isn't big enough to raise many bottles; and all of it that -is produced goes every year to one person--the Emperor of Russia. He -takes the whole crop in advance, be it big or little." - -January 4, 1898. Christmas in Melbourne, New Year's Day in Adelaide, -and saw most of the friends again in both places . . . . Lying here -at anchor all day--Albany (King George's Sound), Western Australia. It -is a perfectly landlocked harbor, or roadstead--spacious to look at, but -not deep water. Desolate-looking rocks and scarred hills. Plenty of -ships arriving now, rushing to the new gold-fields. The papers are full -of wonderful tales of the sort always to be heard in connection with new -gold diggings. A sample: a youth staked out a claim and tried to sell -half for L5; no takers; he stuck to it fourteen days, starving, then -struck it rich and sold out for L10,000. . . About sunset, strong -breeze blowing, got up the anchor. We were in a small deep puddle, with -a narrow channel leading out of it, minutely buoyed, to the sea. - -I stayed on deck to see how we were going to manage it with such a big -ship and such a strong wind. On the bridge our giant captain, in -uniform; at his side a little pilot in elaborately gold-laced uniform; on -the forecastle a white mate and quartermaster or two, and a brilliant -crowd of lascars standing by for business. Our stern was pointing -straight at the head of the channel; so we must turn entirely around in -the puddle--and the wind blowing as described. It was done, and -beautifully. It was done by help of a jib. We stirred up much mud, but -did not touch the bottom. We turned right around in our tracks--a -seeming impossibility. We had several casts of quarter-less 5, and one -cast of half 4--27 feet; we were drawing 26 astern. By the time we were -entirely around and pointed, the first buoy was not more than a hundred -yards in front of us. It was a fine piece of work, and I was the only -passenger that saw it. However, the others got their dinner; the P. & O. -Company got mine . . . . More cats developed. Smythe says it is a -British law that they must be carried; and he instanced a case of a ship -not allowed to sail till she sent for a couple. The bill came, too: -"Debtor, to 2 cats, 20 shillings." . . . News comes that within this -week Siam has acknowledged herself to be, in effect, a French province. -It seems plain that all savage and semi-civilized countries are going to -be grabbed . . . . A vulture on board; bald, red, queer-shaped head, -featherless red places here and there on his body, intense great black -eyes set in featherless rims of inflamed flesh; dissipated look; a -businesslike style, a selfish, conscienceless, murderous aspect--the very -look of a professional assassin, and yet a bird which does no murder. -What was the use of getting him up in that tragic style for so innocent a -trade as his? For this one isn't the sort that wars upon the living, his -diet is offal--and the more out of date it is the better he likes it. -Nature should give him a suit of rusty black; then he would be all right, -for he would look like an undertaker and would harmonize with his -business; whereas the way he is now he is horribly out of true. - -January 5. At 9 this morning we passed Cape Leeuwin (lioness) and -ceased from our long due-west course along the southern shore of -Australia. Turning this extreme southwestern corner, we now take a long -straight slant nearly N. W., without a break, for Ceylon. As we speed -northward it will grow hotter very fast--but it isn't chilly, now. . . . -The vulture is from the public menagerie at Adelaide--a great and -interesting collection. It was there that we saw the baby tiger solemnly -spreading its mouth and trying to roar like its majestic mother. It -swaggered, scowling, back and forth on its short legs just as it had seen -her do on her long ones, and now and then snarling viciously, exposing -its teeth, with a threatening lift of its upper lip and bristling -moustache; and when it thought it was impressing the visitors, it would -spread its mouth wide and do that screechy cry which it meant for a roar, -but which did not deceive. It took itself quite seriously, and was -lovably comical. And there was a hyena--an ugly creature; as ugly as the -tiger-kitty was pretty. It repeatedly arched its back and delivered -itself of such a human cry; a startling resemblance; a cry which was just -that of a grown person badly hurt. In the dark one would assuredly go to -its assistance--and be disappointed . . . . Many friends of -Australasian Federation on board. They feel sure that the good day is -not far off, now. But there seems to be a party that would go further ---have Australasia cut loose from the British Empire and set up -housekeeping on her own hook. It seems an unwise idea. They point to -the United States, but it seems to me that the cases lack a good deal of -being alike. Australasia governs herself wholly--there is no -interference; and her commerce and manufactures are not oppressed in any -way. If our case had been the same we should not have gone out when we -did. - - -January 13. Unspeakably hot. The equator is arriving again. We are -within eight degrees of it. Ceylon present. Dear me, it is beautiful! -And most sumptuously tropical, as to character of foliage and opulence of -it. "What though the spicy breezes blow soft o'er Ceylon's isle"--an -eloquent line, an incomparable line; it says little, but conveys whole -libraries of sentiment, and Oriental charm and mystery, and tropic -deliciousness--a line that quivers and tingles with a thousand -unexpressed and inexpressible things, things that haunt one and find no -articulate voice . . . . Colombo, the capital. An Oriental town, -most manifestly; and fascinating. - -In this palatial ship the passengers dress for dinner. The ladies' -toilettes make a fine display of color, and this is in keeping with the -elegance of the vessel's furnishings and the flooding brilliancies of the -electric light. On the stormy Atlantic one never sees a man in evening -dress, except at the rarest intervals; and then there is only one, not -two; and he shows up but once on the voyage--the night before the ship -makes port--the night when they have the "concert" and do the amateur -wailings and recitations. He is the tenor, as a rule . . . . There -has been a deal of cricket-playing on board; it seems a queer game for a -ship, but they enclose the promenade deck with nettings and keep the ball -from flying overboard, and the sport goes very well, and is properly -violent and exciting . . . . We must part from this vessel here. - -January 14. Hotel Bristol. Servant Brompy. Alert, gentle, smiling, -winning young brown creature as ever was. Beautiful shining black hair -combed back like a woman's, and knotted at the back of his head ---tortoise-shell comb in it, sign that he is a Singhalese; slender, shapely -form; jacket; under it is a beltless and flowing white cotton gown--from -neck straight to heel; he and his outfit quite unmasculine. It was an -embarrassment to undress before him. - -We drove to the market, using the Japanese jinriksha--our first -acquaintanceship with it. It is a light cart, with a native to draw it. -He makes good speed for half-an-hour, but it is hard work for him; he is -too slight for it. After the half-hour there is no more pleasure for -you; your attention is all on the man, just as it would be on a tired -horse, and necessarily your sympathy is there too. There's a plenty of -these 'rickshas, and the tariff is incredibly cheap. - -I was in Cairo years ago. That was Oriental, but there was a lack. When -you are in Florida or New Orleans you are in the South--that is granted; -but you are not in the South; you are in a modified South, a tempered -South. Cairo was a tempered Orient--an Orient with an indefinite -something wanting. That feeling was not present in Ceylon. Ceylon was -Oriental in the last measure of completeness--utterly Oriental; also -utterly tropical; and indeed to one's unreasoning spiritual sense the two -things belong together. All the requisites were present. The costumes -were right; the black and brown exposures, unconscious of immodesty, were -right; the juggler was there, with his basket, his snakes, his mongoose, -and his arrangements for growing a tree from seed to foliage and ripe -fruitage before one's eyes; in sight were plants and flowers familiar to -one on books but in no other way celebrated, desirable, strange, but in -production restricted to the hot belt of the equator; and out a little -way in the country were the proper deadly snakes, and fierce beasts of -prey, and the wild elephant and the monkey. And there was that swoon in -the air which one associates with the tropics, and that smother of heat, -heavy with odors of unknown flowers, and that sudden invasion of purple -gloom fissured with lightnings,--then the tumult of crashing thunder and -the downpour and presently all sunny and smiling again; all these things -were there; the conditions were complete, nothing was lacking. And away -off in the deeps of the jungle and in the remotenesses of the mountains -were the ruined cities and mouldering temples, mysterious relics of the -pomps of a forgotten time and a vanished race--and this was as it should -be, also, for nothing is quite satisfyingly Oriental that lacks the -somber and impressive qualities of mystery and antiquity. - -The drive through the town and out to the Galle Face by the seashore, -what a dream it was of tropical splendors of bloom and blossom, and -Oriental conflagrations of costume! The walking groups of men, women, -boys, girls, babies--each individual was a flame, each group a house -afire for color. And such stunning colors, such intensely vivid colors, -such rich and exquisite minglings and fusings of rainbows and lightnings! -And all harmonious, all in perfect taste; never a discordant note; never -a color on any person swearing at another color on him or failing to -harmonize faultlessly with the colors of any group the wearer might join. -The stuffs were silk-thin, soft, delicate, clinging; and, as a rule, each -piece a solid color: a splendid green, a splendid blue, a splendid -yellow, a splendid purple, a splendid ruby, deep, and rich with -smouldering fires they swept continuously by in crowds and legions and -multitudes, glowing, flashing, burning, radiant; and every five seconds -came a burst of blinding red that made a body catch his breath, and -filled his heart with joy. And then, the unimaginable grace of those -costumes! Sometimes a woman's whole dress was but a scarf wound about -her person and her head, sometimes a man's was but a turban and a -careless rag or two--in both cases generous areas of polished dark skin -showing--but always the arrangement compelled the homage of the eye and -made the heart sing for gladness. - -I can see it to this day, that radiant panorama, that wilderness of rich -color, that incomparable dissolving-view of harmonious tints, and lithe -half-covered forms, and beautiful brown faces, and gracious and graceful -gestures and attitudes and movements, free, unstudied, barren of -stiffness and restraint, and-- - -Just then, into this dream of fairyland and paradise a grating dissonance -was injected. - -Out of a missionary school came marching, two and two, sixteen prim and -pious little Christian black girls, Europeanly clothed--dressed, to the -last detail, as they would have been dressed on a summer Sunday in an -English or American village. Those clothes--oh, they were unspeakably -ugly! Ugly, barbarous, destitute of taste, destitute of grace, repulsive -as a shroud. I looked at my womenfolk's clothes--just full-grown -duplicates of the outrages disguising those poor little abused creatures ---and was ashamed to be seen in the street with them. Then I looked at -my own clothes, and was ashamed to be seen in the street with myself. - -However, we must put up with our clothes as they are--they have their -reason for existing. They are on us to expose us--to advertise what we -wear them to conceal. They are a sign; a sign of insincerity; a sign of -suppressed vanity; a pretense that we despise gorgeous colors and the -graces of harmony and form; and we put them on to propagate that lie and -back it up. But we do not deceive our neighbor; and when we step into -Ceylon we realize that we have not even deceived ourselves. We do love -brilliant colors and graceful costumes; and at home we will turn out in a -storm to see them when the procession goes by--and envy the wearers. We -go to the theater to look at them and grieve that we can't be clothed -like that. We go to the King's ball, when we get a chance, and are glad -of a sight of the splendid uniforms and the glittering orders. When we -are granted permission to attend an imperial drawing-room we shut -ourselves up in private and parade around in the theatrical court-dress -by the hour, and admire ourselves in the glass, and are utterly happy; -and every member of every governor's staff in democratic America does the -same with his grand new uniform--and if he is not watched he will get -himself photographed in it, too. When I see the Lord Mayor's footman I -am dissatisfied with my lot. Yes, our clothes are a lie, and have been -nothing short of that these hundred years. They are insincere, they are -the ugly and appropriate outward exposure of an inward sham and a moral -decay. - -The last little brown boy I chanced to notice in the crowds and swarms of -Colombo had nothing on but a twine string around his waist, but in my -memory the frank honesty of his costume still stands out in pleasant -contrast with the odious flummery in which the little Sunday-school -dowdies were masquerading. - - - - -CHAPTER XXXVIII. - -Prosperity is the best protector of principle. - --Pudd'nhead Wilson's New Calendar. - -EVENING--11th. Sailed in the Rosetta. This is a poor old ship, and -ought to be insured and sunk. As in the 'Oceana', just so here: -everybody dresses for dinner; they make it a sort of pious duty. These -fine and formal costumes are a rather conspicuous contrast to the poverty -and shabbiness of the surroundings . . . . If you want a slice of a -lime at four o'clock tea, you must sign an order on the bar. Limes cost -14 cents a barrel. - -January 18th. We have been running up the Arabian Sea, latterly. -Closing up on Bombay now, and due to arrive this evening. - -January 20th. Bombay! A bewitching place, a bewildering place, an -enchanting place--the Arabian Nights come again? It is a vast city; -contains about a million inhabitants. Natives, they are, with a slight -sprinkling of white people--not enough to have the slightest modifying -effect upon the massed dark complexion of the public. It is winter here, -yet the weather is the divine weather of June, and the foliage is the -fresh and heavenly foliage of June. There is a rank of noble great shade -trees across the way from the hotel, and under them sit groups of -picturesque natives of both sexes; and the juggler in his turban is there -with his snakes and his magic; and all day long the cabs and the -multitudinous varieties of costumes flock by. It does not seem as if one -could ever get tired of watching this moving show, this shining and -shifting spectacle . . . . In the great bazar the pack and jam of -natives was marvelous, the sea of rich-colored turbans and draperies an -inspiring sight, and the quaint and showy Indian architecture was just -the right setting for it. Toward sunset another show; this is the drive -around the sea-shore to Malabar Point, where Lord Sandhurst, the Governor -of the Bombay Presidency, lives. Parsee palaces all along the first part -of the drive; and past them all the world is driving; the private -carriages of wealthy Englishmen and natives of rank are manned by a -driver and three footmen in stunning oriental liveries--two of these -turbaned statues standing up behind, as fine as monuments. Sometimes -even the public carriages have this superabundant crew, slightly -modified--one to drive, one to sit by and see it done, and one to stand -up behind and yell--yell when there is anybody in the way, and for -practice when there isn't. It all helps to keep up the liveliness and -augment the general sense of swiftness and energy and confusion and -pow-wow. - -In the region of Scandal Point--felicitous name--where there are handy -rocks to sit on and a noble view of the sea on the one hand, and on the -other the passing and reprising whirl and tumult of gay carriages, are -great groups of comfortably-off Parsee women--perfect flower-beds of -brilliant color, a fascinating spectacle. Tramp, tramp, tramping along -the road, in singles, couples, groups, and gangs, you have the -working-man and the working-woman--but not clothed like ours. Usually -the man is a nobly-built great athlete, with not a rag on but his -loin-handkerchief; his color a deep dark brown, his skin satin, his -rounded muscles knobbing it as if it had eggs under it. Usually the -woman is a slender and shapely creature, as erect as a lightning-rod, and -she has but one thing on--a bright-colored piece of stuff which is wound -about her head and her body down nearly half-way to her knees, and which -clings like her own skin. Her legs and feet are bare, and so are her -arms, except for her fanciful bunches of loose silver rings on her ankles -and on her arms. She has jewelry bunched on the side of her nose also, -and showy clusterings on her toes. When she undresses for bed she takes -off her jewelry, I suppose. If she took off anything more she would -catch cold. As a rule she has a large shiney brass water jar of graceful -shape on her head, and one of her naked arms curves up and the hand holds -it there. She is so straight, so erect, and she steps with such style, -and such easy grace and dignity; and her curved arm and her brazen jar -are such a help to the picture indeed, our working-women cannot begin -with her as a road-decoration. - -It is all color, bewitching color, enchanting color--everywhere all -around--all the way around the curving great opaline bay clear to -Government House, where the turbaned big native 'chuprassies' stand -grouped in state at the door in their robes of fiery red, and do most -properly and stunningly finish up the splendid show and make it -theatrically complete. I wish I were a 'chuprassy'. - -This is indeed India! the land of dreams and romance, of fabulous wealth -and fabulous poverty, of splendor and rags, of palaces and hovels, of -famine and pestilence, of genii and giants and Aladdin lamps, of tigers -and elephants, the cobra and the jungle, the country of a hundred nations -and a hundred tongues, of a thousand religions and two million gods, -cradle of the human race, birthplace of human speech, mother of history, -grandmother of legend, great-grandmother of tradition, whose yesterdays -bear date with the mouldering antiquities of the rest of the nations--the -one sole country under the sun that is endowed with an imperishable -interest for alien prince and alien peasant, for lettered and ignorant, -wise and fool, rich and poor, bond and free, the one land that all men -desire to see, and having seen once, by even a glimpse, would not give -that glimpse for the shows of all the rest of the globe combined. -Even now, after the lapse of a year, the delirium of those days in Bombay -has not left me, and I hope never will. It was all new, no detail of it -hackneyed. And India did not wait for morning, it began at the hotel ---straight away. The lobbies and halls were full of turbaned, and fez'd -and embroidered, cap'd, and barefooted, and cotton-clad dark natives, -some of them rushing about, others at rest squatting, or sitting on the -ground; some of them chattering with energy, others still and dreamy; in -the dining-room every man's own private native servant standing behind -his chair, and dressed for a part in the Arabian Nights. - -Our rooms were high up, on the front. A white man--he was a burly German ---went up with us, and brought three natives along to see to arranging -things. About fourteen others followed in procession, with the -hand-baggage; each carried an article--and only one; a bag, in some -cases, in other cases less. One strong native carried my overcoat, -another a parasol, another a box of cigars, another a novel, and the last -man in the procession had no load but a fan. It was all done with -earnestness and sincerity, there was not a smile in the procession from -the head of it to the tail of it. Each man waited patiently, tranquilly, -in no sort of hurry, till one of us found time to give him a copper, then -he bent his head reverently, touched his forehead with his fingers, and -went his way. They seemed a soft and gentle race, and there was -something both winning and touching about their demeanor. - -There was a vast glazed door which opened upon the balcony. It needed -closing, or cleaning, or something, and a native got down on his knees -and went to work at it. He seemed to be doing it well enough, but -perhaps he wasn't, for the burly German put on a look that betrayed -dissatisfaction, then without explaining what was wrong, gave the native -a brisk cuff on the jaw and then told him where the defect was. It -seemed such a shame to do that before us all. The native took it with -meekness, saying nothing, and not showing in his face or manner any -resentment. I had not seen the like of this for fifty years. It carried -me back to my boyhood, and flashed upon me the forgotten fact that this -was the usual way of explaining one's desires to a slave. I was able to -remember that the method seemed right and natural to me in those days, I -being born to it and unaware that elsewhere there were other methods; but -I was also able to remember that those unresented cuffings made me sorry -for the victim and ashamed for the punisher. My father was a refined and -kindly gentleman, very grave, rather austere, of rigid probity, a sternly -just and upright man, albeit he attended no church and never spoke of -religious matters, and had no part nor lot in the pious joys of his -Presbyterian family, nor ever seemed to suffer from this deprivation. He -laid his hand upon me in punishment only twice in his life, and then not -heavily; once for telling him a lie--which surprised me, and showed me -how unsuspicious he was, for that was not my maiden effort. He punished -me those two times only, and never any other member of the family at all; -yet every now and then he cuffed our harmless slave boy, Lewis, for -trifling little blunders and awkwardnesses. My father had passed his life -among the slaves from his cradle up, and his cuffings proceeded from the -custom of the time, not from his nature. When I was ten years old I saw -a man fling a lump of iron-ore at a slaveman in anger, for merely doing -something awkwardly--as if that were a crime. It bounded from the man's -skull, and the man fell and never spoke again. He was dead in an hour. -I knew the man had a right to kill his slave if he wanted to, and yet it -seemed a pitiful thing and somehow wrong, though why wrong I was not deep -enough to explain if I had been asked to do it. Nobody in the village -approved of that murder, but of course no one said much about it. - -It is curious--the space-annihilating power of thought. For just one -second, all that goes to make the me in me was in a Missourian village, -on the other side of the globe, vividly seeing again these forgotten -pictures of fifty years ago, and wholly unconscious of all things but -just those; and in the next second I was back in Bombay, and that -kneeling native's smitten cheek was not done tingling yet! Back to -boyhood--fifty years; back to age again, another fifty; and a flight -equal to the circumference of the globe-all in two seconds by the watch! - -Some natives--I don't remember how many--went into my bedroom, now, and -put things to rights and arranged the mosquito-bar, and I went to bed to -nurse my cough. It was about nine in the evening. What a state of -things! For three hours the yelling and shouting of natives in the hall -continued, along with the velvety patter of their swift bare feet--what a -racket it was! They were yelling orders and messages down three flights. -Why, in the matter of noise it amounted to a riot, an insurrection, a -revolution. And then there were other noises mixed up with these and at -intervals tremendously accenting them--roofs falling in, I judged, -windows smashing, persons being murdered, crows squawking, and deriding, -and cursing, canaries screeching, monkeys jabbering, macaws blaspheming, -and every now and then fiendish bursts of laughter and explosions of -dynamite. By midnight I had suffered all the different kinds of shocks -there are, and knew that I could never more be disturbed by them, either -isolated or in combination. Then came peace--stillness deep and solemn -and lasted till five. - -Then it all broke loose again. And who re-started it? The Bird of Birds -the Indian crow. I came to know him well, by and by, and be infatuated -with him. I suppose he is the hardest lot that wears feathers. Yes, and -the cheerfulest, and the best satisfied with himself. He never arrived -at what he is by any careless process, or any sudden one; he is a work of -art, and "art is long"; he is the product of immemorial ages, and of deep -calculation; one can't make a bird like that in a day. He has been -reincarnated more times than Shiva; and he has kept a sample of each -incarnation, and fused it into his constitution. In the course of his -evolutionary promotions, his sublime march toward ultimate perfection, he -has been a gambler, a low comedian, a dissolute priest, a fussy woman, a -blackguard, a scoffer, a liar, a thief, a spy, an informer, a trading -politician, a swindler, a professional hypocrite, a patriot for cash, a -reformer, a lecturer, a lawyer, a conspirator, a rebel, a royalist, a -democrat, a practicer and propagator of irreverence, a meddler, an -intruder, a busybody, an infidel, and a wallower in sin for the mere love -of it. The strange result, the incredible result, of this patient -accumulation of all damnable traits is, that be does not know what care -is, he does not know what sorrow is, he does not know what remorse is, -his life is one long thundering ecstasy of happiness, and he will go to -his death untroubled, knowing that he will soon turn up again as an -author or something, and be even more intolerably capable and comfortable -than ever he was before. - -In his straddling wide forward-step, and his springy side-wise series of -hops, and his impudent air, and his cunning way of canting his head to -one side upon occasion, he reminds one of the American blackbird. But -the sharp resemblances stop there. He is much bigger than the blackbird; -and he lacks the blackbird's trim and slender and beautiful build and -shapely beak; and of course his sober garb of gray and rusty black is a -poor and humble thing compared with the splendid lustre of the -blackbird's metallic sables and shifting and flashing bronze glories. -The blackbird is a perfect gentleman, in deportment and attire, and is -not noisy, I believe, except when holding religious services and -political conventions in a tree; but this Indian sham Quaker is just a -rowdy, and is always noisy when awake--always chaffing, scolding, -scoffing, laughing, ripping, and cursing, and carrying on about something -or other. I never saw such a bird for delivering opinions. Nothing -escapes him; he notices everything that happens, and brings out his -opinion about it, particularly if it is a matter that is none of his -business. And it is never a mild opinion, but always violent--violent -and profane--the presence of ladies does not affect him. His opinions -are not the outcome of reflection, for he never thinks about anything, -but heaves out the opinion that is on top in his mind, and which is often -an opinion about some quite different thing and does not fit the case. -But that is his way; his main idea is to get out an opinion, and if he -stopped to think he would lose chances. - -I suppose he has no enemies among men. The whites and Mohammedans never -seemed to molest him; and the Hindoos, because of their religion, never -take the life of any creature, but spare even the snakes and tigers and -fleas and rats. If I sat on one end of the balcony, the crows would -gather on the railing at the other end and talk about me; and edge -closer, little by little, till I could almost reach them; and they would -sit there, in the most unabashed way, and talk about my clothes, and my -hair, and my complexion, and probable character and vocation and -politics, and how I came to be in India, and what I had been doing, and -how many days I had got for it, and how I had happened to go unhanged -so long, and when would it probably come off, and might there be more of -my sort where I came from, and when would they be hanged,--and so on, and -so on, until I could not longer endure the embarrassment of it; then I -would shoo them away, and they would circle around in the air a little -while, laughing and deriding and mocking, and presently settle on the -rail and do it all over again. - -They were very sociable when there was anything to eat--oppressively so. -With a little encouragement they would come in and light on the table and -help me eat my breakfast; and once when I was in the other room and they -found themselves alone, they carried off everything they could lift; and -they were particular to choose things which they could make no use of -after they got them. In India their number is beyond estimate, and their -noise is in proportion. I suppose they cost the country more than the -government does; yet that is not a light matter. Still, they pay; their -company pays; it would sadden the land to take their cheerful voice out -of it. - - - - -CHAPTER XXXIX. - -By trying we can easily learn to endure adversity. Another man's, -I mean. - --Pudd'nhead Wilson's New Calendar. - -You soon find your long-ago dreams of India rising in a sort of vague and -luscious moonlight above the horizon-rim of your opaque consciousness, -and softly lighting up a thousand forgotten details which were parts of a -vision that had once been vivid to you when you were a boy, and steeped -your spirit in tales of the East. The barbaric gorgeousnesses, for -instance; and the princely titles, the sumptuous titles, the sounding -titles,--how good they taste in the mouth! The Nizam of Hyderabad; the -Maharajah of Travancore; the Nabob of Jubbelpore; the Begum of Bhopal; -the Nawab of Mysore; the Rance of Gulnare; the Ahkoond of Swat's; the Rao -of Rohilkund; the Gaikwar of Baroda. Indeed, it is a country that runs -richly to name. The great god Vishnu has 108--108 special ones--108 -peculiarly holy ones--names just for Sunday use only. I learned the -whole of Vishnu's 108 by heart once, but they wouldn't stay; I don't -remember any of them now but John W. - -And the romances connected with, those princely native houses--to this -day they are always turning up, just as in the old, old times. They were -sweating out a romance in an English court in Bombay a while before we -were there. In this case a native prince, 16 1/2 years old, who has been -enjoying his titles and dignities and estates unmolested for fourteen -years, is suddenly haled into court on the charge that he is rightfully -no prince at all, but a pauper peasant; that the real prince died when -two and one-half years old; that the death was concealed, and a peasant -child smuggled into the royal cradle, and that this present incumbent was -that smuggled substitute. This is the very material that so many -oriental tales have been made of. - -The case of that great prince, the Gaikwar of Baroda, is a reversal of -the theme. When that throne fell vacant, no heir could be found for some -time, but at last one was found in the person of a peasant child who was -making mud pies in a village street, and having an innocent good time. -But his pedigree was straight; he was the true prince, and he has reigned -ever since, with none to dispute his right. - -Lately there was another hunt for an heir to another princely house, and -one was found who was circumstanced about as the Gaikwar had been. His -fathers were traced back, in humble life, along a branch of the ancestral -tree to the point where it joined the stem fourteen generations ago, and -his heirship was thereby squarely established. The tracing was done by -means of the records of one of the great Hindoo shrines, where princes on -pilgrimage record their names and the date of their visit. This is to -keep the prince's religious account straight, and his spiritual person -safe; but the record has the added value of keeping the pedigree -authentic, too. - -When I think of Bombay now, at this distance of time, I seem to have a -kaleidoscope at my eye; and I hear the clash of the glass bits as the -splendid figures change, and fall apart, and flash into new forms, figure -after figure, and with the birth of each new form I feel my skin crinkle -and my nerve-web tingle with a new thrill of wonder and delight. These -remembered pictures float past me in a sequence of contracts; following -the same order always, and always whirling by and disappearing with the -swiftness of a dream, leaving me with the sense that the actuality was -the experience of an hour, at most, whereas it really covered days, I -think. - -The series begins with the hiring of a "bearer"--native man-servant--a -person who should be selected with some care, because as long as he is in -your employ he will be about as near to you as your clothes. - -In India your day may be said to begin with the "bearer's" knock on the -bedroom door, accompanied by a formula of, words--a formula which is -intended to mean that the bath is ready. It doesn't really seem to mean -anything at all. But that is because you are not used to "bearer" -English. You will presently understand. - -Where he gets his English is his own secret. There is nothing like it -elsewhere in the earth; or even in paradise, perhaps, but the other place -is probably full of it. You hire him as soon as you touch Indian soil; -for no matter what your sex is, you cannot do without him. He is -messenger, valet, chambermaid, table-waiter, lady's maid, courier--he is -everything. He carries a coarse linen clothes-bag and a quilt; he sleeps -on the stone floor outside your chamber door, and gets his meals you do -not know where nor when; you only know that he is not fed on the -premises, either when you are in a hotel or when you are a guest in a, -private house. His wages are large--from an Indian point of view--and he -feeds and clothes himself out of them. We had three of him in two and a -half months. The first one's rate was thirty rupees a month that is to -say, twenty-seven cents a day; the rate of the others, Rs. 40 (40 rupees) -a month. A princely sum; for the native switchman on a railway and the -native servant in a private family get only Rs. 7 per month, and the -farm-hand only 4. The two former feed and clothe themselves and their -families on their $1.90 per month; but I cannot believe that the farmhand -has to feed himself on his $1.08. I think the farm probably feeds him, -and that the whole of his wages, except a trifle for the priest, go to -the support of his family. That is, to the feeding of his family; for -they live in a mud hut, hand-made, and, doubtless, rent-free, and they -wear no clothes; at least, nothing more than a rag. And not much of a -rag at that, in the case of the males. However, these are handsome times -for the farm-hand; he was not always the child of luxury that he is now. -The Chief Commissioner of the Central Provinces, in a recent official -utterance wherein he was rebuking a native deputation for complaining of -hard times, reminded them that they could easily remember when a -farm-hand's wages were only half a rupee (former value) a month--that -is to say, less than a cent a day; nearly $2.90 a year. If such a -wage-earner had a good deal of a family--and they all have that, for God -is very good to these poor natives in some ways--he would save a profit -of fifteen cents, clean and clear, out of his year's toil; I mean a -frugal, thrifty person would, not one given to display and ostentation. -And if he owed $13.50 and took good care of his health, he could pay it -off in ninety years. Then he could hold up his head, and look his -creditors in the face again. - -Think of these facts and what they mean. India does not consist of -cities. There are no cities in India--to speak of. Its stupendous -population consists of farm-laborers. India is one vast farm--one almost -interminable stretch of fields with mud fences between. . . Think of the -above facts; and consider what an incredible aggregate of poverty they -place before you. - -The first Bearer that applied, waited below and sent up his -recommendations. That was the first morning in Bombay. We read them -over; carefully, cautiously, thoughtfully. There was not a fault to find -with them--except one; they were all from Americans. Is that a slur? -If it is, it is a deserved one. In my experience, an American's -recommendation of a servant is not usually valuable. We are too -good-natured a race; we hate to say the unpleasant thing; we shrink from -speaking the unkind truth about a poor fellow whose bread depends upon -our verdict; so we speak of his good points only, thus not scrupling to -tell a lie--a silent lie--for in not mentioning his bad ones we as good -as say he hasn't any. The only difference that I know of between a -silent lie and a spoken one is, that the silent lie is a less respectable -one than the other. And it can deceive, whereas the other can't--as a -rule. We not only tell the silent lie as to a servant's faults, but we -sin in another way: we overpraise his merits; for when it comes to -writing recommendations of servants we are a nation of gushers. And we -have not the Frenchman's excuse. In France you must give the departing -servant a good recommendation; and you must conceal his faults; you have -no choice. If you mention his faults for the protection of the next -candidate for his services, he can sue you for damages; and the court -will award them, too; and, moreover, the judge will give you a sharp -dressing-down from the bench for trying to destroy a poor man's -character, and rob him of his bread. I do not state this on my own -authority, I got it from a French physician of fame and repute--a man who -was born in Paris, and had practiced there all his life. And he said -that he spoke not merely from common knowledge, but from exasperating -personal experience. - -As I was saying, the Bearer's recommendations were all from American -tourists; and St. Peter would have admitted him to the fields of the -blest on them--I mean if he is as unfamiliar with our people and our ways -as I suppose he is. According to these recommendations, Manuel X. was -supreme in all the arts connected with his complex trade; and these -manifold arts were mentioned--and praised-in detail. His English was -spoken of in terms of warm admiration--admiration verging upon rapture. -I took pleased note of that, and hoped that some of it might be true. - -We had to have some one right away; so the family went down stairs and -took him a week on trial; then sent him up to me and departed on their -affairs. I was shut up in my quarters with a bronchial cough, and glad -to have something fresh to look at, something new to play with. Manuel -filled the bill; Manuel was very welcome. He was toward fifty years old, -tall, slender, with a slight stoop--an artificial stoop, a deferential -stoop, a stoop rigidified by long habit--with face of European mould; -short hair intensely black; gentle black eyes, timid black eyes, indeed; -complexion very dark, nearly black in fact; face smooth-shaven. He was -bareheaded and barefooted, and was never otherwise while his week with us -lasted; his clothing was European, cheap, flimsy, and showed much wear. - -He stood before me and inclined his head (and body) in the pathetic -Indian way, touching his forehead with the finger--ends of his right -hand, in salute. I said: - -"Manuel, you are evidently Indian, but you seem to have a Spanish name -when you put it all together. How is that?" - -A perplexed look gathered in his face; it was plain that he had not -understood--but he didn't let on. He spoke back placidly. - -"Name, Manuel. Yes, master." - -"I know; but how did you get the name?" - -"Oh, yes, I suppose. Think happen so. Father same name, not mother." - -I saw that I must simplify my language and spread my words apart, if I -would be understood by this English scholar. - -"Well--then--how--did--your--father--get--his name?" - -"Oh, he,"--brightening a little--"he Christian--Portygee; live in Goa; I -born Goa; mother not Portygee, mother native-high-caste Brahmin--Coolin -Brahmin; highest caste; no other so high caste. I high-caste Brahmin, -too. Christian, too, same like father; high-caste Christian Brahmin, -master--Salvation Army." - -All this haltingly, and with difficulty. Then he had an inspiration, and -began to pour out a flood of words that I could make nothing of; so I -said: - -"There--don't do that. I can't understand Hindostani." - -"Not Hindostani, master--English. Always I speaking English sometimes -when I talking every day all the time at you." - -"Very well, stick to that; that is intelligible. It is not up to my -hopes, it is not up to the promise of the recommendations, still it is -English, and I understand it. Don't elaborate it; I don't like -elaborations when they are crippled by uncertainty of touch." - -"Master?" - -"Oh, never mind; it was only a random thought; I didn't expect you to -understand it. How did you get your English; is it an acquirement, or -just a gift of God?" - -After some hesitation--piously: - -"Yes, he very good. Christian god very good, Hindoo god very good, too. -Two million Hindoo god, one Christian god--make two million and one. All -mine; two million and one god. I got a plenty. Sometime I pray all time -at those, keep it up, go all time every day; give something at shrine, -all good for me, make me better man; good for me, good for my family, dam -good." - -Then he had another inspiration, and went rambling off into fervent -confusions and incoherencies, and I had to stop him again. I thought we -had talked enough, so I told him to go to the bathroom and clean it up -and remove the slops--this to get rid of him. He went away, seeming to -understand, and got out some of my clothes and began to brush them. I -repeated my desire several times, simplifying and re-simplifying it, and -at last he got the idea. Then he went away and put a coolie at the work, -and explained that he would lose caste if he did it himself; it would be -pollution, by the law of his caste, and it would cost him a deal of fuss -and trouble to purify himself and accomplish his rehabilitation. He said -that that kind of work was strictly forbidden to persons of caste, and as -strictly restricted to the very bottom layer of Hindoo society--the -despised 'Sudra' (the toiler, the laborer). He was right; and apparently -the poor Sudra has been content with his strange lot, his insulting -distinction, for ages and ages--clear back to the beginning of things, so -to speak. Buckle says that his name--laborer--is a term of contempt; -that it is ordained by the Institutes of Menu (900 B.C.) that if a Sudra -sit on a level with his superior he shall be exiled or branded--[Without -going into particulars I will remark that as a rule they wear no clothing -that would conceal the brand.--M. T.]. . . ; if he speak -contemptuously of his superior or insult him he shall suffer death; if he -listen to the reading of the sacred books he shall have burning oil -poured in his ears; if he memorize passages from them he shall be killed; -if he marry his daughter to a Brahmin the husband shall go to hell for -defiling himself by contact with a woman so infinitely his inferior; and -that it is forbidden to a Sudra to acquire wealth. "The bulk of the -population of India," says Bucklet--[Population to-day, 300,000,000.] ---"is the Sudras--the workers, the farmers, the creators of wealth." - -Manuel was a failure, poor old fellow. His age was against him. He was -desperately slow and phenomenally forgetful. When he went three blocks -on an errand he would be gone two hours, and then forget what it was he -went for. When he packed a trunk it took him forever, and the trunk's -contents were an unimaginable chaos when he got done. He couldn't wait -satisfactorily at table--a prime defect, for if you haven't your own -servant in an Indian hotel you are likely to have a slow time of it and -go away hungry. We couldn't understand his English; he couldn't -understand ours; and when we found that he couldn't understand his own, -it seemed time for us to part. I had to discharge him; there was no help -for it. But I did it as kindly as I could, and as gently. We must part, -said I, but I hoped we should meet again in a better world. It was not -true, but it was only a little thing to say, and saved his feelings and -cost me nothing. - -But now that he was gone, and was off my mind and heart, my spirits began -to rise at once, and I was soon feeling brisk and ready to go out and -have adventures. Then his newly-hired successor flitted in, touched his -forehead, and began to fly around here, there, and everywhere, on his -velvet feet, and in five minutes he had everything in the room -"ship-shape and Bristol fashion," as the sailors say, and was standing at -the salute, waiting for orders. Dear me, what a rustler he was after the -slumbrous way of Manuel, poor old slug! All my heart, all my affection, -all my admiration, went out spontaneously to this frisky little forked -black thing, this compact and compressed incarnation of energy and force -and promptness and celerity and confidence, this smart, smily, engaging, -shiney-eyed little devil, feruled on his upper end by a gleaming -fire-coal of a fez with a red-hot tassel dangling from it. I said, -with deep satisfaction-- - -"You'll suit. What is your name?" - -He reeled it mellowly off. - -"Let me see if I can make a selection out of it--for business uses, I -mean; we will keep the rest for Sundays. Give it to me in installments." - -He did it. But there did not seem to be any short ones, except -Mousawhich suggested mouse. It was out of character; it was too soft, -too quiet, too conservative; it didn't fit his splendid style. I -considered, and said-- - -"Mousa is short enough, but I don't quite like it. It seems colorless ---inharmonious--inadequate; and I am sensitive to such things. How do you -think Satan would do?" - -"Yes, master. Satan do wair good." - -It was his way of saying "very good." - -There was a rap at the door. Satan covered the ground with a single -skip; there was a word or two of Hindostani, then he disappeared. Three -minutes later he was before me again, militarily erect, and waiting for -me to speak first. - -"What is it, Satan?" - -"God want to see you." - -"Who?" - -"God. I show him up, master?" - -"Why, this is so unusual, that--that--well, you see indeed I am so -unprepared--I don't quite know what I do mean. Dear me, can't you -explain? Don't you see that this is a most ex----" - -"Here his card, master." - -Wasn't it curious--and amazing, and tremendous, and all that? Such a -personage going around calling on such as I, and sending up his card, -like a mortal--sending it up by Satan. It was a bewildering collision of -the impossibles. But this was the land of the Arabian Nights, this was -India! and what is it that cannot happen in India? - -We had the interview. Satan was right--the Visitor was indeed a God in -the conviction of his multitudinous followers, and was worshiped by them -in sincerity and humble adoration. They are troubled by no doubts as to -his divine origin and office. They believe in him, they pray to him, -they make offerings to him, they beg of him remission of sins; to them -his person, together with everything connected with it, is sacred; from -his barber they buy the parings of his nails and set them in gold, and -wear them as precious amulets. - -I tried to seem tranquilly conversational and at rest, but I was not. -Would you have been? I was in a suppressed frenzy of excitement and -curiosity and glad wonder. I could not keep my eyes off him. I was -looking upon a god, an actual god, a recognized and accepted god; and -every detail of his person and his dress had a consuming interest for me. -And the thought went floating through my head, "He is worshiped--think of -it--he is not a recipient of the pale homage called compliment, wherewith -the highest human clay must make shift to be satisfied, but of an -infinitely richer spiritual food: adoration, worship!--men and women lay -their cares and their griefs and their broken hearts at his feet; and he -gives them his peace; and they go away healed." - -And just then the Awful Visitor said, in the simplest way--"There is a -feature of the philosophy of Huck Finn which"--and went luminously on -with the construction of a compact and nicely-discriminated literary -verdict. - -It is a land of surprises--India! I had had my ambitions--I had hoped, -and almost expected, to be read by kings and presidents and emperors--but -I had never looked so high as That. It would be false modesty to pretend -that I was not inordinately pleased. I was. I was much more pleased -than I should have been with a compliment from a man. - -He remained half an hour, and I found him a most courteous and charming -gentleman. The godship has been in his family a good while, but I do not -know how long. He is a Mohammedan deity; by earthly rank he is a prince; -not an Indian but a Persian prince. He is a direct descendant of the -Prophet's line. He is comely; also young--for a god; not forty, perhaps -not above thirty-five years old. He wears his immense honors with -tranquil brace, and with a dignity proper to his awful calling. He -speaks English with the ease and purity of a person born to it. I think -I am not overstating this. He was the only god I had ever seen, and I -was very favorably impressed. When he rose to say good-bye, the door -swung open and I caught the flash of a red fez, and heard these words, -reverently said-- - -"Satan see God out?" - -"Yes." And these mis-mated Beings passed from view Satan in the lead and -The Other following after. - - - - -CHAPTER XL. - -Few of us can stand prosperity. Another man's, I mean. - --Pudd'nhead Wilson's New Calendar. - -The next picture in my mind is Government House, on Malabar Point, with -the wide sea-view from the windows and broad balconies; abode of His -Excellency the Governor of the Bombay Presidency--a residence which is -European in everything but the native guards and servants, and is a home -and a palace of state harmoniously combined. - -That was England, the English power, the English civilization, the modern -civilization--with the quiet elegancies and quiet colors and quiet tastes -and quiet dignity that are the outcome of the modern cultivation. And -following it came a picture of the ancient civilization of India--an hour -in the mansion of a native prince: Kumar Schri Samatsinhji Bahadur of the -Palitana State. - -The young lad, his heir, was with the prince; also, the lad's sister, a -wee brown sprite, very pretty, very serious, very winning, delicately -moulded, costumed like the daintiest butterfly, a dear little fairyland -princess, gravely willing to be friendly with the strangers, but in the -beginning preferring to hold her father's hand until she could take stock -of them and determine how far they were to be trusted. She must have -been eight years old; so in the natural (Indian) order of things she -would be a bride in three or four years from now, and then this free -contact with the sun and the air and the other belongings of out-door -nature and comradeship with visiting male folk would end, and she would -shut herself up in the zenana for life, like her mother, and by inherited -habit of mind would be happy in that seclusion and not look upon it as an -irksome restraint and a weary captivity. - -The game which the prince amuses his leisure with--however, never mind -it, I should never be able to describe it intelligibly. I tried to get -an idea of it while my wife and daughter visited the princess in the -zenana, a lady of charming graces and a fluent speaker of English, but I -did not make it out. It is a complicated game, and I believe it is said -that nobody can learn to play it well--but an Indian. And I was not able -to learn how to wind a turban. It seemed a simple art and easy; but that -was a deception. It is a piece of thin, delicate stuff a foot wide or -more, and forty or fifty feet long; and the exhibitor of the art takes -one end of it in his hands, and winds it in and out intricately about his -head, twisting it as he goes, and in a minute or two the thing is -finished, and is neat and symmetrical and fits as snugly as a mould. - -We were interested in the wardrobe and the jewels, and in the silverware, -and its grace of shape and beauty and delicacy of ornamentation. The -silverware is kept locked up, except at meal-times, and none but the -chief butler and the prince have keys to the safe. I did not clearly -understand why, but it was not for the protection of the silver. It was -either to protect the prince from the contamination which his caste would -suffer if the vessels were touched by low-caste hands, or it was to -protect his highness from poison. Possibly it was both. I believe a -salaried taster has to taste everything before the prince ventures it--an -ancient and judicious custom in the East, and has thinned out the tasters -a good deal, for of course it is the cook that puts the poison in. If I -were an Indian prince I would not go to the expense of a taster, I would -eat with the cook. - -Ceremonials are always interesting; and I noted that the Indian -good-morning is a ceremonial, whereas ours doesn't amount to that. In -salutation the son reverently touches the father's forehead with a small -silver implement tipped with vermillion paste which leaves a red spot -there, and in return the son receives the father's blessing. Our good -morning is well enough for the rowdy West, perhaps, but would be too -brusque for the soft and ceremonious East. - -After being properly necklaced, according to custom, with great garlands -made of yellow flowers, and provided with betel-nut to chew, this -pleasant visit closed, and we passed thence to a scene of a different -sort: from this glow of color and this sunny life to those grim -receptacles of the Parsee dead, the Towers of Silence. There is -something stately about that name, and an impressiveness which sinks -deep; the hush of death is in it. We have the Grave, the Tomb, the -Mausoleum, God's Acre, the Cemetery; and association has made them -eloquent with solemn meaning; but we have no name that is so majestic as -that one, or lingers upon the ear with such deep and haunting pathos. - -On lofty ground, in the midst of a paradise of tropical foliage and -flowers, remote from the world and its turmoil and noise, they stood--the -Towers of Silence; and away below was spread the wide groves of cocoa -palms, then the city, mile on mile, then the ocean with its fleets of -creeping ships all steeped in a stillness as deep as the hush that -hallowed this high place of the dead. The vultures were there. They -stood close together in a great circle all around the rim of a massive -low tower--waiting; stood as motionless as sculptured ornaments, and -indeed almost deceived one into the belief that that was what they were. -Presently there was a slight stir among the score of persons present, and -all moved reverently out of the path and ceased from talking. A funeral -procession entered the great gate, marching two and two, and moved -silently by, toward the Tower. The corpse lay in a shallow shell, and -was under cover of a white cloth, but was otherwise naked. The bearers -of the body were separated by an interval of thirty feet from the -mourners. They, and also the mourners, were draped all in pure white, -and each couple of mourners was figuratively bound together by a piece of -white rope or a handkerchief--though they merely held the ends of it in -their hands. Behind the procession followed a dog, which was led in a -leash. When the mourners had reached the neighborhood of the Tower ---neither they nor any other human being but the bearers of the dead must -approach within thirty feet of it--they turned and went back to one of -the prayer-houses within the gates, to pray for the spirit of their dead. -The bearers unlocked the Tower's sole door and disappeared from view -within. In a little while they came out bringing the bier and the white -covering-cloth, and locked the door again. Then the ring of vultures -rose, flapping their wings, and swooped down into the Tower to devour the -body. Nothing was left of it but a clean-picked skeleton when they -flocked-out again a few minutes afterward. - -The principle which underlies and orders everything connected with a -Parsee funeral is Purity. By the tenets of the Zoroastrian religion, the -elements, Earth, Fire, and Water, are sacred, and must not be -contaminated by contact with a dead body. Hence corpses must not be -burned, neither must they be buried. None may touch the dead or enter -the Towers where they repose except certain men who are officially -appointed for that purpose. They receive high pay, but theirs is a -dismal life, for they must live apart from their species, because their -commerce with the dead defiles them, and any who should associate with -them would share their defilement. When they come out of the Tower the -clothes they are wearing are exchanged for others, in a building within -the grounds, and the ones which they have taken off are left behind, for -they are contaminated, and must never be used again or suffered to go -outside the grounds. These bearers come to every funeral in new -garments. So far as is known, no human being, other than an official -corpse-bearer--save one--has ever entered a Tower of Silence after its -consecration. Just a hundred years ago a European rushed in behind the -bearers and fed his brutal curiosity with a glimpse of the forbidden -mysteries of the place. This shabby savage's name is not given; his -quality is also concealed. These two details, taken in connection with -the fact that for his extraordinary offense the only punishment he got -from the East India Company's Government was a solemn official -"reprimand"--suggest the suspicion that he was a European of consequence. -The same public document which contained the reprimand gave warning that -future offenders of his sort, if in the Company's service, would be -dismissed; and if merchants, suffer revocation of license and exile to -England. - -The Towers are not tall, but are low in proportion to their -circumference, like a gasometer. If you should fill a gasometer half way -up with solid granite masonry, then drive a wide and deep well down -through the center of this mass of masonry, you would have the idea of a -Tower of Silence. On the masonry surrounding the well the bodies lie, in -shallow trenches which radiate like wheel-spokes from the well. The -trenches slant toward the well and carry into it the rainfall. -Underground drains, with charcoal filters in them, carry off this water -from the bottom of the well. - -When a skeleton has lain in the Tower exposed to the rain and the flaming -sun a month it is perfectly dry and clean. Then the same bearers that -brought it there come gloved and take it up with tongs and throw it into -the well. There it turns to dust. It is never seen again, never touched -again, in the world. Other peoples separate their dead, and preserve and -continue social distinctions in the grave--the skeletons of kings and -statesmen and generals in temples and pantheons proper to skeletons of -their degree, and the skeletons of the commonplace and the poor in places -suited to their meaner estate; but the Parsees hold that all men rank -alike in death--all are humble, all poor, all destitute. In sign of -their poverty they are sent to their grave naked, in sign of their -equality the bones of the rich, the poor, the illustrious and the obscure -are flung into the common well together. At a Parsee funeral there are -no vehicles; all concerned must walk, both rich and poor, howsoever great -the distance to be traversed may be. In the wells of the Five Towers of -Silence is mingled the dust of all the Parsee men and women and children -who have died in Bombay and its vicinity during the two centuries which -have elapsed since the Mohammedan conquerors drove the Parsees out of -Persia, and into that region of India. The earliest of the five towers -was built by the Modi family something more than 200 years ago, and it is -now reserved to the heirs of that house; none but the dead of that blood -are carried thither. - -The origin of at least one of the details of a Parsee funeral is not now -known--the presence of the dog. Before a corpse is borne from the house -of mourning it must be uncovered and exposed to the gaze of a dog; a dog -must also be led in the rear of the funeral. Mr. Nusserwanjee Byranijee, -Secretary to the Parsee Punchayet, said that these formalities had once -had a meaning and a reason for their institution, but that they were -survivals whose origin none could now account for. Custom and tradition -continue them in force, antiquity hallows them. It is thought that in -ancient times in Persia the dog was a sacred animal and could guide souls -to heaven; also that his eye had the power of purifying objects which had -been contaminated by the touch of the dead; and that hence his presence -with the funeral cortege provides an ever-applicable remedy in case of -need. - -The Parsees claim that their method of disposing of the dead is an -effective protection of the living; that it disseminates no corruption, -no impurities of any sort, no disease-germs; that no wrap, no garment -which has touched the dead is allowed to touch the living afterward; that -from the Towers of Silence nothing proceeds which can carry harm to the -outside world. These are just claims, I think. As a sanitary measure, -their system seems to be about the equivalent of cremation, and as sure. -We are drifting slowly--but hopefully--toward cremation in these days. -It could not be expected that this progress should be swift, but if it be -steady and continuous, even if slow, that will suffice. When cremation -becomes the rule we shall cease to shudder at it; we should shudder at -burial if we allowed ourselves to think what goes on in the grave. - -The dog was an impressive figure to me, representing as he did a mystery -whose key is lost. He was humble, and apparently depressed; and he let -his head droop pensively, and looked as if he might be trying to call -back to his mind what it was that he had used to symbolize ages ago when -he began his function. There was another impressive thing close at hand, -but I was not privileged to see it. That was the sacred fire--a fire -which is supposed to have been burning without interruption for more than -two centuries; and so, living by the same heat that was imparted to it so -long ago. - -The Parsees are a remarkable community. There are only about 60,000 in -Bombay, and only about half as many as that in the rest of India; but -they make up in importance what they lack in numbers. They are highly -educated, energetic, enterprising, progressive, rich, and the Jew himself -is not more lavish or catholic in his charities and benevolences. The -Parsees build and endow hospitals, for both men and animals; and they and -their womenkind keep an open purse for all great and good objects. They -are a political force, and a valued support to the government. They have -a pure and lofty religion, and they preserve it in its integrity and -order their lives by it. - -We took a final sweep of the wonderful view of plain and city and ocean, -and so ended our visit to the garden and the Towers of Silence; and the -last thing I noticed was another symbol--a voluntary symbol this one; it -was a vulture standing on the sawed-off top of a tall and slender and -branchless palm in an open space in the ground; he was perfectly -motionless, and looked like a piece of sculpture on a pillar. And he had -a mortuary look, too, which was in keeping with the place. - - - - -CHAPTER XLI. - -There is an old-time toast which is golden for its beauty. -"When you ascend the hill of prosperity may you not meet a friend." - --Pudd'nhead Wilson's New Calendar. - -The next picture that drifts across the field of my memory is one which -is connected with religious things. We were taken by friends to see a -Jain temple. It was small, and had many flags or streamers flying from -poles standing above its roof; and its little battlements supported a -great many small idols or images. Upstairs, inside, a solitary Jain was -praying or reciting aloud in the middle of the room. Our presence did -not interrupt him, nor even incommode him or modify his fervor. Ten or -twelve feet in front of him was the idol, a small figure in a sitting -posture. It had the pinkish look of a wax doll, but lacked the doll's -roundness of limb and approximation to correctness of form and justness -of proportion. Mr. Gandhi explained every thing to us. He was delegate -to the Chicago Fair Congress of Religions. It was lucidly done, in -masterly English, but in time it faded from me, and now I have nothing -left of that episode but an impression: a dim idea of a religious belief -clothed in subtle intellectual forms, lofty and clean, barren of fleshly -grossnesses; and with this another dim impression which connects that -intellectual system somehow with that crude image, that inadequate idol ---how, I do not know. Properly they do not seem to belong together. -Apparently the idol symbolized a person who had become a saint or a god -through accessions of steadily augmenting holiness acquired through a -series of reincarnations and promotions extending over many ages; and was -now at last a saint and qualified to vicariously receive worship and -transmit it to heaven's chancellery. Was that it? - -And thence we went to Mr. Premchand Roychand's bungalow, in Lovelane, -Byculla, where an Indian prince was to receive a deputation of the Jain -community who desired to congratulate him upon a high honor lately -conferred upon him by his sovereign, Victoria, Empress of India. She had -made him a knight of the order of the Star of India. It would seem that -even the grandest Indian prince is glad to add the modest title "Sir" to -his ancient native grandeurs, and is willing to do valuable service to -win it. He will remit taxes liberally, and will spend money freely upon -the betterment of the condition of his subjects, if there is a knighthood -to be gotten by it. And he will also do good work and a deal of it to -get a gun added to the salute allowed him by the British Government. -Every year the Empress distributes knighthoods and adds guns for public -services done by native princes. The salute of a small prince is three -or four guns; princes of greater consequence have salutes that run higher -and higher, gun by gun,--oh, clear away up to eleven; possibly more, but -I did not hear of any above eleven-gun princes. I was told that when a -four-gun prince gets a gun added, he is pretty troublesome for a while, -till the novelty wears off, for he likes the music, and keeps hunting up -pretexts to get himself saluted. It may be that supremely grand folk, -like the Nyzam of Hyderabad and the Gaikwar of Baroda, have more than -eleven guns, but I don't know. - -When we arrived at the bungalow, the large hall on the ground floor was -already about full, and carriages were still flowing into the grounds. -The company present made a fine show, an exhibition of human fireworks, -so to speak, in the matters of costume and comminglings of brilliant -color. The variety of form noticeable in the display of turbans was -remarkable. We were told that the explanation of this was, that this -Jain delegation was drawn from many parts of India, and that each man -wore the turban that was in vogue in his own region. This diversity of -turbans made a beautiful effect. - -I could have wished to start a rival exhibition there, of Christian hats -and clothes. I would have cleared one side of the room of its Indian -splendors and repacked the space with Christians drawn from America, -England, and the Colonies, dressed in the hats and habits of now, and of -twenty and forty and fifty years ago. It would have been a hideous -exhibition, a thoroughly devilish spectacle. Then there would have been -the added disadvantage of the white complexion. It is not an unbearably -unpleasant complexion when it keeps to itself, but when it comes into -competition with masses of brown and black the fact is betrayed that it -is endurable only because we are used to it. Nearly all black and brown -skins are beautiful, but a beautiful white skin is rare. How rare, one -may learn by walking down a street in Paris, New York, or London on a -week-day particularly an unfashionable street--and keeping count of the -satisfactory complexions encountered in the course of a mile. Where dark -complexions are massed, they make the whites look bleached-out, -unwholesome, and sometimes frankly ghastly. I could notice this as a -boy, down South in the slavery days before the war. The splendid black -satin skin of the South African Zulus of Durban seemed to me to come very -close to perfection. I can see those Zulus yet--'ricksha athletes -waiting in front of the hotel for custom; handsome and intensely black -creatures, moderately clothed in loose summer stuffs whose snowy -whiteness made the black all the blacker by contrast. Keeping that group -in my mind, I can compare those complexions with the white ones which are -streaming past this London window now: - - A lady. Complexion, new parchment. Another lady. Complexion, old - parchment. - - Another. Pink and white, very fine. - - Man. Grayish skin, with purple areas. - - Man. Unwholesome fish-belly skin. - - Girl. Sallow face, sprinkled with freckles. - - Old woman. Face whitey-gray. - - Young butcher. Face a general red flush. - - Jaundiced man--mustard yellow. - - Elderly lady. Colorless skin, with two conspicuous moles. - - Elderly man--a drinker. Boiled-cauliflower nose in a flabby face - veined with purple crinklings. - - Healthy young gentleman. Fine fresh complexion. - - Sick young man. His face a ghastly white. - -No end of people whose skins are dull and characterless modifications of -the tint which we miscall white. Some of these faces are pimply; some -exhibit other signs of diseased blood; some show scars of a tint out of a -harmony with the surrounding shades of color. The white man's complexion -makes no concealments. It can't. It seemed to have been designed as a -catch-all for everything that can damage it. Ladies have to paint it, -and powder it, and cosmetic it, and diet it with arsenic, and enamel it, -and be always enticing it, and persuading it, and pestering it, and -fussing at it, to make it beautiful; and they do not succeed. But these -efforts show what they think of the natural complexion, as distributed. -As distributed it needs these helps. The complexion which they try to -counterfeit is one which nature restricts to the few--to the very few. -To ninety-nine persons she gives a bad complexion, to the hundredth a -good one. The hundredth can keep it--how long? Ten years, perhaps. - -The advantage is with the Zulu, I think. He starts with a beautiful -complexion, and it will last him through. And as for the Indian brown ---firm, smooth, blemishless, pleasant and restful to the eye, afraid of no -color, harmonizing with all colors and adding a grace to them all--I -think there is no sort of chance for the average white complexion against -that rich and perfect tint. - -To return to the bungalow. The most gorgeous costume present were worn -by some children. They seemed to blaze, so bright were the colors, and -so brilliant the jewels strum over the rich materials. These children -were professional nautch-dancers, and looked like girls, but they were -boys, They got up by ones and twos and fours, and danced and sang to an -accompaniment of weird music. Their posturings and gesturings were -elaborate and graceful, but their voices were stringently raspy and -unpleasant, and there was a good deal of monotony about the tune. - -By and by there was a burst of shouts and cheers outside and the prince -with his train entered in fine dramatic style. He was a stately man, he -was ideally costumed, and fairly festooned with ropes of gems; some of -the ropes were of pearls, some were of uncut great emeralds--emeralds -renowned in Bombay for their quality and value. Their size was -marvelous, and enticing to the eye, those rocks. A boy--a princeling ---was with the prince, and he also was a radiant exhibition. - -The ceremonies were not tedious. The prince strode to his throne with -the port and majesty--and the sternness--of a Julius Caesar coming to -receive and receipt for a back-country kingdom and have it over and get -out, and no fooling. There was a throne for the young prince, too, and -the two sat there, side by side, with their officers grouped at either -hand and most accurately and creditably reproducing the pictures which -one sees in the books--pictures which people in the prince's line of -business have been furnishing ever since Solomon received the Queen of -Sheba and showed her his things. The chief of the Jain delegation read -his paper of congratulations, then pushed it into a beautifully engraved -silver cylinder, which was delivered with ceremony into the prince's -hands and at once delivered by him without ceremony into the hands of an -officer. I will copy the address here. It is interesting, as showing -what an Indian prince's subject may have opportunity to thank him for in -these days of modern English rule, as contrasted with what his ancestor -would have given them opportunity to thank him for a century and a half -ago--the days of freedom unhampered by English interference. A century -and a half ago an address of thanks could have been put into small space. -It would have thanked the prince-- - - 1. For not slaughtering too many of his people upon mere caprice; - - 2. For not stripping them bare by sudden and arbitrary tax levies, - and bringing famine upon them; - - 3. For not upon empty pretext destroying the rich and seizing their - property; - - 4. For not killing, blinding, imprisoning, or banishing the - relatives of the royal house to protect the throne from possible - plots; - - 5. For not betraying the subject secretly, for a bribe, into the - hands of bands of professional Thugs, to be murdered and robbed in - the prince's back lot. - -Those were rather common princely industries in the old times, but they -and some others of a harsh sort ceased long ago under English rule. -Better industries have taken their place, as this Address from the Jain -community will show: - - "Your Highness,--We the undersigned members of the Jain community of - Bombay have the pleasure to approach your Highness with the - expression of our heartfelt congratulations on the recent conference - on your Highness of the Knighthood of the Most Exalted Order of the - Star of India. Ten years ago we had the pleasure and privilege of - welcoming your Highness to this city under circumstances which have - made a memorable epoch in the history of your State, for had it not - been for a generous and reasonable spirit that your Highness - displayed in the negotiations between the Palitana Durbar and the - Jain community, the conciliatory spirit that animated our people - could not have borne fruit. That was the first step in your - Highness's administration, and it fitly elicited the praise of the - Jain community, and of the Bombay Government. A decade of your - Highness's administration, combined with the abilities, training, - and acquirements that your Highness brought to bear upon it, has - justly earned for your Highness the unique and honourable - distinction--the Knighthood of the Most Exalted Order of the Star of - India, which we understand your Highness is the first to enjoy among - Chiefs of your, Highness's rank and standing. And we assure your - Highness that for this mark of honour that has been conferred on you - by Her Most Gracious Majesty, the Queen-Empress, we feel no less - proud than your Highness. Establishment of commercial factories, - schools, hospitals, etc., by your Highness in your State has marked - your Highness's career during these ten years, and we trust that - your Highness will be spared to rule over your people with wisdom - and foresight, and foster the many reforms that your Highness has - been pleased to introduce in your State. We again offer your - Highness our warmest felicitations for the honour that has been - conferred on you. We beg to remain your Highness's obedient - servants." - -Factories, schools, hospitals, reforms. The prince propagates that kind -of things in the modern times, and gets knighthood and guns for it. - -After the address the prince responded with snap and brevity; spoke a -moment with half a dozen guests in English, and with an official or two -in a native tongue; then the garlands were distributed as usual, and the -function ended. - - - - -CHAPTER XLII. - -Each person is born to one possession which outvalues all his others--his -last breath. - --Pudd'nhead Wilson's New Calendar. - -Toward midnight, that night, there was another function. This was a -Hindoo wedding--no, I think it was a betrothal ceremony. Always before, -we had driven through streets that were multitudinous and tumultuous with -picturesque native life, but now there was nothing of that. We seemed to -move through a city of the dead. There was hardly a suggestion of life -in those still and vacant streets. Even the crows were silent. But -everywhere on the ground lay sleeping natives-hundreds and hundreds. -They lay stretched at full length and tightly wrapped in blankets, beads -and all. Their attitude and their rigidity counterfeited death. The -plague was not in Bombay then, but it is devastating the city now. The -shops are deserted, now, half of the people have fled, and of the -remainder the smitten perish by shoals every day. No doubt the city -looks now in the daytime as it looked then at night. When we had pierced -deep into the native quarter and were threading its narrow dim lanes, we -had to go carefully, for men were stretched asleep all about and there -was hardly room to drive between them. And every now and then a swarm of -rats would scamper across past the horses' feet in the vague light--the -forbears of the rats that are carrying the plague from house to house in -Bombay now. The shops were but sheds, little booths open to the street; -and the goods had been removed, and on the counters families were -sleeping, usually with an oil lamp present. Recurrent dead watches, it -looked like. - -But at last we turned a corner and saw a great glare of light ahead. It -was the home of the bride, wrapped in a perfect conflagration of -illuminations,--mainly gas-work designs, gotten up specially for the -occasion. Within was abundance of brilliancy--flames, costumes, colors, -decorations, mirrors--it was another Aladdin show. - -The bride was a trim and comely little thing of twelve years, dressed as -we would dress a boy, though more expensively than we should do it, of -course. She moved about very much at her ease, and stopped and talked -with the guests and allowed her wedding jewelry to be examined. It was -very fine. Particularly a rope of great diamonds, a lovely thing to look -at and handle. It had a great emerald hanging to it. - -The bridegroom was not present. He was having betrothal festivities of -his own at his father's house. As I understood it, he and the bride were -to entertain company every night and nearly all night for a week or more, -then get married, if alive. Both of the children were a little elderly, -as brides and grooms go, in India--twelve; they ought to have been -married a year or two sooner; still to a, stranger twelve seems quite -young enough. - -A while after midnight a couple of celebrated and high-priced -nautch-girls appeared in the gorgeous place, and danced and sang. With -them were men who played upon strange instruments which made uncanny -noises of a sort to make one's flesh creep. One of these instruments was -a pipe, and to its music the girls went through a performance which -represented snake charming. It seemed a doubtful sort of music to charm -anything with, but a native gentleman assured me that snakes like it and -will come out of their holes and listen to it with every evidence of -refreshment And gratitude. He said that at an entertainment in his -grounds once, the pipe brought out half a dozen snakes, and the music had -to be stopped before they would be persuaded to go. Nobody wanted their -company, for they were bold, familiar, and dangerous; but no one would -kill them, of course, for it is sinful for a Hindoo to kill any kind of a -creature. - -We withdrew from the festivities at two in the morning. Another picture, -then--but it has lodged itself in my memory rather as a stage-scene than -as a reality. It is of a porch and short flight of steps crowded with -dark faces and ghostly-white draperies flooded with the strong glare from -the dazzling concentration of illuminations; and midway of the steps one -conspicuous figure for accent--a turbaned giant, with a name according to -his size: Rao Bahadur Baskirao Balinkanje Pitale, Vakeel to his Highness -the Gaikwar of Baroda. Without him the picture would not have been -complete; and if his name had been merely Smith, he wouldn't have -answered. Close at hand on house-fronts on both sides of the narrow -street were illuminations of a kind commonly employed by the natives ---scores of glass tumblers (containing tapers) fastened a few in inches -apart all over great latticed frames, forming starry constellations which -showed out vividly against their black back grounds. As we drew away -into the distance down the dim lanes the illuminations gathered together -into a single mass, and glowed out of the enveloping darkness like a sun. - -Then again the deep silence, the skurrying rats, the dim forms stretched -every-where on the ground; and on either hand those open booths -counterfeiting sepulchres, with counterfeit corpses sleeping motionless -in the flicker of the counterfeit death lamps. And now, a year later, -when I read the cablegrams I seem to be reading of what I myself partly -saw--saw before it happened--in a prophetic dream, as it were. One -cablegram says, "Business in the native town is about suspended. Except -the wailing and the tramp of the funerals. There is but little life or -movement. The closed shops exceed in number those that remain open." -Another says that 325,000 of the people have fled the city and are -carrying the plague to the country. Three days later comes the news, -"The population is reduced by half." The refugees have carried the -disease to Karachi; "220 cases, 214 deaths." A day or two later, "52 -fresh cases, all of which proved fatal." - -The plague carries with it a terror which no other disease can excite; -for of all diseases known to men it is the deadliest--by far the -deadliest. "Fifty-two fresh cases--all fatal." It is the Black Death -alone that slays like that. We can all imagine, after a fashion, the -desolation of a plague-stricken city, and the stupor of stillness broken -at intervals by distant bursts of wailing, marking the passing of -funerals, here and there and yonder, but I suppose it is not possible for -us to realize to ourselves the nightmare of dread and fear that possesses -the living who are present in such a place and cannot get away. That -half million fled from Bombay in a wild panic suggests to us something of -what they were feeling, but perhaps not even they could realize what the -half million were feeling whom they left stranded behind to face the -stalking horror without chance of escape. Kinglake was in Cairo many -years ago during an epidemic of the Black Death, and he has imagined the -terrors that creep into a man's heart at such a time and follow him until -they themselves breed the fatal sign in the armpit, and then the delirium -with confused images, and home-dreams, and reeling billiard-tables, and -then the sudden blank of death: - - "To the contagionist, filled as he is with the dread of final - causes, having no faith in destiny, nor in the fixed will of God, - and with none of the devil-may-care indifference which might stand - him instead of creeds--to such one, every rag that shivers in the - breeze of a plague-stricken city has this sort of sublimity. If by - any terrible ordinance he be forced to venture forth, be sees death - dangling from every sleeve; and, as he creeps forward, he poises his - shuddering limbs between the imminent jacket that is stabbing at his - right elbow and the murderous pelisse that threatens to mow him - clean down as it sweeps along on his left. But most of all he - dreads that which most of all he should love--the touch of a woman's - dress; for mothers and wives, hurrying forth on kindly errands from - the bedsides of the dying, go slouching along through the streets - more willfully and less courteously than the men. For a while it - may be that the caution of the poor Levantine may enable him to - avoid contact, but sooner or later, perhaps, the dreaded chance - arrives; that bundle of linen, with the dark tearful eyes at the top - of it, that labors along with the voluptuous clumsiness of Grisi - --she has touched the poor Levantine with the hem of her sleeve! From - that dread moment his peace is gone; his mind for ever hanging upon - the fatal touch invites the blow which he fears; he watches for the - symptoms of plague so carefully, that sooner or later they come in - truth. The parched mouth is a sign--his mouth is parched; the - throbbing brain--his brain does throb; the rapid pulse--he touches - his own wrist (for he dares not ask counsel of any man lest he be - deserted), he touches his wrist, and feels how his frighted blood - goes galloping out of his heart. There is nothing but the fatal - swelling that is wanting to make his sad conviction complete; - immediately, he has an odd feel under the arm--no pain, but a little - straining of the skin; he would to God it were his fancy that were - strong enough to give him that sensation; this is the worst of all. - It now seems to him that he could be happy and contented with his - parched mouth, and his throbbing brain, and his rapid pulse, if only - he could know that there were no swelling under the left arm; but - dares he try?--in a moment of calmness and deliberation he dares - not; but when for a while he has writhed under the torture of - suspense, a sudden strength of will drives him to seek and know his - fate; he touches the gland, and finds the skin sane and sound but - under the cuticle there lies a small lump like a pistol-bullet, that - moves as he pushes it. Oh! but is this for all certainty, is this - the sentence of death? Feel the gland of the other arm. There is - not the same lump exactly, yet something a little like it. Have not - some people glands naturally enlarged?--would to heaven he were one! - So he does for himself the work of the plague, and when the Angel of - Death thus courted does indeed and in truth come, he has only to - finish that which has been so well begun; he passes his fiery hand - over the brain of the victim, and lets him rave for a season, but - all chance-wise, of people and things once dear, or of people and - things indifferent. Once more the poor fellow is back at his home - in fair Provence, and sees the sundial that stood in his childhood's - garden--sees his mother, and the long-since forgotten face of that - little dear sister--(he sees her, he says, on a Sunday morning, for - all the church bells are ringing); he looks up and down through the - universe, and owns it well piled with bales upon bales of cotton, - and cotton eternal--so much so that he feels--he knows--he swears he - could make that winning hazard, if the billiard-table would not - slant upwards, and if the cue were a cue worth playing with; but it - is not--it's a cue that won't move--his own arm won't move--in - short, there's the devil to pay in the brain of the poor Levantine; - and perhaps, the next night but one he becomes the 'life and the - soul' of some squalling jackal family, who fish him out by the foot - from his shallow and sandy grave." - - - - -CHAPTER XLIII. - -Hunger is the handmaid of genius - --Pudd'nhead Wilson's New Calendar. - -One day during our stay in Bombay there was a criminal trial of a most -interesting sort, a terribly realistic chapter out of the "Arabian -Nights," a strange mixture of simplicities and pieties and murderous -practicalities, which brought back the forgotten days of Thuggee and made -them live again; in fact, even made them believable. It was a case where -a young girl had been assassinated for the sake of her trifling -ornaments, things not worth a laborer's day's wages in America. This -thing could have been done in many other countries, but hardly with the -cold business-like depravity, absence of fear, absence of caution, -destitution of the sense of horror, repentance, remorse, exhibited in -this case. Elsewhere the murderer would have done his crime secretly, by -night, and without witnesses; his fears would have allowed him no peace -while the dead body was in his neighborhood; he would not have rested -until he had gotten it safe out of the way and hidden as effectually as -he could hide it. But this Indian murderer does his deed in the full -light of day, cares nothing for the society of witnesses, is in no way -incommoded by the presence of the corpse, takes his own time about -disposing of it, and the whole party are so indifferent, so phlegmatic, -that they take their regular sleep as if nothing was happening and no -halters hanging over them; and these five bland people close the episode -with a religious service. The thing reads like a Meadows-Taylor Thug-tale -of half a century ago, as may be seen by the official report of the -trial: - - "At the Mazagon Police Court yesterday, Superintendent Nolan again - charged Tookaram Suntoo Savat Baya, woman, her daughter Krishni, and - Gopal Yithoo Bhanayker, before Mr. Phiroze Hoshang Dastur, Fourth - Presidency Magistrate, under sections 302 and 109 of the Code, with - having on the night of the 30th of December last murdered a Hindoo - girl named Cassi, aged 12, by strangulation, in the room of a chawl - at Jakaria Bunder, on the Sewriroad, and also with aiding and - abetting each other in the commission of the offense. - - "Mr. F. A. Little, Public Prosecutor, conducted the case on behalf - of the Crown, the accused being undefended. - - "Mr. Little applied under the provisions of the Criminal Procedure - Code to tender pardon to one of the accused, Krishni, woman, aged - 22, on her undertaking to make a true and full statement of facts - under which the deceased girl Cassi was murdered. - - "The Magistrate having granted the Public Prosecutor's application, - the accused Krishni went into the witness-box, and, on being - examined by Mr. Little, made the following confession:--I am a - mill-hand employed at the Jubilee Mill. I recollect the day - (Tuesday); on which the body of the deceased Cassi was found. - Previous to that I attended the mill for half a day, and then - returned home at 3 in the afternoon, when I saw five persons in the - house, viz.: the first accused Tookaram, who is my paramour, my - mother, the second accused Baya, the accused Gopal, and two guests - named Ramji Daji and Annaji Gungaram. Tookaram rented the room of - the chawl situated at Jakaria Bunder-road from its owner, - Girdharilal Radhakishan, and in that room I, my paramour, Tookaram, - and his younger brother, Yesso Mahadhoo, live. Since his arrival in - Bombay from his native country Yesso came and lived with us. When I - returned from the mill on the afternoon of that day, I saw the two - guests seated on a cot in the veranda, and a few minutes after the - accused Gopal came and took his seat by their side, while I and my - mother were seated inside the room. Tookaram, who had gone out to - fetch some 'pan' and betelnuts, on his return home had brought the - two guests with him. After returning home he gave them 'pan - supari'. While they were eating it my mother came out of the room - and inquired of one of the guests, Ramji, what had happened to his - foot, when he replied that he had tried many remedies, but they had - done him no good. My mother then took some rice in her hand and - prophesied that the disease which Ramji was suffering from would not - be cured until he returned to his native country. In the meantime - the deceased Casi came from the direction of an out-house, and stood - in front on the threshold of our room with a 'lota' in her hand. - Tookaram then told his two guests to leave the room, and they then - went up the steps towards the quarry. After the guests had gone - away, Tookaram seized the deceased, who had come into the room, and - he afterwards put a waistband around her, and tied her to a post - which supports a loft. After doing this, he pressed the girl's - throat, and, having tied her mouth with the 'dhotur' (now shown in - Court), fastened it to the post. Having killed the girl, Tookaram - removed her gold head ornament and a gold 'putlee', and also took - charge of her 'lota'. Besides these two ornaments Cassi had on her - person ear-studs a nose-ring, some silver toe-rings, two necklaces, - a pair of silver anklets and bracelets. Tookaram afterwards tried - to remove the silver amulets, the ear-studs, and the nose-ring; but - he failed in his attempt. While he was doing so, I, my mother, and - Gopal were present. After removing the two gold ornaments, he - handed them over to Gopal, who was at the time standing near me. - When he killed Cassi, Tookaram threatened to strangle me also if I - informed any one of this. Gopal and myself were then standing at - the door of our room, and we both were threatened by Tookaram. My - mother, Baya, had seized the legs of the deceased at the time she - was killed, and whilst she was being tied to the post. Cassi then - made a noise. Tookaram and my mother took part in killing the girl. - After the murder her body was wrapped up in a mattress and kept on - the loft over the door of our room. When Cassi was strangled, the - door of the room was fastened from the inside by Tookaram. This - deed was committed shortly after my return home from work in the - mill. Tookaram put the body of the deceased in the mattress, and, - after it was left on the loft, he went to have his head shaved by a - barber named Sambhoo Raghoo, who lives only one door away from me. - My mother and myself then remained in the possession of the - information. I was slapped and threatened by my paramour, Tookaram, - and that was the only reason why I did not inform any one at that - time. When I told Tookaram that I would give information of the - occurrence, he slapped me. The accused Gopal was asked by Tookaram - to go back to his room, and he did so, taking away with him the two - gold ornaments and the 'lota'. Yesso Mahadhoo, a brother-in-law of - Tookaram, came to the house and asked Taokaram why he was washing, - the water-pipe being just opposite. Tookaram replied that he was - washing his dhotur, as a fowl had polluted it. About 6 o'clock of - the evening of that day my mother gave me three pice and asked me to - buy a cocoanut, and I gave the money to Yessoo, who went and fetched - a cocoanut and some betel leaves. When Yessoo and others were in - the room I was bathing, and, after I finished my bath, my mother - took the cocoanut and the betel leaves from Yessoo, and we five went - to the sea. The party consisted of Tookaram, my mother, Yessoo, - Tookaram's younger brother, and myself. On reaching the seashore, - my mother made the offering to the sea, and prayed to be pardoned - for what we had done. Before we went to the sea, some one came to - inquire after the girl Cassi. The police and other people came to - make these inquiries both before and after we left the house for the - seashore. The police questioned my mother about the girl, and she - replied that Cassi had come to her door, but had left. The next day - the police questioned Tookaram, and he, too, gave a similar reply. - This was said the same night when the search was made for the girl. - After the offering was made to the sea, we partook of the cocoanut - and returned home, when my mother gave me some food; but Tookaram - did not partake of any food that night. After dinner I and my - mother slept inside the room, and Tookaram slept on a cot near his - brother-in-law, Yessoo Mahadhoo, just outside the door. That was - not the usual place where Tookaram slept. He usually slept inside - the room. The body of the deceased remained on the loft when I went - to sleep. The room in which we slept was locked, and I heard that - my paramour, Tookaram, was restless outside. About 3 o'clock the - following morning Tookaram knocked at the door, when both myself and - my mother opened it. He then told me to go to the steps leading to - the quarry, and see if any one was about. Those steps lead to a - stable, through which we go to the quarry at the back of the - compound. When I got to the steps I saw no one there. Tookaram - asked me if any one was there, and I replied that I could see no one - about. He then took the body of the deceased from the loft, and - having wrapped it up in his saree, asked me to accompany him to the - steps of the quarry, and I did so. The 'saree' now produced here - was the same. Besides the 'saree', there was also a 'cholee' on the - body. He then carried the body in his arms, and went up the steps, - through the stable, and then to the right hand towards a Sahib's - bungalow, where Tookaram placed the body near a wall. All the time - I and my mother were with him. When the body was taken down, Yessoo - was lying on the cot. After depositing the body under the wall, we - all returned home, and soon after 5 a.m. the police again came and - took Tookaram away. About an hour after they returned and took me - and my mother away. We were questioned about it, when I made a - statement. Two hours later I was taken to the room, and I pointed - out this waistband, the 'dhotur', the mattress, and the wooden post - to Superintendent Nolan and Inspectors Roberts and Rashanali, in the - presence of my mother and Tookaram. Tookaram killed the girl Cassi - for her ornaments, which he wanted for the girl to whom he was - shortly going to be married. The body was found in the same place - where it was deposited by Tookaram." - -The criminal side of the native has always been picturesque, always -readable. The Thuggee and one or two other particularly outrageous -features of it have been suppressed by the English, but there is enough -of it left to keep it darkly interesting. One finds evidence of these -survivals in the newspapers. Macaulay has a light-throwing passage upon -this matter in his great historical sketch of Warren Hastings, where he -is describing some effects which followed the temporary paralysis of -Hastings' powerful government brought about by Sir Philip Francis and his -party: - - "The natives considered Hastings as a fallen man; and they acted - after their kind. Some of our readers may have seen, in India, a - cloud of crows pecking a sick vulture to death--no bad type of what - happens in that country as often as fortune deserts one who has been - great and dreaded. In an instant all the sycophants, who had lately - been ready to lie for him, to forge for him, to pander for him, to - poison for him, hasten to purchase the favor of his victorious - enemies by accusing him. An Indian government has only to let it be - understood that it wishes a particular man to be ruined, and in - twenty-four hours it will be furnished with grave charges, supported - by depositions so full and circumstantial that any person - unaccustomed to Asiatic mendacity would regard them as decisive. It - is well if the signature of the destined victim is not counterfeited - at the foot of some illegal compact, and if some treasonable paper - is not slipped into a hiding-place in his house." - -That was nearly a century and a quarter ago. An article in one of the -chief journals of India (the Pioneer) shows that in some respects the -native of to-day is just what his ancestor was then. Here are niceties -of so subtle and delicate a sort that they lift their breed of rascality -to a place among the fine arts, and almost entitle it to respect: - - "The records of the Indian courts might certainly be relied upon to - prove that swindlers as a class in the East come very close to, if - they do not surpass, in brilliancy of execution and originality of - design the most expert of their fraternity in Europe and America. - India in especial is the home of forgery. There are some particular - districts which are noted as marts for the finest specimens of the - forger's handiwork. The business is carried on by firms who possess - stores of stamped papers to suit every emergency. They habitually - lay in a store of fresh stamped papers every year, and some of the - older and more thriving houses can supply documents for the past - forty years, bearing the proper water-mark and possessing the - genuine appearance of age. Other districts have earned notoriety - for skilled perjury, a pre-eminence that excites a respectful - admiration when one thinks of the universal prevalence of the art, - and persons desirous of succeeding in false suits are ready to pay - handsomely to avail themselves of the services of these local - experts as witnesses." - -Various instances illustrative of the methods of these swindlers are -given. They exhibit deep cunning and total depravity on the part of the -swindler and his pals, and more obtuseness on the part of the victim than -one would expect to find in a country where suspicion of your neighbor -must surely be one of the earliest things learned. The favorite subject -is the young fool who has just come into a fortune and is trying to see -how poor a use he can put it to. I will quote one example: - - "Sometimes another form of confidence trick is adopted, which is - invariably successful. The particular pigeon is spotted, and, his - acquaintance having been made, he is encouraged in every form of - vice. When the friendship is thoroughly established, the swindler - remarks to the young man that he has a brother who has asked him to - lend him Rs.10,000. The swindler says he has the money and would - lend it; but, as the borrower is his brother, he cannot charge - interest. So he proposes that he should hand the dupe the money, - and the latter should lend it to the swindler's brother, exacting a - heavy pre-payment of interest which, it is pointed out, they may - equally enjoy in dissipation. The dupe sees no objection, and on - the appointed day receives Rs.7,000 from the swindler, which he - hands over to the confederate. The latter is profuse in his thanks, - and executes a promissory note for Rs.10,000, payable to bearer. - The swindler allows the scheme to remain quiescent for a time, and - then suggests that, as the money has not been repaid and as it would - be unpleasant to sue his brother, it would be better to sell the - note in the bazaar. The dupe hands the note over, for the money he - advanced was not his, and, on being informed that it would be - necessary to have his signature on the back so as to render the - security negotiable, he signs without any hesitation. The swindler - passes it on to confederates, and the latter employ a respectable - firm of solicitors to ask the dupe if his signature is genuine. He - admits it at once, and his fate is sealed. A suit is filed by a - confederate against the dupe, two accomplices being made - co-defendants. They admit their Signatures as indorsers, and the - one swears he bought the note for value from the dupe. The latter - has no defense, for no court would believe the apparently idle - explanation of the manner in which he came to endorse the note." - -There is only one India! It is the only country that has a monopoly of -grand and imposing specialties. When another country has a remarkable -thing, it cannot have it all to itself--some other country has a -duplicate. But India--that is different. Its marvels are its own; the -patents cannot be infringed; imitations are not possible. And think of -the size of them, the majesty of them, the weird and outlandish character -of the most of them! - -There is the Plague, the Black Death: India invented it; India is the -cradle of that mighty birth. - -The Car of Juggernaut was India's invention. - -So was the Suttee; and within the time of men still living eight hundred -widows willingly, and, in fact, rejoicingly, burned themselves to death -on the bodies of their dead husbands in a single year. Eight hundred -would do it this year if the British government would let them. - -Famine is India's specialty. Elsewhere famines are inconsequential -incidents--in India they are devastating cataclysms; in one case they -annihilate hundreds; in the other, millions. - -India had 2,000,000 gods, and worships them all. In religion all other -countries are paupers; India is the only millionaire. - -With her everything is on a giant scale--even her poverty; no other -country can show anything to compare with it. And she has been used to -wealth on so vast a scale that she has to shorten to single words the -expressions describing great sums. She describes 100,000 with one word ---a 'lahk'; she describes ten millions with one word--a 'crore'. - -In the bowels of the granite mountains she has patiently carved out -dozens of vast temples, and made them glorious with sculptured colonnades -and stately groups of statuary, and has adorned the eternal walls with -noble paintings. She has built fortresses of such magnitude that the -show-strongholds of the rest of the world are but modest little things by -comparison; palaces that are wonders for rarity of materials, delicacy -and beauty of workmanship, and for cost; and one tomb which men go around -the globe to see. It takes eighty nations, speaking eighty languages, to -people her, and they number three hundred millions. - -On top of all this she is the mother and home of that wonder of wonders -caste--and of that mystery of mysteries, the satanic brotherhood of the -Thugs. - -India had the start of the whole world in the beginning of things. She -had the first civilization; she had the first accumulation of material -wealth; she was populous with deep thinkers and subtle intellects; she -had mines, and woods, and a fruitful soil. It would seem as if she -should have kept the lead, and should be to-day not the meek dependent of -an alien master, but mistress of the world, and delivering law and -command to every tribe and nation in it. But, in truth, there was never -any possibility of such supremacy for her. If there had been but one -India and one language--but there were eighty of them! Where there are -eighty nations and several hundred governments, fighting and quarreling -must be the common business of life; unity of purpose and policy are -impossible; out of such elements supremacy in the world cannot come. -Even caste itself could have had the defeating effect of a multiplicity -of tongues, no doubt; for it separates a people into layers, and layers, -and still other layers, that have no community of feeling with each -other; and in such a condition of things as that, patriotism can have no -healthy growth. - -It was the division of the country into so many States and nations that -made Thuggee possible and prosperous. It is difficult to realize the -situation. But perhaps one may approximate it by imagining the States of -our Union peopled by separate nations, speaking separate languages, with -guards and custom-houses strung along all frontiers, plenty of -interruptions for travelers and traders, interpreters able to handle all -the languages very rare or non-existent, and a few wars always going on -here and there and yonder as a further embarrassment to commerce and -excursioning. It would make intercommunication in a measure ungeneral. -India had eighty languages, and more custom-houses than cats. No clever -man with the instinct of a highway robber could fail to notice what a -chance for business was here offered. India was full of clever men with -the highwayman instinct, and so, quite naturally, the brotherhood of the -Thugs came into being to meet the long-felt want. - -How long ago that was nobody knows-centuries, it is supposed. One of the -chiefest wonders connected with it was the success with which it kept its -secret. The English trader did business in India two hundred years and -more before he ever heard of it; and yet it was assassinating its -thousands all around him every year, the whole time. - - - - -CHAPTER XLIV. - -The old saw says, "Let a sleeping dog lie." Right.... Still, when there -is much at stake it is better to get a newspaper to do it. - --Pudd'nhead Wilson's New Calendar. - -FROM DIARY: - -January 28. I learned of an official Thug-book the other day. I was -not aware before that there was such a thing. I am allowed the temporary -use of it. We are making preparations for travel. Mainly the -preparations are purchases of bedding. This is to be used in sleeping -berths in the trains; in private houses sometimes; and in nine-tenths of -the hotels. It is not realizable; and yet it is true. It is a survival; -an apparently unnecessary thing which in some strange way has outlived -the conditions which once made it necessary. It comes down from a time -when the railway and the hotel did not exist; when the occasional white -traveler went horseback or by bullock-cart, and stopped over night in the -small dak-bungalow provided at easy distances by the government--a -shelter, merely, and nothing more. He had to carry bedding along, or do -without. The dwellings of the English residents are spacious and -comfortable and commodiously furnished, and surely it must be an odd -sight to see half a dozen guests come filing into such a place and -dumping blankets and pillows here and there and everywhere. But custom -makes incongruous things congruous. - -One buys the bedding, with waterproof hold-all for it at almost any shop ---there is no difficulty about it. - -January 30. What a spectacle the railway station was, at train-time! It -was a very large station, yet when we arrived it seemed as if the whole -world was present--half of it inside, the other half outside, and both -halves, bearing mountainous head-loads of bedding and other freight, -trying simultaneously to pass each other, in opposing floods, in one -narrow door. These opposing floods were patient, gentle, long-suffering -natives, with whites scattered among them at rare intervals; and wherever -a white man's native servant appeared, that native seemed to have put -aside his natural gentleness for the time and invested himself with the -white man's privilege of making a way for himself by promptly shoving all -intervening black things out of it. In these exhibitions of authority -Satan was scandalous. He was probably a Thug in one of his former -incarnations. - -Inside the great station, tides upon tides of rainbow-costumed natives -swept along, this way and that, in massed and bewildering confusion, -eager, anxious, belated, distressed; and washed up to the long trains and -flowed into them with their packs and bundles, and disappeared, followed -at once by the next wash, the next wave. And here and there, in the -midst of this hurly-burly, and seemingly undisturbed by it, sat great -groups of natives on the bare stone floor,--young, slender brown women, -old, gray wrinkled women, little soft brown babies, old men, young men, -boys; all poor people, but all the females among them, both big and -little, bejeweled with cheap and showy nose-rings, toe-rings, leglets, -and armlets, these things constituting all their wealth, no doubt. These -silent crowds sat there with their humble bundles and baskets and small -household gear about them, and patiently waited--for what? A train that -was to start at some time or other during the day or night! They hadn't -timed themselves well, but that was no matter--the thing had been so -ordered from on high, therefore why worry? There was plenty of time, -hours and hours of it, and the thing that was to happen would happen ---there was no hurrying it. - -The natives traveled third class, and at marvelously cheap rates. They -were packed and crammed into cars that held each about fifty; and it was -said that often a Brahmin of the highest caste was thus brought into -personal touch, and consequent defilement, with persons of the lowest -castes--no doubt a very shocking thing if a body could understand it and -properly appreciate it. Yes, a Brahmin who didn't own a rupee and -couldn't borrow one, might have to touch elbows with a rich hereditary -lord of inferior caste, inheritor of an ancient title a couple of yards -long, and he would just have to stand it; for if either of the two was -allowed to go in the cars where the sacred white people were, it probably -wouldn't be the august poor Brahmin. There was an immense string of -those third-class cars, for the natives travel by hordes; and a weary -hard night of it the occupants would have, no doubt. - -When we reached our car, Satan and Barney had already arrived there with -their train of porters carrying bedding and parasols and cigar boxes, and -were at work. We named him Barney for short; we couldn't use his real -name, there wasn't time. - -It was a car that promised comfort; indeed, luxury. Yet the cost of it ---well, economy could no further go; even in France; not even in Italy. It -was built of the plainest and cheapest partially-smoothed boards, with a -coating of dull paint on them, and there was nowhere a thought of -decoration. The floor was bare, but would not long remain so when the -dust should begin to fly. Across one end of the compartment ran a -netting for the accommodation of hand-baggage; at the other end was a -door which would shut, upon compulsion, but wouldn't stay shut; it opened -into a narrow little closet which had a wash-bowl in one end of it, and a -place to put a towel, in case you had one with you--and you would be sure -to have towels, because you buy them with the bedding, knowing that the -railway doesn't furnish them. On each side of the car, and running fore -and aft, was a broad leather-covered sofa to sit on in the day and sleep -on at night. Over each sofa hung, by straps, a wide, flat, -leather-covered shelf--to sleep on. In the daytime you can hitch it up -against the wall, out of the way--and then you have a big unencumbered -and most comfortable room to spread out in. No car in any country is -quite its equal for comfort (and privacy) I think. For usually there are -but two persons in it; and even when there are four there is but little -sense of impaired privacy. Our own cars at home can surpass the railway -world in all details but that one: they have no cosiness; there are too -many people together. - -At the foot of each sofa was a side-door, for entrance and exit. -Along the whole length of the sofa on each side of the car ran a row of -large single-plate windows, of a blue tint-blue to soften the bitter -glare of the sun and protect one's eyes from torture. These could be let -down out of the way when one wanted the breeze. In the roof were two oil -lamps which gave a light strong enough to read by; each had a green-cloth -attachment by which it could be covered when the light should be no -longer needed. - -While we talked outside with friends, Barney and Satan placed the -hand-baggage, books, fruits, and soda-bottles in the racks, and the -hold-alls and heavy baggage in the closet, hung the overcoats and -sun-helmets and towels on the hooks, hoisted the two bed-shelves up out -of the way, then shouldered their bedding and retired to the third class. - -Now then, you see what a handsome, spacious, light, airy, homelike place -it was, wherein to walk up and down, or sit and write, or stretch out and -read and smoke. A central door in the forward end of the compartment -opened into a similar compartment. It was occupied by my wife and -daughter. About nine in the evening, while we halted a while at a -station, Barney and Satan came and undid the clumsy big hold-alls, and -spread the bedding on the sofas in both compartments--mattresses, sheets, -gay coverlets, pillows, all complete; there are no chambermaids in India ---apparently it was an office that was never heard of. Then they -closed the communicating door, nimbly tidied up our place, put the -night-clothing on the beds and the slippers under them, then returned -to their own quarters. - -January 31. It was novel and pleasant, and I stayed awake as long as I -could, to enjoy it, and to read about those strange people the Thugs. In -my sleep they remained with me, and tried to strangle me. The leader of -the gang was that giant Hindoo who was such a picture in the strong light -when we were leaving those Hindoo betrothal festivities at two o'clock in -the morning--Rao Bahadur Baskirao Balinkanje Pitale, Vakeel to the -Gaikwar of Baroda. It was he that brought me the invitation from his -master to go to Baroda and lecture to that prince--and now he was -misbehaving in my dreams. But all things can happen in dreams. It is -indeed as the Sweet Singer of Michigan says--irrelevantly, of course, for -the one and unfailing great quality which distinguishes her poetry from -Shakespeare's and makes it precious to us is its stern and simple -irrelevancy: - - My heart was gay and happy, - This was ever in my mind, - There is better times a coming, - And I hope some day to find - Myself capable of composing, - It was my heart's delight - To compose on a sentimental subject - If it came in my mind just right. - ---["The Sentimental Song Book," p. 49; theme, "The Author's Early Life," -19th stanza.] - - -Barroda. Arrived at 7 this morning. The dawn was just beginning to -show. It was forlorn to have to turn out in a strange place at such a -time, and the blinking lights in the station made it seem night still. -But the gentlemen who had come to receive us were there with their -servants, and they make quick work; there was no lost time. We were soon -outside and moving swiftly through the soft gray light, and presently -were comfortably housed--with more servants to help than we were used to, -and with rather embarassingly important officials to direct them. But it -was custom; they spoke Ballarat English, their bearing was charming and -hospitable, and so all went well. - -Breakfast was a satisfaction. Across the lawns was visible in the -distance through the open window an Indian well, with two oxen tramping -leisurely up and down long inclines, drawing water; and out of the -stillness came the suffering screech of the machinery--not quite musical, -and yet soothingly melancholy and dreamy and reposeful--a wail of lost -spirits, one might imagine. And commemorative and reminiscent, perhaps; -for of course the Thugs used to throw people down that well when they -were done with them. - -After breakfast the day began, a sufficiently busy one. We were driven -by winding roads through a vast park, with noble forests of great trees, -and with tangles and jungles of lovely growths of a humbler sort; and at -one place three large gray apes came out and pranced across the road--a -good deal of a surprise and an unpleasant one, for such creatures belong -in the menagerie, and they look artificial and out of place in a -wilderness. - -We came to the city, by and by, and drove all through it. Intensely -Indian, it was, and crumbly, and mouldering, and immemorially old, to all -appearance. And the houses--oh, indescribably quaint and curious they -were, with their fronts an elaborate lace-work of intricate and beautiful -wood-carving, and now and then further adorned with rude pictures of -elephants and princes and gods done in shouting colors; and all the -ground floors along these cramped and narrow lanes occupied as shops ---shops unbelievably small and impossibly packed with merchantable rubbish, -and with nine-tenths-naked natives squatting at their work of hammering, -pounding, brazing, soldering, sewing, designing, cooking, measuring out -grain, grinding it, repairing idols--and then the swarm of ragged and -noisy humanity under the horses' feet and everywhere, and the pervading -reek and fume and smell! It was all wonderful and delightful. - -Imagine a file of elephants marching through such a crevice of a street -and scraping the paint off both sides of it with their hides. How big -they must look, and how little they must make the houses look; and when -the elephants are in their glittering court costume, what a contrast they -must make with the humble and sordid surroundings. And when a mad -elephant goes raging through, belting right and left with his trunk, how -do these swarms of people get out of the way? I suppose it is a thing -which happens now and then in the mad season (for elephants have a mad -season). - -I wonder how old the town is. There are patches of building--massive -structures, monuments, apparently--that are so battered and worn, and -seemingly so tired and so burdened with the weight of age, and so dulled -and stupefied with trying to remember things they forgot before history -began, that they give one the feeling that they must have been a part of -original Creation. This is indeed one of the oldest of the princedoms of -India, and has always been celebrated for its barbaric pomps and -splendors, and for the wealth of its princes. - - - - -CHAPTER XLV. - -It takes your enemy and your friend, working together, to hurt you to the -heart; the one to slander you and the other to get the news to you. - --Pudd'nhead Wilson's New Calendar. - -Out of the town again; a long drive through open country, by winding -roads among secluded villages nestling in the inviting shade of tropic -vegetation, a Sabbath stillness everywhere, sometimes a pervading sense -of solitude, but always barefoot natives gliding by like spirits, without -sound of footfall, and others in the distance dissolving away and -vanishing like the creatures of dreams. Now and then a string of stately -camels passed by--always interesting things to look at--and they were -velvet-shod by nature, and made no noise. Indeed, there were no noises -of any sort in this paradise. Yes, once there was one, for a moment: a -file of native convicts passed along in charge of an officer, and we -caught the soft clink of their chains. In a retired spot, resting -himself under a tree, was a holy person--a naked black fakeer, thin and -skinny, and whitey-gray all over with ashes. - -By and by to the elephant stables, and I took a ride; but it was by -request--I did not ask for it, and didn't want it; but I took it, because -otherwise they would have thought I was afraid, which I was. The -elephant kneels down, by command--one end of him at a time--and you climb -the ladder and get into the howdah, and then he gets up, one end at a -time, just as a ship gets up over a wave; and after that, as he strides -monstrously about, his motion is much like a ship's motion. The mahout -bores into the back of his head with a great iron prod and you wonder at -his temerity and at the elephant's patience, and you think that perhaps -the patience will not last; but it does, and nothing happens. The mahout -talks to the elephant in a low voice all the time, and the elephant seems -to understand it all and to be pleased with it; and he obeys every order -in the most contented and docile way. Among these twenty-five elephants -were two which were larger than any I had ever seen before, and if I had -thought I could learn to not be afraid, I would have taken one of them -while the police were not looking. - -In the howdah-house there were many howdahs that were made of silver, one -of gold, and one of old ivory, and equipped with cushions and canopies of -rich and costly stuffs. The wardrobe of the elephants was there, too; -vast velvet covers stiff and heavy with gold embroidery; and bells of -silver and gold; and ropes of these metals for fastening the things on -harness, so to speak; and monster hoops of massive gold for the elephant -to wear on his ankles when he is out in procession on business of state. - -But we did not see the treasury of crown jewels, and that was a -disappointment, for in mass and richness it ranks only second in India. -By mistake we were taken to see the new palace instead, and we used up -the last remnant of our spare time there. It was a pity, too; for the -new palace is mixed modern American-European, and has not a merit except -costliness. It is wholly foreign to India, and impudent and out of -place. The architect has escaped. This comes of overdoing the -suppression of the Thugs; they had their merits. The old palace is -oriental and charming, and in consonance with the country. The old -palace would still be great if there were nothing of it but the spacious -and lofty hall where the durbars are held. It is not a good place to -lecture in, on account of the echoes, but it is a good place to hold -durbars in and regulate the affairs of a kingdom, and that is what it is -for. If I had it I would have a durbar every day, instead of once or -twice a year. - -The prince is an educated gentleman. His culture is European. He has -been in Europe five times. People say that this is costly amusement for -him, since in crossing the sea he must sometimes be obliged to drink -water from vessels that are more or less public, and thus damage his -caste. To get it purified again he must make pilgrimage to some renowned -Hindoo temples and contribute a fortune or two to them. His people are -like the other Hindoos, profoundly religious; and they could not be -content with a master who was impure. - -We failed to see the jewels, but we saw the gold cannon and the silver -one--they seemed to be six-pounders. They were not designed for -business, but for salutes upon rare and particularly important state -occasions. An ancestor of the present Gaikwar had the silver one made, -and a subsequent ancestor had the gold one made, in order to outdo him. - -This sort of artillery is in keeping with the traditions of Baroda, which -was of old famous for style and show. It used to entertain visiting -rajahs and viceroys with tiger-fights, elephant-fights, illuminations, -and elephant-processions of the most glittering and gorgeous character. - -It makes the circus a pale, poor thing. - -In the train, during a part of the return journey from Baroda, we had the -company of a gentleman who had with him a remarkable looking dog. I had -not seen one of its kind before, as far as I could remember; though of -course I might have seen one and not noticed it, for I am not acquainted -with dogs, but only with cats. This dog's coat was smooth and shiny and -black, and I think it had tan trimmings around the edges of the dog, and -perhaps underneath. It was a long, low dog, with very short, strange -legs--legs that curved inboard, something like parentheses wrong way (. -Indeed, it was made on the plan of a bench for length and lowness. It -seemed to be satisfied, but I thought the plan poor, and structurally -weak, on account of the distance between the forward supports and those -abaft. With age the dog's back was likely to sag; and it seemed to me -that it would have been a stronger and more practicable dog if it had had -some more legs. It had not begun to sag yet, but the shape of the legs -showed that the undue weight imposed upon them was beginning to tell. -It had a long nose, and floppy ears that hung down, and a resigned -expression of countenance. I did not like to ask what kind of a dog it -was, or how it came to be deformed, for it was plain that the gentleman -was very fond of it, and naturally he could be sensitive about it. From -delicacy I thought it best not to seem to notice it too much. No doubt a -man with a dog like that feels just as a person does who has a child that -is out of true. The gentleman was not merely fond of the dog, he was -also proud of it--just the same again, as a mother feels about her -child when it is an idiot. I could see that he was proud of it, -not-withstanding it was such a long dog and looked so resigned and pious. -It had been all over the world with him, and had been pilgriming like -that for years and years. It had traveled 50,000 miles by sea and rail, -and had ridden in front of him on his horse 8,000. It had a silver medal -from the Geographical Society of Great Britain for its travels, and I saw -it. It had won prizes in dog shows, both in India and in England--I saw -them. He said its pedigree was on record in the Kennel Club, and that it -was a well-known dog. He said a great many people in London could -recognize it the moment they saw it. I did not say anything, but I did -not think it anything strange; I should know that dog again, myself, yet -I am not careful about noticing dogs. He said that when he walked along -in London, people often stopped and looked at the dog. Of course I did -not say anything, for I did not want to hurt his feelings, but I could -have explained to him that if you take a great long low dog like that and -waddle it along the street anywhere in the world and not charge anything, -people will stop and look. He was gratified because the dog took prizes. -But that was nothing; if I were built like that I could take prizes -myself. I wished I knew what kind of a dog it was, and what it was for, -but I could not very well ask, for that would show that I did not know. -Not that I want a dog like that, but only to know the secret of its -birth. - -I think he was going to hunt elephants with it, because I know, from -remarks dropped by him, that he has hunted large game in India and -Africa, and likes it. But I think that if he tries to hunt elephants -with it, he is going to be disappointed. - -I do not believe that it is suited for elephants. It lacks energy, it -lacks force of character, it lacks bitterness. These things all show in -the meekness and resignation of its expression. It would not attack an -elephant, I am sure of it. It might not run if it saw one coming, but it -looked to me like a dog that would sit down and pray. - -I wish he had told me what breed it was, if there are others; but I shall -know the dog next time, and then if I can bring myself to it I will put -delicacy aside and ask. If I seem strangely interested in dogs, I have a -reason for it; for a dog saved me from an embarrassing position once, and -that has made me grateful to these animals; and if by study I could learn -to tell some of the kinds from the others, I should be greatly pleased. -I only know one kind apart, yet, and that is the kind that saved me that -time. I always know that kind when I meet it, and if it is hungry or -lost I take care of it. The matter happened in this way - -It was years and years ago. I had received a note from Mr. Augustin Daly -of the Fifth Avenue Theatre, asking me to call the next time I should be -in New York. I was writing plays, in those days, and he was admiring -them and trying to get me a chance to get them played in Siberia. I took -the first train--the early one--the one that leaves Hartford at 8.29 in -the morning. At New Haven I bought a paper, and found it filled with -glaring display-lines about a "bench-show" there. I had often heard of -bench-shows, but had never felt any interest in them, because I supposed -they were lectures that were not well attended. It turned out, now, that -it was not that, but a dog-show. There was a double-leaded column about -the king-feature of this one, which was called a Saint Bernard, and was -worth $10,000, and was known to be the largest and finest of his species -in the world. I read all this with interest, because out of my -school-boy readings I dimly remembered how the priests and pilgrims of -St. Bernard used to go out in the storms and dig these dogs out of the -snowdrifts when lost and exhausted, and give them brandy and save their -lives, and drag them to the monastery and restore them with gruel. - -Also, there was a picture of this prize-dog in the paper, a noble great -creature with a benignant countenance, standing by a table. He was -placed in that way so that one could get a right idea of his great -dimensions. You could see that he was just a shade higher than the -table--indeed, a huge fellow for a dog. Then there was a description -which event into the details. It gave his enormous weight--150 1/2 -pounds, and his length 4 feet 2 inches, from stem to stern-post; and his -height--3 feet 1 inch, to the top of his back. The pictures and the -figures so impressed me, that I could see the beautiful colossus before -me, and I kept on thinking about him for the next two hours; then I -reached New York, and he dropped out of my mind. - -In the swirl and tumult of the hotel lobby I ran across Mr. Daly's -comedian, the late James Lewis, of beloved memory, and I casually -mentioned that I was going to call upon Mr. Daly in the evening at 8. -He looked surprised, and said he reckoned not. For answer I handed him -Mr. Daly's note. Its substance was: "Come to my private den, over the -theater, where we cannot be interrupted. And come by the back way, not -the front. No. 642 Sixth Avenue is a cigar shop; pass through it and you -are in a paved court, with high buildings all around; enter the second -door on the left, and come up stairs." - -"Is this all?" - -"Yes," I said. - -"Well, you'll never get in" - -"Why?" - -"Because you won't. Or if you do you can draw on me for a hundred -dollars; for you will be the first man that has accomplished it in -twenty-five years. I can't think what Mr. Daly can have been absorbed -in. He has forgotten a most important detail, and he will feel -humiliated in the morning when he finds that you tried to get in and -couldn't." - -"Why, what is the trouble?" - -"I'll tell you. You see----" - -At that point we were swept apart by the crowd, somebody detained me with -a moment's talk, and we did not get together again. But it did not -matter; I believed he was joking, anyway. - -At eight in the evening I passed through the cigar shop and into the -court and knocked at the second door. - -"Come in!" - -I entered. It was a small room, carpetless, dusty, with a naked deal -table, and two cheap wooden chairs for furniture. A giant Irishman was -standing there, with shirt collar and vest unbuttoned, and no coat on. I -put my hat on the table, and was about to say something, when the -Irishman took the innings himself. And not with marked courtesy of tone: - -"Well, sor, what will you have?" - -I was a little disconcerted, and my easy confidence suffered a shrinkage. -The man stood as motionless as Gibraltar, and kept his unblinking eye -upon me. It was very embarrassing, very humiliating. I stammered at a -false start or two; then---- - -"I have just run down from----" - -"Av ye plaze, ye'll not smoke here, ye understand." - -I laid my cigar on the window-ledge; chased my flighty thoughts a moment, -then said in a placating manner: - -"I--I have come to see Mr. Daly." - -"Oh, ye have, have ye?" - -"Yes" - -"Well, ye'll not see him." - -"But he asked me to come." - -"Oh, he did, did he?" - -"Yes, he sent me this note, and----" - -"Lemme see it." - -For a moment I fancied there would be a change in the atmosphere, now; -but this idea was premature. The big man was examining the note -searchingly under the gas-jet. A glance showed me that he had it upside -down--disheartening evidence that he could not read. - -"Is ut his own handwrite?" - -"Yes--he wrote it himself." - -"He did, did he?" - -"Yes." - -"H'm. Well, then, why ud he write it like that?" - -"How do you mean?" - -"I mane, why wudn't he put his naime to ut?" - -"His name is to it. That's not it--you are looking at my name." - -I thought that that was a home shot, but he did not betray that he had -been hit. He said: - -"It's not an aisy one to spell; how do you pronounce ut?" - -"Mark Twain." - -"H'm. H'm. Mike Train. H'm. I don't remember ut. What is it ye want -to see him about?" - -"It isn't I that want to see him, he wants to see me." - -"Oh, he does, does he?" - -"Yes." - -"What does he want to see ye about?" - -"I don't know." - -"Ye don't know! And ye confess it, becod! Well, I can tell ye wan -thing--ye'll not see him. Are ye in the business?" - -"What business?" - -"The show business." - -A fatal question. I recognized that I was defeated. If I answered no, -he would cut the matter short and wave me to the door without the grace -of a word--I saw it in his uncompromising eye; if I said I was a -lecturer, he would despise me, and dismiss me with opprobrious words; if -I said I was a dramatist, he would throw me out of the window. I saw -that my case was hopeless, so I chose the course which seemed least -humiliating: I would pocket my shame and glide out without answering. -The silence was growing lengthy. - -"I'll ask ye again. Are ye in the show business yerself?" - -"Yes!" - -I said it with splendid confidence; for in that moment the very twin of -that grand New Haven dog loafed into the room, and I saw that Irishman's -eye light eloquently with pride and affection. - -"Ye are? And what is it?" - -"I've got a bench-show in New Haven." - -The weather did change then. - -"You don't say, sir! And that's your show, sir! Oh, it's a grand show, -it's a wonderful show, sir, and a proud man I am to see your honor this -day. And ye'll be an expert, sir, and ye'll know all about dogs--more -than ever they know theirselves, I'll take me oath to ut." - -I said, with modesty: - -"I believe I have some reputation that way. In fact, my business -requires it." - -"Ye have some reputation, your honor! Bedad I believe you! There's not -a jintleman in the worrld that can lay over ye in the judgmint of a dog, -sir. Now I'll vinture that your honor'll know that dog's dimensions -there better than he knows them his own self, and just by the casting of -your educated eye upon him. Would you mind giving a guess, if ye'll be -so good?" - -I knew that upon my answer would depend my fate. If I made this dog -bigger than the prize-dog, it would be bad diplomacy, and suspicious; if -I fell too far short of the prizedog, that would be equally damaging. -The dog was standing by the table, and I believed I knew the difference -between him and the one whose picture I had seen in the newspaper to a -shade. I spoke promptly up and said: - -"It's no trouble to guess this noble creature's figures height, three -feet; length, four feet and three-quarters of an inch; weight, a hundred -and forty-eight and a quarter." - -The man snatched his hat from its peg and danced on it with joy, -shouting: - -"Ye've hardly missed it the hair's breadth, hardly the shade of a shade, -your honor! Oh, it's the miraculous eye ye've got, for the judgmint of a -dog!" - -And still pouring out his admiration of my capacities, he snatched off -his vest and scoured off one of the wooden chairs with it, and scrubbed -it and polished it, and said: - -"There, sit down, your honor, I'm ashamed of meself that I forgot ye were -standing all this time; and do put on your hat, ye mustn't take cold, -it's a drafty place; and here is your cigar, sir, a getting cold, I'll -give ye a light. There. The place is all yours, sir, and if ye'll just -put your feet on the table and make yourself at home, I'll stir around -and get a candle and light ye up the ould crazy stairs and see that ye -don't come to anny harm, for be this time Mr. Daly'll be that impatient -to see your honor that he'll be taking the roof off." - -He conducted me cautiously and tenderly up the stairs, lighting the way -and protecting me with friendly warnings, then pushed the door open and -bowed me in and went his way, mumbling hearty things about my wonderful -eye for points of a dog. Mr. Daly was writing and had his back to me. -He glanced over his shoulder presently, then jumped up and said-- - -"Oh, dear me, I forgot all about giving instructions. I was just writing -you to beg a thousand pardons. But how is it you are here? How did you -get by that Irishman? You are the first man that's done it in five and -twenty years. You didn't bribe him, I know that; there's not money -enough in New York to do it. And you didn't persuade him; he is all ice -and iron: there isn't a soft place nor a warm one in him anywhere. That -is your secret? Look here; you owe me a hundred dollars for -unintentionally giving you a chance to perform a miracle--for it is a -miracle that you've done." - -"That is all right," I said, "collect it of Jimmy Lewis." - -That good dog not only did me that good turn in the time of my need, but -he won for me the envious reputation among all the theatrical people from -the Atlantic to the Pacific of being the only man in history who had ever -run the blockade of Augustin Daly's back door. - - - - -CHAPTER XLVI. - -If the desire to kill and the opportunity to kill came always together, -who would escape hanging. - --Pudd'nhead Wilson's New Calendar. - -On the Train. Fifty years ago, when I was a boy in the then remote and -sparsely peopled Mississippi valley, vague tales and rumors of a -mysterious body of professional murderers came wandering in from a -country which was constructively as far from us as the constellations -blinking in space--India; vague tales and rumors of a sect called Thugs, -who waylaid travelers in lonely places and killed them for the -contentment of a god whom they worshiped; tales which everybody liked to -listen to and nobody believed, except with reservations. It was -considered that the stories had gathered bulk on their travels. The -matter died down and a lull followed. Then Eugene Sue's "Wandering Jew" -appeared, and made great talk for a while. One character in it was a -chief of Thugs--"Feringhea"--a mysterious and terrible Indian who was as -slippery and sly as a serpent, and as deadly; and he stirred up the Thug -interest once more. But it did not last. It presently died again this -time to stay dead. - -At first glance it seems strange that this should have happened; but -really it was not strange--on the contrary,. it was natural; I mean on -our side of the water. For the source whence the Thug tales mainly came -was a Government Report, and without doubt was not republished in -America; it was probably never even seen there. Government Reports have -no general circulation. They are distributed to the few, and are not -always read by those few. I heard of this Report for the first time a -day or two ago, and borrowed it. It is full of fascinations; and it -turns those dim, dark fairy tales of my boyhood days into realities. - -The Report was made in 1889 by Major Sleeman, of the Indian Service, and -was printed in Calcutta in 1840. It is a clumsy, great, fat, poor sample -of the printer's art, but good enough for a government printing-office in -that old day and in that remote region, perhaps. To Major Sleeman was -given the general superintendence of the giant task of ridding India of -Thuggee, and he and his seventeen assistants accomplished it. It was the -Augean Stables over again. Captain Vallancey, writing in a Madras -journal in those old times, makes this remark: - - "The day that sees this far-spread evil eradicated from India and - known only in name, will greatly tend to immortalize British rule in - the East." - -He did not overestimate the magnitude and difficulty of the work, nor the -immensity of the credit which would justly be due to British rule in case -it was accomplished. - -Thuggee became known to the British authorities in India about 1810, but -its wide prevalence was not suspected; it was not regarded as a serious -matter, and no systematic measures were taken for its suppression until -about 1830. About that time Major Sleeman captured Eugene Sue's -Thug-chief, "Feringhea," and got him to turn King's evidence. The -revelations were so stupefying that Sleeman was not able to believe them. -Sleeman thought he knew every criminal within his jurisdiction, and that -the worst of them were merely thieves; but Feringhea told him that he was -in reality living in the midst of a swarm of professional murderers; that -they had been all about him for many years, and that they buried their -dead close by. These seemed insane tales; but Feringhea said come and -see--and he took him to a grave and dug up a hundred bodies, and told him -all the circumstances of the killings, and named the Thugs who had done -the work. It was a staggering business. Sleeman captured some of these -Thugs and proceeded to examine them separately, and with proper -precautions against collusion; for he would not believe any Indian's -unsupported word. The evidence gathered proved the truth of what -Feringhea had said, and also revealed the fact that gangs of Thugs were -plying their trade all over India. The astonished government now took -hold of Thuggee, and for ten years made systematic and relentless war -upon it, and finally destroyed it. Gang after gang was captured, tried, -and punished. The Thugs were harried and hunted from one end of India to -the other. The government got all their secrets out of them; and also -got the names of the members of the bands, and recorded them in a book, -together with their birthplaces and places of residence. - -The Thugs were worshipers of Bhowanee; and to this god they sacrificed -anybody that came handy; but they kept the dead man's things themselves, -for the god cared for nothing but the corpse. Men were initiated into -the sect with solemn ceremonies. Then they were taught how to strangle a -person with the sacred choke-cloth, but were not allowed to perform -officially with it until after long practice. No half-educated strangler -could choke a man to death quickly enough to keep him from uttering a -sound--a muffled scream, gurgle, gasp, moan, or something of the sort; -but the expert's work was instantaneous: the cloth was whipped around the -victim's neck, there was a sudden twist, and the head fell silently -forward, the eyes starting from the sockets; and all was over. The Thug -carefully guarded against resistance. It was usual to to get the victims -to sit down, for that was the handiest position for business. - -If the Thug had planned India itself it could not have been more -conveniently arranged for the needs of his occupation. - -There were no public conveyances. There were no conveyances for hire. -The traveler went on foot or in a bullock cart or on a horse which he -bought for the purpose. As soon as he was out of his own little State or -principality he was among strangers; nobody knew him, nobody took note of -him, and from that time his movements could no longer be traced. He did -not stop in towns or villages, but camped outside of them and sent his -servants in to buy provisions. There were no habitations between -villages. Whenever he was between villages he was an easy prey, -particularly as he usually traveled by night, to avoid the heat. He was -always being overtaken by strangers who offered him the protection of -their company, or asked for the protection of his--and these strangers -were often Thugs, as he presently found out to his cost. The -landholders, the native police, the petty princes, the village officials, -the customs officers were in many cases protectors and harborers of the -Thugs, and betrayed travelers to them for a share of the spoil. At first -this condition of things made it next to impossible for the government to -catch the marauders; they were spirited away by these watchful friends. -All through a vast continent, thus infested, helpless people of every -caste and kind moved along the paths and trails in couples and groups -silently by night, carrying the commerce of the country--treasure, -jewels, money, and petty batches of silks, spices, and all manner of -wares. It was a paradise for the Thug. - -When the autumn opened, the Thugs began to gather together by -pre-concert. Other people had to have interpreters at every turn, but -not the Thugs; they could talk together, no matter how far apart they -were born, for they had a language of their own, and they had secret -signs by which they knew each other for Thugs; and they were always -friends. Even their diversities of religion and caste were sunk in -devotion to their calling, and the Moslem and the high-caste and -low-caste Hindoo were staunch and affectionate brothers in Thuggery. - -When a gang had been assembled, they had religious worship, and waited -for an omen. They had definite notions about the omens. The cries of -certain animals were good omens, the cries of certain other creatures -were bad omens. A bad omen would stop proceedings and send the men home. - -The sword and the strangling-cloth were sacred emblems. The Thugs -worshiped the sword at home before going out to the assembling-place; the -strangling-cloth was worshiped at the place of assembly. The chiefs of -most of the bands performed the religious ceremonies themselves; but the -Kaets delegated them to certain official stranglers (Chaurs). The rites -of the Kaets were so holy that no one but the Chaur was allowed to touch -the vessels and other things used in them. - -Thug methods exhibit a curious mixture of caution and the absence of it; -cold business calculation and sudden, unreflecting impulse; but there -were two details which were constant, and not subject to caprice: patient -persistence in following up the prey, and pitilessness when the time came -to act. - -Caution was exhibited in the strength of the bands. They never felt -comfortable and confident unless their strength exceeded that of any -party of travelers they were likely to meet by four or fivefold. Yet it -was never their purpose to attack openly, but only when the victims were -off their guard. When they got hold of a party of travelers they often -moved along in their company several days, using all manner of arts to -win their friendship and get their confidence. At last, when this was -accomplished to their satisfaction, the real business began. A few Thugs -were privately detached and sent forward in the dark to select a good -killing-place and dig the graves. When the rest reached the spot a halt -was called, for a rest or a smoke. The travelers were invited to sit. -By signs, the chief appointed certain Thugs to sit down in front of the -travelers as if to wait upon them, others to sit down beside them and -engage them in conversation, and certain expert stranglers to stand -behind the travelers and be ready when the signal was given. The signal -was usually some commonplace remark, like "Bring the tobacco." Sometimes -a considerable wait ensued after all the actors were in their places--the -chief was biding his time, in order to make everything sure. Meantime, -the talk droned on, dim figures moved about in the dull light, peace and -tranquility reigned, the travelers resigned themselves to the pleasant -reposefulness and comfort of the situation, unconscious of the -death-angels standing motionless at their backs. The time was ripe, now, -and the signal came: "Bring the tobacco." There was a mute swift -movement, all in the same instant the men at each victim's sides seized -his hands, the man in front seized his feet, and pulled, the man at his -back whipped the cloth around his neck and gave it a twist the head sunk -forward, the tragedy was over. The bodies were stripped and covered up -in the graves, the spoil packed for transportation, then the Thugs gave -pious thanks to Bhowanee, and departed on further holy service. - -The Report shows that the travelers moved in exceedingly small groups ---twos, threes, fours, as a rule; a party with a dozen in it was rare. The -Thugs themselves seem to have been the only people who moved in force. -They went about in gangs of 10, 15, 25, 40, 60, 100, 150, 200, 250, and -one gang of 310 is mentioned. Considering their numbers, their catch was -not extraordinary--particularly when you consider that they were not in -the least fastidious, but took anybody they could get, whether rich or -poor, and sometimes even killed children. Now and then they killed -women, but it was considered sinful to do it, and unlucky. The "season" -was six or eight months long. One season the half dozen Bundelkand and -Gwalior gangs aggregated 712 men, and they murdered 210 people. One -season the Malwa and Kandeish gangs aggregated 702 men, and they murdered -232. One season the Kandeish and Berar gangs aggregated 963 men, and -they murdered 385 people. - -Here is the tally-sheet of a gang of sixty Thugs for a whole season--gang -under two noted chiefs, "Chotee and Sheik Nungoo from Gwalior": - - "Left Poora, in Jhansee, and on arrival at Sarora murdered a - traveler. - - "On nearly reaching Bhopal, met 3 Brahmins, and murdered them. - - "Cross the Nerbudda; at a village called Hutteea, murdered a Hindoo. - - "Went through Aurungabad to Walagow; there met a Havildar of the - barber caste and 5 sepoys (native soldiers); in the evening came to - Jokur, and in the morning killed them near the place where the - treasure-bearers were killed the year before. - - "Between Jokur and Dholeea met a sepoy of the shepherd caste; killed - him in the jungle. - - "Passed through Dholeea and lodged in a village; two miles beyond, - on the road to Indore, met a Byragee (beggar-holy mendicant); - murdered him at the Thapa. - - "In the morning, beyond the Thapa, fell in with 3 Marwarie - travelers; murdered them. - - "Near a village on the banks of the Taptee met 4 travelers and - killed them. - - "Between Choupra and Dhoreea met a Marwarie; murdered him. - - "At Dhoreea met 3 Marwaries; took them two miles and murdered them. - - "Two miles further on, overtaken by three treasure-bearers; took - them two miles and murdered them in the jungle. - - "Came on to Khurgore Bateesa in Indore, divided spoil, and - dispersed. - - "A total of 27 men murdered on one expedition." - -Chotee (to save his neck) was informer, and furnished these facts. -Several things are noticeable about his resume. 1. Business brevity; -2, absence of emotion; 3, smallness of the parties encountered by the 60; -4, variety in character and quality of the game captured; 5, Hindoo and -Mohammedan chiefs in business together for Bhowanee; 6, the sacred caste -of the Brahmins not respected by either; 7, nor yet the character of that -mendicant, that Byragee. - -A beggar is a holy creature, and some of the gangs spared him on that -account, no matter how slack business might be; but other gangs -slaughtered not only him, but even that sacredest of sacred creatures, -the fakeer--that repulsive skin-and-bone thing that goes around naked and -mats his bushy hair with dust and dirt, and so beflours his lean body -with ashes that he looks like a specter. Sometimes a fakeer trusted a -shade too far in the protection of his sacredness. In the middle of a -tally-sheet of Feringhea's, who had been out with forty Thugs, I find a -case of the kind. After the killing of thirty-nine men and one woman, -the fakeer appears on the scene: - - "Approaching Doregow, met 3 pundits; also a fakeer, mounted on a - pony; he was plastered over with sugar to collect flies, and was - covered with them. Drove off the fakeer, and killed the other - three. - - "Leaving Doregow, the fakeer joined again, and went on in company to - Raojana; met 6 Khutries on their way from Bombay to Nagpore. Drove - off the fakeer with stones, and killed the 6 men in camp, and buried - them in the grove. - - "Next day the fakeer joined again; made him leave at Mana. Beyond - there, fell in with two Kahars and a sepoy, and came on towards the - place selected for the murder. When near it, the fakeer came again. - Losing all patience with him, gave Mithoo, one of the gang, 5 rupees - ($2.50) to murder him, and take the sin upon himself. All four were - strangled, including the fakeer. Surprised to find among the - fakeer's effects 30 pounds of coral, 350 strings of small pearls, 15 - strings of large pearls, and a gilt necklace." - -It it curious, the little effect that time has upon a really interesting -circumstance. This one, so old, so long ago gone down into oblivion, -reads with the same freshness and charm that attach to the news in the -morning paper; one's spirits go up, then down, then up again, following -the chances which the fakeer is running; now you hope, now you despair, -now you hope again; and at last everything comes out right, and you feel -a great wave of personal satisfaction go weltering through you, and -without thinking, you put out your hand to pat Mithoo on the back, when ---puff! the whole thing has vanished away, there is nothing there; Mithoo -and all the crowd have been dust and ashes and forgotten, oh, so many, -many, many lagging years! And then comes a sense of injury: you don't -know whether Mithoo got the swag, along with the sin, or had to divide up -the swag and keep all the sin himself. There is no literary art about a -government report. It stops a story right in the most interesting place. - -These reports of Thug expeditions run along interminably in one -monotonous tune: "Met a sepoy--killed him; met 5 pundits--killed them; -met 4 Rajpoots and a woman--killed them"--and so on, till the statistics -get to be pretty dry. But this small trip of Feringhea's Forty had some -little variety about it. Once they came across a man hiding in a grave ---a thief; he had stolen 1,100 rupees from Dhunroj Seith of Parowtee. -They strangled him and took the money. They had no patience with thieves. -They killed two treasure-bearers, and got 4,000 rupees. They came across -two bullocks "laden with copper pice," and killed the four drivers and -took the money. There must have been half a ton of it. I think it takes -a double handful of pice to make an anna, and 16 annas to make a rupee; -and even in those days the rupee was worth only half a dollar. Coming -back over their tracks from Baroda, they had another picturesque stroke -of luck: "'The Lohars of Oodeypore' put a traveler in their charge for -safety." Dear, dear, across this abyssmal gulf of time we still see -Feringhea's lips uncover his teeth, and through the dim haze we catch the -incandescent glimmer of his smile. He accepted that trust, good man; and -so we know what went with the traveler. - -Even Rajahs had no terrors for Feringhea; he came across an -elephant-driver belonging to the Rajah of Oodeypore and promptly -strangled him. - -"A total of 100 men and 5 women murdered on this expedition." - -Among the reports of expeditions we find mention of victims of almost -every quality and estate. - -Also a prince's cook; and even the water-carrier of that sublime lord of -lords and king of kings, the Governor-General of India! How broad they -were in their tastes! They also murdered actors--poor wandering -barnstormers. There are two instances recorded; the first one by a gang -of Thugs under a chief who soils a great name borne by a better man ---Kipling's deathless "Gungadin": - - "After murdering 4 sepoys, going on toward Indore, met 4 strolling - players, and persuaded them to come with us, on the pretense that we - would see their performance at the next stage. Murdered them at a - temple near Bhopal." - -Second instance: - - "At Deohuttee, joined by comedians. Murdered them eastward of that - place." - -But this gang was a particularly bad crew. On that expedition they -murdered a fakeer and twelve beggars. And yet Bhowanee protected them; -for once when they were strangling a man in a wood when a crowd was going -by close at hand and the noose slipped and the man screamed, Bhowanee -made a camel burst out at the same moment with a roar that drowned the -scream; and before the man could repeat it the breath was choked out of -his body. - -The cow is so sacred in India that to kill her keeper is an awful -sacrilege, and even the Thugs recognized this; yet now and then the lust -for blood was too strong, and so they did kill a few cow-keepers. In one -of these instances the witness who killed the cowherd said, "In Thuggee -this is strictly forbidden, and is an act from which no good can come. I -was ill of a fever for ten days afterward. I do believe that evil will -follow the murder of a man with a cow. If there be no cow it does not -signify." Another Thug said he held the cowherd's feet while this -witness did the strangling. He felt no concern, "because the bad fortune -of such a deed is upon the strangler and not upon the assistants; even if -there should be a hundred of them." - -There were thousands of Thugs roving over India constantly, during many -generations. They made Thug gee a hereditary vocation and taught it to -their sons and to their son's sons. Boys were in full membership as -early as 16 years of age; veterans were still at work at 70. What was -the fascination, what was the impulse? Apparently, it was partly piety, -largely gain, and there is reason to suspect that the sport afforded was -the chiefest fascination of all. Meadows Taylor makes a Thug in one of -his books claim that the pleasure of killing men was the white man's -beast-hunting instinct enlarged, refined, ennobled. I will quote the -passage: - - - - -CHAPTER XLVII. - -Simple rules for saving money: To save half, when you are fired by an -eager impulse to contribute to a charity, wait, and count forty. To save -three-quarters, count sixty. To save it all, count sixty-five. - --Pudd'nhead Wilson's New Calendar. - -The Thug said: - -"How many of you English are passionately devoted to sporting! Your days -and months are passed in its excitement. A tiger, a panther, a buffalo -or a hog rouses your utmost energies for its destruction--you even risk -your lives in its pursuit. How much higher game is a Thug's!" - -That must really be the secret of the rise and development of Thuggee. -The joy of killing! the joy of seeing killing done--these are traits of -the human race at large. We white people are merely modified Thugs; -Thugs fretting under the restraints of a not very thick skin of -civilization; Thugs who long ago enjoyed the slaughter of the Roman -arena, and later the burning of doubtful Christians by authentic -Christians in the public squares, and who now, with the Thugs of Spain -and Nimes, flock to enjoy the blood and misery of the bullring. We have -no tourists of either sex or any religion who are able to resist the -delights of the bull-ring when opportunity offers; and we are gentle -Thugs in the hunting-season, and love to chase a tame rabbit and kill it. -Still, we have made some progress-microscopic, and in truth scarcely -worth mentioning, and certainly nothing to be proud of--still, it is -progress: we no longer take pleasure in slaughtering or burning helpless -men. We have reached a little altitude where we may look down upon the -Indian Thugs with a complacent shudder; and we may even hope for a day, -many centuries hence, when our posterity will look down upon us in the -same way. - -There are many indications that the Thug often hunted men for the mere -sport of it; that the fright and pain of the quarry were no more to him -than are the fright and pain of the rabbit or the stag to us; and that he -was no more ashamed of beguiling his game with deceits and abusing its -trust than are we when we have imitated a wild animal's call and shot it -when it honored us with its confidence and came to see what we wanted: - - "Madara, son of Nihal, and I, Ramzam, set out from Kotdee in the - cold weather and followed the high road for about twenty days in - search of travelers, until we came to Selempore, where we met a very - old man going to the east. We won his confidence in this manner: he - carried a load which was too heavy for his old age; I said to him, - 'You are an old man, I will aid you in carrying your load, as you - are from my part of the country.' He said, 'Very well, take me with - you.' So we took him with us to Selempore, where we slept that - night. We woke him next morning before dawn and set out, and at the - distance of three miles we seated him to rest while it was still - very dark. Madara was ready behind him, and strangled him. He - never spoke a word. He was about 60 or 70 years of age." - -Another gang fell in with a couple of barbers and persuaded them to come -along in their company by promising them the job of shaving the whole -crew--30 Thugs. At the place appointed for the murder 15 got shaved, and -actually paid the barbers for their work. Then killed them and took back -the money. - -A gang of forty-two Thugs came across two Brahmins and a shopkeeper on -the road, beguiled them into a grove and got up a concert for their -entertainment. While these poor fellows were listening to the music the -stranglers were standing behind them; and at the proper moment for -dramatic effect they applied the noose. - -The most devoted fisherman must have a bite at least as often as once -a week or his passion will cool and he will put up his tackle. The -tiger-sportsman must find a tiger at least once a fortnight or he will get -tired and quit. The elephant-hunter's enthusiasm will waste away little -by little, and his zeal will perish at last if he plod around a month -without finding a member of that noble family to assassinate. - -But when the lust in the hunter's heart is for the noblest of all -quarries, man, how different is the case! and how watery and poor is the -zeal and how childish the endurance of those other hunters by comparison. -Then, neither hunger, nor thirst, nor fatigue, nor deferred hope, nor -monotonous disappointment, nor leaden-footed lapse of time can conquer -the hunter's patience or weaken the joy of his quest or cool the splendid -rage of his desire. Of all the hunting-passions that burn in the breast -of man, there is none that can lift him superior to discouragements like -these but the one--the royal sport, the supreme sport, whose quarry is -his brother. By comparison, tiger-hunting is a colorless poor thing, for -all it has been so bragged about. - -Why, the Thug was content to tramp patiently along, afoot, in the wasting -heat of India, week after week, at an average of nine or ten miles a day, -if he might but hope to find game some time or other and refresh his -longing soul with blood. Here is an instance: - - "I (Ramzam) and Hyder set out, for the purpose of strangling - travelers, from Guddapore, and proceeded via the Fort of Julalabad, - Newulgunge, Bangermow, on the banks of the Ganges (upwards of 100 - miles), from whence we returned by another route. Still no - travelers! till we reached Bowaneegunge, where we fell in with a - traveler, a boatman; we inveigled him and about two miles east of - there Hyder strangled him as he stood--for he was troubled and - afraid, and would not sit. We then made a long journey (about 130 - miles) and reached Hussunpore Bundwa, where at the tank we fell in - with a traveler--he slept there that night; next morning we followed - him and tried to win his confidence; at the distance of two miles we - endeavored to induce him to sit down--but he would not, having - become aware of us. I attempted to strangle him as he walked along, - but did not succeed; both of us then fell upon him, he made a great - outcry, 'They are murdering me!' at length we strangled him and - flung his body into a well. After this we returned to our homes, - having been out a month and traveled about 260 miles. A total of - two men murdered on the expedition." - -And here is another case-related by the terrible Futty Khan, a man with a -tremendous record, to be re-mentioned by and by: - - "I, with three others, traveled for about 45 days a distance of - about 200 miles in search of victims along the highway to Bundwa and - returned by Davodpore (another 200 miles) during which journey we - had only one murder, which happened in this manner. Four miles to - the east of Noubustaghat we fell in with a traveler, an old man. I, - with Koshal and Hyder, inveigled him and accompanied him that day - within 3 miles of Rampoor, where, after dark, in a lonely place, we - got him to sit down and rest; and while I kept him in talk, seated - before him, Hyder behind strangled him: he made no resistance. - Koshal stabbed him under the arms and in the throat, and we flung - the body into a running stream. We got about 4 or 5 rupees each ($2 - or $2.50). We then proceeded homewards. A total of one man - murdered on this expedition." - -There. They tramped 400 miles, were gone about three months, and -harvested two dollars and a half apiece. But the mere pleasure of the -hunt was sufficient. That was pay enough. They did no grumbling. - -Every now and then in this big book one comes across that pathetic -remark: "we tried to get him to sit down but he would not." It tells the -whole story. Some accident had awakened the suspicion in him that these -smooth friends who had been petting and coddling him and making him feel -so safe and so fortunate after his forlorn and lonely wanderings were the -dreaded Thugs; and now their ghastly invitation to "sit and rest" had -confirmed its truth. He knew there was no help for him, and that he was -looking his last upon earthly things, but "he would not sit." No, not -that--it was too awful to think of! - -There are a number of instances which indicate that when a man had once -tasted the regal joys of man-hunting he could not be content with the -dull monotony of a crimeless life after ward. Example, from a Thug's -testimony: - - "We passed through to Kurnaul, where we found a former Thug named - Junooa, an old comrade of ours, who had turned religious mendicant - and become a disciple and holy. He came to us in the serai and - weeping with joy returned to his old trade." - -Neither wealth nor honors nor dignities could satisfy a reformed Thug for -long. He would throw them all away, someday, and go back to the lurid -pleasures of hunting men, and being hunted himself by the British. - -Ramzam was taken into a great native grandee's service and given -authority over five villages. "My authority extended over these people -to summons them to my presence, to make them stand or sit. I dressed -well, rode my pony, and had two sepoys, a scribe and a village guard to -attend me. During three years I used to pay each village a monthly -visit, and no one suspected that I was a Thug! The chief man used to -wait on me to transact business, and as I passed along, old and young -made their salaam to me." - -And yet during that very three years he got leave of absence "to attend a -wedding," and instead went off on a Thugging lark with six other Thugs -and hunted the highway for fifteen days!--with satisfactory results. - -Afterwards he held a great office under a Rajah. There he had ten miles -of country under his command and a military guard of fifteen men, with -authority to call out 2,000 more upon occasion. But the British got on -his track, and they crowded him so that he had to give himself up. See -what a figure he was when he was gotten up for style and had all his -things on: "I was fully armed--a sword, shield, pistols, a matchlock -musket and a flint gun, for I was fond of being thus arrayed, and when so -armed feared not though forty men stood before me." - -He gave himself up and proudly proclaimed himself a Thug. Then by -request he agreed to betray his friend and pal, Buhram, a Thug with the -most tremendous record in India. "I went to the house where Buhram slept -(often has he led our gangs!) I woke him, he knew me well, and came -outside to me. It was a cold night, so under pretence of warming myself, -but in reality to have light for his seizure by the guards, I lighted -some straw and made a blaze. We were warming our hands. The guards drew -around us. I said to them, 'This is Buhram,' and he was seized just as a -cat seizes a mouse. Then Buhram said, 'I am a Thug! my father was a -Thug, my grandfather was a Thug, and I have thugged with many!'" - -So spoke the mighty hunter, the mightiest of the mighty, the Gordon -Cumming of his day. Not much regret noticeable in it.--["Having planted -a bullet in the shoulder-bone of an elephant, and caused the agonized -creature to lean for support against a tree, I proceeded to brew some -coffee. Having refreshed myself, taking observations of the elephant's -spasms and writhings between the sips, I resolved to make experiments on -vulnerable points, and, approaching very near, I fired several bullets at -different parts of his enormous skull. He only acknowledged the shots by -a salaam-like movement of his trunk, with the point of which he gently -touched the wounds with a striking and peculiar action. Surprised and -shocked to find that I was only prolonging the suffering of the noble -beast, which bore its trials with such dignified composure, I resolved to -finish the proceeding with all possible despatch, and accordingly opened -fire upon him from the left side. Aiming at the shoulder, I fired six -shots with the two-grooved rifle, which must have eventually proved -mortal, after which I fired six shots at the same part with the Dutch -six-founder. Large tears now trickled down from his eyes, which he -slowly shut and opened, his colossal frame shivered convulsively, and -falling on his side he expired."--Gordon Cumming.] - -So many many times this Official Report leaves one's curiosity -unsatisfied. For instance, here is a little paragraph out of the record -of a certain band of 193 Thugs, which has that defect: - - "Fell in with Lall Sing Subahdar and his family, consisting of nine - persons. Traveled with them two days, and the third put them all to - death except the two children, little boys of one and a half years - old." - -There it stops. What did they do with those poor little fellows? What -was their subsequent history? Did they purpose training them up as -Thugs? How could they take care of such little creatures on a march -which stretched over several months? No one seems to have cared to ask -any questions about the babies. But I do wish I knew. - -One would be apt to imagine that the Thugs were utterly callous, utterly -destitute of human feelings, heartless toward their own families as well -as toward other people's; but this was not so. Like all other Indians, -they had a passionate love for their kin. A shrewd British officer who -knew the Indian character, took that characteristic into account in -laying his plans for the capture of Eugene Sue's famous Feringhea. He -found out Feringhea's hiding-place, and sent a guard by night to seize -him, but the squad was awkward and he got away. However, they got the -rest of the family--the mother, wife, child, and brother--and brought -them to the officer, at Jubbulpore; the officer did not fret, but bided -his time: "I knew Feringhea would not go far while links so dear to him -were in my hands." He was right. Feringhea knew all the danger he was -running by staying in the neighborhood, still he could not tear himself -away. The officer found that he divided his time between five villages -where be had relatives and friends who could get news for him from his -family in Jubbulpore jail; and that he never slept two consecutive nights -in the same village. The officer traced out his several haunts, then -pounced upon all the five villages on the one night and at the same hour, -and got his man. - -Another example of family affection. A little while previously to the -capture of Feringhea's family, the British officer had captured -Feringhea's foster-brother, leader of a gang of ten, and had tried the -eleven and condemned them to be hanged. Feringhea's captured family -arrived at the jail the day before the execution was to take place. The -foster-brother, Jhurhoo, entreated to be allowed to see the aged mother -and the others. The prayer was granted, and this is what took place--it -is the British officer who speaks: - - "In the morning, just before going to the scaffold, the interview - took place before me. He fell at the old woman's feet and begged - that she would relieve him from the obligations of the milk with - which she had nourished him from infancy, as he was about to die - before he could fulfill any of them. She placed her hands on his - head, and he knelt, and she said she forgave him all, and bid him - die like a man." - -If a capable artist should make a picture of it, it would be full of -dignity and solemnity and pathos; and it could touch you. You would -imagine it to be anything but what it was. There is reverence there, and -tenderness, and gratefulness, and compassion, and resignation, and -fortitude, and self-respect--and no sense of disgrace, no thought of -dishonor. Everything is there that goes to make a noble parting, and -give it a moving grace and beauty and dignity. And yet one of these -people is a Thug and the other a mother of Thugs! The incongruities of -our human nature seem to reach their limit here. - -I wish to make note of one curious thing while I think of it. One of the -very commonest remarks to be found in this bewildering array of Thug -confessions is this: - -"Strangled him and threw him an a well!" In one case they threw sixteen -into a well--and they had thrown others in the same well before. It -makes a body thirsty to read about it. - -And there is another very curious thing. The bands of Thugs had private -graveyards. They did not like to kill and bury at random, here and there -and everywhere. They preferred to wait, and toll the victims along, and -get to one of their regular burying-places ('bheels') if they could. In -the little kingdom of Oude, which was about half as big as Ireland and -about as big as the State of Maine, they had two hundred and seventy-four -'bheels'. They were scattered along fourteen hundred miles of road, at -an average of only five miles apart, and the British government traced -out and located each and every one of them and set them down on the map. - -The Oude bands seldom went out of their own country, but they did a -thriving business within its borders. So did outside bands who came in -and helped. Some of the Thug leaders of Oude were noted for their -successful careers. Each of four of them confessed to above 300 murders; -another to nearly 400; our friend Ramzam to 604--he is the one who got -leave of absence to attend a wedding and went thugging instead; and he is -also the one who betrayed Buhram to the British. - -But the biggest records of all were the murder-lists of Futty Khan and -Buhram. Futty Khan's number is smaller than Ramzam's, but he is placed -at the head because his average is the best in Oude-Thug history per year -of service. His slaughter was 508 men in twenty years, and he was still -a young man when the British stopped his industry. Buhram's list was 931 -murders, but it took him forty years. His average was one man and nearly -all of another man per month for forty years, but Futty Khan's average -was two men and a little of another man per month during his twenty years -of usefulness. - -There is one very striking thing which I wish to call attention to. You -have surmised from the listed callings followed by the victims of the -Thugs that nobody could travel the Indian roads unprotected and live to -get through; that the Thugs respected no quality, no vocation, no -religion, nobody; that they killed every unarmed man that came in their -way. That is wholly true--with one reservation. In all the long file of -Thug confessions an English traveler is mentioned but once--and this is -what the Thug says of the circumstance: - - "He was on his way from Mhow to Bombay. We studiously avoided him. - He proceeded next morning with a number of travelers who had sought - his protection, and they took the road to Baroda." - -We do not know who he was; he flits across the page of this rusty old -book and disappears in the obscurity beyond; but he is an impressive -figure, moving through that valley of death serene and unafraid, clothed -in the might of the English name. - -We have now followed the big official book through, and we understand -what Thuggee was, what a bloody terror it was, what a desolating scourge -it was. In 1830 the English found this cancerous organization imbedded -in the vitals of the empire, doing its devastating work in secrecy, and -assisted, protected, sheltered, and hidden by innumerable confederates ---big and little native chiefs, customs officers, village officials, and -native police, all ready to lie for it, and the mass of the people, -through fear, persistently pretending to know nothing about its doings; -and this condition of things had existed for generations, and was -formidable with the sanctions of age and old custom. If ever there was -an unpromising task, if ever there was a hopeless task in the world, -surely it was offered here--the task of conquering Thuggee. But that -little handful of English officials in India set their sturdy and -confident grip upon it, and ripped it out, root and branch! How modest -do Captain Vallancey's words sound now, when we read them again, knowing -what we know: - - "The day that sees this far-spread evil completely eradicated from - India, and known only in name, will greatly tend to immortalize - British rule in the East." - -It would be hard to word a claim more modestly than that for this most -noble work. - - - - -CHAPTER XLVIII. - -Grief can take care of itself; but to get the full value of a joy you -must have somebody to divide it with. - --Pudd'nhead Wilson's New Calendar. - -We left Bombay for Allahabad by a night train. It is the custom of the -country to avoid day travel when it can conveniently be done. But there -is one trouble: while you can seemingly "secure" the two lower berths by -making early application, there is no ticket as witness of it, and no -other producible evidence in case your proprietorship shall chance to be -challenged. The word "engaged" appears on the window, but it doesn't -state who the compartment is engaged, for. If your Satan and your Barney -arrive before somebody else's servants, and spread the bedding on the two -sofas and then stand guard till you come, all will be well; but if they -step aside on an errand, they may find the beds promoted to the two -shelves, and somebody else's demons standing guard over their master's -beds, which in the meantime have been spread upon your sofas. - -You do not pay anything extra for your sleeping place; that is where the -trouble lies. If you buy a fare-ticket and fail to use it, there is room -thus made available for someone else; but if the place were secured to -you it would remain vacant, and yet your ticket would secure you another -place when you were presently ready to travel. - -However, no explanation of such a system can make it seem quite rational -to a person who has been used to a more rational system. If our people -had the arranging of it, we should charge extra for securing the place, -and then the road would suffer no loss if the purchaser did not occupy -it. - -The present system encourages good manners--and also discourages them. -If a young girl has a lower berth and an elderly lady comes in, it is -usual for the girl to offer her place to this late comer; and it is usual -for the late comer to thank her courteously and take it. But the thing -happens differently sometimes. When we were ready to leave Bombay my -daughter's satchels were holding possession of her berth--a lower one. -At the last moment, a middle-aged American lady swarmed into the -compartment, followed by native porters laden with her baggage. She was -growling and snarling and scolding, and trying to make herself -phenomenally disagreeable; and succeeding. Without a word, she hoisted -the satchels into the hanging shelf, and took possession of that lower -berth. - -On one of our trips Mr. Smythe and I got out at a station to walk up and -down, and when we came back Smythe's bed was in the hanging shelf and an -English cavalry officer was in bed on the sofa which he had lately been -occupying. It was mean to be glad about it, but it is the way we are -made; I could not have been gladder if it had been my enemy that had -suffered this misfortune. We all like to see people in trouble, if it -doesn't cost us anything. I was so happy over Mr. Smythe's chagrin that -I couldn't go to sleep for thinking of it and enjoying it. I knew he -supposed the officer had committed the robbery himself, whereas without a -doubt the officer's servant had done it without his knowledge. Mr. -Smythe kept this incident warm in his heart, and longed for a chance to -get even with somebody for it. Sometime afterward the opportunity came, -in Calcutta. We were leaving on a 24-hour journey to Darjeeling. Mr. -Barclay, the general superintendent, has made special provision for our -accommodation, Mr. Smythe said; so there was no need to hurry about -getting to the train; consequently, we were a little late. - -When we arrived, the usual immense turmoil and confusion of a great -Indian station were in full blast. It was an immoderately long train, -for all the natives of India were going by it somewhither, and the native -officials were being pestered to frenzy by belated and anxious people. -They didn't know where our car was, and couldn't remember having received -any orders about it. It was a deep disappointment; moreover, it looked -as if our half of our party would be left behind altogether. Then Satan -came running and said he had found a compartment with one shelf and one -sofa unoccupied, and had made our beds and had stowed our baggage. We -rushed to the place, and just as the train was ready to pull out and the -porters were slamming the doors to, all down the line, an officer of the -Indian Civil Service, a good friend of ours, put his head in and said:-- - -"I have been hunting for you everywhere. What are you doing here? Don't -you know----" - -The train started before he could finish. Mr. Smythe's opportunity was -come. His bedding, on the shelf, at once changed places with the -bedding--a stranger's--that was occupying the sofa that was opposite to -mine. About ten o'clock we stopped somewhere, and a large Englishman of -official military bearing stepped in. We pretended to be asleep. The -lamps were covered, but there was light enough for us to note his look of -surprise. He stood there, grand and fine, peering down at Smythe, and -wondering in silence at the situation. After a bit be said:-- - -"Well!" And that was all. - -But that was enough. It was easy to understand. It meant: "This is -extraordinary. This is high-handed. I haven't had an experience like -this before." - -He sat down on his baggage, and for twenty minutes we watched him through -our eyelashes, rocking and swaying there to the motion of the train. -Then we came to a station, and he got up and went out, muttering: "I must -find a lower berth, or wait over." His servant came presently and carried -away his things. - -Mr. Smythe's sore place was healed, his hunger for revenge was satisfied. -But he couldn't sleep, and neither could I; for this was a venerable old. -car, and nothing about it was taut. The closet door slammed all night, -and defied every fastening we could invent. We got up very much jaded, -at dawn, and stepped out at a way station; and, while we were taking a -cup of coffee, that Englishman ranged up alongside, and somebody said to -him: - -"So you didn't stop off, after all?" - -"No. The guard found a place for me that had been, engaged and not -occupied. I had a whole saloon car all to myself--oh, quite palatial! -I never had such luck in my life." - -That was our car, you see. We moved into it, straight off, the family -and all. But I asked the English gentleman to remain, and he did. A -pleasant man, an infantry colonel; and doesn't know, yet, that Smythe -robbed him of his berth, but thinks it was done by Smythe's servant -without Smythe's knowledge. He was assisted in gathering this -impression. - -The Indian trains are manned by natives exclusively. The Indian stations -except very large and important ones--are manned entirely by natives, and -so are the posts and telegraphs. The rank and file of the police are -natives. All these people are pleasant and accommodating. One day I -left an express train to lounge about in that perennially ravishing show, -the ebb and flow and whirl of gaudy natives, that is always surging up -and down the spacious platform of a great Indian station; and I lost -myself in the ecstasy of it, and when I turned, the train was moving -swiftly away. I was going to sit down and wait for another train, as I -would have done at home; I had no thought of any other course. But a -native official, who had a green flag in his hand, saw me, and said -politely: - -"Don't you belong in the train, sir?" - -"Yes." I said. - -He waved his flag, and the train came back! And he put me aboard with as -much ceremony as if I had been the General Superintendent. They are -kindly people, the natives. The face and the bearing that indicate a -surly spirit and a bad heart seemed to me to be so rare among Indians--so -nearly non-existent, in fact--that I sometimes wondered if Thuggee wasn't -a dream, and not a reality. The bad hearts are there, but I believe that -they are in a small, poor minority. One thing is sure: They are much the -most interesting people in the world--and the nearest to being -incomprehensible. At any rate, the hardest to account for. Their -character and their history, their customs and their religion, confront -you with riddles at every turn-riddles which are a trifle more perplexing -after they are explained than they were before. You can get the facts of -a custom--like caste, and Suttee, and Thuggee, and so on--and with the -facts a theory which tries to explain, but never quite does it to your -satisfaction. You can never quite understand how so strange a thing -could have been born, nor why. - -For instance--the Suttee. This is the explanation of it: - -A woman who throws away her life when her husband dies is instantly -joined to him again, and is forever afterward happy with him in heaven; -her family will build a little monument to her, or a temple, and will -hold her in honor, and, indeed, worship her memory always; they will -themselves be held in honor by the public; the woman's self-sacrifice has -conferred a noble and lasting distinction upon her posterity. And, -besides, see what she has escaped: If she had elected to live, she would -be a disgraced person; she could not remarry; her family would despise -her and disown her; she would be a friendless outcast, and miserable all -her days. - -Very well, you say, but the explanation is not complete yet. How did -people come to drift into such a strange custom? What was the origin of -the idea? "Well, nobody knows; it was probably a revelation sent down by -the gods." One more thing: Why was such a cruel death chosen--why -wouldn't a gentle one have answered? "Nobody knows; maybe that was a -revelation, too." - -No--you can never understand it. It all seems impossible. You resolve -to believe that a widow never burnt herself willingly, but went to her -death because she was afraid to defy public opinion. But you are not -able to keep that position. History drives you from it. Major Sleeman -has a convincing case in one of his books. In his government on the -Nerbudda he made a brave attempt on the 28th of March, 1828, to put down -Suttee on his own hook and without warrant from the Supreme Government of -India. He could not foresee that the Government would put it down itself -eight months later. The only backing he had was a bold nature and a -compassionate heart. He issued his proclamation abolishing the Suttee in -his district. On the morning of Tuesday--note the day of the week--the -24th of the following November, Ummed Singh Upadhya, head of the most -respectable and most extensive Brahmin family in the district, died, and -presently came a deputation of his sons and grandsons to beg that his old -widow might be allowed to burn herself upon his pyre. Sleeman threatened -to enforce his order, and punish severely any man who assisted; and he -placed a police guard to see that no one did so. From the early morning -the old widow of sixty-five had been sitting on the bank of the sacred -river by her dead, waiting through the long hours for the permission; and -at last the refusal came instead. In one little sentence Sleeman gives -you a pathetic picture of this lonely old gray figure: all day and all -night "she remained sitting by the edge of the water without eating or -drinking." The next morning the body of the husband was burned to ashes -in a pit eight feet square and three or four feet deep, in the view of -several thousand spectators. Then the widow waded out to a bare rock in -the river, and everybody went away but her sons and other relations. All -day she sat there on her rock in the blazing sun without food or drink, -and with no clothing but a sheet over her shoulders. - -The relatives remained with her and all tried to persuade her to desist -from her purpose, for they deeply loved her. She steadily refused. Then -a part of the family went to Sleeman's house, ten miles away, and tried -again to get him to let her burn herself. He refused, hoping to save her -yet. - -All that day she scorched in her sheet on the rock, and all that night -she kept her vigil there in the bitter cold. Thursday morning, in the -sight of her relatives, she went through a ceremonial which said more to -them than any words could have done; she put on the dhaja (a coarse red -turban) and broke her bracelets in pieces. By these acts she became a -dead person in the eye of the law, and excluded from her caste forever. -By the iron rule of ancient custom, if she should now choose to live she -could never return to her family. Sleeman was in deep trouble. If she -starved herself to death her family would be disgraced; and, moreover, -starving would be a more lingering misery than the death by fire. He -went back in the evening thoroughly worried. The old woman remained on -her rock, and there in the morning he found her with her dhaja still on -her head. "She talked very collectedly, telling me that she had -determined to mix her ashes with those of her departed husband, and -should patiently wait my permission to do so, assured that God would -enable her to sustain life till that was given, though she dared not eat -or drink. Looking at the sun, then rising before her over a long and -beautiful reach of the river, she said calmly, 'My soul has been for five -days with my husband's near that sun; nothing but my earthly frame is -left; and this, I know, you will in time suffer to be mixed with his -ashes in yonder pit, because it is not in your nature or usage wantonly -to prolong the miseries of a poor old woman.'" - -He assured her that it was his desire and duty to save her, and to urge -her to live, and to keep her family from the disgrace of being thought -her murderers. But she said she "was not afraid of their being thought -so; that they had all, like good children, done everything in their power -to induce her to live, and to abide with them; and if I should consent I -know they would love and honor me, but my duties to them have now ended. -I commit them all to your care, and I go to attend my husband, Ummed -Singh Upadhya, with whose ashes on the funeral pile mine have been -already three times mixed." - -She believed that she and he had been upon the earth three several times -as wife and husband, and that she had burned herself to death three times -upon his pyre. That is why she said that strange thing. Since she had -broken her bracelets and put on the red turban she regarded herself as a -corpse; otherwise she would not have allowed herself to do her husband -the irreverence of pronouncing his name. "This was the first time in her -long life that she had ever uttered her husband's name, for in India no -woman, high or low, ever pronounces the name of her husband." - -Major Sleeman still tried to shake her purpose. He promised to build her -a fine house among the temples of her ancestors upon the bank of the -river and make handsome provision for her out of rent-free lands if she -would consent to live; and if she wouldn't he would allow no stone or -brick to ever mark the place where she died. But she only smiled and -said, "My pulse has long ceased to beat, my spirit has departed; I shall -suffer nothing in the burning; and if you wish proof, order some fire and -you shall see this arm consumed without giving me any pain." - -Sleeman was now satisfied that he could not alter her purpose. He sent -for all the chief members of the family and said he would suffer her to -burn herself if they would enter into a written engagement to abandon the -suttee in their family thenceforth. They agreed; the papers were drawn -out and signed, and at noon, Saturday, word was sent to the poor old -woman. She seemed greatly pleased. The ceremonies of bathing were gone -through with, and by three o'clock she was ready and the fire was briskly -burning in the pit. She had now gone without food or drink during more -than four days and a half. She came ashore from her rock, first wetting -her sheet in the waters of the sacred river, for without that safeguard -any shadow which might fall upon her would convey impurity to her; then -she walked to the pit, leaning upon one of her sons and a nephew--the -distance was a hundred and fifty yards. - -"I had sentries placed all around, and no other person was allowed to -approach within five paces. She came on with a calm and cheerful -countenance, stopped once, and casting her eyes upwards, said, 'Why have -they kept me five days from thee, my husband?' On coming to the sentries -her supporters stopped and remained standing; she moved on, and walked -once around the pit, paused a moment, and while muttering a prayer, threw -some flowers into the fire. She then walked up deliberately and steadily -to the brink, stepped into the centre of the flame, sat down, and leaning -back in the midst as if reposing upon a couch, was consumed without -uttering a shriek or betraying one sign of agony." - -It is fine and beautiful. It compels one's reverence and respect--no, -has it freely, and without compulsion. We see how the custom, once -started, could continue, for the soul of it is that stupendous power, -Faith; faith brought to the pitch of effectiveness by the cumulative -force of example and long use and custom; but we cannot understand how -the first widows came to take to it. That is a perplexing detail. - -Sleeman says that it was usual to play music at the suttee, but that the -white man's notion that this was to drown the screams of the martyr is -not correct; that it had a quite different purpose. It was believed that -the martyr died prophecying; that the prophecies sometimes foretold -disaster, and it was considered a kindness to those upon whom it was to -fall to drown the voice and keep them in ignorance of the misfortune that -was to come. - - - - -CHAPTER XLIX. - -He had had much experience of physicians, and said "the only way to keep -your health is to eat what you don't want, drink what; you don't like, -and do what you'd druther not." - --Pudd'nhead Wilson's New Calendar. - -It was a long journey--two nights, one day, and part of another day, from -Bombay eastward to Allahabad; but it was always interesting, and it was -not fatiguing. At first the, night travel promised to be fatiguing, but -that was on account of pyjamas. This foolish night-dress consists of -jacket and drawers. Sometimes they are made of silk, sometimes of a -raspy, scratchy, slazy woolen material with a sandpaper surface. The -drawers are loose elephant-legged and elephant-waisted things, and -instead of buttoning around the body there is a drawstring to produce the -required shrinkage. The jacket is roomy, and one buttons it in front. -Pyjamas are hot on a hot night and cold on a cold night--defects which a -nightshirt is free from. I tried the pyjamas in order to be in the -fashion; but I was obliged to give them up, I couldn't stand them. There -was no sufficient change from day-gear to night-gear. I missed the -refreshing and luxurious sense, induced by the night-gown, of being -undressed, emancipated, set free from restraints and trammels. In place -of that, I had the worried, confined, oppressed, suffocated sense of -being abed with my clothes on. All through the warm half of the night -the coarse surfaces irritated my skin and made it feel baked and -feverish, and the dreams which came in the fitful flurries of slumber -were such as distress the sleep of the damned, or ought to; and all -through the cold other half of the night I could get no time for sleep -because I had to employ it all in stealing blankets. But blankets are of -no value at such a time; the higher they are piled the more effectively -they cork the cold in and keep it from getting out. The result is that -your legs are ice, and you know how you will feel by and by when you are -buried. In a sane interval I discarded the pyjamas, and led a rational -and comfortable life thenceforth. - -Out in the country in India, the day begins early. One sees a plain, -perfectly flat, dust-colored and brick-yardy, stretching limitlessly away -on every side in the dim gray light, striped everywhere with hard-beaten -narrow paths, the vast flatness broken at wide intervals by bunches of -spectral trees that mark where villages are; and along all the paths are -slender women and the black forms of lanky naked men moving, to their -work, the women with brass water-jars on their heads, the men carrying -hoes. The man is not entirely naked; always there is a bit of white rag, -a loin-cloth; it amounts to a bandage, and is a white accent on his black -person, like the silver band around the middle of a pipe-stem. Sometimes -he also wears a fluffy and voluminous white turban, and this adds a -second accent. He then answers properly to Miss Gordon Cumming's -flash-light picture of him--as a person who is dressed in "a turban -and a pocket handkerchief." - -All day long one has this monotony of dust-colored dead levels and -scattering bunches of trees and mud villages. You soon realize that -India is not beautiful; still there is an enchantment about it that is -beguiling, and which does not pall. You cannot tell just what it is that -makes the spell, perhaps, but you feel it and confess it, nevertheless. -Of course, at bottom, you know in a vague way that it is history; it is -that that affects you, a haunting sense of the myriads of human lives -that have blossomed, and withered, and perished here, repeating and -repeating and repeating, century after century, and age after age, the -barren and meaningless process; it is this sense that gives to this -forlorn, uncomely land power to speak to the spirit and make friends with -it; to, speak to it with a voice bitter with satire, but eloquent with -melancholy. The deserts of Australia and the ice-barrens of Greenland -have no speech, for they have no venerable history; with nothing to tell -of man and his vanities, his fleeting glories and his miseries, they have -nothing wherewith to spiritualize their ugliness and veil it with a -charm. - -There is nothing pretty about an Indian village--a mud one--and I do not -remember that we saw any but mud ones on that long flight to Allahabad. -It is a little bunch of dirt-colored mud hovels jammed together within a -mud wall. As a rule, the rains had beaten down parts of some of the -houses, and this gave the village the aspect of a mouldering and hoary -ruin. I believe the cattle and the vermin live inside the wall; for I -saw cattle coming out and cattle going in; and whenever I saw a villager, -he was scratching. This last is only circumstantial evidence, but I -think it has value. The village has a battered little temple or two, big -enough to hold an idol, and with custom enough to fat-up a priest and -keep him comfortable. Where there are Mohammedans there are generally a -few sorry tombs outside the village that have a decayed and neglected -look. The villages interested me because of things which Major Sleeman -says about them in his books--particularly what he says about the -division of labor in them. He says that the whole face of India is -parceled out into estates of villages; that nine-tenths of the vast -population of the land consist of cultivators of the soil; that it is -these cultivators who inhabit the villages; that there are certain -"established" village servants--mechanics and others who are apparently -paid a wage by the village at large, and whose callings remain in certain -families and are handed down from father to son, like an estate. He -gives a list of these established servants: Priest, blacksmith, -carpenter, accountant, washerman, basketmaker, potter, watchman, barber, -shoemaker, brazier, confectioner, weaver, dyer, etc. In his day witches -abounded, and it was not thought good business wisdom for a man to marry -his daughter into a family that hadn't a witch in it, for she would need -a witch on the premises to protect her children from the evil spells -which would certainly be cast upon them by the witches connected with the -neighboring families. - -The office of midwife was hereditary in the family of the basket-maker. -It belonged to his wife. She might not be competent, but the office was -hers, anyway. Her pay was not high--25 cents for a boy, and half as much -for a girl. The girl was not desired, because she would be a disastrous -expense by and by. As soon as she should be old enough to begin to wear -clothes for propriety's sake, it would be a disgrace to the family if she -were not married; and to marry her meant financial ruin; for by custom -the father must spend upon feasting and wedding-display everything he had -and all he could borrow--in fact, reduce himself to a condition of -poverty which he might never more recover from. - -It was the dread of this prospective ruin which made the killing of -girl-babies so prevalent in India in the old days before England laid the -iron hand of her prohibitions upon the piteous slaughter. One may judge -of how prevalent the custom was, by one of Sleeman's casual electrical -remarks, when he speaks of children at play in villages--where -girl-voices were never heard! - -The wedding-display folly is still in full force in India, and by -consequence the destruction of girl-babies is still furtively practiced; -but not largely, because of the vigilance of the government and the -sternness of the penalties it levies. - -In some parts of India the village keeps in its pay three other servants: -an astrologer to tell the villager when he may plant his crop, or make a -journey, or marry a wife, or strangle a child, or borrow a dog, or climb -a tree, or catch a rat, or swindle a neighbor, without offending the -alert and solicitous heavens; and what his dream means, if he has had one -and was not bright enough to interpret it himself by the details of his -dinner; the two other established servants were the tiger-persuader and -the hailstorm discourager. The one kept away the tigers if he could, and -collected the wages anyway, and the other kept off the hailstorms, or -explained why he failed. He charged the same for explaining a failure -that he did for scoring a success. A man is an idiot who can't earn a -living in India. - -Major Sleeman reveals the fact that the trade union and the boycott are -antiquities in India. India seems to have originated everything. The -"sweeper" belongs to the bottom caste; he is the lowest of the low--all -other castes despise him and scorn his office. But that does not trouble -him. His caste is a caste, and that is sufficient for him, and so he is -proud of it, not ashamed. Sleeman says: - - "It is perhaps not known to many of my countrymen, even in India, - that in every town and city in the country the right of sweeping the - houses and streets is a monopoly, and is supported entirely by the - pride of castes among the scavengers, who are all of the lowest - class. The right of sweeping within a certain range is recognized - by the caste to belong to a certain member; and if any other member - presumes to sweep within that range, he is excommunicated--no other - member will smoke out of his pipe or drink out of his jug; and he - can get restored to caste only by a feast to the whole body of - sweepers. If any housekeeper within a particular circle happens to - offend the sweeper of that range, none of his filth will be removed - till he pacifies him, because no other sweeper will dare to touch - it; and the people of a town are often more tyrannized over by these - people than by any other." - -A footnote by Major Sleeman's editor, Mr. Vincent Arthur Smith, says that -in our day this tyranny of the sweepers' guild is one of the many -difficulties which bar the progress of Indian sanitary reform. Think of -this: - - "The sweepers cannot be readily coerced, because no Hindoo or - Mussulman would do their work to save his life, nor will he pollute - himself by beating the refractory scavenger." - -They certainly do seem to have the whip-hand; it would be difficult to -imagine a more impregnable position. "The vested rights described in the -text are so fully recognized in practice that they are frequently the -subject of sale or mortgage." - -Just like a milk-route; or like a London crossing-sweepership. It is -said that the London crossing-sweeper's right to his crossing is -recognized by the rest of the guild; that they protect him in its -possession; that certain choice crossings are valuable property, and are -saleable at high figures. I have noticed that the man who sweeps in -front of the Army and Navy Stores has a wealthy South African -aristocratic style about him; and when he is off his guard, he has -exactly that look on his face which you always see in the face of a man -who has is saving up his daughter to marry her to a duke. - -It appears from Sleeman that in India the occupation of elephant-driver -is confined to Mohammedans. I wonder why that is. The water-carrier -('bheestie') is a Mohammedan, but it is said that the reason of that is, -that the Hindoo's religion does not allow him to touch the skin of dead -kine, and that is what the water-sack is made of; it would defile him. -And it doesn't allow him to eat meat; the animal that furnished the meat -was murdered, and to take any creature's life is a sin. It is a good and -gentle religion, but inconvenient. - -A great Indian river, at low water, suggests the familiar anatomical -picture of a skinned human body, the intricate mesh of interwoven muscles -and tendons to stand for water-channels, and the archipelagoes of fat and -flesh inclosed by them to stand for the sandbars. Somewhere on this -journey we passed such a river, and on a later journey we saw in the -Sutlej the duplicate of that river. Curious rivers they are; low shores -a dizzy distance apart, with nothing between but an enormous acreage of -sand-flats with sluggish little veins of water dribbling around amongst -them; Saharas of sand, smallpox-pitted with footprints punctured in belts -as straight as the equator clear from the one shore to the other (barring -the channel-interruptions)--a dry-shod ferry, you see. Long railway -bridges are required for this sort of rivers, and India has them. You -approach Allahabad by a very long one. It was now carrying us across the -bed of the Jumna, a bed which did not seem to have been slept in for one -while or more. It wasn't all river-bed--most of it was overflow ground. - -Allahabad means "City of God." I get this from the books. From a printed -curiosity--a letter written by one of those brave and confident Hindoo -strugglers with the English tongue, called a "babu"--I got a more -compressed translation: "Godville." It is perfectly correct, but that is -the most that can be said for it. - -We arrived in the forenoon, and short-handed; for Satan got left behind -somewhere that morning, and did not overtake us until after nightfall. -It seemed very peaceful without him. The world seemed asleep and -dreaming. - -I did not see the native town, I think. I do not remember why; for an -incident connects it with the Great Mutiny, and that is enough to make -any place interesting. But I saw the English part of the city. It is a -town of wide avenues and noble distances, and is comely and alluring, and -full of suggestions of comfort and leisure, and of the serenity which a -good conscience buttressed by a sufficient bank account gives. The -bungalows (dwellings) stand well back in the seclusion and privacy of -large enclosed compounds (private grounds, as we should say) and in the -shade and shelter of trees. Even the photographer and the prosperous -merchant ply their industries in the elegant reserve of big compounds, -and the citizens drive in thereupon their business occasions. And not in -cabs--no; in the Indian cities cabs are for the drifting stranger; all -the white citizens have private carriages; and each carriage has a flock -of white-turbaned black footmen and drivers all over it. The vicinity of -a lecture-hall looks like a snowstorm,--and makes the lecturer feel like -an opera. India has many names, and they are correctly descriptive. It -is the Land of Contradictions, the Land of Subtlety and Superstition, the -Land of Wealth and Poverty, the Land of Splendor and Desolation, the Land -of Plague and Famine, the Land of the Thug and the Poisoner, and of the -Meek and the Patient, the Land of the Suttee, the Land of the -Unreinstatable Widow, the Land where All Life is Holy, the Land of -Cremation, the Land where the Vulture is a Grave and a Monument, the Land -of the Multitudinous Gods; and if signs go for anything, it is the Land -of the Private Carriage. - -In Bombay the forewoman of a millinery shop came to the hotel in her -private carriage to take the measure for a gown--not for me, but for -another. She had come out to India to make a temporary stay, but was -extending it indefinitely; indeed, she was purposing to end her days -there. In London, she said, her work had been hard, her hours long; for -economy's sake she had had to live in shabby rooms and far away from the -shop, watch the pennies, deny herself many of the common comforts of -life, restrict herself in effect to its bare necessities, eschew cabs, -travel third-class by underground train to and from her work, swallowing -coal-smoke and cinders all the way, and sometimes troubled with the -society of men and women who were less desirable than the smoke and the -cinders. But in Bombay, on almost any kind of wages, she could live in -comfort, and keep her carriage, and have six servants in place of the -woman-of-all-work she had had in her English home. Later, in Calcutta, I -found that the Standard Oil clerks had small one-horse vehicles, and did -no walking; and I was told that the clerks of the other large concerns -there had the like equipment. But to return to Allahabad. - -I was up at dawn, the next morning. In India the tourist's servant does -not sleep in a room in the hotel, but rolls himself up head and ears in -his blanket and stretches himself on the veranda, across the front of his -master's door, and spends the night there. I don't believe anybody's -servant occupies a room. Apparently, the bungalow servants sleep on the -veranda; it is roomy, and goes all around the house. I speak of -menservants; I saw none of the other sex. I think there are none, except -child-nurses. I was up at dawn, and walked around the veranda, past the -rows of sleepers. In front of one door a Hindoo servant was squatting, -waiting for his master to call him. He had polished the yellow shoes and -placed them by the door, and now he had nothing to do but wait. It was -freezing cold, but there he was, as motionless as a sculptured image, and -as patient. It troubled me. I wanted to say to him, "Don't crouch there -like that and freeze; nobody requires it of you; stir around and get -warm." But I hadn't the words. I thought of saying 'jeldy jow', but I -couldn't remember what it meant, so I didn't say it. I knew another -phrase, but it wouldn't come to my mind. I moved on, purposing to -dismiss him from my thoughts, but his bare legs and bare feet kept him -there. They kept drawing me back from the sunny side to a point whence I -could see him. At the end of an hour he had not changed his attitude in -the least degree. It was a curious and impressive exhibition of meekness -and patience, or fortitude or indifference, I did not know which. But it -worried me, and it was spoiling my morning. In fact, it spoiled two -hours of it quite thoroughly. I quitted this vicinity, then, and left -him to punish himself as much as he might want to. But up to that time -the man had not changed his attitude a hair. He will always remain with -me, I suppose; his figure never grows vague in my memory. Whenever I -read of Indian resignation, Indian patience under wrongs, hardships, and -misfortunes, he comes before me. He becomes a personification, and -stands for India in trouble. And for untold ages India in trouble has -been pursued with the very remark which I was going to utter but didn't, -because its meaning had slipped me: "Jeddy jow!" ("Come, shove along!") - -Why, it was the very thing. - -In the early brightness we made a long drive out to the Fort. Part of -the way was beautiful. It led under stately trees and through groups of -native houses and by the usual village well, where the picturesque gangs -are always flocking to and fro and laughing and chattering; and this time -brawny men were deluging their bronze bodies with the limpid water, and -making a refreshing and enticing show of it; enticing, for the sun was -already transacting business, firing India up for the day. There was -plenty of this early bathing going on, for it was getting toward -breakfast time, and with an unpurified body the Hindoo must not eat. - -Then we struck into the hot plain, and found the roads crowded with -pilgrims of both sexes, for one of the great religious fairs of India was -being held, just beyond the Fort, at the junction of the sacred rivers, -the Ganges and the Jumna. Three sacred rivers, I should have said, for -there is a subterranean one. Nobody has seen it, but that doesn't -signify. The fact that it is there is enough. These pilgrims had come -from all over India; some of them had been months on the way, plodding -patiently along in the heat and dust, worn, poor, hungry, but supported -and sustained by an unwavering faith and belief; they were supremely -happy and content, now; their full and sufficient reward was at hand; -they were going to be cleansed from every vestige of sin and corruption -by these holy waters which make utterly pure whatsoever thing they touch, -even the dead and rotten. It is wonderful, the power of a faith like -that, that can make multitudes upon multitudes of the old and weak and -the young and frail enter without hesitation or complaint upon such -incredible journeys and endure the resultant miseries without repining. -It is done in love, or it is done in fear; I do not know which it is. -No matter what the impulse is, the act born of it is beyond imagination -marvelous to our kind of people, the cold whites. There are choice great -natures among us that could exhibit the equivalent of this prodigious -self-sacrifice, but the rest of us know that we should not be equal to -anything approaching it. Still, we all talk self-sacrifice, and this -makes me hope that we are large enough to honor it in the Hindoo. - -Two millions of natives arrive at this fair every year. How many start, -and die on the road, from age and fatigue and disease and scanty -nourishment, and how many die on the return, from the same causes, no one -knows; but the tale is great, one may say enormous. Every twelfth year -is held to be a year of peculiar grace; a greatly augmented volume of -pilgrims results then. The twelfth year has held this distinction since -the remotest times, it is said. It is said also that there is to be but -one more twelfth year--for the Ganges. After that, that holiest of all -sacred rivers will cease to be holy, and will be abandoned by the pilgrim -for many centuries; how many, the wise men have not stated. At the end -of that interval it will become holy again. Meantime, the data will be -arranged by those people who have charge of all such matters, the great -chief Brahmins. It will be like shutting down a mint. At a first glance -it looks most unbrahminically uncommercial, but I am not disturbed, being -soothed and tranquilized by their reputation. "Brer fox he lay low," as -Uncle Remus says; and at the judicious time he will spring something on -the Indian public which will show that he was not financially asleep when -he took the Ganges out of the market. - -Great numbers of the natives along the roads were bringing away holy -water from the rivers. They would carry it far and wide in India and -sell it. Tavernier, the French traveler (17th century), notes that -Ganges water is often given at weddings, "each guest receiving a cup or -two, according to the liberality of the host; sometimes 2,000 or 3,000 -rupees' worth of it is consumed at a wedding." - -The Fort is a huge old structure, and has had a large experience in -religions. In its great court stands a monolith which was placed there -more than 2,000 years ago to preach (Budhism) by its pious inscription; -the Fort was built three centuries ago by a Mohammedan Emperor--a -resanctification of the place in the interest of that religion. There is -a Hindoo temple, too, with subterranean ramifications stocked with -shrines and idols; and now the Fort belongs to the English, it contains a -Christian Church. Insured in all the companies. - -From the lofty ramparts one has a fine view of the sacred rivers. They -join at that point--the pale blue Jumna, apparently clean and clear, and -the muddy Ganges, dull yellow and not clean. On a long curved spit -between the rivers, towns of tents were visible, with a multitude of -fluttering pennons, and a mighty swarm of pilgrims. It was a troublesome -place to get down to, and not a quiet place when you arrived; but it was -interesting. There was a world of activity and turmoil and noise, partly -religious, partly commercial; for the Mohammedans were there to curse and -sell, and the Hindoos to buy and pray. It is a fair as well as a -religious festival. Crowds were bathing, praying, and drinking the -purifying waters, and many sick pilgrims had come long journeys in -palanquins to be healed of their maladies by a bath; or if that might not -be, then to die on the blessed banks and so make sure of heaven. There -were fakeers in plenty, with their bodies dusted over with ashes and -their long hair caked together with cow-dung; for the cow is holy and so -is the rest of it; so holy that the good Hindoo peasant frescoes the -walls of his hut with this refuse, and also constructs ornamental figures -out of it for the gracing of his dirt floor. There were seated families, -fearfully and wonderfully painted, who by attitude and grouping -represented the families of certain great gods. There was a holy man who -sat naked by the day and by the week on a cluster of iron spikes, and did -not seem to mind it; and another holy man, who stood all day holding his -withered arms motionless aloft, and was said to have been doing it for -years. All of these performers have a cloth on the ground beside them -for the reception of contributions, and even the poorest of the people -give a trifle and hope that the sacrifice will be blessed to him. At -last came a procession of naked holy people marching by and chanting, and -I wrenched myself away. - - - - -CHAPTER L. - -The man who is ostentatious of his modesty is twin to the statue that -wears a fig-leaf. - --Pudd'nhead Wilson's New Calendar. - -The journey to Benares was all in daylight, and occupied but a few hours. -It was admirably dusty. The dust settled upon you in a thick ashy layer -and turned you into a fakeer, with nothing lacking to the role but the -cow manure and the sense of holiness. There was a change of cars about -mid-afternoon at Moghul-serai--if that was the name--and a wait of two -hours there for the Benares train. We could have found a carriage and -driven to the sacred city, but we should have lost the wait. In other -countries a long wait at a station is a dull thing and tedious, but one -has no right to have that feeling in India. You have the monster crowd -of bejeweled natives, the stir, the bustle, the confusion, the shifting -splendors of the costumes--dear me, the delight of it, the charm of it -are beyond speech. The two-hour wait was over too soon. Among other -satisfying things to look at was a minor native prince from the backwoods -somewhere, with his guard of honor, a ragged but wonderfully gaudy gang -of fifty dark barbarians armed with rusty flint-lock muskets. The -general show came so near to exhausting variety that one would have said -that no addition to it could be conspicuous, but when this Falstaff and -his motleys marched through it one saw that that seeming impossibility -had happened. - -We got away by and by, and soon reached the outer edge of Benares; then -there was another wait; but, as usual, with something to look at. This -was a cluster of little canvas-boxes--palanquins. A canvas-box is not much -of a sight--when empty; but when there is a lady in it, it is an object -of interest. These boxes were grouped apart, in the full blaze of the -terrible sun during the three-quarters of an hour that we tarried there. -They contained zenana ladies. They had to sit up; there was not room -enough to stretch out. They probably did not mind it. They are used to -the close captivity of the dwellings all their lives; when they go a -journey they are carried to the train in these boxes; in the train they -have to be secluded from inspection. Many people pity them, and I always -did it myself and never charged anything; but it is doubtful if this -compassion is valued. While we were in India some good-hearted Europeans -in one of the cities proposed to restrict a large park to the use of -zenana ladies, so that they could go there and in assured privacy go -about unveiled and enjoy the sunshine and air as they had never enjoyed -them before. The good intentions back of the proposition were -recognized, and sincere thanks returned for it, but the proposition -itself met with a prompt declination at the hands of those who were -authorized to speak for the zenana ladies. Apparently, the idea was -shocking to the ladies--indeed, it was quite manifestly shocking. Was -that proposition the equivalent of inviting European ladies to assemble -scantily and scandalously clothed in the seclusion of a private park? It -seemed to be about that. - -Without doubt modesty is nothing less than a holy feeling; and without -doubt the person whose rule of modesty has been transgressed feels the -same sort of wound that he would feel if something made holy to him by -his religion had suffered a desecration. I say "rule of modesty" because -there are about a million rules in the world, and this makes a million -standards to be looked out for. Major Sleeman mentions the case of some -high-caste veiled ladies who were profoundly scandalized when some -English young ladies passed by with faces bare to the world; so -scandalized that they spoke out with strong indignation and wondered that -people could be so shameless as to expose their persons like that. And -yet "the legs of the objectors were naked to mid-thigh." Both parties -were clean-minded and irreproachably modest, while abiding by their -separate rules, but they couldn't have traded rules for a change without -suffering considerable discomfort. All human rules are more or less -idiotic, I suppose. It is best so, no doubt. The way it is now, the -asylums can hold the sane people, but if we tried to shut up the insane -we should run out of building materials. - -You have a long drive through the outskirts of Benares before you get to -the hotel. And all the aspects are melancholy. It is a vision of dusty -sterility, decaying temples, crumbling tombs, broken mud walls, shabby -huts. The whole region seems to ache with age and penury. It must take -ten thousand years of want to produce such an aspect. We were still -outside of the great native city when we reached the hotel. It was a -quiet and homelike house, inviting, and manifestly comfortable. But we -liked its annex better, and went thither. It was a mile away, perhaps, -and stood in the midst of a large compound, and was built bungalow -fashion, everything on the ground floor, and a veranda all around. They -have doors in India, but I don't know why. They don't fasten, and they -stand open, as a rule, with a curtain hanging in the doorspace to keep -out the glare of the sun. Still, there is plenty of privacy, for no -white person will come in without notice, of course. The native men -servants will, but they don't seem to count. They glide in, barefoot and -noiseless, and are in the midst before one knows it. At first this is a -shock, and sometimes it is an embarrassment; but one has to get used to -it, and does. - -There was one tree in the compound, and a monkey lived in it. At first I -was strongly interested in the tree, for I was told that it was the -renowned peepul--the tree in whose shadow you cannot tell a lie. This -one failed to stand the test, and I went away from it disappointed. -There was a softly creaking well close by, and a couple of oxen drew -water from it by the hour, superintended by two natives dressed in the -usual "turban and pocket-handkerchief." The tree and the well were the -only scenery, and so the compound was a soothing and lonesome and -satisfying place; and very restful after so many activities. There was -nobody in our bungalow but ourselves; the other guests were in the next -one, where the table d'hote was furnished. A body could not be more -pleasantly situated. Each room had the customary bath attached--a room -ten or twelve feet square, with a roomy stone-paved pit in it and -abundance of water. One could not easily improve upon this arrangement, -except by furnishing it with cold water and excluding the hot, in -deference to the fervency of the climate; but that is forbidden. It -would damage the bather's health. The stranger is warned against taking -cold baths in India, but even the most intelligent strangers are fools, -and they do not obey, and so they presently get laid up. I was the most -intelligent fool that passed through, that year. But I am still more -intelligent now. Now that it is too late. - -I wonder if the 'dorian', if that is the name of it, is another -superstition, like the peepul tree. There was a great abundance and -variety of tropical fruits, but the dorian was never in evidence. It was -never the season for the dorian. It was always going to arrive from -Burma sometime or other, but it never did. By all accounts it was a most -strange fruit, and incomparably delicious to the taste, but not to the -smell. Its rind was said to exude a stench of so atrocious a nature that -when a dorian was in the room even the presence of a polecat was a -refreshment. We found many who had eaten the dorian, and they all spoke -of it with a sort of rapture. They said that if you could hold your nose -until the fruit was in your mouth a sacred joy would suffuse you from -head to foot that would make you oblivious to the smell of the rind, but -that if your grip slipped and you caught the smell of the rind before the -fruit was in your mouth, you would faint. There is a fortune in that -rind. Some day somebody will import it into Europe and sell it for -cheese. - -Benares was not a disappointment. It justified its reputation as a -curiosity. It is on high ground, and overhangs a grand curve of the -Ganges. It is a vast mass of building, compactly crusting a hill, and is -cloven in all directions by an intricate confusion of cracks which stand -for streets. Tall, slim minarets and beflagged temple-spires rise out of -it and give it picturesqueness, viewed from the river. The city is as -busy as an ant-hill, and the hurly-burly of human life swarming along the -web of narrow streets reminds one of the ants. The sacred cow swarms -along, too, and goes whither she pleases, and takes toll of the -grain-shops, and is very much in the way, and is a good deal of a -nuisance, since she must not be molested. - -Benares is older than history, older than tradition, older even than -legend, and looks twice as old as all of them put together. From a -Hindoo statement quoted in Rev. Mr. Parker's compact and lucid Guide to -Benares, I find that the site of the town was the beginning-place of the -Creation. It was merely an upright "lingam," at first, no larger than a -stove-pipe, and stood in the midst of a shoreless ocean. This was the -work of the God Vishnu. Later he spread the lingam out till its surface -was ten miles across. Still it was not large enough for the business; -therefore he presently built the globe around it. Benares is thus the -center of the earth. This is considered an advantage. - -It has had a tumultuous history, both materially and spiritually. It -started Brahminically, many ages ago; then by and by Buddha came in -recent times 2,500 years ago, and after that it was Buddhist during many -centuries--twelve, perhaps--but the Brahmins got the upper hand again, -then, and have held it ever since. It is unspeakably sacred in Hindoo -eyes, and is as unsanitary as it is sacred, and smells like the rind of -the dorian. It is the headquarters of the Brahmin faith, and one-eighth -of the population are priests of that church. But it is not an -overstock, for they have all India as a prey. All India flocks thither -on pilgrimage, and pours its savings into the pockets of the priests in a -generous stream, which never fails. A priest with a good stand on the -shore of the Ganges is much better off than the sweeper of the best -crossing in London. A good stand is worth a world of money. The holy -proprietor of it sits under his grand spectacular umbrella and blesses -people all his life, and collects his commission, and grows fat and rich; -and the stand passes from father to son, down and down and down through -the ages, and remains a permanent and lucrative estate in the family. As -Mr. Parker suggests, it can become a subject of dispute, at one time or -another, and then the matter will be settled, not by prayer and fasting -and consultations with Vishnu, but by the intervention of a much more -puissant power--an English court. In Bombay I was told by an American -missionary that in India there are 640 Protestant missionaries at work. -At first it seemed an immense force, but of course that was a thoughtless -idea. One missionary to 500,000 natives--no, that is not a force; it is -the reverse of it; 640 marching against an intrenched camp of -300,000,000--the odds are too great. A force of 640 in Benares alone -would have its hands over-full with 8,000 Brahmin priests for adversary. -Missionaries need to be well equipped with hope and confidence, and this -equipment they seem to have always had in all parts of the world. Mr. -Parker has it. It enables him to get a favorable outlook out of -statistics which might add up differently with other mathematicians. For -instance: - -"During the past few years competent observers declare that the number of -pilgrims to Benares has increased." - -And then he adds up this fact and gets this conclusion: - -"But the revival, if so it may be called, has in it the marks of death. -It is a spasmodic struggle before dissolution." - -In this world we have seen the Roman Catholic power dying, upon these -same terms, for many centuries. Many a time we have gotten all ready for -the funeral and found it postponed again, on account of the weather or -something. Taught by experience, we ought not to put on our things for -this Brahminical one till we see the procession move. Apparently one of -the most uncertain things in the world is the funeral of a religion. - -I should have been glad to acquire some sort of idea of Hindoo theology, -but the difficulties were too great, the matter was too intricate. Even -the mere A, B, C of it is baffling. - -There is a trinity--Brahma, Shiva, and Vishnu--independent powers, -apparently, though one cannot feel quite sure of that, because in one of -the temples there is an image where an attempt has been made to -concentrate the three in one person. The three have other names and -plenty of them, and this makes confusion in one's mind. The three have -wives and the wives have several names, and this increases the confusion. -There are children, the children have many names, and thus the confusion -goes on and on. It is not worth while to try to get any grip upon the -cloud of minor gods, there are too many of them. - -It is even a justifiable economy to leave Brahma, the chiefest god of -all, out of your studies, for he seems to cut no great figure in India. -The vast bulk of the national worship is lavished upon Shiva and Vishnu -and their families. Shiva's symbol--the "lingam" with which Vishnu began -the Creation--is worshiped by everybody, apparently. It is the commonest -object in Benares. It is on view everywhere, it is garlanded with -flowers, offerings are made to it, it suffers no neglect. Commonly it is -an upright stone, shaped like a thimble-sometimes like an elongated -thimble. This priapus-worship, then, is older than history. Mr. Parker -says that the lingams in Benares "outnumber the inhabitants." - -In Benares there are many Mohammedan mosques. There are Hindoo temples -without number--these quaintly shaped and elaborately sculptured little -stone jugs crowd all the lanes. The Ganges itself and every individual -drop of water in it are temples. Religion, then, is the business of -Benares, just as gold-production is the business of Johannesburg. Other -industries count for nothing as compared with the vast and all-absorbing -rush and drive and boom of the town's specialty. Benares is the -sacredest of sacred cities. The moment you step across the -sharply-defined line which separates it from the rest of the globe, you -stand upon ineffably and unspeakably holy ground. Mr. Parker says: "It -is impossible to convey any adequate idea of the intense feelings of -veneration and affection with which the pious Hindoo regards 'Holy Kashi' -(Benares)." And then he gives you this vivid and moving picture: - - "Let a Hindoo regiment be marched through the district, and as soon - as they cross the line and enter the limits of the holy place they - rend the air with cries of 'Kashi ji ki jai--jai--jai! (Holy - Kashi! Hail to thee! Hail! Hail! Hail)'. The weary pilgrim - scarcely able to stand, with age and weakness, blinded by the dust - and heat, and almost dead with fatigue, crawls out of the oven-like - railway carriage and as soon as his feet touch the ground he lifts - up his withered hands and utters the same pious exclamation. Let a - European in some distant city in casual talk in the bazar mention - the fact that he has lived at Benares, and at once voices will be - raised to call down blessings on his head, for a dweller in Benares - is of all men most blessed." - -It makes our own religious enthusiasm seem pale and cold. Inasmuch as -the life of religion is in the heart, not the head, Mr. Parker's touching -picture seems to promise a sort of indefinite postponement of that -funeral. - - - - -CHAPTER LI. - -Let me make the superstitions of a nation and I care not who makes its -laws or its songs either. - --Pudd'nhead Wilson's New Calendar. - -Yes, the city of Benares is in effect just a big church, a religious -hive, whose every cell is a temple, a shrine or a mosque, and whose every -conceivable earthly and heavenly good is procurable under one roof, so to -speak--a sort of Army and Navy Stores, theologically stocked. - -I will make out a little itinerary for the pilgrim; then you will see how -handy the system is, how convenient, how comprehensive. If you go to -Benares with a serious desire to spiritually benefit yourself, you will -find it valuable. I got some of the facts from conversations with the -Rev. Mr. Parker and the others from his Guide to Benares; they are -therefore trustworthy. - -1. Purification. At sunrise you must go down to the Ganges and bathe, -pray, and drink some of the water. This is for your general -purification. - -2. Protection against Hunger. Next, you must fortify yourself against -the sorrowful earthly ill just named. This you will do by worshiping for -a moment in the Cow Temple. By the door of it you will find an image of -Ganesh, son of Shiva; it has the head of an elephant on a human body; its -face and hands are of silver. You will worship it a little, and pass on, -into a covered veranda, where you will find devotees reciting from the -sacred books, with the help of instructors. In this place are groups of -rude and dismal idols. You may contribute something for their support; -then pass into the temple, a grim and stenchy place, for it is populous -with sacred cows and with beggars. You will give something to the -beggars, and "reverently kiss the tails" of such cows as pass along, for -these cows are peculiarly holy, and this act of worship will secure you -from hunger for the day. - -3. "The Poor Man's Friend." You will next worship this god. He is at -the bottom of a stone cistern in the temple of Dalbhyeswar, under the -shade of a noble peepul tree on the bluff overlooking the Ganges, so you -must go back to the river. The Poor Man's Friend is the god of material -prosperity in general, and the god of the rain in particular. You will -secure material prosperity, or both, by worshiping him. He is Shiva, -under a new alias, and he abides in the bottom of that cistern, in the -form of a stone lingam. You pour Ganges water over him, and in return -for this homage you get the promised benefits. If there is any delay -about the rain, you must pour water in until the cistern is full; the -rain will then be sure to come. - -4. Fever. At the Kedar Ghat you will find a long flight of stone steps -leading down to the river. Half way down is a tank filled with sewage. -Drink as much of it as you want. It is for fever. - -5. Smallpox. Go straight from there to the central Ghat. At its -upstream end you will find a small whitewashed building, which is a -temple sacred to Sitala, goddess of smallpox. Her under-study is there ---a rude human figure behind a brass screen. You will worship this for -reasons to be furnished presently. - -6. The Well of Fate. For certain reasons you will next go and do homage -at this well. You will find it in the Dandpan Temple, in the city. The -sunlight falls into it from a square hole in the masonry above. You will -approach it with awe, for your life is now at stake. You will bend over -and look. If the fates are propitious, you will see your face pictured -in the water far down in the well. If matters have been otherwise -ordered, a sudden cloud will mask the sun and you will see nothing. This -means that you have not six months to live. If you are already at the -point of death, your circumstances are now serious. There is no time to -lose. Let this world go, arrange for the next one. Handily situated, at -your very elbow, is opportunity for this. You turn and worship the image -of Maha Kal, the Great Fate, and happiness in the life to come is -secured. If there is breath in your body yet, you should now make an -effort to get a further lease of the present life. You have a chance. -There is a chance for everything in this admirably stocked and -wonderfully systemized Spiritual and Temporal Army and Navy Store. You -must get yourself carried to the - -7. Well of Long Life. This is within the precincts of the mouldering and -venerable Briddhkal Temple, which is one of the oldest in Benares. You -pass in by a stone image of the monkey god, Hanuman, and there, among the -ruined courtyards, you will find a shallow pool of stagnant sewage. It -smells like the best limburger cheese, and is filthy with the washings of -rotting lepers, but that is nothing, bathe in it; bathe in it gratefully -and worshipfully, for this is the Fountain of Youth; these are the Waters -of Long Life. Your gray hairs will disappear, and with them your -wrinkles and your rheumatism, the burdens of care and the weariness of -age, and you will come out young, fresh, elastic, and full of eagerness -for the new race of life. Now will come flooding upon you the manifold -desires that haunt the dear dreams of the morning of life. You will go -whither you will find - -8. Fulfillment of Desire. To wit, to the Kameshwar Temple, sacred to -Shiva as the Lord of Desires. Arrange for yours there. And if you like -to look at idols among the pack and jam of temples, there you will find -enough to stock a museum. You will begin to commit sins now with a -fresh, new vivacity; therefore, it will be well to go frequently to a -place where you can get - -9. Temporary Cleansing from Sin. To wit, to the Well of the Earring. -You must approach this with the profoundest reverence, for it is -unutterably sacred. It is, indeed, the most sacred place in Benares, the -very Holy of Holies, in the estimation of the people. It is a railed -tank, with stone stairways leading down to the water. The water is not -clean. Of course it could not be, for people are always bathing in it. -As long as you choose to stand and look, you will see the files of -sinners descending and ascending--descending soiled with sin, ascending -purged from it. "The liar, the thief, the murderer, and the adulterer -may here wash and be clean," says the Rev. Mr. Parker, in his book. Very -well. I know Mr. Parker, and I believe it; but if anybody else had said -it, I should consider him a person who had better go down in the tank and -take another wash. The god Vishnu dug this tank. He had nothing to dig -with but his "discus." I do not know what a discus is, but I know it is a -poor thing to dig tanks with, because, by the time this one was finished, -it was full of sweat--Vishnu's sweat. He constructed the site that -Benares stands on, and afterward built the globe around it, and thought -nothing of it, yet sweated like that over a little thing like this tank. -One of these statements is doubtful. I do not know which one it is, but -I think it difficult not to believe that a god who could build a world -around Benares would not be intelligent enough to build it around the -tank too, and not have to dig it. Youth, long life, temporary -purification from sin, salvation through propitiation of the Great Fate ---these are all good. But you must do something more. You must - -10. Make Salvation Sure. There are several ways. To get drowned in -the Ganges is one, but that is not pleasant. To die within the limits of -Benares is another; but that is a risky one, because you might be out of -town when your time came. The best one of all is the Pilgrimage Around -the City. You must walk; also, you must go barefoot. The tramp is -forty-four miles, for the road winds out into the country a piece, and -you will be marching five or six days. But you will have plenty of -company. You will move with throngs and hosts of happy pilgrims whose -radiant costumes will make the spectacle beautiful and whose glad songs -and holy pans of triumph will banish your fatigues and cheer your spirit; -and at intervals there will be temples where you may sleep and be -refreshed with food. The pilgrimage completed, you have purchased -salvation, and paid for it. But you may not get it unless you - -11. Get Your Redemption Recorded. You can get this done at the Sakhi -Binayak Temple, and it is best to do it, for otherwise you might not be -able to prove that you had made the pilgrimage in case the matter should -some day come to be disputed. That temple is in a lane back of the Cow -Temple. Over the door is a red image of Ganesh of the elephant head, son -and heir of Shiva, and Prince of Wales to the Theological Monarchy, so to -speak. Within is a god whose office it is to record your pilgrimage and -be responsible for you. You will not see him, but you will see a Brahmin -who will attend to the matter and take the money. If he should forget to -collect the money, you can remind him. He knows that your salvation is -now secure, but of course you would like to know it yourself. You have -nothing to do but go and pray, and pay at the - -12. Well of the Knowledge of Salvation. It is close to the Golden -Temple. There you will see, sculptured out of a single piece of black -marble, a bull which is much larger than any living bull you have ever -seen, and yet is not a good likeness after all. And there also you will -see a very uncommon thing--an image of Shiva. You have seen his lingam -fifty thousand times already, but this is Shiva himself, and said to be a -good likeness. It has three eyes. He is the only god in the firm that -has three. "The well is covered by a fine canopy of stone supported by -forty pillars," and around it you will find what you have already seen at -almost every shrine you have visited in Benares, a mob of devout and -eager pilgrims. The sacred water is being ladled out to them; with it -comes to them the knowledge, clear, thrilling, absolute, that they are -saved; and you can see by their faces that there is one happiness in this -world which is supreme, and to which no other joy is comparable. You -receive your water, you make your deposit, and now what more would you -have? Gold, diamonds, power, fame? All in a single moment these things -have withered to dirt, dust, ashes. The world has nothing to give you -now. For you it is bankrupt. - -I do not claim that the pilgrims do their acts of worship in the order -and sequence above charted out in this Itinerary of mine, but I think -logic suggests that they ought to do so. Instead of a helter-skelter -worship, we then have a definite starting-place, and a march which -carries the pilgrim steadily forward by reasoned and logical progression -to a definite goal. Thus, his Ganges bath in the early morning gives him -an appetite; he kisses the cow-tails, and that removes it. It is now -business hours, and longings for material prosperity rise in his mind, -and be goes and pours water over Shiva's symbol; this insures the -prosperity, but also brings on a rain, which gives him a fever. Then he -drinks the sewage at the Kedar Ghat to cure the fever; it cures the fever -but gives him the smallpox. He wishes to know how it is going to turn -out; he goes to the Dandpan Temple and looks down the well. A clouded -sun shows him that death is near. Logically his best course for the -present, since he cannot tell at what moment he may die, is to secure a -happy hereafter; this he does, through the agency of the Great Fate. He -is safe, now, for heaven; his next move will naturally be to keep out of -it as long as he can. Therefore he goes to the Briddhkal Temple and -secures Youth and long life by bathing in a puddle of leper-pus which -would kill a microbe. Logically, Youth has re-equipped him for sin and -with the disposition to commit it; he will naturally go to the fane which -is consecrated to the Fulfillment of Desires, and make arrangements. -Logically, he will now go to the Well of the Earring from time to time to -unload and freshen up for further banned enjoyments. But first and last -and all the time he is human, and therefore in his reflective intervals -he will always be speculating in "futures." He will make the Great -Pilgrimage around the city and so make his salvation absolutely sure; he -will also have record made of it, so that it may remain absolutely sure -and not be forgotten or repudiated in the confusion of the Final -Settlement. Logically, also, he will wish to have satisfying and -tranquilizing personal knowledge that that salvation is secure; therefore -he goes to the Well of the Knowledge of Salvation, adds that completing -detail, and then goes about his affairs serene and content; serene and -content, for he is now royally endowed with an advantage which no -religion in this world could give him but his own; for henceforth he may -commit as many million sins as he wants to and nothing can come of it. - -Thus the system, properly and logically ordered, is neat, compact, -clearly defined, and covers the whole ground. I desire to recommend it -to such as find the other systems too difficult, exacting, and irksome -for the uses of this fretful brief life of ours. - -However, let me not deceive any one. My Itinerary lacks a detail. I -must put it in. The truth is, that after the pilgrim has faithfully -followed the requirements of the Itinerary through to the end and has -secured his salvation and also the personal knowledge of that fact, there -is still an accident possible to him which can annul the whole thing. If -he should ever cross to the other side of the Ganges and get caught out -and die there he would at once come to life again in the form of an ass. -Think of that, after all this trouble and expense. You see how -capricious and uncertain salvation is there. The Hindoo has a childish -and unreasoning aversion to being turned into an ass. It is hard to tell -why. One could properly expect an ass to have an aversion to being -turned into a Hindoo. One could understand that he could lose dignity by -it; also self-respect, and nine-tenths of his intelligence. But the -Hindoo changed into an ass wouldn't lose anything, unless you count his -religion. And he would gain much--release from his slavery to two -million gods and twenty million priests, fakeers, holy mendicants, and -other sacred bacilli; he would escape the Hindoo hell; he would also -escape the Hindoo heaven. These are advantages which the Hindoo ought to -consider; then he would go over and die on the other side. - -Benares is a religious Vesuvius. In its bowels the theological forces -have been heaving and tossing, rumbling, thundering and quaking, boiling, -and weltering and flaming and smoking for ages. But a little group of -missionaries have taken post at its base, and they have hopes. There are -the Baptist Missionary Society, the Church Missionary Society, the London -Missionary Society, the Wesleyan Missionary Society, and the Zenana Bible -and Medical Mission. They have schools, and the principal work seems to -be among the children. And no doubt that part of the work prospers best, -for grown people everywhere are always likely to cling to the religion -they were brought up in. - - - - -CHAPTER LII. - -Wrinkles should merely indicate where smiles have been. - --Pudd'nhead Wilson's New Calendar. - -In one of those Benares temples we saw a devotee working for salvation in -a curious way. He had a huge wad of clay beside him and was making it up -into little wee gods no bigger than carpet tacks. He stuck a grain of -rice into each--to represent the lingam, I think. He turned them out -nimbly, for he had had long practice and had acquired great facility. -Every day he made 2,000 gods, then threw them into the holy Ganges. This -act of homage brought him the profound homage of the pious--also their -coppers. He had a sure living here, and was earning a high place in the -hereafter. - -The Ganges front is the supreme show-place of Benares. Its tall bluffs -are solidly caked from water to summit, along a stretch of three miles, -with a splendid jumble of massive and picturesque masonry, a bewildering -and beautiful confusion of stone platforms, temples, stair-flights, rich -and stately palaces--nowhere a break, nowhere a glimpse of the bluff -itself; all the long face of it is compactly walled from sight by this -crammed perspective of platforms, soaring stairways, sculptured temples, -majestic palaces, softening away into the distances; and there is -movement, motion, human life everywhere, and brilliantly costumed ---streaming in rainbows up and down the lofty stairways, and massed in -metaphorical flower-gardens on the miles of great platforms at the -river's edge. - -All this masonry, all this architecture represents piety. The palaces -were built by native princes whose homes, as a rule, are far from -Benares, but who go there from time to time to refresh their souls with -the sight and touch of the Ganges, the river of their idolatry. The -stairways are records of acts of piety; the crowd of costly little -temples are tokens of money spent by rich men for present credit and hope -of future reward. Apparently, the rich Christian who spends large sums -upon his religion is conspicuous with us, by his rarity, but the rich -Hindoo who doesn't spend large sums upon his religion is seemingly -non-existent. With us the poor spend money on their religion, but they -keep back some to live on. Apparently, in India, the poor bankrupt -themselves daily for their religion. The rich Hindoo can afford his -pious outlays; he gets much glory for his spendings, yet keeps back a -sufficiency of his income for temporal purposes; but the poor Hindoo is -entitled to compassion, for his spendings keep him poor, yet get him no -glory. - -We made the usual trip up and down the river, seated in chairs under an -awning on the deck of the usual commodious hand-propelled ark; made it -two or three times, and could have made it with increasing interest and -enjoyment many times more; for, of course, the palaces and temples would -grow more and more beautiful every time one saw them, for that happens -with all such things; also, I think one would not get tired of the -bathers, nor their costumes, nor of their ingenuities in getting out of -them and into them again without exposing too much bronze, nor of their -devotional gesticulations and absorbed bead-tellings. - -But I should get tired of seeing them wash their mouths with that -dreadful water and drink it. In fact, I did get tired of it, and very -early, too. At one place where we halted for a while, the foul gush from -a sewer was making the water turbid and murky all around, and there was a -random corpse slopping around in it that had floated down from up -country. Ten steps below that place stood a crowd of men, women, and -comely young maidens waist deep in the water-and they were scooping it up -in their hands and drinking it. Faith can certainly do wonders, and this -is an instance of it. Those people were not drinking that fearful stuff -to assuage thirst, but in order to purify their souls and the interior of -their bodies. According to their creed, the Ganges water makes -everything pure that it touches--instantly and utterly pure. The sewer -water was not an offence to them, the corpse did not revolt them; the -sacred water had touched both, and both were now snow-pure, and could -defile no one. The memory of that sight will always stay by me; but not -by request. - -A word further concerning the nasty but all-purifying Ganges water. When -we went to Agra, by and by, we happened there just in time to be in at -the birth of a marvel--a memorable scientific discovery--the discovery -that in certain ways the foul and derided Ganges water is the most -puissant purifier in the world! This curious fact, as I have said, had -just been added to the treasury of modern science. It had long been -noted as a strange thing that while Benares is often afflicted with the -cholera she does not spread it beyond her borders. This could not be -accounted for. Mr. Henkin, the scientist in the employ of the government -of Agra, concluded to examine the water. He went to Benares and made his -tests. He got water at the mouths of the sewers where they empty into -the river at the bathing ghats; a cubic centimetre of it contained -millions of germs; at the end of six hours they were all dead. He caught -a floating corpse, towed it to the shore, and from beside it he dipped up -water that was swarming with cholera germs; at the end of six hours they -were all dead. He added swarm after swarm of cholera germs to this -water; within the six hours they always died, to the last sample. -Repeatedly, he took pure well water which was bare of animal life, and -put into it a few cholera germs; they always began to propagate at once, -and always within six hours they swarmed--and were numberable by millions -upon millions. - -For ages and ages the Hindoos have had absolute faith that the water of -the Ganges was absolutely pure, could not be defiled by any contact -whatsoever, and infallibly made pure and clean whatsoever thing touched -it. They still believe it, and that is why they bathe in it and drink -it, caring nothing for its seeming filthiness and the floating corpses. -The Hindoos have been laughed at, these many generations, but the -laughter will need to modify itself a little from now on. How did -they find out the water's secret in those ancient ages? Had they -germ-scientists then? We do not know. We only know that they had a -civilization long before we emerged from savagery. But to return to -where I was before; I was about to speak of the burning-ghat. - -They do not burn fakeers--those revered mendicants. They are so holy -that they can get to their place without that sacrament, provided they be -consigned to the consecrating river. We saw one carried to mid-stream -and thrown overboard. He was sandwiched between two great slabs of -stone. - -We lay off the cremation-ghat half an hour and saw nine corpses burned. -I should not wish to see any more of it, unless I might select the -parties. The mourners follow the bier through the town and down to the -ghat; then the bier-bearers deliver the body to some low-caste natives ---Doms--and the mourners turn about and go back home. I heard no crying -and saw no tears, there was no ceremony of parting. Apparently, these -expressions of grief and affection are reserved for the privacy of the -home. The dead women came draped in red, the men in white. They are -laid in the water at the river's edge while the pyre is being prepared. - -The first subject was a man. When the Doms unswathed him to wash him, he -proved to be a sturdily built, well-nourished and handsome old gentleman, -with not a sign about him to suggest that he had ever been ill. Dry wood -was brought and built up into a loose pile; the corpse was laid upon it -and covered over with fuel. Then a naked holy man who was sitting on -high ground a little distance away began to talk and shout with great -energy, and he kept up this noise right along. It may have been the -funeral sermon, and probably was. I forgot to say that one of the -mourners remained behind when the others went away. This was the dead -man's son, a boy of ten or twelve, brown and handsome, grave and -self-possessed, and clothed in flowing white. He was there to burn his -father. He was given a torch, and while he slowly walked seven times -around the pyre the naked black man on the high ground poured out his -sermon more clamorously than ever. The seventh circuit completed, the -boy applied the torch at his father's head, then at his feet; the flames -sprang briskly up with a sharp crackling noise, and the lad went away. -Hindoos do not want daughters, because their weddings make such a ruinous -expense; but they want sons, so that at death they may have honorable -exit from the world; and there is no honor equal to the honor of having -one's pyre lighted by one's son. The father who dies sonless is in a -grievous situation indeed, and is pitied. Life being uncertain, the -Hindoo marries while he is still a boy, in the hope that he will have a -son ready when the day of his need shall come. But if he have no son, he -will adopt one. This answers every purpose. - -Meantime the corpse is burning, also several others. It is a dismal -business. The stokers did not sit down in idleness, but moved briskly -about, punching up the fires with long poles, and now and then adding -fuel. Sometimes they hoisted the half of a skeleton into the air, then -slammed it down and beat it with the pole, breaking it up so that it -would burn better. They hoisted skulls up in the same way and banged and -battered them. The sight was hard to bear; it would have been harder if -the mourners had stayed to witness it. I had but a moderate desire to -see a cremation, so it was soon satisfied. For sanitary reasons it would -be well if cremation were universal; but this form is revolting, and not -to be recommended. - -The fire used is sacred, of course--for there is money in it. Ordinary -fire is forbidden; there is no money in it. I was told that this sacred -fire is all furnished by one person, and that he has a monopoly of it and -charges a good price for it. Sometimes a rich mourner pays a thousand -rupees for it. To get to paradise from India is an expensive thing. -Every detail connected with the matter costs something, and helps to -fatten a priest. I suppose it is quite safe to conclude that that -fire-bug is in holy orders. - -Close to the cremation-ground stand a few time-worn stones which are -remembrances of the suttee. Each has a rough carving upon it, -representing a man and a woman standing or walking hand in hand, and -marks the spot where a widow went to her death by fire in the days when -the suttee flourished. Mr. Parker said that widows would burn themselves -now if the government would allow it. The family that can point to one -of these little memorials and say: "She who burned herself there was an -ancestress of ours," is envied. - -It is a curious people. With them, all life seems to be sacred except -human life. Even the life of vermin is sacred, and must not be taken. -The good Jain wipes off a seat before using it, lest he cause the death -of-some valueless insect by sitting down on it. It grieves him to have -to drink water, because the provisions in his stomach may not agree with -the microbes. Yet India invented Thuggery and the Suttee. India is a -hard country to understand. We went to the temple of the Thug goddess, -Bhowanee, or Kali, or Durga. She has these names and others. She is the -only god to whom living sacrifices are made. Goats are sacrificed to -her. Monkeys would be cheaper. There are plenty of them about the -place. Being sacred, they make themselves very free, and scramble around -wherever they please. The temple and its porch are beautifully carved, -but this is not the case with the idol. Bhowanee is not pleasant to look -at. She has a silver face, and a projecting swollen tongue painted a -deep red. She wears a necklace of skulls. - -In fact, none of the idols in Benares are handsome or attractive. And -what a swarm of them there is! The town is a vast museum of idols--and -all of them crude, misshapen, and ugly. They flock through one's dreams -at night, a wild mob of nightmares. When you get tired of them in the -temples and take a trip on the river, you find idol giants, flashily -painted, stretched out side by side on the shore. And apparently -wherever there is room for one more lingam, a lingam is there. If Vishnu -had foreseen what his town was going to be, he would have called it -Idolville or Lingamburg. - -The most conspicuous feature of Benares is the pair of slender white -minarets which tower like masts from the great Mosque of Aurangzeb. They -seem to be always in sight, from everywhere, those airy, graceful, -inspiring things. But masts is not the right word, for masts have a -perceptible taper, while these minarets have not. They are 142 feet -high, and only 8 1/2 feet in diameter at the base, and 7 1/2 at the -summit--scarcely any taper at all. These are the proportions of a -candle; and fair and fairylike candles these are. Will be, anyway, some -day, when the Christians inherit them and top them with the electric -light. There is a great view from up there--a wonderful view. A large -gray monkey was part of it, and damaged it. A monkey has no judgment. -This one was skipping about the upper great heights of the mosque ---skipping across empty yawning intervals which were almost too wide for -him, and which he only just barely cleared, each time, by the skin of his -teeth. He got me so nervous that I couldn't look at the view. I -couldn't look at anything but him. Every time he went sailing over one -of those abysses my breath stood still, and when he grabbed for the perch -he was going for, I grabbed too, in sympathy. And he was perfectly -indifferent, perfectly unconcerned, and I did all the panting myself. -He came within an ace of losing his life a dozen times, and I was so -troubled about him that I would have shot him if I had had anything to do -it with. But I strongly recommend the view. There is more monkey than -view, and there is always going to be more monkey while that idiot -survives, but what view you get is superb. All Benares, the river, and -the region round about are spread before you. Take a gun, and look at -the view. - -The next thing I saw was more reposeful. It was a new kind of art. It -was a picture painted on water. It was done by a native. He sprinkled -fine dust of various colors on the still surface of a basin of water, and -out of these sprinklings a dainty and pretty picture gradually grew, a -picture which a breath could destroy. Somehow it was impressive, after -so much browsing among massive and battered and decaying fanes that rest -upon ruins, and those ruins upon still other ruins, and those upon still -others again. It was a sermon, an allegory, a symbol of Instability. -Those creations in stone were only a kind of water pictures, after all. - -A prominent episode in the Indian career of Warren Hastings had Benares -for its theater. Wherever that extraordinary man set his foot, he left -his mark. He came to Benares in 1781 to collect a fine of L500,000 which -he had levied upon its Rajah, Cheit Singly on behalf of the East India -Company. Hastings was a long way from home and help. There were, -probably, not a dozen Englishmen within reach; the Rajah was in his fort -with his myriads around him. But no matter. From his little camp in a -neighboring garden, Hastings sent a party to arrest the sovereign. He -sent on this daring mission a couple of hundred native soldiers sepoys ---under command of three young English lieutenants. The Rajah submitted -without a word. The incident lights up the Indian situation -electrically, and gives one a vivid sense of the strides which the -English had made and the mastership they had acquired in the land since -the date of Clive's great victory. In a quarter of a century, from being -nobodies, and feared by none, they were become confessed lords and -masters, feared by all, sovereigns included, and served by all, -sovereigns included. It makes the fairy tales sound true. The English -had not been afraid to enlist native soldiers to fight against their own -people and keep them obedient. And now Hastings was not afraid to come -away out to this remote place with a handful of such soldiers and send -them to arrest a native sovereign. - -The lieutenants imprisoned the Rajah in his own fort. It was beautiful, -the pluckiness of it, the impudence of it. The arrest enraged the -Rajah's people, and all Benares came storming about the place and -threatening vengeance. And yet, but for an accident, nothing important -would have resulted, perhaps. The mob found out a most strange thing, an -almost incredible thing--that this handful of soldiers had come on this -hardy errand with empty guns and no ammunition. This has been attributed -to thoughtlessness, but it could hardly have been that, for in such large -emergencies as this, intelligent people do think. It must have been -indifference, an over-confidence born of the proved submissiveness of the -native character, when confronted by even one or two stern Britons in -their war paint. But, however that may be, it was a fatal discovery that -the mob had made. They were full of courage, now, and they broke into -the fort and massacred the helpless soldiers and their officers. -Hastings escaped from Benares by night and got safely away, leaving the -principality in a state of wild insurrection; but he was back again -within the month, and quieted it down in his prompt and virile way, and -took the Rajah's throne away from him and gave it to another man. He was -a capable kind of person was Warren Hastings. This was the only time he -was ever out of ammunition. Some of his acts have left stains upon his -name which can never be washed away, but he saved to England the Indian -Empire, and that was the best service that was ever done to the Indians -themselves, those wretched heirs of a hundred centuries of pitiless -oppression and abuse. - - - - -CHAPTER LIII. - -True irreverence is disrespect for another man's god. - --Pudd'nhead Wilson's New Calendar. - -It was in Benares that I saw another living god. That makes two. -I believe I have seen most of the greater and lesser wonders of the -world, but I do not remember that any of them interested me so -overwhelmingly as did that pair of gods. - -When I try to account for this effect I find no difficulty about it. -I find that, as a rule, when a thing is a wonder to us it is not because -of what we see in it, but because of what others have seen in it. We get -almost all our wonders at second hand. We are eager to see any -celebrated thing--and we never fail of our reward; just the deep -privilege of gazing upon an object which has stirred the enthusiasm or -evoked the reverence or affection or admiration of multitudes of our race -is a thing which we value; we are profoundly glad that we have seen it, -we are permanently enriched from having seen it, we would not part with -the memory of that experience for a great price. And yet that very -spectacle may be the Taj. You cannot keep your enthusiasms down, you -cannot keep your emotions within bounds when that soaring bubble of -marble breaks upon your view. But these are not your enthusiasms and -emotions--they are the accumulated emotions and enthusiasms of a thousand -fervid writers, who have been slowly and steadily storing them up in your -heart day by day and year by year all your life; and now they burst out -in a flood and overwhelm you; and you could not be a whit happier if they -were your very own. By and by you sober down, and then you perceive that -you have been drunk on the smell of somebody else's cork. For ever and -ever the memory of my distant first glimpse of the Taj will compensate me -for creeping around the globe to have that great privilege. - -But the Taj--with all your inflation of delusive emotions, acquired at -second-hand from people to whom in the majority of cases they were also -delusions acquired at second-hand--a thing which you fortunately did not -think of or it might have made you doubtful of what you imagined were -your own what is the Taj as a marvel, a spectacle and an uplifting and -overpowering wonder, compared with a living, breathing, speaking -personage whom several millions of human beings devoutly and sincerely -and unquestioningly believe to be a God, and humbly and gratefully -worship as a God? - -He was sixty years old when I saw him. He is called Sri 108 Swami -Bhaskarananda Saraswati. That is one form of it. I think that that is -what you would call him in speaking to him--because it is short. But you -would use more of his name in addressing a letter to him; courtesy would -require this. Even then you would not have to use all of it, but only -this much: - -Sri 108 Matparamahansrzpairivrajakacharyaswamibhaskaranandasaraswati. - -You do not put "Esq." after it, for that is not necessary. The word -which opens the volley is itself a title of honor "Sri." The "108" -stands for the rest of his names, I believe. Vishnu has 108 names which -he does not use in business, and no doubt it is a custom of gods and a -privilege sacred to their order to keep 108 extra ones in stock. Just -the restricted name set down above is a handsome property, without the -108. By my count it has 58 letters in it. This removes the long German -words from competition; they are permanently out of the race. - -Sri 108 S. B. Saraswati has attained to what among the Hindoos is called -the "state of perfection." It is a state which other Hindoos reach by -being born again and again, and over and over again into this world, -through one re-incarnation after another--a tiresome long job covering -centuries and decades of centuries, and one that is full of risks, too, -like the accident of dying on the wrong side of the Ganges some time or -other and waking up in the form of an ass, with a fresh start necessary -and the numerous trips to be made all over again. But in reaching -perfection, Sri 108 S. B. S. has escaped all that. He is no longer a -part or a feature of this world; his substance has changed, all -earthiness has departed out of it; he is utterly holy, utterly pure; -nothing can desecrate this holiness or stain this purity; he is no longer -of the earth, its concerns are matters foreign to him, its pains and -griefs and troubles cannot reach him. When he dies, Nirvana is his; he -will be absorbed into the substance of the Supreme Deity and be at peace -forever. - -The Hindoo Scriptures point out how this state is to be reached, but it -is only once in a thousand years, perhaps, that candidate accomplishes -it. This one has traversed the course required, stage by stage, from the -beginning to the end, and now has nothing left to do but wait for the -call which shall release him from a world in which he has now no part nor -lot. First, he passed through the student stage, and became learned in -the holy books. Next he became citizen, householder, husband, and -father. That was the required second stage. Then--like John Bunyan's -Christian he bade perpetual good-bye to his family, as required, and went -wandering away. He went far into the desert and served a term as hermit. -Next, he became a beggar, "in accordance with the rites laid down in the -Scriptures," and wandered about India eating the bread of mendicancy. A -quarter of a century ago he reached the stage of purity. This needs no -garment; its symbol is nudity; he discarded the waist-cloth which he had -previously worn. He could resume it now if he chose, for neither that -nor any other contact can defile him; but he does not choose. - -There are several other stages, I believe, but I do not remember what -they are. But he has been through them. Throughout the long course he -was perfecting himself in holy learning, and writing commentaries upon -the sacred books. He was also meditating upon Brahma, and he does that -now. - -White marble relief-portraits of him are sold all about India. He lives -in a good house in a noble great garden in Benares, all meet and proper -to his stupendous rank. Necessarily he does not go abroad in the -streets. Deities would never be able to move about handily in any -country. If one whom we recognized and adored as a god should go abroad -in our streets, and the day it was to happen were known, all traffic -would be blocked and business would come to a standstill. - -This god is comfortably housed, and yet modestly, all things considered, -for if he wanted to live in a palace he would only need to speak and his -worshipers would gladly build it. Sometimes he sees devotees for a -moment, and comforts them and blesses them, and they kiss his feet and go -away happy. Rank is nothing to him, he being a god. To him all men are -alike. He sees whom he pleases and denies himself to whom he pleases. -Sometimes he sees a prince and denies himself to a pauper; at other times -he receives the pauper and turns the prince away. However, he does not -receive many of either class. He has to husband his time for his -meditations. I think he would receive Rev. Mr. Parker at any time. I -think he is sorry for Mr. Parker, and I think Mr. Parker is sorry for -him; and no doubt this compassion is good for both of them. - -When we arrived we had to stand around in the garden a little while and -wait, and the outlook was not good, for he had been turning away -Maharajas that day and receiving only the riff-raff, and we belonged in -between, somewhere. But presently, a servant came out saying it was all -right, he was coming. - -And sure enough, he came, and I saw him--that object of the worship of -millions. It was a strange sensation, and thrilling. I wish I could -feel it stream through my veins again. And yet, to me he was not a god, -he was only a Taj. The thrill was not my thrill, but had come to me -secondhand from those invisible millions of believers. By a hand-shake -with their god I had ground-circuited their wire and got their monster -battery's whole charge. - -He was tall and slender, indeed emaciated. He had a clean cut and -conspicuously intellectual face, and a deep and kindly eye. He looked -many years older than he really was, but much study and meditation and -fasting and prayer, with the arid life he had led as hermit and beggar, -could account for that. He is wholly nude when he receives natives, of -whatever rank they may be, but he had white cloth around his loins now, a -concession to Mr. Parker's Europe prejudices, no doubt. - -As soon as I had sobered down a little we got along very well together, -and I found him a most pleasant and friendly deity. He had heard a deal -about Chicago, and showed a quite remarkable interest in it, for a god. -It all came of the World's Fair and the Congress of Religions. If India -knows about nothing else American, she knows about those, and will keep -them in mind one while. - -He proposed an exchange of autographs, a delicate attention which made me -believe in him, but I had been having my doubts before. He wrote his in -his book, and I have a reverent regard for that book, though the words -run from right to left, and so I can't read it. It was a mistake to -print in that way. It contains his voluminous comments on the Hindoo -holy writings, and if I could make them out I would try for perfection -myself. I gave him a copy of Huckleberry Finn. I thought it might rest -him up a little to mix it in along with his meditations on Brahma, for he -looked tired, and I knew that if it didn't do him any good it wouldn't do -him any harm. - -He has a scholar meditating under him--Mina Bahadur Rana--but we did not -see him. He wears clothes and is very imperfect. He has written a -little pamphlet about his master, and I have that. It contains a -wood-cut of the master and himself seated on a rug in the garden. The -portrait of the master is very good indeed. The posture is exactly that -which Brahma himself affects, and it requires long arms and limber legs, -and can be accumulated only by gods and the india-rubber man. There is a -life-size marble relief of Shri 108, S.B.S. in the garden. It -represents him in this same posture. - -Dear me! It is a strange world. Particularly the Indian division of it. -This pupil, Mina Bahadur Rana, is not a commonplace person, but a man of -distinguished capacities and attainments, and, apparently, he had a fine -worldly career in front of him. He was serving the Nepal Government in a -high capacity at the Court of the Viceroy of India, twenty years ago. He -was an able man, educated, a thinker, a man of property. But the longing -to devote himself to a religious life came upon him, and he resigned his -place, turned his back upon the vanities and comforts of the world, and -went away into the solitudes to live in a hut and study the sacred -writings and meditate upon virtue and holiness and seek to attain them. -This sort of religion resembles ours. Christ recommended the rich to -give away all their property and follow Him in poverty, not in worldly -comfort. American and English millionaires do it every day, and thus -verify and confirm to the world the tremendous forces that lie in -religion. Yet many people scoff at them for this loyalty to duty, and -many will scoff at Mina Bahadur Rana and call him a crank. Like many -Christians of great character and intellect, he has made the study of his -Scriptures and the writing of books of commentaries upon them the loving -labor of his life. Like them, he has believed that his was not an idle -and foolish waste of his life, but a most worthy and honorable employment -of it. Yet, there are many people who will see in those others, men -worthy of homage and deep reverence, but in him merely a crank. But I -shall not. He has my reverence. And I don't offer it as a common thing -and poor, but as an unusual thing and of value. The ordinary reverence, -the reverence defined and explained by the dictionary costs nothing. -Reverence for one's own sacred things--parents, religion, flag, laws, and -respect for one's own beliefs--these are feelings which we cannot even -help. They come natural to us; they are involuntary, like breathing. -There is no personal merit in breathing. But the reverence which is -difficult, and which has personal merit in it, is the respect which you -pay, without compulsion, to the political or religious attitude of a man -whose beliefs are not yours. You can't revere his gods or his politics, -and no one expects you to do that, but you could respect his belief in -them if you tried hard enough; and you could respect him, too, if you -tried hard enough. But it is very, very difficult; it is next to -impossible, and so we hardly ever try. If the man doesn't believe as we -do, we say he is a crank, and that settles it. I mean it does nowadays, -because now we can't burn him. - -We are always canting about people's "irreverence," always charging this -offense upon somebody or other, and thereby intimating that we are better -than that person and do not commit that offense ourselves. Whenever we -do this we are in a lying attitude, and our speech is cant; for none of -us are reverent--in a meritorious way; deep down in our hearts we are all -irreverent. There is probably not a single exception to this rule in the -earth. There is probably not one person whose reverence rises higher -than respect for his own sacred things; and therefore, it is not a thing -to boast about and be proud of, since the most degraded savage has that ---and, like the best of us, has nothing higher. To speak plainly, we -despise all reverences and all objects of reverence which are outside the -pale of our own list of sacred things. And yet, with strange -inconsistency, we are shocked when other people despise and defile the -things which are holy to us. Suppose we should meet with a paragraph -like the following, in the newspapers: - -"Yesterday a visiting party of the British nobility had a picnic at Mount -Vernon, and in the tomb of Washington they ate their luncheon, sang -popular songs, played games, and danced waltzes and polkas." - -Should we be shocked? Should we feel outraged? Should we be amazed? -Should we call the performance a desecration? Yes, that would all -happen. We should denounce those people in round terms, and call them -hard names. - -And suppose we found this paragraph in the newspapers: - -"Yesterday a visiting party of American pork-millionaires had a picnic in -Westminster Abbey, and in that sacred place they ate their luncheon, sang -popular songs, played games, and danced waltzes and polkas." - -Would the English be shocked? Would they feel outraged? Would they be -amazed? Would they call the performance a desecration? That would all -happen. The pork-millionaires would be denounced in round terms; they -would be called hard names. - -In the tomb at Mount Vernon lie the ashes of America's most honored son; -in the Abbey, the ashes of England's greatest dead; the tomb of tombs, -the costliest in the earth, the wonder of the world, the Taj, was built -by a great Emperor to honor the memory of a perfect wife and perfect -mother, one in whom there was no spot or blemish, whose love was his stay -and support, whose life was the light of the world to him; in it her -ashes lie, and to the Mohammedan millions of India it is a holy place; to -them it is what Mount Vernon is to Americans, it is what the Abbey is to -the English. - -Major Sleeman wrote forty or fifty years ago (the italics are mine): - - "I would here enter my humble protest against the quadrille and - lunch parties which are sometimes given to European ladies and - gentlemen of the station at this imperial tomb; drinking and dancing - are no doubt very good things in their season, but they are sadly - out of place in a sepulchre." - -Were there any Americans among those lunch parties? If they were -invited, there were. - -If my imagined lunch-parties in Westminster and the tomb of Washington -should take place, the incident would cause a vast outbreak of bitter -eloquence about Barbarism and Irreverence; and it would come from two -sets of people who would go next day and dance in the Taj if they had a -chance. - -As we took our leave of the Benares god and started away we noticed a -group of natives waiting respectfully just within the gate--a Rajah from -somewhere in India, and some people of lesser consequence. The god -beckoned them to come, and as we passed out the Rajah was kneeling and -reverently kissing his sacred feet. - -If Barnum--but Barnum's ambitions are at rest. This god will remain in -the holy peace and seclusion of his garden, undisturbed. Barnum could -not have gotten him, anyway. Still, he would have found a substitute -that would answer. - - - - -CHAPTER LIV. - -Do not undervalue the headache. While it is at its sharpest it seems a -bad investment; but when relief begins, the unexpired remainder is worth -$4 a minute. - --Pudd'nhead Wilson's New Calendar. - -A comfortable railway journey of seventeen and a half hours brought us to -the capital of India, which is likewise the capital of Bengal--Calcutta. -Like Bombay, it has a population of nearly a million natives and a small -gathering of white people. It is a huge city and fine, and is called the -City of Palaces. It is rich in historical memories; rich in British -achievement--military, political, commercial; rich in the results of the -miracles done by that brace of mighty magicians, Clive and Hastings. And -has a cloud kissing monument to one Ochterlony. - -It is a fluted candlestick 250 feet high. This lingam is the only large -monument in Calcutta, I believe. It is a fine ornament, and will keep -Ochterlony in mind. - -Wherever you are, in Calcutta, and for miles around, you can see it; and -always when you see it you think of Ochterlony. And so there is not an -hour in the day that you do not think of Ochterlony and wonder who he -was. It is good that Clive cannot come back, for he would think it was -for Plassey; and then that great spirit would be wounded when the -revelation came that it was not. Clive would find out that it was for -Ochterlony; and he would think Ochterlony was a battle. And he would -think it was a great one, too, and he would say, "With three thousand I -whipped sixty thousand and founded the Empire--and there is no monument; -this other soldier must have whipped a billion with a dozen and saved the -world." - -But he would be mistaken. Ochterlony was a man, not a battle. And he -did good and honorable service, too; as good and honorable service as has -been done in India by seventy-five or a hundred other Englishmen of -courage, rectitude, and distinguished capacity. For India has been a -fertile breeding-ground of such men, and remains so; great men, both in -war and in the civil service, and as modest as great. But they have no -monuments, and were not expecting any. Ochterlony could not have been -expecting one, and it is not at all likely that he desired one--certainly -not until Clive and Hastings should be supplied. Every day Clive and -Hastings lean on the battlements of heaven and look down and wonder which -of the two the monument is for; and they fret and worry because they -cannot find out, and so the peace of heaven is spoiled for them and lost. -But not for Ochterlony. Ochterlony is not troubled. He doesn't suspect -that it is his monument. Heaven is sweet and peaceful to him. There is -a sort of unfairness about it all. - -Indeed, if monuments were always given in India for high achievements, -duty straitly performed, and smirchless records, the landscape would be -monotonous with them. The handful of English in India govern the Indian -myriads with apparent ease, and without noticeable friction, through -tact, training, and distinguished administrative ability, reinforced by -just and liberal laws--and by keeping their word to the native whenever -they give it. - -England is far from India and knows little about the eminent services -performed by her servants there, for it is the newspaper correspondent -who makes fame, and he is not sent to India but to the continent, to -report the doings of the princelets and the dukelets, and where they are -visiting and whom they are marrying. Often a British official spends -thirty or forty years in India, climbing from grade to grade by services -which would make him celebrated anywhere else, and finishes as a -vice-sovereign, governing a great realm and millions of subjects; then he -goes home to England substantially unknown and unheard of, and settles -down in some modest corner, and is as one extinguished. Ten years later -there is a twenty-line obituary in the London papers, and the reader is -paralyzed by the splendors of a career which he is not sure that he had -ever heard of before. But meanwhile he has learned all about the -continental princelets and dukelets. - -The average man is profoundly ignorant of countries that lie remote from -his own. When they are mentioned in his presence one or two facts and -maybe a couple of names rise like torches in his mind, lighting up an -inch or two of it and leaving the rest all dark. The mention of Egypt -suggests some Biblical facts and the Pyramids-nothing more. The mention -of South Africa suggests Kimberly and the diamonds and there an end. -Formerly the mention, to a Hindoo, of America suggested a name--George -Washington--with that his familiarity with our country was exhausted. -Latterly his familiarity with it has doubled in bulk; so that when -America is mentioned now, two torches flare up in the dark caverns of his -mind and he says, "Ah, the country of the great man Washington; and of -the Holy City--Chicago." For he knows about the Congress of Religion, and -this has enabled him to get an erroneous impression of Chicago. - -When India is mentioned to the citizen of a far country it suggests -Clive, Hastings, the Mutiny, Kipling, and a number of other great events; -and the mention of Calcutta infallibly brings up the Black Hole. And so, -when that citizen finds himself in the capital of India he goes first of -all to see the Black Hole of Calcutta--and is disappointed. - -The Black Hole was not preserved; it is gone, long, long ago. It is -strange. Just as it stood, it was itself a monument; a ready-made one. -It was finished, it was complete, its materials were strong and lasting, -it needed no furbishing up, no repairs; it merely needed to be let alone. -It was the first brick, the Foundation Stone, upon which was reared a -mighty Empire--the Indian Empire of Great Britain. It was the ghastly -episode of the Black Hole that maddened the British and brought Clive, -that young military marvel, raging up from Madras; it was the seed from -which sprung Plassey; and it was that extraordinary battle, whose like -had not been seen in the earth since Agincourt, that laid deep and strong -the foundations of England's colossal Indian sovereignty. - -And yet within the time of men who still live, the Black Hole was torn -down and thrown away as carelessly as if its bricks were common clay, not -ingots of historic gold. There is no accounting for human beings. - -The supposed site of the Black Hole is marked by an engraved plate. I -saw that; and better that than nothing. The Black Hole was a prison--a -cell is nearer the right word--eighteen feet square, the dimensions of an -ordinary bedchamber; and into this place the victorious Nabob of Bengal -packed 146 of his English prisoners. There was hardly standing room for -them; scarcely a breath of air was to be got; the time was night, the -weather sweltering hot. Before the dawn came, the captives were all dead -but twenty-three. Mr. Holwell's long account of the awful episode was -familiar to the world a hundred years ago, but one seldom sees in print -even an extract from it in our day. Among the striking things in it is -this. Mr. Holwell, perishing with thirst, kept himself alive by sucking -the perspiration from his sleeves. It gives one a vivid idea of the -situation. He presently found that while he was busy drawing life from -one of his sleeves a young English gentleman was stealing supplies from -the other one. Holwell was an unselfish man, a man of the most generous -impulses; he lived and died famous for these fine and rare qualities; yet -when he found out what was happening to that unwatched sleeve, he took -the precaution to suck that one dry first. The miseries of the Black -Hole were able to change even a nature like his. But that young -gentleman was one of the twenty-three survivors, and he said it was the -stolen perspiration that saved his life. From the middle of Mr. -Holwell's narrative I will make a brief excerpt: - - "Then a general prayer to Heaven, to hasten the approach of the - flames to the right and left of us, and put a period to our misery. - But these failing, they whose strength and spirits were quite - exhausted laid themselves down and expired quietly upon their - fellows: others who had yet some strength and vigor left made a last - effort at the windows, and several succeeded by leaping and - scrambling over the backs and heads of those in the first rank, and - got hold of the bars, from which there was no removing them. Many - to the right and left sunk with the violent pressure, and were soon - suffocated; for now a steam arose from the living and the dead, - which affected us in all its circumstances as if we were forcibly - held with our heads over a bowl full of strong volatile spirit of - hartshorn, until suffocated; nor could the effluvia of the one be - distinguished from the other, and frequently, when I was forced by - the load upon my head and shoulders to hold my face down, I was - obliged, near as I was to the window, instantly to raise it again to - avoid suffocation. I need not, my dear friend, ask your - commiseration, when I tell you, that in this plight, from half an - hour past eleven till near two in the morning, I sustained the - weight of a heavy man, with his knees in my back, and the pressure - of his whole body on my head. A Dutch surgeon who had taken his - seat upon my left shoulder, and a Topaz (a black Christian soldier) - bearing on my right; all which nothing could have enabled me to - support but the props and pressure equally sustaining me all around. - The two latter I frequently dislodged by shifting my hold on the - bars and driving my knuckles into their ribs; but my friend above - stuck fast, held immovable by two bars. - - "I exerted anew my strength and fortitude; but the repeated trials - and efforts I made to dislodge the insufferable incumbrances upon me - at last quite exhausted me; and towards two o'clock, finding I must - quit the window or sink where I was, I resolved on the former, - having bore, truly for the sake of others, infinitely more for life - than the best of it is worth. In the rank close behind me was an - officer of one of the ships, whose name was Cary, and who had - behaved with much bravery during the siege (his wife, a fine woman, - though country born, would not quit him, but accompanied him into - the prison, and was one who survived). This poor wretch had been - long raving for water and air; I told him I was determined to give - up life, and recommended his gaining my station. On my quitting it - he made a fruitless attempt to get my place; but the Dutch surgeon, - who sat on my shoulder, supplanted him. Poor Cary expressed his - thankfulness, and said he would give up life too; but it was with - the utmost labor we forced our way from the window (several in the - inner ranks appearing to me dead standing, unable to fall by the - throng and equal pressure around). He laid himself down to die; and - his death, I believe, was very sudden; for he was a short, full, - sanguine man. His strength was great; and, I imagine, had he not - retired with me, I should never have been able to force my way. I - was at this time sensible of no pain, and little uneasiness; I can - give you no better idea of my situation than by repeating my simile - of the bowl of spirit of hartshorn. I found a stupor coming on - apace, and laid myself down by that gallant old man, the Rev. Mr. - Jervas Bellamy, who laid dead with his son, the lieutenant, hand in - hand, near the southernmost wall of the prison. When I had lain - there some little time, I still had reflection enough to suffer some - uneasiness in the thought that I should be trampled upon, when dead, - as I myself had done to others. With some difficulty I raised - myself, and gained the platform a second time, where I presently - lost all sensation; the last trace of sensibility that I have been - able to recollect after my laying down, was my sash being uneasy - about my waist, which I untied, and threw from me. Of what passed - in this interval, to the time of my resurrection from this hole of - horrors, I can give you no account." - -There was plenty to see in Calcutta, but there was not plenty of time for -it. I saw the fort that Clive built; and the place where Warren Hastings -and the author of the Junius Letters fought their duel; and the great -botanical gardens; and the fashionable afternoon turnout in the Maidan; -and a grand review of the garrison in a great plain at sunrise; and a -military tournament in which great bodies of native soldiery exhibited -the perfection of their drill at all arms, a spectacular and beautiful -show occupying several nights and closing with the mimic storming of a -native fort which was as good as the reality for thrilling and accurate -detail, and better than the reality for security and comfort; we had a -pleasure excursion on the 'Hoogly' by courtesy of friends, and devoted -the rest of the time to social life and the Indian museum. One should -spend a month in the museum, an enchanted palace of Indian antiquities. -Indeed, a person might spend half a year among the beautiful and -wonderful things without exhausting their interest. - -It was winter. We were of Kipling's "hosts of tourists who travel up and -down India in the cold weather showing how things ought to be managed." -It is a common expression there, "the cold weather," and the people think -there is such a thing. It is because they have lived there half a -lifetime, and their perceptions have become blunted. When a person is -accustomed to 138 in the shade, his ideas about cold weather are not -valuable. I had read, in the histories, that the June marches made -between Lucknow and Cawnpore by the British forces in the time of the -Mutiny were made weather--138 in the shade and had taken it for -historical embroidery. I had read it again in Serjeant-Major -Forbes-Mitchell's account of his military experiences in the Mutiny ---at least I thought I had--and in Calcutta I asked him if it was true, -and he said it was. An officer of high rank who had been in the thick of -the Mutiny said the same. As long as those men were talking about what -they knew, they were trustworthy, and I believed them; but when they said -it was now "cold weather," I saw that they had traveled outside of their -sphere of knowledge and were floundering. I believe that in India "cold -weather" is merely a conventional phrase and has come into use through -the necessity of having some way to distinguish between weather which -will melt a brass door-knob and weather which will only make it mushy. -It was observable that brass ones were in use while I was in Calcutta, -showing that it was not yet time to change to porcelain; I was told the -change to porcelain was not usually made until May. But this cold -weather was too warm for us; so we started to Darjeeling, in the -Himalayas--a twenty-four hour journey. - - - - -CHAPTER LV. - -There are 869 different forms of lying, but only one of them has been -squarely forbidden. Thou shalt not bear false witness against thy -neighbor. - --Pudd'nhead Wilson's New Calendar. - - -FROM DIARY: - -February 14. We left at 4:30 P.M. Until dark we moved through rich -vegetation, then changed to a boat and crossed the Ganges. - -February 15. Up with the sun. A brilliant morning, and frosty. A -double suit of flannels is found necessary. The plain is perfectly -level, and seems to stretch away and away and away, dimming and -softening, to the uttermost bounds of nowhere. What a soaring, -strenuous, gushing fountain spray of delicate greenery a bunch of bamboo -is! As far as the eye can reach, these grand vegetable geysers grace the -view, their spoutings refined to steam by distance. And there are fields -of bananas, with the sunshine glancing from the varnished surface of -their drooping vast leaves. And there are frequent groves of palm; and -an effective accent is given to the landscape by isolated individuals of -this picturesque family, towering, clean-stemmed, their plumes broken and -hanging ragged, Nature's imitation of an umbrella that has been out to -see what a cyclone is like and is trying not to look disappointed. And -everywhere through the soft morning vistas we glimpse the villages, the -countless villages, the myriad villages, thatched, built of clean new -matting, snuggling among grouped palms and sheaves of bamboo; villages, -villages, no end of villages, not three hundred yards apart, and dozens -and dozens of them in sight all the time; a mighty City, hundreds of -miles long, hundreds of miles broad, made all of villages, the biggest -city in the earth, and as populous as a European kingdom. I have seen no -such city as this before. And there is a continuously repeated and -replenished multitude of naked men in view on both sides and ahead. We -fly through it mile after mile, but still it is always there, on both -sides and ahead--brown-bodied, naked men and boys, plowing in the fields. -But not woman. In these two hours I have not seen a woman or a girl -working in the fields. - - "From Greenland's icy mountains, - From India's coral strand, - Where Afric's sunny fountains - Roll down their golden sand. - From many an ancient river, - From many a palmy plain, - They call us to deliver - Their land from error's chain." - -Those are beautiful verses, and they have remained in my memory all my -life. But if the closing lines are true, let us hope that when we come -to answer the call and deliver the land from its errors, we shall secrete -from it some of our high-civilization ways, and at the same time borrow -some of its pagan ways to enrich our high system with. We have a right -to do this. If we lift those people up, we have a right to lift -ourselves up nine or ten grades or so, at their expense. A few years ago -I spent several weeks at Tolz, in Bavaria. It is a Roman Catholic -region, and not even Benares is more deeply or pervasively or -intelligently devout. In my diary of those days I find this: - - "We took a long drive yesterday around about the lovely country - roads. But it was a drive whose pleasure was damaged in a couple of - ways: by the dreadful shrines and by the shameful spectacle of gray - and venerable old grandmothers toiling in the fields. The shrines - were frequent along the roads--figures of the Saviour nailed to the - cross and streaming with blood from the wounds of the nails and the - thorns. - - "When missionaries go from here do they find fault with the pagan - idols? I saw many women seventy and even eighty years old mowing - and binding in the fields, and pitchforking the loads into the - wagons." - -I was in Austria later, and in Munich. In Munich I saw gray old women -pushing trucks up hill and down, long distances, trucks laden with -barrels of beer, incredible loads. In my Austrian diary I find this: - - "In the fields I often see a woman and a cow harnessed to the plow, - and a man driving. - - "In the public street of Marienbad to-day, I saw an old, bent, - gray-headed woman, in harness with a dog, drawing a laden sled over - bare dirt roads and bare pavements; and at his ease walked the - driver, smoking his pipe, a hale fellow not thirty years old." - -Five or six years ago I bought an open boat, made a kind of a canvas -wagon-roof over the stern of it to shelter me from sun and rain; hired a -courier and a boatman, and made a twelve-day floating voyage down the -Rhone from Lake Bourget to Marseilles. In my diary of that trip I find -this entry. I was far down the Rhone then: - - "Passing St. Etienne, 2:15 P.M. On a distant ridge inland, a tall - openwork structure commandingly situated, with a statue of the - Virgin standing on it. A devout country. All down this river, - wherever there is a crag there is a statue of the Virgin on it. I - believe I have seen a hundred of them. And yet, in many respects, - the peasantry seem to be mere pagans, and destitute of any - considerable degree of civilization. - - " . . . . We reached a not very promising looking village about - 4 o'clock, and I concluded to tie up for the day; munching fruit and - fogging the hood with pipe-smoke had grown monotonous; I could not - have the hood furled, because the floods of rain fell unceasingly. - The tavern was on the river bank, as is the custom. It was dull - there, and melancholy--nothing to do but look out of the window into - the drenching rain, and shiver; one could do that, for it was bleak - and cold and windy, and country France furnishes no fire. Winter - overcoats did not help me much; they had to be supplemented with - rugs. The raindrops were so large and struck the river with such - force that they knocked up the water like pebble-splashes. - - "With the exception of a very occasional woodenshod peasant, nobody - was abroad in this bitter weather--I mean nobody of our sex. But - all weathers are alike to the women in these continental countries. - To them and the other animals, life is serious; nothing interrupts - their slavery. Three of them were washing clothes in the river - under the window when I arrived, and they continued at it as long as - there was light to work by. One was apparently thirty; another--the - mother!--above fifty; the third--grandmother!--so old and worn and - gray she could have passed for eighty; I took her to be that old. - They had no waterproofs nor rubbers, of course; over their shoulders - they wore gunnysacks--simply conductors for rivers of water; some of - the volume reached the ground; the rest soaked in on the way. - - "At last a vigorous fellow of thirty-five arrived, dry and - comfortable, smoking his pipe under his big umbrella in an open - donkey-cart-husband, son, and grandson of those women! He stood up - in the cart, sheltering himself, and began to superintend, issuing - his orders in a masterly tone of command, and showing temper when - they were not obeyed swiftly enough. - - "Without complaint or murmur the drowned women patiently carried out - the orders, lifting the immense baskets of soggy, wrung-out clothing - into the cart and stowing them to the man's satisfaction. There - were six of the great baskets, and a man of mere ordinary strength - could not have lifted any one of them. The cart being full now, the - Frenchman descended, still sheltered by his umbrella, entered the - tavern, and the women went drooping homeward, trudging in the wake - of the cart, and soon were blended with the deluge and lost to - sight. - - "When I went down into the public room, the Frenchman had his bottle - of wine and plate of food on a bare table black with grease, and was - "chomping" like a horse. He had the little religious paper which is - in everybody's hands on the Rhone borders, and was enlightening - himself with the histories of French saints who used to flee to the - desert in the Middle Ages to escape the contamination of woman. For - two hundred years France has been sending missionaries to other - savage lands. To spare to the needy from poverty like hers is fine - and true generosity." - -But to get back to India--where, as my favorite poem says-- - - "Every prospect pleases, - And only man is vile." - -It is because Bavaria and Austria and France have not introduced their -civilization to him yet. But Bavaria and Austria and France are on their -way. They are coming. They will rescue him; they will refine the -vileness out of him. - -Some time during the forenoon, approaching the mountains, we changed from -the regular train to one composed of little canvas-sheltered cars that -skimmed along within a foot of the ground and seemed to be going fifty -miles an hour when they were really making about twenty. Each car had -seating capacity for half-a-dozen persons; and when the curtains were up -one was substantially out of doors, and could see everywhere, and get all -the breeze, and be luxuriously comfortable. It was not a pleasure -excursion in name only, but in fact. - -After a while the stopped at a little wooden coop of a station just -within the curtain of the sombre jungle, a place with a deep and dense -forest of great trees and scrub and vines all about it. The royal Bengal -tiger is in great force there, and is very bold and unconventional. From -this lonely little station a message once went to the railway manager in -Calcutta: "Tiger eating station-master on front porch; telegraph -instructions." - -It was there that I had my first tiger hunt. I killed thirteen. We were -presently away again, and the train began to climb the mountains. In one -place seven wild elephants crossed the track, but two of them got away -before I could overtake them. The railway journey up the mountain is -forty miles, and it takes eight hours to make it. It is so wild and -interesting and exciting and enchanting that it ought to take a week. As -for the vegetation, it is a museum. The jungle seemed to contain samples -of every rare and curious tree and bush that we had ever seen or heard -of. It is from that museum, I think, that the globe must have been -supplied with the trees and vines and shrubs that it holds precious. - -The road is infinitely and charmingly crooked. It goes winding in and -out under lofty cliffs that are smothered in vines and foliage, and -around the edges of bottomless chasms; and all the way one glides by -files of picturesque natives, some carrying burdens up, others going down -from their work in the tea-gardens; and once there was a gaudy wedding -procession, all bright tinsel and color, and a bride, comely and girlish, -who peeped out from the curtains of her palanquin, exposing her face with -that pure delight which the young and happy take in sin for sin's own -sake. - -By and by we were well up in the region of the clouds, and from that -breezy height we looked down and afar over a wonderful picture--the -Plains of India, stretching to the horizon, soft and fair, level as a -floor, shimmering with heat, mottled with cloud-shadows, and cloven with -shining rivers. Immediately below us, and receding down, down, down, -toward the valley, was a shaven confusion of hilltops, with ribbony roads -and paths squirming and snaking cream-yellow all over them and about -them, every curve and twist sharply distinct. - -At an elevation of 6,000 feet we entered a thick cloud, and it shut out -the world and kept it shut out. We climbed 1,000 feet higher, then began -to descend, and presently got down to Darjeeling, which is 6,000 feet -above the level of the Plains. - -We had passed many a mountain village on the way up, and seen some new -kinds of natives, among them many samples of the fighting Ghurkas. They -are not large men, but they are strong and resolute. There are no better -soldiers among Britain's native troops. And we had passed shoals of -their women climbing the forty miles of steep road from the valley to -their mountain homes, with tall baskets on their backs hitched to their -foreheads by a band, and containing a freightage weighing--I will not say -how many hundreds of pounds, for the sum is unbelievable. These were -young women, and they strode smartly along under these astonishing -burdens with the air of people out for a holiday. I was told that a -woman will carry a piano on her back all the way up the mountain; and -that more than once a woman had done it. If these were old women I -should regard the Ghurkas as no more civilized than the Europeans. -At the railway station at Darjeeling you find plenty of cab-substitutes ---open coffins, in which you sit, and are then borne on men's shoulders up -the steep roads into the town. - -Up there we found a fairly comfortable hotel, the property of an -indiscriminate and incoherent landlord, who looks after nothing, but -leaves everything to his army of Indian servants. No, he does look after -the bill--to be just to him--and the tourist cannot do better than follow -his example. I was told by a resident that the summit of Kinchinjunga is -often hidden in the clouds, and that sometimes a tourist has waited -twenty-two days and then been obliged to go away without a sight of it. -And yet went not disappointed; for when he got his hotel bill he -recognized that he was now seeing the highest thing in the Himalayas. -But this is probably a lie. - -After lecturing I went to the Club that night, and that was a comfortable -place. It is loftily situated, and looks out over a vast spread of -scenery; from it you can see where the boundaries of three countries come -together, some thirty miles away; Thibet is one of them, Nepaul another, -and I think Herzegovina was the other. Apparently, in every town and -city in India the gentlemen of the British civil and military service -have a club; sometimes it is a palatial one, always it is pleasant and -homelike. The hotels are not always as good as they might be, and the -stranger who has access to the Club is grateful for his privilege and -knows how to value it. - -Next day was Sunday. Friends came in the gray dawn with horses, and my -party rode away to a distant point where Kinchinjunga and Mount Everest -show up best, but I stayed at home for a private view; for it was very -old, and I was not acquainted with the horses, any way. I got a pipe and -a few blankets and sat for two hours at the window, and saw the sun drive -away the veiling gray and touch up the snow-peaks one after another with -pale pink splashes and delicate washes of gold, and finally flood the -whole mighty convulsion of snow-mountains with a deluge of rich -splendors. - -Kinchinjunga's peak was but fitfully visible, but in the between times it -was vividly clear against the sky--away up there in the blue dome more -than 28,000 feet above sea level--the loftiest land I had ever seen, by -12,000 feet or more. It was 45 miles away. Mount Everest is a thousand -feet higher, but it was not a part of that sea of mountains piled up -there before me, so I did not see it; but I did not care, because I think -that mountains that are as high as that are disagreeable. - -I changed from the back to the front of the house and spent the rest of -the morning there, watching the swarthy strange tribes flock by from -their far homes in the Himalayas. All ages and both sexes were -represented, and the breeds were quite new to me, though the costumes of -the Thibetans made them look a good deal like Chinamen. The prayer-wheel -was a frequent feature. It brought me near to these people, and made -them seem kinfolk of mine. Through our preacher we do much of our -praying by proxy. We do not whirl him around a stick, as they do, but -that is merely a detail. The swarm swung briskly by, hour after hour, a -strange and striking pageant. It was wasted there, and it seemed a pity. -It should have been sent streaming through the cities of Europe or -America, to refresh eyes weary of the pale monotonies of the -circus-pageant. These people were bound for the bazar, with things to -sell. We went down there, later, and saw that novel congress of the wild -peoples, and plowed here and there through it, and concluded that it -would be worth coming from Calcutta to see, even if there were no -Kinchinjunga and Everest. - - - - -CHAPTER LVI. - -There are two times in a man's life when he should not speculate: when he -can't afford it, and when he can. - --Pudd'nhead Wilson's New Calendar. - -On Monday and Tuesday at sunrise we again had fair-to-middling views of -the stupendous mountains; then, being well cooled off and refreshed, we -were ready to chance the weather of the lower world once more. - -We traveled up hill by the regular train five miles to the summit, then -changed to a little canvas-canopied hand-car for the 35-mile descent. It -was the size of a sleigh, it had six seats and was so low that it seemed -to rest on the ground. It had no engine or other propelling power, and -needed none to help it fly down those steep inclines. It only needed a -strong brake, to modify its flight, and it had that. There was a story -of a disastrous trip made down the mountain once in this little car by -the Lieutenant-Governor of Bengal, when the car jumped the track and -threw its passengers over a precipice. It was not true, but the story -had value for me, for it made me nervous, and nervousness wakes a person -up and makes him alive and alert, and heightens the thrill of a new and -doubtful experience. The car could really jump the track, of course; a -pebble on the track, placed there by either accident or malice, at a -sharp curve where one might strike it before the eye could discover it, -could derail the car and fling it down into India; and the fact that the -lieutenant-governor had escaped was no proof that I would have the same -luck. And standing there, looking down upon the Indian Empire from the -airy altitude of 7,000 feet, it seemed unpleasantly far, dangerously far, -to be flung from a handcar. - -But after all, there was but small danger-for me. What there was, was -for Mr. Pugh, inspector of a division of the Indian police, in whose -company and protection we had come from Calcutta. He had seen long -service as an artillery officer, was less nervous than I was, and so he -was to go ahead of us in a pilot hand-car, with a Ghurka and another -native; and the plan was that when we should see his car jump over a -precipice we must put on our break [sp.] and send for another pilot. -It was a good arrangement. Also Mr. Barnard, chief engineer of the -mountain-division of the road, was to take personal charge of our car, -and he had been down the mountain in it many a time. - -Everything looked safe. Indeed, there was but one questionable detail -left: the regular train was to follow us as soon as we should start, and -it might run over us. Privately, I thought it would. - -The road fell sharply down in front of us and went corkscrewing in and -out around the crags and precipices, down, down, forever down, suggesting -nothing so exactly or so uncomfortably as a croaked toboggan slide with -no end to it. Mr. Pugh waved his flag and started, like an arrow from a -bow, and before I could get out of the car we were gone too. I had -previously had but one sensation like the shock of that departure, and -that was the gaspy shock that took my breath away the first time that I -was discharged from the summit of a toboggan slide. But in both -instances the sensation was pleasurable--intensely so; it was a sudden -and immense exaltation, a mixed ecstasy of deadly fright and unimaginable -joy. I believe that this combination makes the perfection of human -delight. - -The pilot car's flight down the mountain suggested the swoop of a swallow -that is skimming the ground, so swiftly and smoothly and gracefully it -swept down the long straight reaches and soared in and out of the bends -and around the corners. We raced after it, and seemed to flash by the -capes and crags with the speed of light; and now and then we almost -overtook it--and had hopes; but it was only playing with us; when we got -near, it released its brake, make a spring around a corner, and the next -time it spun into view, a few seconds later, it looked as small as a -wheelbarrow, it was so far away. We played with the train in the same -way. We often got out to gather flowers or sit on a precipice and look -at the scenery, then presently we would hear a dull and growing roar, and -the long coils of the train would come into sight behind and above us; -but we did not need to start till the locomotive was close down upon us ---then we soon left it far behind. It had to stop at every station, -therefore it was not an embarrassment to us. Our brake was a good piece -of machinery; it could bring the car to a standstill on a slope as steep -as a house-roof. - -The scenery was grand and varied and beautiful, and there was no hurry; -we could always stop and examine it. There was abundance of time. We -did not need to hamper the train; if it wanted the road, we could switch -off and let it go by, then overtake it and pass it later. We stopped at -one place to see the Gladstone Cliff, a great crag which the ages and the -weather have sculptured into a recognizable portrait of the venerable -statesman. Mr. Gladstone is a stockholder in the road, and Nature began -this portrait ten thousand years ago, with the idea of having the -compliment ready in time for the event. - -We saw a banyan tree which sent down supporting stems from branches which -were sixty feet above the ground. That is, I suppose it was a banyan; -its bark resembled that of the great banyan in the botanical gardens at -Calcutta, that spider-legged thing with its wilderness of vegetable -columns. And there were frequent glimpses of a totally leafless tree -upon whose innumerable twigs and branches a cloud of crimson butterflies -had lighted--apparently. In fact these brilliant red butterflies were -flowers, but the illusion was good. Afterward in South Africa, I saw -another splendid effect made by red flowers. This flower was probably -called the torch-plant--should have been so named, anyway. It had a -slender stem several feet high, and from its top stood up a single tongue -of flame, an intensely red flower of the size and shape of a small -corn-cob. The stems stood three or four feet apart all over a great -hill-slope that was a mile long, and make one think of what the Place -de la Concorde would be if its myriad lights were red instead of white -and yellow. - -A few miles down the mountain we stopped half an hour to see a Thibetan -dramatic performance. It was in the open air on the hillside. The -audience was composed of Thibetans, Ghurkas, and other unusual people. -The costumes of the actors were in the last degree outlandish, and the -performance was in keeping with the clothes. To an accompaniment of -barbarous noises the actors stepped out one after another and began to -spin around with immense swiftness and vigor and violence, chanting the -while, and soon the whole troupe would be spinning and chanting and -raising the dust. They were performing an ancient and celebrated -historical play, and a Chinaman explained it to me in pidjin English as -it went along. The play was obscure enough without the explanation; with -the explanation added, it was (opake). As a drama this ancient -historical work of art was defective, I thought, but as a wild and -barbarous spectacle the representation was beyond criticism. -Far down the mountain we got out to look at a piece of remarkable -loop-engineering--a spiral where the road curves upon itself with such -abruptness that when the regular train came down and entered the loop, we -stood over it and saw the locomotive disappear under our bridge, then in -a few moments appear again, chasing its own tail; and we saw it gain on -it, overtake it, draw ahead past the rear cars, and run a race with that -end of the train. It was like a snake swallowing itself. - -Half-way down the mountain we stopped about an hour at Mr. Barnard's -house for refreshments, and while we were sitting on the veranda looking -at the distant panorama of hills through a gap in the forest, we came -very near seeing a leopard kill a calf.--[It killed it the day before.] ---It is a wild place and lovely. From the woods all about came the songs -of birds,--among them the contributions of a couple of birds which I was -not then acquainted with: the brain-fever bird and the coppersmith. The -song of the brain-fever demon starts on a low but steadily rising key, -and is a spiral twist which augments in intensity and severity with each -added spiral, growing sharper and sharper, and more and more painful, -more and more agonizing, more and more maddening, intolerable, -unendurable, as it bores deeper and deeper and deeper into the listener's -brain, until at last the brain fever comes as a relief and the man dies. -I am bringing some of these birds home to America. They will be a great -curiosity there, and it is believed that in our climate they will -multiply like rabbits. - -The coppersmith bird's note at a certain distance away has the ring of a -sledge on granite; at a certain other distance the hammering has a more -metallic ring, and you might think that the bird was mending a copper -kettle; at another distance it has a more woodeny thump, but it is a -thump that is full of energy, and sounds just like starting a bung. So -he is a hard bird to name with a single name; he is a stone-breaker, -coppersmith, and bung-starter, and even then he is not completely named, -for when he is close by you find that there is a soft, deep, melodious -quality in his thump, and for that no satisfying name occurs to you. You -will not mind his other notes, but when he camps near enough for you to -hear that one, you presently find that his measured and monotonous -repetition of it is beginning to disturb you; next it will weary you, -soon it will distress you, and before long each thump will hurt your -head; if this goes on, you will lose your mind with the pain and misery -of it, and go crazy. I am bringing some of these birds home to America. -There is nothing like them there. They will be a great surprise, and it -is said that in a climate like ours they will surpass expectation for -fecundity. - -I am bringing some nightingales, too, and some cue-owls. I got them in -Italy. The song of the nightingale is the deadliest known to -ornithology. That demoniacal shriek can kill at thirty yards. The note -of the cue-owl is infinitely soft and sweet--soft and sweet as the -whisper of a flute. But penetrating--oh, beyond belief; it can bore -through boiler-iron. It is a lingering note, and comes in triplets, on -the one unchanging key: hoo-o-o, hoo-o-o, hoo-o-o; then a silence of -fifteen seconds, then the triplet again; and so on, all night. At first -it is divine; then less so; then trying; then distressing; then -excruciating; then agonizing, and at the end of two hours the listener is -a maniac. - -And so, presently we took to the hand-car and went flying down the -mountain again; flying and stopping, flying and stopping, till at last we -were in the plain once more and stowed for Calcutta in the regular train. -That was the most enjoyable day I have spent in the earth. For rousing, -tingling, rapturous pleasure there is no holiday trip that approaches the -bird-flight down the Himalayas in a hand-car. It has no fault, no -blemish, no lack, except that there are only thirty-five miles of it -instead of five hundred. - - - - -CHAPTER LVII. - -She was not quite what you would call refined. She was not quite what -you would call unrefined. She was the kind of person that keeps a -parrot. - --Pudd'nhead Wilson's New Calendar. - -So far as I am able to judge, nothing has been left undone, either by man -or Nature, to make India the most extraordinary country that the sun -visits on his round. Nothing seems to have been forgotten, nothing over -looked. Always, when you think you have come to the end of her -tremendous specialties and have finished banging tags upon her as the -Land of the Thug, the Land of the Plague, the Land of Famine, the Land of -Giant Illusions, the Land of Stupendous Mountains, and so forth, another -specialty crops up and another tag is required. I have been overlooking -the fact that India is by an unapproachable supremacy--the Land of -Murderous Wild Creatures. Perhaps it will be simplest to throw away the -tags and generalize her with one all-comprehensive name, as the Land of -Wonders. - -For many years the British Indian Government has been trying to destroy -the murderous wild creatures, and has spent a great deal of money in the -effort. The annual official returns show that the undertaking is a -difficult one. - -These returns exhibit a curious annual uniformity in results; the sort of -uniformity which you find in the annual output of suicides in the world's -capitals, and the proportions of deaths by this, that, and the other -disease. You can always come close to foretelling how many suicides will -occur in Paris, London, and New York, next year, and also how many deaths -will result from cancer, consumption, dog-bite, falling out of the -window, getting run over by cabs, etc., if you know the statistics of -those matters for the present year. In the same way, with one year's -Indian statistics before you, you can guess closely at how many people -were killed in that Empire by tigers during the previous year, and the -year before that, and the year before that, and at how many were killed -in each of those years by bears, how many by wolves, and how many by -snakes; and you can also guess closely at how many people are going to be -killed each year for the coming five years by each of those agencies. -You can also guess closely at how many of each agency the government is -going to kill each year for the next five years. - -I have before me statistics covering a period of six consecutive years. -By these, I know that in India the tiger kills something over 800 persons -every year, and that the government responds by killing about double as -many tigers every year. In four of the six years referred to, the tiger -got 800 odd; in one of the remaining two years he got only 700, but in -the other remaining year he made his average good by scoring 917. He is -always sure of his average. Anyone who bets that the tiger will kill -2,400 people in India in any three consecutive years has invested his -money in a certainty; anyone who bets that he will kill 2,600 in any -three consecutive years, is absolutely sure to lose. - -As strikingly uniform as are the statistics of suicide, they are not any -more so than are those of the tiger's annual output of slaughtered human -beings in India. The government's work is quite uniform, too; it about -doubles the tiger's average. In six years the tiger killed 5,000 -persons, minus 50; in the same six years 10,000 tigers were killed, minus -400. - -The wolf kills nearly as many people as the tiger--700 a year to the -tiger's 800 odd--but while he is doing it, more than 5,000 of his tribe -fall. - -The leopard kills an average of 230 people per year, but loses 3,300 of -his own mess while he is doing it. - -The bear kills 100 people per year at a cost of 1,250 of his own tribe. - -The tiger, as the figures show, makes a very handsome fight against man. -But it is nothing to the elephant's fight. The king of beasts, the lord -of the jungle, loses four of his mess per year, but he kills forty--five -persons to make up for it. - -But when it comes to killing cattle, the lord of the jungle is not -interested. He kills but 100 in six years--horses of hunters, no doubt ---but in the same six the tiger kills more than 84,000, the leopard -100,000, the bear 4,000, the wolf 70,000, the hyena more than 13,000, -other wild beasts 27,000, and the snakes 19,000, a grand total of more -than 300,000; an average of 50,000 head per year. - -In response, the government kills, in the six years, a total of 3,201,232 -wild beasts and snakes. Ten for one. - -It will be perceived that the snakes are not much interested in cattle; -they kill only 3,000 odd per year. The snakes are much more interested -in man. India swarms with deadly snakes. At the head of the list is the -cobra, the deadliest known to the world, a snake whose bite kills where -the rattlesnake's bite merely entertains. - -In India, the annual man-killings by snakes are as uniform, as regular, -and as forecastable as are the tiger-average and the suicide-average. -Anyone who bets that in India, in any three consecutive years the snakes -will kill 49,500 persons, will win his bet; and anyone who bets that in -India in any three consecutive years, the snakes will kill 53,500 -persons, will lose his bet. In India the snakes kill 17,000 people a -year; they hardly ever fall short of it; they as seldom exceed it. An -insurance actuary could take the Indian census tables and the -government's snake tables and tell you within sixpence how much it would -be worth to insure a man against death by snake-bite there. If I had a -dollar for every person killed per year in India, I would rather have it -than any other property, as it is the only property in the world not -subject to shrinkage. - -I should like to have a royalty on the government-end of the snake -business, too, and am in London now trying to get it; but when I get it -it is not going to be as regular an income as the other will be if I get -that; I have applied for it. The snakes transact their end of the -business in a more orderly and systematic way than the government -transacts its end of it, because the snakes have had a long experience -and know all about the traffic. You can make sure that the government -will never kill fewer than 110,000 snakes in a year, and that it will -newer quite reach 300,000 too much room for oscillation; good speculative -stock, to bear or bull, and buy and sell long and short, and all that -kind of thing, but not eligible for investment like the other. The man -that speculates in the government's snake crop wants to go carefully. I -would not advise a man to buy a single crop at all--I mean a crop of -futures for the possible wobble is something quite extraordinary. If he -can buy six future crops in a bunch, seller to deliver 1,500,000 -altogether, that is another matter. I do not know what snakes are worth -now, but I know what they would be worth then, for the statistics show -that the seller could not come within 427,000 of carrying out his -contract. However, I think that a person who speculates in snakes is a -fool, anyway. He always regrets it afterwards. - -To finish the statistics. In six years the wild beasts kill 20,000 -persons, and the snakes kill 103,000. In the same six the government -kills 1,073,546 snakes. Plenty left. - -There are narrow escapes in India. In the very jungle where I killed -sixteen tigers and all those elephants, a cobra bit me but it got well; -everyone was surprised. This could not happen twice in ten years, -perhaps. Usually death would result in fifteen minutes. - -We struck out westward or northwestward from Calcutta on an itinerary of -a zig-zag sort, which would in the course of time carry us across India -to its northwestern corner and the border of Afghanistan. The first part -of the trip carried us through a great region which was an endless -garden--miles and miles of the beautiful flower from whose juices comes -the opium, and at Muzaffurpore we were in the midst of the indigo -culture; thence by a branch road to the Ganges at a point near Dinapore, -and by a train which would have missed the connection by a week but for -the thoughtfulness of some British officers who were along, and who knew -the ways of trains that are run by natives without white supervision. -This train stopped at every village; for no purpose connected with -business, apparently. We put out nothing, we took nothing aboard. The -train bands stepped ashore and gossiped with friends a quarter of an -hour, then pulled out and repeated this at the succeeding villages. We -had thirty-five miles to go and six hours to do it in, but it was plain -that we were not going to make it. It was then that the English officers -said it was now necessary to turn this gravel train into an express. So -they gave the engine-driver a rupee and told him to fly. It was a simple -remedy. After that we made ninety miles an hour. We crossed the Ganges -just at dawn, made our connection, and went to Benares, where we stayed -twenty-four hours and inspected that strange and fascinating piety-hive -again; then left for Lucknow, a city which is perhaps the most -conspicuous of the many monuments of British fortitude and valor that are -scattered about the earth. - -The heat was pitiless, the flat plains were destitute of grass, and baked -dry by the sun they were the color of pale dust, which was flying in -clouds. But it was much hotter than this when the relieving forces -marched to Lucknow in the time of the Mutiny. Those were the days of 138 -deg. in the shade. - - - - -CHAPTER, LVIII. - -Make it a point to do something every day that you don't want to do. -This is the golden rule for acquiring the habit of doing your duty -without pain. - --Pudd'nhead Wilson's New Calendar. - -It seems to be settled, now, that among the many causes from which the -Great Mutiny sprang, the main one was the annexation of the kingdom of -Oudh by the East India Company--characterized by Sir Henry Lawrence as -"the most unrighteous act that was ever committed." In the spring of -1857, a mutinous spirit was observable in many of the native garrisons, -and it grew day by day and spread wider and wider. The younger military -men saw something very serious in it, and would have liked to take hold -of it vigorously and stamp it out promptly; but they were not in -authority. Old-men were in the high places of the army--men who should -have been retired long before, because of their great age--and they -regarded the matter as a thing of no consequence. They loved their -native soldiers, and would not believe that anything could move them to -revolt. Everywhere these obstinate veterans listened serenely to the -rumbling of the volcanoes under them, and said it was nothing. - -And so the propagators of mutiny had everything their own way. They -moved from camp to camp undisturbed, and painted to the native soldier -the wrongs his people were suffering at the hands of the English, and -made his heart burn for revenge. They were able to point to two facts of -formidable value as backers of their persuasions: In Clive's day, native -armies were incoherent mobs, and without effective arms; therefore, they -were weak against Clive's organized handful of well-armed men, but the -thing was the other way, now. The British forces were native; they had -been trained by the British, organized by the British, armed by the -British, all the power was in their hands--they were a club made by -British hands to beat out British brains with. There was nothing to -oppose their mass, nothing but a few weak battalions of British soldiers -scattered about India, a force not worth speaking of. This argument, -taken alone, might not have succeeded, for the bravest and best Indian -troops had a wholesome dread of the white soldier, whether he was weak or -strong; but the agitators backed it with their second and best point -prophecy--a prophecy a hundred years old. The Indian is open to prophecy -at all times; argument may fail to convince him, but not prophecy. There -was a prophecy that a hundred years from the year of that battle of -Clive's which founded the British Indian Empire, the British power would -be overthrown and swept away by the natives. - -The Mutiny broke out at Meerut on the 10th of May, 1857, and fired a -train of tremendous historical explosions. Nana Sahib's massacre of the -surrendered garrison of Cawnpore occurred in June, and the long siege of -Lucknow began. The military history of England is old and great, but I -think it must be granted that the crushing of the Mutiny is the greatest -chapter in it. The British were caught asleep and unprepared. They were -a few thousands, swallowed up in an ocean of hostile populations. It -would take months to inform England and get help, but they did not falter -or stop to count the odds, but with English resolution and English -devotion they took up their task, and went stubbornly on with it, through -good fortune and bad, and fought the most unpromising fight that one may -read of in fiction or out of it, and won it thoroughly. - -The Mutiny broke out so suddenly, and spread with such rapidity that -there was but little time for occupants of weak outlying stations to -escape to places of safety. Attempts were made, of course, but they were -attended by hardships as bitter as death in the few cases which were -successful; for the heat ranged between 120 and 138 in the shade; the way -led through hostile peoples, and food and water were hardly to be had. -For ladies and children accustomed to ease and comfort and plenty, such a -journey must have been a cruel experience. Sir G. O. Trevelyan quotes -an example: - - "This is what befell Mrs. M----, the wife of the surgeon at a - certain station on the southern confines of the insurrection. 'I - heard,' she says, 'a number of shots fired, and, looking out, I saw - my husband driving furiously from the mess-house, waving his whip. - I ran to him, and, seeing a bearer with my child in his arms, I - caught her up, and got into the buggy. At the mess-house we found - all the officers assembled, together with sixty sepoys, who had - remained faithful. We went off in one large party, amidst a general - conflagration of our late homes. We reached the caravanserai at - Chattapore the next morning, and thence started for Callinger. At - this point our sepoy escort deserted us. We were fired upon by - match-lockmen, and one officer was shot dead. We heard, likewise, - that the people had risen at Callinger, so we returned and walked - back ten miles that day. M---- and I carried the child alternately. - Presently Mrs. Smalley died of sunstroke. We had no food amongst - us. An officer kindly lent us a horse. We were very faint. The - Major died, and was buried; also the Sergeant-major and some women. - The bandsmen left us on the nineteenth of June. We were fired at - again by match-lockmen, and changed direction for Allahabad. Our - party consisted of nine gentlemen, two children, the sergeant and - his wife. On the morning of the twentieth, Captain Scott took - Lottie on to his horse. I was riding behind my husband, and she was - so crushed between us. She was two years old on the first of the - month. We were both weak through want of food and the effect of the - sun. Lottie and I had no head covering. M---- had a sepoy's cap I - found on the ground. Soon after sunrise we were followed by - villagers armed with clubs and spears. One of them struck Captain - Scott's horse on the leg. He galloped off with Lottie, and my poor - husband never saw his child again. We rode on several miles, - keeping away from villages, and then crossed the river. Our thirst - was extreme. M---- had dreadful cramps, so that I had to hold him - on the horse. I was very uneasy about him. The day before I saw - the drummer's wife eating chupatties, and asked her to give a piece - to the child, which she did. I now saw water in a ravine. The - descent was steep, and our only drinkingvessel was M----'s cap. Our - horse got water, and I bathed my neck. I had no stockings, and my - feet were torn and blistered. Two peasants came in sight, and we - were frightened and rode off. The sergeant held our horse, and - M---- put me up and mounted. I think he must have got suddenly faint, - for I fell and he over me, on the road, when the horse started off. - Some time before he said, and Barber, too, that he could not live - many hours. I felt he was dying before we came to the ravine. He - told me his wishes about his children and myself, and took leave. - My brain seemed burnt up. No tears came. As soon as we fell, the - sergeant let go the horse, and it went off; so that escape was cut - off. We sat down on the ground waiting for death. Poor fellow! he - was very weak; his thirst was frightful, and I went to get him - water. Some villagers came, and took my rupees and watch. I took - off my wedding-ring, and twisted it in my hair, and replaced the - guard. I tore off the skirt of my dress to bring water in, but was - no use, for when I returned my beloved's eyes were fixed, and, - though I called and tried to restore him, and poured water into his - mouth, it only rattled in his throat. He never spoke to me again. - I held him in my arms till he sank gradually down. I felt frantic, - but could not cry. I was alone. I bound his head and face in my - dress, for there was no earth to buy him. The pain in my hands and - feet was dreadful. I went down to the ravine, and sat in the water - on a stone, hoping to get off at night and look for Lottie. When I - came back from the water, I saw that they had not taken her little - watch, chain, and seals, so I tied them under my petticoat. In an - hour, about thirty villagers came, they dragged me out of the - ravine, and took off my jacket, and found the little chain. They - then dragged me to a village, mocking me all the way, and disputing - as to whom I was to belong to. The whole population came to look at - me. I asked for a bedstead, and lay down outside the door of a hut. - They had a dozen of cows, and yet refused me milk. When night came, - and the village was quiet, some old woman brought me a leafful of - rice. I was too parched to eat, and they gave me water. The - morning after a neighboring Rajah sent a palanquin and a horseman to - fetch me, who told me that a little child and three Sahibs had come - to his master's house. And so the poor mother found her lost one, - 'greatly blistered,' poor little creature. It is not for Europeans - in India to pray that their flight be not in the winter." - -In the first days of June the aged general, Sir Hugh Wheeler commanding -the forces at Cawnpore, was deserted by his native troops; then he moved -out of the fort and into an exposed patch of open flat ground and built a -four-foot mud wall around it. He had with him a few hundred white -soldiers and officers, and apparently more women and children than -soldiers. He was short of provisions, short of arms, short of -ammunition, short of military wisdom, short of everything but courage and -devotion to duty. The defense of that open lot through twenty-one days -and nights of hunger, thirst, Indian heat, and a never-ceasing storm of -bullets, bombs, and cannon-balls--a defense conducted, not by the aged -and infirm general, but by a young officer named Moore--is one of the -most heroic episodes in history. When at last the Nana found it -impossible to conquer these starving men and women with powder and ball, -he resorted to treachery, and that succeeded. He agreed to supply them -with food and send them to Allahabad in boats. Their mud wall and their -barracks were in ruins, their provisions were at the point of exhaustion, -they had done all that the brave could do, they had conquered an -honorable compromise,--their forces had been fearfully reduced by -casualties and by disease, they were not able to continue the contest -longer. They came forth helpless but suspecting no treachery, the Nana's -host closed around them, and at a signal from a trumpet the massacre -began. About two hundred women and children were spared--for the -present--but all the men except three or four were killed. Among the -incidents of the massacre quoted by Sir G. O. Trevelyan, is this: - - "When, after the lapse of some twenty minutes, the dead began to - outnumber the living;--when the fire slackened, as the marks grew - few and far between; then the troopers who had been drawn up to the - right of the temple plunged into the river, sabre between teeth, and - pistol in hand. Thereupon two half-caste Christian women, the wives - of musicians in the band of the Fifty-sixth, witnessed a scene which - should not be related at second-hand. 'In the boat where I was to - have gone,' says Mrs. Bradshaw, confirmed throughout by Mrs. Betts, - 'was the school-mistress and twenty-two misses. General Wheeler - came last in a palkee. They carried him into the water near the - boat. I stood close by. He said, 'Carry me a little further - towards the boat.' But a trooper said, 'No, get out here.' As the - General got out of the palkee, head-foremost, the trooper gave him a - cut with his sword into the neck, and he fell into the water. My - son was killed near him. I saw it; alas! alas! Some were stabbed - with bayonets; others cut down. Little infants were torn in pieces. - We saw it; we did; and tell you only what we saw. Other children - were stabbed and thrown into the river. The schoolgirls were burnt - to death. I saw their clothes and hair catch fire. In the water, a - few paces off, by the next boat, we saw the youngest daughter of - Colonel Williams. A sepoy was going to kill her with his bayonet. - She said, 'My father was always kind to sepoys.' He turned away, - and just then a villager struck her on the head with a club, and she - fell into the water. These people likewise saw good Mr. Moncrieff, - the clergyman, take a book from his pocket that he never had leisure - to open, and heard him commence a prayer for mercy which he was not - permitted to conclude. Another deponent observed an European making - for a drain like a scared water-rat, when some boatmen, armed with - cudgels, cut off his retreat, and beat him down dead into the mud." - -The women and children who had been reserved from the massacre were -imprisoned during a fortnight in a small building, one story high--a -cramped place, a slightly modified Black Hole of Calcutta. They were -waiting in suspense; there was none who could foretaste their fate. -Meantime the news of the massacre had traveled far and an army of -rescuers with Havelock at its head was on its way--at least an army which -hoped to be rescuers. It was crossing the country by forced marches, and -strewing its way with its own dead men struck down by cholera, and by a -heat which reached 135 deg. It was in a vengeful fury, and it stopped -for nothing neither heat, nor fatigue, nor disease, nor human opposition. -It tore its impetuous way through hostile forces, winning victory after -victory, but still striding on and on, not halting to count results. And -at last, after this extraordinary march, it arrived before the walls of -Cawnpore, met the Nana's massed strength, delivered a crushing defeat, -and entered. - -But too late--only a few hours too late. For at the last moment the Nana -had decided upon the massacre of the captive women and children, and had -commissioned three Mohammedans and two Hindoos to do the work. Sir G. -O. Trevelyan says: - - "Thereupon the five men entered. It was the short gloaming of - Hindostan--the hour when ladies take their evening drive. She who - had accosted the officer was standing in the doorway. With her were - the native doctor and two Hindoo menials. That much of the business - might be seen from the veranda, but all else was concealed amidst - the interior gloom. Shrieks and scuffing acquainted those without - that the journeymen were earning their hire. Survur Khan soon - emerged with his sword broken off at the hilt. He procured another - from the Nana's house, and a few minutes after appeared again on the - same errand. The third blade was of better temper; or perhaps the - thick of the work was already over. By the time darkness had closed - in, the men came forth and locked up the house for the night. Then - the screams ceased, but the groans lasted till morning. - - "The sun rose as usual. When he had been up nearly three hours the - five repaired to the scene of their labors over night. They were - attended by a few sweepers, who proceeded to transfer the contents - of the house to a dry well situated behind some trees which grew - hard by. 'The bodies,' says one who was present throughout, 'were - dragged out, most of them by the hair of the head. Those who had - clothing worth taking were stripped. Some of the women were alive. - I cannot say how many; but three could speak. They prayed for the - sake of God that an end might be put to their sufferings. I - remarked one very stout woman, a half-caste, who was severely - wounded in both arms, who entreated to be killed. She and two or - three others were placed against the bank of the cut by which - bullocks go down in drawing water. The dead were first thrown in. - Yes: there was a great crowd looking on; they were standing along - the walls of the compound. They were principally city people and - villagers. Yes: there were also sepoys. Three boys were alive. - They were fair children. The eldest, I think, must have been six or - seven, and the youngest five years. They were running around the - well (where else could they go to?), and there was none to save - them. No one said a word or tried to save them.' - - "At length the smallest of them made an infantile attempt to get - away. The little thing had been frightened past bearing by the - murder of one of the surviving ladies. He thus attracted the - observation of a native who flung him and his companions down the - well." - -The soldiers had made a march of eighteen days, almost without rest, to -save the women and the children, and now they were too late--all were -dead and the assassin had flown. What happened then, Trevelyan hesitated -to put into words. "Of what took place, the less said is the better." - -Then he continues: - - "But there was a spectacle to witness which might excuse much. - Those who, straight from the contested field, wandered sobbing - through the rooms of the ladies' house, saw what it were well could - the outraged earth have straightway hidden. The inner apartment was - ankle-deep in blood. The plaster was scored with sword-cuts; not - high up as where men have fought, but low down, and about the - corners, as if a creature had crouched to avoid the blow. Strips of - dresses, vainly tied around the handles of the doors, signified the - contrivance to which feminine despair had resorted as a means of - keeping out the murderers. Broken combs were there, and the frills - of children's trousers, and torn cuffs and pinafores, and little - round hats, and one or two shoes with burst latchets, and one or two - daguerreotype cases with cracked glasses. An officer picked up a - few curls, preserved in a bit of cardboard, and marked 'Ned's hair, - with love'; but around were strewn locks, some near a yard in - length, dissevered, not as a keepsake, by quite other scissors." - -The battle of Waterloo was fought on the 18th of June, 1815. I do not -state this fact as a reminder to the reader, but as news to him. For a -forgotten fact is news when it comes again. Writers of books have the -fashion of whizzing by vast and renowned historical events with the -remark, "The details of this tremendous episode are too familiar to the -reader to need repeating here." They know that that is not true. It is -a low kind of flattery. They know that the reader has forgotten every -detail of it, and that nothing of the tremendous event is left in his -mind but a vague and formless luminous smudge. Aside from the desire to -flatter the reader, they have another reason for making the remark-two -reasons, indeed. They do not remember the details themselves, and do not -want the trouble of hunting them up and copying them out; also, they are -afraid that if they search them out and print them they will be scoffed -at by the book-reviewers for retelling those worn old things which are -familiar to everybody. They should not mind the reviewer's jeer; he -doesn't remember any of the worn old things until the book which he is -reviewing has retold them to him. - -I have made the quoted remark myself, at one time and another, but I was -not doing it to flatter the reader; I was merely doing it to save work. -If I had known the details without brushing up, I would have put them in; -but I didn't, and I did not want the labor of posting myself; so I said, -"The details of this tremendous episode are too familiar to the reader to -need repeating here." I do not like that kind of a lie; still, it does -save work. - -I am not trying to get out of repeating the details of the Siege of -Lucknow in fear of the reviewer; I am not leaving them out in fear that -they would not interest the reader; I am leaving them out partly to save -work; mainly for lack of room. It is a pity, too; for there is not a -dull place anywhere in the great story. - -Ten days before the outbreak (May 10th) of the Mutiny, all was serene at -Lucknow, the huge capital of Oudh, the kingdom which had recently been -seized by the India Company. There was a great garrison, composed of -about 7,000 native troops and between 700 and 800 whites. These white -soldiers and their families were probably the only people of their race -there; at their elbow was that swarming population of warlike natives, a -race of born soldiers, brave, daring, and fond of fighting. On high -ground just outside the city stood the palace of that great personage, -the Resident, the representative of British power and authority. It -stood in the midst of spacious grounds, with its due complement of -outbuildings, and the grounds were enclosed by a wall--a wall not for -defense, but for privacy. The mutinous spirit was in the air, but the -whites were not afraid, and did not feel much troubled. - -Then came the outbreak at Meerut, then the capture of Delhi by the -mutineers; in June came the three-weeks leaguer of Sir Hugh Wheeler in -his open lot at Cawnpore--40 miles distant from Lucknow--then the -treacherous massacre of that gallant little garrison; and now the great -revolt was in full flower, and the comfortable condition of things at -Lucknow was instantly changed. - -There was an outbreak there, and Sir Henry Lawrence marched out of the -Residency on the 30th of June to put it down, but was defeated with heavy -loss, and had difficulty in getting back again. That night the memorable -siege of the Residency--called the siege of Lucknow--began. Sir Henry -was killed three days later, and Brigadier Inglis succeeded him in -command. - -Outside of the Residency fence was an immense host of hostile and -confident native besiegers; inside it were 480 loyal native soldiers, 730 -white ones, and 500 women and children. - -In those days the English garrisons always managed to hamper themselves -sufficiently with women and children. - -The natives established themselves in houses close at hand and began to -rain bullets and cannon-balls into the Residency; and this they kept up, -night and day, during four months and a half, the little garrison -industriously replying all the time. The women and children soon became -so used to the roar of the guns that it ceased to disturb their sleep. -The children imitated siege and defense in their play. The women--with -any pretext, or with none--would sally out into the storm-swept grounds. -The defense was kept up week after week, with stubborn fortitude, in the -midst of death, which came in many forms--by bullet, small-pox, cholera, -and by various diseases induced by unpalatable and insufficient food, by -the long hours of wearying and exhausting overwork in the daily and -nightly battle in the oppressive Indian heat, and by the broken rest -caused by the intolerable pest of mosquitoes, flies, mice, rats, and -fleas. - -Six weeks after the beginning of the siege more than one-half of the -original force of white soldiers was dead, and close upon three-fifths of -the original native force. - -But the fighting went on just the same. The enemy mined, the English -counter-mined, and, turn about, they blew up each other's posts. The -Residency grounds were honey-combed with the enemy's tunnels. Deadly -courtesies were constantly exchanged--sorties by the English in the -night; rushes by the enemy in the night--rushes whose purpose was to -breach the walls or scale them; rushes which cost heavily, and always -failed. - -The ladies got used to all the horrors of war--the shrieks of mutilated -men, the sight of blood and death. Lady Inglis makes this mention in her -diary: - - "Mrs. Bruere's nurse was carried past our door to-day, wounded in - the eye. To extract the bullet it was found necessary to take out - the eye--a fearful operation. Her mistress held her while it was - performed." - -The first relieving force failed to relieve. It was under Havelock and -Outram; and arrived when the siege had been going on for three months. -It fought its desperate way to Lucknow, then fought its way through the -city against odds of a hundred to one, and entered the Residency; but -there was not enough left of it, then, to do any good. It lost more men -in its last fight than it found in the Residency when it got in. It -became captive itself. - -The fighting and starving and dying by bullets and disease went steadily -on. Both sides fought with energy and industry. Captain Birch puts this -striking incident in evidence. He is speaking of the third month of the -siege: - - "As an instance of the heavy firing brought to bear on our position - this month may be mentioned the cutting down of the upper story of a - brick building simply by musketry firring. This building was in a - most exposed position. All the shots which just missed the top of - the rampart cut into the dead wall pretty much in a straight line, - and at length cut right through and brought the upper story tumbling - down. The upper structure on the top of the brigade-mess also fell - in. The Residency house was a wreck. Captain Anderson's post had - long ago been knocked down, and Innes' post also fell in. These two - were riddled with round shot. As many as 200 were picked up by - Colonel Masters." - -The exhausted garrison fought doggedly on all through the next month -October. Then, November 2d, news came Sir Colin Campbell's relieving -force would soon be on its way from Cawnpore. - -On the 12th the boom of his guns was heard. - -On the 13th the sounds came nearer--he was slowly, but steadily, cutting -his way through, storming one stronghold after another. - -On the 14th he captured the Martiniere College, and ran up the British -flag there. It was seen from the Residency. - -Next he took the Dilkoosha. - -On the 17th he took the former mess-house of the 32d regiment--a -fortified building, and very strong. "A most exciting, anxious day," -writes Lady Inglis in her diary. "About 4 P.M., two strange officers -walked through our yard, leading their horses"--and by that sign she knew -that communication was established between the forces, that the relief -was real, this time, and that the long siege of Lucknow was ended. - -The last eight or ten miles of Sir Colin Campbell's march was through -seas of, blood. The weapon mainly used was the bayonet, the fighting was -desperate. The way was mile-stoned with detached strong buildings of -stone, fortified, and heavily garrisoned, and these had to be taken by -assault. Neither side asked for quarter, and neither gave it. At the -Secundrabagh, where nearly two thousand of the enemy occupied a great -stone house in a garden, the work of slaughter was continued until every -man was killed. That is a sample of the character of that devastating -march. - -There were but few trees in the plain at that time, and from the -Residency the progress of the march, step by step, victory by victory, -could be noted; the ascending clouds of battle-smoke marked the way to -the eye, and the thunder of the guns marked it to the ear. - -Sir Colin Campbell had not come to Lucknow to hold it, but to save the -occupants of the Residency, and bring them away. Four or five days after -his arrival the secret evacuation by the troops took place, in the middle -of a dark night, by the principal gate, (the Bailie Guard). The two -hundred women and two hundred and fifty children had been previously -removed. Captain Birch says: - - "And now commenced a movement of the most perfect arrangement and - successful generalship--the withdrawal of the whole of the various - forces, a combined movement requiring the greatest care and skill. - First, the garrison in immediate contact with the enemy at the - furthest extremity of the Residency position was marched out. Every - other garrison in turn fell in behind it, and so passed out through - the Bailie Guard gate, till the whole of our position was evacuated. - Then Havelock's force was similarly withdrawn, post by post, - marching in rear of our garrison. After them in turn came the - forces of the Commander-in-Chief, which joined on in the rear of - Havelock's force. Regiment by regiment was withdrawn with--the - utmost order and regularity. The whole operation resembled the - movement of a telescope. Stern silence was kept, and the enemy took - no alarm." - -Lady Inglis, referring to her husband and to General Sir James Outram, -sets down the closing detail of this impressive midnight retreat, in -darkness and by stealth, of this shadowy host through the gate which it -had defended so long and so well: - - "At twelve precisely they marched out, John and Sir James Outram - remaining till all had passed, and then they took off their hats to - the Bailie Guard, the scene of as noble a defense as I think history - will ever have to relate." - - - - -CHAPTER LIX. - -Don't part with your illusions. When they are gone you may still exist -but you have ceased to live. - --Pudd'nhead Wilson's New Calendar. - -Often, the surest way to convey misinformation is to tell the strict -truth. - --Pudd'nhead Wilson's New Calendar. - -We were driven over Sir Colin Campbell's route by a British officer, and -when I arrived at the Residency I was so familiar with the road that I -could have led a retreat over it myself; but the compass in my head has -been out of order from my birth, and so, as soon as I was within the -battered Bailie Guard and turned about to review the march and imagine -the relieving forces storming their way along it, everything was upside -down and wrong end first in a moment, and I was never able to get -straightened out again. And now, when I look at the battle-plan, the -confusion remains. In me the east was born west, the battle-plans which -have the east on the right-hand side are of no use to me. - -The Residency ruins are draped with flowering vines, and are impressive -and beautiful. They and the grounds are sacred now, and will suffer no -neglect nor be profaned by any sordid or commercial use while the British -remain masters of India. Within the grounds are buried the dead who gave -up their lives there in the long siege. - -After a fashion, I was able to imagine the fiery storm that raged night -and day over the place during so many months, and after a fashion I could -imagine the men moving through it, but I could not satisfactorily place -the 200 women, and I could do nothing at all with the 250 children. I -knew by Lady Inglis' diary that the children carried on their small -affairs very much as if blood and carnage and the crash and thunder of a -siege were natural and proper features of nursery life, and I tried to -realize it; but when her little Johnny came rushing, all excitement, -through the din and smoke, shouting, "Oh, mamma, the white hen has laid -an egg!" I saw that I could not do it. Johnny's place was under the -bed. I could imagine him there, because I could imagine myself there; -and I think I should not have been interested in a hen that was laying an -egg; my interest would have been with the parties that were laying the -bombshells. I sat at dinner with one of those children in the Club's -Indian palace, and I knew that all through the siege he was perfecting -his teething and learning to talk; and while to me he was the most -impressive object in Lucknow after the Residency ruins, I was not able to -imagine what his life had been during that tempestuous infancy of his, -nor what sort of a curious surprise it must have been to him to be -marched suddenly out into a strange dumb world where there wasn't any -noise, and nothing going on. He was only forty-one when I saw him, a -strangely youthful link to connect the present with so ancient an episode -as the Great Mutiny. - -By and by we saw Cawnpore, and the open lot which was the scene of -Moore's memorable defense, and the spot on the shore of the Ganges where -the massacre of the betrayed garrison occurred, and the small Indian -temple whence the bugle-signal notified the assassins to fall on. This -latter was a lonely spot, and silent. The sluggish river drifted by, -almost currentless. It was dead low water, narrow channels with vast -sandbars between, all the way across the wide bed; and the only living -thing in sight was that grotesque and solemn bald-headed bird, the -Adjutant, standing on his six-foot stilts, solitary on a distant bar, -with his head sunk between his shoulders, thinking; thinking of his -prize, I suppose--the dead Hindoo that lay awash at his feet, and whether -to eat him alone or invite friends. He and his prey were a proper accent -to that mournful place. They were in keeping with it, they emphasized -its loneliness and its solemnity. - -And we saw the scene of the slaughter of the helpless women and children, -and also the costly memorial that is built over the well which contains -their remains. The Black Hole of Calcutta is gone, but a more reverent -age is come, and whatever remembrancer still exists of the moving and -heroic sufferings and achievements of the garrisons of Lucknow and -Cawnpore will be guarded and preserved. - -In Agra and its neighborhood, and afterwards at Delhi, we saw forts, -mosques, and tombs, which were built in the great days of the Mohammedan -emperors, and which are marvels of cost, magnitude, and richness of -materials and ornamentation, creations of surpassing grandeur, wonders -which do indeed make the like things in the rest of the world seem tame -and inconsequential by comparison. I am not purposing to describe them. -By good fortune I had not read too much about them, and therefore was -able to get a natural and rational focus upon them, with the result that -they thrilled, blessed, and exalted me. But if I had previously -overheated my imagination by drinking too much pestilential literary hot -Scotch, I should have suffered disappointment and sorrow. - -I mean to speak of only one of these many world-renowned buildings, the -Taj Mahal, the most celebrated construction in the earth. I had read a -great deal too much about it. I saw it in the daytime, I saw it in the -moonlight, I saw it near at hand, I saw it from a distance; and I knew -all the time, that of its kind it was the wonder of the world, with no -competitor now and no possible future competitor; and yet, it was not my -Taj. My Taj had been built by excitable literary people; it was solidly -lodged in my head, and I could not blast it out. - -I wish to place before the reader some of the usual descriptions of the -Taj, and ask him to take note of the impressions left in his mind. These -descriptions do really state the truth--as nearly as the limitations of -language will allow. But language is a treacherous thing, a most unsure -vehicle, and it can seldom arrange descriptive words in such a way that -they will not inflate the facts--by help of the reader's imagination, -which is always ready to take a hand, and work for nothing, and do the -bulk of it at that. - -I will begin with a few sentences from the excellent little local -guide-book of Mr. Satya Chandra Mukerji. I take them from here and there -in his description: - - "The inlaid work of the Taj and the flowers and petals that are to - be found on all sides on the surface of the marble evince a most - delicate touch." - -That is true. - - "The inlaid work, the marble, the flowers, the buds, the leaves, the - petals, and the lotus stems are almost without a rival in the whole - of the civilized world." - - "The work of inlaying with stones and gems is found in the highest - perfection in the Taj." - -Gems, inlaid flowers, buds, and leaves to be found on all sides. What do -you see before you? Is the fairy structure growing? Is it becoming a -jewel casket? - - "The whole of the Taj produces a wonderful effect that is equally - sublime and beautiful." - -Then Sir William Wilson Hunter: - - "The Taj Mahal with its beautiful domes, 'a dream of marble,' rises - on the river bank." - - "The materials are white marble and red sandstone." - - "The complexity of its design and the delicate intricacy of the - workmanship baffle description." - -Sir William continues. I will italicize some of his words: - - "The mausoleum stands on a raised marble platform at each of whose - corners rises a tall and slender minaret of graceful proportions and - of exquisite beauty. Beyond the platform stretch the two wings, one - of which is itself a mosque of great architectural merit. In the - center of the whole design the mausoleum occupies a square of 186 - feet, with the angles deeply truncated so also form an unequal - octagon. The main feature in this central pile is the great dome, - which swells upward to nearly two-thirds of a sphere and tapers at - its extremity into a pointed spire crowned by a crescent. Beneath - it an enclosure of marble trellis-work surrounds the tomb of the - princess and of her husband, the Emperor. Each corner of the - mausoleum is covered by a similar though much smaller dome erected - on a pediment pierced with graceful Saracenic arches. Light is - admitted into the interior through a double screen of pierced - marble, which tempers the glare of an Indian sky while its whiteness - prevents the mellow effect from degenerating into gloom. The - internal decorations consist of inlaid work in precious stones, such - as agate, jasper, etc., with which every squandril or salient point - in the architecture is richly fretted. Brown and violet marble is - also freely employed in wreaths, scrolls, and lintels to relieve the - monotony of white wall. In regard to color and design, the interior - of the Taj may rank first in the world for purely decorative - workmanship; while the perfect symmetry of its exterior, once seen - can never be forgotten, nor the aerial grace of its domes, rising - like marble bubbles into the clear sky. The Taj represents the most - highly elaborated stage of ornamentation reached by the - Indo-Mohammedan builders, the stage in which the architect ends and - the jeweler begins. In its magnificent gateway the diagonal - ornamentation at the corners, which satisfied the designers of the - gateways of Itimad-ud-doulah and Sikandra mausoleums is superseded - by fine marble cables, in bold twists, strong and handsome. The - triangular insertions of white marble and large flowers have in like - manner given place to fine inlaid work. Firm perpendicular lines in - black marble with well proportioned panels of the same material are - effectively used in the interior of the gateway. On its top the - Hindu brackets and monolithic architraves of Sikandra are replaced - by Moorish carped arches, usually single blocks of red sandstone, in - the Kiosks and pavilions which adorn the roof. From the pillared - pavilions a magnificent view is obtained of the Taj gardens below, - with the noble Jumna river at their farther end, and the city and - fort of Agra in the distance. From this beautiful and splendid - gateway one passes up a straight alley shaded by evergreen trees - cooled by a broad shallow piece of water running along the middle of - the path to the Taj itself. The Taj is entirely of marble and gems. - The red sandstone of the other Mohammedan buildings has entirely - disappeared, or rather the red sandstone which used to form the - thickness of the walls, is in the Taj itself overlaid completely - with white marble, and the white marble is itself inlaid with - precious stones arranged in lovely patterns of flowers. A feeling - of purity impresses itself on the eye and the mind from the absence - of the coarser material which forms so invariable a material in Agra - architecture. The lower wall and panels are covered with tulips, - oleanders, and fullblown lilies, in flat carving on the white - marble; and although the inlaid work of flowers done in gems is very - brilliant when looked at closely, there is on the whole but little - color, and the all-prevailing sentiment is one of whiteness, - silence, and calm. The whiteness is broken only by the fine color - of the inlaid gems, by lines in black marble, and by delicately - written inscriptions, also in black, from the Koran. Under the dome - of the vast mausoleum a high and beautiful screen of open tracery in - white marble rises around the two tombs, or rather cenotaphs of the - emperor and his princess; and in this marvel of marble the carving - has advanced from the old geometrical patterns to a trellis-work of - flowers and foliage, handled with great freedom and spirit. The two - cenotaphs in the center of the exquisite enclosure have no carving - except the plain Kalamdan or oblong pen-box on the tomb of Emperor - Shah Jehan. But both cenotaphs are inlaid with flowers made of - costly gems, and with the ever graceful oleander scroll." - -Bayard Taylor, after describing the details of the Taj, goes on to say: - - "On both sides the palm, the banyan, and the feathery bamboo mingle - their foliage; the song of birds meets your ears, and the odor of - roses and lemon flowers sweetens the air. Down such a vista and - over such a foreground rises the Taj. There is no mystery, no sense - of partial failure about the Taj. A thing of perfect beauty and of - absolute finish in every detail, it might pass for the work of genii - who knew naught of the weaknesses and ills with which mankind are - beset." - -All of these details are true. But, taken together, they state a -falsehood--to you. You cannot add them up correctly. Those writers know -the values of their words and phrases, but to you the words and phrases -convey other and uncertain values. To those writers their phrases have -values which I think I am now acquainted with; and for the help of the -reader I will here repeat certain of those words and phrases, and follow -them with numerals which shall represent those values--then we shall see -the difference between a writer's ciphering and a mistaken reader's-- - -Precious stones, such as agate, jasper, etc.--5. - -With which every salient point is richly fretted--5. - -First in the world for purely decorative workmanship--9. - -The Taj represents the stage where the architect ends and the jeweler -begins--5. - -The Taj is entirely of marble and gems--7. - -Inlaid with precious stones in lovely patterns of flowers--5. - -The inlaid work of flowers done in gems is very brilliant -(followed by a most important modification which the reader is sure to -read too carelessly)--2. - -The vast mausoleum--5. - -This marvel of marble--5. - -The exquisite enclosure--5. - -Inlaid with flowers made of costly gems--5. - -A thing of perfect beauty and absolute finish--5. - - -Those details are correct; the figures which I have placed after them -represent quite fairly their individual, values. Then why, as a whole, -do they convey a false impression to the reader? It is because the -reader--beguiled by, his heated imagination--masses them in the wrong -way. The writer would mass the first three figures in the following way, -and they would speak the truth - -Total--19 - -But the reader masses them thus--and then they tell a lie--559. - -The writer would add all of his twelve numerals together, and then the -sum would express the whole truth about the Taj, and the truth only--63. - -But the reader--always helped by his imagination--would put the figures -in a row one after the other, and get this sum, which would tell him a -noble big lie: - -559575255555. - -You must put in the commas yourself; I have to go on with my work. - -The reader will always be sure to put the figures together in that wrong -way, and then as surely before him will stand, sparkling in the sun, a -gem-crusted Taj tall as the Matterhorn. - -I had to visit Niagara fifteen times before I succeeded in getting my -imaginary Falls gauged to the actuality and could begin to sanely and -wholesomely wonder at them for what they were, not what I had expected -them to be. When I first approached them it was with my face lifted -toward the sky, for I thought I was going to see an Atlantic ocean -pouring down thence over cloud-vexed Himalayan heights, a sea-green wall -of water sixty miles front and six miles high, and so, when the toy -reality came suddenly into view--that beruiled little wet apron hanging -out to dry--the shock was too much for me, and I fell with a dull thud. - -Yet slowly, surely, steadily, in the course of my fifteen visits, the -proportions adjusted themselves to the facts, and I came at last to -realize that a waterfall a hundred and sixty-five feet high and a quarter -of a mile wide was an impressive thing. It was not a dipperful to my -vanished great vision, but it would answer. - -I know that I ought to do with the Taj as I was obliged to do with -Niagara--see it fifteen times, and let my mind gradually get rid of the -Taj built in it by its describers, by help of my imagination, and -substitute for it the Taj of fact. It would be noble and fine, then, and -a marvel; not the marvel which it replaced, but still a marvel, and fine -enough. I am a careless reader, I suppose--an impressionist reader; an -impressionist reader of what is not an impressionist picture; a reader -who overlooks the informing details or masses their sum improperly, and -gets only a large splashy, general effect--an effect which is not -correct, and which is not warranted by the particulars placed before me -particulars which I did not examine, and whose meanings I did not -cautiously and carefully estimate. It is an effect which is some -thirty-five or forty times finer than the reality, and is therefore a -great deal better and more valuable than the reality; and so, I ought -never to hunt up the reality, but stay miles away from it, and thus -preserve undamaged my own private mighty Niagara tumbling out of the -vault of heaven, and my own ineffable Taj, built of tinted mists upon -jeweled arches of rainbows supported by colonnades of moonlight. It is a -mistake for a person with an unregulated imagination to go and look at an -illustrious world's wonder. - -I suppose that many, many years ago I gathered the idea that the Taj's -place in the achievements of man was exactly the place of the ice-storm -in the achievements of Nature; that the Taj represented man's supremest -possibility in the creation of grace and beauty and exquisiteness and -splendor, just as the ice-storm represents Nature's supremest possibility -in the combination of those same qualities. I do not know how long ago -that idea was bred in me, but I know that I cannot remember back to a -time when the thought of either of these symbols of gracious and -unapproachable perfection did not at once suggest the other. If I -thought of the ice-storm, the Taj rose before me divinely beautiful; if I -thought of the Taj, with its encrustings and inlayings of jewels, the -vision of the ice-storm rose. And so, to me, all these years, the Taj -has had no rival among the temples and palaces of men, none that even -remotely approached it it was man's architectural ice-storm. - -Here in London the other night I was talking with some Scotch and English -friends, and I mentioned the ice-storm, using it as a figure--a figure -which failed, for none of them had heard of the ice-storm. One -gentleman, who was very familiar with American literature, said he had -never seen it mentioned in any book. That is strange. And I, myself, -was not able to say that I had seen it mentioned in a book; and yet the -autumn foliage, with all other American scenery, has received full and -competent attention. - -The oversight is strange, for in America the ice-storm is an event. And -it is not an event which one is careless about. When it comes, the news -flies from room to room in the house, there are bangings on the doors, -and shoutings, "The ice-storm! the ice-storm!" and even the laziest -sleepers throw off the covers and join the rush for the windows. The -ice-storm occurs in midwinter, and usually its enchantments are wrought -in the silence and the darkness of the night. A fine drizzling rain -falls hour after hour upon the naked twigs and branches of the trees, and -as it falls it freezes. In time the trunk and every branch and twig are -incased in hard pure ice; so that the tree looks like a skeleton tree -made all of glass--glass that is crystal-clear. All along the underside -of every branch and twig is a comb of little icicles--the frozen drip. -Sometimes these pendants do not quite amount to icicles, but are round -beads--frozen tears. - -The weather clears, toward dawn, and leaves a brisk pure atmosphere and a -sky without a shred of cloud in it--and everything is still, there is not -a breath of wind. The dawn breaks and spreads, the news of the storm -goes about the house, and the little and the big, in wraps and blankets, -flock to the window and press together there, and gaze intently out upon -the great white ghost in the grounds, and nobody says a word, nobody -stirs. All are waiting; they know what is coming, and they are waiting -waiting for the miracle. The minutes drift on and on and on, with not a -sound but the ticking of the clock; at last the sun fires a sudden sheaf -of rays into the ghostly tree and turns it into a white splendor of -glittering diamonds. Everybody catches his breath, and feels a swelling -in his throat and a moisture in his eyes-but waits again; for he knows -what is coming; there is more yet. The sun climbs higher, and still -higher, flooding the tree from its loftiest spread of branches to its -lowest, turning it to a glory of white fire; then in a moment, without -warning, comes the great miracle, the supreme miracle, the miracle -without its fellow in the earth; a gust of wind sets every branch and -twig to swaying, and in an instant turns the whole white tree into a -spouting and spraying explosion of flashing gems of every conceivable -color; and there it stands and sways this way and that, flash! flash! -flash! a dancing and glancing world of rubies, emeralds, diamonds, -sapphires, the most radiant spectacle, the most blinding spectacle, the -divinest, the most exquisite, the most intoxicating vision of fire and -color and intolerable and unimaginable splendor that ever any eye has -rested upon in this world, or will ever rest upon outside of the gates of -heaven. - -By, all my senses, all my faculties, I know that the icestorm is Nature's -supremest achievement in the domain of the superb and the beautiful; and -by my reason, at least, I know that the Taj is man's ice-storm. - -In the ice-storm every one of the myriad ice-beads pendant from twig and -branch is an individual gem, and changes color with every motion caused -by the wind; each tree carries a million, and a forest-front exhibits the -splendors of the single tree multiplied by a thousand. - -It occurs to me now that I have never seen the ice-storm put upon canvas, -and have not heard that any painter has tried to do it. I wonder why -that is. Is it that paint cannot counterfeit the intense blaze of a -sun-flooded jewel? There should be, and must be, a reason, and a good one, -why the most enchanting sight that Nature has created has been neglected -by the brush. - -Often, the surest way to convey misinformation is to tell the strict -truth. The describers of the Taj have used the word gem in its strictest -sense--its scientific sense. In that sense it is a mild word, and -promises but little to the eye-nothing bright, nothing brilliant, nothing -sparkling, nothing splendid in the way of color. It accurately describes -the sober and unobtrusive gem-work of the Taj; that is, to the very -highly-educated one person in a thousand; but it most falsely describes -it to the 999. But the 999 are the people who ought to be especially -taken care of, and to them it does not mean quiet-colored designs wrought -in carnelians, or agates, or such things; they know the word in its wide -and ordinary sense only, and so to them it means diamonds and rubies and -opals and their kindred, and the moment their eyes fall upon it in print -they see a vision of glorious colors clothed in fire. - -These describers are writing for the "general," and so, in order to make -sure of being understood, they ought to use words in their ordinary -sense, or else explain. The word fountain means one thing in Syria, -where there is but a handful of people; it means quite another thing in -North America, where there are 75,000,000. If I were describing some -Syrian scenery, and should exclaim, "Within the narrow space of a quarter -of a mile square I saw, in the glory of the flooding moonlight, two -hundred noble fountains--imagine the spectacle!" the North American would -have a vision of clustering columns of water soaring aloft, bending over -in graceful arches, bursting in beaded spray and raining white fire in -the moonlight-and he would be deceived. But the Syrian would not be -deceived; he would merely see two hundred fresh-water springs--two -hundred drowsing puddles, as level and unpretentious and unexcited as so -many door-mats, and even with the help of the moonlight he would not lose -his grip in the presence of the exhibition. My word "fountain" would be -correct; it would speak the strict truth; and it would convey the strict -truth to the handful of Syrians, and the strictest misinformation to the -North American millions. With their gems--and gems--and more gems--and -gems again--and still other gems--the describers of the Taj are within -their legal but not their moral rights; they are dealing in the strictest -scientific truth; and in doing it they succeed to admiration in telling -"what ain't so." - - - - -CHAPTER LX. - -SATAN (impatiently) to NEW-COMER. The trouble with you Chicago people -is, that you think you are the best people down here; whereas you are -merely the most numerous. - --Pudd'nhead Wilson's New Calendar. - -We wandered contentedly around here and there in India; to Lahore, among -other places, where the Lieutenant-Governor lent me an elephant. This -hospitality stands out in my experiences in a stately isolation. It was -a fine elephant, affable, gentlemanly, educated, and I was not afraid of -it. I even rode it with confidence through the crowded lanes of the -native city, where it scared all the horses out of their senses, and -where children were always just escaping its feet. It took the middle of -the road in a fine independent way, and left it to the world to get out -of the way or take the consequences. I am used to being afraid of -collisions when I ride or drive, but when one is on top of an elephant -that feeling is absent. I could have ridden in comfort through a -regiment of runaway teams. I could easily learn to prefer an elephant to -any other vehicle, partly because of that immunity from collisions, and -partly because of the fine view one has from up there, and partly because -of the dignity one feels in that high place, and partly because one can -look in at the windows and see what is going on privately among the -family. The Lahore horses were used to elephants, but they were -rapturously afraid of them just the same. It seemed curious. Perhaps -the better they know the elephant the more they respect him in that -peculiar way. In our own case--we are not afraid of dynamite till we get -acquainted with it. - -We drifted as far as Rawal Pindi, away up on the Afghan frontier--I think -it was the Afghan frontier, but it may have been Hertzegovina--it was -around there somewhere--and down again to Delhi, to see the ancient -architectural wonders there and in Old Delhi and not describe them, and -also to see the scene of the illustrious assault, in the Mutiny days, -when the British carried Delhi by storm, one of the marvels of history -for impudent daring and immortal valor. - -We had a refreshing rest, there in Delhi, in a great old mansion which -possessed historical interest. It was built by a rich Englishman who had -become orientalized--so much so that he had a zenana. But he was a -broadminded man, and remained so. To please his harem he built a mosque; -to please himself he built an English church. That kind of a man will -arrive, somewhere. In the Mutiny days the mansion was the British -general's headquarters. It stands in a great garden--oriental fashion ---and about it are many noble trees. The trees harbor monkeys; and they -are monkeys of a watchful and enterprising sort, and not much troubled -with fear. They invade the house whenever they get a chance, and carry -off everything they don't want. One morning the master of the house was -in his bath, and the window was open. Near it stood a pot of yellow -paint and a brush. Some monkeys appeared in the window; to scare them -away, the gentleman threw his sponge at them. They did not scare at all; -they jumped into the room and threw yellow paint all over him from the -brush, and drove him out; then they painted the walls and the floor and -the tank and the windows and the furniture yellow, and were in the -dressing-room painting that when help arrived and routed them. - -Two of these creatures came into my room in the early morning, through a -window whose shutters I had left open, and when I woke one of them was -before the glass brushing his hair, and the other one had my note-book, -and was reading a page of humorous notes and crying. I did not mind the -one with the hair-brush, but the conduct of the other one hurt me; it -hurts me yet. I threw something at him, and that was wrong, for my host -had told me that the monkeys were best left alone. They threw everything -at me that they could lift, and then went into the bathroom to get some -more things, and I shut the door on them. - -At Jeypore, in Rajputana, we made a considerable stay. We were not in -the native city, but several miles from it, in the small European -official suburb. There were but few Europeans--only fourteen but they -were all kind and hospitable, and it amounted to being at home. In -Jeypore we found again what we had found all about India--that while the -Indian servant is in his way a very real treasure, he will sometimes bear -watching, and the Englishman watches him. If he sends him on an errand, -he wants more than the man's word for it that he did the errand. When -fruit and vegetables were sent to us, a "chit" came with them--a receipt -for us to sign; otherwise the things might not arrive. If a gentleman -sent up his carriage, the chit stated "from" such-and-such an hour "to" -such-and-such an hour--which made it unhandy for the coachman and his two -or three subordinates to put us off with a part of the allotted time and -devote the rest of it to a lark of their own. - -We were pleasantly situated in a small two-storied inn, in an empty large -compound which was surrounded by a mud wall as high as a man's head. The -inn was kept by nine Hindoo brothers, its owners. They lived, with their -families, in a one-storied building within the compound, but off to one -side, and there was always a long pile of their little comely brown -children loosely stacked in its veranda, and a detachment of the parents -wedged among them, smoking the hookah or the howdah, or whatever they -call it. By the veranda stood a palm, and a monkey lived in it, and led -a lonesome life, and always looked sad and weary, and the crows bothered -him a good deal. - -The inn cow poked about the compound and emphasized the secluded and -country air of the place, and there was a dog of no particular breed, who -was always present in the compound, and always asleep, always stretched -out baking in the sun and adding to the deep tranquility and -reposefulness of the place, when the crows were away on business. -White-draperied servants were coming and going all the time, but they -seemed only spirits, for their feet were bare and made no sound. Down -the lane a piece lived an elephant in the shade of a noble tree, and -rocked and rocked, and reached about with his trunk, begging of his brown -mistress or fumbling the children playing at his feet. And there were -camels about, but they go on velvet feet, and were proper to the silence -and serenity of the surroundings. - -The Satan mentioned at the head of this chapter was not our Satan, but -the other one. Our Satan was lost to us. In these later days he had -passed out of our life--lamented by me, and sincerely. I was missing -him; I am missing him yet, after all these months. He was an astonishing -creature to fly around and do things. He didn't always do them quite -right, but he did them, and did them suddenly. There was no time wasted. -You would say: - -"Pack the trunks and bags, Satan." - -"Wair good" (very good). - -Then there would be a brief sound of thrashing and slashing and humming -and buzzing, and a spectacle as of a whirlwind spinning gowns and jackets -and coats and boots and things through the air, and then with bow and -touch-- - -"Awready, master." - -It was wonderful. It made one dizzy. He crumpled dresses a good deal, -and he had no particular plan about the work--at first--except to put -each article into the trunk it didn't belong in. But he soon reformed, -in this matter. Not entirely; for, to the last, he would cram into the -satchel sacred to literature any odds and ends of rubbish that he -couldn't find a handy place for elsewhere. When threatened with death -for this, it did not trouble him; he only looked pleasant, saluted with -soldierly grace, said "Wair good," and did it again next day. - -He was always busy; kept the rooms tidied up, the boots polished, the -clothes brushed, the wash-basin full of clean water, my dress clothes -laid out and ready for the lecture-hall an hour ahead of time; and he -dressed me from head to heel in spite of my determination to do it -myself, according to my lifelong custom. - -He was a born boss, and loved to command, and to jaw and dispute with -inferiors and harry them and bullyrag them. He was fine at the railway -station--yes, he was at his finest there. He would shoulder and plunge -and paw his violent way through the packed multitude of natives with -nineteen coolies at his tail, each bearing a trifle of luggage--one a -trunk, another a parasol, another a shawl, another a fan, and so on; one -article to each, and the longer the procession, the better he was suited ---and he was sure to make for some engaged sleeper and begin to hurl the -owner's things out of it, swearing that it was ours and that there had -been a mistake. Arrived at our own sleeper, he would undo the -bedding-bundles and make the beds and put everything to rights and -shipshape in two minutes; then put his head out at, a window and have a -restful good time abusing his gang of coolies and disputing their bill -until we arrived and made him pay them and stop his noise. - -Speaking of noise, he certainly was the noisest little devil in India ---and that is saying much, very much, indeed. I loved him for his noise, -but the family detested him for it. They could not abide it; they could -not get reconciled to it. It humiliated them. As a rule, when we got -within six hundred yards of one of those big railway stations, a mighty -racket of screaming and shrieking and shouting and storming would break -upon us, and I would be happy to myself, and the family would say, with -shame: - -"There--that's Satan. Why do you keep him?" - -And, sure enough, there in the whirling midst of fifteen hundred -wondering people we would find that little scrap of a creature -gesticulating like a spider with the colic, his black eyes snapping, his -fez-tassel dancing, his jaws pouring out floods of billingsgate upon his -gang of beseeching and astonished coolies. - -I loved him; I couldn't help it; but the family--why, they could hardly -speak of him with patience. To this day I regret his loss, and wish I -had him back; but they--it is different with them. He was a native, and -came from Surat. Twenty degrees of latitude lay between his birthplace -and Manuel's, and fifteen hundred between their ways and characters and -dispositions. I only liked Manuel, but I loved Satan. This latter's -real name was intensely Indian. I could not quite get the hang of it, -but it sounded like Bunder Rao Ram Chunder Clam Chowder. It was too long -for handy use, anyway; so I reduced it. - -When he had been with us two or three weeks, he began to make mistakes -which I had difficulty in patching up for him. Approaching Benares one -day, he got out of the train to see if he could get up a misunderstanding -with somebody, for it had been a weary, long journey and he wanted to -freshen up. He found what he was after, but kept up his pow-wow a shade -too long and got left. So there we were in a strange city and no -chambermaid. It was awkward for us, and we told him he must not do so -any more. He saluted and said in his dear, pleasant way, "Wair good." -Then at Lucknow he got drunk. I said it was a fever, and got the -family's compassion, and solicitude aroused; so they gave him a -teaspoonful of liquid quinine and it set his vitals on fire. He made -several grimaces which gave me a better idea of the Lisbon earthquake -than any I have ever got of it from paintings and descriptions. His -drunk was still portentously solid next morning, but I could have pulled -him through with the family if he would only have taken another spoonful -of that remedy; but no, although he was stupefied, his memory still had -flickerings of life; so he smiled a divinely dull smile and said, -fumblingly saluting: - -"Scoose me, mem Saheb, scoose me, Missy Saheb; Satan not prefer it, -please." - -Then some instinct revealed to them that he was drunk. They gave him -prompt notice that next time this happened he must go. He got out a -maudlin and most gentle "Wair good," and saluted indefinitely. - -Only one short week later he fell again. And oh, sorrow! not in a hotel -this time, but in an English gentleman's private house. And in Agra, of -all places. So he had to go. When I told him, he said patiently, "Wair -good," and made his parting salute, and went out from us to return no -more forever. Dear me! I would rather have lost a hundred angels than -that one poor lovely devil. What style he used to put on, in a swell -hotel or in a private house--snow-white muslin from his chin to his bare -feet, a crimson sash embroidered with gold thread around his waist, and -on his head a great sea-green turban like to the turban of the Grand -Turk. - -He was not a liar; but he will become one if he keeps on. He told me -once that he used to crack cocoanuts with his teeth when he was a boy; -and when I asked how he got them into his mouth, he said he was upward of -six feet high at that time, and had an unusual mouth. And when I -followed him up and asked him what had become of that other foot, he said -a house fell on him and he was never able to get his stature back again. -Swervings like these from the strict line of fact often beguile a -truthful man on and on until he eventually becomes a liar. - -His successor was a Mohammedan, Sahadat Mohammed Khan; very dark, very -tall, very grave. He went always in flowing masses of white, from the -top of his big turban down to his bare feet. His voice was low. He -glided about in a noiseless way, and looked like a ghost. He was -competent and satisfactory. But where he was, it seemed always Sunday. -It was not so in Satan's time. - -Jeypore is intensely Indian, but it has two or three features which -indicate the presence of European science and European interest in the -weal of the common public, such as the liberal water-supply furnished by -great works built at the State's expense; good sanitation, resulting in a -degree of healthfulness unusually high for India; a noble pleasure -garden, with privileged days for women; schools for the instruction of -native youth in advanced art, both ornamental and utilitarian; and a new -and beautiful palace stocked with a museum of extraordinary interest and -value. Without the Maharaja's sympathy and purse these beneficences -could not have been created; but he is a man of wide views and large -generosities, and all such matters find hospitality with him. - -We drove often to the city from the hotel Kaiser-i-Hind, a journey which -was always full of interest, both night and day, for that country road -was never quiet, never empty, but was always India in motion, always a -streaming flood of brown people clothed in smouchings from the rainbow, a -tossing and moiling flood, happy, noisy, a charming and satisfying -confusion of strange human and strange animal life and equally strange -and outlandish vehicles. - -And the city itself is a curiosity. Any Indian city is that, but this -one is not like any other that we saw. It is shut up in a lofty turreted -wall; the main body of it is divided into six parts by perfectly straight -streets that are more than a hundred feet wide; the blocks of houses -exhibit a long frontage of the most taking architectural quaintnesses, -the straight lines being broken everywhere by pretty little balconies, -pillared and highly ornamented, and other cunning and cozy and inviting -perches and projections, and many of the fronts are curiously pictured by -the brush, and the whole of them have the soft rich tint of strawberry -ice-cream. One cannot look down the far stretch of the chief street and -persuade himself that these are real houses, and that it is all out of -doors--the impression that it is an unreality, a picture, a scene in a -theater, is the only one that will take hold. - -Then there came a great day when this illusion was more pronounced than -ever. A rich Hindoo had been spending a fortune upon the manufacture of -a crowd of idols and accompanying paraphernalia whose purpose was to -illustrate scenes in the life of his especial god or saint, and this fine -show was to be brought through the town in processional state at ten in -the morning. As we passed through the great public pleasure garden on -our way to the city we found it crowded with natives. That was one -sight. Then there was another. In the midst of the spacious lawns -stands the palace which contains the museum--a beautiful construction of -stone which shows arched colonnades, one above another, and receding, -terrace-fashion, toward the sky. Every one of these terraces, all the -way to the top one, was packed and jammed with natives. One must try to -imagine those solid masses of splendid color, one above another, up and -up, against the blue sky, and the Indian sun turning them all to beds of -fire and flame. - -Later, when we reached the city, and glanced down the chief avenue, -smouldering in its crushed-strawberry tint, those splendid effects were -repeated; for every balcony, and every fanciful bird-cage of a snuggery -countersunk in the house-fronts, and all the long lines of roofs were -crowded with people, and each crowd was an explosion of brilliant color. - -Then the wide street itself, away down and down and down into the -distance, was alive with gorgeously-clothed people not still, but moving, -swaying, drifting, eddying, a delirious display of all colors and all -shades of color, delicate, lovely, pale, soft, strong, stunning, vivid, -brilliant, a sort of storm of sweetpea blossoms passing on the wings of a -hurricane; and presently, through this storm of color, came swaying and -swinging the majestic elephants, clothed in their Sunday best of -gaudinesses, and the long procession of fanciful trucks freighted with -their groups of curious and costly images, and then the long rearguard of -stately camels, with their picturesque riders. - -For color, and picturesqueness, and novelty, and outlandishness, and -sustained interest and fascination, it was the most satisfying show I had -ever seen, and I suppose I shall not have the privilege of looking upon -its like again. - - - - -CHAPTER LXI. - -In the first place God made idiots. This was for practice. Then He made -School Boards. - --Pudd'nhead Wilson's New Calendar. - -Suppose we applied no more ingenuity to the instruction of deaf and dumb -and blind children than we sometimes apply in our American public schools -to the instruction of children who are in possession of all their -faculties? The result would be that the deaf and dumb and blind would -acquire nothing. They would live and die as ignorant as bricks and -stones. The methods used in the asylums are rational. The teacher -exactly measures the child's capacity, to begin with; and from thence -onwards the tasks imposed are nicely gauged to the gradual development of -that capacity, the tasks keep pace with the steps of the child's -progress, they don't jump miles and leagues ahead of it by irrational -caprice and land in vacancy--according to the average public-school plan. -In the public school, apparently, they teach the child to spell cat, then -ask it to calculate an eclipse; when it can read words of two syllables, -they require it to explain the circulation of the blood; when it reaches -the head of the infant class they bully it with conundrums that cover the -domain of universal knowledge. This sounds extravagant--and is; yet it -goes no great way beyond the facts. - -I received a curious letter one day, from the Punjab (you must pronounce -it Punjawb). The handwriting was excellent, and the wording was English ---English, and yet not exactly English. The style was easy and smooth -and flowing, yet there was something subtly foreign about it--A something -tropically ornate and sentimental and rhetorical. It turned out to be -the work of a Hindoo youth, the holder of a humble clerical billet in a -railway office. He had been educated in one of the numerous colleges of -India. Upon inquiry I was told that the country was full of young -fellows of his like. They had been educated away up to the snow-summits -of learning--and the market for all this elaborate cultivation was -minutely out of proportion to the vastness of the product. This market -consisted of some thousands of small clerical posts under the government ---the supply of material for it was multitudinous. If this youth with the -flowing style and the blossoming English was occupying a small railway -clerkship, it meant that there were hundreds and hundreds as capable as -he, or he would be in a high place; and it certainly meant that there -were thousands whose education and capacity had fallen a little short, -and that they would have to go without places. Apparently, then, the -colleges of India were doing what our high schools have long been doing ---richly over-supplying the market for highly-educated service; and thereby -doing a damage to the scholar, and through him to the country. - -At home I once made a speech deploring the injuries inflicted by the high -school in making handicrafts distasteful to boys who would have been -willing to make a living at trades and agriculture if they had but had -the good luck to stop with the common school. But I made no converts. -Not one, in a community overrun with educated idlers who were above -following their fathers' mechanical trades, yet could find no market for -their book-knowledge. The same rail that brought me the letter from the -Punjab, brought also a little book published by Messrs. Thacker, Spink & -Co., of Calcutta, which interested me, for both its preface and its -contents treated of this matter of over-education. In the preface occurs -this paragraph from the Calcutta Review. For "Government office" read -"drygoods clerkship" and it will fit more than one region of America: - - "The education that we give makes the boys a little less clownish in - their manners, and more intelligent when spoken to by strangers. On - the other hand, it has made them less contented with their lot in - life, and less willing to work with their hands. The form which - discontent takes in this country is not of a healthy kind; for, the - Natives of India consider that the only occupation worthy of an - educated man is that of a writership in some office, and especially - in a Government office. The village schoolboy goes back to the plow - with the greatest reluctance; and the town schoolboy carries the - same discontent and inefficiency into his father's workshop. - Sometimes these ex-students positively refuse at first to work; and - more than once parents have openly expressed their regret that they - ever allowed their sons to be inveigled to school." - -The little book which I am quoting from is called "Indo-Anglian -Literature," and is well stocked with "baboo" English--clerkly English, -hooky English, acquired in the schools. Some of it is very funny, ---almost as funny, perhaps, as what you and I produce when we try to write -in a language not our own; but much of it is surprisingly correct and -free. If I were going to quote good English--but I am not. India is -well stocked with natives who speak it and write it as well as the best -of us. I merely wish to show some of the quaint imperfect attempts at -the use of our tongue. There are many letters in the book; poverty -imploring help--bread, money, kindness, office generally an office, a -clerkship, some way to get food and a rag out of the applicant's -unmarketable education; and food not for himself alone, but sometimes for -a dozen helpless relations in addition to his own family; for those -people are astonishingly unselfish, and admirably faithful to their ties -of kinship. Among us I think there is nothing approaching it. Strange -as some of these wailing and supplicating letters are, humble and even -groveling as some of them are, and quaintly funny and confused as a -goodly number of them are, there is still a pathos about them, as a rule, -that checks the rising laugh and reproaches it. In the following letter -"father" is not to be read literally. In Ceylon a little native -beggar-girl embarrassed me by calling me father, although I knew she was -mistaken. I was so new that I did not know that she was merely following -the custom of the dependent and the supplicant. - - "SIR, - - "I pray please to give me some action (work) for I am very poor boy - I have no one to help me even so father for it so it seemed in thy - good sight, you give the Telegraph Office, and another work what is - your wish I am very poor boy, this understand what is your wish you - my father I am your son this understand what is your wish. - - "Your Sirvent, P. C. B." - -Through ages of debasing oppression suffered by these people at the hands -of their native rulers, they come legitimately by the attitude and -language of fawning and flattery, and one must remember this in -mitigation when passing judgment upon the native character. It is common -in these letters to find the petitioner furtively trying to get at the -white man's soft religious side; even this poor boy baits his hook with a -macerated Bible-text in the hope that it may catch something if all else -fail. - -Here is an application for the post of instructor in English to some -children: - - "My Dear Sir or Gentleman, that your Petitioner has much - qualification in the Language of English to instruct the young boys; - I was given to understand that your of suitable children has to - acquire the knowledge of English language." - -As a sample of the flowery Eastern style, I will take a sentence or two -from along letter written by a young native to the Lieutenant-Governor of -Bengal--an application for employment: - - "HONORED AND MUCH RESPECTED SIR, - - "I hope your honor will condescend to hear the tale of this poor - creature. I shall overflow with gratitude at this mark of your - royal condescension. The bird-like happiness has flown away from my - nest-like heart and has not hitherto returned from the period whence - the rose of my father's life suffered the autumnal breath of death, - in plain English he passed through the gates of Grave, and from that - hour the phantom of delight has never danced before me." - -It is all school-English, book-English, you see; and good enough, too, -all things considered. If the native boy had but that one study he would -shine, he would dazzle, no doubt. But that is not the case. He is -situated as are our public-school children--loaded down with an -over-freightage of other studies; and frequently they are as far beyond -the actual point of progress reached by him and suited to the stage of -development attained, as could be imagined by the insanest fancy. -Apparently--like our public-school boy--he must work, work, work, in -school and out, and play but little. Apparently--like our public-school -boy--his "education" consists in learning things, not the meaning of -them; he is fed upon the husks, not the corn. From several essays -written by native schoolboys in answer to the question of how they spend -their day, I select one--the one which goes most into detail: - - "66. At the break of day I rises from my own bed and finish my - daily duty, then I employ myself till 8 o'clock, after which I - employ myself to bathe, then take for my body some sweet meat, and - just at 9 1/2 I came to school to attend my class duty, then at - 2 1/2 P. M. I return from school and engage myself to do my natural - duty, then, I engage for a quarter to take my tithn, then I study - till 5 P. M., after which I began to play anything which comes in - my head. After 8 1/2, half pass to eight we are began to sleep, - before sleeping I told a constable just 11 o' he came and rose us - from half pass eleven we began to read still morning." - -It is not perfectly clear, now that I come to cipher upon it. He gets up -at about 5 in the morning, or along there somewhere, and goes to bed -about fifteen or sixteen hours afterward--that much of it seems straight; -but why he should rise again three hours later and resume his studies -till morning is puzzling. - -I think it is because he is studying history. History requires a world -of time and bitter hard work when your "education" is no further advanced -than the cat's; when you are merely stuffing yourself with a mixed-up -mess of empty names and random incidents and elusive dates, which no one -teaches you how to interpret, and which, uninterpreted, pay you not a -farthing's value for your waste of time. Yes, I think he had to get up -at halfpast 11 P.M. in order to be sure to be perfect with his history -lesson by noon. With results as follows--from a Calcutta school -examination: - -"Q. Who was Cardinal Wolsey? -"Cardinal Wolsey was an Editor of a paper named North Briton. No. 45 of -his publication he charged the King of uttering a lie from the throne. -He was arrested and cast into prison; and after releasing went to France. - -"3. As Bishop of York but died in disentry in a church on his way to be -blockheaded. - -"8. Cardinal Wolsey was the son of Edward IV, after his father's death -he himself ascended the throne at the age of (10) ten only, but when he -surpassed or when he was fallen in his twenty years of age at that time -he wished to make a journey in his countries under him, but he was -opposed by his mother to do journey, and according to his mother's -example he remained in the home, and then became King. After many times -obstacles and many confusion he become King and afterwards his brother." - -There is probably not a word of truth in that. - -"Q. What is the meaning of 'Ich Dien'? - -"10. An honor conferred on the first or eldest sons of English -Sovereigns. It is nothing more than some feathers. - -"11. Ich Dien was the word which was written on the feathers of the -blind King who came to fight, being interlaced with the bridles of the -horse. - -"13. Ich Dien is a title given to Henry VII by the Pope of Rome, when he -forwarded the Reformation of Cardinal Wolsy to Rome, and for this reason -he was called Commander of the faith." - -A dozen or so of this kind of insane answers are quoted in the book from -that examination. Each answer is sweeping proof, all by itself, that the -person uttering it was pushed ahead of where he belonged when he was put -into history; proof that he had been put to the task of acquiring history -before he had had a single lesson in the art of acquiring it, which is -the equivalent of dumping a pupil into geometry before he has learned the -progressive steps which lead up to it and make its acquirement possible. -Those Calcutta novices had no business with history. There was no excuse -for examining them in it, no excuse for exposing them and their teachers. -They were totally empty; there was nothing to "examine." - -Helen Keller has been dumb, stone deaf, and stone blind, ever since she -was a little baby a year-and-a-half old; and now at sixteen years of age -this miraculous creature, this wonder of all the ages, passes the Harvard -University examination in Latin, German, French history, belles lettres, -and such things, and does it brilliantly, too, not in a commonplace -fashion. She doesn't know merely things, she is splendidly familiar with -the meanings of them. When she writes an essay on a Shakespearean -character, her English is fine and strong, her grasp of the subject is -the grasp of one who knows, and her page is electric with light. Has -Miss Sullivan taught her by the methods of India and the American public -school? No, oh, no; for then she would be deafer and dumber and blinder -than she was before. It is a pity that we can't educate all the children -in the asylums. - -To continue the Calcutta exposure: - -"What is the meaning of a Sheriff?" - -"25. Sheriff is a post opened in the time of John. The duty of Sheriff -here in Calcutta, to look out and catch those carriages which is rashly -driven out by the coachman; but it is a high post in England. - -"26. Sheriff was the English bill of common prayer. - -"27. The man with whom the accusative persons are placed is called -Sheriff. - -"28. Sheriff--Latin term for 'shrub,' we called broom, worn by the first -earl of Enjue, as an emblem of humility when they went to the pilgrimage, -and from this their hairs took their crest and surname. - -"29. Sheriff is a kind of titlous sect of people, as Barons, Nobles, -etc. - -"30. Sheriff; a tittle given on those persons who were respective and -pious in England." - -The students were examined in the following bulky matters: Geometry, the -Solar Spectrum, the Habeas Corpus Act, the British Parliament, and in -Metaphysics they were asked to trace the progress of skepticism from -Descartes to Hume. It is within bounds to say that some of the results -were astonishing. Without doubt, there were students present who -justified their teacher's wisdom in introducing them to these studies; -but the fact is also evident that others had been pushed into these -studies to waste their time over them when they could have been -profitably employed in hunting smaller game. Under the head of Geometry, -one of the answers is this: - -"49. The whole BD = the whole CA, and so-so-so-so-so-so-so." - -To me this is cloudy, but I was never well up in geometry. That was the -only effort made among the five students who appeared for examination in -geometry; the other four wailed and surrendered without a fight. They -are piteous wails, too, wails of despair; and one of them is an eloquent -reproach; it comes from a poor fellow who has been laden beyond his -strength by a stupid teacher, and is eloquent in spite of the poverty of -its English. The poor chap finds himself required to explain riddles -which even Sir Isaac Newton was not able to understand: - -"50. Oh my dear father examiner you my father and you kindly give a -number of pass you my great father. - -"51. I am a poor boy and have no means to support my mother and two -brothers who are suffering much for want of food. I get four rupees -monthly from charity fund of this place, from which I send two rupees for -their support, and keep two for my own support. Father, if I relate the -unlucky circumstance under which we are placed, then, I think, you will -not be able to suppress the tender tear. - -"52. Sir which Sir Isaac Newton and other experienced mathematicians -cannot understand I being third of Entrance Class can understand these -which is too impossible to imagine. And my examiner also has put very -tiresome and very heavy propositions to prove." - -We must remember that these pupils had to do their thinking in one -language, and express themselves in another and alien one. It was a -heavy handicap. I have by me "English as She is Taught"--a collection of -American examinations made in the public schools of Brooklyn by one of -the teachers, Miss Caroline B. Le Row. An extract or two from its pages -will show that when the American pupil is using but one language, and -that one his own, his performance is no whit better than his Indian -brother's: - -"ON HISTORY. - -"Christopher Columbus was called the father of his Country. Queen -Isabella of Spain sold her watch and chain and other millinery so that -Columbus could discover America. - -"The Indian wars were very desecrating to the country. - -"The Indians pursued their warfare by hiding in the bushes and then -scalping them. - -"Captain John Smith has been styled the father of his country. His life -was saved by his daughter Pochahantas. - -"The Puritans found an insane asylum in the wilds of America. - -"The Stamp Act was to make everybody stamp all materials so they should -be null and void. - -"Washington died in Spain almost broken-hearted. His remains were taken -to the cathedral in Havana. - -"Gorilla warfare was where men rode on gorillas." - - -In Brooklyn, as in India, they examine a pupil, and when they find out he -doesn't know anything, they put him into literature, or geometry, or -astronomy, or government, or something like that, so that he can properly -display the assification of the whole system-- - -"ON LITERATURE. - -"'Bracebridge Hall' was written by Henry Irving. - -"Edgar A. Poe was a very curdling writer. - -"Beowulf wrote the Scriptures. - -"Ben Johnson survived Shakespeare in some respects. - -"In the 'Canterbury Tale' it gives account of King Alfred on his way to -the shrine of Thomas Bucket. - -"Chaucer was the father of English pottery. - -"Chaucer was succeeded by H. Wads. Longfellow." - - -We will finish with a couple of samples of "literature," one from -America, the other from India. The first is a Brooklyn public-school -boy's attempt to turn a few verses of the "Lady of the Lake" into prose. -You will have to concede that he did it: - -"The man who rode on the horse performed the whip and an instrument made -of steel alone with strong ardor not diminishing, for, being tired from -the time passed with hard labor overworked with anger and ignorant with -weariness, while every breath for labor lie drew with cries full of -sorrow, the young deer made imperfect who worked hard filtered in sight." - - -The following paragraph is from a little book which is famous in India ---the biography of a distinguished Hindoo judge, Onoocool Chunder -Mookerjee; it was written by his nephew, and is unintentionally funny-in -fact, exceedingly so. I offer here the closing scene. If you would like -to sample the rest of the book, it can be had by applying to the -publishers, Messrs. Thacker, Spink & Co., Calcutta - - "And having said these words he hermetically sealed his lips not to - open them again. All the well-known doctors of Calcutta that could - be procured for a man of his position and wealth were brought, - --Doctors Payne, Fayrer, and Nilmadhub Mookerjee and others; they did - what they could do, with their puissance and knack of medical - knowledge, but it proved after all as if to milk the ram! His wife - and children had not the mournful consolation to hear his last - words; he remained sotto voce for a few hours, and then was taken - from us at 6.12 P.m. according to the caprice of God which passeth - understanding." - - - - -CHAPTER LXII. - -There are no people who are quite so vulgar as the over-refined ones. - --Pudd'nhead Wilson's New Calendar. - -We sailed from Calcutta toward the end of March; stopped a day at Madras; -two or three days in Ceylon; then sailed westward on a long flight for -Mauritius. From my diary: - -April 7. We are far abroad upon the smooth waters of the Indian Ocean, -now; it is shady and pleasant and peaceful under the vast spread of the -awnings, and life is perfect again--ideal. - -The difference between a river and the sea is, that the river looks -fluid, the sea solid--usually looks as if you could step out and walk on -it. - -The captain has this peculiarity--he cannot tell the truth in a plausible -way. In this he is the very opposite of the austere Scot who sits midway -of the table; he cannot tell a lie in an unplausible way. When the -captain finishes a statement the passengers glance at each other -privately, as who should say, "Do you believe that?" When the Scot -finishes one, the look says, "How strange and interesting." The whole -secret is in the manner and method of the two men. The captain is a -little shy and diffident, and he states the simplest fact as if he were a -little afraid of it, while the Scot delivers himself of the most -abandoned lie with such an air of stern veracity that one is forced to -believe it although one knows it isn't so. For instance, the Scot told -about a pet flying-fish he once owned, that lived in a little fountain in -his conservatory, and supported itself by catching birds and frogs and -rats in the neighboring fields. It was plain that no one at the table -doubted this statement. - -By and by, in the course of some talk about custom-house annoyances, the -captain brought out the following simple everyday incident, but through -his infirmity of style managed to tell it in such a way that it got no -credence. He said: - - "I went ashore at Naples one voyage when I was in that trade, and - stood around helping my passengers, for I could speak a little - Italian. Two or three times, at intervals, the officer asked me if - I had anything dutiable about me, and seemed more and more put out - and disappointed every time I told him no. Finally a passenger whom - I had helped through asked me to come out and take something. I - thanked him, but excused myself, saying I had taken a whisky just - before I came ashore. - - "It was a fatal admission. The officer at once made me pay sixpence - import-duty on the whisky-just from ship to shore, you see; and he - fined me L5 for not declaring the goods, another L5 for falsely - denying that I had anything dutiable about me, also L5 for - concealing the goods, and L50 for smuggling, which is the maximum - penalty for unlawfully bringing in goods under the value of - sevenpence ha'penny. Altogether, sixty-five pounds sixpence for a - little thing like that." - -The Scot is always believed, yet he never tells anything but lies; -whereas the captain is never believed, although he never tells a lie, so -far as I can judge. If he should say his uncle was a male person, he -would probably say it in such a way that nobody would believe it; at the -same time the Scot could claim that he had a female uncle and not stir a -doubt in anybody's mind. My own luck has been curious all my literary -life; I never could tell a lie that anybody would doubt, nor a truth that -anybody would believe. - -Lots of pets on board--birds and things. In these far countries the -white people do seem to run remarkably to pets. Our host in Cawnpore had -a fine collection of birds--the finest we saw in a private house in -India. And in Colombo, Dr. Murray's great compound and commodious -bungalow were well populated with domesticated company from the woods: -frisky little squirrels; a Ceylon mina walking sociably about the house; -a small green parrot that whistled a single urgent note of call without -motion of its beak; also chuckled; a monkey in a cage on the back -veranda, and some more out in the trees; also a number of beautiful -macaws in the trees; and various and sundry birds and animals of breeds -not known to me. But no cat. Yet a cat would have liked that place. - -April 9. Tea-planting is the great business in Ceylon, now. A passenger -says it often pays 40 per cent. on the investment. Says there is a boom. - -April 10. The sea is a Mediterranean blue; and I believe that that is -about the divinest color known to nature. - -It is strange and fine--Nature's lavish generosities to her creatures. -At least to all of them except man. For those that fly she has provided -a home that is nobly spacious--a home which is forty miles deep and -envelops the whole globe, and has not an obstruction in it. For those -that swim she has provided a more than imperial domain--a domain which is -miles deep and covers four-fifths of the globe. But as for man, she has -cut him off with the mere odds and ends of the creation. She has given -him the thin skin, the meagre skin which is stretched over the remaining -one-fifth--the naked bones stick up through it in most places. On the -one-half of this domain he can raise snow, ice, sand, rocks, and nothing -else. So the valuable part of his inheritance really consists of but a -single fifth of the family estate; and out of it he has to grub hard to -get enough to keep him alive and provide kings and soldiers and powder to -extend the blessings of civilization with. Yet man, in his simplicity -and complacency and inability to cipher, thinks Nature regards him as the -important member of the family--in fact, her favorite. Surely, it must -occur to even his dull head, sometimes, that she has a curious way of -showing it. - -Afternoon. The captain has been telling how, in one of his Arctic -voyages, it was so cold that the mate's shadow froze fast to the deck and -had to be ripped loose by main strength. And even then he got only about -two-thirds of it back. Nobody said anything, and the captain went away. -I think he is becoming disheartened . . . . Also, to be fair, there -is another word of praise due to this ship's library: it contains no copy -of the Vicar of Wakefield, that strange menagerie of complacent -hypocrites and idiots, of theatrical cheap-john heroes and heroines, who -are always showing off, of bad people who are not interesting, and good -people who are fatiguing. A singular book. Not a sincere line in it, -and not a character that invites respect; a book which is one long -waste-pipe discharge of goody-goody puerilities and dreary moralities; a -book which is full of pathos which revolts, and humor which grieves the -heart. There are few things in literature that are more piteous, more -pathetic, than the celebrated "humorous" incident of Moses and the -spectacles. Jane Austen's books, too, are absent from this library. Just -that one omission alone would make a fairly good library out of a library -that hadn't a book in it. - -Customs in tropic seas. At 5 in the morning they pipe to wash down the -decks, and at once the ladies who are sleeping there turn out and they -and their beds go below. Then one after another the men come up from the -bath in their pyjamas, and walk the decks an hour or two with bare legs -and bare feet. Coffee and fruit served. The ship cat and her kitten now -appear and get about their toilets; next the barber comes and flays us on -the breezy deck. Breakfast at 9.30, and the day begins. I do not know -how a day could be more reposeful: no motion; a level blue sea; nothing -in sight from horizon to horizon; the speed of the ship furnishes a -cooling breeze; there is no mail to read and answer; no newspapers to -excite you; no telegrams to fret you or fright you--the world is far, far -away; it has ceased to exist for you--seemed a fading dream, along in the -first days; has dissolved to an unreality now; it is gone from your mind -with all its businesses and ambitions, its prosperities and disasters, -its exultations and despairs, its joys and griefs and cares and worries. -They are no concern of yours any more; they have gone out of your life; -they are a storm which has passed and left a deep calm behind. The -people group themselves about the decks in their snowy white linen, and -read, smoke, sew, play cards, talk, nap, and so on. In other ships the -passengers are always ciphering about when they are going to arrive; out -in these seas it is rare, very rare, to hear that subject broached. In -other ships there is always an eager rush to the bulletin board at noon -to find out what the "run" has been; in these seas the bulletin seems to -attract no interest; I have seen no one visit it; in thirteen days I have -visited it only once. Then I happened to notice the figures of the day's -run. On that day there happened to be talk, at dinner, about the speed -of modern ships. I was the only passenger present who knew this ship's -gait. Necessarily, the Atlantic custom of betting on the ship's run is -not a custom here--nobody ever mentions it. - -I myself am wholly indifferent as to when we are going to "get in"; if -any one else feels interested in the matter he has not indicated it in my -hearing. If I had my way we should never get in at all. This sort of -sea life is charged with an indestructible charm. There is no weariness, -no fatigue, no worry, no responsibility, no work, no depression of -spirits. There is nothing like this serenity, this comfort, this peace, -this deep contentment, to be found anywhere on land. If I had my way I -would sail on for ever and never go to live on the solid ground again. - -One of Kipling's ballads has delivered the aspect and sentiment of this -bewitching sea correctly: - - "The Injian Ocean sets an' smiles - So sof', so bright, so bloomin' blue; - There aren't a wave for miles an' miles - Excep' the jiggle from the screw." - -April 14. It turns out that the astronomical apprentice worked off a -section of the Milky Way on me for the Magellan Clouds. A man of more -experience in the business showed one of them to me last night. It was -small and faint and delicate, and looked like the ghost of a bunch of -white smoke left floating in the sky by an exploded bombshell. - -Wednesday, April 15. Mauritius. Arrived and anchored off Port Louis -2 A. M. Rugged clusters of crags and peaks, green to their summits; from -their bases to the sea a green plain with just tilt enough to it to make -the water drain off. I believe it is in 56 E. and 22 S.--a hot tropical -country. The green plain has an inviting look; has scattering dwellings -nestling among the greenery. Scene of the sentimental adventure of Paul -and Virginia. - -Island under French control--which means a community which depends upon -quarantines, not sanitation, for its health. - -Thursday, April 16. Went ashore in the forenoon at Port Louis, a little -town, but with the largest variety of nationalities and complexions we -have encountered yet. French, English, Chinese, Arabs, Africans with -wool, blacks with straight hair, East Indians, half-whites, quadroons ---and great varieties in costumes and colors. - -Took the train for Curepipe at 1.30--two hours' run, gradually uphill. -What a contrast, this frantic luxuriance of vegetation, with the arid -plains of India; these architecturally picturesque crags and knobs and -miniature mountains, with the monotony of the Indian dead-levels. - -A native pointed out a handsome swarthy man of grave and dignified -bearing, and said in an awed tone, "That is so-and-so; has held office of -one sort or another under this government for 37 years--he is known all -over this whole island and in the other countries of the world perhaps ---who knows? One thing is certain; you can speak his name anywhere in this -whole island, and you will find not one grown person that has not heard -it. It is a wonderful thing to be so celebrated; yet look at him; it -makes no change in him; he does not even seem to know it." - -Curepipe (means Pincushion or Pegtown, probably). Sixteen miles (two -hours) by rail from Port Louis. At each end of every roof and on the -apex of every dormer window a wooden peg two feet high stands up; in some -cases its top is blunt, in others the peg is sharp and looks like a -toothpick. The passion for this humble ornament is universal. - -Apparently, there has been only one prominent event in the history of -Mauritius, and that one didn't happen. I refer to the romantic sojourn -of Paul and Virginia here. It was that story that made Mauritius known -to the world, made the name familiar to everybody, the geographical -position of it to nobody. - -A clergyman was asked to guess what was in a box on a table. It was a -vellum fan painted with the shipwreck, and was "one of Virginia's wedding -gifts." - -April 18. This is the only country in the world where the stranger is -not asked "How do you like this place?" This is indeed a large -distinction. Here the citizen does the talking about the country -himself; the stranger is not asked to help. You get all sorts of -information. From one citizen you gather the idea that Mauritius was -made first, and then heaven; and that heaven was copied after Mauritius. -Another one tells you that this is an exaggeration; that the two chief -villages, Port Louis and Curepipe, fall short of heavenly perfection; -that nobody lives in Port Louis except upon compulsion, and that Curepipe -is the wettest and rainiest place in the world. An English citizen said: - - "In the early part of this century Mauritius was used by the French - as a basis from which to operate against England's Indian - merchantmen; so England captured the island and also the neighbor, - Bourbon, to stop that annoyance. England gave Bourbon back; the - government in London did not want any more possessions in the West - Indies. If the government had had a better quality of geography in - stock it would not have wasted Bourbon in that foolish way. A big - war will temporarily shut up the Suez Canal some day and the English - ships will have to go to India around the Cape of Good Hope again; - then England will have to have Bourbon and will take it. - - "Mauritius was a crown colony until 20 years ago, with a governor - appointed by the Crown and assisted by a Council appointed by - himself; but Pope Hennessey came out as Governor then, and he worked - hard to get a part of the council made elective, and succeeded. So - now the whole council is French, and in all ordinary matters of - legislation they vote together and in the French interest, not the - English. The English population is very slender; it has not votes - enough to elect a legislator. Half a dozen rich French families - elect the legislature. Pope Hennessey was an Irishman, a Catholic, - a Home Ruler, M.P., a hater of England and the English, a very - troublesome person and a serious incumbrance at Westminster; so it - was decided to send him out to govern unhealthy countries, in hope - that something would happen to him. But nothing did. The first - experiment was not merely a failure, it was more than a failure. He - proved to be more of a disease himself than any he was sent to - encounter. The next experiment was here. The dark scheme failed - again. It was an off-season and there was nothing but measles here - at the time. Pope Hennessey's health was not affected. He worked - with the French and for the French and against the English, and he - made the English very tired and the French very happy, and lived to - have the joy of seeing the flag he served publicly hissed. His - memory is held in worshipful reverence and affection by the French. - - "It is a land of extraordinary quarantines. They quarantine a ship - for anything or for nothing; quarantine her for 20 and even 30 days. - They once quarantined a ship because her captain had had the - smallpox when he was a boy. That and because he was English. - - "The population is very small; small to insignificance. The - majority is East Indian; then mongrels; then negroes (descendants of - the slaves of the French times); then French; then English. There - was an American, but he is dead or mislaid. The mongrels are the - result of all kinds of mixtures; black and white, mulatto and white, - quadroon and white, octoroon and white. And so there is every shade - of complexion; ebony, old mahogany, horsechestnut, sorrel, - molasses-candy, clouded amber, clear amber, old-ivory white, - new-ivory white, fish-belly white--this latter the leprous complexion - frequent with the Anglo-Saxon long resident in tropical climates. - - "You wouldn't expect a person to be proud of being a Mauritian, now - would you? But it is so. The most of them have never been out of - the island, and haven't read much or studied much, and they think - the world consists of three principal countries--Judaea, France, and - Mauritius; so they are very proud of belonging to one of the three - grand divisions of the globe. They think that Russia and Germany - are in England, and that England does not amount to much. They have - heard vaguely about the United States and the equator, but they - think both of them are monarchies. They think Mount Peter Botte is - the highest mountain in the world, and if you show one of them a - picture of Milan Cathedral he will swell up with satisfaction and - say that the idea of that jungle of spires was stolen from the - forest of peg-tops and toothpicks that makes the roofs of Curepipe - look so fine and prickly. - - "There is not much trade in books. The newspapers educate and - entertain the people. Mainly the latter. They have two pages of - large-print reading-matter-one of them English, the other French. - The English page is a translation of the French one. The typography - is super-extra primitive--in this quality it has not its equal - anywhere. There is no proof-reader now; he is dead. - - "Where do they get matter to fill up a page in this little island - lost in the wastes of the Indian Ocean? Oh, Madagascar. They - discuss Madagascar and France. That is the bulk. Then they chock - up the rest with advice to the Government. Also, slurs upon the - English administration. The papers are all owned and edited by - creoles--French. - - "The language of the country is French. Everybody speaks it--has - to. You have to know French particularly mongrel French, the patois - spoken by Tom, Dick, and Harry of the multiform complexions--or you - can't get along. - -"This was a flourishing country in former days, for it made then and -still makes the best sugar in the world; but first the Suez Canal severed -it from the world and left it out in the cold and next the beetroot sugar -helped by bounties, captured the European markets. Sugar is the life of -Mauritius, and it is losing its grip. Its downward course was checked by -the depreciation of the rupee--for the planter pays wages in rupees but -sells his crop for gold--and the insurrection in Cuba and paralyzation of -the sugar industry there have given our prices here a life-saving lift; -but the outlook has nothing permanently favorable about it. It takes a -year to mature the canes--on the high ground three and six months longer ---and there is always a chance that the annual cyclone will rip the -profit out of the crop. In recent times a cyclone took the whole crop, -as you may say; and the island never saw a finer one. Some of the -noblest sugar estates in the island are in deep difficulties. A dozen of -them are investments of English capital; and the companies that own them -are at work now, trying to settle up and get out with a saving of half -the money they put in. You know, in these days, when a country begins to -introduce the tea culture, it means that its own specialty has gone back -on it. Look at Bengal; look at Ceylon. Well, they've begun to introduce -the tea culture, here. - -"Many copies of Paul and Virginia are sold every year in Mauritius. No -other book is so popular here except the Bible. By many it is supposed -to be a part of the Bible. All the missionaries work up their French on -it when they come here to pervert the Catholic mongrel. It is the -greatest story that was ever written about Mauritius, and the only one." - - - - -CHAPTER LXIII. - -The principal difference between a cat and a lie is that the cat has only -nine lives. - --Pudd'nhead Wilson's New Calendar. - -April 20.--The cyclone of 1892 killed and crippled hundreds of people; -it was accompanied by a deluge of rain, which drowned Port Louis and -produced a water famine. Quite true; for it burst the reservoir and the -water-pipes; and for a time after the flood had disappeared there was -much distress from want of water. - -This is the only place in the world where no breed of matches can stand -the damp. Only one match in 16 will light. - -The roads are hard and smooth; some of the compounds are spacious, some -of the bungalows commodious, and the roadways are walled by tall bamboo -hedges, trim and green and beautiful; and there are azalea hedges, too, -both the white and the red; I never saw that before. - -As to healthiness: I translate from to-day's (April 20) Merchants' and -Planters' Gazette, from the article of a regular contributor, "Carminge," -concerning the death of the nephew of a prominent citizen: - - "Sad and lugubrious existence, this which we lead in Mauritius; I - believe there is no other country in the world where one dies more - easily than among us. The least indisposition becomes a mortal - malady; a simple headache develops into meningitis; a cold into - pneumonia, and presently, when we are least expecting it, death is a - guest in our home." - -This daily paper has a meteorological report which tells you what the -weather was day before yesterday. - -One is clever pestered by a beggar or a peddler in this town, so far as I -can see. This is pleasantly different from India. - -April 22. To such as believe that the quaint product called French -civilization would be an improvement upon the civilization of New Guinea -and the like, the snatching of Madagascar and the laying on of French -civilization there will be fully justified. But why did the English -allow the French to have Madagascar? Did she respect a theft of a couple -of centuries ago? Dear me, robbery by European nations of each other's -territories has never been a sin, is not a sin to-day. To the several -cabinets the several political establishments of the world are -clotheslines; and a large part of the official duty of these cabinets is -to keep an eye on each other's wash and grab what they can of it as -opportunity offers. All the territorial possessions of all the political -establishments in the earth--including America, of course--consist of -pilferings from other people's wash. No tribe, howsoever insignificant, -and no nation, howsoever mighty, occupies a foot of land that was not -stolen. When the English, the French, and the Spaniards reached America, -the Indian tribes had been raiding each other's territorial clothes-lines -for ages, and every acre of ground in the continent had been stolen and -re-stolen 500 times. The English, the French, and the Spaniards went to -work and stole it all over again; and when that was satisfactorily -accomplished they went diligently to work and stole it from each other. -In Europe and Asia and Africa every acre of ground has been stolen -several millions of times. A crime persevered in a thousand centuries -ceases to be a crime, and becomes a virtue. This is the law of custom, -and custom supersedes all other forms of law. Christian governments are -as frank to-day, as open and above-board, in discussing projects for -raiding each other's clothes-lines as ever they were before the Golden -Rule came smiling into this inhospitable world and couldn't get a night's -lodging anywhere. In 150 years England has beneficently retired garment -after garment from the Indian lines, until there is hardly a rag of the -original wash left dangling anywhere. In 800 years an obscure -tribe of Muscovite savages has risen to the dazzling position of -Land-Robber-in-Chief; she found a quarter of the world hanging out to dry -on a hundred parallels of latitude, and she scooped in the whole wash. -She keeps a sharp eye on a multitude of little lines that stretch along -the northern boundaries of India, and every now and then she snatches a -hip-rag or a pair of pyjamas. It is England's prospective property, and -Russia knows it; but Russia cares nothing for that. In fact, in our day -land-robbery, claim-jumping, is become a European governmental frenzy. -Some have been hard at it in the borders of China, in Burma, in Siam, and -the islands of the sea; and all have been at it in Africa. Africa has -been as coolly divided up and portioned out among the gang as if they had -bought it and paid for it. And now straightway they are beginning the -old game again --to steal each other's grabbings. Germany found a vast -slice of Central Africa with the English flag and the English missionary -and the English trader scattered all over it, but with certain -formalities neglected--no signs up, "Keep off the grass," -"Trespassers-forbidden," etc.--and she stepped in with a cold calm smile -and put up the signs herself, and swept those English pioneers promptly -out of the country. - -There is a tremendous point there. It can be put into the form of a -maxim: Get your formalities right--never mind about the moralities. - -It was an impudent thing; but England had to put up with it. Now, in the -case of Madagascar, the formalities had originally been observed, but by -neglect they had fallen into desuetude ages ago. England should have -snatched Madagascar from the French clothes-line. Without an effort she -could have saved those harmless natives from the calamity of French -civilization, and she did not do it. Now it is too late. - -The signs of the times show plainly enough what is going to happen. All -the savage lands in the world are going to be brought under subjection to -the Christian governments of Europe. I am not sorry, but glad. This -coming fate might have been a calamity to those savage peoples two -hundred years ago; but now it will in some cases be a benefaction. The -sooner the seizure is consummated, the better for the savages. - -The dreary and dragging ages of bloodshed and disorder and oppression -will give place to peace and order and the reign of law. When one -considers what India was under her Hindoo and Mohammedan rulers, and what -she is now; when he remembers the miseries of her millions then and the -protections and humanities which they enjoy now, he must concede that the -most fortunate thing that has ever befallen that empire was the -establishment of British supremacy there. The savage lands of the world -are to pass to alien possession, their peoples to the mercies of alien -rulers. Let us hope and believe that they will all benefit by the -change. - -April 23. "The first year they gather shells; the second year they -gather shells and drink; the third year they do not gather shells." (Said -of immigrants to Mauritius.) - -Population 375,000. 120 sugar factories. - -Population 1851, 185,000. The increase is due mainly to the introduction -of Indian coolies. They now apparently form the great majority of the -population. They are admirable breeders; their homes are always hazy -with children. Great savers of money. A British officer told me that in -India he paid his servant 10 rupees a month, and he had 11 cousins, -uncles, parents, etc., dependent upon him, and he supported them on his -wages. These thrifty coolies are said to be acquiring land a trifle at a -time, and cultivating it; and may own the island by and by. - -The Indian women do very hard labor [for wages of (1/2 rupee) for twelve -hours' work.] They carry mats of sugar on their heads (70 pounds) all -day lading ships, for half a rupee, and work at gardening all day for -less. - -The camaron is a fresh water creature like a cray-fish. It is regarded -here as the world's chiefest delicacy--and certainly it is good. Guards -patrol the streams to prevent poaching it. A fine of Rs.200 or 300 -(they say) for poaching. Bait is thrown in the water; the camaron goes -for it; the fisher drops his loop in and works it around and about the -camaron he has selected, till he gets it over its tail; then there's a -jerk or something to certify the camaron that it is his turn now; he -suddenly backs away, which moves the loop still further up his person and -draws it taut, and his days are ended. - -Another dish, called palmiste, is like raw turnip-shavings and tastes -like green almonds; is very delicate and good. Costs the life of a palm -tree 12 to 20 years old--for it is the pith. - -Another dish--looks like greens or a tangle of fine seaweed--is a -preparation of the deadly nightshade. Good enough. - -The monkeys live in the dense forests on the flanks of the toy mountains, -and they flock down nights and raid the sugar-fields. Also on other -estates they come down and destroy a sort of bean-crop--just for fun, -apparently--tear off the pods and throw them down. - -The cyclone of 1892 tore down two great blocks of stone buildings in the -center of Port Louis--the chief architectural feature-and left the -uncomely and apparently frail blocks standing. Everywhere in its track -it annihilated houses, tore off roofs, destroyed trees and crops. The -men were in the towns, the women and children at home in the country -getting crippled, killed, frightened to insanity; and the rain deluging -them, the wind howling, the thunder crashing, the lightning glaring. -This for an hour or so. Then a lull and sunshine; many ventured out of -safe shelter; then suddenly here it came again from the opposite point -and renewed and completed the devastation. It is said the Chinese fed -the sufferers for days on free rice. - -Whole streets in Port Louis were laid flat--wrecked. During a minute and -a half the wind blew 123 miles an hour; no official record made after -that, when it may have reached 150. It cut down an obelisk. It carried -an American ship into the woods after breaking the chains of two anchors. -They now use four-two forward, two astern. Common report says it killed -1,200 in Port Louis alone, in half an hour. Then came the lull of the -central calm--people did not know the barometer was still going down ---then suddenly all perdition broke loose again while people were rushing -around seeking friends and rescuing the wounded. The noise was -comparable to nothing; there is nothing resembling it but thunder and -cannon, and these are feeble in comparison. - -What there is of Mauritius is beautiful. You have undulating wide -expanses of sugar-cane--a fine, fresh green and very pleasant to the eye; -and everywhere else you have a ragged luxuriance of tropic vegetation of -vivid greens of varying shades, a wild tangle of underbrush, with -graceful tall palms lifting their crippled plumes high above it; and you -have stretches of shady dense forest with limpid streams frolicking -through them, continually glimpsed and lost and glimpsed again in the -pleasantest hide-and-seek fashion; and you have some tiny mountains, -some quaint and picturesque groups of toy peaks, and a dainty little -vest-pocket Matterhorn; and here and there and now and then a strip of -sea with a white ruffle of surf breaks into the view. - -That is Mauritius; and pretty enough. The details are few, the massed -result is charming, but not imposing; not riotous, not exciting; it is a -Sunday landscape. Perspective, and the enchantments wrought by distance, -are wanting. There are no distances; there is no perspective, so to -speak. Fifteen miles as the crow flies is the usual limit of vision. -Mauritius is a garden and a park combined. It affects one's emotions as -parks and gardens affect them. The surfaces of one's spiritual deeps are -pleasantly played upon, the deeps themselves are not reached, not -stirred. Spaciousness, remote altitudes, the sense of mystery which -haunts apparently inaccessible mountain domes and summits reposing in the -sky--these are the things which exalt the spirit and move it to see -visions and dream dreams. - -The Sandwich Islands remain my ideal of the perfect thing in the matter -of tropical islands. I would add another story to Mauna Loa's 16,000 -feet if I could, and make it particularly bold and steep and craggy and -forbidding and snowy; and I would make the volcano spout its lava-floods -out of its summit instead of its sides; but aside from these -non-essentials I have no corrections to suggest. I hope these will be -attended to; I do not wish to have to speak of it again. - - - - -CHAPTER LXIV. - -When your watch gets out of order you have choice of two things to do: -throw it in the fire or take it to the watch-tinker. The former is the -quickest. - --Pudd'nhead Wilson's New Calendar. - -The Arundel Castle is the finest boat I have seen in these seas. She is -thoroughly modern, and that statement covers a great deal of ground. She -has the usual defect, the common defect, the universal defect, the defect -that has never been missing from any ship that ever sailed--she has -imperfect beds. Many ships have good beds, but no ship has very good -ones. In the matter of beds all ships have been badly edited, ignorantly -edited, from the beginning. The selection of the beds is given to some -hearty, strong-backed, self-made man, when it ought to be given to a -frail woman accustomed from girlhood to backaches and insomnia. Nothing -is so rare, on either side of the ocean, as a perfect bed; nothing is so -difficult to make. Some of the hotels on both sides provide it, but no -ship ever does or ever did. In Noah's Ark the beds were simply -scandalous. Noah set the fashion, and it will endure in one degree of -modification or another till the next flood. - -8 A.M. Passing Isle de Bourbon. Broken-up sky-line of volcanic -mountains in the middle. Surely it would not cost much to repair them, -and it seems inexcusable neglect to leave them as they are. - -It seems stupid to send tired men to Europe to rest. It is no proper -rest for the mind to clatter from town to town in the dust and cinders, -and examine galleries and architecture, and be always meeting people and -lunching and teaing and dining, and receiving worrying cables and -letters. And a sea voyage on the Atlantic is of no use--voyage too -short, sea too rough. The peaceful Indian and Pacific Oceans and the -long stretches of time are the healing thing. - -May 2, AM. A fair, great ship in sight, almost the first we have seen in -these weeks of lonely voyaging. We are now in the Mozambique Channel, -between Madagascar and South Africa, sailing straight west for Delagoa -Bay. - -Last night, the burly chief engineer, middle-aged, was standing telling a -spirited seafaring tale, and had reached the most exciting place, where a -man overboard was washing swiftly astern on the great seas, and uplifting -despairing cries, everybody racing aft in a frenzy of excitement and -fading hope, when the band, which had been silent a moment, began -impressively its closing piece, the English national anthem. As simply -as if he was unconscious of what he was doing, he stopped his story, -uncovered, laid his laced cap against his breast, and slightly bent his -grizzled head. The few bars finished, he put on his cap and took up his -tale again, as naturally as if that interjection of music had been a part -of it. There was something touching and fine about it, and it was moving -to reflect that he was one of a myriad, scattered over every part of the -globe, who by turn was doing as he was doing every hour of the -twenty-four--those awake doing it while the others slept--those -impressive bars forever floating up out of the various climes, never -silent and never lacking reverent listeners. - -All that I remember about Madagascar is that Thackeray's little Billie -went up to the top of the mast and there knelt him upon his knee, saying, -"I see - - "Jerusalem and Madagascar, - And North and South Amerikee." - -May 3. Sunday. Fifteen or twenty Africanders who will end their voyage -to-day and strike for their several homes from Delagoa Bay to-morrow, sat -up singing on the afterdeck in the moonlight till 3 A.M. Good fun and -wholesome. And the songs were clean songs, and some of them were -hallowed by tender associations. Finally, in a pause, a man asked, "Have -you heard about the fellow that kept a diary crossing the Atlantic?" -It was a discord, a wet blanket. The men were not in the mood for -humorous dirt. The songs had carried them to their homes, and in spirit -they sat by those far hearthstones, and saw faces and heard voices other -than those that were about them. And so this disposition to drag in an -old indecent anecdote got no welcome; nobody answered. The poor man -hadn't wit enough to see that he had blundered, but asked his question -again. Again there was no response. It was embarrassing for him. In -his confusion he chose the wrong course, did the wrong thing--began the -anecdote. Began it in a deep and hostile stillness, where had been such -life and stir and warm comradeship before. He delivered himself of the -brief details of the diary's first day, and did it with some confidence -and a fair degree of eagerness. It fell flat. There was an awkward -pause. The two rows of men sat like statues. There was no movement, no -sound. He had to go on; there was no other way, at least none that an -animal of his calibre could think of. At the close of each day's diary, -the same dismal silence followed. When at last he finished his tale and -sprung the indelicate surprise which is wont to fetch a crash of -laughter, not a ripple of sound resulted. It was as if the tale had been -told to dead men. After what seemed a long, long time, somebody sighed, -somebody else stirred in his seat; presently, the men dropped into a low -murmur of confidential talk, each with his neighbor, and the incident was -closed. There were indications that that man was fond of his anecdote; -that it was his pet, his standby, his shot that never missed, his -reputation-maker. But he will never tell it again. No doubt he will -think of it sometimes, for that cannot well be helped; and then he will -see a picture, and always the same picture--the double rank of dead men; -the vacant deck stretching away in dimming perspective beyond them, the -wide desert of smooth sea all abroad; the rim of the moon spying from -behind a rag of black cloud; the remote top of the mizzenmast shearing a -zigzag path through the fields of stars in the deeps of space; and this -soft picture will remind him of the time that he sat in the midst of it -and told his poor little tale and felt so lonesome when he got through. - -Fifty Indians and Chinamen asleep in a big tent in the waist of the ship -forward; they lie side by side with no space between; the former wrapped -up, head and all, as in the Indian streets, the Chinamen uncovered; the -lamp and things for opium smoking in the center. - -A passenger said it was ten 2-ton truck loads of dynamite that lately -exploded at Johannesburg. Hundreds killed; he doesn't know how many; -limbs picked up for miles around. Glass shattered, and roofs swept away -or collapsed 200 yards off; fragment of iron flung three and a half -miles. - -It occurred at 3 p.m.; at 6, L65,000 had been subscribed. When this -passenger left, L35,000 had been voted by city and state governments and -L100,000 by citizens and business corporations. When news of the -disaster was telephoned to the Exchange L35,000 were subscribed in the -first five minutes. Subscribing was still going on when he left; the -papers had ceased the names, only the amounts--too many names; not enough -room. L100,000 subscribed by companies and citizens; if this is true, it -must be what they call in Australia "a record"--the biggest instance of a -spontaneous outpour for charity in history, considering the size of the -population it was drawn from, $8 or $10 for each white resident, babies -at the breast included. - -Monday, May 4. Steaming slowly in the stupendous Delagoa Bay, its dim -arms stretching far away and disappearing on both sides. It could -furnish plenty of room for all the ships in the world, but it is shoal. -The lead has given us 3 1/2 fathoms several times and we are drawing -that, lacking 6 inches. - -A bold headland--precipitous wall, 150 feet high, very strong, red color, -stretching a mile or so. A man said it was Portuguese blood--battle -fought here with the natives last year. I think this doubtful. Pretty -cluster of houses on the tableland above the red-and rolling stretches of -grass and groups of trees, like England. - -The Portuguese have the railroad (one passenger train a day) to the -border--70 miles--then the Netherlands Company have it. Thousands of -tons of freight on the shore--no cover. This is Portuguese allover ---indolence, piousness, poverty, impotence. - -Crews of small boats and tugs, all jet black woolly heads and very -muscular. - -Winter. The South African winter is just beginning now, but nobody but -an expert can tell it from summer. However, I am tired of summer; we -have had it unbroken for eleven months. We spent the afternoon on shore, -Delagoa Bay. A small town--no sights. No carriages. Three 'rickshas, -but we couldn't get them--apparently private. These Portuguese are a -rich brown, like some of the Indians. Some of the blacks have the long -horse beads and very long chins of the negroes of the picture books; but -most of them are exactly like the negroes of our Southern States round -faces, flat noses, good-natured, and easy laughers. - -Flocks of black women passed along, carrying outrageously heavy bags of -freight on their heads. The quiver of their leg as the foot was planted -and the strain exhibited by their bodies showed what a tax upon their -strength the load was. They were stevedores and doing full stevedores -work. They were very erect when unladden--from carrying heavy loads on -their heads--just like the Indian women. It gives them a proud fine -carriage. - -Sometimes one saw a woman carrying on her head a laden and top-heavy -basket the shape of an inverted pyramid-its top the size of a soup-plate, -its base the diameter of a teacup. It required nice balancing--and got -it. - -No bright colors; yet there were a good many Hindoos. - -The Second Class Passenger came over as usual at "lights out" (11) and we -lounged along the spacious vague solitudes of the deck and smoked the -peaceful pipe and talked. He told me an incident in Mr. Barnum's life -which was evidently characteristic of that great showman in several ways: - -This was Barnum's purchase of Shakespeare's birthplace, a quarter of a -century ago. The Second Class Passenger was in Jamrach's employ at the -time and knew Barnum well. He said the thing began in this way. One -morning Barnum and Jamrach were in Jamrach's little private snuggery back -of the wilderness of caged monkeys and snakes and other commonplaces of -Jamrach's stock in trade, refreshing themselves after an arduous stroke -of business, Jamrach with something orthodox, Barnum with something -heterodox--for Barnum was a teetotaler. The stroke of business was in -the elephant line. Jamrach had contracted to deliver to Barnum in New -York 18 elephants for $360,000 in time for the next season's opening. -Then it occurred to Mr. Barnum that he needed a "card" He suggested -Jumbo. Jamrach said he would have to think of something else--Jumbo -couldn't be had; the Zoo wouldn't part with that elephant. Barnum said -he was willing to pay a fortune for Jumbo if he could get him. Jamrach -said it was no use to think about it; that Jumbo was as popular as the -Prince of Wales and the Zoo wouldn't dare to sell him; all England would -be outraged at the idea; Jumbo was an English institution; he was part of -the national glory; one might as well think of buying the Nelson -monument. Barnum spoke up with vivacity and said: - -"It's a first-rate idea. I'll buy the Monument." - -Jamrach was speechless for a second. Then he said, like one ashamed -"You caught me. I was napping. For a moment I thought you were in -earnest." - -Barnum said pleasantly-- - -"I was in earnest. I know they won't sell it, but no matter, I will not -throw away a good idea for all that. All I want is a big advertisement. -I will keep the thing in mind, and if nothing better turns up I will -offer to buy it. That will answer every purpose. It will furnish me a -couple of columns of gratis advertising in every English and American -paper for a couple of months, and give my show the biggest boom a show -ever had in this world." - -Jamrach started to deliver a burst of admiration, but was interrupted by -Barnum, who said: - -"Here is a state of things! England ought to blush." - -His eye had fallen upon something in the newspaper. He read it through -to himself, then read it aloud. It said that the house that Shakespeare -was born in at Stratford-on-Avon was falling gradually to ruin through -neglect; that the room where the poet first saw the light was now serving -as a butcher's shop; that all appeals to England to contribute money (the -requisite sum stated) to buy and repair the house and place it in the -care of salaried and trustworthy keepers had fallen resultless. Then -Barnum said: - -"There's my chance. Let Jumbo and the Monument alone for the present ---they'll keep. I'll buy Shakespeare's house. I'll set it up in my -Museum in New York and put a glass case around it and make a sacred thing -of it; and you'll see all America flock there to worship; yes, and -pilgrims from the whole earth; and I'll make them take their hats off, -too. In America we know how to value anything that Shakespeare's touch -has made holy. You'll see." - -In conclusion the S. C. P. said: - -"That is the way the thing came about. Barnum did buy Shakespeare's -house. He paid the price asked, and received the properly attested -documents of sale. Then there was an explosion, I can tell you. England -rose! That, the birthplace of the master-genius of all the ages and all -the climes--that priceless possession of Britain--to be carted out of the -country like so much old lumber and set up for sixpenny desecration in a -Yankee show-shop--the idea was not to be tolerated for a moment. England -rose in her indignation; and Barnum was glad to relinquish his prize and -offer apologies. However, he stood out for a compromise; he claimed a -concession--England must let him have Jumbo. And England consented, but -not cheerfully." - -It shows how, by help of time, a story can grow--even after Barnum has -had the first innings in the telling of it. Mr. Barnum told me the story -himself, years ago. He said that the permission to buy Jumbo was not a -concession; the purchase was made and the animal delivered before the -public knew anything about it. Also, that the securing of Jumbo was all -the advertisement he needed. It produced many columns of newspaper talk, -free of cost, and he was satisfied. He said that if he had failed to get -Jumbo he would have caused his notion of buying the Nelson Monument to be -treacherously smuggled into print by some trusty friend, and after he had -gotten a few hundred pages of gratuitous advertising out of it, he would -have come out with a blundering, obtuse, but warm-hearted letter of -apology, and in a postscript to it would have naively proposed to let the -Monument go, and take Stonehenge in place of it at the same price. - -It was his opinion that such a letter, written with well-simulated -asinine innocence and gush would have gotten his ignorance and stupidity -an amount of newspaper abuse worth six fortunes to him, and not -purchasable for twice the money. - -I knew Mr. Barnum well, and I placed every confidence in the account -which he gave me of the Shakespeare birthplace episode. He said he found -the house neglected and going-to decay, and he inquired into the matter -and was told that many times earnest efforts had been made to raise money -for its proper repair and preservation, but without success. He then -proposed to buy it. The proposition was entertained, and a price named ---$50,000, I think; but whatever it was, Barnum paid the money down, -without remark, and the papers were drawn up and executed. He said that -it had been his purpose to set up the house in his Museum, keep it in -repair, protect it from name-scribblers and other desecrators, and leave -it by bequest to the safe and perpetual guardianship of the Smithsonian -Institute at Washington. - -But as soon as it was found that Shakespeare's house had passed into -foreign hands and was going to be carried across the ocean, England was -stirred as no appeal from the custodians of the relic had ever stirred -England before, and protests came flowing in--and money, too, to stop the -outrage. Offers of repurchase were made--offers of double the money that -Mr. Barnum had paid for the house. He handed the house back, but took -only the sum which it had cost him--but on the condition that an -endowment sufficient for the future safeguarding and maintenance of the -sacred relic should be raised. This condition was fulfilled. - -That was Barnum's account of the episode; and to the end of his days he -claimed with pride and satisfaction that not England, but America ---represented by him--saved the birthplace of Shakespeare from destruction. - -At 3 P.M., May 6th, the ship slowed down, off the land, and thoughtfully -and cautiously picked her way into the snug harbor of Durban, South -Africa. - - - - -CHAPTER LXV. - -In statesmanship get the formalities right, never mind about the -moralities. - --Pudd'nhead Wilson's New Calendar. - -FROM DIARY: - -Royal Hotel. Comfortable, good table, good service of natives and -Madrasis. Curious jumble of modern and ancient city and village, -primitiveness and the other thing. Electric bells, but they don't ring. -Asked why they didn't, the watchman in the office said he thought they -must be out of order; he thought so because some of them rang, but most -of them didn't. Wouldn't it be a good idea to put them in order? He -hesitated--like one who isn't quite sure--then conceded the point. - -May 7. A bang on the door at 6. Did I want my boots cleaned? Fifteen -minutes later another bang. Did we want coffee? Fifteen later, bang -again, my wife's bath ready; 15 later, my bath ready. Two other bangs; -I forget what they were about. Then lots of shouting back and forth, -among the servants just as in an Indian hotel. - -Evening. At 4 P.M. it was unpleasantly warm. Half-hour after sunset -one needed a spring overcoat; by 8 a winter one. - -Durban is a neat and clean town. One notices that without having his -attention called to it. - -Rickshaws drawn by splendidly built black Zulus, so overflowing with -strength, seemingly, that it is a pleasure, not a pain, to see them -snatch a rickshaw along. They smile and laugh and show their teeth--a -good-natured lot. Not allowed to drink; 2s per hour for one person; 3s -for two; 3d for a course--one person. - -The chameleon in the hotel court. He is fat and indolent and -contemplative; but is business-like and capable when a fly comes about ---reaches out a tongue like a teaspoon and takes him in. He gums his -tongue first. He is always pious, in his looks. And pious and thankful -both, when Providence or one of us sends him a fly. He has a froggy -head, and a back like a new grave--for shape; and hands like a bird's -toes that have been frostbitten. But his eyes are his exhibition -feature. A couple of skinny cones project from the sides of his head, -with a wee shiny bead of an eye set in the apex of each; and these cones -turn bodily like pivot-guns and point every-which-way, and they are -independent of each other; each has its own exclusive machinery. When I -am behind him and C. in front of him, he whirls one eye rearwards and the -other forwards--which gives him a most Congressional expression (one eye -on the constituency and one on the swag); and then if something happens -above and below him he shoots out one eye upward like a telescope and the -other downward--and this changes his expression, but does not improve it. - -Natives must not be out after the curfew bell without a pass. In Natal -there are ten blacks to one white. - -Sturdy plump creatures are the women. They comb their wool up to a peak -and keep it in position by stiffening it with brown-red clay--half of -this tower colored, denotes engagement; the whole of it colored denotes -marriage. - -None but heathen Zulus on the police; Christian ones not allowed. - -May 9. A drive yesterday with friends over the Berea. Very fine roads -and lofty, overlooking the whole town, the harbor, and the sea-beautiful -views. Residences all along, set in the midst of green lawns with shrubs -and generally one or two intensely red outbursts of poinsettia--the -flaming splotch of blinding red a stunning contrast with the world of -surrounding green. The cactus tree--candelabrum-like; and one twisted -like gray writhing serpents. The "flat-crown" (should be flat-roof) ---half a dozen naked branches full of elbows, slant upward like artificial -supports, and fling a roof of delicate foliage out in a horizontal -platform as flat as a floor; and you look up through this thin floor as -through a green cobweb or veil. The branches are japanesich. All about -you is a bewildering variety of unfamiliar and beautiful trees; one sort -wonderfully dense foliage and very dark green--so dark that you notice it -at once, notwithstanding there are so many orange trees. The -"flamboyant"--not in flower, now, but when in flower lives up to its -name, we are told. Another tree with a lovely upright tassel scattered -among its rich greenery, red and glowing as a firecoal. Here and there a -gum-tree; half a dozen lofty Norfolk Island pines lifting their fronded -arms skyward. Groups of tall bamboo. - -Saw one bird. Not many birds here, and they have no music--and the -flowers not much smell, they grow so fast. - -Everything neat and trim and clean like the town. The loveliest trees -and the greatest variety I have ever seen anywhere, except approaching -Darjeeling. Have not heard anyone call Natal the garden of South Africa, -but that is what it probably is. - -It was when Bishop of Natal that Colenso raised such a storm in the -religious world. The concerns of religion are a vital matter here yet. -A vigilant eye is kept upon Sunday. Museums and other dangerous resorts -are not allowed to be open. You may sail on the Bay, but it is wicked to -play cricket. For a while a Sunday concert was tolerated, upon condition -that it must be admission free and the money taken by collection. But -the collection was alarmingly large and that stopped the matter. They -are particular about babies. A clergyman would not bury a child -according to the sacred rites because it had not been baptized. The -Hindoo is more liberal. He burns no child under three, holding that it -does not need purifying. - -The King of the Zulus, a fine fellow of 30, was banished six years ago -for a term of seven years. He is occupying Napoleon's old stand--St. -Helena. The people are a little nervous about having him come back, and -they may well be, for Zulu kings have been terrible people sometimes ---like Tchaka, Dingaan, and Cetewayo. - -There is a large Trappist monastery two hours from Durban, over the -country roads, and in company with Mr. Milligan and Mr. Hunter, general -manager of the Natal government railways, who knew the heads of it, we -went out to see it. - -There it all was, just as one reads about it in books and cannot believe -that it is so--I mean the rough, hard work, the impossible hours, the -scanty food, the coarse raiment, the Maryborough beds, the tabu of human -speech, of social intercourse, of relaxation, of amusement, of -entertainment, of the presence of woman in the men's establishment. -There it all was. It was not a dream, it was not a lie. And yet with -the fact before one's face it was still incredible. It is such a -sweeping suppression of human instincts, such an extinction of the man as -an individual. - -La Trappe must have known the human race well. The scheme which he -invented hunts out everything that a man wants and values--and withholds -it from him. Apparently there is no detail that can help make life worth -living that has not been carefully ascertained and placed out of the -Trappist's reach. La Trappe must have known that there were men who -would enjoy this kind of misery, but how did he find it out? - -If he had consulted you or me he would have been told that his scheme -lacked too many attractions; that it was impossible; that it could never -be floated. But there in the monastery was proof that he knew the human -race better than it knew itself. He set his foot upon every desire that -a man has--yet he floated his project, and it has prospered for two -hundred years, and will go on prospering forever, no doubt. - -Man likes personal distinction--there in the monastery it is obliterated. -He likes delicious food--there he gets beans and bread and tea, and not -enough of it. He likes to lie softly--there he lies on a sand mattress, -and has a pillow and a blanket, but no sheet. When he is dining, in a -great company of friends, he likes to laugh and chat--there a monk reads -a holy book aloud during meals, and nobody speaks or laughs. When a man -has a hundred friends about him, evenings, be likes to have a good time -and run late--there he and the rest go silently to bed at 8; and in the -dark, too; there is but a loose brown robe to discard, there are no -night-clothes to put on, a light is not needed. Man likes to lie abed -late there he gets up once or twice in the night to perform some -religious office, and gets up finally for the day at two in the morning. -Man likes light work or none at all--there he labors all day in the -field, or in the blacksmith shop or the other shops devoted to the -mechanical trades, such as shoemaking, saddlery, carpentry, and so on. -Man likes the society of girls and women--there he never has it. He -likes to have his children about him, and pet them and play with them ---there he has none. He likes billiards--there is no table there. He -likes outdoor sports and indoor dramatic and musical and social -entertainments--there are none there. He likes to bet on things--I was -told that betting is forbidden there. When a man's temper is up he likes -to pour it out upon somebody there this is not allowed. A man likes -animals--pets; there are none there. He likes to smoke--there he cannot -do it. He likes to read the news--no papers or magazines come there. A -man likes to know how his parents and brothers and sisters are getting -along when he is away, and if they miss him--there he cannot know. A man -likes a pretty house, and pretty furniture, and pretty things, and pretty -colors--there he has nothing but naked aridity and sombre colors. A man -likes--name it yourself: whatever it is, it is absent from that place. - -From what I could learn, all that a man gets for this is merely the -saving of his soul. - -It all seems strange, incredible, impossible. But La Trappe knew the -race. He knew the powerful attraction of unattractiveness; he knew that -no life could be imagined, howsoever comfortless and forbidding, but -somebody would want to try it. - -This parent establishment of Germans began its work fifteen years ago, -strangers, poor, and unencouraged; it owns 15,000 acres of land now, and -raises grain and fruit, and makes wines, and manufactures all manner of -things, and has native apprentices in its shops, and sends them forth -able to read and write, and also well equipped to earn their living by -their trades. And this young establishment has set up eleven branches in -South Africa, and in them they are christianizing and educating and -teaching wage-yielding mechanical trades to 1,200 boys and girls. -Protestant Missionary work is coldly regarded by the commercial white -colonist all over the heathen world, as a rule, and its product is -nicknamed "rice-Christians" (occupationless incapables who join the -church for revenue only), but I think it would be difficult to pick a -flaw in the work of these Catholic monks, and I believe that the -disposition to attempt it has not shown itself. - -Tuesday, May 12. Transvaal politics in a confused condition. First the -sentencing of the Johannesburg Reformers startled England by its -severity; on the top of this came Kruger's exposure of the cipher -correspondence, which showed that the invasion of the Transvaal, with the -design of seizing that country and adding it to the British Empire, was -planned by Cecil Rhodes and Beit--which made a revulsion in English -feeling, and brought out a storm against Rhodes and the Chartered Company -for degrading British honor. For a good while I couldn't seem to get at -a clear comprehension of it, it was so tangled. But at last by patient -study I have managed it, I believe. As I understand it, the Uitlanders -and other Dutchmen were dissatisfied because the English would not allow -them to take any part in the government except to pay taxes. Next, as I -understand it, Dr. Kruger and Dr. Jameson, not having been able to make -the medical business pay, made a raid into Matabeleland with the -intention of capturing the capital, Johannesburg, and holding the women -and children to ransom until the Uitlanders and the other Boers should -grant to them and the Chartered Company the political rights which had -been withheld from them. They would have succeeded in this great scheme, -as I understand it, but for the interference of Cecil Rhodes and Mr. -Beit, and other Chiefs of the Matabele, who persuaded their countrymen to -revolt and throw off their allegiance to Germany. This, in turn, as I -understand it, provoked the King of Abyssinia to destroy the Italian army -and fall back upon Johannesburg; this at the instigation of Rhodes, to -bull the stock market. - - - - -CHAPTER LXVI. - -Every one is a moon, and has a dark side which he never shows to anybody. - --Pudd'nhead Wilson's New Calendar. - -When I scribbled in my note-book a year ago the paragraph which ends the -preceding chapter, it was meant to indicate, in an extravagant form, two -things: the conflicting nature of the information conveyed by the citizen -to the stranger concerning South African politics, and the resulting -confusion created in the stranger's mind thereby. - -But it does not seem so very extravagant now. Nothing could in that -disturbed and excited time make South African politics clear or quite -rational to the citizen of the country because his personal interest and -his political prejudices were in his way; and nothing could make those -politics clear or rational to the stranger, the sources of his -information being such as they were. - -I was in South Africa some little time. When I arrived there the -political pot was boiling fiercely. Four months previously, Jameson had -plunged over the Transvaal border with about 600 armed horsemen at his -back, to go to the "relief of the women and children" of Johannesburg; on -the fourth day of his march the Boers had defeated him in battle, and -carried him and his men to Pretoria, the capital, as prisoners; the Boer -government had turned Jameson and his officers over to the British -government for trial, and shipped them to England; next, it had arrested -64 important citizens of Johannesburg as raid-conspirators, condemned -their four leaders to death, then commuted the sentences, and now the 64 -were waiting, in jail, for further results. Before midsummer they were -all out excepting two, who refused to sign the petitions for release; 58 -had been fined $10,000 each and enlarged, and the four leaders had gotten -off with fines of $125,000 each with permanent exile added, in one case. - -Those were wonderfully interesting days for a stranger, and I was glad. -to be in the thick of the excitement. Everybody was talking, and I -expected to understand the whole of one side of it in a very little -while. - -I was disappointed. There were singularities, perplexities, -unaccountabilities about it which I was not able to master. I had no -personal access to Boers--their side was a secret to me, aside from what -I was able to gather of it from published statements. My sympathies were -soon with the Reformers in the Pretoria jail, with their friends, and -with their cause. By diligent inquiry in Johannesburg I found out ---apparently--all the details of their side of the quarrel except one--what -they expected to accomplish by an armed rising. - -Nobody seemed to know. - -The reason why the Reformers were discontented and wanted some changes -made, seemed quite clear. In Johannesburg it was claimed that the -Uitlanders (strangers, foreigners) paid thirteen-fifteenths of the -Transvaal taxes, yet got little or nothing for it. Their city had no -charter; it had no municipal government; it could levy no taxes for -drainage, water-supply, paving, cleaning, sanitation, policing. There -was a police force, but it was composed of Boers, it was furnished by the -State Government, and the city had no control over it. Mining was very -costly; the government enormously increased the cost by putting -burdensome taxes upon the mines, the output, the machinery, the -buildings; by burdensome imposts upon incoming materials; by burdensome -railway-freight-charges. Hardest of all to bear, the government reserved -to itself a monopoly in that essential thing, dynamite, and burdened it -with an extravagant price. The detested Hollander from over the water -held all the public offices. The government was rank with corruption. -The Uitlander had no vote, and must live in the State ten or twelve years -before he could get one. He was not represented in the Raad -(legislature) that oppressed him and fleeced him. Religion was not free. -There were no schools where the teaching was in English, yet the great -majority of the white population of the State knew no tongue but that. -The State would not pass a liquor law; but allowed a great trade in cheap -vile brandy among the blacks, with the result that 25 per cent. of the -50,000 blacks employed in the mines were usually drunk and incapable of -working. - -There--it was plain enough that the reasons for wanting some changes made -were abundant and reasonable, if this statement of the existing -grievances was correct. - -What the Uitlanders wanted was reform--under the existing Republic. - -What they proposed to do was to secure these reforms by, prayer, -petition, and persuasion. - -They did petition. Also, they issued a Manifesto, whose very first note -is a bugle-blast of loyalty: "We want the establishment of this Republic -as a true Republic." - -Could anything be clearer than the Uitlander's statement of the -grievances and oppressions under which they were suffering? Could -anything be more legal and citizen-like and law-respecting than their -attitude as expressed by their Manifesto? No. Those things were -perfectly clear, perfectly comprehensible. - -But at this point the puzzles and riddles and confusions begin to flock -in. You have arrived at a place which you cannot quite understand. - -For you find that as a preparation for this loyal, lawful, and in every -way unexceptionable attempt to persuade the government to right their -grievances, the Uitlanders had smuggled a Maxim gun or two and 1,500 -muskets into the town, concealed in oil tanks and coal cars, and had -begun to form and drill military companies composed of clerks, merchants, -and citizens generally. - -What was their idea? Did they suppose that the Boers would attack them -for petitioning, for redress? That could not be. - -Did they suppose that the Boers would attack them even for issuing a -Manifesto demanding relief under the existing government? - -Yes, they apparently believed so, because the air was full of talk of -forcing the government to grant redress if it were not granted -peacefully. - -The Reformers were men of high intelligence. If they were in earnest, -they were taking extraordinary risks. They had enormously valuable -properties to defend; their town was full of women and children; their -mines and compounds were packed with thousands upon thousands of sturdy -blacks. If the Boers attacked, the mines would close, the blacks would -swarm out and get drunk; riot and conflagration and the Boers together -might lose the Reformers more in a day, in money, blood, and suffering, -than the desired political relief could compensate in ten years if they -won the fight and secured the reforms. - -It is May, 1897, now; a year has gone by, and the confusions of that day -have been to a considerable degree cleared away. Mr. Cecil Rhodes, Dr. -Jameson, and others responsible for the Raid, have testified before the -Parliamentary Committee of Inquiry in London, and so have Mr. Lionel -Phillips and other Johannesburg Reformers, monthly-nurses of the -Revolution which was born dead. These testimonies have thrown light. -Three books have added much to this light: - -"South Africa As It Is," by Mr. Statham, an able writer partial to the -Boers; "The Story of an African Crisis," by Mr. Garrett, a brilliant -writer partial to Rhodes; and "A Woman's Part in a Revolution," by Mrs. -John Hays Hammond, a vigorous and vivid diarist, partial to the -Reformers. By liquifying the evidence of the prejudiced books and of the -prejudiced parliamentary witnesses and stirring the whole together and -pouring it into my own (prejudiced) moulds, I have got at the truth of -that puzzling South African situation, which is this: - -1. The capitalists and other chief men of Johannesburg were fretting -under various political and financial burdens imposed by the State (the -South African Republic, sometimes called "the Transvaal") and desired to -procure by peaceful means a modification of the laws. - -2. Mr. Cecil Rhodes, Premier of the British Cape Colony, millionaire, -creator and managing director of the territorially-immense and -financially unproductive South Africa Company; projector of vast schemes -for the unification and consolidation of all the South African States, -one imposing commonwealth or empire under the shadow and general -protection of the British flag, thought he saw an opportunity to make -profitable use of the Uitlander discontent above mentioned--make the -Johannesburg cat help pull out one of his consolidation chestnuts for -him. With this view he set himself the task of warming the lawful and -legitimate petitions and supplications of the Uitlanders into seditious -talk, and their frettings into threatenings--the final outcome to be -revolt and armed rebellion. If he could bring about a bloody collision -between those people and the Boer government, Great Britain would have to -interfere; her interference would be resisted by the Boers; she would -chastise them and add the Transvaal to her South African possessions. It -was not a foolish idea, but a rational and practical one. - -After a couple of years of judicious plotting, Mr. Rhodes had his reward; -the revolutionary kettle was briskly boiling in Johannesburg, and the -Uitlander leaders were backing their appeals to the government--now -hardened into demands--by threats of force and bloodshed. By the middle -of December, 1895, the explosion seemed imminent. Mr. Rhodes was -diligently helping, from his distant post in Cape Town. He was helping -to procure arms for Johannesburg; he was also arranging to have Jameson -break over the border and come to Johannesburg with 600 mounted men at -his back. Jameson--as per instructions from Rhodes, perhaps--wanted a -letter from the Reformers requesting him to come to their aid. It was a -good idea. It would throw a considerable share of the responsibility of -his invasion upon the Reformers. He got the letter--that famous one -urging him to fly to the rescue of the women and children. He got it two -months before he flew. The Reformers seem to have thought it over and -concluded that they had not done wisely; for the next day after giving -Jameson the implicating document they wanted to withdraw it and leave the -women and children in danger; but they were told that it was too late. -The original had gone to Mr. Rhodes at the Cape. Jameson had kept a -copy, though. - -From that time until the 29th of December, a good deal of the Reformers' -time was taken up with energetic efforts to keep Jameson from coming to -their assistance. Jameson's invasion had been set for the 26th. The -Reformers were not ready. The town was not united. Some wanted a fight, -some wanted peace; some wanted a new government, some wanted the existing -one reformed; apparently very few wanted the revolution to take place in -the interest and under the ultimate shelter of the Imperial flag ---British; yet a report began to spread that Mr. Rhodes's embarrassing -assistance had for its end this latter object. - -Jameson was away up on the frontier tugging at his leash, fretting to -burst over the border. By hard work the Reformers got his starting-date -postponed a little, and wanted to get it postponed eleven days. -Apparently, Rhodes's agents were seconding their efforts--in fact wearing -out the telegraph wires trying to hold him back. Rhodes was himself the -only man who could have effectively postponed Jameson, but that would -have been a disadvantage to his scheme; indeed, it could spoil his whole -two years' work. - -Jameson endured postponement three days, then resolved to wait no longer. -Without any orders--excepting Mr. Rhodes's significant silence--he cut -the telegraph wires on the 29th, and made his plunge that night, to go to -the rescue of the women and children, by urgent request of a letter now -nine days old--as per date,--a couple of months old, in fact. He read -the letter to his men, and it affected them. It did not affect all of -them alike. Some saw in it a piece of piracy of doubtful wisdom, and -were sorry to find that they had been assembled to violate friendly -territory instead of to raid native kraals, as they had supposed. - -Jameson would have to ride 150 miles. He knew that there were suspicions -abroad in the Transvaal concerning him, but he expected to get through to -Johannesburg before they should become general and obstructive. But a -telegraph wire had been overlooked and not cut. It spread the news of -his invasion far and wide, and a few hours after his start the Boer -farmers were riding hard from every direction to intercept him. - -As soon as it was known in Johannesburg that he was on his way to rescue -the women and children, the grateful people put the women and children in -a train and rushed them for Australia. In fact, the approach of -Johannesburg's saviour created panic and consternation; there, and a -multitude of males of peaceable disposition swept to the trains like a -sand-storm. The early ones fared best; they secured seats--by sitting in -them--eight hours before the first train was timed to leave. - -Mr. Rhodes lost no time. He cabled the renowned Johannesburg letter of -invitation to the London press--the gray-headedest piece of ancient -history that ever went over a cable. - -The new poet laureate lost no time. He came out with a rousing poem -lauding Jameson's prompt and splendid heroism in flying to the rescue of -the women and children; for the poet could not know that he did not fly -until two months after the invitation. He was deceived by the false date -of the letter, which was December 20th. - -Jameson was intercepted by the Boers on New Year's Day, and on the next -day he surrendered. He had carried his copy of the letter along, and if -his instructions required him--in case of emergency--to see that it fell -into the hands of the Boers, he loyally carried them out. Mrs. Hammond -gives him a sharp rap for his supposed carelessness, and emphasizes her -feeling about it with burning italics: "It was picked up on the -battle-field in a leathern pouch, supposed to be Dr. Jameson's saddle-bag. -Why, in the name of all that is discreet and honorable, didn't he eat it!" - -She requires too much. He was not in the service of the Reformers ---excepting ostensibly; he was in the service of Mr. Rhodes. It was the -only plain English document, undarkened by ciphers and mysteries, and -responsibly signed and authenticated, which squarely implicated the -Reformers in the raid, and it was not to Mr. Rhodes's interest that it -should be eaten. Besides, that letter was not the original, it was only -a copy. Mr. Rhodes had the original--and didn't eat it. He cabled it to -the London press. It had already been read in England and America and -all over Europe before, Jameson dropped it on the battlefield. If the -subordinate's knuckles deserved a rap, the principal's deserved as many -as a couple of them. - -That letter is a juicily dramatic incident and is entitled to all its -celebrity, because of the odd and variegated effects which it produced. -All within the space of a single week it had made Jameson an illustrious -hero in England, a pirate in Pretoria, and an ass without discretion or -honor in Johannesburg; also it had produced a poet-laureatic explosion of -colored fireworks which filled the world's sky with giddy splendors, and, -the knowledge that Jameson was coming with it to rescue the women and -children emptied Johannesburg of that detail of the population. For an -old letter, this was much. For a letter two months old, it did marvels; -if it had been a year old it would have done miracles. - - - - -CHAPTER LXVII. - -First catch your Boer, then kick him. - --Pudd'nhead Wilson's New Calendar. - -Those latter days were days of bitter worry and trouble for the harassed -Reformers. - -From Mrs. Hammond we learn that on the 31st (the day after Johannesburg -heard of the invasion), "The Reform Committee repudiates Dr. Jameson's -inroad." - -It also publishes its intention to adhere to the Manifesto. - -It also earnestly desires that the inhabitants shall refrain from overt -acts against the Boer government. - -It also "distributes arms" at the Court House, and furnishes horses "to -the newly-enrolled volunteers." - -It also brings a Transvaal flag into the committee-room, and the entire -body swear allegiance to it "with uncovered heads and upraised arms." - -Also "one thousand Lee-Metford rifles have been given out"--to rebels. - -Also, in a speech, Reformer Lionel Phillips informs the public that the -Reform Committee Delegation has "been received with courtesy by the -Government Commission," and "been assured that their proposals shall be -earnestly considered." That "while the Reform Committee regretted -Jameson's precipitate action, they would stand by him." - -Also the populace are in a state of "wild enthusiasm," and "46 can -scarcely be restrained; they want to go out to meet Jameson and bring him -in with triumphal outcry." - -Also the British High Commissioner has issued a damnifying proclamation -against Jameson and all British abettors of his game. It arrives January -1st. - -It is a difficult position for the Reformers, and full of hindrances and -perplexities. Their duty is hard, but plain: - -1. They have to repudiate the inroad, and stand by the inroader. - -2. They have to swear allegiance to the Boer government, and distribute -cavalry horses to the rebels. - -3. They have to forbid overt acts against the Boer government, and -distribute arms to its enemies. - -4. They have to avoid collision with the British government, but still -stand by Jameson and their new oath of allegiance to the Boer government, -taken, uncovered, in presence of its flag. - -They did such of these things as they could; they tried to do them all; -in fact, did do them all, but only in turn, not simultaneously. In the -nature of things they could not be made to simultane. - -In preparing for armed revolution and in talking revolution, were the -Reformers "bluffing," or were they in earnest? If they were in earnest, -they were taking great risks--as has been already pointed out. A -gentleman of high position told me in Johannesburg that he had in his -possession a printed document proclaiming a new government and naming its -president--one of the Reform leaders. He said that this proclamation had -been ready for issue, but was suppressed when the raid collapsed. -Perhaps I misunderstood him. Indeed, I must have misunderstood him, for -I have not seen mention of this large incident in print anywhere. - -Besides, I hope I am mistaken; for, if I am, then there is argument that -the Reformers were privately not serious, but were only trying to scare -the Boer government into granting the desired reforms. - -The Boer government was scared, and it had a right to be. For if Mr. -Rhodes's plan was to provoke a collision that would compel the -interference of England, that was a serious matter. If it could be shown -that that was also the Reformers' plan and purpose, it would prove that -they had marked out a feasible project, at any rate, although it was one -which could hardly fail to cost them ruinously before England should -arrive. But it seems clear that they had no such plan nor desire. If, -when the worst should come to the worst, they meant to overthrow the -government, they also meant to inherit the assets themselves, no doubt. - -This scheme could hardly have succeeded. With an army of Boers at their -gates and 50,000 riotous blacks in their midst, the odds against success -would have been too heavy--even if the whole town had been armed. With -only 2,500 rifles in the place, they stood really no chance. - -To me, the military problems of the situation are of more interest than -the political ones, because by disposition I have always been especially -fond of war. No, I mean fond of discussing war; and fond of giving -military advice. If I had been with Jameson the morning after he -started, I should have advised him to turn back. That was Monday; it was -then that he received his first warning from a Boer source not to violate -the friendly soil of the Transvaal. It showed that his invasion was -known. If I had been with him on Tuesday morning and afternoon, when he -received further warnings, I should have repeated my advice. If I had -been with him the next morning--New Year's--when he received notice that -"a few hundred" Boers were waiting for him a few miles ahead, I should -not have advised, but commanded him to go back. And if I had been with -him two or three hours later--a thing not conceivable to me--I should -have retired him by force; for at that time he learned that the few -hundred had now grown to 800; and that meant that the growing would go on -growing. - -For,--by authority of Mr. Garrett, one knows that Jameson's 600 were only -530 at most, when you count out his native drivers, etc.; and that the -530 consisted largely of "green" youths, "raw young fellows," not trained -and war-worn British soldiers; and I would have told. Jameson that those -lads would not be able to shoot effectively from horseback in the scamper -and racket of battle, and that there would not be anything for them to -shoot at, anyway, but rocks; for the Boers would be behind the rocks, not -out in the open. I would have told him that 300 Boer sharpshooters -behind rocks would be an overmatch for his 500 raw young fellows on -horseback. - -If pluck were the only thing essential to battle-winning, the English -would lose no battles. But discretion, as well as pluck, is required -when one fights Boers and Red Indians. In South Africa the Briton has -always insisted upon standing bravely up, unsheltered, before the hidden -Boer, and taking the results: Jameson's men would follow the custom. -Jameson would not have listened to me--he would have been intent upon -repeating history, according to precedent. Americans are not acquainted -with the British-Boer war of 1881; but its history is interesting, and -could have been instructive to Jameson if he had been receptive. I will -cull some details of it from trustworthy sources mainly from "Russell's -Natal." Mr. Russell is not a Boer, but a Briton. He is inspector of -schools, and his history is a text-book whose purpose is the instruction -of the Natal English youth. - -After the seizure of the Transvaal and the suppression of the Boer -government by England in 1877, the Boers fretted for three years, and -made several appeals to England for a restoration of their liberties, -but without result. Then they gathered themselves together in a great -mass-meeting at Krugersdorp, talked their troubles over, and resolved to -fight for their deliverance from the British yoke. (Krugersdorp--the -place where the Boers interrupted the Jameson raid.) The little handful -of farmers rose against the strongest empire in the world. They -proclaimed martial law and the re-establishment of their Republic. They -organized their forces and sent them forward to intercept the British -battalions. This, although Sir Garnet Wolseley had but lately made -proclamation that "so long as the sun shone in the heavens," the -Transvaal would be and remain English territory. And also in spite of -the fact that the commander of the 94th regiment--already on the march to -suppress this rebellion--had been heard to say that "the Boers would turn -tail at the first beat of the big drum."--["South Africa As It Is," -by F. Reginald Statham, page 82. London: T. Fisher Unwin, 1897.] - -Four days after the flag-raising, the Boer force which had been sent -forward to forbid the invasion of the English troops met them at -Bronkhorst Spruit--246 men of the 94th regiment, in command of a colonel, -the big drum beating, the band playing--and the first battle was fought. -It lasted ten minutes. Result: - - British loss, more than 150 officers and men, out of the 246. - Surrender of the remnant. - - Boer loss--if any--not stated. - -They are fine marksmen, the Boers. From the cradle up, they live on -horseback and hunt wild animals with the rifle. They have a passion for -liberty and the Bible, and care for nothing else. - -"General Sir George Colley, Lieutenant-Governor and Commander-in-Chief in -Natal, felt it his duty to proceed at once to the relief of the loyalists -and soldiers beleaguered in the different towns of the Transvaal." He -moved out with 1,000 men and some artillery. He found the Boers encamped -in a strong and sheltered position on high ground at Laing's Nek--every -Boer behind a rock. Early in the morning of the 28th January, 1881, he -moved to the attack "with the 58th regiment, commanded by Colonel Deane, -a mounted squadron of 70 men, the 60th Rifles, the Naval Brigade with -three rocket tubes, and the Artillery with six guns." He shelled the -Boers for twenty minutes, then the assault was delivered, the 58th -marching up the slope in solid column. The battle was soon finished, -with this result, according to Russell-- - - British loss in killed and wounded, 174. - - Boer loss, "trifling." - -Colonel Deane was killed, and apparently every officer above the grade of -lieutenant was killed or wounded, for the 58th retreated to its camp in -command of a lieutenant. ("Africa as It Is.") - -That ended the second battle. - -On the 7th of February General Colley discovered that the Boers were -flanking his position. The next morning he left his camp at Mount -Pleasant and marched out and crossed the Ingogo river with 270 men, -started up the Ingogo heights, and there fought a battle which lasted -from noon till nightfall. He then retreated, leaving his wounded with -his military chaplain, and in recrossing the now swollen river lost some -of his men by drowning. That was the third Boer victory. Result, -according to Mr. Russell-- - - British loss 150 out of 270 engaged. - - Boer loss, 8 killed, 9 wounded--17. - -There was a season of quiet, now, but at the end of about three weeks Sir -George Colley conceived the idea of climbing, with an infantry and -artillery force, the steep and rugged mountain of Amajuba in the night--a -bitter hard task, but he accomplished it. On the way he left about 200 -men to guard a strategic point, and took about 400 up the mountain with -him. When the sun rose in the morning, there was an unpleasant surprise -for the Boers; yonder were the English troops visible on top of the -mountain two or three miles away, and now their own position was at the -mercy of the English artillery. The Boer chief resolved to retreat--up -that mountain. He asked for volunteers, and got them. - -The storming party crossed the swale and began to creep up the steeps, -"and from behind rocks and bushes they shot at the soldiers on the -skyline as if they were stalking deer," says Mr. Russell. There was -"continuous musketry fire, steady and fatal on the one side, wild and -ineffectual on the other." The Boers reached the top, and began to put in -their ruinous work. Presently the British "broke and fled for their -lives down the rugged steep." The Boers had won the battle. Result in -killed and wounded, including among the killed the British General: - - British loss, 226, out of 400 engaged. - - Boer loss, 1 killed, 5 wounded. - -That ended the war. England listened to reason, and recognized the Boer -Republic--a government which has never been in any really awful danger -since, until Jameson started after it with his 500 "raw young fellows." -To recapitulate: - -The Boer farmers and British soldiers fought 4 battles, and the Boers won -them all. Result of the 4, in killed and wounded: - - British loss, 700 men. - - Boer loss, so far as known, 23 men. - -It is interesting, now, to note how loyally Jameson and his several -trained British military officers tried to make their battles conform to -precedent. Mr. Garrett's account of the Raid is much the best one I have -met with, and my impressions of the Raid are drawn from that. - -When Jameson learned that near Krugersdorp he would find 800 Boers -waiting to dispute his passage, he was not in the least disturbed. He -was feeling as he had felt two or three days before, when he had opened -his campaign with a historic remark to the same purport as the one with -which the commander of the 94th had opened the Boer-British war of -fourteen years before. That Commander's remark was, that the Boers -"would turn tail at the first beat of the big drum." Jameson's was, that -with his "raw young fellows" he could kick the (persons) of the Boers -"all round the Transvaal." He was keeping close to historic precedent. - -Jameson arrived in the presence of the Boers. They--according to -precedent--were not visible. It was a country of ridges, depressions, -rocks, ditches, moraines of mining-tailings--not even as favorable for -cavalry work as Laing's Nek had been in the former disastrous days. -Jameson shot at the ridges and rocks with his artillery, just as General -Colley had done at the Nek; and did them no damage and persuaded no Boer -to show himself. Then about a hundred of his men formed up to charge the -ridge-according to the 58th's precedent at the Nek; but as they dashed -forward they opened out in a long line, which was a considerable -improvement on the 58th's tactics; when they had gotten to within 200 -yards of the ridge the concealed Boers opened out on them and emptied 20 -saddles. The unwounded dismounted and fired at the rocks over the backs -of their horses; but the return-fire was too hot, and they mounted again, -"and galloped back or crawled away into a clump of reeds for cover, where -they were shortly afterward taken prisoners as they lay among the reeds. -Some thirty prisoners were so taken, and during the night which followed -the Boers carried away another thirty killed and wounded--the wounded to -Krugersdorp hospital." Sixty per cent. of the assaulted force disposed -of--according to Mr. Garrett's estimate. - -It was according to Amajuba precedent, where the British loss was 226 out -of about 400 engaged. - -Also, in Jameson's camp, that night, "there lay about 30 wounded or -otherwise disabled" men. Also during the night "some 30 or 40 young -fellows got separated from the command and straggled through into -Johannesburg." Altogether a possible 150 men gone, out of his 530. His -lads had fought valorously, but had not been able to get near enough to a -Boer to kick him around the Transvaal. - -At dawn the next morning the column of something short of 400 whites -resumed its march. Jameson's grit was stubbornly good; indeed, it was -always that. He still had hopes. There was a long and tedious -zigzagging march through broken ground, with constant harassment from the -Boers; and at last the column "walked into a sort of trap," and the Boers -"closed in upon it." "Men and horses dropped on all sides. In the -column the feeling grew that unless it could burst through the Boer lines -at this point it was done for. The Maxims were fired until they grew too -hot, and, water failing for the cool jacket, five of them jammed and went -out of action. The 7-pounder was fired until only half an hour's -ammunition was left to fire with. One last rush was made, and failed, -and then the Staats Artillery came up on the left flank, and the game was -up." - -Jameson hoisted a white flag and surrendered. - -There is a story, which may not be true, about an ignorant Boer farmer -there who thought that this white flag was the national flag of England. -He had been at Bronkhorst, and Laing's Nek, and Ingogo and Amajuba, and -supposed that the English did not run up their flag excepting at the end -of a fight. - -The following is (as I understand it) Mr. Garrett's estimate of Jameson's -total loss in killed and wounded for the two days: - -"When they gave in they were minus some 20 per cent. of combatants. -There were 76 casualties. There were 30 men hurt or sick in the wagons. -There were 27 killed on the spot or mortally wounded." - -Total, 133, out of the original 530. It is just 25 per cent.--[However, -I judge that the total was really 150; for the number of wounded carried -to Krugersdorp hospital was 53; not 30, as Mr. Garrett reports it. The -lady whose guest I was in Krugerdorp gave me the figures. She was head -nurse from the beginning of hostilities (Jan. 1) until the professional -nurses arrived, Jan. 8th. Of the 53, "Three or four were Boers"; I quote -her words.]--This is a large improvement upon the precedents established -at Bronkhorst, Laing's Nek, Ingogo, and Amajuba, and seems to indicate -that Boer marksmanship is not so good now as it was in those days. But -there is one detail in which the Raid-episode exactly repeats history. -By surrender at Bronkhorst, the whole British force disappeared from the -theater of war; this was the case with Jameson's force. - -In the Boer loss, also, historical precedent is followed with sufficient -fidelity. In the 4 battles named above, the Boer loss, so far as known, -was an average of 6 men per battle, to the British average loss of 175. -In Jameson's battles, as per Boer official report, the Boer loss in -killed was 4. Two of these were killed by the Boers themselves, by -accident, the other by Jameson's army--one of them intentionally, the -other by a pathetic mischance. "A young Boer named Jacobz was moving -forward to give a drink to one of the wounded troopers (Jameson's) after -the first charge, when another wounded man, mistaking his intention; shot -him." There were three or four wounded Boers in the Krugersdorp -hospital, and apparently no others have been reported. Mr. Garrett, "on -a balance of probabilities, fully accepts the official version, and -thanks Heaven the killed was not larger." - -As a military man, I wish to point out what seems to me to be military -errors in the conduct of the campaign which we have just been -considering. I have seen active service in the field, and it was in the -actualities of war that I acquired my training and my right to speak. -I served two weeks in the beginning of our Civil War, and during all that -tune commanded a battery of infantry composed of twelve men. General -Grant knew the history of my campaign, for I told it him. I also told -him the principle upon which I had conducted it; which was, to tire the -enemy. I tired out and disqualified many battalions, yet never had a -casualty myself nor lost a man. General Grant was not given to paying -compliments, yet he said frankly that if I had conducted the whole war -much bloodshed would have been spared, and that what the army might have -lost through the inspiriting results of collision in the field would have -been amply made up by the liberalizing influences of travel. Further -endorsement does not seem to me to be necessary. - -Let us now examine history, and see what it teaches. In the 4 battles -fought in 1881 and the two fought by Jameson, the British loss in killed, -wounded, and prisoners, was substantially 1,300 men; the Boer loss, as -far as is ascertainable, eras about 30 men. These figures show that -there was a defect somewhere. It was not in the absence of courage. I -think it lay in the absence of discretion. The Briton should have done -one thing or the other: discarded British methods and fought the Boer -with Boer methods, or augmented his own force until--using British -methods--it should be large enough to equalize results with the Boer. - -To retain the British method requires certain things, determinable by -arithmetic. If, for argument's sake, we allow that the aggregate of -1,716 British soldiers engaged in the 4 early battles was opposed by the -same aggregate of Boers, we have this result: the British loss of 700 and -the Boer loss of 23 argues that in order to equalize results in future -battles you must make the British force thirty times as strong as the -Boer force. Mr. Garrett shows that the Boer force immediately opposed to -Jameson was 2,000, and that there were 6,000 more on hand by the evening -of the second day. Arithmetic shows that in order to make himself the -equal of the 8,000 Boers, Jameson should have had 240,000 men, whereas he -merely had 530 boys. From a military point of view, backed by the facts -of history, I conceive that Jameson's military judgment was at fault. - -Another thing.--Jameson was encumbered by artillery, ammunition, and -rifles. The facts of the battle show that he should have had none of -those things along. They were heavy, they were in his way, they impeded -his march. There was nothing to shoot at but rocks--he knew quite well -that there would be nothing to shoot at but rocks--and he knew that -artillery and rifles have no effect upon rocks. He was badly overloaded -with unessentials. He had 8 Maxims--a Maxim is a kind of Gatling, I -believe, and shoots about 500 bullets per minute; he had one -12 1/2-pounder cannon and two 7-pounders; also, 145,000 rounds of -ammunition. He worked the Maxims so hard upon the rocks that five of them -became disabled--five of the Maxims, not the rocks. It is believed that -upwards of 100,000 rounds of ammunition of the various kinds were fired -during the 21 hours that the battles lasted. One man killed. He must -have been much mutilated. It was a pity to bring those futile Maxims -along. Jameson should have furnished himself with a battery of Pudd'nhead -Wilson maxims instead, They are much more deadly than those others, and -they are easily carried, because they have no weight. - -Mr. Garrett--not very carefully concealing a smile--excuses the presence -of the Maxims by saying that they were of very substantial use because -their sputtering disordered the aim of the Boers, and in that way saved -lives. - -Three cannon, eight Maxims, and five hundred rifles yielded a result -which emphasized a fact which had already been established--that the -British system of standing out in the open to fight Boers who are behind -rocks is not wise, not excusable, and ought to be abandoned for something -more efficacious. For the purpose of war is to kill, not merely to waste -ammunition. - -If I could get the management of one of those campaigns, I would know -what to do, for I have studied the Boer. He values the Bible above every -other thing. The most delicious edible in South Africa is "biltong." -You will have seen it mentioned in Olive Schreiner's books. It is what -our plainsmen call "jerked beef." It is the Boer's main standby. He has -a passion for it, and he is right. - -If I had the command of the campaign I would go with rifles only, no -cumbersome Maxims and cannon to spoil good rocks with. I would move -surreptitiously by night to a point about a quarter of a mile from the -Boer camp, and there I would build up a pyramid of biltong and Bibles -fifty feet high, and then conceal my men all about. In the morning the -Boers would send out spies, and then the rest would come with a rush. -I would surround them, and they would have to fight my men on equal -terms, in the open. There wouldn't be any Amajuba results. - ---[Just as I am finishing this book an unfortunate dispute has sprung up -between Dr. Jameson and his officers, on the one hand, and Colonel Rhodes -on the other, concerning the wording of a note which Colonel Rhodes sent -from Johannesburg by a cyclist to Jameson just before hostilities began -on the memorable New Year's Day. Some of the fragments of this note were -found on the battlefield after the fight, and these have been pieced -together; the dispute is as to what words the lacking fragments -contained. Jameson says the note promised him a reinforcement of 300 men -from Johannesburg. Colonel Rhodes denies this, and says he merely -promised to send out "some" men "to meet you."] - -[It seems a pity that these friends should fall out over so little a -thing. If the 300 had been sent, what good would it have done? In 21 -hours of industrious fighting, Jameson's 530 men, with 8 Maxims, 3 -cannon, and 145,000 rounds of ammunition, killed an aggregate of 1. -Boer. These statistics show that a reinforcement of 300 Johannesburgers, -armed merely with muskets, would have killed, at the outside, only a -little over a half of another Boer. This would not have saved the day. -It would not even have seriously affected the general result. The -figures show clearly, and with mathematical violence, that the only way -to save Jameson, or even give him a fair and equal chance with the enemy, -was for Johannesburg to send him 240 Maxims, 90 cannon, 600 carloads of -ammunition, and 240,000 men. Johannesburg was not in a position to do -this. Johannesburg has been called very hard names for not reinforcing -Jameson. But in every instance this has been done by two classes of -persons--people who do not read history, and people, like Jameson, who do -not understand what it means, after they have read it.] - - - - -CHAPTER LXVIII. - -None of us can have as many virtues as the fountain-pen, or half its -cussedness; but we can try. - --Pudd'nhead Wilson's New Calendar. - -The Duke of Fife has borne testimony that Mr. Rhodes deceived him. That -is also what Mr. Rhodes did with the Reformers. He got them into -trouble, and then stayed out himself. A judicious man. He has always -been that. As to this there was a moment of doubt, once. It was when he -was out on his last pirating expedition in the Matabele country. The -cable shouted out that he had gone unarmed, to visit a party of hostile -chiefs. It was true, too; and this dare-devil thing came near fetching -another indiscretion out of the poet laureate. It would have been too -bad, for when the facts were all in, it turned out that there was a lady -along, too, and she also was unarmed. - -In the opinion of many people Mr. Rhodes is South Africa; others think he -is only a large part of it. These latter consider that South Africa -consists of Table Mountain, the diamond mines, the Johannesburg gold -fields, and Cecil Rhodes. The gold fields are wonderful in every way. -In seven or eight years they built up, in a desert, a city of a hundred -thousand inhabitants, counting white and black together; and not the -ordinary mining city of wooden shanties, but a city made out of lasting -material. Nowhere in the world is there such a concentration of rich -mines as at Johannesburg. Mr. Bonamici, my manager there, gave me a -small gold brick with some statistics engraved upon it which record the -output of gold from the early days to July, 1895, and exhibit the strides -which have been made in the development of the industry; in 1888 the -output was $4,162,440; the output of the next five and a half years was -(total: $17,585,894); for the single year ending with June, 1895, it was -$45,553,700. - -The capital which has developed the mines came from England, the mining -engineers from America. This is the case with the diamond mines also. -South Africa seems to be the heaven of the American scientific mining -engineer. He gets the choicest places, and keeps them. His salary is -not based upon what he would get in America, but apparently upon what a -whole family of him would get there. - -The successful mines pay great dividends, yet the rock is not rich, from -a Californian point of view. Rock which yields ten or twelve dollars a -ton is considered plenty rich enough. It is troubled with base metals to -such a degree that twenty years ago it would have been only about half as -valuable as it is now; for at that time there was no paying way of -getting anything out of such rock but the coarser-grained "free" gold; but -the new cyanide process has changed all that, and the gold fields of the -world now deliver up fifty million dollars' worth of gold per year which -would have gone into the tailing-pile under the former conditions. - -The cyanide process was new to me, and full of interest; and among the -costly and elaborate mining machinery there were fine things which were -new to me, but I was already familiar with the rest of the details of the -gold-mining industry. I had been a gold miner myself, in my day, and -knew substantially everything that those people knew about it, except how -to make money at it. But I learned a good deal about the Boers there, -and that was a fresh subject. What I heard there was afterwards repeated -to me in other parts of South Africa. Summed up--according to the -information thus gained--this is the Boer: - -He is deeply religious, profoundly ignorant, dull, obstinate, bigoted, -uncleanly in his habits, hospitable, honest in his dealings with the -whites, a hard master to his black servant, lazy, a good shot, good -horseman, addicted to the chase, a lover of political independence, a -good husband and father, not fond of herding together in towns, but -liking the seclusion and remoteness and solitude and empty vastness and -silence of the veldt; a man of a mighty appetite, and not delicate about -what he appeases it with--well-satisfied with pork and Indian corn and -biltong, requiring only that the quantity shall not be stinted; willing -to ride a long journey to take a hand in a rude all-night dance -interspersed with vigorous feeding and boisterous jollity, but ready to -ride twice as far for a prayer-meeting; proud of his Dutch and Huguenot -origin and its religious and military history; proud of his race's -achievements in South Africa, its bold plunges into hostile and uncharted -deserts in search of free solitudes unvexed by the pestering and detested -English, also its victories over the natives and the British; proudest of -all, of the direct and effusive personal interest which the Deity has -always taken in its affairs. He cannot read, he cannot write; he has one -or two newspapers, but he is, apparently, not aware of it; until latterly -he had no schools, and taught his children nothing, news is a term which -has no meaning to him, and the thing itself he cares nothing about. He -hates to be taxed and resents it. He has stood stock still in South -Africa for two centuries and a half, and would like to stand still till -the end of time, for he has no sympathy with Uitlander notions of -progress. He is hungry to be rich, for he is human; but his preference -has been for riches in cattle, not in fine clothes and fine houses and -gold and diamonds. The gold and the diamonds have brought the godless -stranger within his gates, also contamination and broken repose, and he -wishes that they had never been discovered. - -I think that the bulk of those details can be found in Olive Schreiner's -books, and she would not be accused of sketching the Boer's portrait with -an unfair hand. - -Now what would you expect from that unpromising material? What ought you -to expect from it? Laws inimical to religious liberty? Yes. Laws -denying, representation and suffrage to the intruder? Yes. Laws -unfriendly to educational institutions? Yes. Laws obstructive of gold -production? Yes. Discouragement of railway expansion? Yes. Laws heavily -taxing the intruder and overlooking the Boer? Yes. - -The Uitlander seems to have expected something very different from all -that. I do not know why. Nothing different from it was rationally to be -expected. A round man cannot be expected to fit a square hole right -away. He must have time to modify his shape. The modification had begun -in a detail or two, before the Raid, and was making some progress. It -has made further progress since. There are wise men in the Boer -government, and that accounts for the modification; the modification of -the Boer mass has probably not begun yet. If the heads of the Boer -government had not been wise men they would have hanged Jameson, and thus -turned a very commonplace pirate into a holy martyr. But even their -wisdom has its limits, and they will hang Mr. Rhodes if they ever catch -him. That will round him and complete him and make him a saint. He has -already been called by all other titles that symbolize human grandeur, -and he ought to rise to this one, the grandest of all. It will be a -dizzy jump from where he is now, but that is nothing, it will land him in -good company and be a pleasant change for him. - -Some of the things demanded by the Johannesburgers' Manifesto have been -conceded since the days of the Raid, and the others will follow in time, -no doubt. It was most fortunate for the miners of Johannesburg that the -taxes which distressed them so much were levied by the Boer government, -instead of by their friend Rhodes and his Chartered Company of -highwaymen, for these latter take half of whatever their mining victims -find, they do not stop at a mere percentage. If the Johannesburg miners -were under their jurisdiction they would be in the poorhouse in twelve -months. - -I have been under the impression all along that I had an unpleasant -paragraph about the Boers somewhere in my notebook, and also a pleasant -one. I have found them now. The unpleasant one is dated at an interior -village, and says-- - -"Mr. Z. called. He is an English Afrikander; is an old resident, and has -a Boer wife. He speaks the language, and his professional business is -with the Boers exclusively. He told me that the ancient Boer families in -the great region of which this village is the commercial center are -falling victims to their inherited indolence and dullness in the -materialistic latter-day race and struggle, and are dropping one by one -into the grip of the usurer--getting hopelessly in debt--and are losing -their high place and retiring to second and lower. The Boer's farm does -not go to another Boer when he loses it, but to a foreigner. Some have -fallen so low that they sell their daughters to the blacks." - -Under date of another South African town I find the note which is -creditable to the Boers: - -"Dr. X. told me that in the Kafir war 1,500 Kafirs took refuge in a great -cave in the mountains about 90 miles north of Johannesburg, and the Boers -blocked up the entrance and smoked them to death. Dr. X. has been in -there and seen the great array of bleached skeletons--one a woman with -the skeleton of a child hugged to her breast." - -The great bulk of the savages must go. The white man wants their lands, -and all must go excepting such percentage of them as he will need to do -his work for him upon terms to be determined by himself. Since history -has removed the element of guesswork from this matter and made it -certainty, the humanest way of diminishing the black population should be -adopted, not the old cruel ways of the past. Mr. Rhodes and his gang -have been following the old ways.--They are chartered to rob and slay, -and they lawfully do it, but not in a compassionate and Christian spirit. -They rob the Mashonas and the Matabeles of a portion of their territories -in the hallowed old style of "purchase!" for a song, and then they force -a quarrel and take the rest by the strong hand. They rob the natives of -their cattle under the pretext that all the cattle in the country -belonged to the king whom they have tricked and assassinated. They issue -"regulations" requiring the incensed and harassed natives to work for the -white settlers, and neglect their own affairs to do it. This is slavery, -and is several times worse than was the American slavery which used to -pain England so much; for when this Rhodesian slave is sick, -super-annuated, or otherwise disabled, he must support himself -or starve--his master is under no obligation to support him. - -The reduction of the population by Rhodesian methods to the desired limit -is a return to the old-time slow-misery and lingering-death system of a -discredited time and a crude "civilization." We humanely reduce an -overplus of dogs by swift chloroform; the Boer humanely reduced an -overplus of blacks by swift suffocation; the nameless but right-hearted -Australian pioneer humanely reduced his overplus of aboriginal neighbors -by a sweetened swift death concealed in a poisoned pudding. All these -are admirable, and worthy of praise; you and I would rather suffer either -of these deaths thirty times over in thirty successive days than linger -out one of the Rhodesian twenty-year deaths, with its daily burden of -insult, humiliation, and forced labor for a man whose entire race the -victim hates. Rhodesia is a happy name for that land of piracy and -pillage, and puts the right stain upon it. - -Several long journeys--gave us experience of the Cape Colony railways; -easy-riding, fine cars; all the conveniences; thorough cleanliness; -comfortable beds furnished for the night trains. It was in the first -days of June, and winter; the daytime was pleasant, the nighttime nice -and cold. Spinning along all day in the cars it was ecstasy to breathe -the bracing air and gaze out over the vast brown solitudes of the velvet -plains, soft and lovely near by, still softer and lovelier further away, -softest and loveliest of all in the remote distances, where dim -island-hills seemed afloat, as in a sea--a sea made of dream-stuff and -flushed with colors faint and rich; and dear me, the depth of the sky, -and the beauty of the strange new cloud-forms, and the glory of the -sunshine, the lavishness, the wastefulness of it! The vigor and -freshness and inspiration of the air and the sunwell, it was all -just as Olive Schreiner had made it in her books. - -To me the veldt, in its sober winter garb, was surpassingly beautiful. -There were unlevel stretches where it was rolling and swelling, and -rising and subsiding, and sweeping superbly on and on, and still on and -on like an ocean, toward the faraway horizon, its pale brown deepening by -delicately graduated shades to rich orange, and finally to purple and -crimson where it washed against the wooded hills and naked red crags at -the base of the sky. - -Everywhere, from Cape Town to Kimberley and from Kimberley to Port -Elizabeth and East London, the towns were well populated with tamed -blacks; tamed and Christianized too, I suppose, for they wore the dowdy -clothes of our Christian civilization. But for that, many of them would -have been remarkably handsome. These fiendish clothes, together with the -proper lounging gait, good-natured face, happy air, and easy laugh, made -them precise counterparts of our American blacks; often where all the -other aspects were strikingly and harmoniously and thrillingly African, a -flock of these natives would intrude, looking wholly out of place, and -spoil it all, making the thing a grating discord, half African and half -American. - -One Sunday in King William's Town a score of colored women came mincing -across the great barren square dressed--oh, in the last perfection of -fashion, and newness, and expensiveness, and showy mixture of unrelated -colors,--all just as I had seen it so often at home; and in their faces -and their gait was that languishing, aristocratic, divine delight in -their finery which was so familiar to me, and had always been such a -satisfaction to my eye and my heart. I seemed among old, old friends; -friends of fifty years, and I stopped and cordially greeted them. They -broke into a good-fellowship laugh, flashing their white teeth upon me, -and all answered at once. I did not understand a word they said. I was -astonished; I was not dreaming that they would answer in anything but -American. - -The voices, too, of the African women, were familiar to me sweet and -musical, just like those of the slave women of my early days. I followed -a couple of them all over the Orange Free State--no, over its capital ---Bloemfontein, to hear their liquid voices and the happy ripple of their -laughter. Their language was a large improvement upon American. Also -upon the Zulu. It had no Zulu clicks in it; and it seemed to have no -angles or corners, no roughness, no vile s's or other hissing sounds, but -was very, very mellow and rounded and flowing. - -In moving about the country in the trains, I had opportunity to see a -good many Boers of the veldt. One day at a village station a hundred of -them got out of the third-class cars to feed. - -Their clothes were very interesting. For ugliness of shapes, and for -miracles of ugly colors inharmoniously associated, they were a record. -The effect was nearly as exciting and interesting as that produced by the -brilliant and beautiful clothes and perfect taste always on view at the -Indian railway stations. One man had corduroy trousers of a faded -chewing gum tint. And they were new--showing that this tint did not come -by calamity, but was intentional; the very ugliest color I have ever -seen. A gaunt, shackly country lout six feet high, in battered gray -slouched hat with wide brim, and old resin-colored breeches, had on a -hideous brand-new woolen coat which was imitation tiger skin wavy broad -stripes of dazzling yellow and deep brown. I thought he ought to be -hanged, and asked the station-master if it could be arranged. He said -no; and not only that, but said it rudely; said it with a quite -unnecessary show of feeling. Then he muttered something about my being a -jackass, and walked away and pointed me out to people, and did everything -he could to turn public sentiment against me. It is what one gets for -trying to do good. - -In the train that day a passenger told me some more about Boer life out -in the lonely veldt. He said the Boer gets up early and sets his -"niggers" at their tasks (pasturing the cattle, and watching them); eats, -smokes, drowses, sleeps; toward evening superintends the milking, etc.; -eats, smokes, drowses; goes to bed at early candlelight in the fragrant -clothes he (and she) have worn all day and every week-day for years. I -remember that last detail, in Olive Schreiner's "Story of an African -Farm." And the passenger told me that the Boers were justly noted for -their hospitality. He told me a story about it. He said that his grace -the Bishop of a certain See was once making a business-progress through -the tavernless veldt, and one night he stopped with a Boer; after supper -was shown to bed; he undressed, weary and worn out, and was soon sound -asleep; in the night he woke up feeling crowded and suffocated, and found -the old Boer and his fat wife in bed with him, one on each side, with all -their clothes on, and snoring. He had to stay there and stand it--awake -and suffering--until toward dawn, when sleep again fell upon him for an -hour. Then he woke again. The Boer was gone, but the wife was still at -his side. - -Those Reformers detested that Boer prison; they were not used to cramped -quarters and tedious hours, and weary idleness, and early to bed, and -limited movement, and arbitrary and irritating rules, and the absence of -the luxuries which wealth comforts the day and the night with. The -confinement told upon their bodies and their spirits; still, they were -superior men, and they made the best that was to be made of the -circumstances. Their wives smuggled delicacies to them, which helped to -smooth the way down for the prison fare. - -In the train Mr. B. told me that the Boer jail-guards treated the black -prisoners--even political ones--mercilessly. An African chief and his -following had been kept there nine months without trial, and during all -that time they had been without shelter from rain and sun. He said that -one day the guards put a big black in the stocks for dashing his soup on -the ground; they stretched his legs painfully wide apart, and set him -with his back down hill; he could not endure it, and put back his hands -upon the slope for a support. The guard ordered him to withdraw the -support and kicked him in the back. "Then," said Mr. B., "'the powerful -black wrenched the stocks asunder and went for the guard; a Reform -prisoner pulled him off, and thrashed the guard himself." - - - - -CHAPTER LXIX. - -The very ink with which all history is written is merely fluid prejudice. - --Pudd'nhead Wilsons's New Calendar. - -There isn't a Parallel of Latitude but thinks it would have been the -Equator if it had had its rights. - --Pudd'nhead Wilson's New Calendar. - -Next to Mr. Rhodes, to me the most interesting convulsion of nature in -South Africa was the diamond-crater. The Rand gold fields are a -stupendous marvel, and they make all other gold fields small, but I was -not a stranger to gold-mining; the veldt was a noble thing to see, but it -was only another and lovelier variety of our Great Plains; the natives -were very far from being uninteresting, but they were not new; and as for -the towns, I could find my way without a guide through the most of them -because I had learned the streets, under other names, in towns just like -them in other lands; but the diamond mine was a wholly fresh thing, a -splendid and absorbing novelty. Very few people in the world have seen -the diamond in its home. It has but three or four homes in the world, -whereas gold has a million. It is worth while to journey around the -globe to see anything which can truthfully be called a novelty, and the -diamond mine is the greatest and most select and restricted novelty which -the globe has in stock. - -The Kimberley diamond deposits were discovered about 1869, I think. When -everything is taken into consideration, the wonder is that they were not -discovered five thousand years ago and made familiar to the African world -for the rest of time. For this reason the first diamonds were found on -the surface of the ground. They were smooth and limpid, and in the -sunlight they vomited fire. They were the very things which an African -savage of any era would value above every other thing in the world -excepting a glass bead. For two or three centuries we have been buying -his lands, his cattle, his neighbor, and any other thing he had for sale, -for glass beads and so it is strange that he was indifferent to the -diamonds--for he must have pickets them up many and many a time. It -would not occur to him to try to sell them to whites, of course, since -the whites already had plenty of glass beads, and more fashionably -shaped, too, than these; but one would think that the poorer sort of -black, who could not afford real glass, would have been humbly content to -decorate himself with the imitation, and that presently the white trader -would notice the things, and dimly suspect, and carry some of them home, -and find out what they were, and at once empty a multitude of -fortune-hunters into Africa. There are many strange things in human -history; one of the strangest is that the sparkling diamonds laid there -so long without exciting any one's interest. - -The revelation came at last by accident. In a Boer's hut out in the wide -solitude of the plains, a traveling stranger noticed a child playing with -a bright object, and was told it was a piece of glass which had been -found in the veldt. The stranger bought it for a trifle and carried it -away; and being without honor, made another stranger believe it was a -diamond, and so got $125 out of him for it, and was as pleased with -himself as if he had done a righteous thing. In Paris the wronged -stranger sold it to a pawnshop for $10,000, who sold it to a countess for -$90,000, who sold it to a brewer for $800;000, who traded it to a king -for a dukedom and a pedigree, and the king "put it up the spout." ---[handwritten note: "From the Greek meaning 'pawned it.'" M.T.]--I know -these particulars to be correct. - -The news flew around, and the South African diamond-boom began. The -original traveler--the dishonest one--now remembered that he had once -seen a Boer teamster chocking his wagon-wheel on a steep grade with a -diamond as large as a football, and he laid aside his occupations and -started out to hunt for it, but not with the intention of cheating -anybody out of $125 with it, for he had reformed. - -We now come to matters more didactic. Diamonds are not imbedded in rock -ledges fifty miles long, like the Johannesburg gold, but are distributed -through the rubbish of a filled-up well, so to speak. The well is rich, -its walls are sharply defined; outside of the walls are no diamonds. The -well is a crater, and a large one. Before it had been meddled with, its -surface was even with the level plain, and there was no sign to suggest -that it was there. The pasturage covering the surface of the Kimberley -crater was sufficient for the support of a cow, and the pasturage -underneath was sufficient for the support of a kingdom; but the cow did -not know it, and lost her chance. - -The Kimberley crater is roomy enough to admit the Roman Coliseum; the -bottom of the crater has not been reached, and no one can tell how far -down in the bowels of the earth it goes. Originally, it was a -perpendicular hole packed solidly full of blue rock or cement, and -scattered through that blue mass, like raisins in a pudding, were the -diamonds. As deep down in the earth as the blue stuff extends, so deep -will the diamonds be found. - -There are three or four other celebrated craters near by a circle three -miles in diameter would enclose them all. They are owned by the De Beers -Company, a consolidation of diamond properties arranged by Mr. Rhodes -twelve or fourteen years ago. The De Beers owns other craters; they are -under the grass, but the De Beers knows where they are, and will open -them some day, if the market should require it. - -Originally, the diamond deposits were the property of the Orange Free -State; but a judicious "rectification" of the boundary line shifted them -over into the British territory of Cape Colony. A high official of the -Free State told me that the sum of $4,00,000 was handed to his -commonwealth as a compromise, or indemnity, or something of the sort, and -that he thought his commonwealth did wisely to take the money and keep -out of a dispute, since the power was all on the one side and the -weakness all on the other. The De Beers Company dig out $400,000 worth -of diamonds per week, now. The Cape got the territory, but no profit; -for Mr. Rhodes and the Rothschilds and the other De Beers people own the -mines, and they pay no taxes. - -In our day the mines are worked upon scientific principles, under the -guidance of the ablest mining-engineering talent procurable in America. -There are elaborate works for reducing the blue rock and passing it -through one process after another until every diamond it contains has -been hunted down and secured. I watched the "concentrators" at work big -tanks containing mud and water and invisible diamonds--and was told that -each could stir and churn and properly treat 300 car-loads of mud per day -1,600 pounds to the car-load--and reduce it to 3 car-loads of slush. I -saw the 3 carloads of slush taken to the "pulsators" and there reduced to -quarter of a load of nice clean dark-colored sand. Then I followed it to -the sorting tables and saw the men deftly and swiftly spread it out and -brush it about and seize the diamonds as they showed up. I assisted, and -once I found a diamond half as large as an almond. It is an exciting -kind of fishing, and you feel a fine thrill of pleasure every time you -detect the glow of one of those limpid pebbles through the veil of dark -sand. I would like to spend my Saturday holidays in that charming sport -every now and then. Of course there are disappointments. Sometimes you -find a diamond which is not a diamond; it is only a quartz crystal or -some such worthless thing. The expert can generally distinguish it from -the precious stone which it is counterfeiting; but if he is in doubt he -lays it on a flatiron and hits it with a sledgehammer. If it is a -diamond it holds its own; if it is anything else, it is reduced to -powder. I liked that experiment very much, and did not tire of -repetitions of it. It was full of enjoyable apprehensions, unmarred by -any personal sense of risk. The De Beers concern treats 8;000 carloads ---about 6,000 tons--of blue rock per day, and the result is three pounds of -diamonds. Value, uncut, $50,000 to $70,000. After cutting, they will -weigh considerably less than a pound, but will be worth four or five -times as much as they were before. - -All the plain around that region is spread over, a foot deep, with blue -rock, placed there by the Company, and looks like a plowed field. -Exposure for a length of time make the rock easier to work than it is -when it comes out of the mine. If mining should cease now, the supply of -rock spread over those fields would furnish the usual 8,000 car-loads per -day to the separating works during three years. The fields are fenced -and watched; and at night they are under the constant inspection of lofty -electric searchlight. They contain fifty or sixty million dollars' -worth' of diamonds, and there is an abundance of enterprising thieves -around. - -In the dirt of the Kimberley streets there is much hidden wealth. Some -time ago the people were granted the privilege of a free wash-up. There -was a general rush, the work was done with thoroughness, and a good -harvest of diamonds was gathered. - -The deep mining is done by natives. There are many hundreds of them. -They live in quarters built around the inside of a great compound. They -are a jolly and good-natured lot, and accommodating. They performed a -war-dance for us, which was the wildest exhibition I have ever seen. -They are not allowed outside of the compound during their term of service -three months, I think it, is, as a rule. They go down the shaft, stand -their watch, come up again, are searched, and go to bed or to their -amusements in the compound; and this routine they repeat, day in and day -out. - -It is thought that they do not now steal many diamonds successfully. -They used to swallow them, and find other ways of concealing them, but -the white man found ways of beating their various games. One man cut his -leg and shoved a diamond into the wound, but even that project did not -succeed. When they find a fine large diamond they are more likely to -report it than to steal it, for in the former case they get a reward, and -in the latter they are quite apt to merely get into trouble. Some years -ago, in a mine not owned by the De Beers, a black found what has been -claimed to be the largest diamond known to the world's history; and, as a -reward he was released from service and given a blanket, a horse, and -five hundred dollars. It made him a Vanderbilt. He could buy four -wives, and have money left. Four wives are an ample support for a -native. With four wives he is wholly independent, and need never do a -stroke of work again. - -That great diamond weighs 97l carats. Some say it is as big as a piece -of alum, others say it is as large as a bite of rock candy, but the best -authorities agree that it is almost exactly the size of a chunk of ice. -But those details are not important; and in my opinion not trustworthy. -It has a flaw in it, otherwise it would be of incredible value. As it -is, it is held to be worth $2,000,000. After cutting it ought to be -worth from $5,000,000 to $8,000,000, therefore persons desiring to save -money should buy it now. It is owned by a syndicate, and apparently -there is no satisfactory market for it. It is earning nothing; it is -eating its head off. Up to this time it has made nobody rich but the -native who found it. - -He found it in a mine which was being worked by contract. That is to -say, a company had bought the privilege of taking from the mine 5,000,000 -carloads of blue-rock, for a sum down and a royalty. Their speculation -had not paid; but on the very day that their privilege ran out that -native found the $2,000,000-diamond and handed it over to them. Even the -diamond culture is not without its romantic episodes. - -The Koh-i-Noor is a large diamond, and valuable; but it cannot compete in -these matters with three which--according to legend--are among the crown -trinkets of Portugal and Russia. One of these is held to be worth -$20,000,000; another, $25,000,000, and the third something over -$28,000,000. - -Those are truly wonderful diamonds, whether they exist or not; and yet -they are of but little importance by comparison with the one wherewith -the Boer wagoner chocked his wheel on that steep grade as heretofore -referred to. In Kimberley I had some conversation with the man who saw -the Boer do that--an incident which had occurred twenty-seven or -twenty-eight years before I had my talk with him. He assured me that -that diamond's value could have been over a billion dollars, but not -under it. I believed him, because he had devoted twenty-seven years to -hunting for it, and was, in a position to know. - -A fitting and interesting finish to an examination of the tedious and -laborious and costly processes whereby the diamonds are gotten out of the -deeps of the earth and freed from the base stuffs which imprison them is -the visit to the De Beers offices in the town of Kimberley, where the -result of each day's mining is brought every day, and, weighed, assorted, -valued, and deposited in safes against shipping-day. An unknown and -unaccredited person cannot, get into that place; and it seemed apparent -from the generous supply of warning and protective and prohibitory signs -that were posted all about, that not even the known and accredited can -steal diamonds there without inconvenience. - -We saw the day's output--shining little nests of diamonds, distributed a -foot apart, along a counter, each nest reposing upon a sheet of white -paper. That day's catch was about $70,000 worth. In the course of a -year half a ton of diamonds pass under the scales there and sleep on that -counter; the resulting money is $18,000,000 or $20,000,000. Profit, -about $12,000,000. - -Young girls were doing the sorting--a nice, clean, dainty, and probably -distressing employment. Every day ducal incomes sift and sparkle through -the fingers of those young girls; yet they go to bed at night as poor as -they were when they got up in the morning. The same thing next day, and -all the days. - -They are beautiful things, those diamonds, in their native state. They -are of various shapes; they have flat surfaces, rounded borders, and -never a sharp edge. They are of all colors and shades of color, from -dewdrop white to actual black; and their smooth and rounded surfaces and -contours, variety of color, and transparent limpidity make them look like -piles of assorted candies. A very light straw color is their commonest -tint. It seemed to me that these uncut gems must be more beautiful than -any cut ones could be; but when a collection of cut ones was brought out, -I saw my mistake. Nothing is so beautiful as a rose diamond with the -light playing through it, except that uncostly thing which is just like -it--wavy sea-water with the sunlight playing through it and striking a -white-sand bottom. - -Before the middle of July we reached Cape Town, and the end of our -African journeyings. And well satisfied; for, towering above us was -Table Mountain--a reminder that we had now seen each and all of the great -features of South Africa except Mr. Cecil Rhodes. I realize that that is -a large exception. I know quite well that whether Mr. Rhodes is the -lofty and worshipful patriot and statesman that multitudes believe him to -be, or Satan come again, as the rest of the world account him, he is -still the most imposing figure in the British empire outside of England. -When he stands on the Cape of Good Hope, his shadow falls to the Zambesi. -He is the only colonial in the British dominions whose goings and comings -are chronicled and discussed under all the globe's meridians, and whose -speeches, unclipped, are cabled from the ends of the earth; and he is the -only unroyal outsider whose arrival in London can compete for attention -with an eclipse. - -That he is an extraordinary man, and not an accident of fortune, not even -his dearest South African enemies were willing to deny, so far as I heard -them testify. The whole South African world seemed to stand in a kind of -shuddering awe of him, friend and enemy alike. It was as if he were -deputy-God on the one side, deputy-Satan on the other, proprietor of the -people, able to make them or ruin them by his breath, worshiped by many, -hated by many, but blasphemed by none among the judicious, and even by -the indiscreet in guarded whispers only. - -What is the secret of his formidable supremacy? One says it is his -prodigious wealth--a wealth whose drippings in salaries and in other ways -support multitudes and make them his interested and loyal vassals; -another says it is his personal magnetism and his persuasive tongue, and -that these hypnotize and make happy slaves of all that drift within the -circle of their influence; another says it is his majestic ideas, his -vast schemes for the territorial aggrandizement of England, his patriotic -and unselfish ambition to spread her beneficent protection and her just -rule over the pagan wastes of Africa and make luminous the African -darkness with the glory of her name; and another says he wants the earth -and wants it for his own, and that the belief that he will get it and let -his friends in on the ground floor is the secret that rivets so many eyes -upon him and keeps him in the zenith where the view is unobstructed. - -One may take his choice. They are all the same price. One fact is sure: -he keeps his prominence and a vast following, no matter what he does. He -"deceives" the Duke of Fife--it is the Duke's word--but that does not -destroy the Duke's loyalty to him. He tricks the Reformers into immense -trouble with his Raid, but the most of them believe he meant well. He -weeps over the harshly--taxed Johannesburgers and makes them his friends; -at the same time he taxes his Charter-settlers 50 per cent., and so wins -their affection and their confidence that they are squelched with despair -at every rumor that the Charter is to be annulled. He raids and robs and -slays and enslaves the Matabele and gets worlds of Charter-Christian -applause for it. He has beguiled England into buying Charter waste paper -for Bank of England notes, ton for ton, and the ravished still burn -incense to him as the Eventual God of Plenty. He has done everything he -could think of to pull himself down to the ground; he has done more than -enough to pull sixteen common-run great men down; yet there he stands, to -this day, upon his dizzy summit under the dome of the sky, an apparent -permanency, the marvel of the time, the mystery of the age, an Archangel -with wings to half the world, Satan with a tail to the other half. - -I admire him, I frankly confess it; and when his time comes I shall buy a -piece of the rope for a keepsake. - - - - -CONCLUSION. - -I have traveled more than anyone else, and I have noticed that even the -angels speak English with an accent. - --Pudd'nhead Wilson's New Calendar. - -I saw Table Rock, anyway--a majestic pile. It is 3,000 feet high. It is -also 17,000 feet high. These figures may be relied upon. I got them in -Cape Town from the two best-informed citizens, men who had made Table -Rock the study of their lives. And I saw Table Bay, so named for its -levelness. I saw the Castle--built by the Dutch East India Company three -hundred years ago--where the Commanding General lives; I saw St. Simon's -Bay, where the Admiral lives. I saw the Government, also the Parliament, -where they quarreled in two languages when I was there, and agreed in -none. I saw the club. I saw and explored the beautiful sea-girt drives -that wind about the mountains and through the paradise where the villas -are: Also I saw some of the fine old Dutch mansions, pleasant homes of -the early times, pleasant homes to-day, and enjoyed the privilege of -their hospitalities. - -And just before I sailed I saw in one of them a quaint old picture which -was a link in a curious romance--a picture of a pale, intellectual young -man in a pink coat with a high black collar. It was a portrait of Dr. -James Barry, a military surgeon who came out to the Cape fifty years ago -with his regiment. He was a wild young fellow, and was guilty of various -kinds of misbehavior. He was several times reported to headquarters in -England, and it was in each case expected that orders would come out to -deal with him promptly and severely, but for some mysterious reason no -orders of any kind ever came back--nothing came but just an impressive -silence. This made him an imposing and uncanny wonder to the town. - -Next, he was promoted-away up. He was made Medical Superintendent -General, and transferred to India. Presently he was back at the Cape -again and at his escapades once more. There were plenty of pretty girls, -but none of them caught him, none of them could get hold of his heart; -evidently he was not a marrying man. And that was another marvel, -another puzzle, and made no end of perplexed talk. Once he was called in -the night, an obstetric service, to do what he could for a woman who was -believed to be dying. He was prompt and scientific, and saved both -mother and child. There are other instances of record which testify to -his mastership of his profession; and many which testify to his love of -it and his devotion to it. Among other adventures of his was a duel of a -desperate sort, fought with swords, at the Castle. He killed his man. - -The child heretofore mentioned as having been saved by Dr. Barry so long -ago, was named for him, and still lives in Cape Town. He had Dr. -Barry's portrait painted, and gave it to the gentleman in whose old Dutch -house I saw it--the quaint figure in pink coat and high black collar. - -The story seems to be arriving nowhere. But that is because I have not -finished. Dr. Barry died in Cape Town 30 years ago. It was then -discovered that he was a woman. - -The legend goes that enquiries--soon silenced--developed the fact that -she was a daughter of a great English house, and that that was why her -Cape wildnesses brought no punishment and got no notice when reported to -the government at home. Her name was an alias. She had disgraced -herself with her people; so she chose to change her name and her sex and -take a new start in the world. - -We sailed on the 15th of July in the Norman, a beautiful ship, perfectly -appointed. The voyage to England occupied a short fortnight, without a -stop except at Madeira. A good and restful voyage for tired people, and -there were several of us. I seemed to have been lecturing a thousand -years, though it was only a twelvemonth, and a considerable number of the -others were Reformers who were fagged out with their five months of -seclusion in the Pretoria prison. - -Our trip around the earth ended at the Southampton pier, where we -embarked thirteen months before. It seemed a fine and large thing to -have accomplished--the circumnavigation of this great globe in that -little time, and I was privately proud of it. For a moment. -Then came one of those vanity-snubbing astronomical reports from the -Observatory-people, whereby it appeared that another great body of light -had lately flamed up in the remotenesses of space which was traveling at -a gait which would enable it to do all that I had done in a minute and a -half. Human pride is not worth while; there is always something lying in -wait to take the wind out of it. - - - - - -End of the Project Gutenberg EBook of Following the Equator, Complete -by Mark Twain (Samuel Clemens) - -*** END OF THIS PROJECT GUTENBERG EBOOK FOLLOWING THE EQUATOR, COMPLETE *** - -***** This file should be named 2895.txt or 2895.zip ***** -This and all associated files of various formats will be found in: - http://www.gutenberg.net/2/8/9/2895/ - -Produced by David Widger - -Updated editions will replace the previous one--the old editions -will be renamed. - -Creating the works from public domain print editions means that no -one owns a United States copyright in these works, so the Foundation -(and you!) can copy and distribute it in the United States without -permission and without paying copyright royalties. Special rules, -set forth in the General Terms of Use part of this license, apply to -copying and distributing Project Gutenberg-tm electronic works to -protect the PROJECT GUTENBERG-tm concept and trademark. Project -Gutenberg is a registered trademark, and may not be used if you -charge for the eBooks, unless you receive specific permission. If you -do not charge anything for copies of this eBook, complying with the -rules is very easy. You may use this eBook for nearly any purpose -such as creation of derivative works, reports, performances and -research. They may be modified and printed and given away--you may do -practically ANYTHING with public domain eBooks. Redistribution is -subject to the trademark license, especially commercial -redistribution. - - - -*** START: FULL LICENSE *** - -THE FULL PROJECT GUTENBERG LICENSE -PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK - -To protect the Project Gutenberg-tm mission of promoting the free -distribution of electronic works, by using or distributing this work -(or any other work associated in any way with the phrase "Project -Gutenberg"), you agree to comply with all the terms of the Full Project -Gutenberg-tm License (available with this file or online at -http://gutenberg.net/license). - - -Section 1. General Terms of Use and Redistributing Project Gutenberg-tm -electronic works - -1.A. By reading or using any part of this Project Gutenberg-tm -electronic work, you indicate that you have read, understand, agree to -and accept all the terms of this license and intellectual property -(trademark/copyright) agreement. If you do not agree to abide by all -the terms of this agreement, you must cease using and return or destroy -all copies of Project Gutenberg-tm electronic works in your possession. -If you paid a fee for obtaining a copy of or access to a Project -Gutenberg-tm electronic work and you do not agree to be bound by the -terms of this agreement, you may obtain a refund from the person or -entity to whom you paid the fee as set forth in paragraph 1.E.8. - -1.B. "Project Gutenberg" is a registered trademark. It may only be -used on or associated in any way with an electronic work by people who -agree to be bound by the terms of this agreement. There are a few -things that you can do with most Project Gutenberg-tm electronic works -even without complying with the full terms of this agreement. See -paragraph 1.C below. There are a lot of things you can do with Project -Gutenberg-tm electronic works if you follow the terms of this agreement -and help preserve free future access to Project Gutenberg-tm electronic -works. See paragraph 1.E below. - -1.C. The Project Gutenberg Literary Archive Foundation ("the Foundation" -or PGLAF), owns a compilation copyright in the collection of Project -Gutenberg-tm electronic works. Nearly all the individual works in the -collection are in the public domain in the United States. If an -individual work is in the public domain in the United States and you are -located in the United States, we do not claim a right to prevent you from -copying, distributing, performing, displaying or creating derivative -works based on the work as long as all references to Project Gutenberg -are removed. Of course, we hope that you will support the Project -Gutenberg-tm mission of promoting free access to electronic works by -freely sharing Project Gutenberg-tm works in compliance with the terms of -this agreement for keeping the Project Gutenberg-tm name associated with -the work. You can easily comply with the terms of this agreement by -keeping this work in the same format with its attached full Project -Gutenberg-tm License when you share it without charge with others. - -1.D. The copyright laws of the place where you are located also govern -what you can do with this work. Copyright laws in most countries are in -a constant state of change. If you are outside the United States, check -the laws of your country in addition to the terms of this agreement -before downloading, copying, displaying, performing, distributing or -creating derivative works based on this work or any other Project -Gutenberg-tm work. The Foundation makes no representations concerning -the copyright status of any work in any country outside the United -States. - -1.E. Unless you have removed all references to Project Gutenberg: - -1.E.1. The following sentence, with active links to, or other immediate -access to, the full Project Gutenberg-tm License must appear prominently -whenever any copy of a Project Gutenberg-tm work (any work on which the -phrase "Project Gutenberg" appears, or with which the phrase "Project -Gutenberg" is associated) is accessed, displayed, performed, viewed, -copied or distributed: - -This eBook is for the use of anyone anywhere at no cost and with -almost no restrictions whatsoever. You may copy it, give it away or -re-use it under the terms of the Project Gutenberg License included -with this eBook or online at www.gutenberg.net - -1.E.2. If an individual Project Gutenberg-tm electronic work is derived -from the public domain (does not contain a notice indicating that it is -posted with permission of the copyright holder), the work can be copied -and distributed to anyone in the United States without paying any fees -or charges. If you are redistributing or providing access to a work -with the phrase "Project Gutenberg" associated with or appearing on the -work, you must comply either with the requirements of paragraphs 1.E.1 -through 1.E.7 or obtain permission for the use of the work and the -Project Gutenberg-tm trademark as set forth in paragraphs 1.E.8 or -1.E.9. - -1.E.3. If an individual Project Gutenberg-tm electronic work is posted -with the permission of the copyright holder, your use and distribution -must comply with both paragraphs 1.E.1 through 1.E.7 and any additional -terms imposed by the copyright holder. Additional terms will be linked -to the Project Gutenberg-tm License for all works posted with the -permission of the copyright holder found at the beginning of this work. - -1.E.4. Do not unlink or detach or remove the full Project Gutenberg-tm -License terms from this work, or any files containing a part of this -work or any other work associated with Project Gutenberg-tm. - -1.E.5. Do not copy, display, perform, distribute or redistribute this -electronic work, or any part of this electronic work, without -prominently displaying the sentence set forth in paragraph 1.E.1 with -active links or immediate access to the full terms of the Project -Gutenberg-tm License. - -1.E.6. You may convert to and distribute this work in any binary, -compressed, marked up, nonproprietary or proprietary form, including any -word processing or hypertext form. However, if you provide access to or -distribute copies of a Project Gutenberg-tm work in a format other than -"Plain Vanilla ASCII" or other format used in the official version -posted on the official Project Gutenberg-tm web site (www.gutenberg.net), -you must, at no additional cost, fee or expense to the user, provide a -copy, a means of exporting a copy, or a means of obtaining a copy upon -request, of the work in its original "Plain Vanilla ASCII" or other -form. Any alternate format must include the full Project Gutenberg-tm -License as specified in paragraph 1.E.1. - -1.E.7. Do not charge a fee for access to, viewing, displaying, -performing, copying or distributing any Project Gutenberg-tm works -unless you comply with paragraph 1.E.8 or 1.E.9. - -1.E.8. You may charge a reasonable fee for copies of or providing -access to or distributing Project Gutenberg-tm electronic works provided -that - -- You pay a royalty fee of 20% of the gross profits you derive from - the use of Project Gutenberg-tm works calculated using the method - you already use to calculate your applicable taxes. The fee is - owed to the owner of the Project Gutenberg-tm trademark, but he - has agreed to donate royalties under this paragraph to the - Project Gutenberg Literary Archive Foundation. Royalty payments - must be paid within 60 days following each date on which you - prepare (or are legally required to prepare) your periodic tax - returns. Royalty payments should be clearly marked as such and - sent to the Project Gutenberg Literary Archive Foundation at the - address specified in Section 4, "Information about donations to - the Project Gutenberg Literary Archive Foundation." - -- You provide a full refund of any money paid by a user who notifies - you in writing (or by e-mail) within 30 days of receipt that s/he - does not agree to the terms of the full Project Gutenberg-tm - License. You must require such a user to return or - destroy all copies of the works possessed in a physical medium - and discontinue all use of and all access to other copies of - Project Gutenberg-tm works. - -- You provide, in accordance with paragraph 1.F.3, a full refund of any - money paid for a work or a replacement copy, if a defect in the - electronic work is discovered and reported to you within 90 days - of receipt of the work. - -- You comply with all other terms of this agreement for free - distribution of Project Gutenberg-tm works. - -1.E.9. If you wish to charge a fee or distribute a Project Gutenberg-tm -electronic work or group of works on different terms than are set -forth in this agreement, you must obtain permission in writing from -both the Project Gutenberg Literary Archive Foundation and Michael -Hart, the owner of the Project Gutenberg-tm trademark. Contact the -Foundation as set forth in Section 3 below. - -1.F. - -1.F.1. Project Gutenberg volunteers and employees expend considerable -effort to identify, do copyright research on, transcribe and proofread -public domain works in creating the Project Gutenberg-tm -collection. Despite these efforts, Project Gutenberg-tm electronic -works, and the medium on which they may be stored, may contain -"Defects," such as, but not limited to, incomplete, inaccurate or -corrupt data, transcription errors, a copyright or other intellectual -property infringement, a defective or damaged disk or other medium, a -computer virus, or computer codes that damage or cannot be read by -your equipment. - -1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for the "Right -of Replacement or Refund" described in paragraph 1.F.3, the Project -Gutenberg Literary Archive Foundation, the owner of the Project -Gutenberg-tm trademark, and any other party distributing a Project -Gutenberg-tm electronic work under this agreement, disclaim all -liability to you for damages, costs and expenses, including legal -fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT -LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE -PROVIDED IN PARAGRAPH F3. YOU AGREE THAT THE FOUNDATION, THE -TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE -LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE OR -INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH -DAMAGE. - -1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you discover a -defect in this electronic work within 90 days of receiving it, you can -receive a refund of the money (if any) you paid for it by sending a -written explanation to the person you received the work from. If you -received the work on a physical medium, you must return the medium with -your written explanation. The person or entity that provided you with -the defective work may elect to provide a replacement copy in lieu of a -refund. If you received the work electronically, the person or entity -providing it to you may choose to give you a second opportunity to -receive the work electronically in lieu of a refund. If the second copy -is also defective, you may demand a refund in writing without further -opportunities to fix the problem. - -1.F.4. Except for the limited right of replacement or refund set forth -in paragraph 1.F.3, this work is provided to you 'AS-IS' WITH NO OTHER -WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO -WARRANTIES OF MERCHANTIBILITY OR FITNESS FOR ANY PURPOSE. - -1.F.5. Some states do not allow disclaimers of certain implied -warranties or the exclusion or limitation of certain types of damages. -If any disclaimer or limitation set forth in this agreement violates the -law of the state applicable to this agreement, the agreement shall be -interpreted to make the maximum disclaimer or limitation permitted by -the applicable state law. The invalidity or unenforceability of any -provision of this agreement shall not void the remaining provisions. - -1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation, the -trademark owner, any agent or employee of the Foundation, anyone -providing copies of Project Gutenberg-tm electronic works in accordance -with this agreement, and any volunteers associated with the production, -promotion and distribution of Project Gutenberg-tm electronic works, -harmless from all liability, costs and expenses, including legal fees, -that arise directly or indirectly from any of the following which you do -or cause to occur: (a) distribution of this or any Project Gutenberg-tm -work, (b) alteration, modification, or additions or deletions to any -Project Gutenberg-tm work, and (c) any Defect you cause. - - -Section 2. Information about the Mission of Project Gutenberg-tm - -Project Gutenberg-tm is synonymous with the free distribution of -electronic works in formats readable by the widest variety of computers -including obsolete, old, middle-aged and new computers. It exists -because of the efforts of hundreds of volunteers and donations from -people in all walks of life. - -Volunteers and financial support to provide volunteers with the -assistance they need, is critical to reaching Project Gutenberg-tm's -goals and ensuring that the Project Gutenberg-tm collection will -remain freely available for generations to come. In 2001, the Project -Gutenberg Literary Archive Foundation was created to provide a secure -and permanent future for Project Gutenberg-tm and future generations. -To learn more about the Project Gutenberg Literary Archive Foundation -and how your efforts and donations can help, see Sections 3 and 4 -and the Foundation web page at http://www.pglaf.org. - - -Section 3. Information about the Project Gutenberg Literary Archive -Foundation - -The Project Gutenberg Literary Archive Foundation is a non profit -501(c)(3) educational corporation organized under the laws of the -state of Mississippi and granted tax exempt status by the Internal -Revenue Service. The Foundation's EIN or federal tax identification -number is 64-6221541. Its 501(c)(3) letter is posted at -http://pglaf.org/fundraising. Contributions to the Project Gutenberg -Literary Archive Foundation are tax deductible to the full extent -permitted by U.S. federal laws and your state's laws. - -The Foundation's principal office is located at 4557 Melan Dr. S. -Fairbanks, AK, 99712., but its volunteers and employees are scattered -throughout numerous locations. Its business office is located at -809 North 1500 West, Salt Lake City, UT 84116, (801) 596-1887, email -business@pglaf.org. Email contact links and up to date contact -information can be found at the Foundation's web site and official -page at http://pglaf.org - -For additional contact information: - Dr. Gregory B. Newby - Chief Executive and Director - gbnewby@pglaf.org - - -Section 4. Information about Donations to the Project Gutenberg -Literary Archive Foundation - -Project Gutenberg-tm depends upon and cannot survive without wide -spread public support and donations to carry out its mission of -increasing the number of public domain and licensed works that can be -freely distributed in machine readable form accessible by the widest -array of equipment including outdated equipment. Many small donations -($1 to $5,000) are particularly important to maintaining tax exempt -status with the IRS. - -The Foundation is committed to complying with the laws regulating -charities and charitable donations in all 50 states of the United -States. Compliance requirements are not uniform and it takes a -considerable effort, much paperwork and many fees to meet and keep up -with these requirements. We do not solicit donations in locations -where we have not received written confirmation of compliance. To -SEND DONATIONS or determine the status of compliance for any -particular state visit http://pglaf.org - -While we cannot and do not solicit contributions from states where we -have not met the solicitation requirements, we know of no prohibition -against accepting unsolicited donations from donors in such states who -approach us with offers to donate. - -International donations are gratefully accepted, but we cannot make -any statements concerning tax treatment of donations received from -outside the United States. U.S. laws alone swamp our small staff. - -Please check the Project Gutenberg Web pages for current donation -methods and addresses. Donations are accepted in a number of other -ways including including checks, online payments and credit card -donations. To donate, please visit: http://pglaf.org/donate - - -Section 5. General Information About Project Gutenberg-tm electronic -works. - -Professor Michael S. Hart is the originator of the Project Gutenberg-tm -concept of a library of electronic works that could be freely shared -with anyone. For thirty years, he produced and distributed Project -Gutenberg-tm eBooks with only a loose network of volunteer support. - - -Project Gutenberg-tm eBooks are often created from several printed -editions, all of which are confirmed as Public Domain in the U.S. -unless a copyright notice is included. Thus, we do not necessarily -keep eBooks in compliance with any particular paper edition. - - -Most people start at our Web site which has the main PG search facility: - - http://www.gutenberg.net - -This Web site includes information about Project Gutenberg-tm, -including how to make donations to the Project Gutenberg Literary -Archive Foundation, how to help produce our new eBooks, and how to -subscribe to our email newsletter to hear about new eBooks. diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_01/Ex_01.pde deleted file mode 100755 index d5370e0f7..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_01/Ex_01.pde +++ /dev/null @@ -1,25 +0,0 @@ -class OverCircle { - int x, y; // The x- and y-coordinates - int diameter; // Diameter of the circle - int gray; // Gray value - - OverCircle(int xp, int yp, int d) { - x = xp; - y = yp; - diameter = d; - gray = 0; - } - - void update(int mx, int my) { - if (dist(mx, my, x, y) < diameter / 2) { - gray = 255; - } else { - gray = 0; - } - } - - void display() { - fill(gray); - ellipse(x, y, diameter, diameter); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_02/Ex_02.pde deleted file mode 100755 index b90c455ed..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_02/Ex_02.pde +++ /dev/null @@ -1,25 +0,0 @@ -class OverRect { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) of the rectangle - int gray; // Gray value - - OverRect(int xp, int yp, int s) { - x = xp; - y = yp; - size = s; - gray = 0; - } - - void update(int mx, int my) { - if ((mx > x) && (mx < x + size) && (my > y) && (my < y + size)) { - gray = 255; - } else { - gray = 0; - } - } - - void display() { - fill(gray); - rect(x, y, size, size); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/Ex_03.pde deleted file mode 100755 index bd49f80c9..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/Ex_03.pde +++ /dev/null @@ -1,17 +0,0 @@ -// Requires the OverRect and OverCircle classes -OverRect r = new OverRect(9, 30, 36); -OverCircle c = new OverCircle(72, 48, 40); - -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - background(204); - r.update(mouseX, mouseY); - r.display(); - c.update(mouseX, mouseY); - c.display(); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/OverCircle.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/OverCircle.pde deleted file mode 100755 index d5370e0f7..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/OverCircle.pde +++ /dev/null @@ -1,25 +0,0 @@ -class OverCircle { - int x, y; // The x- and y-coordinates - int diameter; // Diameter of the circle - int gray; // Gray value - - OverCircle(int xp, int yp, int d) { - x = xp; - y = yp; - diameter = d; - gray = 0; - } - - void update(int mx, int my) { - if (dist(mx, my, x, y) < diameter / 2) { - gray = 255; - } else { - gray = 0; - } - } - - void display() { - fill(gray); - ellipse(x, y, diameter, diameter); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/OverRect.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/OverRect.pde deleted file mode 100755 index b90c455ed..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/OverRect.pde +++ /dev/null @@ -1,25 +0,0 @@ -class OverRect { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) of the rectangle - int gray; // Gray value - - OverRect(int xp, int yp, int s) { - x = xp; - y = yp; - size = s; - gray = 0; - } - - void update(int mx, int my) { - if ((mx > x) && (mx < x + size) && (my > y) && (my < y + size)) { - gray = 255; - } else { - gray = 0; - } - } - - void display() { - fill(gray); - rect(x, y, size, size); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/Ex_04.pde deleted file mode 100755 index b033ad3e9..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/Ex_04.pde +++ /dev/null @@ -1,11 +0,0 @@ -void update(int mx, int my) { - if (dist(mx, my, x, y) < diameter / 2) { - if (gray < 250) { - gray++; - } - } else { - if (gray > 0.0) { - gray--; - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/OverCircle.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/OverCircle.pde deleted file mode 100755 index d5370e0f7..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/OverCircle.pde +++ /dev/null @@ -1,25 +0,0 @@ -class OverCircle { - int x, y; // The x- and y-coordinates - int diameter; // Diameter of the circle - int gray; // Gray value - - OverCircle(int xp, int yp, int d) { - x = xp; - y = yp; - diameter = d; - gray = 0; - } - - void update(int mx, int my) { - if (dist(mx, my, x, y) < diameter / 2) { - gray = 255; - } else { - gray = 0; - } - } - - void display() { - fill(gray); - ellipse(x, y, diameter, diameter); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/OverRect.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/OverRect.pde deleted file mode 100755 index b90c455ed..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/OverRect.pde +++ /dev/null @@ -1,25 +0,0 @@ -class OverRect { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) of the rectangle - int gray; // Gray value - - OverRect(int xp, int yp, int s) { - x = xp; - y = yp; - size = s; - gray = 0; - } - - void update(int mx, int my) { - if ((mx > x) && (mx < x + size) && (my > y) && (my < y + size)) { - gray = 255; - } else { - gray = 0; - } - } - - void display() { - fill(gray); - rect(x, y, size, size); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_05/Ex_05.pde deleted file mode 100755 index d5c5b63ce..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_05/Ex_05.pde +++ /dev/null @@ -1,53 +0,0 @@ -class Button { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) - color baseGray; // Default gray value - color overGray; // Value when mouse is over the button - color pressGray; // Value when mouse is over and pressed - boolean over = false; // True when the mouse is over - boolean pressed = false; // True when the mouse is over and pressed - - Button(int xp, int yp, int s, color b, color o, color p) { - x = xp; - y = yp; - size = s; - baseGray = b; - overGray = o; - pressGray = p; - } - - // Updates the over field every frame - void update() { - if ((mouseX >= x) && (mouseX <= x + size) && - (mouseY >= y) && (mouseY <= y + size)) { - over = true; - } else { - over = false; - } - } - - boolean press() { - if (over == true) { - pressed = true; - return true; - } else { - return false; - } - } - - void release() { - pressed = false; // Set to false when the mouse is released - } - - void display() { - if (pressed == true) { - fill(pressGray); - } else if (over == true) { - fill(overGray); - } else { - fill(baseGray); - } - stroke(255); - rect(x, y, size, size); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_06/Button.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_06/Button.pde deleted file mode 100755 index d5c5b63ce..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_06/Button.pde +++ /dev/null @@ -1,53 +0,0 @@ -class Button { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) - color baseGray; // Default gray value - color overGray; // Value when mouse is over the button - color pressGray; // Value when mouse is over and pressed - boolean over = false; // True when the mouse is over - boolean pressed = false; // True when the mouse is over and pressed - - Button(int xp, int yp, int s, color b, color o, color p) { - x = xp; - y = yp; - size = s; - baseGray = b; - overGray = o; - pressGray = p; - } - - // Updates the over field every frame - void update() { - if ((mouseX >= x) && (mouseX <= x + size) && - (mouseY >= y) && (mouseY <= y + size)) { - over = true; - } else { - over = false; - } - } - - boolean press() { - if (over == true) { - pressed = true; - return true; - } else { - return false; - } - } - - void release() { - pressed = false; // Set to false when the mouse is released - } - - void display() { - if (pressed == true) { - fill(pressGray); - } else if (over == true) { - fill(overGray); - } else { - fill(baseGray); - } - stroke(255); - rect(x, y, size, size); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_06/Ex_06.pde deleted file mode 100755 index e9b58b505..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_06/Ex_06.pde +++ /dev/null @@ -1,24 +0,0 @@ -Button button; - -void setup() { - size(100, 100); -// Inputs: x, y, size, -// base color, over color, press color - button = new Button(25, 25, 50, - color(204), color(255), color(0)); -} - -void draw() { - background(204); - stroke(255); - button.update(); - button.display(); -} - -void mousePressed() { - button.press(); -} - -void mouseReleased() { - button.release(); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_07/Button.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_07/Button.pde deleted file mode 100755 index d5c5b63ce..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_07/Button.pde +++ /dev/null @@ -1,53 +0,0 @@ -class Button { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) - color baseGray; // Default gray value - color overGray; // Value when mouse is over the button - color pressGray; // Value when mouse is over and pressed - boolean over = false; // True when the mouse is over - boolean pressed = false; // True when the mouse is over and pressed - - Button(int xp, int yp, int s, color b, color o, color p) { - x = xp; - y = yp; - size = s; - baseGray = b; - overGray = o; - pressGray = p; - } - - // Updates the over field every frame - void update() { - if ((mouseX >= x) && (mouseX <= x + size) && - (mouseY >= y) && (mouseY <= y + size)) { - over = true; - } else { - over = false; - } - } - - boolean press() { - if (over == true) { - pressed = true; - return true; - } else { - return false; - } - } - - void release() { - pressed = false; // Set to false when the mouse is released - } - - void display() { - if (pressed == true) { - fill(pressGray); - } else if (over == true) { - fill(overGray); - } else { - fill(baseGray); - } - stroke(255); - rect(x, y, size, size); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_07/Ex_07.pde deleted file mode 100755 index c7d0c4371..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_07/Ex_07.pde +++ /dev/null @@ -1,55 +0,0 @@ -// Requires the Button class -Button button1, button2, button3; -int mode = 1; - -void setup() { - size(100, 100); - smooth(); - color gray = color(204); - color white = color(255); - color black = color(0); - button1 = new Button(10, 80, 10, gray, white, black); - button2 = new Button(25, 80, 10, gray, white, black); - button3 = new Button(40, 80, 10, gray, white, black); -} - -void draw() { - background(204); - manageButtons(); - noStroke(); - fill(0); - if (mode == 1) { - ellipse(0, 40, 60, 60); - } else if (mode == 2) { - ellipse(50, 40, 60, 60); - } else if (mode == 3) { - ellipse(100, 40, 60, 60); - } -} - -void manageButtons() { - button1.update(); - button2.update(); - button3.update(); - button1.display(); - button2.display(); - button3.display(); -} - -void mousePressed() { - if (button1.press() == true) { - mode = 1; - } - if (button2.press() == true) { - mode = 2; - } - if (button3.press() == true) { - mode = 3; - } -} - -void mouseReleased() { - button1.release(); - button2.release(); - button3.release(); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_08/Ex_08.pde deleted file mode 100755 index d0d2217b8..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_08/Ex_08.pde +++ /dev/null @@ -1,31 +0,0 @@ -class Check { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) - color baseGray; // Default gray value - boolean checked = false; // True when the check box is selected - - Check(int xp, int yp, int s, color b) { - x = xp; - y = yp; - size = s; - baseGray = b; - } - - // Updates the boolean variable checked - void press(float mx, float my) { - if ((mx >= x) && (mx <= x + size) && (my >= y) && (my <= y + size)) { - checked = !checked; // Toggle the check box on and off - } - } - - // Draws the box and an X inside if the checked variable is true - void display() { - stroke(255); - fill(baseGray); - rect(x, y, size, size); - if (checked == true) { - line(x, y, x + size, y + size); - line(x + size, y, x, y + size); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_09/Check.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_09/Check.pde deleted file mode 100755 index d0d2217b8..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_09/Check.pde +++ /dev/null @@ -1,31 +0,0 @@ -class Check { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) - color baseGray; // Default gray value - boolean checked = false; // True when the check box is selected - - Check(int xp, int yp, int s, color b) { - x = xp; - y = yp; - size = s; - baseGray = b; - } - - // Updates the boolean variable checked - void press(float mx, float my) { - if ((mx >= x) && (mx <= x + size) && (my >= y) && (my <= y + size)) { - checked = !checked; // Toggle the check box on and off - } - } - - // Draws the box and an X inside if the checked variable is true - void display() { - stroke(255); - fill(baseGray); - rect(x, y, size, size); - if (checked == true) { - line(x, y, x + size, y + size); - line(x + size, y, x, y + size); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_09/Ex_09.pde deleted file mode 100755 index 54b9f1d44..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_09/Ex_09.pde +++ /dev/null @@ -1,16 +0,0 @@ -Check check; - -void setup() { - size(100, 100); -// Inputs: x, y, size, fill color - check = new Check(25, 25, 50, color(0)); -} - -void draw() { - background(204); - check.display(); -} - -void mousePressed() { - check.press(mouseX, mouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_10/Check.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_10/Check.pde deleted file mode 100755 index d0d2217b8..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_10/Check.pde +++ /dev/null @@ -1,31 +0,0 @@ -class Check { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) - color baseGray; // Default gray value - boolean checked = false; // True when the check box is selected - - Check(int xp, int yp, int s, color b) { - x = xp; - y = yp; - size = s; - baseGray = b; - } - - // Updates the boolean variable checked - void press(float mx, float my) { - if ((mx >= x) && (mx <= x + size) && (my >= y) && (my <= y + size)) { - checked = !checked; // Toggle the check box on and off - } - } - - // Draws the box and an X inside if the checked variable is true - void display() { - stroke(255); - fill(baseGray); - rect(x, y, size, size); - if (checked == true) { - line(x, y, x + size, y + size); - line(x + size, y, x, y + size); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_10/Ex_10.pde deleted file mode 100755 index 6b20c3db2..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_10/Ex_10.pde +++ /dev/null @@ -1,31 +0,0 @@ -// Requires the Check class -int numChecks = 25; -Check[] checks = new Check[numChecks]; - - -void setup() { - size(100, 100); - int x = 14; - int y = 14; - for (int i = 0; i < numChecks; i++) { - checks[i] = new Check(x, y, 12, color(0)); - x += 15; - if (x > 80) { - x = 14; - y += 15; - } - } -} - -void draw() { - background(0); - for (int i = 0; i < numChecks; i++) { - checks[i].display(); - } -} - -void mousePressed() { - for (int i = 0; i < numChecks; i++) { - checks[i].press(mouseX, mouseY); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_11/Ex_11.pde deleted file mode 100755 index 7c37a79e8..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_11/Ex_11.pde +++ /dev/null @@ -1,46 +0,0 @@ -class Radio { - int x, y; // The x- and y-coordinates of the rect - int size, dotSize; // Dimension of circle, inner circle - color baseGray, dotGray; // Circle gray value, inner gray value - boolean checked = false; // True when the button is selected - int me; // ID number for this Radio object - Radio[] others; // Array of all other Radio objects - - Radio(int xp, int yp, int s, color b, color d, int m, Radio[] o) { - x = xp; - y = yp; - size = s; - dotSize = size - size / 3; - ; - baseGray = b; - dotGray = d; - others = o; - me = m; - } - - // Updates the boolean value press, returns true or false - boolean press(float mx, float my) { - if (dist(x, y, mx, my) < size / 2) { - checked = true; - for (int i = 0; i < others.length; i++) { - if (i != me) { - others[i].checked = false; - } - } - return true; - } else { - return false; - } - } - - // Draws the element to the display window - void display() { - noStroke(); - fill(baseGray); - ellipse(x, y, size, size); - if (checked == true) { - fill(dotGray); - ellipse(x, y, dotSize, dotSize); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_12/Ex_12.pde deleted file mode 100755 index d39a30d50..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_12/Ex_12.pde +++ /dev/null @@ -1,23 +0,0 @@ -Radio[] buttons = new Radio[2]; - -void setup() { - size(100, 100); - smooth(); -// Inputs: x, y, size, base color, fill color, -// id number, array of others - buttons[0] = new Radio(33, 50, 30, color(255), color(0), - 0, buttons); - buttons[1] = new Radio(66, 50, 30, color(255), color(0), - 1, buttons); -} - -void draw() { - background(204); - buttons[0].display(); - buttons[1].display(); -} - -void mousePressed() { - buttons[0].press(mouseX, mouseY); - buttons[1].press(mouseX, mouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_12/Radio.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_12/Radio.pde deleted file mode 100755 index 7c37a79e8..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_12/Radio.pde +++ /dev/null @@ -1,46 +0,0 @@ -class Radio { - int x, y; // The x- and y-coordinates of the rect - int size, dotSize; // Dimension of circle, inner circle - color baseGray, dotGray; // Circle gray value, inner gray value - boolean checked = false; // True when the button is selected - int me; // ID number for this Radio object - Radio[] others; // Array of all other Radio objects - - Radio(int xp, int yp, int s, color b, color d, int m, Radio[] o) { - x = xp; - y = yp; - size = s; - dotSize = size - size / 3; - ; - baseGray = b; - dotGray = d; - others = o; - me = m; - } - - // Updates the boolean value press, returns true or false - boolean press(float mx, float my) { - if (dist(x, y, mx, my) < size / 2) { - checked = true; - for (int i = 0; i < others.length; i++) { - if (i != me) { - others[i].checked = false; - } - } - return true; - } else { - return false; - } - } - - // Draws the element to the display window - void display() { - noStroke(); - fill(baseGray); - ellipse(x, y, size, size); - if (checked == true) { - fill(dotGray); - ellipse(x, y, dotSize, dotSize); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_13/Ex_13.pde deleted file mode 100755 index 64151526c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_13/Ex_13.pde +++ /dev/null @@ -1,25 +0,0 @@ -int numButtons = 7; -Radio[] buttons = new Radio[numButtons]; - -void setup() { - size(100, 100); - smooth(); - for (int i = 0; i < buttons.length; i++) { - int x = i * 12 + 14; - buttons[i] = new Radio(x, 50, 10, color(255), color(0), - i, buttons); - } -} - -void draw() { - background(204); - for (int i = 0; i < buttons.length; i++) { - buttons[i].display(); - } -} - -void mousePressed() { - for (int i = 0; i < buttons.length; i++) { - buttons[i].press(mouseX, mouseY); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_13/Radio.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_13/Radio.pde deleted file mode 100755 index 7c37a79e8..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_13/Radio.pde +++ /dev/null @@ -1,46 +0,0 @@ -class Radio { - int x, y; // The x- and y-coordinates of the rect - int size, dotSize; // Dimension of circle, inner circle - color baseGray, dotGray; // Circle gray value, inner gray value - boolean checked = false; // True when the button is selected - int me; // ID number for this Radio object - Radio[] others; // Array of all other Radio objects - - Radio(int xp, int yp, int s, color b, color d, int m, Radio[] o) { - x = xp; - y = yp; - size = s; - dotSize = size - size / 3; - ; - baseGray = b; - dotGray = d; - others = o; - me = m; - } - - // Updates the boolean value press, returns true or false - boolean press(float mx, float my) { - if (dist(x, y, mx, my) < size / 2) { - checked = true; - for (int i = 0; i < others.length; i++) { - if (i != me) { - others[i].checked = false; - } - } - return true; - } else { - return false; - } - } - - // Draws the element to the display window - void display() { - noStroke(); - fill(baseGray); - ellipse(x, y, size, size); - if (checked == true) { - fill(dotGray); - ellipse(x, y, dotSize, dotSize); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_14/Ex_14.pde deleted file mode 100755 index e2b87d7e5..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_14/Ex_14.pde +++ /dev/null @@ -1,75 +0,0 @@ -class Scrollbar { - int x, y; // The x- and y-coordinates - float sw, sh; // Width and height of scrollbar - float pos; // Position of thumb - float posMin, posMax; // Max and min values of thumb - boolean rollover; // True when the mouse is over - boolean locked; // True when its the active scrollbar - float minVal, maxVal; // Min and max values for the thumb - Scrollbar(int xp, int yp, int w, int h, float miv, float mav) { - x = xp; - y = yp; - sw = w; - sh = h; - minVal = miv; - maxVal = mav; - pos = x + sw / 2 - sh / 2; - posMin = x; - posMax = x + sw - sh; - } - - // Updates the over boolean and the position of the thumb - void update(int mx, int my) { - if (over(mx, my) == true) { - rollover = true; - } else { - rollover = false; - } - if (locked == true) { - pos = constrain(mx - sh / 2, posMin, posMax); - } - } - - // Locks the thumb so the mouse can move off and still update - void press(int mx, int my) { - if (rollover == true) { - locked = true; - } else { - locked = false; - } - } - - // Resets the scrollbar to neutral - void release() { - locked = false; - } - - // Returns true if the cursor is over the scrollbar - boolean over(int mx, int my) { - if ((mx > x) && (mx < x + sw) && (my > y) && (my < y + sh)) { - return true; - } else { - return false; - } - } - - // Draws the scrollbar to the screen - void display() { - fill(255); - rect(x, y, sw, sh); - if ((rollover == true) || (locked == true)) { - fill(0); - } else { - fill(102); - } - rect(pos, y, sh, sh); - } - - // Returns the current value of the thumb - float getPos() { - float scalar = sw / (sw - sh); - float ratio = (pos - x) * scalar; - float offset = minVal + (ratio / sw * (maxVal - minVal)); - return offset; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/Ex_15.pde deleted file mode 100755 index 506f8003e..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/Ex_15.pde +++ /dev/null @@ -1,36 +0,0 @@ -Scrollbar bar1, bar2; -PFont font; - -void setup() { - size(100, 100); - noStroke(); -// Inputs: x, y, width, height, minVal, maxVal - bar1 = new Scrollbar(10, 35, 80, 10, 0.0, 100.0); - bar2 = new Scrollbar(10, 55, 80, 10, 0.0, 1.0); - font = loadFont("Courier-30.vlw"); - textFont(font); - textAlign(CENTER); -} - -void draw() { - background(204); - fill(0); - int pos1 = int(bar1.getPos()); - text(nf(pos1, 2), 50, 30); - float pos2 = bar2.getPos(); - text(nf(pos2, 1, 2), 50, 90); - bar1.update(mouseX, mouseY); - bar2.update(mouseX, mouseY); - bar1.display(); - bar2.display(); -} - -void mousePressed() { - bar1.press(mouseX, mouseY); - bar2.press(mouseX, mouseY); -} - -void mouseReleased() { - bar1.release(); - bar2.release(); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/Scrollbar.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/Scrollbar.pde deleted file mode 100755 index e2b87d7e5..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/Scrollbar.pde +++ /dev/null @@ -1,75 +0,0 @@ -class Scrollbar { - int x, y; // The x- and y-coordinates - float sw, sh; // Width and height of scrollbar - float pos; // Position of thumb - float posMin, posMax; // Max and min values of thumb - boolean rollover; // True when the mouse is over - boolean locked; // True when its the active scrollbar - float minVal, maxVal; // Min and max values for the thumb - Scrollbar(int xp, int yp, int w, int h, float miv, float mav) { - x = xp; - y = yp; - sw = w; - sh = h; - minVal = miv; - maxVal = mav; - pos = x + sw / 2 - sh / 2; - posMin = x; - posMax = x + sw - sh; - } - - // Updates the over boolean and the position of the thumb - void update(int mx, int my) { - if (over(mx, my) == true) { - rollover = true; - } else { - rollover = false; - } - if (locked == true) { - pos = constrain(mx - sh / 2, posMin, posMax); - } - } - - // Locks the thumb so the mouse can move off and still update - void press(int mx, int my) { - if (rollover == true) { - locked = true; - } else { - locked = false; - } - } - - // Resets the scrollbar to neutral - void release() { - locked = false; - } - - // Returns true if the cursor is over the scrollbar - boolean over(int mx, int my) { - if ((mx > x) && (mx < x + sw) && (my > y) && (my < y + sh)) { - return true; - } else { - return false; - } - } - - // Draws the scrollbar to the screen - void display() { - fill(255); - rect(x, y, sw, sh); - if ((rollover == true) || (locked == true)) { - fill(0); - } else { - fill(102); - } - rect(pos, y, sh, sh); - } - - // Returns the current value of the thumb - float getPos() { - float scalar = sw / (sw - sh); - float ratio = (pos - x) * scalar; - float offset = minVal + (ratio / sw * (maxVal - minVal)); - return offset; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/data/Courier-30.vlw b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/data/Courier-30.vlw deleted file mode 100755 index 8c0fb84a6..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/data/Courier-30.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_16/Ex_16.pde deleted file mode 100755 index b1d14bc6a..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_16/Ex_16.pde +++ /dev/null @@ -1,27 +0,0 @@ -// Requires Scrollbar Class -Scrollbar bar; -PImage img; - -void setup() { - size(100, 100); - noStroke(); -// Inputs: x, y, width, height, minVal, maxVal - bar = new Scrollbar(10, 45, 80, 10, -200.0, 0.0); - img = loadImage("landscape.jpg"); -} - -void draw() { - background(204); - int x = int(bar.getPos()); - image(img, x, 0); - bar.update(mouseX, mouseY); - bar.display(); -} - -void mousePressed() { - bar.press(mouseX, mouseY); -} - -void mouseReleased() { - bar.release(); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_16/Scrollbar.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_16/Scrollbar.pde deleted file mode 100755 index e2b87d7e5..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_16/Scrollbar.pde +++ /dev/null @@ -1,75 +0,0 @@ -class Scrollbar { - int x, y; // The x- and y-coordinates - float sw, sh; // Width and height of scrollbar - float pos; // Position of thumb - float posMin, posMax; // Max and min values of thumb - boolean rollover; // True when the mouse is over - boolean locked; // True when its the active scrollbar - float minVal, maxVal; // Min and max values for the thumb - Scrollbar(int xp, int yp, int w, int h, float miv, float mav) { - x = xp; - y = yp; - sw = w; - sh = h; - minVal = miv; - maxVal = mav; - pos = x + sw / 2 - sh / 2; - posMin = x; - posMax = x + sw - sh; - } - - // Updates the over boolean and the position of the thumb - void update(int mx, int my) { - if (over(mx, my) == true) { - rollover = true; - } else { - rollover = false; - } - if (locked == true) { - pos = constrain(mx - sh / 2, posMin, posMax); - } - } - - // Locks the thumb so the mouse can move off and still update - void press(int mx, int my) { - if (rollover == true) { - locked = true; - } else { - locked = false; - } - } - - // Resets the scrollbar to neutral - void release() { - locked = false; - } - - // Returns true if the cursor is over the scrollbar - boolean over(int mx, int my) { - if ((mx > x) && (mx < x + sw) && (my > y) && (my < y + sh)) { - return true; - } else { - return false; - } - } - - // Draws the scrollbar to the screen - void display() { - fill(255); - rect(x, y, sw, sh); - if ((rollover == true) || (locked == true)) { - fill(0); - } else { - fill(102); - } - rect(pos, y, sh, sh); - } - - // Returns the current value of the thumb - float getPos() { - float scalar = sw / (sw - sh); - float ratio = (pos - x) * scalar; - float offset = minVal + (ratio / sw * (maxVal - minVal)); - return offset; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_01/Ex_01.pde deleted file mode 100755 index 7aa9ca990..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_01/Ex_01.pde +++ /dev/null @@ -1,37 +0,0 @@ -Spot sp1, sp2; - -void setup() { - size(100, 100); - smooth(); - noLoop(); -// Run the constructore without parameters - sp1 = new Spot(); -// Run the constructor with three parameters - sp2 = new Spot(66, 50, 20); -} - -void draw() { - sp1.display(); - sp2.display(); -} - -class Spot { - float x, y, radius; -// First version of the Spot constructor, -// the fields are assigned default values - Spot() { - x = 33; - y = 50; - radius = 8; - } -// Second version of the Spot constructor, -// the fields are assigned with parameters - Spot(float xpos, float ypos, float r) { - x = xpos; - y = ypos; - radius = r; - } - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Egg.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Egg.pde deleted file mode 100755 index dac8bfe21..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Egg.pde +++ /dev/null @@ -1,36 +0,0 @@ -class Egg { - float x, y; // X-coordinate, y-coordinate - float tilt; // Left and right angle offset - float angle; // Used to define the tilt - float scalar; // Height of the egg - - // Constructor - Egg(int xpos, int ypos, float t, float s) { - x = xpos; - y = ypos; - tilt = t; - scalar = s / 100.0; - } - - void wobble() { - tilt = cos(angle) / 8; - angle += 0.1; - } - - void display() { - noStroke(); - fill(255); - pushMatrix(); - translate(x, y); - rotate(tilt); - scale(scalar); - beginShape(); - vertex(0, -100); - bezierVertex(25, -100, 40, -65, 40, -40); - bezierVertex(40, -15, 25, 0, 0, 0); - bezierVertex(-25, 0, -40, -15, -40, -40); - bezierVertex(-40, -65, -25, -100, 0, -100); - endShape(); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Ex_02.pde deleted file mode 100755 index b4ebd4ce0..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Ex_02.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Requires Egg and Ring classes (codes 43-08 and 43-11) -class EggRing { - Egg ovoid; - Ring circle = new Ring(); - - EggRing(int x, int y, float t, float sp) { - ovoid = new Egg(x, y, t, sp); - circle.start(x, y - sp / 2); - } - - void transmit() { - ovoid.wobble(); - ovoid.display(); - circle.grow(); - circle.display(); - if (circle.on == false) { - circle.on = true; - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Ring.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Ring.pde deleted file mode 100755 index 47a8b20bc..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Ring.pde +++ /dev/null @@ -1,30 +0,0 @@ -class Ring { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the ring - boolean on = false; // Turns the display on and off - - void start(float xpos, float ypos) { - x = xpos; - y = ypos; - on = true; - diameter = 1; - } - - void grow() { - if (on == true) { - diameter += 0.5; - if (diameter > 400) { - on = false; - } - } - } - - void display() { - if (on == true) { - noFill(); - strokeWeight(4); - stroke(15, 153); - ellipse(x, y, diameter, diameter); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Egg.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Egg.pde deleted file mode 100755 index dac8bfe21..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Egg.pde +++ /dev/null @@ -1,36 +0,0 @@ -class Egg { - float x, y; // X-coordinate, y-coordinate - float tilt; // Left and right angle offset - float angle; // Used to define the tilt - float scalar; // Height of the egg - - // Constructor - Egg(int xpos, int ypos, float t, float s) { - x = xpos; - y = ypos; - tilt = t; - scalar = s / 100.0; - } - - void wobble() { - tilt = cos(angle) / 8; - angle += 0.1; - } - - void display() { - noStroke(); - fill(255); - pushMatrix(); - translate(x, y); - rotate(tilt); - scale(scalar); - beginShape(); - vertex(0, -100); - bezierVertex(25, -100, 40, -65, 40, -40); - bezierVertex(40, -15, 25, 0, 0, 0); - bezierVertex(-25, 0, -40, -15, -40, -40); - bezierVertex(-40, -65, -25, -100, 0, -100); - endShape(); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/EggRing.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/EggRing.pde deleted file mode 100755 index b4ebd4ce0..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/EggRing.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Requires Egg and Ring classes (codes 43-08 and 43-11) -class EggRing { - Egg ovoid; - Ring circle = new Ring(); - - EggRing(int x, int y, float t, float sp) { - ovoid = new Egg(x, y, t, sp); - circle.start(x, y - sp / 2); - } - - void transmit() { - ovoid.wobble(); - ovoid.display(); - circle.grow(); - circle.display(); - if (circle.on == false) { - circle.on = true; - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Ex_03.pde deleted file mode 100755 index 77fc3e022..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Ex_03.pde +++ /dev/null @@ -1,14 +0,0 @@ -EggRing er1, er2; - -void setup() { - size(100, 100); - smooth(); - er1 = new EggRing(33, 66, 0.1, 33); - er2 = new EggRing(66, 90, 0.05, 66); -} - -void draw() { - background(0); - er1.transmit(); - er2.transmit(); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Ring.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Ring.pde deleted file mode 100755 index 47a8b20bc..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Ring.pde +++ /dev/null @@ -1,30 +0,0 @@ -class Ring { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the ring - boolean on = false; // Turns the display on and off - - void start(float xpos, float ypos) { - x = xpos; - y = ypos; - on = true; - diameter = 1; - } - - void grow() { - if (on == true) { - diameter += 0.5; - if (diameter > 400) { - on = false; - } - } - } - - void display() { - if (on == true) { - noFill(); - strokeWeight(4); - stroke(15, 153); - ellipse(x, y, diameter, diameter); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_04/Ex_04.pde deleted file mode 100755 index d30394fad..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_04/Ex_04.pde +++ /dev/null @@ -1,15 +0,0 @@ -class Spin { - float x, y, speed; - float angle = 0.0; - - Spin(float xpos, float ypos, float s) { - x = xpos; - y = ypos; - speed = s; - } - - void update() { - angle += speed; - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_05/Ex_05.pde deleted file mode 100755 index a2c2a6f40..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_05/Ex_05.pde +++ /dev/null @@ -1,16 +0,0 @@ -class SpinArm extends Spin { - SpinArm(float x, float y, float s) { - super(x, y, s); - } - - void display() { - strokeWeight(1); - stroke(0); - pushMatrix(); - translate(x, y); - angle += speed; - rotate(angle); - line(0, 0, 100, 0); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_05/Spin.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_05/Spin.pde deleted file mode 100755 index d30394fad..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_05/Spin.pde +++ /dev/null @@ -1,15 +0,0 @@ -class Spin { - float x, y, speed; - float angle = 0.0; - - Spin(float xpos, float ypos, float s) { - x = xpos; - y = ypos; - speed = s; - } - - void update() { - angle += speed; - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_06/Ex_06.pde deleted file mode 100755 index 4055a3f6e..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_06/Ex_06.pde +++ /dev/null @@ -1,19 +0,0 @@ -class SpinSpots extends Spin { - float dim; - - SpinSpots(float x, float y, float s, float d) { - super(x, y, s); - dim = d; - } - - void display() { - noStroke(); - pushMatrix(); - translate(x, y); - angle += speed; - rotate(angle); - ellipse(-dim / 2, 0, dim, dim); - ellipse(dim / 2, 0, dim, dim); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_06/Spin.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_06/Spin.pde deleted file mode 100755 index d30394fad..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_06/Spin.pde +++ /dev/null @@ -1,15 +0,0 @@ -class Spin { - float x, y, speed; - float angle = 0.0; - - Spin(float xpos, float ypos, float s) { - x = xpos; - y = ypos; - speed = s; - } - - void update() { - angle += speed; - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/Ex_07.pde deleted file mode 100755 index fc32e6e34..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/Ex_07.pde +++ /dev/null @@ -1,17 +0,0 @@ -SpinSpots spots; -SpinArm arm; - -void setup() { - size(100, 100); - smooth(); - arm = new SpinArm(width / 2, height / 2, 0.01); - spots = new SpinSpots(width / 2, height / 2, -0.02, 33.0); -} - -void draw() { - background(204); - arm.update(); - arm.display(); - spots.update(); - spots.display(); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/Spin.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/Spin.pde deleted file mode 100755 index d30394fad..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/Spin.pde +++ /dev/null @@ -1,15 +0,0 @@ -class Spin { - float x, y, speed; - float angle = 0.0; - - Spin(float xpos, float ypos, float s) { - x = xpos; - y = ypos; - speed = s; - } - - void update() { - angle += speed; - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/SpinArm.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/SpinArm.pde deleted file mode 100755 index a2c2a6f40..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/SpinArm.pde +++ /dev/null @@ -1,16 +0,0 @@ -class SpinArm extends Spin { - SpinArm(float x, float y, float s) { - super(x, y, s); - } - - void display() { - strokeWeight(1); - stroke(0); - pushMatrix(); - translate(x, y); - angle += speed; - rotate(angle); - line(0, 0, 100, 0); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/SpinSpots.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/SpinSpots.pde deleted file mode 100755 index 4055a3f6e..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/SpinSpots.pde +++ /dev/null @@ -1,19 +0,0 @@ -class SpinSpots extends Spin { - float dim; - - SpinSpots(float x, float y, float s, float d) { - super(x, y, s); - dim = d; - } - - void display() { - noStroke(); - pushMatrix(); - translate(x, y); - angle += speed; - rotate(angle); - ellipse(-dim / 2, 0, dim, dim); - ellipse(dim / 2, 0, dim, dim); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_08/Button.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_08/Button.pde deleted file mode 100755 index c798487eb..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_08/Button.pde +++ /dev/null @@ -1,59 +0,0 @@ -class Button { - int x, y; // x-coordinate, y-coordinate of the rectangle - int size; // Dimension (width and height) of the rectangle - color baseGray; // Default gray value - color overGray; // Gray value when mouse is over the button - color pressGray; // Gray value when mouse is over and pressed - boolean over = false; // True when the mouse is over - boolean press = false; // True when the mouse is over and pressed - - Button(int xpos, int ypos, int s, color b, color o, color p) { - x = xpos; - y = ypos; - size = s; - baseGray = b; - overGray = o; - pressGray = p; - } - - // Updates the over field every frame - void update(int mx, int my) { - if ((mx >= x) && (mx <= x+size) && - (my >= y) && (my <= y+size)) { - over = true; - } - else { - over = false; - } - } - - // Updates the press boolean when mouse is pressed - boolean press() { - if (over == true) { - press = true; - return true; - } - else { - return false; - } - } - - // Sets the press boolean to false when mouse is released - void release() { - press = false; - } - - // Draws the button - void display() { - if (press == true) { - fill(pressGray); - } else if (over == true) { - fill(overGray); - } else { - fill(baseGray); - } - stroke(255); - rect(x, y, size, size); - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_08/Ex_08.pde deleted file mode 100755 index 99e26e5e3..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_08/Ex_08.pde +++ /dev/null @@ -1,20 +0,0 @@ -class DragButton extends Button { - int xoff, yoff; - - DragButton(int x, int y, int s, color bv, color ov, color pv) { - super(x, y, s, bv, ov, pv); - } - - void press(int mx, int my) { - super.press(); - xoff = mx - x; - yoff = my - y; - } - - void drag(int mx, int my) { - if (press == true) { - x = mx - xoff; - y = my - yoff; - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/Button.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/Button.pde deleted file mode 100755 index c798487eb..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/Button.pde +++ /dev/null @@ -1,59 +0,0 @@ -class Button { - int x, y; // x-coordinate, y-coordinate of the rectangle - int size; // Dimension (width and height) of the rectangle - color baseGray; // Default gray value - color overGray; // Gray value when mouse is over the button - color pressGray; // Gray value when mouse is over and pressed - boolean over = false; // True when the mouse is over - boolean press = false; // True when the mouse is over and pressed - - Button(int xpos, int ypos, int s, color b, color o, color p) { - x = xpos; - y = ypos; - size = s; - baseGray = b; - overGray = o; - pressGray = p; - } - - // Updates the over field every frame - void update(int mx, int my) { - if ((mx >= x) && (mx <= x+size) && - (my >= y) && (my <= y+size)) { - over = true; - } - else { - over = false; - } - } - - // Updates the press boolean when mouse is pressed - boolean press() { - if (over == true) { - press = true; - return true; - } - else { - return false; - } - } - - // Sets the press boolean to false when mouse is released - void release() { - press = false; - } - - // Draws the button - void display() { - if (press == true) { - fill(pressGray); - } else if (over == true) { - fill(overGray); - } else { - fill(baseGray); - } - stroke(255); - rect(x, y, size, size); - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/DragButton.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/DragButton.pde deleted file mode 100755 index 99e26e5e3..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/DragButton.pde +++ /dev/null @@ -1,20 +0,0 @@ -class DragButton extends Button { - int xoff, yoff; - - DragButton(int x, int y, int s, color bv, color ov, color pv) { - super(x, y, s, bv, ov, pv); - } - - void press(int mx, int my) { - super.press(); - xoff = mx - x; - yoff = my - y; - } - - void drag(int mx, int my) { - if (press == true) { - x = mx - xoff; - y = my - yoff; - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/Ex_09.pde deleted file mode 100755 index 92a7791b2..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/Ex_09.pde +++ /dev/null @@ -1,28 +0,0 @@ -DragButton icon; - -void setup() { - size(100, 100); - smooth(); - color gray = color(204); - color white = color(255); - color black = color(0); - icon = new DragButton(21, 42, 50, gray, white, black); -} - -void draw() { - background(204); - icon.update(mouseX, mouseY); - icon.display(); -} - -void mousePressed() { - icon.press(mouseX, mouseY); -} - -void mouseReleased() { - icon.release(); -} - -void mouseDragged() { - icon.drag(mouseX, mouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/Button.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/Button.pde deleted file mode 100755 index c798487eb..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/Button.pde +++ /dev/null @@ -1,59 +0,0 @@ -class Button { - int x, y; // x-coordinate, y-coordinate of the rectangle - int size; // Dimension (width and height) of the rectangle - color baseGray; // Default gray value - color overGray; // Gray value when mouse is over the button - color pressGray; // Gray value when mouse is over and pressed - boolean over = false; // True when the mouse is over - boolean press = false; // True when the mouse is over and pressed - - Button(int xpos, int ypos, int s, color b, color o, color p) { - x = xpos; - y = ypos; - size = s; - baseGray = b; - overGray = o; - pressGray = p; - } - - // Updates the over field every frame - void update(int mx, int my) { - if ((mx >= x) && (mx <= x+size) && - (my >= y) && (my <= y+size)) { - over = true; - } - else { - over = false; - } - } - - // Updates the press boolean when mouse is pressed - boolean press() { - if (over == true) { - press = true; - return true; - } - else { - return false; - } - } - - // Sets the press boolean to false when mouse is released - void release() { - press = false; - } - - // Draws the button - void display() { - if (press == true) { - fill(pressGray); - } else if (over == true) { - fill(overGray); - } else { - fill(baseGray); - } - stroke(255); - rect(x, y, size, size); - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/DragButton.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/DragButton.pde deleted file mode 100755 index 99e26e5e3..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/DragButton.pde +++ /dev/null @@ -1,20 +0,0 @@ -class DragButton extends Button { - int xoff, yoff; - - DragButton(int x, int y, int s, color bv, color ov, color pv) { - super(x, y, s, bv, ov, pv); - } - - void press(int mx, int my) { - super.press(); - xoff = mx - x; - yoff = my - y; - } - - void drag(int mx, int my) { - if (press == true) { - x = mx - xoff; - y = my - yoff; - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/Ex_10.pde deleted file mode 100755 index 9e9e016f2..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/Ex_10.pde +++ /dev/null @@ -1,22 +0,0 @@ -class DragImage extends DragButton { - PImage img; - - DragImage(int x, int y, int d, String s) { - super(x, y, d, color(204), color(255), color(0)); - img = loadImage(s); - } - - // Override the display() from Button - void display() { - if (press == true) { - stroke(pressGray); - } else if (over == true) { - stroke(overGray); - } else { - stroke(baseGray); - } - noFill(); - rect(x - 1, y - 1, size + 1, size + 1); - image(img, x, y, size, size); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_01/Ex_01.pde deleted file mode 100755 index 5667cefe1..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,57 +0,0 @@ -int[] rules = { 0, 0, 0, 1, 1, 1, 1, 0 }; -int gen = 1; // Generation -color on = color(255); -color off = color(0); - -void setup() { - size(101, 101); - frameRate(8); // Slow down to 8 frames each second - background(0); - set(width / 2, 0, on); // Set the top, middle pixel to white -} - -void draw() { -// For each pixel, determine new state by examining current -// state and neighbor states and ignore edges that have only -// one neighbor - for (int i = 1; i < width - 1; i++) { - int left = get(i - 1, gen - 1); // Left neighbor - int me = get(i, gen - 1); // Current pixel - int right = get(i + 1, gen - 1); // Right neighbor - if (rules(left, me, right) == 1) { - set(i, gen, on); - } - } - gen++; // Increment the generation by 1 - if (gen > height - 1) { // If reached the bottom of the screen, - noLoop(); // stop the program - } -} -// Implement the rules -int rules(color a, color b, color c) { - if ((a == on) && (b == on) && (c == on)) { - return rules[0]; - } - if ((a == on) && (b == on) && (c == off)) { - return rules[1]; - } - if ((a == on) && (b == off) && (c == on)) { - return rules[2]; - } - if ((a == on) && (b == off) && (c == off)) { - return rules[3]; - } - if ((a == off) && (b == on) && (c == on)) { - return rules[4]; - } - if ((a == off) && (b == on) && (c == off)) { - return rules[5]; - } - if ((a == off) && (b == off) && (c == on)) { - return rules[6]; - } - if ((a == off) && (b == off) && (c == off)) { - return rules[7]; - } - return 0; -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_02/Ex_02.pde deleted file mode 100755 index a28a8ab16..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,52 +0,0 @@ -int[][] grid, futureGrid; - -void setup() { - size(540, 100); - frameRate(8); - grid = new int[width][height]; - futureGrid = new int[width][height]; - float density = 0.3 * width * height; - for (int i = 0; i < density; i++) { - grid[int(random(width))][int(random(height))] = 1; - } - background(0); -} - -void draw() { - for (int x = 1; x < width - 1; x++) { - for (int y = 1; y < height - 1; y++) { - // Check the number of neighbors (adjacent cells) - int nb = neighbors(x, y); - if ((grid[x][y] == 1) && (nb < 2)) { - futureGrid[x][y] = 0; // Isolation death - set(x, y, color(0)); - } else if ((grid[x][y] == 1) && (nb > 3)) { - futureGrid[x][y] = 0; // Overpopulation death - set(x, y, color(0)); - } else if ((grid[x][y] == 0) && (nb == 3)) { - futureGrid[x][y] = 1; // Birth - set(x, y, color(255)); - } else { - futureGrid[x][y] = grid[x][y]; // Survive - } - } - } - - // Swap current and future grids - int[][] temp = grid; - grid = futureGrid; - futureGrid = temp; -} - -// Count the number of adjacent cells 'on' -int neighbors(int x, int y) { - return grid[x][y-1] + // North - grid[x+1][y-1] + // Northeast - grid[x+1][y] + // East - grid[x+1][y+1] + // Souteast - grid[x][y+1] + // South - grid[x-1][y+1] + // Southwest - grid[x-1][y] + // West - grid[x-1][y-1]; // Northwest -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_03/Ex_03.pde deleted file mode 100755 index 21a16dfa9..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,14 +0,0 @@ -int neighbors(int x, int y) { - int north = (y + height - 1) % height; - int south = (y + 1) % height; - int east = (x + 1) % width; - int west = (x + width - 1) % width; - return grid[x][north] + // North - grid[east][north] + // Northeast - grid[east][y] + // East - grid[east][south] + // Southeast - grid[x][south] + // South - grid[west][south] + // Southwest - grid[west][y] + // West - grid[west][north]; // Northwest -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_04/Ex_04.pde deleted file mode 100755 index 4df0e09af..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,57 +0,0 @@ -int SOUTH = 0; // Direction numbers with names -int EAST = 1; // so that the code self-documents -int NORTH = 2; -int WEST = 3; -int direction = NORTH; // Current direction of the ant -int x, y; // Ant's current position -color ON = color(255); // Color for an 'on' pixel -color OFF = color(0); // Color for an 'off' pixel - -void setup() { - size(100, 100); - x = width / 2; - y = height / 2; - background(0); -} - -void draw() { - if (direction == SOUTH) { - y++; - if (y == height) { - y = 0; - } - } else if (direction == EAST) { - x++; - if (x == width) { - x = 0; - } - } else if (direction == NORTH) { - if (y == 0) { - y = height - 1; - } else { - y--; - } - } else if (direction == WEST) { - if (x == 0) { - x = width - 1; - } else { - x--; - } - } - if (get(x, y) == ON) { - set(x, y, OFF); - if (direction == SOUTH) { - direction = WEST; - } else { - direction--; - } - } - else { - set(x, y, ON); - if (direction == WEST) { - direction = SOUTH; - } else { - direction++; // Rotate direction - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_05/Ex_05.pde deleted file mode 100755 index 6c60c0f1f..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,49 +0,0 @@ -int[][] angles = { { 0, 1 }, { 1, 1 }, { 1, 0 }, { 1,-1 }, - { 0,-1 }, {-1,-1 }, {-1, 0 }, {-1, 1 } }; -int numAngles = angles.length; -int x, y, nx, ny; -int dir = 0; -color black = color(0); -color white = color(255); - -void setup() { - size(100, 100); - background(255); - x = width / 2; - nx = x; - y = height / 2; - ny = y; - float woodDensity = width * height * 0.5; - for (int i = 0; i < woodDensity; i++) { - int rx = int(random(width)); - int ry = int(random(height)); - set(rx, ry, black); - } -} - -void draw() { - int rand = int(abs(random(-1, 2))); - dir = (dir + rand + numAngles) % numAngles; - nx = (nx + angles[dir][0] + width) % width; - ny = (ny + angles[dir][1] + height) % height; - if ((get(x, y) == black) && (get(nx, ny) == white)) { -// Move the chip one space - set(x, y, white); - set(nx, ny, black); - x = nx; - y = ny; - } - else if ((get(x, y) == black) && (get(nx, ny) == black)) { -// Move in the opposite direction - dir = (dir + (numAngles / 2)) % numAngles; - x = (x + angles[dir][0] + width) % width; - y = (y + angles[dir][1] + height) % height; - } - else { -// Not carrying - x = nx; - y = ny; - } - nx = x; // Save the current position - ny = y; -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_01/Ex_01.pde deleted file mode 100755 index d3f581d2d..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,24 +0,0 @@ -// Gradually increases the velocity -float y = 50.0; -float radius = 15.0; -float velocity = 0.0; -float acceleration = 0.01; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - fill(0, 10); - rect(0, 0, width, height); - fill(255); - ellipse(33, y, radius, radius); - velocity += acceleration; // Increase the velocity - y += velocity; // Update the position - if (y > height + radius) { // If over the bottom edge, - y = -radius; // move to the top - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_02/Ex_02.pde deleted file mode 100755 index 6c326eb9b..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,23 +0,0 @@ -float y = 50.0; -float radius = 15.0; -float velocity = 9.0; -float acceleration = -0.05; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - ellipse(33, y, radius, radius); - velocity += acceleration; - y += velocity; - if (y > height + radius) { - y = -radius; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_03/Ex_03.pde deleted file mode 100755 index 287236d89..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,23 +0,0 @@ -float y = 50.0; -float radius = 15.0; -float velocity = 8.0; -float friction = 0.98; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - ellipse(33, y, radius, radius); - velocity *= friction; - y += velocity; - if (y > height + radius) { - y = -radius; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_04/Ex_04.pde deleted file mode 100755 index 5440ca2ac..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,27 +0,0 @@ -float x = 33; -float y = 5; -float velocity = 0.0; -float radius = 15.0; -float friction = 0.99; -float acceleration = 0.3; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - velocity += acceleration; - velocity *= friction; - y += velocity; - if (y > (height - radius)) { - y = height - radius; - velocity = -velocity; - } - ellipse(x, y, radius, radius); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_05/Ex_05.pde deleted file mode 100755 index 246c2050c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,24 +0,0 @@ -class Particle { - float x, y; // The x- and y-coordinates - float vx, vy; // The x- and y-velocities - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xpos, int ypos, float velx, float vely, float r) { - x = xpos; - y = ypos; - vx = velx; - vy = vely; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_06/Ex_06.pde deleted file mode 100755 index c3334f86c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,16 +0,0 @@ -Particle p; - -void setup() { - size(100, 100); - noStroke(); - smooth(); - p = new Particle(0, height, 2.2, -4.2, 20.0); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - p.update(); - p.display(); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_06/Particle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_06/Particle.pde deleted file mode 100755 index 246c2050c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_06/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -class Particle { - float x, y; // The x- and y-coordinates - float vx, vy; // The x- and y-velocities - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xpos, int ypos, float velx, float vely, float r) { - x = xpos; - y = ypos; - vx = velx; - vy = vely; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_07/Ex_07.pde deleted file mode 100755 index c70a324af..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,19 +0,0 @@ -class GenParticle extends Particle { - float originX, originY; - - GenParticle(int xIn, int yIn, float vxIn, float vyIn, float r, float ox, float oy) { - super(xIn, yIn, vxIn, vyIn, r); - originX = ox; - originY = oy; - } - - void regenerate() { - if ((x > width + radius) || (x < -radius) || - (y > height + radius) || (y < -radius)) { - x = originX; - y = originY; - vx = random(-1.0, 1.0); - vy = random(-4.0, -2.0); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_07/Particle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_07/Particle.pde deleted file mode 100755 index 246c2050c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_07/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -class Particle { - float x, y; // The x- and y-coordinates - float vx, vy; // The x- and y-velocities - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xpos, int ypos, float velx, float vely, float r) { - x = xpos; - y = ypos; - vx = velx; - vy = vely; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/Ex_08.pde deleted file mode 100755 index b9185c07f..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,27 +0,0 @@ -int numParticles = 200; -GenParticle[] p = new GenParticle[numParticles]; - -void setup() { - size(100, 100); - noStroke(); - smooth(); - for (int i = 0; i < p.length; i++) { - float velX = random(-1, 1); - float velY = -i; -// Inputs: x, y, x-velocity, y-velocity, -// radius, origin x, origin y - p[i] = new GenParticle(width / 2, height / 2, velX, velY, - 5.0, width / 2, height / 2); - } -} - -void draw() { - fill(0, 36); - rect(0, 0, width, height); - fill(255, 60); - for (int i = 0; i < p.length; i++) { - p[i].update(); - p[i].regenerate(); - p[i].display(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/GenParticle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/GenParticle.pde deleted file mode 100755 index c70a324af..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/GenParticle.pde +++ /dev/null @@ -1,19 +0,0 @@ -class GenParticle extends Particle { - float originX, originY; - - GenParticle(int xIn, int yIn, float vxIn, float vyIn, float r, float ox, float oy) { - super(xIn, yIn, vxIn, vyIn, r); - originX = ox; - originY = oy; - } - - void regenerate() { - if ((x > width + radius) || (x < -radius) || - (y > height + radius) || (y < -radius)) { - x = originX; - y = originY; - vx = random(-1.0, 1.0); - vy = random(-4.0, -2.0); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/Particle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/Particle.pde deleted file mode 100755 index 246c2050c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -class Particle { - float x, y; // The x- and y-coordinates - float vx, vy; // The x- and y-velocities - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xpos, int ypos, float velx, float vely, float r) { - x = xpos; - y = ypos; - vx = velx; - vy = vely; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_09/Ex_09.pde deleted file mode 100755 index aa4766598..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_09/Ex_09.pde +++ /dev/null @@ -1,24 +0,0 @@ -class LimitedParticle extends Particle { - float friction = 0.99; - LimitedParticle(int ix, int iy, float ivx, float ivy, float ir) { - super(ix, iy, ivx, ivy, ir); - } - - void update() { - vy *= friction; - vx *= friction; - super.update(); - limit(); - } - - void limit() { - if (y > height - radius) { - vy = -vy; - y = constrain(y, -height * height, height - radius); - } - if ((x < radius) || (x > width - radius)) { - vx = -vx; - x = constrain(x, radius, width - radius); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_09/Particle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_09/Particle.pde deleted file mode 100755 index 246c2050c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_09/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -class Particle { - float x, y; // The x- and y-coordinates - float vx, vy; // The x- and y-velocities - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xpos, int ypos, float velx, float vely, float r) { - x = xpos; - y = ypos; - vx = velx; - vy = vely; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/Ex_10.pde deleted file mode 100755 index 635f8798b..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/Ex_10.pde +++ /dev/null @@ -1,26 +0,0 @@ -int num = 80; -LimitedParticle[] p = new LimitedParticle[num]; -float radius = 1.2; - -void setup() { - size(100, 100); - noStroke(); - smooth(); - for (int i = 0; i < p.length; i++) { - float velX = random(-2, 2); - float velY = -i; -// Inputs: x, y, x-velocity, y-velocity, radius - p[i] = new LimitedParticle(width / 2, height / 2, - velX, velY, 2.2); - } -} - -void draw() { - fill(0, 24); - rect(0, 0, width, height); - fill(255); - for (int i = 0; i < p.length; i++) { - p[i].update(); - p[i].display(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/LimitedParticle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/LimitedParticle.pde deleted file mode 100755 index aa4766598..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/LimitedParticle.pde +++ /dev/null @@ -1,24 +0,0 @@ -class LimitedParticle extends Particle { - float friction = 0.99; - LimitedParticle(int ix, int iy, float ivx, float ivy, float ir) { - super(ix, iy, ivx, ivy, ir); - } - - void update() { - vy *= friction; - vx *= friction; - super.update(); - limit(); - } - - void limit() { - if (y > height - radius) { - vy = -vy; - y = constrain(y, -height * height, height - radius); - } - if ((x < radius) || (x > width - radius)) { - vx = -vx; - x = constrain(x, radius, width - radius); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/Particle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/Particle.pde deleted file mode 100755 index 246c2050c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -class Particle { - float x, y; // The x- and y-coordinates - float vx, vy; // The x- and y-velocities - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xpos, int ypos, float velx, float vely, float r) { - x = xpos; - y = ypos; - vx = velx; - vy = vely; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_11/Ex_11.pde deleted file mode 100755 index dd5b4aa66..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_11/Ex_11.pde +++ /dev/null @@ -1,26 +0,0 @@ -class ArrowParticle extends Particle { - float angle = 0.0; - float shaftLength = 20.0; - ArrowParticle(int ix, int iy, float ivx, float ivy, float ir) { - super(ix, iy, ivx, ivy, ir); - } - - void update() { - super.update(); - angle = atan2(vy, vx); - } - - void display() { - stroke(255); - pushMatrix(); - translate(x, y); - rotate(angle); - scale(shaftLength); - strokeWeight(1.0 / shaftLength); - line(0, 0, 1, 0); - line(1, 0, 0.7, -0.3); - line(1, 0, 0.7, 0.3); - popMatrix(); - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_11/Particle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_11/Particle.pde deleted file mode 100755 index 246c2050c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_11/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -class Particle { - float x, y; // The x- and y-coordinates - float vx, vy; // The x- and y-velocities - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xpos, int ypos, float velx, float vely, float r) { - x = xpos; - y = ypos; - vx = velx; - vy = vely; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/ArrowParticle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/ArrowParticle.pde deleted file mode 100755 index dd5b4aa66..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/ArrowParticle.pde +++ /dev/null @@ -1,26 +0,0 @@ -class ArrowParticle extends Particle { - float angle = 0.0; - float shaftLength = 20.0; - ArrowParticle(int ix, int iy, float ivx, float ivy, float ir) { - super(ix, iy, ivx, ivy, ir); - } - - void update() { - super.update(); - angle = atan2(vy, vx); - } - - void display() { - stroke(255); - pushMatrix(); - translate(x, y); - rotate(angle); - scale(shaftLength); - strokeWeight(1.0 / shaftLength); - line(0, 0, 1, 0); - line(1, 0, 0.7, -0.3); - line(1, 0, 0.7, 0.3); - popMatrix(); - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/Ex_12.pde deleted file mode 100755 index 98ce49b9b..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/Ex_12.pde +++ /dev/null @@ -1,22 +0,0 @@ -int num = 320; -ArrowParticle[] p = new ArrowParticle[num]; -float radius = 1.2; - -void setup() { - size(600, 100); - smooth(); - for (int i = 0; i < p.length; i++) { - float velX = random(1, 8); - float velY = random(-5, -1); -// Parameters: x, y, x-velocity, y-velocity, radius - p[i] = new ArrowParticle(0, height / 2, velX, velY, 1.2); - } -} - -void draw() { - background(0); - for (int i = 0; i < p.length; i++) { - p[i].update(); - p[i].display(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/Particle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/Particle.pde deleted file mode 100755 index 98c2333b5..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/Particle.pde +++ /dev/null @@ -1,25 +0,0 @@ -class Particle { - - float x, y; // X-coordinate, y-coordinate - float vx, vy; // X velocity, y velocity - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xIn, int yIn, float vxIn, float vyIn, float r) { - x = xIn; - y = yIn; - vx = vxIn; - vy = vyIn; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_13/Ex_13.pde deleted file mode 100755 index ef4157adc..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_13/Ex_13.pde +++ /dev/null @@ -1,21 +0,0 @@ -float stiffness = 0.1; -float damping = 0.9; -float velocity = 0.0; -float targetY; -float y; - -void setup() { - size(100, 100); - noStroke(); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - float force = stiffness * (targetY - y); // f = -kx - velocity = damping * (velocity + force); - y += velocity; - rect(10, y, width - 20, 12); - targetY = mouseY; -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_14/Ex_14.pde deleted file mode 100755 index 9fc62279a..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_14/Ex_14.pde +++ /dev/null @@ -1,28 +0,0 @@ -float y1, y2; -float velocity1, velocity2; -float mass1 = 1.0; -float mass2 = 6.0; -float stiffness = 0.1; -float damping = 0.9; - -void setup() { - size(100, 100); - noStroke(); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - float targetY = mouseY; - float forceA = stiffness * (targetY - y1); - float accelerationY1 = forceA / mass1; - velocity1 = damping * (velocity1 + accelerationY1); - y1 += velocity1; - rect(10, y1, 40, 15); - float forceB = stiffness * (targetY - y2); - float accelerationY2 = forceB / mass2; - velocity2 = damping * (velocity2 + accelerationY2); - y2 += velocity2; - rect(50, y2, 40, 15); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_15/Ex_15.pde deleted file mode 100755 index bc548351d..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_15/Ex_15.pde +++ /dev/null @@ -1,35 +0,0 @@ -class Spring2D { - float vx, vy; // The x- and y-axis velocities - float x, y; // The x- and y-coordinates - float gravity; - float mass; - float radius = 10; - float stiffness = 0.2; - float damping = 0.7; - - Spring2D(float xpos, float ypos, float m, float g) { - x = xpos; - y = ypos; - mass = m; - gravity = g; - } - - void update(float targetX, float targetY) { - float forceX = (targetX - x) * stiffness; - float ax = forceX / mass; - vx = damping * (vx + ax); - x += vx; - float forceY = (targetY - y) * stiffness; - forceY += gravity; - float ay = forceY / mass; - vy = damping * (vy + ay); - y += vy; - } - - void display(float nx, float ny) { - noStroke(); - ellipse(x, y, radius*2, radius*2); - stroke(255); - line(x, y, nx, ny); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_16/Ex_16.pde deleted file mode 100755 index 1070dfca6..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_16/Ex_16.pde +++ /dev/null @@ -1,20 +0,0 @@ -Spring2D s1, s2; -float gravity = 5.0; -float mass = 2.0; - -void setup() { - size(100, 100); - smooth(); - fill(0); -// Inputs: x, y, mass, gravity - s1 = new Spring2D(0.0, width / 2, mass, gravity); - s2 = new Spring2D(0.0, width / 2, mass, gravity); -} - -void draw() { - background(204); - s1.update(mouseX, mouseY); - s1.display(mouseX, mouseY); - s2.update(s1.x, s1.y); - s2.display(s1.x, s1.y); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_16/Spring2D.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_16/Spring2D.pde deleted file mode 100755 index bc548351d..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_16/Spring2D.pde +++ /dev/null @@ -1,35 +0,0 @@ -class Spring2D { - float vx, vy; // The x- and y-axis velocities - float x, y; // The x- and y-coordinates - float gravity; - float mass; - float radius = 10; - float stiffness = 0.2; - float damping = 0.7; - - Spring2D(float xpos, float ypos, float m, float g) { - x = xpos; - y = ypos; - mass = m; - gravity = g; - } - - void update(float targetX, float targetY) { - float forceX = (targetX - x) * stiffness; - float ax = forceX / mass; - vx = damping * (vx + ax); - x += vx; - float forceY = (targetY - y) * stiffness; - forceY += gravity; - float ay = forceY / mass; - vy = damping * (vy + ay); - y += vy; - } - - void display(float nx, float ny) { - noStroke(); - ellipse(x, y, radius*2, radius*2); - stroke(255); - line(x, y, nx, ny); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_17/Ex_17.pde deleted file mode 100755 index 209c51df7..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_17/Ex_17.pde +++ /dev/null @@ -1,23 +0,0 @@ -int numSprings = 30; -Spring2D[] s = new Spring2D[numSprings]; -float gravity = 5.0; -float mass = 3.0; - -void setup() { - size(100, 900); - smooth(); - fill(0); - for (int i = 0; i < numSprings; i++) { - s[i] = new Spring2D(width / 2, i*(height / numSprings), mass, gravity); - } -} - -void draw() { - background(204); - s[0].update(mouseX, mouseY); - s[0].display(mouseX, mouseY); - for (int i = 1; i < numSprings; i++) { - s[i].update(s[i-1].x, s[i-1].y); - s[i].display(s[i-1].x, s[i-1].y); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_17/Spring2D.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_17/Spring2D.pde deleted file mode 100755 index bc548351d..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_17/Spring2D.pde +++ /dev/null @@ -1,35 +0,0 @@ -class Spring2D { - float vx, vy; // The x- and y-axis velocities - float x, y; // The x- and y-coordinates - float gravity; - float mass; - float radius = 10; - float stiffness = 0.2; - float damping = 0.7; - - Spring2D(float xpos, float ypos, float m, float g) { - x = xpos; - y = ypos; - mass = m; - gravity = g; - } - - void update(float targetX, float targetY) { - float forceX = (targetX - x) * stiffness; - float ax = forceX / mass; - vx = damping * (vx + ax); - x += vx; - float forceY = (targetY - y) * stiffness; - forceY += gravity; - float ay = forceY / mass; - vy = damping * (vy + ay); - y += vy; - } - - void display(float nx, float ny) { - noStroke(); - ellipse(x, y, radius*2, radius*2); - stroke(255); - line(x, y, nx, ny); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_18/Ex_18.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_18/Ex_18.pde deleted file mode 100755 index dbb55d438..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_18/Ex_18.pde +++ /dev/null @@ -1,24 +0,0 @@ -class FixedSpring extends Spring2D { - float springLength; - - FixedSpring(float xpos, float ypos, float m, float g, float s) { - super(xpos, ypos, m, g); - springLength = s; - } - - void update(float newX, float newY) { - // Calculate the target position - float dx = x - newX; - float dy = y - newY; - float angle = atan2(dy, dx); - float targetX = newX + cos(angle) * springLength; - float targetY = newY + sin(angle) * springLength; - - // Activate update method from Spring2D - super.update(targetX, targetY); - - // Constrain to display window - x = constrain(x, radius, width - radius); - y = constrain(y, radius, height - radius); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_18/Spring2D.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_18/Spring2D.pde deleted file mode 100755 index bc548351d..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_18/Spring2D.pde +++ /dev/null @@ -1,35 +0,0 @@ -class Spring2D { - float vx, vy; // The x- and y-axis velocities - float x, y; // The x- and y-coordinates - float gravity; - float mass; - float radius = 10; - float stiffness = 0.2; - float damping = 0.7; - - Spring2D(float xpos, float ypos, float m, float g) { - x = xpos; - y = ypos; - mass = m; - gravity = g; - } - - void update(float targetX, float targetY) { - float forceX = (targetX - x) * stiffness; - float ax = forceX / mass; - vx = damping * (vx + ax); - x += vx; - float forceY = (targetY - y) * stiffness; - forceY += gravity; - float ay = forceY / mass; - vy = damping * (vy + ay); - y += vy; - } - - void display(float nx, float ny) { - noStroke(); - ellipse(x, y, radius*2, radius*2); - stroke(255); - line(x, y, nx, ny); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/Ex_19.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/Ex_19.pde deleted file mode 100755 index 68e4d5804..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/Ex_19.pde +++ /dev/null @@ -1,16 +0,0 @@ -FixedSpring s; -float gravity = 0.5; - -void setup() { - size(100, 100); - smooth(); - fill(0); -// Inputs: x, y, mass, gravity, length - s = new FixedSpring(0.0, 50.0, 1.0, gravity, 40.0); -} - -void draw() { - background(204); - s.update(mouseX, mouseY); - s.display(mouseX, mouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/FixedSpring.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/FixedSpring.pde deleted file mode 100755 index dbb55d438..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/FixedSpring.pde +++ /dev/null @@ -1,24 +0,0 @@ -class FixedSpring extends Spring2D { - float springLength; - - FixedSpring(float xpos, float ypos, float m, float g, float s) { - super(xpos, ypos, m, g); - springLength = s; - } - - void update(float newX, float newY) { - // Calculate the target position - float dx = x - newX; - float dy = y - newY; - float angle = atan2(dy, dx); - float targetX = newX + cos(angle) * springLength; - float targetY = newY + sin(angle) * springLength; - - // Activate update method from Spring2D - super.update(targetX, targetY); - - // Constrain to display window - x = constrain(x, radius, width - radius); - y = constrain(y, radius, height - radius); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/Spring2D.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/Spring2D.pde deleted file mode 100755 index bc548351d..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/Spring2D.pde +++ /dev/null @@ -1,35 +0,0 @@ -class Spring2D { - float vx, vy; // The x- and y-axis velocities - float x, y; // The x- and y-coordinates - float gravity; - float mass; - float radius = 10; - float stiffness = 0.2; - float damping = 0.7; - - Spring2D(float xpos, float ypos, float m, float g) { - x = xpos; - y = ypos; - mass = m; - gravity = g; - } - - void update(float targetX, float targetY) { - float forceX = (targetX - x) * stiffness; - float ax = forceX / mass; - vx = damping * (vx + ax); - x += vx; - float forceY = (targetY - y) * stiffness; - forceY += gravity; - float ay = forceY / mass; - vy = damping * (vy + ay); - y += vy; - } - - void display(float nx, float ny) { - noStroke(); - ellipse(x, y, radius*2, radius*2); - stroke(255); - line(x, y, nx, ny); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/Ex_20.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/Ex_20.pde deleted file mode 100755 index 78221bea8..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/Ex_20.pde +++ /dev/null @@ -1,23 +0,0 @@ -FixedSpring s1, s2; -float gravity = 1.2; - -void setup() { - size(100, 100); - smooth(); - fill(0); -// Inputs: x, y, mass, gravity, length - s1 = new FixedSpring(45, 33, 1.5, gravity, 40.0); - s2 = new FixedSpring(55, 66, 1.5, gravity, 40.0); -} - -void draw() { - background(204); - s1.update(s2.x, s2.y); - s2.update(s1.x, s1.y); - s1.display(s2.x, s2.y); - s2.display(s1.x, s1.y); - if (mousePressed == true) { - s1.x = mouseX; - s1.y = mouseY; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/FixedSpring.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/FixedSpring.pde deleted file mode 100755 index dbb55d438..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/FixedSpring.pde +++ /dev/null @@ -1,24 +0,0 @@ -class FixedSpring extends Spring2D { - float springLength; - - FixedSpring(float xpos, float ypos, float m, float g, float s) { - super(xpos, ypos, m, g); - springLength = s; - } - - void update(float newX, float newY) { - // Calculate the target position - float dx = x - newX; - float dy = y - newY; - float angle = atan2(dy, dx); - float targetX = newX + cos(angle) * springLength; - float targetY = newY + sin(angle) * springLength; - - // Activate update method from Spring2D - super.update(targetX, targetY); - - // Constrain to display window - x = constrain(x, radius, width - radius); - y = constrain(y, radius, height - radius); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/Spring2D.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/Spring2D.pde deleted file mode 100755 index bc548351d..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/Spring2D.pde +++ /dev/null @@ -1,35 +0,0 @@ -class Spring2D { - float vx, vy; // The x- and y-axis velocities - float x, y; // The x- and y-coordinates - float gravity; - float mass; - float radius = 10; - float stiffness = 0.2; - float damping = 0.7; - - Spring2D(float xpos, float ypos, float m, float g) { - x = xpos; - y = ypos; - mass = m; - gravity = g; - } - - void update(float targetX, float targetY) { - float forceX = (targetX - x) * stiffness; - float ax = forceX / mass; - vx = damping * (vx + ax); - x += vx; - float forceY = (targetY - y) * stiffness; - forceY += gravity; - float ay = forceY / mass; - vy = damping * (vy + ay); - y += vy; - } - - void display(float nx, float ny) { - noStroke(); - ellipse(x, y, radius*2, radius*2); - stroke(255); - line(x, y, nx, ny); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/readme.txt b/java/examples/Books/Visualizing Data/ch03-usmap/readme.txt deleted file mode 100644 index a7ffe39dc..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/readme.txt +++ /dev/null @@ -1,14 +0,0 @@ -For this chapter, the a sketch that implements every step described in the -book is included. This is because the figures and steps used to develop the -code don't really line up (there are more steps than figures). Each sketch -has a name like step15_framerate, which should be self-explanatory when used -with the book. (I do not recommend using this ugly style of naming for your - own sketches, it's done this way simply because the step/figure numbering -is relevant and needs to be included). - -All examples have been tested but if you find errors of any kind (typos, -unused variables, profanities in the comments, the usual), please contact -me through http://benfry.com/writing and I'll be happy to fix the code. - -The code in this file is (c) 2008 Ben Fry. Rights to use of the code can be -found in the preface of "Visualizing Data". diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step00_show_map/step00_show_map.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step00_show_map/step00_show_map.pde deleted file mode 100644 index f9bba8447..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step00_show_map/step00_show_map.pde +++ /dev/null @@ -1,11 +0,0 @@ -PImage mapImage; - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); -} - -void draw() { - background(255); - image(mapImage, 0, 0); -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/step01_fig1_red_dots.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/step01_fig1_red_dots.pde deleted file mode 100644 index 670a62559..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/step01_fig1_red_dots.pde +++ /dev/null @@ -1,30 +0,0 @@ -PImage mapImage; -Table locationTable; -int rowCount; - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - // Make a data table from a file that contains - // the coordinates of each state. - locationTable = new Table("locations.tsv"); - // The row count will be used a lot, store it locally. - rowCount = locationTable.getRowCount(); -} - -void draw() { - background(255); - image(mapImage, 0, 0); - - // Drawing attributes for the ellipses - smooth(); - fill(192, 0, 0); - noStroke(); - - // Loop through the rows of the locations file and draw the points - for (int row = 0; row < rowCount; row++) { - float x = locationTable.getFloat(row, 1); // column 1 - float y = locationTable.getFloat(row, 2); // column 2 - ellipse(x, y, 9, 9); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/Table.pde deleted file mode 100644 index 1b1a11278..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/Table.pde +++ /dev/null @@ -1,142 +0,0 @@ -class Table { - String[][] data; - int rowCount; - - - Table() { - data = new String[10][10]; - } - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - // Write this table as a TSV file - void write(PrintWriter writer) { - for (int i = 0; i < rowCount; i++) { - for (int j = 0; j < data[i].length; j++) { - if (j != 0) { - writer.print(TAB); - } - if (data[i][j] != null) { - writer.print(data[i][j]); - } - } - writer.println(); - } - writer.flush(); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/step02_fig2_varying_sizes.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/step02_fig2_varying_sizes.pde deleted file mode 100644 index 720a9cd5e..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/step02_fig2_varying_sizes.pde +++ /dev/null @@ -1,57 +0,0 @@ -PImage mapImage; -Table locationTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - rowCount = locationTable.getRowCount(); - - // Read the data table - dataTable = new Table("random.tsv"); - - // Find the minimum and maximum values - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } -} - - -void draw() { - background(255); - image(mapImage, 0, 0); - - smooth(); - fill(192, 0, 0); - noStroke(); - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } -} - - -// Map the size of the ellipse to the data value -void drawData(float x, float y, String abbrev) { - // Get data value for state - float value = dataTable.getFloat(abbrev, 1); - // Re-map the value to a number between 2 and 40 - float mapped = map(value, dataMin, dataMax, 2, 40); - // Draw an ellipse for this item - ellipse(x, y, mapped, mapped); -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/Table.pde deleted file mode 100644 index 21fb6ba0e..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/Table.pde +++ /dev/null @@ -1,82 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/step03_fig3_red_to_blue.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/step03_fig3_red_to_blue.pde deleted file mode 100644 index dc1514b78..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/step03_fig3_red_to_blue.pde +++ /dev/null @@ -1,54 +0,0 @@ -PImage mapImage; -Table locationTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - rowCount = locationTable.getRowCount(); - - // Read the data table - dataTable = new Table("random.tsv"); - - // Find the minimum and maximum values - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } - - smooth(); - noStroke(); -} - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float percent = norm(value, dataMin, dataMax); - color between = lerpColor(#FF4422, #4422CC, percent); // red to blue - fill(between); - ellipse(x, y, 15, 15); -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/Table.pde deleted file mode 100644 index 21fb6ba0e..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/Table.pde +++ /dev/null @@ -1,82 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/step04_fig4_blue_green.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/step04_fig4_blue_green.pde deleted file mode 100644 index 9d5c73bb2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/step04_fig4_blue_green.pde +++ /dev/null @@ -1,54 +0,0 @@ -PImage mapImage; -Table locationTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - rowCount = locationTable.getRowCount(); - - // Read the data table - dataTable = new Table("random.tsv"); - - // Find the minimum and maximum values - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } - smooth(); - noStroke(); -} - - -void draw() { - background(255); - tint(255, 160); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float percent = norm(value, dataMin, dataMax); - color between = lerpColor(#296F34, #61E2F0, percent); - fill(between); - ellipse(x, y, 15, 15); -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/Table.pde deleted file mode 100644 index 21fb6ba0e..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/Table.pde +++ /dev/null @@ -1,82 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/step05_fig5_blue_green_hsb.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/step05_fig5_blue_green_hsb.pde deleted file mode 100644 index e17f45a94..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/step05_fig5_blue_green_hsb.pde +++ /dev/null @@ -1,54 +0,0 @@ -PImage mapImage; -Table locationTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - rowCount = locationTable.getRowCount(); - - // Read the data table - dataTable = new Table("random.tsv"); - - // Find the minimum and maximum values - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } - - smooth(); - noStroke(); -} - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float percent = norm(value, dataMin, dataMax); - color between = lerpColor(#296F34, #61E2F0, percent, HSB); - fill(between); - ellipse(x, y, 15, 15); -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/Table.pde deleted file mode 100644 index 21fb6ba0e..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/Table.pde +++ /dev/null @@ -1,82 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/step06_fig6_two_sided_range.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/step06_fig6_two_sided_range.pde deleted file mode 100644 index 5351ea43d..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/step06_fig6_two_sided_range.pde +++ /dev/null @@ -1,59 +0,0 @@ -PImage mapImage; -Table locationTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - rowCount = locationTable.getRowCount(); - - // Read the data table - dataTable = new Table("random.tsv"); - - // Find the minimum and maximum values - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } - - smooth(); - noStroke(); -} - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float diameter = 0; - if (value >= 0) { - diameter = map(value, 0, dataMax, 3, 30); - fill(#333366); // blue - } else { - diameter = map(value, 0, dataMin, 3, 30); - fill(#ec5166); // red - } - ellipse(x, y, diameter, diameter); -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/Table.pde deleted file mode 100644 index 21fb6ba0e..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/Table.pde +++ /dev/null @@ -1,82 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/step07_fig7_two_sided_alpha.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/step07_fig7_two_sided_alpha.pde deleted file mode 100644 index dc803f3bc..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/step07_fig7_two_sided_alpha.pde +++ /dev/null @@ -1,58 +0,0 @@ -PImage mapImage; -Table locationTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - rowCount = locationTable.getRowCount(); - - // Read the data table - dataTable = new Table("random.tsv"); - - // Find the minimum and maximum values - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } - - smooth(); - noStroke(); -} - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - if (value >= 0) { - float a = map(value, 0, dataMax, 0, 255); - fill(#333366, a); - } else { - float a = map(value, 0, dataMin, 0, 255); - fill(#EC5166, a); - } - ellipse(x, y, 15, 15); -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/Table.pde deleted file mode 100644 index 21fb6ba0e..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/Table.pde +++ /dev/null @@ -1,82 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/step08_rollovers.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/step08_rollovers.pde deleted file mode 100644 index 4c757da66..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/step08_rollovers.pde +++ /dev/null @@ -1,70 +0,0 @@ -PImage mapImage; -Table locationTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - rowCount = locationTable.getRowCount(); - - // Read the data table - dataTable = new Table("random.tsv"); - - // Find the minimum and maximum values - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); -} - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - if (dist(x, y, mouseX, mouseY) < radius+2) { - fill(0); - textAlign(CENTER); - // Show the data value and the state abbreviation in parentheses - text(value + " (" + abbrev + ")", x, y-radius-4); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/Table.pde deleted file mode 100644 index 21fb6ba0e..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/Table.pde +++ /dev/null @@ -1,82 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/step09_rollovers_full_names.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/step09_rollovers_full_names.pde deleted file mode 100644 index 274ef8080..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/step09_rollovers_full_names.pde +++ /dev/null @@ -1,70 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - - dataTable = new Table("random.tsv"); - - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); -} - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - if (dist(x, y, mouseX, mouseY) < radius+2) { - fill(0); - textAlign(CENTER); - String name = nameTable.getString(abbrev, 1); - text(name + " " + value, x, y-radius-4); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/step10_single_rollover.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/step10_single_rollover.pde deleted file mode 100644 index db7d65627..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/step10_single_rollover.pde +++ /dev/null @@ -1,94 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - - dataTable = new Table("random.tsv"); - - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); -} - - -// Global variables set in drawData() and read in draw() -float closestDist; -String closestText; -float closestTextX; -float closestTextY; - - -void draw() { - background(255); - image(mapImage, 0, 0); - - // Use the built-in width and height variables to set the - // closest distance high so it will be replaced immediately - closestDist = width*height; - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } - - // Use global variables set in drawData() - // to draw text related to closest circle. - if (closestDist != width*height) { - fill(0); - textAlign(CENTER); - text(closestText, closestTextX, closestTextY); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - float d = dist(x, y, mouseX, mouseY); - // Because the following check is done each time a new - // circle is drawn, we end up with the values of the - // circle closest to the mouse. - if ((d < radius + 2) && (d < closestDist)) { - closestDist = d; - String name = nameTable.getString(abbrev, 1); - closestText = name + " " + value; - closestTextX = x; - closestTextY = y-radius-4; - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/step11_randomize_on_keypress.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/step11_randomize_on_keypress.pde deleted file mode 100644 index 246ae2ad8..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/step11_randomize_on_keypress.pde +++ /dev/null @@ -1,90 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = -10; -float dataMax = 10; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - - dataTable = new Table("random.tsv"); - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); -} - -float closestDist; -String closestText; -float closestTextX; -float closestTextY; - - -void draw() { - background(255); - image(mapImage, 0, 0); - - closestDist = width*height; // abritrarily high - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } - - if (closestDist != width*height) { - fill(0); - textAlign(CENTER); - text(closestText, closestTextX, closestTextY); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - float d = dist(x, y, mouseX, mouseY); - if ((d < radius + 2) && (d < closestDist)) { - closestDist = d; - String name = nameTable.getString(abbrev, 1); - closestText = name + " " + value; - closestTextX = x; - closestTextY = y-radius-4; - } -} - - -void keyPressed() { - if (key == ' ') { - updateTable(); - } -} - - -void updateTable() { - for (int row = 0; row < rowCount; row++) { - float newValue = random(-10, 10); - dataTable.setFloat(row, 1, newValue); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/step12_randomize_with_nfp.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/step12_randomize_with_nfp.pde deleted file mode 100644 index bc355b4c1..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/step12_randomize_with_nfp.pde +++ /dev/null @@ -1,90 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = -10; -float dataMax = 10; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - - dataTable = new Table("random.tsv"); - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); -} - -float closestDist; -String closestText; -float closestTextX; -float closestTextY; - - -void draw() { - background(255); - image(mapImage, 0, 0); - - closestDist = width*height; // abritrarily high - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } - - if (closestDist != width*height) { - fill(0); - textAlign(CENTER); - text(closestText, closestTextX, closestTextY); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - float d = dist(x, y, mouseX, mouseY); - if ((d < radius + 2) && (d < closestDist)) { - closestDist = d; - String name = nameTable.getString(abbrev, 1); - closestText = name + " " + nfp(value, 0, 2); - closestTextX = x; - closestTextY = y-radius-4; - } -} - - -void keyPressed() { - if (key == ' ') { - updateTable(); - } -} - - -void updateTable() { - for (int row = 0; row < rowCount; row++) { - float newValue = random(-10, 10); - dataTable.setFloat(row, 1, newValue); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/random.cgi b/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/random.cgi deleted file mode 100755 index 48e28fe77..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/random.cgi +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/perl - -# An array of the 50 state abbreviations -@states = ('AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'FL', 'GA', - 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', - 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', - 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', - 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'); - -# A CGI script must identify the type of data it's sending, -# this line specifies that plain text data will follow. -print "Content-type: text/plain\n\n"; - -# Loop through each of the state abbreviations in the array -foreach $state (@states) { - - # Pick a random number between -10 and 10. (rand() returns a - # number between 0 and 1, multiply that by 20 and subtract 10) - $r = (rand() * 20) - 10; - - # Print the state name, followed by a tab, - # then the random value, followed by a new line. - print "$state\t$r\n"; -} \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/step13_randomize_from_cgi.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/step13_randomize_from_cgi.pde deleted file mode 100644 index 9b6089691..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/step13_randomize_from_cgi.pde +++ /dev/null @@ -1,85 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = -10; -float dataMax = 10; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - updateTable(); - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); -} - -float closestDist; -String closestText; -float closestTextX; -float closestTextY; - - -void draw() { - image(mapImage, 0, 0); - - closestDist = width*height; // abritrarily high - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } - - if (closestDist != width*height) { - fill(0); - textAlign(CENTER); - text(closestText, closestTextX, closestTextY); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - float d = dist(x, y, mouseX, mouseY); - if ((d < radius + 2) && (d < closestDist)) { - closestDist = d; - String name = nameTable.getString(abbrev, 1); - closestText = name + " " + nfp(value, 0, 2); - closestTextX = x; - closestTextY = y-radius-4; - } -} - - -void keyPressed() { - if (key == ' ') { - updateTable(); - } -} - - -void updateTable() { - dataTable = new Table("http://benfry.com/writing/map/random.cgi"); -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/Integrator.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/Integrator.pde deleted file mode 100644 index fd4edb3b1..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/Integrator.pde +++ /dev/null @@ -1,60 +0,0 @@ -class Integrator { - - final float DAMPING = 0.5f; - final float ATTRACTION = 0.2f; - - float value; - float vel; - float accel; - float force; - float mass = 1; - - float damping = DAMPING; - float attraction = ATTRACTION; - boolean targeting; - float target; - - - Integrator() { } - - - Integrator(float value) { - this.value = value; - } - - - Integrator(float value, float damping, float attraction) { - this.value = value; - this.damping = damping; - this.attraction = attraction; - } - - - void set(float v) { - value = v; - } - - - void update() { - if (targeting) { - force += attraction * (target - value); - } - - accel = force / mass; - vel = (vel + accel) * damping; - value += vel; - - force = 0; - } - - - void target(float t) { - targeting = true; - target = t; - } - - - void noTarget() { - targeting = false; - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/step14_integrators.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/step14_integrators.pde deleted file mode 100644 index f79a1ac0a..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/step14_integrators.pde +++ /dev/null @@ -1,106 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = -10; -float dataMax = 10; - -Integrator[] interpolators; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - - dataTable = new Table("random.tsv"); - interpolators = new Integrator[rowCount]; - for (int row = 0; row < rowCount; row++) { - float initialValue = dataTable.getFloat(row, 1); - interpolators[row] = new Integrator(initialValue); - } - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); -} - -float closestDist; -String closestText; -float closestTextX; -float closestTextY; - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - interpolators[row].update(); - } - - closestDist = width*height; // abritrarily high - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } - - if (closestDist != width*height) { - fill(0); - textAlign(CENTER); - text(closestText, closestTextX, closestTextY); - } -} - - -void drawData(float x, float y, String abbrev) { - // Figure out what row this is - int row = dataTable.getRowIndex(abbrev); - // Get the current value - float value = interpolators[row].value; - - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - float d = dist(x, y, mouseX, mouseY); - if ((d < radius + 2) && (d < closestDist)) { - closestDist = d; - String name = nameTable.getString(abbrev, 1); - String val = nfp(interpolators[row].target, 0, 2); - closestText = name + " " + val; - closestTextX = x; - closestTextY = y-radius-4; - } -} - - -void keyPressed() { - if (key == ' ') { - updateTable(); - } -} - - -void updateTable() { - for (int row = 0; row < rowCount; row++) { - float newValue = random(dataMin, dataMax); - interpolators[row].target(newValue); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/Integrator.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/Integrator.pde deleted file mode 100644 index fd4edb3b1..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/Integrator.pde +++ /dev/null @@ -1,60 +0,0 @@ -class Integrator { - - final float DAMPING = 0.5f; - final float ATTRACTION = 0.2f; - - float value; - float vel; - float accel; - float force; - float mass = 1; - - float damping = DAMPING; - float attraction = ATTRACTION; - boolean targeting; - float target; - - - Integrator() { } - - - Integrator(float value) { - this.value = value; - } - - - Integrator(float value, float damping, float attraction) { - this.value = value; - this.damping = damping; - this.attraction = attraction; - } - - - void set(float v) { - value = v; - } - - - void update() { - if (targeting) { - force += attraction * (target - value); - } - - accel = force / mass; - vel = (vel + accel) * damping; - value += vel; - - force = 0; - } - - - void target(float t) { - targeting = true; - target = t; - } - - - void noTarget() { - targeting = false; - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/step15_framerate.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/step15_framerate.pde deleted file mode 100644 index 407e5f469..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/step15_framerate.pde +++ /dev/null @@ -1,107 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = -10; -float dataMax = 10; - -Integrator[] interpolators; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - - dataTable = new Table("random.tsv"); - interpolators = new Integrator[rowCount]; - for (int row = 0; row < rowCount; row++) { - float initialValue = dataTable.getFloat(row, 1); - interpolators[row] = new Integrator(initialValue); - } - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); - frameRate(30); -} - -float closestDist; -String closestText; -float closestTextX; -float closestTextY; - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - interpolators[row].update(); - } - - closestDist = width*height; // abritrarily high - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } - - if (closestDist != width*height) { - fill(0); - textAlign(CENTER); - text(closestText, closestTextX, closestTextY); - } -} - - -void drawData(float x, float y, String abbrev) { - // Figure out what row this is - int row = dataTable.getRowIndex(abbrev); - // Get the current value - float value = interpolators[row].value; - - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - float d = dist(x, y, mouseX, mouseY); - if ((d < radius + 2) && (d < closestDist)) { - closestDist = d; - String name = nameTable.getString(abbrev, 1); - String val = nfp(interpolators[row].target, 0, 2); - closestText = name + " " + val; - closestTextX = x; - closestTextY = y-radius-4; - } -} - - -void keyPressed() { - if (key == ' ') { - updateTable(); - } -} - - -void updateTable() { - for (int row = 0; row < rowCount; row++) { - float newValue = random(dataMin, dataMax); - interpolators[row].target(newValue); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/Integrator.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/Integrator.pde deleted file mode 100644 index fd4edb3b1..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/Integrator.pde +++ /dev/null @@ -1,60 +0,0 @@ -class Integrator { - - final float DAMPING = 0.5f; - final float ATTRACTION = 0.2f; - - float value; - float vel; - float accel; - float force; - float mass = 1; - - float damping = DAMPING; - float attraction = ATTRACTION; - boolean targeting; - float target; - - - Integrator() { } - - - Integrator(float value) { - this.value = value; - } - - - Integrator(float value, float damping, float attraction) { - this.value = value; - this.damping = damping; - this.attraction = attraction; - } - - - void set(float v) { - value = v; - } - - - void update() { - if (targeting) { - force += attraction * (target - value); - } - - accel = force / mass; - vel = (vel + accel) * damping; - value += vel; - - force = 0; - } - - - void target(float t) { - targeting = true; - target = t; - } - - - void noTarget() { - targeting = false; - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/step16_lethargic.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/step16_lethargic.pde deleted file mode 100644 index 3dd017233..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/step16_lethargic.pde +++ /dev/null @@ -1,107 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = -10; -float dataMax = 10; - -Integrator[] interpolators; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - - dataTable = new Table("random.tsv"); - interpolators = new Integrator[rowCount]; - for (int row = 0; row < rowCount; row++) { - float initialValue = dataTable.getFloat(row, 1); - interpolators[row] = new Integrator(initialValue, 0.5, 0.01); - } - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); - //frameRate(30); -} - -float closestDist; -String closestText; -float closestTextX; -float closestTextY; - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - interpolators[row].update(); - } - - closestDist = width*height; // abritrarily high - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } - - if (closestDist != width*height) { - fill(0); - textAlign(CENTER); - text(closestText, closestTextX, closestTextY); - } -} - - -void drawData(float x, float y, String abbrev) { - // Figure out what row this is - int row = dataTable.getRowIndex(abbrev); - // Get the current value - float value = interpolators[row].value; - - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - float d = dist(x, y, mouseX, mouseY); - if ((d < radius + 2) && (d < closestDist)) { - closestDist = d; - String name = nameTable.getString(abbrev, 1); - String val = nfp(interpolators[row].target, 0, 2); - closestText = name + " " + val; - closestTextX = x; - closestTextY = y-radius-4; - } -} - - -void keyPressed() { - if (key == ' ') { - updateTable(); - } -} - - -void updateTable() { - for (int row = 0; row < rowCount; row++) { - float newValue = random(dataMin, dataMax); - interpolators[row].target(newValue); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/Integrator.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/Integrator.pde deleted file mode 100644 index fd4edb3b1..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/Integrator.pde +++ /dev/null @@ -1,60 +0,0 @@ -class Integrator { - - final float DAMPING = 0.5f; - final float ATTRACTION = 0.2f; - - float value; - float vel; - float accel; - float force; - float mass = 1; - - float damping = DAMPING; - float attraction = ATTRACTION; - boolean targeting; - float target; - - - Integrator() { } - - - Integrator(float value) { - this.value = value; - } - - - Integrator(float value, float damping, float attraction) { - this.value = value; - this.damping = damping; - this.attraction = attraction; - } - - - void set(float v) { - value = v; - } - - - void update() { - if (targeting) { - force += attraction * (target - value); - } - - accel = force / mass; - vel = (vel + accel) * damping; - value += vel; - - force = 0; - } - - - void target(float t) { - targeting = true; - target = t; - } - - - void noTarget() { - targeting = false; - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/step17_bouncy.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/step17_bouncy.pde deleted file mode 100644 index 431e41281..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/step17_bouncy.pde +++ /dev/null @@ -1,107 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = -10; -float dataMax = 10; - -Integrator[] interpolators; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - - dataTable = new Table("random.tsv"); - interpolators = new Integrator[rowCount]; - for (int row = 0; row < rowCount; row++) { - float initialValue = dataTable.getFloat(row, 1); - interpolators[row] = new Integrator(initialValue, 0.9, 0.1); - } - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); - //frameRate(30); -} - -float closestDist; -String closestText; -float closestTextX; -float closestTextY; - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - interpolators[row].update(); - } - - closestDist = width*height; // abritrarily high - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } - - if (closestDist != width*height) { - fill(0); - textAlign(CENTER); - text(closestText, closestTextX, closestTextY); - } -} - - -void drawData(float x, float y, String abbrev) { - // Figure out what row this is - int row = dataTable.getRowIndex(abbrev); - // Get the current value - float value = interpolators[row].value; - - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - float d = dist(x, y, mouseX, mouseY); - if ((d < radius + 2) && (d < closestDist)) { - closestDist = d; - String name = nameTable.getString(abbrev, 1); - String val = nfp(interpolators[row].target, 0, 2); - closestText = name + " " + val; - closestTextX = x; - closestTextY = y-radius-4; - } -} - - -void keyPressed() { - if (key == ' ') { - updateTable(); - } -} - - -void updateTable() { - for (int row = 0; row < rowCount; row++) { - float newValue = random(dataMin, dataMax); - interpolators[row].target(newValue); - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/figure_01_just_points.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/figure_01_just_points.pde deleted file mode 100644 index 69c41d5a9..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/figure_01_just_points.pde +++ /dev/null @@ -1,60 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; - -int yearMin, yearMax; -int[] years; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = data.getTableMax(); - - // Corners of the plotted time series - plotX1 = 50; - plotX2 = width - plotX1; - plotY1 = 60; - plotY2 = height - plotY1; - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - strokeWeight(5); - // Draw the data for the first column - stroke(#5679C1); - drawDataPoints(0); -} - - -// Draw the data as a series of points -void drawDataPoints(int col) { - int rowCount = data.getRowCount(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - point(x, y); - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/figure_02_plot_title.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/figure_02_plot_title.pde deleted file mode 100644 index bd1024aca..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/figure_02_plot_title.pde +++ /dev/null @@ -1,74 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; - -int currentColumn = 0; -int columnCount; - -int yearMin, yearMax; -int[] years; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = data.getTableMax(); - - // Corners of the plotted time series - plotX1 = 50; - plotX2 = width - plotX1; - plotY1 = 60; - plotY2 = height - plotY1; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - // Draw the title of the current plot - fill(0); - textSize(20); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); - - stroke(#5679C1); - strokeWeight(5); - drawDataPoints(currentColumn); -} - - -// Draw the data as a series of points -void drawDataPoints(int col) { - int rowCount = data.getRowCount(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - point(x, y); - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/FloatTable.pde deleted file mode 100755 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/figure_03_labels.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/figure_03_labels.pde deleted file mode 100755 index ead08a5b0..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/figure_03_labels.pde +++ /dev/null @@ -1,115 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = data.getTableMax(); - - // Corners of the plotted time series - plotX1 = 50; - plotX2 = width - plotX1; - plotY1 = 60; - plotY2 = height - plotY1; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitle(); - drawYearLabels(); - - stroke(#5679C1); - strokeWeight(5); - drawDataPoints(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER, TOP); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + 5); - } - } -} - - -void drawDataPoints(int col) { - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - point(x, y); - } - } -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/FloatTable.pde deleted file mode 100755 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/figure_04_grid.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/figure_04_grid.pde deleted file mode 100755 index bf50fbc3f..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/figure_04_grid.pde +++ /dev/null @@ -1,247 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - //println(data.getTableMin()); - dataMin = 0; //data.getTableMin(); - dataMax = data.getTableMax(); - - // Corners of the plotted time series - plotX1 = 50; - plotX2 = width - plotX1; - plotY1 = 60; - plotY2 = height - plotY1; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - // Draw the title of the current plot - drawTitle(); - drawYearLabels(); - - stroke(#5679C1); - strokeWeight(5); - drawDataPoints(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER, TOP); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -void drawDataPoints(int col) { - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - point(x, y); - } - } -} - - -void drawDataLine(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - endShape(); -} - - -void drawDataHighlight(int col) { - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - if (dist(mouseX, mouseY, x, y) < 3) { - strokeWeight(10); - point(x, y); - fill(0); - textSize(10); - textAlign(CENTER); - text(nf(value, 0, 2) + " (" + years[row] + ")", x, y-8); - textAlign(LEFT); - } - } - } -} - - -void drawDataCurve(int col) { - //stroke(0); - //noStroke(); - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - //float x = map(row, 0, rowCount-1, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - - //ellipse(x, y, 5, 5); // only change for ellipses - curveVertex(x, y); - // double the curve points for the start and stop - if ((row == 0) || (row == rowCount-1)) { - curveVertex(x, y); - } - } - } - endShape(); -} - - -void drawDataArea(int col) { - float leftEdge = width; - float rightEdge = 0; - - noStroke(); - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - - if (x < leftEdge) { - leftEdge = x; - } - if (x > rightEdge) { - rightEdge = x; - } - - vertex(x, y); - } - } - // draw the lower-right and lower-left corners - vertex(rightEdge, plotY2); - vertex(leftEdge, plotY2); - endShape(CLOSE); -} - - -void drawDataEllipses(int col) { - ellipseMode(CENTER); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - //float x = map(row, 0, rowCount-1, plotX1, plotX2); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - ellipse(x, y, 5, 5); - } - } -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} - - - /* - // print the min and max - println(dataMin + " " + dataMax); - */ - - /* - // print column names - for (int i = 0; i < data.getColumnCount(); i++) { - println(data.getColumnName(i)); - } - */ - - /* - // print row names - for (int i = 0; i < data.getRowCount(); i++) { - println(data.getRowName(i)); - } - */ - - /* - // print a row of data - int row = 4; - for (int i = 0; i < data.getColumnCount(); i++) { - print(data.getFloat(row, i) + "\t"); - } - println(); - */ diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/figure_05_ylabels_and_ticks.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/figure_05_ylabels_and_ticks.pde deleted file mode 100644 index e955fb852..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/figure_05_ylabels_and_ticks.pde +++ /dev/null @@ -1,150 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 50; - plotX2 = width - plotX1; - plotY1 = 60; - plotY2 = height - plotY1; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - // Draw the title of the current plot - drawTitle(); - - drawYearLabels(); - drawVolumeLabels(); - - stroke(#5679C1); - strokeWeight(5); - drawDataPoints(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataPoints(int col) { - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - point(x, y); - } - } -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/figure_06_finalish.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/figure_06_finalish.pde deleted file mode 100644 index 2d1b4f48b..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/figure_06_finalish.pde +++ /dev/null @@ -1,166 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; -int volumeIntervalMinor = 5; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitle(); - drawAxisLabels(); - - drawYearLabels(); - drawVolumeLabels(); - - stroke(#5679C1); - strokeWeight(5); - drawDataPoints(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - // Use \n (enter/linefeed) to break the text into separate lines - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER, TOP); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -void drawVolumeLabels() { - fill(0); - textSize(10); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - if (v == dataMin) { - textAlign(RIGHT); // Align by the bottom - } else if (v == dataMax) { - textAlign(RIGHT, TOP); // Align by the top - } else { - textAlign(RIGHT, CENTER); // Center vertically - } - text(floor(v), plotX1 - 10, y); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - // Commented out, too distracting visually - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataPoints(int col) { - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - point(x, y); - } - } -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07a_shape_noFill/figure_07a_shape_noFill.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07a_shape_noFill/figure_07a_shape_noFill.pde deleted file mode 100644 index e3ea37cba..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07a_shape_noFill/figure_07a_shape_noFill.pde +++ /dev/null @@ -1,9 +0,0 @@ -smooth(); - -noFill(); -beginShape(); -vertex(10, 10); -vertex(90, 30); -vertex(40, 90); -vertex(50, 40); -endShape(); diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07b_shape_fill/figure_07b_shape_fill.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07b_shape_fill/figure_07b_shape_fill.pde deleted file mode 100644 index d3a244d54..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07b_shape_fill/figure_07b_shape_fill.pde +++ /dev/null @@ -1,8 +0,0 @@ -smooth(); - -beginShape(); -vertex(10, 10); -vertex(90, 30); -vertex(40, 90); -vertex(50, 40); -endShape(); diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07c_shape_close/figure_07c_shape_close.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07c_shape_close/figure_07c_shape_close.pde deleted file mode 100644 index 61a440ae5..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07c_shape_close/figure_07c_shape_close.pde +++ /dev/null @@ -1,8 +0,0 @@ -smooth(); - -beginShape(); -vertex(10, 10); -vertex(90, 30); -vertex(40, 90); -vertex(50, 40); -endShape(CLOSE); diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/figure_08_draw_data_line.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/figure_08_draw_data_line.pde deleted file mode 100644 index 59032aeda..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/figure_08_draw_data_line.pde +++ /dev/null @@ -1,167 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitle(); - drawAxisLabels(); - drawYearLabels(); - drawVolumeLabels(); - - stroke(#5679C1); - strokeWeight(5); - noFill(); - drawDataLine(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataLine(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - endShape(); -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/figure_09_draw_data_mixed.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/figure_09_draw_data_mixed.pde deleted file mode 100644 index 6f864a64d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/figure_09_draw_data_mixed.pde +++ /dev/null @@ -1,181 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitle(); - drawAxisLabels(); - drawYearLabels(); - drawVolumeLabels(); - - stroke(#5679C1); - strokeWeight(5); - drawDataPoints(currentColumn); - noFill(); - strokeWeight(0.5); - drawDataLine(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataPoints(int col) { - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - point(x, y); - } - } -} - - -void drawDataLine(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - endShape(); -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/figure_10_rollovers.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/figure_10_rollovers.pde deleted file mode 100644 index f4c78788d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/figure_10_rollovers.pde +++ /dev/null @@ -1,200 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitle(); - drawAxisLabels(); - drawYearLabels(); - drawVolumeLabels(); - - stroke(#5679C1); - noFill(); - strokeWeight(2); - drawDataLine(currentColumn); - drawDataHighlight(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataPoints(int col) { - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - point(x, y); - } - } -} - - -void drawDataLine(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - endShape(); -} - - -void drawDataHighlight(int col) { - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - if (dist(mouseX, mouseY, x, y) < 3) { - strokeWeight(10); - point(x, y); - fill(0); - textSize(10); - textAlign(CENTER); - text(nf(value, 0, 2) + " (" + years[row] + ")", x, y-8); - textAlign(LEFT); - } - } - } -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/figure_11_curve.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/figure_11_curve.pde deleted file mode 100644 index 37cafb864..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/figure_11_curve.pde +++ /dev/null @@ -1,174 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitle(); - drawAxisLabels(); - drawYearLabels(); - drawVolumeLabels(); - - // draw the data using a long curve - noFill(); - stroke(32, 128, 192); - // balance the weight of the lines with the closeness of the data points - strokeWeight(2); - drawDataCurve(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataCurve(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - - curveVertex(x, y); - // double the curve points for the start and stop - if ((row == 0) || (row == rowCount-1)) { - curveVertex(x, y); - } - } - } - endShape(); -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/figure_12_area.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/figure_12_area.pde deleted file mode 100644 index 213b74e8b..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/figure_12_area.pde +++ /dev/null @@ -1,169 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitle(); - drawAxisLabels(); - drawYearLabels(); - drawVolumeLabels(); - - fill(#5679C1); - drawDataArea(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataArea(int col) { - noStroke(); - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - // draw the lower-right and lower-left corners - vertex(plotX2, plotY2); - vertex(plotX1, plotY2); - endShape(CLOSE); -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/figure_13_reversed.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/figure_13_reversed.pde deleted file mode 100644 index 3eba9d586..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/figure_13_reversed.pde +++ /dev/null @@ -1,166 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - float plotW = plotX2 - plotX1; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(255); - - drawTitle(); - drawAxisLabels(); - drawVolumeLabels(); - - noStroke(); - fill(#5679C1); - drawDataArea(currentColumn); - - drawYearLabels(); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(255); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataArea(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - // Draw the lower-right and lower-left corners - vertex(plotX2, plotY2); - vertex(plotX1, plotY2); - endShape(CLOSE); -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/figure_14_bar_chart.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/figure_14_bar_chart.pde deleted file mode 100644 index c7a44b9ff..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/figure_14_bar_chart.pde +++ /dev/null @@ -1,183 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - float plotW = plotX2 - plotX1; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(255); - - drawTitle(); - drawAxisLabels(); - drawVolumeLabels(); - - noStroke(); - fill(#5679C1); - drawDataBars(currentColumn); - - drawYearLabels(); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(255); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - //line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -float barWidth = 4; // Add this line above setup() - -void drawDataBars(int col) { - noStroke(); - rectMode(CORNERS); - - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - rect(x-barWidth/2, y, x+barWidth/2, plotY2); - } - } -} - - -void drawDataArea(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - // Draw the lower-right and lower-left corners - vertex(plotX2, plotY2); - vertex(plotX1, plotY2); - endShape(CLOSE); -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/figure_15_tabs.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/figure_15_tabs.pde deleted file mode 100644 index 963eb668e..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/figure_15_tabs.pde +++ /dev/null @@ -1,228 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - //println(data.getTableMin()); - dataMin = 0; //data.getTableMin(); - //dataMax = data.getTableMax(); - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - //println(dataMax); - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitleTabs(); - drawAxisLabels(); - drawYearLabels(); - drawVolumeLabels(); - - noStroke(); - fill(#5679C1); - drawDataArea(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -float[] tabLeft, tabRight; // Add above setup() -float tabTop, tabBottom; -float tabPad = 10; - -void drawTitleTabs() { - rectMode(CORNERS); - noStroke(); - textSize(20); - textAlign(LEFT); - - // On first use of this method, allocate space for an array - // to store the values for the left and right edges of the tabs - if (tabLeft == null) { - tabLeft = new float[columnCount]; - tabRight = new float[columnCount]; - } - - float runningX = plotX1; - tabTop = plotY1 - textAscent() - 15; - tabBottom = plotY1; - - for (int col = 0; col < columnCount; col++) { - String title = data.getColumnName(col); - tabLeft[col] = runningX; - float titleWidth = textWidth(title); - tabRight[col] = tabLeft[col] + tabPad + titleWidth + tabPad; - - // If the current tab, set its background white, otherwise use pale gray - fill(col == currentColumn ? 255 : 224); - rect(tabLeft[col], tabTop, tabRight[col], tabBottom); - - // If the current tab, use black for the text, otherwise use dark gray - fill(col == currentColumn ? 0 : 64); - text(title, runningX + tabPad, plotY1 - 10); - - runningX = tabRight[col]; - } -} - - -void mousePressed() { - if (mouseY > tabTop && mouseY < tabBottom) { - for (int col = 0; col < columnCount; col++) { - if (mouseX > tabLeft[col] && mouseX < tabRight[col]) { - setCurrent(col); - } - } - } -} - - -void setCurrent(int col) { - currentColumn = col; -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataArea(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - // Draw the lower-right and lower-left corners - vertex(plotX2, plotY2); - vertex(plotX1, plotY2); - endShape(CLOSE); -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/readme.txt b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/readme.txt deleted file mode 100644 index df3021132..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/readme.txt +++ /dev/null @@ -1,16 +0,0 @@ -For this chapter, the sketch used to create each figure is included, -because the figures and steps used to develop the code line up pretty -well. Each sketch has a name like figure_03_labels, which should be -self-explanatory. (I do not recommend using this ugly style of naming -for your own sketches, it's done this way simply because the figure -numbering is relevant and needs to be included). The last two sketches -are called step_16 and step_17 because there was no figure 16 or 17 -associated with them. - -All examples have been tested but if you find errors of any kind -(typos, unused variables, profanities in the comments, the usual), -please contact me through http://benfry.com/writing and I'll be happy -to fix the code. - -The code in this file is (c) 2008 Ben Fry. Rights to use of the code -can be found in the preface of "Visualizing Data". diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/step_16_tabs_images.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/step_16_tabs_images.pde deleted file mode 100644 index 20b435843..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/step_16_tabs_images.pde +++ /dev/null @@ -1,237 +0,0 @@ -// The images used in this example are identical to the text-only tabs used in the -// previous step. Some might say that's rather unimaginative. Others might see it -// as an opportunity to produce nicer tab images to replace them. - -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitleTabs(); - drawAxisLabels(); - - drawYearLabels(); - drawVolumeLabels(); - - noStroke(); - fill(#5679C1); - drawDataArea(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -float[] tabLeft, tabRight; // Add above setup() -float tabTop, tabBottom; -float tabPad = 0; // No padding necessary when using images -PImage[] tabImageNormal; -PImage[] tabImageHighlight; - -void drawTitleTabs() { - rectMode(CORNERS); - noStroke(); - textSize(20); - textAlign(LEFT); - - // Allocate the tab position array, and load the tab images. - if (tabLeft == null) { - tabLeft = new float[columnCount]; - tabRight = new float[columnCount]; - - tabImageNormal = new PImage[columnCount]; - tabImageHighlight = new PImage[columnCount]; - for (int col = 0; col < columnCount; col++) { - String title = data.getColumnName(col); - tabImageNormal[col] = loadImage(title + "-unselected.png"); - tabImageHighlight[col] = loadImage(title + "-selected.png"); - } - } - - float runningX = plotX1; - tabBottom = plotY1; - // Size based on the height of the tabs by checking the - // height of the first (all images are the same height) - tabTop = plotY1 - tabImageNormal[0].height; - - for (int col = 0; col < columnCount; col++) { - String title = data.getColumnName(col); - tabLeft[col] = runningX; - float titleWidth = tabImageNormal[col].width; - tabRight[col] = tabLeft[col] + tabPad + titleWidth + tabPad; - - PImage tabImage = (col == currentColumn) ? - tabImageHighlight[col] : tabImageNormal[col]; - image(tabImage, tabLeft[col], tabTop); - - runningX = tabRight[col]; - } -} - - -void mousePressed() { - if (mouseY > tabTop && mouseY < tabBottom) { - for (int col = 0; col < columnCount; col++) { - if (mouseX > tabLeft[col] && mouseX < tabRight[col]) { - setCurrent(col); - } - } - } -} - - -void setCurrent(int col) { - currentColumn = col; -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataArea(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - // Draw the lower-right and lower-left corners - vertex(plotX2, plotY2); - vertex(plotX1, plotY2); - endShape(CLOSE); -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/Integrator.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/Integrator.pde deleted file mode 100644 index fd4edb3b1..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/Integrator.pde +++ /dev/null @@ -1,60 +0,0 @@ -class Integrator { - - final float DAMPING = 0.5f; - final float ATTRACTION = 0.2f; - - float value; - float vel; - float accel; - float force; - float mass = 1; - - float damping = DAMPING; - float attraction = ATTRACTION; - boolean targeting; - float target; - - - Integrator() { } - - - Integrator(float value) { - this.value = value; - } - - - Integrator(float value, float damping, float attraction) { - this.value = value; - this.damping = damping; - this.attraction = attraction; - } - - - void set(float v) { - value = v; - } - - - void update() { - if (targeting) { - force += attraction * (target - value); - } - - accel = force / mass; - vel = (vel + accel) * damping; - value += vel; - - force = 0; - } - - - void target(float t) { - targeting = true; - target = t; - } - - - void noTarget() { - targeting = false; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/step_17_interpolate.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/step_17_interpolate.pde deleted file mode 100644 index 777308ca6..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/step_17_interpolate.pde +++ /dev/null @@ -1,216 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; -int volumeIntervalMinor = 5; - -float[] tabLeft, tabRight; -float tabTop, tabBottom; -float tabPad = 10; - -Integrator[] interpolators; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - interpolators = new Integrator[rowCount]; - for (int row = 0; row < rowCount; row++) { - float initialValue = data.getFloat(row, 0); - interpolators[row] = new Integrator(initialValue); - interpolators[row].attraction = 0.1; // Set lower than the default - } - - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitleTabs(); - drawAxisLabels(); - - for (int row = 0; row < rowCount; row++) { - interpolators[row].update(); - } - - drawYearLabels(); - drawVolumeLabels(); - - noStroke(); - fill(#5679C1); - drawDataArea(currentColumn); -} - - -void drawTitleTabs() { - rectMode(CORNERS); - noStroke(); - textSize(20); - textAlign(LEFT); - - // On first use of this method, allocate space for an array - // to store the values for the left and right edges of the tabs - if (tabLeft == null) { - tabLeft = new float[columnCount]; - tabRight = new float[columnCount]; - } - - float runningX = plotX1; - tabTop = plotY1 - textAscent() - 15; - tabBottom = plotY1; - - for (int col = 0; col < columnCount; col++) { - String title = data.getColumnName(col); - tabLeft[col] = runningX; - float titleWidth = textWidth(title); - tabRight[col] = tabLeft[col] + tabPad + titleWidth + tabPad; - - // If the current tab, set its background white, otherwise use pale gray - fill(col == currentColumn ? 255 : 224); - rect(tabLeft[col], tabTop, tabRight[col], tabBottom); - - // If the current tab, use black for the text, otherwise use dark gray - fill(col == currentColumn ? 0 : 64); - text(title, runningX + tabPad, plotY1 - 10); - - runningX = tabRight[col]; - } -} - - -void mousePressed() { - if (mouseY > tabTop && mouseY < tabBottom) { - for (int col = 0; col < columnCount; col++) { - if (mouseX > tabLeft[col] && mouseX < tabRight[col]) { - setCurrent(col); - } - } - } -} - - -void setCurrent(int col) { - currentColumn = col; - - for (int row = 0; row < rowCount; row++) { - interpolators[row].target(data.getFloat(row, col)); - } -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataArea(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = interpolators[row].value; - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - vertex(plotX2, plotY2); - vertex(plotX1, plotY2); - endShape(CLOSE); -} diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/Integrator.java b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/Integrator.java deleted file mode 100644 index 728d0913a..000000000 --- a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/Integrator.java +++ /dev/null @@ -1,79 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -public class Integrator { - - static final float DAMPING = 0.5f; // formerly 0.9f - static final float ATTRACTION = 0.2f; // formerly 0.1f - - public float value = 0; - public float vel = 0; - public float accel = 0; - public float force = 0; - public float mass = 1; - - public float damping; - public float attraction; - public boolean targeting; - public float target; - - public float prev = Float.MAX_VALUE; - public float epsilon = 0.0001f; - - - public Integrator() { - this(0, DAMPING, ATTRACTION); - } - - - public Integrator(float value) { - this(value, DAMPING, ATTRACTION); - } - - - public Integrator(float value, float damping, float attraction) { - this.value = value; - this.damping = damping; - this.attraction = attraction; - } - - - public void set(float v) { - value = v; - } - - - /** - * Update for next time step. - * Returns true if actually updated, false if no longer changing. - */ - public boolean update() { - if (targeting) { - force += attraction * (target - value); - } - - accel = force / mass; - vel = (vel + accel) * damping; - value += vel; - - force = 0; - - if (Math.abs(value - prev) < epsilon) { - value = target; - return false; - } - prev = value; - return true; - } - - - public void target(float t) { - targeting = true; - target = t; - } - - - public void noTarget() { - targeting = false; - } -} diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/RankedList.java b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/RankedList.java deleted file mode 100644 index 20beeaaa5..000000000 --- a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/RankedList.java +++ /dev/null @@ -1,121 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -import processing.core.PApplet; - - -public class RankedList { - // Number of elements in the list - protected int count; - // Array of values for the list - protected float[] value; - // Minimum and maximum values in the list - protected float minValue, maxValue; - // How this value is represented visually - protected String[] title; - // Rank for each item (0 is highest) - protected int[] rank; - // Ordering used while sorting by rank - protected int[] order; - // True if the element 0 is the lowest value, and count-1 the largest. - // (This has no bearing on what is considered the minValue and maxValue.) - protected boolean ascending; - - - RankedList(int count, boolean ascending) { - this.count = count; - this.ascending = ascending; - - value = new float[count]; - title = new String[count]; - rank = new int[count]; - } - - - public int getCount() { - return count; - } - - - public float getValue(int index) { - return value[index]; - } - - - public float getMinValue() { - return minValue; - } - - - public float getMaxValue() { - return maxValue; - } - - - public String getTitle(int index) { - return title[index]; - } - - - public int getRank(int index) { - return rank[index]; - } - - - // Sort the data and calculate min/max values - void update() { - // Set up an initial order to be sorted - order = new int[count]; - for (int i = 0; i < count; i++) { - order[i] = i; - } - sort(0, count-1); - - // Assign rankings based on the order after sorting - for (int i = 0; i < count; i++) { - rank[order[i]] = i; - } - - // Calculate minimum and maximum values - minValue = PApplet.min(value); - maxValue = PApplet.max(value); - } - - - void sort(int left, int right) { - int pivotIndex = (left+right)/2; - swap(pivotIndex, right); - int k = partition(left-1, right); - swap(k, right); - if ((k-left) > 1) sort(left, k-1); - if ((right-k) > 1) sort(k+1, right); - } - - - int partition(int left, int right) { - int pivot = right; - do { - while (compare(++left, pivot) < 0) ; - while ((right != 0) && (compare(--right, pivot) > 0)) ; - swap(left, right); - } while (left < right); - swap(left, right); - return left; - } - - - float compare(int a, int b) { - if (ascending) { - return value[order[a]] - value[order[b]]; - } else { - return value[order[b]] - value[order[a]]; - } - } - - - void swap(int a, int b) { - int temp = order[a]; - order[a] = order[b]; - order[b] = temp; - } -} diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/salaries.tsv b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/salaries.tsv deleted file mode 100644 index 88df60d59..000000000 --- a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/salaries.tsv +++ /dev/null @@ -1,30 +0,0 @@ -nyy 189639045 -bos 143026214 -nym 115231663 -ana 109251333 -cws 108671833 -la 108454524 -sea 106460833 -chc 99670332 -det 95180369 -bal 93554808 -stl 90286823 -sf 90219056 -phi 89428213 -hou 87759000 -atl 87290833 -tor 81942800 -oak 79366940 -min 71439500 -mil 70986500 -cin 68904980 -tex 68318675 -kc 67116500 -cle 61673267 -sd 58110567 -col 54424000 -ari 52067546 -pit 38537833 -was 37347500 -fla 30507000 -tb 24123500 diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/ana.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/ana.gif deleted file mode 100644 index ff68d49f1..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/ana.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/ari.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/ari.gif deleted file mode 100644 index 4e328e797..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/ari.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/atl.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/atl.gif deleted file mode 100644 index f7731725f..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/atl.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/bal.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/bal.gif deleted file mode 100644 index d7ca7d91d..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/bal.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/bos.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/bos.gif deleted file mode 100644 index 30691a634..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/bos.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/chc.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/chc.gif deleted file mode 100644 index 7235caaac..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/chc.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cin.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cin.gif deleted file mode 100644 index 648af180c..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cin.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cle.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cle.gif deleted file mode 100644 index 50c0fd72d..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cle.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/col.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/col.gif deleted file mode 100644 index acfad7c96..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/col.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cws.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cws.gif deleted file mode 100644 index 1694536a8..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cws.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/det.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/det.gif deleted file mode 100644 index bf2ca0cdf..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/det.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/fla.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/fla.gif deleted file mode 100644 index 157094e0c..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/fla.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/hou.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/hou.gif deleted file mode 100644 index 98afe6d29..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/hou.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/kc.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/kc.gif deleted file mode 100644 index 47a380c68..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/kc.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/la.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/la.gif deleted file mode 100644 index 0aa0696c2..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/la.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/mil.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/mil.gif deleted file mode 100644 index 06e0ce204..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/mil.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/min.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/min.gif deleted file mode 100644 index 6c27ea0c9..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/min.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/nym.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/nym.gif deleted file mode 100644 index 1fffcd8f3..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/nym.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/nyy.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/nyy.gif deleted file mode 100644 index acfb715a0..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/nyy.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/oak.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/oak.gif deleted file mode 100644 index fd049c2de..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/oak.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/phi.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/phi.gif deleted file mode 100644 index abed04f58..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/phi.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/pit.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/pit.gif deleted file mode 100644 index 0d452b5e8..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/pit.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sd.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sd.gif deleted file mode 100644 index 8208d636f..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sd.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sea.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sea.gif deleted file mode 100644 index 043a5fb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sea.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sf.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sf.gif deleted file mode 100644 index 57de12c9d..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sf.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/stl.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/stl.gif deleted file mode 100644 index 0af78037f..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/stl.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tb.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tb.gif deleted file mode 100644 index 28083656b..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tb.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tex.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tex.gif deleted file mode 100644 index ac03b3751..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tex.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tor.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tor.gif deleted file mode 100644 index 0c61e7396..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tor.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/was.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/was.gif deleted file mode 100644 index b015bc11a..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/was.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/teams.tsv b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/teams.tsv deleted file mode 100644 index 5600af189..000000000 --- a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/teams.tsv +++ /dev/null @@ -1,30 +0,0 @@ -nyy NY Yankees -bos Boston -nym New York Mets -ana LA Angels -cws Chi White Sox -la LA Dodgers -sea Seattle -chc Chi Cubs -det Detroit -bal Baltimore -stl St. Louis -sf San Francisco -phi Philadelphia -hou Houston -atl Atlanta -tor Toronto -oak Oakland -min Minnesota -mil Milwaukee -cin Cincinnati -tex Texas -kc Kansas City -cle Cleveland -sd San Diego -col Colorado -ari Arizona -pit Pittsburgh -was Washington -fla Florida -tb Tampa Bay \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/step_08b_web.pde b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/step_08b_web.pde deleted file mode 100644 index 9ded6d556..000000000 --- a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/step_08b_web.pde +++ /dev/null @@ -1,475 +0,0 @@ -/* -This book is here to help you get your job done. In general, you may use the -code in this book in your programs and documentation. You do not need to contact -us for permission unless you’re reproducing a significant portion of the code. -For example, writing a program that uses several chunks of code from this book -does not require permission. Selling or distributing a CD-ROM of examples from -O’Reilly books does require permission. Answering a question by citing this book -and quoting example code does not require permission. Incorporating a significant -amount of example code from this book into your product’s documentation does -require permission. - -We appreciate, but do not require, attribution. An attribution usually includes -the title, author, publisher, and ISBN. For example: “Visualizing Data, First -Edition by Ben Fry. Copyright 2008 Ben Fry, 9780596514556.” - -If you feel your use of code examples falls outside fair use or the permission -given above, feel free to contact us at permissions@oreilly.com. -*/ -import java.util.Date; -import java.util.regex.*; -import java.text.*; - -int teamCount = 30; -String[] teamNames; -String[] teamCodes; -HashMap teamIndices; - -static final int ROW_HEIGHT = 23; -static final float HALF_ROW_HEIGHT = ROW_HEIGHT / 2.0f; - -static final int SIDE_PADDING = 30; -static final int TOP_PADDING = 40; - -SalaryList salaries; -StandingsList standings; - -StandingsList[] season; -Integrator[] standingsPosition; - -PImage[] logos; -float logoWidth; -float logoHeight; - -PFont font; - - -// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - -String firstDateStamp = "20070401"; -String lastDateStamp = "20070930"; -String todayDateStamp; - -static final long MILLIS_PER_DAY = 24 * 60 * 60 * 1000; - -// The number of days in the entire season. -int dateCount; -// The current date being shown. -int dateIndex; -// Don't show the first 10 days, they're too erratic. -int minDateIndex = 10; -// The last day of the season, or yesterday, if the season is ongoing. -// This is the maximum date that can be viewed. -int maxDateIndex; - -// This format makes "20070704" from the date July 4, 2007. -DateFormat stampFormat = new SimpleDateFormat("yyyyMMdd"); -// This format makes "4 July 2007" from the same. -DateFormat prettyFormat = new SimpleDateFormat("d MMMM yyyy"); - -// All dates for the season formatted with stampFormat. -String[] dateStamp; -// All dates in the season formatted with prettyFormat. -String[] datePretty; - -void setupDates() { - try { - Date firstDate = stampFormat.parse(firstDateStamp); - long firstDateMillis = firstDate.getTime(); - Date lastDate = stampFormat.parse(lastDateStamp); - long lastDateMillis = lastDate.getTime(); - - // Calculate number of days by dividing the total milliseconds - // between the first and last dates by the number of milliseconds per day - dateCount = (int) - ((lastDateMillis - firstDateMillis) / MILLIS_PER_DAY) + 1; - maxDateIndex = dateCount; - dateStamp = new String[dateCount]; - datePretty = new String[dateCount]; - - todayDateStamp = year() + nf(month(), 2) + nf(day(), 2); - // Another option to do this, but more code - //Date today = new Date(); - //String todayDateStamp = stampFormat.format(today); - - for (int i = 0; i < dateCount; i++) { - Date date = new Date(firstDateMillis + MILLIS_PER_DAY*i); - datePretty[i] = prettyFormat.format(date); - dateStamp[i] = stampFormat.format(date); - // If this value for 'date' is equal to today, then set the previous - // day as the maximum viewable date, because it means the season is - // still ongoing. The previous day is used because unless it is late - // in the evening, the updated numbers for the day will be unavailable - // or incomplete. - if (dateStamp[i].equals(todayDateStamp)) { - maxDateIndex = i-1; - } - } - } catch (ParseException e) { - die("Problem while setting up dates", e); - } -} - - -// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - -public void setup() { - size(480, 750); - - setupTeams(); - setupDates(); - setupSalaries(); - // Load the standings after the salaries, because salary - // will be used as the tie-breaker when sorting. - setupStandings(); - setupRanking(); - setupLogos(); - - font = createFont("Georgia", 12); - textFont(font); - - frameRate(15); - // Use today as the current day - setDate(maxDateIndex); -} - - -void setupTeams() { - String[] lines = loadStrings("teams.tsv"); - - teamCount = lines.length; - teamCodes = new String[teamCount]; - teamNames = new String[teamCount]; - teamIndices = new HashMap(); - - for (int i = 0; i < teamCount; i++) { - String[] pieces = split(lines[i], TAB); - teamCodes[i] = pieces[0]; - teamNames[i] = pieces[1]; - teamIndices.put(teamCodes[i], new Integer(i)); - } -} - - -int teamIndex(String teamCode) { - Integer index = (Integer) teamIndices.get(teamCode); - return index.intValue(); -} - - -void setupSalaries() { - String[] lines = loadStrings("salaries.tsv"); - salaries = new SalaryList(lines); -} - - -/* -void setupStandings() { - season = new StandingsList[maxDateIndex + 1]; - for (int i = minDateIndex; i <= maxDateIndex; i++) { - String[] lines = acquireStandings(dateStamp[i]); - season[i] = new StandingsList(lines); - } -} -*/ - - -void setupStandings() { - String[] lines = loadStrings("http://benfry.com/writing/salaryper/mlb.cgi"); - int dataCount = lines.length / teamCount; - int expectedCount = (maxDateIndex - minDateIndex) + 1; - if (dataCount < expectedCount) { - println("Found " + dataCount + " entries in the data file, " + - "but was expecting " + expectedCount + " entries."); - maxDateIndex = minDateIndex + dataCount - 1; - } - season = new StandingsList[maxDateIndex + 1]; - for (int i = 0; i < dataCount; i++) { - String[] portion = subset(lines, i*teamCount, teamCount); - season[i+minDateIndex] = new StandingsList(portion); - } -} - - -void setupRanking() { - standingsPosition = new Integrator[teamCount]; - for (int i = 0; i < teamCodes.length; i++) { - standingsPosition[i] = new Integrator(i); - } -} - - -void setupLogos() { - logos = new PImage[teamCount]; - for (int i = 0; i < teamCount; i++) { - logos[i] = loadImage("small/" + teamCodes[i] + ".gif"); - } - logoWidth = logos[0].width / 2.0f; - logoHeight = logos[0].height / 2.0f; -} - - -public void draw() { - background(255); - smooth(); - - drawDateSelector(); - - translate(SIDE_PADDING, TOP_PADDING); - - boolean updated = false; - for (int i = 0; i < teamCount; i++) { - if (standingsPosition[i].update()) { - updated = true; - } - } - if (!updated) { - noLoop(); - } - - for (int i = 0; i < teamCount; i++) { - //float standingsY = standings.getRank(i)*ROW_HEIGHT + HALF_ROW_HEIGHT; - float standingsY = standingsPosition[i].value * ROW_HEIGHT + HALF_ROW_HEIGHT; - - image(logos[i], 0, standingsY - logoHeight/2, logoWidth, logoHeight); - - textAlign(LEFT, CENTER); - text(teamNames[i], 28, standingsY); - - textAlign(RIGHT, CENTER); - fill(128); - text(standings.getTitle(i), 150, standingsY); - - float weight = map(salaries.getValue(i), - salaries.getMinValue(), salaries.getMaxValue(), - 0.25f, 6); - strokeWeight(weight); - - float salaryY = salaries.getRank(i)*ROW_HEIGHT + HALF_ROW_HEIGHT; - if (salaryY >= standingsY) { - stroke(33, 85, 156); // Blue for positive (or equal) difference. - } else { - stroke(206, 0, 82); // Red for wasting money. - } - - line(160, standingsY, 325, salaryY); - - fill(128); - textAlign(LEFT, CENTER); - text(salaries.getTitle(i), 335, salaryY); - } -} - - -// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - -int dateSelectorX; -int dateSelectorY = 30; - -// Draw a series of lines for selecting the date -void drawDateSelector() { - dateSelectorX = (width - dateCount*2) / 2; - - strokeWeight(1); - for (int i = 0; i < dateCount; i++) { - int x = dateSelectorX + i*2; - - // If this is the currently selected date, draw it differently - if (i == dateIndex) { - stroke(0); - line(x, 0, x, 13); - textAlign(CENTER, TOP); - text(datePretty[dateIndex], x, 15); - - } else { - // If this is a viewable date, make the line darker - if ((i >= minDateIndex) && (i <= maxDateIndex)) { - stroke(128); // Viewable date - } else { - stroke(204); // Not a viewable date - } - line(x, 0, x, 7); - } - } -} - - -void setDate(int index) { - dateIndex = index; - standings = season[dateIndex]; - - for (int i = 0; i < teamCount; i++) { - standingsPosition[i].target(standings.getRank(i)); - } - // Re-enable the animation loop - loop(); -} - - -void mousePressed() { - handleMouse(); -} - -void mouseDragged() { - handleMouse(); -} - -void handleMouse() { - if (mouseY < dateSelectorY) { - int date = (mouseX - dateSelectorX) / 2; - setDate(constrain(date, minDateIndex, maxDateIndex)); - } -} - - -void keyPressed() { - if (key == CODED) { - if (keyCode == LEFT) { - int newDate = max(dateIndex - 1, minDateIndex); - setDate(newDate); - - } else if (keyCode == RIGHT) { - int newDate = min(dateIndex + 1, maxDateIndex); - setDate(newDate); - } - } -} - - -// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - -/* -String[] acquireStandings(String stamp) { - int year = int(stamp.substring(0, 4)); - int month = int(stamp.substring(4, 6)); - int day = int(stamp.substring(6, 8)); - return acquireStandings(year, month, day); -} - - -String[] acquireStandings(int year, int month, int day) { - String filename = year + nf(month, 2) + nf(day, 2) + ".tsv"; - String path = dataPath(filename); - File file = new File(path); - if (!file.exists()) { - println("Downloading standings file " + filename); - PrintWriter writer = createWriter(path); - - String base = "http://mlb.mlb.com/components/game" + - "/year_" + year + "/month_" + nf(month, 2) + "/day_" + nf(day, 2) + "/"; - - // American League (AL) - parseWinLoss(base + "standings_rs_ale.js", writer); - parseWinLoss(base + "standings_rs_alc.js", writer); - parseWinLoss(base + "standings_rs_alw.js", writer); - - // National League (NL) - parseWinLoss(base + "standings_rs_nle.js", writer); - parseWinLoss(base + "standings_rs_nlc.js", writer); - parseWinLoss(base + "standings_rs_nlw.js", writer); - - writer.flush(); - writer.close(); - } - return loadStrings(filename); -} - - -void parseWinLoss(String filename, PrintWriter writer) { - String[] lines = loadStrings(filename); - Pattern p = Pattern.compile("\\s+([\\w\\d]+):\\s'(.*)',?"); - - String teamCode = ""; - int wins = 0; - int losses = 0; - - for (int i = 0; i < lines.length; i++) { - Matcher m = p.matcher(lines[i]); - - if (m.matches()) { - String attr = m.group(1); - String value = m.group(2); - - if (attr.equals("code")) { - teamCode = value; - } else if (attr.equals("w")) { - wins = parseInt(value); - } else if (attr.equals("l")) { - losses = parseInt(value); - } - - } else { - if (lines[i].startsWith("}")) { - // this is the end of a group, write these values - //println(team + " " + wins + "-" + losses); - //set(teamIndex(teamCode), wins, losses); - writer.println(teamCode + TAB + wins + TAB + losses); - } - } - } -} -*/ - - -//. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - -class SalaryList extends RankedList { - - SalaryList(String[] lines) { - super(teamCount, false); - - for (int i = 0; i < teamCount; i++) { - String pieces[] = split(lines[i], TAB); - - // First column is the team 2-3 digit team code. - int index = teamIndex(pieces[0]); - - // Second column is the salary as a number. - value[index] = parseInt(pieces[1]); - - // Make the title in the format $NN,NNN,NNN - int salary = (int) value[index]; - title[index] = "$" + nfc(salary); - } - update(); - } -} - - -// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - -class StandingsList extends RankedList { - - StandingsList(String[] lines) { - super(teamCount, false); - - for (int i = 0; i < teamCount; i++) { - String[] pieces = split(lines[i], TAB); - int index = teamIndex(pieces[0]); - int wins = parseInt(pieces[1]); - int losses = parseInt(pieces[2]); - - value[index] = (float) wins / (float) (wins+losses); - title[index] = wins + "\u2013" + losses; - } - update(); - } - - float compare(int a, int b) { - // First compare based on the record of both teams - float amt = super.compare(a, b); - // If the record is not identical, return the difference - if (amt != 0) return amt; - - // If records are equal, use salary as tie-breaker. - // In this case, a and b are switched, because a higher - // salary is a negative thing, unlike the values above. - return salaries.compare(a, b); - } -} diff --git a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/ColorIntegrator.java b/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/ColorIntegrator.java deleted file mode 100644 index a41da0bb8..000000000 --- a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/ColorIntegrator.java +++ /dev/null @@ -1,51 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -public class ColorIntegrator extends Integrator { - - float r0, g0, b0, a0; - float rs, gs, bs, as; - - int colorValue; - - - public ColorIntegrator(int color0, int color1) { - int a1 = (color0 >> 24) & 0xff; - int r1 = (color0 >> 16) & 0xff; - int g1 = (color0 >> 8) & 0xff; - int b1 = (color0 ) & 0xff; - - int a2 = (color1 >> 24) & 0xff; - int r2 = (color1 >> 16) & 0xff; - int g2 = (color1 >> 8) & 0xff; - int b2 = (color1 ) & 0xff; - - r0 = (float)r1 / 255.0f; - g0 = (float)g1 / 255.0f; - b0 = (float)b1 / 255.0f; - a0 = (float)a1 / 255.0f; - - rs = (r2 - r1) / 255.0f; - gs = (g2 - g1) / 255.0f; - bs = (b2 - b1) / 255.0f; - as = (a2 - a1) / 255.0f; - } - - - public boolean update() { - boolean updated = super.update(); - if (updated) { - colorValue = - (((int) ((a0 + as*value) * 255f) << 24) | - ((int) ((r0 + rs*value) * 255f) << 16) | - ((int) ((g0 + gs*value) * 255f) << 8) | - ((int) ((b0 + bs*value) * 255f))); - } - return updated; - } - - - public int get() { - return colorValue; - } -} diff --git a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Integrator.java b/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Integrator.java deleted file mode 100644 index 7aaa26cc8..000000000 --- a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Integrator.java +++ /dev/null @@ -1,181 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -public class Integrator { - - static final float DAMPING = 0.5f; // formerly 0.9f - static final float ATTRACTION = 0.2f; // formerly 0.1f - - float value = 0; - float vel = 0; - float accel = 0; - float force = 0; - float mass = 1; - - float damping; // = DAMPING; - float attraction; // = ATTRACTION; - - boolean targeting; // = false; - float target; // = 0; - - - public Integrator() { - this.value = 0; - this.damping = DAMPING; - this.attraction = ATTRACTION; - } - - - public Integrator(float value) { - this.value = value; - this.damping = DAMPING; - this.attraction = ATTRACTION; - } - - - public Integrator(float value, float damping, float attraction) { - this.value = value; - this.damping = damping; - this.attraction = attraction; - } - - - public void set(float v) { - value = v; - //targeting = false ? - } - - - public boolean update() { // default dtime = 1.0 - if (targeting) { - force += attraction * (target - value); - } - - accel = force / mass; - vel = (vel + accel) * damping; /* e.g. 0.90 */ - value += vel; - - force = 0; // implicit reset - - return (vel > 0.0001f); - } - - - public void target(float t) { - targeting = true; - target = t; - } - - - public void noTarget() { - targeting = false; - } -} - - - /* - public void attraction(float targetValue, float a) { - force += attraction * (targetValue - value); - } - - public void attract(float target, float a) { - attraction(target, a); - update(); - } - - public void setDecay(float d) { - kDecay = d; - } - - public void decay() { - force -= kDecay * value; - } - - public void decay(float d) { - force -= d * value; - } - - public void setImpulse(float i) { - kImpulse = i; - } - - public void impulse() { - //printf("kimpulse is %f\n", kImpulse); - force += kImpulse; - //decay(-kImpulse); // lazy - } - - public void impulse(float i) { - force += i; - //decay(-i); // lazy - } - - public void setDamping(float d) { - kDamping = d; - } - - public void noise(float amount) { - force += (float) ((Math.random() * 2) - 1) * amount; - } - - public void add(float v) { - value += v; - } - - public void add(Integrator integrator) { - value += integrator.value; - } - */ - - - -/* - -void Integrator1f::updateRK() { // default dtime = 1.0 -#define H 0.001 - float f1 = force; - float f2 = force + H*f1/2; - float f3 = force + H*f2/2; - float f4 = force + H*f3; - velocity = velocity + (H/6)*(f1 + 2*f2 + 2*f3 + f4); -} - - eval(x) is the force - i think x should be time, so x is normally 1.0. - if dtime were incorporated, that would probably work - >> need correct function for force and dtime - - double f1 = fn.evalX(x); - double f2 = fn.evalX(x + h*f1/2); - double f3 = fn.evalX(x + h*f2/2); - double f4 = fn.evalX(x + h*f3); - - out = x + (h/6)*(f1 + 2*f2 + 2*f3 + f4); -*/ - -/* - - public void step(double t, double x, double y, - Function fn, double h, double out[]) { - double f1 = fn.evalX(t, x, y); - double g1 = fn.evalY(t, x, y); - - double f2 = fn.evalX(t + h/2, x + h*f1/2, y + h*g1/2); - double g2 = fn.evalY(t + h/2, x + h*f1/2, y + h*g1/2); - - double f3 = fn.evalX(t + h/2, x + h*f2/2, y + h*g2/2); - double g3 = fn.evalY(t + h/2, x + h*f2/2, y + h*g2/2); - - double f4 = fn.evalX(t + h, x + h*f3, y + h*g3); - double g4 = fn.evalY(t + h, x + h*f3, y + h*g3); - - out[0] = x + (h/6)*(f1 + 2*f2 + 2*f3 + f4); - out[1] = y + (h/6)*(g1 + 2*g2 + 2*g3 + g4); - } -*/ - -//void Integrator1f::update(float dtime) { -//velocity += force * dtime; -// value += velocity*dtime + 0.5f*force*dtime*dtime; -//force = 0; -//} diff --git a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Place.pde b/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Place.pde deleted file mode 100644 index 81a806aea..000000000 --- a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Place.pde +++ /dev/null @@ -1,131 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -class Place { - int code; - String name; - float x; - float y; - - int partial[]; - int matchDepth; - - - public Place(int code, String name, float lon, float lat) { - this.code = code; - this.name = name; - this.x = lon; - this.y = lat; - - partial = new int[6]; - partial[5] = code; - partial[4] = partial[5] / 10; - partial[3] = partial[4] / 10; - partial[2] = partial[3] / 10; - partial[1] = partial[2] / 10; - } - - - void check() { - // default to zero levels of depth that match - matchDepth = 0; - - if (typedCount != 0) { - // Start from the greatest depth, and work backwards to see how many - // items match. Want to figure out the maximum match, so better to - // begin from the end. - // The multiple levels of matching are important because more than one - // depth level might be fading at a time. - for (int j = typedCount; j > 0; --j) { - if (typedPartials[j] == partial[j]) { - matchDepth = j; - break; // since starting at end, can stop now - } - } - } - - //if (partial[typedCount] == partialCode) { - if (matchDepth == typedCount) { - foundCount++; - if (typedCount == 5) { - chosen = this; - } - - if (x < boundsX1) boundsX1 = x; - if (y < boundsY1) boundsY1 = y; - if (x > boundsX2) boundsX2 = x; - if (y > boundsY2) boundsY2 = y; - } - } - - void draw() { - float xx = TX(x); - float yy = TY(y); - - if ((xx < 0) || (yy < 0) || (xx >= width) || (yy >= height)) return; - - if ((zoomDepth.value < 2.8f) || !zoomEnabled) { // show simple dots - //pixels[((int) yy) * width + ((int) xx)] = faders[matchDepth].cvalue; - set((int)xx, (int)yy, faders[matchDepth].colorValue); - - } else { // show slightly more complicated dots - noStroke(); - - fill(faders[matchDepth].colorValue); - //rect(TX(nlon), TY(nlat), depther.value-1, depther.value-1); - - if (matchDepth == typedCount) { - if (typedCount == 4) { // on the fourth digit, show nums for the 5th - text(code % 10, TX(x), TY(y)); - } else { // show a larger box for selections - rect(xx, yy, zoomDepth.value, zoomDepth.value); - } - } else { // show a slightly smaller box for unselected - rect(xx, yy, zoomDepth.value-1, zoomDepth.value-1); - } - } - } - - - void drawChosen() { - noStroke(); - fill(faders[matchDepth].colorValue); - // the chosen point has to be a little larger when zooming - int size = zoomEnabled ? 6 : 4; - rect(TX(x), TY(y), size, size); - - // calculate position to draw the text, slightly offset from the main point - float textX = TX(x); - float textY = TY(y) - size - 4; - - // don't go off the top.. (e.g. 59544) - if (textY < 20) { - textY = TY(y) + 20; - } - - // don't run off the bottom.. (e.g. 33242) - if (textY > height - 5) { - textY = TY(y) - 20; - } - - String location = name + " " + nf(code, 5); - - if (zoomEnabled) { - textAlign(CENTER); - text(location, textX, textY); - - } else { - float wide = textWidth(location); - - if (textX > width/3) { - textX -= wide + 8; - } else { - textX += 8; - } - - textAlign(LEFT); - fill(highlightColor); - text(location, textX, textY); - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Slurper.pde b/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Slurper.pde deleted file mode 100644 index ac5396896..000000000 --- a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Slurper.pde +++ /dev/null @@ -1,31 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -class Slurper implements Runnable { - - Slurper() { - Thread thread = new Thread(this); - thread.start(); - } - - public void run() { - try { - InputStream input = openStream("zips.gz"); - BufferedReader reader = createReader(input); - - // first get the info line - String line = reader.readLine(); - parseInfo(line); - - places = new Place[totalCount]; - - // parse each of the rest of the lines - while ((line = reader.readLine()) != null) { - places[placeCount] = parsePlace(line); - placeCount++; - } - } catch (IOException e) { - e.printStackTrace(); - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/data/ScalaSans-Regular-14.vlw b/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/data/ScalaSans-Regular-14.vlw deleted file mode 100644 index c42b3f0d9..000000000 Binary files a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/data/ScalaSans-Regular-14.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/round_09c_focus_handling.pde b/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/round_09c_focus_handling.pde deleted file mode 100644 index b8ac21cae..000000000 --- a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/round_09c_focus_handling.pde +++ /dev/null @@ -1,393 +0,0 @@ -/* -This book is here to help you get your job done. In general, you may use the -code in this book in your programs and documentation. You do not need to contact -us for permission unless you’re reproducing a significant portion of the code. -For example, writing a program that uses several chunks of code from this book -does not require permission. Selling or distributing a CD-ROM of examples from -O’Reilly books does require permission. Answering a question by citing this book -and quoting example code does not require permission. Incorporating a significant -amount of example code from this book into your product’s documentation does -require permission. - -We appreciate, but do not require, attribution. An attribution usually includes -the title, author, publisher, and ISBN. For example: “Visualizing Data, First -Edition by Ben Fry. Copyright 2008 Ben Fry, 9780596514556.” - -If you feel your use of code examples falls outside fair use or the permission -given above, feel free to contact us at permissions@oreilly.com. -*/ - -color backgroundColor = #333333; // dark background color -color dormantColor = #999966; // initial color of the map -color highlightColor = #CBCBCB; // color for selected points -color unhighlightColor = #66664C; // color for points that are not selected -color waitingColor = #CBCBCB; // "please type a zip code" message -color badColor = #FFFF66; // text color when nothing found - -ColorIntegrator faders[]; - -// border of where the map should be drawn on screen -float mapX1, mapY1; -float mapX2, mapY2; - -// column numbers in the data file -static final int CODE = 0; -static final int X = 1; -static final int Y = 2; -static final int NAME = 3; - -int totalCount; // total number of places -Place[] places; -int placeCount; // number of places loaded - -// min/max boundary of all points -float minX, maxX; -float minY, maxY; - -// typing and selection -PFont font; -String typedString = ""; -char typedChars[] = new char[5]; -int typedCount; -int typedPartials[] = new int[6]; - -float messageX, messageY; - -int foundCount; -Place chosen; - -// smart updates -int notUpdatedCount = 0; - -// zoom -boolean zoomEnabled = false; -Integrator zoomDepth = new Integrator(); - -Integrator zoomX1; -Integrator zoomY1; -Integrator zoomX2; -Integrator zoomY2; - -float targetX1[] = new float[6]; -float targetY1[] = new float[6]; -float targetX2[] = new float[6]; -float targetY2[] = new float[6]; - -// boundary of currently valid points at this typedCount -float boundsX1, boundsY1; -float boundsX2, boundsY2; - - -public void setup() { - size(720, 453); - - mapX1 = 30; - mapX2 = width - mapX1; - mapY1 = 20; - mapY2 = height - mapY1; - - font = loadFont("ScalaSans-Regular-14.vlw"); - textFont(font); - - messageX = 40; - messageY = height - 40; - - faders = new ColorIntegrator[6]; - - // When nothing is typed, all points are shown with a color called - // "dormant," which is brighter than when not highlighted, but - // not as bright as the highlight color for a selection. - faders[0] = new ColorIntegrator(unhighlightColor, dormantColor); - faders[0].attraction = 0.5f; - faders[0].target(1); - - for (int i = 1; i < 6; i++) { - faders[i] = new ColorIntegrator(unhighlightColor, highlightColor); - faders[i].attraction = 0.5; - faders[i].target(1); - } - - readData(); - - zoomX1 = new Integrator(minX); - zoomY1 = new Integrator(minY); - zoomX2 = new Integrator(maxX); - zoomY2 = new Integrator(maxY); - - targetX1[0] = minX; - targetX2[0] = maxX; - targetY1[0] = minY; - targetY2[0] = maxY; - - rectMode(CENTER); - ellipseMode(CENTER); - frameRate(15); -} - - - -void readData() { - new Slurper(); -} - - -void parseInfo(String line) { - String infoString = line.substring(2); // remove the # - String[] infoPieces = split(infoString, ','); - totalCount = int(infoPieces[0]); - minX = float(infoPieces[1]); - maxX = float(infoPieces[2]); - minY = float(infoPieces[3]); - maxY = float(infoPieces[4]); -} - - -Place parsePlace(String line) { - String pieces[] = split(line, TAB); - - int zip = int(pieces[CODE]); - float x = float(pieces[X]); - float y = float(pieces[Y]); - String name = pieces[NAME]; - - return new Place(zip, name, x, y); -} - - -// change message from 'click inside the window' -public void focusGained() { - redraw(); -} - -// change message to 'click inside the window' -public void focusLost() { - redraw(); -} - -// this method is empty in p5 -public void mouseEntered() { - requestFocus(); -} - - -public void draw() { - background(backgroundColor); - - updateAnimation(); - - for (int i = 0; i < placeCount; i++) { - places[i].draw(); - } - - if (typedCount == 0) { - fill(waitingColor); - textAlign(LEFT); - String message = "zipdecode by ben fry"; - // if all places are loaded - if (placeCount == totalCount) { - if (focused) { - message = "type the digits of a zip code"; - } else { - message = "click the map image to begin"; - } - } - text(message, messageX, messageY); - - } else { - if (foundCount > 0) { - if (!zoomEnabled && (typedCount == 4)) { - // re-draw the chosen ones, because they're often occluded - // by the non-selected points - for (int i = 0; i < placeCount; i++) { - if (places[i].matchDepth == typedCount) { - places[i].draw(); - } - } - } - - if (chosen != null) { - chosen.drawChosen(); - } - - fill(highlightColor); - textAlign(LEFT); - text(typedString, messageX, messageY); - - } else { - fill(badColor); - text(typedString, messageX, messageY); - } - } - - // draw "zoom" text toggle - textAlign(RIGHT); - fill(zoomEnabled ? highlightColor : unhighlightColor); - text("zoom", width - 40, height - 40); - textAlign(LEFT); -} - - -void updateAnimation() { - boolean updated = false; - - for (int i = 0; i < 6; i++) { - updated |= faders[i].update(); - } - - if (foundCount > 0) { - zoomDepth.target(typedCount); - } else { - zoomDepth.target(typedCount-1); - } - updated |= zoomDepth.update(); - - updated |= zoomX1.update(); - updated |= zoomY1.update(); - updated |= zoomX2.update(); - updated |= zoomY2.update(); - - // if the data is loaded, can optionally call noLoop() to save cpu - if (placeCount == totalCount) { // if fully loaded - if (!updated) { - notUpdatedCount++; - // after 20 frames of no updates, shut off the loop - if (notUpdatedCount > 20) { - noLoop(); - notUpdatedCount = 0; - } - } else { - notUpdatedCount = 0; - } - } -} - - -float TX(float x) { - if (zoomEnabled) { - return map(x, zoomX1.value, zoomX2.value, mapX1, mapX2); - - } else { - return map(x, minX, maxX, mapX1, mapX2); - } -} - - -float TY(float y) { - if (zoomEnabled) { - return map(y, zoomY1.value, zoomY2.value, mapY2, mapY1); - - } else { - return map(y, minY, maxY, mapY2, mapY1); - } -} - - -void mousePressed() { - if ((mouseX > width-100) && (mouseY > height - 50)) { - zoomEnabled = !zoomEnabled; - redraw(); - } -} - - -void keyPressed() { - if ((key == BACKSPACE) || (key == DELETE)) { - if (typedCount > 0) { - typedCount--; - } - updateTyped(); - - } else if ((key >= '0') && (key <= '9')) { - if (typedCount != 5) { // only 5 digits - if (foundCount > 0) { // don't allow to keep typing bad - typedChars[typedCount++] = key; - } - } - } - updateTyped(); -} - - -void updateTyped() { - typedString = new String(typedChars, 0, typedCount); - - // Un-highlight areas already typed past - for (int i = 0; i < typedCount; i++) faders[i].target(0); - // Highlight potential dots not yet selected by keys - for (int i = typedCount; i < 6; i++) faders[i].target(1); - - typedPartials[typedCount] = int(typedString); - for (int j = typedCount-1; j > 0; --j) { - typedPartials[j] = typedPartials[j + 1] / 10; - } - - foundCount = 0; - chosen = null; - - boundsX1 = maxX; - boundsY1 = maxY; - boundsX2 = minX; - boundsY2 = minY; - - for (int i = 0; i < placeCount; i++) { - // update boundaries of selection - // and identify whether a particular place is chosen - places[i].check(); - } - calcZoom(); - - loop(); // re-enable updates -} - - -void calcZoom() { - if (foundCount != 0) { - // given a set of min/max coords, expand in one direction so that the - // selected area includes the range with the proper aspect ratio - - float spanX = (boundsX2 - boundsX1); - float spanY = (boundsY2 - boundsY1); - - float midX = (boundsX1 + boundsX2) / 2; - float midY = (boundsY1 + boundsY2) / 2; - - if ((spanX != 0) && (spanY != 0)) { - float screenAspect = width / float(height); - float spanAspect = spanX / spanY; - - if (spanAspect > screenAspect) { - spanY = (spanX / width) * height; // wide - - } else { - spanX = (spanY / height) * width; // tall - } - } else { // if span is zero - // use the span from one level previous - spanX = targetX2[typedCount-1] - targetX1[typedCount-1]; - spanY = targetY2[typedCount-1] - targetY1[typedCount-1]; - } - targetX1[typedCount] = midX - spanX/2; - targetX2[typedCount] = midX + spanX/2; - targetY1[typedCount] = midY - spanY/2; - targetY2[typedCount] = midY + spanY/2; - - } else if (typedCount != 0) { - // nothing found at this level, so set the zoom identical to the previous - targetX1[typedCount] = targetX1[typedCount-1]; - targetY1[typedCount] = targetY1[typedCount-1]; - targetX2[typedCount] = targetX2[typedCount-1]; - targetY2[typedCount] = targetY2[typedCount-1]; - } - - zoomX1.target(targetX1[typedCount]); - zoomY1.target(targetY1[typedCount]); - zoomX2.target(targetX2[typedCount]); - zoomY2.target(targetY2[typedCount]); - - if (!zoomEnabled) { - zoomX1.set(zoomX1.target); - zoomY1.set(zoomY1.target); - zoomX2.set(zoomX2.target); - zoomY2.set(zoomY2.target); - } -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/WordItem.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/WordItem.pde deleted file mode 100644 index cb42dd954..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/WordItem.pde +++ /dev/null @@ -1,23 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -class WordItem extends SimpleMapItem { - String word; - - WordItem(String word) { - this.word = word; - } - - void draw() { - fill(255); - rect(x, y, w, h); - - fill(0); - if (w > textWidth(word) + 6) { - if (h > textAscent() + 6) { - textAlign(CENTER, CENTER); - text(word, x + w/2, y + h/2); - } - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/WordMap.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/WordMap.pde deleted file mode 100644 index 157dd51d7..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/WordMap.pde +++ /dev/null @@ -1,24 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -class WordMap extends SimpleMapModel { - HashMap words; - - WordMap() { - words = new HashMap(); - } - - void addWord(String word) { - WordItem item = (WordItem) words.get(word); - if (item == null) { - item = new WordItem(word); - words.put(word, item); - } - item.incrementSize(); - } - - void finishAdd() { - items = new WordItem[words.size()]; - words.values().toArray(items); - } -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/data/equator.txt b/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/data/equator.txt deleted file mode 100644 index d65650116..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/data/equator.txt +++ /dev/null @@ -1,194700 +0,0 @@ -produced -by -david -widger -following -the -equator -a -journey -around -the -world -by -mark -twain -samuel -l -clemens -hartford -connecticut -this -book -is -affectionately -inscribed -to -my -young -friend -harry -rogers -with -recognition -of -what -he -is -and -apprehension -of -what -he -may -become -unless -he -form -himself -a -little -more -closely -upon -the -model -of -the -author -the -pudd'nhead -maxims -these -wisdoms -are -for -the -luring -of -youth -toward -high -moral -altitudes -the -author -did -not -gather -them -from -practice -but -from -observation -to -be -good -is -noble -but -to -show -others -how -to -be -good -is -nobler -and -no -trouble -contents -chapter -i -the -party -across -america -to -vancouver -on -board -the -warrimo -steamer -chairs -the -captain -going -home -under -a -cloud -a -gritty -purser -the -brightest -passenger -remedy -for -bad -habits -the -doctor -and -the -lumbago -a -moral -pauper -limited -smoking -remittance -men -chapter -ii -change -of -costume -fish -snake -and -boomerang -stories -tests -of -memory -a -brahmin -expert -general -grant's -memory -a -delicately -improper -tale -chapter -iii -honolulu -reminiscences -of -the -sandwich -islands -king -liholiho -and -his -royal -equipment -the -tabu -the -population -of -the -island -a -kanaka -diver -cholera -at -honolulu -honolulu -past -and -present -the -leper -colony -chapter -iv -leaving -honolulu -flying -fish -approaching -the -equator -why -the -ship -went -slow -the -front -yard -of -the -ship -crossing -the -equator -horse -billiards -or -shovel -board -the -waterbury -watch -washing -decks -ship -painters -the -great -meridian -the -loss -of -a -day -a -babe -without -a -birthday -chapter -v -a -lesson -in -pronunciation -reverence -for -robert -burns -the -southern -cross -troublesome -constellations -victoria -for -a -name -islands -on -the -map -alofa -and -fortuna -recruiting -for -the -queensland -plantations -captain -warren's -notebook -recruiting -not -thoroughly -popular -chapter -vi -missionaries -obstruct -business -the -sugar -planter -and -the -kanaka -the -planter's -view -civilizing -the -kanaka -the -missionary's -view -the -result -repentant -kanakas -wrinkles -the -death -rate -in -queensland -chapter -vii -the -fiji -islands -suva -the -ship -from -duluth -going -ashore -midwinter -in -fiji -seeing -the -governor -why -fiji -was -ceded -to -england -old -time -fijians -convicts -among -the -fijians -a -case -where -marriage -was -a -failure -immortality -with -limitations -chapter -viii -a -wilderness -of -islands -two -men -without -a -country -a -naturalist -from -new -zealand -the -fauna -of -australasia -animals -insects -and -birds -the -ornithorhynchus -poetry -and -plagiarism -chapter -ix -close -to -australia -porpoises -at -night -entrance -to -sydney -harbor -the -loss -of -the -duncan -dunbar -the -harbor -the -city -of -sydney -spring -time -in -australia -the -climate -information -for -travelers -the -size -of -australia -a -dust -storm -and -hot -wind -chapter -x -the -discovery -of -australia -transportation -of -convicts -discipline -english -laws -ancient -and -modern -flogging -prisoners -to -death -arrival -of -settlers -new -south -wales -corps -rum -currency -intemperance -everywhere -$100 -000 -for -one -gallon -of -rum -development -of -the -country -immense -resources -chapter -xi -hospitality -of -english -speaking -people -writers -and -their -gratitude -mr -gane -and -the -panegyrics -population -of -sydney -an -english -city -with -american -trimming -squatters -palaces -and -sheep -kingdoms -wool -and -mutton -australians -and -americans -costermonger -pronunciation -england -is -home -table -talk -english -and -colonial -audiences -124 -chapter -xii -mr -x -a -missionary -why -christianity -makes -slow -progress -in -india -a -large -dream -hindoo -miracles -and -legends -sampson -and -hanuman -the -sandstone -ridge -where -are -the -gates -chapter -xiii -public -works -in -australasia -botanical -garden -of -sydney -four -special -socialties -the -government -house -a -governor -and -his -functions -the -admiralty -house -the -tour -of -the -harbor -shark -fishing -cecil -rhodes' -shark -and -his -first -fortune -free -board -for -sharks -chapter -xiv -bad -health -to -melbourne -by -rail -maps -defective -the -colony -of -victoria -a -round -trip -ticket -from -sydney -change -cars -from -wide -to -narrow -gauge -a -peculiarity -at -albury -customs -fences -my -word -the -blue -mountains -rabbit -piles -government -r -r -restaurants -duchesses -for -waiters -sheep -dip -railroad -coffee -things -seen -and -not -seen -chapter -xv -wagga -wagga -the -tichborne -claimant -a -stock -mystery -the -plan -of -the -romance -the -realization -the -henry -bascom -mystery -bascom -hall -the -author's -death -and -funeral -chapter -xvi -melbourne -and -its -attractions -the -melbourne -cup -races -cup -day -great -crowds -clothes -regardless -of -cost -the -australian -larrikin -is -he -dead -australian -hospitality -melbourne -wool -brokers -the -museums -the -palaces -the -origin -of -melbourne -chapter -xvii -the -british -empire -its -exports -and -imports -the -trade -of -australia -to -adelaide -broken -hill -silver -mine -a -roundabout -road -the -scrub -and -its -possibilities -for -the -novelist -the -aboriginal -tracker -a -test -case -how -does -one -cow -track -differ -from -another -chapter -xviii -gum -trees -unsociable -trees -gorse -and -broom -a -universal -defect -an -adventurer -wanted -l200 -got -l20 -000 -000 -a -vast -land -scheme -the -smash -up -the -corpse -got -up -and -danced -a -unique -business -by -one -man -buying -the -kangaroo -skin -the -approach -to -adelaide -everything -comes -to -him -who -waits -a -healthy -religious -sphere -what -is -the -matter -with -the -specter -chapter -xix -the -botanical -gardens -contributions -from -all -countries -the -zoological -gardens -of -adelaide -the -laughing -jackass -the -dingo -a -misnamed -province -telegraphing -from -melbourne -to -san -francisco -a -mania -for -holidays -the -temperature -the -death -rate -celebration -of -the -reading -of -the -proclamation -of -1836 -some -old -settlers -at -the -commemoration -their -staying -powers -the -intelligence -of -the -aboriginal -the -antiquity -of -the -boomerang -chapter -xx -a -caller -a -talk -about -old -times -the -fox -hunt -an -accurate -judgment -of -an -idiot -how -we -passed -the -custom -officers -in -italy -chapter -xxi -the -weet -weet -keeping -down -the -population -victoria -killing -the -aboriginals -pioneer -days -in -queensland -material -for -a -drama -the -bush -pudding -with -arsenic -revenge -a -right -spirit -but -a -wrong -method -death -of -donga -billy -chapter -xxii -continued -description -of -aboriginals -manly -qualities -dodging -balls -feats -of -spring -jumping -where -the -kangaroo -learned -its -art -'well -digging -endurance -surgery -artistic -abilities -fennimore -cooper's -last -chance -australian -slang -chapter -xxiii -to -horsham -colony -of -victoria -description -of -horsham -at -the -hotel -pepper -tree -the -agricultural -college -forty -pupils -high -temperature -width -of -road -in -chains -perches -etc -the -bird -with -a -forgettable -name -the -magpie -and -the -lady -fruit -trees -soils -sheep -shearing -to -stawell -gold -mining -country -$75 -000 -per -month -income -and -able -to -keep -house -fine -grapes -and -wine -the -dryest -community -on -earth -the -three -sisters -gum -trees -and -water -chapter -xxiv -road -to -ballarat -the -city -great -gold -strike -1851 -rush -for -australia -great -nuggets -taxation -revolt -and -victory -peter -lalor -and -the -eureka -stockade -pencil -mark -fine -statuary -at -ballarat -population -ballarat -english -chapter -xxv -bound -for -bendigo -the -priest -at -castlemaine -time -saved -by -walking -description -of -bendigo -a -valuable -nugget -perseverence -and -success -mr -blank -and -his -influence -conveyance -of -an -idea -i -had -to -like -the -irishman -corrigan -castle -and -the -mark -twain -club -my -bascom -mystery -solved -chapter -xxvi -where -new -zealand -is -but -few -know -things -people -think -they -know -the -yale -professor -and -his -visitor -from -n -z -chapter -xxvii -the -south -pole -swell -tasmania -extermination -of -the -natives -the -picture -proclamation -the -conciliator -the -formidable -sixteen -chapter -xxviii -when -the -moment -comes -the -man -appears -why -ed -jackson -called -on -commodore -vanderbilt -their -interview -welcome -to -the -child -of -his -friend -a -big -time -but -under -inspection -sent -on -important -business -a -visit -to -the -boys -on -the -boat -chapter -xxix -tasmania -early -days -description -of -the -town -of -hobart -an -englishman's -love -of -home -surroundings -neatest -city -on -earth -the -museum -a -parrot -with -an -acquired -taste -glass -arrow -beads -refuge -for -the -indigent -too -healthy -chapter -xxx -arrival -at -bluff -n -z -where -the -rabbit -plague -began -the -natural -enemy -of -the -rabbit -dunedin -a -lovely -town -visit -to -dr -hockin -his -museum -a -liquified -caterpillar -the -unperfected -tape -worm -the -public -museum -and -picture -chapter -xxxi -the -express -train -a -hell -of -a -hotel -at -maryborough -clocks -and -bells -railroad -service -chapter -xxxii -description -of -the -town -of -christ -church -a -fine -museum -jade -stone -trinkets -the -great -man -the -first -maori -in -new -zealand -women -voters -person -in -new -zealand -law -includes -woman -taming -an -ornithorhynchus -a -voyage -in -the -'flora' -from -lyttelton -cattle -stalls -for -everybody -a -wonderful -time -chapter -xxxiii -the -town -of -nelson -the -mongatapu -murders -the -great -event -of -the -town -burgess' -confession -summit -of -mount -eden -rotorua -and -the -hot -lakes -and -geysers -thermal -springs -district -kauri -gum -tangariwa -mountains -chapter -xxxiv -the -bay -of -gisborne -taking -in -passengers -by -the -yard -arm -the -green -ballarat -fly -false -teeth -from -napier -to -hastings -by -the -ballarat -fly -train -kauri -trees -a -case -of -mental -telegraphy -chapter -xxxv -fifty -miles -in -four -hours -comfortable -cars -town -of -wauganui -plenty -of -maoris -on -the -increase -compliments -to -the -maoris -the -missionary -ways -all -wrong -the -tabu -among -the -maoris -a -mysterious -sign -curious -war -monuments -wellington -chapter -xxxvi -the -poems -of -mrs -moore -the -sad -fate -of -william -upson -a -fellow -traveler -imitating -the -prince -of -wales -a -would -be -dude -arrival -at -sydney -curious -town -names -with -poem -chapter -xxxvii -from -sydney -for -ceylon -a -lascar -crew -a -fine -ship -three -cats -and -a -basket -of -kittens -dinner -conversations -veuve -cliquot -wine -at -anchor -in -king -george's -sound -albany -harbor -more -cats -a -vulture -on -board -nearing -the -equator -again -dressing -for -dinner -ceylon -hotel -bristol -servant -brampy -a -feminine -man -japanese -jinriksha -or -cart -scenes -in -ceylon -a -missionary -school -insincerity -of -clothes -chapter -xxxviii -steamer -rosettes -to -bombay -limes -14 -cents -a -barrel -bombay -a -bewitching -city -descriptions -of -people -and -dress -woman -as -a -road -decoration -india -the -land -of -dreams -and -romance -fourteen -porters -to -carry -baggage -correcting -a -servant -killing -a -slave -arranging -a -bedroom -three -hours' -work -and -a -terrible -racket -the -bird -of -birds -the -indian -crow -chapter -xxxix -god -vishnu -108 -names -change -of -titles -or -hunting -for -an -heir -bombay -as -a -kaleidoscope -the -native's -man -servant -servants' -recommendations -how -manuel -got -his -name -and -his -english -satan -a -visit -from -god -chapter -xl -the -government -house -at -malabar -point -mansion -of -kumar -shri -samatsin -hji -bahadur -the -indian -princess -a -difficult -game -wardrobe -and -jewels -ceremonials -decorations -when -leaving -the -towers -of -silence -a -funeral -chapter -xli -jain -temple -mr -roychand's -bungalow -a -decorated -six -gun -prince -human -fireworks -european -dress -past -and -present -complexions -advantages -with -the -zulu -festivities -at -the -bungalow -nautch -dancers -entrance -of -the -prince -address -to -the -prince -chapter -xlii -a -hindoo -betrothal -midnight -sleepers -on -the -ground -home -of -the -bride -of -twelve -years -dressed -as -a -boy -illumination -nautch -girls -imitating -snakes -later -illuminated -porch -filled -with -sleepers -the -plague -chapter -xliii -murder -trial -in -bombay -confidence -swindlers -some -specialities -of -india -the -plague -juggernaut -suttee -etc -everything -on -gigantic -scale -india -first -in -everything -80 -states -more -custom -houses -than -cats -rich -ground -for -thug -society -chapter -xliv -thug -book -supplies -for -traveling -bedding -and -other -freight -scene -at -railway -station -making -way -for -white -man -waiting -passengers -high -and -low -caste -touch -in -the -cars -our -car -beds -made -up -dreaming -of -thugs -baroda -meet -friends -indian -well -the -old -town -narrow -streets -a -mad -elephant -chapter -xlv -elephant -riding -howdahs -the -new -palace -the -prince's -excursion -gold -and -silver -artillery -a -vice -royal -visit -remarkable -dog -the -bench -show -augustin -daly's -back -door -fakeer -chapter -xlvi -the -thugs -government -efforts -to -exterminate -them -choking -a -victim -a -fakeer -spared -thief -strangled -chapter -xlvii -thugs -continued -record -of -murders -a -joy -of -hunting -and -killing -men -gordon -gumming -killing -an -elephant -family -affection -among -thugs -burial -places -chapter -xlviii -starting -for -allahabad -lower -berths -in -sleepers -elderly -ladies -have -preference -of -berths -an -american -lady -takes -one -anyhow -how -smythe -lost -his -berth -how -he -got -even -the -suttee -chapter -xlix -pyjamas -day -scene -in -india -clothed -in -a -turban -and -a -pocket -handkerchief -land -parceled -out -established -village -servants -witches -in -families -hereditary -midwifery -destruction -of -girl -babies -wedding -display -tiger -persuader -hailstorm -discourages -the -tyranny -of -the -sweeper -elephant -driver -water -carrier -curious -rivers -arrival -at -allahabad -english -quarter -lecture -hall -like -a -snowstorm -private -carriages -a -milliner -early -morning -the -squatting -servant -a -religious -fair -chapter -l -on -the -road -to -benares -dust -and -waiting -the -bejeweled -crowd -a -native -prince -and -his -guard -zenana -lady -the -extremes -of -fashion -the -hotel -at -benares -an -annex -a -mile -away -doors -in -india -the -peepul -tree -warning -against -cold -baths -a -strange -fruit -description -of -benares -the -beginning -of -creation -pilgrims -to -benares -a -priest -with -a -good -business -stand -protestant -missionary -the -trinity -brahma -shiva -and -vishnu -religion -the -business -at -benares -chapter -li -benares -a -religious -temple -a -guide -for -pilgrims -to -save -time -in -securing -salvation -chapter -lii -a -curious -way -to -secure -salvation -the -banks -of -the -ganges -architecture -represents -piety -a -trip -on -the -river -bathers -and -their -costumes -drinking -the -water -a -scientific -test -of -the -nasty -purifier -hindoo -faith -in -the -ganges -a -cremation -remembrances -of -the -suttee -all -life -sacred -except -human -life -the -goddess -bhowanee -and -the -sacrificers -sacred -monkeys -ugly -idols -everywhere -two -white -minarets -a -great -view -with -a -monkey -in -it -a -picture -on -the -water -chapter -liii -still -in -benares -another -living -god -why -things -are -wonderful -sri -108 -utterly -perfect -how -he -came -so -our -visit -to -sri -a -friendly -deity -exchanging -autographs -and -books -sri's -pupil -an -interesting -man -reverence -and -irreverence -dancing -in -a -sepulchre -chapter -liv -rail -to -calcutta -population -the -city -of -palaces -a -fluted -candle -stick -ochterlony -newspaper -correspondence -average -knowledge -of -countries -a -wrong -idea -of -chicago -calcutta -and -the -black -hole -description -of -the -horrors -those -who -lived -the -botanical -gardens -the -afternoon -turnout -grand -review -military -tournament -excursion -on -the -hoogly -the -museum -what -winter -means -calcutta -chapter -lv -on -the -road -again -flannels -in -order -across -country -from -greenland's -icy -mountain -swapping -civilization -no -field -women -in -india -how -it -is -in -other -countries -canvas -covered -cars -the -tiger -country -my -first -hunt -some -elephants -get -away -the -plains -of -india -the -ghurkas -women -for -pack -horses -a -substitute -for -a -cab -darjeeling -the -hotel -the -highest -thing -in -the -himalayas -the -club -kinchinjunga -and -mt -everest -thibetans -the -prayer -wheel -people -going -to -the -bazar -chapter -lvi -on -the -road -again -the -hand -car -a -thirty -five -mile -slide -the -banyan -tree -a -dramatic -performance -the -railroad -the -half -way -house -the -brain -fever -bird -the -coppersmith -bird -nightingales -and -cue -owls -chapter -lvii -india -the -most -extraordinary -country -on -earth -nothing -forgotten -the -land -of -wonders -annual -statistics -everywhere -about -violence -tiger -vs -man -a -handsome -fight -annual -man -killing -and -tiger -killing -other -animals -snakes -insurance -and -snake -tables -the -cobra -bite -muzaffurpore -dinapore -a -train -that -stopped -for -gossip -six -hours -for -thirty -five -miles -a -rupee -to -the -engineer -ninety -miles -an -hour -again -to -benares -the -piety -hive -to -lucknow -chapter -lviii -the -great -mutiny -the -massacre -in -cawnpore -terrible -scenes -in -lucknow -the -residency -the -siege -chapter -lix -a -visit -to -the -residency -cawnpore -the -adjutant -bird -and -the -hindoo -corpse -the -tai -mahal -the -true -conception -the -ice -storm -true -gems -syrian -fountains -an -exaggerated -niagara -chapter -lx -to -lahore -the -governor's -elephant -taking -a -ride -no -danger -from -collision -rawal -pindi -back -to -delhi -an -orientalized -englishman -monkeys -and -the -paint -pot -monkey -crying -over -my -note -book -arrival -at -jeypore -in -rajputana -watching -servants -the -jeypore -hotel -our -old -and -new -satan -satan -as -a -liar -the -museum -a -street -show -blocks -of -houses -a -religious -procession -chapter -lxi -methods -in -american -deaf -and -dumb -asylums -methods -in -the -public -schools -a -letter -from -a -youth -in -punjab -highly -educated -service -a -damage -to -the -country -a -little -book -from -calcutta -writing -poor -english -embarrassed -by -a -beggar -girl -a -specimen -letter -an -application -for -employment -a -calcutta -school -examination -two -samples -of -literature -chapter -lxii -sail -from -calcutta -to -madras -thence -to -ceylon -thence -for -mauritius -the -indian -ocean -our -captain's -peculiarity -the -scot -has -one -too -the -flying -fish -that -went -hunting -in -the -field -fined -for -smuggling -lots -of -pets -on -board -the -color -of -the -sea -the -most -important -member -of -nature's -family -the -captain's -story -of -cold -weather -omissions -in -the -ship's -library -washing -decks -pyjamas -on -deck -the -cat's -toilet -no -interest -in -the -bulletin -perfect -rest -the -milky -way -and -the -magellan -clouds -mauritius -port -louis -a -hot -country -under -french -control -a -variety -of -people -and -complexions -train -to -curepipe -a -wonderful -office -holder -the -wooden -peg -ornament -the -prominent -historical -event -of -mauritius -paul -and -virginia -one -of -virginia's -wedding -gifts -heaven -copied -after -mauritius -early -history -of -mauritius -quarantines -population -of -all -kinds -what -the -world -consists -of -where -russia -and -germany -are -a -picture -of -milan -cathedral -newspapers -the -language -best -sugar -in -the -world -literature -of -mauritius -chapter -lxiii -port -louis -matches -no -good -good -roads -death -notices -why -european -nations -rob -each -other -what -immigrants -to -mauritius -do -population -labor -wages -the -camaron -the -palmiste -and -other -eatables -monkeys -the -cyclone -of -1892 -mauritius -a -sunday -landscape -chapter -lxiv -the -steamer -arundel -castle -poor -beds -in -ships -the -beds -in -noah's -ark -getting -a -rest -in -europe -ship -in -sight -mozambique -channel -the -engineer -and -the -band -thackeray's -madagascar -africanders -going -home -singing -on -the -after -deck -an -out -of -place -story -dynamite -explosion -in -johannesburg -entering -delagoa -bay -ashore -a -hot -winter -small -town -no -sights -no -carriages -working -women -barnum's -purchase -of -shakespeare's -birthplace -jumbo -and -the -nelson -monument -arrival -at -durban -chapter -lxv -royal -hotel -durban -bells -that -did -not -ring -early -inquiries -for -comforts -change -of -temperature -after -sunset -rickhaws -the -hotel -chameleon -natives -not -out -after -the -bell -preponderance -of -blacks -in -natal -hair -fashions -in -natal -zulus -for -police -a -drive -round -the -berea -the -cactus -and -other -trees -religion -a -vital -matter -peculiar -views -about -babies -zulu -kings -a -trappist -monastery -transvaal -politics -reasons -why -the -trouble -came -about -chapter -lxvi -jameson -over -the -border -his -defeat -and -capture -sent -to -england -for -trial -arrest -of -citizens -by -the -boers -commuted -sentences -final -release -of -all -but -two -interesting -days -for -a -stranger -hard -to -understand -either -side -what -the -reformers -expected -to -accomplish -how -they -proposed -to -do -it -testimonies -a -year -later -a -woman's -part -the -truth -of -the -south -african -situation -jameson's -ride -a -poem -chapter -lxvil -jameson's -raid -the -reform -committee's -difficult -task -possible -plans -advice -that -jameson -ought -to -have -the -war -of -1881 -and -its -lessons -statistics -of -losses -of -the -combatants -jameson's -battles -losses -on -both -sides -the -military -errors -how -the -warfare -should -have -been -carried -on -to -be -successful -chapter -lxviii -judicious -mr -rhodes -what -south -africa -consists -of -johannesburg -the -gold -mines -the -heaven -of -american -engineers -what -the -author -knows -about -mining -description -of -the -boer -what -should -be -expected -of -him -what -was -a -dizzy -jump -for -rhodes -taxes -rhodesian -method -of -reducing -native -population -journeying -in -cape -colony -the -cars -the -country -the -weather -tamed -blacks -familiar -figures -in -king -william's -town -boer -dress -boer -country -life -sleeping -accommodations -the -reformers -in -boer -prison -torturing -a -black -prisoner -chapter -lxix -an -absorbing -novelty -the -kimberley -diamond -mines -discovery -of -diamonds -the -wronged -stranger -where -the -gems -are -a -judicious -change -of -boundary -modern -machinery -and -appliances -thrilling -excitement -in -finding -a -diamond -testing -a -diamond -fences -deep -mining -by -natives -in -the -compound -stealing -reward -for -the -biggest -diamond -a -fortune -in -wine -the -great -diamond -office -of -the -de -beer -co -sorting -the -gems -cape -town -the -most -imposing -man -in -british -provinces -various -reasons -for -his -supremacy -how -he -makes -friends -conclusion -table -rock -table -bay -the -castle -government -and -parliament -the -club -dutch -mansions -and -their -hospitality -dr -john -barry -and -his -doings -on -the -ship -norman -madeira -arrived -in -southampton -following -the -equator -chapter -i -a -man -may -have -no -bad -habits -and -have -worse -pudd'nhead -wilson's -new -calendar -the -starting -point -of -this -lecturing -trip -around -the -world -was -paris -where -we -had -been -living -a -year -or -two -we -sailed -for -america -and -there -made -certain -preparations -this -took -but -little -time -two -members -of -my -family -elected -to -go -with -me -also -a -carbuncle -the -dictionary -says -a -carbuncle -is -a -kind -of -jewel -humor -is -out -of -place -in -a -dictionary -we -started -westward -from -new -york -in -midsummer -with -major -pond -to -manage -the -platform -business -as -far -as -the -pacific -it -was -warm -work -all -the -way -and -the -last -fortnight -of -it -was -suffocatingly -smoky -for -in -oregon -and -columbia -the -forest -fires -were -raging -we -had -an -added -week -of -smoke -at -the -seaboard -where -we -were -obliged -awhile -for -our -ship -she -had -been -getting -herself -ashore -in -the -smoke -and -she -had -to -be -docked -and -repaired -we -sailed -at -last -and -so -ended -a -snail -paced -march -across -the -continent -which -had -lasted -forty -days -we -moved -westward -about -mid -afternoon -over -a -rippled -and -summer -sea -an -enticing -sea -a -clean -and -cool -sea -and -apparently -a -welcome -sea -to -all -on -board -it -certainly -was -to -the -distressful -dustings -and -smokings -and -swelterings -of -the -past -weeks -the -voyage -would -furnish -a -three -weeks -holiday -with -hardly -a -break -in -it -we -had -the -whole -pacific -ocean -in -front -of -us -with -nothing -to -do -but -do -nothing -and -be -comfortable -the -city -of -victoria -was -twinkling -dim -in -the -deep -heart -of -her -smoke -cloud -and -getting -ready -to -vanish -and -now -we -closed -the -field -glasses -and -sat -down -on -our -steamer -chairs -contented -and -at -peace -but -they -went -to -wreck -and -ruin -under -us -and -brought -us -to -shame -before -all -the -passengers -they -had -been -furnished -by -the -largest -furniture -dealing -house -in -victoria -and -were -worth -a -couple -of -farthings -a -dozen -though -they -had -cost -us -the -price -of -honest -chairs -in -the -pacific -and -indian -oceans -one -must -still -bring -his -own -deck -chair -on -board -or -go -without -just -as -in -the -old -forgotten -atlantic -times -those -dark -ages -of -sea -travel -ours -was -a -reasonably -comfortable -ship -with -the -customary -sea -going -fare -plenty -of -good -food -furnished -by -the -deity -and -cooked -by -the -devil -the -discipline -observable -on -board -was -perhaps -as -good -as -it -is -anywhere -in -the -pacific -and -indian -oceans -the -ship -was -not -very -well -arranged -for -tropical -service -but -that -is -nothing -for -this -is -the -rule -for -ships -which -ply -in -the -tropics -she -had -an -over -supply -of -cockroaches -but -this -is -also -the -rule -with -ships -doing -business -in -the -summer -seas -at -least -such -as -have -been -long -in -service -our -young -captain -was -a -very -handsome -man -tall -and -perfectly -formed -the -very -figure -to -show -up -a -smart -uniform's -best -effects -he -was -a -man -of -the -best -intentions -and -was -polite -and -courteous -even -to -courtliness -there -was -a -soft -and -finish -about -his -manners -which -made -whatever -place -he -happened -to -be -in -seem -for -the -moment -a -drawing -room -he -avoided -the -smoking -room -he -had -no -vices -he -did -not -smoke -or -chew -tobacco -or -take -snuff -he -did -not -swear -or -use -slang -or -rude -or -coarse -or -indelicate -language -or -make -puns -or -tell -anecdotes -or -laugh -intemperately -or -raise -his -voice -above -the -moderate -pitch -enjoined -by -the -canons -of -good -form -when -he -gave -an -order -his -manner -modified -it -into -a -request -after -dinner -he -and -his -officers -joined -the -ladies -and -gentlemen -in -the -ladies' -saloon -and -shared -in -the -singing -and -piano -playing -and -helped -turn -the -music -he -had -a -sweet -and -sympathetic -tenor -voice -and -used -it -with -taste -and -effect -the -music -he -played -whist -there -always -with -the -same -partner -and -opponents -until -the -ladies' -bedtime -the -electric -lights -burned -there -as -late -as -the -ladies -and -their -friends -might -desire -but -they -were -not -allowed -to -burn -in -the -smoking -room -after -eleven -there -were -many -laws -on -the -ship's -statute -book -of -course -but -so -far -as -i -could -see -this -and -one -other -were -the -only -ones -that -were -rigidly -enforced -the -captain -explained -that -he -enforced -this -one -because -his -own -cabin -adjoined -the -smoking -room -and -the -smell -of -tobacco -smoke -made -him -sick -i -did -not -see -how -our -smoke -could -reach -him -for -the -smoking -room -and -his -cabin -were -on -the -upper -deck -targets -for -all -the -winds -that -blew -and -besides -there -was -no -crack -of -communication -between -them -no -opening -of -any -sort -in -the -solid -intervening -bulkhead -still -to -a -delicate -stomach -even -imaginary -smoke -can -convey -damage -the -captain -with -his -gentle -nature -his -polish -his -sweetness -his -moral -and -verbal -purity -seemed -pathetically -out -of -place -in -his -rude -and -autocratic -vocation -it -seemed -another -instance -of -the -irony -of -fate -he -was -going -home -under -a -cloud -the -passengers -knew -about -his -trouble -and -were -sorry -for -him -approaching -vancouver -through -a -narrow -and -difficult -passage -densely -befogged -with -smoke -from -the -forest -fires -he -had -had -the -ill -luck -to -lose -his -bearings -and -get -his -ship -on -the -rocks -a -matter -like -this -would -rank -merely -as -an -error -with -you -and -me -it -ranks -as -a -crime -with -the -directors -of -steamship -companies -the -captain -had -been -tried -by -the -admiralty -court -at -vancouver -and -its -verdict -had -acquitted -him -of -blame -but -that -was -insufficient -comfort -a -sterner -court -would -examine -the -case -in -sydney -the -court -of -directors -the -lords -of -a -company -in -whose -ships -the -captain -had -served -as -mate -a -number -of -years -this -was -his -first -voyage -as -captain -the -officers -of -our -ship -were -hearty -and -companionable -young -men -and -they -entered -into -the -general -amusements -and -helped -the -passengers -pass -the -time -voyages -in -the -pacific -and -indian -oceans -are -but -pleasure -excursions -for -all -hands -our -purser -was -a -young -scotchman -who -was -equipped -with -a -grit -that -was -remarkable -he -was -an -invalid -and -looked -it -as -far -as -his -body -was -concerned -but -illness -could -not -subdue -his -spirit -he -was -full -of -life -and -had -a -gay -and -capable -tongue -to -all -appearances -he -was -a -sick -man -without -being -aware -of -it -for -he -did -not -talk -about -his -ailments -and -his -bearing -and -conduct -were -those -of -a -person -in -robust -health -yet -he -was -the -prey -at -intervals -of -ghastly -sieges -of -pain -in -his -heart -these -lasted -many -hours -and -while -the -attack -continued -he -could -neither -sit -nor -lie -in -one -instance -he -stood -on -his -feet -twenty -four -hours -fighting -for -his -life -with -these -sharp -agonies -and -yet -was -as -full -of -life -and -cheer -and -activity -the -next -day -as -if -nothing -had -happened -the -brightest -passenger -in -the -ship -and -the -most -interesting -and -felicitous -talker -was -a -young -canadian -who -was -not -able -to -let -the -whisky -bottle -alone -he -was -of -a -rich -and -powerful -family -and -could -have -had -a -distinguished -career -and -abundance -of -effective -help -toward -it -if -he -could -have -conquered -his -appetite -for -drink -but -he -could -not -do -it -so -his -great -equipment -of -talent -was -of -no -use -to -him -he -had -often -taken -the -pledge -to -drink -no -more -and -was -a -good -sample -of -what -that -sort -of -unwisdom -can -do -for -a -man -for -a -man -with -anything -short -of -an -iron -will -the -system -is -wrong -in -two -ways -it -does -not -strike -at -the -root -of -the -trouble -for -one -thing -and -to -make -a -pledge -of -any -kind -is -to -declare -war -against -nature -for -a -pledge -is -a -chain -that -is -always -clanking -and -reminding -the -wearer -of -it -that -he -is -not -a -free -man -i -have -said -that -the -system -does -not -strike -at -the -root -of -the -trouble -and -i -venture -to -repeat -that -the -root -is -not -the -drinking -but -the -desire -to -drink -these -are -very -different -things -the -one -merely -requires -will -and -a -great -deal -of -it -both -as -to -bulk -and -staying -capacity -the -other -merely -requires -watchfulness -and -for -no -long -time -the -desire -of -course -precedes -the -act -and -should -have -one's -first -attention -it -can -do -but -little -good -to -refuse -the -act -over -and -over -again -always -leaving -the -desire -unmolested -unconquered -the -desire -will -continue -to -assert -itself -and -will -be -almost -sure -to -win -in -the -long -run -when -the -desire -intrudes -it -should -be -at -once -banished -out -of -the -mind -one -should -be -on -the -watch -for -it -all -the -time -otherwise -it -will -get -in -it -must -be -taken -in -time -and -not -allowed -to -get -a -lodgment -a -desire -constantly -repulsed -for -a -fortnight -should -die -then -that -should -cure -the -drinking -habit -the -system -of -refusing -the -mere -act -of -drinking -and -leaving -the -desire -in -full -force -is -unintelligent -war -tactics -it -seems -to -me -i -used -to -take -pledges -and -soon -violate -them -my -will -was -not -strong -and -i -could -not -help -it -and -then -to -be -tied -in -any -way -naturally -irks -an -otherwise -free -person -and -makes -him -chafe -in -his -bonds -and -want -to -get -his -liberty -but -when -i -finally -ceased -from -taking -definite -pledges -and -merely -resolved -that -i -would -kill -an -injurious -desire -but -leave -myself -free -to -resume -the -desire -and -the -habit -whenever -i -should -choose -to -do -so -i -had -no -more -trouble -in -five -days -i -drove -out -the -desire -to -smoke -and -was -not -obliged -to -keep -watch -after -that -and -i -never -experienced -any -strong -desire -to -smoke -again -at -the -end -of -a -year -and -a -quarter -of -idleness -i -began -to -write -a -book -and -presently -found -that -the -pen -was -strangely -reluctant -to -go -i -tried -a -smoke -to -see -if -that -would -help -me -out -of -the -difficulty -it -did -i -smoked -eight -or -ten -cigars -and -as -many -pipes -a -day -for -five -months -finished -the -book -and -did -not -smoke -again -until -a -year -had -gone -by -and -another -book -had -to -be -begun -i -can -quit -any -of -my -nineteen -injurious -habits -at -any -time -and -without -discomfort -or -inconvenience -i -think -that -the -dr -tanners -and -those -others -who -go -forty -days -without -eating -do -it -by -resolutely -keeping -out -the -desire -to -eat -in -the -beginning -and -that -after -a -few -hours -the -desire -is -discouraged -and -comes -no -more -once -i -tried -my -scheme -in -a -large -medical -way -i -had -been -confined -to -my -bed -several -days -with -lumbago -my -case -refused -to -improve -finally -the -doctor -said -my -remedies -have -no -fair -chance -consider -what -they -have -to -fight -besides -the -lumbago -you -smoke -extravagantly -don't -you -yes -you -take -coffee -immoderately -yes -and -some -tea -yes -you -eat -all -kinds -of -things -that -are -dissatisfied -with -each -other's -company -yes -you -drink -two -hot -scotches -every -night -yes -very -well -there -you -see -what -i -have -to -contend -against -we -can't -make -progress -the -way -the -matter -stands -you -must -make -a -reduction -in -these -things -you -must -cut -down -your -consumption -of -them -considerably -for -some -days -i -can't -doctor -why -can't -you -i -lack -the -will -power -i -can -cut -them -off -entirely -but -i -can't -merely -moderate -them -he -said -that -that -would -answer -and -said -he -would -come -around -in -twenty -four -hours -and -begin -work -again -he -was -taken -ill -himself -and -could -not -come -but -i -did -not -need -him -i -cut -off -all -those -things -for -two -days -and -nights -in -fact -i -cut -off -all -kinds -of -food -too -and -all -drinks -except -water -and -at -the -end -of -the -forty -eight -hours -the -lumbago -was -discouraged -and -left -me -i -was -a -well -man -so -i -gave -thanks -and -took -to -those -delicacies -again -it -seemed -a -valuable -medical -course -and -i -recommended -it -to -a -lady -she -had -run -down -and -down -and -down -and -had -at -last -reached -a -point -where -medicines -no -longer -had -any -helpful -effect -upon -her -i -said -i -knew -i -could -put -her -upon -her -feet -in -a -week -it -brightened -her -up -it -filled -her -with -hope -and -she -said -she -would -do -everything -i -told -her -to -do -so -i -said -she -must -stop -swearing -and -drinking -and -smoking -and -eating -for -four -days -and -then -she -would -be -all -right -again -and -it -would -have -happened -just -so -i -know -it -but -she -said -she -could -not -stop -swearing -and -smoking -and -drinking -because -she -had -never -done -those -things -so -there -it -was -she -had -neglected -her -habits -and -hadn't -any -now -that -they -would -have -come -good -there -were -none -in -stock -she -had -nothing -to -fall -back -on -she -was -a -sinking -vessel -with -no -freight -in -her -to -throw -over -lighten -ship -withal -why -even -one -or -two -little -bad -habits -could -have -saved -her -but -she -was -just -a -moral -pauper -when -she -could -have -acquired -them -she -was -dissuaded -by -her -parents -who -were -ignorant -people -though -reared -in -the -best -society -and -it -was -too -late -to -begin -now -it -seemed -such -a -pity -but -there -was -no -help -for -it -these -things -ought -to -be -attended -to -while -a -person -is -young -otherwise -when -age -and -disease -come -there -is -nothing -effectual -to -fight -them -with -when -i -was -a -youth -i -used -to -take -all -kinds -of -pledges -and -do -my -best -to -keep -them -but -i -never -could -because -i -didn't -strike -at -the -root -of -the -habit -the -desire -i -generally -broke -down -within -the -month -once -i -tried -limiting -a -habit -that -worked -tolerably -well -for -a -while -i -pledged -myself -to -smoke -but -one -cigar -a -day -i -kept -the -cigar -waiting -until -bedtime -then -i -had -a -luxurious -time -with -it -but -desire -persecuted -me -every -day -and -all -day -long -so -within -the -week -i -found -myself -hunting -for -larger -cigars -than -i -had -been -used -to -smoke -then -larger -ones -still -and -still -larger -ones -within -the -fortnight -i -was -getting -cigars -made -for -me -on -a -yet -larger -pattern -they -still -grew -and -grew -in -size -within -the -month -my -cigar -had -grown -to -such -proportions -that -i -could -have -used -it -as -a -crutch -it -now -seemed -to -me -that -a -one -cigar -limit -was -no -real -protection -to -a -person -so -i -knocked -my -pledge -on -the -head -and -resumed -my -liberty -to -go -back -to -that -young -canadian -he -was -a -remittance -man -the -first -one -i -had -ever -seen -or -heard -of -passengers -explained -the -term -to -me -they -said -that -dissipated -ne'er -do -wells -belonging -to -important -families -in -england -and -canada -were -not -cast -off -by -their -people -while -there -was -any -hope -of -reforming -them -but -when -that -last -hope -perished -at -last -the -ne'er -do -well -was -sent -abroad -to -get -him -out -of -the -way -he -was -shipped -off -with -just -enough -money -in -his -pocket -no -in -the -purser's -pocket -for -the -needs -of -the -voyage -and -when -he -reached -his -destined -port -he -would -find -a -remittance -awaiting -him -there -not -a -large -one -but -just -enough -to -keep -him -a -month -a -similar -remittance -would -come -monthly -thereafter -it -was -the -remittance -man's -custom -to -pay -his -month's -board -and -lodging -straightway -a -duty -which -his -landlord -did -not -allow -him -to -forget -then -spree -away -the -rest -of -his -money -in -a -single -night -then -brood -and -mope -and -grieve -in -idleness -till -the -next -remittance -came -it -is -a -pathetic -life -we -had -other -remittance -men -on -board -it -was -said -at -least -they -said -they -were -r -m -'s -there -were -two -but -they -did -not -resemble -the -canadian -they -lacked -his -tidiness -and -his -brains -and -his -gentlemanly -ways -and -his -resolute -spirit -and -his -humanities -and -generosities -one -of -them -was -a -lad -of -nineteen -or -twenty -and -he -was -a -good -deal -of -a -ruin -as -to -clothes -and -morals -and -general -aspect -he -said -he -was -a -scion -of -a -ducal -house -in -england -and -had -been -shipped -to -canada -for -the -house's -relief -that -he -had -fallen -into -trouble -there -and -was -now -being -shipped -to -australia -he -said -he -had -no -title -beyond -this -remark -he -was -economical -of -the -truth -the -first -thing -he -did -in -australia -was -to -get -into -the -lockup -and -the -next -thing -he -did -was -to -proclaim -himself -an -earl -in -the -police -court -in -the -morning -and -fail -to -prove -it -chapter -ii -when -in -doubt -tell -the -truth -pudd'nhead -wilson's -new -calendar -about -four -days -out -from -victoria -we -plunged -into -hot -weather -and -all -the -male -passengers -put -on -white -linen -clothes -one -or -two -days -later -we -crossed -the -25th -parallel -of -north -latitude -and -then -by -order -the -officers -of -the -ship -laid -away -their -blue -uniforms -and -came -out -in -white -linen -ones -all -the -ladies -were -in -white -by -this -time -this -prevalence -of -snowy -costumes -gave -the -promenade -deck -an -invitingly -cool -and -cheerful -and -picnicky -aspect -from -my -diary -there -are -several -sorts -of -ills -in -the -world -from -which -a -person -can -never -escape -altogether -let -him -journey -as -far -as -he -will -one -escapes -from -one -breed -of -an -ill -only -to -encounter -another -breed -of -it -we -have -come -far -from -the -snake -liar -and -the -fish -liar -and -there -was -rest -and -peace -in -the -thought -but -now -we -have -reached -the -realm -of -the -boomerang -liar -and -sorrow -is -with -us -once -more -the -first -officer -has -seen -a -man -try -to -escape -from -his -enemy -by -getting -behind -a -tree -but -the -enemy -sent -his -boomerang -sailing -into -the -sky -far -above -and -beyond -the -tree -then -it -turned -descended -and -killed -the -man -the -australian -passenger -has -seen -this -thing -done -to -two -men -behind -two -trees -and -by -the -one -arrow -this -being -received -with -a -large -silence -that -suggested -doubt -he -buttressed -it -with -the -statement -that -his -brother -once -saw -the -boomerang -kill -a -bird -away -off -a -hundred -yards -and -bring -it -to -the -thrower -but -these -are -ills -which -must -be -borne -there -is -no -other -way -the -talk -passed -from -the -boomerang -to -dreams -usually -a -fruitful -subject -afloat -or -ashore -but -this -time -the -output -was -poor -then -it -passed -to -instances -of -extraordinary -memory -with -better -results -blind -tom -the -negro -pianist -was -spoken -of -and -it -was -said -that -he -could -accurately -play -any -piece -of -music -howsoever -long -and -difficult -after -hearing -it -once -and -that -six -months -later -he -could -accurately -play -it -again -without -having -touched -it -in -the -interval -one -of -the -most -striking -of -the -stories -told -was -furnished -by -a -gentleman -who -had -served -on -the -staff -of -the -viceroy -of -india -he -read -the -details -from -his -note -book -and -explained -that -he -had -written -them -down -right -after -the -consummation -of -the -incident -which -they -described -because -he -thought -that -if -he -did -not -put -them -down -in -black -and -white -he -might -presently -come -to -think -he -had -dreamed -them -or -invented -them -the -viceroy -was -making -a -progress -and -among -the -shows -offered -by -the -maharajah -of -mysore -for -his -entertainment -was -a -memory -exhibition -the -viceroy -and -thirty -gentlemen -of -his -suite -sat -in -a -row -and -the -memory -expert -a -high -caste -brahmin -was -brought -in -and -seated -on -the -floor -in -front -of -them -he -said -he -knew -but -two -languages -the -english -and -his -own -but -would -not -exclude -any -foreign -tongue -from -the -tests -to -be -applied -to -his -memory -then -he -laid -before -the -assemblage -his -program -a -sufficiently -extraordinary -one -he -proposed -that -one -gentleman -should -give -him -one -word -of -a -foreign -sentence -and -tell -him -its -place -in -the -sentence -he -was -furnished -with -the -french -word -'est' -and -was -told -it -was -second -in -a -sentence -of -three -words -the -next -gentleman -gave -him -the -german -word -'verloren' -and -said -it -was -the -third -in -a -sentence -of -four -words -he -asked -the -next -gentleman -for -one -detail -in -a -sum -in -addition -another -for -one -detail -in -a -sum -of -subtraction -others -for -single -details -in -mathematical -problems -of -various -kinds -he -got -them -intermediates -gave -him -single -words -from -sentences -in -greek -latin -spanish -portuguese -italian -and -other -languages -and -told -him -their -places -in -the -sentences -when -at -last -everybody -had -furnished -him -a -single -rag -from -a -foreign -sentence -or -a -figure -from -a -problem -he -went -over -the -ground -again -and -got -a -second -word -and -a -second -figure -and -was -told -their -places -in -the -sentences -and -the -sums -and -so -on -and -so -on -he -went -over -the -ground -again -and -again -until -he -had -collected -all -the -parts -of -the -sums -and -all -the -parts -of -the -sentences -and -all -in -disorder -of -course -not -in -their -proper -rotation -this -had -occupied -two -hours -the -brahmin -now -sat -silent -and -thinking -a -while -then -began -and -repeated -all -the -sentences -placing -the -words -in -their -proper -order -and -untangled -the -disordered -arithmetical -problems -and -gave -accurate -answers -to -them -all -in -the -beginning -he -had -asked -the -company -to -throw -almonds -at -him -during -the -two -hours -he -to -remember -how -many -each -gentleman -had -thrown -but -none -were -thrown -for -the -viceroy -said -that -the -test -would -be -a -sufficiently -severe -strain -without -adding -that -burden -to -it -general -grant -had -a -fine -memory -for -all -kinds -of -things -including -even -names -and -faces -and -i -could -have -furnished -an -instance -of -it -if -i -had -thought -of -it -the -first -time -i -ever -saw -him -was -early -in -his -first -term -as -president -i -had -just -arrived -in -washington -from -the -pacific -coast -a -stranger -and -wholly -unknown -to -the -public -and -was -passing -the -white -house -one -morning -when -i -met -a -friend -a -senator -from -nevada -he -asked -me -if -i -would -like -to -see -the -president -i -said -i -should -be -very -glad -so -we -entered -i -supposed -that -the -president -would -be -in -the -midst -of -a -crowd -and -that -i -could -look -at -him -in -peace -and -security -from -a -distance -as -another -stray -cat -might -look -at -another -king -but -it -was -in -the -morning -and -the -senator -was -using -a -privilege -of -his -office -which -i -had -not -heard -of -the -privilege -of -intruding -upon -the -chief -magistrate's -working -hours -before -i -knew -it -the -senator -and -i -were -in -the -presence -and -there -was -none -there -but -we -three -general -grant -got -slowly -up -from -his -table -put -his -pen -down -and -stood -before -me -with -the -iron -expression -of -a -man -who -had -not -smiled -for -seven -years -and -was -not -intending -to -smile -for -another -seven -he -looked -me -steadily -in -the -eyes -mine -lost -confidence -and -fell -i -had -never -confronted -a -great -man -before -and -was -in -a -miserable -state -of -funk -and -inefficiency -the -senator -said -mr -president -may -i -have -the -privilege -of -introducing -mr -clemens -the -president -gave -my -hand -an -unsympathetic -wag -and -dropped -it -he -did -not -say -a -word -but -just -stood -in -my -trouble -i -could -not -think -of -anything -to -say -i -merely -wanted -to -resign -there -was -an -awkward -pause -a -dreary -pause -a -horrible -pause -then -i -thought -of -something -and -looked -up -into -that -unyielding -face -and -said -timidly -mr -president -i -i -am -embarrassed -are -you -his -face -broke -just -a -little -a -wee -glimmer -the -momentary -flicker -of -a -summer -lightning -smile -seven -years -ahead -of -time -and -i -was -out -and -gone -as -soon -as -it -was -ten -years -passed -away -before -i -saw -him -the -second -time -meantime -i -was -become -better -known -and -was -one -of -the -people -appointed -to -respond -to -toasts -at -the -banquet -given -to -general -grant -in -chicago -by -the -army -of -the -tennessee -when -he -came -back -from -his -tour -around -the -world -i -arrived -late -at -night -and -got -up -late -in -the -morning -all -the -corridors -of -the -hotel -were -crowded -with -people -waiting -to -get -a -glimpse -of -general -grant -when -he -should -pass -to -the -place -whence -he -was -to -review -the -great -procession -i -worked -my -way -by -the -suite -of -packed -drawing -rooms -and -at -the -corner -of -the -house -i -found -a -window -open -where -there -was -a -roomy -platform -decorated -with -flags -and -carpeted -i -stepped -out -on -it -and -saw -below -me -millions -of -people -blocking -all -the -streets -and -other -millions -caked -together -in -all -the -windows -and -on -all -the -house -tops -around -these -masses -took -me -for -general -grant -and -broke -into -volcanic -explosions -and -cheers -but -it -was -a -good -place -to -see -the -procession -and -i -stayed -presently -i -heard -the -distant -blare -of -military -music -and -far -up -the -street -i -saw -the -procession -come -in -sight -cleaving -its -way -through -the -huzzaing -multitudes -with -sheridan -the -most -martial -figure -of -the -war -riding -at -its -head -in -the -dress -uniform -of -a -lieutenant -general -and -now -general -grant -arm -in -arm -with -major -carter -harrison -stepped -out -on -the -platform -followed -two -and -two -by -the -badged -and -uniformed -reception -committee -general -grant -was -looking -exactly -as -he -had -looked -upon -that -trying -occasion -of -ten -years -before -all -iron -and -bronze -self -possession -mr -harrison -came -over -and -led -me -to -the -general -and -formally -introduced -me -before -i -could -put -together -the -proper -remark -general -grant -said -mr -clemens -i -am -not -embarrassed -are -you -and -that -little -seven -year -smile -twinkled -across -his -face -again -seventeen -years -have -gone -by -since -then -and -to -day -in -new -york -the -streets -are -a -crush -of -people -who -are -there -to -honor -the -remains -of -the -great -soldier -as -they -pass -to -their -final -resting -place -under -the -monument -and -the -air -is -heavy -with -dirges -and -the -boom -of -artillery -and -all -the -millions -of -america -are -thinking -of -the -man -who -restored -the -union -and -the -flag -and -gave -to -democratic -government -a -new -lease -of -life -and -as -we -may -hope -and -do -believe -a -permanent -place -among -the -beneficent -institutions -of -men -we -had -one -game -in -the -ship -which -was -a -good -time -passer -at -least -it -was -at -night -in -the -smoking -room -when -the -men -were -getting -freshened -up -from -the -day's -monotonies -and -dullnesses -it -was -the -completing -of -non -complete -stories -that -is -to -say -a -man -would -tell -all -of -a -story -except -the -finish -then -the -others -would -try -to -supply -the -ending -out -of -their -own -invention -when -every -one -who -wanted -a -chance -had -had -it -the -man -who -had -introduced -the -story -would -give -it -its -original -ending -then -you -could -take -your -choice -sometimes -the -new -endings -turned -out -to -be -better -than -the -old -one -but -the -story -which -called -out -the -most -persistent -and -determined -and -ambitious -effort -was -one -which -had -no -ending -and -so -there -was -nothing -to -compare -the -new -made -endings -with -the -man -who -told -it -said -he -could -furnish -the -particulars -up -to -a -certain -point -only -because -that -was -as -much -of -the -tale -as -he -knew -he -had -read -it -in -a -volume -of -`sketches -twenty -five -years -ago -and -was -interrupted -before -the -end -was -reached -he -would -give -any -one -fifty -dollars -who -would -finish -the -story -to -the -satisfaction -of -a -jury -to -be -appointed -by -ourselves -we -appointed -a -jury -and -wrestled -with -the -tale -we -invented -plenty -of -endings -but -the -jury -voted -them -all -down -the -jury -was -right -it -was -a -tale -which -the -author -of -it -may -possibly -have -completed -satisfactorily -and -if -he -really -had -that -good -fortune -i -would -like -to -know -what -the -ending -was -any -ordinary -man -will -find -that -the -story's -strength -is -in -its -middle -and -that -there -is -apparently -no -way -to -transfer -it -to -the -close -where -of -course -it -ought -to -be -in -substance -the -storiette -was -as -follows -john -brown -aged -thirty -one -good -gentle -bashful -timid -lived -in -a -quiet -village -in -missouri -he -was -superintendent -of -the -presbyterian -sunday -school -it -was -but -a -humble -distinction -still -it -was -his -only -official -one -and -he -was -modestly -proud -of -it -and -was -devoted -to -its -work -and -its -interests -the -extreme -kindliness -of -his -nature -was -recognized -by -all -in -fact -people -said -that -he -was -made -entirely -out -of -good -impulses -and -bashfulness -that -he -could -always -be -counted -upon -for -help -when -it -was -needed -and -for -bashfulness -both -when -it -was -needed -and -when -it -wasn't -mary -taylor -twenty -three -modest -sweet -winning -and -in -character -and -person -beautiful -was -all -in -all -to -him -and -he -was -very -nearly -all -in -all -to -her -she -was -wavering -his -hopes -were -high -her -mother -had -been -in -opposition -from -the -first -but -she -was -wavering -too -he -could -see -it -she -was -being -touched -by -his -warm -interest -in -her -two -charity -proteges -and -by -his -contributions -toward -their -support -these -were -two -forlorn -and -aged -sisters -who -lived -in -a -log -hut -in -a -lonely -place -up -a -cross -road -four -miles -from -mrs -taylor's -farm -one -of -the -sisters -was -crazy -and -sometimes -a -little -violent -but -not -often -at -last -the -time -seemed -ripe -for -a -final -advance -and -brown -gathered -his -courage -together -and -resolved -to -make -it -he -would -take -along -a -contribution -of -double -the -usual -size -and -win -the -mother -over -with -her -opposition -annulled -the -rest -of -the -conquest -would -be -sure -and -prompt -he -took -to -the -road -in -the -middle -of -a -placid -sunday -afternoon -in -the -soft -missourian -summer -and -he -was -equipped -properly -for -his -mission -he -was -clothed -all -in -white -linen -with -a -blue -ribbon -for -a -necktie -and -he -had -on -dressy -tight -boots -his -horse -and -buggy -were -the -finest -that -the -livery -stable -could -furnish -the -lap -robe -was -of -white -linen -it -was -new -and -it -had -a -hand -worked -border -that -could -not -be -rivaled -in -that -region -for -beauty -and -elaboration -when -he -was -four -miles -out -on -the -lonely -road -and -was -walking -his -horse -over -a -wooden -bridge -his -straw -hat -blew -off -and -fell -in -the -creek -and -floated -down -and -lodged -against -a -bar -he -did -not -quite -know -what -to -do -he -must -have -the -hat -that -was -manifest -but -how -was -he -to -get -it -then -he -had -an -idea -the -roads -were -empty -nobody -was -stirring -yes -he -would -risk -it -he -led -the -horse -to -the -roadside -and -set -it -to -cropping -the -grass -then -he -undressed -and -put -his -clothes -in -the -buggy -petted -the -horse -a -moment -to -secure -its -compassion -and -its -loyalty -then -hurried -to -the -stream -he -swam -out -and -soon -had -the -hat -when -he -got -to -the -top -of -the -bank -the -horse -was -gone! -his -legs -almost -gave -way -under -him -the -horse -was -walking -leisurely -along -the -road -brown -trotted -after -it -saying -whoa -whoa -there's -a -good -fellow -but -whenever -he -got -near -enough -to -chance -a -jump -for -the -buggy -the -horse -quickened -its -pace -a -little -and -defeated -him -and -so -this -went -on -the -naked -man -perishing -with -anxiety -and -expecting -every -moment -to -see -people -come -in -sight -he -tagged -on -and -on -imploring -the -horse -beseeching -the -horse -till -he -had -left -a -mile -behind -him -and -was -closing -up -on -the -taylor -premises -then -at -last -he -was -successful -and -got -into -the -buggy -he -flung -on -his -shirt -his -necktie -and -his -coat -then -reached -for -but -he -was -too -late -he -sat -suddenly -down -and -pulled -up -the -lap -robe -for -he -saw -some -one -coming -out -of -the -gate -a -woman -he -thought -he -wheeled -the -horse -to -the -left -and -struck -briskly -up -the -cross -road -it -was -perfectly -straight -and -exposed -on -both -sides -but -there -were -woods -and -a -sharp -turn -three -miles -ahead -and -he -was -very -grateful -when -he -got -there -as -he -passed -around -the -turn -he -slowed -down -to -a -walk -and -reached -for -his -tr -too -late -again -he -had -come -upon -mrs -enderby -mrs -glossop -mrs -taylor -and -mary -they -were -on -foot -and -seemed -tired -and -excited -they -came -at -once -to -the -buggy -and -shook -hands -and -all -spoke -at -once -and -said -eagerly -and -earnestly -how -glad -they -were -that -he -was -come -and -how -fortunate -it -was -and -mrs -enderby -said -impressively -it -looks -like -an -accident -his -coming -at -such -a -time -but -let -no -one -profane -it -with -such -a -name -he -was -sent -sent -from -on -high -they -were -all -moved -and -mrs -glossop -said -in -an -awed -voice -sarah -enderby -you -never -said -a -truer -word -in -your -life -this -is -no -accident -it -is -a -special -providence -he -was -sent -he -is -an -angel -an -angel -as -truly -as -ever -angel -was -an -angel -of -deliverance -i -say -angel -sarah -enderby -and -will -have -no -other -word -don't -let -any -one -ever -say -to -me -again -that -there's -no -such -thing -as -special -providences -for -if -this -isn't -one -let -them -account -for -it -that -can -i -know -it's -so -said -mrs -taylor -fervently -john -brown -i -could -worship -you -i -could -go -down -on -my -knees -to -you -didn't -something -tell -you -didn't -you -feel -that -you -were -sent -i -could -kiss -the -hem -of -your -laprobe -he -was -not -able -to -speak -he -was -helpless -with -shame -and -fright -mrs -taylor -went -on -why -just -look -at -it -all -around -julia -glossop -any -person -can -see -the -hand -of -providence -in -it -here -at -noon -what -do -we -see -we -see -the -smoke -rising -i -speak -up -and -say -'that's -the -old -people's -cabin -afire -' -didn't -i -julia -glossop -the -very -words -you -said -nancy -taylor -i -was -as -close -to -you -as -i -am -now -and -i -heard -them -you -may -have -said -hut -instead -of -cabin -but -in -substance -it's -the -same -and -you -were -looking -pale -too -pale -i -was -that -pale -that -if -why -you -just -compare -it -with -this -laprobe -then -the -next -thing -i -said -was -'mary -taylor -tell -the -hired -man -to -rig -up -the -team -we'll -go -to -the -rescue -' -and -she -said -'mother -don't -you -know -you -told -him -he -could -drive -to -see -his -people -and -stay -over -sunday -' -and -it -was -just -so -i -declare -for -it -i -had -forgotten -it -'then -' -said -i -'we'll -go -afoot -' -and -go -we -did -and -found -sarah -enderby -on -the -road -and -we -all -went -together -said -mrs -enderby -and -found -the -cabin -set -fire -to -and -burnt -down -by -the -crazy -one -and -the -poor -old -things -so -old -and -feeble -that -they -couldn't -go -afoot -and -we -got -them -to -a -shady -place -and -made -them -as -comfortable -as -we -could -and -began -to -wonder -which -way -to -turn -to -find -some -way -to -get -them -conveyed -to -nancy -taylor's -house -and -i -spoke -up -and -said -now -what -did -i -say -didn't -i -say -'providence -will -provide' -why -sure -as -you -live -so -you -did! -i -had -forgotten -it -so -had -i -said -mrs -glossop -and -mrs -taylor -but -you -certainly -said -it -now -wasn't -that -remarkable -yes -i -said -it -and -then -we -went -to -mr -moseley's -two -miles -and -all -of -them -were -gone -to -the -camp -meeting -over -on -stony -fork -and -then -we -came -all -the -way -back -two -miles -and -then -here -another -mile -and -providence -has -provided -you -see -it -yourselves -they -gazed -at -each -other -awe -struck -and -lifted -their -hands -and -said -in -unison -it's -per -fectly -wonderful -and -then -said -mrs -glossop -what -do -you -think -we -had -better -do -let -mr -brown -drive -the -old -people -to -nancy -taylor's -one -at -a -time -or -put -both -of -them -in -the -buggy -and -him -lead -the -horse -brown -gasped -now -then -that's -a -question -said -mrs -enderby -you -see -we -are -all -tired -out -and -any -way -we -fix -it -it's -going -to -be -difficult -for -if -mr -brown -takes -both -of -them -at -least -one -of -us -must -go -back -to -help -him -for -he -can't -load -them -into -the -buggy -by -himself -and -they -so -helpless -that -is -so -said -mrs -taylor -it -doesn't -look -oh -how -would -this -do -one -of -us -drive -there -with -mr -brown -and -the -rest -of -you -go -along -to -my -house -and -get -things -ready -i'll -go -with -him -he -and -i -together -can -lift -one -of -the -old -people -into -the -buggy -then -drive -her -to -my -house -and -but -who -will -take -care -of -the -other -one -said -mrs -enderby -we -musn't -leave -her -there -in -the -woods -alone -you -know -especially -the -crazy -one -there -and -back -is -eight -miles -you -see -they -had -all -been -sitting -on -the -grass -beside -the -buggy -for -a -while -now -trying -to -rest -their -weary -bodies -they -fell -silent -a -moment -or -two -and -struggled -in -thought -over -the -baffling -situation -then -mrs -enderby -brightened -and -said -i -think -i've -got -the -idea -now -you -see -we -can't -walk -any -more -think -what -we've -done -four -miles -there -two -to -moseley's -is -six -then -back -to -here -nine -miles -since -noon -and -not -a -bite -to -eat -i -declare -i -don't -see -how -we've -done -it -and -as -for -me -i -am -just -famishing -now -somebody's -got -to -go -back -to -help -mr -brown -there's -no -getting -mound -that -but -whoever -goes -has -got -to -ride -not -walk -so -my -idea -is -this -one -of -us -to -ride -back -with -mr -brown -then -ride -to -nancy -taylor's -house -with -one -of -the -old -people -leaving -mr -brown -to -keep -the -other -old -one -company -you -all -to -go -now -to -nancy's -and -rest -and -wait -then -one -of -you -drive -back -and -get -the -other -one -and -drive -her -to -nancy's -and -mr -brown -walk -splendid! -they -all -cried -oh -that -will -do -that -will -answer -perfectly -and -they -all -said -that -mrs -enderby -had -the -best -head -for -planning -in -the -company -and -they -said -that -they -wondered -that -they -hadn't -thought -of -this -simple -plan -themselves -they -hadn't -meant -to -take -back -the -compliment -good -simple -souls -and -didn't -know -they -had -done -it -after -a -consultation -it -was -decided -that -mrs -enderby -should -drive -back -with -brown -she -being -entitled -to -the -distinction -because -she -had -invented -the -plan -everything -now -being -satisfactorily -arranged -and -settled -the -ladies -rose -relieved -and -happy -and -brushed -down -their -gowns -and -three -of -them -started -homeward -mrs -enderby -set -her -foot -on -the -buggy -step -and -was -about -to -climb -in -when -brown -found -a -remnant -of -his -voice -and -gasped -out -please -mrs -enderby -call -them -back -i -am -very -weak -i -can't -walk -i -can't -indeed -why -dear -mr -brown! -you -do -look -pale -i -am -ashamed -of -myself -that -i -didn't -notice -it -sooner -come -back -all -of -you! -mr -brown -is -not -well -is -there -anything -i -can -do -for -you -mr -brown -i'm -real -sorry -are -you -in -pain -no -madam -only -weak -i -am -not -sick -but -only -just -weak -lately -not -long -but -just -lately -the -others -came -back -and -poured -out -their -sympathies -and -commiserations -and -were -full -of -self -reproaches -for -not -having -noticed -how -pale -he -was -and -they -at -once -struck -out -a -new -plan -and -soon -agreed -that -it -was -by -far -the -best -of -all -they -would -all -go -to -nancy -taylor's -house -and -see -to -brown's -needs -first -he -could -lie -on -the -sofa -in -the -parlor -and -while -mrs -taylor -and -mary -took -care -of -him -the -other -two -ladies -would -take -the -buggy -and -go -and -get -one -of -the -old -people -and -leave -one -of -themselves -with -the -other -one -and -by -this -time -without -any -solicitation -they -were -at -the -horse's -head -and -were -beginning -to -turn -him -around -the -danger -was -imminent -but -brown -found -his -voice -again -and -saved -himself -he -said -but -ladies -you -are -overlooking -something -which -makes -the -plan -impracticable -you -see -if -you -bring -one -of -them -home -and -one -remains -behind -with -the -other -there -will -be -three -persons -there -when -one -of -you -comes -back -for -that -other -for -some -one -must -drive -the -buggy -back -and -three -can't -come -home -in -it -they -all -exclaimed -why -sure -ly -that -is -so! -and -they -were -all -perplexed -again -dear -dear -what -can -we -do -said -mrs -glossop -it -is -the -most -mixed -up -thing -that -ever -was -the -fox -and -the -goose -and -the -corn -and -things -oh -dear -they -are -nothing -to -it -they -sat -wearily -down -once -more -to -further -torture -their -tormented -heads -for -a -plan -that -would -work -presently -mary -offered -a -plan -it -was -her -first -effort -she -said -i -am -young -and -strong -and -am -refreshed -now -take -mr -brown -to -our -house -and -give -him -help -you -see -how -plainly -he -needs -it -i -will -go -back -and -take -care -of -the -old -people -i -can -be -there -in -twenty -minutes -you -can -go -on -and -do -what -you -first -started -to -do -wait -on -the -main -road -at -our -house -until -somebody -comes -along -with -a -wagon -then -send -and -bring -away -the -three -of -us -you -won't -have -to -wait -long -the -farmers -will -soon -be -coming -back -from -town -now -i -will -keep -old -polly -patient -and -cheered -up -the -crazy -one -doesn't -need -it -this -plan -was -discussed -and -accepted -it -seemed -the -best -that -could -be -done -in -the -circumstances -and -the -old -people -must -be -getting -discouraged -by -this -time -brown -felt -relieved -and -was -deeply -thankful -let -him -once -get -to -the -main -road -and -he -would -find -a -way -to -escape -then -mrs -taylor -said -the -evening -chill -will -be -coming -on -pretty -soon -and -those -poor -old -burnt -out -things -will -need -some -kind -of -covering -take -the -lap -robe -with -you -dear -very -well -mother -i -will -she -stepped -to -the -buggy -and -put -out -her -hand -to -take -it -that -was -the -end -of -the -tale -the -passenger -who -told -it -said -that -when -he -read -the -story -twenty -five -years -ago -in -a -train -he -was -interrupted -at -that -point -the -train -jumped -off -a -bridge -at -first -we -thought -we -could -finish -the -story -quite -easily -and -we -set -to -work -with -confidence -but -it -soon -began -to -appear -that -it -was -not -a -simple -thing -but -difficult -and -baffling -this -was -on -account -of -brown's -character -great -generosity -and -kindliness -but -complicated -with -unusual -shyness -and -diffidence -particularly -in -the -presence -of -ladies -there -was -his -love -for -mary -in -a -hopeful -state -but -not -yet -secure -just -in -a -condition -indeed -where -its -affair -must -be -handled -with -great -tact -and -no -mistakes -made -no -offense -given -and -there -was -the -mother -wavering -half -willing -by -adroit -and -flawless -diplomacy -to -be -won -over -now -or -perhaps -never -at -all -also -there -were -the -helpless -old -people -yonder -in -the -woods -waiting -their -fate -and -brown's -happiness -to -be -determined -by -what -brown -should -do -within -the -next -two -seconds -mary -was -reaching -for -the -lap -robe -brown -must -decide -there -was -no -time -to -be -lost -of -course -none -but -a -happy -ending -of -the -story -would -be -accepted -by -the -jury -the -finish -must -find -brown -in -high -credit -with -the -ladies -his -behavior -without -blemish -his -modesty -unwounded -his -character -for -self -sacrifice -maintained -the -old -people -rescued -through -him -their -benefactor -all -the -party -proud -of -him -happy -in -him -his -praises -on -all -their -tongues -we -tried -to -arrange -this -but -it -was -beset -with -persistent -and -irreconcilable -difficulties -we -saw -that -brown's -shyness -would -not -allow -him -to -give -up -the -lap -robe -this -would -offend -mary -and -her -mother -and -it -would -surprise -the -other -ladies -partly -because -this -stinginess -toward -the -suffering -old -people -would -be -out -of -character -with -brown -and -partly -because -he -was -a -special -providence -and -could -not -properly -act -so -if -asked -to -explain -his -conduct -his -shyness -would -not -allow -him -to -tell -the -truth -and -lack -of -invention -and -practice -would -find -him -incapable -of -contriving -a -lie -that -would -wash -we -worked -at -the -troublesome -problem -until -three -in -the -morning -meantime -mary -was -still -reaching -for -the -lap -robe -we -gave -it -up -and -decided -to -let -her -continue -to -reach -it -is -the -reader's -privilege -to -determine -for -himself -how -the -thing -came -out -chapter -iii -it -is -more -trouble -to -make -a -maxim -than -it -is -to -do -right -pudd'nhead -wilson's -new -calendar -on -the -seventh -day -out -we -saw -a -dim -vast -bulk -standing -up -out -of -the -wastes -of -the -pacific -and -knew -that -that -spectral -promontory -was -diamond -head -a -piece -of -this -world -which -i -had -not -seen -before -for -twenty -nine -years -so -we -were -nearing -honolulu -the -capital -city -of -the -sandwich -islands -those -islands -which -to -me -were -paradise -a -paradise -which -i -had -been -longing -all -those -years -to -see -again -not -any -other -thing -in -the -world -could -have -stirred -me -as -the -sight -of -that -great -rock -did -in -the -night -we -anchored -a -mile -from -shore -through -my -port -i -could -see -the -twinkling -lights -of -honolulu -and -the -dark -bulk -of -the -mountain -range -that -stretched -away -right -and -left -i -could -not -make -out -the -beautiful -nuuana -valley -but -i -knew -where -it -lay -and -remembered -how -it -used -to -look -in -the -old -times -we -used -to -ride -up -it -on -horseback -in -those -days -we -young -people -and -branch -off -and -gather -bones -in -a -sandy -region -where -one -of -the -first -kamehameha's -battles -was -fought -he -was -a -remarkable -man -for -a -king -and -he -was -also -a -remarkable -man -for -a -savage -he -was -a -mere -kinglet -and -of -little -or -no -consequence -at -the -time -of -captain -cook's -arrival -in -1788 -but -about -four -years -afterward -he -conceived -the -idea -of -enlarging -his -sphere -of -influence -that -is -a -courteous -modern -phrase -which -means -robbing -your -neighbor -for -your -neighbor's -benefit -and -the -great -theater -of -its -benevolences -is -africa -kamehameha -went -to -war -and -in -the -course -of -ten -years -he -whipped -out -all -the -other -kings -and -made -himself -master -of -every -one -of -the -nine -or -ten -islands -that -form -the -group -but -he -did -more -than -that -he -bought -ships -freighted -them -with -sandal -wood -and -other -native -products -and -sent -them -as -far -as -south -america -and -china -he -sold -to -his -savages -the -foreign -stuffs -and -tools -and -utensils -which -came -back -in -these -ships -and -started -the -march -of -civilization -it -is -doubtful -if -the -match -to -this -extraordinary -thing -is -to -be -found -in -the -history -of -any -other -savage -savages -are -eager -to -learn -from -the -white -man -any -new -way -to -kill -each -other -but -it -is -not -their -habit -to -seize -with -avidity -and -apply -with -energy -the -larger -and -nobler -ideas -which -he -offers -them -the -details -of -kamehameha's -history -show -that -he -was -always -hospitably -ready -to -examine -the -white -man's -ideas -and -that -he -exercised -a -tidy -discrimination -in -making -his -selections -from -the -samples -placed -on -view -a -shrewder -discrimination -than -was -exhibited -by -his -son -and -successor -liholiho -i -think -liholiho -could -have -qualified -as -a -reformer -perhaps -but -as -a -king -he -was -a -mistake -a -mistake -because -he -tried -to -be -both -king -and -reformer -this -is -mixing -fire -and -gunpowder -together -a -king -has -no -proper -business -with -reforming -his -best -policy -is -to -keep -things -as -they -are -and -if -he -can't -do -that -he -ought -to -try -to -make -them -worse -than -they -are -this -is -not -guesswork -i -have -thought -over -this -matter -a -good -deal -so -that -if -i -should -ever -have -a -chance -to -become -a -king -i -would -know -how -to -conduct -the -business -in -the -best -way -when -liholiho -succeeded -his -father -he -found -himself -possessed -of -an -equipment -of -royal -tools -and -safeguards -which -a -wiser -king -would -have -known -how -to -husband -and -judiciously -employ -and -make -profitable -the -entire -country -was -under -the -one -scepter -and -his -was -that -scepter -there -was -an -established -church -and -he -was -the -head -of -it -there -was -a -standing -army -and -he -was -the -head -of -that -an -army -of -114 -privates -under -command -of -27 -generals -and -a -field -marshal -there -was -a -proud -and -ancient -hereditary -nobility -there -was -still -one -other -asset -this -was -the -tabu -an -agent -endowed -with -a -mysterious -and -stupendous -power -an -agent -not -found -among -the -properties -of -any -european -monarch -a -tool -of -inestimable -value -in -the -business -liholiho -was -headmaster -of -the -tabu -the -tabu -was -the -most -ingenious -and -effective -of -all -the -inventions -that -has -ever -been -devised -for -keeping -a -people's -privileges -satisfactorily -restricted -it -required -the -sexes -to -live -in -separate -houses -it -did -not -allow -people -to -eat -in -either -house -they -must -eat -in -another -place -it -did -not -allow -a -man's -woman -folk -to -enter -his -house -it -did -not -allow -the -sexes -to -eat -together -the -men -must -eat -first -and -the -women -must -wait -on -them -then -the -women -could -eat -what -was -left -if -anything -was -left -and -wait -on -themselves -i -mean -if -anything -of -a -coarse -or -unpalatable -sort -was -left -the -women -could -have -it -but -not -the -good -things -the -fine -things -the -choice -things -such -as -pork -poultry -bananas -cocoanuts -the -choicer -varieties -of -fish -and -so -on -by -the -tabu -all -these -were -sacred -to -the -men -the -women -spent -their -lives -longing -for -them -and -wondering -what -they -might -taste -like -and -they -died -without -finding -out -these -rules -as -you -see -were -quite -simple -and -clear -it -was -easy -to -remember -them -and -useful -for -the -penalty -for -infringing -any -rule -in -the -whole -list -was -death -those -women -easily -learned -to -put -up -with -shark -and -taro -and -dog -for -a -diet -when -the -other -things -were -so -expensive -it -was -death -for -any -one -to -walk -upon -tabu'd -ground -or -defile -a -tabu'd -thing -with -his -touch -or -fail -in -due -servility -to -a -chief -or -step -upon -the -king's -shadow -the -nobles -and -the -king -and -the -priests -were -always -suspending -little -rags -here -and -there -and -yonder -to -give -notice -to -the -people -that -the -decorated -spot -or -thing -was -tabu -and -death -lurking -near -the -struggle -for -life -was -difficult -and -chancy -in -the -islands -in -those -days -thus -advantageously -was -the -new -king -situated -will -it -be -believed -that -the -first -thing -he -did -was -to -destroy -his -established -church -root -and -branch -he -did -indeed -do -that -to -state -the -case -figuratively -he -was -a -prosperous -sailor -who -burnt -his -ship -and -took -to -a -raft -this -church -was -a -horrid -thing -it -heavily -oppressed -the -people -it -kept -them -always -trembling -in -the -gloom -of -mysterious -threatenings -it -slaughtered -them -in -sacrifice -before -its -grotesque -idols -of -wood -and -stone -it -cowed -them -it -terrorized -them -it -made -them -slaves -to -its -priests -and -through -the -priests -to -the -king -it -was -the -best -friend -a -king -could -have -and -the -most -dependable -to -a -professional -reformer -who -should -annihilate -so -frightful -and -so -devastating -a -power -as -this -church -reverence -and -praise -would -be -due -but -to -a -king -who -should -do -it -could -properly -be -due -nothing -but -reproach -reproach -softened -by -sorrow -sorrow -for -his -unfitness -for -his -position -he -destroyed -his -established -church -and -his -kingdom -is -a -republic -today -in -consequence -of -that -act -when -he -destroyed -the -church -and -burned -the -idols -he -did -a -mighty -thing -for -civilization -and -for -his -people's -weal -but -it -was -not -business -it -was -unkingly -it -was -inartistic -it -made -trouble -for -his -line -the -american -missionaries -arrived -while -the -burned -idols -were -still -smoking -they -found -the -nation -without -a -religion -and -they -repaired -the -defect -they -offered -their -own -religion -and -it -was -gladly -received -but -it -was -no -support -to -arbitrary -kingship -and -so -the -kingly -power -began -to -weaken -from -that -day -forty -seven -years -later -when -i -was -in -the -islands -kainehameha -v -was -trying -to -repair -liholiho's -blunder -and -not -succeeding -he -had -set -up -an -established -church -and -made -himself -the -head -of -it -but -it -was -only -a -pinchbeck -thing -an -imitation -a -bauble -an -empty -show -it -had -no -power -no -value -for -a -king -it -could -not -harry -or -burn -or -slay -it -in -no -way -resembled -the -admirable -machine -which -liholiho -destroyed -it -was -an -established -church -without -an -establishment -all -the -people -were -dissenters -long -before -that -the -kingship -had -itself -become -but -a -name -a -show -at -an -early -day -the -missionaries -had -turned -it -into -something -very -much -like -a -republic -and -here -lately -the -business -whites -have -turned -it -into -something -exactly -like -it -in -captain -cook's -time -1778 -the -native -population -of -the -islands -was -estimated -at -400 -000 -in -1836 -at -something -short -of -200 -000 -in -1866 -at -50 -000 -it -is -to -day -per -census -25 -000 -all -intelligent -people -praise -kamehameha -i -and -liholiho -for -conferring -upon -their -people -the -great -boon -of -civilization -i -would -do -it -myself -but -my -intelligence -is -out -of -repair -now -from -over -work -when -i -was -in -the -islands -nearly -a -generation -ago -i -was -acquainted -with -a -young -american -couple -who -had -among -their -belongings -an -attractive -little -son -of -the -age -of -seven -attractive -but -not -practicably -companionable -with -me -because -he -knew -no -english -he -had -played -from -his -birth -with -the -little -kanakas -on -his -father's -plantation -and -had -preferred -their -language -and -would -learn -no -other -the -family -removed -to -america -a -month -after -i -arrived -in -the -islands -and -straightway -the -boy -began -to -lose -his -kanaka -and -pick -up -english -by -the -time -he -was -twelve -be -hadn't -a -word -of -kanaka -left -the -language -had -wholly -departed -from -his -tongue -and -from -his -comprehension -nine -years -later -when -he -was -twenty -one -i -came -upon -the -family -in -one -of -the -lake -towns -of -new -york -and -the -mother -told -me -about -an -adventure -which -her -son -had -been -having -by -trade -he -was -now -a -professional -diver -a -passenger -boat -had -been -caught -in -a -storm -on -the -lake -and -had -gone -down -carrying -her -people -with -her -a -few -days -later -the -young -diver -descended -with -his -armor -on -and -entered -the -berth -saloon -of -the -boat -and -stood -at -the -foot -of -the -companionway -with -his -hand -on -the -rail -peering -through -the -dim -water -presently -something -touched -him -on -the -shoulder -and -he -turned -and -found -a -dead -man -swaying -and -bobbing -about -him -and -seemingly -inspecting -him -inquiringly -he -was -paralyzed -with -fright -his -entry -had -disturbed -the -water -and -now -he -discerned -a -number -of -dim -corpses -making -for -him -and -wagging -their -heads -and -swaying -their -bodies -like -sleepy -people -trying -to -dance -his -senses -forsook -him -and -in -that -condition -he -was -drawn -to -the -surface -he -was -put -to -bed -at -home -and -was -soon -very -ill -during -some -days -he -had -seasons -of -delirium -which -lasted -several -hours -at -a -time -and -while -they -lasted -he -talked -kanaka -incessantly -and -glibly -and -kanaka -only -he -was -still -very -ill -and -he -talked -to -me -in -that -tongue -but -i -did -not -understand -it -of -course -the -doctor -books -tell -us -that -cases -like -this -are -not -uncommon -then -the -doctors -ought -to -study -the -cases -and -find -out -how -to -multiply -them -many -languages -and -things -get -mislaid -in -a -person's -head -and -stay -mislaid -for -lack -of -this -remedy -many -memories -of -my -former -visit -to -the -islands -came -up -in -my -mind -while -we -lay -at -anchor -in -front -of -honolulu -that -night -and -pictures -pictures -pictures -an -enchanting -procession -of -them! -i -was -impatient -for -the -morning -to -come -when -it -came -it -brought -disappointment -of -course -cholera -had -broken -out -in -the -town -and -we -were -not -allowed -to -have -any -communication -with -the -shore -thus -suddenly -did -my -dream -of -twenty -nine -years -go -to -ruin -messages -came -from -friends -but -the -friends -themselves -i -was -not -to -have -any -sight -of -my -lecture -hall -was -ready -but -i -was -not -to -see -that -either -several -of -our -passengers -belonged -in -honolulu -and -these -were -sent -ashore -but -nobody -could -go -ashore -and -return -there -were -people -on -shore -who -were -booked -to -go -with -us -to -australia -but -we -could -not -receive -them -to -do -it -would -cost -us -a -quarantine -term -in -sydney -they -could -have -escaped -the -day -before -by -ship -to -san -francisco -but -the -bars -had -been -put -up -now -and -they -might -have -to -wait -weeks -before -any -ship -could -venture -to -give -them -a -passage -any -whither -and -there -were -hardships -for -others -an -elderly -lady -and -her -son -recreation -seekers -from -massachusetts -had -wandered -westward -further -and -further -from -home -always -intending -to -take -the -return -track -but -always -concluding -to -go -still -a -little -further -and -now -here -they -were -at -anchor -before -honolulu -positively -their -last -westward -bound -indulgence -they -had -made -up -their -minds -to -that -but -where -is -the -use -in -making -up -your -mind -in -this -world -it -is -usually -a -waste -of -time -to -do -it -these -two -would -have -to -stay -with -us -as -far -as -australia -then -they -could -go -on -around -the -world -or -go -back -the -way -they -had -come -the -distance -and -the -accommodations -and -outlay -of -time -would -be -just -the -same -whichever -of -the -two -routes -they -might -elect -to -take -think -of -it -a -projected -excursion -of -five -hundred -miles -gradually -enlarged -without -any -elaborate -degree -of -intention -to -a -possible -twenty -four -thousand -however -they -were -used -to -extensions -by -this -time -and -did -not -mind -this -new -one -much -and -we -had -with -us -a -lawyer -from -victoria -who -had -been -sent -out -by -the -government -on -an -international -matter -and -he -had -brought -his -wife -with -him -and -left -the -children -at -home -with -the -servants -and -now -what -was -to -be -done -go -ashore -amongst -the -cholera -and -take -the -risks -most -certainly -not -they -decided -to -go -on -to -the -fiji -islands -wait -there -a -fortnight -for -the -next -ship -and -then -sail -for -home -they -couldn't -foresee -that -they -wouldn't -see -a -homeward -bound -ship -again -for -six -weeks -and -that -no -word -could -come -to -them -from -the -children -and -no -word -go -from -them -to -the -children -in -all -that -time -it -is -easy -to -make -plans -in -this -world -even -a -cat -can -do -it -and -when -one -is -out -in -those -remote -oceans -it -is -noticeable -that -a -cat's -plans -and -a -man's -are -worth -about -the -same -there -is -much -the -same -shrinkage -in -both -in -the -matter -of -values -there -was -nothing -for -us -to -do -but -sit -about -the -decks -in -the -shade -of -the -awnings -and -look -at -the -distant -shore -we -lay -in -luminous -blue -water -shoreward -the -water -was -green -green -and -brilliant -at -the -shore -itself -it -broke -in -a -long -white -ruffle -and -with -no -crash -no -sound -that -we -could -hear -the -town -was -buried -under -a -mat -of -foliage -that -looked -like -a -cushion -of -moss -the -silky -mountains -were -clothed -in -soft -rich -splendors -of -melting -color -and -some -of -the -cliffs -were -veiled -in -slanting -mists -i -recognized -it -all -it -was -just -as -i -had -seen -it -long -before -with -nothing -of -its -beauty -lost -nothing -of -its -charm -wanting -a -change -had -come -but -that -was -political -and -not -visible -from -the -ship -the -monarchy -of -my -day -was -gone -and -a -republic -was -sitting -in -its -seat -it -was -not -a -material -change -the -old -imitation -pomps -the -fuss -and -feathers -have -departed -and -the -royal -trademark -that -is -about -all -that -one -could -miss -i -suppose -that -imitation -monarchy -was -grotesque -enough -in -my -time -if -it -had -held -on -another -thirty -years -it -would -have -been -a -monarchy -without -subjects -of -the -king's -race -we -had -a -sunset -of -a -very -fine -sort -the -vast -plain -of -the -sea -was -marked -off -in -bands -of -sharply -contrasted -colors -great -stretches -of -dark -blue -others -of -purple -others -of -polished -bronze -the -billowy -mountains -showed -all -sorts -of -dainty -browns -and -greens -blues -and -purples -and -blacks -and -the -rounded -velvety -backs -of -certain -of -them -made -one -want -to -stroke -them -as -one -would -the -sleek -back -of -a -cat -the -long -sloping -promontory -projecting -into -the -sea -at -the -west -turned -dim -and -leaden -and -spectral -then -became -suffused -with -pink -dissolved -itself -in -a -pink -dream -so -to -speak -it -seemed -so -airy -and -unreal -presently -the -cloud -rack -was -flooded -with -fiery -splendors -and -these -were -copied -on -the -surface -of -the -sea -and -it -made -one -drunk -with -delight -to -look -upon -it -from -talks -with -certain -of -our -passengers -whose -home -was -honolulu -and -from -a -sketch -by -mrs -mary -h -krout -i -was -able -to -perceive -what -the -honolulu -of -to -day -is -as -compared -with -the -honolulu -of -my -time -in -my -time -it -was -a -beautiful -little -town -made -up -of -snow -white -wooden -cottages -deliciously -smothered -in -tropical -vines -and -flowers -and -trees -and -shrubs -and -its -coral -roads -and -streets -were -hard -and -smooth -and -as -white -as -the -houses -the -outside -aspects -of -the -place -suggested -the -presence -of -a -modest -and -comfortable -prosperity -a -general -prosperity -perhaps -one -might -strengthen -the -term -and -say -universal -there -were -no -fine -houses -no -fine -furniture -there -were -no -decorations -tallow -candles -furnished -the -light -for -the -bedrooms -a -whale -oil -lamp -furnished -it -for -the -parlor -native -matting -served -as -carpeting -in -the -parlor -one -would -find -two -or -three -lithographs -on -the -walls -portraits -as -a -rule -kamehameha -iv -louis -kossuth -jenny -lind -and -may -be -an -engraving -or -two -rebecca -at -the -well -moses -smiting -the -rock -joseph's -servants -finding -the -cup -in -benjamin's -sack -there -would -be -a -center -table -with -books -of -a -tranquil -sort -on -it -the -whole -duty -of -man -baxter's -saints' -rest -fox's -martyrs -tupper's -proverbial -philosophy -bound -copies -of -the -missionary -herald -and -of -father -damon's -seaman's -friend -a -melodeon -a -music -stand -with -'willie -we -have -missed -you' -'star -of -the -evening' -'roll -on -silver -moon' -'are -we -most -there' -'i -would -not -live -alway' -and -other -songs -of -love -and -sentiment -together -with -an -assortment -of -hymns -a -what -not -with -semi -globular -glass -paperweights -enclosing -miniature -pictures -of -ships -new -england -rural -snowstorms -and -the -like -sea -shells -with -bible -texts -carved -on -them -in -cameo -style -native -curios -whale's -tooth -with -full -rigged -ship -carved -on -it -there -was -nothing -reminiscent -of -foreign -parts -for -nobody -had -been -abroad -trips -were -made -to -san -francisco -but -that -could -not -be -called -going -abroad -comprehensively -speaking -nobody -traveled -but -honolulu -has -grown -wealthy -since -then -and -of -course -wealth -has -introduced -changes -some -of -the -old -simplicities -have -disappeared -here -is -a -modern -house -as -pictured -by -mrs -krout -almost -every -house -is -surrounded -by -extensive -lawns -and -gardens -enclosed -by -walls -of -volcanic -stone -or -by -thick -hedges -of -the -brilliant -hibiscus -the -houses -are -most -tastefully -and -comfortably -furnished -the -floors -are -either -of -hard -wood -covered -with -rugs -or -with -fine -indian -matting -while -there -is -a -preference -as -in -most -warm -countries -for -rattan -or -bamboo -furniture -there -are -the -usual -accessories -of -bric -a -brac -pictures -books -and -curios -from -all -parts -of -the -world -for -these -island -dwellers -are -indefatigable -travelers -nearly -every -house -has -what -is -called -a -lanai -it -is -a -large -apartment -roofed -floored -open -on -three -sides -with -a -door -or -a -draped -archway -opening -into -the -drawing -room -frequently -the -roof -is -formed -by -the -thick -interlacing -boughs -of -the -hou -tree -impervious -to -the -sun -and -even -to -the -rain -except -in -violent -storms -vines -are -trained -about -the -sides -the -stephanotis -or -some -one -of -the -countless -fragrant -and -blossoming -trailers -which -abound -in -the -islands -there -are -also -curtains -of -matting -that -may -be -drawn -to -exclude -the -sun -or -rain -the -floor -is -bare -for -coolness -or -partially -covered -with -rugs -and -the -lanai -is -prettily -furnished -with -comfortable -chairs -sofas -and -tables -loaded -with -flowers -or -wonderful -ferns -in -pots -the -lanai -is -the -favorite -reception -room -and -here -at -any -social -function -the -musical -program -is -given -and -cakes -and -ices -are -served -here -morning -callers -are -received -or -gay -riding -parties -the -ladies -in -pretty -divided -skirts -worn -for -convenience -in -riding -astride -the -universal -mode -adopted -by -europeans -and -americans -as -well -as -by -the -natives -the -comfort -and -luxury -of -such -an -apartment -especially -at -a -seashore -villa -can -hardly -be -imagined -the -soft -breezes -sweep -across -it -heavy -with -the -fragrance -of -jasmine -and -gardenia -and -through -the -swaying -boughs -of -palm -and -mimosa -there -are -glimpses -of -rugged -mountains -their -summits -veiled -in -clouds -of -purple -sea -with -the -white -surf -beating -eternally -against -the -reefs -whiter -still -in -the -yellow -sunlight -or -the -magical -moonlight -of -the -tropics -there -rugs -ices -pictures -lanais -worldly -books -sinful -bric -a -brac -fetched -from -everywhere -and -the -ladies -riding -astride -these -are -changes -indeed -in -my -time -the -native -women -rode -astride -but -the -white -ones -lacked -the -courage -to -adopt -their -wise -custom -in -my -time -ice -was -seldom -seen -in -honolulu -it -sometimes -came -in -sailing -vessels -from -new -england -as -ballast -and -then -if -there -happened -to -be -a -man -of -war -in -port -and -balls -and -suppers -raging -by -consequence -the -ballast -was -worth -six -hundred -dollars -a -ton -as -is -evidenced -by -reputable -tradition -but -the -ice -machine -has -traveled -all -over -the -world -now -and -brought -ice -within -everybody's -reach -in -lapland -and -spitzbergen -no -one -uses -native -ice -in -our -day -except -the -bears -and -the -walruses -the -bicycle -is -not -mentioned -it -was -not -necessary -we -know -that -it -is -there -without -inquiring -it -is -everywhere -but -for -it -people -could -never -have -had -summer -homes -on -the -summit -of -mont -blanc -before -its -day -property -up -there -had -but -a -nominal -value -the -ladies -of -the -hawaiian -capital -learned -too -late -the -right -way -to -occupy -a -horse -too -late -to -get -much -benefit -from -it -the -riding -horse -is -retiring -from -business -everywhere -in -the -world -in -honolulu -a -few -years -from -now -he -will -be -only -a -tradition -we -all -know -about -father -damien -the -french -priest -who -voluntarily -forsook -the -world -and -went -to -the -leper -island -of -molokai -to -labor -among -its -population -of -sorrowful -exiles -who -wait -there -in -slow -consuming -misery -for -death -to -cone -and -release -them -from -their -troubles -and -we -know -that -the -thing -which -he -knew -beforehand -would -happen -did -happen -that -he -became -a -leper -himself -and -died -of -that -horrible -disease -there -was -still -another -case -of -self -sacrifice -it -appears -i -asked -after -billy -ragsdale -interpreter -to -the -parliament -in -my -time -a -half -white -he -was -a -brilliant -young -fellow -and -very -popular -as -an -interpreter -he -would -have -been -hard -to -match -anywhere -he -used -to -stand -up -in -the -parliament -and -turn -the -english -speeches -into -hawaiian -and -the -hawaiian -speeches -into -english -with -a -readiness -and -a -volubility -that -were -astonishing -i -asked -after -him -and -was -told -that -his -prosperous -career -was -cut -short -in -a -sudden -and -unexpected -way -just -as -he -was -about -to -marry -a -beautiful -half -caste -girl -he -discovered -by -some -nearly -invisible -sign -about -his -skin -that -the -poison -of -leprosy -was -in -him -the -secret -was -his -own -and -might -be -kept -concealed -for -years -but -he -would -not -be -treacherous -to -the -girl -that -loved -him -he -would -not -marry -her -to -a -doom -like -his -and -so -he -put -his -affairs -in -order -and -went -around -to -all -his -friends -and -bade -them -good -bye -and -sailed -in -the -leper -ship -to -molokai -there -he -died -the -loathsome -and -lingering -death -that -all -lepers -die -in -this -place -let -me -insert -a -paragraph -or -two -from -the -paradise -of -the -pacific -rev -h -h -gowen -poor -lepers! -it -is -easy -for -those -who -have -no -relatives -or -friends -among -them -to -enforce -the -decree -of -segregation -to -the -letter -but -who -can -write -of -the -terrible -the -heart -breaking -scenes -which -that -enforcement -has -brought -about -a -man -upon -hawaii -was -suddenly -taken -away -after -a -summary -arrest -leaving -behind -him -a -helpless -wife -about -to -give -birth -to -a -babe -the -devoted -wife -with -great -pain -and -risk -came -the -whole -journey -to -honolulu -and -pleaded -until -the -authorities -were -unable -to -resist -her -entreaty -that -she -might -go -and -live -like -a -leper -with -her -leper -husband -a -woman -in -the -prime -of -life -and -activity -is -condemned -as -an -incipient -leper -suddenly -removed -from -her -home -and -her -husband -returns -to -find -his -two -helpless -babes -moaning -for -their -lost -mother -imagine -it! -the -case -of -the -babies -is -hard -but -its -bitterness -is -a -trifle -less -than -a -trifle -less -than -nothing -compared -to -what -the -mother -must -suffer -and -suffer -minute -by -minute -hour -by -hour -day -by -day -month -by -month -year -by -year -without -respite -relief -or -any -abatement -of -her -pain -till -she -dies -one -woman -luka -kaaukau -has -been -living -with -her -leper -husband -in -the -settlement -for -twelve -years -the -man -has -scarcely -a -joint -left -his -limbs -are -only -distorted -ulcerated -stumps -for -four -years -his -wife -has -put -every -particle -of -food -into -his -mouth -he -wanted -his -wife -to -abandon -his -wretched -carcass -long -ago -as -she -herself -was -sound -and -well -but -luka -said -that -she -was -content -to -remain -and -wait -on -the -man -she -loved -till -the -spirit -should -be -freed -from -its -burden -i -myself -have -known -hard -cases -enough -of -a -girl -apparently -in -full -health -decorating -the -church -with -me -at -easter -who -before -christmas -is -taken -away -as -a -confirmed -leper -of -a -mother -hiding -her -child -in -the -mountains -for -years -so -that -not -even -her -dearest -friends -knew -that -she -had -a -child -alive -that -he -might -not -be -taken -away -of -a -respectable -white -man -taken -away -from -his -wife -and -family -and -compelled -to -become -a -dweller -in -the -leper -settlement -where -he -is -counted -dead -even -by -the -insurance -companies -and -one -great -pity -of -it -all -is -that -these -poor -sufferers -are -innocent -the -leprosy -does -not -come -of -sins -which -they -committed -but -of -sins -committed -by -their -ancestors -who -escaped -the -curse -of -leprosy! -mr -gowan -has -made -record -of -a -certain -very -striking -circumstance -would -you -expect -to -find -in -that -awful -leper -settlement -a -custom -worthy -to -be -transplanted -to -your -own -country -they -have -one -such -and -it -is -inexpressibly -touching -and -beautiful -when -death -sets -open -the -prison -door -of -life -there -the -band -salutes -the -freed -soul -with -a -burst -of -glad -music! -chapter -iv -a -dozen -direct -censures -are -easier -to -bear -than -one -morganatic -compliment -pudd'nhead -wilson's -new -calendar -sailed -from -honolulu -from -diary -sept -2 -flocks -of -flying -fish -slim -shapely -graceful -and -intensely -white -with -the -sun -on -them -they -look -like -a -flight -of -silver -fruit -knives -they -are -able -to -fly -a -hundred -yards -sept -3 -in -9 -deg -50' -north -latitude -at -breakfast -approaching -the -equator -on -a -long -slant -those -of -us -who -have -never -seen -the -equator -are -a -good -deal -excited -i -think -i -would -rather -see -it -than -any -other -thing -in -the -world -we -entered -the -doldrums -last -night -variable -winds -bursts -of -rain -intervals -of -calm -with -chopping -seas -and -a -wobbly -and -drunken -motion -to -the -ship -a -condition -of -things -findable -in -other -regions -sometimes -but -present -in -the -doldrums -always -the -globe -girdling -belt -called -the -doldrums -is -20 -degrees -wide -and -the -thread -called -the -equator -lies -along -the -middle -of -it -sept -4 -total -eclipse -of -the -moon -last -night -at -1 -30 -it -began -to -go -off -at -total -or -about -that -it -was -like -a -rich -rosy -cloud -with -a -tumbled -surface -framed -in -the -circle -and -projecting -from -it -a -bulge -of -strawberry -ice -so -to -speak -at -half -eclipse -the -moon -was -like -a -gilded -acorn -in -its -cup -sept -5 -closing -in -on -the -equator -this -noon -a -sailor -explained -to -a -young -girl -that -the -ship's -speed -is -poor -because -we -are -climbing -up -the -bulge -toward -the -center -of -the -globe -but -that -when -we -should -once -get -over -at -the -equator -and -start -down -hill -we -should -fly -when -she -asked -him -the -other -day -what -the -fore -yard -was -he -said -it -was -the -front -yard -the -open -area -in -the -front -end -of -the -ship -that -man -has -a -good -deal -of -learning -stored -up -and -the -girl -is -likely -to -get -it -all -afternoon -crossed -the -equator -in -the -distance -it -looked -like -a -blue -ribbon -stretched -across -the -ocean -several -passengers -kodak'd -it -we -had -no -fool -ceremonies -no -fantastics -no -horse -play -all -that -sort -of -thing -has -gone -out -in -old -times -a -sailor -dressed -as -neptune -used -to -come -in -over -the -bows -with -his -suite -and -lather -up -and -shave -everybody -who -was -crossing -the -equator -for -the -first -time -and -then -cleanse -these -unfortunates -by -swinging -them -from -the -yard -arm -and -ducking -them -three -times -in -the -sea -this -was -considered -funny -nobody -knows -why -no -that -is -not -true -we -do -know -why -such -a -thing -could -never -be -funny -on -land -no -part -of -the -old -time -grotesque -performances -gotten -up -on -shipboard -to -celebrate -the -passage -of -the -line -would -ever -be -funny -on -shore -they -would -seem -dreary -and -less -to -shore -people -but -the -shore -people -would -change -their -minds -about -it -at -sea -on -a -long -voyage -on -such -a -voyage -with -its -eternal -monotonies -people's -intellects -deteriorate -the -owners -of -the -intellects -soon -reach -a -point -where -they -almost -seem -to -prefer -childish -things -to -things -of -a -maturer -degree -one -is -often -surprised -at -the -juvenilities -which -grown -people -indulge -in -at -sea -and -the -interest -they -take -in -them -and -the -consuming -enjoyment -they -get -out -of -them -this -is -on -long -voyages -only -the -mind -gradually -becomes -inert -dull -blunted -it -loses -its -accustomed -interest -in -intellectual -things -nothing -but -horse -play -can -rouse -it -nothing -but -wild -and -foolish -grotesqueries -can -entertain -it -on -short -voyages -it -makes -no -such -exposure -of -itself -it -hasn't -time -to -slump -down -to -this -sorrowful -level -the -short -voyage -passenger -gets -his -chief -physical -exercise -out -of -horse -billiards -shovel -board -it -is -a -good -game -we -play -it -in -this -ship -a -quartermaster -chalks -off -a -diagram -like -this -on -the -deck -the -player -uses -a -cue -that -is -like -a -broom -handle -with -a -quarter -moon -of -wood -fastened -to -the -end -of -it -with -this -he -shoves -wooden -disks -the -size -of -a -saucer -he -gives -the -disk -a -vigorous -shove -and -sends -it -fifteen -or -twenty -feet -along -the -deck -and -lands -it -in -one -of -the -squares -if -he -can -if -it -stays -there -till -the -inning -is -played -out -it -will -count -as -many -points -in -the -game -as -the -figure -in -the -square -it -has -stopped -in -represents -the -adversary -plays -to -knock -that -disk -out -and -leave -his -own -in -its -place -particularly -if -it -rests -upon -the -9 -or -10 -or -some -other -of -the -high -numbers -but -if -it -rests -in -the -10off -he -backs -it -up -lands -his -disk -behind -it -a -foot -or -two -to -make -it -difficult -for -its -owner -to -knock -it -out -of -that -damaging -place -and -improve -his -record -when -the -inning -is -played -out -it -may -be -found -that -each -adversary -has -placed -his -four -disks -where -they -count -it -may -be -found -that -some -of -them -are -touching -chalk -lines -and -not -counting -and -very -often -it -will -be -found -that -there -has -been -a -general -wreckage -and -that -not -a -disk -has -been -left -within -the -diagram -anyway -the -result -is -recorded -whatever -it -is -and -the -game -goes -on -the -game -is -100 -points -and -it -takes -from -twenty -minutes -to -forty -to -play -it -according -to -luck -and -the -condition -of -the -sea -it -is -an -exciting -game -and -the -crowd -of -spectators -furnish -abundance -of -applause -for -fortunate -shots -and -plenty -of -laughter -for -the -other -kind -it -is -a -game -of -skill -but -at -the -same -time -the -uneasy -motion -of -the -ship -is -constantly -interfering -with -skill -this -makes -it -a -chancy -game -and -the -element -of -luck -comes -largely -in -we -had -a -couple -of -grand -tournaments -to -determine -who -should -be -champion -of -the -pacific -they -included -among -the -participants -nearly -all -the -passengers -of -both -sexes -and -the -officers -of -the -ship -and -they -afforded -many -days -of -stupendous -interest -and -excitement -and -murderous -exercise -for -horse -billiards -is -a -physically -violent -game -the -figures -in -the -following -record -of -some -of -the -closing -games -in -the -first -tournament -will -show -better -than -any -description -how -very -chancy -the -game -is -the -losers -here -represented -had -all -been -winners -in -the -previous -games -of -the -series -some -of -them -by -fine -majorities -chase -102 -mrs -d -57 -mortimer -105 -the -surgeon -92 -miss -c -105 -mrs -t -9 -clemens -101 -taylor -92 -taylor -109 -davies -95 -miss -c -108 -mortimer -55 -thomas -102 -roper -76 -clemens -111 -miss -c -89 -coomber -106 -chase -98 -and -so -on -until -but -three -couples -of -winners -were -left -then -i -beat -my -man -young -smith -beat -his -man -and -thomas -beat -his -this -reduced -the -combatants -to -three -smith -and -i -took -the -deck -and -i -led -off -at -the -close -of -the -first -inning -i -was -10 -worse -than -nothing -and -smith -had -scored -7 -the -luck -continued -against -me -when -i -was -57 -smith -was -97 -within -3 -of -out -the -luck -changed -then -he -picked -up -a -10 -off -or -so -and -couldn't -recover -i -beat -him -the -next -game -would -end -tournament -no -1 -mr -thomas -and -i -were -the -contestants -he -won -the -lead -and -went -to -the -bat -so -to -speak -and -there -he -stood -with -the -crotch -of -his -cue -resting -against -his -disk -while -the -ship -rose -slowly -up -sank -slowly -down -rose -again -sank -again -she -never -seemed -to -rise -to -suit -him -exactly -she -started -up -once -more -and -when -she -was -nearly -ready -for -the -turn -he -let -drive -and -landed -his -disk -just -within -the -left -hand -end -of -the -10 -applause -the -umpire -proclaimed -a -good -10 -and -the -game -keeper -set -it -down -i -played -my -disk -grazed -the -edge -of -mr -thomas's -disk -and -went -out -of -the -diagram -no -applause -mr -thomas -played -again -and -landed -his -second -disk -alongside -of -the -first -and -almost -touching -its -right -hand -side -good -10 -great -applause -i -played -and -missed -both -of -them -no -applause -mr -thomas -delivered -his -third -shot -and -landed -his -disk -just -at -the -right -of -the -other -two -good -10 -immense -applause -there -they -lay -side -by -side -the -three -in -a -row -it -did -not -seem -possible -that -anybody -could -miss -them -still -i -did -it -immense -silence -mr -thomas -played -his -last -disk -it -seems -incredible -but -he -actually -landed -that -disk -alongside -of -the -others -and -just -to -the -right -of -them -a -straight -solid -row -of -4 -disks -tumultuous -and -long -continued -applause -then -i -played -my -last -disk -again -it -did -not -seem -possible -that -anybody -could -miss -that -row -a -row -which -would -have -been -14 -inches -long -if -the -disks -had -been -clamped -together -whereas -with -the -spaces -separating -them -they -made -a -longer -row -than -that -but -i -did -it -it -may -be -that -i -was -getting -nervous -i -think -it -unlikely -that -that -innings -has -ever -had -its -parallel -in -the -history -of -horse -billiards -to -place -the -four -disks -side -by -side -in -the -10 -was -an -extraordinary -feat -indeed -it -was -a -kind -of -miracle -to -miss -them -was -another -miracle -it -will -take -a -century -to -produce -another -man -who -can -place -the -four -disks -in -the -10 -and -longer -than -that -to -find -a -man -who -can't -knock -them -out -i -was -ashamed -of -my -performance -at -the -time -but -now -that -i -reflect -upon -it -i -see -that -it -was -rather -fine -and -difficult -mr -thomas -kept -his -luck -and -won -the -game -and -later -the -championship -in -a -minor -tournament -i -won -the -prize -which -was -a -waterbury -watch -i -put -it -in -my -trunk -in -pretoria -south -africa -nine -months -afterward -my -proper -watch -broke -down -and -i -took -the -waterbury -out -wound -it -set -it -by -the -great -clock -on -the -parliament -house -8 -05 -then -went -back -to -my -room -and -went -to -bed -tired -from -a -long -railway -journey -the -parliamentary -clock -had -a -peculiarity -which -i -was -not -aware -of -at -the -time -a -peculiarity -which -exists -in -no -other -clock -and -would -not -exist -in -that -one -if -it -had -been -made -by -a -sane -person -on -the -half -hour -it -strikes -the -succeeding -hour -then -strikes -the -hour -again -at -the -proper -time -i -lay -reading -and -smoking -awhile -then -when -i -could -hold -my -eyes -open -no -longer -and -was -about -to -put -out -the -light -the -great -clock -began -to -boom -and -i -counted -ten -i -reached -for -the -waterbury -to -see -how -it -was -getting -along -it -was -marking -9 -30 -it -seemed -rather -poor -speed -for -a -three -dollar -watch -but -i -supposed -that -the -climate -was -affecting -it -i -shoved -it -half -an -hour -ahead -and -took -to -my -book -and -waited -to -see -what -would -happen -at -10 -the -great -clock -struck -ten -again -i -looked -the -waterbury -was -marking -half -past -10 -this -was -too -much -speed -for -the -money -and -it -troubled -me -i -pushed -the -hands -back -a -half -hour -and -waited -once -more -i -had -to -for -i -was -vexed -and -restless -now -and -my -sleepiness -was -gone -by -and -by -the -great -clock -struck -11 -the -waterbury -was -marking -10 -30 -i -pushed -it -ahead -half -an -hour -with -some -show -of -temper -by -and -by -the -great -clock -struck -11 -again -the -waterbury -showed -up -11 -30 -now -and -i -beat -her -brains -out -against -the -bedstead -i -was -sorry -next -day -when -i -found -out -to -return -to -the -ship -the -average -human -being -is -a -perverse -creature -and -when -he -isn't -that -he -is -a -practical -joker -the -result -to -the -other -person -concerned -is -about -the -same -that -is -he -is -made -to -suffer -the -washing -down -of -the -decks -begins -at -a -very -early -hour -in -all -ships -in -but -few -ships -are -any -measures -taken -to -protect -the -passengers -either -by -waking -or -warning -them -or -by -sending -a -steward -to -close -their -ports -and -so -the -deckwashers -have -their -opportunity -and -they -use -it -they -send -a -bucket -of -water -slashing -along -the -side -of -the -ship -and -into -the -ports -drenching -the -passenger's -clothes -and -often -the -passenger -himself -this -good -old -custom -prevailed -in -this -ship -and -under -unusually -favorable -circumstances -for -in -the -blazing -tropical -regions -a -removable -zinc -thing -like -a -sugarshovel -projects -from -the -port -to -catch -the -wind -and -bring -it -in -this -thing -catches -the -wash -water -and -brings -it -in -too -and -in -flooding -abundance -mrs -l -an -invalid -had -to -sleep -on -the -locker -sofa -under -her -port -and -every -time -she -over -slept -and -thus -failed -to -take -care -of -herself -the -deck -washers -drowned -her -out -and -the -painters -what -a -good -time -they -had! -this -ship -would -be -going -into -dock -for -a -month -in -sydney -for -repairs -but -no -matter -painting -was -going -on -all -the -time -somewhere -or -other -the -ladies' -dresses -were -constantly -getting -ruined -nevertheless -protests -and -supplications -went -for -nothing -sometimes -a -lady -taking -an -afternoon -nap -on -deck -near -a -ventilator -or -some -other -thing -that -didn't -need -painting -would -wake -up -by -and -by -and -find -that -the -humorous -painter -had -been -noiselessly -daubing -that -thing -and -had -splattered -her -white -gown -all -over -with -little -greasy -yellow -spots -the -blame -for -this -untimely -painting -did -not -lie -with -the -ship's -officers -but -with -custom -as -far -back -as -noah's -time -it -became -law -that -ships -must -be -constantly -painted -and -fussed -at -when -at -sea -custom -grew -out -of -the -law -and -at -sea -custom -knows -no -death -this -custom -will -continue -until -the -sea -goes -dry -sept -8 -sunday -we -are -moving -so -nearly -south -that -we -cross -only -about -two -meridians -of -longitude -a -day -this -morning -we -were -in -longitude -178 -west -from -greenwich -and -57 -degrees -west -from -san -francisco -to -morrow -we -shall -be -close -to -the -center -of -the -globe -the -180th -degree -of -west -longitude -and -180th -degree -of -east -longitude -and -then -we -must -drop -out -a -day -lose -a -day -out -of -our -lives -a -day -never -to -be -found -again -we -shall -all -die -one -day -earlier -than -from -the -beginning -of -time -we -were -foreordained -to -die -we -shall -be -a -day -behindhand -all -through -eternity -we -shall -always -be -saying -to -the -other -angels -fine -day -today -and -they -will -be -always -retorting -but -it -isn't -to -day -it's -tomorrow -we -shall -be -in -a -state -of -confusion -all -the -time -and -shall -never -know -what -true -happiness -is -next -day -sure -enough -it -has -happened -yesterday -it -was -september -8 -sunday -to -day -per -the -bulletin -board -at -the -head -of -the -companionway -it -is -september -10 -tuesday -there -is -something -uncanny -about -it -and -uncomfortable -in -fact -nearly -unthinkable -and -wholly -unrealizable -when -one -comes -to -consider -it -while -we -were -crossing -the -180th -meridian -it -was -sunday -in -the -stern -of -the -ship -where -my -family -were -and -tuesday -in -the -bow -where -i -was -they -were -there -eating -the -half -of -a -fresh -apple -on -the -8th -and -i -was -at -the -same -time -eating -the -other -half -of -it -on -the -10th -and -i -could -notice -how -stale -it -was -already -the -family -were -the -same -age -that -they -were -when -i -had -left -them -five -minutes -before -but -i -was -a -day -older -now -than -i -was -then -the -day -they -were -living -in -stretched -behind -them -half -way -round -the -globe -across -the -pacific -ocean -and -america -and -europe -the -day -i -was -living -in -stretched -in -front -of -me -around -the -other -half -to -meet -it -they -were -stupendous -days -for -bulk -and -stretch -apparently -much -larger -days -than -we -had -ever -been -in -before -all -previous -days -had -been -but -shrunk -up -little -things -by -comparison -the -difference -in -temperature -between -the -two -days -was -very -marked -their -day -being -hotter -than -mine -because -it -was -closer -to -the -equator -along -about -the -moment -that -we -were -crossing -the -great -meridian -a -child -was -born -in -the -steerage -and -now -there -is -no -way -to -tell -which -day -it -was -born -on -the -nurse -thinks -it -was -sunday -the -surgeon -thinks -it -was -tuesday -the -child -will -never -know -its -own -birthday -it -will -always -be -choosing -first -one -and -then -the -other -and -will -never -be -able -to -make -up -its -mind -permanently -this -will -breed -vacillation -and -uncertainty -in -its -opinions -about -religion -and -politics -and -business -and -sweethearts -and -everything -and -will -undermine -its -principles -and -rot -them -away -and -make -the -poor -thing -characterless -and -its -success -in -life -impossible -every -one -in -the -ship -says -so -and -this -is -not -all -in -fact -not -the -worst -for -there -is -an -enormously -rich -brewer -in -the -ship -who -said -as -much -as -ten -days -ago -that -if -the -child -was -born -on -his -birthday -he -would -give -it -ten -thousand -dollars -to -start -its -little -life -with -his -birthday -was -monday -the -9th -of -september -if -the -ships -all -moved -in -the -one -direction -westward -i -mean -the -world -would -suffer -a -prodigious -loss -in -the -matter -of -valuable -time -through -the -dumping -overboard -on -the -great -meridian -of -such -multitudes -of -days -by -ships -crews -and -passengers -but -fortunately -the -ships -do -not -all -sail -west -half -of -them -sail -east -so -there -is -no -real -loss -these -latter -pick -up -all -the -discarded -days -and -add -them -to -the -world's -stock -again -and -about -as -good -as -new -too -for -of -course -the -salt -water -preserves -them -chapter -v -noise -proves -nothing -often -a -hen -who -has -merely -laid -an -egg -cackles -as -if -she -had -laid -an -asteroid -pudd'nhead -wilson's -new -calendar -wednesday -sept -11 -in -this -world -we -often -make -mistakes -of -judgment -we -do -not -as -a -rule -get -out -of -them -sound -and -whole -but -sometimes -we -do -at -dinner -yesterday -evening -present -a -mixture -of -scotch -english -american -canadian -and -australasian -folk -a -discussion -broke -out -about -the -pronunciation -of -certain -scottish -words -this -was -private -ground -and -the -non -scotch -nationalities -with -one -exception -discreetly -kept -still -but -i -am -not -discreet -and -i -took -a -hand -i -didn't -know -anything -about -the -subject -but -i -took -a -hand -just -to -have -something -to -do -at -that -moment -the -word -in -dispute -was -the -word -three -one -scotchman -was -claiming -that -the -peasantry -of -scotland -pronounced -it -three -his -adversaries -claimed -that -they -didn't -that -they -pronounced -it -'thraw' -the -solitary -scot -was -having -a -sultry -time -of -it -so -i -thought -i -would -enrich -him -with -my -help -in -my -position -i -was -necessarily -quite -impartial -and -was -equally -as -well -and -as -ill -equipped -to -fight -on -the -one -side -as -on -the -other -so -i -spoke -up -and -said -the -peasantry -pronounced -the -word -three -not -thraw -it -was -an -error -of -judgment -there -was -a -moment -of -astonished -and -ominous -silence -then -weather -ensued -the -storm -rose -and -spread -in -a -surprising -way -and -i -was -snowed -under -in -a -very -few -minutes -it -was -a -bad -defeat -for -me -a -kind -of -waterloo -it -promised -to -remain -so -and -i -wished -i -had -had -better -sense -than -to -enter -upon -such -a -forlorn -enterprise -but -just -then -i -had -a -saving -thought -at -least -a -thought -that -offered -a -chance -while -the -storm -was -still -raging -i -made -up -a -scotch -couplet -and -then -spoke -up -and -said -very -well -don't -say -any -more -i -confess -defeat -i -thought -i -knew -but -i -see -my -mistake -i -was -deceived -by -one -of -your -scotch -poets -a -scotch -poet! -o -come! -name -him -robert -burns -it -is -wonderful -the -power -of -that -name -these -men -looked -doubtful -but -paralyzed -all -the -same -they -were -quite -silent -for -a -moment -then -one -of -them -said -with -the -reverence -in -his -voice -which -is -always -present -in -a -scotchman's -tone -when -he -utters -the -name -does -robbie -burns -say -what -does -he -say -this -is -what -he -says -'there -were -nae -bairns -but -only -three -ane -at -the -breast -twa -at -the -knee -' -it -ended -the -discussion -there -was -no -man -there -profane -enough -disloyal -enough -to -say -any -word -against -a -thing -which -robert -burns -had -settled -i -shall -always -honor -that -great -name -for -the -salvation -it -brought -me -in -this -time -of -my -sore -need -it -is -my -belief -that -nearly -any -invented -quotation -played -with -confidence -stands -a -good -chance -to -deceive -there -are -people -who -think -that -honesty -is -always -the -best -policy -this -is -a -superstition -there -are -times -when -the -appearance -of -it -is -worth -six -of -it -we -are -moving -steadily -southward -getting -further -and -further -down -under -the -projecting -paunch -of -the -globe -yesterday -evening -we -saw -the -big -dipper -and -the -north -star -sink -below -the -horizon -and -disappear -from -our -world -no -not -we -but -they -they -saw -it -somebody -saw -it -and -told -me -about -it -but -it -is -no -matter -i -was -not -caring -for -those -things -i -am -tired -of -them -any -way -i -think -they -are -well -enough -but -one -doesn't -want -them -always -hanging -around -my -interest -was -all -in -the -southern -cross -i -had -never -seen -that -i -had -heard -about -it -all -my -life -and -it -was -but -natural -that -i -should -be -burning -to -see -it -no -other -constellation -makes -so -much -talk -i -had -nothing -against -the -big -dipper -and -naturally -couldn't -have -anything -against -it -since -it -is -a -citizen -of -our -own -sky -and -the -property -of -the -united -states -but -i -did -want -it -to -move -out -of -the -way -and -give -this -foreigner -a -chance -judging -by -the -size -of -the -talk -which -the -southern -cross -had -made -i -supposed -it -would -need -a -sky -all -to -itself -but -that -was -a -mistake -we -saw -the -cross -to -night -and -it -is -not -large -not -large -and -not -strikingly -bright -but -it -was -low -down -toward -the -horizon -and -it -may -improve -when -it -gets -up -higher -in -the -sky -it -is -ingeniously -named -for -it -looks -just -as -a -cross -would -look -if -it -looked -like -something -else -but -that -description -does -not -describe -it -is -too -vague -too -general -too -indefinite -it -does -after -a -fashion -suggest -a -cross -across -that -is -out -of -repair -or -out -of -drawing -not -correctly -shaped -it -is -long -with -a -short -cross -bar -and -the -cross -bar -is -canted -out -of -the -straight -line -it -consists -of -four -large -stars -and -one -little -one -the -little -one -is -out -of -line -and -further -damages -the -shape -it -should -have -been -placed -at -the -intersection -of -the -stem -and -the -cross -bar -if -you -do -not -draw -an -imaginary -line -from -star -to -star -it -does -not -suggest -a -cross -nor -anything -in -particular -one -must -ignore -the -little -star -and -leave -it -out -of -the -combination -it -confuses -everything -if -you -leave -it -out -then -you -can -make -out -of -the -four -stars -a -sort -of -cross -out -of -true -or -a -sort -of -kite -out -of -true -or -a -sort -of -coffin -out -of -true -constellations -have -always -been -troublesome -things -to -name -if -you -give -one -of -them -a -fanciful -name -it -will -always -refuse -to -live -up -to -it -it -will -always -persist -in -not -resembling -the -thing -it -has -been -named -for -ultimately -to -satisfy -the -public -the -fanciful -name -has -to -be -discarded -for -a -common -sense -one -a -manifestly -descriptive -one -the -great -bear -remained -the -great -bear -and -unrecognizable -as -such -for -thousands -of -years -and -people -complained -about -it -all -the -time -and -quite -properly -but -as -soon -as -it -became -the -property -of -the -united -states -congress -changed -it -to -the -big -dipper -and -now -every -body -is -satisfied -and -there -is -no -more -talk -about -riots -i -would -not -change -the -southern -cross -to -the -southern -coffin -i -would -change -it -to -the -southern -kite -for -up -there -in -the -general -emptiness -is -the -proper -home -of -a -kite -but -not -for -coffins -and -crosses -and -dippers -in -a -little -while -now -i -cannot -tell -exactly -how -long -it -will -be -the -globe -will -belong -to -the -english -speaking -race -and -of -course -the -skies -also -then -the -constellations -will -be -re -organized -and -polished -up -and -re -named -the -most -of -them -victoria -i -reckon -but -this -one -will -sail -thereafter -as -the -southern -kite -or -go -out -of -business -several -towns -and -things -here -and -there -have -been -named -for -her -majesty -already -in -these -past -few -days -we -are -plowing -through -a -mighty -milky -way -of -islands -they -are -so -thick -on -the -map -that -one -would -hardly -expect -to -find -room -between -them -for -a -canoe -yet -we -seldom -glimpse -one -once -we -saw -the -dim -bulk -of -a -couple -of -them -far -away -spectral -and -dreamy -things -members -of -the -horne -alofa -and -fortuna -on -the -larger -one -are -two -rival -native -kings -and -they -have -a -time -together -they -are -catholics -so -are -their -people -the -missionaries -there -are -french -priests -from -the -multitudinous -islands -in -these -regions -the -recruits -for -the -queensland -plantations -were -formerly -drawn -are -still -drawn -from -them -i -believe -vessels -fitted -up -like -old -time -slavers -came -here -and -carried -off -the -natives -to -serve -as -laborers -in -the -great -australian -province -in -the -beginning -it -was -plain -simple -man -stealing -as -per -testimony -of -the -missionaries -this -has -been -denied -but -not -disproven -afterward -it -was -forbidden -by -law -to -recruit -a -native -without -his -consent -and -governmental -agents -were -sent -in -all -recruiting -vessels -to -see -that -the -law -was -obeyed -which -they -did -according -to -the -recruiting -people -and -which -they -sometimes -didn't -according -to -the -missionaries -a -man -could -be -lawfully -recruited -for -a -three -years -term -of -service -he -could -volunteer -for -another -term -if -he -so -chose -when -his -time -was -up -he -could -return -to -his -island -and -would -also -have -the -means -to -do -it -for -the -government -required -the -employer -to -put -money -in -its -hands -for -this -purpose -before -the -recruit -was -delivered -to -him -captain -wawn -was -a -recruiting -ship -master -during -many -years -from -his -pleasant -book -one -gets -the -idea -that -the -recruiting -business -was -quite -popular -with -the -islanders -as -a -rule -and -yet -that -did -not -make -the -business -wholly -dull -and -uninteresting -for -one -finds -rather -frequent -little -breaks -in -the -monotony -of -it -like -this -for -instance -the -afternoon -of -our -arrival -at -leper -island -the -schooner -was -lying -almost -becalmed -under -the -lee -of -the -lofty -central -portion -of -the -island -about -three -quarters -of -a -mile -from -the -shore -the -boats -were -in -sight -at -some -distance -the -recruiter -boat -had -run -into -a -small -nook -on -the -rocky -coast -under -a -high -bank -above -which -stood -a -solitary -hut -backed -by -dense -forest -the -government -agent -and -mate -in -the -second -boat -lay -about -400 -yards -to -the -westward -suddenly -we -heard -the -sound -of -firing -followed -by -yells -from -the -natives -on -shore -and -then -we -saw -the -recruiter -boat -push -out -with -a -seemingly -diminished -crew -the -mate's -boat -pulled -quickly -up -took -her -in -tow -and -presently -brought -her -alongside -all -her -own -crew -being -more -or -less -hurt -it -seems -the -natives -had -called -them -into -the -place -on -pretence -of -friendship -a -crowd -gathered -about -the -stern -of -the -boat -and -several -fellows -even -got -into -her -all -of -a -sudden -our -men -were -attacked -with -clubs -and -tomahawks -the -recruiter -escaped -the -first -blows -aimed -at -him -making -play -with -his -fists -until -he -had -an -opportunity -to -draw -his -revolver -'tom -sayers -' -a -mare -man -received -a -tomahawk -blow -on -the -head -which -laid -the -scalp -open -but -did -not -penetrate -his -skull -fortunately -'bobby -towns -' -another -mare -boatman -had -both -his -thumbs -cut -in -warding -off -blows -one -of -them -being -so -nearly -severed -from -the -hand -that -the -doctors -had -to -finish -the -operation -lihu -a -lifu -boy -the -recruiter's -special -attendant -was -cut -and -pricked -in -various -places -but -nowhere -seriously -jack -an -unlucky -tanna -recruit -who -had -been -engaged -to -act -as -boatman -received -an -arrow -through -his -forearm -the -head -of -which -apiece -of -bone -seven -or -eight -inches -long -was -still -in -the -limb -protruding -from -both -sides -when -the -boats -returned -the -recruiter -himself -would -have -got -off -scot -free -had -not -an -arrow -pinned -one -of -his -fingers -to -the -loom -of -the -steering -oar -just -as -they -were -getting -off -the -fight -had -been -short -but -sharp -the -enemy -lost -two -men -both -shot -dead -the -truth -is -captain -wawn -furnishes -such -a -crowd -of -instances -of -fatal -encounters -between -natives -and -french -and -english -recruiting -crews -for -the -french -are -in -the -business -for -the -plantations -of -new -caledonia -that -one -is -almost -persuaded -that -recruiting -is -not -thoroughly -popular -among -the -islanders -else -why -this -bristling -string -of -attacks -and -bloodcurdling -slaughter -the -captain -lays -it -all -to -exeter -hall -influence -but -for -the -meddling -philanthropists -the -native -fathers -and -mothers -would -be -fond -of -seeing -their -children -carted -into -exile -and -now -and -then -the -grave -instead -of -weeping -about -it -and -trying -to -kill -the -kind -recruiters -chapter -vi -he -was -as -shy -as -a -newspaper -is -when -referring -to -its -own -merits -pudd'nhead -wilson's -new -calendar -captain -wawn -is -crystal -clear -on -one -point -he -does -not -approve -of -missionaries -they -obstruct -his -business -they -make -recruiting -as -he -calls -it -slave -catching -as -they -call -it -in -their -frank -way -a -trouble -when -it -ought -to -be -just -a -picnic -and -a -pleasure -excursion -the -missionaries -have -their -opinion -about -the -manner -in -which -the -labor -traffic -is -conducted -and -about -the -recruiter's -evasions -of -the -law -of -the -traffic -and -about -the -traffic -itself -and -it -is -distinctly -uncomplimentary -to -the -traffic -and -to -everything -connected -with -it -including -the -law -for -its -regulation -captain -wawn's -book -is -of -very -recent -date -i -have -by -me -a -pamphlet -of -still -later -date -hot -from -the -press -in -fact -by -rev -wm -gray -a -missionary -and -the -book -and -the -pamphlet -taken -together -make -exceedingly -interesting -reading -to -my -mind -interesting -and -easy -to -understand -except -in -one -detail -which -i -will -mention -presently -it -is -easy -to -understand -why -the -queensland -sugar -planter -should -want -the -kanaka -recruit -he -is -cheap -very -cheap -in -fact -these -are -the -figures -paid -by -the -planter -l20 -to -the -recruiter -for -getting -the -kanaka -or -catching -him -as -the -missionary -phrase -goes -l3 -to -the -queensland -government -for -superintending -the -importation -l5 -deposited -with -the -government -for -the -kanaka's -passage -home -when -his -three -years -are -up -in -case -he -shall -live -that -long -about -l25 -to -the -kanaka -himself -for -three -years' -wages -and -clothing -total -payment -for -the -use -of -a -man -three -years -l53 -or -including -diet -l60 -altogether -a -hundred -dollars -a -year -one -can -understand -why -the -recruiter -is -fond -of -the -business -the -recruit -costs -him -a -few -cheap -presents -given -to -the -recruit's -relatives -not -himself -and -the -recruit -is -worth -l20 -to -the -recruiter -when -delivered -in -queensland -all -this -is -clear -enough -but -the -thing -that -is -not -clear -is -what -there -is -about -it -all -to -persuade -the -recruit -he -is -young -and -brisk -life -at -home -in -his -beautiful -island -is -one -lazy -long -holiday -to -him -or -if -he -wants -to -work -he -can -turn -out -a -couple -of -bags -of -copra -per -week -and -sell -it -for -four -or -five -shillings -a -bag -in -queensland -he -must -get -up -at -dawn -and -work -from -eight -to -twelve -hours -a -day -in -the -canefields -in -a -much -hotter -climate -than -he -is -used -to -and -get -less -than -four -shillings -a -week -for -it -i -cannot -understand -his -willingness -to -go -to -queensland -it -is -a -deep -puzzle -to -me -here -is -the -explanation -from -the -planter's -point -of -view -at -least -i -gather -from -the -missionary's -pamphlet -that -it -is -the -planter's -when -he -comes -from -his -home -he -is -a -savage -pure -and -simple -he -feels -no -shame -at -his -nakedness -and -want -of -adornment -when -he -returns -home -he -does -so -well -dressed -sporting -a -waterbury -watch -collars -cuffs -boots -and -jewelry -he -takes -with -him -one -or -more -boxes -[ -box -is -english -for -trunk -] -well -filled -with -clothing -a -musical -instrument -or -two -and -perfumery -and -other -articles -of -luxury -he -has -learned -to -appreciate -for -just -one -moment -we -have -a -seeming -flash -of -comprehension -of -the -kanaka's -reason -for -exiling -himself -he -goes -away -to -acquire -civilization -yes -he -was -naked -and -not -ashamed -now -he -is -clothed -and -knows -how -to -be -ashamed -he -was -unenlightened -now -he -has -a -waterbury -watch -he -was -unrefined -now -he -has -jewelry -and -something -to -make -him -smell -good -he -was -a -nobody -a -provincial -now -he -has -been -to -far -countries -and -can -show -off -it -all -looks -plausible -for -a -moment -then -the -missionary -takes -hold -of -this -explanation -and -pulls -it -to -pieces -and -dances -on -it -and -damages -it -beyond -recognition -admitting -that -the -foregoing -description -is -the -average -one -the -average -sequel -is -this -the -cuffs -and -collars -if -used -at -all -are -carried -off -by -youngsters -who -fasten -them -round -the -leg -just -below -the -knee -as -ornaments -the -waterbury -broken -and -dirty -finds -its -way -to -the -trader -who -gives -a -trifle -for -it -or -the -inside -is -taken -out -the -wheels -strung -on -a -thread -and -hung -round -the -neck -knives -axes -calico -and -handkerchiefs -are -divided -among -friends -and -there -is -hardly -one -of -these -apiece -the -boxes -the -keys -often -lost -on -the -road -home -can -be -bought -for -2s -6d -they -are -to -be -seen -rotting -outside -in -almost -any -shore -village -on -tanna -i -speak -of -what -i -have -seen -a -returned -kanaka -has -been -furiously -angry -with -me -because -i -would -not -buy -his -trousers -which -he -declared -were -just -my -fit -he -sold -them -afterwards -to -one -of -my -aniwan -teachers -for -9d -worth -of -tobacco -a -pair -of -trousers -that -probably -cost -him -8s -or -10s -in -queensland -a -coat -or -shirt -is -handy -for -cold -weather -the -white -handkerchiefs -the -'senet' -perfumery -the -umbrella -and -perhaps -the -hat -are -kept -the -boots -have -to -take -their -chance -if -they -do -not -happen -to -fit -the -copra -trader -'senet' -on -the -hair -streaks -of -paint -on -the -face -a -dirty -white -handkerchief -round -the -neck -strips -of -turtle -shell -in -the -ears -a -belt -a -sheath -and -knife -and -an -umbrella -constitute -the -rig -of -returned -kanaka -at -home -the -day -after -landing -a -hat -an -umbrella -a -belt -a -neckerchief -otherwise -stark -naked -all -in -a -day -the -hard -earned -civilization -has -melted -away -to -this -and -even -these -perishable -things -must -presently -go -indeed -there -is -but -a -single -detail -of -his -civilization -that -can -be -depended -on -to -stay -by -him -according -to -the -missionary -he -has -learned -to -swear -this -is -art -and -art -is -long -as -the -poet -says -in -all -countries -the -laws -throw -light -upon -the -past -the -queensland -law -for -the -regulation -of -the -labor -traffic -is -a -confession -it -is -a -confession -that -the -evils -charged -by -the -missionaries -upon -the -traffic -had -existed -in -the -past -and -that -they -still -existed -when -the -law -was -made -the -missionaries -make -a -further -charge -that -the -law -is -evaded -by -the -recruiters -and -that -the -government -agent -sometimes -helps -them -to -do -it -regulation -31 -reveals -two -things -that -sometimes -a -young -fool -of -a -recruit -gets -his -senses -back -after -being -persuaded -to -sign -away -his -liberty -for -three -years -and -dearly -wants -to -get -out -of -the -engagement -and -stay -at -home -with -his -own -people -and -that -threats -intimidation -and -force -are -used -to -keep -him -on -board -the -recruiting -ship -and -to -hold -him -to -his -contract -regulation -31 -forbids -these -coercions -the -law -requires -that -he -shall -be -allowed -to -go -free -and -another -clause -of -it -requires -the -recruiter -to -set -him -ashore -per -boat -because -of -the -prevalence -of -sharks -testimony -from -rev -mr -gray -there -are -'wrinkles' -for -taking -the -penitent -kanaka -my -first -experience -of -the -traffic -was -a -case -of -this -kind -in -1884 -a -vessel -anchored -just -out -of -sight -of -our -station -word -was -brought -to -me -that -some -boys -were -stolen -and -the -relatives -wished -me -to -go -and -get -them -back -the -facts -were -as -i -found -that -six -boys -had -recruited -had -rushed -into -the -boat -the -government -agent -informed -me -they -had -all -'signed' -and -said -the -government -agent -'on -board -they -shall -remain -' -i -was -assured -that -the -six -boys -were -of -age -and -willing -to -go -yet -on -getting -ready -to -leave -the -ship -i -found -four -of -the -lads -ready -to -come -ashore -in -the -boat! -this -i -forbade -one -of -them -jumped -into -the -water -and -persisted -in -coming -ashore -in -my -boat -when -appealed -to -the -government -agent -suggested -that -we -go -and -leave -him -to -be -picked -up -by -the -ship's -boat -a -quarter -mile -distant -at -the -time! -the -law -and -the -missionaries -feel -for -the -repentant -recruit -and -properly -one -may -be -permitted -to -think -for -he -is -only -a -youth -and -ignorant -and -persuadable -to -his -hurt -but -sympathy -for -him -is -not -kept -in -stock -by -the -recruiter -rev -mr -gray -says -a -captain -many -years -in -the -traffic -explained -to -me -how -a -penitent -could -betaken -'when -a -boy -jumps -overboard -we -just -take -a -boat -and -pull -ahead -of -him -then -lie -between -him -and -the -shore -if -he -has -not -tired -himself -swimming -and -passes -the -boat -keep -on -heading -him -in -this -way -the -dodge -rarely -fails -the -boy -generally -tires -of -swimming -gets -into -the -boat -of -his -own -accord -and -goes -quietly -on -board -yes -exhaustion -is -likely -to -make -a -boy -quiet -if -the -distressed -boy -had -been -the -speaker's -son -and -the -captors -savages -the -speaker -would -have -been -surprised -to -see -how -differently -the -thing -looked -from -the -new -point -of -view -however -it -is -not -our -custom -to -put -ourselves -in -the -other -person's -place -somehow -there -is -something -pathetic -about -that -disappointed -young -savage's -resignation -i -must -explain -here -that -in -the -traffic -dialect -boy -does -not -always -mean -boy -it -means -a -youth -above -sixteen -years -of -age -that -is -by -queensland -law -the -age -of -consent -though -it -is -held -that -recruiters -allow -themselves -some -latitude -in -guessing -at -ages -captain -wawn -of -the -free -spirit -chafes -under -the -annoyance -of -cast -iron -regulations -they -and -the -missionaries -have -poisoned -his -life -he -grieves -for -the -good -old -days -vanished -to -come -no -more -see -him -weep -hear -him -cuss -between -the -lines! -for -a -long -time -we -were -allowed -to -apprehend -and -detain -all -deserters -who -had -signed -the -agreement -on -board -ship -but -the -'cast -iron' -regulations -of -the -act -of -1884 -put -a -stop -to -that -allowing -the -kanaka -to -sign -the -agreement -for -three -years' -service -travel -about -in -the -ship -in -receipt -of -the -regular -rations -cadge -all -he -could -and -leave -when -he -thought -fit -so -long -as -he -did -not -extend -his -pleasure -trip -to -queensland -rev -mr -gray -calls -this -same -restrictive -cast -iron -law -a -farce -there -is -as -much -cruelty -and -injustice -done -to -natives -by -acts -that -are -legal -as -by -deeds -unlawful -the -regulations -that -exist -are -unjust -and -inadequate -unjust -and -inadequate -they -must -ever -be -he -furnishes -his -reasons -for -his -position -but -they -are -too -long -for -reproduction -here -however -if -the -most -a -kanaka -advantages -himself -by -a -three -years -course -in -civilization -in -queensland -is -a -necklace -and -an -umbrella -and -a -showy -imperfection -in -the -art -of -swearing -it -must -be -that -all -the -profit -of -the -traffic -goes -to -the -white -man -this -could -be -twisted -into -a -plausible -argument -that -the -traffic -ought -to -be -squarely -abolished -however -there -is -reason -for -hope -that -that -can -be -left -alone -to -achieve -itself -it -is -claimed -that -the -traffic -will -depopulate -its -sources -of -supply -within -the -next -twenty -or -thirty -years -queensland -is -a -very -healthy -place -for -white -people -death -rate -12 -in -1 -000 -of -the -population -but -the -kanaka -death -rate -is -away -above -that -the -vital -statistics -for -1893 -place -it -at -52 -for -1894 -mackay -district -68 -the -first -six -months -of -the -kanaka's -exile -are -peculiarly -perilous -for -him -because -of -the -rigors -of -the -new -climate -the -death -rate -among -the -new -men -has -reached -as -high -as -180 -in -the -1 -000 -in -the -kanaka's -native -home -his -death -rate -is -12 -in -time -of -peace -and -15 -in -time -of -war -thus -exile -to -queensland -with -the -opportunity -to -acquire -civilization -an -umbrella -and -a -pretty -poor -quality -of -profanity -is -twelve -times -as -deadly -for -him -as -war -common -christian -charity -common -humanity -does -seem -to -require -not -only -that -these -people -be -returned -to -their -homes -but -that -war -pestilence -and -famine -be -introduced -among -them -for -their -preservation -concerning -these -pacific -isles -and -their -peoples -an -eloquent -prophet -spoke -long -years -ago -five -and -fifty -years -ago -in -fact -he -spoke -a -little -too -early -prophecy -is -a -good -line -of -business -but -it -is -full -of -risks -this -prophet -was -the -right -rev -m -russell -ll -d -d -c -l -of -edinburgh -is -the -tide -of -civilization -to -roll -only -to -the -foot -of -the -rocky -mountains -and -is -the -sun -of -knowledge -to -set -at -last -in -the -waves -of -the -pacific -no -the -mighty -day -of -four -thousand -years -is -drawing -to -its -close -the -sun -of -humanity -has -performed -its -destined -course -but -long -ere -its -setting -rays -are -extinguished -in -the -west -its -ascending -beams -have -glittered -on -the -isles -of -the -eastern -seas -and -now -we -see -the -race -of -japhet -setting -forth -to -people -the -isles -and -the -seeds -of -another -europe -and -a -second -england -sown -in -the -regions -of -the -sun -but -mark -the -words -of -the -prophecy -'he -shall -dwell -in -the -tents -of -shem -and -canaan -shall -be -his -servant -' -it -is -not -said -canaan -shall -be -his -slave -to -the -anglo -saxon -race -is -given -the -scepter -of -the -globe -but -there -is -not -given -either -the -lash -of -the -slave -driver -or -the -rack -of -the -executioner -the -east -will -not -be -stained -with -the -same -atrocities -as -the -west -the -frightful -gangrene -of -an -enthralled -race -is -not -to -mar -the -destinies -of -the -family -of -japhet -in -the -oriental -world -humanizing -not -destroying -as -they -advance -uniting -with -not -enslaving -the -inhabitants -with -whom -they -dwell -the -british -race -may -etc -etc -and -he -closes -his -vision -with -an -invocation -from -thomson -come -bright -improvement! -on -the -car -of -time -and -rule -the -spacious -world -from -clime -to -clime -very -well -bright -improvement -has -arrived -you -see -with -her -civilization -and -her -waterbury -and -her -umbrella -and -her -third -quality -profanity -and -her -humanizing -not -destroying -machinery -and -her -hundred -and -eighty -death -rate -and -everything -is -going -along -just -as -handsome! -but -the -prophet -that -speaks -last -has -an -advantage -over -the -pioneer -in -the -business -rev -mr -gray -says -what -i -am -concerned -about -is -that -we -as -a -christian -nation -should -wipe -out -these -races -to -enrich -ourselves -and -he -closes -his -pamphlet -with -a -grim -indictment -which -is -as -eloquent -in -its -flowerless -straightforward -english -as -is -the -hand -painted -rhapsody -of -the -early -prophet -my -indictment -of -the -queensland -kanaka -labor -traffic -is -this -1 -it -generally -demoralizes -and -always -impoverishes -the -kanaka -deprives -him -of -his -citizenship -and -depopulates -the -islands -fitted -to -his -home -2 -it -is -felt -to -lower -the -dignity -of -the -white -agricultural -laborer -in -queensland -and -beyond -a -doubt -it -lowers -his -wages -there -3 -the -whole -system -is -fraught -with -danger -to -australia -and -the -islands -on -the -score -of -health -4 -on -social -and -political -grounds -the -continuance -of -the -queensland -kanaka -labor -traffic -must -be -a -barrier -to -the -true -federation -of -the -australian -colonies -5 -the -regulations -under -which -the -traffic -exists -in -queensland -are -inadequate -to -prevent -abuses -and -in -the -nature -of -things -they -must -remain -so -6 -the -whole -system -is -contrary -to -the -spirit -and -doctrine -of -the -gospel -of -jesus -christ -the -gospel -requires -us -to -help -the -weak -but -the -kanaka -is -fleeced -and -trodden -down -7 -the -bed -rock -of -this -traffic -is -that -the -life -and -liberty -of -a -black -man -are -of -less -value -than -those -of -a -white -man -and -a -traffic -that -has -grown -out -of -'slave -hunting' -will -certainly -remain -to -the -end -not -unlike -its -origin -chapter -vii -truth -is -the -most -valuable -thing -we -have -let -us -economize -it -pudd'nhead -wilson's -new -calendar -from -diary -for -a -day -or -two -we -have -been -plowing -among -an -invisible -vast -wilderness -of -islands -catching -now -and -then -a -shadowy -glimpse -of -a -member -of -it -there -does -seem -to -be -a -prodigious -lot -of -islands -this -year -the -map -of -this -region -is -freckled -and -fly -specked -all -over -with -them -their -number -would -seem -to -be -uncountable -we -are -moving -among -the -fijis -now -224 -islands -and -islets -in -the -group -in -front -of -us -to -the -west -the -wilderness -stretches -toward -australia -then -curves -upward -to -new -guinea -and -still -up -and -up -to -japan -behind -us -to -the -east -the -wilderness -stretches -sixty -degrees -across -the -wastes -of -the -pacific -south -of -us -is -new -zealand -somewhere -or -other -among -these -myriads -samoa -is -concealed -and -not -discoverable -on -the -map -still -if -you -wish -to -go -there -you -will -have -no -trouble -about -finding -it -if -you -follow -the -directions -given -by -robert -louis -stevenson -to -dr -conan -doyle -and -to -mr -j -m -barrie -you -go -to -america -cross -the -continent -to -san -francisco -and -then -it's -the -second -turning -to -the -left -to -get -the -full -flavor -of -the -joke -one -must -take -a -glance -at -the -map -wednesday -september -11 -yesterday -we -passed -close -to -an -island -or -so -and -recognized -the -published -fiji -characteristics -a -broad -belt -of -clean -white -coral -sand -around -the -island -back -of -it -a -graceful -fringe -of -leaning -palms -with -native -huts -nestling -cosily -among -the -shrubbery -at -their -bases -back -of -these -a -stretch -of -level -land -clothed -in -tropic -vegetation -back -of -that -rugged -and -picturesque -mountains -a -detail -of -the -immediate -foreground -a -mouldering -ship -perched -high -up -on -a -reef -bench -this -completes -the -composition -and -makes -the -picture -artistically -perfect -in -the -afternoon -we -sighted -suva -the -capital -of -the -group -and -threaded -our -way -into -the -secluded -little -harbor -a -placid -basin -of -brilliant -blue -and -green -water -tucked -snugly -in -among -the -sheltering -hills -a -few -ships -rode -at -anchor -in -it -one -of -them -a -sailing -vessel -flying -the -american -flag -and -they -said -she -came -from -duluth! -there's -a -journey! -duluth -is -several -thousand -miles -from -the -sea -and -yet -she -is -entitled -to -the -proud -name -of -mistress -of -the -commercial -marine -of -the -united -states -of -america -there -is -only -one -free -independent -unsubsidized -american -ship -sailing -the -foreign -seas -and -duluth -owns -it -all -by -itself -that -ship -is -the -american -fleet -all -by -itself -it -causes -the -american -name -and -power -to -be -respected -in -the -far -regions -of -the -globe -all -by -itself -it -certifies -to -the -world -that -the -most -populous -civilized -nation -in -the -earth -has -a -just -pride -in -her -stupendous -stretch -of -sea -front -and -is -determined -to -assert -and -maintain -her -rightful -place -as -one -of -the -great -maritime -powers -of -the -planet -all -by -itself -it -is -making -foreign -eyes -familiar -with -a -flag -which -they -have -not -seen -before -for -forty -years -outside -of -the -museum -for -what -duluth -has -done -in -building -equipping -and -maintaining -at -her -sole -expense -the -american -foreign -commercial -fleet -and -in -thus -rescuing -the -american -name -from -shame -and -lifting -it -high -for -the -homage -of -the -nations -we -owe -her -a -debt -of -gratitude -which -our -hearts -shall -confess -with -quickened -beats -whenever -her -name -is -named -henceforth -many -national -toasts -will -die -in -the -lapse -of -time -but -while -the -flag -flies -and -the -republic -survives -they -who -live -under -their -shelter -will -still -drink -this -one -standing -and -uncovered -health -and -prosperity -to -thee -o -duluth -american -queen -of -the -alien -seas! -row -boats -began -to -flock -from -the -shore -their -crews -were -the -first -natives -we -had -seen -these -men -carried -no -overplus -of -clothing -and -this -was -wise -for -the -weather -was -hot -handsome -great -dusky -men -they -were -muscular -clean -limbed -and -with -faces -full -of -character -and -intelligence -it -would -be -hard -to -find -their -superiors -anywhere -among -the -dark -races -i -should -think -everybody -went -ashore -to -look -around -and -spy -out -the -land -and -have -that -luxury -of -luxuries -to -sea -voyagers -a -land -dinner -and -there -we -saw -more -natives -wrinkled -old -women -with -their -flat -mammals -flung -over -their -shoulders -or -hanging -down -in -front -like -the -cold -weather -drip -from -the -molasses -faucet -plump -and -smily -young -girls -blithe -and -content -easy -and -graceful -a -pleasure -to -look -at -young -matrons -tall -straight -comely -nobly -built -sweeping -by -with -chin -up -and -a -gait -incomparable -for -unconscious -stateliness -and -dignity -majestic -young -men -athletes -for -build -and -muscle -clothed -in -a -loose -arrangement -of -dazzling -white -with -bronze -breast -and -bronze -legs -naked -and -the -head -a -cannon -swab -of -solid -hair -combed -straight -out -from -the -skull -and -dyed -a -rich -brick -red -only -sixty -years -ago -they -were -sunk -in -darkness -now -they -have -the -bicycle -we -strolled -about -the -streets -of -the -white -folks' -little -town -and -around -over -the -hills -by -paths -and -roads -among -european -dwellings -and -gardens -and -plantations -and -past -clumps -of -hibiscus -that -made -a -body -blink -the -great -blossoms -were -so -intensely -red -and -by -and -by -we -stopped -to -ask -an -elderly -english -colonist -a -question -or -two -and -to -sympathize -with -him -concerning -the -torrid -weather -but -he -was -surprised -and -said -this -this -is -not -hot -you -ought -to -be -here -in -the -summer -time -once -we -supposed -that -this -was -summer -it -has -the -ear -marks -of -it -you -could -take -it -to -almost -any -country -and -deceive -people -with -it -but -if -it -isn't -summer -what -does -it -lack -it -lacks -half -a -year -this -is -mid -winter -i -had -been -suffering -from -colds -for -several -months -and -a -sudden -change -of -season -like -this -could -hardly -fail -to -do -me -hurt -it -brought -on -another -cold -it -is -odd -these -sudden -jumps -from -season -to -season -a -fortnight -ago -we -left -america -in -mid -summer -now -it -is -midwinter -about -a -week -hence -we -shall -arrive -in -australia -in -the -spring -after -dinner -i -found -in -the -billiard -room -a -resident -whom -i -had -known -somewhere -else -in -the -world -and -presently -made -some -new -friends -and -drove -with -them -out -into -the -country -to -visit -his -excellency -the -head -of -the -state -who -was -occupying -his -country -residence -to -escape -the -rigors -of -the -winter -weather -i -suppose -for -it -was -on -breezy -high -ground -and -much -more -comfortable -than -the -lower -regions -where -the -town -is -and -where -the -winter -has -full -swing -and -often -sets -a -person's -hair -afire -when -he -takes -off -his -hat -to -bow -there -is -a -noble -and -beautiful -view -of -ocean -and -islands -and -castellated -peaks -from -the -governor's -high -placed -house -and -its -immediate -surroundings -lie -drowsing -in -that -dreamy -repose -and -serenity -which -are -the -charm -of -life -in -the -pacific -islands -one -of -the -new -friends -who -went -out -there -with -me -was -a -large -man -and -i -had -been -admiring -his -size -all -the -way -i -was -still -admiring -it -as -he -stood -by -the -governor -on -the -veranda -talking -then -the -fijian -butler -stepped -out -there -to -announce -tea -and -dwarfed -him -maybe -he -did -not -quite -dwarf -him -but -at -any -rate -the -contrast -was -quite -striking -perhaps -that -dark -giant -was -a -king -in -a -condition -of -political -suspension -i -think -that -in -the -talk -there -on -the -veranda -it -was -said -that -in -fiji -as -in -the -sandwich -islands -native -kings -and -chiefs -are -of -much -grander -size -and -build -than -the -commoners -this -man -was -clothed -in -flowing -white -vestments -and -they -were -just -the -thing -for -him -they -comported -well -with -his -great -stature -and -his -kingly -port -and -dignity -european -clothes -would -have -degraded -him -and -made -him -commonplace -i -know -that -because -they -do -that -with -everybody -that -wears -them -it -was -said -that -the -old -time -devotion -to -chiefs -and -reverence -for -their -persons -still -survive -in -the -native -commoner -and -in -great -force -the -educated -young -gentleman -who -is -chief -of -the -tribe -that -live -in -the -region -about -the -capital -dresses -in -the -fashion -of -high -class -european -gentlemen -but -even -his -clothes -cannot -damn -him -in -the -reverence -of -his -people -their -pride -in -his -lofty -rank -and -ancient -lineage -lives -on -in -spite -of -his -lost -authority -and -the -evil -magic -of -his -tailor -he -has -no -need -to -defile -himself -with -work -or -trouble -his -heart -with -the -sordid -cares -of -life -the -tribe -will -see -to -it -that -he -shall -not -want -and -that -he -shall -hold -up -his -head -and -live -like -a -gentleman -i -had -a -glimpse -of -him -down -in -the -town -perhaps -he -is -a -descendant -of -the -last -king -the -king -with -the -difficult -name -whose -memory -is -preserved -by -a -notable -monument -of -cut -stone -which -one -sees -in -the -enclosure -in -the -middle -of -the -town -thakombau -i -remember -now -that -is -the -name -it -is -easier -to -preserve -it -on -a -granite -block -than -in -your -head -fiji -was -ceded -to -england -by -this -king -in -1858 -one -of -the -gentlemen -present -at -the -governor's -quoted -a -remark -made -by -the -king -at -the -time -of -the -session -a -neat -retort -and -with -a -touch -of -pathos -in -it -too -the -english -commissioner -had -offered -a -crumb -of -comfort -to -thakombau -by -saying -that -the -transfer -of -the -kingdom -to -great -britain -was -merely -a -sort -of -hermit -crab -formality -you -know -yes -said -poor -thakombau -but -with -this -difference -the -crab -moves -into -an -unoccupied -shell -but -mine -isn't -however -as -far -as -i -can -make -out -from -the -books -the -king -was -between -the -devil -and -the -deep -sea -at -the -time -and -hadn't -much -choice -he -owed -the -united -states -a -large -debt -a -debt -which -he -could -pay -if -allowed -time -but -time -was -denied -him -he -must -pay -up -right -away -or -the -warships -would -be -upon -him -to -protect -his -people -from -this -disaster -he -ceded -his -country -to -britain -with -a -clause -in -the -contract -providing -for -the -ultimate -payment -of -the -american -debt -in -old -times -the -fijians -were -fierce -fighters -they -were -very -religious -and -worshiped -idols -the -big -chiefs -were -proud -and -haughty -and -they -were -men -of -great -style -in -many -ways -all -chiefs -had -several -wives -the -biggest -chiefs -sometimes -had -as -many -as -fifty -when -a -chief -was -dead -and -ready -for -burial -four -or -five -of -his -wives -were -strangled -and -put -into -the -grave -with -him -in -1804 -twenty -seven -british -convicts -escaped -from -australia -to -fiji -and -brought -guns -and -ammunition -with -them -consider -what -a -power -they -were -armed -like -that -and -what -an -opportunity -they -had -if -they -had -been -energetic -men -and -sober -and -had -had -brains -and -known -how -to -use -them -they -could -have -achieved -the -sovereignty -of -the -archipelago -twenty -seven -kings -and -each -with -eight -or -nine -islands -under -his -scepter -but -nothing -came -of -this -chance -they -lived -worthless -lives -of -sin -and -luxury -and -died -without -honor -in -most -cases -by -violence -only -one -of -them -had -any -ambition -he -was -an -irishman -named -connor -he -tried -to -raise -a -family -of -fifty -children -and -scored -forty -eight -he -died -lamenting -his -failure -it -was -a -foolish -sort -of -avarice -many -a -father -would -have -been -rich -enough -with -forty -it -is -a -fine -race -the -fijians -with -brains -in -their -heads -and -an -inquiring -turn -of -mind -it -appears -that -their -savage -ancestors -had -a -doctrine -of -immortality -in -their -scheme -of -religion -with -limitations -that -is -to -say -their -dead -friend -would -go -to -a -happy -hereafter -if -he -could -be -accumulated -but -not -otherwise -they -drew -the -line -they -thought -that -the -missionary's -doctrine -was -too -sweeping -too -comprehensive -they -called -his -attention -to -certain -facts -for -instance -many -of -their -friends -had -been -devoured -by -sharks -the -sharks -in -their -turn -were -caught -and -eaten -by -other -men -later -these -men -were -captured -in -war -and -eaten -by -the -enemy -the -original -persons -had -entered -into -the -composition -of -the -sharks -next -they -and -the -sharks -had -become -part -of -the -flesh -and -blood -and -bone -of -the -cannibals -how -then -could -the -particles -of -the -original -men -be -searched -out -from -the -final -conglomerate -and -put -together -again -the -inquirers -were -full -of -doubts -and -considered -that -the -missionary -had -not -examined -the -matter -with -the -gravity -and -attention -which -so -serious -a -thing -deserved -the -missionary -taught -these -exacting -savages -many -valuable -things -and -got -from -them -one -a -very -dainty -and -poetical -idea -those -wild -and -ignorant -poor -children -of -nature -believed -that -the -flowers -after -they -perish -rise -on -the -winds -and -float -away -to -the -fair -fields -of -heaven -and -flourish -there -forever -in -immortal -beauty! -chapter -viii -it -could -probably -be -shown -by -facts -and -figures -that -there -is -no -distinctly -native -american -criminal -class -except -congress -pudd'nhead -wilson's -new -calendar -when -one -glances -at -the -map -the -members -of -the -stupendous -island -wilderness -of -the -pacific -seem -to -crowd -upon -each -other -but -no -there -is -no -crowding -even -in -the -center -of -a -group -and -between -groups -there -are -lonely -wide -deserts -of -sea -not -everything -is -known -about -the -islands -their -peoples -and -their -languages -a -startling -reminder -of -this -is -furnished -by -the -fact -that -in -fiji -twenty -years -ago -were -living -two -strange -and -solitary -beings -who -came -from -an -unknown -country -and -spoke -an -unknown -language -they -were -picked -up -by -a -passing -vessel -many -hundreds -of -miles -from -any -known -land -floating -in -the -same -tiny -canoe -in -which -they -had -been -blown -out -to -sea -when -found -they -were -but -skin -and -bone -no -one -could -understand -what -they -said -and -they -have -never -named -their -country -or -if -they -have -the -name -does -not -correspond -with -that -of -any -island -on -any -chart -they -are -now -fat -and -sleek -and -as -happy -as -the -day -is -long -in -the -ship's -log -there -is -an -entry -of -the -latitude -and -longitude -in -which -they -were -found -and -this -is -probably -all -the -clue -they -will -ever -have -to -their -lost -homes -[forbes's -two -years -in -fiji -] -what -a -strange -and -romantic -episode -it -is -and -how -one -is -tortured -with -curiosity -to -know -whence -those -mysterious -creatures -came -those -men -without -a -country -errant -waifs -who -cannot -name -their -lost -home -wandering -children -of -nowhere -indeed -the -island -wilderness -is -the -very -home -of -romance -and -dreams -and -mystery -the -loneliness -the -solemnity -the -beauty -and -the -deep -repose -of -this -wilderness -have -a -charm -which -is -all -their -own -for -the -bruised -spirit -of -men -who -have -fought -and -failed -in -the -struggle -for -life -in -the -great -world -and -for -men -who -have -been -hunted -out -of -the -great -world -for -crime -and -for -other -men -who -love -an -easy -and -indolent -existence -and -for -others -who -love -a -roving -free -life -and -stir -and -change -and -adventure -and -for -yet -others -who -love -an -easy -and -comfortable -career -of -trading -and -money -getting -mixed -with -plenty -of -loose -matrimony -by -purchase -divorce -without -trial -or -expense -and -limitless -spreeing -thrown -in -to -make -life -ideally -perfect -we -sailed -again -refreshed -the -most -cultivated -person -in -the -ship -was -a -young -english -man -whose -home -was -in -new -zealand -he -was -a -naturalist -his -learning -in -his -specialty -was -deep -and -thorough -his -interest -in -his -subject -amounted -to -a -passion -he -had -an -easy -gift -of -speech -and -so -when -he -talked -about -animals -it -was -a -pleasure -to -listen -to -him -and -profitable -too -though -he -was -sometimes -difficult -to -understand -because -now -and -then -he -used -scientific -technicalities -which -were -above -the -reach -of -some -of -us -they -were -pretty -sure -to -be -above -my -reach -but -as -he -was -quite -willing -to -explain -them -i -always -made -it -a -point -to -get -him -to -do -it -i -had -a -fair -knowledge -of -his -subject -layman's -knowledge -to -begin -with -but -it -was -his -teachings -which -crystalized -it -into -scientific -form -and -clarity -in -a -word -gave -it -value -his -special -interest -was -the -fauna -of -australasia -and -his -knowledge -of -the -matter -was -as -exhaustive -as -it -was -accurate -i -already -knew -a -good -deal -about -the -rabbits -in -australasia -and -their -marvelous -fecundity -but -in -my -talks -with -him -i -found -that -my -estimate -of -the -great -hindrance -and -obstruction -inflicted -by -the -rabbit -pest -upon -traffic -and -travel -was -far -short -of -the -facts -he -told -me -that -the -first -pair -of -rabbits -imported -into -australasia -bred -so -wonderfully -that -within -six -months -rabbits -were -so -thick -in -the -land -that -people -had -to -dig -trenches -through -them -to -get -from -town -to -town -he -told -me -a -great -deal -about -worms -and -the -kangaroo -and -other -coleoptera -and -said -he -knew -the -history -and -ways -of -all -such -pachydermata -he -said -the -kangaroo -had -pockets -and -carried -its -young -in -them -when -it -couldn't -get -apples -and -he -said -that -the -emu -was -as -big -as -an -ostrich -and -looked -like -one -and -had -an -amorphous -appetite -and -would -eat -bricks -also -that -the -dingo -was -not -a -dingo -at -all -but -just -a -wild -dog -and -that -the -only -difference -between -a -dingo -and -a -dodo -was -that -neither -of -them -barked -otherwise -they -were -just -the -same -he -said -that -the -only -game -bird -in -australia -was -the -wombat -and -the -only -song -bird -the -larrikin -and -that -both -were -protected -by -government -the -most -beautiful -of -the -native -birds -was -the -bird -of -paradise -next -came -the -two -kinds -of -lyres -not -spelt -the -same -he -said -the -one -kind -was -dying -out -the -other -thickening -up -he -explained -that -the -sundowner -was -not -a -bird -it -was -a -man -sundowner -was -merely -the -australian -equivalent -of -our -word -tramp -he -is -a -loafer -a -hard -drinker -and -a -sponge -he -tramps -across -the -country -in -the -sheep -shearing -season -pretending -to -look -for -work -but -he -always -times -himself -to -arrive -at -a -sheep -run -just -at -sundown -when -the -day's -labor -ends -all -he -wants -is -whisky -and -supper -and -bed -and -breakfast -he -gets -them -and -then -disappears -the -naturalist -spoke -of -the -bell -bird -the -creature -that -at -short -intervals -all -day -rings -out -its -mellow -and -exquisite -peal -from -the -deeps -of -the -forest -it -is -the -favorite -and -best -friend -of -the -weary -and -thirsty -sundowner -for -he -knows -that -wherever -the -bell -bird -is -there -is -water -and -he -goes -somewhere -else -the -naturalist -said -that -the -oddest -bird -in -australasia -was -the -laughing -jackass -and -the -biggest -the -now -extinct -great -moa -the -moa -stood -thirteen -feet -high -and -could -step -over -an -ordinary -man's -head -or -kick -his -hat -off -and -his -head -too -for -that -matter -he -said -it -was -wingless -but -a -swift -runner -the -natives -used -to -ride -it -it -could -make -forty -miles -an -hour -and -keep -it -up -for -four -hundred -miles -and -come -out -reasonably -fresh -it -was -still -in -existence -when -the -railway -was -introduced -into -new -zealand -still -in -existence -and -carrying -the -mails -the -railroad -began -with -the -same -schedule -it -has -now -two -expresses -a -week -time -twenty -miles -an -hour -the -company -exterminated -the -moa -to -get -the -mails -speaking -of -the -indigenous -coneys -and -bactrian -camels -the -naturalist -said -that -the -coniferous -and -bacteriological -output -of -australasia -was -remarkable -for -its -many -and -curious -departures -from -the -accepted -laws -governing -these -species -of -tubercles -but -that -in -his -opinion -nature's -fondness -for -dabbling -in -the -erratic -was -most -notably -exhibited -in -that -curious -combination -of -bird -fish -amphibian -burrower -crawler -quadruped -and -christian -called -the -ornithorhynchus -grotesquest -of -animals -king -of -the -animalculae -of -the -world -for -versatility -of -character -and -make -up -said -he -you -can -call -it -anything -you -want -to -and -be -right -it -is -a -fish -for -it -lives -in -the -river -half -the -time -it -is -a -land -animal -for -it -resides -on -the -land -half -the -time -it -is -an -amphibian -since -it -likes -both -and -does -not -know -which -it -prefers -it -is -a -hybernian -for -when -times -are -dull -and -nothing -much -going -on -it -buries -itself -under -the -mud -at -the -bottom -of -a -puddle -and -hybernates -there -a -couple -of -weeks -at -a -time -it -is -a -kind -of -duck -for -it -has -a -duck -bill -and -four -webbed -paddles -it -is -a -fish -and -quadruped -together -for -in -the -water -it -swims -with -the -paddles -and -on -shore -it -paws -itself -across -country -with -them -it -is -a -kind -of -seal -for -it -has -a -seal's -fur -it -is -carnivorous -herbivorous -insectivorous -and -vermifuginous -for -it -eats -fish -and -grass -and -butterflies -and -in -the -season -digs -worms -out -of -the -mud -and -devours -them -it -is -clearly -a -bird -for -it -lays -eggs -and -hatches -them -it -is -clearly -a -mammal -for -it -nurses -its -young -and -it -is -manifestly -a -kind -of -christian -for -it -keeps -the -sabbath -when -there -is -anybody -around -and -when -there -isn't -doesn't -it -has -all -the -tastes -there -are -except -refined -ones -it -has -all -the -habits -there -are -except -good -ones -it -is -a -survival -a -survival -of -the -fittest -mr -darwin -invented -the -theory -that -goes -by -that -name -but -the -ornithorhynchus -was -the -first -to -put -it -to -actual -experiment -and -prove -that -it -could -be -done -hence -it -should -have -as -much -of -the -credit -as -mr -darwin -it -was -never -in -the -ark -you -will -find -no -mention -of -it -there -it -nobly -stayed -out -and -worked -the -theory -of -all -creatures -in -the -world -it -was -the -only -one -properly -equipped -for -the -test -the -ark -was -thirteen -months -afloat -and -all -the -globe -submerged -no -land -visible -above -the -flood -no -vegetation -no -food -for -a -mammal -to -eat -nor -water -for -a -mammal -to -drink -for -all -mammal -food -was -destroyed -and -when -the -pure -floods -from -heaven -and -the -salt -oceans -of -the -earth -mingled -their -waters -and -rose -above -the -mountain -tops -the -result -was -a -drink -which -no -bird -or -beast -of -ordinary -construction -could -use -and -live -but -this -combination -was -nuts -for -the -ornithorhynchus -if -i -may -use -a -term -like -that -without -offense -its -river -home -had -always -been -salted -by -the -flood -tides -of -the -sea -on -the -face -of -the -noachian -deluge -innumerable -forest -trees -were -floating -upon -these -the -ornithorhynchus -voyaged -in -peace -voyaged -from -clime -to -clime -from -hemisphere -to -hemisphere -in -contentment -and -comfort -in -virile -interest -in -the -constant -change -of -scene -in -humble -thankfulness -for -its -privileges -in -ever -increasing -enthusiasm -in -the -development -of -the -great -theory -upon -whose -validity -it -had -staked -its -life -its -fortunes -and -its -sacred -honor -if -i -may -use -such -expressions -without -impropriety -in -connection -with -an -episode -of -this -nature -it -lived -the -tranquil -and -luxurious -life -of -a -creature -of -independent -means -of -things -actually -necessary -to -its -existence -and -its -happiness -not -a -detail -was -wanting -when -it -wished -to -walk -it -scrambled -along -the -tree -trunk -it -mused -in -the -shade -of -the -leaves -by -day -it -slept -in -their -shelter -by -night -when -it -wanted -the -refreshment -of -a -swim -it -had -it -it -ate -leaves -when -it -wanted -a -vegetable -diet -it -dug -under -the -bark -for -worms -and -grubs -when -it -wanted -fish -it -caught -them -when -it -wanted -eggs -it -laid -them -if -the -grubs -gave -out -in -one -tree -it -swam -to -another -and -as -for -fish -the -very -opulence -of -the -supply -was -an -embarrassment -and -finally -when -it -was -thirsty -it -smacked -its -chops -in -gratitude -over -a -blend -that -would -have -slain -a -crocodile -when -at -last -after -thirteen -months -of -travel -and -research -in -all -the -zones -it -went -aground -on -a -mountain -summit -it -strode -ashore -saying -in -its -heart -'let -them -that -come -after -me -invent -theories -and -dream -dreams -about -the -survival -of -the -fittest -if -they -like -but -i -am -the -first -that -has -done -it! -this -wonderful -creature -dates -back -like -the -kangaroo -and -many -other -australian -hydrocephalous -invertebrates -to -an -age -long -anterior -to -the -advent -of -man -upon -the -earth -they -date -back -indeed -to -a -time -when -a -causeway -hundreds -of -miles -wide -and -thousands -of -miles -long -joined -australia -to -africa -and -the -animals -of -the -two -countries -were -alike -and -all -belonged -to -that -remote -geological -epoch -known -to -science -as -the -old -red -grindstone -post -pleosaurian -later -the -causeway -sank -under -the -sea -subterranean -convulsions -lifted -the -african -continent -a -thousand -feet -higher -than -it -was -before -but -australia -kept -her -old -level -in -africa's -new -climate -the -animals -necessarily -began -to -develop -and -shade -off -into -new -forms -and -families -and -species -but -the -animals -of -australia -as -necessarily -remained -stationary -and -have -so -remained -until -this -day -in -the -course -of -some -millions -of -years -the -african -ornithorhynchus -developed -and -developed -and -developed -and -sluffed -off -detail -after -detail -of -its -make -up -until -at -last -the -creature -became -wholly -disintegrated -and -scattered -whenever -you -see -a -bird -or -a -beast -or -a -seal -or -an -otter -in -africa -you -know -that -he -is -merely -a -sorry -surviving -fragment -of -that -sublime -original -of -whom -i -have -been -speaking -that -creature -which -was -everything -in -general -and -nothing -in -particular -the -opulently -endowed -'e -pluribus -unum' -of -the -animal -world -such -is -the -history -of -the -most -hoary -the -most -ancient -the -most -venerable -creature -that -exists -in -the -earth -today -ornithorhynchus -platypus -extraordinariensis -whom -god -preserve! -when -he -was -strongly -moved -he -could -rise -and -soar -like -that -with -ease -and -not -only -in -the -prose -form -but -in -the -poetical -as -well -he -had -written -many -pieces -of -poetry -in -his -time -and -these -manuscripts -he -lent -around -among -the -passengers -and -was -willing -to -let -them -be -copied -it -seemed -to -me -that -the -least -technical -one -in -the -series -and -the -one -which -reached -the -loftiest -note -perhaps -was -his -invocation -come -forth -from -thy -oozy -couch -o -ornithorhynchus -dear! -and -greet -with -a -cordial -claw -the -stranger -that -longs -to -hear -from -thy -own -own -lips -the -tale -of -thy -origin -all -unknown -thy -misplaced -bone -where -flesh -should -be -and -flesh -where -should -be -bone -and -fishy -fin -where -should -be -paw -and -beaver -trowel -tail -and -snout -of -beast -equip'd -with -teeth -where -gills -ought -to -prevail -come -kangaroo -the -good -and -true -foreshortened -as -to -legs -and -body -tapered -like -a -churn -and -sack -marsupial -i' -fegs -and -tells -us -why -you -linger -here -thou -relic -of -a -vanished -time -when -all -your -friends -as -fossils -sleep -immortalized -in -lime! -perhaps -no -poet -is -a -conscious -plagiarist -but -there -seems -to -be -warrant -for -suspecting -that -there -is -no -poet -who -is -not -at -one -time -or -another -an -unconscious -one -the -above -verses -are -indeed -beautiful -and -in -a -way -touching -but -there -is -a -haunting -something -about -them -which -unavoidably -suggests -the -sweet -singer -of -michigan -it -can -hardly -be -doubted -that -the -author -had -read -the -works -of -that -poet -and -been -impressed -by -them -it -is -not -apparent -that -he -has -borrowed -from -them -any -word -or -yet -any -phrase -but -the -style -and -swing -and -mastery -and -melody -of -the -sweet -singer -all -are -there -compare -this -invocation -with -frank -dutton -particularly -stanzas -first -and -seventeenth -and -i -think -the -reader -will -feel -convinced -that -he -who -wrote -the -one -had -read -the -other -i -frank -dutton -was -as -fine -a -lad -as -ever -you -wish -to -see -and -he -was -drowned -in -pine -island -lake -on -earth -no -more -will -he -be -his -age -was -near -fifteen -years -and -he -was -a -motherless -boy -he -was -living -with -his -grandmother -when -he -was -drowned -poor -boy -xvii -he -was -drowned -on -tuesday -afternoon -on -sunday -he -was -found -and -the -tidings -of -that -drowned -boy -was -heard -for -miles -around -his -form -was -laid -by -his -mother's -side -beneath -the -cold -cold -ground -his -friends -for -him -will -drop -a -tear -when -they -view -his -little -mound -the -sentimental -song -book -by -mrs -julia -moore -p -36 -chapter -ix -it -is -your -human -environment -that -makes -climate -pudd'nhead -wilson's -new -calendar -sept -15 -night -close -to -australia -now -sydney -50 -miles -distant -that -note -recalls -an -experience -the -passengers -were -sent -for -to -come -up -in -the -bow -and -see -a -fine -sight -it -was -very -dark -one -could -not -follow -with -the -eye -the -surface -of -the -sea -more -than -fifty -yards -in -any -direction -it -dimmed -away -and -became -lost -to -sight -at -about -that -distance -from -us -but -if -you -patiently -gazed -into -the -darkness -a -little -while -there -was -a -sure -reward -for -you -presently -a -quarter -of -a -mile -away -you -would -see -a -blinding -splash -or -explosion -of -light -on -the -water -a -flash -so -sudden -and -so -astonishingly -brilliant -that -it -would -make -you -catch -your -breath -then -that -blotch -of -light -would -instantly -extend -itself -and -take -the -corkscrew -shape -and -imposing -length -of -the -fabled -sea -serpent -with -every -curve -of -its -body -and -the -break -spreading -away -from -its -head -and -the -wake -following -behind -its -tail -clothed -in -a -fierce -splendor -of -living -fire -and -my -but -it -was -coming -at -a -lightning -gait! -almost -before -you -could -think -this -monster -of -light -fifty -feet -long -would -go -flaming -and -storming -by -and -suddenly -disappear -and -out -in -the -distance -whence -he -came -you -would -see -another -flash -and -another -and -another -and -another -and -see -them -turn -into -sea -serpents -on -the -instant -and -once -sixteen -flashed -up -at -the -same -time -and -came -tearing -towards -us -a -swarm -of -wiggling -curves -a -moving -conflagration -a -vision -of -bewildering -beauty -a -spectacle -of -fire -and -energy -whose -equal -the -most -of -those -people -will -not -see -again -until -after -they -are -dead -it -was -porpoises -porpoises -aglow -with -phosphorescent -light -they -presently -collected -in -a -wild -and -magnificent -jumble -under -the -bows -and -there -they -played -for -an -hour -leaping -and -frollicking -and -carrying -on -turning -summersaults -in -front -of -the -stem -or -across -it -and -never -getting -hit -never -making -a -miscalculation -though -the -stem -missed -them -only -about -an -inch -as -a -rule -they -were -porpoises -of -the -ordinary -length -eight -or -ten -feet -but -every -twist -of -their -bodies -sent -a -long -procession -of -united -and -glowing -curves -astern -that -fiery -jumble -was -an -enchanting -thing -to -look -at -and -we -stayed -out -the -performance -one -cannot -have -such -a -show -as -that -twice -in -a -lifetime -the -porpoise -is -the -kitten -of -the -sea -he -never -has -a -serious -thought -he -cares -for -nothing -but -fun -and -play -but -i -think -i -never -saw -him -at -his -winsomest -until -that -night -it -was -near -a -center -of -civilization -and -he -could -have -been -drinking -by -and -by -when -we -had -approached -to -somewhere -within -thirty -miles -of -sydney -heads -the -great -electric -light -that -is -posted -on -one -of -those -lofty -ramparts -began -to -show -and -in -time -the -little -spark -grew -to -a -great -sun -and -pierced -the -firmament -of -darkness -with -a -far -reaching -sword -of -light -sydney -harbor -is -shut -in -behind -a -precipice -that -extends -some -miles -like -a -wall -and -exhibits -no -break -to -the -ignorant -stranger -it -has -a -break -in -the -middle -but -it -makes -so -little -show -that -even -captain -cook -sailed -by -it -without -seeing -it -near -by -that -break -is -a -false -break -which -resembles -it -and -which -used -to -make -trouble -for -the -mariner -at -night -in -the -early -days -before -the -place -was -lighted -it -caused -the -memorable -disaster -to -the -duncan -dunbar -one -of -the -most -pathetic -tragedies -in -the -history -of -that -pitiless -ruffian -the -sea -the -ship -was -a -sailing -vessel -a -fine -and -favorite -passenger -packet -commanded -by -a -popular -captain -of -high -reputation -she -was -due -from -england -and -sydney -was -waiting -and -counting -the -hours -counting -the -hours -and -making -ready -to -give -her -a -heart -stirring -welcome -for -she -was -bringing -back -a -great -company -of -mothers -and -daughters -the -long -missed -light -and -bloom -of -life -of -sydney -homes -daughters -that -had -been -years -absent -at -school -and -mothers -that -had -been -with -them -all -that -time -watching -over -them -of -all -the -world -only -india -and -australasia -have -by -custom -freighted -ships -and -fleets -with -their -hearts -and -know -the -tremendous -meaning -of -that -phrase -only -they -know -what -the -waiting -is -like -when -this -freightage -is -entrusted -to -the -fickle -winds -not -steam -and -what -the -joy -is -like -when -the -ship -that -is -returning -this -treasure -comes -safe -to -port -and -the -long -dread -is -over -on -board -the -duncan -dunbar -flying -toward -sydney -heads -in -the -waning -afternoon -the -happy -home -comers -made -busy -preparation -for -it -was -not -doubted -that -they -would -be -in -the -arms -of -their -friends -before -the -day -was -done -they -put -away -their -sea -going -clothes -and -put -on -clothes -meeter -for -the -meeting -their -richest -and -their -loveliest -these -poor -brides -of -the -grave -but -the -wind -lost -force -or -there -was -a -miscalculation -and -before -the -heads -were -sighted -the -darkness -came -on -it -was -said -that -ordinarily -the -captain -would -have -made -a -safe -offing -and -waited -for -the -morning -but -this -was -no -ordinary -occasion -all -about -him -were -appealing -faces -faces -pathetic -with -disappointment -so -his -sympathy -moved -him -to -try -the -dangerous -passage -in -the -dark -he -had -entered -the -heads -seventeen -times -and -believed -he -knew -the -ground -so -he -steered -straight -for -the -false -opening -mistaking -it -for -the -true -one -he -did -not -find -out -that -he -was -wrong -until -it -was -too -late -there -was -no -saving -the -ship -the -great -seas -swept -her -in -and -crushed -her -to -splinters -and -rubbish -upon -the -rock -tushes -at -the -base -of -the -precipice -not -one -of -all -that -fair -and -gracious -company -was -ever -seen -again -alive -the -tale -is -told -to -every -stranger -that -passes -the -spot -and -it -will -continue -to -be -told -to -all -that -come -for -generations -but -it -will -never -grow -old -custom -cannot -stale -it -the -heart -break -that -is -in -it -can -never -perish -out -of -it -there -were -two -hundred -persons -in -the -ship -and -but -one -survived -the -disaster -he -was -a -sailor -a -huge -sea -flung -him -up -the -face -of -the -precipice -and -stretched -him -on -a -narrow -shelf -of -rock -midway -between -the -top -and -the -bottom -and -there -he -lay -all -night -at -any -other -time -he -would -have -lain -there -for -the -rest -of -his -life -without -chance -of -discovery -but -the -next -morning -the -ghastly -news -swept -through -sydney -that -the -duncan -dunbar -had -gone -down -in -sight -of -home -and -straightway -the -walls -of -the -heads -were -black -with -mourners -and -one -of -these -stretching -himself -out -over -the -precipice -to -spy -out -what -might -be -seen -below -discovered -this -miraculously -preserved -relic -of -the -wreck -ropes -were -brought -and -the -nearly -impossible -feat -of -rescuing -the -man -was -accomplished -he -was -a -person -with -a -practical -turn -of -mind -and -he -hired -a -hall -in -sydney -and -exhibited -himself -at -sixpence -a -head -till -he -exhausted -the -output -of -the -gold -fields -for -that -year -we -entered -and -cast -anchor -and -in -the -morning -went -oh -ing -and -ah -ing -in -admiration -up -through -the -crooks -and -turns -of -the -spacious -and -beautiful -harbor -a -harbor -which -is -the -darling -of -sydney -and -the -wonder -of -the -world -it -is -not -surprising -that -the -people -are -proud -of -it -nor -that -they -put -their -enthusiasm -into -eloquent -words -a -returning -citizen -asked -me -what -i -thought -of -it -and -i -testified -with -a -cordiality -which -i -judged -would -be -up -to -the -market -rate -i -said -it -was -beautiful -superbly -beautiful -then -by -a -natural -impulse -i -gave -god -the -praise -the -citizen -did -not -seem -altogether -satisfied -he -said -it -is -beautiful -of -course -it's -beautiful -the -harbor -but -that -isn't -all -of -it -it's -only -half -of -it -sydney's -the -other -half -and -it -takes -both -of -them -together -to -ring -the -supremacy -bell -god -made -the -harbor -and -that's -all -right -but -satan -made -sydney -of -course -i -made -an -apology -and -asked -him -to -convey -it -to -his -friend -he -was -right -about -sydney -being -half -of -it -it -would -be -beautiful -without -sydney -but -not -above -half -as -beautiful -as -it -is -now -with -sydney -added -it -is -shaped -somewhat -like -an -oak -leaf -a -roomy -sheet -of -lovely -blue -water -with -narrow -off -shoots -of -water -running -up -into -the -country -on -both -sides -between -long -fingers -of -land -high -wooden -ridges -with -sides -sloped -like -graves -handsome -villas -are -perched -here -and -there -on -these -ridges -snuggling -amongst -the -foliage -and -one -catches -alluring -glimpses -of -them -as -the -ship -swims -by -toward -the -city -the -city -clothes -a -cluster -of -hills -and -a -ruffle -of -neighboring -ridges -with -its -undulating -masses -of -masonry -and -out -of -these -masses -spring -towers -and -spires -and -other -architectural -dignities -and -grandeurs -that -break -the -flowing -lines -and -give -picturesqueness -to -the -general -effect -the -narrow -inlets -which -i -have -mentioned -go -wandering -out -into -the -land -everywhere -and -hiding -themselves -in -it -and -pleasure -launches -are -always -exploring -them -with -picnic -parties -on -board -it -is -said -by -trustworthy -people -that -if -you -explore -them -all -you -will -find -that -you -have -covered -700 -miles -of -water -passage -but -there -are -liars -everywhere -this -year -and -they -will -double -that -when -their -works -are -in -good -going -order -october -was -close -at -hand -spring -was -come -it -was -really -spring -everybody -said -so -but -you -could -have -sold -it -for -summer -in -canada -and -nobody -would -have -suspected -it -was -the -very -weather -that -makes -our -home -summers -the -perfection -of -climatic -luxury -i -mean -when -you -are -out -in -the -wood -or -by -the -sea -but -these -people -said -it -was -cool -now -a -person -ought -to -see -sydney -in -the -summer -time -if -he -wanted -to -know -what -warm -weather -is -and -he -ought -to -go -north -ten -or -fifteen -hundred -miles -if -he -wanted -to -know -what -hot -weather -is -they -said -that -away -up -there -toward -the -equator -the -hens -laid -fried -eggs -sydney -is -the -place -to -go -to -get -information -about -other -people's -climates -it -seems -to -me -that -the -occupation -of -unbiased -traveler -seeking -information -is -the -pleasantest -and -most -irresponsible -trade -there -is -the -traveler -can -always -find -out -anything -he -wants -to -merely -by -asking -he -can -get -at -all -the -facts -and -more -everybody -helps -him -nobody -hinders -him -anybody -who -has -an -old -fact -in -stock -that -is -no -longer -negotiable -in -the -domestic -market -will -let -him -have -it -at -his -own -price -an -accumulation -of -such -goods -is -easily -and -quickly -made -they -cost -almost -nothing -and -they -bring -par -in -the -foreign -market -travelers -who -come -to -america -always -freight -up -with -the -same -old -nursery -tales -that -their -predecessors -selected -and -they -carry -them -back -and -always -work -them -off -without -any -trouble -in -the -home -market -if -the -climates -of -the -world -were -determined -by -parallels -of -latitude -then -we -could -know -a -place's -climate -by -its -position -on -the -map -and -so -we -should -know -that -the -climate -of -sydney -was -the -counterpart -of -the -climate -of -columbia -s -c -and -of -little -rock -arkansas -since -sydney -is -about -the -same -distance -south -of -the -equator -that -those -other -towns -are -north -of -it -thirty -four -degrees -but -no -climate -disregards -the -parallels -of -latitude -in -arkansas -they -have -a -winter -in -sydney -they -have -the -name -of -it -but -not -the -thing -itself -i -have -seen -the -ice -in -the -mississippi -floating -past -the -mouth -of -the -arkansas -river -and -at -memphis -but -a -little -way -above -the -mississippi -has -been -frozen -over -from -bank -to -bank -but -they -have -never -had -a -cold -spell -in -sydney -which -brought -the -mercury -down -to -freezing -point -once -in -a -mid -winter -day -there -in -the -month -of -july -the -mercury -went -down -to -36 -deg -and -that -remains -the -memorable -cold -day -in -the -history -of -the -town -no -doubt -little -rock -has -seen -it -below -zero -once -in -sydney -in -mid -summer -about -new -year's -day -the -mercury -went -up -to -106 -deg -in -the -shade -and -that -is -sydney's -memorable -hot -day -that -would -about -tally -with -little -rock's -hottest -day -also -i -imagine -my -sydney -figures -are -taken -from -a -government -report -and -are -trustworthy -in -the -matter -of -summer -weather -arkansas -has -no -advantage -over -sydney -perhaps -but -when -it -comes -to -winter -weather -that -is -another -affair -you -could -cut -up -an -arkansas -winter -into -a -hundred -sydney -winters -and -have -enough -left -for -arkansas -and -the -poor -the -whole -narrow -hilly -belt -of -the -pacific -side -of -new -south -wales -has -the -climate -of -its -capital -a -mean -winter -temperature -of -54 -deg -and -a -mean -summer -one -of -71 -deg -it -is -a -climate -which -cannot -be -improved -upon -for -healthfulness -but -the -experts -say -that -90 -deg -in -new -south -wales -is -harder -to -bear -than -112 -deg -in -the -neighboring -colony -of -victoria -because -the -atmosphere -of -the -former -is -humid -and -of -the -latter -dry -the -mean -temperature -of -the -southernmost -point -of -new -south -wales -is -the -same -as -that -of -nice -60 -deg -yet -nice -is -further -from -the -equator -by -460 -miles -than -is -the -former -but -nature -is -always -stingy -of -perfect -climates -stingier -in -the -case -of -australia -than -usual -apparently -this -vast -continent -has -a -really -good -climate -nowhere -but -around -the -edges -if -we -look -at -a -map -of -the -world -we -are -surprised -to -see -how -big -australia -is -it -is -about -two -thirds -as -large -as -the -united -states -was -before -we -added -alaska -but -where -as -one -finds -a -sufficiently -good -climate -and -fertile -land -almost -everywhere -in -the -united -states -it -seems -settled -that -inside -of -the -australian -border -belt -one -finds -many -deserts -and -in -spots -a -climate -which -nothing -can -stand -except -a -few -of -the -hardier -kinds -of -rocks -in -effect -australia -is -as -yet -unoccupied -if -you -take -a -map -of -the -united -states -and -leave -the -atlantic -sea -board -states -in -their -places -also -the -fringe -of -southern -states -from -florida -west -to -the -mouth -of -the -mississippi -also -a -narrow -inhabited -streak -up -the -mississippi -half -way -to -its -head -waters -also -a -narrow -inhabited -border -along -the -pacific -coast -then -take -a -brushful -of -paint -and -obliterate -the -whole -remaining -mighty -stretch -of -country -that -lies -between -the -atlantic -states -and -the -pacific -coast -strip -your -map -will -look -like -the -latest -map -of -australia -this -stupendous -blank -is -hot -not -to -say -torrid -a -part -of -it -is -fertile -the -rest -is -desert -it -is -not -liberally -watered -it -has -no -towns -one -has -only -to -cross -the -mountains -of -new -south -wales -and -descend -into -the -westward -lying -regions -to -find -that -he -has -left -the -choice -climate -behind -him -and -found -a -new -one -of -a -quite -different -character -in -fact -he -would -not -know -by -the -thermometer -that -he -was -not -in -the -blistering -plains -of -india -captain -sturt -the -great -explorer -gives -us -a -sample -of -the -heat -the -wind -which -had -been -blowing -all -the -morning -from -the -n -e -increased -to -a -heavy -gale -and -i -shall -never -forget -its -withering -effect -i -sought -shelter -behind -a -large -gum -tree -but -the -blasts -of -heat -were -so -terrific -that -i -wondered -the -very -grass -did -not -take -fire -this -really -was -nothing -ideal -everything -both -animate -and -inanimate -gave -way -before -it -the -horses -stood -with -their -backs -to -the -wind -and -their -noses -to -the -ground -without -the -muscular -strength -to -raise -their -heads -the -birds -were -mute -and -the -leaves -of -the -trees -under -which -we -were -sitting -fell -like -a -snow -shower -around -us -at -noon -i -took -a -thermometer -graded -to -127 -deg -out -of -my -box -and -observed -that -the -mercury -was -up -to -125 -thinking -that -it -had -been -unduly -influenced -i -put -it -in -the -fork -of -a -tree -close -to -me -sheltered -alike -from -the -wind -and -the -sun -i -went -to -examine -it -about -an -hour -afterwards -when -i -found -the -mercury -had -risen -to -the -top -of -the -instrument -and -had -burst -the -bulb -a -circumstance -that -i -believe -no -traveler -has -ever -before -had -to -record -i -cannot -find -language -to -convey -to -the -reader's -mind -an -idea -of -the -intense -and -oppressive -nature -of -the -heat -that -prevailed -that -hot -wind -sweeps -over -sydney -sometimes -and -brings -with -it -what -is -called -a -dust -storm -it -is -said -that -most -australian -towns -are -acquainted -with -the -dust -storm -i -think -i -know -what -it -is -like -for -the -following -description -by -mr -gape -tallies -very -well -with -the -alkali -duststorm -of -nevada -if -you -leave -out -the -shovel -part -still -the -shovel -part -is -a -pretty -important -part -and -seems -to -indicate -that -my -nevada -storm -is -but -a -poor -thing -after -all -as -we -proceeded -the -altitude -became -less -and -the -heat -proportionately -greater -until -we -reached -dubbo -which -is -only -600 -feet -above -sea -level -it -is -a -pretty -town -built -on -an -extensive -plain -after -the -effects -of -a -shower -of -rain -have -passed -away -the -surface -of -the -ground -crumbles -into -a -thick -layer -of -dust -and -occasionally -when -the -wind -is -in -a -particular -quarter -it -is -lifted -bodily -from -the -ground -in -one -long -opaque -cloud -in -the -midst -of -such -a -storm -nothing -can -be -seen -a -few -yards -ahead -and -the -unlucky -person -who -happens -to -be -out -at -the -time -is -compelled -to -seek -the -nearest -retreat -at -hand -when -the -thrifty -housewife -sees -in -the -distance -the -dark -column -advancing -in -a -steady -whirl -towards -her -house -she -closes -the -doors -and -windows -with -all -expedition -a -drawing -room -the -window -of -which -has -been -carelessly -left -open -during -a -dust -storm -is -indeed -an -extraordinary -sight -a -lady -who -has -resided -in -dubbo -for -some -years -says -that -the -dust -lies -so -thick -on -the -carpet -that -it -is -necessary -to -use -a -shovel -to -remove -it -and -probably -a -wagon -i -was -mistaken -i -have -not -seen -a -proper -duststorm -to -my -mind -the -exterior -aspects -and -character -of -australia -are -fascinating -things -to -look -at -and -think -about -they -are -so -strange -so -weird -so -new -so -uncommonplace -such -a -startling -and -interesting -contrast -to -the -other -sections -of -the -planet -the -sections -that -are -known -to -us -all -familiar -to -us -all -in -the -matter -of -particulars -a -detail -here -a -detail -there -we -have -had -the -choice -climate -of -new -south -wales' -seacoast -we -have -had -the -australian -heat -as -furnished -by -captain -sturt -we -have -had -the -wonderful -dust -storm -and -we -have -considered -the -phenomenon -of -an -almost -empty -hot -wilderness -half -as -big -as -the -united -states -with -a -narrow -belt -of -civilization -population -and -good -climate -around -it -chapter -x -everything -human -is -pathetic -the -secret -source -of -humor -itself -is -not -joy -but -sorrow -there -is -no -humor -in -heaven -pudd'nhead -wilson's -new -calendar -captain -cook -found -australia -in -1770 -and -eighteen -years -later -the -british -government -began -to -transport -convicts -to -it -altogether -new -south -wales -received -83 -000 -in -53 -years -the -convicts -wore -heavy -chains -they -were -ill -fed -and -badly -treated -by -the -officers -set -over -them -they -were -heavily -punished -for -even -slight -infractions -of -the -rules -the -cruelest -discipline -ever -known -is -one -historian's -description -of -their -life -[the -story -of -australasia -j -s -laurie -] -english -law -was -hard -hearted -in -those -days -for -trifling -offenses -which -in -our -day -would -be -punished -by -a -small -fine -or -a -few -days' -confinement -men -women -and -boys -were -sent -to -this -other -end -of -the -earth -to -serve -terms -of -seven -and -fourteen -years -and -for -serious -crimes -they -were -transported -for -life -children -were -sent -to -the -penal -colonies -for -seven -years -for -stealing -a -rabbit! -when -i -was -in -london -twenty -three -years -ago -there -was -a -new -penalty -in -force -for -diminishing -garroting -and -wife -beating -25 -lashes -on -the -bare -back -with -the -cat -o' -nine -tails -it -was -said -that -this -terrible -punishment -was -able -to -bring -the -stubbornest -ruffians -to -terms -and -that -no -man -had -been -found -with -grit -enough -to -keep -his -emotions -to -himself -beyond -the -ninth -blow -as -a -rule -the -man -shrieked -earlier -that -penalty -had -a -great -and -wholesome -effect -upon -the -garroters -and -wife -beaters -but -humane -modern -london -could -not -endure -it -it -got -its -law -rescinded -many -a -bruised -and -battered -english -wife -has -since -had -occasion -to -deplore -that -cruel -achievement -of -sentimental -humanity -twenty -five -lashes! -in -australia -and -tasmania -they -gave -a -convict -fifty -for -almost -any -little -offense -and -sometimes -a -brutal -officer -would -add -fifty -and -then -another -fifty -and -so -on -as -long -as -the -sufferer -could -endure -the -torture -and -live -in -tasmania -i -read -the -entry -in -an -old -manuscript -official -record -of -a -case -where -a -convict -was -given -three -hundred -lashes -for -stealing -some -silver -spoons -and -men -got -more -than -that -sometimes -who -handled -the -cat -often -it -was -another -convict -sometimes -it -was -the -culprit's -dearest -comrade -and -he -had -to -lay -on -with -all -his -might -otherwise -he -would -get -a -flogging -himself -for -his -mercy -for -he -was -under -watch -and -yet -not -do -his -friend -any -good -the -friend -would -be -attended -to -by -another -hand -and -suffer -no -lack -in -the -matter -of -full -punishment -the -convict -life -in -tasmania -was -so -unendurable -and -suicide -so -difficult -to -accomplish -that -once -or -twice -despairing -men -got -together -and -drew -straws -to -determine -which -of -them -should -kill -another -of -the -group -this -murder -to -secure -death -to -the -perpetrator -and -to -the -witnesses -of -it -by -the -hand -of -the -hangman! -the -incidents -quoted -above -are -mere -hints -mere -suggestions -of -what -convict -life -was -like -they -are -but -a -couple -of -details -tossed -into -view -out -of -a -shoreless -sea -of -such -or -to -change -the -figure -they -are -but -a -pair -of -flaming -steeples -photographed -from -a -point -which -hides -from -sight -the -burning -city -which -stretches -away -from -their -bases -on -every -hand -some -of -the -convicts -indeed -a -good -many -of -them -were -very -bad -people -even -for -that -day -but -the -most -of -them -were -probably -not -noticeably -worse -than -the -average -of -the -people -they -left -behind -them -at -home -we -must -believe -this -we -cannot -avoid -it -we -are -obliged -to -believe -that -a -nation -that -could -look -on -unmoved -and -see -starving -or -freezing -women -hanged -for -stealing -twenty -six -cents' -worth -of -bacon -or -rags -and -boys -snatched -from -their -mothers -and -men -from -their -families -and -sent -to -the -other -side -of -the -world -for -long -terms -of -years -for -similar -trifling -offenses -was -a -nation -to -whom -the -term -civilized -could -not -in -any -large -way -be -applied -and -we -must -also -believe -that -a -nation -that -knew -during -more -than -forty -years -what -was -happening -to -those -exiles -and -was -still -content -with -it -was -not -advancing -in -any -showy -way -toward -a -higher -grade -of -civilization -if -we -look -into -the -characters -and -conduct -of -the -officers -and -gentlemen -who -had -charge -of -the -convicts -and -attended -to -their -backs -and -stomachs -we -must -grant -again -that -as -between -the -convict -and -his -masters -and -between -both -and -the -nation -at -home -there -was -a -quite -noticeable -monotony -of -sameness -four -years -had -gone -by -and -many -convicts -had -come -respectable -settlers -were -beginning -to -arrive -these -two -classes -of -colonists -had -to -be -protected -in -case -of -trouble -among -themselves -or -with -the -natives -it -is -proper -to -mention -the -natives -though -they -could -hardly -count -they -were -so -scarce -at -a -time -when -they -had -not -as -yet -begun -to -be -much -disturbed -not -as -yet -being -in -the -way -it -was -estimated -that -in -new -south -wales -there -was -but -one -native -to -45 -000 -acres -of -territory -people -had -to -be -protected -officers -of -the -regular -army -did -not -want -this -service -away -off -there -where -neither -honor -nor -distinction -was -to -be -gained -so -england -recruited -and -officered -a -kind -of -militia -force -of -1 -000 -uniformed -civilians -called -the -new -south -wales -corps -and -shipped -it -this -was -the -worst -blow -of -all -the -colony -fairly -staggered -under -it -the -corps -was -an -object -lesson -of -the -moral -condition -of -england -outside -of -the -jails -the -colonists -trembled -it -was -feared -that -next -there -would -be -an -importation -of -the -nobility -in -those -early -days -the -colony -was -non -supporting -all -the -necessaries -of -life -food -clothing -and -all -were -sent -out -from -england -and -kept -in -great -government -store -houses -and -given -to -the -convicts -and -sold -to -the -settlers -sold -at -a -trifling -advance -upon -cost -the -corps -saw -its -opportunity -its -officers -went -into -commerce -and -in -a -most -lawless -way -they -went -to -importing -rum -and -also -to -manufacturing -it -in -private -stills -in -defiance -of -the -government's -commands -and -protests -they -leagued -themselves -together -and -ruled -the -market -they -boycotted -the -government -and -the -other -dealers -they -established -a -close -monopoly -and -kept -it -strictly -in -their -own -hands -when -a -vessel -arrived -with -spirits -they -allowed -nobody -to -buy -but -themselves -and -they -forced -the -owner -to -sell -to -them -at -a -price -named -by -themselves -and -it -was -always -low -enough -they -bought -rum -at -an -average -of -two -dollars -a -gallon -and -sold -it -at -an -average -of -ten -they -made -rum -the -currency -of -the -country -for -there -was -little -or -no -money -and -they -maintained -their -devastating -hold -and -kept -the -colony -under -their -heel -for -eighteen -or -twenty -years -before -they -were -finally -conquered -and -routed -by -the -government -meantime -they -had -spread -intemperance -everywhere -and -they -had -squeezed -farm -after -farm -out -of -the -settlers -hands -for -rum -and -thus -had -bountifully -enriched -themselves -when -a -farmer -was -caught -in -the -last -agonies -of -thirst -they -took -advantage -of -him -and -sweated -him -for -a -drink -in -one -instance -they -sold -a -man -a -gallon -of -rum -worth -two -dollars -for -a -piece -of -property -which -was -sold -some -years -later -for -$100 -000 -when -the -colony -was -about -eighteen -or -twenty -years -old -it -was -discovered -that -the -land -was -specially -fitted -for -the -wool -culture -prosperity -followed -commerce -with -the -world -began -by -and -by -rich -mines -of -the -noble -metals -were -opened -immigrants -flowed -in -capital -likewise -the -result -is -the -great -and -wealthy -and -enlightened -commonwealth -of -new -south -wales -it -is -a -country -that -is -rich -in -mines -wool -ranches -trams -railways -steamship -lines -schools -newspapers -botanical -gardens -art -galleries -libraries -museums -hospitals -learned -societies -it -is -the -hospitable -home -of -every -species -of -culture -and -of -every -species -of -material -enterprise -and -there -is -a -church -at -every -man's -door -and -a -race -track -over -the -way -chapter -xi -we -should -be -careful -to -get -out -of -an -experience -only -the -wisdom -that -is -in -it -and -stop -there -lest -we -be -like -the -cat -that -sits -down -on -a -hot -stove -lid -she -will -never -sit -down -on -a -hot -stove -lid -again -and -that -is -well -but -also -she -will -never -sit -down -on -a -cold -one -any -more -pudd'nhead -wilson's -new -calendar -all -english -speaking -colonies -are -made -up -of -lavishly -hospitable -people -and -new -south -wales -and -its -capital -are -like -the -rest -in -this -the -english -speaking -colony -of -the -united -states -of -america -is -always -called -lavishly -hospitable -by -the -english -traveler -as -to -the -other -english -speaking -colonies -throughout -the -world -from -canada -all -around -i -know -by -experience -that -the -description -fits -them -i -will -not -go -more -particularly -into -this -matter -for -i -find -that -when -writers -try -to -distribute -their -gratitude -here -and -there -and -yonder -by -detail -they -run -across -difficulties -and -do -some -ungraceful -stumbling -mr -gane -new -south -wales -and -victoria -in -1885 -tried -to -distribute -his -gratitude -and -was -not -lucky -the -inhabitants -of -sydney -are -renowned -for -their -hospitality -the -treatment -which -we -experienced -at -the -hands -of -this -generous -hearted -people -will -help -more -than -anything -else -to -make -us -recollect -with -pleasure -our -stay -amongst -them -in -the -character -of -hosts -and -hostesses -they -excel -the -'new -chum' -needs -only -the -acquaintanceship -of -one -of -their -number -and -he -becomes -at -once -the -happy -recipient -of -numerous -complimentary -invitations -and -thoughtful -kindnesses -of -the -towns -it -has -been -our -good -fortune -to -visit -none -have -portrayed -home -so -faithfully -as -sydney -nobody -could -say -it -finer -than -that -if -he -had -put -in -his -cork -then -and -stayed -away -from -dubbo -but -no -heedless -man -he -pulled -it -again -pulled -it -when -he -was -away -along -in -his -book -and -his -memory -of -what -he -had -said -about -sydney -had -grown -dim -we -cannot -quit -the -promising -town -of -dubbo -without -testifying -in -warm -praise -to -the -kind -hearted -and -hospitable -usages -of -its -inhabitants -sydney -though -well -deserving -the -character -it -bears -of -its -kindly -treatment -of -strangers -possesses -a -little -formality -and -reserve -in -dubbo -on -the -contrary -though -the -same -congenial -manners -prevail -there -is -a -pleasing -degree -of -respectful -familiarity -which -gives -the -town -a -homely -comfort -not -often -met -with -elsewhere -in -laying -on -one -side -our -pen -we -feel -contented -in -having -been -able -though -so -late -in -this -work -to -bestow -a -panegyric -however -unpretentious -on -a -town -which -though -possessing -no -picturesque -natural -surroundings -nor -interesting -architectural -productions -has -yet -a -body -of -citizens -whose -hearts -cannot -but -obtain -for -their -town -a -reputation -for -benevolence -and -kind -heartedness -i -wonder -what -soured -him -on -sydney -it -seems -strange -that -a -pleasing -degree -of -three -or -four -fingers -of -respectful -familiarity -should -fill -a -man -up -and -give -him -the -panegyrics -so -bad -for -he -has -them -the -worst -way -any -one -can -see -that -a -man -who -is -perfectly -at -himself -does -not -throw -cold -detraction -at -people's -architectural -productions -and -picturesque -surroundings -and -let -on -that -what -he -prefers -is -a -dubbonese -dust -storm -and -a -pleasing -degree -of -respectful -familiarity -no -these -are -old -old -symptoms -and -when -they -appear -we -know -that -the -man -has -got -the -panegyrics -sydney -has -a -population -of -400 -000 -when -a -stranger -from -america -steps -ashore -there -the -first -thing -that -strikes -him -is -that -the -place -is -eight -or -nine -times -as -large -as -he -was -expecting -it -to -be -and -the -next -thing -that -strikes -him -is -that -it -is -an -english -city -with -american -trimmings -later -on -in -melbourne -he -will -find -the -american -trimmings -still -more -in -evidence -there -even -the -architecture -will -often -suggest -america -a -photograph -of -its -stateliest -business -street -might -be -passed -upon -him -for -a -picture -of -the -finest -street -in -a -large -american -city -i -was -told -that -the -most -of -the -fine -residences -were -the -city -residences -of -squatters -the -name -seemed -out -of -focus -somehow -when -the -explanation -came -it -offered -a -new -instance -of -the -curious -changes -which -words -as -well -as -animals -undergo -through -change -of -habitat -and -climate -with -us -when -you -speak -of -a -squatter -you -are -always -supposed -to -be -speaking -of -a -poor -man -but -in -australia -when -you -speak -of -a -squatter -you -are -supposed -to -be -speaking -of -a -millionaire -in -america -the -word -indicates -the -possessor -of -a -few -acres -and -a -doubtful -title -in -australia -it -indicates -a -man -whose -landfront -is -as -long -as -a -railroad -and -whose -title -has -been -perfected -in -one -way -or -another -in -america -the -word -indicates -a -man -who -owns -a -dozen -head -of -live -stock -in -australia -a -man -who -owns -anywhere -from -fifty -thousand -up -to -half -a -million -head -in -america -the -word -indicates -a -man -who -is -obscure -and -not -important -in -australia -a -man -who -is -prominent -and -of -the -first -importance -in -america -you -take -off -your -hat -to -no -squatter -in -australia -you -do -in -america -if -your -uncle -is -a -squatter -you -keep -it -dark -in -australia -you -advertise -it -in -america -if -your -friend -is -a -squatter -nothing -comes -of -it -but -with -a -squatter -for -your -friend -in -australia -you -may -sup -with -kings -if -there -are -any -around -in -australia -it -takes -about -two -acres -and -a -half -of -pastureland -some -people -say -twice -as -many -to -support -a -sheep -and -when -the -squatter -has -half -a -million -sheep -his -private -domain -is -about -as -large -as -rhode -island -to -speak -in -general -terms -his -annual -wool -crop -may -be -worth -a -quarter -or -a -half -million -dollars -he -will -live -in -a -palace -in -melbourne -or -sydney -or -some -other -of -the -large -cities -and -make -occasional -trips -to -his -sheep -kingdom -several -hundred -miles -away -in -the -great -plains -to -look -after -his -battalions -of -riders -and -shepherds -and -other -hands -he -has -a -commodious -dwelling -out -there -and -if -he -approve -of -you -he -will -invite -you -to -spend -a -week -in -it -and -will -make -you -at -home -and -comfortable -and -let -you -see -the -great -industry -in -all -its -details -and -feed -you -and -slake -you -and -smoke -you -with -the -best -that -money -can -buy -on -at -least -one -of -these -vast -estates -there -is -a -considerable -town -with -all -the -various -businesses -and -occupations -that -go -to -make -an -important -town -and -the -town -and -the -land -it -stands -upon -are -the -property -of -the -squatters -i -have -seen -that -town -and -it -is -not -unlikely -that -there -are -other -squatter -owned -towns -in -australia -australia -supplies -the -world -not -only -with -fine -wool -but -with -mutton -also -the -modern -invention -of -cold -storage -and -its -application -in -ships -has -created -this -great -trade -in -sydney -i -visited -a -huge -establishment -where -they -kill -and -clean -and -solidly -freeze -a -thousand -sheep -a -day -for -shipment -to -england -the -australians -did -not -seem -to -me -to -differ -noticeably -from -americans -either -in -dress -carriage -ways -pronunciation -inflections -or -general -appearance -there -were -fleeting -and -subtle -suggestions -of -their -english -origin -but -these -were -not -pronounced -enough -as -a -rule -to -catch -one's -attention -the -people -have -easy -and -cordial -manners -from -the -beginning -from -the -moment -that -the -introduction -is -completed -this -is -american -to -put -it -in -another -way -it -is -english -friendliness -with -the -english -shyness -and -self -consciousness -left -out -now -and -then -but -this -is -rare -one -hears -such -words -as -piper -for -paper -lydy -for -lady -and -tyble -for -table -fall -from -lips -whence -one -would -not -expect -such -pronunciations -to -come -there -is -a -superstition -prevalent -in -sydney -that -this -pronunciation -is -an -australianism -but -people -who -have -been -home -as -the -native -reverently -and -lovingly -calls -england -know -better -it -is -costermonger -all -over -australasia -this -pronunciation -is -nearly -as -common -among -servants -as -it -is -in -london -among -the -uneducated -and -the -partially -educated -of -all -sorts -and -conditions -of -people -that -mislaid -'y' -is -rather -striking -when -a -person -gets -enough -of -it -into -a -short -sentence -to -enable -it -to -show -up -in -the -hotel -in -sydney -the -chambermaid -said -one -morning -the -tyble -is -set -and -here -is -the -piper -and -if -the -lydy -is -ready -i'll -tell -the -wyter -to -bring -up -the -breakfast -i -have -made -passing -mention -a -moment -ago -of -the -native -australasian's -custom -of -speaking -of -england -as -home -it -was -always -pretty -to -hear -it -and -often -it -was -said -in -an -unconsciously -caressing -way -that -made -it -touching -in -a -way -which -transmuted -a -sentiment -into -an -embodiment -and -made -one -seem -to -see -australasia -as -a -young -girl -stroking -mother -england's -old -gray -head -in -the -australasian -home -the -table -talk -is -vivacious -and -unembarrassed -it -is -without -stiffness -or -restraint -this -does -not -remind -one -of -england -so -much -as -it -does -of -america -but -australasia -is -strictly -democratic -and -reserves -and -restraints -are -things -that -are -bred -by -differences -of -rank -english -and -colonial -audiences -are -phenomenally -alert -and -responsive -where -masses -of -people -are -gathered -together -in -england -caste -is -submerged -and -with -it -the -english -reserve -equality -exists -for -the -moment -and -every -individual -is -free -so -free -from -any -consciousness -of -fetters -indeed -that -the -englishman's -habit -of -watching -himself -and -guarding -himself -against -any -injudicious -exposure -of -his -feelings -is -forgotten -and -falls -into -abeyance -and -to -such -a -degree -indeed -that -he -will -bravely -applaud -all -by -himself -if -he -wants -to -an -exhibition -of -daring -which -is -unusual -elsewhere -in -the -world -but -it -is -hard -to -move -a -new -english -acquaintance -when -he -is -by -himself -or -when -the -company -present -is -small -and -new -to -him -he -is -on -his -guard -then -and -his -natural -reserve -is -to -the -fore -this -has -given -him -the -false -reputation -of -being -without -humor -and -without -the -appreciation -of -humor -americans -are -not -englishmen -and -american -humor -is -not -english -humor -but -both -the -american -and -his -humor -had -their -origin -in -england -and -have -merely -undergone -changes -brought -about -by -changed -conditions -and -a -new -environment -about -the -best -humorous -speeches -i -have -yet -heard -were -a -couple -that -were -made -in -australia -at -club -suppers -one -of -them -by -an -englishman -the -other -by -an -australian -chapter -xii -there -are -those -who -scoff -at -the -schoolboy -calling -him -frivolous -and -shallow -yet -it -was -the -schoolboy -who -said -faith -is -believing -what -you -know -ain't -so -pudd'nhead -wilson's -new -calendar -in -sydney -i -had -a -large -dream -and -in -the -course -of -talk -i -told -it -to -a -missionary -from -india -who -was -on -his -way -to -visit -some -relatives -in -new -zealand -i -dreamed -that -the -visible -universe -is -the -physical -person -of -god -that -the -vast -worlds -that -we -see -twinkling -millions -of -miles -apart -in -the -fields -of -space -are -the -blood -corpuscles -in -his -veins -and -that -we -and -the -other -creatures -are -the -microbes -that -charge -with -multitudinous -life -the -corpuscles -mr -x -the -missionary -considered -the -dream -awhile -then -said -it -is -not -surpassable -for -magnitude -since -its -metes -and -bounds -are -the -metes -and -bounds -of -the -universe -itself -and -it -seems -to -me -that -it -almost -accounts -for -a -thing -which -is -otherwise -nearly -unaccountable -the -origin -of -the -sacred -legends -of -the -hindoos -perhaps -they -dream -them -and -then -honestly -believe -them -to -be -divine -revelations -of -fact -it -looks -like -that -for -the -legends -are -built -on -so -vast -a -scale -that -it -does -not -seem -reasonable -that -plodding -priests -would -happen -upon -such -colossal -fancies -when -awake -he -told -some -of -the -legends -and -said -that -they -were -implicitly -believed -by -all -classes -of -hindoos -including -those -of -high -social -position -and -intelligence -and -he -said -that -this -universal -credulity -was -a -great -hindrance -to -the -missionary -in -his -work -then -he -said -something -like -this -at -home -people -wonder -why -christianity -does -not -make -faster -progress -in -india -they -hear -that -the -indians -believe -easily -and -that -they -have -a -natural -trust -in -miracles -and -give -them -a -hospitable -reception -then -they -argue -like -this -since -the -indian -believes -easily -place -christianity -before -them -and -they -must -believe -confirm -its -truths -by -the -biblical -miracles -and -they -will -no -longer -doubt -the -natural -deduction -is -that -as -christianity -makes -but -indifferent -progress -in -india -the -fault -is -with -us -we -are -not -fortunate -in -presenting -the -doctrines -and -the -miracles -but -the -truth -is -we -are -not -by -any -means -so -well -equipped -as -they -think -we -have -not -the -easy -task -that -they -imagine -to -use -a -military -figure -we -are -sent -against -the -enemy -with -good -powder -in -our -guns -but -only -wads -for -bullets -that -is -to -say -our -miracles -are -not -effective -the -hindoos -do -not -care -for -them -they -have -more -extraordinary -ones -of -their -own -all -the -details -of -their -own -religion -are -proven -and -established -by -miracles -the -details -of -ours -must -be -proven -in -the -same -way -when -i -first -began -my -work -in -india -i -greatly -underestimated -the -difficulties -thus -put -upon -my -task -a -correction -was -not -long -in -coming -i -thought -as -our -friends -think -at -home -that -to -prepare -my -childlike -wonder -lovers -to -listen -with -favor -to -my -grave -message -i -only -needed -to -charm -the -way -to -it -with -wonders -marvels -miracles -with -full -confidence -i -told -the -wonders -performed -by -samson -the -strongest -man -that -had -ever -lived -for -so -i -called -him -at -first -i -saw -lively -anticipation -and -strong -interest -in -the -faces -of -my -people -but -as -i -moved -along -from -incident -to -incident -of -the -great -story -i -was -distressed -to -see -that -i -was -steadily -losing -the -sympathy -of -my -audience -i -could -not -understand -it -it -was -a -surprise -to -me -and -a -disappointment -before -i -was -through -the -fading -sympathy -had -paled -to -indifference -thence -to -the -end -the -indifference -remained -i -was -not -able -to -make -any -impression -upon -it -a -good -old -hindoo -gentleman -told -me -where -my -trouble -lay -he -said -'we -hindoos -recognize -a -god -by -the -work -of -his -hands -we -accept -no -other -testimony -apparently -this -is -also -the -rule -with -you -christians -and -we -know -when -a -man -has -his -power -from -a -god -by -the -fact -that -he -does -things -which -he -could -not -do -as -a -man -with -the -mere -powers -of -a -man -plainly -this -is -the -christian's -way -also -of -knowing -when -a -man -is -working -by -a -god's -power -and -not -by -his -own -you -saw -that -there -was -a -supernatural -property -in -the -hair -of -samson -for -you -perceived -that -when -his -hair -was -gone -he -was -as -other -men -it -is -our -way -as -i -have -said -there -are -many -nations -in -the -world -and -each -group -of -nations -has -its -own -gods -and -will -pay -no -worship -to -the -gods -of -the -others -each -group -believes -its -own -gods -to -be -strongest -and -it -will -not -exchange -them -except -for -gods -that -shall -be -proven -to -be -their -superiors -in -power -man -is -but -a -weak -creature -and -needs -the -help -of -gods -he -cannot -do -without -it -shall -he -place -his -fate -in -the -hands -of -weak -gods -when -there -may -be -stronger -ones -to -be -found -that -would -be -foolish -no -if -he -hear -of -gods -that -are -stronger -than -his -own -he -should -not -turn -a -deaf -ear -for -it -is -not -a -light -matter -that -is -at -stake -how -then -shall -he -determine -which -gods -are -the -stronger -his -own -or -those -that -preside -over -the -concerns -of -other -nations -by -comparing -the -known -works -of -his -own -gods -with -the -works -of -those -others -there -is -no -other -way -now -when -we -make -this -comparison -we -are -not -drawn -towards -the -gods -of -any -other -nation -our -gods -are -shown -by -their -works -to -be -the -strongest -the -most -powerful -the -christians -have -but -few -gods -and -they -are -new -new -and -not -strong -as -it -seems -to -us -they -will -increase -in -number -it -is -true -for -this -has -happened -with -all -gods -but -that -time -is -far -away -many -ages -and -decades -of -ages -away -for -gods -multiply -slowly -as -is -meet -for -beings -to -whom -a -thousand -years -is -but -a -single -moment -our -own -gods -have -been -born -millions -of -years -apart -the -process -is -slow -the -gathering -of -strength -and -power -is -similarly -slow -in -the -slow -lapse -of -the -ages -the -steadily -accumulating -power -of -our -gods -has -at -last -become -prodigious -we -have -a -thousand -proofs -of -this -in -the -colossal -character -of -their -personal -acts -and -the -acts -of -ordinary -men -to -whom -they -have -given -supernatural -qualities -to -your -samson -was -given -supernatural -power -and -when -he -broke -the -withes -and -slew -the -thousands -with -the -jawbone -of -an -ass -and -carried -away -the -gate's -of -the -city -upon -his -shoulders -you -were -amazed -and -also -awed -for -you -recognized -the -divine -source -of -his -strength -but -it -could -not -profit -to -place -these -things -before -your -hindoo -congregation -and -invite -their -wonder -for -they -would -compare -them -with -the -deed -done -by -hanuman -when -our -gods -infused -their -divine -strength -into -his -muscles -and -they -would -be -indifferent -to -them -as -you -saw -in -the -old -old -times -ages -and -ages -gone -by -when -our -god -rama -was -warring -with -the -demon -god -of -ceylon -rama -bethought -him -to -bridge -the -sea -and -connect -ceylon -with -india -so -that -his -armies -might -pass -easily -over -and -he -sent -his -general -hanuman -inspired -like -your -own -samson -with -divine -strength -to -bring -the -materials -for -the -bridge -in -two -days -hanuman -strode -fifteen -hundred -miles -to -the -himalayas -and -took -upon -his -shoulder -a -range -of -those -lofty -mountains -two -hundred -miles -long -and -started -with -it -toward -ceylon -it -was -in -the -night -and -as -he -passed -along -the -plain -the -people -of -govardhun -heard -the -thunder -of -his -tread -and -felt -the -earth -rocking -under -it -and -they -ran -out -and -there -with -their -snowy -summits -piled -to -heaven -they -saw -the -himalayas -passing -by -and -as -this -huge -continent -swept -along -overshadowing -the -earth -upon -its -slopes -they -discerned -the -twinkling -lights -of -a -thousand -sleeping -villages -and -it -was -as -if -the -constellations -were -filing -in -procession -through -the -sky -while -they -were -looking -hanuman -stumbled -and -a -small -ridge -of -red -sandstone -twenty -miles -long -was -jolted -loose -and -fell -half -of -its -length -has -wasted -away -in -the -course -of -the -ages -but -the -other -ten -miles -of -it -remain -in -the -plain -by -govardhun -to -this -day -as -proof -of -the -might -of -the -inspiration -of -our -gods -you -must -know -yourself -that -hanuman -could -not -have -carried -those -mountains -to -ceylon -except -by -the -strength -of -the -gods -you -know -that -it -was -not -done -by -his -own -strength -therefore -you -know -that -it -was -done -by -the -strength -of -the -gods -just -as -you -know -that -samson -carried -the -gates -by -the -divine -strength -and -not -by -his -own -i -think -you -must -concede -two -things -first -that -in -carrying -the -gates -of -the -city -upon -his -shoulders -samson -did -not -establish -the -superiority -of -his -gods -over -ours -secondly -that -his -feat -is -not -supported -by -any -but -verbal -evidence -while -hanuman's -is -not -only -supported -by -verbal -evidence -but -this -evidence -is -confirmed -established -proven -by -visible -tangible -evidence -which -is -the -strongest -of -all -testimony -we -have -the -sandstone -ridge -and -while -it -remains -we -cannot -doubt -and -shall -not -have -you -the -gates -' -chapter -xiii -the -timid -man -yearns -for -full -value -and -asks -a -tenth -the -bold -man -strikes -for -double -value -and -compromises -on -par -pudd'nhead -wilson's -new -calendar -one -is -sure -to -be -struck -by -the -liberal -way -in -which -australasia -spends -money -upon -public -works -such -as -legislative -buildings -town -halls -hospitals -asylums -parks -and -botanical -gardens -i -should -say -that -where -minor -towns -in -america -spend -a -hundred -dollars -on -the -town -hall -and -on -public -parks -and -gardens -the -like -towns -in -australasia -spend -a -thousand -and -i -think -that -this -ratio -will -hold -good -in -the -matter -of -hospitals -also -i -have -seen -a -costly -and -well -equipped -and -architecturally -handsome -hospital -in -an -australian -village -of -fifteen -hundred -inhabitants -it -was -built -by -private -funds -furnished -by -the -villagers -and -the -neighboring -planters -and -its -running -expenses -were -drawn -from -the -same -sources -i -suppose -it -would -be -hard -to -match -this -in -any -country -this -village -was -about -to -close -a -contract -for -lighting -its -streets -with -the -electric -light -when -i -was -there -that -is -ahead -of -london -london -is -still -obscured -by -gas -gas -pretty -widely -scattered -too -in -some -of -the -districts -so -widely -indeed -that -except -on -moonlight -nights -it -is -difficult -to -find -the -gas -lamps -the -botanical -garden -of -sydney -covers -thirty -eight -acres -beautifully -laid -out -and -rich -with -the -spoil -of -all -the -lands -and -all -the -climes -of -the -world -the -garden -is -on -high -ground -in -the -middle -of -the -town -overlooking -the -great -harbor -and -it -adjoins -the -spacious -grounds -of -government -house -fifty -six -acres -and -at -hand -also -is -a -recreation -ground -containing -eighty -two -acres -in -addition -there -are -the -zoological -gardens -the -race -course -and -the -great -cricket -grounds -where -the -international -matches -are -played -therefore -there -is -plenty -of -room -for -reposeful -lazying -and -lounging -and -for -exercise -too -for -such -as -like -that -kind -of -work -there -are -four -specialties -attainable -in -the -way -of -social -pleasure -if -you -enter -your -name -on -the -visitor's -book -at -government -house -you -will -receive -an -invitation -to -the -next -ball -that -takes -place -there -if -nothing -can -be -proven -against -you -and -it -will -be -very -pleasant -for -you -will -see -everybody -except -the -governor -and -add -a -number -of -acquaintances -and -several -friends -to -your -list -the -governor -will -be -in -england -he -always -is -the -continent -has -four -or -five -governors -and -i -do -not -know -how -many -it -takes -to -govern -the -outlying -archipelago -but -anyway -you -will -not -see -them -when -they -are -appointed -they -come -out -from -england -and -get -inaugurated -and -give -a -ball -and -help -pray -for -rain -and -get -aboard -ship -and -go -back -home -and -so -the -lieutenant -governor -has -to -do -all -the -work -i -was -in -australasia -three -months -and -a -half -and -saw -only -one -governor -the -others -were -at -home -the -australasian -governor -would -not -be -so -restless -perhaps -if -he -had -a -war -or -a -veto -or -something -like -that -to -call -for -his -reserve -energies -but -he -hasn't -there -isn't -any -war -and -there -isn't -any -veto -in -his -hands -and -so -there -is -really -little -or -nothing -doing -in -his -line -the -country -governs -itself -and -prefers -to -do -it -and -is -so -strenuous -about -it -and -so -jealous -of -its -independence -that -it -grows -restive -if -even -the -imperial -government -at -home -proposes -to -help -and -so -the -imperial -veto -while -a -fact -is -yet -mainly -a -name -thus -the -governor's -functions -are -much -more -limited -than -are -a -governor's -functions -with -us -and -therefore -more -fatiguing -he -is -the -apparent -head -of -the -state -he -is -the -real -head -of -society -he -represents -culture -refinement -elevated -sentiment -polite -life -religion -and -by -his -example -he -propagates -these -and -they -spread -and -flourish -and -bear -good -fruit -he -creates -the -fashion -and -leads -it -his -ball -is -the -ball -of -balls -and -his -countenance -makes -the -horse -race -thrive -he -is -usually -a -lord -and -this -is -well -for -his -position -compels -him -to -lead -an -expensive -life -and -an -english -lord -is -generally -well -equipped -for -that -another -of -sydney's -social -pleasures -is -the -visit -to -the -admiralty -house -which -is -nobly -situated -on -high -ground -overlooking -the -water -the -trim -boats -of -the -service -convey -the -guests -thither -and -there -or -on -board -the -flag -ship -they -have -the -duplicate -of -the -hospitalities -of -government -house -the -admiral -commanding -a -station -in -british -waters -is -a -magnate -of -the -first -degree -and -he -is -sumptuously -housed -as -becomes -the -dignity -of -his -office -third -in -the -list -of -special -pleasures -is -the -tour -of -the -harbor -in -a -fine -steam -pleasure -launch -your -richer -friends -own -boats -of -this -kind -and -they -will -invite -you -and -the -joys -of -the -trip -will -make -a -long -day -seem -short -and -finally -comes -the -shark -fishing -sydney -harbor -is -populous -with -the -finest -breeds -of -man -eating -sharks -in -the -world -some -people -make -their -living -catching -them -for -the -government -pays -a -cash -bounty -on -them -the -larger -the -shark -the -larger -the -bounty -and -some -of -the -sharks -are -twenty -feet -long -you -not -only -get -the -bounty -but -everything -that -is -in -the -shark -belongs -to -you -sometimes -the -contents -are -quite -valuable -the -shark -is -the -swiftest -fish -that -swims -the -speed -of -the -fastest -steamer -afloat -is -poor -compared -to -his -and -he -is -a -great -gad -about -and -roams -far -and -wide -in -the -oceans -and -visits -the -shores -of -all -of -them -ultimately -in -the -course -of -his -restless -excursions -i -have -a -tale -to -tell -now -which -has -not -as -yet -been -in -print -in -1870 -a -young -stranger -arrived -in -sydney -and -set -about -finding -something -to -do -but -he -knew -no -one -and -brought -no -recommendations -and -the -result -was -that -he -got -no -employment -he -had -aimed -high -at -first -but -as -time -and -his -money -wasted -away -he -grew -less -and -less -exacting -until -at -last -he -was -willing -to -serve -in -the -humblest -capacities -if -so -he -might -get -bread -and -shelter -but -luck -was -still -against -him -he -could -find -no -opening -of -any -sort -finally -his -money -was -all -gone -he -walked -the -streets -all -day -thinking -he -walked -them -all -night -thinking -thinking -and -growing -hungrier -and -hungrier -at -dawn -he -found -himself -well -away -from -the -town -and -drifting -aimlessly -along -the -harbor -shore -as -he -was -passing -by -a -nodding -shark -fisher -the -man -looked -up -and -said -say -young -fellow -take -my -line -a -spell -and -change -my -luck -for -me -how -do -you -know -i -won't -make -it -worse -because -you -can't -it -has -been -at -its -worst -all -night -if -you -can't -change -it -no -harm's -done -if -you -do -change -it -it's -for -the -better -of -course -come -all -right -what -will -you -give -i'll -give -you -the -shark -if -you -catch -one -and -i -will -eat -it -bones -and -all -give -me -the -line -here -you -are -i -will -get -away -now -for -awhile -so -that -my -luck -won't -spoil -yours -for -many -and -many -a -time -i've -noticed -that -if -there -pull -in -pull -in -man -you've -got -a -bite! -i -knew -how -it -would -be -why -i -knew -you -for -a -born -son -of -luck -the -minute -i -saw -you -all -right -he's -landed -it -was -an -unusually -large -shark -a -full -nineteen -footer -the -fisherman -said -as -he -laid -the -creature -open -with -his -knife -now -you -rob -him -young -man -while -i -step -to -my -hamper -for -a -fresh -bait -there's -generally -something -in -them -worth -going -for -you've -changed -my -luck -you -see -but -my -goodness -i -hope -you -haven't -changed -your -own -oh -it -wouldn't -matter -don't -worry -about -that -get -your -bait -i'll -rob -him -when -the -fisherman -got -back -the -young -man -had -just -finished -washing -his -hands -in -the -bay -and -was -starting -away -what -you -are -not -going -yes -good -bye -but -what -about -your -shark -the -shark -why -what -use -is -he -to -me -what -use -is -he -i -like -that -don't -you -know -that -we -can -go -and -report -him -to -government -and -you'll -get -a -clean -solid -eighty -shillings -bounty -hard -cash -you -know -what -do -you -think -about -it -now -oh -well -you -can -collect -it -and -keep -it -is -that -what -you -mean -yes -well -this -is -odd -you're -one -of -those -sort -they -call -eccentrics -i -judge -the -saying -is -you -mustn't -judge -a -man -by -his -clothes -and -i'm -believing -it -now -why -yours -are -looking -just -ratty -don't -you -know -and -yet -you -must -be -rich -i -am -the -young -man -walked -slowly -back -to -the -town -deeply -musing -as -he -went -he -halted -a -moment -in -front -of -the -best -restaurant -then -glanced -at -his -clothes -and -passed -on -and -got -his -breakfast -at -a -stand -up -there -was -a -good -deal -of -it -and -it -cost -five -shillings -he -tendered -a -sovereign -got -his -change -glanced -at -his -silver -muttered -to -himself -there -isn't -enough -to -buy -clothes -with -and -went -his -way -at -half -past -nine -the -richest -wool -broker -in -sydney -was -sitting -in -his -morning -room -at -home -settling -his -breakfast -with -the -morning -paper -a -servant -put -his -head -in -and -said -there's -a -sundowner -at -the -door -wants -to -see -you -sir -what -do -you -bring -that -kind -of -a -message -here -for -send -him -about -his -business -he -won't -go -sir -i've -tried -he -won't -go -that's -why -that's -unusual -he's -one -of -two -things -then -he's -a -remarkable -person -or -he's -crazy -is -he -crazy -no -sir -he -don't -look -it -then -he's -remarkable -what -does -he -say -he -wants -he -won't -tell -sir -only -says -it's -very -important -and -won't -go -does -he -say -he -won't -go -says -he'll -stand -there -till -he -sees -you -sir -if -it's -all -day -and -yet -isn't -crazy -show -him -up -the -sundowner -was -shown -in -the -broker -said -to -himself -no -he's -not -crazy -that -is -easy -to -see -so -he -must -be -the -other -thing -then -aloud -well -my -good -fellow -be -quick -about -it -don't -waste -any -words -what -is -it -you -want -i -want -to -borrow -a -hundred -thousand -pounds -scott! -it's -a -mistake -he -is -crazy -no -he -can't -be -not -with -that -eye -why -you -take -my -breath -away -come -who -are -you -nobody -that -you -know -what -is -your -name -cecil -rhodes -no -i -don't -remember -hearing -the -name -before -now -then -just -for -curiosity's -sake -what -has -sent -you -to -me -on -this -extraordinary -errand -the -intention -to -make -a -hundred -thousand -pounds -for -you -and -as -much -for -myself -within -the -next -sixty -days -well -well -well -it -is -the -most -extraordinary -idea -that -sit -down -you -interest -me -and -somehow -you -well -you -fascinate -me -i -think -that -that -is -about -the -word -and -it -isn't -your -proposition -no -that -doesn't -fascinate -me -it's -something -else -i -don't -quite -know -what -something -that's -born -in -you -and -oozes -out -of -you -i -suppose -now -then -just -for -curiosity's -sake -again -nothing -more -as -i -understand -it -it -is -your -desire -to -bor -i -said -intention -pardon -so -you -did -i -thought -it -was -an -unheedful -use -of -the -word -an -unheedful -valuing -of -its -strength -you -know -i -knew -its -strength -well -i -must -say -but -look -here -let -me -walk -the -floor -a -little -my -mind -is -getting -into -a -sort -of -whirl -though -you -don't -seem -disturbed -any -plainly -this -young -fellow -isn't -crazy -but -as -to -his -being -remarkable -well -really -he -amounts -to -that -and -something -over -now -then -i -believe -i -am -beyond -the -reach -of -further -astonishment -strike -and -spare -not -what -is -your -scheme -to -buy -the -wool -crop -deliverable -in -sixty -days -what -the -whole -of -it -the -whole -of -it -no -i -was -not -quite -out -of -the -reach -of -surprises -after -all -why -how -you -talk! -do -you -know -what -our -crop -is -going -to -foot -up -two -and -a -half -million -sterling -maybe -a -little -more -well -you've -got -your -statistics -right -any -way -now -then -do -you -know -what -the -margins -would -foot -up -to -buy -it -at -sixty -days -the -hundred -thousand -pounds -i -came -here -to -get -right -once -more -well -dear -me -just -to -see -what -would -happen -i -wish -you -had -the -money -and -if -you -had -it -what -would -you -do -with -it -i -shall -make -two -hundred -thousand -pounds -out -of -it -in -sixty -days -you -mean -of -course -that -you -might -make -it -if -i -said -'shall' -yes -by -george -you -did -say -'shall'! -you -are -the -most -definite -devil -i -ever -saw -in -the -matter -of -language -dear -dear -dear -look -here! -definite -speech -means -clarity -of -mind -upon -my -word -i -believe -you've -got -what -you -believe -to -be -a -rational -reason -for -venturing -into -this -house -an -entire -stranger -on -this -wild -scheme -of -buying -the -wool -crop -of -an -entire -colony -on -speculation -bring -it -out -i -am -prepared -acclimatized -if -i -may -use -the -word -why -would -you -buy -the -crop -and -why -would -you -make -that -sum -out -of -it -that -is -to -say -what -makes -you -think -you -i -don't -think -i -know -definite -again -how -do -you -know -because -france -has -declared -war -against -germany -and -wool -has -gone -up -fourteen -per -cent -in -london -and -is -still -rising -oh -in -deed -now -then -i've -got -you! -such -a -thunderbolt -as -you -have -just -let -fly -ought -to -have -made -me -jump -out -of -my -chair -but -it -didn't -stir -me -the -least -little -bit -you -see -and -for -a -very -simple -reason -i -have -read -the -morning -paper -you -can -look -at -it -if -you -want -to -the -fastest -ship -in -the -service -arrived -at -eleven -o'clock -last -night -fifty -days -out -from -london -all -her -news -is -printed -here -there -are -no -war -clouds -anywhere -and -as -for -wool -why -it -is -the -low -spiritedest -commodity -in -the -english -market -it -is -your -turn -to -jump -now -well -why -don't -you -jump -why -do -you -sit -there -in -that -placid -fashion -when -because -i -have -later -news -later -news -oh -come -later -news -than -fifty -days -brought -steaming -hot -from -london -by -the -my -news -is -only -ten -days -old -oh -mun -chausen -hear -the -maniac -talk! -where -did -you -get -it -got -it -out -of -a -shark -oh -oh -oh -this -is -too -much! -front! -call -the -police -bring -the -gun -raise -the -town! -all -the -asylums -in -christendom -have -broken -loose -in -the -single -person -of -sit -down! -and -collect -yourself -where -is -the -use -in -getting -excited -am -i -excited -there -is -nothing -to -get -excited -about -when -i -make -a -statement -which -i -cannot -prove -it -will -be -time -enough -for -you -to -begin -to -offer -hospitality -to -damaging -fancies -about -me -and -my -sanity -oh -a -thousand -thousand -pardons! -i -ought -to -be -ashamed -of -myself -and -i -am -ashamed -of -myself -for -thinking -that -a -little -bit -of -a -circumstance -like -sending -a -shark -to -england -to -fetch -back -a -market -report -what -does -your -middle -initial -stand -for -sir -andrew -what -are -you -writing -wait -a -moment -proof -about -the -shark -and -another -matter -only -ten -lines -there -now -it -is -done -sign -it -many -thanks -many -let -me -see -it -says -it -says -oh -come -this -is -interesting! -why -why -look -here! -prove -what -you -say -here -and -i'll -put -up -the -money -and -double -as -much -if -necessary -and -divide -the -winnings -with -you -half -and -half -there -now -i've -signed -make -your -promise -good -if -you -can -show -me -a -copy -of -the -london -times -only -ten -days -old -here -it -is -and -with -it -these -buttons -and -a -memorandum -book -that -belonged -to -the -man -the -shark -swallowed -swallowed -him -in -the -thames -without -a -doubt -for -you -will -notice -that -the -last -entry -in -the -book -is -dated -'london -' -and -is -of -the -same -date -as -the -times -and -says -'ber -confequentz -der -kreigeseflarun -reife -ich -heute -nach -deutchland -ab -aur -bak -ich -mein -leben -auf -dem -ultar -meines -landes -legen -mag' -as -clean -native -german -as -anybody -can -put -upon -paper -and -means -that -in -consequence -of -the -declaration -of -war -this -loyal -soul -is -leaving -for -home -to -day -to -fight -and -he -did -leave -too -but -the -shark -had -him -before -the -day -was -done -poor -fellow -and -a -pity -too -but -there -are -times -for -mourning -and -we -will -attend -to -this -case -further -on -other -matters -are -pressing -now -i -will -go -down -and -set -the -machinery -in -motion -in -a -quiet -way -and -buy -the -crop -it -will -cheer -the -drooping -spirits -of -the -boys -in -a -transitory -way -everything -is -transitory -in -this -world -sixty -days -hence -when -they -are -called -to -deliver -the -goods -they -will -think -they've -been -struck -by -lightning -but -there -is -a -time -for -mourning -and -we -will -attend -to -that -case -along -with -the -other -one -come -along -i'll -take -you -to -my -tailor -what -did -you -say -your -name -is -cecil -rhodes -it -is -hard -to -remember -however -i -think -you -will -make -it -easier -by -and -by -if -you -live -there -are -three -kinds -of -people -commonplace -men -remarkable -men -and -lunatics -i'll -classify -you -with -the -remarkables -and -take -the -chances -the -deal -went -through -and -secured -to -the -young -stranger -the -first -fortune -he -ever -pocketed -the -people -of -sydney -ought -to -be -afraid -of -the -sharks -but -for -some -reason -they -do -not -seem -to -be -on -saturdays -the -young -men -go -out -in -their -boats -and -sometimes -the -water -is -fairly -covered -with -the -little -sails -a -boat -upsets -now -and -then -by -accident -a -result -of -tumultuous -skylarking -sometimes -the -boys -upset -their -boat -for -fun -such -as -it -is -with -sharks -visibly -waiting -around -for -just -such -an -occurrence -the -young -fellows -scramble -aboard -whole -sometimes -not -always -tragedies -have -happened -more -than -once -while -i -was -in -sydney -it -was -reported -that -a -boy -fell -out -of -a -boat -in -the -mouth -of -the -paramatta -river -and -screamed -for -help -and -a -boy -jumped -overboard -from -another -boat -to -save -him -from -the -assembling -sharks -but -the -sharks -made -swift -work -with -the -lives -of -both -the -government -pays -a -bounty -for -the -shark -to -get -the -bounty -the -fishermen -bait -the -hook -or -the -seine -with -agreeable -mutton -the -news -spreads -and -the -sharks -come -from -all -over -the -pacific -ocean -to -get -the -free -board -in -time -the -shark -culture -will -be -one -of -the -most -successful -things -in -the -colony -chapter -xiv -we -can -secure -other -people's -approval -if -we -do -right -and -try -hard -but -our -own -is -worth -a -hundred -of -it -and -no -way -has -been -found -out -of -securing -that -pudd'nhead -wilson's -new -calendar -my -health -had -broken -down -in -new -york -in -may -it -had -remained -in -a -doubtful -but -fairish -condition -during -a -succeeding -period -of -82 -days -it -broke -again -on -the -pacific -it -broke -again -in -sydney -but -not -until -after -i -had -had -a -good -outing -and -had -also -filled -my -lecture -engagements -this -latest -break -lost -me -the -chance -of -seeing -queensland -in -the -circumstances -to -go -north -toward -hotter -weather -was -not -advisable -so -we -moved -south -with -a -westward -slant -17 -hours -by -rail -to -the -capital -of -the -colony -of -victoria -melbourne -that -juvenile -city -of -sixty -years -and -half -a -million -inhabitants -on -the -map -the -distance -looked -small -but -that -is -a -trouble -with -all -divisions -of -distance -in -such -a -vast -country -as -australia -the -colony -of -victoria -itself -looks -small -on -the -map -looks -like -a -county -in -fact -yet -it -is -about -as -large -as -england -scotland -and -wales -combined -or -to -get -another -focus -upon -it -it -is -just -80 -times -as -large -as -the -state -of -rhode -island -and -one -third -as -large -as -the -state -of -texas -outside -of -melbourne -victoria -seems -to -be -owned -by -a -handful -of -squatters -each -with -a -rhode -island -for -a -sheep -farm -that -is -the -impression -which -one -gathers -from -common -talk -yet -the -wool -industry -of -victoria -is -by -no -means -so -great -as -that -of -new -south -wales -the -climate -of -victoria -is -favorable -to -other -great -industries -among -others -wheat -growing -and -the -making -of -wine -we -took -the -train -at -sydney -at -about -four -in -the -afternoon -it -was -american -in -one -way -for -we -had -a -most -rational -sleeping -car -also -the -car -was -clean -and -fine -and -new -nothing -about -it -to -suggest -the -rolling -stock -of -the -continent -of -europe -but -our -baggage -was -weighed -and -extra -weight -charged -for -that -was -continental -continental -and -troublesome -any -detail -of -railroading -that -is -not -troublesome -cannot -honorably -be -described -as -continental -the -tickets -were -round -trip -ones -to -melbourne -and -clear -to -adelaide -in -south -australia -and -then -all -the -way -back -to -sydney -twelve -hundred -more -miles -than -we -really -expected -to -make -but -then -as -the -round -trip -wouldn't -cost -much -more -than -the -single -trip -it -seemed -well -enough -to -buy -as -many -miles -as -one -could -afford -even -if -one -was -not -likely -to -need -them -a -human -being -has -a -natural -desire -to -have -more -of -a -good -thing -than -he -needs -now -comes -a -singular -thing -the -oddest -thing -the -strangest -thing -the -most -baffling -and -unaccountable -marvel -that -australasia -can -show -at -the -frontier -between -new -south -wales -and -victoria -our -multitude -of -passengers -were -routed -out -of -their -snug -beds -by -lantern -light -in -the -morning -in -the -biting -cold -of -a -high -altitude -to -change -cars -on -a -road -that -has -no -break -in -it -from -sydney -to -melbourne! -think -of -the -paralysis -of -intellect -that -gave -that -idea -birth -imagine -the -boulder -it -emerged -from -on -some -petrified -legislator's -shoulders -it -is -a -narrow -gage -road -to -the -frontier -and -a -broader -gauge -thence -to -melbourne -the -two -governments -were -the -builders -of -the -road -and -are -the -owners -of -it -one -or -two -reasons -are -given -for -this -curious -state -of -things -one -is -that -it -represents -the -jealousy -existing -between -the -colonies -the -two -most -important -colonies -of -australasia -what -the -other -one -is -i -have -forgotten -but -it -is -of -no -consequence -it -could -be -but -another -effort -to -explain -the -inexplicable -all -passengers -fret -at -the -double -gauge -all -shippers -of -freight -must -of -course -fret -at -it -unnecessary -expense -delay -and -annoyance -are -imposed -upon -everybody -concerned -and -no -one -is -benefitted -each -australian -colony -fences -itself -off -from -its -neighbor -with -a -custom -house -personally -i -have -no -objection -but -it -must -be -a -good -deal -of -inconvenience -to -the -people -we -have -something -resembling -it -here -and -there -in -america -but -it -goes -by -another -name -the -large -empire -of -the -pacific -coast -requires -a -world -of -iron -machinery -and -could -manufacture -it -economically -on -the -spot -if -the -imposts -on -foreign -iron -were -removed -but -they -are -not -protection -to -pennsylvania -and -alabama -forbids -it -the -result -to -the -pacific -coast -is -the -same -as -if -there -were -several -rows -of -custom -fences -between -the -coast -and -the -east -iron -carted -across -the -american -continent -at -luxurious -railway -rates -would -be -valuable -enough -to -be -coined -when -it -arrived -we -changed -cars -this -was -at -albury -and -it -was -there -i -think -that -the -growing -day -and -the -early -sun -exposed -the -distant -range -called -the -blue -mountains -accurately -named -my -word! -as -the -australians -say -but -it -was -a -stunning -color -that -blue -deep -strong -rich -exquisite -towering -and -majestic -masses -of -blue -a -softly -luminous -blue -a -smouldering -blue -as -if -vaguely -lit -by -fires -within -it -extinguished -the -blue -of -the -sky -made -it -pallid -and -unwholesome -whitey -and -washed -out -a -wonderful -color -just -divine -a -resident -told -me -that -those -were -not -mountains -he -said -they -were -rabbit -piles -and -explained -that -long -exposure -and -the -over -ripe -condition -of -the -rabbits -was -what -made -them -look -so -blue -this -man -may -have -been -right -but -much -reading -of -books -of -travel -has -made -me -distrustful -of -gratis -information -furnished -by -unofficial -residents -of -a -country -the -facts -which -such -people -give -to -travelers -are -usually -erroneous -and -often -intemperately -so -the -rabbit -plague -has -indeed -been -very -bad -in -australia -and -it -could -account -for -one -mountain -but -not -for -a -mountain -range -it -seems -to -me -it -is -too -large -an -order -we -breakfasted -at -the -station -a -good -breakfast -except -the -coffee -and -cheap -the -government -establishes -the -prices -and -placards -them -the -waiters -were -men -i -think -but -that -is -not -usual -in -australasia -the -usual -thing -is -to -have -girls -no -not -girls -young -ladies -generally -duchesses -dress -they -would -attract -attention -at -any -royal -levee -in -europe -even -empresses -and -queens -do -not -dress -as -they -do -not -that -they -could -not -afford -it -perhaps -but -they -would -not -know -how -all -the -pleasant -morning -we -slid -smoothly -along -over -the -plains -through -thin -not -thick -forests -of -great -melancholy -gum -trees -with -trunks -rugged -with -curled -sheets -of -flaking -bark -erysipelas -convalescents -so -to -speak -shedding -their -dead -skins -and -all -along -were -tiny -cabins -built -sometimes -of -wood -sometimes -of -gray -blue -corrugated -iron -and -the -doorsteps -and -fences -were -clogged -with -children -rugged -little -simply -clad -chaps -that -looked -as -if -they -had -been -imported -from -the -banks -of -the -mississippi -without -breaking -bulk -and -there -were -little -villages -with -neat -stations -well -placarded -with -showy -advertisements -mainly -of -almost -too -self -righteous -brands -of -sheepdip -if -that -is -the -name -and -i -think -it -is -it -is -a -stuff -like -tar -and -is -dabbed -on -to -places -where -the -shearer -clips -a -piece -out -of -the -sheep -it -bars -out -the -flies -and -has -healing -properties -and -a -nip -to -it -which -makes -the -sheep -skip -like -the -cattle -on -a -thousand -hills -it -is -not -good -to -eat -that -is -it -is -not -good -to -eat -except -when -mixed -with -railroad -coffee -it -improves -railroad -coffee -without -it -railroad -coffee -is -too -vague -but -with -it -it -is -quite -assertive -and -enthusiastic -by -itself -railroad -coffee -is -too -passive -but -sheep -dip -makes -it -wake -up -and -get -down -to -business -i -wonder -where -they -get -railroad -coffee -we -saw -birds -but -not -a -kangaroo -not -an -emu -not -an -ornithorhynchus -not -a -lecturer -not -a -native -indeed -the -land -seemed -quite -destitute -of -game -but -i -have -misused -the -word -native -in -australia -it -is -applied -to -australian -born -whites -only -i -should -have -said -that -we -saw -no -aboriginals -no -blackfellows -and -to -this -day -i -have -never -seen -one -in -the -great -museums -you -will -find -all -the -other -curiosities -but -in -the -curio -of -chiefest -interest -to -the -stranger -all -of -them -are -lacking -we -have -at -home -an -abundance -of -museums -and -not -an -american -indian -in -them -it -is -clearly -an -absurdity -but -it -never -struck -me -before -chapter -xv -truth -is -stranger -than -fiction -to -some -people -but -i -am -measurably -familiar -with -it -pudd'nhead -wilson's -new -calendar -truth -is -stranger -than -fiction -but -it -is -because -fiction -is -obliged -to -stick -to -possibilities -truth -isn't -pudd'nhead -wilson's -new -calendar -the -air -was -balmy -and -delicious -the -sunshine -radiant -it -was -a -charming -excursion -in -the -course -of -it -we -came -to -a -town -whose -odd -name -was -famous -all -over -the -world -a -quarter -of -a -century -ago -wagga -wagga -this -was -because -the -tichborne -claimant -had -kept -a -butcher -shop -there -it -was -out -of -the -midst -of -his -humble -collection -of -sausages -and -tripe -that -he -soared -up -into -the -zenith -of -notoriety -and -hung -there -in -the -wastes -of -space -a -time -with -the -telescopes -of -all -nations -leveled -at -him -in -unappeasable -curiosity -curiosity -as -to -which -of -the -two -long -missing -persons -he -was -arthur -orton -the -mislaid -roustabout -of -wapping -or -sir -roger -tichborne -the -lost -heir -of -a -name -and -estates -as -old -as -english -history -we -all -know -now -but -not -a -dozen -people -knew -then -and -the -dozen -kept -the -mystery -to -themselves -and -allowed -the -most -intricate -and -fascinating -and -marvelous -real -life -romance -that -has -ever -been -played -upon -the -world's -stage -to -unfold -itself -serenely -act -by -act -in -a -british -court -by -the -long -and -laborious -processes -of -judicial -development -when -we -recall -the -details -of -that -great -romance -we -marvel -to -see -what -daring -chances -truth -may -freely -take -in -constructing -a -tale -as -compared -with -the -poor -little -conservative -risks -permitted -to -fiction -the -fiction -artist -could -achieve -no -success -with -the -materials -of -this -splendid -tichborne -romance -he -would -have -to -drop -out -the -chief -characters -the -public -would -say -such -people -are -impossible -he -would -have -to -drop -out -a -number -of -the -most -picturesque -incidents -the -public -would -say -such -things -could -never -happen -and -yet -the -chief -characters -did -exist -and -the -incidents -did -happen -it -cost -the -tichborne -estates -$400 -000 -to -unmask -the -claimant -and -drive -him -out -and -even -after -the -exposure -multitudes -of -englishmen -still -believed -in -him -it -cost -the -british -government -another -$400 -000 -to -convict -him -of -perjury -and -after -the -conviction -the -same -old -multitudes -still -believed -in -him -and -among -these -believers -were -many -educated -and -intelligent -men -and -some -of -them -had -personally -known -the -real -sir -roger -the -claimant -was -sentenced -to -14 -years' -imprisonment -when -he -got -out -of -prison -he -went -to -new -york -and -kept -a -whisky -saloon -in -the -bowery -for -a -time -then -disappeared -from -view -he -always -claimed -to -be -sir -roger -tichborne -until -death -called -for -him -this -was -but -a -few -months -ago -not -very -much -short -of -a -generation -since -he -left -wagga -wagga -to -go -and -possess -himself -of -his -estates -on -his -death -bed -he -yielded -up -his -secret -and -confessed -in -writing -that -he -was -only -arthur -orton -of -wapping -able -seaman -and -butcher -that -and -nothing -more -but -it -is -scarcely -to -be -doubted -that -there -are -people -whom -even -his -dying -confession -will -not -convince -the -old -habit -of -assimilating -incredibilities -must -have -made -strong -food -a -necessity -in -their -case -a -weaker -article -would -probably -disagree -with -them -i -was -in -london -when -the -claimant -stood -his -trial -for -perjury -i -attended -one -of -his -showy -evenings -in -the -sumptuous -quarters -provided -for -him -from -the -purses -of -his -adherents -and -well -wishers -he -was -in -evening -dress -and -i -thought -him -a -rather -fine -and -stately -creature -there -were -about -twenty -five -gentlemen -present -educated -men -men -moving -in -good -society -none -of -them -commonplace -some -of -them -were -men -of -distinction -none -of -them -were -obscurities -they -were -his -cordial -friends -and -admirers -it -was -sir -roger -always -sir -roger -on -all -hands -no -one -withheld -the -title -all -turned -it -from -the -tongue -with -unction -and -as -if -it -tasted -good -for -many -years -i -had -had -a -mystery -in -stock -melbourne -and -only -melbourne -could -unriddle -it -for -me -in -1873 -i -arrived -in -london -with -my -wife -and -young -child -and -presently -received -a -note -from -naples -signed -by -a -name -not -familiar -to -me -it -was -not -bascom -and -it -was -not -henry -but -i -will -call -it -henry -bascom -for -convenience's -sake -this -note -of -about -six -lines -was -written -on -a -strip -of -white -paper -whose -end -edges -were -ragged -i -came -to -be -familiar -with -those -strips -in -later -years -their -size -and -pattern -were -always -the -same -their -contents -were -usually -to -the -same -effect -would -i -and -mine -come -to -the -writer's -country -place -in -england -on -such -and -such -a -date -by -such -and -such -a -train -and -stay -twelve -days -and -depart -by -such -and -such -a -train -at -the -end -of -the -specified -time -a -carriage -would -meet -us -at -the -station -these -invitations -were -always -for -a -long -time -ahead -if -we -were -in -europe -three -months -ahead -if -we -were -in -america -six -to -twelve -months -ahead -they -always -named -the -exact -date -and -train -for -the -beginning -and -also -for -the -end -of -the -visit -this -first -note -invited -us -for -a -date -three -months -in -the -future -it -asked -us -to -arrive -by -the -4 -10 -p -m -train -from -london -august -6th -the -carriage -would -be -waiting -the -carriage -would -take -us -away -seven -days -later -train -specified -and -there -were -these -words -speak -to -tom -hughes -i -showed -the -note -to -the -author -of -tom -brown -at -rugby -and -be -said -accept -and -be -thankful -he -described -mr -bascom -as -being -a -man -of -genius -a -man -of -fine -attainments -a -choice -man -in -every -way -a -rare -and -beautiful -character -he -said -that -bascom -hall -was -a -particularly -fine -example -of -the -stately -manorial -mansion -of -elizabeth's -days -and -that -it -was -a -house -worth -going -a -long -way -to -see -like -knowle -that -mr -b -was -of -a -social -disposition -liked -the -company -of -agreeable -people -and -always -had -samples -of -the -sort -coming -and -going -we -paid -the -visit -we -paid -others -in -later -years -the -last -one -in -1879 -soon -after -that -mr -bascom -started -on -a -voyage -around -the -world -in -a -steam -yacht -a -long -and -leisurely -trip -for -he -was -making -collections -in -all -lands -of -birds -butterflies -and -such -things -the -day -that -president -garfield -was -shot -by -the -assassin -guiteau -we -were -at -a -little -watering -place -on -long -island -sound -and -in -the -mail -matter -of -that -day -came -a -letter -with -the -melbourne -post -mark -on -it -it -was -for -my -wife -but -i -recognized -mr -bascom's -handwriting -on -the -envelope -and -opened -it -it -was -the -usual -note -as -to -paucity -of -lines -and -was -written -on -the -customary -strip -of -paper -but -there -was -nothing -usual -about -the -contents -the -note -informed -my -wife -that -if -it -would -be -any -assuagement -of -her -grief -to -know -that -her -husband's -lecture -tour -in -australia -was -a -satisfactory -venture -from -the -beginning -to -the -end -he -the -writer -could -testify -that -such -was -the -case -also -that -her -husband's -untimely -death -had -been -mourned -by -all -classes -as -she -would -already -know -by -the -press -telegrams -long -before -the -reception -of -this -note -that -the -funeral -was -attended -by -the -officials -of -the -colonial -and -city -governments -and -that -while -he -the -writer -her -friend -and -mine -had -not -reached -melbourne -in -time -to -see -the -body -he -had -at -least -had -the -sad -privilege -of -acting -as -one -of -the -pall -bearers -signed -henry -bascom -my -first -thought -was -why -didn't -he -have -the -coffin -opened -he -would -have -seen -that -the -corpse -was -an -imposter -and -he -could -have -gone -right -ahead -and -dried -up -the -most -of -those -tears -and -comforted -those -sorrowing -governments -and -sold -the -remains -and -sent -me -the -money -i -did -nothing -about -the -matter -i -had -set -the -law -after -living -lecture -doubles -of -mine -a -couple -of -times -in -america -and -the -law -had -not -been -able -to -catch -them -others -in -my -trade -had -tried -to -catch -their -impostor -doubles -and -had -failed -then -where -was -the -use -in -harrying -a -ghost -none -and -so -i -did -not -disturb -it -i -had -a -curiosity -to -know -about -that -man's -lecture -tour -and -last -moments -but -that -could -wait -when -i -should -see -mr -bascom -he -would -tell -me -all -about -it -but -he -passed -from -life -and -i -never -saw -him -again -my -curiosity -faded -away -however -when -i -found -that -i -was -going -to -australia -it -revived -and -naturally -for -if -the -people -should -say -that -i -was -a -dull -poor -thing -compared -to -what -i -was -before -i -died -it -would -have -a -bad -effect -on -business -well -to -my -surprise -the -sydney -journalists -had -never -heard -of -that -impostor! -i -pressed -them -but -they -were -firm -they -had -never -heard -of -him -and -didn't -believe -in -him -i -could -not -understand -it -still -i -thought -it -would -all -come -right -in -melbourne -the -government -would -remember -and -the -other -mourners -at -the -supper -of -the -institute -of -journalists -i -should -find -out -all -about -the -matter -but -no -it -turned -out -that -they -had -never -heard -of -it -so -my -mystery -was -a -mystery -still -it -was -a -great -disappointment -i -believed -it -would -never -be -cleared -up -in -this -life -so -i -dropped -it -out -of -my -mind -but -at -last! -just -when -i -was -least -expecting -it -however -this -is -not -the -place -for -the -rest -of -it -i -shall -come -to -the -matter -again -in -a -far -distant -chapter -chapter -xvi -there -is -a -moral -sense -and -there -is -an -immoral -sense -history -shows -us -that -the -moral -sense -enables -us -to -perceive -morality -and -how -to -avoid -it -and -that -the -immoral -sense -enables -us -to -perceive -immorality -and -how -to -enjoy -it -pudd'nhead -wilson's -new -calendar -melbourne -spreads -around -over -an -immense -area -of -ground -it -is -a -stately -city -architecturally -as -well -as -in -magnitude -it -has -an -elaborate -system -of -cable -car -service -it -has -museums -and -colleges -and -schools -and -public -gardens -and -electricity -and -gas -and -libraries -and -theaters -and -mining -centers -and -wool -centers -and -centers -of -the -arts -and -sciences -and -boards -of -trade -and -ships -and -railroads -and -a -harbor -and -social -clubs -and -journalistic -clubs -and -racing -clubs -and -a -squatter -club -sumptuously -housed -and -appointed -and -as -many -churches -and -banks -as -can -make -a -living -in -a -word -it -is -equipped -with -everything -that -goes -to -make -the -modern -great -city -it -is -the -largest -city -of -australasia -and -fills -the -post -with -honor -and -credit -it -has -one -specialty -this -must -not -be -jumbled -in -with -those -other -things -it -is -the -mitred -metropolitan -of -the -horse -racing -cult -its -race -ground -is -the -mecca -of -australasia -on -the -great -annual -day -of -sacrifice -the -5th -of -november -guy -fawkes's -day -business -is -suspended -over -a -stretch -of -land -and -sea -as -wide -as -from -new -york -to -san -francisco -and -deeper -than -from -the -northern -lakes -to -the -gulf -of -mexico -and -every -man -and -woman -of -high -degree -or -low -who -can -afford -the -expense -put -away -their -other -duties -and -come -they -begin -to -swarm -in -by -ship -and -rail -a -fortnight -before -the -day -and -they -swarm -thicker -and -thicker -day -after -day -until -all -the -vehicles -of -transportation -are -taxed -to -their -uttermost -to -meet -the -demands -of -the -occasion -and -all -hotels -and -lodgings -are -bulging -outward -because -of -the -pressure -from -within -they -come -a -hundred -thousand -strong -as -all -the -best -authorities -say -and -they -pack -the -spacious -grounds -and -grandstands -and -make -a -spectacle -such -as -is -never -to -be -seen -in -australasia -elsewhere -it -is -the -melbourne -cup -that -brings -this -multitude -together -their -clothes -have -been -ordered -long -ago -at -unlimited -cost -and -without -bounds -as -to -beauty -and -magnificence -and -have -been -kept -in -concealment -until -now -for -unto -this -day -are -they -consecrate -i -am -speaking -of -the -ladies' -clothes -but -one -might -know -that -and -so -the -grand -stands -make -a -brilliant -and -wonderful -spectacle -a -delirium -of -color -a -vision -of -beauty -the -champagne -flows -everybody -is -vivacious -excited -happy -everybody -bets -and -gloves -and -fortunes -change -hands -right -along -all -the -time -day -after -day -the -races -go -on -and -the -fun -and -the -excitement -are -kept -at -white -heat -and -when -each -day -is -done -the -people -dance -all -night -so -as -to -be -fresh -for -the -race -in -the -morning -and -at -the -end -of -the -great -week -the -swarms -secure -lodgings -and -transportation -for -next -year -then -flock -away -to -their -remote -homes -and -count -their -gains -and -losses -and -order -next -year's -cup -clothes -and -then -lie -down -and -sleep -two -weeks -and -get -up -sorry -to -reflect -that -a -whole -year -must -be -put -in -somehow -or -other -before -they -can -be -wholly -happy -again -the -melbourne -cup -is -the -australasian -national -day -it -would -be -difficult -to -overstate -its -importance -it -overshadows -all -other -holidays -and -specialized -days -of -whatever -sort -in -that -congeries -of -colonies -overshadows -them -i -might -almost -say -it -blots -them -out -each -of -them -gets -attention -but -not -everybody's -each -of -them -evokes -interest -but -not -everybody's -each -of -them -rouses -enthusiasm -but -not -everybody's -in -each -case -a -part -of -the -attention -interest -and -enthusiasm -is -a -matter -of -habit -and -custom -and -another -part -of -it -is -official -and -perfunctory -cup -day -and -cup -day -only -commands -an -attention -an -interest -and -an -enthusiasm -which -are -universal -and -spontaneous -not -perfunctory -cup -day -is -supreme -it -has -no -rival -i -can -call -to -mind -no -specialized -annual -day -in -any -country -which -can -be -named -by -that -large -name -supreme -i -can -call -to -mind -no -specialized -annual -day -in -any -country -whose -approach -fires -the -whole -land -with -a -conflagration -of -conversation -and -preparation -and -anticipation -and -jubilation -no -day -save -this -one -but -this -one -does -it -in -america -we -have -no -annual -supreme -day -no -day -whose -approach -makes -the -whole -nation -glad -we -have -the -fourth -of -july -and -christmas -and -thanksgiving -neither -of -them -can -claim -the -primacy -neither -of -them -can -arouse -an -enthusiasm -which -comes -near -to -being -universal -eight -grown -americans -out -of -ten -dread -the -coming -of -the -fourth -with -its -pandemonium -and -its -perils -and -they -rejoice -when -it -is -gone -if -still -alive -the -approach -of -christmas -brings -harassment -and -dread -to -many -excellent -people -they -have -to -buy -a -cart -load -of -presents -and -they -never -know -what -to -buy -to -hit -the -various -tastes -they -put -in -three -weeks -of -hard -and -anxious -work -and -when -christmas -morning -comes -they -are -so -dissatisfied -with -the -result -and -so -disappointed -that -they -want -to -sit -down -and -cry -then -they -give -thanks -that -christmas -comes -but -once -a -year -the -observance -of -thanksgiving -day -as -a -function -has -become -general -of -late -years -the -thankfulness -is -not -so -general -this -is -natural -two -thirds -of -the -nation -have -always -had -hard -luck -and -a -hard -time -during -the -year -and -this -has -a -calming -effect -upon -their -enthusiasm -we -have -a -supreme -day -a -sweeping -and -tremendous -and -tumultuous -day -a -day -which -commands -an -absolute -universality -of -interest -and -excitement -but -it -is -not -annual -it -comes -but -once -in -four -years -therefore -it -cannot -count -as -a -rival -of -the -melbourne -cup -in -great -britain -and -ireland -they -have -two -great -days -christmas -and -the -queen's -birthday -but -they -are -equally -popular -there -is -no -supremacy -i -think -it -must -be -conceded -that -the -position -of -the -australasian -day -is -unique -solitary -unfellowed -and -likely -to -hold -that -high -place -a -long -time -the -next -things -which -interest -us -when -we -travel -are -first -the -people -next -the -novelties -and -finally -the -history -of -the -places -and -countries -visited -novelties -are -rare -in -cities -which -represent -the -most -advanced -civilization -of -the -modern -day -when -one -is -familiar -with -such -cities -in -the -other -parts -of -the -world -he -is -in -effect -familiar -with -the -cities -of -australasia -the -outside -aspects -will -furnish -little -that -is -new -there -will -be -new -names -but -the -things -which -they -represent -will -sometimes -be -found -to -be -less -new -than -their -names -there -may -be -shades -of -difference -but -these -can -easily -be -too -fine -for -detection -by -the -incompetent -eye -of -the -passing -stranger -in -the -larrikin -he -will -not -be -able -to -discover -a -new -species -but -only -an -old -one -met -elsewhere -and -variously -called -loafer -rough -tough -bummer -or -blatherskite -according -to -his -geographical -distribution -the -larrikin -differs -by -a -shade -from -those -others -in -that -he -is -more -sociable -toward -the -stranger -than -they -more -kindly -disposed -more -hospitable -more -hearty -more -friendly -at -least -it -seemed -so -to -me -and -i -had -opportunity -to -observe -in -sydney -at -least -in -melbourne -i -had -to -drive -to -and -from -the -lecture -theater -but -in -sydney -i -was -able -to -walk -both -ways -and -did -it -every -night -on -my -way -home -at -ten -or -a -quarter -past -i -found -the -larrikin -grouped -in -considerable -force -at -several -of -the -street -corners -and -he -always -gave -me -this -pleasant -salutation -hello -mark! -here's -to -you -old -chap! -say -mark! -is -he -dead -a -reference -to -a -passage -in -some -book -of -mine -though -i -did -not -detect -at -that -time -that -that -was -its -source -and -i -didn't -detect -it -afterward -in -melbourne -when -i -came -on -the -stage -for -the -first -time -and -the -same -question -was -dropped -down -upon -me -from -the -dizzy -height -of -the -gallery -it -is -always -difficult -to -answer -a -sudden -inquiry -like -that -when -you -have -come -unprepared -and -don't -know -what -it -means -i -will -remark -here -if -it -is -not -an -indecorum -that -the -welcome -which -an -american -lecturer -gets -from -a -british -colonial -audience -is -a -thing -which -will -move -him -to -his -deepest -deeps -and -veil -his -sight -and -break -his -voice -and -from -winnipeg -to -africa -experience -will -teach -him -nothing -he -will -never -learn -to -expect -it -it -will -catch -him -as -a -surprise -each -time -the -war -cloud -hanging -black -over -england -and -america -made -no -trouble -for -me -i -was -a -prospective -prisoner -of -war -but -at -dinners -suppers -on -the -platform -and -elsewhere -there -was -never -anything -to -remind -me -of -it -this -was -hospitality -of -the -right -metal -and -would -have -been -prominently -lacking -in -some -countries -in -the -circumstances -and -speaking -of -the -war -flurry -it -seemed -to -me -to -bring -to -light -the -unexpected -in -a -detail -or -two -it -seemed -to -relegate -the -war -talk -to -the -politicians -on -both -sides -of -the -water -whereas -whenever -a -prospective -war -between -two -nations -had -been -in -the -air -theretofore -the -public -had -done -most -of -the -talking -and -the -bitterest -the -attitude -of -the -newspapers -was -new -also -i -speak -of -those -of -australasia -and -india -for -i -had -access -to -those -only -they -treated -the -subject -argumentatively -and -with -dignity -not -with -spite -and -anger -that -was -a -new -spirit -too -and -not -learned -of -the -french -and -german -press -either -before -sedan -or -since -i -heard -many -public -speeches -and -they -reflected -the -moderation -of -the -journals -the -outlook -is -that -the -english -speaking -race -will -dominate -the -earth -a -hundred -years -from -now -if -its -sections -do -not -get -to -fighting -each -other -it -would -be -a -pity -to -spoil -that -prospect -by -baffling -and -retarding -wars -when -arbitration -would -settle -their -differences -so -much -better -and -also -so -much -more -definitely -no -as -i -have -suggested -novelties -are -rare -in -the -great -capitals -of -modern -times -even -the -wool -exchange -in -melbourne -could -not -be -told -from -the -familiar -stock -exchange -of -other -countries -wool -brokers -are -just -like -stockbrokers -they -all -bounce -from -their -seats -and -put -up -their -hands -and -yell -in -unison -no -stranger -can -tell -what -and -the -president -calmly -says -sold -to -smith -& -co -threpence -farthing -next! -when -probably -nothing -of -the -kind -happened -for -how -should -he -know -in -the -museums -you -will -find -acres -of -the -most -strange -and -fascinating -things -but -all -museums -are -fascinating -and -they -do -so -tire -your -eyes -and -break -your -back -and -burn -out -your -vitalities -with -their -consuming -interest -you -always -say -you -will -never -go -again -but -you -do -go -the -palaces -of -the -rich -in -melbourne -are -much -like -the -palaces -of -the -rich -in -america -and -the -life -in -them -is -the -same -but -there -the -resemblance -ends -the -grounds -surrounding -the -american -palace -are -not -often -large -and -not -often -beautiful -but -in -the -melbourne -case -the -grounds -are -often -ducally -spacious -and -the -climate -and -the -gardeners -together -make -them -as -beautiful -as -a -dream -it -is -said -that -some -of -the -country -seats -have -grounds -domains -about -them -which -rival -in -charm -and -magnitude -those -which -surround -the -country -mansion -of -an -english -lord -but -i -was -not -out -in -the -country -i -had -my -hands -full -in -town -and -what -was -the -origin -of -this -majestic -city -and -its -efflorescence -of -palatial -town -houses -and -country -seats -its -first -brick -was -laid -and -its -first -house -built -by -a -passing -convict -australian -history -is -almost -always -picturesque -indeed -it -is -so -curious -and -strange -that -it -is -itself -the -chiefest -novelty -the -country -has -to -offer -and -so -it -pushes -the -other -novelties -into -second -and -third -place -it -does -not -read -like -history -but -like -the -most -beautiful -lies -and -all -of -a -fresh -new -sort -no -mouldy -old -stale -ones -it -is -full -of -surprises -and -adventures -and -incongruities -and -contradictions -and -incredibilities -but -they -are -all -true -they -all -happened -chapter -xvii -the -english -are -mentioned -in -the -bible -blessed -are -the -meek -for -they -shall -inherit -the -earth -pudd'nhead -wilson's -new -calendar -when -we -consider -the -immensity -of -the -british -empire -in -territory -population -and -trade -it -requires -a -stern -exercise -of -faith -to -believe -in -the -figures -which -represent -australasia's -contribution -to -the -empire's -commercial -grandeur -as -compared -with -the -landed -estate -of -the -british -empire -the -landed -estate -dominated -by -any -other -power -except -one -russia -is -not -very -impressive -for -size -my -authorities -make -the -british -empire -not -much -short -of -a -fourth -larger -than -the -russian -empire -roughly -proportioned -if -you -will -allow -your -entire -hand -to -represent -the -british -empire -you -may -then -cut -off -the -fingers -a -trifle -above -the -middle -joint -of -the -middle -finger -and -what -is -left -of -the -hand -will -represent -russia -the -populations -ruled -by -great -britain -and -china -are -about -the -same -400 -000 -000 -each -no -other -power -approaches -these -figures -even -russia -is -left -far -behind -the -population -of -australasia -4 -000 -000 -sinks -into -nothingness -and -is -lost -from -sight -in -that -british -ocean -of -400 -000 -000 -yet -the -statistics -indicate -that -it -rises -again -and -shows -up -very -conspicuously -when -its -share -of -the -empire's -commerce -is -the -matter -under -consideration -the -value -of -england's -annual -exports -and -imports -is -stated -at -three -billions -of -dollars -[new -south -wales -blue -book -] -and -it -is -claimed -that -more -than -one -tenth -of -this -great -aggregate -is -represented -by -australasia's -exports -to -england -and -imports -from -england -in -addition -to -this -australasia -does -a -trade -with -countries -other -than -england -amounting -to -a -hundred -million -dollars -a -year -and -a -domestic -intercolonial -trade -amounting -to -a -hundred -and -fifty -millions -in -round -numbers -the -4 -000 -000 -buy -and -sell -about -$600 -000 -000 -worth -of -goods -a -year -it -is -claimed -that -about -half -of -this -represents -commodities -of -australasian -production -the -products -exported -annually -by -india -are -worth -a -trifle -over -$500 -000 -000 -now -here -are -some -faith -straining -figures -indian -production -300 -000 -000 -population -$500 -000 -000 -australasian -production -4 -000 -000 -population -$300 -000 -000 -that -is -to -say -the -product -of -the -individual -indian -annually -for -export -some -whither -is -worth -$1 -15 -that -of -the -individual -australasian -for -export -some -whither -$75! -or -to -put -it -in -another -way -the -indian -family -of -man -and -wife -and -three -children -sends -away -an -annual -result -worth -$8 -75 -while -the -australasian -family -sends -away -$375 -worth -there -are -trustworthy -statistics -furnished -by -sir -richard -temple -and -others -which -show -that -the -individual -indian's -whole -annual -product -both -for -export -and -home -use -is -worth -in -gold -only -$7 -50 -or -$37 -50 -for -the -family -aggregate -ciphered -out -on -a -like -ratio -of -multiplication -the -australasian -family's -aggregate -production -would -be -nearly -$1 -600 -truly -nothing -is -so -astonishing -as -figures -if -they -once -get -started -we -left -melbourne -by -rail -for -adelaide -the -capital -of -the -vast -province -of -south -australia -a -seventeen -hour -excursion -on -the -train -we -found -several -sydney -friends -among -them -a -judge -who -was -going -out -on -circuit -and -was -going -to -hold -court -at -broken -hill -where -the -celebrated -silver -mine -is -it -seemed -a -curious -road -to -take -to -get -to -that -region -broken -hill -is -close -to -the -western -border -of -new -south -wales -and -sydney -is -on -the -eastern -border -a -fairly -straight -line -700 -miles -long -drawn -westward -from -sydney -would -strike -broken -hill -just -as -a -somewhat -shorter -one -drawn -west -from -boston -would -strike -buffalo -the -way -the -judge -was -traveling -would -carry -him -over -2 -000 -miles -by -rail -he -said -southwest -from -sydney -down -to -melbourne -then -northward -up -to -adelaide -then -a -cant -back -northeastward -and -over -the -border -into -new -south -wales -once -more -to -broken -hill -it -was -like -going -from -boston -southwest -to -richmond -virginia -then -northwest -up -to -erie -pennsylvania -then -a -cant -back -northeast -and -over -the -border -to -buffalo -new -york -but -the -explanation -was -simple -years -ago -the -fabulously -rich -silver -discovery -at -broken -hill -burst -suddenly -upon -an -unexpectant -world -its -stocks -started -at -shillings -and -went -by -leaps -and -bounds -to -the -most -fanciful -figures -it -was -one -of -those -cases -where -the -cook -puts -a -month's -wages -into -shares -and -comes -next -mouth -and -buys -your -house -at -your -own -price -and -moves -into -it -herself -where -the -coachman -takes -a -few -shares -and -next -month -sets -up -a -bank -and -where -the -common -sailor -invests -the -price -of -a -spree -and -next -month -buys -out -the -steamship -company -and -goes -into -business -on -his -own -hook -in -a -word -it -was -one -of -those -excitements -which -bring -multitudes -of -people -to -a -common -center -with -a -rush -and -whose -needs -must -be -supplied -and -at -once -adelaide -was -close -by -sydney -was -far -away -adelaide -threw -a -short -railway -across -the -border -before -sydney -had -time -to -arrange -for -a -long -one -it -was -not -worth -while -for -sydney -to -arrange -at -all -the -whole -vast -trade -profit -of -broken -hill -fell -into -adelaide's -hands -irrevocably -new -south -wales -furnishes -for -broken -hill -and -sends -her -judges -2 -000 -miles -mainly -through -alien -countries -to -administer -it -but -adelaide -takes -the -dividends -and -makes -no -moan -we -started -at -4 -20 -in -the -afternoon -and -moved -across -level -until -night -in -the -morning -we -had -a -stretch -of -scrub -country -the -kind -of -thing -which -is -so -useful -to -the -australian -novelist -in -the -scrub -the -hostile -aboriginal -lurks -and -flits -mysteriously -about -slipping -out -from -time -to -time -to -surprise -and -slaughter -the -settler -then -slipping -back -again -and -leaving -no -track -that -the -white -man -can -follow -in -the -scrub -the -novelist's -heroine -gets -lost -search -fails -of -result -she -wanders -here -and -there -and -finally -sinks -down -exhausted -and -unconscious -and -the -searchers -pass -within -a -yard -or -two -of -her -not -suspecting -that -she -is -near -and -by -and -by -some -rambler -finds -her -bones -and -the -pathetic -diary -which -she -had -scribbled -with -her -failing -hand -and -left -behind -nobody -can -find -a -lost -heroine -in -the -scrub -but -the -aboriginal -tracker -and -he -will -not -lend -himself -to -the -scheme -if -it -will -interfere -with -the -novelist's -plot -the -scrub -stretches -miles -and -miles -in -all -directions -and -looks -like -a -level -roof -of -bush -tops -without -a -break -or -a -crack -in -it -as -seamless -as -a -blanket -to -all -appearance -one -might -as -well -walk -under -water -and -hope -to -guess -out -a -route -and -stick -to -it -i -should -think -yet -it -is -claimed -that -the -aboriginal -tracker -was -able -to -hunt -out -people -lost -in -the -scrub -also -in -the -bush -also -in -the -desert -and -even -follow -them -over -patches -of -bare -rocks -and -over -alluvial -ground -which -had -to -all -appearance -been -washed -clear -of -footprints -from -reading -australian -books -and -talking -with -the -people -i -became -convinced -that -the -aboriginal -tracker's -performances -evince -a -craft -a -penetration -a -luminous -sagacity -and -a -minuteness -and -accuracy -of -observation -in -the -matter -of -detective -work -not -found -in -nearly -so -remarkable -a -degree -in -any -other -people -white -or -colored -in -an -official -account -of -the -blacks -of -australia -published -by -the -government -of -victoria -one -reads -that -the -aboriginal -not -only -notices -the -faint -marks -left -on -the -bark -of -a -tree -by -the -claws -of -a -climbing -opossum -but -knows -in -some -way -or -other -whether -the -marks -were -made -to -day -or -yesterday -and -there -is -the -case -on -records -where -a -a -settler -makes -a -bet -with -b -that -b -may -lose -a -cow -as -effectually -as -he -can -and -a -will -produce -an -aboriginal -who -will -find -her -b -selects -a -cow -and -lets -the -tracker -see -the -cow's -footprint -then -be -put -under -guard -b -then -drives -the -cow -a -few -miles -over -a -course -which -drifts -in -all -directions -and -frequently -doubles -back -upon -itself -and -he -selects -difficult -ground -all -the -time -and -once -or -twice -even -drives -the -cow -through -herds -of -other -cows -and -mingles -her -tracks -in -the -wide -confusion -of -theirs -he -finally -brings -his -cow -home -the -aboriginal -is -set -at -liberty -and -at -once -moves -around -in -a -great -circle -examining -all -cow -tracks -until -he -finds -the -one -he -is -after -then -sets -off -and -follows -it -throughout -its -erratic -course -and -ultimately -tracks -it -to -the -stable -where -b -has -hidden -the -cow -now -wherein -does -one -cow -track -differ -from -another -there -must -be -a -difference -or -the -tracker -could -not -have -performed -the -feat -a -difference -minute -shadowy -and -not -detectible -by -you -or -me -or -by -the -late -sherlock -holmes -and -yet -discernible -by -a -member -of -a -race -charged -by -some -people -with -occupying -the -bottom -place -in -the -gradations -of -human -intelligence -chapter -xviii -it -is -easier -to -stay -out -than -get -out -pudd'nhead -wilson's -new -calendar -the -train -was -now -exploring -a -beautiful -hill -country -and -went -twisting -in -and -out -through -lovely -little -green -valleys -there -were -several -varieties -of -gum -trees -among -them -many -giants -some -of -them -were -bodied -and -barked -like -the -sycamore -some -were -of -fantastic -aspect -and -reminded -one -of -the -quaint -apple -trees -in -japanese -pictures -and -there -was -one -peculiarly -beautiful -tree -whose -name -and -breed -i -did -not -know -the -foliage -seemed -to -consist -of -big -bunches -of -pine -spines -the -lower -half -of -each -bunch -a -rich -brown -or -old -gold -color -the -upper -half -a -most -vivid -and -strenuous -and -shouting -green -the -effect -was -altogether -bewitching -the -tree -was -apparently -rare -i -should -say -that -the -first -and -last -samples -of -it -seen -by -us -were -not -more -than -half -an -hour -apart -there -was -another -tree -of -striking -aspect -a -kind -of -pine -we -were -told -its -foliage -was -as -fine -as -hair -apparently -and -its -mass -sphered -itself -above -the -naked -straight -stem -like -an -explosion -of -misty -smoke -it -was -not -a -sociable -sort -it -did -not -gather -in -groups -or -couples -but -each -individual -stood -far -away -from -its -nearest -neighbor -it -scattered -itself -in -this -spacious -and -exclusive -fashion -about -the -slopes -of -swelling -grassy -great -knolls -and -stood -in -the -full -flood -of -the -wonderful -sunshine -and -as -far -as -you -could -see -the -tree -itself -you -could -also -see -the -ink -black -blot -of -its -shadow -on -the -shining -green -carpet -at -its -feet -on -some -part -of -this -railway -journey -we -saw -gorse -and -broom -importations -from -england -and -a -gentleman -who -came -into -our -compartment -on -a -visit -tried -to -tell -me -which -was -which -but -as -he -didn't -know -he -had -difficulty -he -said -he -was -ashamed -of -his -ignorance -but -that -he -had -never -been -confronted -with -the -question -before -during -the -fifty -years -and -more -that -he -had -spent -in -australia -and -so -he -had -never -happened -to -get -interested -in -the -matter -but -there -was -no -need -to -be -ashamed -the -most -of -us -have -his -defect -we -take -a -natural -interest -in -novelties -but -it -is -against -nature -to -take -an -interest -in -familiar -things -the -gorse -and -the -broom -were -a -fine -accent -in -the -landscape -here -and -there -they -burst -out -in -sudden -conflagrations -of -vivid -yellow -against -a -background -of -sober -or -sombre -color -with -a -so -startling -effect -as -to -make -a -body -catch -his -breath -with -the -happy -surprise -of -it -and -then -there -was -the -wattle -a -native -bush -or -tree -an -inspiring -cloud -of -sumptuous -yellow -bloom -it -is -a -favorite -with -the -australians -and -has -a -fine -fragrance -a -quality -usually -wanting -in -australian -blossoms -the -gentleman -who -enriched -me -with -the -poverty -of -his -formation -about -the -gorse -and -the -broom -told -me -that -he -came -out -from -england -a -youth -of -twenty -and -entered -the -province -of -south -australia -with -thirty -six -shillings -in -his -pocket -an -adventurer -without -trade -profession -or -friends -but -with -a -clearly -defined -purpose -in -his -head -he -would -stay -until -he -was -worth -l200 -then -go -back -home -he -would -allow -himself -five -years -for -the -accumulation -of -this -fortune -that -was -more -than -fifty -years -ago -said -he -and -here -i -am -yet -as -he -went -out -at -the -door -he -met -a -friend -and -turned -and -introduced -him -to -me -and -the -friend -and -i -had -a -talk -and -a -smoke -i -spoke -of -the -previous -conversation -and -said -there -something -very -pathetic -about -this -half -century -of -exile -and -that -i -wished -the -l200 -scheme -had -succeeded -with -him -oh -it -did -it's -not -so -sad -a -case -he -is -modest -and -he -left -out -some -of -the -particulars -the -lad -reached -south -australia -just -in -time -to -help -discover -the -burra -burra -copper -mines -they -turned -out -l700 -000 -in -the -first -three -years -up -to -now -they -have -yielded -l120 -000 -000 -he -has -had -his -share -before -that -boy -had -been -in -the -country -two -years -he -could -have -gone -home -and -bought -a -village -he -could -go -now -and -buy -a -city -i -think -no -there -is -nothing -very -pathetic -about -his -case -he -and -his -copper -arrived -at -just -a -handy -time -to -save -south -australia -it -had -got -mashed -pretty -flat -under -the -collapse -of -a -land -boom -a -while -before -there -it -is -again -picturesque -history -australia's -specialty -in -1829 -south -australia -hadn't -a -white -man -in -it -in -1836 -the -british -parliament -erected -it -still -a -solitude -into -a -province -and -gave -it -a -governor -and -other -governmental -machinery -speculators -took -hold -now -and -inaugurated -a -vast -land -scheme -and -invited -immigration -encouraging -it -with -lurid -promises -of -sudden -wealth -it -was -well -worked -in -london -and -bishops -statesmen -and -all -ports -of -people -made -a -rush -for -the -land -company's -shares -immigrants -soon -began -to -pour -into -the -region -of -adelaide -and -select -town -lots -and -farms -in -the -sand -and -the -mangrove -swamps -by -the -sea -the -crowds -continued -to -come -prices -of -land -rose -high -then -higher -and -still -higher -everybody -was -prosperous -and -happy -the -boom -swelled -into -gigantic -proportions -a -village -of -sheet -iron -huts -and -clapboard -sheds -sprang -up -in -the -sand -and -in -these -wigwams -fashion -made -display -richly -dressed -ladies -played -on -costly -pianos -london -swells -in -evening -dress -and -patent -leather -boots -were -abundant -and -this -fine -society -drank -champagne -and -in -other -ways -conducted -itself -in -this -capital -of -humble -sheds -as -it -had -been -accustomed -to -do -in -the -aristocratic -quarters -of -the -metropolis -of -the -world -the -provincial -government -put -up -expensive -buildings -for -its -own -use -and -a -palace -with -gardens -for -the -use -of -its -governor -the -governor -had -a -guard -and -maintained -a -court -roads -wharves -and -hospitals -were -built -all -this -on -credit -on -paper -on -wind -on -inflated -and -fictitious -values -on -the -boom's -moonshine -in -fact -this -went -on -handsomely -during -four -or -five -years -then -of -a -sudden -came -a -smash -bills -for -a -huge -amount -drawn -the -governor -upon -the -treasury -were -dishonored -the -land -company's -credit -went -up -in -smoke -a -panic -followed -values -fell -with -a -rush -the -frightened -immigrants -seized -their -grips -and -fled -to -other -lands -leaving -behind -them -a -good -imitation -of -a -solitude -where -lately -had -been -a -buzzing -and -populous -hive -of -men -adelaide -was -indeed -almost -empty -its -population -had -fallen -to -3 -000 -during -two -years -or -more -the -death -trance -continued -prospect -of -revival -there -was -none -hope -of -it -ceased -then -as -suddenly -as -the -paralysis -had -come -came -the -resurrection -from -it -those -astonishingly -rich -copper -mines -were -discovered -and -the -corpse -got -up -and -danced -the -wool -production -began -to -grow -grain -raising -followed -followed -so -vigorously -too -that -four -or -five -years -after -the -copper -discovery -this -little -colony -which -had -had -to -import -its -breadstuffs -formerly -and -pay -hard -prices -for -them -once -$50 -a -barrel -for -flour -had -become -an -exporter -of -grain -the -prosperities -continued -after -many -years -providence -desiring -to -show -especial -regard -for -new -south -wales -and -exhibit -loving -interest -in -its -welfare -which -should -certify -to -all -nations -the -recognition -of -that -colony's -conspicuous -righteousness -and -distinguished -well -deserving -conferred -upon -it -that -treasury -of -inconceivable -riches -broken -hill -and -south -australia -went -over -the -border -and -took -it -giving -thanks -among -our -passengers -was -an -american -with -a -unique -vocation -unique -is -a -strong -word -but -i -use -it -justifiably -if -i -did -not -misconceive -what -the -american -told -me -for -i -understood -him -to -say -that -in -the -world -there -was -not -another -man -engaged -in -the -business -which -he -was -following -he -was -buying -the -kangaroo -skin -crop -buying -all -of -it -both -the -australian -crop -and -the -tasmanian -and -buying -it -for -an -american -house -in -new -york -the -prices -were -not -high -as -there -was -no -competition -but -the -year's -aggregate -of -skins -would -cost -him -l30 -000 -i -had -had -the -idea -that -the -kangaroo -was -about -extinct -in -tasmania -and -well -thinned -out -on -the -continent -in -america -the -skins -are -tanned -and -made -into -shoes -after -the -tanning -the -leather -takes -a -new -name -which -i -have -forgotten -i -only -remember -that -the -new -name -does -not -indicate -that -the -kangaroo -furnishes -the -leather -there -was -a -german -competition -for -a -while -some -years -ago -but -that -has -ceased -the -germans -failed -to -arrive -at -the -secret -of -tanning -the -skins -successfully -and -they -withdrew -from -the -business -now -then -i -suppose -that -i -have -seen -a -man -whose -occupation -is -really -entitled -to -bear -that -high -epithet -unique -and -i -suppose -that -there -is -not -another -occupation -in -the -world -that -is -restricted -to -the -hands -of -a -sole -person -i -can -think -of -no -instance -of -it -there -is -more -than -one -pope -there -is -more -than -one -emperor -there -is -even -more -than -one -living -god -walking -upon -the -earth -and -worshiped -in -all -sincerity -by -large -populations -of -men -i -have -seen -and -talked -with -two -of -these -beings -myself -in -india -and -i -have -the -autograph -of -one -of -them -it -can -come -good -by -and -by -i -reckon -if -i -attach -it -to -a -permit -approaching -adelaide -we -dismounted -from -the -train -as -the -french -say -and -were -driven -in -an -open -carriage -over -the -hills -and -along -their -slopes -to -the -city -it -was -an -excursion -of -an -hour -or -two -and -the -charm -of -it -could -not -be -overstated -i -think -the -road -wound -around -gaps -and -gorges -and -offered -all -varieties -of -scenery -and -prospect -mountains -crags -country -homes -gardens -forests -color -color -color -everywhere -and -the -air -fine -and -fresh -the -skies -blue -and -not -a -shred -of -cloud -to -mar -the -downpour -of -the -brilliant -sunshine -and -finally -the -mountain -gateway -opened -and -the -immense -plain -lay -spread -out -below -and -stretching -away -into -dim -distances -on -every -hand -soft -and -delicate -and -dainty -and -beautiful -on -its -near -edge -reposed -the -city -we -descended -and -entered -there -was -nothing -to -remind -one -of -the -humble -capital -of -buts -and -sheds -of -the -long -vanished -day -of -the -land -boom -no -this -was -a -modern -city -with -wide -streets -compactly -built -with -fine -homes -everywhere -embowered -in -foliage -and -flowers -and -with -imposing -masses -of -public -buildings -nobly -grouped -and -architecturally -beautiful -there -was -prosperity -in -the -air -for -another -boom -was -on -providence -desiring -to -show -especial -regard -for -the -neighboring -colony -on -the -west -called -western -australia -and -exhibit -a -loving -interest -in -its -welfare -which -should -certify -to -all -nations -the -recognition -of -that -colony's -conspicuous -righteousness -and -distinguished -well -deserving -had -recently -conferred -upon -it -that -majestic -treasury -of -golden -riches -coolgardie -and -now -south -australia -had -gone -around -the -corner -and -taken -it -giving -thanks -everything -comes -to -him -who -is -patient -and -good -and -waits -but -south -australia -deserves -much -for -apparently -she -is -a -hospitable -home -for -every -alien -who -chooses -to -come -and -for -his -religion -too -she -has -a -population -as -per -the -latest -census -of -only -320 -000 -odd -and -yet -her -varieties -of -religion -indicate -the -presence -within -her -borders -of -samples -of -people -from -pretty -nearly -every -part -of -the -globe -you -can -think -of -tabulated -these -varieties -of -religion -make -a -remarkable -show -one -would -have -to -go -far -to -find -its -match -i -copy -here -this -cosmopolitan -curiosity -and -it -comes -from -the -published -census -church -of -england -89 -271 -roman -catholic -47 -179 -wesleyan -49 -159 -lutheran -23 -328 -presbyterian -18 -206 -congregationalist -11 -882 -bible -christian -15 -762 -primitive -methodist -11 -654 -baptist -17 -547 -christian -brethren -465 -methodist -new -connexion -39 -unitarian -688 -church -of -christ -3 -367 -society -of -friends -100 -salvation -army -4 -356 -new -jerusalem -church -168 -jews -840 -protestants -undefined -6 -532 -mohammedans -299 -confucians -etc -3 -884 -other -religions -1 -719 -object -6 -940 -not -stated -8 -046 -total -320 -431 -the -item -in -the -above -list -other -religions -includes -the -following -as -returned -agnostics -atheists -believers -in -christ -buddhists -calvinists -christadelphians -christians -christ's -chapel -christian -israelites -christian -socialists -church -of -god -cosmopolitans -deists -evangelists -exclusive -brethren -free -church -free -methodists -freethinkers -followers -of -christ -gospel -meetings -greek -church -infidels -maronites -memnonists -moravians -mormons -naturalists -orthodox -others -indefinite -pagans -pantheists -plymouth -brethren -rationalists -reformers -secularists -seventh -day -adventists -shaker -shintoists -spiritualists -theosophists -town -city -mission -welsh -church -huguenot -hussite -zoroastrians -zwinglian -about -64 -roads -to -the -other -world -you -see -how -healthy -the -religious -atmosphere -is -anything -can -live -in -it -agnostics -atheists -freethinkers -infidels -mormons -pagans -indefinites -they -are -all -there -and -all -the -big -sects -of -the -world -can -do -more -than -merely -live -in -it -they -can -spread -flourish -prosper -all -except -the -spiritualists -and -the -theosophists -that -is -the -most -curious -feature -of -this -curious -table -what -is -the -matter -with -the -specter -why -do -they -puff -him -away -he -is -a -welcome -toy -everywhere -else -in -the -world -chapter -xix -pity -is -for -the -living -envy -is -for -the -dead -pudd'nhead -wilson's -new -calendar -the -successor -of -the -sheet -iron -hamlet -of -the -mangrove -marshes -has -that -other -australian -specialty -the -botanical -gardens -we -cannot -have -these -paradises -the -best -we -could -do -would -be -to -cover -a -vast -acreage -under -glass -and -apply -steam -heat -but -it -would -be -inadequate -the -lacks -would -still -be -so -great -the -confined -sense -the -sense -of -suffocation -the -atmospheric -dimness -the -sweaty -heat -these -would -all -be -there -in -place -of -the -australian -openness -to -the -sky -the -sunshine -and -the -breeze -whatever -will -grow -under -glass -with -us -will -flourish -rampantly -out -of -doors -in -australia -[the -greatest -heat -in -victoria -that -there -is -an -authoritative -record -of -was -at -sandhurst -in -january -1862 -the -thermometer -then -registered -117 -degrees -in -the -shade -in -january -1880 -the -heat -at -adelaide -south -australia -was -172 -degrees -in -the -sun -] -when -the -white -man -came -the -continent -was -nearly -as -poor -in -variety -of -vegetation -as -the -desert -of -sahara -now -it -has -everything -that -grows -on -the -earth -in -fact -not -australia -only -but -all -australasia -has -levied -tribute -upon -the -flora -of -the -rest -of -the -world -and -wherever -one -goes -the -results -appear -in -gardens -private -and -public -in -the -woodsy -walls -of -the -highways -and -in -even -the -forests -if -you -see -a -curious -or -beautiful -tree -or -bush -or -flower -and -ask -about -it -the -people -answering -usually -name -a -foreign -country -as -the -place -of -its -origin -india -africa -japan -china -england -america -java -sumatra -new -guinea -polynesia -and -so -on -in -the -zoological -gardens -of -adelaide -i -saw -the -only -laughing -jackass -that -ever -showed -any -disposition -to -be -courteous -to -me -this -one -opened -his -head -wide -and -laughed -like -a -demon -or -like -a -maniac -who -was -consumed -with -humorous -scorn -over -a -cheap -and -degraded -pun -it -was -a -very -human -laugh -if -he -had -been -out -of -sight -i -could -have -believed -that -the -laughter -came -from -a -man -it -is -an -odd -looking -bird -with -a -head -and -beak -that -are -much -too -large -for -its -body -in -time -man -will -exterminate -the -rest -of -the -wild -creatures -of -australia -but -this -one -will -probably -survive -for -man -is -his -friend -and -lets -him -alone -man -always -has -a -good -reason -for -his -charities -towards -wild -things -human -or -animal -when -he -has -any -in -this -case -the -bird -is -spared -because -he -kills -snakes -if -l -j -he -will -not -kill -all -of -them -in -that -garden -i -also -saw -the -wild -australian -dog -the -dingo -he -was -a -beautiful -creature -shapely -graceful -a -little -wolfish -in -some -of -his -aspects -but -with -a -most -friendly -eye -and -sociable -disposition -the -dingo -is -not -an -importation -he -was -present -in -great -force -when -the -whites -first -came -to -the -continent -it -may -be -that -he -is -the -oldest -dog -in -the -universe -his -origin -his -descent -the -place -where -his -ancestors -first -appeared -are -as -unknown -and -as -untraceable -as -are -the -camel's -he -is -the -most -precious -dog -in -the -world -for -he -does -not -bark -but -in -an -evil -hour -he -got -to -raiding -the -sheep -runs -to -appease -his -hunger -and -that -sealed -his -doom -he -is -hunted -now -just -as -if -he -were -a -wolf -he -has -been -sentenced -to -extermination -and -the -sentence -will -be -carried -out -this -is -all -right -and -not -objectionable -the -world -was -made -for -man -the -white -man -south -australia -is -confusingly -named -all -of -the -colonies -have -a -southern -exposure -except -one -queensland -properly -speaking -south -australia -is -middle -australia -it -extends -straight -up -through -the -center -of -the -continent -like -the -middle -board -in -a -center -table -it -is -2 -000 -miles -high -from -south -to -north -and -about -a -third -as -wide -a -wee -little -spot -down -in -its -southeastern -corner -contains -eight -or -nine -tenths -of -its -population -the -other -one -or -two -tenths -are -elsewhere -as -elsewhere -as -they -could -be -in -the -united -states -with -all -the -country -between -denver -and -chicago -and -canada -and -the -gulf -of -mexico -to -scatter -over -there -is -plenty -of -room -a -telegraph -line -stretches -straight -up -north -through -that -2 -000 -miles -of -wilderness -and -desert -from -adelaide -to -port -darwin -on -the -edge -of -the -upper -ocean -south -australia -built -the -line -and -did -it -in -1871 -2 -when -her -population -numbered -only -185 -000 -it -was -a -great -work -for -there -were -no -roads -no -paths -1 -300 -miles -of -the -route -had -been -traversed -but -once -before -by -white -men -provisions -wire -and -poles -had -to -be -carried -over -immense -stretches -of -desert -wells -had -to -be -dug -along -the -route -to -supply -the -men -and -cattle -with -water -a -cable -had -been -previously -laid -from -port -darwin -to -java -and -thence -to -india -and -there -was -telegraphic -communication -with -england -from -india -and -so -if -adelaide -could -make -connection -with -port -darwin -it -meant -connection -with -the -whole -world -the -enterprise -succeeded -one -could -watch -the -london -markets -daily -now -the -profit -to -the -wool -growers -of -australia -was -instant -and -enormous -a -telegram -from -melbourne -to -san -francisco -covers -approximately -20 -000 -miles -the -equivalent -of -five -sixths -of -the -way -around -the -globe -it -has -to -halt -along -the -way -a -good -many -times -and -be -repeated -still -but -little -time -is -lost -these -halts -and -the -distances -between -them -are -here -tabulated -[from -round -the -empire -george -r -parkin -all -but -the -last -two -] -miles -melbourne -mount -gambier -300 -mount -gambier -adelaide -270 -adelaide -port -augusta -200 -port -augusta -alice -springs -1 -036 -alice -springs -port -darwin -898 -port -darwin -banjoewangie -1 -150 -banjoewangie -batavia -480 -batavia -singapore -553 -singapore -penang -399 -penang -madras -1 -280 -madras -bombay -650 -bombay -aden -1 -662 -aden -suez -1 -346 -suez -alexandria -224 -alexandria -malta -828 -malta -gibraltar -1 -008 -gibraltar -falmouth -1 -061 -falmouth -london -350 -london -new -york -2 -500 -new -york -san -francisco -3 -500 -i -was -in -adelaide -again -some -months -later -and -saw -the -multitudes -gather -in -the -neighboring -city -of -glenelg -to -commemorate -the -reading -of -the -proclamation -in -1836 -which -founded -the -province -if -i -have -at -any -time -called -it -a -colony -i -withdraw -the -discourtesy -it -is -not -a -colony -it -is -a -province -and -officially -so -moreover -it -is -the -only -one -so -named -in -australasia -there -was -great -enthusiasm -it -was -the -province's -national -holiday -its -fourth -of -july -so -to -speak -it -is -the -pre -eminent -holiday -and -that -is -saying -much -in -a -country -where -they -seem -to -have -a -most -un -english -mania -for -holidays -mainly -they -are -workingmen's -holidays -for -in -south -australia -the -workingman -is -sovereign -his -vote -is -the -desire -of -the -politician -indeed -it -is -the -very -breath -of -the -politician's -being -the -parliament -exists -to -deliver -the -will -of -the -workingman -and -the -government -exists -to -execute -it -the -workingman -is -a -great -power -everywhere -in -australia -but -south -australia -is -his -paradise -he -has -had -a -hard -time -in -this -world -and -has -earned -a -paradise -i -am -glad -he -has -found -it -the -holidays -there -are -frequent -enough -to -be -bewildering -to -the -stranger -i -tried -to -get -the -hang -of -the -system -but -was -not -able -to -do -it -you -have -seen -that -the -province -is -tolerant -religious -wise -it -is -so -politically -also -one -of -the -speakers -at -the -commemoration -banquet -the -minister -of -public -works -was -an -american -born -and -reared -in -new -england -there -is -nothing -narrow -about -the -province -politically -or -in -any -other -way -that -i -know -of -sixty -four -religions -and -a -yankee -cabinet -minister -no -amount -of -horse -racing -can -damn -this -community -the -mean -temperature -of -the -province -is -62 -deg -the -death -rate -is -13 -in -the -1 -000 -about -half -what -it -is -in -the -city -of -new -york -i -should -think -and -new -york -is -a -healthy -city -thirteen -is -the -death -rate -for -the -average -citizen -of -the -province -but -there -seems -to -be -no -death -rate -for -the -old -people -there -were -people -at -the -commemoration -banquet -who -could -remember -cromwell -there -were -six -of -them -these -old -settlers -had -all -been -present -at -the -original -reading -of -the -proclamation -in -1536 -they -showed -signs -of -the -blightings -and -blastings -of -time -in -their -outward -aspect -but -they -were -young -within -young -and -cheerful -and -ready -to -talk -ready -to -talk -and -talk -all -you -wanted -in -their -turn -and -out -of -it -they -were -down -for -six -speeches -and -they -made -42 -the -governor -and -the -cabinet -and -the -mayor -were -down -for -42 -speeches -and -they -made -6 -they -have -splendid -grit -the -old -settlers -splendid -staying -power -but -they -do -not -hear -well -and -when -they -see -the -mayor -going -through -motions -which -they -recognize -as -the -introducing -of -a -speaker -they -think -they -are -the -one -and -they -all -get -up -together -and -begin -to -respond -in -the -most -animated -way -and -the -more -the -mayor -gesticulates -and -shouts -sit -down! -sit -down! -the -more -they -take -it -for -applause -and -the -more -excited -and -reminiscent -and -enthusiastic -they -get -and -next -when -they -see -the -whole -house -laughing -and -crying -three -of -them -think -it -is -about -the -bitter -old -time -hardships -they -are -describing -and -the -other -three -think -the -laughter -is -caused -by -the -jokes -they -have -been -uncorking -jokes -of -the -vintage -of -1836 -and -then -the -way -they -do -go -on! -and -finally -when -ushers -come -and -plead -and -beg -and -gently -and -reverently -crowd -them -down -into -their -seats -they -say -oh -i'm -not -tired -i -could -bang -along -a -week! -and -they -sit -there -looking -simple -and -childlike -and -gentle -and -proud -of -their -oratory -and -wholly -unconscious -of -what -is -going -on -at -the -other -end -of -the -room -and -so -one -of -the -great -dignitaries -gets -a -chance -and -begins -his -carefully -prepared -speech -impressively -and -with -solemnity -when -we -now -great -and -prosperous -and -powerful -bow -our -heads -in -reverent -wonder -in -the -contemplation -of -those -sublimities -of -energy -of -wisdom -of -forethought -of -up -come -the -immortal -six -again -in -a -body -with -a -joyous -hey -i've -thought -of -another -one! -and -at -it -they -go -with -might -and -main -hearing -not -a -whisper -of -the -pandemonium -that -salutes -them -but -taking -all -the -visible -violences -for -applause -as -before -and -hammering -joyously -away -till -the -imploring -ushers -pray -them -into -their -seats -again -and -a -pity -too -for -those -lovely -old -boys -did -so -enjoy -living -their -heroic -youth -over -in -these -days -of -their -honored -antiquity -and -certainly -the -things -they -had -to -tell -were -usually -worth -the -telling -and -the -hearing -it -was -a -stirring -spectacle -stirring -in -more -ways -than -one -for -it -was -amazingly -funny -and -at -the -same -time -deeply -pathetic -for -they -had -seen -so -much -these -time -worn -veterans -end -had -suffered -so -much -and -had -built -so -strongly -and -well -and -laid -the -foundations -of -their -commonwealth -so -deep -in -liberty -and -tolerance -and -had -lived -to -see -the -structure -rise -to -such -state -and -dignity -and -hear -themselves -so -praised -for -honorable -work -one -of -these -old -gentlemen -told -me -some -things -of -interest -afterward -things -about -the -aboriginals -mainly -he -thought -them -intelligent -remarkably -so -in -some -directions -and -he -said -that -along -with -their -unpleasant -qualities -they -had -some -exceedingly -good -ones -and -he -considered -it -a -great -pity -that -the -race -had -died -out -he -instanced -their -invention -of -the -boomerang -and -the -weet -weet -as -evidences -of -their -brightness -and -as -another -evidence -of -it -he -said -he -had -never -seen -a -white -man -who -had -cleverness -enough -to -learn -to -do -the -miracles -with -those -two -toys -that -the -aboriginals -achieved -he -said -that -even -the -smartest -whites -had -been -obliged -to -confess -that -they -could -not -learn -the -trick -of -the -boomerang -in -perfection -that -it -had -possibilities -which -they -could -not -master -the -white -man -could -not -control -its -motions -could -not -make -it -obey -him -but -the -aboriginal -could -he -told -me -some -wonderful -things -some -almost -incredible -things -which -he -had -seen -the -blacks -do -with -the -boomerang -and -the -weet -weet -they -have -been -confirmed -to -me -since -by -other -early -settlers -and -by -trustworthy -books -it -is -contended -and -may -be -said -to -be -conceded -that -the -boomerang -was -known -to -certain -savage -tribes -in -europe -in -roman -times -in -support -of -this -virgil -and -two -other -roman -poets -are -quoted -it -is -also -contended -that -it -was -known -to -the -ancient -egyptians -one -of -two -things -either -some -one -with -is -then -apparent -a -boomerang -arrived -in -australia -in -the -days -of -antiquity -before -european -knowledge -of -the -thing -had -been -lost -or -the -australian -aboriginal -reinvented -it -it -will -take -some -time -to -find -out -which -of -these -two -propositions -is -the -fact -but -there -is -no -hurry -chapter -xx -it -is -by -the -goodness -of -god -that -in -our -country -we -have -those -three -unspeakably -precious -things -freedom -of -speech -freedom -of -conscience -and -the -prudence -never -to -practice -either -of -them -pudd'nhead -wilson's -new -calendar -from -diary -mr -g -called -i -had -not -seen -him -since -nauheim -germany -several -years -ago -the -time -that -the -cholera -broke -out -at -hamburg -we -talked -of -the -people -we -had -known -there -or -had -casually -met -and -g -said -do -you -remember -my -introducing -you -to -an -earl -the -earl -of -c -yes -that -was -the -last -time -i -saw -you -you -and -he -were -in -a -carriage -just -starting -belated -for -the -train -i -remember -it -i -remember -it -too -because -of -a -thing -which -happened -then -which -i -was -not -looking -for -he -had -told -me -a -while -before -about -a -remarkable -and -interesting -californian -whom -he -had -met -and -who -was -a -friend -of -yours -and -said -that -if -he -should -ever -meet -you -he -would -ask -you -for -some -particulars -about -that -californian -the -subject -was -not -mentioned -that -day -at -nauheim -for -we -were -hurrying -away -and -there -was -no -time -but -the -thing -that -surprised -me -was -this -when -i -induced -you -you -said -'i -am -glad -to -meet -your -lordship -gain -' -the -i -again' -was -the -surprise -he -is -a -little -hard -of -hearing -and -didn't -catch -that -word -and -i -thought -you -hadn't -intended -that -he -should -as -we -drove -off -i -had -only -time -to -say -'why -what -do -you -know -about -him -' -and -i -understood -you -to -say -'oh -nothing -except -that -he -is -the -quickest -judge -of -' -then -we -were -gone -and -i -didn't -get -the -rest -i -wondered -what -it -was -that -he -was -such -a -quick -judge -of -i -have -thought -of -it -many -times -since -and -still -wondered -what -it -could -be -he -and -i -talked -it -over -but -could -not -guess -it -out -he -thought -it -must -be -fox -hounds -or -horses -for -he -is -a -good -judge -of -those -no -one -is -a -better -but -you -couldn't -know -that -because -you -didn't -know -him -you -had -mistaken -him -for -some -one -else -it -must -be -that -he -said -because -he -knew -you -had -never -met -him -before -and -of -course -you -hadn't -had -you -yes -i -had -is -that -so -where -at -a -fox -hunt -in -england -how -curious -that -is -why -he -hadn't -the -least -recollection -of -it -had -you -any -conversation -with -him -some -yes -well -it -left -not -the -least -impression -upon -him -what -did -you -talk -about -about -the -fox -i -think -that -was -all -why -that -would -interest -him -that -ought -to -have -left -an -impression -what -did -he -talk -about -the -fox -it's -very -curious -i -don't -understand -it -did -what -he -said -leave -an -impression -upon -you -yes -it -showed -me -that -he -was -a -quick -judge -of -however -i -will -tell -you -all -about -it -then -you -will -understand -it -was -a -quarter -of -a -century -ago -1873 -or -'74 -i -had -an -american -friend -in -london -named -f -who -was -fond -of -hunting -and -his -friends -the -blanks -invited -him -and -me -to -come -out -to -a -hunt -and -be -their -guests -at -their -country -place -in -the -morning -the -mounts -were -provided -but -when -i -saw -the -horses -i -changed -my -mind -and -asked -permission -to -walk -i -had -never -seen -an -english -hunter -before -and -it -seemed -to -me -that -i -could -hunt -a -fox -safer -on -the -ground -i -had -always -been -diffident -about -horses -anyway -even -those -of -the -common -altitudes -and -i -did -not -feel -competent -to -hunt -on -a -horse -that -went -on -stilts -so -then -mrs -blank -came -to -my -help -and -said -i -could -go -with -her -in -the -dog -cart -and -we -would -drive -to -a -place -she -knew -of -and -there -we -should -have -a -good -glimpse -of -the -hunt -as -it -went -by -when -we -got -to -that -place -i -got -out -and -went -and -leaned -my -elbows -on -a -low -stone -wall -which -enclosed -a -turfy -and -beautiful -great -field -with -heavy -wood -on -all -its -sides -except -ours -mrs -blank -sat -in -the -dog -cart -fifty -yards -away -which -was -as -near -as -she -could -get -with -the -vehicle -i -was -full -of -interest -for -i -had -never -seen -a -fox -hunt -i -waited -dreaming -and -imagining -in -the -deep -stillness -and -impressive -tranquility -which -reigned -in -that -retired -spot -presently -from -away -off -in -the -forest -on -the -left -a -mellow -bugle -note -came -floating -then -all -of -a -sudden -a -multitude -of -dogs -burst -out -of -that -forest -and -went -tearing -by -and -disappeared -in -the -forest -on -the -right -there -was -a -pause -and -then -a -cloud -of -horsemen -in -black -caps -and -crimson -coats -plunged -out -of -the -left -hand -forest -and -went -flaming -across -the -field -like -a -prairie -fire -a -stirring -sight -to -see -there -was -one -man -ahead -of -the -rest -and -he -came -spurring -straight -at -me -he -was -fiercely -excited -it -was -fine -to -see -him -ride -he -was -a -master -horseman -he -came -like -a -storm -till -he -was -within -seven -feet -of -me -where -i -was -leaning -on -the -wall -then -he -stood -his -horse -straight -up -in -the -air -on -his -hind -toe -nails -and -shouted -like -a -demon -'which -way'd -the -fox -go -' -i -didn't -much -like -the -tone -but -i -did -not -let -on -for -he -was -excited -you -know -but -i -was -calm -so -i -said -softly -and -without -acrimony -'which -fox -' -it -seemed -to -anger -him -i -don't -know -why -and -he -thundered -out -'which -fox -why -the -fox -which -way -did -the -fox -go -' -i -said -with -great -gentleness -even -argumentatively -'if -you -could -be -a -little -more -definite -a -little -less -vague -because -i -am -a -stranger -and -there -are -many -foxes -as -you -will -know -even -better -than -i -and -unless -i -know -which -one -it -is -that -you -desire -to -identify -and -' -'you're -certainly -the -damdest -idiot -that -has -escaped -in -a -thousand -years!' -and -he -snatched -his -great -horse -around -as -easily -as -i -would -snatch -a -cat -and -was -away -like -a -hurricane -a -very -excitable -man -i -went -back -to -mrs -blank -and -she -was -excited -too -oh -all -alive -she -said -'he -spoke -to -you! -didn't -he -' -'yes -it -is -what -happened -' -'i -knew -it! -i -couldn't -hear -what -he -said -but -i -knew -be -spoke -to -you! -do -you -know -who -it -was -it -was -lord -c -and -he -is -master -of -the -buckhounds! -tell -me -what -do -you -think -of -him -' -'him -well -for -sizing -up -a -stranger -he's -got -the -most -sudden -and -accurate -judgment -of -any -man -i -ever -saw -' -it -pleased -her -i -thought -it -would -g -got -away -from -nauheim -just -in -time -to -escape -being -shut -in -by -the -quarantine -bars -on -the -frontiers -and -so -did -we -for -we -left -the -next -day -but -g -had -a -great -deal -of -trouble -in -getting -by -the -italian -custom -house -and -we -should -have -fared -likewise -but -for -the -thoughtfulness -of -our -consul -general -in -frankfort -he -introduced -me -to -the -italian -consul -general -and -i -brought -away -from -that -consulate -a -letter -which -made -our -way -smooth -it -was -a -dozen -lines -merely -commending -me -in -a -general -way -to -the -courtesies -of -servants -in -his -italian -majesty's -service -but -it -was -more -powerful -than -it -looked -in -addition -to -a -raft -of -ordinary -baggage -we -had -six -or -eight -trunks -which -were -filled -exclusively -with -dutiable -stuff -household -goods -purchased -in -frankfort -for -use -in -florence -where -we -had -taken -a -house -i -was -going -to -ship -these -through -by -express -but -at -the -last -moment -an -order -went -throughout -germany -forbidding -the -moving -of -any -parcels -by -train -unless -the -owner -went -with -them -this -was -a -bad -outlook -we -must -take -these -things -along -and -the -delay -sure -to -be -caused -by -the -examination -of -them -in -the -custom -house -might -lose -us -our -train -i -imagined -all -sorts -of -terrors -and -enlarged -them -steadily -as -we -approached -the -italian -frontier -we -were -six -in -number -clogged -with -all -that -baggage -and -i -was -courier -for -the -party -the -most -incapable -one -they -ever -employed -we -arrived -and -pressed -with -the -crowd -into -the -immense -custom -house -and -the -usual -worries -began -everybody -crowding -to -the -counter -and -begging -to -have -his -baggage -examined -first -and -all -hands -clattering -and -chattering -at -once -it -seemed -to -me -that -i -could -do -nothing -it -would -be -better -to -give -it -all -up -and -go -away -and -leave -the -baggage -i -couldn't -speak -the -language -i -should -never -accomplish -anything -just -then -a -tall -handsome -man -in -a -fine -uniform -was -passing -by -and -i -knew -he -must -be -the -station -master -and -that -reminded -me -of -my -letter -i -ran -to -him -and -put -it -into -his -hands -he -took -it -out -of -the -envelope -and -the -moment -his -eye -caught -the -royal -coat -of -arms -printed -at -its -top -he -took -off -his -cap -and -made -a -beautiful -bow -to -me -and -said -in -english -which -is -your -baggage -please -show -it -to -me -i -showed -him -the -mountain -nobody -was -disturbing -it -nobody -was -interested -in -it -all -the -family's -attempts -to -get -attention -to -it -had -failed -except -in -the -case -of -one -of -the -trunks -containing -the -dutiable -goods -it -was -just -being -opened -my -officer -said -there -let -that -alone! -lock -it -now -chalk -it -chalk -all -of -the -lot -now -please -come -and -show -the -hand -baggage -he -plowed -through -the -waiting -crowd -i -following -to -the -counter -and -he -gave -orders -again -in -his -emphatic -military -way -chalk -these -chalk -all -of -them -then -he -took -off -his -cap -and -made -that -beautiful -bow -again -and -went -his -way -by -this -time -these -attentions -had -attracted -the -wonder -of -that -acre -of -passengers -and -the -whisper -had -gone -around -that -the -royal -family -were -present -getting -their -baggage -chalked -and -as -we -passed -down -in -review -on -our -way -to -the -door -i -was -conscious -of -a -pervading -atmosphere -of -envy -which -gave -me -deep -satisfaction -but -soon -there -was -an -accident -my -overcoat -pockets -were -stuffed -with -german -cigars -and -linen -packages -of -american -smoking -tobacco -and -a -porter -was -following -us -around -with -this -overcoat -on -his -arm -and -gradually -getting -it -upside -down -just -as -i -in -the -rear -of -my -family -moved -by -the -sentinels -at -the -door -about -three -hatfuls -of -the -tobacco -tumbled -out -on -the -floor -one -of -the -soldiers -pounced -upon -it -gathered -it -up -in -his -arms -pointed -back -whence -i -had -come -and -marched -me -ahead -of -him -past -that -long -wall -of -passengers -again -he -chattering -and -exulting -like -a -devil -they -smiling -in -peaceful -joy -and -i -trying -to -look -as -if -my -pride -was -not -hurt -and -as -if -i -did -not -mind -being -brought -to -shame -before -these -pleased -people -who -had -so -lately -envied -me -but -at -heart -i -was -cruelly -humbled -when -i -had -been -marched -two -thirds -of -the -long -distance -and -the -misery -of -it -was -at -the -worst -the -stately -station -master -stepped -out -from -somewhere -and -the -soldier -left -me -and -darted -after -him -and -overtook -him -and -i -could -see -by -the -soldier's -excited -gestures -that -he -was -betraying -to -him -the -whole -shabby -business -the -station -master -was -plainly -very -angry -he -came -striding -down -toward -me -and -when -he -was -come -near -he -began -to -pour -out -a -stream -of -indignant -italian -then -suddenly -took -off -his -hat -and -made -that -beautiful -bow -and -said -oh -it -is -you! -i -beg -a -thousands -pardons! -this -idiot -here -he -turned -to -the -exulting -soldier -and -burst -out -with -a -flood -of -white -hot -italian -lava -and -the -next -moment -he -was -bowing -and -the -soldier -and -i -were -moving -in -procession -again -he -in -the -lead -and -ashamed -this -time -i -with -my -chin -up -and -so -we -marched -by -the -crowd -of -fascinated -passengers -and -i -went -forth -to -the -train -with -the -honors -of -war -tobacco -and -all -chapter -xxi -man -will -do -many -things -to -get -himself -loved -he -will -do -all -things -to -get -himself -envied -pudd'nhead -wilson's -new -calendar -before -i -saw -australia -i -had -never -heard -of -the -weet -weet -at -all -i -met -but -few -men -who -had -seen -it -thrown -at -least -i -met -but -few -who -mentioned -having -seen -it -thrown -roughly -described -it -is -a -fat -wooden -cigar -with -its -butt -end -fastened -to -a -flexible -twig -the -whole -thing -is -only -a -couple -of -feet -long -and -weighs -less -than -two -ounces -this -feather -so -to -call -it -is -not -thrown -through -the -air -but -is -flung -with -an -underhanded -throw -and -made -to -strike -the -ground -a -little -way -in -front -of -the -thrower -then -it -glances -and -makes -a -long -skip -glances -again -skips -again -and -again -and -again -like -the -flat -stone -which -a -boy -sends -skating -over -the -water -the -water -is -smooth -and -the -stone -has -a -good -chance -so -a -strong -man -may -make -it -travel -fifty -or -seventy -five -yards -but -the -weet -weet -has -no -such -good -chance -for -it -strikes -sand -grass -and -earth -in -its -course -yet -an -expert -aboriginal -has -sent -it -a -measured -distance -of -two -hundred -and -twenty -yards -it -would -have -gone -even -further -but -it -encountered -rank -ferns -and -underwood -on -its -passage -and -they -damaged -its -speed -two -hundred -and -twenty -yards -and -so -weightless -a -toy -a -mouse -on -the -end -of -a -bit -of -wire -in -effect -and -not -sailing -through -the -accommodating -air -but -encountering -grass -and -sand -and -stuff -at -every -jump -it -looks -wholly -impossible -but -mr -brough -smyth -saw -the -feat -and -did -the -measuring -and -set -down -the -facts -in -his -book -about -aboriginal -life -which -he -wrote -by -command -of -the -victorian -government -what -is -the -secret -of -the -feat -no -one -explains -it -cannot -be -physical -strength -for -that -could -not -drive -such -a -feather -weight -any -distance -it -must -be -art -but -no -one -explains -what -the -art -of -it -is -nor -how -it -gets -around -that -law -of -nature -which -says -you -shall -not -throw -any -two -ounce -thing -220 -yards -either -through -the -air -or -bumping -along -the -ground -rev -j -g -woods -says -the -distance -to -which -the -weet -weet -or -kangaroo -rat -can -be -thrown -is -truly -astonishing -i -have -seen -an -australian -stand -at -one -side -of -kennington -oval -and -throw -the -kangaroo -rat -completely -across -it -width -of -kensington -oval -not -stated -it -darts -through -the -air -with -the -sharp -and -menacing -hiss -of -a -rifle -ball -its -greatest -height -from -the -ground -being -some -seven -or -eight -feet -when -properly -thrown -it -looks -just -like -a -living -animal -leaping -along -its -movements -have -a -wonderful -resemblance -to -the -long -leaps -of -a -kangaroo -rat -fleeing -in -alarm -with -its -long -tail -trailing -behind -it -the -old -settler -said -that -he -had -seen -distances -made -by -the -weet -weet -in -the -early -days -which -almost -convinced -him -that -it -was -as -extraordinary -an -instrument -as -the -boomerang -there -must -have -been -a -large -distribution -of -acuteness -among -those -naked -skinny -aboriginals -or -they -couldn't -have -been -such -unapproachable -trackers -and -boomerangers -and -weet -weeters -it -must -have -been -race -aversion -that -put -upon -them -a -good -deal -of -the -low -rate -intellectual -reputation -which -they -bear -and -have -borne -this -long -time -in -the -world's -estimate -of -them -they -were -lazy -always -lazy -perhaps -that -was -their -trouble -it -is -a -killing -defect -surely -they -could -have -invented -and -built -a -competent -house -but -they -didn't -and -they -could -have -invented -and -developed -the -agricultural -arts -but -they -didn't -they -went -naked -and -houseless -and -lived -on -fish -and -grubs -and -worms -and -wild -fruits -and -were -just -plain -savages -for -all -their -smartness -with -a -country -as -big -as -the -united -states -to -live -and -multiply -in -and -with -no -epidemic -diseases -among -them -till -the -white -man -came -with -those -and -his -other -appliances -of -civilization -it -is -quite -probable -that -there -was -never -a -day -in -his -history -when -he -could -muster -100 -000 -of -his -race -in -all -australia -he -diligently -and -deliberately -kept -population -down -by -infanticide -largely -but -mainly -by -certain -other -methods -he -did -not -need -to -practise -these -artificialities -any -more -after -the -white -man -came -the -white -man -knew -ways -of -keeping -down -population -which -were -worth -several -of -his -the -white -man -knew -ways -of -reducing -a -native -population -80 -percent -in -20 -years -the -native -had -never -seen -anything -as -fine -as -that -before -for -example -there -is -the -case -of -the -country -now -called -victoria -a -country -eighty -times -as -large -as -rhode -island -as -i -have -already -said -by -the -best -official -guess -there -were -4 -500 -aboriginals -in -it -when -the -whites -came -along -in -the -middle -of -the -'thirties -of -these -1 -000 -lived -in -gippsland -a -patch -of -territory -the -size -of -fifteen -or -sixteen -rhode -islands -they -did -not -diminish -as -fast -as -some -of -the -other -communities -indeed -at -the -end -of -forty -years -there -were -still -200 -of -them -left -the -geelong -tribe -diminished -more -satisfactorily -from -173 -persons -it -faded -to -34 -in -twenty -years -at -the -end -of -another -twenty -the -tribe -numbered -one -person -altogether -the -two -melbourne -tribes -could -muster -almost -300 -when -the -white -man -came -they -could -muster -but -twenty -thirty -seven -years -later -in -1875 -in -that -year -there -were -still -odds -and -ends -of -tribes -scattered -about -the -colony -of -victoria -but -i -was -told -that -natives -of -full -blood -are -very -scarce -now -it -is -said -that -the -aboriginals -continue -in -some -force -in -the -huge -territory -called -queensland -the -early -whites -were -not -used -to -savages -they -could -not -understand -the -primary -law -of -savage -life -that -if -a -man -do -you -a -wrong -his -whole -tribe -is -responsible -each -individual -of -it -and -you -may -take -your -change -out -of -any -individual -of -it -without -bothering -to -seek -out -the -guilty -one -when -a -white -killed -an -aboriginal -the -tribe -applied -the -ancient -law -and -killed -the -first -white -they -came -across -to -the -whites -this -was -a -monstrous -thing -extermination -seemed -to -be -the -proper -medicine -for -such -creatures -as -this -they -did -not -kill -all -the -blacks -but -they -promptly -killed -enough -of -them -to -make -their -own -persons -safe -from -the -dawn -of -civilization -down -to -this -day -the -white -man -has -always -used -that -very -precaution -mrs -campbell -praed -lived -in -queensland -as -a -child -in -the -early -days -and -in -her -sketches -of -australian -life -we -get -informing -pictures -of -the -early -struggles -of -the -white -and -the -black -to -reform -each -other -speaking -of -pioneer -days -in -the -mighty -wilderness -of -queensland -mrs -praed -says -at -first -the -natives -retreated -before -the -whites -and -except -that -they -every -now -and -then -speared -a -beast -in -one -of -the -herds -gave -little -cause -for -uneasiness -but -as -the -number -of -squatters -increased -each -one -taking -up -miles -of -country -and -bringing -two -or -three -men -in -his -train -so -that -shepherds' -huts -and -stockmen's -camps -lay -far -apart -and -defenseless -in -the -midst -of -hostile -tribes -the -blacks' -depredations -became -more -frequent -and -murder -was -no -unusual -event -the -loneliness -of -the -australian -bush -can -hardly -be -painted -in -words -here -extends -mile -after -mile -of -primeval -forest -where -perhaps -foot -of -white -man -has -never -trod -interminable -vistas -where -the -eucalyptus -trees -rear -their -lofty -trunks -and -spread -forth -their -lanky -limbs -from -which -the -red -gum -oozes -and -hangs -in -fantastic -pendants -like -crimson -stalactites -ravines -along -the -sides -of -which -the -long -bladed -grass -grows -rankly -level -untimbered -plains -alternating -with -undulating -tracts -of -pasture -here -and -there -broken -by -a -stony -ridge -steep -gully -or -dried -up -creek -all -wild -vast -and -desolate -all -the -same -monotonous -gray -coloring -except -where -the -wattle -when -in -blossom -shows -patches -of -feathery -gold -or -a -belt -of -scrub -lies -green -glossy -and -impenetrable -as -indian -jungle -the -solitude -seems -intensified -by -the -strange -sounds -of -reptiles -birds -and -insects -and -by -the -absence -of -larger -creatures -of -which -in -the -day -time -the -only -audible -signs -are -the -stampede -of -a -herd -of -kangaroo -or -the -rustle -of -a -wallabi -or -a -dingo -stirring -the -grass -as -it -creeps -to -its -lair -but -there -are -the -whirring -of -locusts -the -demoniac -chuckle -of -the -laughing -jack -ass -the -screeching -of -cockatoos -and -parrots -the -hissing -of -the -frilled -lizard -and -the -buzzing -of -innumerable -insects -hidden -under -the -dense -undergrowth -and -then -at -night -the -melancholy -wailing -of -the -curlews -the -dismal -howling -of -dingoes -the -discordant -croaking -of -tree -frogs -might -well -shake -the -nerves -of -the -solitary -watcher -that -is -the -theater -for -the -drama -when -you -comprehend -one -or -two -other -details -you -will -perceive -how -well -suited -for -trouble -it -was -and -how -loudly -it -invited -it -the -cattlemen's -stations -were -scattered -over -that -profound -wilderness -miles -and -miles -apart -at -each -station -half -a -dozen -persons -there -was -a -plenty -of -cattle -the -black -natives -were -always -ill -nourished -and -hungry -the -land -belonged -to -them -the -whites -had -not -bought -it -and -couldn't -buy -it -for -the -tribes -had -no -chiefs -nobody -in -authority -nobody -competent -to -sell -and -convey -and -the -tribes -themselves -had -no -comprehension -of -the -idea -of -transferable -ownership -of -land -the -ousted -owners -were -despised -by -the -white -interlopers -and -this -opinion -was -not -hidden -under -a -bushel -more -promising -materials -for -a -tragedy -could -not -have -been -collated -let -mrs -praed -speak -at -nie -station -one -dark -night -the -unsuspecting -hut -keeper -having -as -he -believed -secured -himself -against -assault -was -lying -wrapped -in -his -blankets -sleeping -profoundly -the -blacks -crept -stealthily -down -the -chimney -and -battered -in -his -skull -while -he -slept -one -could -guess -the -whole -drama -from -that -little -text -the -curtain -was -up -it -would -not -fall -until -the -mastership -of -one -party -or -the -other -was -determined -and -permanently -there -was -treachery -on -both -sides -the -blacks -killed -the -whites -when -they -found -them -defenseless -and -the -whites -slew -the -blacks -in -a -wholesale -and -promiscuous -fashion -which -offended -against -my -childish -sense -of -justice -they -were -regarded -as -little -above -the -level -of -brutes -and -in -some -cases -were -destroyed -like -vermin -here -is -an -instance -a -squatter -whose -station -was -surrounded -by -blacks -whom -he -suspected -to -be -hostile -and -from -whom -he -feared -an -attack -parleyed -with -them -from -his -house -door -he -told -them -it -was -christmas -time -a -time -at -which -all -men -black -or -white -feasted -that -there -were -flour -sugar -plums -good -things -in -plenty -in -the -store -and -that -he -would -make -for -them -such -a -pudding -as -they -had -never -dreamed -of -a -great -pudding -of -which -all -might -eat -and -be -filled -the -blacks -listened -and -were -lost -the -pudding -was -made -and -distributed -next -morning -there -was -howling -in -the -camp -for -it -had -been -sweetened -with -sugar -and -arsenic! -the -white -man's -spirit -was -right -but -his -method -was -wrong -his -spirit -was -the -spirit -which -the -civilized -white -has -always -exhibited -toward -the -savage -but -the -use -of -poison -was -a -departure -from -custom -true -it -was -merely -a -technical -departure -not -a -real -one -still -it -was -a -departure -and -therefore -a -mistake -in -my -opinion -it -was -better -kinder -swifter -and -much -more -humane -than -a -number -of -the -methods -which -have -been -sanctified -by -custom -but -that -does -not -justify -its -employment -that -is -it -does -not -wholly -justify -it -its -unusual -nature -makes -it -stand -out -and -attract -an -amount -of -attention -which -it -is -not -entitled -to -it -takes -hold -upon -morbid -imaginations -and -they -work -it -up -into -a -sort -of -exhibition -of -cruelty -and -this -smirches -the -good -name -of -our -civilization -whereas -one -of -the -old -harsher -methods -would -have -had -no -such -effect -because -usage -has -made -those -methods -familiar -to -us -and -innocent -in -many -countries -we -have -chained -the -savage -and -starved -him -to -death -and -this -we -do -not -care -for -because -custom -has -inured -us -to -it -yet -a -quick -death -by -poison -is -loving -kindness -to -it -in -many -countries -we -have -burned -the -savage -at -the -stake -and -this -we -do -not -care -for -because -custom -has -inured -us -to -it -yet -a -quick -death -is -loving -kindness -to -it -in -more -than -one -country -we -have -hunted -the -savage -and -his -little -children -and -their -mother -with -dogs -and -guns -through -the -woods -and -swamps -for -an -afternoon's -sport -and -filled -the -region -with -happy -laughter -over -their -sprawling -and -stumbling -flight -and -their -wild -supplications -for -mercy -but -this -method -we -do -not -mind -because -custom -has -inured -us -to -it -yet -a -quick -death -by -poison -is -loving -kindness -to -it -in -many -countries -we -have -taken -the -savage's -land -from -him -and -made -him -our -slave -and -lashed -him -every -day -and -broken -his -pride -and -made -death -his -only -friend -and -overworked -him -till -he -dropped -in -his -tracks -and -this -we -do -not -care -for -because -custom -has -inured -us -to -it -yet -a -quick -death -by -poison -is -loving -kindness -to -it -in -the -matabeleland -today -why -there -we -are -confining -ourselves -to -sanctified -custom -we -rhodes -beit -millionaires -in -south -africa -and -dukes -in -london -and -nobody -cares -because -we -are -used -to -the -old -holy -customs -and -all -we -ask -is -that -no -notice -inviting -new -ones -shall -be -intruded -upon -the -attention -of -our -comfortable -consciences -mrs -praed -says -of -the -poisoner -that -squatter -deserves -to -have -his -name -handed -down -to -the -contempt -of -posterity -i -am -sorry -to -hear -her -say -that -i -myself -blame -him -for -one -thing -and -severely -but -i -stop -there -i -blame -him -for -the -indiscretion -of -introducing -a -novelty -which -was -calculated -to -attract -attention -to -our -civilization -there -was -no -occasion -to -do -that -it -was -his -duty -and -it -is -every -loyal -man's -duty -to -protect -that -heritage -in -every -way -he -can -and -the -best -way -to -do -that -is -to -attract -attention -elsewhere -the -squatter's -judgment -was -bad -that -is -plain -but -his -heart -was -right -he -is -almost -the -only -pioneering -representative -of -civilization -in -history -who -has -risen -above -the -prejudices -of -his -caste -and -his -heredity -and -tried -to -introduce -the -element -of -mercy -into -the -superior -race's -dealings -with -the -savage -his -name -is -lost -and -it -is -a -pity -for -it -deserves -to -be -handed -down -to -posterity -with -homage -and -reverence -this -paragraph -is -from -a -london -journal -to -learn -what -france -is -doing -to -spread -the -blessings -of -civilization -in -her -distant -dependencies -we -may -turn -with -advantage -to -new -caledonia -with -a -view -to -attracting -free -settlers -to -that -penal -colony -m -feillet -the -governor -forcibly -expropriated -the -kanaka -cultivators -from -the -best -of -their -plantations -with -a -derisory -compensation -in -spite -of -the -protests -of -the -council -general -of -the -island -such -immigrants -as -could -be -induced -to -cross -the -seas -thus -found -themselves -in -possession -of -thousands -of -coffee -cocoa -banana -and -bread -fruit -trees -the -raising -of -which -had -cost -the -wretched -natives -years -of -toil -whilst -the -latter -had -a -few -five -franc -pieces -to -spend -in -the -liquor -stores -of -noumea -you -observe -the -combination -it -is -robbery -humiliation -and -slow -slow -murder -through -poverty -and -the -white -man's -whisky -the -savage's -gentle -friend -the -savage's -noble -friend -the -only -magnanimous -and -unselfish -friend -the -savage -has -ever -had -was -not -there -with -the -merciful -swift -release -of -his -poisoned -pudding -there -are -many -humorous -things -in -the -world -among -them -the -white -man's -notion -that -he -is -less -savage -than -the -other -savages -[see -chapter -on -tasmania -post -] -chapter -xxii -nothing -is -so -ignorant -as -a -man's -left -hand -except -a -lady's -watch -pudd'nhead -wilson's -new -calendar -you -notice -that -mrs -praed -knows -her -art -she -can -place -a -thing -before -you -so -that -you -can -see -it -she -is -not -alone -in -that -australia -is -fertile -in -writers -whose -books -are -faithful -mirrors -of -the -life -of -the -country -and -of -its -history -the -materials -were -surprisingly -rich -both -in -quality -and -in -mass -and -marcus -clarke -ralph -boldrewood -cordon -kendall -and -the -others -have -built -out -of -them -a -brilliant -and -vigorous -literature -and -one -which -must -endure -materials -there -is -no -end -to -them! -why -a -literature -might -be -made -out -of -the -aboriginal -all -by -himself -his -character -and -ways -are -so -freckled -with -varieties -varieties -not -staled -by -familiarity -but -new -to -us -you -do -not -need -to -invent -any -picturesquenesses -whatever -you -want -in -that -line -he -can -furnish -you -and -they -will -not -be -fancies -and -doubtful -but -realities -and -authentic -in -his -history -as -preserved -by -the -white -man's -official -records -he -is -everything -everything -that -a -human -creature -can -be -he -covers -the -entire -ground -he -is -a -coward -there -are -a -thousand -fact -to -prove -it -he -is -brave -there -are -a -thousand -facts -to -prove -it -he -is -treacherous -oh -beyond -imagination! -he -is -faithful -loyal -true -the -white -man's -records -supply -you -with -a -harvest -of -instances -of -it -that -are -noble -worshipful -and -pathetically -beautiful -he -kills -the -starving -stranger -who -comes -begging -for -food -and -shelter -there -is -proof -of -it -he -succors -and -feeds -and -guides -to -safety -to -day -the -lost -stranger -who -fired -on -him -only -yesterday -there -is -proof -of -it -he -takes -his -reluctant -bride -by -force -he -courts -her -with -a -club -then -loves -her -faithfully -through -a -long -life -it -is -of -record -he -gathers -to -himself -another -wife -by -the -same -processes -beats -and -bangs -her -as -a -daily -diversion -and -by -and -by -lays -down -his -life -in -defending -her -from -some -outside -harm -it -is -of -record -he -will -face -a -hundred -hostiles -to -rescue -one -of -his -children -and -will -kill -another -of -his -children -because -the -family -is -large -enough -without -it -his -delicate -stomach -turns -at -certain -details -of -the -white -man's -food -but -he -likes -over -ripe -fish -and -brazed -dog -and -cat -and -rat -and -will -eat -his -own -uncle -with -relish -he -is -a -sociable -animal -yet -he -turns -aside -and -hides -behind -his -shield -when -his -mother -in -law -goes -by -he -is -childishly -afraid -of -ghosts -and -other -trivialities -that -menace -his -soul -but -dread -of -physical -pain -is -a -weakness -which -he -is -not -acquainted -with -he -knows -all -the -great -and -many -of -the -little -constellations -and -has -names -for -them -he -has -a -symbol -writing -by -means -of -which -he -can -convey -messages -far -and -wide -among -the -tribes -he -has -a -correct -eye -for -form -and -expression -and -draws -a -good -picture -he -can -track -a -fugitive -by -delicate -traces -which -the -white -man's -eye -cannot -discern -and -by -methods -which -the -finest -white -intelligence -cannot -master -he -makes -a -missile -which -science -itself -cannot -duplicate -without -the -model -if -with -it -a -missile -whose -secret -baffled -and -defeated -the -searchings -and -theorizings -of -the -white -mathematicians -for -seventy -years -and -by -an -art -all -his -own -he -performs -miracles -with -it -which -the -white -man -cannot -approach -untaught -nor -parallel -after -teaching -within -certain -limits -this -savage's -intellect -is -the -alertest -and -the -brightest -known -to -history -or -tradition -and -yet -the -poor -creature -was -never -able -to -invent -a -counting -system -that -would -reach -above -five -nor -a -vessel -that -he -could -boil -water -in -he -is -the -prize -curiosity -of -all -the -races -to -all -intents -and -purposes -he -is -dead -in -the -body -but -he -has -features -that -will -live -in -literature -mr -philip -chauncy -an -officer -of -the -victorian -government -contributed -to -its -archives -a -report -of -his -personal -observations -of -the -aboriginals -which -has -in -it -some -things -which -i -wish -to -condense -slightly -and -insert -here -he -speaks -of -the -quickness -of -their -eyes -and -the -accuracy -of -their -judgment -of -the -direction -of -approaching -missiles -as -being -quite -extraordinary -and -of -the -answering -suppleness -and -accuracy -of -limb -and -muscle -in -avoiding -the -missile -as -being -extraordinary -also -he -has -seen -an -aboriginal -stand -as -a -target -for -cricket -balls -thrown -with -great -force -ten -or -fifteen -yards -by -professional -bowlers -and -successfully -dodge -them -or -parry -them -with -his -shield -during -about -half -an -hour -one -of -those -balls -properly -placed -could -have -killed -him -yet -he -depended -with -the -utmost -self -possession -on -the -quickness -of -his -eye -and -his -agility -the -shield -was -the -customary -war -shield -of -his -race -and -would -not -be -a -protection -to -you -or -to -me -it -is -no -broader -than -a -stovepipe -and -is -about -as -long -as -a -man's -arm -the -opposing -surface -is -not -flat -but -slopes -away -from -the -centerline -like -a -boat's -bow -the -difficulty -about -a -cricket -ball -that -has -been -thrown -with -a -scientific -twist -is -that -it -suddenly -changes -it -course -when -it -is -close -to -its -target -and -comes -straight -for -the -mark -when -apparently -it -was -going -overhead -or -to -one -side -i -should -not -be -able -to -protect -myself -from -such -balls -for -half -an -hour -or -less -mr -chauncy -once -saw -a -little -native -man -throw -a -cricket -ball -119 -yards -this -is -said -to -beat -the -english -professional -record -by -thirteen -yards -we -have -all -seen -the -circus -man -bound -into -the -air -from -a -spring -board -and -make -a -somersault -over -eight -horses -standing -side -by -side -mr -chauncy -saw -an -aboriginal -do -it -over -eleven -and -was -assured -that -he -had -sometimes -done -it -over -fourteen -but -what -is -that -to -this -i -saw -the -same -man -leap -from -the -ground -and -in -going -over -he -dipped -his -head -unaided -by -his -hands -into -a -hat -placed -in -an -inverted -position -on -the -top -of -the -head -of -another -man -sitting -upright -on -horseback -both -man -and -horse -being -of -the -average -size -the -native -landed -on -the -other -side -of -the -horse -with -the -hat -fairly -on -his -head -the -prodigious -height -of -the -leap -and -the -precision -with -which -it -was -taken -so -as -to -enable -him -to -dip -his -head -into -the -hat -exceeded -any -feat -of -the -kind -i -have -ever -beheld -i -should -think -so! -on -board -a -ship -lately -i -saw -a -young -oxford -athlete -run -four -steps -and -spring -into -the -air -and -squirm -his -hips -by -a -side -twist -over -a -bar -that -was -five -and -one -half -feet -high -but -he -could -not -have -stood -still -and -cleared -a -bar -that -was -four -feet -high -i -know -this -because -i -tried -it -myself -one -can -see -now -where -the -kangaroo -learned -its -art -sir -george -grey -and -mr -eyre -testify -that -the -natives -dug -wells -fourteen -or -fifteen -feet -deep -and -two -feet -in -diameter -at -the -bore -dug -them -in -the -sand -wells -that -were -quite -circular -carried -straight -down -and -the -work -beautifully -executed -their -tools -were -their -hands -and -feet -how -did -they -throw -sand -out -from -such -a -depth -how -could -they -stoop -down -and -get -it -with -only -two -feet -of -space -to -stoop -in -how -did -they -keep -that -sand -pipe -from -caving -in -on -them -i -do -not -know -still -they -did -manage -those -seeming -impossibilities -swallowed -the -sand -may -be -mr -chauncy -speaks -highly -of -the -patience -and -skill -and -alert -intelligence -of -the -native -huntsman -when -he -is -stalking -the -emu -the -kangaroo -and -other -game -as -he -walks -through -the -bush -his -step -is -light -elastic -and -noiseless -every -track -on -the -earth -catches -his -keen -eye -a -leaf -or -fragment -of -a -stick -turned -or -a -blade -of -grass -recently -bent -by -the -tread -of -one -of -the -lower -animals -instantly -arrests -his -attention -in -fact -nothing -escapes -his -quick -and -powerful -sight -on -the -ground -in -the -trees -or -in -the -distance -which -may -supply -him -with -a -meal -or -warn -him -of -danger -a -little -examination -of -the -trunk -of -a -tree -which -may -be -nearly -covered -with -the -scratches -of -opossums -ascending -and -descending -is -sufficient -to -inform -him -whether -one -went -up -the -night -before -without -coming -down -again -or -not -fennimore -cooper -lost -his -chance -he -would -have -known -how -to -value -these -people -he -wouldn't -have -traded -the -dullest -of -them -for -the -brightest -mohawk -he -ever -invented -all -savages -draw -outline -pictures -upon -bark -but -the -resemblances -are -not -close -and -expression -is -usually -lacking -but -the -australian -aboriginal's -pictures -of -animals -were -nicely -accurate -in -form -attitude -carriage -and -he -put -spirit -into -them -and -expression -and -his -pictures -of -white -people -and -natives -were -pretty -nearly -as -good -as -his -pictures -of -the -other -animals -he -dressed -his -whites -in -the -fashion -of -their -day -both -the -ladies -and -the -gentlemen -as -an -untaught -wielder -of -the -pencil -it -is -not -likely -that -he -has -had -his -equal -among -savage -people -his -place -in -art -as -to -drawing -not -color -work -is -well -up -all -things -considered -his -art -is -not -to -be -classified -with -savage -art -at -all -but -on -a -plane -two -degrees -above -it -and -one -degree -above -the -lowest -plane -of -civilized -art -to -be -exact -his -place -in -art -is -between -botticelli -and -de -maurier -that -is -to -say -he -could -not -draw -as -well -as -de -maurier -but -better -than -boticelli -in -feeling -he -resembles -both -also -in -grouping -and -in -his -preferences -in -the -matter -of -subjects -his -corrobboree -of -the -australian -wilds -reappears -in -de -maurier's -belgravian -ballrooms -with -clothes -and -the -smirk -of -civilization -added -botticelli's -spring -is -the -corrobboree -further -idealized -but -with -fewer -clothes -and -more -smirk -and -well -enough -as -to -intention -but -my -word! -the -aboriginal -can -make -a -fire -by -friction -i -have -tried -that -all -savages -are -able -to -stand -a -good -deal -of -physical -pain -the -australian -aboriginal -has -this -quality -in -a -well -developed -degree -do -not -read -the -following -instances -if -horrors -are -not -pleasant -to -you -they -were -recorded -by -the -rev -henry -n -wolloston -of -melbourne -who -had -been -a -surgeon -before -he -became -a -clergyman -1 -in -the -summer -of -1852 -i -started -on -horseback -from -albany -king -george's -sound -to -visit -at -cape -riche -accompanied -by -a -native -on -foot -we -traveled -about -forty -miles -the -first -day -then -camped -by -a -water -hole -for -the -night -after -cooking -and -eating -our -supper -i -observed -the -native -who -had -said -nothing -to -me -on -the -subject -collect -the -hot -embers -of -the -fire -together -and -deliberately -place -his -right -foot -in -the -glowing -mass -for -a -moment -then -suddenly -withdraw -it -stamping -on -the -ground -and -uttering -a -long -drawn -guttural -sound -of -mingled -pain -and -satisfaction -this -operation -he -repeated -several -times -on -my -inquiring -the -meaning -of -his -strange -conduct -he -only -said -'me -carpenter -make -'em' -'i -am -mending -my -foot' -and -then -showed -me -his -charred -great -toe -the -nail -of -which -had -been -torn -off -by -a -tea -tree -stump -in -which -it -had -been -caught -during -the -journey -and -the -pain -of -which -he -had -borne -with -stoical -composure -until -the -evening -when -he -had -an -opportunity -of -cauterizing -the -wound -in -the -primitive -manner -above -described -and -he -proceeded -on -the -journey -the -next -day -as -if -nothing -had -happened -and -walked -thirty -miles -it -was -a -strange -idea -to -keep -a -surgeon -and -then -do -his -own -surgery -2 -a -native -about -twenty -five -years -of -age -once -applied -to -me -as -a -doctor -to -extract -the -wooden -barb -of -a -spear -which -during -a -fight -in -the -bush -some -four -months -previously -had -entered -his -chest -just -missing -the -heart -and -penetrated -the -viscera -to -a -considerable -depth -the -spear -had -been -cut -off -leaving -the -barb -behind -which -continued -to -force -its -way -by -muscular -action -gradually -toward -the -back -and -when -i -examined -him -i -could -feel -a -hard -substance -between -the -ribs -below -the -left -blade -bone -i -made -a -deep -incision -and -with -a -pair -of -forceps -extracted -the -barb -which -was -made -as -usual -of -hard -wood -about -four -inches -long -and -from -half -an -inch -to -an -inch -thick -it -was -very -smooth -and -partly -digested -so -to -speak -by -the -maceration -to -which -it -had -been -exposed -during -its -four -months' -journey -through -the -body -the -wound -made -by -the -spear -had -long -since -healed -leaving -only -a -small -cicatrix -and -after -the -operation -which -the -native -bore -without -flinching -he -appeared -to -suffer -no -pain -indeed -judging -from -his -good -state -of -health -the -presence -of -the -foreign -matter -did -not -materially -annoy -him -he -was -perfectly -well -in -a -few -days -but -no -3 -is -my -favorite -whenever -i -read -it -i -seem -to -enjoy -all -that -the -patient -enjoyed -whatever -it -was -3 -once -at -king -george's -sound -a -native -presented -himself -to -me -with -one -leg -only -and -requested -me -to -supply -him -with -a -wooden -leg -he -had -traveled -in -this -maimed -state -about -ninety -six -miles -for -this -purpose -i -examined -the -limb -which -had -been -severed -just -below -the -knee -and -found -that -it -had -been -charred -by -fire -while -about -two -inches -of -the -partially -calcined -bone -protruded -through -the -flesh -i -at -once -removed -this -with -the -saw -and -having -made -as -presentable -a -stump -of -it -as -i -could -covered -the -amputated -end -of -the -bone -with -a -surrounding -of -muscle -and -kept -the -patient -a -few -days -under -my -care -to -allow -the -wound -to -heal -on -inquiring -the -native -told -me -that -in -a -fight -with -other -black -fellows -a -spear -had -struck -his -leg -and -penetrated -the -bone -below -the -knee -finding -it -was -serious -he -had -recourse -to -the -following -crude -and -barbarous -operation -which -it -appears -is -not -uncommon -among -these -people -in -their -native -state -he -made -a -fire -and -dug -a -hole -in -the -earth -only -sufficiently -large -to -admit -his -leg -and -deep -enough -to -allow -the -wounded -part -to -be -on -a -level -with -the -surface -of -the -ground -he -then -surrounded -the -limb -with -the -live -coals -or -charcoal -which -was -replenished -until -the -leg -was -literally -burnt -off -the -cauterization -thus -applied -completely -checked -the -hemorrhage -and -he -was -able -in -a -day -or -two -to -hobble -down -to -the -sound -with -the -aid -of -a -long -stout -stick -although -he -was -more -than -a -week -on -the -road -but -he -was -a -fastidious -native -he -soon -discarded -the -wooden -leg -made -for -him -by -the -doctor -because -it -had -no -feeling -in -it -it -must -have -had -as -much -as -the -one -he -burnt -off -i -should -think -so -much -for -the -aboriginals -it -is -difficult -for -me -to -let -them -alone -they -are -marvelously -interesting -creatures -for -a -quarter -of -a -century -now -the -several -colonial -governments -have -housed -their -remnants -in -comfortable -stations -and -fed -them -well -and -taken -good -care -of -them -in -every -way -if -i -had -found -this -out -while -i -was -in -australia -i -could -have -seen -some -of -those -people -but -i -didn't -i -would -walk -thirty -miles -to -see -a -stuffed -one -australia -has -a -slang -of -its -own -this -is -a -matter -of -course -the -vast -cattle -and -sheep -industries -the -strange -aspects -of -the -country -and -the -strange -native -animals -brute -and -human -are -matters -which -would -naturally -breed -a -local -slang -i -have -notes -of -this -slang -somewhere -but -at -the -moment -i -can -call -to -mind -only -a -few -of -the -words -and -phrases -they -are -expressive -ones -the -wide -sterile -unpeopled -deserts -have -created -eloquent -phrases -like -no -man's -land -and -the -never -never -country -also -this -felicitous -form -she -lives -in -the -never -never -country -that -is -she -is -an -old -maid -and -this -one -is -not -without -merit -heifer -paddock -young -ladies' -seminary -bail -up -and -stick -up -equivalent -of -our -highwayman -term -to -hold -up -a -stage -coach -or -a -train -new -chum -is -the -equivalent -of -our -tenderfoot -new -arrival -and -then -there -is -the -immortal -my -word! -we -must -import -it -m -y -word! -in -cold -print -it -is -the -equivalent -of -our -ger -rreat -caesar! -but -spoken -with -the -proper -australian -unction -and -fervency -it -is -worth -six -of -it -for -grace -and -charm -and -expressiveness -our -form -is -rude -and -explosive -it -is -not -suited -to -the -drawing -room -or -the -heifer -paddock -but -m -y -word! -is -and -is -music -to -the -ear -too -when -the -utterer -knows -how -to -say -it -i -saw -it -in -print -several -times -on -the -pacific -ocean -but -it -struck -me -coldly -it -aroused -no -sympathy -that -was -because -it -was -the -dead -corpse -of -the -thing -the -'soul -was -not -there -the -tones -were -lacking -the -informing -spirit -the -deep -feeling -the -eloquence -but -the -first -time -i -heard -an -australian -say -it -it -was -positively -thrilling -chapter -xxiii -be -careless -in -your -dress -if -you -must -but -keep -a -tidy -soul -pudd'nhead -wilson's -new -calendar -we -left -adelaide -in -due -course -and -went -to -horsham -in -the -colony -of -victoria -a -good -deal -of -a -journey -if -i -remember -rightly -but -pleasant -horsham -sits -in -a -plain -which -is -as -level -as -a -floor -one -of -those -famous -dead -levels -which -australian -books -describe -so -often -gray -bare -sombre -melancholy -baked -cracked -in -the -tedious -long -drouths -but -a -horizonless -ocean -of -vivid -green -grass -the -day -after -a -rain -a -country -town -peaceful -reposeful -inviting -full -of -snug -homes -with -garden -plots -and -plenty -of -shrubbery -and -flowers -horsham -october -17 -at -the -hotel -the -weather -divine -across -the -way -in -front -of -the -london -bank -of -australia -is -a -very -handsome -cottonwood -it -is -in -opulent -leaf -and -every -leaf -perfect -the -full -power -of -the -on -rushing -spring -is -upon -it -and -i -imagine -i -can -see -it -grow -alongside -the -bank -and -a -little -way -back -in -the -garden -there -is -a -row -of -soaring -fountain -sprays -of -delicate -feathery -foliage -quivering -in -the -breeze -and -mottled -with -flashes -of -light -that -shift -and -play -through -the -mass -like -flash -lights -through -an -opal -a -most -beautiful -tree -and -a -striking -contrast -to -the -cottonwood -every -leaf -of -the -cottonwood -is -distinctly -defined -it -is -a -kodak -for -faithful -hard -unsentimental -detail -the -other -an -impressionist -picture -delicious -to -look -upon -full -of -a -subtle -and -exquisite -charm -but -all -details -fused -in -a -swoon -of -vague -and -soft -loveliness -it -turned -out -upon -inquiry -to -be -a -pepper -tree -an -importation -from -china -it -has -a -silky -sheen -soft -and -rich -i -saw -some -that -had -long -red -bunches -of -currant -like -berries -ambushed -among -the -foliage -at -a -distance -in -certain -lights -they -give -the -tree -a -pinkish -tint -and -a -new -charm -there -is -an -agricultural -college -eight -miles -from -horsham -we -were -driven -out -to -it -by -its -chief -the -conveyance -was -an -open -wagon -the -time -noonday -no -wind -the -sky -without -a -cloud -the -sunshine -brilliant -and -the -mercury -at -92 -deg -in -the -shade -in -some -countries -an -indolent -unsheltered -drive -of -an -hour -and -a -half -under -such -conditions -would -have -been -a -sweltering -and -prostrating -experience -but -there -was -nothing -of -that -in -this -case -it -is -a -climate -that -is -perfect -there -was -no -sense -of -heat -indeed -there -was -no -heat -the -air -was -fine -and -pure -and -exhilarating -if -the -drive -had -lasted -half -a -day -i -think -we -should -not -have -felt -any -discomfort -or -grown -silent -or -droopy -or -tired -of -course -the -secret -of -it -was -the -exceeding -dryness -of -the -atmosphere -in -that -plain -112 -deg -in -the -shade -is -without -doubt -no -harder -upon -a -man -than -is -88 -or -90 -deg -in -new -york -the -road -lay -through -the -middle -of -an -empty -space -which -seemed -to -me -to -be -a -hundred -yards -wide -between -the -fences -i -was -not -given -the -width -in -yards -but -only -in -chains -and -perches -and -furlongs -i -think -i -would -have -given -a -good -deal -to -know -what -the -width -was -but -i -did -not -pursue -the -matter -i -think -it -is -best -to -put -up -with -information -the -way -you -get -it -and -seem -satisfied -with -it -and -surprised -at -it -and -grateful -for -it -and -say -my -word! -and -never -let -on -it -was -a -wide -space -i -could -tell -you -how -wide -in -chains -and -perches -and -furlongs -and -things -but -that -would -not -help -you -any -those -things -sound -well -but -they -are -shadowy -and -indefinite -like -troy -weight -and -avoirdupois -nobody -knows -what -they -mean -when -you -buy -a -pound -of -a -drug -and -the -man -asks -you -which -you -want -troy -or -avoirdupois -it -is -best -to -say -yes -and -shift -the -subject -they -said -that -the -wide -space -dates -from -the -earliest -sheep -and -cattle -raising -days -people -had -to -drive -their -stock -long -distances -immense -journeys -from -worn -out -places -to -new -ones -where -were -water -and -fresh -pasturage -and -this -wide -space -had -to -be -left -in -grass -and -unfenced -or -the -stock -would -have -starved -to -death -in -the -transit -on -the -way -we -saw -the -usual -birds -the -beautiful -little -green -parrots -the -magpie -and -some -others -and -also -the -slender -native -bird -of -modest -plumage -and -the -eternally -forgettable -name -the -bird -that -is -the -smartest -among -birds -and -can -give -a -parrot -30 -to -1 -in -the -game -and -then -talk -him -to -death -i -cannot -recall -that -bird's -name -i -think -it -begins -with -m -i -wish -it -began -with -g -or -something -that -a -person -can -remember -the -magpie -was -out -in -great -force -in -the -fields -and -on -the -fences -he -is -a -handsome -large -creature -with -snowy -white -decorations -and -is -a -singer -he -has -a -murmurous -rich -note -that -is -lovely -he -was -once -modest -even -diffident -but -he -lost -all -that -when -he -found -out -that -he -was -australia's -sole -musical -bird -he -has -talent -and -cuteness -and -impudence -and -in -his -tame -state -he -is -a -most -satisfactory -pet -never -coming -when -he -is -called -always -coming -when -he -isn't -and -studying -disobedience -as -an -accomplishment -he -is -not -confined -but -loafs -all -over -the -house -and -grounds -like -the -laughing -jackass -i -think -he -learns -to -talk -i -know -he -learns -to -sing -tunes -and -his -friends -say -that -he -knows -how -to -steal -without -learning -i -was -acquainted -with -a -tame -magpie -in -melbourne -he -had -lived -in -a -lady's -house -several -years -and -believed -he -owned -it -the -lady -had -tamed -him -and -in -return -he -had -tamed -the -lady -he -was -always -on -deck -when -not -wanted -always -having -his -own -way -always -tyrannizing -over -the -dog -and -always -making -the -cat's -life -a -slow -sorrow -and -a -martyrdom -he -knew -a -number -of -tunes -and -could -sing -them -in -perfect -time -and -tune -and -would -do -it -too -at -any -time -that -silence -was -wanted -and -then -encore -himself -and -do -it -again -but -if -he -was -asked -to -sing -he -would -go -out -and -take -a -walk -it -was -long -believed -that -fruit -trees -would -not -grow -in -that -baked -and -waterless -plain -around -horsham -but -the -agricultural -college -has -dissipated -that -idea -its -ample -nurseries -were -producing -oranges -apricots -lemons -almonds -peaches -cherries -48 -varieties -of -apples -in -fact -all -manner -of -fruits -and -in -abundance -the -trees -did -not -seem -to -miss -the -water -they -were -in -vigorous -and -flourishing -condition -experiments -are -made -with -different -soils -to -see -what -things -thrive -best -in -them -and -what -climates -are -best -for -them -a -man -who -is -ignorantly -trying -to -produce -upon -his -farm -things -not -suited -to -its -soil -and -its -other -conditions -can -make -a -journey -to -the -college -from -anywhere -in -australia -and -go -back -with -a -change -of -scheme -which -will -make -his -farm -productive -and -profitable -there -were -forty -pupils -there -a -few -of -them -farmers -relearning -their -trade -the -rest -young -men -mainly -from -the -cities -novices -it -seemed -a -strange -thing -that -an -agricultural -college -should -have -an -attraction -for -city -bred -youths -but -such -is -the -fact -they -are -good -stuff -too -they -are -above -the -agricultural -average -of -intelligence -and -they -come -without -any -inherited -prejudices -in -favor -of -hoary -ignorances -made -sacred -by -long -descent -the -students -work -all -day -in -the -fields -the -nurseries -and -the -shearing -sheds -learning -and -doing -all -the -practical -work -of -the -business -three -days -in -a -week -on -the -other -three -they -study -and -hear -lectures -they -are -taught -the -beginnings -of -such -sciences -as -bear -upon -agriculture -like -chemistry -for -instance -we -saw -the -sophomore -class -in -sheep -shearing -shear -a -dozen -sheep -they -did -it -by -hand -not -with -the -machine -the -sheep -was -seized -and -flung -down -on -his -side -and -held -there -and -the -students -took -off -his -coat -with -great -celerity -and -adroitness -sometimes -they -clipped -off -a -sample -of -the -sheep -but -that -is -customary -with -shearers -and -they -don't -mind -it -they -don't -even -mind -it -as -much -as -the -sheep -they -dab -a -splotch -of -sheep -dip -on -the -place -and -go -right -ahead -the -coat -of -wool -was -unbelievably -thick -before -the -shearing -the -sheep -looked -like -the -fat -woman -in -the -circus -after -it -he -looked -like -a -bench -he -was -clipped -to -the -skin -and -smoothly -and -uniformly -the -fleece -comes -from -him -all -in -one -piece -and -has -the -spread -of -a -blanket -the -college -was -flying -the -australian -flag -the -gridiron -of -england -smuggled -up -in -the -northwest -corner -of -a -big -red -field -that -had -the -random -stars -of -the -southern -cross -wandering -around -over -it -from -horsham -we -went -to -stawell -by -rail -still -in -the -colony -of -victoria -stawell -is -in -the -gold -mining -country -in -the -bank -safe -was -half -a -peck -of -surface -gold -gold -dust -grain -gold -rich -pure -in -fact -and -pleasant -to -sift -through -one's -fingers -and -would -be -pleasanter -if -it -would -stick -and -there -were -a -couple -of -gold -bricks -very -heavy -to -handle -and -worth -$7 -500 -a -piece -they -were -from -a -very -valuable -quartz -mine -a -lady -owns -two -thirds -of -it -she -has -an -income -of -$75 -000 -a -month -from -it -and -is -able -to -keep -house -the -stawell -region -is -not -productive -of -gold -only -it -has -great -vineyards -and -produces -exceptionally -fine -wines -one -of -these -vineyards -the -great -western -owned -by -mr -irving -is -regarded -as -a -model -its -product -has -reputation -abroad -it -yields -a -choice -champagne -and -a -fine -claret -and -its -hock -took -a -prize -in -france -two -or -three -years -ago -the -champagne -is -kept -in -a -maze -of -passages -under -ground -cut -in -the -rock -to -secure -it -an -even -temperature -during -the -three -year -term -required -to -perfect -it -in -those -vaults -i -saw -120 -000 -bottles -of -champagne -the -colony -of -victoria -has -a -population -of -1 -000 -000 -and -those -people -are -said -to -drink -25 -000 -000 -bottles -of -champagne -per -year -the -dryest -community -on -the -earth -the -government -has -lately -reduced -the -duty -upon -foreign -wines -that -is -one -of -the -unkindnesses -of -protection -a -man -invests -years -of -work -and -a -vast -sum -of -money -in -a -worthy -enterprise -upon -the -faith -of -existing -laws -then -the -law -is -changed -and -the -man -is -robbed -by -his -own -government -on -the -way -back -to -stawell -we -had -a -chance -to -see -a -group -of -boulders -called -the -three -sisters -a -curiosity -oddly -located -for -it -was -upon -high -ground -with -the -land -sloping -away -from -it -and -no -height -above -it -from -whence -the -boulders -could -have -rolled -down -relics -of -an -early -ice -drift -perhaps -they -are -noble -boulders -one -of -them -has -the -size -and -smoothness -and -plump -sphericity -of -a -balloon -of -the -biggest -pattern -the -road -led -through -a -forest -of -great -gum -trees -lean -and -scraggy -and -sorrowful -the -road -was -cream -white -a -clayey -kind -of -earth -apparently -along -it -toiled -occasional -freight -wagons -drawn -by -long -double -files -of -oxen -those -wagons -were -going -a -journey -of -two -hundred -miles -i -was -told -and -were -running -a -successful -opposition -to -the -railway! -the -railways -are -owned -and -run -by -the -government -those -sad -gums -stood -up -out -of -the -dry -white -clay -pictures -of -patience -and -resignation -it -is -a -tree -that -can -get -along -without -water -still -it -is -fond -of -it -ravenously -so -it -is -a -very -intelligent -tree -and -will -detect -the -presence -of -hidden -water -at -a -distance -of -fifty -feet -and -send -out -slender -long -root -fibres -to -prospect -it -they -will -find -it -and -will -also -get -at -it -even -through -a -cement -wall -six -inches -thick -once -a -cement -water -pipe -under -ground -at -stawell -began -to -gradually -reduce -its -output -and -finally -ceased -altogether -to -deliver -water -upon -examining -into -the -matter -it -was -found -stopped -up -wadded -compactly -with -a -mass -of -root -fibres -delicate -and -hair -like -how -this -stuff -had -gotten -into -the -pipe -was -a -puzzle -for -some -little -time -finally -it -was -found -that -it -had -crept -in -through -a -crack -that -was -almost -invisible -to -the -eye -a -gum -tree -forty -feet -away -had -tapped -the -pipe -and -was -drinking -the -water -chapter -xxiv -there -is -no -such -thing -as -the -queen's -english -the -property -has -gone -into -the -hands -of -a -joint -stock -company -and -we -own -the -bulk -of -the -shares! -pudd'nhead -wilson's -new -calendar -frequently -in -australia -one -has -cloud -effects -of -an -unfamiliar -sort -we -had -this -kind -of -scenery -finely -staged -all -the -way -to -ballarat -consequently -we -saw -more -sky -than -country -on -that -journey -at -one -time -a -great -stretch -of -the -vault -was -densely -flecked -with -wee -ragged -edged -flakes -of -painfully -white -cloud -stuff -all -of -one -shape -and -size -and -equidistant -apart -with -narrow -cracks -of -adorable -blue -showing -between -the -whole -was -suggestive -of -a -hurricane -of -snow -flakes -drifting -across -the -skies -by -and -by -these -flakes -fused -themselves -together -in -interminable -lines -with -shady -faint -hollows -between -the -lines -the -long -satin -surfaced -rollers -following -each -other -in -simulated -movement -and -enchantingly -counterfeiting -the -majestic -march -of -a -flowing -sea -later -the -sea -solidified -itself -then -gradually -broke -up -its -mass -into -innumerable -lofty -white -pillars -of -about -one -size -and -ranged -these -across -the -firmament -in -receding -and -fading -perspective -in -the -similitude -of -a -stupendous -colonnade -a -mirage -without -a -doubt -flung -from -the -far -gates -of -the -hereafter -the -approaches -to -ballarat -were -beautiful -the -features -great -green -expanses -of -rolling -pasture -land -bisected -by -eye -contenting -hedges -of -commingled -new -gold -and -old -gold -gorse -and -a -lovely -lake -one -must -put -in -the -pause -there -to -fetch -the -reader -up -with -a -slight -jolt -and -keep -him -from -gliding -by -without -noticing -the -lake -one -must -notice -it -for -a -lovely -lake -is -not -as -common -a -thing -along -the -railways -of -australia -as -are -the -dry -places -ninety -two -in -the -shade -again -but -balmy -and -comfortable -fresh -and -bracing -a -perfect -climate -forty -five -years -ago -the -site -now -occupied -by -the -city -of -ballarat -was -a -sylvan -solitude -as -quiet -as -eden -and -as -lovely -nobody -had -ever -heard -of -it -on -the -25th -of -august -1851 -the -first -great -gold -strike -made -in -australia -was -made -here -the -wandering -prospectors -who -made -it -scraped -up -two -pounds -and -a -half -of -gold -the -first -day -worth -$600 -a -few -days -later -the -place -was -a -hive -a -town -the -news -of -the -strike -spread -everywhere -in -a -sort -of -instantaneous -way -spread -like -a -flash -to -the -very -ends -of -the -earth -a -celebrity -so -prompt -and -so -universal -has -hardly -been -paralleled -in -history -perhaps -it -was -as -if -the -name -ballarat -had -suddenly -been -written -on -the -sky -where -all -the -world -could -read -it -at -once -the -smaller -discoveries -made -in -the -colony -of -new -south -wales -three -months -before -had -already -started -emigrants -toward -australia -they -had -been -coming -as -a -stream -but -they -came -as -a -flood -now -a -hundred -thousand -people -poured -into -melbourne -from -england -and -other -countries -in -a -single -month -and -flocked -away -to -the -mines -the -crews -of -the -ships -that -brought -them -flocked -with -them -the -clerks -in -the -government -offices -followed -so -did -the -cooks -the -maids -the -coachmen -the -butlers -and -the -other -domestic -servants -so -did -the -carpenters -the -smiths -the -plumbers -the -painters -the -reporters -the -editors -the -lawyers -the -clients -the -barkeepers -the -bummers -the -blacklegs -the -thieves -the -loose -women -the -grocers -the -butchers -the -bakers -the -doctors -the -druggists -the -nurses -so -did -the -police -even -officials -of -high -and -hitherto -envied -place -threw -up -their -positions -and -joined -the -procession -this -roaring -avalanche -swept -out -of -melbourne -and -left -it -desolate -sunday -like -paralyzed -everything -at -a -stand -still -the -ships -lying -idle -at -anchor -all -signs -of -life -departed -all -sounds -stilled -save -the -rasping -of -the -cloud -shadows -as -they -scraped -across -the -vacant -streets -that -grassy -and -leafy -paradise -at -ballarat -was -soon -ripped -open -and -lacerated -and -scarified -and -gutted -in -the -feverish -search -for -its -hidden -riches -there -is -nothing -like -surface -mining -to -snatch -the -graces -and -beauties -and -benignities -out -of -a -paradise -and -make -an -odious -and -repulsive -spectacle -of -it -what -fortunes -were -made! -immigrants -got -rich -while -the -ship -unloaded -and -reloaded -and -went -back -home -for -good -in -the -same -cabin -they -had -come -out -in! -not -all -of -them -only -some -i -saw -the -others -in -ballarat -myself -forty -five -years -later -what -were -left -of -them -by -time -and -death -and -the -disposition -to -rove -they -were -young -and -gay -then -they -are -patriarchal -and -grave -now -and -they -do -not -get -excited -any -more -they -talk -of -the -past -they -live -in -it -their -life -is -a -dream -a -retrospection -ballarat -was -a -great -region -for -nuggets -no -such -nuggets -were -found -in -california -as -ballarat -produced -in -fact -the -ballarat -region -has -yielded -the -largest -ones -known -to -history -two -of -them -weighed -about -180 -pounds -each -and -together -were -worth -$90 -000 -they -were -offered -to -any -poor -person -who -would -shoulder -them -and -carry -them -away -gold -was -so -plentiful -that -it -made -people -liberal -like -that -ballarat -was -a -swarming -city -of -tents -in -the -early -days -everybody -was -happy -for -a -time -and -apparently -prosperous -then -came -trouble -the -government -swooped -down -with -a -mining -tax -and -in -its -worst -form -too -for -it -was -not -a -tax -upon -what -the -miner -had -taken -out -but -upon -what -he -was -going -to -take -out -if -he -could -find -it -it -was -a -license -tax -license -to -work -his -claim -and -it -had -to -be -paid -before -he -could -begin -digging -consider -the -situation -no -business -is -so -uncertain -as -surface -mining -your -claim -may -be -good -and -it -may -be -worthless -it -may -make -you -well -off -in -a -month -and -then -again -you -may -have -to -dig -and -slave -for -half -a -year -at -heavy -expense -only -to -find -out -at -last -that -the -gold -is -not -there -in -cost -paying -quantity -and -that -your -time -and -your -hard -work -have -been -thrown -away -it -might -be -wise -policy -to -advance -the -miner -a -monthly -sum -to -encourage -him -to -develop -the -country's -riches -but -to -tax -him -monthly -in -advance -instead -why -such -a -thing -was -never -dreamed -of -in -america -there -neither -the -claim -itself -nor -its -products -howsoever -rich -or -poor -were -taxed -the -ballarat -miners -protested -petitioned -complained -it -was -of -no -use -the -government -held -its -ground -and -went -on -collecting -the -tax -and -not -by -pleasant -methods -but -by -ways -which -must -have -been -very -galling -to -free -people -the -rumblings -of -a -coming -storm -began -to -be -audible -by -and -by -there -was -a -result -and -i -think -it -may -be -called -the -finest -thing -in -australasian -history -it -was -a -revolution -small -in -size -but -great -politically -it -was -a -strike -for -liberty -a -struggle -for -a -principle -a -stand -against -injustice -and -oppression -it -was -the -barons -and -john -over -again -it -was -hampden -and -ship -money -it -was -concord -and -lexington -small -beginnings -all -of -them -but -all -of -them -great -in -political -results -all -of -them -epoch -making -it -is -another -instance -of -a -victory -won -by -a -lost -battle -it -adds -an -honorable -page -to -history -the -people -know -it -and -are -proud -of -it -they -keep -green -the -memory -of -the -men -who -fell -at -the -eureka -stockade -and -peter -lalor -has -his -monument -the -surface -soil -of -ballarat -was -full -of -gold -this -soil -the -miners -ripped -and -tore -and -trenched -and -harried -and -disembowled -and -made -it -yield -up -its -immense -treasure -then -they -went -down -into -the -earth -with -deep -shafts -seeking -the -gravelly -beds -of -ancient -rivers -and -brooks -and -found -them -they -followed -the -courses -of -these -streams -and -gutted -them -sending -the -gravel -up -in -buckets -to -the -upper -world -and -washing -out -of -it -its -enormous -deposits -of -gold -the -next -biggest -of -the -two -monster -nuggets -mentioned -above -came -from -an -old -river -channel -180 -feet -under -ground -finally -the -quartz -lodes -were -attacked -that -is -not -poor -man's -mining -quartz -mining -and -milling -require -capital -and -staying -power -and -patience -big -companies -were -formed -and -for -several -decades -now -the -lodes -have -been -successfully -worked -and -have -yielded -great -wealth -since -the -gold -discovery -in -1853 -the -ballarat -mines -taking -the -three -kinds -of -mining -together -have -contributed -to -the -world's -pocket -something -over -three -hundred -millions -of -dollars -which -is -to -say -that -this -nearly -invisible -little -spot -on -the -earth's -surface -has -yielded -about -one -fourth -as -much -gold -in -forty -four -years -as -all -california -has -yielded -in -forty -seven -the -californian -aggregate -from -1848 -to -1895 -inclusive -as -reported -by -the -statistician -of -the -united -states -mint -is -$1 -265 -215 -217 -a -citizen -told -me -a -curious -thing -about -those -mines -with -all -my -experience -of -mining -i -had -never -heard -of -anything -of -the -sort -before -the -main -gold -reef -runs -about -north -and -south -of -course -for -that -is -the -custom -of -a -rich -gold -reef -at -ballarat -its -course -is -between -walls -of -slate -now -the -citizen -told -me -that -throughout -a -stretch -of -twelve -miles -along -the -reef -the -reef -is -crossed -at -intervals -by -a -straight -black -streak -of -a -carbonaceous -nature -a -streak -in -the -slate -a -streak -no -thicker -than -a -pencil -and -that -wherever -it -crosses -the -reef -you -will -certainly -find -gold -at -the -junction -it -is -called -the -indicator -thirty -feet -on -each -side -of -the -indicator -and -down -in -the -slate -of -course -is -a -still -finer -streak -a -streak -as -fine -as -a -pencil -mark -and -indeed -that -is -its -name -pencil -mark -whenever -you -find -the -pencil -mark -you -know -that -thirty -feet -from -it -is -the -indicator -you -measure -the -distance -excavate -find -the -indicator -trace -it -straight -to -the -reef -and -sink -your -shaft -your -fortune -is -made -for -certain -if -that -is -true -it -is -curious -and -it -is -curious -anyway -ballarat -is -a -town -of -only -40 -000 -population -and -yet -since -it -is -in -australia -it -has -every -essential -of -an -advanced -and -enlightened -big -city -this -is -pure -matter -of -course -i -must -stop -dwelling -upon -these -things -it -is -hard -to -keep -from -dwelling -upon -them -though -for -it -is -difficult -to -get -away -from -the -surprise -of -it -i -will -let -the -other -details -go -this -time -but -i -must -allow -myself -to -mention -that -this -little -town -has -a -park -of -326 -acres -a -flower -garden -of -83 -acres -with -an -elaborate -and -expensive -fernery -in -it -and -some -costly -and -unusually -fine -statuary -and -an -artificial -lake -covering -600 -acres -equipped -with -a -fleet -of -200 -shells -small -sail -boats -and -little -steam -yachts -at -this -point -i -strike -out -some -other -praiseful -things -which -i -was -tempted -to -add -i -do -not -strike -them -out -because -they -were -not -true -or -not -well -said -but -because -i -find -them -better -said -by -another -man -and -a -man -more -competent -to -testify -too -because -he -belongs -on -the -ground -and -knows -i -clip -them -from -a -chatty -speech -delivered -some -years -ago -by -mr -william -little -who -was -at -that -time -mayor -of -ballarat -the -language -of -our -citizens -in -this -as -in -other -parts -of -australasia -is -mostly -healthy -anglo -saxon -free -from -americanisms -vulgarisms -and -the -conflicting -dialects -of -our -fatherland -and -is -pure -enough -to -suit -a -trench -or -a -latham -our -youth -aided -by -climatic -influence -are -in -point -of -physique -and -comeliness -unsurpassed -in -the -sunny -south -our -young -men -are -well -ordered -and -our -maidens -'not -stepping -over -the -bounds -of -modesty -' -are -as -fair -as -psyches -dispensing -smiles -as -charming -as -november -flowers -the -closing -clause -has -the -seeming -of -a -rather -frosty -compliment -but -that -is -apparent -only -not -real -november -is -summer -time -there -his -compliment -to -the -local -purity -of -the -language -is -warranted -it -is -quite -free -from -impurities -this -is -acknowledged -far -and -wide -as -in -the -german -empire -all -cultivated -people -claim -to -speak -hanovarian -german -so -in -australasia -all -cultivated -people -claim -to -speak -ballarat -english -even -in -england -this -cult -has -made -considerable -progress -and -now -that -it -is -favored -by -the -two -great -universities -the -time -is -not -far -away -when -ballarat -english -will -come -into -general -use -among -the -educated -classes -of -great -britain -at -large -its -great -merit -is -that -it -is -shorter -than -ordinary -english -that -is -it -is -more -compressed -at -first -you -have -some -difficulty -in -understanding -it -when -it -is -spoken -as -rapidly -as -the -orator -whom -i -have -quoted -speaks -it -an -illustration -will -show -what -i -mean -when -he -called -and -i -handed -him -a -chair -he -bowed -and -said -q -presently -when -we -were -lighting -our -cigars -he -held -a -match -to -mine -and -i -said -thank -you -and -he -said -km -then -i -saw -'q' -is -the -end -of -the -phrase -i -thank -you -'km' -is -the -end -of -the -phrase -you -are -welcome -mr -little -puts -no -emphasis -upon -either -of -them -but -delivers -them -so -reduced -that -they -hardly -have -a -sound -all -ballarat -english -is -like -that -and -the -effect -is -very -soft -and -pleasant -it -takes -all -the -hardness -and -harshness -out -of -our -tongue -and -gives -to -it -a -delicate -whispery -and -vanishing -cadence -which -charms -the -ear -like -the -faint -rustling -of -the -forest -leaves -chapter -xxv -classic -a -book -which -people -praise -and -don't -read -pudd'nhead -wilson's -new -calendar -on -the -rail -again -bound -for -bendigo -from -diary -october -23 -got -up -at -6 -left -at -7 -30 -soon -reached -castlemaine -one -of -the -rich -gold -fields -of -the -early -days -waited -several -hours -for -a -train -left -at -3 -40 -and -reached -bendigo -in -an -hour -for -comrade -a -catholic -priest -who -was -better -than -i -was -but -didn't -seem -to -know -it -a -man -full -of -graces -of -the -heart -the -mind -and -the -spirit -a -lovable -man -he -will -rise -he -will -be -a -bishop -some -day -later -an -archbishop -later -a -cardinal -finally -an -archangel -i -hope -and -then -he -will -recall -me -when -i -say -do -you -remember -that -trip -we -made -from -ballarat -to -bendigo -when -you -were -nothing -but -father -c -and -i -was -nothing -to -what -i -am -now -it -has -actually -taken -nine -hours -to -come -from -ballarat -to -bendigo -we -could -have -saved -seven -by -walking -however -there -was -no -hurry -bendigo -was -another -of -the -rich -strikes -of -the -early -days -it -does -a -great -quartz -mining -business -now -that -business -which -more -than -any -other -that -i -know -of -teaches -patience -and -requires -grit -and -a -steady -nerve -the -town -is -full -of -towering -chimney -stacks -and -hoisting -works -and -looks -like -a -petroleum -city -speaking -of -patience -for -example -one -of -the -local -companies -went -steadily -on -with -its -deep -borings -and -searchings -without -show -of -gold -or -a -penny -of -reward -for -eleven -years -then -struck -it -and -became -suddenly -rich -the -eleven -years' -work -had -cost -$55 -000 -and -the -first -gold -found -was -a -grain -the -size -of -a -pin's -head -it -is -kept -under -locks -and -bars -as -a -precious -thing -and -is -reverently -shown -to -the -visitor -hats -off -when -i -saw -it -i -had -not -heard -its -history -it -is -gold -examine -it -take -the -glass -now -how -much -should -you -say -it -is -worth -i -said -i -should -say -about -two -cents -or -in -your -english -dialect -four -farthings -well -it -cost -l11 -000 -oh -come! -yes -it -did -ballarat -and -bendigo -have -produced -the -three -monumental -nuggets -of -the -world -and -this -one -is -the -monumentalest -one -of -the -three -the -other -two -represent -19 -000 -a -piece -this -one -a -couple -of -thousand -more -it -is -small -and -not -much -to -look -at -but -it -is -entitled -to -its -name -adam -it -is -the -adam -nugget -of -this -mine -and -its -children -run -up -into -the -millions -speaking -of -patience -again -another -of -the -mines -was -worked -under -heavy -expenses -during -17 -years -before -pay -was -struck -and -still -another -one -compelled -a -wait -of -21 -years -before -pay -was -struck -then -in -both -instances -the -outlay -was -all -back -in -a -year -or -two -with -compound -interest -bendigo -has -turned -out -even -more -gold -than -ballarat -the -two -together -have -produced -$650 -000 -000 -worth -which -is -half -as -much -as -california -has -produced -it -was -through -mr -blank -not -to -go -into -particulars -about -his -name -it -was -mainly -through -mr -blank -that -my -stay -in -bendigo -was -made -memorably -pleasant -and -interesting -he -explained -this -to -me -himself -he -told -me -that -it -was -through -his -influence -that -the -city -government -invited -me -to -the -town -hall -to -hear -complimentary -speeches -and -respond -to -them -that -it -was -through -his -influence -that -i -had -been -taken -on -a -long -pleasure -drive -through -the -city -and -shown -its -notable -features -that -it -was -through -his -influence -that -i -was -invited -to -visit -the -great -mines -that -it -was -through -his -influence -that -i -was -taken -to -the -hospital -and -allowed -to -see -the -convalescent -chinaman -who -had -been -attacked -at -midnight -in -his -lonely -hut -eight -weeks -before -by -robbers -and -stabbed -forty -six -times -and -scalped -besides -that -it -was -through -his -influence -that -when -i -arrived -this -awful -spectacle -of -piecings -and -patchings -and -bandagings -was -sitting -up -in -his -cot -letting -on -to -read -one -of -my -books -that -it -was -through -his -influence -that -efforts -had -been -made -to -get -the -catholic -archbishop -of -bendigo -to -invite -me -to -dinner -that -it -was -through -his -influence -that -efforts -had -been -made -to -get -the -anglican -bishop -of -bendigo -to -ask -me -to -supper -that -it -was -through -his -influence -that -the -dean -of -the -editorial -fraternity -had -driven -me -through -the -woodsy -outlying -country -and -shown -me -from -the -summit -of -lone -tree -hill -the -mightiest -and -loveliest -expanse -of -forest -clad -mountain -and -valley -that -i -had -seen -in -all -australia -and -when -he -asked -me -what -had -most -impressed -me -in -bendigo -and -i -answered -and -said -it -was -the -taste -and -the -public -spirit -which -had -adorned -the -streets -with -105 -miles -of -shade -trees -he -said -that -it -was -through -his -influence -that -it -had -been -done -but -i -am -not -representing -him -quite -correctly -he -did -not -say -it -was -through -his -influence -that -all -these -things -had -happened -for -that -would -have -been -coarse -be -merely -conveyed -that -idea -conveyed -it -so -subtly -that -i -only -caught -it -fleetingly -as -one -catches -vagrant -faint -breaths -of -perfume -when -one -traverses -the -meadows -in -summer -conveyed -it -without -offense -and -without -any -suggestion -of -egoism -or -ostentation -but -conveyed -it -nevertheless -he -was -an -irishman -an -educated -gentleman -grave -and -kindly -and -courteous -a -bachelor -and -about -forty -five -or -possibly -fifty -years -old -apparently -he -called -upon -me -at -the -hotel -and -it -was -there -that -we -had -this -talk -he -made -me -like -him -and -did -it -without -trouble -this -was -partly -through -his -winning -and -gentle -ways -but -mainly -through -the -amazing -familiarity -with -my -books -which -his -conversation -showed -he -was -down -to -date -with -them -too -and -if -he -had -made -them -the -study -of -his -life -he -could -hardly -have -been -better -posted -as -to -their -contents -than -he -was -he -made -me -better -satisfied -with -myself -than -i -had -ever -been -before -it -was -plain -that -he -had -a -deep -fondness -for -humor -yet -he -never -laughed -he -never -even -chuckled -in -fact -humor -could -not -win -to -outward -expression -on -his -face -at -all -no -he -was -always -grave -tenderly -pensively -grave -but -he -made -me -laugh -all -along -and -this -was -very -trying -and -very -pleasant -at -the -same -time -for -it -was -at -quotations -from -my -own -books -when -he -was -going -he -turned -and -said -you -don't -remember -me -i -why -no -have -we -met -before -no -it -was -a -matter -of -correspondence -correspondence -yes -many -years -ago -twelve -or -fifteen -oh -longer -than -that -but -of -course -you -a -musing -pause -then -he -said -do -you -remember -corrigan -castle -n -no -i -believe -i -don't -i -don't -seem -to -recall -the -name -he -waited -a -moment -pondering -with -the -door -knob -in -his -hand -then -started -out -but -turned -back -and -said -that -i -had -once -been -interested -in -corrigan -castle -and -asked -me -if -i -would -go -with -him -to -his -quarters -in -the -evening -and -take -a -hot -scotch -and -talk -it -over -i -was -a -teetotaler -and -liked -relaxation -so -i -said -i -would -we -drove -from -the -lecture -hall -together -about -half -past -ten -he -had -a -most -comfortably -and -tastefully -furnished -parlor -with -good -pictures -on -the -walls -indian -and -japanese -ornaments -on -the -mantel -and -here -and -there -and -books -everywhere -largely -mine -which -made -me -proud -the -light -was -brilliant -the -easy -chairs -were -deep -cushioned -the -arrangements -for -brewing -and -smoking -were -all -there -we -brewed -and -lit -up -then -he -passed -a -sheet -of -note -paper -to -me -and -said -do -you -remember -that -oh -yes -indeed! -the -paper -was -of -a -sumptuous -quality -at -the -top -was -a -twisted -and -interlaced -monogram -printed -from -steel -dies -in -gold -and -blue -and -red -in -the -ornate -english -fashion -of -long -years -ago -and -under -it -in -neat -gothic -capitals -was -this -printed -in -blue -the -mark -twain -club -corrigan -castle -187 -my! -said -i -how -did -you -come -by -this -i -was -president -of -it -no! -you -don't -mean -it -it -is -true -i -was -its -first -president -i -was -re -elected -annually -as -long -as -its -meetings -were -held -in -my -castle -corrigan -which -was -five -years -then -he -showed -me -an -album -with -twenty -three -photographs -of -me -in -it -five -of -them -were -of -old -dates -the -others -of -various -later -crops -the -list -closed -with -a -picture -taken -by -falk -in -sydney -a -month -before -you -sent -us -the -first -five -the -rest -were -bought -this -was -paradise! -we -ran -late -and -talked -talked -talked -subject -the -mark -twain -club -of -corrigan -castle -ireland -my -first -knowledge -of -that -club -dates -away -back -all -of -twenty -years -i -should -say -it -came -to -me -in -the -form -of -a -courteous -letter -written -on -the -note -paper -which -i -have -described -and -signed -by -order -of -the -president -c -pembroke -secretary -it -conveyed -the -fact -that -the -club -had -been -created -in -my -honor -and -added -the -hope -that -this -token -of -appreciation -of -my -work -would -meet -with -my -approval -i -answered -with -thanks -and -did -what -i -could -to -keep -my -gratification -from -over -exposure -it -was -then -that -the -long -correspondence -began -a -letter -came -back -by -order -of -the -president -furnishing -me -the -names -of -the -members -thirty -two -in -number -with -it -came -a -copy -of -the -constitution -and -by -laws -in -pamphlet -form -and -artistically -printed -the -initiation -fee -and -dues -were -in -their -proper -place -also -schedule -of -meetings -monthly -for -essays -upon -works -of -mine -followed -by -discussions -quarterly -for -business -and -a -supper -without -essays -but -with -after -supper -speeches -also -there -was -a -list -of -the -officers -president -vice -president -secretary -treasurer -etc -the -letter -was -brief -but -it -was -pleasant -reading -for -it -told -me -about -the -strong -interest -which -the -membership -took -in -their -new -venture -etc -etc -it -also -asked -me -for -a -photograph -a -special -one -i -went -down -and -sat -for -it -and -sent -it -with -a -letter -of -course -presently -came -the -badge -of -the -club -and -very -dainty -and -pretty -it -was -and -very -artistic -it -was -a -frog -peeping -out -from -a -graceful -tangle -of -grass -sprays -and -rushes -and -was -done -in -enamels -on -a -gold -basis -and -had -a -gold -pin -back -of -it -after -i -had -petted -it -and -played -with -it -and -caressed -it -and -enjoyed -it -a -couple -of -hours -the -light -happened -to -fall -upon -it -at -a -new -angle -and -revealed -to -me -a -cunning -new -detail -with -the -light -just -right -certain -delicate -shadings -of -the -grass -blades -and -rush -stems -wove -themselves -into -a -monogram -mine! -you -can -see -that -that -jewel -was -a -work -of -art -and -when -you -come -to -consider -the -intrinsic -value -of -it -you -must -concede -that -it -is -not -every -literary -club -that -could -afford -a -badge -like -that -it -was -easily -worth -$75 -in -the -opinion -of -messrs -marcus -and -ward -of -new -york -they -said -they -could -not -duplicate -it -for -that -and -make -a -profit -by -this -time -the -club -was -well -under -way -and -from -that -time -forth -its -secretary -kept -my -off -hours -well -supplied -with -business -he -reported -the -club's -discussions -of -my -books -with -laborious -fullness -and -did -his -work -with -great -spirit -and -ability -as -a -rule -he -synopsized -but -when -a -speech -was -especially -brilliant -he -short -handed -it -and -gave -me -the -best -passages -from -it -written -out -there -were -five -speakers -whom -he -particularly -favored -in -that -way -palmer -forbes -naylor -norris -and -calder -palmer -and -forbes -could -never -get -through -a -speech -without -attacking -each -other -and -each -in -his -own -way -was -formidably -effective -palmer -in -virile -and -eloquent -abuse -forbes -in -courtly -and -elegant -but -scalding -satire -i -could -always -tell -which -of -them -was -talking -without -looking -for -his -name -naylor -had -a -polished -style -and -a -happy -knack -at -felicitous -metaphor -norris's -style -was -wholly -without -ornament -but -enviably -compact -lucid -and -strong -but -after -all -calder -was -the -gem -he -never -spoke -when -sober -he -spoke -continuously -when -he -wasn't -and -certainly -they -were -the -drunkest -speeches -that -a -man -ever -uttered -they -were -full -of -good -things -but -so -incredibly -mixed -up -and -wandering -that -it -made -one's -head -swim -to -follow -him -they -were -not -intended -to -be -funny -but -they -were -funny -for -the -very -gravity -which -the -speaker -put -into -his -flowing -miracles -of -incongruity -in -the -course -of -five -years -i -came -to -know -the -styles -of -the -five -orators -as -well -as -i -knew -the -style -of -any -speaker -in -my -own -club -at -home -these -reports -came -every -month -they -were -written -on -foolscap -600 -words -to -the -page -and -usually -about -twenty -five -pages -in -a -report -a -good -15 -000 -words -i -should -say -a -solid -week's -work -the -reports -were -absorbingly -entertaining -long -as -they -were -but -unfortunately -for -me -they -did -not -come -alone -they -were -always -accompanied -by -a -lot -of -questions -about -passages -and -purposes -in -my -books -which -the -club -wanted -answered -and -additionally -accompanied -every -quarter -by -the -treasurer's -report -and -the -auditor's -report -and -the -committee's -report -and -the -president's -review -and -my -opinion -of -these -was -always -desired -also -suggestions -for -the -good -of -the -club -if -any -occurred -to -me -by -and -by -i -came -to -dread -those -things -and -this -dread -grew -and -grew -and -grew -grew -until -i -got -to -anticipating -them -with -a -cold -horror -for -i -was -an -indolent -man -and -not -fond -of -letter -writing -and -whenever -these -things -came -i -had -to -put -everything -by -and -sit -down -for -my -own -peace -of -mind -and -dig -and -dig -until -i -got -something -out -of -my -head -which -would -answer -for -a -reply -i -got -along -fairly -well -the -first -year -but -for -the -succeeding -four -years -the -mark -twain -club -of -corrigan -castle -was -my -curse -my -nightmare -the -grief -and -misery -of -my -life -and -i -got -so -so -sick -of -sitting -for -photographs -i -sat -every -year -for -five -years -trying -to -satisfy -that -insatiable -organization -then -at -last -i -rose -in -revolt -i -could -endure -my -oppressions -no -longer -i -pulled -my -fortitude -together -and -tore -off -my -chains -and -was -a -free -man -again -and -happy -from -that -day -i -burned -the -secretary's -fat -envelopes -the -moment -they -arrived -and -by -and -by -they -ceased -to -come -well -in -the -sociable -frankness -of -that -night -in -bendigo -i -brought -this -all -out -in -full -confession -then -mr -blank -came -out -in -the -same -frank -way -and -with -a -preliminary -word -of -gentle -apology -said -that -he -was -the -mark -twain -club -and -the -only -member -it -had -ever -had! -why -it -was -matter -for -anger -but -i -didn't -feel -any -he -said -he -never -had -to -work -for -a -living -and -that -by -the -time -he -was -thirty -life -had -become -a -bore -and -a -weariness -to -him -he -had -no -interests -left -they -had -paled -and -perished -one -by -one -and -left -him -desolate -he -had -begun -to -think -of -suicide -then -all -of -a -sudden -he -thought -of -that -happy -idea -of -starting -an -imaginary -club -and -went -straightway -to -work -at -it -with -enthusiasm -and -love -he -was -charmed -with -it -it -gave -him -something -to -do -it -elaborated -itself -on -his -hands -it -became -twenty -times -more -complex -and -formidable -than -was -his -first -rude -draft -of -it -every -new -addition -to -his -original -plan -which -cropped -up -in -his -mind -gave -him -a -fresh -interest -and -a -new -pleasure -he -designed -the -club -badge -himself -and -worked -over -it -altering -and -improving -it -a -number -of -days -and -nights -then -sent -to -london -and -had -it -made -it -was -the -only -one -that -was -made -it -was -made -for -me -the -rest -of -the -club -went -without -he -invented -the -thirty -two -members -and -their -names -he -invented -the -five -favorite -speakers -and -their -five -separate -styles -he -invented -their -speeches -and -reported -them -himself -he -would -have -kept -that -club -going -until -now -if -i -hadn't -deserted -he -said -he -said -he -worked -like -a -slave -over -those -reports -each -of -them -cost -him -from -a -week -to -a -fortnight's -work -and -the -work -gave -him -pleasure -and -kept -him -alive -and -willing -to -be -alive -it -was -a -bitter -blow -to -him -when -the -club -died -finally -there -wasn't -any -corrigan -castle -he -had -invented -that -too -it -was -wonderful -the -whole -thing -and -altogether -the -most -ingenious -and -laborious -and -cheerful -and -painstaking -practical -joke -i -have -ever -heard -of -and -i -liked -it -liked -to -bear -him -tell -about -it -yet -i -have -been -a -hater -of -practical -jokes -from -as -long -back -as -i -can -remember -finally -he -said -do -you -remember -a -note -from -melbourne -fourteen -or -fifteen -years -ago -telling -about -your -lecture -tour -in -australia -and -your -death -and -burial -in -melbourne -a -note -from -henry -bascomb -of -bascomb -hall -upper -holywell -hants -yes -i -wrote -it -m -y -word! -yes -i -did -it -i -don't -know -why -i -just -took -the -notion -and -carried -it -out -without -stopping -to -think -it -was -wrong -it -could -have -done -harm -i -was -always -sorry -about -it -afterward -you -must -forgive -me -i -was -mr -bascom's -guest -on -his -yacht -on -his -voyage -around -the -world -he -often -spoke -of -you -and -of -the -pleasant -times -you -had -had -together -in -his -home -and -the -notion -took -me -there -in -melbourne -and -i -imitated -his -hand -and -wrote -the -letter -so -the -mystery -was -cleared -up -after -so -many -many -years -chapter -xxvi -there -are -people -who -can -do -all -fine -and -heroic -things -but -one! -keep -from -telling -their -happinesses -to -the -unhappy -pudd'nhead -wilson's -new -calendar -after -visits -to -maryborough -and -some -other -australian -towns -we -presently -took -passage -for -new -zealand -if -it -would -not -look -too -much -like -showing -off -i -would -tell -the -reader -where -new -zealand -is -for -he -is -as -i -was -he -thinks -he -knows -and -he -thinks -he -knows -where -hertzegovina -is -and -how -to -pronounce -pariah -and -how -to -use -the -word -unique -without -exposing -himself -to -the -derision -of -the -dictionary -but -in -truth -he -knows -none -of -these -things -there -are -but -four -or -five -people -in -the -world -who -possess -this -knowledge -and -these -make -their -living -out -of -it -they -travel -from -place -to -place -visiting -literary -assemblages -geographical -societies -and -seats -of -learning -and -springing -sudden -bets -that -these -people -do -not -know -these -things -since -all -people -think -they -know -them -they -are -an -easy -prey -to -these -adventurers -or -rather -they -were -an -easy -prey -until -the -law -interfered -three -months -ago -and -a -new -york -court -decided -that -this -kind -of -gambling -is -illegal -because -it -traverses -article -iv -section -9 -of -the -constitution -of -the -united -states -which -forbids -betting -on -a -sure -thing -this -decision -was -rendered -by -the -full -bench -of -the -new -york -supreme -court -after -a -test -sprung -upon -the -court -by -counsel -for -the -prosecution -which -showed -that -none -of -the -nine -judges -was -able -to -answer -any -of -the -four -questions -all -people -think -that -new -zealand -is -close -to -australia -or -asia -or -somewhere -and -that -you -cross -to -it -on -a -bridge -but -that -is -not -so -it -is -not -close -to -anything -but -lies -by -itself -out -in -the -water -it -is -nearest -to -australia -but -still -not -near -the -gap -between -is -very -wide -it -will -be -a -surprise -to -the -reader -as -it -was -to -me -to -learn -that -the -distance -from -australia -to -new -zealand -is -really -twelve -or -thirteen -hundred -miles -and -that -there -is -no -bridge -i -learned -this -from -professor -x -of -yale -university -whom -i -met -in -the -steamer -on -the -great -lakes -when -i -was -crossing -the -continent -to -sail -across -the -pacific -i -asked -him -about -new -zealand -in -order -to -make -conversation -i -supposed -he -would -generalize -a -little -without -compromising -himself -and -then -turn -the -subject -to -something -he -was -acquainted -with -and -my -object -would -then -be -attained -the -ice -would -be -broken -and -we -could -go -smoothly -on -and -get -acquainted -and -have -a -pleasant -time -but -to -my -surprise -he -was -not -only -not -embarrassed -by -my -question -but -seemed -to -welcome -it -and -to -take -a -distinct -interest -in -it -he -began -to -talk -fluently -confidently -comfortably -and -as -he -talked -my -admiration -grew -and -grew -for -as -the -subject -developed -under -his -hands -i -saw -that -he -not -only -knew -where -new -zealand -was -but -that -he -was -minutely -familiar -with -every -detail -of -its -history -politics -religions -and -commerce -its -fauna -flora -geology -products -and -climatic -peculiarities -when -he -was -done -i -was -lost -in -wonder -and -admiration -and -said -to -myself -he -knows -everything -in -the -domain -of -human -knowledge -he -is -king -i -wanted -to -see -him -do -more -miracles -and -so -just -for -the -pleasure -of -hearing -him -answer -i -asked -him -about -hertzegovina -and -pariah -and -unique -but -he -began -to -generalize -then -and -show -distress -i -saw -that -with -new -zealand -gone -he -was -a -samson -shorn -of -his -locks -he -was -as -other -men -this -was -a -curious -and -interesting -mystery -and -i -was -frank -with -him -and -asked -him -to -explain -it -he -tried -to -avoid -it -at -first -but -then -laughed -and -said -that -after -all -the -matter -was -not -worth -concealment -so -he -would -let -me -into -the -secret -in -substance -this -is -his -story -last -autumn -i -was -at -work -one -morning -at -home -when -a -card -came -up -the -card -of -a -stranger -under -the -name -was -printed -a -line -which -showed -that -this -visitor -was -professor -of -theological -engineering -in -wellington -university -new -zealand -i -was -troubled -troubled -i -mean -by -the -shortness -of -the -notice -college -etiquette -required -that -he -be -at -once -invited -to -dinner -by -some -member -of -the -faculty -invited -to -dine -on -that -day -not -put -off -till -a -subsequent -day -i -did -not -quite -know -what -to -do -college -etiquette -requires -in -the -case -of -a -foreign -guest -that -the -dinner -talk -shall -begin -with -complimentary -references -to -his -country -its -great -men -its -services -to -civilization -its -seats -of -learning -and -things -like -that -and -of -course -the -host -is -responsible -and -must -either -begin -this -talk -himself -or -see -that -it -is -done -by -some -one -else -i -was -in -great -difficulty -and -the -more -i -searched -my -memory -the -more -my -trouble -grew -i -found -that -i -knew -nothing -about -new -zealand -i -thought -i -knew -where -it -was -and -that -was -all -i -had -an -impression -that -it -was -close -to -australia -or -asia -or -somewhere -and -that -one -went -over -to -it -on -a -bridge -this -might -turn -out -to -be -incorrect -and -even -if -correct -it -would -not -furnish -matter -enough -for -the -purpose -at -the -dinner -and -i -should -expose -my -college -to -shame -before -my -guest -he -would -see -that -i -a -member -of -the -faculty -of -the -first -university -in -america -was -wholly -ignorant -of -his -country -and -he -would -go -away -and -tell -this -and -laugh -at -it -the -thought -of -it -made -my -face -burn -i -sent -for -my -wife -and -told -her -how -i -was -situated -and -asked -for -her -help -and -she -thought -of -a -thing -which -i -might -have -thought -of -myself -if -i -had -not -been -excited -and -worried -she -said -she -would -go -and -tell -the -visitor -that -i -was -out -but -would -be -in -in -a -few -minutes -and -she -would -talk -and -keep -him -busy -while -i -got -out -the -back -way -and -hurried -over -and -make -professor -lawson -give -the -dinner -for -lawson -knew -everything -and -could -meet -the -guest -in -a -creditable -way -and -save -the -reputation -of -the -university -i -ran -to -lawson -but -was -disappointed -he -did -not -know -anything -about -new -zealand -he -said -that -as -far -as -his -recollection -went -it -was -close -to -australia -or -asia -or -somewhere -and -you -go -over -to -it -on -a -bridge -but -that -was -all -he -knew -it -was -too -bad -lawson -was -a -perfect -encyclopedia -of -abstruse -learning -but -now -in -this -hour -of -our -need -it -turned -out -that -he -did -not -know -any -useful -thing -we -consulted -he -saw -that -the -reputation -of -the -university -was -in -very -real -peril -and -he -walked -the -floor -in -anxiety -talking -and -trying -to -think -out -some -way -to -meet -the -difficulty -presently -he -decided -that -we -must -try -the -rest -of -the -faculty -some -of -them -might -know -about -new -zealand -so -we -went -to -the -telephone -and -called -up -the -professor -of -astronomy -and -asked -him -and -he -said -that -all -he -knew -was -that -it -was -close -to -australia -or -asia -or -somewhere -and -you -went -over -to -it -on -we -shut -him -off -and -called -up -the -professor -of -biology -and -he -said -that -all -he -knew -was -that -it -was -close -to -aus -we -shut -him -off -and -sat -down -worried -and -disheartened -to -see -if -we -could -think -up -some -other -scheme -we -shortly -hit -upon -one -which -promised -well -and -this -one -we -adopted -and -set -its -machinery -going -at -once -it -was -this -lawson -must -give -the -dinner -the -faculty -must -be -notified -by -telephone -to -prepare -we -must -all -get -to -work -diligently -and -at -the -end -of -eight -hours -and -a -half -we -must -come -to -dinner -acquainted -with -new -zealand -at -least -well -enough -informed -to -appear -without -discredit -before -this -native -to -seem -properly -intelligent -we -should -have -to -know -about -new -zealand's -population -and -politics -and -form -of -government -and -commerce -and -taxes -and -products -and -ancient -history -and -modern -history -and -varieties -of -religion -and -nature -of -the -laws -and -their -codification -and -amount -of -revenue -and -whence -drawn -and -methods -of -collection -and -percentage -of -loss -and -character -of -climate -and -well -a -lot -of -things -like -that -we -must -suck -the -maps -and -cyclopedias -dry -and -while -we -posted -up -in -this -way -the -faculty's -wives -must -flock -over -one -after -the -other -in -a -studiedly -casual -way -and -help -my -wife -keep -the -new -zealander -quiet -and -not -let -him -get -out -and -come -interfering -with -our -studies -the -scheme -worked -admirably -but -it -stopped -business -stopped -it -entirely -it -is -in -the -official -log -book -of -yale -to -be -read -and -wondered -at -by -future -generations -the -account -of -the -great -blank -day -the -memorable -blank -day -the -day -wherein -the -wheels -of -culture -were -stopped -a -sunday -silence -prevailed -all -about -and -the -whole -university -stood -still -while -the -faculty -read -up -and -qualified -itself -to -sit -at -meat -without -shame -in -the -presence -of -the -professor -of -theological -engineering -from -new -zealand -when -we -assembled -at -the -dinner -we -were -miserably -tired -and -worn -but -we -were -posted -yes -it -is -fair -to -claim -that -in -fact -erudition -is -a -pale -name -for -it -new -zealand -was -the -only -subject -and -it -was -just -beautiful -to -hear -us -ripple -it -out -and -with -such -an -air -of -unembarrassed -ease -and -unostentatious -familiarity -with -detail -and -trained -and -seasoned -mastery -of -the -subject -and -oh -the -grace -and -fluency -of -it! -well -finally -somebody -happened -to -notice -that -the -guest -was -looking -dazed -and -wasn't -saying -anything -so -they -stirred -him -up -of -course -then -that -man -came -out -with -a -good -honest -eloquent -compliment -that -made -the -faculty -blush -he -said -he -was -not -worthy -to -sit -in -the -company -of -men -like -these -that -he -had -been -silent -from -admiration -that -he -had -been -silent -from -another -cause -also -silent -from -shame -silent -from -ignorance! -'for -' -said -he -'i -who -have -lived -eighteen -years -in -new -zealand -and -have -served -five -in -a -professorship -and -ought -to -know -much -about -that -country -perceive -now -that -i -know -almost -nothing -about -it -i -say -it -with -shame -that -i -have -learned -fifty -times -yes -a -hundred -times -more -about -new -zealand -in -these -two -hours -at -this -table -than -i -ever -knew -before -in -all -the -eighteen -years -put -together -i -was -silent -because -i -could -not -help -myself -what -i -knew -about -taxes -and -policies -and -laws -and -revenue -and -products -and -history -and -all -that -multitude -of -things -was -but -general -and -ordinary -and -vague -unscientific -in -a -word -and -it -would -have -been -insanity -to -expose -it -here -to -the -searching -glare -of -your -amazingly -accurate -and -all -comprehensive -knowledge -of -those -matters -gentlemen -i -beg -you -to -let -me -sit -silent -as -becomes -me -but -do -not -change -the -subject -i -can -at -least -follow -you -in -this -one -whereas -if -you -change -to -one -which -shall -call -out -the -full -strength -of -your -mighty -erudition -i -shall -be -as -one -lost -if -you -know -all -this -about -a -remote -little -inconsequent -patch -like -new -zealand -ah -what -wouldn't -you -know -about -any -other -subject!' -chapter -xxvil -man -is -the -only -animal -that -blushes -or -needs -to -pudd'nhead -wilson's -new -calendar -the -universal -brotherhood -of -man -is -our -most -precious -possession -what -there -is -of -it -pudd'nhead -wilson's -new -calendar -from -diary -november -1 -noon -a -fine -day -a -brilliant -sun -warm -in -the -sun -cold -in -the -shade -an -icy -breeze -blowing -out -of -the -south -a -solemn -long -swell -rolling -up -northward -it -comes -from -the -south -pole -with -nothing -in -the -way -to -obstruct -its -march -and -tone -its -energy -down -i -have -read -somewhere -that -an -acute -observer -among -the -early -explorers -cook -or -tasman -accepted -this -majestic -swell -as -trustworthy -circumstantial -evidence -that -no -important -land -lay -to -the -southward -and -so -did -not -waste -time -on -a -useless -quest -in -that -direction -but -changed -his -course -and -went -searching -elsewhere -afternoon -passing -between -tasmania -formerly -van -diemen's -land -and -neighboring -islands -islands -whence -the -poor -exiled -tasmanian -savages -used -to -gaze -at -their -lost -homeland -and -cry -and -die -of -broken -hearts -how -glad -i -am -that -all -these -native -races -are -dead -and -gone -or -nearly -so -the -work -was -mercifully -swift -and -horrible -in -some -portions -of -australia -as -far -as -tasmania -is -concerned -the -extermination -was -complete -not -a -native -is -left -it -was -a -strife -of -years -and -decades -of -years -the -whites -and -the -blacks -hunted -each -other -ambushed -each -other -butchered -each -other -the -blacks -were -not -numerous -but -they -were -wary -alert -cunning -and -they -knew -their -country -well -they -lasted -a -long -time -few -as -they -were -and -inflicted -much -slaughter -upon -the -whites -the -government -wanted -to -save -the -blacks -from -ultimate -extermination -if -possible -one -of -its -schemes -was -to -capture -them -and -coop -them -up -on -a -neighboring -island -under -guard -bodies -of -whites -volunteered -for -the -hunt -for -the -pay -was -good -l5 -for -each -black -captured -and -delivered -but -the -success -achieved -was -not -very -satisfactory -the -black -was -naked -and -his -body -was -greased -it -was -hard -to -get -a -grip -on -him -that -would -hold -the -whites -moved -about -in -armed -bodies -and -surprised -little -families -of -natives -and -did -make -captures -but -it -was -suspected -that -in -these -surprises -half -a -dozen -natives -were -killed -to -one -caught -and -that -was -not -what -the -government -desired -another -scheme -was -to -drive -the -natives -into -a -corner -of -the -island -and -fence -them -in -by -a -cordon -of -men -placed -in -line -across -the -country -but -the -natives -managed -to -slip -through -constantly -and -continue -their -murders -and -arsons -the -governor -warned -these -unlettered -savages -by -printed -proclamation -that -they -must -stay -in -the -desolate -region -officially -appointed -for -them! -the -proclamation -was -a -dead -letter -the -savages -could -not -read -it -afterward -a -picture -proclamation -was -issued -it -was -painted -up -on -boards -and -these -were -nailed -to -trees -in -the -forest -herewith -is -a -photographic -reproduction -of -this -fashion -plate -substantially -it -means -1 -the -governor -wishes -the -whites -and -the -blacks -to -love -each -other -2 -he -loves -his -black -subjects -3 -blacks -who -kill -whites -will -be -hanged -4 -whites -who -kill -blacks -will -be -hanged -upon -its -several -schemes -the -government -spent -l30 -000 -and -employed -the -labors -and -ingenuities -of -several -thousand -whites -for -a -long -time -with -failure -as -a -result -then -at -last -a -quarter -of -a -century -after -the -beginning -of -the -troubles -between -the -two -races -the -right -man -was -found -no -he -found -himself -this -was -george -augustus -robinson -called -in -history -the -conciliator -he -was -not -educated -and -not -conspicuous -in -any -way -he -was -a -working -bricklayer -in -hobart -town -but -he -must -have -been -an -amazing -personality -a -man -worth -traveling -far -to -see -it -may -be -his -counterpart -appears -in -history -but -i -do -not -know -where -to -look -for -it -he -set -himself -this -incredible -task -to -go -out -into -the -wilderness -the -jungle -and -the -mountain -retreats -where -the -hunted -and -implacable -savages -were -hidden -and -appear -among -them -unarmed -speak -the -language -of -love -and -of -kindness -to -them -and -persuade -them -to -forsake -their -homes -and -the -wild -free -life -that -was -so -dear -to -them -and -go -with -him -and -surrender -to -the -hated -whites -and -live -under -their -watch -and -ward -and -upon -their -charity -the -rest -of -their -lives! -on -its -face -it -was -the -dream -of -a -madman -in -the -beginning -his -moral -suasion -project -was -sarcastically -dubbed -the -sugar -plum -speculation -if -the -scheme -was -striking -and -new -to -the -world's -experience -the -situation -was -not -less -so -it -was -this -the -white -population -numbered -40 -000 -in -1831 -the -black -population -numbered -three -hundred -not -300 -warriors -but -300 -men -women -and -children -the -whites -were -armed -with -guns -the -blacks -with -clubs -and -spears -the -whites -had -fought -the -blacks -for -a -quarter -of -a -century -and -had -tried -every -thinkable -way -to -capture -kill -or -subdue -them -and -could -not -do -it -if -white -men -of -any -race -could -have -done -it -these -would -have -accomplished -it -but -every -scheme -had -failed -the -splendid -300 -the -matchless -300 -were -unconquered -and -manifestly -unconquerable -they -would -not -yield -they -would -listen -to -no -terms -they -would -fight -to -the -bitter -end -yet -they -had -no -poet -to -keep -up -their -heart -and -sing -the -marvel -of -their -magnificent -patriotism -at -the -end -of -five -and -twenty -years -of -hard -fighting -the -surviving -300 -naked -patriots -were -still -defiant -still -persistent -still -efficacious -with -their -rude -weapons -and -the -governor -and -the -40 -000 -knew -not -which -way -to -turn -nor -what -to -do -then -the -bricklayer -that -wonderful -man -proposed -to -go -out -into -the -wilderness -with -no -weapon -but -his -tongue -and -no -protection -but -his -honest -eye -and -his -humane -heart -and -track -those -embittered -savages -to -their -lairs -in -the -gloomy -forests -and -among -the -mountain -snows -naturally -he -was -considered -a -crank -but -he -was -not -quite -that -in -fact -he -was -a -good -way -short -of -that -he -was -building -upon -his -long -and -intimate -knowledge -of -the -native -character -the -deriders -of -his -project -were -right -from -their -standpoint -for -they -believed -the -natives -to -be -mere -wild -beasts -and -robinson -was -right -from -his -standpoint -for -he -believed -the -natives -to -be -human -beings -the -truth -did -really -lie -between -the -two -the -event -proved -that -robinson's -judgment -was -soundest -but -about -once -a -month -for -four -years -the -event -came -near -to -giving -the -verdict -to -the -deriders -for -about -that -frequently -robinson -barely -escaped -falling -under -the -native -spears -but -history -shows -that -he -had -a -thinking -head -and -was -not -a -mere -wild -sentimentalist -for -instance -he -wanted -the -war -parties -called -in -before -he -started -unarmed -upon -his -mission -of -peace -he -wanted -the -best -chance -of -success -not -a -half -chance -and -he -was -very -willing -to -have -help -and -so -high -rewards -were -advertised -for -any -who -would -go -unarmed -with -him -this -opportunity -was -declined -robinson -persuaded -some -tamed -natives -of -both -sexes -to -go -with -him -a -strong -evidence -of -his -persuasive -powers -for -those -natives -well -knew -that -their -destruction -would -be -almost -certain -as -it -turned -out -they -had -to -face -death -over -and -over -again -robinson -and -his -little -party -had -a -difficult -undertaking -upon -their -hands -they -could -not -ride -off -horseback -comfortably -into -the -woods -and -call -leonidas -and -his -300 -together -for -a -talk -and -a -treaty -the -following -day -for -the -wild -men -were -not -in -a -body -they -were -scattered -immense -distances -apart -over -regions -so -desolate -that -even -the -birds -could -not -make -a -living -with -the -chances -offered -scattered -in -groups -of -twenty -a -dozen -half -a -dozen -even -in -groups -of -three -and -the -mission -must -go -on -foot -mr -bonwick -furnishes -a -description -of -those -horrible -regions -whereby -it -will -be -seen -that -even -fugitive -gangs -of -the -hardiest -and -choicest -human -devils -the -world -has -seen -the -convicts -set -apart -to -people -the -hell -of -macquarrie -harbor -station -were -never -able -but -once -to -survive -the -horrors -of -a -march -through -them -but -starving -and -struggling -and -fainting -and -failing -ate -each -other -and -died -onward -still -onward -was -the -order -of -the -indomitable -robinson -no -one -ignorant -of -the -western -country -of -tasmania -can -form -a -correct -idea -of -the -traveling -difficulties -while -i -was -resident -in -hobart -town -the -governor -sir -john -franklin -and -his -lady -undertook -the -western -journey -to -macquarrie -harbor -and -suffered -terribly -one -man -who -assisted -to -carry -her -ladyship -through -the -swamps -gave -me -his -bitter -experience -of -its -miseries -several -were -disabled -for -life -no -wonder -that -but -one -party -escaping -from -macquarrie -harbor -convict -settlement -arrived -at -the -civilized -region -in -safety -men -perished -in -the -scrub -were -lost -in -snow -or -were -devoured -by -their -companions -this -was -the -territory -traversed -by -mr -robinson -and -his -black -guides -all -honor -to -his -intrepidity -and -their -wonderful -fidelity! -when -they -had -in -the -depth -of -winter -to -cross -deep -and -rapid -rivers -pass -among -mountains -six -thousand -feet -high -pierce -dangerous -thickets -and -find -food -in -a -country -forsaken -even -by -birds -we -can -realize -their -hardships -after -a -frightful -journey -by -cradle -mountain -and -over -the -lofty -plateau -of -middlesex -plains -the -travelers -experienced -unwonted -misery -and -the -circumstances -called -forth -the -best -qualities -of -the -noble -little -band -mr -robinson -wrote -afterwards -to -mr -secretary -burnett -some -details -of -this -passage -of -horrors -in -that -letter -of -oct -2 -1834 -he -states -that -his -natives -were -very -reluctant -to -go -over -the -dreadful -mountain -passes -that -'for -seven -successive -days -we -continued -traveling -over -one -solid -body -of -snow -' -that -'the -snows -were -of -incredible -depth -' -that -'the -natives -were -frequently -up -to -their -middle -in -snow -' -but -still -the -ill -clad -ill -fed -diseased -and -way -worn -men -and -women -were -sustained -by -the -cheerful -voice -of -their -unconquerable -friend -and -responded -most -nobly -to -his -call -mr -bonwick -says -that -robinson's -friendly -capture -of -the -big -river -tribe -remember -it -was -a -whole -tribe -was -by -far -the -grandest -feature -of -the -war -and -the -crowning -glory -of -his -efforts -the -word -war -was -not -well -chosen -and -is -misleading -there -was -war -still -but -only -the -blacks -were -conducting -it -the -whites -were -holding -off -until -robinson -could -give -his -scheme -a -fair -trial -i -think -that -we -are -to -understand -that -the -friendly -capture -of -that -tribe -was -by -far -the -most -important -thing -the -highest -in -value -that -happened -during -the -whole -thirty -years -of -truceless -hostilities -that -it -was -a -decisive -thing -a -peaceful -waterloo -the -surrender -of -the -native -napoleon -and -his -dreaded -forces -the -happy -ending -of -the -long -strife -for -that -tribe -was -the -terror -of -the -colony -its -chief -the -black -douglas -of -bush -households -robinson -knew -that -these -formidable -people -were -lurking -somewhere -in -some -remote -corner -of -the -hideous -regions -just -described -and -he -and -his -unarmed -little -party -started -on -a -tedious -and -perilous -hunt -for -them -at -last -there -under -the -shadows -of -the -frenchman's -cap -whose -grim -cone -rose -five -thousand -feet -in -the -uninhabited -westward -interior -they -were -found -it -was -a -serious -moment -robinson -himself -believed -for -once -that -his -mission -successful -until -now -was -to -end -here -in -failure -and -that -his -own -death -hour -had -struck -the -redoubtable -chief -stood -in -menacing -attitude -with -his -eighteen -foot -spear -poised -his -warriors -stood -massed -at -his -back -armed -for -battle -their -faces -eloquent -with -their -long -cherished -loathing -for -white -men -they -rattled -their -spears -and -shouted -their -war -cry -their -women -were -back -of -them -laden -with -supplies -of -weapons -and -keeping -their -150 -eager -dogs -quiet -until -the -chief -should -give -the -signal -to -fall -on -i -think -we -shall -soon -be -in -the -resurrection -whispered -a -member -of -robinson's -little -party -i -think -we -shall -answered -robinson -then -plucked -up -heart -and -began -his -persuasions -in -the -tribe's -own -dialect -which -surprised -and -pleased -the -chief -presently -there -was -an -interruption -by -the -chief -who -are -you -we -are -gentlemen -where -are -your -guns -we -have -none -the -warrior -was -astonished -where -your -little -guns -pistols -we -have -none -a -few -minutes -passed -in -by -play -suspense -discussion -among -the -tribesmen -robinson's -tamed -squaws -ventured -to -cross -the -line -and -begin -persuasions -upon -the -wild -squaws -then -the -chief -stepped -back -to -confer -with -the -old -women -the -real -arbiters -of -savage -war -mr -bonwick -continues -as -the -fallen -gladiator -in -the -arena -looks -for -the -signal -of -life -or -death -from -the -president -of -the -amphitheatre -so -waited -our -friends -in -anxious -suspense -while -the -conference -continued -in -a -few -minutes -before -a -word -was -uttered -the -women -of -the -tribe -threw -up -their -arms -three -times -this -was -the -inviolable -sign -of -peace! -down -fell -the -spears -forward -with -a -heavy -sigh -of -relief -and -upward -glance -of -gratitude -came -the -friends -of -peace -the -impulsive -natives -rushed -forth -with -tears -and -cries -as -each -saw -in -the -other's -rank -a -loved -one -of -the -past -it -was -a -jubilee -of -joy -a -festival -followed -and -while -tears -flowed -at -the -recital -of -woe -a -corrobory -of -pleasant -laughter -closed -the -eventful -day -in -four -years -without -the -spilling -of -a -drop -of -blood -robinson -brought -them -all -in -willing -captives -and -delivered -them -to -the -white -governor -and -ended -the -war -which -powder -and -bullets -and -thousands -of -men -to -use -them -had -prosecuted -without -result -since -1804 -marsyas -charming -the -wild -beasts -with -his -music -that -is -fable -but -the -miracle -wrought -by -robinson -is -fact -it -is -history -and -authentic -and -surely -there -is -nothing -greater -nothing -more -reverence -compelling -in -the -history -of -any -country -ancient -or -modern -and -in -memory -of -the -greatest -man -australasia -ever -developed -or -ever -will -develop -there -is -a -stately -monument -to -george -augustus -robinson -the -conciliator -in -no -it -is -to -another -man -i -forget -his -name -however -robertson's -own -generation -honored -him -and -in -manifesting -it -honored -themselves -the -government -gave -him -a -money -reward -and -a -thousand -acres -of -land -and -the -people -held -mass -meetings -and -praised -him -and -emphasized -their -praise -with -a -large -subscription -of -money -a -good -dramatic -situation -but -the -curtain -fell -on -another -when -this -desperate -tribe -was -thus -captured -there -was -much -surprise -to -find -that -the -l30 -000 -of -a -little -earlier -day -had -been -spent -and -the -whole -population -of -the -colony -placed -under -arms -in -contention -with -an -opposing -force -of -sixteen -men -with -wooden -spears! -yet -such -was -the -fact -the -celebrated -big -river -tribe -that -had -been -raised -by -european -fears -to -a -host -consisted -of -sixteen -men -nine -women -and -one -child -with -a -knowledge -of -the -mischief -done -by -these -few -their -wonderful -marches -and -their -widespread -aggressions -their -enemies -cannot -deny -to -them -the -attributes -of -courage -and -military -tact -a -wallace -might -harass -a -large -army -with -a -small -and -determined -band -but -the -contending -parties -were -at -least -equal -in -arms -and -civilization -the -zulus -who -fought -us -in -africa -the -maories -in -new -zealand -the -arabs -in -the -soudan -were -far -better -provided -with -weapons -more -advanced -in -the -science -of -war -and -considerably -more -numerous -than -the -naked -tasmanians -governor -arthur -rightly -termed -them -a -noble -race -these -were -indeed -wonderful -people -the -natives -they -ought -not -to -have -been -wasted -they -should -have -been -crossed -with -the -whites -it -would -have -improved -the -whites -and -done -the -natives -no -harm -but -the -natives -were -wasted -poor -heroic -wild -creatures -they -were -gathered -together -in -little -settlements -on -neighboring -islands -and -paternally -cared -for -by -the -government -and -instructed -in -religion -and -deprived -of -tobacco -because -the -superintendent -of -the -sunday -school -was -not -a -smoker -and -so -considered -smoking -immoral -the -natives -were -not -used -to -clothes -and -houses -and -regular -hours -and -church -and -school -and -sunday -school -and -work -and -the -other -misplaced -persecutions -of -civilization -and -they -pined -for -their -lost -home -and -their -wild -free -life -too -late -they -repented -that -they -had -traded -that -heaven -for -this -hell -they -sat -homesick -on -their -alien -crags -and -day -by -day -gazed -out -through -their -tears -over -the -sea -with -unappeasable -longing -toward -the -hazy -bulk -which -was -the -specter -of -what -had -been -their -paradise -one -by -one -their -hearts -broke -and -they -died -in -a -very -few -years -nothing -but -a -scant -remnant -remained -alive -a -handful -lingered -along -into -age -in -1864 -the -last -man -died -in -1876 -the -last -woman -died -and -the -spartans -of -australasia -were -extinct -the -whites -always -mean -well -when -they -take -human -fish -out -of -the -ocean -and -try -to -make -them -dry -and -warm -and -happy -and -comfortable -in -a -chicken -coop -but -the -kindest -hearted -white -man -can -always -be -depended -on -to -prove -himself -inadequate -when -he -deals -with -savages -he -cannot -turn -the -situation -around -and -imagine -how -he -would -like -it -to -have -a -well -meaning -savage -transfer -him -from -his -house -and -his -church -and -his -clothes -and -his -books -and -his -choice -food -to -a -hideous -wilderness -of -sand -and -rocks -and -snow -and -ice -and -sleet -and -storm -and -blistering -sun -with -no -shelter -no -bed -no -covering -for -his -and -his -family's -naked -bodies -and -nothing -to -eat -but -snakes -and -grubs -and -'offal -this -would -be -a -hell -to -him -and -if -he -had -any -wisdom -he -would -know -that -his -own -civilization -is -a -hell -to -the -savage -but -he -hasn't -any -and -has -never -had -any -and -for -lack -of -it -he -shut -up -those -poor -natives -in -the -unimaginable -perdition -of -his -civilization -committing -his -crime -with -the -very -best -intentions -and -saw -those -poor -creatures -waste -away -under -his -tortures -and -gazed -at -it -vaguely -troubled -and -sorrowful -and -wondered -what -could -be -the -matter -with -them -one -is -almost -betrayed -into -respecting -those -criminals -they -were -so -sincerely -kind -and -tender -and -humane -and -well -meaning -they -didn't -know -why -those -exiled -savages -faded -away -and -they -did -their -honest -best -to -reason -it -out -and -one -man -in -a -like -case -in -new -south -wales -did -reason -it -out -and -arrive -at -a -solution -it -is -from -the -wrath -of -god -which -is -revealed -from -heaven -against -cold -ungodliness -and -unrighteousness -of -men -that -settles -it -chapter -xxviii -let -us -be -thankful -for -the -fools -but -for -them -the -rest -of -us -could -not -succeed -pudd'nhead -wilson's -new -calendar -the -aphorism -does -really -seem -true -given -the -circumstances -the -man -will -appear -but -the -man -musn't -appear -ahead -of -time -or -it -will -spoil -everything -in -robinson's -case -the -moment -had -been -approaching -for -a -quarter -of -a -century -and -meantime -the -future -conciliator -was -tranquilly -laying -bricks -in -hobart -when -all -other -means -had -failed -the -moment -had -arrived -and -the -bricklayer -put -down -his -trowel -and -came -forward -earlier -he -would -have -been -jeered -back -to -his -trowel -again -it -reminds -me -of -a -tale -that -was -told -me -by -a -kentuckian -on -the -train -when -we -were -crossing -montana -he -said -the -tale -was -current -in -louisville -years -ago -he -thought -it -had -been -in -print -but -could -not -remember -at -any -rate -in -substance -it -was -this -as -nearly -as -i -can -call -it -back -to -mind -a -few -years -before -the -outbreak -of -the -civil -war -it -began -to -appear -that -memphis -tennessee -was -going -to -be -a -great -tobacco -entrepot -the -wise -could -see -the -signs -of -it -at -that -time -memphis -had -a -wharf -boat -of -course -there -was -a -paved -sloping -wharf -for -the -accommodation -of -freight -but -the -steamers -landed -on -the -outside -of -the -wharfboat -and -all -loading -and -unloading -was -done -across -it -between -steamer -and -shore -a -number -of -wharfboat -clerks -were -needed -and -part -of -the -time -every -day -they -were -very -busy -and -part -of -the -time -tediously -idle -they -were -boiling -over -with -youth -and -spirits -and -they -had -to -make -the -intervals -of -idleness -endurable -in -some -way -and -as -a -rule -they -did -it -by -contriving -practical -jokes -and -playing -them -upon -each -other -the -favorite -butt -for -the -jokes -was -ed -jackson -because -he -played -none -himself -and -was -easy -game -for -other -people's -for -he -always -believed -whatever -was -told -him -one -day -he -told -the -others -his -scheme -for -his -holiday -he -was -not -going -fishing -or -hunting -this -time -no -he -had -thought -out -a -better -plan -out -of -his -$40 -a -month -he -had -saved -enough -for -his -purpose -in -an -economical -way -and -he -was -going -to -have -a -look -at -new -york -it -was -a -great -and -surprising -idea -it -meant -travel -immense -travel -in -those -days -it -meant -seeing -the -world -it -was -the -equivalent -of -a -voyage -around -it -in -ours -at -first -the -other -youths -thought -his -mind -was -affected -but -when -they -found -that -he -was -in -earnest -the -next -thing -to -be -thought -of -was -what -sort -of -opportunity -this -venture -might -afford -for -a -practical -joke -the -young -men -studied -over -the -matter -then -held -a -secret -consultation -and -made -a -plan -the -idea -was -that -one -of -the -conspirators -should -offer -ed -a -letter -of -introduction -to -commodore -vanderbilt -and -trick -him -into -delivering -it -it -would -be -easy -to -do -this -but -what -would -ed -do -when -he -got -back -to -memphis -that -was -a -serious -matter -he -was -good -hearted -and -had -always -taken -the -jokes -patiently -but -they -had -been -jokes -which -did -not -humiliate -him -did -not -bring -him -to -shame -whereas -this -would -be -a -cruel -one -in -that -way -and -to -play -it -was -to -meddle -with -fire -for -with -all -his -good -nature -ed -was -a -southerner -and -the -english -of -that -was -that -when -he -came -back -he -would -kill -as -many -of -the -conspirators -as -he -could -before -falling -himself -however -the -chances -must -be -taken -it -wouldn't -do -to -waste -such -a -joke -as -that -so -the -letter -was -prepared -with -great -care -and -elaboration -it -was -signed -alfred -fairchild -and -was -written -in -an -easy -and -friendly -spirit -it -stated -that -the -bearer -was -the -bosom -friend -of -the -writer's -son -and -was -of -good -parts -and -sterling -character -and -it -begged -the -commodore -to -be -kind -to -the -young -stranger -for -the -writer's -sake -it -went -on -to -say -you -may -have -forgotten -me -in -this -long -stretch -of -time -but -you -will -easily -call -me -back -out -of -your -boyhood -memories -when -i -remind -you -of -how -we -robbed -old -stevenson's -orchard -that -night -and -how -while -he -was -chasing -down -the -road -after -us -we -cut -across -the -field -and -doubled -back -and -sold -his -own -apples -to -his -own -cook -for -a -hat -full -of -doughnuts -and -the -time -that -we -and -so -forth -and -so -on -bringing -in -names -of -imaginary -comrades -and -detailing -all -sorts -of -wild -and -absurd -and -of -course -wholly -imaginary -schoolboy -pranks -and -adventures -but -putting -them -into -lively -and -telling -shape -with -all -gravity -ed -was -asked -if -he -would -like -to -have -a -letter -to -commodore -vanderbilt -the -great -millionaire -it -was -expected -that -the -question -would -astonish -ed -and -it -did -what -do -you -know -that -extraordinary -man -no -but -my -father -does -they -were -schoolboys -together -and -if -you -like -i'll -write -and -ask -father -i -know -he'll -be -glad -to -give -it -to -you -for -my -sake -ed -could -not -find -words -capable -of -expressing -his -gratitude -and -delight -the -three -days -passed -and -the -letter -was -put -into -his -bands -he -started -on -his -trip -still -pouring -out -his -thanks -while -he -shook -good -bye -all -around -and -when -he -was -out -of -sight -his -comrades -let -fly -their -laughter -in -a -storm -of -happy -satisfaction -and -then -quieted -down -and -were -less -happy -less -satisfied -for -the -old -doubts -as -to -the -wisdom -of -this -deception -began -to -intrude -again -arrived -in -new -york -ed -found -his -way -to -commodore -vanderbilt's -business -quarters -and -was -ushered -into -a -large -anteroom -where -a -score -of -people -were -patiently -awaiting -their -turn -for -a -two -minute -interview -with -the -millionaire -in -his -private -office -a -servant -asked -for -ed's -card -and -got -the -letter -instead -ed -was -sent -for -a -moment -later -and -found -mr -vanderbilt -alone -with -the -letter -open -in -his -hand -pray -sit -down -mr -er -jackson -ah -sit -down -mr -jackson -by -the -opening -sentences -it -seems -to -be -a -letter -from -an -old -friend -allow -me -i -will -run -my -eye -through -it -he -says -he -says -why -who -is -it -he -turned -the -sheet -and -found -the -signature -alfred -fairchild -hm -fairchild -i -don't -recall -the -name -but -that -is -nothing -a -thousand -names -have -gone -from -me -he -says -he -says -hm -hmoh -dear -but -it's -good! -oh -it's -rare! -i -don't -quite -remember -it -but -i -seem -to -it'll -all -come -back -to -me -presently -he -says -he -says -hm -hm -oh -but -that -was -a -game! -oh -spl -endid! -how -it -carries -me -back! -it's -all -dim -of -course -it's -a -long -time -ago -and -the -names -some -of -the -names -are -wavery -and -indistinct -but -sho' -i -know -it -happened -i -can -feel -it! -and -lord -how -it -warms -my -heart -and -brings -back -my -lost -youth! -well -well -well -i've -got -to -come -back -into -this -work -a -day -world -now -business -presses -and -people -are -waiting -i'll -keep -the -rest -for -bed -to -night -and -live -my -youth -over -again -and -you'll -thank -fairchild -for -me -when -you -see -him -i -used -to -call -him -alf -i -think -and -you'll -give -him -my -gratitude -for -what -this -letter -has -done -for -the -tired -spirit -of -a -hard -worked -man -and -tell -him -there -isn't -anything -that -i -can -do -for -him -or -any -friend -of -his -that -i -won't -do -and -as -for -you -my -lad -you -are -my -guest -you -can't -stop -at -any -hotel -in -new -york -sit -where -you -are -a -little -while -till -i -get -through -with -these -people -then -we'll -go -home -i'll -take -care -of -you -my -boy -make -yourself -easy -as -to -that -ed -stayed -a -week -and -had -an -immense -time -and -never -suspected -that -the -commodore's -shrewd -eye -was -on -him -and -that -he -was -daily -being -weighed -and -measured -and -analyzed -and -tried -and -tested -yes -he -had -an -immense -time -and -never -wrote -home -but -saved -it -all -up -to -tell -when -he -should -get -back -twice -with -proper -modesty -and -decency -he -proposed -to -end -his -visit -but -the -commodore -said -no -wait -leave -it -to -me -i'll -tell -you -when -to -go -in -those -days -the -commodore -was -making -some -of -those -vast -combinations -of -his -consolidations -of -warring -odds -and -ends -of -railroads -into -harmonious -systems -and -concentrations -of -floating -and -rudderless -commerce -in -effective -centers -and -among -other -things -his -farseeing -eye -had -detected -the -convergence -of -that -huge -tobacco -commerce -already -spoken -of -toward -memphis -and -he -had -resolved -to -set -his -grasp -upon -it -and -make -it -his -own -the -week -came -to -an -end -then -the -commodore -said -now -you -can -start -home -but -first -we -will -have -some -more -talk -about -that -tobacco -matter -i -know -you -now -i -know -your -abilities -as -well -as -you -know -them -yourself -perhaps -better -you -understand -that -tobacco -matter -you -understand -that -i -am -going -to -take -possession -of -it -and -you -also -understand -the -plans -which -i -have -matured -for -doing -it -what -i -want -is -a -man -who -knows -my -mind -and -is -qualified -to -represent -me -in -memphis -and -be -in -supreme -command -of -that -important -business -and -i -appoint -you -me! -yes -your -salary -will -be -high -of -course -for -you -are -representing -me -later -you -will -earn -increases -of -it -and -will -get -them -you -will -need -a -small -army -of -assistants -choose -them -yourself -and -carefully -take -no -man -for -friendship's -sake -but -all -things -being -equal -take -the -man -you -know -take -your -friend -in -preference -to -the -stranger -after -some -further -talk -under -this -head -the -commodore -said -good -bye -my -boy -and -thank -alf -for -me -for -sending -you -to -me -when -ed -reached -memphis -he -rushed -down -to -the -wharf -in -a -fever -to -tell -his -great -news -and -thank -the -boys -over -and -over -again -for -thinking -to -give -him -the -letter -to -mr -vanderbilt -it -happened -to -be -one -of -those -idle -times -blazing -hot -noonday -and -no -sign -of -life -on -the -wharf -but -as -ed -threaded -his -way -among -the -freight -piles -he -saw -a -white -linen -figure -stretched -in -slumber -upon -a -pile -of -grain -sacks -under -an -awning -and -said -to -himself -that's -one -of -them -and -hastened -his -step -next -he -said -it's -charley -it's -fairchild -good -and -the -next -moment -laid -an -affectionate -hand -on -the -sleeper's -shoulder -the -eyes -opened -lazily -took -one -glance -the -face -blanched -the -form -whirled -itself -from -the -sack -pile -and -in -an -instant -ed -was -alone -and -fairchild -was -flying -for -the -wharf -boat -like -the -wind! -ed -was -dazed -stupefied -was -fairchild -crazy -what -could -be -the -meaning -of -this -he -started -slow -and -dreamily -down -toward -the -wharf -boat -turned -the -corner -of -a -freight -pile -and -came -suddenly -upon -two -of -the -boys -they -were -lightly -laughing -over -some -pleasant -matter -they -heard -his -step -and -glanced -up -just -as -he -discovered -them -the -laugh -died -abruptly -and -before -ed -could -speak -they -were -off -and -sailing -over -barrels -and -bales -like -hunted -deer -again -ed -was -paralyzed -had -the -boys -all -gone -mad -what -could -be -the -explanation -of -this -extraordinary -conduct -and -so -dreaming -along -he -reached -the -wharf -boat -and -stepped -aboard -nothing -but -silence -there -and -vacancy -he -crossed -the -deck -turned -the -corner -to -go -down -the -outer -guard -heard -a -fervent -o -lord! -and -saw -a -white -linen -form -plunge -overboard -the -youth -came -up -coughing -and -strangling -and -cried -out -go -'way -from -here! -you -let -me -alone -i -didn't -do -it -i -swear -i -didn't! -didn't -do -what -give -you -the -never -mind -what -you -didn't -do -come -out -of -that! -what -makes -you -all -act -so -what -have -i -done -you -why -you -haven't -done -anything -but -well -then -what -have -you -got -against -me -what -do -you -all -treat -me -so -for -i -er -but -haven't -you -got -anything -against -us -of -course -not -what -put -such -a -thing -into -your -head -honor -bright -you -haven't -honor -bright -swear -it! -i -don't -know -what -in -the -world -you -mean -but -i -swear -it -anyway -and -you'll -shake -hands -with -me -goodness -knows -i'll -be -glad -to! -why -i'm -just -starving -to -shake -hands -with -somebody! -the -swimmer -muttered -hang -him -he -smelt -a -rat -and -never -delivered -the -letter! -but -it's -all -right -i'm -not -going -to -fetch -up -the -subject -and -he -crawled -out -and -came -dripping -and -draining -to -shake -hands -first -one -and -then -another -of -the -conspirators -showed -up -cautiously -armed -to -the -teeth -took -in -the -amicable -situation -then -ventured -warily -forward -and -joined -the -love -feast -and -to -ed's -eager -inquiry -as -to -what -made -them -act -as -they -had -been -acting -they -answered -evasively -and -pretended -that -they -had -put -it -up -as -a -joke -to -see -what -he -would -do -it -was -the -best -explanation -they -could -invent -at -such -short -notice -and -each -said -to -himself -he -never -delivered -that -letter -and -the -joke -is -on -us -if -he -only -knew -it -or -we -were -dull -enough -to -come -out -and -tell -then -of -course -they -wanted -to -know -all -about -the -trip -and -he -said -come -right -up -on -the -boiler -deck -and -order -the -drinks -it's -my -treat -i'm -going -to -tell -you -all -about -it -and -to -night -it's -my -treat -again -and -we'll -have -oysters -and -a -time! -when -the -drinks -were -brought -and -cigars -lighted -ed -said -well -when -i -delivered -the -letter -to -mr -vanderbilt -great -scott! -gracious -how -you -scared -me -what's -the -matter -oh -er -nothing -nothing -it -was -a -tack -in -the -chair -seat -said -one -but -you -all -said -it -however -no -matter -when -i -delivered -the -letter -did -you -deliver -it -and -they -looked -at -each -other -as -people -might -who -thought -that -maybe -they -were -dreaming -then -they -settled -to -listening -and -as -the -story -deepened -and -its -marvels -grew -the -amazement -of -it -made -them -dumb -and -the -interest -of -it -took -their -breath -they -hardly -uttered -a -whisper -during -two -hours -but -sat -like -petrifactions -and -drank -in -the -immortal -romance -at -last -the -tale -was -ended -and -ed -said -and -it's -all -owing -to -you -boys -and -you'll -never -find -me -ungrateful -bless -your -hearts -the -best -friends -a -fellow -ever -had! -you'll -all -have -places -i -want -every -one -of -you -i -know -you -i -know -you -'by -the -back -' -as -the -gamblers -say -you're -jokers -and -all -that -but -you're -sterling -with -the -hallmark -on -and -charley -fairchild -you -shall -be -my -first -assistant -and -right -hand -because -of -your -first -class -ability -and -because -you -got -me -the -letter -and -for -your -father's -sake -who -wrote -it -for -me -and -to -please -mr -vanderbilt -who -said -it -would! -and -here's -to -that -great -man -drink -hearty! -yes -when -the -moment -comes -the -man -appears -even -if -he -is -a -thousand -miles -away -and -has -to -be -discovered -by -a -practical -joke -chapter -xxix -when -people -do -not -respect -us -we -are -sharply -offended -yet -deep -down -in -his -private -heart -no -man -much -respects -himself -pudd'nhead -wilson's -new -calendar -necessarily -the -human -interest -is -the -first -interest -in -the -log -book -of -any -country -the -annals -of -tasmania -in -whose -shadow -we -were -sailing -are -lurid -with -that -feature -tasmania -was -a -convict -dump -in -old -times -this -has -been -indicated -in -the -account -of -the -conciliator -where -reference -is -made -to -vain -attempts -of -desperate -convicts -to -win -to -permanent -freedom -after -escaping -from -macquarrie -harbor -and -the -gates -of -hell -in -the -early -days -tasmania -had -a -great -population -of -convicts -of -both -sexes -and -all -ages -and -a -bitter -hard -life -they -had -in -one -spot -there -was -a -settlement -of -juvenile -convicts -children -who -had -been -sent -thither -from -their -home -and -their -friends -on -the -other -side -of -the -globe -to -expiate -their -crimes -in -due -course -our -ship -entered -the -estuary -called -the -derwent -at -whose -head -stands -hobart -the -capital -of -tasmania -the -derwent's -shores -furnish -scenery -of -an -interesting -sort -the -historian -laurie -whose -book -the -story -of -australasia -is -just -out -invoices -its -features -with -considerable -truth -and -intemperance -the -marvelous -picturesqueness -of -every -point -of -view -combined -with -the -clear -balmy -atmosphere -and -the -transparency -of -the -ocean -depths -must -have -delighted -and -deeply -impressed -the -early -explorers -if -the -rock -bound -coasts -sullen -defiant -and -lowering -seemed -uninviting -these -were -occasionally -broken -into -charmingly -alluring -coves -floored -with -golden -sand -clad -with -evergreen -shrubbery -and -adorned -with -every -variety -of -indigenous -wattle -she -oak -wild -flower -and -fern -from -the -delicately -graceful -'maiden -hair' -to -the -palm -like -'old -man' -while -the -majestic -gum -tree -clean -and -smooth -as -the -mast -of -'some -tall -admiral' -pierces -the -clear -air -to -the -height -of -230 -feet -or -more -it -looked -so -to -me -coasting -along -tasman's -peninsula -what -a -shock -of -pleasant -wonder -must -have -struck -the -early -mariner -on -suddenly -sighting -cape -pillar -with -its -cluster -of -black -ribbed -basaltic -columns -rising -to -a -height -of -900 -feet -the -hydra -head -wreathed -in -a -turban -of -fleecy -cloud -the -base -lashed -by -jealous -waves -spouting -angry -fountains -of -foam -that -is -well -enough -but -i -did -not -suppose -those -snags -were -900 -feet -high -still -they -were -a -very -fine -show -they -stood -boldly -out -by -themselves -and -made -a -fascinatingly -odd -spectacle -but -there -was -nothing -about -their -appearance -to -suggest -the -heads -of -a -hydra -they -looked -like -a -row -of -lofty -slabs -with -their -upper -ends -tapered -to -the -shape -of -a -carving -knife -point -in -fact -the -early -voyager -ignorant -of -their -great -height -might -have -mistaken -them -for -a -rusty -old -rank -of -piles -that -had -sagged -this -way -and -that -out -of -the -perpendicular -the -peninsula -is -lofty -rocky -and -densely -clothed -with -scrub -or -brush -or -both -it -is -joined -to -the -main -by -a -low -neck -at -this -junction -was -formerly -a -convict -station -called -port -arthur -a -place -hard -to -escape -from -behind -it -was -the -wilderness -of -scrub -in -which -a -fugitive -would -soon -starve -in -front -was -the -narrow -neck -with -a -cordon -of -chained -dogs -across -it -and -a -line -of -lanterns -and -a -fence -of -living -guards -armed -we -saw -the -place -as -we -swept -by -that -is -we -had -a -glimpse -of -what -we -were -told -was -the -entrance -to -port -arthur -the -glimpse -was -worth -something -as -a -remembrancer -but -that -was -all -the -voyage -thence -up -the -derwent -frith -displays -a -grand -succession -of -fairy -visions -in -its -entire -length -elsewhere -unequaled -in -gliding -over -the -deep -blue -sea -studded -with -lovely -islets -luxuriant -to -the -water's -edge -one -is -at -a -loss -which -scene -to -choose -for -contemplation -and -to -admire -most -when -the -huon -and -bruni -have -been -passed -there -seems -no -possible -chance -of -a -rival -but -suddenly -mount -wellington -massive -and -noble -like -his -brother -etna -literally -heaves -in -sight -sternly -guarded -on -either -hand -by -mounts -nelson -and -rumney -presently -we -arrive -at -sullivan's -cove -hobart! -it -is -an -attractive -town -it -sits -on -low -hills -that -slope -to -the -harbor -a -harbor -that -looks -like -a -river -and -is -as -smooth -as -one -its -still -surface -is -pictured -with -dainty -reflections -of -boats -and -grassy -banks -and -luxuriant -foliage -back -of -the -town -rise -highlands -that -are -clothed -in -woodland -loveliness -and -over -the -way -is -that -noble -mountain -wellington -a -stately -bulk -a -most -majestic -pile -how -beautiful -is -the -whole -region -for -form -and -grouping -and -opulence -and -freshness -of -foliage -and -variety -of -color -and -grace -and -shapeliness -of -the -hills -the -capes -the -promontories -and -then -the -splendor -of -the -sunlight -the -dim -rich -distances -the -charm -of -the -water -glimpses! -and -it -was -in -this -paradise -that -the -yellow -liveried -convicts -were -landed -and -the -corps -bandits -quartered -and -the -wanton -slaughter -of -the -kangaroo -chasing -black -innocents -consummated -on -that -autumn -day -in -may -in -the -brutish -old -time -it -was -all -out -of -keeping -with -the -place -a -sort -of -bringing -of -heaven -and -hell -together -the -remembrance -of -this -paradise -reminds -me -that -it -was -at -hobart -that -we -struck -the -head -of -the -procession -of -junior -englands -we -were -to -encounter -other -sections -of -it -in -new -zealand -presently -and -others -later -in -natal -wherever -the -exiled -englishman -can -find -in -his -new -home -resemblances -to -his -old -one -he -is -touched -to -the -marrow -of -his -being -the -love -that -is -in -his -heart -inspires -his -imagination -and -these -allied -forces -transfigure -those -resemblances -into -authentic -duplicates -of -the -revered -originals -it -is -beautiful -the -feeling -which -works -this -enchantment -and -it -compels -one's -homage -compels -it -and -also -compels -one's -assent -compels -it -always -even -when -as -happens -sometimes -one -does -not -see -the -resemblances -as -clearly -as -does -the -exile -who -is -pointing -them -out -the -resemblances -do -exist -it -is -quite -true -and -often -they -cunningly -approximate -the -originals -but -after -all -in -the -matter -of -certain -physical -patent -rights -there -is -only -one -england -now -that -i -have -sampled -the -globe -i -am -not -in -doubt -there -is -a -beauty -of -switzerland -and -it -is -repeated -in -the -glaciers -and -snowy -ranges -of -many -parts -of -the -earth -there -is -a -beauty -of -the -fiord -and -it -is -repeated -in -new -zealand -and -alaska -there -is -a -beauty -of -hawaii -and -it -is -repeated -in -ten -thousand -islands -of -the -southern -seas -there -is -a -beauty -of -the -prairie -and -the -plain -and -it -is -repeated -here -and -there -in -the -earth -each -of -these -is -worshipful -each -is -perfect -in -its -way -yet -holds -no -monopoly -of -its -beauty -but -that -beauty -which -is -england -is -alone -it -has -no -duplicate -it -is -made -up -of -very -simple -details -just -grass -and -trees -and -shrubs -and -roads -and -hedges -and -gardens -and -houses -and -vines -and -churches -and -castles -and -here -and -there -a -ruin -and -over -it -all -a -mellow -dream -haze -of -history -but -its -beauty -is -incomparable -and -all -its -own -hobart -has -a -peculiarity -it -is -the -neatest -town -that -the -sun -shines -on -and -i -incline -to -believe -that -it -is -also -the -cleanest -however -that -may -be -its -supremacy -in -neatness -is -not -to -be -questioned -there -cannot -be -another -town -in -the -world -that -has -no -shabby -exteriors -no -rickety -gates -and -fences -no -neglected -houses -crumbling -to -ruin -no -crazy -and -unsightly -sheds -no -weed -grown -front -yards -of -the -poor -no -back -yards -littered -with -tin -cans -and -old -boots -and -empty -bottles -no -rubbish -in -the -gutters -no -clutter -on -the -sidewalks -no -outer -borders -fraying -out -into -dirty -lanes -and -tin -patched -huts -no -in -hobart -all -the -aspects -are -tidy -and -all -a -comfort -to -the -eye -the -modestest -cottage -looks -combed -and -brushed -and -has -its -vines -its -flowers -its -neat -fence -its -neat -gate -its -comely -cat -asleep -on -the -window -ledge -we -had -a -glimpse -of -the -museum -by -courtesy -of -the -american -gentleman -who -is -curator -of -it -it -has -samples -of -half -a -dozen -different -kinds -of -marsupials -[a -marsupial -is -a -plantigrade -vertebrate -whose -specialty -is -its -pocket -in -some -countries -it -is -extinct -in -the -others -it -is -rare -the -first -american -marsupials -were -stephen -girard -mr -aston -and -the -opossum -the -principal -marsupials -of -the -southern -hemisphere -are -mr -rhodes -and -the -kangaroo -i -myself -am -the -latest -marsupial -also -i -might -boast -that -i -have -the -largest -pocket -of -them -all -but -there -is -nothing -in -that -] -one -the -tasmanian -devil -that -is -i -think -he -was -one -of -them -and -there -was -a -fish -with -lungs -when -the -water -dries -up -it -can -live -in -the -mud -most -curious -of -all -was -a -parrot -that -kills -sheep -on -one -great -sheep -run -this -bird -killed -a -thousand -sheep -in -a -whole -year -he -doesn't -want -the -whole -sheep -but -only -the -kidney -fat -this -restricted -taste -makes -him -an -expensive -bird -to -support -to -get -the -fat -he -drives -his -beak -in -and -rips -it -out -the -wound -is -mortal -this -parrot -furnishes -a -notable -example -of -evolution -brought -about -by -changed -conditions -when -the -sheep -culture -was -introduced -it -presently -brought -famine -to -the -parrot -by -exterminating -a -kind -of -grub -which -had -always -thitherto -been -the -parrot's -diet -the -miseries -of -hunger -made -the -bird -willing -to -eat -raw -flesh -since -it -could -get -no -other -food -and -it -began -to -pick -remnants -of -meat -from -sheep -skins -hung -out -on -the -fences -to -dry -it -soon -came -to -prefer -sheep -meat -to -any -other -food -and -by -and -by -it -came -to -prefer -the -kidney -fat -to -any -other -detail -of -the -sheep -the -parrot's -bill -was -not -well -shaped -for -digging -out -the -fat -but -nature -fixed -that -matter -she -altered -the -bill's -shape -and -now -the -parrot -can -dig -out -kidney -fat -better -than -the -chief -justice -of -the -supreme -court -or -anybody -else -for -that -matter -even -an -admiral -and -there -was -another -curiosity -quite -a -stunning -one -i -thought -arrow -heads -and -knives -just -like -those -which -primeval -man -made -out -of -flint -and -thought -he -had -done -such -a -wonderful -thing -yes -and -has -been -humored -and -coddled -in -that -superstition -by -this -age -of -admiring -scientists -until -there -is -probably -no -living -with -him -in -the -other -world -by -now -yet -here -is -his -finest -and -nicest -work -exactly -duplicated -in -our -day -and -by -people -who -have -never -heard -of -him -or -his -works -by -aborigines -who -lived -in -the -islands -of -these -seas -within -our -time -and -they -not -only -duplicated -those -works -of -art -but -did -it -in -the -brittlest -and -most -treacherous -of -substances -glass -made -them -out -of -old -brandy -bottles -flung -out -of -the -british -camps -millions -of -tons -of -them -it -is -time -for -primeval -man -to -make -a -little -less -noise -now -he -has -had -his -day -he -is -not -what -he -used -to -be -we -had -a -drive -through -a -bloomy -and -odorous -fairy -land -to -the -refuge -for -the -indigent -a -spacious -and -comfortable -home -with -hospitals -etc -for -both -sexes -there -was -a -crowd -in -there -of -the -oldest -people -i -have -ever -seen -it -was -like -being -suddenly -set -down -in -a -new -world -a -weird -world -where -youth -has -never -been -a -world -sacred -to -age -and -bowed -forms -and -wrinkles -out -of -the -359 -persons -present -223 -were -ex -convicts -and -could -have -told -stirring -tales -no -doubt -if -they -had -been -minded -to -talk -42 -of -the -359 -were -past -80 -and -several -were -close -upon -90 -the -average -age -at -death -there -is -76 -years -as -for -me -i -have -no -use -for -that -place -it -is -too -healthy -seventy -is -old -enough -after -that -there -is -too -much -risk -youth -and -gaiety -might -vanish -any -day -and -then -what -is -left -death -in -life -death -without -its -privileges -death -without -its -benefits -there -were -185 -women -in -that -refuge -and -81 -of -them -were -ex -convicts -the -steamer -disappointed -us -instead -of -making -a -long -visit -at -hobart -as -usual -she -made -a -short -one -so -we -got -but -a -glimpse -of -tasmania -and -then -moved -on -chapter -xxx -nature -makes -the -locust -with -an -appetite -for -crops -man -would -have -made -him -with -an -appetite -for -sand -pudd'nhead -wilson's -new -calendar -we -spent -part -of -an -afternoon -and -a -night -at -sea -and -reached -bluff -in -new -zealand -early -in -the -morning -bluff -is -at -the -bottom -of -the -middle -island -and -is -away -down -south -nearly -forty -seven -degrees -below -the -equator -it -lies -as -far -south -of -the -line -as -quebec -lies -north -of -it -and -the -climates -of -the -two -should -be -alike -but -for -some -reason -or -other -it -has -not -been -so -arranged -quebec -is -hot -in -the -summer -and -cold -in -the -winter -but -bluff's -climate -is -less -intense -the -cold -weather -is -not -very -cold -the -hot -weather -is -not -very -hot -and -the -difference -between -the -hottest -month -and -the -coldest -is -but -17 -degrees -fahrenheit -in -new -zealand -the -rabbit -plague -began -at -bluff -the -man -who -introduced -the -rabbit -there -was -banqueted -and -lauded -but -they -would -hang -him -now -if -they -could -get -him -in -england -the -natural -enemy -of -the -rabbit -is -detested -and -persecuted -in -the -bluff -region -the -natural -enemy -of -the -rabbit -is -honored -and -his -person -is -sacred -the -rabbit's -natural -enemy -in -england -is -the -poacher -in -bluff -its -natural -enemy -is -the -stoat -the -weasel -the -ferret -the -cat -and -the -mongoose -in -england -any -person -below -the -heir -who -is -caught -with -a -rabbit -in -his -possession -must -satisfactorily -explain -how -it -got -there -or -he -will -suffer -fine -and -imprisonment -together -with -extinction -of -his -peerage -in -bluff -the -cat -found -with -a -rabbit -in -its -possession -does -not -have -to -explain -everybody -looks -the -other -way -the -person -caught -noticing -would -suffer -fine -and -imprisonment -with -extinction -of -peerage -this -is -a -sure -way -to -undermine -the -moral -fabric -of -a -cat -thirty -years -from -now -there -will -not -be -a -moral -cat -in -new -zealand -some -think -there -is -none -there -now -in -england -the -poacher -is -watched -tracked -hunted -he -dare -not -show -his -face -in -bluff -the -cat -the -weasel -the -stoat -and -the -mongoose -go -up -and -down -whither -they -will -unmolested -by -a -law -of -the -legislature -posted -where -all -may -read -it -is -decreed -that -any -person -found -in -possession -of -one -of -these -creatures -dead -must -satisfactorily -explain -the -circumstances -or -pay -a -fine -of -not -less -than -l5 -nor -more -than -l20 -the -revenue -from -this -source -is -not -large -persons -who -want -to -pay -a -hundred -dollars -for -a -dead -cat -are -getting -rarer -and -rarer -every -day -this -is -bad -for -the -revenue -was -to -go -to -the -endowment -of -a -university -all -governments -are -more -or -less -short -sighted -in -england -they -fine -the -poacher -whereas -he -ought -to -be -banished -to -new -zealand -new -zealand -would -pay -his -way -and -give -him -wages -it -was -from -bluff -that -we -ought -to -have -cut -across -to -the -west -coast -and -visited -the -new -zealand -switzerland -a -land -of -superb -scenery -made -up -of -snowy -grandeurs -anal -mighty -glaciers -and -beautiful -lakes -and -over -there -also -are -the -wonderful -rivals -of -the -norwegian -and -alaskan -fiords -and -for -neighbor -a -waterfall -of -1 -900 -feet -but -we -were -obliged -to -postpone -the -trip -to -some -later -and -indefinite -time -november -6 -a -lovely -summer -morning -brilliant -blue -sky -a -few -miles -out -from -invercargill -passed -through -vast -level -green -expanses -snowed -over -with -sheep -fine -to -see -the -green -deep -and -very -vivid -sometimes -at -other -times -less -so -but -delicate -and -lovely -a -passenger -reminds -me -that -i -am -in -the -england -of -the -far -south -dunedin -same -date -the -town -justifies -michael -davitt's -praises -the -people -are -scotch -they -stopped -here -on -their -way -from -home -to -heaven -thinking -they -had -arrived -the -population -is -stated -at -40 -000 -by -malcolm -ross -journalist -stated -by -an -m -p -at -60 -000 -a -journalist -cannot -lie -to -the -residence -of -dr -hockin -he -has -a -fine -collection -of -books -relating -to -new -zealand -and -his -house -is -a -museum -of -maori -art -and -antiquities -he -has -pictures -and -prints -in -color -of -many -native -chiefs -of -the -past -some -of -them -of -note -in -history -there -is -nothing -of -the -savage -in -the -faces -nothing -could -be -finer -than -these -men's -features -nothing -more -intellectual -than -these -faces -nothing -more -masculine -nothing -nobler -than -their -aspect -the -aboriginals -of -australia -and -tasmania -looked -the -savage -but -these -chiefs -looked -like -roman -patricians -the -tattooing -in -these -portraits -ought -to -suggest -the -savage -of -course -but -it -does -not -the -designs -are -so -flowing -and -graceful -and -beautiful -that -they -are -a -most -satisfactory -decoration -it -takes -but -fifteen -minutes -to -get -reconciled -to -the -tattooing -and -but -fifteen -more -to -perceive -that -it -is -just -the -thing -after -that -the -undecorated -european -face -is -unpleasant -and -ignoble -dr -hockiu -gave -us -a -ghastly -curiosity -a -lignified -caterpillar -with -a -plant -growing -out -of -the -back -of -its -neck -a -plant -with -a -slender -stem -4 -inches -high -it -happened -not -by -accident -but -by -design -nature's -design -this -caterpillar -was -in -the -act -of -loyally -carrying -out -a -law -inflicted -upon -him -by -nature -a -law -purposely -inflicted -upon -him -to -get -him -into -trouble -a -law -which -was -a -trap -in -pursuance -of -this -law -he -made -the -proper -preparations -for -turning -himself -into -a -night -moth -that -is -to -say -he -dug -a -little -trench -a -little -grave -and -then -stretched -himself -out -in -it -on -his -stomach -and -partially -buried -himself -then -nature -was -ready -for -him -she -blew -the -spores -of -a -peculiar -fungus -through -the -air -with -a -purpose -some -of -them -fell -into -a -crease -in -the -back -of -the -caterpillar's -neck -and -began -to -sprout -and -grow -for -there -was -soil -there -he -had -not -washed -his -neck -the -roots -forced -themselves -down -into -the -worm's -person -and -rearward -along -through -its -body -sucking -up -the -creature's -juices -for -sap -the -worm -slowly -died -and -turned -to -wood -and -here -he -was -now -a -wooden -caterpillar -with -every -detail -of -his -former -physique -delicately -and -exactly -preserved -and -perpetuated -and -with -that -stem -standing -up -out -of -him -for -his -monument -monument -commemorative -of -his -own -loyalty -and -of -nature's -unfair -return -for -it -nature -is -always -acting -like -that -mrs -x -said -of -course -that -the -caterpillar -was -not -conscious -and -didn't -suffer -she -should -have -known -better -no -caterpillar -can -deceive -nature -if -this -one -couldn't -suffer -nature -would -have -known -it -and -would -have -hunted -up -another -caterpillar -not -that -she -would -have -let -this -one -go -merely -because -it -was -defective -no -she -would -have -waited -and -let -him -turn -into -a -night -moth -and -then -fried -him -in -the -candle -nature -cakes -a -fish's -eyes -over -with -parasites -so -that -it -shan't -be -able -to -avoid -its -enemies -or -find -its -food -she -sends -parasites -into -a -star -fish's -system -which -clog -up -its -prongs -and -swell -them -and -make -them -so -uncomfortable -that -the -poor -creature -delivers -itself -from -the -prong -to -ease -its -misery -and -presently -it -has -to -part -with -another -prong -for -the -sake -of -comfort -and -finally -with -a -third -if -it -re -grows -the -prongs -the -parasite -returns -and -the -same -thing -is -repeated -and -finally -when -the -ability -to -reproduce -prongs -is -lost -through -age -that -poor -old -star -fish -can't -get -around -any -more -and -so -it -dies -of -starvation -in -australia -is -prevalent -a -horrible -disease -due -to -an -unperfected -tapeworm -unperfected -that -is -what -they -call -it -i -do -not -know -why -for -it -transacts -business -just -as -well -as -if -it -were -finished -and -frescoed -and -gilded -and -all -that -november -9 -to -the -museum -and -public -picture -gallery -with -the -president -of -the -society -of -artists -some -fine -pictures -there -lent -by -the -s -of -a -several -of -them -they -bought -the -others -came -to -them -by -gift -next -to -the -gallery -of -the -s -of -a -annual -exhibition -just -opened -fine -think -of -a -town -like -this -having -two -such -collections -as -this -and -a -society -of -artists -it -is -so -all -over -australasia -if -it -were -a -monarchy -one -might -understand -it -i -mean -an -absolute -monarchy -where -it -isn't -necessary -to -vote -money -but -take -it -then -art -flourishes -but -these -colonies -are -republics -republics -with -a -wide -suffrage -voters -of -both -sexes -this -one -of -new -zealand -in -republics -neither -the -government -nor -the -rich -private -citizen -is -much -given -to -propagating -art -all -over -australasia -pictures -by -famous -european -artists -are -bought -for -the -public -galleries -by -the -state -and -by -societies -of -citizens -living -citizens -not -dead -ones -they -rob -themselves -to -give -not -their -heirs -this -s -of -a -here -owns -its -buildings -built -it -by -subscription -chapter -xxxi -the -spirit -of -wrath -not -the -words -is -the -sin -and -the -spirit -of -wrath -is -cursing -we -begin -to -swear -before -we -can -talk -pudd'nhead -wilson's -new -calendar -november -11 -on -the -road -this -train -express -goes -twenty -and -one -half -miles -an -hour -schedule -time -but -it -is -fast -enough -the -outlook -upon -sea -and -land -is -so -interesting -and -the -cars -so -comfortable -they -are -not -english -and -not -american -they -are -the -swiss -combination -of -the -two -a -narrow -and -railed -porch -along -the -side -where -a -person -can -walk -up -and -down -a -lavatory -in -each -car -this -is -progress -this -is -nineteenth -century -spirit -in -new -zealand -these -fast -expresses -run -twice -a -week -it -is -well -to -know -this -if -you -want -to -be -a -bird -and -fly -through -the -country -at -a -20 -mile -gait -otherwise -you -may -start -on -one -of -the -five -wrong -days -and -then -you -will -get -a -train -that -can't -overtake -its -own -shadow -by -contrast -these -pleasant -cars -call -to -mind -the -branch -road -cars -at -maryborough -australia -and -the -passengers' -talk -about -the -branch -road -and -the -hotel -somewhere -on -the -road -to -maryborough -i -changed -for -a -while -to -a -smoking -carriage -there -were -two -gentlemen -there -both -riding -backward -one -at -each -end -of -the -compartment -they -were -acquaintances -of -each -other -i -sat -down -facing -the -one -that -sat -at -the -starboard -window -he -had -a -good -face -and -a -friendly -look -and -i -judged -from -his -dress -that -he -was -a -dissenting -minister -he -was -along -toward -fifty -of -his -own -motion -he -struck -a -match -and -shaded -it -with -his -hand -for -me -to -light -my -cigar -i -take -the -rest -from -my -diary -in -order -to -start -conversation -i -asked -him -something -about -maryborough -he -said -in -a -most -pleasant -even -musical -voice -but -with -quiet -and -cultured -decision -it's -a -charming -town -with -a -hell -of -a -hotel -i -was -astonished -it -seemed -so -odd -to -hear -a -minister -swear -out -loud -he -went -placidly -on -it's -the -worst -hotel -in -australia -well -one -may -go -further -and -say -in -australasia -bad -beds -no -none -at -all -just -sand -bags -the -pillows -too -yes -the -pillows -too -just -sand -and -not -a -good -quality -of -sand -it -packs -too -hard -and -has -never -been -screened -there -is -too -much -gravel -in -it -it -is -like -sleeping -on -nuts -isn't -there -any -good -sand -plenty -of -it -there -is -as -good -bed -sand -in -this -region -as -the -world -can -furnish -aerated -sand -and -loose -but -they -won't -buy -it -they -want -something -that -will -pack -solid -and -petrify -how -are -the -rooms -eight -feet -square -and -a -sheet -of -iced -oil -cloth -to -step -on -in -the -morning -when -you -get -out -of -the -sand -quarry -as -to -lights -coal -oil -lamp -a -good -one -no -it's -the -kind -that -sheds -a -gloom -i -like -a -lamp -that -burns -all -night -this -one -won't -you -must -blow -it -out -early -that -is -bad -one -might -want -it -again -in -the -night -can't -find -it -in -the -dark -there's -no -trouble -you -can -find -it -by -the -stench -wardrobe -two -nails -on -the -door -to -hang -seven -suits -of -clothes -on -if -you've -got -them -bells -there -aren't -any -what -do -you -do -when -you -want -service -shout -but -it -won't -fetch -anybody -suppose -you -want -the -chambermaid -to -empty -the -slopjar -there -isn't -any -slop -jar -the -hotels -don't -keep -them -that -is -outside -of -sydney -and -melbourne -yes -i -knew -that -i -was -only -talking -it's -the -oddest -thing -in -australia -another -thing -i've -got -to -get -up -in -the -dark -in -the -morning -to -take -the -5 -o'clock -train -now -if -the -boots -there -isn't -any -well -the -porter -there -isn't -any -but -who -will -call -me -nobody -you'll -call -yourself -and -you'll -light -yourself -too -there'll -not -be -a -light -burning -in -the -halls -or -anywhere -and -if -you -don't -carry -a -light -you'll -break -your -neck -but -who -will -help -me -down -with -my -baggage -nobody -however -i -will -tell -you -what -to -do -in -maryborough -there's -an -american -who -has -lived -there -half -a -lifetime -a -fine -man -and -prosperous -and -popular -he -will -be -on -the -lookout -for -you -you -won't -have -any -trouble -sleep -in -peace -he -will -rout -you -out -and -you -will -make -your -train -where -is -your -manager -i -left -him -at -ballarat -studying -the -language -and -besides -he -had -to -go -to -melbourne -and -get -us -ready -for -new -zealand -i've -not -tried -to -pilot -myself -before -and -it -doesn't -look -easy -easy! -you've -selected -the -very -most -difficult -piece -of -railroad -in -australia -for -your -experiment -there -are -twelve -miles -of -this -road -which -no -man -without -good -executive -ability -can -ever -hope -tell -me -have -you -good -executive -ability -first -rate -executive -ability -i -well -i -think -so -but -that -settles -it -the -tone -of -oh -you -wouldn't -ever -make -it -in -the -world -however -that -american -will -point -you -right -and -you'll -go -you've -got -tickets -yes -round -trip -all -the -way -to -sydney -ah -there -it -is -you -see! -you -are -going -in -the -5 -o'clock -by -castlemaine -twelve -miles -instead -of -the -7 -15 -by -ballarat -in -order -to -save -two -hours -of -fooling -along -the -road -now -then -don't -interrupt -let -me -have -the -floor -you're -going -to -save -the -government -a -deal -of -hauling -but -that's -nothing -your -ticket -is -by -ballarat -and -it -isn't -good -over -that -twelve -miles -and -so -but -why -should -the -government -care -which -way -i -go -goodness -knows! -ask -of -the -winds -that -far -away -with -fragments -strewed -the -sea -as -the -boy -that -stood -on -the -burning -deck -used -to -say -the -government -chooses -to -do -its -railway -business -in -its -own -way -and -it -doesn't -know -as -much -about -it -as -the -french -in -the -beginning -they -tried -idiots -then -they -imported -the -french -which -was -going -backwards -you -see -now -it -runs -the -roads -itself -which -is -going -backwards -again -you -see -why -do -you -know -in -order -to -curry -favor -with -the -voters -the -government -puts -down -a -road -wherever -anybody -wants -it -anybody -that -owns -two -sheep -and -a -dog -and -by -consequence -we've -got -in -the -colony -of -victoria -800 -railway -stations -and -the -business -done -at -eighty -of -them -doesn't -foot -up -twenty -shillings -a -week -five -dollars -oh -come! -it's -true -it's -the -absolute -truth -why -there -are -three -or -four -men -on -wages -at -every -station -i -know -it -and -the -station -business -doesn't -pay -for -the -sheep -dip -to -sanctify -their -coffee -with -it's -just -as -i -say -and -accommodating -why -if -you -shake -a -rag -the -train -will -stop -in -the -midst -of -the -wilderness -to -pick -you -up -all -that -kind -of -politics -costs -you -see -and -then -besides -any -town -that -has -a -good -many -votes -and -wants -a -fine -station -gets -it -don't -you -overlook -that -maryborough -station -if -you -take -an -interest -in -governmental -curiosities -why -you -can -put -the -whole -population -of -maryborough -into -it -and -give -them -a -sofa -apiece -and -have -room -for -more -you -haven't -fifteen -stations -in -america -that -are -as -big -and -you -probably -haven't -five -that -are -half -as -fine -why -it's -perfectly -elegant -and -the -clock! -everybody -will -show -you -the -clock -there -isn't -a -station -in -europe -that's -got -such -a -clock -it -doesn't -strike -and -that's -one -mercy -it -hasn't -any -bell -and -as -you'll -have -cause -to -remember -if -you -keep -your -reason -all -australia -is -simply -bedamned -with -bells -on -every -quarter -hour -night -and -day -they -jingle -a -tiresome -chime -of -half -a -dozen -notes -all -the -clocks -in -town -at -once -all -the -clocks -in -australasia -at -once -and -all -the -very -same -notes -first -downward -scale -mi -re -do -sol -then -upward -scale -sol -si -re -do -down -again -mi -re -do -sol -up -again -sol -si -re -do -then -the -clock -say -at -midnight -clang -clang -clang -clang -clang -clang -clang -clang -clang -clang -and -by -that -time -you're -hello -what's -all -this -excitement -about -a -runaway -scared -by -the -train -why -you -think -this -train -could -scare -anything -well -when -they -build -eighty -stations -at -a -loss -and -a -lot -of -palace -stations -and -clocks -like -maryborough's -at -another -loss -the -government -has -got -to -economize -somewhere -hasn't -it -very -well -look -at -the -rolling -stock -that's -where -they -save -the -money -why -that -train -from -maryborough -will -consist -of -eighteen -freight -cars -and -two -passenger -kennels -cheap -poor -shabby -slovenly -no -drinking -water -no -sanitary -arrangements -every -imaginable -inconvenience -and -slow -oh -the -gait -of -cold -molasses -no -air -brake -no -springs -and -they'll -jolt -your -head -off -every -time -they -start -or -stop -that's -where -they -make -their -little -economies -you -see -they -spend -tons -of -money -to -house -you -palatially -while -you -wait -fifteen -minutes -for -a -train -then -degrade -you -to -six -hours' -convict -transportation -to -get -the -foolish -outlay -back -what -a -rational -man -really -needs -is -discomfort -while -he's -waiting -then -his -journey -in -a -nice -train -would -be -a -grateful -change -but -no -that -would -be -common -sense -and -out -of -place -in -a -government -and -then -besides -they -save -in -that -other -little -detail -you -know -repudiate -their -own -tickets -and -collect -a -poor -little -illegitimate -extra -shilling -out -of -you -for -that -twelve -miles -and -well -in -any -case -wait -there's -more -leave -that -american -out -of -the -account -and -see -what -would -happen -there's -nobody -on -hand -to -examine -your -ticket -when -you -arrive -but -the -conductor -will -come -and -examine -it -when -the -train -is -ready -to -start -it -is -too -late -to -buy -your -extra -ticket -now -the -train -can't -wait -and -won't -you -must -climb -out -but -can't -i -pay -the -conductor -no -he -is -not -authorized -to -receive -the -money -and -he -won't -you -must -climb -out -there's -no -other -way -i -tell -you -the -railway -management -is -about -the -only -thoroughly -european -thing -here -continentally -european -i -mean -not -english -it's -the -continental -business -in -perfection -down -fine -oh -yes -even -to -the -peanut -commerce -of -weighing -baggage -the -train -slowed -up -at -his -place -as -he -stepped -out -he -said -yes -you'll -like -maryborough -plenty -of -intelligence -there -it's -a -charming -place -with -a -hell -of -a -hotel -then -he -was -gone -i -turned -to -the -other -gentleman -is -your -friend -in -the -ministry -no -studying -for -it -chapter -xxxii -the -man -with -a -new -idea -is -a -crank -until -the -idea -succeeds -pudd'nhead -wilson's -new -calendar -it -was -junior -england -all -the -way -to -christchurch -in -fact -just -a -garden -and -christchurch -is -an -english -town -with -an -english -park -annex -and -a -winding -english -brook -just -like -the -avon -and -named -the -avon -but -from -a -man -not -from -shakespeare's -river -its -grassy -banks -are -bordered -by -the -stateliest -and -most -impressive -weeping -willows -to -be -found -in -the -world -i -suppose -they -continue -the -line -of -a -great -ancestor -they -were -grown -from -sprouts -of -the -willow -that -sheltered -napoleon's -grave -in -st -helena -it -is -a -settled -old -community -with -all -the -serenities -the -graces -the -conveniences -and -the -comforts -of -the -ideal -home -life -if -it -had -an -established -church -and -social -inequality -it -would -be -england -over -again -with -hardly -a -lack -in -the -museum -we -saw -many -curious -and -interesting -things -among -others -a -fine -native -house -of -the -olden -time -with -all -the -details -true -to -the -facts -and -the -showy -colors -right -and -in -their -proper -places -all -the -details -the -fine -mats -and -rugs -and -things -the -elaborate -and -wonderful -wood -carvings -wonderful -surely -considering -who -did -them -wonderful -in -design -and -particularly -in -execution -for -they -were -done -with -admirable -sharpness -and -exactness -and -yet -with -no -better -tools -than -flint -and -jade -and -shell -could -furnish -and -the -totem -posts -were -there -ancestor -above -ancestor -with -tongues -protruded -and -hands -clasped -comfortably -over -bellies -containing -other -people's -ancestors -grotesque -and -ugly -devils -every -one -but -lovingly -carved -and -ably -and -the -stuffed -natives -were -present -in -their -proper -places -and -looking -as -natural -as -life -and -the -housekeeping -utensils -were -there -too -and -close -at -hand -the -carved -and -finely -ornamented -war -canoe -and -we -saw -little -jade -gods -to -hang -around -the -neck -not -everybody's -but -sacred -to -the -necks -of -natives -of -rank -also -jade -weapons -and -many -kinds -of -jade -trinkets -all -made -out -of -that -excessively -hard -stone -without -the -help -of -any -tool -of -iron -and -some -of -these -things -had -small -round -holes -bored -through -them -nobody -knows -how -it -was -done -a -mystery -a -lost -art -i -think -it -was -said -that -if -you -want -such -a -hole -bored -in -a -piece -of -jade -now -you -must -send -it -to -london -or -amsterdam -where -the -lapidaries -are -also -we -saw -a -complete -skeleton -of -the -giant -moa -it -stood -ten -feet -high -and -must -have -been -a -sight -to -look -at -when -it -was -a -living -bird -it -was -a -kicker -like -the -ostrich -in -fight -it -did -not -use -its -beak -but -its -foot -it -must -have -been -a -convincing -kind -of -kick -if -a -person -had -his -back -to -the -bird -and -did -not -see -who -it -was -that -did -it -he -would -think -he -had -been -kicked -by -a -wind -mill -there -must -have -been -a -sufficiency -of -moas -in -the -old -forgotten -days -when -his -breed -walked -the -earth -his -bones -are -found -in -vast -masses -all -crammed -together -in -huge -graves -they -are -not -in -caves -but -in -the -ground -nobody -knows -how -they -happened -to -get -concentrated -there -mind -they -are -bones -not -fossils -this -means -that -the -moa -has -not -been -extinct -very -long -still -this -is -the -only -new -zealand -creature -which -has -no -mention -in -that -otherwise -comprehensive -literature -the -native -legends -this -is -a -significant -detail -and -is -good -circumstantial -evidence -that -the -moa -has -been -extinct -500 -years -since -the -maori -has -himself -by -tradition -been -in -new -zealand -since -the -end -of -the -fifteenth -century -he -came -from -an -unknown -land -the -first -maori -did -then -sailed -back -in -his -canoe -and -brought -his -tribe -and -they -removed -the -aboriginal -peoples -into -the -sea -and -into -the -ground -and -took -the -land -that -is -the -tradition -that -that -first -maori -could -come -is -understandable -for -anybody -can -come -to -a -place -when -he -isn't -trying -to -but -how -that -discoverer -found -his -way -back -home -again -without -a -compass -is -his -secret -and -he -died -with -it -in -him -his -language -indicates -that -he -came -from -polynesia -he -told -where -he -came -from -but -he -couldn't -spell -well -so -one -can't -find -the -place -on -the -map -because -people -who -could -spell -better -than -he -could -spelt -the -resemblance -all -out -of -it -when -they -made -the -map -however -it -is -better -to -have -a -map -that -is -spelt -right -than -one -that -has -information -in -it -in -new -zealand -women -have -the -right -to -vote -for -members -of -the -legislature -but -they -cannot -be -members -themselves -the -law -extending -the -suffrage -to -them -event -into -effect -in -1893 -the -population -of -christchurch -census -of -1891 -was -31 -454 -the -first -election -under -the -law -was -held -in -november -of -that -year -number -of -men -who -voted -6 -313 -number -of -women -who -voted -5 -989 -these -figures -ought -to -convince -us -that -women -are -not -as -indifferent -about -politics -as -some -people -would -have -us -believe -in -new -zealand -as -a -whole -the -estimated -adult -female -population -was -139 -915 -of -these -109 -461 -qualified -and -registered -their -names -on -the -rolls -78 -23 -per -cent -of -the -whole -of -these -90 -290 -went -to -the -polls -and -voted -85 -18 -per -cent -do -men -ever -turn -out -better -than -that -in -america -or -elsewhere -here -is -a -remark -to -the -other -sex's -credit -too -i -take -it -from -the -official -report -a -feature -of -the -election -was -the -orderliness -and -sobriety -of -the -people -women -were -in -no -way -molested -at -home -a -standing -argument -against -woman -suffrage -has -always -been -that -women -could -not -go -to -the -polls -without -being -insulted -the -arguments -against -woman -suffrage -have -always -taken -the -easy -form -of -prophecy -the -prophets -have -been -prophesying -ever -since -the -woman's -rights -movement -began -in -1848 -and -in -forty -seven -years -they -have -never -scored -a -hit -men -ought -to -begin -to -feel -a -sort -of -respect -for -their -mothers -and -wives -and -sisters -by -this -time -the -women -deserve -a -change -of -attitude -like -that -for -they -have -wrought -well -in -forty -seven -years -they -have -swept -an -imposingly -large -number -of -unfair -laws -from -the -statute -books -of -america -in -that -brief -time -these -serfs -have -set -themselves -free -essentially -men -could -not -have -done -so -much -for -themselves -in -that -time -without -bloodshed -at -least -they -never -have -and -that -is -argument -that -they -didn't -know -how -the -women -have -accomplished -a -peaceful -revolution -and -a -very -beneficent -one -and -yet -that -has -not -convinced -the -average -man -that -they -are -intelligent -and -have -courage -and -energy -and -perseverance -and -fortitude -it -takes -much -to -convince -the -average -man -of -anything -and -perhaps -nothing -can -ever -make -him -realize -that -he -is -the -average -woman's -inferior -yet -in -several -important -details -the -evidences -seems -to -show -that -that -is -what -he -is -man -has -ruled -the -human -race -from -the -beginning -but -he -should -remember -that -up -to -the -middle -of -the -present -century -it -was -a -dull -world -and -ignorant -and -stupid -but -it -is -not -such -a -dull -world -now -and -is -growing -less -and -less -dull -all -the -time -this -is -woman's -opportunity -she -has -had -none -before -i -wonder -where -man -will -be -in -another -forty -seven -years -in -the -new -zealand -law -occurs -this -the -word -person -wherever -it -occurs -throughout -the -act -includes -woman -that -is -promotion -you -see -by -that -enlargement -of -the -word -the -matron -with -the -garnered -wisdom -and -experience -of -fifty -years -becomes -at -one -jump -the -political -equal -of -her -callow -kid -of -twenty -one -the -white -population -of -the -colony -is -626 -000 -the -maori -population -is -42 -000 -the -whites -elect -seventy -members -of -the -house -of -representatives -the -maoris -four -the -maori -women -vote -for -their -four -members -november -16 -after -four -pleasant -days -in -christchurch -we -are -to -leave -at -midnight -to -night -mr -kinsey -gave -me -an -ornithorhynchus -and -i -am -taming -it -sunday -17th -sailed -last -night -in -the -flora -from -lyttelton -so -we -did -i -remember -it -yet -the -people -who -sailed -in -the -flora -that -night -may -forget -some -other -things -if -they -live -a -good -while -but -they -will -not -live -long -enough -to -forget -that -the -flora -is -about -the -equivalent -of -a -cattle -scow -but -when -the -union -company -find -it -inconvenient -to -keep -a -contract -and -lucrative -to -break -it -they -smuggle -her -into -passenger -service -and -keep -the -change -they -give -no -notice -of -their -projected -depredation -you -innocently -buy -tickets -for -the -advertised -passenger -boat -and -when -you -get -down -to -lyttelton -at -midnight -you -find -that -they -have -substituted -the -scow -they -have -plenty -of -good -boats -but -no -competition -and -that -is -the -trouble -it -is -too -late -now -to -make -other -arrangements -if -you -have -engagements -ahead -it -is -a -powerful -company -it -has -a -monopoly -and -everybody -is -afraid -of -it -including -the -government's -representative -who -stands -at -the -end -of -the -stage -plank -to -tally -the -passengers -and -see -that -no -boat -receives -a -greater -number -than -the -law -allows -her -to -carry -this -conveniently -blind -representative -saw -the -scow -receive -a -number -which -was -far -in -excess -of -its -privilege -and -winked -a -politic -wink -and -said -nothing -the -passengers -bore -with -meekness -the -cheat -which -had -been -put -upon -them -and -made -no -complaint -it -was -like -being -at -home -in -america -where -abused -passengers -act -in -just -the -same -way -a -few -days -before -the -union -company -had -discharged -a -captain -for -getting -a -boat -into -danger -and -had -advertised -this -act -as -evidence -of -its -vigilance -in -looking -after -the -safety -of -the -passengers -for -thugging -a -captain -costs -the -company -nothing -but -when -opportunity -offered -to -send -this -dangerously -overcrowded -tub -to -sea -and -save -a -little -trouble -and -a -tidy -penny -by -it -it -forgot -to -worry -about -the -passenger's -safety -the -first -officer -told -me -that -the -flora -was -privileged -to -carry -125 -passengers -she -must -have -had -all -of -200 -on -board -all -the -cabins -were -full -all -the -cattle -stalls -in -the -main -stable -were -full -the -spaces -at -the -heads -of -companionways -were -full -every -inch -of -floor -and -table -in -the -swill -room -was -packed -with -sleeping -men -and -remained -so -until -the -place -was -required -for -breakfast -all -the -chairs -and -benches -on -the -hurricane -deck -were -occupied -and -still -there -were -people -who -had -to -walk -about -all -night! -if -the -flora -had -gone -down -that -night -half -of -the -people -on -board -would -have -been -wholly -without -means -of -escape -the -owners -of -that -boat -were -not -technically -guilty -of -conspiracy -to -commit -murder -but -they -were -morally -guilty -of -it -i -had -a -cattle -stall -in -the -main -stable -a -cavern -fitted -up -with -a -long -double -file -of -two -storied -bunks -the -files -separated -by -a -calico -partition -twenty -men -and -boys -on -one -side -of -it -twenty -women -and -girls -on -the -other -the -place -was -as -dark -as -the -soul -of -the -union -company -and -smelt -like -a -kennel -when -the -vessel -got -out -into -the -heavy -seas -and -began -to -pitch -and -wallow -the -cavern -prisoners -became -immediately -seasick -and -then -the -peculiar -results -that -ensued -laid -all -my -previous -experiences -of -the -kind -well -away -in -the -shade -and -the -wails -the -groans -the -cries -the -shrieks -the -strange -ejaculations -it -was -wonderful -the -women -and -children -and -some -of -the -men -and -boys -spent -the -night -in -that -place -for -they -were -too -ill -to -leave -it -but -the -rest -of -us -got -up -by -and -by -and -finished -the -night -on -the -hurricane -deck -that -boat -was -the -foulest -i -was -ever -in -and -the -smell -of -the -breakfast -saloon -when -we -threaded -our -way -among -the -layers -of -steaming -passengers -stretched -upon -its -floor -and -its -tables -was -incomparable -for -efficiency -a -good -many -of -us -got -ashore -at -the -first -way -port -to -seek -another -ship -after -a -wait -of -three -hours -we -got -good -rooms -in -the -mahinapua -a -wee -little -bridal -parlor -of -a -boat -only -205 -tons -burthen -clean -and -comfortable -good -service -good -beds -good -table -and -no -crowding -the -seas -danced -her -about -like -a -duck -but -she -was -safe -and -capable -next -morning -early -she -went -through -the -french -pass -a -narrow -gateway -of -rock -between -bold -headlands -so -narrow -in -fact -that -it -seemed -no -wider -than -a -street -the -current -tore -through -there -like -a -mill -race -and -the -boat -darted -through -like -a -telegram -the -passage -was -made -in -half -a -minute -then -we -were -in -a -wide -place -where -noble -vast -eddies -swept -grandly -round -and -round -in -shoal -water -and -i -wondered -what -they -would -do -with -the -little -boat -they -did -as -they -pleased -with -her -they -picked -her -up -and -flung -her -around -like -nothing -and -landed -her -gently -on -the -solid -smooth -bottom -of -sand -so -gently -indeed -that -we -barely -felt -her -touch -it -barely -felt -her -quiver -when -she -came -to -a -standstill -the -water -was -as -clear -as -glass -the -sand -on -the -bottom -was -vividly -distinct -and -the -fishes -seemed -to -be -swimming -about -in -nothing -fishing -lines -were -brought -out -but -before -we -could -bait -the -hooks -the -boat -was -off -and -away -again -chapter -xxxiii -let -us -be -grateful -to -adam -our -benefactor -he -cut -us -out -of -the -blessing -of -idleness -and -won -for -us -the -curse -of -labor -pudd'nhead -wilson's -new -calendar -we -soon -reached -the -town -of -nelson -and -spent -the -most -of -the -day -there -visiting -acquaintances -and -driving -with -them -about -the -garden -the -whole -region -is -a -garden -excepting -the -scene -of -the -maungatapu -murders -of -thirty -years -ago -that -is -a -wild -place -wild -and -lonely -an -ideal -place -for -a -murder -it -is -at -the -base -of -a -vast -rugged -densely -timbered -mountain -in -the -deep -twilight -of -that -forest -solitude -four -desperate -rascals -burgess -sullivan -levy -and -kelley -ambushed -themselves -beside -the -mountain -trail -to -murder -and -rob -four -travelers -kempthorne -mathieu -dudley -and -de -pontius -the -latter -a -new -yorker -a -harmless -old -laboring -man -came -wandering -along -and -as -his -presence -was -an -embarrassment -they -choked -him -hid -him -and -then -resumed -their -watch -for -the -four -they -had -to -wait -a -while -but -eventually -everything -turned -out -as -they -desired -that -dark -episode -is -the -one -large -event -in -the -history -of -nelson -the -fame -of -it -traveled -far -burgess -made -a -confession -it -is -a -remarkable -paper -for -brevity -succinctness -and -concentration -it -is -perhaps -without -its -peer -in -the -literature -of -murder -there -are -no -waste -words -in -it -there -is -no -obtrusion -of -matter -not -pertinent -to -the -occasion -nor -any -departure -from -the -dispassionate -tone -proper -to -a -formal -business -statement -for -that -is -what -it -is -a -business -statement -of -a -murder -by -the -chief -engineer -of -it -or -superintendent -or -foreman -or -whatever -one -may -prefer -to -call -him -we -were -getting -impatient -when -we -saw -four -men -and -a -pack -horse -coming -i -left -my -cover -and -had -a -look -at -the -men -for -levy -had -told -me -that -mathieu -was -a -small -man -and -wore -a -large -beard -and -that -it -was -a -chestnut -horse -i -said -'here -they -come -' -they -were -then -a -good -distance -away -i -took -the -caps -off -my -gun -and -put -fresh -ones -on -i -said -'you -keep -where -you -are -i'll -put -them -up -and -you -give -me -your -gun -while -you -tie -them -' -it -was -arranged -as -i -have -described -the -men -came -they -arrived -within -about -fifteen -yards -when -i -stepped -up -and -said -'stand! -bail -up!' -that -means -all -of -them -to -get -together -i -made -them -fall -back -on -the -upper -side -of -the -road -with -their -faces -up -the -range -and -sullivan -brought -me -his -gun -and -then -tied -their -hands -behind -them -the -horse -was -very -quiet -all -the -time -he -did -not -move -when -they -were -all -tied -sullivan -took -the -horse -up -the -hill -and -put -him -in -the -bush -he -cut -the -rope -and -let -the -swags -[a -swag -is -a -kit -a -pack -small -baggage -] -fall -on -the -ground -and -then -came -to -me -we -then -marched -the -men -down -the -incline -to -the -creek -the -water -at -this -time -barely -running -up -this -creek -we -took -the -men -we -went -i -daresay -five -or -six -hundred -yards -up -it -which -took -us -nearly -half -an -hour -to -accomplish -then -we -turned -to -the -right -up -the -range -we -went -i -daresay -one -hundred -and -fifty -yards -from -the -creek -and -there -we -sat -down -with -the -men -i -said -to -sullivan -'put -down -your -gun -and -search -these -men -' -which -he -did -i -asked -them -their -several -names -they -told -me -i -asked -them -if -they -were -expected -at -nelson -they -said -'no -' -if -such -their -lives -would -have -been -spared -in -money -we -took -l60 -odd -i -said -'is -this -all -you -have -you -had -better -tell -me -' -sullivan -said -'here -is -a -bag -of -gold -' -i -said -'what's -on -that -pack -horse -is -there -any -gold -' -when -kempthorne -said -'yes -my -gold -is -in -the -portmanteau -and -i -trust -you -will -not -take -it -all -' -'well -' -i -said -'we -must -take -you -away -one -at -a -time -because -the -range -is -steep -just -here -and -then -we -will -let -you -go -' -they -said -'all -right -' -most -cheerfully -we -tied -their -feet -and -took -dudley -with -us -we -went -about -sixty -yards -with -him -this -was -through -a -scrub -it -was -arranged -the -night -previously -that -it -would -be -best -to -choke -them -in -case -the -report -of -the -arms -might -be -heard -from -the -road -and -if -they -were -missed -they -never -would -be -found -so -we -tied -a -handkerchief -over -his -eyes -when -sullivan -took -the -sash -off -his -waist -put -it -round -his -neck -and -so -strangled -him -sullivan -after -i -had -killed -the -old -laboring -man -found -fault -with -the -way -he -was -choked -he -said -'the -next -we -do -i'll -show -you -my -way -' -i -said -'i -have -never -done -such -a -thing -before -i -have -shot -a -man -but -never -choked -one -' -we -returned -to -the -others -when -kempthorne -said -'what -noise -was -that -' -i -said -it -was -caused -by -breaking -through -the -scrub -this -was -taking -too -much -time -so -it -was -agreed -to -shoot -them -with -that -i -said -'we'll -take -you -no -further -but -separate -you -and -then -loose -one -of -you -and -he -can -relieve -the -others -' -so -with -that -sullivan -took -de -pontius -to -the -left -of -where -kempthorne -was -sitting -i -took -mathieu -to -the -right -i -tied -a -strap -round -his -legs -and -shot -him -with -a -revolver -he -yelled -i -ran -from -him -with -my -gun -in -my -hand -i -sighted -kempthorne -who -had -risen -to -his -feet -i -presented -the -gun -and -shot -him -behind -the -right -ear -his -life's -blood -welled -from -him -and -he -died -instantaneously -sullivan -had -shot -de -pontius -in -the -meantime -and -then -came -to -me -i -said -'look -to -mathieu -' -indicating -the -spot -where -he -lay -he -shortly -returned -and -said -'i -had -to -chiv -that -fellow -he -was -not -dead -' -a -cant -word -meaning -that -he -had -to -stab -him -returning -to -the -road -we -passed -where -de -pontius -lay -and -was -dead -sullivan -said -'this -is -the -digger -the -others -were -all -storekeepers -this -is -the -digger -let's -cover -him -up -for -should -the -others -be -found -they'll -think -he -done -it -and -sloped -' -meaning -he -had -gone -so -with -that -we -threw -all -the -stones -on -him -and -then -left -him -this -bloody -work -took -nearly -an -hour -and -a -half -from -the -time -we -stopped -the -men -anyone -who -reads -that -confession -will -think -that -the -man -who -wrote -it -was -destitute -of -emotions -destitute -of -feeling -that -is -partly -true -as -regarded -others -he -was -plainly -without -feeling -utterly -cold -and -pitiless -but -as -regarded -himself -the -case -was -different -while -he -cared -nothing -for -the -future -of -the -murdered -men -he -cared -a -great -deal -for -his -own -it -makes -one's -flesh -creep -to -read -the -introduction -to -his -confession -the -judge -on -the -bench -characterized -it -as -scandalously -blasphemous -and -it -certainly -reads -so -but -burgess -meant -no -blasphemy -he -was -merely -a -brute -and -whatever -he -said -or -wrote -was -sure -to -expose -the -fact -his -redemption -was -a -very -real -thing -to -him -and -he -was -as -jubilantly -happy -on -the -gallows -as -ever -was -christian -martyr -at -the -stake -we -dwellers -in -this -world -are -strangely -made -and -mysteriously -circumstanced -we -have -to -suppose -that -the -murdered -men -are -lost -and -that -burgess -is -saved -but -we -cannot -suppress -our -natural -regrets -written -in -my -dungeon -drear -this -7th -of -august -in -the -year -of -grace -1866 -to -god -be -ascribed -all -power -and -glory -in -subduing -the -rebellious -spirit -of -a -most -guilty -wretch -who -has -been -brought -through -the -instrumentality -of -a -faithful -follower -of -christ -to -see -his -wretched -and -guilty -state -inasmuch -as -hitherto -he -has -led -an -awful -and -wretched -life -and -through -the -assurance -of -this -faithful -soldier -of -christ -he -has -been -led -and -also -believes -that -christ -will -yet -receive -and -cleanse -him -from -all -his -deep -dyed -and -bloody -sins -i -lie -under -the -imputation -which -says -'come -now -and -let -us -reason -together -saith -the -lord -though -your -sins -be -as -scarlet -they -shall -be -as -white -as -snow -though -they -be -red -like -crimson -they -shall -be -as -wool -' -on -this -promise -i -rely -we -sailed -in -the -afternoon -late -spent -a -few -hours -at -new -plymouth -then -sailed -again -and -reached -auckland -the -next -day -november -20th -and -remained -in -that -fine -city -several -days -its -situation -is -commanding -and -the -sea -view -is -superb -there -are -charming -drives -all -about -and -by -courtesy -of -friends -we -had -opportunity -to -enjoy -them -from -the -grassy -crater -summit -of -mount -eden -one's -eye -ranges -over -a -grand -sweep -and -variety -of -scenery -forests -clothed -in -luxuriant -foliage -rolling -green -fields -conflagrations -of -flowers -receding -and -dimming -stretches -of -green -plain -broken -by -lofty -and -symmetrical -old -craters -then -the -blue -bays -twinkling -and -sparkling -away -into -the -dreamy -distances -where -the -mountains -loom -spiritual -in -their -veils -of -haze -it -is -from -auckland -that -one -goes -to -rotorua -the -region -of -the -renowned -hot -lakes -and -geysers -one -of -the -chief -wonders -of -new -zealand -but -i -was -not -well -enough -to -make -the -trip -the -government -has -a -sanitorium -there -and -everything -is -comfortable -for -the -tourist -and -the -invalid -the -government's -official -physician -is -almost -over -cautious -in -his -estimates -of -the -efficacy -of -the -baths -when -he -is -talking -about -rheumatism -gout -paralysis -and -such -things -but -when -he -is -talking -about -the -effectiveness -of -the -waters -in -eradicating -the -whisky -habit -he -seems -to -have -no -reserves -the -baths -will -cure -the -drinking -habit -no -matter -how -chronic -it -is -and -cure -it -so -effectually -that -even -the -desire -to -drink -intoxicants -will -come -no -more -there -should -be -a -rush -from -europe -and -america -to -that -place -and -when -the -victims -of -alcoholism -find -out -what -they -can -get -by -going -there -the -rush -will -begin -the -thermal -springs -district -of -new -zealand -comprises -an -area -of -upwards -of -600 -000 -acres -or -close -on -1 -000 -square -miles -rotorua -is -the -favorite -place -it -is -the -center -of -a -rich -field -of -lake -and -mountain -scenery -from -rotorua -as -a -base -the -pleasure -seeker -makes -excursions -the -crowd -of -sick -people -is -great -and -growing -rotorua -is -the -carlsbad -of -australasia -it -is -from -auckland -that -the -kauri -gum -is -shipped -for -a -long -time -now -about -8 -000 -tons -of -it -have -been -brought -into -the -town -per -year -it -is -worth -about -$300 -per -ton -unassorted -assorted -the -finest -grades -are -worth -about -$1 -000 -it -goes -to -america -chiefly -it -is -in -lumps -and -is -hard -and -smooth -and -looks -like -amber -the -light -colored -like -new -amber -and -the -dark -brown -like -rich -old -amber -and -it -has -the -pleasant -feel -of -amber -too -some -of -the -light -colored -samples -were -a -tolerably -fair -counterfeit -of -uncut -south -african -diamonds -they -were -so -perfectly -smooth -and -polished -and -transparent -it -is -manufactured -into -varnish -a -varnish -which -answers -for -copal -varnish -and -is -cheaper -the -gum -is -dug -up -out -of -the -ground -it -has -been -there -for -ages -it -is -the -sap -of -the -kauri -tree -dr -campbell -of -auckland -told -me -he -sent -a -cargo -of -it -to -england -fifty -years -ago -but -nothing -came -of -the -venture -nobody -knew -what -to -do -with -it -so -it -was -sold -at -15 -a -ton -to -light -fires -with -november -26 -3 -p -m -sailed -vast -and -beautiful -harbor -land -all -about -for -hours -tangariwa -the -mountain -that -has -the -same -shape -from -every -point -of -view -that -is -the -common -belief -in -auckland -and -so -it -has -from -every -point -of -view -except -thirteen -perfect -summer -weather -large -school -of -whales -in -the -distance -nothing -could -be -daintier -than -the -puffs -of -vapor -they -spout -up -when -seen -against -the -pink -glory -of -the -sinking -sun -or -against -the -dark -mass -of -an -island -reposing -in -the -deep -blue -shadow -of -a -storm -cloud -great -barrier -rock -standing -up -out -of -the -sea -away -to -the -left -sometime -ago -a -ship -hit -it -full -speed -in -a -fog -20 -miles -out -of -her -course -140 -lives -lost -the -captain -committed -suicide -without -waiting -a -moment -he -knew -that -whether -he -was -to -blame -or -not -the -company -owning -the -vessel -would -discharge -him -and -make -a -devotion -to -passengers' -safety -advertisement -out -of -it -and -his -chance -to -make -a -livelihood -would -be -permanently -gone -chapter -xxxiv -let -us -not -be -too -particular -it -is -better -to -have -old -second -hand -diamonds -than -none -at -all -pudd'nhead -wilson's -new -calendar -november -27 -to -day -we -reached -gisborne -and -anchored -in -a -big -bay -there -was -a -heavy -sea -on -so -we -remained -on -board -we -were -a -mile -from -shore -a -little -steam -tug -put -out -from -the -land -she -was -an -object -of -thrilling -interest -she -would -climb -to -the -summit -of -a -billow -reel -drunkenly -there -a -moment -dim -and -gray -in -the -driving -storm -of -spindrift -then -make -a -plunge -like -a -diver -and -remain -out -of -sight -until -one -had -given -her -up -then -up -she -would -dart -again -on -a -steep -slant -toward -the -sky -shedding -niagaras -of -water -from -her -forecastle -and -this -she -kept -up -all -the -way -out -to -us -she -brought -twenty -five -passengers -in -her -stomach -men -and -women -mainly -a -traveling -dramatic -company -in -sight -on -deck -were -the -crew -in -sou'westers -yellow -waterproof -canvas -suits -and -boots -to -the -thigh -the -deck -was -never -quiet -for -a -moment -and -seldom -nearer -level -than -a -ladder -and -noble -were -the -seas -which -leapt -aboard -and -went -flooding -aft -we -rove -a -long -line -to -the -yard -arm -hung -a -most -primitive -basketchair -to -it -and -swung -it -out -into -the -spacious -air -of -heaven -and -there -it -swayed -pendulum -fashion -waiting -for -its -chance -then -down -it -shot -skillfully -aimed -and -was -grabbed -by -the -two -men -on -the -forecastle -a -young -fellow -belonging -to -our -crew -was -in -the -chair -to -be -a -protection -to -the -lady -comers -at -once -a -couple -of -ladies -appeared -from -below -took -seats -in -his -lap -we -hoisted -them -into -the -sky -waited -a -moment -till -the -roll -of -the -ship -brought -them -in -overhead -then -we -lowered -suddenly -away -and -seized -the -chair -as -it -struck -the -deck -we -took -the -twenty -five -aboard -and -delivered -twenty -five -into -the -tug -among -them -several -aged -ladies -and -one -blind -one -and -all -without -accident -it -was -a -fine -piece -of -work -ours -is -a -nice -ship -roomy -comfortable -well -ordered -and -satisfactory -now -and -then -we -step -on -a -rat -in -a -hotel -but -we -have -had -no -rats -on -shipboard -lately -unless -perhaps -in -the -flora -we -had -more -serious -things -to -think -of -there -and -did -not -notice -i -have -noticed -that -it -is -only -in -ships -and -hotels -which -still -employ -the -odious -chinese -gong -that -you -find -rats -the -reason -would -seem -to -be -that -as -a -rat -cannot -tell -the -time -of -day -by -a -clock -he -won't -stay -where -he -cannot -find -out -when -dinner -is -ready -november -29 -the -doctor -tells -me -of -several -old -drunkards -one -spiritless -loafer -and -several -far -gone -moral -wrecks -who -have -been -reclaimed -by -the -salvation -army -and -have -remained -staunch -people -and -hard -workers -these -two -years -wherever -one -goes -these -testimonials -to -the -army's -efficiency -are -forthcoming -this -morning -we -had -one -of -those -whizzing -green -ballarat -flies -in -the -room -with -his -stunning -buzz -saw -noise -the -swiftest -creature -in -the -world -except -the -lightning -flash -it -is -a -stupendous -force -that -is -stored -up -in -that -little -body -if -we -had -it -in -a -ship -in -the -same -proportion -we -could -spin -from -liverpool -to -new -york -in -the -space -of -an -hour -the -time -it -takes -to -eat -luncheon -the -new -zealand -express -train -is -called -the -ballarat -fly -bad -teeth -in -the -colonies -a -citizen -told -me -they -don't -have -teeth -filled -but -pull -them -out -and -put -in -false -ones -and -that -now -and -then -one -sees -a -young -lady -with -a -full -set -she -is -fortunate -i -wish -i -had -been -born -with -false -teeth -and -a -false -liver -and -false -carbuncles -i -should -get -along -better -december -2 -monday -left -napier -in -the -ballarat -fly -the -one -that -goes -twice -a -week -from -napier -to -hastings -twelve -miles -time -fifty -five -minutes -not -so -far -short -of -thirteen -miles -an -hour -a -perfect -summer -day -cool -breeze -brilliant -sky -rich -vegetation -two -or -three -times -during -the -afternoon -we -saw -wonderfully -dense -and -beautiful -forests -tumultuously -piled -skyward -on -the -broken -highlands -not -the -customary -roof -like -slant -of -a -hillside -where -the -trees -are -all -the -same -height -the -noblest -of -these -trees -were -of -the -kauri -breed -we -were -told -the -timber -that -is -now -furnishing -the -wood -paving -for -europe -and -is -the -best -of -all -wood -for -that -purpose -sometimes -these -towering -upheavals -of -forestry -were -festooned -and -garlanded -with -vine -cables -and -sometimes -the -masses -of -undergrowth -were -cocooned -in -another -sort -of -vine -of -a -delicate -cobwebby -texture -they -call -it -the -supplejack -i -think -tree -ferns -everywhere -a -stem -fifteen -feet -high -with -a -graceful -chalice -of -fern -fronds -sprouting -from -its -top -a -lovely -forest -ornament -and -there -was -a -ten -foot -reed -with -a -flowing -suit -of -what -looked -like -yellow -hair -hanging -from -its -upper -end -i -do -not -know -its -name -but -if -there -is -such -a -thing -as -a -scalp -plant -this -is -it -a -romantic -gorge -with -a -brook -flowing -in -its -bottom -approaching -palmerston -north -waitukurau -twenty -minutes -for -luncheon -with -me -sat -my -wife -and -daughter -and -my -manager -mr -carlyle -smythe -i -sat -at -the -head -of -the -table -and -could -see -the -right -hand -wall -the -others -had -their -backs -to -it -on -that -wall -at -a -good -distance -away -were -a -couple -of -framed -pictures -i -could -not -see -them -clearly -but -from -the -groupings -of -the -figures -i -fancied -that -they -represented -the -killing -of -napoleon -iii's -son -by -the -zulus -in -south -africa -i -broke -into -the -conversation -which -was -about -poetry -and -cabbage -and -art -and -said -to -my -wife -do -you -remember -when -the -news -came -to -paris -of -the -killing -of -the -prince -those -were -the -very -words -i -had -in -my -mind -yes -but -what -prince -napoleon -lulu -what -made -you -think -of -that -i -don't -know -there -was -no -collusion -she -had -not -seen -the -pictures -and -they -had -not -been -mentioned -she -ought -to -have -thought -of -some -recent -news -that -came -to -paris -for -we -were -but -seven -months -from -there -and -had -been -living -there -a -couple -of -years -when -we -started -on -this -trip -but -instead -of -that -she -thought -of -an -incident -of -our -brief -sojourn -in -paris -of -sixteen -years -before -here -was -a -clear -case -of -mental -telegraphy -of -mind -transference -of -my -mind -telegraphing -a -thought -into -hers -how -do -i -know -because -i -telegraphed -an -error -for -it -turned -out -that -the -pictures -did -not -represent -the -killing -of -lulu -at -all -nor -anything -connected -with -lulu -she -had -to -get -the -error -from -my -head -it -existed -nowhere -else -chapter -xxxv -the -autocrat -of -russia -possesses -more -power -than -any -other -man -in -the -earth -but -he -cannot -stop -a -sneeze -pudd'nhead -wilson's -new -calendar -wauganiui -december -3 -a -pleasant -trip -yesterday -per -ballarat -fly -four -hours -i -do -not -know -the -distance -but -it -must -have -been -well -along -toward -fifty -miles -the -fly -could -have -spun -it -out -to -eight -hours -and -not -discommoded -me -for -where -there -is -comfort -and -no -need -for -hurry -speed -is -of -no -value -at -least -to -me -and -nothing -that -goes -on -wheels -can -be -more -comfortable -more -satisfactory -than -the -new -zealand -trains -outside -of -america -there -are -no -cars -that -are -so -rationally -devised -when -you -add -the -constant -presence -of -charming -scenery -and -the -nearly -constant -absence -of -dust -well -if -one -is -not -content -then -he -ought -to -get -out -and -walk -that -would -change -his -spirit -perhaps -i -think -so -at -the -end -of -an -hour -you -would -find -him -waiting -humbly -beside -the -track -and -glad -to -be -taken -aboard -again -much -horseback -riding -in -and -around -this -town -many -comely -girls -in -cool -and -pretty -summer -gowns -much -salvation -army -lots -of -maoris -the -faces -and -bodies -of -some -of -the -old -ones -very -tastefully -frescoed -maori -council -house -over -the -river -large -strong -carpeted -from -end -to -end -with -matting -and -decorated -with -elaborate -wood -carvings -artistically -executed -the -maoris -were -very -polite -i -was -assured -by -a -member -of -the -house -of -representatives -that -the -native -race -is -not -decreasing -but -actually -increasing -slightly -it -is -another -evidence -that -they -are -a -superior -breed -of -savages -i -do -not -call -to -mind -any -savage -race -that -built -such -good -houses -or -such -strong -and -ingenious -and -scientific -fortresses -or -gave -so -much -attention -to -agriculture -or -had -military -arts -and -devices -which -so -nearly -approached -the -white -man's -these -taken -together -with -their -high -abilities -in -boat -building -and -their -tastes -and -capacities -in -the -ornamental -arts -modify -their -savagery -to -a -semi -civilization -or -at -least -to -a -quarter -civilization -it -is -a -compliment -to -them -that -the -british -did -not -exterminate -them -as -they -did -the -australians -and -the -tasmanians -but -were -content -with -subduing -them -and -showed -no -desire -to -go -further -and -it -is -another -compliment -to -them -that -the -british -did -not -take -the -whole -of -their -choicest -lands -but -left -them -a -considerable -part -and -then -went -further -and -protected -them -from -the -rapacities -of -landsharks -a -protection -which -the -new -zealand -government -still -extends -to -them -and -it -is -still -another -compliment -to -the -maoris -that -the -government -allows -native -representation -in -both -the -legislature -and -the -cabinet -and -gives -both -sexes -the -vote -and -in -doing -these -things -the -government -also -compliments -itself -it -has -not -been -the -custom -of -the -world -for -conquerors -to -act -in -this -large -spirit -toward -the -conquered -the -highest -class -white -men -who -lived -among -the -maoris -in -the -earliest -time -had -a -high -opinion -of -them -and -a -strong -affection -for -them -among -the -whites -of -this -sort -was -the -author -of -old -new -zealand -and -dr -campbell -of -auckland -was -another -dr -campbell -was -a -close -friend -of -several -chiefs -and -has -many -pleasant -things -to -say -of -their -fidelity -their -magnanimity -and -their -generosity -also -of -their -quaint -notions -about -the -white -man's -queer -civilization -and -their -equally -quaint -comments -upon -it -one -of -them -thought -the -missionary -had -got -everything -wrong -end -first -and -upside -down -why -he -wants -us -to -stop -worshiping -and -supplicating -the -evil -gods -and -go -to -worshiping -and -supplicating -the -good -one! -there -is -no -sense -in -that -a -good -god -is -not -going -to -do -us -any -harm -the -maoris -had -the -tabu -and -had -it -on -a -polynesian -scale -of -comprehensiveness -and -elaboration -some -of -its -features -could -have -been -importations -from -india -and -judea -neither -the -maori -nor -the -hindoo -of -common -degree -could -cook -by -a -fire -that -a -person -of -higher -caste -had -used -nor -could -the -high -maori -or -high -hindoo -employ -fire -that -had -served -a -man -of -low -grade -if -a -low -grade -maori -or -hindoo -drank -from -a -vessel -belonging -to -a -high -grade -man -the -vessel -was -defiled -and -had -to -be -destroyed -there -were -other -resemblances -between -maori -tabu -and -hindoo -caste -custom -yesterday -a -lunatic -burst -into -my -quarters -and -warned -me -that -the -jesuits -were -going -to -cook -poison -me -in -my -food -or -kill -me -on -the -stage -at -night -he -said -a -mysterious -sign -was -visible -upon -my -posters -and -meant -my -death -he -said -he -saved -rev -mr -haweis's -life -by -warning -him -that -there -were -three -men -on -his -platform -who -would -kill -him -if -he -took -his -eyes -off -them -for -a -moment -during -his -lecture -the -same -men -were -in -my -audience -last -night -but -they -saw -that -he -was -there -will -they -be -there -again -to -night -he -hesitated -then -said -no -he -thought -they -would -rather -take -a -rest -and -chance -the -poison -this -lunatic -has -no -delicacy -but -he -was -not -uninteresting -he -told -me -a -lot -of -things -he -said -he -had -saved -so -many -lecturers -in -twenty -years -that -they -put -him -in -the -asylum -i -think -he -has -less -refinement -than -any -lunatic -i -have -met -december -8 -a -couple -of -curious -war -monuments -here -at -wanganui -one -is -in -honor -of -white -men -who -fell -in -defence -of -law -and -order -against -fanaticism -and -barbarism -fanaticism -we -americans -are -english -in -blood -english -in -speech -english -in -religion -english -in -the -essentials -of -our -governmental -system -english -in -the -essentials -of -our -civilization -and -so -let -us -hope -for -the -honor -of -the -blend -for -the -honor -of -the -blood -for -the -honor -of -the -race -that -that -word -got -there -through -lack -of -heedfulness -and -will -not -be -suffered -to -remain -if -you -carve -it -at -thermopylae -or -where -winkelried -died -or -upon -bunker -hill -monument -and -read -it -again -who -fell -in -defence -of -law -and -order -against -fanaticism -you -will -perceive -what -the -word -means -and -how -mischosen -it -is -patriotism -is -patriotism -calling -it -fanaticism -cannot -degrade -it -nothing -can -degrade -it -even -though -it -be -a -political -mistake -and -a -thousand -times -a -political -mistake -that -does -not -affect -it -it -is -honorable -always -honorable -always -noble -and -privileged -to -hold -its -head -up -and -look -the -nations -in -the -face -it -is -right -to -praise -these -brave -white -men -who -fell -in -the -maori -war -they -deserve -it -but -the -presence -of -that -word -detracts -from -the -dignity -of -their -cause -and -their -deeds -and -makes -them -appear -to -have -spilt -their -blood -in -a -conflict -with -ignoble -men -men -not -worthy -of -that -costly -sacrifice -but -the -men -were -worthy -it -was -no -shame -to -fight -them -they -fought -for -their -homes -they -fought -for -their -country -they -bravely -fought -and -bravely -fell -and -it -would -take -nothing -from -the -honor -of -the -brave -englishmen -who -lie -under -the -monument -but -add -to -it -to -say -that -they -died -in -defense -of -english -laws -and -english -homes -against -men -worthy -of -the -sacrifice -the -maori -patriots -the -other -monument -cannot -be -rectified -except -with -dynamite -it -is -a -mistake -all -through -and -a -strangely -thoughtless -one -it -is -a -monument -erected -by -white -men -to -maoris -who -fell -fighting -with -the -whites -and -against -their -own -people -in -the -maori -war -sacred -to -the -memory -of -the -brave -men -who -fell -on -the -14th -of -may -1864 -etc -on -one -side -are -the -names -of -about -twenty -maoris -it -is -not -a -fancy -of -mine -the -monument -exists -i -saw -it -it -is -an -object -lesson -to -the -rising -generation -it -invites -to -treachery -disloyalty -unpatriotism -its -lesson -in -frank -terms -is -desert -your -flag -slay -your -people -burn -their -homes -shame -your -nationality -we -honor -such -december -9 -wellington -ten -hours -from -wanganui -by -the -fly -december -12 -it -is -a -fine -city -and -nobly -situated -a -busy -place -and -full -of -life -and -movement -have -spent -the -three -days -partly -in -walking -about -partly -in -enjoying -social -privileges -and -largely -in -idling -around -the -magnificent -garden -at -hutt -a -little -distance -away -around -the -shore -i -suppose -we -shall -not -see -such -another -one -soon -we -are -packing -to -night -for -the -return -voyage -to -australia -our -stay -in -new -zealand -has -been -too -brief -still -we -are -not -unthankful -for -the -glimpse -which -we -have -had -of -it -the -sturdy -maoris -made -the -settlement -of -the -country -by -the -whites -rather -difficult -not -at -first -but -later -at -first -they -welcomed -the -whites -and -were -eager -to -trade -with -them -particularly -for -muskets -for -their -pastime -was -internecine -war -and -they -greatly -preferred -the -white -man's -weapons -to -their -own -war -was -their -pastime -i -use -the -word -advisedly -they -often -met -and -slaughtered -each -other -just -for -a -lark -and -when -there -was -no -quarrel -the -author -of -old -new -zealand -mentions -a -case -where -a -victorious -army -could -have -followed -up -its -advantage -and -exterminated -the -opposing -army -but -declined -to -do -it -explaining -naively -that -if -we -did -that -there -couldn't -be -any -more -fighting -in -another -battle -one -army -sent -word -that -it -was -out -of -ammunition -and -would -be -obliged -to -stop -unless -the -opposing -army -would -send -some -it -was -sent -and -the -fight -went -on -in -the -early -days -things -went -well -enough -the -natives -sold -land -without -clearly -understanding -the -terms -of -exchange -and -the -whites -bought -it -without -being -much -disturbed -about -the -native's -confusion -of -mind -but -by -and -by -the -maori -began -to -comprehend -that -he -was -being -wronged -then -there -was -trouble -for -he -was -not -the -man -to -swallow -a -wrong -and -go -aside -and -cry -about -it -he -had -the -tasmanian's -spirit -and -endurance -and -a -notable -share -of -military -science -besides -and -so -he -rose -against -the -oppressor -did -this -gallant -fanatic -and -started -a -war -that -was -not -brought -to -a -definite -end -until -more -than -a -generation -had -sped -chapter -xxxvi -there -are -several -good -protections -against -temptations -but -the -surest -is -cowardice -pudd'nhead -wilson's -new -calendar -names -are -not -always -what -they -seem -the -common -welsh -name -bzjxxllwep -is -pronounced -jackson -pudd'nhead -wilson's -new -calendar -friday -december -13 -sailed -at -3 -p -m -in -the -'mararoa' -summer -seas -and -a -good -ship -life -has -nothing -better -monday -three -days -of -paradise -warm -and -sunny -and -smooth -the -sea -a -luminous -mediterranean -blue -one -lolls -in -a -long -chair -all -day -under -deck -awnings -and -reads -and -smokes -in -measureless -content -one -does -not -read -prose -at -such -a -time -but -poetry -i -have -been -reading -the -poems -of -mrs -julia -a -moore -again -and -i -find -in -them -the -same -grace -and -melody -that -attracted -me -when -they -were -first -published -twenty -years -ago -and -have -held -me -in -happy -bonds -ever -since -the -sentimental -song -book -has -long -been -out -of -print -and -has -been -forgotten -by -the -world -in -general -but -not -by -me -i -carry -it -with -me -always -it -and -goldsmith's -deathless -story -indeed -it -has -the -same -deep -charm -for -me -that -the -vicar -of -wakefield -has -and -i -find -in -it -the -same -subtle -touch -the -touch -that -makes -an -intentionally -humorous -episode -pathetic -and -an -intentionally -pathetic -one -funny -in -her -time -mrs -moore -was -called -the -sweet -singer -of -michigan -and -was -best -known -by -that -name -i -have -read -her -book -through -twice -today -with -the -purpose -of -determining -which -of -her -pieces -has -most -merit -and -i -am -persuaded -that -for -wide -grasp -and -sustained -power -william -upson -may -claim -first -place -william -upson -air -the -major's -only -son -come -all -good -people -far -and -near -oh -come -and -see -what -you -can -hear -it's -of -a -young -man -true -and -brave -that -is -now -sleeping -in -his -grave -now -william -upson -was -his -name -if -it's -not -that -it's -all -the -same -he -did -enlist -in -a -cruel -strife -and -it -caused -him -to -lose -his -life -he -was -perry -upson's -eldest -son -his -father -loved -his -noble -son -this -son -was -nineteen -years -of -age -when -first -in -the -rebellion -he -engaged -his -father -said -that -he -might -go -but -his -dear -mother -she -said -no -oh! -stay -at -home -dear -billy -she -said -but -she -could -not -turn -his -head -he -went -to -nashville -in -tennessee -there -his -kind -friends -he -could -not -see -he -died -among -strangers -so -far -away -they -did -not -know -where -his -body -lay -he -was -taken -sick -and -lived -four -weeks -and -oh! -how -his -parents -weep -but -now -they -must -in -sorrow -mourn -for -billy -has -gone -to -his -heavenly -home -oh! -if -his -mother -could -have -seen -her -son -for -she -loved -him -her -darling -son -if -she -could -heard -his -dying -prayer -it -would -ease -her -heart -till -she -met -him -there -how -it -would -relieve -his -mother's -heart -to -see -her -son -from -this -world -depart -and -hear -his -noble -words -of -love -as -he -left -this -world -for -that -above -now -it -will -relieve -his -mother's -heart -for -her -son -is -laid -in -our -graveyard -for -now -she -knows -that -his -grave -is -near -she -will -not -shed -so -many -tears -although -she -knows -not -that -it -was -her -son -for -his -coffin -could -not -be -opened -it -might -be -someone -in -his -place -for -she -could -not -see -his -noble -face -december -17 -reached -sydney -december -19 -in -the -train -fellow -of -30 -with -four -valises -a -slim -creature -with -teeth -which -made -his -mouth -look -like -a -neglected -churchyard -he -had -solidified -hair -solidified -with -pomatum -it -was -all -one -shell -he -smoked -the -most -extraordinary -cigarettes -made -of -some -kind -of -manure -apparently -these -and -his -hair -made -him -smell -like -the -very -nation -he -had -a -low -cut -vest -on -which -exposed -a -deal -of -frayed -and -broken -and -unclean -shirtfront -showy -studs -of -imitation -gold -they -had -made -black -disks -on -the -linen -oversized -sleeve -buttons -of -imitation -gold -the -copper -base -showing -through -ponderous -watch -chain -of -imitation -gold -i -judge -that -he -couldn't -tell -the -time -by -it -for -he -asked -smythe -what -time -it -was -once -he -wore -a -coat -which -had -been -gay -when -it -was -young -5 -o'clock -tea -trousers -of -a -light -tint -and -marvelously -soiled -yellow -mustache -with -a -dashing -upward -whirl -at -the -ends -foxy -shoes -imitation -patent -leather -he -was -a -novelty -an -imitation -dude -he -would -have -been -a -real -one -if -he -could -have -afforded -it -but -he -was -satisfied -with -himself -you -could -see -it -in -his -expression -and -in -all -his -attitudes -and -movements -he -was -living -in -a -dude -dreamland -where -all -his -squalid -shams -were -genuine -and -himself -a -sincerity -it -disarmed -criticism -it -mollified -spite -to -see -him -so -enjoy -his -imitation -languors -and -arts -and -airs -and -his -studied -daintinesses -of -gesture -and -misbegotten -refinements -it -was -plain -to -me -that -he -was -imagining -himself -the -prince -of -wales -and -was -doing -everything -the -way -he -thought -the -prince -would -do -it -for -bringing -his -four -valises -aboard -and -stowing -them -in -the -nettings -he -gave -his -porter -four -cents -and -lightly -apologized -for -the -smallness -of -the -gratuity -just -with -the -condescendingest -little -royal -air -in -the -world -he -stretched -himself -out -on -the -front -seat -and -rested -his -pomatum -cake -on -the -middle -arm -and -stuck -his -feet -out -of -the -window -and -began -to -pose -as -the -prince -and -work -his -dreams -and -languors -for -exhibition -and -he -would -indolently -watch -the -blue -films -curling -up -from -his -cigarette -and -inhale -the -stench -and -look -so -grateful -and -would -flip -the -ash -away -with -the -daintiest -gesture -unintentionally -displaying -his -brass -ring -in -the -most -intentional -way -why -it -was -as -good -as -being -in -marlborough -house -itself -to -see -him -do -it -so -like -there -was -other -scenery -in -the -trip -that -of -the -hawksbury -river -in -the -national -park -region -fine -extraordinarily -fine -with -spacious -views -of -stream -and -lake -imposingly -framed -in -woody -hills -and -every -now -and -then -the -noblest -groupings -of -mountains -and -the -most -enchanting -rearrangements -of -the -water -effects -further -along -green -flats -thinly -covered -with -gum -forests -with -here -and -there -the -huts -and -cabins -of -small -farmers -engaged -in -raising -children -still -further -along -arid -stretches -lifeless -and -melancholy -then -newcastle -a -rushing -town -capital -of -the -rich -coal -regions -approaching -scone -wide -farming -and -grazing -levels -with -pretty -frequent -glimpses -of -a -troublesome -plant -a -particularly -devilish -little -prickly -pear -daily -damned -in -the -orisons -of -the -agriculturist -imported -by -a -lady -of -sentiment -and -contributed -gratis -to -the -colony -blazing -hot -all -day -december -20 -back -to -sydney -blazing -hot -again -from -the -newspaper -and -from -the -map -i -have -made -a -collection -of -curious -names -of -australasian -towns -with -the -idea -of -making -a -poem -out -of -them -tumut -takee -murriwillumba -bowral -ballarat -mullengudgery -murrurundi -wagga -wagga -wyalong -murrumbidgee -goomeroo -wolloway -wangary -wanilla -worrow -koppio -yankalilla -yaranyacka -yackamoorundie -kaiwaka -coomooroo -tauranga -geelong -tongariro -kaikoura -wakatipu -oohipara -waitpinga -goelwa -munno -para -nangkita -myponga -kapunda -kooringa -penola -nangwarry -kongorong -comaum -koolywurtie -killanoola -naracoorte -muloowurtie -binnum -wallaroo -wirrega -mundoora -hauraki -rangiriri -teawamute -taranaki -toowoomba -goondiwindi -jerrilderie -whangaroa -wollongong -woolloomooloo -bombola -coolgardie -bendigo -coonamble -cootamundra -woolgoolga -mittagong -jamberoo -kondoparinga -kuitpo -tungkillo -oukaparinga -talunga -yatala -parawirra -moorooroo -whangarei -woolundunga -booleroo -pernatty -parramatta -taroom -narrandera -deniliquin -kawakawa -it -may -be -best -to -build -the -poem -now -and -make -the -weather -help -a -sweltering -day -in -australia -to -be -read -soft -and -low -with -the -lights -turned -down -the -bombola -faints -in -the -hot -bowral -tree -where -fierce -mullengudgery's -smothering -fires -far -from -the -breezes -of -coolgardie -burn -ghastly -and -blue -as -the -day -expires -and -murriwillumba -complaineth -in -song -for -the -garlanded -bowers -of -woolloomooloo -and -the -ballarat -fly -and -the -lone -wollongong -they -dream -of -the -gardens -of -jamberoo -the -wallabi -sighs -for -the -murrubidgee -for -the -velvety -sod -of -the -munno -parah -where -the -waters -of -healing -from -muloowurtie -flow -dim -in -the -gloaming -by -yaranyackah -the -koppio -sorrows -for -lost -wolloway -and -sigheth -in -secret -for -murrurundi -the -whangeroo -wombat -lamenteth -the -day -that -made -him -an -exile -from -jerrilderie -the -teawamute -tumut -from -wirrega's -glade -the -nangkita -swallow -the -wallaroo -swan -they -long -for -the -peace -of -the -timaru -shade -and -thy -balmy -soft -airs -o -sweet -mittagong! -the -kooringa -buffalo -pants -in -the -sun -the -kondoparinga -lies -gaping -for -breath -the -kongorong -camaum -to -the -shadow -has -won -but -the -goomeroo -sinks -in -the -slumber -of -death -in -the -weltering -hell -of -the -moorooroo -plain -the -yatala -wangary -withers -and -dies -and -the -worrow -wanilla -demented -with -pain -to -the -woolgoolga -woodlands -despairingly -flies -sweet -nangwarry's -desolate -coonamble -wails -and -tungkillo -kuito -in -sables -is -drest -for -the -whangerei -winds -fall -asleep -in -the -sails -and -the -booleroo -life -breeze -is -dead -in -the -west -mypongo -kapunda -o -slumber -no -more -yankalilla -parawirra -be -warned -there's -death -in -the -air! -killanoola -wherefore -shall -the -prayer -of -penola -be -scorned -cootamundra -and -takee -and -wakatipu -toowoomba -kaikoura -are -lost -from -onkaparinga -to -far -oamaru -all -burn -in -this -hell's -holocaust! -paramatta -and -binnum -are -gone -to -their -rest -in -the -vale -of -tapanni -taroom -kawakawa -deniliquin -all -that -was -best -in -the -earth -are -but -graves -and -a -tomb! -narrandera -mourns -cameron -answers -not -when -the -roll -of -the -scathless -we -cry -tongariro -goondiwindi -woolundunga -the -spot -is -mute -and -forlorn -where -ye -lie -those -are -good -words -for -poetry -among -the -best -i -have -ever -seen -there -are -81 -in -the -list -i -did -not -need -them -all -but -i -have -knocked -down -66 -of -them -which -is -a -good -bag -it -seems -to -me -for -a -person -not -in -the -business -perhaps -a -poet -laureate -could -do -better -but -a -poet -laureate -gets -wages -and -that -is -different -when -i -write -poetry -i -do -not -get -any -wages -often -i -lose -money -by -it -the -best -word -in -that -list -and -the -most -musical -and -gurgly -is -woolloomoolloo -it -is -a -place -near -sydney -and -is -a -favorite -pleasure -resort -it -has -eight -o's -in -it -chapter -xxxvii -to -succeed -in -the -other -trades -capacity -must -be -shown -in -the -law -concealment -of -it -will -do -pudd'nhead -wilson's -new -calendar -monday -december -23 -1895 -sailed -from -sydney -for -ceylon -in -the -p -& -o -steamer -'oceana' -a -lascar -crew -mans -this -ship -the -first -i -have -seen -white -cotton -petticoat -and -pants -barefoot -red -shawl -for -belt -straw -cap -brimless -on -head -with -red -scarf -wound -around -it -complexion -a -rich -dark -brown -short -straight -black -hair -whiskers -fine -and -silky -lustrous -and -intensely -black -mild -good -faces -willing -and -obedient -people -capable -too -but -are -said -to -go -into -hopeless -panics -when -there -is -danger -they -are -from -bombay -and -the -coast -thereabouts -left -some -of -the -trunks -in -sydney -to -be -shipped -to -south -africa -by -a -vessel -advertised -to -sail -three -months -hence -the -proverb -says -separate -not -yourself -from -your -baggage -this -'oceana' -is -a -stately -big -ship -luxuriously -appointed -she -has -spacious -promenade -decks -large -rooms -a -surpassingly -comfortable -ship -the -officers' -library -is -well -selected -a -ship's -library -is -not -usually -that -for -meals -the -bugle -call -man -of -war -fashion -a -pleasant -change -from -the -terrible -gong -three -big -cats -very -friendly -loafers -they -wander -all -over -the -ship -the -white -one -follows -the -chief -steward -around -like -a -dog -there -is -also -a -basket -of -kittens -one -of -these -cats -goes -ashore -in -port -in -england -australia -and -india -to -see -how -his -various -families -are -getting -along -and -is -seen -no -more -till -the -ship -is -ready -to -sail -no -one -knows -how -he -finds -out -the -sailing -date -but -no -doubt -he -comes -down -to -the -dock -every -day -and -takes -a -look -and -when -he -sees -baggage -and -passengers -flocking -in -recognizes -that -it -is -time -to -get -aboard -this -is -what -the -sailors -believe -the -chief -engineer -has -been -in -the -china -and -india -trade -thirty -three -years -and -has -had -but -three -christmases -at -home -in -that -time -conversational -items -at -dinner -mocha! -sold -all -over -the -world! -it -is -not -true -in -fact -very -few -foreigners -except -the -emperor -of -russia -have -ever -seen -a -grain -of -it -or -ever -will -while -they -live -another -man -said -there -is -no -sale -in -australia -for -australian -wine -but -it -goes -to -france -and -comes -back -with -a -french -label -on -it -and -then -they -buy -it -i -have -heard -that -the -most -of -the -french -labeled -claret -in -new -york -is -made -in -california -and -i -remember -what -professor -s -told -me -once -about -veuve -cliquot -if -that -was -the -wine -and -i -think -it -was -he -was -the -guest -of -a -great -wine -merchant -whose -town -was -quite -near -that -vineyard -and -this -merchant -asked -him -if -very -much -v -c -was -drunk -in -america -oh -yes -said -s -a -great -abundance -of -it -is -it -easy -to -be -had -oh -yes -easy -as -water -all -first -and -second -class -hotels -have -it -what -do -you -pay -for -it -it -depends -on -the -style -of -the -hotel -from -fifteen -to -twenty -five -francs -a -bottle -oh -fortunate -country! -why -it's -worth -100 -francs -right -here -on -the -ground -no! -yes! -do -you -mean -that -we -are -drinking -a -bogus -veuve -cliquot -over -there -yes -and -there -was -never -a -bottle -of -the -genuine -in -america -since -columbus's -time -that -wine -all -comes -from -a -little -bit -of -a -patch -of -ground -which -isn't -big -enough -to -raise -many -bottles -and -all -of -it -that -is -produced -goes -every -year -to -one -person -the -emperor -of -russia -he -takes -the -whole -crop -in -advance -be -it -big -or -little -january -4 -1898 -christmas -in -melbourne -new -year's -day -in -adelaide -and -saw -most -of -the -friends -again -in -both -places -lying -here -at -anchor -all -day -albany -king -george's -sound -western -australia -it -is -a -perfectly -landlocked -harbor -or -roadstead -spacious -to -look -at -but -not -deep -water -desolate -looking -rocks -and -scarred -hills -plenty -of -ships -arriving -now -rushing -to -the -new -gold -fields -the -papers -are -full -of -wonderful -tales -of -the -sort -always -to -be -heard -in -connection -with -new -gold -diggings -a -sample -a -youth -staked -out -a -claim -and -tried -to -sell -half -for -l5 -no -takers -he -stuck -to -it -fourteen -days -starving -then -struck -it -rich -and -sold -out -for -l10 -000 -about -sunset -strong -breeze -blowing -got -up -the -anchor -we -were -in -a -small -deep -puddle -with -a -narrow -channel -leading -out -of -it -minutely -buoyed -to -the -sea -i -stayed -on -deck -to -see -how -we -were -going -to -manage -it -with -such -a -big -ship -and -such -a -strong -wind -on -the -bridge -our -giant -captain -in -uniform -at -his -side -a -little -pilot -in -elaborately -gold -laced -uniform -on -the -forecastle -a -white -mate -and -quartermaster -or -two -and -a -brilliant -crowd -of -lascars -standing -by -for -business -our -stern -was -pointing -straight -at -the -head -of -the -channel -so -we -must -turn -entirely -around -in -the -puddle -and -the -wind -blowing -as -described -it -was -done -and -beautifully -it -was -done -by -help -of -a -jib -we -stirred -up -much -mud -but -did -not -touch -the -bottom -we -turned -right -around -in -our -tracks -a -seeming -impossibility -we -had -several -casts -of -quarter -less -5 -and -one -cast -of -half -4 -27 -feet -we -were -drawing -26 -astern -by -the -time -we -were -entirely -around -and -pointed -the -first -buoy -was -not -more -than -a -hundred -yards -in -front -of -us -it -was -a -fine -piece -of -work -and -i -was -the -only -passenger -that -saw -it -however -the -others -got -their -dinner -the -p -& -o -company -got -mine -more -cats -developed -smythe -says -it -is -a -british -law -that -they -must -be -carried -and -he -instanced -a -case -of -a -ship -not -allowed -to -sail -till -she -sent -for -a -couple -the -bill -came -too -debtor -to -2 -cats -20 -shillings -news -comes -that -within -this -week -siam -has -acknowledged -herself -to -be -in -effect -a -french -province -it -seems -plain -that -all -savage -and -semi -civilized -countries -are -going -to -be -grabbed -a -vulture -on -board -bald -red -queer -shaped -head -featherless -red -places -here -and -there -on -his -body -intense -great -black -eyes -set -in -featherless -rims -of -inflamed -flesh -dissipated -look -a -businesslike -style -a -selfish -conscienceless -murderous -aspect -the -very -look -of -a -professional -assassin -and -yet -a -bird -which -does -no -murder -what -was -the -use -of -getting -him -up -in -that -tragic -style -for -so -innocent -a -trade -as -his -for -this -one -isn't -the -sort -that -wars -upon -the -living -his -diet -is -offal -and -the -more -out -of -date -it -is -the -better -he -likes -it -nature -should -give -him -a -suit -of -rusty -black -then -he -would -be -all -right -for -he -would -look -like -an -undertaker -and -would -harmonize -with -his -business -whereas -the -way -he -is -now -he -is -horribly -out -of -true -january -5 -at -9 -this -morning -we -passed -cape -leeuwin -lioness -and -ceased -from -our -long -due -west -course -along -the -southern -shore -of -australia -turning -this -extreme -southwestern -corner -we -now -take -a -long -straight -slant -nearly -n -w -without -a -break -for -ceylon -as -we -speed -northward -it -will -grow -hotter -very -fast -but -it -isn't -chilly -now -the -vulture -is -from -the -public -menagerie -at -adelaide -a -great -and -interesting -collection -it -was -there -that -we -saw -the -baby -tiger -solemnly -spreading -its -mouth -and -trying -to -roar -like -its -majestic -mother -it -swaggered -scowling -back -and -forth -on -its -short -legs -just -as -it -had -seen -her -do -on -her -long -ones -and -now -and -then -snarling -viciously -exposing -its -teeth -with -a -threatening -lift -of -its -upper -lip -and -bristling -moustache -and -when -it -thought -it -was -impressing -the -visitors -it -would -spread -its -mouth -wide -and -do -that -screechy -cry -which -it -meant -for -a -roar -but -which -did -not -deceive -it -took -itself -quite -seriously -and -was -lovably -comical -and -there -was -a -hyena -an -ugly -creature -as -ugly -as -the -tiger -kitty -was -pretty -it -repeatedly -arched -its -back -and -delivered -itself -of -such -a -human -cry -a -startling -resemblance -a -cry -which -was -just -that -of -a -grown -person -badly -hurt -in -the -dark -one -would -assuredly -go -to -its -assistance -and -be -disappointed -many -friends -of -australasian -federation -on -board -they -feel -sure -that -the -good -day -is -not -far -off -now -but -there -seems -to -be -a -party -that -would -go -further -have -australasia -cut -loose -from -the -british -empire -and -set -up -housekeeping -on -her -own -hook -it -seems -an -unwise -idea -they -point -to -the -united -states -but -it -seems -to -me -that -the -cases -lack -a -good -deal -of -being -alike -australasia -governs -herself -wholly -there -is -no -interference -and -her -commerce -and -manufactures -are -not -oppressed -in -any -way -if -our -case -had -been -the -same -we -should -not -have -gone -out -when -we -did -january -13 -unspeakably -hot -the -equator -is -arriving -again -we -are -within -eight -degrees -of -it -ceylon -present -dear -me -it -is -beautiful! -and -most -sumptuously -tropical -as -to -character -of -foliage -and -opulence -of -it -what -though -the -spicy -breezes -blow -soft -o'er -ceylon's -isle -an -eloquent -line -an -incomparable -line -it -says -little -but -conveys -whole -libraries -of -sentiment -and -oriental -charm -and -mystery -and -tropic -deliciousness -a -line -that -quivers -and -tingles -with -a -thousand -unexpressed -and -inexpressible -things -things -that -haunt -one -and -find -no -articulate -voice -colombo -the -capital -an -oriental -town -most -manifestly -and -fascinating -in -this -palatial -ship -the -passengers -dress -for -dinner -the -ladies' -toilettes -make -a -fine -display -of -color -and -this -is -in -keeping -with -the -elegance -of -the -vessel's -furnishings -and -the -flooding -brilliancies -of -the -electric -light -on -the -stormy -atlantic -one -never -sees -a -man -in -evening -dress -except -at -the -rarest -intervals -and -then -there -is -only -one -not -two -and -he -shows -up -but -once -on -the -voyage -the -night -before -the -ship -makes -port -the -night -when -they -have -the -concert -and -do -the -amateur -wailings -and -recitations -he -is -the -tenor -as -a -rule -there -has -been -a -deal -of -cricket -playing -on -board -it -seems -a -queer -game -for -a -ship -but -they -enclose -the -promenade -deck -with -nettings -and -keep -the -ball -from -flying -overboard -and -the -sport -goes -very -well -and -is -properly -violent -and -exciting -we -must -part -from -this -vessel -here -january -14 -hotel -bristol -servant -brompy -alert -gentle -smiling -winning -young -brown -creature -as -ever -was -beautiful -shining -black -hair -combed -back -like -a -woman's -and -knotted -at -the -back -of -his -head -tortoise -shell -comb -in -it -sign -that -he -is -a -singhalese -slender -shapely -form -jacket -under -it -is -a -beltless -and -flowing -white -cotton -gown -from -neck -straight -to -heel -he -and -his -outfit -quite -unmasculine -it -was -an -embarrassment -to -undress -before -him -we -drove -to -the -market -using -the -japanese -jinriksha -our -first -acquaintanceship -with -it -it -is -a -light -cart -with -a -native -to -draw -it -he -makes -good -speed -for -half -an -hour -but -it -is -hard -work -for -him -he -is -too -slight -for -it -after -the -half -hour -there -is -no -more -pleasure -for -you -your -attention -is -all -on -the -man -just -as -it -would -be -on -a -tired -horse -and -necessarily -your -sympathy -is -there -too -there's -a -plenty -of -these -'rickshas -and -the -tariff -is -incredibly -cheap -i -was -in -cairo -years -ago -that -was -oriental -but -there -was -a -lack -when -you -are -in -florida -or -new -orleans -you -are -in -the -south -that -is -granted -but -you -are -not -in -the -south -you -are -in -a -modified -south -a -tempered -south -cairo -was -a -tempered -orient -an -orient -with -an -indefinite -something -wanting -that -feeling -was -not -present -in -ceylon -ceylon -was -oriental -in -the -last -measure -of -completeness -utterly -oriental -also -utterly -tropical -and -indeed -to -one's -unreasoning -spiritual -sense -the -two -things -belong -together -all -the -requisites -were -present -the -costumes -were -right -the -black -and -brown -exposures -unconscious -of -immodesty -were -right -the -juggler -was -there -with -his -basket -his -snakes -his -mongoose -and -his -arrangements -for -growing -a -tree -from -seed -to -foliage -and -ripe -fruitage -before -one's -eyes -in -sight -were -plants -and -flowers -familiar -to -one -on -books -but -in -no -other -way -celebrated -desirable -strange -but -in -production -restricted -to -the -hot -belt -of -the -equator -and -out -a -little -way -in -the -country -were -the -proper -deadly -snakes -and -fierce -beasts -of -prey -and -the -wild -elephant -and -the -monkey -and -there -was -that -swoon -in -the -air -which -one -associates -with -the -tropics -and -that -smother -of -heat -heavy -with -odors -of -unknown -flowers -and -that -sudden -invasion -of -purple -gloom -fissured -with -lightnings -then -the -tumult -of -crashing -thunder -and -the -downpour -and -presently -all -sunny -and -smiling -again -all -these -things -were -there -the -conditions -were -complete -nothing -was -lacking -and -away -off -in -the -deeps -of -the -jungle -and -in -the -remotenesses -of -the -mountains -were -the -ruined -cities -and -mouldering -temples -mysterious -relics -of -the -pomps -of -a -forgotten -time -and -a -vanished -race -and -this -was -as -it -should -be -also -for -nothing -is -quite -satisfyingly -oriental -that -lacks -the -somber -and -impressive -qualities -of -mystery -and -antiquity -the -drive -through -the -town -and -out -to -the -galle -face -by -the -seashore -what -a -dream -it -was -of -tropical -splendors -of -bloom -and -blossom -and -oriental -conflagrations -of -costume! -the -walking -groups -of -men -women -boys -girls -babies -each -individual -was -a -flame -each -group -a -house -afire -for -color -and -such -stunning -colors -such -intensely -vivid -colors -such -rich -and -exquisite -minglings -and -fusings -of -rainbows -and -lightnings! -and -all -harmonious -all -in -perfect -taste -never -a -discordant -note -never -a -color -on -any -person -swearing -at -another -color -on -him -or -failing -to -harmonize -faultlessly -with -the -colors -of -any -group -the -wearer -might -join -the -stuffs -were -silk -thin -soft -delicate -clinging -and -as -a -rule -each -piece -a -solid -color -a -splendid -green -a -splendid -blue -a -splendid -yellow -a -splendid -purple -a -splendid -ruby -deep -and -rich -with -smouldering -fires -they -swept -continuously -by -in -crowds -and -legions -and -multitudes -glowing -flashing -burning -radiant -and -every -five -seconds -came -a -burst -of -blinding -red -that -made -a -body -catch -his -breath -and -filled -his -heart -with -joy -and -then -the -unimaginable -grace -of -those -costumes! -sometimes -a -woman's -whole -dress -was -but -a -scarf -wound -about -her -person -and -her -head -sometimes -a -man's -was -but -a -turban -and -a -careless -rag -or -two -in -both -cases -generous -areas -of -polished -dark -skin -showing -but -always -the -arrangement -compelled -the -homage -of -the -eye -and -made -the -heart -sing -for -gladness -i -can -see -it -to -this -day -that -radiant -panorama -that -wilderness -of -rich -color -that -incomparable -dissolving -view -of -harmonious -tints -and -lithe -half -covered -forms -and -beautiful -brown -faces -and -gracious -and -graceful -gestures -and -attitudes -and -movements -free -unstudied -barren -of -stiffness -and -restraint -and -just -then -into -this -dream -of -fairyland -and -paradise -a -grating -dissonance -was -injected -out -of -a -missionary -school -came -marching -two -and -two -sixteen -prim -and -pious -little -christian -black -girls -europeanly -clothed -dressed -to -the -last -detail -as -they -would -have -been -dressed -on -a -summer -sunday -in -an -english -or -american -village -those -clothes -oh -they -were -unspeakably -ugly! -ugly -barbarous -destitute -of -taste -destitute -of -grace -repulsive -as -a -shroud -i -looked -at -my -womenfolk's -clothes -just -full -grown -duplicates -of -the -outrages -disguising -those -poor -little -abused -creatures -and -was -ashamed -to -be -seen -in -the -street -with -them -then -i -looked -at -my -own -clothes -and -was -ashamed -to -be -seen -in -the -street -with -myself -however -we -must -put -up -with -our -clothes -as -they -are -they -have -their -reason -for -existing -they -are -on -us -to -expose -us -to -advertise -what -we -wear -them -to -conceal -they -are -a -sign -a -sign -of -insincerity -a -sign -of -suppressed -vanity -a -pretense -that -we -despise -gorgeous -colors -and -the -graces -of -harmony -and -form -and -we -put -them -on -to -propagate -that -lie -and -back -it -up -but -we -do -not -deceive -our -neighbor -and -when -we -step -into -ceylon -we -realize -that -we -have -not -even -deceived -ourselves -we -do -love -brilliant -colors -and -graceful -costumes -and -at -home -we -will -turn -out -in -a -storm -to -see -them -when -the -procession -goes -by -and -envy -the -wearers -we -go -to -the -theater -to -look -at -them -and -grieve -that -we -can't -be -clothed -like -that -we -go -to -the -king's -ball -when -we -get -a -chance -and -are -glad -of -a -sight -of -the -splendid -uniforms -and -the -glittering -orders -when -we -are -granted -permission -to -attend -an -imperial -drawing -room -we -shut -ourselves -up -in -private -and -parade -around -in -the -theatrical -court -dress -by -the -hour -and -admire -ourselves -in -the -glass -and -are -utterly -happy -and -every -member -of -every -governor's -staff -in -democratic -america -does -the -same -with -his -grand -new -uniform -and -if -he -is -not -watched -he -will -get -himself -photographed -in -it -too -when -i -see -the -lord -mayor's -footman -i -am -dissatisfied -with -my -lot -yes -our -clothes -are -a -lie -and -have -been -nothing -short -of -that -these -hundred -years -they -are -insincere -they -are -the -ugly -and -appropriate -outward -exposure -of -an -inward -sham -and -a -moral -decay -the -last -little -brown -boy -i -chanced -to -notice -in -the -crowds -and -swarms -of -colombo -had -nothing -on -but -a -twine -string -around -his -waist -but -in -my -memory -the -frank -honesty -of -his -costume -still -stands -out -in -pleasant -contrast -with -the -odious -flummery -in -which -the -little -sunday -school -dowdies -were -masquerading -chapter -xxxviii -prosperity -is -the -best -protector -of -principle -pudd'nhead -wilson's -new -calendar -evening -11th -sailed -in -the -rosetta -this -is -a -poor -old -ship -and -ought -to -be -insured -and -sunk -as -in -the -'oceana' -just -so -here -everybody -dresses -for -dinner -they -make -it -a -sort -of -pious -duty -these -fine -and -formal -costumes -are -a -rather -conspicuous -contrast -to -the -poverty -and -shabbiness -of -the -surroundings -if -you -want -a -slice -of -a -lime -at -four -o'clock -tea -you -must -sign -an -order -on -the -bar -limes -cost -14 -cents -a -barrel -january -18th -we -have -been -running -up -the -arabian -sea -latterly -closing -up -on -bombay -now -and -due -to -arrive -this -evening -january -20th -bombay! -a -bewitching -place -a -bewildering -place -an -enchanting -place -the -arabian -nights -come -again -it -is -a -vast -city -contains -about -a -million -inhabitants -natives -they -are -with -a -slight -sprinkling -of -white -people -not -enough -to -have -the -slightest -modifying -effect -upon -the -massed -dark -complexion -of -the -public -it -is -winter -here -yet -the -weather -is -the -divine -weather -of -june -and -the -foliage -is -the -fresh -and -heavenly -foliage -of -june -there -is -a -rank -of -noble -great -shade -trees -across -the -way -from -the -hotel -and -under -them -sit -groups -of -picturesque -natives -of -both -sexes -and -the -juggler -in -his -turban -is -there -with -his -snakes -and -his -magic -and -all -day -long -the -cabs -and -the -multitudinous -varieties -of -costumes -flock -by -it -does -not -seem -as -if -one -could -ever -get -tired -of -watching -this -moving -show -this -shining -and -shifting -spectacle -in -the -great -bazar -the -pack -and -jam -of -natives -was -marvelous -the -sea -of -rich -colored -turbans -and -draperies -an -inspiring -sight -and -the -quaint -and -showy -indian -architecture -was -just -the -right -setting -for -it -toward -sunset -another -show -this -is -the -drive -around -the -sea -shore -to -malabar -point -where -lord -sandhurst -the -governor -of -the -bombay -presidency -lives -parsee -palaces -all -along -the -first -part -of -the -drive -and -past -them -all -the -world -is -driving -the -private -carriages -of -wealthy -englishmen -and -natives -of -rank -are -manned -by -a -driver -and -three -footmen -in -stunning -oriental -liveries -two -of -these -turbaned -statues -standing -up -behind -as -fine -as -monuments -sometimes -even -the -public -carriages -have -this -superabundant -crew -slightly -modified -one -to -drive -one -to -sit -by -and -see -it -done -and -one -to -stand -up -behind -and -yell -yell -when -there -is -anybody -in -the -way -and -for -practice -when -there -isn't -it -all -helps -to -keep -up -the -liveliness -and -augment -the -general -sense -of -swiftness -and -energy -and -confusion -and -pow -wow -in -the -region -of -scandal -point -felicitous -name -where -there -are -handy -rocks -to -sit -on -and -a -noble -view -of -the -sea -on -the -one -hand -and -on -the -other -the -passing -and -reprising -whirl -and -tumult -of -gay -carriages -are -great -groups -of -comfortably -off -parsee -women -perfect -flower -beds -of -brilliant -color -a -fascinating -spectacle -tramp -tramp -tramping -along -the -road -in -singles -couples -groups -and -gangs -you -have -the -working -man -and -the -working -woman -but -not -clothed -like -ours -usually -the -man -is -a -nobly -built -great -athlete -with -not -a -rag -on -but -his -loin -handkerchief -his -color -a -deep -dark -brown -his -skin -satin -his -rounded -muscles -knobbing -it -as -if -it -had -eggs -under -it -usually -the -woman -is -a -slender -and -shapely -creature -as -erect -as -a -lightning -rod -and -she -has -but -one -thing -on -a -bright -colored -piece -of -stuff -which -is -wound -about -her -head -and -her -body -down -nearly -half -way -to -her -knees -and -which -clings -like -her -own -skin -her -legs -and -feet -are -bare -and -so -are -her -arms -except -for -her -fanciful -bunches -of -loose -silver -rings -on -her -ankles -and -on -her -arms -she -has -jewelry -bunched -on -the -side -of -her -nose -also -and -showy -clusterings -on -her -toes -when -she -undresses -for -bed -she -takes -off -her -jewelry -i -suppose -if -she -took -off -anything -more -she -would -catch -cold -as -a -rule -she -has -a -large -shiney -brass -water -jar -of -graceful -shape -on -her -head -and -one -of -her -naked -arms -curves -up -and -the -hand -holds -it -there -she -is -so -straight -so -erect -and -she -steps -with -such -style -and -such -easy -grace -and -dignity -and -her -curved -arm -and -her -brazen -jar -are -such -a -help -to -the -picture -indeed -our -working -women -cannot -begin -with -her -as -a -road -decoration -it -is -all -color -bewitching -color -enchanting -color -everywhere -all -around -all -the -way -around -the -curving -great -opaline -bay -clear -to -government -house -where -the -turbaned -big -native -'chuprassies' -stand -grouped -in -state -at -the -door -in -their -robes -of -fiery -red -and -do -most -properly -and -stunningly -finish -up -the -splendid -show -and -make -it -theatrically -complete -i -wish -i -were -a -'chuprassy' -this -is -indeed -india! -the -land -of -dreams -and -romance -of -fabulous -wealth -and -fabulous -poverty -of -splendor -and -rags -of -palaces -and -hovels -of -famine -and -pestilence -of -genii -and -giants -and -aladdin -lamps -of -tigers -and -elephants -the -cobra -and -the -jungle -the -country -of -a -hundred -nations -and -a -hundred -tongues -of -a -thousand -religions -and -two -million -gods -cradle -of -the -human -race -birthplace -of -human -speech -mother -of -history -grandmother -of -legend -great -grandmother -of -tradition -whose -yesterdays -bear -date -with -the -mouldering -antiquities -of -the -rest -of -the -nations -the -one -sole -country -under -the -sun -that -is -endowed -with -an -imperishable -interest -for -alien -prince -and -alien -peasant -for -lettered -and -ignorant -wise -and -fool -rich -and -poor -bond -and -free -the -one -land -that -all -men -desire -to -see -and -having -seen -once -by -even -a -glimpse -would -not -give -that -glimpse -for -the -shows -of -all -the -rest -of -the -globe -combined -even -now -after -the -lapse -of -a -year -the -delirium -of -those -days -in -bombay -has -not -left -me -and -i -hope -never -will -it -was -all -new -no -detail -of -it -hackneyed -and -india -did -not -wait -for -morning -it -began -at -the -hotel -straight -away -the -lobbies -and -halls -were -full -of -turbaned -and -fez'd -and -embroidered -cap'd -and -barefooted -and -cotton -clad -dark -natives -some -of -them -rushing -about -others -at -rest -squatting -or -sitting -on -the -ground -some -of -them -chattering -with -energy -others -still -and -dreamy -in -the -dining -room -every -man's -own -private -native -servant -standing -behind -his -chair -and -dressed -for -a -part -in -the -arabian -nights -our -rooms -were -high -up -on -the -front -a -white -man -he -was -a -burly -german -went -up -with -us -and -brought -three -natives -along -to -see -to -arranging -things -about -fourteen -others -followed -in -procession -with -the -hand -baggage -each -carried -an -article -and -only -one -a -bag -in -some -cases -in -other -cases -less -one -strong -native -carried -my -overcoat -another -a -parasol -another -a -box -of -cigars -another -a -novel -and -the -last -man -in -the -procession -had -no -load -but -a -fan -it -was -all -done -with -earnestness -and -sincerity -there -was -not -a -smile -in -the -procession -from -the -head -of -it -to -the -tail -of -it -each -man -waited -patiently -tranquilly -in -no -sort -of -hurry -till -one -of -us -found -time -to -give -him -a -copper -then -he -bent -his -head -reverently -touched -his -forehead -with -his -fingers -and -went -his -way -they -seemed -a -soft -and -gentle -race -and -there -was -something -both -winning -and -touching -about -their -demeanor -there -was -a -vast -glazed -door -which -opened -upon -the -balcony -it -needed -closing -or -cleaning -or -something -and -a -native -got -down -on -his -knees -and -went -to -work -at -it -he -seemed -to -be -doing -it -well -enough -but -perhaps -he -wasn't -for -the -burly -german -put -on -a -look -that -betrayed -dissatisfaction -then -without -explaining -what -was -wrong -gave -the -native -a -brisk -cuff -on -the -jaw -and -then -told -him -where -the -defect -was -it -seemed -such -a -shame -to -do -that -before -us -all -the -native -took -it -with -meekness -saying -nothing -and -not -showing -in -his -face -or -manner -any -resentment -i -had -not -seen -the -like -of -this -for -fifty -years -it -carried -me -back -to -my -boyhood -and -flashed -upon -me -the -forgotten -fact -that -this -was -the -usual -way -of -explaining -one's -desires -to -a -slave -i -was -able -to -remember -that -the -method -seemed -right -and -natural -to -me -in -those -days -i -being -born -to -it -and -unaware -that -elsewhere -there -were -other -methods -but -i -was -also -able -to -remember -that -those -unresented -cuffings -made -me -sorry -for -the -victim -and -ashamed -for -the -punisher -my -father -was -a -refined -and -kindly -gentleman -very -grave -rather -austere -of -rigid -probity -a -sternly -just -and -upright -man -albeit -he -attended -no -church -and -never -spoke -of -religious -matters -and -had -no -part -nor -lot -in -the -pious -joys -of -his -presbyterian -family -nor -ever -seemed -to -suffer -from -this -deprivation -he -laid -his -hand -upon -me -in -punishment -only -twice -in -his -life -and -then -not -heavily -once -for -telling -him -a -lie -which -surprised -me -and -showed -me -how -unsuspicious -he -was -for -that -was -not -my -maiden -effort -he -punished -me -those -two -times -only -and -never -any -other -member -of -the -family -at -all -yet -every -now -and -then -he -cuffed -our -harmless -slave -boy -lewis -for -trifling -little -blunders -and -awkwardnesses -my -father -had -passed -his -life -among -the -slaves -from -his -cradle -up -and -his -cuffings -proceeded -from -the -custom -of -the -time -not -from -his -nature -when -i -was -ten -years -old -i -saw -a -man -fling -a -lump -of -iron -ore -at -a -slaveman -in -anger -for -merely -doing -something -awkwardly -as -if -that -were -a -crime -it -bounded -from -the -man's -skull -and -the -man -fell -and -never -spoke -again -he -was -dead -in -an -hour -i -knew -the -man -had -a -right -to -kill -his -slave -if -he -wanted -to -and -yet -it -seemed -a -pitiful -thing -and -somehow -wrong -though -why -wrong -i -was -not -deep -enough -to -explain -if -i -had -been -asked -to -do -it -nobody -in -the -village -approved -of -that -murder -but -of -course -no -one -said -much -about -it -it -is -curious -the -space -annihilating -power -of -thought -for -just -one -second -all -that -goes -to -make -the -me -in -me -was -in -a -missourian -village -on -the -other -side -of -the -globe -vividly -seeing -again -these -forgotten -pictures -of -fifty -years -ago -and -wholly -unconscious -of -all -things -but -just -those -and -in -the -next -second -i -was -back -in -bombay -and -that -kneeling -native's -smitten -cheek -was -not -done -tingling -yet! -back -to -boyhood -fifty -years -back -to -age -again -another -fifty -and -a -flight -equal -to -the -circumference -of -the -globe -all -in -two -seconds -by -the -watch! -some -natives -i -don't -remember -how -many -went -into -my -bedroom -now -and -put -things -to -rights -and -arranged -the -mosquito -bar -and -i -went -to -bed -to -nurse -my -cough -it -was -about -nine -in -the -evening -what -a -state -of -things! -for -three -hours -the -yelling -and -shouting -of -natives -in -the -hall -continued -along -with -the -velvety -patter -of -their -swift -bare -feet -what -a -racket -it -was! -they -were -yelling -orders -and -messages -down -three -flights -why -in -the -matter -of -noise -it -amounted -to -a -riot -an -insurrection -a -revolution -and -then -there -were -other -noises -mixed -up -with -these -and -at -intervals -tremendously -accenting -them -roofs -falling -in -i -judged -windows -smashing -persons -being -murdered -crows -squawking -and -deriding -and -cursing -canaries -screeching -monkeys -jabbering -macaws -blaspheming -and -every -now -and -then -fiendish -bursts -of -laughter -and -explosions -of -dynamite -by -midnight -i -had -suffered -all -the -different -kinds -of -shocks -there -are -and -knew -that -i -could -never -more -be -disturbed -by -them -either -isolated -or -in -combination -then -came -peace -stillness -deep -and -solemn -and -lasted -till -five -then -it -all -broke -loose -again -and -who -re -started -it -the -bird -of -birds -the -indian -crow -i -came -to -know -him -well -by -and -by -and -be -infatuated -with -him -i -suppose -he -is -the -hardest -lot -that -wears -feathers -yes -and -the -cheerfulest -and -the -best -satisfied -with -himself -he -never -arrived -at -what -he -is -by -any -careless -process -or -any -sudden -one -he -is -a -work -of -art -and -art -is -long -he -is -the -product -of -immemorial -ages -and -of -deep -calculation -one -can't -make -a -bird -like -that -in -a -day -he -has -been -reincarnated -more -times -than -shiva -and -he -has -kept -a -sample -of -each -incarnation -and -fused -it -into -his -constitution -in -the -course -of -his -evolutionary -promotions -his -sublime -march -toward -ultimate -perfection -he -has -been -a -gambler -a -low -comedian -a -dissolute -priest -a -fussy -woman -a -blackguard -a -scoffer -a -liar -a -thief -a -spy -an -informer -a -trading -politician -a -swindler -a -professional -hypocrite -a -patriot -for -cash -a -reformer -a -lecturer -a -lawyer -a -conspirator -a -rebel -a -royalist -a -democrat -a -practicer -and -propagator -of -irreverence -a -meddler -an -intruder -a -busybody -an -infidel -and -a -wallower -in -sin -for -the -mere -love -of -it -the -strange -result -the -incredible -result -of -this -patient -accumulation -of -all -damnable -traits -is -that -be -does -not -know -what -care -is -he -does -not -know -what -sorrow -is -he -does -not -know -what -remorse -is -his -life -is -one -long -thundering -ecstasy -of -happiness -and -he -will -go -to -his -death -untroubled -knowing -that -he -will -soon -turn -up -again -as -an -author -or -something -and -be -even -more -intolerably -capable -and -comfortable -than -ever -he -was -before -in -his -straddling -wide -forward -step -and -his -springy -side -wise -series -of -hops -and -his -impudent -air -and -his -cunning -way -of -canting -his -head -to -one -side -upon -occasion -he -reminds -one -of -the -american -blackbird -but -the -sharp -resemblances -stop -there -he -is -much -bigger -than -the -blackbird -and -he -lacks -the -blackbird's -trim -and -slender -and -beautiful -build -and -shapely -beak -and -of -course -his -sober -garb -of -gray -and -rusty -black -is -a -poor -and -humble -thing -compared -with -the -splendid -lustre -of -the -blackbird's -metallic -sables -and -shifting -and -flashing -bronze -glories -the -blackbird -is -a -perfect -gentleman -in -deportment -and -attire -and -is -not -noisy -i -believe -except -when -holding -religious -services -and -political -conventions -in -a -tree -but -this -indian -sham -quaker -is -just -a -rowdy -and -is -always -noisy -when -awake -always -chaffing -scolding -scoffing -laughing -ripping -and -cursing -and -carrying -on -about -something -or -other -i -never -saw -such -a -bird -for -delivering -opinions -nothing -escapes -him -he -notices -everything -that -happens -and -brings -out -his -opinion -about -it -particularly -if -it -is -a -matter -that -is -none -of -his -business -and -it -is -never -a -mild -opinion -but -always -violent -violent -and -profane -the -presence -of -ladies -does -not -affect -him -his -opinions -are -not -the -outcome -of -reflection -for -he -never -thinks -about -anything -but -heaves -out -the -opinion -that -is -on -top -in -his -mind -and -which -is -often -an -opinion -about -some -quite -different -thing -and -does -not -fit -the -case -but -that -is -his -way -his -main -idea -is -to -get -out -an -opinion -and -if -he -stopped -to -think -he -would -lose -chances -i -suppose -he -has -no -enemies -among -men -the -whites -and -mohammedans -never -seemed -to -molest -him -and -the -hindoos -because -of -their -religion -never -take -the -life -of -any -creature -but -spare -even -the -snakes -and -tigers -and -fleas -and -rats -if -i -sat -on -one -end -of -the -balcony -the -crows -would -gather -on -the -railing -at -the -other -end -and -talk -about -me -and -edge -closer -little -by -little -till -i -could -almost -reach -them -and -they -would -sit -there -in -the -most -unabashed -way -and -talk -about -my -clothes -and -my -hair -and -my -complexion -and -probable -character -and -vocation -and -politics -and -how -i -came -to -be -in -india -and -what -i -had -been -doing -and -how -many -days -i -had -got -for -it -and -how -i -had -happened -to -go -unhanged -so -long -and -when -would -it -probably -come -off -and -might -there -be -more -of -my -sort -where -i -came -from -and -when -would -they -be -hanged -and -so -on -and -so -on -until -i -could -not -longer -endure -the -embarrassment -of -it -then -i -would -shoo -them -away -and -they -would -circle -around -in -the -air -a -little -while -laughing -and -deriding -and -mocking -and -presently -settle -on -the -rail -and -do -it -all -over -again -they -were -very -sociable -when -there -was -anything -to -eat -oppressively -so -with -a -little -encouragement -they -would -come -in -and -light -on -the -table -and -help -me -eat -my -breakfast -and -once -when -i -was -in -the -other -room -and -they -found -themselves -alone -they -carried -off -everything -they -could -lift -and -they -were -particular -to -choose -things -which -they -could -make -no -use -of -after -they -got -them -in -india -their -number -is -beyond -estimate -and -their -noise -is -in -proportion -i -suppose -they -cost -the -country -more -than -the -government -does -yet -that -is -not -a -light -matter -still -they -pay -their -company -pays -it -would -sadden -the -land -to -take -their -cheerful -voice -out -of -it -chapter -xxxix -by -trying -we -can -easily -learn -to -endure -adversity -another -man's -i -mean -pudd'nhead -wilson's -new -calendar -you -soon -find -your -long -ago -dreams -of -india -rising -in -a -sort -of -vague -and -luscious -moonlight -above -the -horizon -rim -of -your -opaque -consciousness -and -softly -lighting -up -a -thousand -forgotten -details -which -were -parts -of -a -vision -that -had -once -been -vivid -to -you -when -you -were -a -boy -and -steeped -your -spirit -in -tales -of -the -east -the -barbaric -gorgeousnesses -for -instance -and -the -princely -titles -the -sumptuous -titles -the -sounding -titles -how -good -they -taste -in -the -mouth! -the -nizam -of -hyderabad -the -maharajah -of -travancore -the -nabob -of -jubbelpore -the -begum -of -bhopal -the -nawab -of -mysore -the -rance -of -gulnare -the -ahkoond -of -swat's -the -rao -of -rohilkund -the -gaikwar -of -baroda -indeed -it -is -a -country -that -runs -richly -to -name -the -great -god -vishnu -has -108 -108 -special -ones -108 -peculiarly -holy -ones -names -just -for -sunday -use -only -i -learned -the -whole -of -vishnu's -108 -by -heart -once -but -they -wouldn't -stay -i -don't -remember -any -of -them -now -but -john -w -and -the -romances -connected -with -those -princely -native -houses -to -this -day -they -are -always -turning -up -just -as -in -the -old -old -times -they -were -sweating -out -a -romance -in -an -english -court -in -bombay -a -while -before -we -were -there -in -this -case -a -native -prince -16 -1/2 -years -old -who -has -been -enjoying -his -titles -and -dignities -and -estates -unmolested -for -fourteen -years -is -suddenly -haled -into -court -on -the -charge -that -he -is -rightfully -no -prince -at -all -but -a -pauper -peasant -that -the -real -prince -died -when -two -and -one -half -years -old -that -the -death -was -concealed -and -a -peasant -child -smuggled -into -the -royal -cradle -and -that -this -present -incumbent -was -that -smuggled -substitute -this -is -the -very -material -that -so -many -oriental -tales -have -been -made -of -the -case -of -that -great -prince -the -gaikwar -of -baroda -is -a -reversal -of -the -theme -when -that -throne -fell -vacant -no -heir -could -be -found -for -some -time -but -at -last -one -was -found -in -the -person -of -a -peasant -child -who -was -making -mud -pies -in -a -village -street -and -having -an -innocent -good -time -but -his -pedigree -was -straight -he -was -the -true -prince -and -he -has -reigned -ever -since -with -none -to -dispute -his -right -lately -there -was -another -hunt -for -an -heir -to -another -princely -house -and -one -was -found -who -was -circumstanced -about -as -the -gaikwar -had -been -his -fathers -were -traced -back -in -humble -life -along -a -branch -of -the -ancestral -tree -to -the -point -where -it -joined -the -stem -fourteen -generations -ago -and -his -heirship -was -thereby -squarely -established -the -tracing -was -done -by -means -of -the -records -of -one -of -the -great -hindoo -shrines -where -princes -on -pilgrimage -record -their -names -and -the -date -of -their -visit -this -is -to -keep -the -prince's -religious -account -straight -and -his -spiritual -person -safe -but -the -record -has -the -added -value -of -keeping -the -pedigree -authentic -too -when -i -think -of -bombay -now -at -this -distance -of -time -i -seem -to -have -a -kaleidoscope -at -my -eye -and -i -hear -the -clash -of -the -glass -bits -as -the -splendid -figures -change -and -fall -apart -and -flash -into -new -forms -figure -after -figure -and -with -the -birth -of -each -new -form -i -feel -my -skin -crinkle -and -my -nerve -web -tingle -with -a -new -thrill -of -wonder -and -delight -these -remembered -pictures -float -past -me -in -a -sequence -of -contracts -following -the -same -order -always -and -always -whirling -by -and -disappearing -with -the -swiftness -of -a -dream -leaving -me -with -the -sense -that -the -actuality -was -the -experience -of -an -hour -at -most -whereas -it -really -covered -days -i -think -the -series -begins -with -the -hiring -of -a -bearer -native -man -servant -a -person -who -should -be -selected -with -some -care -because -as -long -as -he -is -in -your -employ -he -will -be -about -as -near -to -you -as -your -clothes -in -india -your -day -may -be -said -to -begin -with -the -bearer's -knock -on -the -bedroom -door -accompanied -by -a -formula -of -words -a -formula -which -is -intended -to -mean -that -the -bath -is -ready -it -doesn't -really -seem -to -mean -anything -at -all -but -that -is -because -you -are -not -used -to -bearer -english -you -will -presently -understand -where -he -gets -his -english -is -his -own -secret -there -is -nothing -like -it -elsewhere -in -the -earth -or -even -in -paradise -perhaps -but -the -other -place -is -probably -full -of -it -you -hire -him -as -soon -as -you -touch -indian -soil -for -no -matter -what -your -sex -is -you -cannot -do -without -him -he -is -messenger -valet -chambermaid -table -waiter -lady's -maid -courier -he -is -everything -he -carries -a -coarse -linen -clothes -bag -and -a -quilt -he -sleeps -on -the -stone -floor -outside -your -chamber -door -and -gets -his -meals -you -do -not -know -where -nor -when -you -only -know -that -he -is -not -fed -on -the -premises -either -when -you -are -in -a -hotel -or -when -you -are -a -guest -in -a -private -house -his -wages -are -large -from -an -indian -point -of -view -and -he -feeds -and -clothes -himself -out -of -them -we -had -three -of -him -in -two -and -a -half -months -the -first -one's -rate -was -thirty -rupees -a -month -that -is -to -say -twenty -seven -cents -a -day -the -rate -of -the -others -rs -40 -40 -rupees -a -month -a -princely -sum -for -the -native -switchman -on -a -railway -and -the -native -servant -in -a -private -family -get -only -rs -7 -per -month -and -the -farm -hand -only -4 -the -two -former -feed -and -clothe -themselves -and -their -families -on -their -$1 -90 -per -month -but -i -cannot -believe -that -the -farmhand -has -to -feed -himself -on -his -$1 -08 -i -think -the -farm -probably -feeds -him -and -that -the -whole -of -his -wages -except -a -trifle -for -the -priest -go -to -the -support -of -his -family -that -is -to -the -feeding -of -his -family -for -they -live -in -a -mud -hut -hand -made -and -doubtless -rent -free -and -they -wear -no -clothes -at -least -nothing -more -than -a -rag -and -not -much -of -a -rag -at -that -in -the -case -of -the -males -however -these -are -handsome -times -for -the -farm -hand -he -was -not -always -the -child -of -luxury -that -he -is -now -the -chief -commissioner -of -the -central -provinces -in -a -recent -official -utterance -wherein -he -was -rebuking -a -native -deputation -for -complaining -of -hard -times -reminded -them -that -they -could -easily -remember -when -a -farm -hand's -wages -were -only -half -a -rupee -former -value -a -month -that -is -to -say -less -than -a -cent -a -day -nearly -$2 -90 -a -year -if -such -a -wage -earner -had -a -good -deal -of -a -family -and -they -all -have -that -for -god -is -very -good -to -these -poor -natives -in -some -ways -he -would -save -a -profit -of -fifteen -cents -clean -and -clear -out -of -his -year's -toil -i -mean -a -frugal -thrifty -person -would -not -one -given -to -display -and -ostentation -and -if -he -owed -$13 -50 -and -took -good -care -of -his -health -he -could -pay -it -off -in -ninety -years -then -he -could -hold -up -his -head -and -look -his -creditors -in -the -face -again -think -of -these -facts -and -what -they -mean -india -does -not -consist -of -cities -there -are -no -cities -in -india -to -speak -of -its -stupendous -population -consists -of -farm -laborers -india -is -one -vast -farm -one -almost -interminable -stretch -of -fields -with -mud -fences -between -think -of -the -above -facts -and -consider -what -an -incredible -aggregate -of -poverty -they -place -before -you -the -first -bearer -that -applied -waited -below -and -sent -up -his -recommendations -that -was -the -first -morning -in -bombay -we -read -them -over -carefully -cautiously -thoughtfully -there -was -not -a -fault -to -find -with -them -except -one -they -were -all -from -americans -is -that -a -slur -if -it -is -it -is -a -deserved -one -in -my -experience -an -american's -recommendation -of -a -servant -is -not -usually -valuable -we -are -too -good -natured -a -race -we -hate -to -say -the -unpleasant -thing -we -shrink -from -speaking -the -unkind -truth -about -a -poor -fellow -whose -bread -depends -upon -our -verdict -so -we -speak -of -his -good -points -only -thus -not -scrupling -to -tell -a -lie -a -silent -lie -for -in -not -mentioning -his -bad -ones -we -as -good -as -say -he -hasn't -any -the -only -difference -that -i -know -of -between -a -silent -lie -and -a -spoken -one -is -that -the -silent -lie -is -a -less -respectable -one -than -the -other -and -it -can -deceive -whereas -the -other -can't -as -a -rule -we -not -only -tell -the -silent -lie -as -to -a -servant's -faults -but -we -sin -in -another -way -we -overpraise -his -merits -for -when -it -comes -to -writing -recommendations -of -servants -we -are -a -nation -of -gushers -and -we -have -not -the -frenchman's -excuse -in -france -you -must -give -the -departing -servant -a -good -recommendation -and -you -must -conceal -his -faults -you -have -no -choice -if -you -mention -his -faults -for -the -protection -of -the -next -candidate -for -his -services -he -can -sue -you -for -damages -and -the -court -will -award -them -too -and -moreover -the -judge -will -give -you -a -sharp -dressing -down -from -the -bench -for -trying -to -destroy -a -poor -man's -character -and -rob -him -of -his -bread -i -do -not -state -this -on -my -own -authority -i -got -it -from -a -french -physician -of -fame -and -repute -a -man -who -was -born -in -paris -and -had -practiced -there -all -his -life -and -he -said -that -he -spoke -not -merely -from -common -knowledge -but -from -exasperating -personal -experience -as -i -was -saying -the -bearer's -recommendations -were -all -from -american -tourists -and -st -peter -would -have -admitted -him -to -the -fields -of -the -blest -on -them -i -mean -if -he -is -as -unfamiliar -with -our -people -and -our -ways -as -i -suppose -he -is -according -to -these -recommendations -manuel -x -was -supreme -in -all -the -arts -connected -with -his -complex -trade -and -these -manifold -arts -were -mentioned -and -praised -in -detail -his -english -was -spoken -of -in -terms -of -warm -admiration -admiration -verging -upon -rapture -i -took -pleased -note -of -that -and -hoped -that -some -of -it -might -be -true -we -had -to -have -some -one -right -away -so -the -family -went -down -stairs -and -took -him -a -week -on -trial -then -sent -him -up -to -me -and -departed -on -their -affairs -i -was -shut -up -in -my -quarters -with -a -bronchial -cough -and -glad -to -have -something -fresh -to -look -at -something -new -to -play -with -manuel -filled -the -bill -manuel -was -very -welcome -he -was -toward -fifty -years -old -tall -slender -with -a -slight -stoop -an -artificial -stoop -a -deferential -stoop -a -stoop -rigidified -by -long -habit -with -face -of -european -mould -short -hair -intensely -black -gentle -black -eyes -timid -black -eyes -indeed -complexion -very -dark -nearly -black -in -fact -face -smooth -shaven -he -was -bareheaded -and -barefooted -and -was -never -otherwise -while -his -week -with -us -lasted -his -clothing -was -european -cheap -flimsy -and -showed -much -wear -he -stood -before -me -and -inclined -his -head -and -body -in -the -pathetic -indian -way -touching -his -forehead -with -the -finger -ends -of -his -right -hand -in -salute -i -said -manuel -you -are -evidently -indian -but -you -seem -to -have -a -spanish -name -when -you -put -it -all -together -how -is -that -a -perplexed -look -gathered -in -his -face -it -was -plain -that -he -had -not -understood -but -he -didn't -let -on -he -spoke -back -placidly -name -manuel -yes -master -i -know -but -how -did -you -get -the -name -oh -yes -i -suppose -think -happen -so -father -same -name -not -mother -i -saw -that -i -must -simplify -my -language -and -spread -my -words -apart -if -i -would -be -understood -by -this -english -scholar -well -then -how -did -your -father -get -his -name -oh -he -brightening -a -little -he -christian -portygee -live -in -goa -i -born -goa -mother -not -portygee -mother -native -high -caste -brahmin -coolin -brahmin -highest -caste -no -other -so -high -caste -i -high -caste -brahmin -too -christian -too -same -like -father -high -caste -christian -brahmin -master -salvation -army -all -this -haltingly -and -with -difficulty -then -he -had -an -inspiration -and -began -to -pour -out -a -flood -of -words -that -i -could -make -nothing -of -so -i -said -there -don't -do -that -i -can't -understand -hindostani -not -hindostani -master -english -always -i -speaking -english -sometimes -when -i -talking -every -day -all -the -time -at -you -very -well -stick -to -that -that -is -intelligible -it -is -not -up -to -my -hopes -it -is -not -up -to -the -promise -of -the -recommendations -still -it -is -english -and -i -understand -it -don't -elaborate -it -i -don't -like -elaborations -when -they -are -crippled -by -uncertainty -of -touch -master -oh -never -mind -it -was -only -a -random -thought -i -didn't -expect -you -to -understand -it -how -did -you -get -your -english -is -it -an -acquirement -or -just -a -gift -of -god -after -some -hesitation -piously -yes -he -very -good -christian -god -very -good -hindoo -god -very -good -too -two -million -hindoo -god -one -christian -god -make -two -million -and -one -all -mine -two -million -and -one -god -i -got -a -plenty -sometime -i -pray -all -time -at -those -keep -it -up -go -all -time -every -day -give -something -at -shrine -all -good -for -me -make -me -better -man -good -for -me -good -for -my -family -dam -good -then -he -had -another -inspiration -and -went -rambling -off -into -fervent -confusions -and -incoherencies -and -i -had -to -stop -him -again -i -thought -we -had -talked -enough -so -i -told -him -to -go -to -the -bathroom -and -clean -it -up -and -remove -the -slops -this -to -get -rid -of -him -he -went -away -seeming -to -understand -and -got -out -some -of -my -clothes -and -began -to -brush -them -i -repeated -my -desire -several -times -simplifying -and -re -simplifying -it -and -at -last -he -got -the -idea -then -he -went -away -and -put -a -coolie -at -the -work -and -explained -that -he -would -lose -caste -if -he -did -it -himself -it -would -be -pollution -by -the -law -of -his -caste -and -it -would -cost -him -a -deal -of -fuss -and -trouble -to -purify -himself -and -accomplish -his -rehabilitation -he -said -that -that -kind -of -work -was -strictly -forbidden -to -persons -of -caste -and -as -strictly -restricted -to -the -very -bottom -layer -of -hindoo -society -the -despised -'sudra' -the -toiler -the -laborer -he -was -right -and -apparently -the -poor -sudra -has -been -content -with -his -strange -lot -his -insulting -distinction -for -ages -and -ages -clear -back -to -the -beginning -of -things -so -to -speak -buckle -says -that -his -name -laborer -is -a -term -of -contempt -that -it -is -ordained -by -the -institutes -of -menu -900 -b -c -that -if -a -sudra -sit -on -a -level -with -his -superior -he -shall -be -exiled -or -branded -[without -going -into -particulars -i -will -remark -that -as -a -rule -they -wear -no -clothing -that -would -conceal -the -brand -m -t -] -if -he -speak -contemptuously -of -his -superior -or -insult -him -he -shall -suffer -death -if -he -listen -to -the -reading -of -the -sacred -books -he -shall -have -burning -oil -poured -in -his -ears -if -he -memorize -passages -from -them -he -shall -be -killed -if -he -marry -his -daughter -to -a -brahmin -the -husband -shall -go -to -hell -for -defiling -himself -by -contact -with -a -woman -so -infinitely -his -inferior -and -that -it -is -forbidden -to -a -sudra -to -acquire -wealth -the -bulk -of -the -population -of -india -says -bucklet -[population -to -day -300 -000 -000 -] -is -the -sudras -the -workers -the -farmers -the -creators -of -wealth -manuel -was -a -failure -poor -old -fellow -his -age -was -against -him -he -was -desperately -slow -and -phenomenally -forgetful -when -he -went -three -blocks -on -an -errand -he -would -be -gone -two -hours -and -then -forget -what -it -was -he -went -for -when -he -packed -a -trunk -it -took -him -forever -and -the -trunk's -contents -were -an -unimaginable -chaos -when -he -got -done -he -couldn't -wait -satisfactorily -at -table -a -prime -defect -for -if -you -haven't -your -own -servant -in -an -indian -hotel -you -are -likely -to -have -a -slow -time -of -it -and -go -away -hungry -we -couldn't -understand -his -english -he -couldn't -understand -ours -and -when -we -found -that -he -couldn't -understand -his -own -it -seemed -time -for -us -to -part -i -had -to -discharge -him -there -was -no -help -for -it -but -i -did -it -as -kindly -as -i -could -and -as -gently -we -must -part -said -i -but -i -hoped -we -should -meet -again -in -a -better -world -it -was -not -true -but -it -was -only -a -little -thing -to -say -and -saved -his -feelings -and -cost -me -nothing -but -now -that -he -was -gone -and -was -off -my -mind -and -heart -my -spirits -began -to -rise -at -once -and -i -was -soon -feeling -brisk -and -ready -to -go -out -and -have -adventures -then -his -newly -hired -successor -flitted -in -touched -his -forehead -and -began -to -fly -around -here -there -and -everywhere -on -his -velvet -feet -and -in -five -minutes -he -had -everything -in -the -room -ship -shape -and -bristol -fashion -as -the -sailors -say -and -was -standing -at -the -salute -waiting -for -orders -dear -me -what -a -rustler -he -was -after -the -slumbrous -way -of -manuel -poor -old -slug! -all -my -heart -all -my -affection -all -my -admiration -went -out -spontaneously -to -this -frisky -little -forked -black -thing -this -compact -and -compressed -incarnation -of -energy -and -force -and -promptness -and -celerity -and -confidence -this -smart -smily -engaging -shiney -eyed -little -devil -feruled -on -his -upper -end -by -a -gleaming -fire -coal -of -a -fez -with -a -red -hot -tassel -dangling -from -it -i -said -with -deep -satisfaction -you'll -suit -what -is -your -name -he -reeled -it -mellowly -off -let -me -see -if -i -can -make -a -selection -out -of -it -for -business -uses -i -mean -we -will -keep -the -rest -for -sundays -give -it -to -me -in -installments -he -did -it -but -there -did -not -seem -to -be -any -short -ones -except -mousawhich -suggested -mouse -it -was -out -of -character -it -was -too -soft -too -quiet -too -conservative -it -didn't -fit -his -splendid -style -i -considered -and -said -mousa -is -short -enough -but -i -don't -quite -like -it -it -seems -colorless -inharmonious -inadequate -and -i -am -sensitive -to -such -things -how -do -you -think -satan -would -do -yes -master -satan -do -wair -good -it -was -his -way -of -saying -very -good -there -was -a -rap -at -the -door -satan -covered -the -ground -with -a -single -skip -there -was -a -word -or -two -of -hindostani -then -he -disappeared -three -minutes -later -he -was -before -me -again -militarily -erect -and -waiting -for -me -to -speak -first -what -is -it -satan -god -want -to -see -you -who -god -i -show -him -up -master -why -this -is -so -unusual -that -that -well -you -see -indeed -i -am -so -unprepared -i -don't -quite -know -what -i -do -mean -dear -me -can't -you -explain -don't -you -see -that -this -is -a -most -ex -here -his -card -master -wasn't -it -curious -and -amazing -and -tremendous -and -all -that -such -a -personage -going -around -calling -on -such -as -i -and -sending -up -his -card -like -a -mortal -sending -it -up -by -satan -it -was -a -bewildering -collision -of -the -impossibles -but -this -was -the -land -of -the -arabian -nights -this -was -india! -and -what -is -it -that -cannot -happen -in -india -we -had -the -interview -satan -was -right -the -visitor -was -indeed -a -god -in -the -conviction -of -his -multitudinous -followers -and -was -worshiped -by -them -in -sincerity -and -humble -adoration -they -are -troubled -by -no -doubts -as -to -his -divine -origin -and -office -they -believe -in -him -they -pray -to -him -they -make -offerings -to -him -they -beg -of -him -remission -of -sins -to -them -his -person -together -with -everything -connected -with -it -is -sacred -from -his -barber -they -buy -the -parings -of -his -nails -and -set -them -in -gold -and -wear -them -as -precious -amulets -i -tried -to -seem -tranquilly -conversational -and -at -rest -but -i -was -not -would -you -have -been -i -was -in -a -suppressed -frenzy -of -excitement -and -curiosity -and -glad -wonder -i -could -not -keep -my -eyes -off -him -i -was -looking -upon -a -god -an -actual -god -a -recognized -and -accepted -god -and -every -detail -of -his -person -and -his -dress -had -a -consuming -interest -for -me -and -the -thought -went -floating -through -my -head -he -is -worshiped -think -of -it -he -is -not -a -recipient -of -the -pale -homage -called -compliment -wherewith -the -highest -human -clay -must -make -shift -to -be -satisfied -but -of -an -infinitely -richer -spiritual -food -adoration -worship! -men -and -women -lay -their -cares -and -their -griefs -and -their -broken -hearts -at -his -feet -and -he -gives -them -his -peace -and -they -go -away -healed -and -just -then -the -awful -visitor -said -in -the -simplest -way -there -is -a -feature -of -the -philosophy -of -huck -finn -which -and -went -luminously -on -with -the -construction -of -a -compact -and -nicely -discriminated -literary -verdict -it -is -a -land -of -surprises -india! -i -had -had -my -ambitions -i -had -hoped -and -almost -expected -to -be -read -by -kings -and -presidents -and -emperors -but -i -had -never -looked -so -high -as -that -it -would -be -false -modesty -to -pretend -that -i -was -not -inordinately -pleased -i -was -i -was -much -more -pleased -than -i -should -have -been -with -a -compliment -from -a -man -he -remained -half -an -hour -and -i -found -him -a -most -courteous -and -charming -gentleman -the -godship -has -been -in -his -family -a -good -while -but -i -do -not -know -how -long -he -is -a -mohammedan -deity -by -earthly -rank -he -is -a -prince -not -an -indian -but -a -persian -prince -he -is -a -direct -descendant -of -the -prophet's -line -he -is -comely -also -young -for -a -god -not -forty -perhaps -not -above -thirty -five -years -old -he -wears -his -immense -honors -with -tranquil -brace -and -with -a -dignity -proper -to -his -awful -calling -he -speaks -english -with -the -ease -and -purity -of -a -person -born -to -it -i -think -i -am -not -overstating -this -he -was -the -only -god -i -had -ever -seen -and -i -was -very -favorably -impressed -when -he -rose -to -say -good -bye -the -door -swung -open -and -i -caught -the -flash -of -a -red -fez -and -heard -these -words -reverently -said -satan -see -god -out -yes -and -these -mis -mated -beings -passed -from -view -satan -in -the -lead -and -the -other -following -after -chapter -xl -few -of -us -can -stand -prosperity -another -man's -i -mean -pudd'nhead -wilson's -new -calendar -the -next -picture -in -my -mind -is -government -house -on -malabar -point -with -the -wide -sea -view -from -the -windows -and -broad -balconies -abode -of -his -excellency -the -governor -of -the -bombay -presidency -a -residence -which -is -european -in -everything -but -the -native -guards -and -servants -and -is -a -home -and -a -palace -of -state -harmoniously -combined -that -was -england -the -english -power -the -english -civilization -the -modern -civilization -with -the -quiet -elegancies -and -quiet -colors -and -quiet -tastes -and -quiet -dignity -that -are -the -outcome -of -the -modern -cultivation -and -following -it -came -a -picture -of -the -ancient -civilization -of -india -an -hour -in -the -mansion -of -a -native -prince -kumar -schri -samatsinhji -bahadur -of -the -palitana -state -the -young -lad -his -heir -was -with -the -prince -also -the -lad's -sister -a -wee -brown -sprite -very -pretty -very -serious -very -winning -delicately -moulded -costumed -like -the -daintiest -butterfly -a -dear -little -fairyland -princess -gravely -willing -to -be -friendly -with -the -strangers -but -in -the -beginning -preferring -to -hold -her -father's -hand -until -she -could -take -stock -of -them -and -determine -how -far -they -were -to -be -trusted -she -must -have -been -eight -years -old -so -in -the -natural -indian -order -of -things -she -would -be -a -bride -in -three -or -four -years -from -now -and -then -this -free -contact -with -the -sun -and -the -air -and -the -other -belongings -of -out -door -nature -and -comradeship -with -visiting -male -folk -would -end -and -she -would -shut -herself -up -in -the -zenana -for -life -like -her -mother -and -by -inherited -habit -of -mind -would -be -happy -in -that -seclusion -and -not -look -upon -it -as -an -irksome -restraint -and -a -weary -captivity -the -game -which -the -prince -amuses -his -leisure -with -however -never -mind -it -i -should -never -be -able -to -describe -it -intelligibly -i -tried -to -get -an -idea -of -it -while -my -wife -and -daughter -visited -the -princess -in -the -zenana -a -lady -of -charming -graces -and -a -fluent -speaker -of -english -but -i -did -not -make -it -out -it -is -a -complicated -game -and -i -believe -it -is -said -that -nobody -can -learn -to -play -it -well -but -an -indian -and -i -was -not -able -to -learn -how -to -wind -a -turban -it -seemed -a -simple -art -and -easy -but -that -was -a -deception -it -is -a -piece -of -thin -delicate -stuff -a -foot -wide -or -more -and -forty -or -fifty -feet -long -and -the -exhibitor -of -the -art -takes -one -end -of -it -in -his -hands -and -winds -it -in -and -out -intricately -about -his -head -twisting -it -as -he -goes -and -in -a -minute -or -two -the -thing -is -finished -and -is -neat -and -symmetrical -and -fits -as -snugly -as -a -mould -we -were -interested -in -the -wardrobe -and -the -jewels -and -in -the -silverware -and -its -grace -of -shape -and -beauty -and -delicacy -of -ornamentation -the -silverware -is -kept -locked -up -except -at -meal -times -and -none -but -the -chief -butler -and -the -prince -have -keys -to -the -safe -i -did -not -clearly -understand -why -but -it -was -not -for -the -protection -of -the -silver -it -was -either -to -protect -the -prince -from -the -contamination -which -his -caste -would -suffer -if -the -vessels -were -touched -by -low -caste -hands -or -it -was -to -protect -his -highness -from -poison -possibly -it -was -both -i -believe -a -salaried -taster -has -to -taste -everything -before -the -prince -ventures -it -an -ancient -and -judicious -custom -in -the -east -and -has -thinned -out -the -tasters -a -good -deal -for -of -course -it -is -the -cook -that -puts -the -poison -in -if -i -were -an -indian -prince -i -would -not -go -to -the -expense -of -a -taster -i -would -eat -with -the -cook -ceremonials -are -always -interesting -and -i -noted -that -the -indian -good -morning -is -a -ceremonial -whereas -ours -doesn't -amount -to -that -in -salutation -the -son -reverently -touches -the -father's -forehead -with -a -small -silver -implement -tipped -with -vermillion -paste -which -leaves -a -red -spot -there -and -in -return -the -son -receives -the -father's -blessing -our -good -morning -is -well -enough -for -the -rowdy -west -perhaps -but -would -be -too -brusque -for -the -soft -and -ceremonious -east -after -being -properly -necklaced -according -to -custom -with -great -garlands -made -of -yellow -flowers -and -provided -with -betel -nut -to -chew -this -pleasant -visit -closed -and -we -passed -thence -to -a -scene -of -a -different -sort -from -this -glow -of -color -and -this -sunny -life -to -those -grim -receptacles -of -the -parsee -dead -the -towers -of -silence -there -is -something -stately -about -that -name -and -an -impressiveness -which -sinks -deep -the -hush -of -death -is -in -it -we -have -the -grave -the -tomb -the -mausoleum -god's -acre -the -cemetery -and -association -has -made -them -eloquent -with -solemn -meaning -but -we -have -no -name -that -is -so -majestic -as -that -one -or -lingers -upon -the -ear -with -such -deep -and -haunting -pathos -on -lofty -ground -in -the -midst -of -a -paradise -of -tropical -foliage -and -flowers -remote -from -the -world -and -its -turmoil -and -noise -they -stood -the -towers -of -silence -and -away -below -was -spread -the -wide -groves -of -cocoa -palms -then -the -city -mile -on -mile -then -the -ocean -with -its -fleets -of -creeping -ships -all -steeped -in -a -stillness -as -deep -as -the -hush -that -hallowed -this -high -place -of -the -dead -the -vultures -were -there -they -stood -close -together -in -a -great -circle -all -around -the -rim -of -a -massive -low -tower -waiting -stood -as -motionless -as -sculptured -ornaments -and -indeed -almost -deceived -one -into -the -belief -that -that -was -what -they -were -presently -there -was -a -slight -stir -among -the -score -of -persons -present -and -all -moved -reverently -out -of -the -path -and -ceased -from -talking -a -funeral -procession -entered -the -great -gate -marching -two -and -two -and -moved -silently -by -toward -the -tower -the -corpse -lay -in -a -shallow -shell -and -was -under -cover -of -a -white -cloth -but -was -otherwise -naked -the -bearers -of -the -body -were -separated -by -an -interval -of -thirty -feet -from -the -mourners -they -and -also -the -mourners -were -draped -all -in -pure -white -and -each -couple -of -mourners -was -figuratively -bound -together -by -a -piece -of -white -rope -or -a -handkerchief -though -they -merely -held -the -ends -of -it -in -their -hands -behind -the -procession -followed -a -dog -which -was -led -in -a -leash -when -the -mourners -had -reached -the -neighborhood -of -the -tower -neither -they -nor -any -other -human -being -but -the -bearers -of -the -dead -must -approach -within -thirty -feet -of -it -they -turned -and -went -back -to -one -of -the -prayer -houses -within -the -gates -to -pray -for -the -spirit -of -their -dead -the -bearers -unlocked -the -tower's -sole -door -and -disappeared -from -view -within -in -a -little -while -they -came -out -bringing -the -bier -and -the -white -covering -cloth -and -locked -the -door -again -then -the -ring -of -vultures -rose -flapping -their -wings -and -swooped -down -into -the -tower -to -devour -the -body -nothing -was -left -of -it -but -a -clean -picked -skeleton -when -they -flocked -out -again -a -few -minutes -afterward -the -principle -which -underlies -and -orders -everything -connected -with -a -parsee -funeral -is -purity -by -the -tenets -of -the -zoroastrian -religion -the -elements -earth -fire -and -water -are -sacred -and -must -not -be -contaminated -by -contact -with -a -dead -body -hence -corpses -must -not -be -burned -neither -must -they -be -buried -none -may -touch -the -dead -or -enter -the -towers -where -they -repose -except -certain -men -who -are -officially -appointed -for -that -purpose -they -receive -high -pay -but -theirs -is -a -dismal -life -for -they -must -live -apart -from -their -species -because -their -commerce -with -the -dead -defiles -them -and -any -who -should -associate -with -them -would -share -their -defilement -when -they -come -out -of -the -tower -the -clothes -they -are -wearing -are -exchanged -for -others -in -a -building -within -the -grounds -and -the -ones -which -they -have -taken -off -are -left -behind -for -they -are -contaminated -and -must -never -be -used -again -or -suffered -to -go -outside -the -grounds -these -bearers -come -to -every -funeral -in -new -garments -so -far -as -is -known -no -human -being -other -than -an -official -corpse -bearer -save -one -has -ever -entered -a -tower -of -silence -after -its -consecration -just -a -hundred -years -ago -a -european -rushed -in -behind -the -bearers -and -fed -his -brutal -curiosity -with -a -glimpse -of -the -forbidden -mysteries -of -the -place -this -shabby -savage's -name -is -not -given -his -quality -is -also -concealed -these -two -details -taken -in -connection -with -the -fact -that -for -his -extraordinary -offense -the -only -punishment -he -got -from -the -east -india -company's -government -was -a -solemn -official -reprimand -suggest -the -suspicion -that -he -was -a -european -of -consequence -the -same -public -document -which -contained -the -reprimand -gave -warning -that -future -offenders -of -his -sort -if -in -the -company's -service -would -be -dismissed -and -if -merchants -suffer -revocation -of -license -and -exile -to -england -the -towers -are -not -tall -but -are -low -in -proportion -to -their -circumference -like -a -gasometer -if -you -should -fill -a -gasometer -half -way -up -with -solid -granite -masonry -then -drive -a -wide -and -deep -well -down -through -the -center -of -this -mass -of -masonry -you -would -have -the -idea -of -a -tower -of -silence -on -the -masonry -surrounding -the -well -the -bodies -lie -in -shallow -trenches -which -radiate -like -wheel -spokes -from -the -well -the -trenches -slant -toward -the -well -and -carry -into -it -the -rainfall -underground -drains -with -charcoal -filters -in -them -carry -off -this -water -from -the -bottom -of -the -well -when -a -skeleton -has -lain -in -the -tower -exposed -to -the -rain -and -the -flaming -sun -a -month -it -is -perfectly -dry -and -clean -then -the -same -bearers -that -brought -it -there -come -gloved -and -take -it -up -with -tongs -and -throw -it -into -the -well -there -it -turns -to -dust -it -is -never -seen -again -never -touched -again -in -the -world -other -peoples -separate -their -dead -and -preserve -and -continue -social -distinctions -in -the -grave -the -skeletons -of -kings -and -statesmen -and -generals -in -temples -and -pantheons -proper -to -skeletons -of -their -degree -and -the -skeletons -of -the -commonplace -and -the -poor -in -places -suited -to -their -meaner -estate -but -the -parsees -hold -that -all -men -rank -alike -in -death -all -are -humble -all -poor -all -destitute -in -sign -of -their -poverty -they -are -sent -to -their -grave -naked -in -sign -of -their -equality -the -bones -of -the -rich -the -poor -the -illustrious -and -the -obscure -are -flung -into -the -common -well -together -at -a -parsee -funeral -there -are -no -vehicles -all -concerned -must -walk -both -rich -and -poor -howsoever -great -the -distance -to -be -traversed -may -be -in -the -wells -of -the -five -towers -of -silence -is -mingled -the -dust -of -all -the -parsee -men -and -women -and -children -who -have -died -in -bombay -and -its -vicinity -during -the -two -centuries -which -have -elapsed -since -the -mohammedan -conquerors -drove -the -parsees -out -of -persia -and -into -that -region -of -india -the -earliest -of -the -five -towers -was -built -by -the -modi -family -something -more -than -200 -years -ago -and -it -is -now -reserved -to -the -heirs -of -that -house -none -but -the -dead -of -that -blood -are -carried -thither -the -origin -of -at -least -one -of -the -details -of -a -parsee -funeral -is -not -now -known -the -presence -of -the -dog -before -a -corpse -is -borne -from -the -house -of -mourning -it -must -be -uncovered -and -exposed -to -the -gaze -of -a -dog -a -dog -must -also -be -led -in -the -rear -of -the -funeral -mr -nusserwanjee -byranijee -secretary -to -the -parsee -punchayet -said -that -these -formalities -had -once -had -a -meaning -and -a -reason -for -their -institution -but -that -they -were -survivals -whose -origin -none -could -now -account -for -custom -and -tradition -continue -them -in -force -antiquity -hallows -them -it -is -thought -that -in -ancient -times -in -persia -the -dog -was -a -sacred -animal -and -could -guide -souls -to -heaven -also -that -his -eye -had -the -power -of -purifying -objects -which -had -been -contaminated -by -the -touch -of -the -dead -and -that -hence -his -presence -with -the -funeral -cortege -provides -an -ever -applicable -remedy -in -case -of -need -the -parsees -claim -that -their -method -of -disposing -of -the -dead -is -an -effective -protection -of -the -living -that -it -disseminates -no -corruption -no -impurities -of -any -sort -no -disease -germs -that -no -wrap -no -garment -which -has -touched -the -dead -is -allowed -to -touch -the -living -afterward -that -from -the -towers -of -silence -nothing -proceeds -which -can -carry -harm -to -the -outside -world -these -are -just -claims -i -think -as -a -sanitary -measure -their -system -seems -to -be -about -the -equivalent -of -cremation -and -as -sure -we -are -drifting -slowly -but -hopefully -toward -cremation -in -these -days -it -could -not -be -expected -that -this -progress -should -be -swift -but -if -it -be -steady -and -continuous -even -if -slow -that -will -suffice -when -cremation -becomes -the -rule -we -shall -cease -to -shudder -at -it -we -should -shudder -at -burial -if -we -allowed -ourselves -to -think -what -goes -on -in -the -grave -the -dog -was -an -impressive -figure -to -me -representing -as -he -did -a -mystery -whose -key -is -lost -he -was -humble -and -apparently -depressed -and -he -let -his -head -droop -pensively -and -looked -as -if -he -might -be -trying -to -call -back -to -his -mind -what -it -was -that -he -had -used -to -symbolize -ages -ago -when -he -began -his -function -there -was -another -impressive -thing -close -at -hand -but -i -was -not -privileged -to -see -it -that -was -the -sacred -fire -a -fire -which -is -supposed -to -have -been -burning -without -interruption -for -more -than -two -centuries -and -so -living -by -the -same -heat -that -was -imparted -to -it -so -long -ago -the -parsees -are -a -remarkable -community -there -are -only -about -60 -000 -in -bombay -and -only -about -half -as -many -as -that -in -the -rest -of -india -but -they -make -up -in -importance -what -they -lack -in -numbers -they -are -highly -educated -energetic -enterprising -progressive -rich -and -the -jew -himself -is -not -more -lavish -or -catholic -in -his -charities -and -benevolences -the -parsees -build -and -endow -hospitals -for -both -men -and -animals -and -they -and -their -womenkind -keep -an -open -purse -for -all -great -and -good -objects -they -are -a -political -force -and -a -valued -support -to -the -government -they -have -a -pure -and -lofty -religion -and -they -preserve -it -in -its -integrity -and -order -their -lives -by -it -we -took -a -final -sweep -of -the -wonderful -view -of -plain -and -city -and -ocean -and -so -ended -our -visit -to -the -garden -and -the -towers -of -silence -and -the -last -thing -i -noticed -was -another -symbol -a -voluntary -symbol -this -one -it -was -a -vulture -standing -on -the -sawed -off -top -of -a -tall -and -slender -and -branchless -palm -in -an -open -space -in -the -ground -he -was -perfectly -motionless -and -looked -like -a -piece -of -sculpture -on -a -pillar -and -he -had -a -mortuary -look -too -which -was -in -keeping -with -the -place -chapter -xli -there -is -an -old -time -toast -which -is -golden -for -its -beauty -when -you -ascend -the -hill -of -prosperity -may -you -not -meet -a -friend -pudd'nhead -wilson's -new -calendar -the -next -picture -that -drifts -across -the -field -of -my -memory -is -one -which -is -connected -with -religious -things -we -were -taken -by -friends -to -see -a -jain -temple -it -was -small -and -had -many -flags -or -streamers -flying -from -poles -standing -above -its -roof -and -its -little -battlements -supported -a -great -many -small -idols -or -images -upstairs -inside -a -solitary -jain -was -praying -or -reciting -aloud -in -the -middle -of -the -room -our -presence -did -not -interrupt -him -nor -even -incommode -him -or -modify -his -fervor -ten -or -twelve -feet -in -front -of -him -was -the -idol -a -small -figure -in -a -sitting -posture -it -had -the -pinkish -look -of -a -wax -doll -but -lacked -the -doll's -roundness -of -limb -and -approximation -to -correctness -of -form -and -justness -of -proportion -mr -gandhi -explained -every -thing -to -us -he -was -delegate -to -the -chicago -fair -congress -of -religions -it -was -lucidly -done -in -masterly -english -but -in -time -it -faded -from -me -and -now -i -have -nothing -left -of -that -episode -but -an -impression -a -dim -idea -of -a -religious -belief -clothed -in -subtle -intellectual -forms -lofty -and -clean -barren -of -fleshly -grossnesses -and -with -this -another -dim -impression -which -connects -that -intellectual -system -somehow -with -that -crude -image -that -inadequate -idol -how -i -do -not -know -properly -they -do -not -seem -to -belong -together -apparently -the -idol -symbolized -a -person -who -had -become -a -saint -or -a -god -through -accessions -of -steadily -augmenting -holiness -acquired -through -a -series -of -reincarnations -and -promotions -extending -over -many -ages -and -was -now -at -last -a -saint -and -qualified -to -vicariously -receive -worship -and -transmit -it -to -heaven's -chancellery -was -that -it -and -thence -we -went -to -mr -premchand -roychand's -bungalow -in -lovelane -byculla -where -an -indian -prince -was -to -receive -a -deputation -of -the -jain -community -who -desired -to -congratulate -him -upon -a -high -honor -lately -conferred -upon -him -by -his -sovereign -victoria -empress -of -india -she -had -made -him -a -knight -of -the -order -of -the -star -of -india -it -would -seem -that -even -the -grandest -indian -prince -is -glad -to -add -the -modest -title -sir -to -his -ancient -native -grandeurs -and -is -willing -to -do -valuable -service -to -win -it -he -will -remit -taxes -liberally -and -will -spend -money -freely -upon -the -betterment -of -the -condition -of -his -subjects -if -there -is -a -knighthood -to -be -gotten -by -it -and -he -will -also -do -good -work -and -a -deal -of -it -to -get -a -gun -added -to -the -salute -allowed -him -by -the -british -government -every -year -the -empress -distributes -knighthoods -and -adds -guns -for -public -services -done -by -native -princes -the -salute -of -a -small -prince -is -three -or -four -guns -princes -of -greater -consequence -have -salutes -that -run -higher -and -higher -gun -by -gun -oh -clear -away -up -to -eleven -possibly -more -but -i -did -not -hear -of -any -above -eleven -gun -princes -i -was -told -that -when -a -four -gun -prince -gets -a -gun -added -he -is -pretty -troublesome -for -a -while -till -the -novelty -wears -off -for -he -likes -the -music -and -keeps -hunting -up -pretexts -to -get -himself -saluted -it -may -be -that -supremely -grand -folk -like -the -nyzam -of -hyderabad -and -the -gaikwar -of -baroda -have -more -than -eleven -guns -but -i -don't -know -when -we -arrived -at -the -bungalow -the -large -hall -on -the -ground -floor -was -already -about -full -and -carriages -were -still -flowing -into -the -grounds -the -company -present -made -a -fine -show -an -exhibition -of -human -fireworks -so -to -speak -in -the -matters -of -costume -and -comminglings -of -brilliant -color -the -variety -of -form -noticeable -in -the -display -of -turbans -was -remarkable -we -were -told -that -the -explanation -of -this -was -that -this -jain -delegation -was -drawn -from -many -parts -of -india -and -that -each -man -wore -the -turban -that -was -in -vogue -in -his -own -region -this -diversity -of -turbans -made -a -beautiful -effect -i -could -have -wished -to -start -a -rival -exhibition -there -of -christian -hats -and -clothes -i -would -have -cleared -one -side -of -the -room -of -its -indian -splendors -and -repacked -the -space -with -christians -drawn -from -america -england -and -the -colonies -dressed -in -the -hats -and -habits -of -now -and -of -twenty -and -forty -and -fifty -years -ago -it -would -have -been -a -hideous -exhibition -a -thoroughly -devilish -spectacle -then -there -would -have -been -the -added -disadvantage -of -the -white -complexion -it -is -not -an -unbearably -unpleasant -complexion -when -it -keeps -to -itself -but -when -it -comes -into -competition -with -masses -of -brown -and -black -the -fact -is -betrayed -that -it -is -endurable -only -because -we -are -used -to -it -nearly -all -black -and -brown -skins -are -beautiful -but -a -beautiful -white -skin -is -rare -how -rare -one -may -learn -by -walking -down -a -street -in -paris -new -york -or -london -on -a -week -day -particularly -an -unfashionable -street -and -keeping -count -of -the -satisfactory -complexions -encountered -in -the -course -of -a -mile -where -dark -complexions -are -massed -they -make -the -whites -look -bleached -out -unwholesome -and -sometimes -frankly -ghastly -i -could -notice -this -as -a -boy -down -south -in -the -slavery -days -before -the -war -the -splendid -black -satin -skin -of -the -south -african -zulus -of -durban -seemed -to -me -to -come -very -close -to -perfection -i -can -see -those -zulus -yet -'ricksha -athletes -waiting -in -front -of -the -hotel -for -custom -handsome -and -intensely -black -creatures -moderately -clothed -in -loose -summer -stuffs -whose -snowy -whiteness -made -the -black -all -the -blacker -by -contrast -keeping -that -group -in -my -mind -i -can -compare -those -complexions -with -the -white -ones -which -are -streaming -past -this -london -window -now -a -lady -complexion -new -parchment -another -lady -complexion -old -parchment -another -pink -and -white -very -fine -man -grayish -skin -with -purple -areas -man -unwholesome -fish -belly -skin -girl -sallow -face -sprinkled -with -freckles -old -woman -face -whitey -gray -young -butcher -face -a -general -red -flush -jaundiced -man -mustard -yellow -elderly -lady -colorless -skin -with -two -conspicuous -moles -elderly -man -a -drinker -boiled -cauliflower -nose -in -a -flabby -face -veined -with -purple -crinklings -healthy -young -gentleman -fine -fresh -complexion -sick -young -man -his -face -a -ghastly -white -no -end -of -people -whose -skins -are -dull -and -characterless -modifications -of -the -tint -which -we -miscall -white -some -of -these -faces -are -pimply -some -exhibit -other -signs -of -diseased -blood -some -show -scars -of -a -tint -out -of -a -harmony -with -the -surrounding -shades -of -color -the -white -man's -complexion -makes -no -concealments -it -can't -it -seemed -to -have -been -designed -as -a -catch -all -for -everything -that -can -damage -it -ladies -have -to -paint -it -and -powder -it -and -cosmetic -it -and -diet -it -with -arsenic -and -enamel -it -and -be -always -enticing -it -and -persuading -it -and -pestering -it -and -fussing -at -it -to -make -it -beautiful -and -they -do -not -succeed -but -these -efforts -show -what -they -think -of -the -natural -complexion -as -distributed -as -distributed -it -needs -these -helps -the -complexion -which -they -try -to -counterfeit -is -one -which -nature -restricts -to -the -few -to -the -very -few -to -ninety -nine -persons -she -gives -a -bad -complexion -to -the -hundredth -a -good -one -the -hundredth -can -keep -it -how -long -ten -years -perhaps -the -advantage -is -with -the -zulu -i -think -he -starts -with -a -beautiful -complexion -and -it -will -last -him -through -and -as -for -the -indian -brown -firm -smooth -blemishless -pleasant -and -restful -to -the -eye -afraid -of -no -color -harmonizing -with -all -colors -and -adding -a -grace -to -them -all -i -think -there -is -no -sort -of -chance -for -the -average -white -complexion -against -that -rich -and -perfect -tint -to -return -to -the -bungalow -the -most -gorgeous -costume -present -were -worn -by -some -children -they -seemed -to -blaze -so -bright -were -the -colors -and -so -brilliant -the -jewels -strum -over -the -rich -materials -these -children -were -professional -nautch -dancers -and -looked -like -girls -but -they -were -boys -they -got -up -by -ones -and -twos -and -fours -and -danced -and -sang -to -an -accompaniment -of -weird -music -their -posturings -and -gesturings -were -elaborate -and -graceful -but -their -voices -were -stringently -raspy -and -unpleasant -and -there -was -a -good -deal -of -monotony -about -the -tune -by -and -by -there -was -a -burst -of -shouts -and -cheers -outside -and -the -prince -with -his -train -entered -in -fine -dramatic -style -he -was -a -stately -man -he -was -ideally -costumed -and -fairly -festooned -with -ropes -of -gems -some -of -the -ropes -were -of -pearls -some -were -of -uncut -great -emeralds -emeralds -renowned -in -bombay -for -their -quality -and -value -their -size -was -marvelous -and -enticing -to -the -eye -those -rocks -a -boy -a -princeling -was -with -the -prince -and -he -also -was -a -radiant -exhibition -the -ceremonies -were -not -tedious -the -prince -strode -to -his -throne -with -the -port -and -majesty -and -the -sternness -of -a -julius -caesar -coming -to -receive -and -receipt -for -a -back -country -kingdom -and -have -it -over -and -get -out -and -no -fooling -there -was -a -throne -for -the -young -prince -too -and -the -two -sat -there -side -by -side -with -their -officers -grouped -at -either -hand -and -most -accurately -and -creditably -reproducing -the -pictures -which -one -sees -in -the -books -pictures -which -people -in -the -prince's -line -of -business -have -been -furnishing -ever -since -solomon -received -the -queen -of -sheba -and -showed -her -his -things -the -chief -of -the -jain -delegation -read -his -paper -of -congratulations -then -pushed -it -into -a -beautifully -engraved -silver -cylinder -which -was -delivered -with -ceremony -into -the -prince's -hands -and -at -once -delivered -by -him -without -ceremony -into -the -hands -of -an -officer -i -will -copy -the -address -here -it -is -interesting -as -showing -what -an -indian -prince's -subject -may -have -opportunity -to -thank -him -for -in -these -days -of -modern -english -rule -as -contrasted -with -what -his -ancestor -would -have -given -them -opportunity -to -thank -him -for -a -century -and -a -half -ago -the -days -of -freedom -unhampered -by -english -interference -a -century -and -a -half -ago -an -address -of -thanks -could -have -been -put -into -small -space -it -would -have -thanked -the -prince -1 -for -not -slaughtering -too -many -of -his -people -upon -mere -caprice -2 -for -not -stripping -them -bare -by -sudden -and -arbitrary -tax -levies -and -bringing -famine -upon -them -3 -for -not -upon -empty -pretext -destroying -the -rich -and -seizing -their -property -4 -for -not -killing -blinding -imprisoning -or -banishing -the -relatives -of -the -royal -house -to -protect -the -throne -from -possible -plots -5 -for -not -betraying -the -subject -secretly -for -a -bribe -into -the -hands -of -bands -of -professional -thugs -to -be -murdered -and -robbed -in -the -prince's -back -lot -those -were -rather -common -princely -industries -in -the -old -times -but -they -and -some -others -of -a -harsh -sort -ceased -long -ago -under -english -rule -better -industries -have -taken -their -place -as -this -address -from -the -jain -community -will -show -your -highness -we -the -undersigned -members -of -the -jain -community -of -bombay -have -the -pleasure -to -approach -your -highness -with -the -expression -of -our -heartfelt -congratulations -on -the -recent -conference -on -your -highness -of -the -knighthood -of -the -most -exalted -order -of -the -star -of -india -ten -years -ago -we -had -the -pleasure -and -privilege -of -welcoming -your -highness -to -this -city -under -circumstances -which -have -made -a -memorable -epoch -in -the -history -of -your -state -for -had -it -not -been -for -a -generous -and -reasonable -spirit -that -your -highness -displayed -in -the -negotiations -between -the -palitana -durbar -and -the -jain -community -the -conciliatory -spirit -that -animated -our -people -could -not -have -borne -fruit -that -was -the -first -step -in -your -highness's -administration -and -it -fitly -elicited -the -praise -of -the -jain -community -and -of -the -bombay -government -a -decade -of -your -highness's -administration -combined -with -the -abilities -training -and -acquirements -that -your -highness -brought -to -bear -upon -it -has -justly -earned -for -your -highness -the -unique -and -honourable -distinction -the -knighthood -of -the -most -exalted -order -of -the -star -of -india -which -we -understand -your -highness -is -the -first -to -enjoy -among -chiefs -of -your -highness's -rank -and -standing -and -we -assure -your -highness -that -for -this -mark -of -honour -that -has -been -conferred -on -you -by -her -most -gracious -majesty -the -queen -empress -we -feel -no -less -proud -than -your -highness -establishment -of -commercial -factories -schools -hospitals -etc -by -your -highness -in -your -state -has -marked -your -highness's -career -during -these -ten -years -and -we -trust -that -your -highness -will -be -spared -to -rule -over -your -people -with -wisdom -and -foresight -and -foster -the -many -reforms -that -your -highness -has -been -pleased -to -introduce -in -your -state -we -again -offer -your -highness -our -warmest -felicitations -for -the -honour -that -has -been -conferred -on -you -we -beg -to -remain -your -highness's -obedient -servants -factories -schools -hospitals -reforms -the -prince -propagates -that -kind -of -things -in -the -modern -times -and -gets -knighthood -and -guns -for -it -after -the -address -the -prince -responded -with -snap -and -brevity -spoke -a -moment -with -half -a -dozen -guests -in -english -and -with -an -official -or -two -in -a -native -tongue -then -the -garlands -were -distributed -as -usual -and -the -function -ended -chapter -xlii -each -person -is -born -to -one -possession -which -outvalues -all -his -others -his -last -breath -pudd'nhead -wilson's -new -calendar -toward -midnight -that -night -there -was -another -function -this -was -a -hindoo -wedding -no -i -think -it -was -a -betrothal -ceremony -always -before -we -had -driven -through -streets -that -were -multitudinous -and -tumultuous -with -picturesque -native -life -but -now -there -was -nothing -of -that -we -seemed -to -move -through -a -city -of -the -dead -there -was -hardly -a -suggestion -of -life -in -those -still -and -vacant -streets -even -the -crows -were -silent -but -everywhere -on -the -ground -lay -sleeping -natives -hundreds -and -hundreds -they -lay -stretched -at -full -length -and -tightly -wrapped -in -blankets -beads -and -all -their -attitude -and -their -rigidity -counterfeited -death -the -plague -was -not -in -bombay -then -but -it -is -devastating -the -city -now -the -shops -are -deserted -now -half -of -the -people -have -fled -and -of -the -remainder -the -smitten -perish -by -shoals -every -day -no -doubt -the -city -looks -now -in -the -daytime -as -it -looked -then -at -night -when -we -had -pierced -deep -into -the -native -quarter -and -were -threading -its -narrow -dim -lanes -we -had -to -go -carefully -for -men -were -stretched -asleep -all -about -and -there -was -hardly -room -to -drive -between -them -and -every -now -and -then -a -swarm -of -rats -would -scamper -across -past -the -horses' -feet -in -the -vague -light -the -forbears -of -the -rats -that -are -carrying -the -plague -from -house -to -house -in -bombay -now -the -shops -were -but -sheds -little -booths -open -to -the -street -and -the -goods -had -been -removed -and -on -the -counters -families -were -sleeping -usually -with -an -oil -lamp -present -recurrent -dead -watches -it -looked -like -but -at -last -we -turned -a -corner -and -saw -a -great -glare -of -light -ahead -it -was -the -home -of -the -bride -wrapped -in -a -perfect -conflagration -of -illuminations -mainly -gas -work -designs -gotten -up -specially -for -the -occasion -within -was -abundance -of -brilliancy -flames -costumes -colors -decorations -mirrors -it -was -another -aladdin -show -the -bride -was -a -trim -and -comely -little -thing -of -twelve -years -dressed -as -we -would -dress -a -boy -though -more -expensively -than -we -should -do -it -of -course -she -moved -about -very -much -at -her -ease -and -stopped -and -talked -with -the -guests -and -allowed -her -wedding -jewelry -to -be -examined -it -was -very -fine -particularly -a -rope -of -great -diamonds -a -lovely -thing -to -look -at -and -handle -it -had -a -great -emerald -hanging -to -it -the -bridegroom -was -not -present -he -was -having -betrothal -festivities -of -his -own -at -his -father's -house -as -i -understood -it -he -and -the -bride -were -to -entertain -company -every -night -and -nearly -all -night -for -a -week -or -more -then -get -married -if -alive -both -of -the -children -were -a -little -elderly -as -brides -and -grooms -go -in -india -twelve -they -ought -to -have -been -married -a -year -or -two -sooner -still -to -a -stranger -twelve -seems -quite -young -enough -a -while -after -midnight -a -couple -of -celebrated -and -high -priced -nautch -girls -appeared -in -the -gorgeous -place -and -danced -and -sang -with -them -were -men -who -played -upon -strange -instruments -which -made -uncanny -noises -of -a -sort -to -make -one's -flesh -creep -one -of -these -instruments -was -a -pipe -and -to -its -music -the -girls -went -through -a -performance -which -represented -snake -charming -it -seemed -a -doubtful -sort -of -music -to -charm -anything -with -but -a -native -gentleman -assured -me -that -snakes -like -it -and -will -come -out -of -their -holes -and -listen -to -it -with -every -evidence -of -refreshment -and -gratitude -he -said -that -at -an -entertainment -in -his -grounds -once -the -pipe -brought -out -half -a -dozen -snakes -and -the -music -had -to -be -stopped -before -they -would -be -persuaded -to -go -nobody -wanted -their -company -for -they -were -bold -familiar -and -dangerous -but -no -one -would -kill -them -of -course -for -it -is -sinful -for -a -hindoo -to -kill -any -kind -of -a -creature -we -withdrew -from -the -festivities -at -two -in -the -morning -another -picture -then -but -it -has -lodged -itself -in -my -memory -rather -as -a -stage -scene -than -as -a -reality -it -is -of -a -porch -and -short -flight -of -steps -crowded -with -dark -faces -and -ghostly -white -draperies -flooded -with -the -strong -glare -from -the -dazzling -concentration -of -illuminations -and -midway -of -the -steps -one -conspicuous -figure -for -accent -a -turbaned -giant -with -a -name -according -to -his -size -rao -bahadur -baskirao -balinkanje -pitale -vakeel -to -his -highness -the -gaikwar -of -baroda -without -him -the -picture -would -not -have -been -complete -and -if -his -name -had -been -merely -smith -he -wouldn't -have -answered -close -at -hand -on -house -fronts -on -both -sides -of -the -narrow -street -were -illuminations -of -a -kind -commonly -employed -by -the -natives -scores -of -glass -tumblers -containing -tapers -fastened -a -few -in -inches -apart -all -over -great -latticed -frames -forming -starry -constellations -which -showed -out -vividly -against -their -black -back -grounds -as -we -drew -away -into -the -distance -down -the -dim -lanes -the -illuminations -gathered -together -into -a -single -mass -and -glowed -out -of -the -enveloping -darkness -like -a -sun -then -again -the -deep -silence -the -skurrying -rats -the -dim -forms -stretched -every -where -on -the -ground -and -on -either -hand -those -open -booths -counterfeiting -sepulchres -with -counterfeit -corpses -sleeping -motionless -in -the -flicker -of -the -counterfeit -death -lamps -and -now -a -year -later -when -i -read -the -cablegrams -i -seem -to -be -reading -of -what -i -myself -partly -saw -saw -before -it -happened -in -a -prophetic -dream -as -it -were -one -cablegram -says -business -in -the -native -town -is -about -suspended -except -the -wailing -and -the -tramp -of -the -funerals -there -is -but -little -life -or -movement -the -closed -shops -exceed -in -number -those -that -remain -open -another -says -that -325 -000 -of -the -people -have -fled -the -city -and -are -carrying -the -plague -to -the -country -three -days -later -comes -the -news -the -population -is -reduced -by -half -the -refugees -have -carried -the -disease -to -karachi -220 -cases -214 -deaths -a -day -or -two -later -52 -fresh -cases -all -of -which -proved -fatal -the -plague -carries -with -it -a -terror -which -no -other -disease -can -excite -for -of -all -diseases -known -to -men -it -is -the -deadliest -by -far -the -deadliest -fifty -two -fresh -cases -all -fatal -it -is -the -black -death -alone -that -slays -like -that -we -can -all -imagine -after -a -fashion -the -desolation -of -a -plague -stricken -city -and -the -stupor -of -stillness -broken -at -intervals -by -distant -bursts -of -wailing -marking -the -passing -of -funerals -here -and -there -and -yonder -but -i -suppose -it -is -not -possible -for -us -to -realize -to -ourselves -the -nightmare -of -dread -and -fear -that -possesses -the -living -who -are -present -in -such -a -place -and -cannot -get -away -that -half -million -fled -from -bombay -in -a -wild -panic -suggests -to -us -something -of -what -they -were -feeling -but -perhaps -not -even -they -could -realize -what -the -half -million -were -feeling -whom -they -left -stranded -behind -to -face -the -stalking -horror -without -chance -of -escape -kinglake -was -in -cairo -many -years -ago -during -an -epidemic -of -the -black -death -and -he -has -imagined -the -terrors -that -creep -into -a -man's -heart -at -such -a -time -and -follow -him -until -they -themselves -breed -the -fatal -sign -in -the -armpit -and -then -the -delirium -with -confused -images -and -home -dreams -and -reeling -billiard -tables -and -then -the -sudden -blank -of -death -to -the -contagionist -filled -as -he -is -with -the -dread -of -final -causes -having -no -faith -in -destiny -nor -in -the -fixed -will -of -god -and -with -none -of -the -devil -may -care -indifference -which -might -stand -him -instead -of -creeds -to -such -one -every -rag -that -shivers -in -the -breeze -of -a -plague -stricken -city -has -this -sort -of -sublimity -if -by -any -terrible -ordinance -he -be -forced -to -venture -forth -be -sees -death -dangling -from -every -sleeve -and -as -he -creeps -forward -he -poises -his -shuddering -limbs -between -the -imminent -jacket -that -is -stabbing -at -his -right -elbow -and -the -murderous -pelisse -that -threatens -to -mow -him -clean -down -as -it -sweeps -along -on -his -left -but -most -of -all -he -dreads -that -which -most -of -all -he -should -love -the -touch -of -a -woman's -dress -for -mothers -and -wives -hurrying -forth -on -kindly -errands -from -the -bedsides -of -the -dying -go -slouching -along -through -the -streets -more -willfully -and -less -courteously -than -the -men -for -a -while -it -may -be -that -the -caution -of -the -poor -levantine -may -enable -him -to -avoid -contact -but -sooner -or -later -perhaps -the -dreaded -chance -arrives -that -bundle -of -linen -with -the -dark -tearful -eyes -at -the -top -of -it -that -labors -along -with -the -voluptuous -clumsiness -of -grisi -she -has -touched -the -poor -levantine -with -the -hem -of -her -sleeve! -from -that -dread -moment -his -peace -is -gone -his -mind -for -ever -hanging -upon -the -fatal -touch -invites -the -blow -which -he -fears -he -watches -for -the -symptoms -of -plague -so -carefully -that -sooner -or -later -they -come -in -truth -the -parched -mouth -is -a -sign -his -mouth -is -parched -the -throbbing -brain -his -brain -does -throb -the -rapid -pulse -he -touches -his -own -wrist -for -he -dares -not -ask -counsel -of -any -man -lest -he -be -deserted -he -touches -his -wrist -and -feels -how -his -frighted -blood -goes -galloping -out -of -his -heart -there -is -nothing -but -the -fatal -swelling -that -is -wanting -to -make -his -sad -conviction -complete -immediately -he -has -an -odd -feel -under -the -arm -no -pain -but -a -little -straining -of -the -skin -he -would -to -god -it -were -his -fancy -that -were -strong -enough -to -give -him -that -sensation -this -is -the -worst -of -all -it -now -seems -to -him -that -he -could -be -happy -and -contented -with -his -parched -mouth -and -his -throbbing -brain -and -his -rapid -pulse -if -only -he -could -know -that -there -were -no -swelling -under -the -left -arm -but -dares -he -try -in -a -moment -of -calmness -and -deliberation -he -dares -not -but -when -for -a -while -he -has -writhed -under -the -torture -of -suspense -a -sudden -strength -of -will -drives -him -to -seek -and -know -his -fate -he -touches -the -gland -and -finds -the -skin -sane -and -sound -but -under -the -cuticle -there -lies -a -small -lump -like -a -pistol -bullet -that -moves -as -he -pushes -it -oh! -but -is -this -for -all -certainty -is -this -the -sentence -of -death -feel -the -gland -of -the -other -arm -there -is -not -the -same -lump -exactly -yet -something -a -little -like -it -have -not -some -people -glands -naturally -enlarged -would -to -heaven -he -were -one! -so -he -does -for -himself -the -work -of -the -plague -and -when -the -angel -of -death -thus -courted -does -indeed -and -in -truth -come -he -has -only -to -finish -that -which -has -been -so -well -begun -he -passes -his -fiery -hand -over -the -brain -of -the -victim -and -lets -him -rave -for -a -season -but -all -chance -wise -of -people -and -things -once -dear -or -of -people -and -things -indifferent -once -more -the -poor -fellow -is -back -at -his -home -in -fair -provence -and -sees -the -sundial -that -stood -in -his -childhood's -garden -sees -his -mother -and -the -long -since -forgotten -face -of -that -little -dear -sister -he -sees -her -he -says -on -a -sunday -morning -for -all -the -church -bells -are -ringing -he -looks -up -and -down -through -the -universe -and -owns -it -well -piled -with -bales -upon -bales -of -cotton -and -cotton -eternal -so -much -so -that -he -feels -he -knows -he -swears -he -could -make -that -winning -hazard -if -the -billiard -table -would -not -slant -upwards -and -if -the -cue -were -a -cue -worth -playing -with -but -it -is -not -it's -a -cue -that -won't -move -his -own -arm -won't -move -in -short -there's -the -devil -to -pay -in -the -brain -of -the -poor -levantine -and -perhaps -the -next -night -but -one -he -becomes -the -'life -and -the -soul' -of -some -squalling -jackal -family -who -fish -him -out -by -the -foot -from -his -shallow -and -sandy -grave -chapter -xliii -hunger -is -the -handmaid -of -genius -pudd'nhead -wilson's -new -calendar -one -day -during -our -stay -in -bombay -there -was -a -criminal -trial -of -a -most -interesting -sort -a -terribly -realistic -chapter -out -of -the -arabian -nights -a -strange -mixture -of -simplicities -and -pieties -and -murderous -practicalities -which -brought -back -the -forgotten -days -of -thuggee -and -made -them -live -again -in -fact -even -made -them -believable -it -was -a -case -where -a -young -girl -had -been -assassinated -for -the -sake -of -her -trifling -ornaments -things -not -worth -a -laborer's -day's -wages -in -america -this -thing -could -have -been -done -in -many -other -countries -but -hardly -with -the -cold -business -like -depravity -absence -of -fear -absence -of -caution -destitution -of -the -sense -of -horror -repentance -remorse -exhibited -in -this -case -elsewhere -the -murderer -would -have -done -his -crime -secretly -by -night -and -without -witnesses -his -fears -would -have -allowed -him -no -peace -while -the -dead -body -was -in -his -neighborhood -he -would -not -have -rested -until -he -had -gotten -it -safe -out -of -the -way -and -hidden -as -effectually -as -he -could -hide -it -but -this -indian -murderer -does -his -deed -in -the -full -light -of -day -cares -nothing -for -the -society -of -witnesses -is -in -no -way -incommoded -by -the -presence -of -the -corpse -takes -his -own -time -about -disposing -of -it -and -the -whole -party -are -so -indifferent -so -phlegmatic -that -they -take -their -regular -sleep -as -if -nothing -was -happening -and -no -halters -hanging -over -them -and -these -five -bland -people -close -the -episode -with -a -religious -service -the -thing -reads -like -a -meadows -taylor -thug -tale -of -half -a -century -ago -as -may -be -seen -by -the -official -report -of -the -trial -at -the -mazagon -police -court -yesterday -superintendent -nolan -again -charged -tookaram -suntoo -savat -baya -woman -her -daughter -krishni -and -gopal -yithoo -bhanayker -before -mr -phiroze -hoshang -dastur -fourth -presidency -magistrate -under -sections -302 -and -109 -of -the -code -with -having -on -the -night -of -the -30th -of -december -last -murdered -a -hindoo -girl -named -cassi -aged -12 -by -strangulation -in -the -room -of -a -chawl -at -jakaria -bunder -on -the -sewriroad -and -also -with -aiding -and -abetting -each -other -in -the -commission -of -the -offense -mr -f -a -little -public -prosecutor -conducted -the -case -on -behalf -of -the -crown -the -accused -being -undefended -mr -little -applied -under -the -provisions -of -the -criminal -procedure -code -to -tender -pardon -to -one -of -the -accused -krishni -woman -aged -22 -on -her -undertaking -to -make -a -true -and -full -statement -of -facts -under -which -the -deceased -girl -cassi -was -murdered -the -magistrate -having -granted -the -public -prosecutor's -application -the -accused -krishni -went -into -the -witness -box -and -on -being -examined -by -mr -little -made -the -following -confession -i -am -a -mill -hand -employed -at -the -jubilee -mill -i -recollect -the -day -tuesday -on -which -the -body -of -the -deceased -cassi -was -found -previous -to -that -i -attended -the -mill -for -half -a -day -and -then -returned -home -at -3 -in -the -afternoon -when -i -saw -five -persons -in -the -house -viz -the -first -accused -tookaram -who -is -my -paramour -my -mother -the -second -accused -baya -the -accused -gopal -and -two -guests -named -ramji -daji -and -annaji -gungaram -tookaram -rented -the -room -of -the -chawl -situated -at -jakaria -bunder -road -from -its -owner -girdharilal -radhakishan -and -in -that -room -i -my -paramour -tookaram -and -his -younger -brother -yesso -mahadhoo -live -since -his -arrival -in -bombay -from -his -native -country -yesso -came -and -lived -with -us -when -i -returned -from -the -mill -on -the -afternoon -of -that -day -i -saw -the -two -guests -seated -on -a -cot -in -the -veranda -and -a -few -minutes -after -the -accused -gopal -came -and -took -his -seat -by -their -side -while -i -and -my -mother -were -seated -inside -the -room -tookaram -who -had -gone -out -to -fetch -some -'pan' -and -betelnuts -on -his -return -home -had -brought -the -two -guests -with -him -after -returning -home -he -gave -them -'pan -supari' -while -they -were -eating -it -my -mother -came -out -of -the -room -and -inquired -of -one -of -the -guests -ramji -what -had -happened -to -his -foot -when -he -replied -that -he -had -tried -many -remedies -but -they -had -done -him -no -good -my -mother -then -took -some -rice -in -her -hand -and -prophesied -that -the -disease -which -ramji -was -suffering -from -would -not -be -cured -until -he -returned -to -his -native -country -in -the -meantime -the -deceased -casi -came -from -the -direction -of -an -out -house -and -stood -in -front -on -the -threshold -of -our -room -with -a -'lota' -in -her -hand -tookaram -then -told -his -two -guests -to -leave -the -room -and -they -then -went -up -the -steps -towards -the -quarry -after -the -guests -had -gone -away -tookaram -seized -the -deceased -who -had -come -into -the -room -and -he -afterwards -put -a -waistband -around -her -and -tied -her -to -a -post -which -supports -a -loft -after -doing -this -he -pressed -the -girl's -throat -and -having -tied -her -mouth -with -the -'dhotur' -now -shown -in -court -fastened -it -to -the -post -having -killed -the -girl -tookaram -removed -her -gold -head -ornament -and -a -gold -'putlee' -and -also -took -charge -of -her -'lota' -besides -these -two -ornaments -cassi -had -on -her -person -ear -studs -a -nose -ring -some -silver -toe -rings -two -necklaces -a -pair -of -silver -anklets -and -bracelets -tookaram -afterwards -tried -to -remove -the -silver -amulets -the -ear -studs -and -the -nose -ring -but -he -failed -in -his -attempt -while -he -was -doing -so -i -my -mother -and -gopal -were -present -after -removing -the -two -gold -ornaments -he -handed -them -over -to -gopal -who -was -at -the -time -standing -near -me -when -he -killed -cassi -tookaram -threatened -to -strangle -me -also -if -i -informed -any -one -of -this -gopal -and -myself -were -then -standing -at -the -door -of -our -room -and -we -both -were -threatened -by -tookaram -my -mother -baya -had -seized -the -legs -of -the -deceased -at -the -time -she -was -killed -and -whilst -she -was -being -tied -to -the -post -cassi -then -made -a -noise -tookaram -and -my -mother -took -part -in -killing -the -girl -after -the -murder -her -body -was -wrapped -up -in -a -mattress -and -kept -on -the -loft -over -the -door -of -our -room -when -cassi -was -strangled -the -door -of -the -room -was -fastened -from -the -inside -by -tookaram -this -deed -was -committed -shortly -after -my -return -home -from -work -in -the -mill -tookaram -put -the -body -of -the -deceased -in -the -mattress -and -after -it -was -left -on -the -loft -he -went -to -have -his -head -shaved -by -a -barber -named -sambhoo -raghoo -who -lives -only -one -door -away -from -me -my -mother -and -myself -then -remained -in -the -possession -of -the -information -i -was -slapped -and -threatened -by -my -paramour -tookaram -and -that -was -the -only -reason -why -i -did -not -inform -any -one -at -that -time -when -i -told -tookaram -that -i -would -give -information -of -the -occurrence -he -slapped -me -the -accused -gopal -was -asked -by -tookaram -to -go -back -to -his -room -and -he -did -so -taking -away -with -him -the -two -gold -ornaments -and -the -'lota' -yesso -mahadhoo -a -brother -in -law -of -tookaram -came -to -the -house -and -asked -taokaram -why -he -was -washing -the -water -pipe -being -just -opposite -tookaram -replied -that -he -was -washing -his -dhotur -as -a -fowl -had -polluted -it -about -6 -o'clock -of -the -evening -of -that -day -my -mother -gave -me -three -pice -and -asked -me -to -buy -a -cocoanut -and -i -gave -the -money -to -yessoo -who -went -and -fetched -a -cocoanut -and -some -betel -leaves -when -yessoo -and -others -were -in -the -room -i -was -bathing -and -after -i -finished -my -bath -my -mother -took -the -cocoanut -and -the -betel -leaves -from -yessoo -and -we -five -went -to -the -sea -the -party -consisted -of -tookaram -my -mother -yessoo -tookaram's -younger -brother -and -myself -on -reaching -the -seashore -my -mother -made -the -offering -to -the -sea -and -prayed -to -be -pardoned -for -what -we -had -done -before -we -went -to -the -sea -some -one -came -to -inquire -after -the -girl -cassi -the -police -and -other -people -came -to -make -these -inquiries -both -before -and -after -we -left -the -house -for -the -seashore -the -police -questioned -my -mother -about -the -girl -and -she -replied -that -cassi -had -come -to -her -door -but -had -left -the -next -day -the -police -questioned -tookaram -and -he -too -gave -a -similar -reply -this -was -said -the -same -night -when -the -search -was -made -for -the -girl -after -the -offering -was -made -to -the -sea -we -partook -of -the -cocoanut -and -returned -home -when -my -mother -gave -me -some -food -but -tookaram -did -not -partake -of -any -food -that -night -after -dinner -i -and -my -mother -slept -inside -the -room -and -tookaram -slept -on -a -cot -near -his -brother -in -law -yessoo -mahadhoo -just -outside -the -door -that -was -not -the -usual -place -where -tookaram -slept -he -usually -slept -inside -the -room -the -body -of -the -deceased -remained -on -the -loft -when -i -went -to -sleep -the -room -in -which -we -slept -was -locked -and -i -heard -that -my -paramour -tookaram -was -restless -outside -about -3 -o'clock -the -following -morning -tookaram -knocked -at -the -door -when -both -myself -and -my -mother -opened -it -he -then -told -me -to -go -to -the -steps -leading -to -the -quarry -and -see -if -any -one -was -about -those -steps -lead -to -a -stable -through -which -we -go -to -the -quarry -at -the -back -of -the -compound -when -i -got -to -the -steps -i -saw -no -one -there -tookaram -asked -me -if -any -one -was -there -and -i -replied -that -i -could -see -no -one -about -he -then -took -the -body -of -the -deceased -from -the -loft -and -having -wrapped -it -up -in -his -saree -asked -me -to -accompany -him -to -the -steps -of -the -quarry -and -i -did -so -the -'saree' -now -produced -here -was -the -same -besides -the -'saree' -there -was -also -a -'cholee' -on -the -body -he -then -carried -the -body -in -his -arms -and -went -up -the -steps -through -the -stable -and -then -to -the -right -hand -towards -a -sahib's -bungalow -where -tookaram -placed -the -body -near -a -wall -all -the -time -i -and -my -mother -were -with -him -when -the -body -was -taken -down -yessoo -was -lying -on -the -cot -after -depositing -the -body -under -the -wall -we -all -returned -home -and -soon -after -5 -a -m -the -police -again -came -and -took -tookaram -away -about -an -hour -after -they -returned -and -took -me -and -my -mother -away -we -were -questioned -about -it -when -i -made -a -statement -two -hours -later -i -was -taken -to -the -room -and -i -pointed -out -this -waistband -the -'dhotur' -the -mattress -and -the -wooden -post -to -superintendent -nolan -and -inspectors -roberts -and -rashanali -in -the -presence -of -my -mother -and -tookaram -tookaram -killed -the -girl -cassi -for -her -ornaments -which -he -wanted -for -the -girl -to -whom -he -was -shortly -going -to -be -married -the -body -was -found -in -the -same -place -where -it -was -deposited -by -tookaram -the -criminal -side -of -the -native -has -always -been -picturesque -always -readable -the -thuggee -and -one -or -two -other -particularly -outrageous -features -of -it -have -been -suppressed -by -the -english -but -there -is -enough -of -it -left -to -keep -it -darkly -interesting -one -finds -evidence -of -these -survivals -in -the -newspapers -macaulay -has -a -light -throwing -passage -upon -this -matter -in -his -great -historical -sketch -of -warren -hastings -where -he -is -describing -some -effects -which -followed -the -temporary -paralysis -of -hastings' -powerful -government -brought -about -by -sir -philip -francis -and -his -party -the -natives -considered -hastings -as -a -fallen -man -and -they -acted -after -their -kind -some -of -our -readers -may -have -seen -in -india -a -cloud -of -crows -pecking -a -sick -vulture -to -death -no -bad -type -of -what -happens -in -that -country -as -often -as -fortune -deserts -one -who -has -been -great -and -dreaded -in -an -instant -all -the -sycophants -who -had -lately -been -ready -to -lie -for -him -to -forge -for -him -to -pander -for -him -to -poison -for -him -hasten -to -purchase -the -favor -of -his -victorious -enemies -by -accusing -him -an -indian -government -has -only -to -let -it -be -understood -that -it -wishes -a -particular -man -to -be -ruined -and -in -twenty -four -hours -it -will -be -furnished -with -grave -charges -supported -by -depositions -so -full -and -circumstantial -that -any -person -unaccustomed -to -asiatic -mendacity -would -regard -them -as -decisive -it -is -well -if -the -signature -of -the -destined -victim -is -not -counterfeited -at -the -foot -of -some -illegal -compact -and -if -some -treasonable -paper -is -not -slipped -into -a -hiding -place -in -his -house -that -was -nearly -a -century -and -a -quarter -ago -an -article -in -one -of -the -chief -journals -of -india -the -pioneer -shows -that -in -some -respects -the -native -of -to -day -is -just -what -his -ancestor -was -then -here -are -niceties -of -so -subtle -and -delicate -a -sort -that -they -lift -their -breed -of -rascality -to -a -place -among -the -fine -arts -and -almost -entitle -it -to -respect -the -records -of -the -indian -courts -might -certainly -be -relied -upon -to -prove -that -swindlers -as -a -class -in -the -east -come -very -close -to -if -they -do -not -surpass -in -brilliancy -of -execution -and -originality -of -design -the -most -expert -of -their -fraternity -in -europe -and -america -india -in -especial -is -the -home -of -forgery -there -are -some -particular -districts -which -are -noted -as -marts -for -the -finest -specimens -of -the -forger's -handiwork -the -business -is -carried -on -by -firms -who -possess -stores -of -stamped -papers -to -suit -every -emergency -they -habitually -lay -in -a -store -of -fresh -stamped -papers -every -year -and -some -of -the -older -and -more -thriving -houses -can -supply -documents -for -the -past -forty -years -bearing -the -proper -water -mark -and -possessing -the -genuine -appearance -of -age -other -districts -have -earned -notoriety -for -skilled -perjury -a -pre -eminence -that -excites -a -respectful -admiration -when -one -thinks -of -the -universal -prevalence -of -the -art -and -persons -desirous -of -succeeding -in -false -suits -are -ready -to -pay -handsomely -to -avail -themselves -of -the -services -of -these -local -experts -as -witnesses -various -instances -illustrative -of -the -methods -of -these -swindlers -are -given -they -exhibit -deep -cunning -and -total -depravity -on -the -part -of -the -swindler -and -his -pals -and -more -obtuseness -on -the -part -of -the -victim -than -one -would -expect -to -find -in -a -country -where -suspicion -of -your -neighbor -must -surely -be -one -of -the -earliest -things -learned -the -favorite -subject -is -the -young -fool -who -has -just -come -into -a -fortune -and -is -trying -to -see -how -poor -a -use -he -can -put -it -to -i -will -quote -one -example -sometimes -another -form -of -confidence -trick -is -adopted -which -is -invariably -successful -the -particular -pigeon -is -spotted -and -his -acquaintance -having -been -made -he -is -encouraged -in -every -form -of -vice -when -the -friendship -is -thoroughly -established -the -swindler -remarks -to -the -young -man -that -he -has -a -brother -who -has -asked -him -to -lend -him -rs -10 -000 -the -swindler -says -he -has -the -money -and -would -lend -it -but -as -the -borrower -is -his -brother -he -cannot -charge -interest -so -he -proposes -that -he -should -hand -the -dupe -the -money -and -the -latter -should -lend -it -to -the -swindler's -brother -exacting -a -heavy -pre -payment -of -interest -which -it -is -pointed -out -they -may -equally -enjoy -in -dissipation -the -dupe -sees -no -objection -and -on -the -appointed -day -receives -rs -7 -000 -from -the -swindler -which -he -hands -over -to -the -confederate -the -latter -is -profuse -in -his -thanks -and -executes -a -promissory -note -for -rs -10 -000 -payable -to -bearer -the -swindler -allows -the -scheme -to -remain -quiescent -for -a -time -and -then -suggests -that -as -the -money -has -not -been -repaid -and -as -it -would -be -unpleasant -to -sue -his -brother -it -would -be -better -to -sell -the -note -in -the -bazaar -the -dupe -hands -the -note -over -for -the -money -he -advanced -was -not -his -and -on -being -informed -that -it -would -be -necessary -to -have -his -signature -on -the -back -so -as -to -render -the -security -negotiable -he -signs -without -any -hesitation -the -swindler -passes -it -on -to -confederates -and -the -latter -employ -a -respectable -firm -of -solicitors -to -ask -the -dupe -if -his -signature -is -genuine -he -admits -it -at -once -and -his -fate -is -sealed -a -suit -is -filed -by -a -confederate -against -the -dupe -two -accomplices -being -made -co -defendants -they -admit -their -signatures -as -indorsers -and -the -one -swears -he -bought -the -note -for -value -from -the -dupe -the -latter -has -no -defense -for -no -court -would -believe -the -apparently -idle -explanation -of -the -manner -in -which -he -came -to -endorse -the -note -there -is -only -one -india! -it -is -the -only -country -that -has -a -monopoly -of -grand -and -imposing -specialties -when -another -country -has -a -remarkable -thing -it -cannot -have -it -all -to -itself -some -other -country -has -a -duplicate -but -india -that -is -different -its -marvels -are -its -own -the -patents -cannot -be -infringed -imitations -are -not -possible -and -think -of -the -size -of -them -the -majesty -of -them -the -weird -and -outlandish -character -of -the -most -of -them! -there -is -the -plague -the -black -death -india -invented -it -india -is -the -cradle -of -that -mighty -birth -the -car -of -juggernaut -was -india's -invention -so -was -the -suttee -and -within -the -time -of -men -still -living -eight -hundred -widows -willingly -and -in -fact -rejoicingly -burned -themselves -to -death -on -the -bodies -of -their -dead -husbands -in -a -single -year -eight -hundred -would -do -it -this -year -if -the -british -government -would -let -them -famine -is -india's -specialty -elsewhere -famines -are -inconsequential -incidents -in -india -they -are -devastating -cataclysms -in -one -case -they -annihilate -hundreds -in -the -other -millions -india -had -2 -000 -000 -gods -and -worships -them -all -in -religion -all -other -countries -are -paupers -india -is -the -only -millionaire -with -her -everything -is -on -a -giant -scale -even -her -poverty -no -other -country -can -show -anything -to -compare -with -it -and -she -has -been -used -to -wealth -on -so -vast -a -scale -that -she -has -to -shorten -to -single -words -the -expressions -describing -great -sums -she -describes -100 -000 -with -one -word -a -'lahk' -she -describes -ten -millions -with -one -word -a -'crore' -in -the -bowels -of -the -granite -mountains -she -has -patiently -carved -out -dozens -of -vast -temples -and -made -them -glorious -with -sculptured -colonnades -and -stately -groups -of -statuary -and -has -adorned -the -eternal -walls -with -noble -paintings -she -has -built -fortresses -of -such -magnitude -that -the -show -strongholds -of -the -rest -of -the -world -are -but -modest -little -things -by -comparison -palaces -that -are -wonders -for -rarity -of -materials -delicacy -and -beauty -of -workmanship -and -for -cost -and -one -tomb -which -men -go -around -the -globe -to -see -it -takes -eighty -nations -speaking -eighty -languages -to -people -her -and -they -number -three -hundred -millions -on -top -of -all -this -she -is -the -mother -and -home -of -that -wonder -of -wonders -caste -and -of -that -mystery -of -mysteries -the -satanic -brotherhood -of -the -thugs -india -had -the -start -of -the -whole -world -in -the -beginning -of -things -she -had -the -first -civilization -she -had -the -first -accumulation -of -material -wealth -she -was -populous -with -deep -thinkers -and -subtle -intellects -she -had -mines -and -woods -and -a -fruitful -soil -it -would -seem -as -if -she -should -have -kept -the -lead -and -should -be -to -day -not -the -meek -dependent -of -an -alien -master -but -mistress -of -the -world -and -delivering -law -and -command -to -every -tribe -and -nation -in -it -but -in -truth -there -was -never -any -possibility -of -such -supremacy -for -her -if -there -had -been -but -one -india -and -one -language -but -there -were -eighty -of -them! -where -there -are -eighty -nations -and -several -hundred -governments -fighting -and -quarreling -must -be -the -common -business -of -life -unity -of -purpose -and -policy -are -impossible -out -of -such -elements -supremacy -in -the -world -cannot -come -even -caste -itself -could -have -had -the -defeating -effect -of -a -multiplicity -of -tongues -no -doubt -for -it -separates -a -people -into -layers -and -layers -and -still -other -layers -that -have -no -community -of -feeling -with -each -other -and -in -such -a -condition -of -things -as -that -patriotism -can -have -no -healthy -growth -it -was -the -division -of -the -country -into -so -many -states -and -nations -that -made -thuggee -possible -and -prosperous -it -is -difficult -to -realize -the -situation -but -perhaps -one -may -approximate -it -by -imagining -the -states -of -our -union -peopled -by -separate -nations -speaking -separate -languages -with -guards -and -custom -houses -strung -along -all -frontiers -plenty -of -interruptions -for -travelers -and -traders -interpreters -able -to -handle -all -the -languages -very -rare -or -non -existent -and -a -few -wars -always -going -on -here -and -there -and -yonder -as -a -further -embarrassment -to -commerce -and -excursioning -it -would -make -intercommunication -in -a -measure -ungeneral -india -had -eighty -languages -and -more -custom -houses -than -cats -no -clever -man -with -the -instinct -of -a -highway -robber -could -fail -to -notice -what -a -chance -for -business -was -here -offered -india -was -full -of -clever -men -with -the -highwayman -instinct -and -so -quite -naturally -the -brotherhood -of -the -thugs -came -into -being -to -meet -the -long -felt -want -how -long -ago -that -was -nobody -knows -centuries -it -is -supposed -one -of -the -chiefest -wonders -connected -with -it -was -the -success -with -which -it -kept -its -secret -the -english -trader -did -business -in -india -two -hundred -years -and -more -before -he -ever -heard -of -it -and -yet -it -was -assassinating -its -thousands -all -around -him -every -year -the -whole -time -chapter -xliv -the -old -saw -says -let -a -sleeping -dog -lie -right -still -when -there -is -much -at -stake -it -is -better -to -get -a -newspaper -to -do -it -pudd'nhead -wilson's -new -calendar -from -diary -january -28 -i -learned -of -an -official -thug -book -the -other -day -i -was -not -aware -before -that -there -was -such -a -thing -i -am -allowed -the -temporary -use -of -it -we -are -making -preparations -for -travel -mainly -the -preparations -are -purchases -of -bedding -this -is -to -be -used -in -sleeping -berths -in -the -trains -in -private -houses -sometimes -and -in -nine -tenths -of -the -hotels -it -is -not -realizable -and -yet -it -is -true -it -is -a -survival -an -apparently -unnecessary -thing -which -in -some -strange -way -has -outlived -the -conditions -which -once -made -it -necessary -it -comes -down -from -a -time -when -the -railway -and -the -hotel -did -not -exist -when -the -occasional -white -traveler -went -horseback -or -by -bullock -cart -and -stopped -over -night -in -the -small -dak -bungalow -provided -at -easy -distances -by -the -government -a -shelter -merely -and -nothing -more -he -had -to -carry -bedding -along -or -do -without -the -dwellings -of -the -english -residents -are -spacious -and -comfortable -and -commodiously -furnished -and -surely -it -must -be -an -odd -sight -to -see -half -a -dozen -guests -come -filing -into -such -a -place -and -dumping -blankets -and -pillows -here -and -there -and -everywhere -but -custom -makes -incongruous -things -congruous -one -buys -the -bedding -with -waterproof -hold -all -for -it -at -almost -any -shop -there -is -no -difficulty -about -it -january -30 -what -a -spectacle -the -railway -station -was -at -train -time! -it -was -a -very -large -station -yet -when -we -arrived -it -seemed -as -if -the -whole -world -was -present -half -of -it -inside -the -other -half -outside -and -both -halves -bearing -mountainous -head -loads -of -bedding -and -other -freight -trying -simultaneously -to -pass -each -other -in -opposing -floods -in -one -narrow -door -these -opposing -floods -were -patient -gentle -long -suffering -natives -with -whites -scattered -among -them -at -rare -intervals -and -wherever -a -white -man's -native -servant -appeared -that -native -seemed -to -have -put -aside -his -natural -gentleness -for -the -time -and -invested -himself -with -the -white -man's -privilege -of -making -a -way -for -himself -by -promptly -shoving -all -intervening -black -things -out -of -it -in -these -exhibitions -of -authority -satan -was -scandalous -he -was -probably -a -thug -in -one -of -his -former -incarnations -inside -the -great -station -tides -upon -tides -of -rainbow -costumed -natives -swept -along -this -way -and -that -in -massed -and -bewildering -confusion -eager -anxious -belated -distressed -and -washed -up -to -the -long -trains -and -flowed -into -them -with -their -packs -and -bundles -and -disappeared -followed -at -once -by -the -next -wash -the -next -wave -and -here -and -there -in -the -midst -of -this -hurly -burly -and -seemingly -undisturbed -by -it -sat -great -groups -of -natives -on -the -bare -stone -floor -young -slender -brown -women -old -gray -wrinkled -women -little -soft -brown -babies -old -men -young -men -boys -all -poor -people -but -all -the -females -among -them -both -big -and -little -bejeweled -with -cheap -and -showy -nose -rings -toe -rings -leglets -and -armlets -these -things -constituting -all -their -wealth -no -doubt -these -silent -crowds -sat -there -with -their -humble -bundles -and -baskets -and -small -household -gear -about -them -and -patiently -waited -for -what -a -train -that -was -to -start -at -some -time -or -other -during -the -day -or -night! -they -hadn't -timed -themselves -well -but -that -was -no -matter -the -thing -had -been -so -ordered -from -on -high -therefore -why -worry -there -was -plenty -of -time -hours -and -hours -of -it -and -the -thing -that -was -to -happen -would -happen -there -was -no -hurrying -it -the -natives -traveled -third -class -and -at -marvelously -cheap -rates -they -were -packed -and -crammed -into -cars -that -held -each -about -fifty -and -it -was -said -that -often -a -brahmin -of -the -highest -caste -was -thus -brought -into -personal -touch -and -consequent -defilement -with -persons -of -the -lowest -castes -no -doubt -a -very -shocking -thing -if -a -body -could -understand -it -and -properly -appreciate -it -yes -a -brahmin -who -didn't -own -a -rupee -and -couldn't -borrow -one -might -have -to -touch -elbows -with -a -rich -hereditary -lord -of -inferior -caste -inheritor -of -an -ancient -title -a -couple -of -yards -long -and -he -would -just -have -to -stand -it -for -if -either -of -the -two -was -allowed -to -go -in -the -cars -where -the -sacred -white -people -were -it -probably -wouldn't -be -the -august -poor -brahmin -there -was -an -immense -string -of -those -third -class -cars -for -the -natives -travel -by -hordes -and -a -weary -hard -night -of -it -the -occupants -would -have -no -doubt -when -we -reached -our -car -satan -and -barney -had -already -arrived -there -with -their -train -of -porters -carrying -bedding -and -parasols -and -cigar -boxes -and -were -at -work -we -named -him -barney -for -short -we -couldn't -use -his -real -name -there -wasn't -time -it -was -a -car -that -promised -comfort -indeed -luxury -yet -the -cost -of -it -well -economy -could -no -further -go -even -in -france -not -even -in -italy -it -was -built -of -the -plainest -and -cheapest -partially -smoothed -boards -with -a -coating -of -dull -paint -on -them -and -there -was -nowhere -a -thought -of -decoration -the -floor -was -bare -but -would -not -long -remain -so -when -the -dust -should -begin -to -fly -across -one -end -of -the -compartment -ran -a -netting -for -the -accommodation -of -hand -baggage -at -the -other -end -was -a -door -which -would -shut -upon -compulsion -but -wouldn't -stay -shut -it -opened -into -a -narrow -little -closet -which -had -a -wash -bowl -in -one -end -of -it -and -a -place -to -put -a -towel -in -case -you -had -one -with -you -and -you -would -be -sure -to -have -towels -because -you -buy -them -with -the -bedding -knowing -that -the -railway -doesn't -furnish -them -on -each -side -of -the -car -and -running -fore -and -aft -was -a -broad -leather -covered -sofa -to -sit -on -in -the -day -and -sleep -on -at -night -over -each -sofa -hung -by -straps -a -wide -flat -leather -covered -shelf -to -sleep -on -in -the -daytime -you -can -hitch -it -up -against -the -wall -out -of -the -way -and -then -you -have -a -big -unencumbered -and -most -comfortable -room -to -spread -out -in -no -car -in -any -country -is -quite -its -equal -for -comfort -and -privacy -i -think -for -usually -there -are -but -two -persons -in -it -and -even -when -there -are -four -there -is -but -little -sense -of -impaired -privacy -our -own -cars -at -home -can -surpass -the -railway -world -in -all -details -but -that -one -they -have -no -cosiness -there -are -too -many -people -together -at -the -foot -of -each -sofa -was -a -side -door -for -entrance -and -exit -along -the -whole -length -of -the -sofa -on -each -side -of -the -car -ran -a -row -of -large -single -plate -windows -of -a -blue -tint -blue -to -soften -the -bitter -glare -of -the -sun -and -protect -one's -eyes -from -torture -these -could -be -let -down -out -of -the -way -when -one -wanted -the -breeze -in -the -roof -were -two -oil -lamps -which -gave -a -light -strong -enough -to -read -by -each -had -a -green -cloth -attachment -by -which -it -could -be -covered -when -the -light -should -be -no -longer -needed -while -we -talked -outside -with -friends -barney -and -satan -placed -the -hand -baggage -books -fruits -and -soda -bottles -in -the -racks -and -the -hold -alls -and -heavy -baggage -in -the -closet -hung -the -overcoats -and -sun -helmets -and -towels -on -the -hooks -hoisted -the -two -bed -shelves -up -out -of -the -way -then -shouldered -their -bedding -and -retired -to -the -third -class -now -then -you -see -what -a -handsome -spacious -light -airy -homelike -place -it -was -wherein -to -walk -up -and -down -or -sit -and -write -or -stretch -out -and -read -and -smoke -a -central -door -in -the -forward -end -of -the -compartment -opened -into -a -similar -compartment -it -was -occupied -by -my -wife -and -daughter -about -nine -in -the -evening -while -we -halted -a -while -at -a -station -barney -and -satan -came -and -undid -the -clumsy -big -hold -alls -and -spread -the -bedding -on -the -sofas -in -both -compartments -mattresses -sheets -gay -coverlets -pillows -all -complete -there -are -no -chambermaids -in -india -apparently -it -was -an -office -that -was -never -heard -of -then -they -closed -the -communicating -door -nimbly -tidied -up -our -place -put -the -night -clothing -on -the -beds -and -the -slippers -under -them -then -returned -to -their -own -quarters -january -31 -it -was -novel -and -pleasant -and -i -stayed -awake -as -long -as -i -could -to -enjoy -it -and -to -read -about -those -strange -people -the -thugs -in -my -sleep -they -remained -with -me -and -tried -to -strangle -me -the -leader -of -the -gang -was -that -giant -hindoo -who -was -such -a -picture -in -the -strong -light -when -we -were -leaving -those -hindoo -betrothal -festivities -at -two -o'clock -in -the -morning -rao -bahadur -baskirao -balinkanje -pitale -vakeel -to -the -gaikwar -of -baroda -it -was -he -that -brought -me -the -invitation -from -his -master -to -go -to -baroda -and -lecture -to -that -prince -and -now -he -was -misbehaving -in -my -dreams -but -all -things -can -happen -in -dreams -it -is -indeed -as -the -sweet -singer -of -michigan -says -irrelevantly -of -course -for -the -one -and -unfailing -great -quality -which -distinguishes -her -poetry -from -shakespeare's -and -makes -it -precious -to -us -is -its -stern -and -simple -irrelevancy -my -heart -was -gay -and -happy -this -was -ever -in -my -mind -there -is -better -times -a -coming -and -i -hope -some -day -to -find -myself -capable -of -composing -it -was -my -heart's -delight -to -compose -on -a -sentimental -subject -if -it -came -in -my -mind -just -right -[ -the -sentimental -song -book -p -49 -theme -the -author's -early -life -19th -stanza -] -barroda -arrived -at -7 -this -morning -the -dawn -was -just -beginning -to -show -it -was -forlorn -to -have -to -turn -out -in -a -strange -place -at -such -a -time -and -the -blinking -lights -in -the -station -made -it -seem -night -still -but -the -gentlemen -who -had -come -to -receive -us -were -there -with -their -servants -and -they -make -quick -work -there -was -no -lost -time -we -were -soon -outside -and -moving -swiftly -through -the -soft -gray -light -and -presently -were -comfortably -housed -with -more -servants -to -help -than -we -were -used -to -and -with -rather -embarassingly -important -officials -to -direct -them -but -it -was -custom -they -spoke -ballarat -english -their -bearing -was -charming -and -hospitable -and -so -all -went -well -breakfast -was -a -satisfaction -across -the -lawns -was -visible -in -the -distance -through -the -open -window -an -indian -well -with -two -oxen -tramping -leisurely -up -and -down -long -inclines -drawing -water -and -out -of -the -stillness -came -the -suffering -screech -of -the -machinery -not -quite -musical -and -yet -soothingly -melancholy -and -dreamy -and -reposeful -a -wail -of -lost -spirits -one -might -imagine -and -commemorative -and -reminiscent -perhaps -for -of -course -the -thugs -used -to -throw -people -down -that -well -when -they -were -done -with -them -after -breakfast -the -day -began -a -sufficiently -busy -one -we -were -driven -by -winding -roads -through -a -vast -park -with -noble -forests -of -great -trees -and -with -tangles -and -jungles -of -lovely -growths -of -a -humbler -sort -and -at -one -place -three -large -gray -apes -came -out -and -pranced -across -the -road -a -good -deal -of -a -surprise -and -an -unpleasant -one -for -such -creatures -belong -in -the -menagerie -and -they -look -artificial -and -out -of -place -in -a -wilderness -we -came -to -the -city -by -and -by -and -drove -all -through -it -intensely -indian -it -was -and -crumbly -and -mouldering -and -immemorially -old -to -all -appearance -and -the -houses -oh -indescribably -quaint -and -curious -they -were -with -their -fronts -an -elaborate -lace -work -of -intricate -and -beautiful -wood -carving -and -now -and -then -further -adorned -with -rude -pictures -of -elephants -and -princes -and -gods -done -in -shouting -colors -and -all -the -ground -floors -along -these -cramped -and -narrow -lanes -occupied -as -shops -shops -unbelievably -small -and -impossibly -packed -with -merchantable -rubbish -and -with -nine -tenths -naked -natives -squatting -at -their -work -of -hammering -pounding -brazing -soldering -sewing -designing -cooking -measuring -out -grain -grinding -it -repairing -idols -and -then -the -swarm -of -ragged -and -noisy -humanity -under -the -horses' -feet -and -everywhere -and -the -pervading -reek -and -fume -and -smell! -it -was -all -wonderful -and -delightful -imagine -a -file -of -elephants -marching -through -such -a -crevice -of -a -street -and -scraping -the -paint -off -both -sides -of -it -with -their -hides -how -big -they -must -look -and -how -little -they -must -make -the -houses -look -and -when -the -elephants -are -in -their -glittering -court -costume -what -a -contrast -they -must -make -with -the -humble -and -sordid -surroundings -and -when -a -mad -elephant -goes -raging -through -belting -right -and -left -with -his -trunk -how -do -these -swarms -of -people -get -out -of -the -way -i -suppose -it -is -a -thing -which -happens -now -and -then -in -the -mad -season -for -elephants -have -a -mad -season -i -wonder -how -old -the -town -is -there -are -patches -of -building -massive -structures -monuments -apparently -that -are -so -battered -and -worn -and -seemingly -so -tired -and -so -burdened -with -the -weight -of -age -and -so -dulled -and -stupefied -with -trying -to -remember -things -they -forgot -before -history -began -that -they -give -one -the -feeling -that -they -must -have -been -a -part -of -original -creation -this -is -indeed -one -of -the -oldest -of -the -princedoms -of -india -and -has -always -been -celebrated -for -its -barbaric -pomps -and -splendors -and -for -the -wealth -of -its -princes -chapter -xlv -it -takes -your -enemy -and -your -friend -working -together -to -hurt -you -to -the -heart -the -one -to -slander -you -and -the -other -to -get -the -news -to -you -pudd'nhead -wilson's -new -calendar -out -of -the -town -again -a -long -drive -through -open -country -by -winding -roads -among -secluded -villages -nestling -in -the -inviting -shade -of -tropic -vegetation -a -sabbath -stillness -everywhere -sometimes -a -pervading -sense -of -solitude -but -always -barefoot -natives -gliding -by -like -spirits -without -sound -of -footfall -and -others -in -the -distance -dissolving -away -and -vanishing -like -the -creatures -of -dreams -now -and -then -a -string -of -stately -camels -passed -by -always -interesting -things -to -look -at -and -they -were -velvet -shod -by -nature -and -made -no -noise -indeed -there -were -no -noises -of -any -sort -in -this -paradise -yes -once -there -was -one -for -a -moment -a -file -of -native -convicts -passed -along -in -charge -of -an -officer -and -we -caught -the -soft -clink -of -their -chains -in -a -retired -spot -resting -himself -under -a -tree -was -a -holy -person -a -naked -black -fakeer -thin -and -skinny -and -whitey -gray -all -over -with -ashes -by -and -by -to -the -elephant -stables -and -i -took -a -ride -but -it -was -by -request -i -did -not -ask -for -it -and -didn't -want -it -but -i -took -it -because -otherwise -they -would -have -thought -i -was -afraid -which -i -was -the -elephant -kneels -down -by -command -one -end -of -him -at -a -time -and -you -climb -the -ladder -and -get -into -the -howdah -and -then -he -gets -up -one -end -at -a -time -just -as -a -ship -gets -up -over -a -wave -and -after -that -as -he -strides -monstrously -about -his -motion -is -much -like -a -ship's -motion -the -mahout -bores -into -the -back -of -his -head -with -a -great -iron -prod -and -you -wonder -at -his -temerity -and -at -the -elephant's -patience -and -you -think -that -perhaps -the -patience -will -not -last -but -it -does -and -nothing -happens -the -mahout -talks -to -the -elephant -in -a -low -voice -all -the -time -and -the -elephant -seems -to -understand -it -all -and -to -be -pleased -with -it -and -he -obeys -every -order -in -the -most -contented -and -docile -way -among -these -twenty -five -elephants -were -two -which -were -larger -than -any -i -had -ever -seen -before -and -if -i -had -thought -i -could -learn -to -not -be -afraid -i -would -have -taken -one -of -them -while -the -police -were -not -looking -in -the -howdah -house -there -were -many -howdahs -that -were -made -of -silver -one -of -gold -and -one -of -old -ivory -and -equipped -with -cushions -and -canopies -of -rich -and -costly -stuffs -the -wardrobe -of -the -elephants -was -there -too -vast -velvet -covers -stiff -and -heavy -with -gold -embroidery -and -bells -of -silver -and -gold -and -ropes -of -these -metals -for -fastening -the -things -on -harness -so -to -speak -and -monster -hoops -of -massive -gold -for -the -elephant -to -wear -on -his -ankles -when -he -is -out -in -procession -on -business -of -state -but -we -did -not -see -the -treasury -of -crown -jewels -and -that -was -a -disappointment -for -in -mass -and -richness -it -ranks -only -second -in -india -by -mistake -we -were -taken -to -see -the -new -palace -instead -and -we -used -up -the -last -remnant -of -our -spare -time -there -it -was -a -pity -too -for -the -new -palace -is -mixed -modern -american -european -and -has -not -a -merit -except -costliness -it -is -wholly -foreign -to -india -and -impudent -and -out -of -place -the -architect -has -escaped -this -comes -of -overdoing -the -suppression -of -the -thugs -they -had -their -merits -the -old -palace -is -oriental -and -charming -and -in -consonance -with -the -country -the -old -palace -would -still -be -great -if -there -were -nothing -of -it -but -the -spacious -and -lofty -hall -where -the -durbars -are -held -it -is -not -a -good -place -to -lecture -in -on -account -of -the -echoes -but -it -is -a -good -place -to -hold -durbars -in -and -regulate -the -affairs -of -a -kingdom -and -that -is -what -it -is -for -if -i -had -it -i -would -have -a -durbar -every -day -instead -of -once -or -twice -a -year -the -prince -is -an -educated -gentleman -his -culture -is -european -he -has -been -in -europe -five -times -people -say -that -this -is -costly -amusement -for -him -since -in -crossing -the -sea -he -must -sometimes -be -obliged -to -drink -water -from -vessels -that -are -more -or -less -public -and -thus -damage -his -caste -to -get -it -purified -again -he -must -make -pilgrimage -to -some -renowned -hindoo -temples -and -contribute -a -fortune -or -two -to -them -his -people -are -like -the -other -hindoos -profoundly -religious -and -they -could -not -be -content -with -a -master -who -was -impure -we -failed -to -see -the -jewels -but -we -saw -the -gold -cannon -and -the -silver -one -they -seemed -to -be -six -pounders -they -were -not -designed -for -business -but -for -salutes -upon -rare -and -particularly -important -state -occasions -an -ancestor -of -the -present -gaikwar -had -the -silver -one -made -and -a -subsequent -ancestor -had -the -gold -one -made -in -order -to -outdo -him -this -sort -of -artillery -is -in -keeping -with -the -traditions -of -baroda -which -was -of -old -famous -for -style -and -show -it -used -to -entertain -visiting -rajahs -and -viceroys -with -tiger -fights -elephant -fights -illuminations -and -elephant -processions -of -the -most -glittering -and -gorgeous -character -it -makes -the -circus -a -pale -poor -thing -in -the -train -during -a -part -of -the -return -journey -from -baroda -we -had -the -company -of -a -gentleman -who -had -with -him -a -remarkable -looking -dog -i -had -not -seen -one -of -its -kind -before -as -far -as -i -could -remember -though -of -course -i -might -have -seen -one -and -not -noticed -it -for -i -am -not -acquainted -with -dogs -but -only -with -cats -this -dog's -coat -was -smooth -and -shiny -and -black -and -i -think -it -had -tan -trimmings -around -the -edges -of -the -dog -and -perhaps -underneath -it -was -a -long -low -dog -with -very -short -strange -legs -legs -that -curved -inboard -something -like -parentheses -wrong -way -indeed -it -was -made -on -the -plan -of -a -bench -for -length -and -lowness -it -seemed -to -be -satisfied -but -i -thought -the -plan -poor -and -structurally -weak -on -account -of -the -distance -between -the -forward -supports -and -those -abaft -with -age -the -dog's -back -was -likely -to -sag -and -it -seemed -to -me -that -it -would -have -been -a -stronger -and -more -practicable -dog -if -it -had -had -some -more -legs -it -had -not -begun -to -sag -yet -but -the -shape -of -the -legs -showed -that -the -undue -weight -imposed -upon -them -was -beginning -to -tell -it -had -a -long -nose -and -floppy -ears -that -hung -down -and -a -resigned -expression -of -countenance -i -did -not -like -to -ask -what -kind -of -a -dog -it -was -or -how -it -came -to -be -deformed -for -it -was -plain -that -the -gentleman -was -very -fond -of -it -and -naturally -he -could -be -sensitive -about -it -from -delicacy -i -thought -it -best -not -to -seem -to -notice -it -too -much -no -doubt -a -man -with -a -dog -like -that -feels -just -as -a -person -does -who -has -a -child -that -is -out -of -true -the -gentleman -was -not -merely -fond -of -the -dog -he -was -also -proud -of -it -just -the -same -again -as -a -mother -feels -about -her -child -when -it -is -an -idiot -i -could -see -that -he -was -proud -of -it -not -withstanding -it -was -such -a -long -dog -and -looked -so -resigned -and -pious -it -had -been -all -over -the -world -with -him -and -had -been -pilgriming -like -that -for -years -and -years -it -had -traveled -50 -000 -miles -by -sea -and -rail -and -had -ridden -in -front -of -him -on -his -horse -8 -000 -it -had -a -silver -medal -from -the -geographical -society -of -great -britain -for -its -travels -and -i -saw -it -it -had -won -prizes -in -dog -shows -both -in -india -and -in -england -i -saw -them -he -said -its -pedigree -was -on -record -in -the -kennel -club -and -that -it -was -a -well -known -dog -he -said -a -great -many -people -in -london -could -recognize -it -the -moment -they -saw -it -i -did -not -say -anything -but -i -did -not -think -it -anything -strange -i -should -know -that -dog -again -myself -yet -i -am -not -careful -about -noticing -dogs -he -said -that -when -he -walked -along -in -london -people -often -stopped -and -looked -at -the -dog -of -course -i -did -not -say -anything -for -i -did -not -want -to -hurt -his -feelings -but -i -could -have -explained -to -him -that -if -you -take -a -great -long -low -dog -like -that -and -waddle -it -along -the -street -anywhere -in -the -world -and -not -charge -anything -people -will -stop -and -look -he -was -gratified -because -the -dog -took -prizes -but -that -was -nothing -if -i -were -built -like -that -i -could -take -prizes -myself -i -wished -i -knew -what -kind -of -a -dog -it -was -and -what -it -was -for -but -i -could -not -very -well -ask -for -that -would -show -that -i -did -not -know -not -that -i -want -a -dog -like -that -but -only -to -know -the -secret -of -its -birth -i -think -he -was -going -to -hunt -elephants -with -it -because -i -know -from -remarks -dropped -by -him -that -he -has -hunted -large -game -in -india -and -africa -and -likes -it -but -i -think -that -if -he -tries -to -hunt -elephants -with -it -he -is -going -to -be -disappointed -i -do -not -believe -that -it -is -suited -for -elephants -it -lacks -energy -it -lacks -force -of -character -it -lacks -bitterness -these -things -all -show -in -the -meekness -and -resignation -of -its -expression -it -would -not -attack -an -elephant -i -am -sure -of -it -it -might -not -run -if -it -saw -one -coming -but -it -looked -to -me -like -a -dog -that -would -sit -down -and -pray -i -wish -he -had -told -me -what -breed -it -was -if -there -are -others -but -i -shall -know -the -dog -next -time -and -then -if -i -can -bring -myself -to -it -i -will -put -delicacy -aside -and -ask -if -i -seem -strangely -interested -in -dogs -i -have -a -reason -for -it -for -a -dog -saved -me -from -an -embarrassing -position -once -and -that -has -made -me -grateful -to -these -animals -and -if -by -study -i -could -learn -to -tell -some -of -the -kinds -from -the -others -i -should -be -greatly -pleased -i -only -know -one -kind -apart -yet -and -that -is -the -kind -that -saved -me -that -time -i -always -know -that -kind -when -i -meet -it -and -if -it -is -hungry -or -lost -i -take -care -of -it -the -matter -happened -in -this -way -it -was -years -and -years -ago -i -had -received -a -note -from -mr -augustin -daly -of -the -fifth -avenue -theatre -asking -me -to -call -the -next -time -i -should -be -in -new -york -i -was -writing -plays -in -those -days -and -he -was -admiring -them -and -trying -to -get -me -a -chance -to -get -them -played -in -siberia -i -took -the -first -train -the -early -one -the -one -that -leaves -hartford -at -8 -29 -in -the -morning -at -new -haven -i -bought -a -paper -and -found -it -filled -with -glaring -display -lines -about -a -bench -show -there -i -had -often -heard -of -bench -shows -but -had -never -felt -any -interest -in -them -because -i -supposed -they -were -lectures -that -were -not -well -attended -it -turned -out -now -that -it -was -not -that -but -a -dog -show -there -was -a -double -leaded -column -about -the -king -feature -of -this -one -which -was -called -a -saint -bernard -and -was -worth -$10 -000 -and -was -known -to -be -the -largest -and -finest -of -his -species -in -the -world -i -read -all -this -with -interest -because -out -of -my -school -boy -readings -i -dimly -remembered -how -the -priests -and -pilgrims -of -st -bernard -used -to -go -out -in -the -storms -and -dig -these -dogs -out -of -the -snowdrifts -when -lost -and -exhausted -and -give -them -brandy -and -save -their -lives -and -drag -them -to -the -monastery -and -restore -them -with -gruel -also -there -was -a -picture -of -this -prize -dog -in -the -paper -a -noble -great -creature -with -a -benignant -countenance -standing -by -a -table -he -was -placed -in -that -way -so -that -one -could -get -a -right -idea -of -his -great -dimensions -you -could -see -that -he -was -just -a -shade -higher -than -the -table -indeed -a -huge -fellow -for -a -dog -then -there -was -a -description -which -event -into -the -details -it -gave -his -enormous -weight -150 -1/2 -pounds -and -his -length -4 -feet -2 -inches -from -stem -to -stern -post -and -his -height -3 -feet -1 -inch -to -the -top -of -his -back -the -pictures -and -the -figures -so -impressed -me -that -i -could -see -the -beautiful -colossus -before -me -and -i -kept -on -thinking -about -him -for -the -next -two -hours -then -i -reached -new -york -and -he -dropped -out -of -my -mind -in -the -swirl -and -tumult -of -the -hotel -lobby -i -ran -across -mr -daly's -comedian -the -late -james -lewis -of -beloved -memory -and -i -casually -mentioned -that -i -was -going -to -call -upon -mr -daly -in -the -evening -at -8 -he -looked -surprised -and -said -he -reckoned -not -for -answer -i -handed -him -mr -daly's -note -its -substance -was -come -to -my -private -den -over -the -theater -where -we -cannot -be -interrupted -and -come -by -the -back -way -not -the -front -no -642 -sixth -avenue -is -a -cigar -shop -pass -through -it -and -you -are -in -a -paved -court -with -high -buildings -all -around -enter -the -second -door -on -the -left -and -come -up -stairs -is -this -all -yes -i -said -well -you'll -never -get -in -why -because -you -won't -or -if -you -do -you -can -draw -on -me -for -a -hundred -dollars -for -you -will -be -the -first -man -that -has -accomplished -it -in -twenty -five -years -i -can't -think -what -mr -daly -can -have -been -absorbed -in -he -has -forgotten -a -most -important -detail -and -he -will -feel -humiliated -in -the -morning -when -he -finds -that -you -tried -to -get -in -and -couldn't -why -what -is -the -trouble -i'll -tell -you -you -see -at -that -point -we -were -swept -apart -by -the -crowd -somebody -detained -me -with -a -moment's -talk -and -we -did -not -get -together -again -but -it -did -not -matter -i -believed -he -was -joking -anyway -at -eight -in -the -evening -i -passed -through -the -cigar -shop -and -into -the -court -and -knocked -at -the -second -door -come -in! -i -entered -it -was -a -small -room -carpetless -dusty -with -a -naked -deal -table -and -two -cheap -wooden -chairs -for -furniture -a -giant -irishman -was -standing -there -with -shirt -collar -and -vest -unbuttoned -and -no -coat -on -i -put -my -hat -on -the -table -and -was -about -to -say -something -when -the -irishman -took -the -innings -himself -and -not -with -marked -courtesy -of -tone -well -sor -what -will -you -have -i -was -a -little -disconcerted -and -my -easy -confidence -suffered -a -shrinkage -the -man -stood -as -motionless -as -gibraltar -and -kept -his -unblinking -eye -upon -me -it -was -very -embarrassing -very -humiliating -i -stammered -at -a -false -start -or -two -then -i -have -just -run -down -from -av -ye -plaze -ye'll -not -smoke -here -ye -understand -i -laid -my -cigar -on -the -window -ledge -chased -my -flighty -thoughts -a -moment -then -said -in -a -placating -manner -i -i -have -come -to -see -mr -daly -oh -ye -have -have -ye -yes -well -ye'll -not -see -him -but -he -asked -me -to -come -oh -he -did -did -he -yes -he -sent -me -this -note -and -lemme -see -it -for -a -moment -i -fancied -there -would -be -a -change -in -the -atmosphere -now -but -this -idea -was -premature -the -big -man -was -examining -the -note -searchingly -under -the -gas -jet -a -glance -showed -me -that -he -had -it -upside -down -disheartening -evidence -that -he -could -not -read -is -ut -his -own -handwrite -yes -he -wrote -it -himself -he -did -did -he -yes -h'm -well -then -why -ud -he -write -it -like -that -how -do -you -mean -i -mane -why -wudn't -he -put -his -naime -to -ut -his -name -is -to -it -that's -not -it -you -are -looking -at -my -name -i -thought -that -that -was -a -home -shot -but -he -did -not -betray -that -he -had -been -hit -he -said -it's -not -an -aisy -one -to -spell -how -do -you -pronounce -ut -mark -twain -h'm -h'm -mike -train -h'm -i -don't -remember -ut -what -is -it -ye -want -to -see -him -about -it -isn't -i -that -want -to -see -him -he -wants -to -see -me -oh -he -does -does -he -yes -what -does -he -want -to -see -ye -about -i -don't -know -ye -don't -know! -and -ye -confess -it -becod! -well -i -can -tell -ye -wan -thing -ye'll -not -see -him -are -ye -in -the -business -what -business -the -show -business -a -fatal -question -i -recognized -that -i -was -defeated -if -i -answered -no -he -would -cut -the -matter -short -and -wave -me -to -the -door -without -the -grace -of -a -word -i -saw -it -in -his -uncompromising -eye -if -i -said -i -was -a -lecturer -he -would -despise -me -and -dismiss -me -with -opprobrious -words -if -i -said -i -was -a -dramatist -he -would -throw -me -out -of -the -window -i -saw -that -my -case -was -hopeless -so -i -chose -the -course -which -seemed -least -humiliating -i -would -pocket -my -shame -and -glide -out -without -answering -the -silence -was -growing -lengthy -i'll -ask -ye -again -are -ye -in -the -show -business -yerself -yes! -i -said -it -with -splendid -confidence -for -in -that -moment -the -very -twin -of -that -grand -new -haven -dog -loafed -into -the -room -and -i -saw -that -irishman's -eye -light -eloquently -with -pride -and -affection -ye -are -and -what -is -it -i've -got -a -bench -show -in -new -haven -the -weather -did -change -then -you -don't -say -sir! -and -that's -your -show -sir! -oh -it's -a -grand -show -it's -a -wonderful -show -sir -and -a -proud -man -i -am -to -see -your -honor -this -day -and -ye'll -be -an -expert -sir -and -ye'll -know -all -about -dogs -more -than -ever -they -know -theirselves -i'll -take -me -oath -to -ut -i -said -with -modesty -i -believe -i -have -some -reputation -that -way -in -fact -my -business -requires -it -ye -have -some -reputation -your -honor! -bedad -i -believe -you! -there's -not -a -jintleman -in -the -worrld -that -can -lay -over -ye -in -the -judgmint -of -a -dog -sir -now -i'll -vinture -that -your -honor'll -know -that -dog's -dimensions -there -better -than -he -knows -them -his -own -self -and -just -by -the -casting -of -your -educated -eye -upon -him -would -you -mind -giving -a -guess -if -ye'll -be -so -good -i -knew -that -upon -my -answer -would -depend -my -fate -if -i -made -this -dog -bigger -than -the -prize -dog -it -would -be -bad -diplomacy -and -suspicious -if -i -fell -too -far -short -of -the -prizedog -that -would -be -equally -damaging -the -dog -was -standing -by -the -table -and -i -believed -i -knew -the -difference -between -him -and -the -one -whose -picture -i -had -seen -in -the -newspaper -to -a -shade -i -spoke -promptly -up -and -said -it's -no -trouble -to -guess -this -noble -creature's -figures -height -three -feet -length -four -feet -and -three -quarters -of -an -inch -weight -a -hundred -and -forty -eight -and -a -quarter -the -man -snatched -his -hat -from -its -peg -and -danced -on -it -with -joy -shouting -ye've -hardly -missed -it -the -hair's -breadth -hardly -the -shade -of -a -shade -your -honor! -oh -it's -the -miraculous -eye -ye've -got -for -the -judgmint -of -a -dog! -and -still -pouring -out -his -admiration -of -my -capacities -he -snatched -off -his -vest -and -scoured -off -one -of -the -wooden -chairs -with -it -and -scrubbed -it -and -polished -it -and -said -there -sit -down -your -honor -i'm -ashamed -of -meself -that -i -forgot -ye -were -standing -all -this -time -and -do -put -on -your -hat -ye -mustn't -take -cold -it's -a -drafty -place -and -here -is -your -cigar -sir -a -getting -cold -i'll -give -ye -a -light -there -the -place -is -all -yours -sir -and -if -ye'll -just -put -your -feet -on -the -table -and -make -yourself -at -home -i'll -stir -around -and -get -a -candle -and -light -ye -up -the -ould -crazy -stairs -and -see -that -ye -don't -come -to -anny -harm -for -be -this -time -mr -daly'll -be -that -impatient -to -see -your -honor -that -he'll -be -taking -the -roof -off -he -conducted -me -cautiously -and -tenderly -up -the -stairs -lighting -the -way -and -protecting -me -with -friendly -warnings -then -pushed -the -door -open -and -bowed -me -in -and -went -his -way -mumbling -hearty -things -about -my -wonderful -eye -for -points -of -a -dog -mr -daly -was -writing -and -had -his -back -to -me -he -glanced -over -his -shoulder -presently -then -jumped -up -and -said -oh -dear -me -i -forgot -all -about -giving -instructions -i -was -just -writing -you -to -beg -a -thousand -pardons -but -how -is -it -you -are -here -how -did -you -get -by -that -irishman -you -are -the -first -man -that's -done -it -in -five -and -twenty -years -you -didn't -bribe -him -i -know -that -there's -not -money -enough -in -new -york -to -do -it -and -you -didn't -persuade -him -he -is -all -ice -and -iron -there -isn't -a -soft -place -nor -a -warm -one -in -him -anywhere -that -is -your -secret -look -here -you -owe -me -a -hundred -dollars -for -unintentionally -giving -you -a -chance -to -perform -a -miracle -for -it -is -a -miracle -that -you've -done -that -is -all -right -i -said -collect -it -of -jimmy -lewis -that -good -dog -not -only -did -me -that -good -turn -in -the -time -of -my -need -but -he -won -for -me -the -envious -reputation -among -all -the -theatrical -people -from -the -atlantic -to -the -pacific -of -being -the -only -man -in -history -who -had -ever -run -the -blockade -of -augustin -daly's -back -door -chapter -xlvi -if -the -desire -to -kill -and -the -opportunity -to -kill -came -always -together -who -would -escape -hanging -pudd'nhead -wilson's -new -calendar -on -the -train -fifty -years -ago -when -i -was -a -boy -in -the -then -remote -and -sparsely -peopled -mississippi -valley -vague -tales -and -rumors -of -a -mysterious -body -of -professional -murderers -came -wandering -in -from -a -country -which -was -constructively -as -far -from -us -as -the -constellations -blinking -in -space -india -vague -tales -and -rumors -of -a -sect -called -thugs -who -waylaid -travelers -in -lonely -places -and -killed -them -for -the -contentment -of -a -god -whom -they -worshiped -tales -which -everybody -liked -to -listen -to -and -nobody -believed -except -with -reservations -it -was -considered -that -the -stories -had -gathered -bulk -on -their -travels -the -matter -died -down -and -a -lull -followed -then -eugene -sue's -wandering -jew -appeared -and -made -great -talk -for -a -while -one -character -in -it -was -a -chief -of -thugs -feringhea -a -mysterious -and -terrible -indian -who -was -as -slippery -and -sly -as -a -serpent -and -as -deadly -and -he -stirred -up -the -thug -interest -once -more -but -it -did -not -last -it -presently -died -again -this -time -to -stay -dead -at -first -glance -it -seems -strange -that -this -should -have -happened -but -really -it -was -not -strange -on -the -contrary -it -was -natural -i -mean -on -our -side -of -the -water -for -the -source -whence -the -thug -tales -mainly -came -was -a -government -report -and -without -doubt -was -not -republished -in -america -it -was -probably -never -even -seen -there -government -reports -have -no -general -circulation -they -are -distributed -to -the -few -and -are -not -always -read -by -those -few -i -heard -of -this -report -for -the -first -time -a -day -or -two -ago -and -borrowed -it -it -is -full -of -fascinations -and -it -turns -those -dim -dark -fairy -tales -of -my -boyhood -days -into -realities -the -report -was -made -in -1889 -by -major -sleeman -of -the -indian -service -and -was -printed -in -calcutta -in -1840 -it -is -a -clumsy -great -fat -poor -sample -of -the -printer's -art -but -good -enough -for -a -government -printing -office -in -that -old -day -and -in -that -remote -region -perhaps -to -major -sleeman -was -given -the -general -superintendence -of -the -giant -task -of -ridding -india -of -thuggee -and -he -and -his -seventeen -assistants -accomplished -it -it -was -the -augean -stables -over -again -captain -vallancey -writing -in -a -madras -journal -in -those -old -times -makes -this -remark -the -day -that -sees -this -far -spread -evil -eradicated -from -india -and -known -only -in -name -will -greatly -tend -to -immortalize -british -rule -in -the -east -he -did -not -overestimate -the -magnitude -and -difficulty -of -the -work -nor -the -immensity -of -the -credit -which -would -justly -be -due -to -british -rule -in -case -it -was -accomplished -thuggee -became -known -to -the -british -authorities -in -india -about -1810 -but -its -wide -prevalence -was -not -suspected -it -was -not -regarded -as -a -serious -matter -and -no -systematic -measures -were -taken -for -its -suppression -until -about -1830 -about -that -time -major -sleeman -captured -eugene -sue's -thug -chief -feringhea -and -got -him -to -turn -king's -evidence -the -revelations -were -so -stupefying -that -sleeman -was -not -able -to -believe -them -sleeman -thought -he -knew -every -criminal -within -his -jurisdiction -and -that -the -worst -of -them -were -merely -thieves -but -feringhea -told -him -that -he -was -in -reality -living -in -the -midst -of -a -swarm -of -professional -murderers -that -they -had -been -all -about -him -for -many -years -and -that -they -buried -their -dead -close -by -these -seemed -insane -tales -but -feringhea -said -come -and -see -and -he -took -him -to -a -grave -and -dug -up -a -hundred -bodies -and -told -him -all -the -circumstances -of -the -killings -and -named -the -thugs -who -had -done -the -work -it -was -a -staggering -business -sleeman -captured -some -of -these -thugs -and -proceeded -to -examine -them -separately -and -with -proper -precautions -against -collusion -for -he -would -not -believe -any -indian's -unsupported -word -the -evidence -gathered -proved -the -truth -of -what -feringhea -had -said -and -also -revealed -the -fact -that -gangs -of -thugs -were -plying -their -trade -all -over -india -the -astonished -government -now -took -hold -of -thuggee -and -for -ten -years -made -systematic -and -relentless -war -upon -it -and -finally -destroyed -it -gang -after -gang -was -captured -tried -and -punished -the -thugs -were -harried -and -hunted -from -one -end -of -india -to -the -other -the -government -got -all -their -secrets -out -of -them -and -also -got -the -names -of -the -members -of -the -bands -and -recorded -them -in -a -book -together -with -their -birthplaces -and -places -of -residence -the -thugs -were -worshipers -of -bhowanee -and -to -this -god -they -sacrificed -anybody -that -came -handy -but -they -kept -the -dead -man's -things -themselves -for -the -god -cared -for -nothing -but -the -corpse -men -were -initiated -into -the -sect -with -solemn -ceremonies -then -they -were -taught -how -to -strangle -a -person -with -the -sacred -choke -cloth -but -were -not -allowed -to -perform -officially -with -it -until -after -long -practice -no -half -educated -strangler -could -choke -a -man -to -death -quickly -enough -to -keep -him -from -uttering -a -sound -a -muffled -scream -gurgle -gasp -moan -or -something -of -the -sort -but -the -expert's -work -was -instantaneous -the -cloth -was -whipped -around -the -victim's -neck -there -was -a -sudden -twist -and -the -head -fell -silently -forward -the -eyes -starting -from -the -sockets -and -all -was -over -the -thug -carefully -guarded -against -resistance -it -was -usual -to -to -get -the -victims -to -sit -down -for -that -was -the -handiest -position -for -business -if -the -thug -had -planned -india -itself -it -could -not -have -been -more -conveniently -arranged -for -the -needs -of -his -occupation -there -were -no -public -conveyances -there -were -no -conveyances -for -hire -the -traveler -went -on -foot -or -in -a -bullock -cart -or -on -a -horse -which -he -bought -for -the -purpose -as -soon -as -he -was -out -of -his -own -little -state -or -principality -he -was -among -strangers -nobody -knew -him -nobody -took -note -of -him -and -from -that -time -his -movements -could -no -longer -be -traced -he -did -not -stop -in -towns -or -villages -but -camped -outside -of -them -and -sent -his -servants -in -to -buy -provisions -there -were -no -habitations -between -villages -whenever -he -was -between -villages -he -was -an -easy -prey -particularly -as -he -usually -traveled -by -night -to -avoid -the -heat -he -was -always -being -overtaken -by -strangers -who -offered -him -the -protection -of -their -company -or -asked -for -the -protection -of -his -and -these -strangers -were -often -thugs -as -he -presently -found -out -to -his -cost -the -landholders -the -native -police -the -petty -princes -the -village -officials -the -customs -officers -were -in -many -cases -protectors -and -harborers -of -the -thugs -and -betrayed -travelers -to -them -for -a -share -of -the -spoil -at -first -this -condition -of -things -made -it -next -to -impossible -for -the -government -to -catch -the -marauders -they -were -spirited -away -by -these -watchful -friends -all -through -a -vast -continent -thus -infested -helpless -people -of -every -caste -and -kind -moved -along -the -paths -and -trails -in -couples -and -groups -silently -by -night -carrying -the -commerce -of -the -country -treasure -jewels -money -and -petty -batches -of -silks -spices -and -all -manner -of -wares -it -was -a -paradise -for -the -thug -when -the -autumn -opened -the -thugs -began -to -gather -together -by -pre -concert -other -people -had -to -have -interpreters -at -every -turn -but -not -the -thugs -they -could -talk -together -no -matter -how -far -apart -they -were -born -for -they -had -a -language -of -their -own -and -they -had -secret -signs -by -which -they -knew -each -other -for -thugs -and -they -were -always -friends -even -their -diversities -of -religion -and -caste -were -sunk -in -devotion -to -their -calling -and -the -moslem -and -the -high -caste -and -low -caste -hindoo -were -staunch -and -affectionate -brothers -in -thuggery -when -a -gang -had -been -assembled -they -had -religious -worship -and -waited -for -an -omen -they -had -definite -notions -about -the -omens -the -cries -of -certain -animals -were -good -omens -the -cries -of -certain -other -creatures -were -bad -omens -a -bad -omen -would -stop -proceedings -and -send -the -men -home -the -sword -and -the -strangling -cloth -were -sacred -emblems -the -thugs -worshiped -the -sword -at -home -before -going -out -to -the -assembling -place -the -strangling -cloth -was -worshiped -at -the -place -of -assembly -the -chiefs -of -most -of -the -bands -performed -the -religious -ceremonies -themselves -but -the -kaets -delegated -them -to -certain -official -stranglers -chaurs -the -rites -of -the -kaets -were -so -holy -that -no -one -but -the -chaur -was -allowed -to -touch -the -vessels -and -other -things -used -in -them -thug -methods -exhibit -a -curious -mixture -of -caution -and -the -absence -of -it -cold -business -calculation -and -sudden -unreflecting -impulse -but -there -were -two -details -which -were -constant -and -not -subject -to -caprice -patient -persistence -in -following -up -the -prey -and -pitilessness -when -the -time -came -to -act -caution -was -exhibited -in -the -strength -of -the -bands -they -never -felt -comfortable -and -confident -unless -their -strength -exceeded -that -of -any -party -of -travelers -they -were -likely -to -meet -by -four -or -fivefold -yet -it -was -never -their -purpose -to -attack -openly -but -only -when -the -victims -were -off -their -guard -when -they -got -hold -of -a -party -of -travelers -they -often -moved -along -in -their -company -several -days -using -all -manner -of -arts -to -win -their -friendship -and -get -their -confidence -at -last -when -this -was -accomplished -to -their -satisfaction -the -real -business -began -a -few -thugs -were -privately -detached -and -sent -forward -in -the -dark -to -select -a -good -killing -place -and -dig -the -graves -when -the -rest -reached -the -spot -a -halt -was -called -for -a -rest -or -a -smoke -the -travelers -were -invited -to -sit -by -signs -the -chief -appointed -certain -thugs -to -sit -down -in -front -of -the -travelers -as -if -to -wait -upon -them -others -to -sit -down -beside -them -and -engage -them -in -conversation -and -certain -expert -stranglers -to -stand -behind -the -travelers -and -be -ready -when -the -signal -was -given -the -signal -was -usually -some -commonplace -remark -like -bring -the -tobacco -sometimes -a -considerable -wait -ensued -after -all -the -actors -were -in -their -places -the -chief -was -biding -his -time -in -order -to -make -everything -sure -meantime -the -talk -droned -on -dim -figures -moved -about -in -the -dull -light -peace -and -tranquility -reigned -the -travelers -resigned -themselves -to -the -pleasant -reposefulness -and -comfort -of -the -situation -unconscious -of -the -death -angels -standing -motionless -at -their -backs -the -time -was -ripe -now -and -the -signal -came -bring -the -tobacco -there -was -a -mute -swift -movement -all -in -the -same -instant -the -men -at -each -victim's -sides -seized -his -hands -the -man -in -front -seized -his -feet -and -pulled -the -man -at -his -back -whipped -the -cloth -around -his -neck -and -gave -it -a -twist -the -head -sunk -forward -the -tragedy -was -over -the -bodies -were -stripped -and -covered -up -in -the -graves -the -spoil -packed -for -transportation -then -the -thugs -gave -pious -thanks -to -bhowanee -and -departed -on -further -holy -service -the -report -shows -that -the -travelers -moved -in -exceedingly -small -groups -twos -threes -fours -as -a -rule -a -party -with -a -dozen -in -it -was -rare -the -thugs -themselves -seem -to -have -been -the -only -people -who -moved -in -force -they -went -about -in -gangs -of -10 -15 -25 -40 -60 -100 -150 -200 -250 -and -one -gang -of -310 -is -mentioned -considering -their -numbers -their -catch -was -not -extraordinary -particularly -when -you -consider -that -they -were -not -in -the -least -fastidious -but -took -anybody -they -could -get -whether -rich -or -poor -and -sometimes -even -killed -children -now -and -then -they -killed -women -but -it -was -considered -sinful -to -do -it -and -unlucky -the -season -was -six -or -eight -months -long -one -season -the -half -dozen -bundelkand -and -gwalior -gangs -aggregated -712 -men -and -they -murdered -210 -people -one -season -the -malwa -and -kandeish -gangs -aggregated -702 -men -and -they -murdered -232 -one -season -the -kandeish -and -berar -gangs -aggregated -963 -men -and -they -murdered -385 -people -here -is -the -tally -sheet -of -a -gang -of -sixty -thugs -for -a -whole -season -gang -under -two -noted -chiefs -chotee -and -sheik -nungoo -from -gwalior -left -poora -in -jhansee -and -on -arrival -at -sarora -murdered -a -traveler -on -nearly -reaching -bhopal -met -3 -brahmins -and -murdered -them -cross -the -nerbudda -at -a -village -called -hutteea -murdered -a -hindoo -went -through -aurungabad -to -walagow -there -met -a -havildar -of -the -barber -caste -and -5 -sepoys -native -soldiers -in -the -evening -came -to -jokur -and -in -the -morning -killed -them -near -the -place -where -the -treasure -bearers -were -killed -the -year -before -between -jokur -and -dholeea -met -a -sepoy -of -the -shepherd -caste -killed -him -in -the -jungle -passed -through -dholeea -and -lodged -in -a -village -two -miles -beyond -on -the -road -to -indore -met -a -byragee -beggar -holy -mendicant -murdered -him -at -the -thapa -in -the -morning -beyond -the -thapa -fell -in -with -3 -marwarie -travelers -murdered -them -near -a -village -on -the -banks -of -the -taptee -met -4 -travelers -and -killed -them -between -choupra -and -dhoreea -met -a -marwarie -murdered -him -at -dhoreea -met -3 -marwaries -took -them -two -miles -and -murdered -them -two -miles -further -on -overtaken -by -three -treasure -bearers -took -them -two -miles -and -murdered -them -in -the -jungle -came -on -to -khurgore -bateesa -in -indore -divided -spoil -and -dispersed -a -total -of -27 -men -murdered -on -one -expedition -chotee -to -save -his -neck -was -informer -and -furnished -these -facts -several -things -are -noticeable -about -his -resume -1 -business -brevity -2 -absence -of -emotion -3 -smallness -of -the -parties -encountered -by -the -60 -4 -variety -in -character -and -quality -of -the -game -captured -5 -hindoo -and -mohammedan -chiefs -in -business -together -for -bhowanee -6 -the -sacred -caste -of -the -brahmins -not -respected -by -either -7 -nor -yet -the -character -of -that -mendicant -that -byragee -a -beggar -is -a -holy -creature -and -some -of -the -gangs -spared -him -on -that -account -no -matter -how -slack -business -might -be -but -other -gangs -slaughtered -not -only -him -but -even -that -sacredest -of -sacred -creatures -the -fakeer -that -repulsive -skin -and -bone -thing -that -goes -around -naked -and -mats -his -bushy -hair -with -dust -and -dirt -and -so -beflours -his -lean -body -with -ashes -that -he -looks -like -a -specter -sometimes -a -fakeer -trusted -a -shade -too -far -in -the -protection -of -his -sacredness -in -the -middle -of -a -tally -sheet -of -feringhea's -who -had -been -out -with -forty -thugs -i -find -a -case -of -the -kind -after -the -killing -of -thirty -nine -men -and -one -woman -the -fakeer -appears -on -the -scene -approaching -doregow -met -3 -pundits -also -a -fakeer -mounted -on -a -pony -he -was -plastered -over -with -sugar -to -collect -flies -and -was -covered -with -them -drove -off -the -fakeer -and -killed -the -other -three -leaving -doregow -the -fakeer -joined -again -and -went -on -in -company -to -raojana -met -6 -khutries -on -their -way -from -bombay -to -nagpore -drove -off -the -fakeer -with -stones -and -killed -the -6 -men -in -camp -and -buried -them -in -the -grove -next -day -the -fakeer -joined -again -made -him -leave -at -mana -beyond -there -fell -in -with -two -kahars -and -a -sepoy -and -came -on -towards -the -place -selected -for -the -murder -when -near -it -the -fakeer -came -again -losing -all -patience -with -him -gave -mithoo -one -of -the -gang -5 -rupees -$2 -50 -to -murder -him -and -take -the -sin -upon -himself -all -four -were -strangled -including -the -fakeer -surprised -to -find -among -the -fakeer's -effects -30 -pounds -of -coral -350 -strings -of -small -pearls -15 -strings -of -large -pearls -and -a -gilt -necklace -it -it -curious -the -little -effect -that -time -has -upon -a -really -interesting -circumstance -this -one -so -old -so -long -ago -gone -down -into -oblivion -reads -with -the -same -freshness -and -charm -that -attach -to -the -news -in -the -morning -paper -one's -spirits -go -up -then -down -then -up -again -following -the -chances -which -the -fakeer -is -running -now -you -hope -now -you -despair -now -you -hope -again -and -at -last -everything -comes -out -right -and -you -feel -a -great -wave -of -personal -satisfaction -go -weltering -through -you -and -without -thinking -you -put -out -your -hand -to -pat -mithoo -on -the -back -when -puff! -the -whole -thing -has -vanished -away -there -is -nothing -there -mithoo -and -all -the -crowd -have -been -dust -and -ashes -and -forgotten -oh -so -many -many -many -lagging -years! -and -then -comes -a -sense -of -injury -you -don't -know -whether -mithoo -got -the -swag -along -with -the -sin -or -had -to -divide -up -the -swag -and -keep -all -the -sin -himself -there -is -no -literary -art -about -a -government -report -it -stops -a -story -right -in -the -most -interesting -place -these -reports -of -thug -expeditions -run -along -interminably -in -one -monotonous -tune -met -a -sepoy -killed -him -met -5 -pundits -killed -them -met -4 -rajpoots -and -a -woman -killed -them -and -so -on -till -the -statistics -get -to -be -pretty -dry -but -this -small -trip -of -feringhea's -forty -had -some -little -variety -about -it -once -they -came -across -a -man -hiding -in -a -grave -a -thief -he -had -stolen -1 -100 -rupees -from -dhunroj -seith -of -parowtee -they -strangled -him -and -took -the -money -they -had -no -patience -with -thieves -they -killed -two -treasure -bearers -and -got -4 -000 -rupees -they -came -across -two -bullocks -laden -with -copper -pice -and -killed -the -four -drivers -and -took -the -money -there -must -have -been -half -a -ton -of -it -i -think -it -takes -a -double -handful -of -pice -to -make -an -anna -and -16 -annas -to -make -a -rupee -and -even -in -those -days -the -rupee -was -worth -only -half -a -dollar -coming -back -over -their -tracks -from -baroda -they -had -another -picturesque -stroke -of -luck -'the -lohars -of -oodeypore' -put -a -traveler -in -their -charge -for -safety -dear -dear -across -this -abyssmal -gulf -of -time -we -still -see -feringhea's -lips -uncover -his -teeth -and -through -the -dim -haze -we -catch -the -incandescent -glimmer -of -his -smile -he -accepted -that -trust -good -man -and -so -we -know -what -went -with -the -traveler -even -rajahs -had -no -terrors -for -feringhea -he -came -across -an -elephant -driver -belonging -to -the -rajah -of -oodeypore -and -promptly -strangled -him -a -total -of -100 -men -and -5 -women -murdered -on -this -expedition -among -the -reports -of -expeditions -we -find -mention -of -victims -of -almost -every -quality -and -estate -also -a -prince's -cook -and -even -the -water -carrier -of -that -sublime -lord -of -lords -and -king -of -kings -the -governor -general -of -india! -how -broad -they -were -in -their -tastes! -they -also -murdered -actors -poor -wandering -barnstormers -there -are -two -instances -recorded -the -first -one -by -a -gang -of -thugs -under -a -chief -who -soils -a -great -name -borne -by -a -better -man -kipling's -deathless -gungadin -after -murdering -4 -sepoys -going -on -toward -indore -met -4 -strolling -players -and -persuaded -them -to -come -with -us -on -the -pretense -that -we -would -see -their -performance -at -the -next -stage -murdered -them -at -a -temple -near -bhopal -second -instance -at -deohuttee -joined -by -comedians -murdered -them -eastward -of -that -place -but -this -gang -was -a -particularly -bad -crew -on -that -expedition -they -murdered -a -fakeer -and -twelve -beggars -and -yet -bhowanee -protected -them -for -once -when -they -were -strangling -a -man -in -a -wood -when -a -crowd -was -going -by -close -at -hand -and -the -noose -slipped -and -the -man -screamed -bhowanee -made -a -camel -burst -out -at -the -same -moment -with -a -roar -that -drowned -the -scream -and -before -the -man -could -repeat -it -the -breath -was -choked -out -of -his -body -the -cow -is -so -sacred -in -india -that -to -kill -her -keeper -is -an -awful -sacrilege -and -even -the -thugs -recognized -this -yet -now -and -then -the -lust -for -blood -was -too -strong -and -so -they -did -kill -a -few -cow -keepers -in -one -of -these -instances -the -witness -who -killed -the -cowherd -said -in -thuggee -this -is -strictly -forbidden -and -is -an -act -from -which -no -good -can -come -i -was -ill -of -a -fever -for -ten -days -afterward -i -do -believe -that -evil -will -follow -the -murder -of -a -man -with -a -cow -if -there -be -no -cow -it -does -not -signify -another -thug -said -he -held -the -cowherd's -feet -while -this -witness -did -the -strangling -he -felt -no -concern -because -the -bad -fortune -of -such -a -deed -is -upon -the -strangler -and -not -upon -the -assistants -even -if -there -should -be -a -hundred -of -them -there -were -thousands -of -thugs -roving -over -india -constantly -during -many -generations -they -made -thug -gee -a -hereditary -vocation -and -taught -it -to -their -sons -and -to -their -son's -sons -boys -were -in -full -membership -as -early -as -16 -years -of -age -veterans -were -still -at -work -at -70 -what -was -the -fascination -what -was -the -impulse -apparently -it -was -partly -piety -largely -gain -and -there -is -reason -to -suspect -that -the -sport -afforded -was -the -chiefest -fascination -of -all -meadows -taylor -makes -a -thug -in -one -of -his -books -claim -that -the -pleasure -of -killing -men -was -the -white -man's -beast -hunting -instinct -enlarged -refined -ennobled -i -will -quote -the -passage -chapter -xlvii -simple -rules -for -saving -money -to -save -half -when -you -are -fired -by -an -eager -impulse -to -contribute -to -a -charity -wait -and -count -forty -to -save -three -quarters -count -sixty -to -save -it -all -count -sixty -five -pudd'nhead -wilson's -new -calendar -the -thug -said -how -many -of -you -english -are -passionately -devoted -to -sporting! -your -days -and -months -are -passed -in -its -excitement -a -tiger -a -panther -a -buffalo -or -a -hog -rouses -your -utmost -energies -for -its -destruction -you -even -risk -your -lives -in -its -pursuit -how -much -higher -game -is -a -thug's! -that -must -really -be -the -secret -of -the -rise -and -development -of -thuggee -the -joy -of -killing! -the -joy -of -seeing -killing -done -these -are -traits -of -the -human -race -at -large -we -white -people -are -merely -modified -thugs -thugs -fretting -under -the -restraints -of -a -not -very -thick -skin -of -civilization -thugs -who -long -ago -enjoyed -the -slaughter -of -the -roman -arena -and -later -the -burning -of -doubtful -christians -by -authentic -christians -in -the -public -squares -and -who -now -with -the -thugs -of -spain -and -nimes -flock -to -enjoy -the -blood -and -misery -of -the -bullring -we -have -no -tourists -of -either -sex -or -any -religion -who -are -able -to -resist -the -delights -of -the -bull -ring -when -opportunity -offers -and -we -are -gentle -thugs -in -the -hunting -season -and -love -to -chase -a -tame -rabbit -and -kill -it -still -we -have -made -some -progress -microscopic -and -in -truth -scarcely -worth -mentioning -and -certainly -nothing -to -be -proud -of -still -it -is -progress -we -no -longer -take -pleasure -in -slaughtering -or -burning -helpless -men -we -have -reached -a -little -altitude -where -we -may -look -down -upon -the -indian -thugs -with -a -complacent -shudder -and -we -may -even -hope -for -a -day -many -centuries -hence -when -our -posterity -will -look -down -upon -us -in -the -same -way -there -are -many -indications -that -the -thug -often -hunted -men -for -the -mere -sport -of -it -that -the -fright -and -pain -of -the -quarry -were -no -more -to -him -than -are -the -fright -and -pain -of -the -rabbit -or -the -stag -to -us -and -that -he -was -no -more -ashamed -of -beguiling -his -game -with -deceits -and -abusing -its -trust -than -are -we -when -we -have -imitated -a -wild -animal's -call -and -shot -it -when -it -honored -us -with -its -confidence -and -came -to -see -what -we -wanted -madara -son -of -nihal -and -i -ramzam -set -out -from -kotdee -in -the -cold -weather -and -followed -the -high -road -for -about -twenty -days -in -search -of -travelers -until -we -came -to -selempore -where -we -met -a -very -old -man -going -to -the -east -we -won -his -confidence -in -this -manner -he -carried -a -load -which -was -too -heavy -for -his -old -age -i -said -to -him -'you -are -an -old -man -i -will -aid -you -in -carrying -your -load -as -you -are -from -my -part -of -the -country -' -he -said -'very -well -take -me -with -you -' -so -we -took -him -with -us -to -selempore -where -we -slept -that -night -we -woke -him -next -morning -before -dawn -and -set -out -and -at -the -distance -of -three -miles -we -seated -him -to -rest -while -it -was -still -very -dark -madara -was -ready -behind -him -and -strangled -him -he -never -spoke -a -word -he -was -about -60 -or -70 -years -of -age -another -gang -fell -in -with -a -couple -of -barbers -and -persuaded -them -to -come -along -in -their -company -by -promising -them -the -job -of -shaving -the -whole -crew -30 -thugs -at -the -place -appointed -for -the -murder -15 -got -shaved -and -actually -paid -the -barbers -for -their -work -then -killed -them -and -took -back -the -money -a -gang -of -forty -two -thugs -came -across -two -brahmins -and -a -shopkeeper -on -the -road -beguiled -them -into -a -grove -and -got -up -a -concert -for -their -entertainment -while -these -poor -fellows -were -listening -to -the -music -the -stranglers -were -standing -behind -them -and -at -the -proper -moment -for -dramatic -effect -they -applied -the -noose -the -most -devoted -fisherman -must -have -a -bite -at -least -as -often -as -once -a -week -or -his -passion -will -cool -and -he -will -put -up -his -tackle -the -tiger -sportsman -must -find -a -tiger -at -least -once -a -fortnight -or -he -will -get -tired -and -quit -the -elephant -hunter's -enthusiasm -will -waste -away -little -by -little -and -his -zeal -will -perish -at -last -if -he -plod -around -a -month -without -finding -a -member -of -that -noble -family -to -assassinate -but -when -the -lust -in -the -hunter's -heart -is -for -the -noblest -of -all -quarries -man -how -different -is -the -case! -and -how -watery -and -poor -is -the -zeal -and -how -childish -the -endurance -of -those -other -hunters -by -comparison -then -neither -hunger -nor -thirst -nor -fatigue -nor -deferred -hope -nor -monotonous -disappointment -nor -leaden -footed -lapse -of -time -can -conquer -the -hunter's -patience -or -weaken -the -joy -of -his -quest -or -cool -the -splendid -rage -of -his -desire -of -all -the -hunting -passions -that -burn -in -the -breast -of -man -there -is -none -that -can -lift -him -superior -to -discouragements -like -these -but -the -one -the -royal -sport -the -supreme -sport -whose -quarry -is -his -brother -by -comparison -tiger -hunting -is -a -colorless -poor -thing -for -all -it -has -been -so -bragged -about -why -the -thug -was -content -to -tramp -patiently -along -afoot -in -the -wasting -heat -of -india -week -after -week -at -an -average -of -nine -or -ten -miles -a -day -if -he -might -but -hope -to -find -game -some -time -or -other -and -refresh -his -longing -soul -with -blood -here -is -an -instance -i -ramzam -and -hyder -set -out -for -the -purpose -of -strangling -travelers -from -guddapore -and -proceeded -via -the -fort -of -julalabad -newulgunge -bangermow -on -the -banks -of -the -ganges -upwards -of -100 -miles -from -whence -we -returned -by -another -route -still -no -travelers! -till -we -reached -bowaneegunge -where -we -fell -in -with -a -traveler -a -boatman -we -inveigled -him -and -about -two -miles -east -of -there -hyder -strangled -him -as -he -stood -for -he -was -troubled -and -afraid -and -would -not -sit -we -then -made -a -long -journey -about -130 -miles -and -reached -hussunpore -bundwa -where -at -the -tank -we -fell -in -with -a -traveler -he -slept -there -that -night -next -morning -we -followed -him -and -tried -to -win -his -confidence -at -the -distance -of -two -miles -we -endeavored -to -induce -him -to -sit -down -but -he -would -not -having -become -aware -of -us -i -attempted -to -strangle -him -as -he -walked -along -but -did -not -succeed -both -of -us -then -fell -upon -him -he -made -a -great -outcry -'they -are -murdering -me!' -at -length -we -strangled -him -and -flung -his -body -into -a -well -after -this -we -returned -to -our -homes -having -been -out -a -month -and -traveled -about -260 -miles -a -total -of -two -men -murdered -on -the -expedition -and -here -is -another -case -related -by -the -terrible -futty -khan -a -man -with -a -tremendous -record -to -be -re -mentioned -by -and -by -i -with -three -others -traveled -for -about -45 -days -a -distance -of -about -200 -miles -in -search -of -victims -along -the -highway -to -bundwa -and -returned -by -davodpore -another -200 -miles -during -which -journey -we -had -only -one -murder -which -happened -in -this -manner -four -miles -to -the -east -of -noubustaghat -we -fell -in -with -a -traveler -an -old -man -i -with -koshal -and -hyder -inveigled -him -and -accompanied -him -that -day -within -3 -miles -of -rampoor -where -after -dark -in -a -lonely -place -we -got -him -to -sit -down -and -rest -and -while -i -kept -him -in -talk -seated -before -him -hyder -behind -strangled -him -he -made -no -resistance -koshal -stabbed -him -under -the -arms -and -in -the -throat -and -we -flung -the -body -into -a -running -stream -we -got -about -4 -or -5 -rupees -each -$2 -or -$2 -50 -we -then -proceeded -homewards -a -total -of -one -man -murdered -on -this -expedition -there -they -tramped -400 -miles -were -gone -about -three -months -and -harvested -two -dollars -and -a -half -apiece -but -the -mere -pleasure -of -the -hunt -was -sufficient -that -was -pay -enough -they -did -no -grumbling -every -now -and -then -in -this -big -book -one -comes -across -that -pathetic -remark -we -tried -to -get -him -to -sit -down -but -he -would -not -it -tells -the -whole -story -some -accident -had -awakened -the -suspicion -in -him -that -these -smooth -friends -who -had -been -petting -and -coddling -him -and -making -him -feel -so -safe -and -so -fortunate -after -his -forlorn -and -lonely -wanderings -were -the -dreaded -thugs -and -now -their -ghastly -invitation -to -sit -and -rest -had -confirmed -its -truth -he -knew -there -was -no -help -for -him -and -that -he -was -looking -his -last -upon -earthly -things -but -he -would -not -sit -no -not -that -it -was -too -awful -to -think -of! -there -are -a -number -of -instances -which -indicate -that -when -a -man -had -once -tasted -the -regal -joys -of -man -hunting -he -could -not -be -content -with -the -dull -monotony -of -a -crimeless -life -after -ward -example -from -a -thug's -testimony -we -passed -through -to -kurnaul -where -we -found -a -former -thug -named -junooa -an -old -comrade -of -ours -who -had -turned -religious -mendicant -and -become -a -disciple -and -holy -he -came -to -us -in -the -serai -and -weeping -with -joy -returned -to -his -old -trade -neither -wealth -nor -honors -nor -dignities -could -satisfy -a -reformed -thug -for -long -he -would -throw -them -all -away -someday -and -go -back -to -the -lurid -pleasures -of -hunting -men -and -being -hunted -himself -by -the -british -ramzam -was -taken -into -a -great -native -grandee's -service -and -given -authority -over -five -villages -my -authority -extended -over -these -people -to -summons -them -to -my -presence -to -make -them -stand -or -sit -i -dressed -well -rode -my -pony -and -had -two -sepoys -a -scribe -and -a -village -guard -to -attend -me -during -three -years -i -used -to -pay -each -village -a -monthly -visit -and -no -one -suspected -that -i -was -a -thug! -the -chief -man -used -to -wait -on -me -to -transact -business -and -as -i -passed -along -old -and -young -made -their -salaam -to -me -and -yet -during -that -very -three -years -he -got -leave -of -absence -to -attend -a -wedding -and -instead -went -off -on -a -thugging -lark -with -six -other -thugs -and -hunted -the -highway -for -fifteen -days! -with -satisfactory -results -afterwards -he -held -a -great -office -under -a -rajah -there -he -had -ten -miles -of -country -under -his -command -and -a -military -guard -of -fifteen -men -with -authority -to -call -out -2 -000 -more -upon -occasion -but -the -british -got -on -his -track -and -they -crowded -him -so -that -he -had -to -give -himself -up -see -what -a -figure -he -was -when -he -was -gotten -up -for -style -and -had -all -his -things -on -i -was -fully -armed -a -sword -shield -pistols -a -matchlock -musket -and -a -flint -gun -for -i -was -fond -of -being -thus -arrayed -and -when -so -armed -feared -not -though -forty -men -stood -before -me -he -gave -himself -up -and -proudly -proclaimed -himself -a -thug -then -by -request -he -agreed -to -betray -his -friend -and -pal -buhram -a -thug -with -the -most -tremendous -record -in -india -i -went -to -the -house -where -buhram -slept -often -has -he -led -our -gangs! -i -woke -him -he -knew -me -well -and -came -outside -to -me -it -was -a -cold -night -so -under -pretence -of -warming -myself -but -in -reality -to -have -light -for -his -seizure -by -the -guards -i -lighted -some -straw -and -made -a -blaze -we -were -warming -our -hands -the -guards -drew -around -us -i -said -to -them -'this -is -buhram -' -and -he -was -seized -just -as -a -cat -seizes -a -mouse -then -buhram -said -'i -am -a -thug! -my -father -was -a -thug -my -grandfather -was -a -thug -and -i -have -thugged -with -many!' -so -spoke -the -mighty -hunter -the -mightiest -of -the -mighty -the -gordon -cumming -of -his -day -not -much -regret -noticeable -in -it -[ -having -planted -a -bullet -in -the -shoulder -bone -of -an -elephant -and -caused -the -agonized -creature -to -lean -for -support -against -a -tree -i -proceeded -to -brew -some -coffee -having -refreshed -myself -taking -observations -of -the -elephant's -spasms -and -writhings -between -the -sips -i -resolved -to -make -experiments -on -vulnerable -points -and -approaching -very -near -i -fired -several -bullets -at -different -parts -of -his -enormous -skull -he -only -acknowledged -the -shots -by -a -salaam -like -movement -of -his -trunk -with -the -point -of -which -he -gently -touched -the -wounds -with -a -striking -and -peculiar -action -surprised -and -shocked -to -find -that -i -was -only -prolonging -the -suffering -of -the -noble -beast -which -bore -its -trials -with -such -dignified -composure -i -resolved -to -finish -the -proceeding -with -all -possible -despatch -and -accordingly -opened -fire -upon -him -from -the -left -side -aiming -at -the -shoulder -i -fired -six -shots -with -the -two -grooved -rifle -which -must -have -eventually -proved -mortal -after -which -i -fired -six -shots -at -the -same -part -with -the -dutch -six -founder -large -tears -now -trickled -down -from -his -eyes -which -he -slowly -shut -and -opened -his -colossal -frame -shivered -convulsively -and -falling -on -his -side -he -expired -gordon -cumming -] -so -many -many -times -this -official -report -leaves -one's -curiosity -unsatisfied -for -instance -here -is -a -little -paragraph -out -of -the -record -of -a -certain -band -of -193 -thugs -which -has -that -defect -fell -in -with -lall -sing -subahdar -and -his -family -consisting -of -nine -persons -traveled -with -them -two -days -and -the -third -put -them -all -to -death -except -the -two -children -little -boys -of -one -and -a -half -years -old -there -it -stops -what -did -they -do -with -those -poor -little -fellows -what -was -their -subsequent -history -did -they -purpose -training -them -up -as -thugs -how -could -they -take -care -of -such -little -creatures -on -a -march -which -stretched -over -several -months -no -one -seems -to -have -cared -to -ask -any -questions -about -the -babies -but -i -do -wish -i -knew -one -would -be -apt -to -imagine -that -the -thugs -were -utterly -callous -utterly -destitute -of -human -feelings -heartless -toward -their -own -families -as -well -as -toward -other -people's -but -this -was -not -so -like -all -other -indians -they -had -a -passionate -love -for -their -kin -a -shrewd -british -officer -who -knew -the -indian -character -took -that -characteristic -into -account -in -laying -his -plans -for -the -capture -of -eugene -sue's -famous -feringhea -he -found -out -feringhea's -hiding -place -and -sent -a -guard -by -night -to -seize -him -but -the -squad -was -awkward -and -he -got -away -however -they -got -the -rest -of -the -family -the -mother -wife -child -and -brother -and -brought -them -to -the -officer -at -jubbulpore -the -officer -did -not -fret -but -bided -his -time -i -knew -feringhea -would -not -go -far -while -links -so -dear -to -him -were -in -my -hands -he -was -right -feringhea -knew -all -the -danger -he -was -running -by -staying -in -the -neighborhood -still -he -could -not -tear -himself -away -the -officer -found -that -he -divided -his -time -between -five -villages -where -be -had -relatives -and -friends -who -could -get -news -for -him -from -his -family -in -jubbulpore -jail -and -that -he -never -slept -two -consecutive -nights -in -the -same -village -the -officer -traced -out -his -several -haunts -then -pounced -upon -all -the -five -villages -on -the -one -night -and -at -the -same -hour -and -got -his -man -another -example -of -family -affection -a -little -while -previously -to -the -capture -of -feringhea's -family -the -british -officer -had -captured -feringhea's -foster -brother -leader -of -a -gang -of -ten -and -had -tried -the -eleven -and -condemned -them -to -be -hanged -feringhea's -captured -family -arrived -at -the -jail -the -day -before -the -execution -was -to -take -place -the -foster -brother -jhurhoo -entreated -to -be -allowed -to -see -the -aged -mother -and -the -others -the -prayer -was -granted -and -this -is -what -took -place -it -is -the -british -officer -who -speaks -in -the -morning -just -before -going -to -the -scaffold -the -interview -took -place -before -me -he -fell -at -the -old -woman's -feet -and -begged -that -she -would -relieve -him -from -the -obligations -of -the -milk -with -which -she -had -nourished -him -from -infancy -as -he -was -about -to -die -before -he -could -fulfill -any -of -them -she -placed -her -hands -on -his -head -and -he -knelt -and -she -said -she -forgave -him -all -and -bid -him -die -like -a -man -if -a -capable -artist -should -make -a -picture -of -it -it -would -be -full -of -dignity -and -solemnity -and -pathos -and -it -could -touch -you -you -would -imagine -it -to -be -anything -but -what -it -was -there -is -reverence -there -and -tenderness -and -gratefulness -and -compassion -and -resignation -and -fortitude -and -self -respect -and -no -sense -of -disgrace -no -thought -of -dishonor -everything -is -there -that -goes -to -make -a -noble -parting -and -give -it -a -moving -grace -and -beauty -and -dignity -and -yet -one -of -these -people -is -a -thug -and -the -other -a -mother -of -thugs! -the -incongruities -of -our -human -nature -seem -to -reach -their -limit -here -i -wish -to -make -note -of -one -curious -thing -while -i -think -of -it -one -of -the -very -commonest -remarks -to -be -found -in -this -bewildering -array -of -thug -confessions -is -this -strangled -him -and -threw -him -an -a -well! -in -one -case -they -threw -sixteen -into -a -well -and -they -had -thrown -others -in -the -same -well -before -it -makes -a -body -thirsty -to -read -about -it -and -there -is -another -very -curious -thing -the -bands -of -thugs -had -private -graveyards -they -did -not -like -to -kill -and -bury -at -random -here -and -there -and -everywhere -they -preferred -to -wait -and -toll -the -victims -along -and -get -to -one -of -their -regular -burying -places -'bheels' -if -they -could -in -the -little -kingdom -of -oude -which -was -about -half -as -big -as -ireland -and -about -as -big -as -the -state -of -maine -they -had -two -hundred -and -seventy -four -'bheels' -they -were -scattered -along -fourteen -hundred -miles -of -road -at -an -average -of -only -five -miles -apart -and -the -british -government -traced -out -and -located -each -and -every -one -of -them -and -set -them -down -on -the -map -the -oude -bands -seldom -went -out -of -their -own -country -but -they -did -a -thriving -business -within -its -borders -so -did -outside -bands -who -came -in -and -helped -some -of -the -thug -leaders -of -oude -were -noted -for -their -successful -careers -each -of -four -of -them -confessed -to -above -300 -murders -another -to -nearly -400 -our -friend -ramzam -to -604 -he -is -the -one -who -got -leave -of -absence -to -attend -a -wedding -and -went -thugging -instead -and -he -is -also -the -one -who -betrayed -buhram -to -the -british -but -the -biggest -records -of -all -were -the -murder -lists -of -futty -khan -and -buhram -futty -khan's -number -is -smaller -than -ramzam's -but -he -is -placed -at -the -head -because -his -average -is -the -best -in -oude -thug -history -per -year -of -service -his -slaughter -was -508 -men -in -twenty -years -and -he -was -still -a -young -man -when -the -british -stopped -his -industry -buhram's -list -was -931 -murders -but -it -took -him -forty -years -his -average -was -one -man -and -nearly -all -of -another -man -per -month -for -forty -years -but -futty -khan's -average -was -two -men -and -a -little -of -another -man -per -month -during -his -twenty -years -of -usefulness -there -is -one -very -striking -thing -which -i -wish -to -call -attention -to -you -have -surmised -from -the -listed -callings -followed -by -the -victims -of -the -thugs -that -nobody -could -travel -the -indian -roads -unprotected -and -live -to -get -through -that -the -thugs -respected -no -quality -no -vocation -no -religion -nobody -that -they -killed -every -unarmed -man -that -came -in -their -way -that -is -wholly -true -with -one -reservation -in -all -the -long -file -of -thug -confessions -an -english -traveler -is -mentioned -but -once -and -this -is -what -the -thug -says -of -the -circumstance -he -was -on -his -way -from -mhow -to -bombay -we -studiously -avoided -him -he -proceeded -next -morning -with -a -number -of -travelers -who -had -sought -his -protection -and -they -took -the -road -to -baroda -we -do -not -know -who -he -was -he -flits -across -the -page -of -this -rusty -old -book -and -disappears -in -the -obscurity -beyond -but -he -is -an -impressive -figure -moving -through -that -valley -of -death -serene -and -unafraid -clothed -in -the -might -of -the -english -name -we -have -now -followed -the -big -official -book -through -and -we -understand -what -thuggee -was -what -a -bloody -terror -it -was -what -a -desolating -scourge -it -was -in -1830 -the -english -found -this -cancerous -organization -imbedded -in -the -vitals -of -the -empire -doing -its -devastating -work -in -secrecy -and -assisted -protected -sheltered -and -hidden -by -innumerable -confederates -big -and -little -native -chiefs -customs -officers -village -officials -and -native -police -all -ready -to -lie -for -it -and -the -mass -of -the -people -through -fear -persistently -pretending -to -know -nothing -about -its -doings -and -this -condition -of -things -had -existed -for -generations -and -was -formidable -with -the -sanctions -of -age -and -old -custom -if -ever -there -was -an -unpromising -task -if -ever -there -was -a -hopeless -task -in -the -world -surely -it -was -offered -here -the -task -of -conquering -thuggee -but -that -little -handful -of -english -officials -in -india -set -their -sturdy -and -confident -grip -upon -it -and -ripped -it -out -root -and -branch! -how -modest -do -captain -vallancey's -words -sound -now -when -we -read -them -again -knowing -what -we -know -the -day -that -sees -this -far -spread -evil -completely -eradicated -from -india -and -known -only -in -name -will -greatly -tend -to -immortalize -british -rule -in -the -east -it -would -be -hard -to -word -a -claim -more -modestly -than -that -for -this -most -noble -work -chapter -xlviii -grief -can -take -care -of -itself -but -to -get -the -full -value -of -a -joy -you -must -have -somebody -to -divide -it -with -pudd'nhead -wilson's -new -calendar -we -left -bombay -for -allahabad -by -a -night -train -it -is -the -custom -of -the -country -to -avoid -day -travel -when -it -can -conveniently -be -done -but -there -is -one -trouble -while -you -can -seemingly -secure -the -two -lower -berths -by -making -early -application -there -is -no -ticket -as -witness -of -it -and -no -other -producible -evidence -in -case -your -proprietorship -shall -chance -to -be -challenged -the -word -engaged -appears -on -the -window -but -it -doesn't -state -who -the -compartment -is -engaged -for -if -your -satan -and -your -barney -arrive -before -somebody -else's -servants -and -spread -the -bedding -on -the -two -sofas -and -then -stand -guard -till -you -come -all -will -be -well -but -if -they -step -aside -on -an -errand -they -may -find -the -beds -promoted -to -the -two -shelves -and -somebody -else's -demons -standing -guard -over -their -master's -beds -which -in -the -meantime -have -been -spread -upon -your -sofas -you -do -not -pay -anything -extra -for -your -sleeping -place -that -is -where -the -trouble -lies -if -you -buy -a -fare -ticket -and -fail -to -use -it -there -is -room -thus -made -available -for -someone -else -but -if -the -place -were -secured -to -you -it -would -remain -vacant -and -yet -your -ticket -would -secure -you -another -place -when -you -were -presently -ready -to -travel -however -no -explanation -of -such -a -system -can -make -it -seem -quite -rational -to -a -person -who -has -been -used -to -a -more -rational -system -if -our -people -had -the -arranging -of -it -we -should -charge -extra -for -securing -the -place -and -then -the -road -would -suffer -no -loss -if -the -purchaser -did -not -occupy -it -the -present -system -encourages -good -manners -and -also -discourages -them -if -a -young -girl -has -a -lower -berth -and -an -elderly -lady -comes -in -it -is -usual -for -the -girl -to -offer -her -place -to -this -late -comer -and -it -is -usual -for -the -late -comer -to -thank -her -courteously -and -take -it -but -the -thing -happens -differently -sometimes -when -we -were -ready -to -leave -bombay -my -daughter's -satchels -were -holding -possession -of -her -berth -a -lower -one -at -the -last -moment -a -middle -aged -american -lady -swarmed -into -the -compartment -followed -by -native -porters -laden -with -her -baggage -she -was -growling -and -snarling -and -scolding -and -trying -to -make -herself -phenomenally -disagreeable -and -succeeding -without -a -word -she -hoisted -the -satchels -into -the -hanging -shelf -and -took -possession -of -that -lower -berth -on -one -of -our -trips -mr -smythe -and -i -got -out -at -a -station -to -walk -up -and -down -and -when -we -came -back -smythe's -bed -was -in -the -hanging -shelf -and -an -english -cavalry -officer -was -in -bed -on -the -sofa -which -he -had -lately -been -occupying -it -was -mean -to -be -glad -about -it -but -it -is -the -way -we -are -made -i -could -not -have -been -gladder -if -it -had -been -my -enemy -that -had -suffered -this -misfortune -we -all -like -to -see -people -in -trouble -if -it -doesn't -cost -us -anything -i -was -so -happy -over -mr -smythe's -chagrin -that -i -couldn't -go -to -sleep -for -thinking -of -it -and -enjoying -it -i -knew -he -supposed -the -officer -had -committed -the -robbery -himself -whereas -without -a -doubt -the -officer's -servant -had -done -it -without -his -knowledge -mr -smythe -kept -this -incident -warm -in -his -heart -and -longed -for -a -chance -to -get -even -with -somebody -for -it -sometime -afterward -the -opportunity -came -in -calcutta -we -were -leaving -on -a -24 -hour -journey -to -darjeeling -mr -barclay -the -general -superintendent -has -made -special -provision -for -our -accommodation -mr -smythe -said -so -there -was -no -need -to -hurry -about -getting -to -the -train -consequently -we -were -a -little -late -when -we -arrived -the -usual -immense -turmoil -and -confusion -of -a -great -indian -station -were -in -full -blast -it -was -an -immoderately -long -train -for -all -the -natives -of -india -were -going -by -it -somewhither -and -the -native -officials -were -being -pestered -to -frenzy -by -belated -and -anxious -people -they -didn't -know -where -our -car -was -and -couldn't -remember -having -received -any -orders -about -it -it -was -a -deep -disappointment -moreover -it -looked -as -if -our -half -of -our -party -would -be -left -behind -altogether -then -satan -came -running -and -said -he -had -found -a -compartment -with -one -shelf -and -one -sofa -unoccupied -and -had -made -our -beds -and -had -stowed -our -baggage -we -rushed -to -the -place -and -just -as -the -train -was -ready -to -pull -out -and -the -porters -were -slamming -the -doors -to -all -down -the -line -an -officer -of -the -indian -civil -service -a -good -friend -of -ours -put -his -head -in -and -said -i -have -been -hunting -for -you -everywhere -what -are -you -doing -here -don't -you -know -the -train -started -before -he -could -finish -mr -smythe's -opportunity -was -come -his -bedding -on -the -shelf -at -once -changed -places -with -the -bedding -a -stranger's -that -was -occupying -the -sofa -that -was -opposite -to -mine -about -ten -o'clock -we -stopped -somewhere -and -a -large -englishman -of -official -military -bearing -stepped -in -we -pretended -to -be -asleep -the -lamps -were -covered -but -there -was -light -enough -for -us -to -note -his -look -of -surprise -he -stood -there -grand -and -fine -peering -down -at -smythe -and -wondering -in -silence -at -the -situation -after -a -bit -be -said -well! -and -that -was -all -but -that -was -enough -it -was -easy -to -understand -it -meant -this -is -extraordinary -this -is -high -handed -i -haven't -had -an -experience -like -this -before -he -sat -down -on -his -baggage -and -for -twenty -minutes -we -watched -him -through -our -eyelashes -rocking -and -swaying -there -to -the -motion -of -the -train -then -we -came -to -a -station -and -he -got -up -and -went -out -muttering -i -must -find -a -lower -berth -or -wait -over -his -servant -came -presently -and -carried -away -his -things -mr -smythe's -sore -place -was -healed -his -hunger -for -revenge -was -satisfied -but -he -couldn't -sleep -and -neither -could -i -for -this -was -a -venerable -old -car -and -nothing -about -it -was -taut -the -closet -door -slammed -all -night -and -defied -every -fastening -we -could -invent -we -got -up -very -much -jaded -at -dawn -and -stepped -out -at -a -way -station -and -while -we -were -taking -a -cup -of -coffee -that -englishman -ranged -up -alongside -and -somebody -said -to -him -so -you -didn't -stop -off -after -all -no -the -guard -found -a -place -for -me -that -had -been -engaged -and -not -occupied -i -had -a -whole -saloon -car -all -to -myself -oh -quite -palatial! -i -never -had -such -luck -in -my -life -that -was -our -car -you -see -we -moved -into -it -straight -off -the -family -and -all -but -i -asked -the -english -gentleman -to -remain -and -he -did -a -pleasant -man -an -infantry -colonel -and -doesn't -know -yet -that -smythe -robbed -him -of -his -berth -but -thinks -it -was -done -by -smythe's -servant -without -smythe's -knowledge -he -was -assisted -in -gathering -this -impression -the -indian -trains -are -manned -by -natives -exclusively -the -indian -stations -except -very -large -and -important -ones -are -manned -entirely -by -natives -and -so -are -the -posts -and -telegraphs -the -rank -and -file -of -the -police -are -natives -all -these -people -are -pleasant -and -accommodating -one -day -i -left -an -express -train -to -lounge -about -in -that -perennially -ravishing -show -the -ebb -and -flow -and -whirl -of -gaudy -natives -that -is -always -surging -up -and -down -the -spacious -platform -of -a -great -indian -station -and -i -lost -myself -in -the -ecstasy -of -it -and -when -i -turned -the -train -was -moving -swiftly -away -i -was -going -to -sit -down -and -wait -for -another -train -as -i -would -have -done -at -home -i -had -no -thought -of -any -other -course -but -a -native -official -who -had -a -green -flag -in -his -hand -saw -me -and -said -politely -don't -you -belong -in -the -train -sir -yes -i -said -he -waved -his -flag -and -the -train -came -back! -and -he -put -me -aboard -with -as -much -ceremony -as -if -i -had -been -the -general -superintendent -they -are -kindly -people -the -natives -the -face -and -the -bearing -that -indicate -a -surly -spirit -and -a -bad -heart -seemed -to -me -to -be -so -rare -among -indians -so -nearly -non -existent -in -fact -that -i -sometimes -wondered -if -thuggee -wasn't -a -dream -and -not -a -reality -the -bad -hearts -are -there -but -i -believe -that -they -are -in -a -small -poor -minority -one -thing -is -sure -they -are -much -the -most -interesting -people -in -the -world -and -the -nearest -to -being -incomprehensible -at -any -rate -the -hardest -to -account -for -their -character -and -their -history -their -customs -and -their -religion -confront -you -with -riddles -at -every -turn -riddles -which -are -a -trifle -more -perplexing -after -they -are -explained -than -they -were -before -you -can -get -the -facts -of -a -custom -like -caste -and -suttee -and -thuggee -and -so -on -and -with -the -facts -a -theory -which -tries -to -explain -but -never -quite -does -it -to -your -satisfaction -you -can -never -quite -understand -how -so -strange -a -thing -could -have -been -born -nor -why -for -instance -the -suttee -this -is -the -explanation -of -it -a -woman -who -throws -away -her -life -when -her -husband -dies -is -instantly -joined -to -him -again -and -is -forever -afterward -happy -with -him -in -heaven -her -family -will -build -a -little -monument -to -her -or -a -temple -and -will -hold -her -in -honor -and -indeed -worship -her -memory -always -they -will -themselves -be -held -in -honor -by -the -public -the -woman's -self -sacrifice -has -conferred -a -noble -and -lasting -distinction -upon -her -posterity -and -besides -see -what -she -has -escaped -if -she -had -elected -to -live -she -would -be -a -disgraced -person -she -could -not -remarry -her -family -would -despise -her -and -disown -her -she -would -be -a -friendless -outcast -and -miserable -all -her -days -very -well -you -say -but -the -explanation -is -not -complete -yet -how -did -people -come -to -drift -into -such -a -strange -custom -what -was -the -origin -of -the -idea -well -nobody -knows -it -was -probably -a -revelation -sent -down -by -the -gods -one -more -thing -why -was -such -a -cruel -death -chosen -why -wouldn't -a -gentle -one -have -answered -nobody -knows -maybe -that -was -a -revelation -too -no -you -can -never -understand -it -it -all -seems -impossible -you -resolve -to -believe -that -a -widow -never -burnt -herself -willingly -but -went -to -her -death -because -she -was -afraid -to -defy -public -opinion -but -you -are -not -able -to -keep -that -position -history -drives -you -from -it -major -sleeman -has -a -convincing -case -in -one -of -his -books -in -his -government -on -the -nerbudda -he -made -a -brave -attempt -on -the -28th -of -march -1828 -to -put -down -suttee -on -his -own -hook -and -without -warrant -from -the -supreme -government -of -india -he -could -not -foresee -that -the -government -would -put -it -down -itself -eight -months -later -the -only -backing -he -had -was -a -bold -nature -and -a -compassionate -heart -he -issued -his -proclamation -abolishing -the -suttee -in -his -district -on -the -morning -of -tuesday -note -the -day -of -the -week -the -24th -of -the -following -november -ummed -singh -upadhya -head -of -the -most -respectable -and -most -extensive -brahmin -family -in -the -district -died -and -presently -came -a -deputation -of -his -sons -and -grandsons -to -beg -that -his -old -widow -might -be -allowed -to -burn -herself -upon -his -pyre -sleeman -threatened -to -enforce -his -order -and -punish -severely -any -man -who -assisted -and -he -placed -a -police -guard -to -see -that -no -one -did -so -from -the -early -morning -the -old -widow -of -sixty -five -had -been -sitting -on -the -bank -of -the -sacred -river -by -her -dead -waiting -through -the -long -hours -for -the -permission -and -at -last -the -refusal -came -instead -in -one -little -sentence -sleeman -gives -you -a -pathetic -picture -of -this -lonely -old -gray -figure -all -day -and -all -night -she -remained -sitting -by -the -edge -of -the -water -without -eating -or -drinking -the -next -morning -the -body -of -the -husband -was -burned -to -ashes -in -a -pit -eight -feet -square -and -three -or -four -feet -deep -in -the -view -of -several -thousand -spectators -then -the -widow -waded -out -to -a -bare -rock -in -the -river -and -everybody -went -away -but -her -sons -and -other -relations -all -day -she -sat -there -on -her -rock -in -the -blazing -sun -without -food -or -drink -and -with -no -clothing -but -a -sheet -over -her -shoulders -the -relatives -remained -with -her -and -all -tried -to -persuade -her -to -desist -from -her -purpose -for -they -deeply -loved -her -she -steadily -refused -then -a -part -of -the -family -went -to -sleeman's -house -ten -miles -away -and -tried -again -to -get -him -to -let -her -burn -herself -he -refused -hoping -to -save -her -yet -all -that -day -she -scorched -in -her -sheet -on -the -rock -and -all -that -night -she -kept -her -vigil -there -in -the -bitter -cold -thursday -morning -in -the -sight -of -her -relatives -she -went -through -a -ceremonial -which -said -more -to -them -than -any -words -could -have -done -she -put -on -the -dhaja -a -coarse -red -turban -and -broke -her -bracelets -in -pieces -by -these -acts -she -became -a -dead -person -in -the -eye -of -the -law -and -excluded -from -her -caste -forever -by -the -iron -rule -of -ancient -custom -if -she -should -now -choose -to -live -she -could -never -return -to -her -family -sleeman -was -in -deep -trouble -if -she -starved -herself -to -death -her -family -would -be -disgraced -and -moreover -starving -would -be -a -more -lingering -misery -than -the -death -by -fire -he -went -back -in -the -evening -thoroughly -worried -the -old -woman -remained -on -her -rock -and -there -in -the -morning -he -found -her -with -her -dhaja -still -on -her -head -she -talked -very -collectedly -telling -me -that -she -had -determined -to -mix -her -ashes -with -those -of -her -departed -husband -and -should -patiently -wait -my -permission -to -do -so -assured -that -god -would -enable -her -to -sustain -life -till -that -was -given -though -she -dared -not -eat -or -drink -looking -at -the -sun -then -rising -before -her -over -a -long -and -beautiful -reach -of -the -river -she -said -calmly -'my -soul -has -been -for -five -days -with -my -husband's -near -that -sun -nothing -but -my -earthly -frame -is -left -and -this -i -know -you -will -in -time -suffer -to -be -mixed -with -his -ashes -in -yonder -pit -because -it -is -not -in -your -nature -or -usage -wantonly -to -prolong -the -miseries -of -a -poor -old -woman -' -he -assured -her -that -it -was -his -desire -and -duty -to -save -her -and -to -urge -her -to -live -and -to -keep -her -family -from -the -disgrace -of -being -thought -her -murderers -but -she -said -she -was -not -afraid -of -their -being -thought -so -that -they -had -all -like -good -children -done -everything -in -their -power -to -induce -her -to -live -and -to -abide -with -them -and -if -i -should -consent -i -know -they -would -love -and -honor -me -but -my -duties -to -them -have -now -ended -i -commit -them -all -to -your -care -and -i -go -to -attend -my -husband -ummed -singh -upadhya -with -whose -ashes -on -the -funeral -pile -mine -have -been -already -three -times -mixed -she -believed -that -she -and -he -had -been -upon -the -earth -three -several -times -as -wife -and -husband -and -that -she -had -burned -herself -to -death -three -times -upon -his -pyre -that -is -why -she -said -that -strange -thing -since -she -had -broken -her -bracelets -and -put -on -the -red -turban -she -regarded -herself -as -a -corpse -otherwise -she -would -not -have -allowed -herself -to -do -her -husband -the -irreverence -of -pronouncing -his -name -this -was -the -first -time -in -her -long -life -that -she -had -ever -uttered -her -husband's -name -for -in -india -no -woman -high -or -low -ever -pronounces -the -name -of -her -husband -major -sleeman -still -tried -to -shake -her -purpose -he -promised -to -build -her -a -fine -house -among -the -temples -of -her -ancestors -upon -the -bank -of -the -river -and -make -handsome -provision -for -her -out -of -rent -free -lands -if -she -would -consent -to -live -and -if -she -wouldn't -he -would -allow -no -stone -or -brick -to -ever -mark -the -place -where -she -died -but -she -only -smiled -and -said -my -pulse -has -long -ceased -to -beat -my -spirit -has -departed -i -shall -suffer -nothing -in -the -burning -and -if -you -wish -proof -order -some -fire -and -you -shall -see -this -arm -consumed -without -giving -me -any -pain -sleeman -was -now -satisfied -that -he -could -not -alter -her -purpose -he -sent -for -all -the -chief -members -of -the -family -and -said -he -would -suffer -her -to -burn -herself -if -they -would -enter -into -a -written -engagement -to -abandon -the -suttee -in -their -family -thenceforth -they -agreed -the -papers -were -drawn -out -and -signed -and -at -noon -saturday -word -was -sent -to -the -poor -old -woman -she -seemed -greatly -pleased -the -ceremonies -of -bathing -were -gone -through -with -and -by -three -o'clock -she -was -ready -and -the -fire -was -briskly -burning -in -the -pit -she -had -now -gone -without -food -or -drink -during -more -than -four -days -and -a -half -she -came -ashore -from -her -rock -first -wetting -her -sheet -in -the -waters -of -the -sacred -river -for -without -that -safeguard -any -shadow -which -might -fall -upon -her -would -convey -impurity -to -her -then -she -walked -to -the -pit -leaning -upon -one -of -her -sons -and -a -nephew -the -distance -was -a -hundred -and -fifty -yards -i -had -sentries -placed -all -around -and -no -other -person -was -allowed -to -approach -within -five -paces -she -came -on -with -a -calm -and -cheerful -countenance -stopped -once -and -casting -her -eyes -upwards -said -'why -have -they -kept -me -five -days -from -thee -my -husband -' -on -coming -to -the -sentries -her -supporters -stopped -and -remained -standing -she -moved -on -and -walked -once -around -the -pit -paused -a -moment -and -while -muttering -a -prayer -threw -some -flowers -into -the -fire -she -then -walked -up -deliberately -and -steadily -to -the -brink -stepped -into -the -centre -of -the -flame -sat -down -and -leaning -back -in -the -midst -as -if -reposing -upon -a -couch -was -consumed -without -uttering -a -shriek -or -betraying -one -sign -of -agony -it -is -fine -and -beautiful -it -compels -one's -reverence -and -respect -no -has -it -freely -and -without -compulsion -we -see -how -the -custom -once -started -could -continue -for -the -soul -of -it -is -that -stupendous -power -faith -faith -brought -to -the -pitch -of -effectiveness -by -the -cumulative -force -of -example -and -long -use -and -custom -but -we -cannot -understand -how -the -first -widows -came -to -take -to -it -that -is -a -perplexing -detail -sleeman -says -that -it -was -usual -to -play -music -at -the -suttee -but -that -the -white -man's -notion -that -this -was -to -drown -the -screams -of -the -martyr -is -not -correct -that -it -had -a -quite -different -purpose -it -was -believed -that -the -martyr -died -prophecying -that -the -prophecies -sometimes -foretold -disaster -and -it -was -considered -a -kindness -to -those -upon -whom -it -was -to -fall -to -drown -the -voice -and -keep -them -in -ignorance -of -the -misfortune -that -was -to -come -chapter -xlix -he -had -had -much -experience -of -physicians -and -said -the -only -way -to -keep -your -health -is -to -eat -what -you -don't -want -drink -what -you -don't -like -and -do -what -you'd -druther -not -pudd'nhead -wilson's -new -calendar -it -was -a -long -journey -two -nights -one -day -and -part -of -another -day -from -bombay -eastward -to -allahabad -but -it -was -always -interesting -and -it -was -not -fatiguing -at -first -the -night -travel -promised -to -be -fatiguing -but -that -was -on -account -of -pyjamas -this -foolish -night -dress -consists -of -jacket -and -drawers -sometimes -they -are -made -of -silk -sometimes -of -a -raspy -scratchy -slazy -woolen -material -with -a -sandpaper -surface -the -drawers -are -loose -elephant -legged -and -elephant -waisted -things -and -instead -of -buttoning -around -the -body -there -is -a -drawstring -to -produce -the -required -shrinkage -the -jacket -is -roomy -and -one -buttons -it -in -front -pyjamas -are -hot -on -a -hot -night -and -cold -on -a -cold -night -defects -which -a -nightshirt -is -free -from -i -tried -the -pyjamas -in -order -to -be -in -the -fashion -but -i -was -obliged -to -give -them -up -i -couldn't -stand -them -there -was -no -sufficient -change -from -day -gear -to -night -gear -i -missed -the -refreshing -and -luxurious -sense -induced -by -the -night -gown -of -being -undressed -emancipated -set -free -from -restraints -and -trammels -in -place -of -that -i -had -the -worried -confined -oppressed -suffocated -sense -of -being -abed -with -my -clothes -on -all -through -the -warm -half -of -the -night -the -coarse -surfaces -irritated -my -skin -and -made -it -feel -baked -and -feverish -and -the -dreams -which -came -in -the -fitful -flurries -of -slumber -were -such -as -distress -the -sleep -of -the -damned -or -ought -to -and -all -through -the -cold -other -half -of -the -night -i -could -get -no -time -for -sleep -because -i -had -to -employ -it -all -in -stealing -blankets -but -blankets -are -of -no -value -at -such -a -time -the -higher -they -are -piled -the -more -effectively -they -cork -the -cold -in -and -keep -it -from -getting -out -the -result -is -that -your -legs -are -ice -and -you -know -how -you -will -feel -by -and -by -when -you -are -buried -in -a -sane -interval -i -discarded -the -pyjamas -and -led -a -rational -and -comfortable -life -thenceforth -out -in -the -country -in -india -the -day -begins -early -one -sees -a -plain -perfectly -flat -dust -colored -and -brick -yardy -stretching -limitlessly -away -on -every -side -in -the -dim -gray -light -striped -everywhere -with -hard -beaten -narrow -paths -the -vast -flatness -broken -at -wide -intervals -by -bunches -of -spectral -trees -that -mark -where -villages -are -and -along -all -the -paths -are -slender -women -and -the -black -forms -of -lanky -naked -men -moving -to -their -work -the -women -with -brass -water -jars -on -their -heads -the -men -carrying -hoes -the -man -is -not -entirely -naked -always -there -is -a -bit -of -white -rag -a -loin -cloth -it -amounts -to -a -bandage -and -is -a -white -accent -on -his -black -person -like -the -silver -band -around -the -middle -of -a -pipe -stem -sometimes -he -also -wears -a -fluffy -and -voluminous -white -turban -and -this -adds -a -second -accent -he -then -answers -properly -to -miss -gordon -cumming's -flash -light -picture -of -him -as -a -person -who -is -dressed -in -a -turban -and -a -pocket -handkerchief -all -day -long -one -has -this -monotony -of -dust -colored -dead -levels -and -scattering -bunches -of -trees -and -mud -villages -you -soon -realize -that -india -is -not -beautiful -still -there -is -an -enchantment -about -it -that -is -beguiling -and -which -does -not -pall -you -cannot -tell -just -what -it -is -that -makes -the -spell -perhaps -but -you -feel -it -and -confess -it -nevertheless -of -course -at -bottom -you -know -in -a -vague -way -that -it -is -history -it -is -that -that -affects -you -a -haunting -sense -of -the -myriads -of -human -lives -that -have -blossomed -and -withered -and -perished -here -repeating -and -repeating -and -repeating -century -after -century -and -age -after -age -the -barren -and -meaningless -process -it -is -this -sense -that -gives -to -this -forlorn -uncomely -land -power -to -speak -to -the -spirit -and -make -friends -with -it -to -speak -to -it -with -a -voice -bitter -with -satire -but -eloquent -with -melancholy -the -deserts -of -australia -and -the -ice -barrens -of -greenland -have -no -speech -for -they -have -no -venerable -history -with -nothing -to -tell -of -man -and -his -vanities -his -fleeting -glories -and -his -miseries -they -have -nothing -wherewith -to -spiritualize -their -ugliness -and -veil -it -with -a -charm -there -is -nothing -pretty -about -an -indian -village -a -mud -one -and -i -do -not -remember -that -we -saw -any -but -mud -ones -on -that -long -flight -to -allahabad -it -is -a -little -bunch -of -dirt -colored -mud -hovels -jammed -together -within -a -mud -wall -as -a -rule -the -rains -had -beaten -down -parts -of -some -of -the -houses -and -this -gave -the -village -the -aspect -of -a -mouldering -and -hoary -ruin -i -believe -the -cattle -and -the -vermin -live -inside -the -wall -for -i -saw -cattle -coming -out -and -cattle -going -in -and -whenever -i -saw -a -villager -he -was -scratching -this -last -is -only -circumstantial -evidence -but -i -think -it -has -value -the -village -has -a -battered -little -temple -or -two -big -enough -to -hold -an -idol -and -with -custom -enough -to -fat -up -a -priest -and -keep -him -comfortable -where -there -are -mohammedans -there -are -generally -a -few -sorry -tombs -outside -the -village -that -have -a -decayed -and -neglected -look -the -villages -interested -me -because -of -things -which -major -sleeman -says -about -them -in -his -books -particularly -what -he -says -about -the -division -of -labor -in -them -he -says -that -the -whole -face -of -india -is -parceled -out -into -estates -of -villages -that -nine -tenths -of -the -vast -population -of -the -land -consist -of -cultivators -of -the -soil -that -it -is -these -cultivators -who -inhabit -the -villages -that -there -are -certain -established -village -servants -mechanics -and -others -who -are -apparently -paid -a -wage -by -the -village -at -large -and -whose -callings -remain -in -certain -families -and -are -handed -down -from -father -to -son -like -an -estate -he -gives -a -list -of -these -established -servants -priest -blacksmith -carpenter -accountant -washerman -basketmaker -potter -watchman -barber -shoemaker -brazier -confectioner -weaver -dyer -etc -in -his -day -witches -abounded -and -it -was -not -thought -good -business -wisdom -for -a -man -to -marry -his -daughter -into -a -family -that -hadn't -a -witch -in -it -for -she -would -need -a -witch -on -the -premises -to -protect -her -children -from -the -evil -spells -which -would -certainly -be -cast -upon -them -by -the -witches -connected -with -the -neighboring -families -the -office -of -midwife -was -hereditary -in -the -family -of -the -basket -maker -it -belonged -to -his -wife -she -might -not -be -competent -but -the -office -was -hers -anyway -her -pay -was -not -high -25 -cents -for -a -boy -and -half -as -much -for -a -girl -the -girl -was -not -desired -because -she -would -be -a -disastrous -expense -by -and -by -as -soon -as -she -should -be -old -enough -to -begin -to -wear -clothes -for -propriety's -sake -it -would -be -a -disgrace -to -the -family -if -she -were -not -married -and -to -marry -her -meant -financial -ruin -for -by -custom -the -father -must -spend -upon -feasting -and -wedding -display -everything -he -had -and -all -he -could -borrow -in -fact -reduce -himself -to -a -condition -of -poverty -which -he -might -never -more -recover -from -it -was -the -dread -of -this -prospective -ruin -which -made -the -killing -of -girl -babies -so -prevalent -in -india -in -the -old -days -before -england -laid -the -iron -hand -of -her -prohibitions -upon -the -piteous -slaughter -one -may -judge -of -how -prevalent -the -custom -was -by -one -of -sleeman's -casual -electrical -remarks -when -he -speaks -of -children -at -play -in -villages -where -girl -voices -were -never -heard! -the -wedding -display -folly -is -still -in -full -force -in -india -and -by -consequence -the -destruction -of -girl -babies -is -still -furtively -practiced -but -not -largely -because -of -the -vigilance -of -the -government -and -the -sternness -of -the -penalties -it -levies -in -some -parts -of -india -the -village -keeps -in -its -pay -three -other -servants -an -astrologer -to -tell -the -villager -when -he -may -plant -his -crop -or -make -a -journey -or -marry -a -wife -or -strangle -a -child -or -borrow -a -dog -or -climb -a -tree -or -catch -a -rat -or -swindle -a -neighbor -without -offending -the -alert -and -solicitous -heavens -and -what -his -dream -means -if -he -has -had -one -and -was -not -bright -enough -to -interpret -it -himself -by -the -details -of -his -dinner -the -two -other -established -servants -were -the -tiger -persuader -and -the -hailstorm -discourager -the -one -kept -away -the -tigers -if -he -could -and -collected -the -wages -anyway -and -the -other -kept -off -the -hailstorms -or -explained -why -he -failed -he -charged -the -same -for -explaining -a -failure -that -he -did -for -scoring -a -success -a -man -is -an -idiot -who -can't -earn -a -living -in -india -major -sleeman -reveals -the -fact -that -the -trade -union -and -the -boycott -are -antiquities -in -india -india -seems -to -have -originated -everything -the -sweeper -belongs -to -the -bottom -caste -he -is -the -lowest -of -the -low -all -other -castes -despise -him -and -scorn -his -office -but -that -does -not -trouble -him -his -caste -is -a -caste -and -that -is -sufficient -for -him -and -so -he -is -proud -of -it -not -ashamed -sleeman -says -it -is -perhaps -not -known -to -many -of -my -countrymen -even -in -india -that -in -every -town -and -city -in -the -country -the -right -of -sweeping -the -houses -and -streets -is -a -monopoly -and -is -supported -entirely -by -the -pride -of -castes -among -the -scavengers -who -are -all -of -the -lowest -class -the -right -of -sweeping -within -a -certain -range -is -recognized -by -the -caste -to -belong -to -a -certain -member -and -if -any -other -member -presumes -to -sweep -within -that -range -he -is -excommunicated -no -other -member -will -smoke -out -of -his -pipe -or -drink -out -of -his -jug -and -he -can -get -restored -to -caste -only -by -a -feast -to -the -whole -body -of -sweepers -if -any -housekeeper -within -a -particular -circle -happens -to -offend -the -sweeper -of -that -range -none -of -his -filth -will -be -removed -till -he -pacifies -him -because -no -other -sweeper -will -dare -to -touch -it -and -the -people -of -a -town -are -often -more -tyrannized -over -by -these -people -than -by -any -other -a -footnote -by -major -sleeman's -editor -mr -vincent -arthur -smith -says -that -in -our -day -this -tyranny -of -the -sweepers' -guild -is -one -of -the -many -difficulties -which -bar -the -progress -of -indian -sanitary -reform -think -of -this -the -sweepers -cannot -be -readily -coerced -because -no -hindoo -or -mussulman -would -do -their -work -to -save -his -life -nor -will -he -pollute -himself -by -beating -the -refractory -scavenger -they -certainly -do -seem -to -have -the -whip -hand -it -would -be -difficult -to -imagine -a -more -impregnable -position -the -vested -rights -described -in -the -text -are -so -fully -recognized -in -practice -that -they -are -frequently -the -subject -of -sale -or -mortgage -just -like -a -milk -route -or -like -a -london -crossing -sweepership -it -is -said -that -the -london -crossing -sweeper's -right -to -his -crossing -is -recognized -by -the -rest -of -the -guild -that -they -protect -him -in -its -possession -that -certain -choice -crossings -are -valuable -property -and -are -saleable -at -high -figures -i -have -noticed -that -the -man -who -sweeps -in -front -of -the -army -and -navy -stores -has -a -wealthy -south -african -aristocratic -style -about -him -and -when -he -is -off -his -guard -he -has -exactly -that -look -on -his -face -which -you -always -see -in -the -face -of -a -man -who -has -is -saving -up -his -daughter -to -marry -her -to -a -duke -it -appears -from -sleeman -that -in -india -the -occupation -of -elephant -driver -is -confined -to -mohammedans -i -wonder -why -that -is -the -water -carrier -'bheestie' -is -a -mohammedan -but -it -is -said -that -the -reason -of -that -is -that -the -hindoo's -religion -does -not -allow -him -to -touch -the -skin -of -dead -kine -and -that -is -what -the -water -sack -is -made -of -it -would -defile -him -and -it -doesn't -allow -him -to -eat -meat -the -animal -that -furnished -the -meat -was -murdered -and -to -take -any -creature's -life -is -a -sin -it -is -a -good -and -gentle -religion -but -inconvenient -a -great -indian -river -at -low -water -suggests -the -familiar -anatomical -picture -of -a -skinned -human -body -the -intricate -mesh -of -interwoven -muscles -and -tendons -to -stand -for -water -channels -and -the -archipelagoes -of -fat -and -flesh -inclosed -by -them -to -stand -for -the -sandbars -somewhere -on -this -journey -we -passed -such -a -river -and -on -a -later -journey -we -saw -in -the -sutlej -the -duplicate -of -that -river -curious -rivers -they -are -low -shores -a -dizzy -distance -apart -with -nothing -between -but -an -enormous -acreage -of -sand -flats -with -sluggish -little -veins -of -water -dribbling -around -amongst -them -saharas -of -sand -smallpox -pitted -with -footprints -punctured -in -belts -as -straight -as -the -equator -clear -from -the -one -shore -to -the -other -barring -the -channel -interruptions -a -dry -shod -ferry -you -see -long -railway -bridges -are -required -for -this -sort -of -rivers -and -india -has -them -you -approach -allahabad -by -a -very -long -one -it -was -now -carrying -us -across -the -bed -of -the -jumna -a -bed -which -did -not -seem -to -have -been -slept -in -for -one -while -or -more -it -wasn't -all -river -bed -most -of -it -was -overflow -ground -allahabad -means -city -of -god -i -get -this -from -the -books -from -a -printed -curiosity -a -letter -written -by -one -of -those -brave -and -confident -hindoo -strugglers -with -the -english -tongue -called -a -babu -i -got -a -more -compressed -translation -godville -it -is -perfectly -correct -but -that -is -the -most -that -can -be -said -for -it -we -arrived -in -the -forenoon -and -short -handed -for -satan -got -left -behind -somewhere -that -morning -and -did -not -overtake -us -until -after -nightfall -it -seemed -very -peaceful -without -him -the -world -seemed -asleep -and -dreaming -i -did -not -see -the -native -town -i -think -i -do -not -remember -why -for -an -incident -connects -it -with -the -great -mutiny -and -that -is -enough -to -make -any -place -interesting -but -i -saw -the -english -part -of -the -city -it -is -a -town -of -wide -avenues -and -noble -distances -and -is -comely -and -alluring -and -full -of -suggestions -of -comfort -and -leisure -and -of -the -serenity -which -a -good -conscience -buttressed -by -a -sufficient -bank -account -gives -the -bungalows -dwellings -stand -well -back -in -the -seclusion -and -privacy -of -large -enclosed -compounds -private -grounds -as -we -should -say -and -in -the -shade -and -shelter -of -trees -even -the -photographer -and -the -prosperous -merchant -ply -their -industries -in -the -elegant -reserve -of -big -compounds -and -the -citizens -drive -in -thereupon -their -business -occasions -and -not -in -cabs -no -in -the -indian -cities -cabs -are -for -the -drifting -stranger -all -the -white -citizens -have -private -carriages -and -each -carriage -has -a -flock -of -white -turbaned -black -footmen -and -drivers -all -over -it -the -vicinity -of -a -lecture -hall -looks -like -a -snowstorm -and -makes -the -lecturer -feel -like -an -opera -india -has -many -names -and -they -are -correctly -descriptive -it -is -the -land -of -contradictions -the -land -of -subtlety -and -superstition -the -land -of -wealth -and -poverty -the -land -of -splendor -and -desolation -the -land -of -plague -and -famine -the -land -of -the -thug -and -the -poisoner -and -of -the -meek -and -the -patient -the -land -of -the -suttee -the -land -of -the -unreinstatable -widow -the -land -where -all -life -is -holy -the -land -of -cremation -the -land -where -the -vulture -is -a -grave -and -a -monument -the -land -of -the -multitudinous -gods -and -if -signs -go -for -anything -it -is -the -land -of -the -private -carriage -in -bombay -the -forewoman -of -a -millinery -shop -came -to -the -hotel -in -her -private -carriage -to -take -the -measure -for -a -gown -not -for -me -but -for -another -she -had -come -out -to -india -to -make -a -temporary -stay -but -was -extending -it -indefinitely -indeed -she -was -purposing -to -end -her -days -there -in -london -she -said -her -work -had -been -hard -her -hours -long -for -economy's -sake -she -had -had -to -live -in -shabby -rooms -and -far -away -from -the -shop -watch -the -pennies -deny -herself -many -of -the -common -comforts -of -life -restrict -herself -in -effect -to -its -bare -necessities -eschew -cabs -travel -third -class -by -underground -train -to -and -from -her -work -swallowing -coal -smoke -and -cinders -all -the -way -and -sometimes -troubled -with -the -society -of -men -and -women -who -were -less -desirable -than -the -smoke -and -the -cinders -but -in -bombay -on -almost -any -kind -of -wages -she -could -live -in -comfort -and -keep -her -carriage -and -have -six -servants -in -place -of -the -woman -of -all -work -she -had -had -in -her -english -home -later -in -calcutta -i -found -that -the -standard -oil -clerks -had -small -one -horse -vehicles -and -did -no -walking -and -i -was -told -that -the -clerks -of -the -other -large -concerns -there -had -the -like -equipment -but -to -return -to -allahabad -i -was -up -at -dawn -the -next -morning -in -india -the -tourist's -servant -does -not -sleep -in -a -room -in -the -hotel -but -rolls -himself -up -head -and -ears -in -his -blanket -and -stretches -himself -on -the -veranda -across -the -front -of -his -master's -door -and -spends -the -night -there -i -don't -believe -anybody's -servant -occupies -a -room -apparently -the -bungalow -servants -sleep -on -the -veranda -it -is -roomy -and -goes -all -around -the -house -i -speak -of -menservants -i -saw -none -of -the -other -sex -i -think -there -are -none -except -child -nurses -i -was -up -at -dawn -and -walked -around -the -veranda -past -the -rows -of -sleepers -in -front -of -one -door -a -hindoo -servant -was -squatting -waiting -for -his -master -to -call -him -he -had -polished -the -yellow -shoes -and -placed -them -by -the -door -and -now -he -had -nothing -to -do -but -wait -it -was -freezing -cold -but -there -he -was -as -motionless -as -a -sculptured -image -and -as -patient -it -troubled -me -i -wanted -to -say -to -him -don't -crouch -there -like -that -and -freeze -nobody -requires -it -of -you -stir -around -and -get -warm -but -i -hadn't -the -words -i -thought -of -saying -'jeldy -jow' -but -i -couldn't -remember -what -it -meant -so -i -didn't -say -it -i -knew -another -phrase -but -it -wouldn't -come -to -my -mind -i -moved -on -purposing -to -dismiss -him -from -my -thoughts -but -his -bare -legs -and -bare -feet -kept -him -there -they -kept -drawing -me -back -from -the -sunny -side -to -a -point -whence -i -could -see -him -at -the -end -of -an -hour -he -had -not -changed -his -attitude -in -the -least -degree -it -was -a -curious -and -impressive -exhibition -of -meekness -and -patience -or -fortitude -or -indifference -i -did -not -know -which -but -it -worried -me -and -it -was -spoiling -my -morning -in -fact -it -spoiled -two -hours -of -it -quite -thoroughly -i -quitted -this -vicinity -then -and -left -him -to -punish -himself -as -much -as -he -might -want -to -but -up -to -that -time -the -man -had -not -changed -his -attitude -a -hair -he -will -always -remain -with -me -i -suppose -his -figure -never -grows -vague -in -my -memory -whenever -i -read -of -indian -resignation -indian -patience -under -wrongs -hardships -and -misfortunes -he -comes -before -me -he -becomes -a -personification -and -stands -for -india -in -trouble -and -for -untold -ages -india -in -trouble -has -been -pursued -with -the -very -remark -which -i -was -going -to -utter -but -didn't -because -its -meaning -had -slipped -me -jeddy -jow! -come -shove -along! -why -it -was -the -very -thing -in -the -early -brightness -we -made -a -long -drive -out -to -the -fort -part -of -the -way -was -beautiful -it -led -under -stately -trees -and -through -groups -of -native -houses -and -by -the -usual -village -well -where -the -picturesque -gangs -are -always -flocking -to -and -fro -and -laughing -and -chattering -and -this -time -brawny -men -were -deluging -their -bronze -bodies -with -the -limpid -water -and -making -a -refreshing -and -enticing -show -of -it -enticing -for -the -sun -was -already -transacting -business -firing -india -up -for -the -day -there -was -plenty -of -this -early -bathing -going -on -for -it -was -getting -toward -breakfast -time -and -with -an -unpurified -body -the -hindoo -must -not -eat -then -we -struck -into -the -hot -plain -and -found -the -roads -crowded -with -pilgrims -of -both -sexes -for -one -of -the -great -religious -fairs -of -india -was -being -held -just -beyond -the -fort -at -the -junction -of -the -sacred -rivers -the -ganges -and -the -jumna -three -sacred -rivers -i -should -have -said -for -there -is -a -subterranean -one -nobody -has -seen -it -but -that -doesn't -signify -the -fact -that -it -is -there -is -enough -these -pilgrims -had -come -from -all -over -india -some -of -them -had -been -months -on -the -way -plodding -patiently -along -in -the -heat -and -dust -worn -poor -hungry -but -supported -and -sustained -by -an -unwavering -faith -and -belief -they -were -supremely -happy -and -content -now -their -full -and -sufficient -reward -was -at -hand -they -were -going -to -be -cleansed -from -every -vestige -of -sin -and -corruption -by -these -holy -waters -which -make -utterly -pure -whatsoever -thing -they -touch -even -the -dead -and -rotten -it -is -wonderful -the -power -of -a -faith -like -that -that -can -make -multitudes -upon -multitudes -of -the -old -and -weak -and -the -young -and -frail -enter -without -hesitation -or -complaint -upon -such -incredible -journeys -and -endure -the -resultant -miseries -without -repining -it -is -done -in -love -or -it -is -done -in -fear -i -do -not -know -which -it -is -no -matter -what -the -impulse -is -the -act -born -of -it -is -beyond -imagination -marvelous -to -our -kind -of -people -the -cold -whites -there -are -choice -great -natures -among -us -that -could -exhibit -the -equivalent -of -this -prodigious -self -sacrifice -but -the -rest -of -us -know -that -we -should -not -be -equal -to -anything -approaching -it -still -we -all -talk -self -sacrifice -and -this -makes -me -hope -that -we -are -large -enough -to -honor -it -in -the -hindoo -two -millions -of -natives -arrive -at -this -fair -every -year -how -many -start -and -die -on -the -road -from -age -and -fatigue -and -disease -and -scanty -nourishment -and -how -many -die -on -the -return -from -the -same -causes -no -one -knows -but -the -tale -is -great -one -may -say -enormous -every -twelfth -year -is -held -to -be -a -year -of -peculiar -grace -a -greatly -augmented -volume -of -pilgrims -results -then -the -twelfth -year -has -held -this -distinction -since -the -remotest -times -it -is -said -it -is -said -also -that -there -is -to -be -but -one -more -twelfth -year -for -the -ganges -after -that -that -holiest -of -all -sacred -rivers -will -cease -to -be -holy -and -will -be -abandoned -by -the -pilgrim -for -many -centuries -how -many -the -wise -men -have -not -stated -at -the -end -of -that -interval -it -will -become -holy -again -meantime -the -data -will -be -arranged -by -those -people -who -have -charge -of -all -such -matters -the -great -chief -brahmins -it -will -be -like -shutting -down -a -mint -at -a -first -glance -it -looks -most -unbrahminically -uncommercial -but -i -am -not -disturbed -being -soothed -and -tranquilized -by -their -reputation -brer -fox -he -lay -low -as -uncle -remus -says -and -at -the -judicious -time -he -will -spring -something -on -the -indian -public -which -will -show -that -he -was -not -financially -asleep -when -he -took -the -ganges -out -of -the -market -great -numbers -of -the -natives -along -the -roads -were -bringing -away -holy -water -from -the -rivers -they -would -carry -it -far -and -wide -in -india -and -sell -it -tavernier -the -french -traveler -17th -century -notes -that -ganges -water -is -often -given -at -weddings -each -guest -receiving -a -cup -or -two -according -to -the -liberality -of -the -host -sometimes -2 -000 -or -3 -000 -rupees' -worth -of -it -is -consumed -at -a -wedding -the -fort -is -a -huge -old -structure -and -has -had -a -large -experience -in -religions -in -its -great -court -stands -a -monolith -which -was -placed -there -more -than -2 -000 -years -ago -to -preach -budhism -by -its -pious -inscription -the -fort -was -built -three -centuries -ago -by -a -mohammedan -emperor -a -resanctification -of -the -place -in -the -interest -of -that -religion -there -is -a -hindoo -temple -too -with -subterranean -ramifications -stocked -with -shrines -and -idols -and -now -the -fort -belongs -to -the -english -it -contains -a -christian -church -insured -in -all -the -companies -from -the -lofty -ramparts -one -has -a -fine -view -of -the -sacred -rivers -they -join -at -that -point -the -pale -blue -jumna -apparently -clean -and -clear -and -the -muddy -ganges -dull -yellow -and -not -clean -on -a -long -curved -spit -between -the -rivers -towns -of -tents -were -visible -with -a -multitude -of -fluttering -pennons -and -a -mighty -swarm -of -pilgrims -it -was -a -troublesome -place -to -get -down -to -and -not -a -quiet -place -when -you -arrived -but -it -was -interesting -there -was -a -world -of -activity -and -turmoil -and -noise -partly -religious -partly -commercial -for -the -mohammedans -were -there -to -curse -and -sell -and -the -hindoos -to -buy -and -pray -it -is -a -fair -as -well -as -a -religious -festival -crowds -were -bathing -praying -and -drinking -the -purifying -waters -and -many -sick -pilgrims -had -come -long -journeys -in -palanquins -to -be -healed -of -their -maladies -by -a -bath -or -if -that -might -not -be -then -to -die -on -the -blessed -banks -and -so -make -sure -of -heaven -there -were -fakeers -in -plenty -with -their -bodies -dusted -over -with -ashes -and -their -long -hair -caked -together -with -cow -dung -for -the -cow -is -holy -and -so -is -the -rest -of -it -so -holy -that -the -good -hindoo -peasant -frescoes -the -walls -of -his -hut -with -this -refuse -and -also -constructs -ornamental -figures -out -of -it -for -the -gracing -of -his -dirt -floor -there -were -seated -families -fearfully -and -wonderfully -painted -who -by -attitude -and -grouping -represented -the -families -of -certain -great -gods -there -was -a -holy -man -who -sat -naked -by -the -day -and -by -the -week -on -a -cluster -of -iron -spikes -and -did -not -seem -to -mind -it -and -another -holy -man -who -stood -all -day -holding -his -withered -arms -motionless -aloft -and -was -said -to -have -been -doing -it -for -years -all -of -these -performers -have -a -cloth -on -the -ground -beside -them -for -the -reception -of -contributions -and -even -the -poorest -of -the -people -give -a -trifle -and -hope -that -the -sacrifice -will -be -blessed -to -him -at -last -came -a -procession -of -naked -holy -people -marching -by -and -chanting -and -i -wrenched -myself -away -chapter -l -the -man -who -is -ostentatious -of -his -modesty -is -twin -to -the -statue -that -wears -a -fig -leaf -pudd'nhead -wilson's -new -calendar -the -journey -to -benares -was -all -in -daylight -and -occupied -but -a -few -hours -it -was -admirably -dusty -the -dust -settled -upon -you -in -a -thick -ashy -layer -and -turned -you -into -a -fakeer -with -nothing -lacking -to -the -role -but -the -cow -manure -and -the -sense -of -holiness -there -was -a -change -of -cars -about -mid -afternoon -at -moghul -serai -if -that -was -the -name -and -a -wait -of -two -hours -there -for -the -benares -train -we -could -have -found -a -carriage -and -driven -to -the -sacred -city -but -we -should -have -lost -the -wait -in -other -countries -a -long -wait -at -a -station -is -a -dull -thing -and -tedious -but -one -has -no -right -to -have -that -feeling -in -india -you -have -the -monster -crowd -of -bejeweled -natives -the -stir -the -bustle -the -confusion -the -shifting -splendors -of -the -costumes -dear -me -the -delight -of -it -the -charm -of -it -are -beyond -speech -the -two -hour -wait -was -over -too -soon -among -other -satisfying -things -to -look -at -was -a -minor -native -prince -from -the -backwoods -somewhere -with -his -guard -of -honor -a -ragged -but -wonderfully -gaudy -gang -of -fifty -dark -barbarians -armed -with -rusty -flint -lock -muskets -the -general -show -came -so -near -to -exhausting -variety -that -one -would -have -said -that -no -addition -to -it -could -be -conspicuous -but -when -this -falstaff -and -his -motleys -marched -through -it -one -saw -that -that -seeming -impossibility -had -happened -we -got -away -by -and -by -and -soon -reached -the -outer -edge -of -benares -then -there -was -another -wait -but -as -usual -with -something -to -look -at -this -was -a -cluster -of -little -canvas -boxes -palanquins -a -canvas -box -is -not -much -of -a -sight -when -empty -but -when -there -is -a -lady -in -it -it -is -an -object -of -interest -these -boxes -were -grouped -apart -in -the -full -blaze -of -the -terrible -sun -during -the -three -quarters -of -an -hour -that -we -tarried -there -they -contained -zenana -ladies -they -had -to -sit -up -there -was -not -room -enough -to -stretch -out -they -probably -did -not -mind -it -they -are -used -to -the -close -captivity -of -the -dwellings -all -their -lives -when -they -go -a -journey -they -are -carried -to -the -train -in -these -boxes -in -the -train -they -have -to -be -secluded -from -inspection -many -people -pity -them -and -i -always -did -it -myself -and -never -charged -anything -but -it -is -doubtful -if -this -compassion -is -valued -while -we -were -in -india -some -good -hearted -europeans -in -one -of -the -cities -proposed -to -restrict -a -large -park -to -the -use -of -zenana -ladies -so -that -they -could -go -there -and -in -assured -privacy -go -about -unveiled -and -enjoy -the -sunshine -and -air -as -they -had -never -enjoyed -them -before -the -good -intentions -back -of -the -proposition -were -recognized -and -sincere -thanks -returned -for -it -but -the -proposition -itself -met -with -a -prompt -declination -at -the -hands -of -those -who -were -authorized -to -speak -for -the -zenana -ladies -apparently -the -idea -was -shocking -to -the -ladies -indeed -it -was -quite -manifestly -shocking -was -that -proposition -the -equivalent -of -inviting -european -ladies -to -assemble -scantily -and -scandalously -clothed -in -the -seclusion -of -a -private -park -it -seemed -to -be -about -that -without -doubt -modesty -is -nothing -less -than -a -holy -feeling -and -without -doubt -the -person -whose -rule -of -modesty -has -been -transgressed -feels -the -same -sort -of -wound -that -he -would -feel -if -something -made -holy -to -him -by -his -religion -had -suffered -a -desecration -i -say -rule -of -modesty -because -there -are -about -a -million -rules -in -the -world -and -this -makes -a -million -standards -to -be -looked -out -for -major -sleeman -mentions -the -case -of -some -high -caste -veiled -ladies -who -were -profoundly -scandalized -when -some -english -young -ladies -passed -by -with -faces -bare -to -the -world -so -scandalized -that -they -spoke -out -with -strong -indignation -and -wondered -that -people -could -be -so -shameless -as -to -expose -their -persons -like -that -and -yet -the -legs -of -the -objectors -were -naked -to -mid -thigh -both -parties -were -clean -minded -and -irreproachably -modest -while -abiding -by -their -separate -rules -but -they -couldn't -have -traded -rules -for -a -change -without -suffering -considerable -discomfort -all -human -rules -are -more -or -less -idiotic -i -suppose -it -is -best -so -no -doubt -the -way -it -is -now -the -asylums -can -hold -the -sane -people -but -if -we -tried -to -shut -up -the -insane -we -should -run -out -of -building -materials -you -have -a -long -drive -through -the -outskirts -of -benares -before -you -get -to -the -hotel -and -all -the -aspects -are -melancholy -it -is -a -vision -of -dusty -sterility -decaying -temples -crumbling -tombs -broken -mud -walls -shabby -huts -the -whole -region -seems -to -ache -with -age -and -penury -it -must -take -ten -thousand -years -of -want -to -produce -such -an -aspect -we -were -still -outside -of -the -great -native -city -when -we -reached -the -hotel -it -was -a -quiet -and -homelike -house -inviting -and -manifestly -comfortable -but -we -liked -its -annex -better -and -went -thither -it -was -a -mile -away -perhaps -and -stood -in -the -midst -of -a -large -compound -and -was -built -bungalow -fashion -everything -on -the -ground -floor -and -a -veranda -all -around -they -have -doors -in -india -but -i -don't -know -why -they -don't -fasten -and -they -stand -open -as -a -rule -with -a -curtain -hanging -in -the -doorspace -to -keep -out -the -glare -of -the -sun -still -there -is -plenty -of -privacy -for -no -white -person -will -come -in -without -notice -of -course -the -native -men -servants -will -but -they -don't -seem -to -count -they -glide -in -barefoot -and -noiseless -and -are -in -the -midst -before -one -knows -it -at -first -this -is -a -shock -and -sometimes -it -is -an -embarrassment -but -one -has -to -get -used -to -it -and -does -there -was -one -tree -in -the -compound -and -a -monkey -lived -in -it -at -first -i -was -strongly -interested -in -the -tree -for -i -was -told -that -it -was -the -renowned -peepul -the -tree -in -whose -shadow -you -cannot -tell -a -lie -this -one -failed -to -stand -the -test -and -i -went -away -from -it -disappointed -there -was -a -softly -creaking -well -close -by -and -a -couple -of -oxen -drew -water -from -it -by -the -hour -superintended -by -two -natives -dressed -in -the -usual -turban -and -pocket -handkerchief -the -tree -and -the -well -were -the -only -scenery -and -so -the -compound -was -a -soothing -and -lonesome -and -satisfying -place -and -very -restful -after -so -many -activities -there -was -nobody -in -our -bungalow -but -ourselves -the -other -guests -were -in -the -next -one -where -the -table -d'hote -was -furnished -a -body -could -not -be -more -pleasantly -situated -each -room -had -the -customary -bath -attached -a -room -ten -or -twelve -feet -square -with -a -roomy -stone -paved -pit -in -it -and -abundance -of -water -one -could -not -easily -improve -upon -this -arrangement -except -by -furnishing -it -with -cold -water -and -excluding -the -hot -in -deference -to -the -fervency -of -the -climate -but -that -is -forbidden -it -would -damage -the -bather's -health -the -stranger -is -warned -against -taking -cold -baths -in -india -but -even -the -most -intelligent -strangers -are -fools -and -they -do -not -obey -and -so -they -presently -get -laid -up -i -was -the -most -intelligent -fool -that -passed -through -that -year -but -i -am -still -more -intelligent -now -now -that -it -is -too -late -i -wonder -if -the -'dorian' -if -that -is -the -name -of -it -is -another -superstition -like -the -peepul -tree -there -was -a -great -abundance -and -variety -of -tropical -fruits -but -the -dorian -was -never -in -evidence -it -was -never -the -season -for -the -dorian -it -was -always -going -to -arrive -from -burma -sometime -or -other -but -it -never -did -by -all -accounts -it -was -a -most -strange -fruit -and -incomparably -delicious -to -the -taste -but -not -to -the -smell -its -rind -was -said -to -exude -a -stench -of -so -atrocious -a -nature -that -when -a -dorian -was -in -the -room -even -the -presence -of -a -polecat -was -a -refreshment -we -found -many -who -had -eaten -the -dorian -and -they -all -spoke -of -it -with -a -sort -of -rapture -they -said -that -if -you -could -hold -your -nose -until -the -fruit -was -in -your -mouth -a -sacred -joy -would -suffuse -you -from -head -to -foot -that -would -make -you -oblivious -to -the -smell -of -the -rind -but -that -if -your -grip -slipped -and -you -caught -the -smell -of -the -rind -before -the -fruit -was -in -your -mouth -you -would -faint -there -is -a -fortune -in -that -rind -some -day -somebody -will -import -it -into -europe -and -sell -it -for -cheese -benares -was -not -a -disappointment -it -justified -its -reputation -as -a -curiosity -it -is -on -high -ground -and -overhangs -a -grand -curve -of -the -ganges -it -is -a -vast -mass -of -building -compactly -crusting -a -hill -and -is -cloven -in -all -directions -by -an -intricate -confusion -of -cracks -which -stand -for -streets -tall -slim -minarets -and -beflagged -temple -spires -rise -out -of -it -and -give -it -picturesqueness -viewed -from -the -river -the -city -is -as -busy -as -an -ant -hill -and -the -hurly -burly -of -human -life -swarming -along -the -web -of -narrow -streets -reminds -one -of -the -ants -the -sacred -cow -swarms -along -too -and -goes -whither -she -pleases -and -takes -toll -of -the -grain -shops -and -is -very -much -in -the -way -and -is -a -good -deal -of -a -nuisance -since -she -must -not -be -molested -benares -is -older -than -history -older -than -tradition -older -even -than -legend -and -looks -twice -as -old -as -all -of -them -put -together -from -a -hindoo -statement -quoted -in -rev -mr -parker's -compact -and -lucid -guide -to -benares -i -find -that -the -site -of -the -town -was -the -beginning -place -of -the -creation -it -was -merely -an -upright -lingam -at -first -no -larger -than -a -stove -pipe -and -stood -in -the -midst -of -a -shoreless -ocean -this -was -the -work -of -the -god -vishnu -later -he -spread -the -lingam -out -till -its -surface -was -ten -miles -across -still -it -was -not -large -enough -for -the -business -therefore -he -presently -built -the -globe -around -it -benares -is -thus -the -center -of -the -earth -this -is -considered -an -advantage -it -has -had -a -tumultuous -history -both -materially -and -spiritually -it -started -brahminically -many -ages -ago -then -by -and -by -buddha -came -in -recent -times -2 -500 -years -ago -and -after -that -it -was -buddhist -during -many -centuries -twelve -perhaps -but -the -brahmins -got -the -upper -hand -again -then -and -have -held -it -ever -since -it -is -unspeakably -sacred -in -hindoo -eyes -and -is -as -unsanitary -as -it -is -sacred -and -smells -like -the -rind -of -the -dorian -it -is -the -headquarters -of -the -brahmin -faith -and -one -eighth -of -the -population -are -priests -of -that -church -but -it -is -not -an -overstock -for -they -have -all -india -as -a -prey -all -india -flocks -thither -on -pilgrimage -and -pours -its -savings -into -the -pockets -of -the -priests -in -a -generous -stream -which -never -fails -a -priest -with -a -good -stand -on -the -shore -of -the -ganges -is -much -better -off -than -the -sweeper -of -the -best -crossing -in -london -a -good -stand -is -worth -a -world -of -money -the -holy -proprietor -of -it -sits -under -his -grand -spectacular -umbrella -and -blesses -people -all -his -life -and -collects -his -commission -and -grows -fat -and -rich -and -the -stand -passes -from -father -to -son -down -and -down -and -down -through -the -ages -and -remains -a -permanent -and -lucrative -estate -in -the -family -as -mr -parker -suggests -it -can -become -a -subject -of -dispute -at -one -time -or -another -and -then -the -matter -will -be -settled -not -by -prayer -and -fasting -and -consultations -with -vishnu -but -by -the -intervention -of -a -much -more -puissant -power -an -english -court -in -bombay -i -was -told -by -an -american -missionary -that -in -india -there -are -640 -protestant -missionaries -at -work -at -first -it -seemed -an -immense -force -but -of -course -that -was -a -thoughtless -idea -one -missionary -to -500 -000 -natives -no -that -is -not -a -force -it -is -the -reverse -of -it -640 -marching -against -an -intrenched -camp -of -300 -000 -000 -the -odds -are -too -great -a -force -of -640 -in -benares -alone -would -have -its -hands -over -full -with -8 -000 -brahmin -priests -for -adversary -missionaries -need -to -be -well -equipped -with -hope -and -confidence -and -this -equipment -they -seem -to -have -always -had -in -all -parts -of -the -world -mr -parker -has -it -it -enables -him -to -get -a -favorable -outlook -out -of -statistics -which -might -add -up -differently -with -other -mathematicians -for -instance -during -the -past -few -years -competent -observers -declare -that -the -number -of -pilgrims -to -benares -has -increased -and -then -he -adds -up -this -fact -and -gets -this -conclusion -but -the -revival -if -so -it -may -be -called -has -in -it -the -marks -of -death -it -is -a -spasmodic -struggle -before -dissolution -in -this -world -we -have -seen -the -roman -catholic -power -dying -upon -these -same -terms -for -many -centuries -many -a -time -we -have -gotten -all -ready -for -the -funeral -and -found -it -postponed -again -on -account -of -the -weather -or -something -taught -by -experience -we -ought -not -to -put -on -our -things -for -this -brahminical -one -till -we -see -the -procession -move -apparently -one -of -the -most -uncertain -things -in -the -world -is -the -funeral -of -a -religion -i -should -have -been -glad -to -acquire -some -sort -of -idea -of -hindoo -theology -but -the -difficulties -were -too -great -the -matter -was -too -intricate -even -the -mere -a -b -c -of -it -is -baffling -there -is -a -trinity -brahma -shiva -and -vishnu -independent -powers -apparently -though -one -cannot -feel -quite -sure -of -that -because -in -one -of -the -temples -there -is -an -image -where -an -attempt -has -been -made -to -concentrate -the -three -in -one -person -the -three -have -other -names -and -plenty -of -them -and -this -makes -confusion -in -one's -mind -the -three -have -wives -and -the -wives -have -several -names -and -this -increases -the -confusion -there -are -children -the -children -have -many -names -and -thus -the -confusion -goes -on -and -on -it -is -not -worth -while -to -try -to -get -any -grip -upon -the -cloud -of -minor -gods -there -are -too -many -of -them -it -is -even -a -justifiable -economy -to -leave -brahma -the -chiefest -god -of -all -out -of -your -studies -for -he -seems -to -cut -no -great -figure -in -india -the -vast -bulk -of -the -national -worship -is -lavished -upon -shiva -and -vishnu -and -their -families -shiva's -symbol -the -lingam -with -which -vishnu -began -the -creation -is -worshiped -by -everybody -apparently -it -is -the -commonest -object -in -benares -it -is -on -view -everywhere -it -is -garlanded -with -flowers -offerings -are -made -to -it -it -suffers -no -neglect -commonly -it -is -an -upright -stone -shaped -like -a -thimble -sometimes -like -an -elongated -thimble -this -priapus -worship -then -is -older -than -history -mr -parker -says -that -the -lingams -in -benares -outnumber -the -inhabitants -in -benares -there -are -many -mohammedan -mosques -there -are -hindoo -temples -without -number -these -quaintly -shaped -and -elaborately -sculptured -little -stone -jugs -crowd -all -the -lanes -the -ganges -itself -and -every -individual -drop -of -water -in -it -are -temples -religion -then -is -the -business -of -benares -just -as -gold -production -is -the -business -of -johannesburg -other -industries -count -for -nothing -as -compared -with -the -vast -and -all -absorbing -rush -and -drive -and -boom -of -the -town's -specialty -benares -is -the -sacredest -of -sacred -cities -the -moment -you -step -across -the -sharply -defined -line -which -separates -it -from -the -rest -of -the -globe -you -stand -upon -ineffably -and -unspeakably -holy -ground -mr -parker -says -it -is -impossible -to -convey -any -adequate -idea -of -the -intense -feelings -of -veneration -and -affection -with -which -the -pious -hindoo -regards -'holy -kashi' -benares -and -then -he -gives -you -this -vivid -and -moving -picture -let -a -hindoo -regiment -be -marched -through -the -district -and -as -soon -as -they -cross -the -line -and -enter -the -limits -of -the -holy -place -they -rend -the -air -with -cries -of -'kashi -ji -ki -jai -jai -jai! -holy -kashi! -hail -to -thee! -hail! -hail! -hail -' -the -weary -pilgrim -scarcely -able -to -stand -with -age -and -weakness -blinded -by -the -dust -and -heat -and -almost -dead -with -fatigue -crawls -out -of -the -oven -like -railway -carriage -and -as -soon -as -his -feet -touch -the -ground -he -lifts -up -his -withered -hands -and -utters -the -same -pious -exclamation -let -a -european -in -some -distant -city -in -casual -talk -in -the -bazar -mention -the -fact -that -he -has -lived -at -benares -and -at -once -voices -will -be -raised -to -call -down -blessings -on -his -head -for -a -dweller -in -benares -is -of -all -men -most -blessed -it -makes -our -own -religious -enthusiasm -seem -pale -and -cold -inasmuch -as -the -life -of -religion -is -in -the -heart -not -the -head -mr -parker's -touching -picture -seems -to -promise -a -sort -of -indefinite -postponement -of -that -funeral -chapter -li -let -me -make -the -superstitions -of -a -nation -and -i -care -not -who -makes -its -laws -or -its -songs -either -pudd'nhead -wilson's -new -calendar -yes -the -city -of -benares -is -in -effect -just -a -big -church -a -religious -hive -whose -every -cell -is -a -temple -a -shrine -or -a -mosque -and -whose -every -conceivable -earthly -and -heavenly -good -is -procurable -under -one -roof -so -to -speak -a -sort -of -army -and -navy -stores -theologically -stocked -i -will -make -out -a -little -itinerary -for -the -pilgrim -then -you -will -see -how -handy -the -system -is -how -convenient -how -comprehensive -if -you -go -to -benares -with -a -serious -desire -to -spiritually -benefit -yourself -you -will -find -it -valuable -i -got -some -of -the -facts -from -conversations -with -the -rev -mr -parker -and -the -others -from -his -guide -to -benares -they -are -therefore -trustworthy -1 -purification -at -sunrise -you -must -go -down -to -the -ganges -and -bathe -pray -and -drink -some -of -the -water -this -is -for -your -general -purification -2 -protection -against -hunger -next -you -must -fortify -yourself -against -the -sorrowful -earthly -ill -just -named -this -you -will -do -by -worshiping -for -a -moment -in -the -cow -temple -by -the -door -of -it -you -will -find -an -image -of -ganesh -son -of -shiva -it -has -the -head -of -an -elephant -on -a -human -body -its -face -and -hands -are -of -silver -you -will -worship -it -a -little -and -pass -on -into -a -covered -veranda -where -you -will -find -devotees -reciting -from -the -sacred -books -with -the -help -of -instructors -in -this -place -are -groups -of -rude -and -dismal -idols -you -may -contribute -something -for -their -support -then -pass -into -the -temple -a -grim -and -stenchy -place -for -it -is -populous -with -sacred -cows -and -with -beggars -you -will -give -something -to -the -beggars -and -reverently -kiss -the -tails -of -such -cows -as -pass -along -for -these -cows -are -peculiarly -holy -and -this -act -of -worship -will -secure -you -from -hunger -for -the -day -3 -the -poor -man's -friend -you -will -next -worship -this -god -he -is -at -the -bottom -of -a -stone -cistern -in -the -temple -of -dalbhyeswar -under -the -shade -of -a -noble -peepul -tree -on -the -bluff -overlooking -the -ganges -so -you -must -go -back -to -the -river -the -poor -man's -friend -is -the -god -of -material -prosperity -in -general -and -the -god -of -the -rain -in -particular -you -will -secure -material -prosperity -or -both -by -worshiping -him -he -is -shiva -under -a -new -alias -and -he -abides -in -the -bottom -of -that -cistern -in -the -form -of -a -stone -lingam -you -pour -ganges -water -over -him -and -in -return -for -this -homage -you -get -the -promised -benefits -if -there -is -any -delay -about -the -rain -you -must -pour -water -in -until -the -cistern -is -full -the -rain -will -then -be -sure -to -come -4 -fever -at -the -kedar -ghat -you -will -find -a -long -flight -of -stone -steps -leading -down -to -the -river -half -way -down -is -a -tank -filled -with -sewage -drink -as -much -of -it -as -you -want -it -is -for -fever -5 -smallpox -go -straight -from -there -to -the -central -ghat -at -its -upstream -end -you -will -find -a -small -whitewashed -building -which -is -a -temple -sacred -to -sitala -goddess -of -smallpox -her -under -study -is -there -a -rude -human -figure -behind -a -brass -screen -you -will -worship -this -for -reasons -to -be -furnished -presently -6 -the -well -of -fate -for -certain -reasons -you -will -next -go -and -do -homage -at -this -well -you -will -find -it -in -the -dandpan -temple -in -the -city -the -sunlight -falls -into -it -from -a -square -hole -in -the -masonry -above -you -will -approach -it -with -awe -for -your -life -is -now -at -stake -you -will -bend -over -and -look -if -the -fates -are -propitious -you -will -see -your -face -pictured -in -the -water -far -down -in -the -well -if -matters -have -been -otherwise -ordered -a -sudden -cloud -will -mask -the -sun -and -you -will -see -nothing -this -means -that -you -have -not -six -months -to -live -if -you -are -already -at -the -point -of -death -your -circumstances -are -now -serious -there -is -no -time -to -lose -let -this -world -go -arrange -for -the -next -one -handily -situated -at -your -very -elbow -is -opportunity -for -this -you -turn -and -worship -the -image -of -maha -kal -the -great -fate -and -happiness -in -the -life -to -come -is -secured -if -there -is -breath -in -your -body -yet -you -should -now -make -an -effort -to -get -a -further -lease -of -the -present -life -you -have -a -chance -there -is -a -chance -for -everything -in -this -admirably -stocked -and -wonderfully -systemized -spiritual -and -temporal -army -and -navy -store -you -must -get -yourself -carried -to -the -7 -well -of -long -life -this -is -within -the -precincts -of -the -mouldering -and -venerable -briddhkal -temple -which -is -one -of -the -oldest -in -benares -you -pass -in -by -a -stone -image -of -the -monkey -god -hanuman -and -there -among -the -ruined -courtyards -you -will -find -a -shallow -pool -of -stagnant -sewage -it -smells -like -the -best -limburger -cheese -and -is -filthy -with -the -washings -of -rotting -lepers -but -that -is -nothing -bathe -in -it -bathe -in -it -gratefully -and -worshipfully -for -this -is -the -fountain -of -youth -these -are -the -waters -of -long -life -your -gray -hairs -will -disappear -and -with -them -your -wrinkles -and -your -rheumatism -the -burdens -of -care -and -the -weariness -of -age -and -you -will -come -out -young -fresh -elastic -and -full -of -eagerness -for -the -new -race -of -life -now -will -come -flooding -upon -you -the -manifold -desires -that -haunt -the -dear -dreams -of -the -morning -of -life -you -will -go -whither -you -will -find -8 -fulfillment -of -desire -to -wit -to -the -kameshwar -temple -sacred -to -shiva -as -the -lord -of -desires -arrange -for -yours -there -and -if -you -like -to -look -at -idols -among -the -pack -and -jam -of -temples -there -you -will -find -enough -to -stock -a -museum -you -will -begin -to -commit -sins -now -with -a -fresh -new -vivacity -therefore -it -will -be -well -to -go -frequently -to -a -place -where -you -can -get -9 -temporary -cleansing -from -sin -to -wit -to -the -well -of -the -earring -you -must -approach -this -with -the -profoundest -reverence -for -it -is -unutterably -sacred -it -is -indeed -the -most -sacred -place -in -benares -the -very -holy -of -holies -in -the -estimation -of -the -people -it -is -a -railed -tank -with -stone -stairways -leading -down -to -the -water -the -water -is -not -clean -of -course -it -could -not -be -for -people -are -always -bathing -in -it -as -long -as -you -choose -to -stand -and -look -you -will -see -the -files -of -sinners -descending -and -ascending -descending -soiled -with -sin -ascending -purged -from -it -the -liar -the -thief -the -murderer -and -the -adulterer -may -here -wash -and -be -clean -says -the -rev -mr -parker -in -his -book -very -well -i -know -mr -parker -and -i -believe -it -but -if -anybody -else -had -said -it -i -should -consider -him -a -person -who -had -better -go -down -in -the -tank -and -take -another -wash -the -god -vishnu -dug -this -tank -he -had -nothing -to -dig -with -but -his -discus -i -do -not -know -what -a -discus -is -but -i -know -it -is -a -poor -thing -to -dig -tanks -with -because -by -the -time -this -one -was -finished -it -was -full -of -sweat -vishnu's -sweat -he -constructed -the -site -that -benares -stands -on -and -afterward -built -the -globe -around -it -and -thought -nothing -of -it -yet -sweated -like -that -over -a -little -thing -like -this -tank -one -of -these -statements -is -doubtful -i -do -not -know -which -one -it -is -but -i -think -it -difficult -not -to -believe -that -a -god -who -could -build -a -world -around -benares -would -not -be -intelligent -enough -to -build -it -around -the -tank -too -and -not -have -to -dig -it -youth -long -life -temporary -purification -from -sin -salvation -through -propitiation -of -the -great -fate -these -are -all -good -but -you -must -do -something -more -you -must -10 -make -salvation -sure -there -are -several -ways -to -get -drowned -in -the -ganges -is -one -but -that -is -not -pleasant -to -die -within -the -limits -of -benares -is -another -but -that -is -a -risky -one -because -you -might -be -out -of -town -when -your -time -came -the -best -one -of -all -is -the -pilgrimage -around -the -city -you -must -walk -also -you -must -go -barefoot -the -tramp -is -forty -four -miles -for -the -road -winds -out -into -the -country -a -piece -and -you -will -be -marching -five -or -six -days -but -you -will -have -plenty -of -company -you -will -move -with -throngs -and -hosts -of -happy -pilgrims -whose -radiant -costumes -will -make -the -spectacle -beautiful -and -whose -glad -songs -and -holy -pans -of -triumph -will -banish -your -fatigues -and -cheer -your -spirit -and -at -intervals -there -will -be -temples -where -you -may -sleep -and -be -refreshed -with -food -the -pilgrimage -completed -you -have -purchased -salvation -and -paid -for -it -but -you -may -not -get -it -unless -you -11 -get -your -redemption -recorded -you -can -get -this -done -at -the -sakhi -binayak -temple -and -it -is -best -to -do -it -for -otherwise -you -might -not -be -able -to -prove -that -you -had -made -the -pilgrimage -in -case -the -matter -should -some -day -come -to -be -disputed -that -temple -is -in -a -lane -back -of -the -cow -temple -over -the -door -is -a -red -image -of -ganesh -of -the -elephant -head -son -and -heir -of -shiva -and -prince -of -wales -to -the -theological -monarchy -so -to -speak -within -is -a -god -whose -office -it -is -to -record -your -pilgrimage -and -be -responsible -for -you -you -will -not -see -him -but -you -will -see -a -brahmin -who -will -attend -to -the -matter -and -take -the -money -if -he -should -forget -to -collect -the -money -you -can -remind -him -he -knows -that -your -salvation -is -now -secure -but -of -course -you -would -like -to -know -it -yourself -you -have -nothing -to -do -but -go -and -pray -and -pay -at -the -12 -well -of -the -knowledge -of -salvation -it -is -close -to -the -golden -temple -there -you -will -see -sculptured -out -of -a -single -piece -of -black -marble -a -bull -which -is -much -larger -than -any -living -bull -you -have -ever -seen -and -yet -is -not -a -good -likeness -after -all -and -there -also -you -will -see -a -very -uncommon -thing -an -image -of -shiva -you -have -seen -his -lingam -fifty -thousand -times -already -but -this -is -shiva -himself -and -said -to -be -a -good -likeness -it -has -three -eyes -he -is -the -only -god -in -the -firm -that -has -three -the -well -is -covered -by -a -fine -canopy -of -stone -supported -by -forty -pillars -and -around -it -you -will -find -what -you -have -already -seen -at -almost -every -shrine -you -have -visited -in -benares -a -mob -of -devout -and -eager -pilgrims -the -sacred -water -is -being -ladled -out -to -them -with -it -comes -to -them -the -knowledge -clear -thrilling -absolute -that -they -are -saved -and -you -can -see -by -their -faces -that -there -is -one -happiness -in -this -world -which -is -supreme -and -to -which -no -other -joy -is -comparable -you -receive -your -water -you -make -your -deposit -and -now -what -more -would -you -have -gold -diamonds -power -fame -all -in -a -single -moment -these -things -have -withered -to -dirt -dust -ashes -the -world -has -nothing -to -give -you -now -for -you -it -is -bankrupt -i -do -not -claim -that -the -pilgrims -do -their -acts -of -worship -in -the -order -and -sequence -above -charted -out -in -this -itinerary -of -mine -but -i -think -logic -suggests -that -they -ought -to -do -so -instead -of -a -helter -skelter -worship -we -then -have -a -definite -starting -place -and -a -march -which -carries -the -pilgrim -steadily -forward -by -reasoned -and -logical -progression -to -a -definite -goal -thus -his -ganges -bath -in -the -early -morning -gives -him -an -appetite -he -kisses -the -cow -tails -and -that -removes -it -it -is -now -business -hours -and -longings -for -material -prosperity -rise -in -his -mind -and -be -goes -and -pours -water -over -shiva's -symbol -this -insures -the -prosperity -but -also -brings -on -a -rain -which -gives -him -a -fever -then -he -drinks -the -sewage -at -the -kedar -ghat -to -cure -the -fever -it -cures -the -fever -but -gives -him -the -smallpox -he -wishes -to -know -how -it -is -going -to -turn -out -he -goes -to -the -dandpan -temple -and -looks -down -the -well -a -clouded -sun -shows -him -that -death -is -near -logically -his -best -course -for -the -present -since -he -cannot -tell -at -what -moment -he -may -die -is -to -secure -a -happy -hereafter -this -he -does -through -the -agency -of -the -great -fate -he -is -safe -now -for -heaven -his -next -move -will -naturally -be -to -keep -out -of -it -as -long -as -he -can -therefore -he -goes -to -the -briddhkal -temple -and -secures -youth -and -long -life -by -bathing -in -a -puddle -of -leper -pus -which -would -kill -a -microbe -logically -youth -has -re -equipped -him -for -sin -and -with -the -disposition -to -commit -it -he -will -naturally -go -to -the -fane -which -is -consecrated -to -the -fulfillment -of -desires -and -make -arrangements -logically -he -will -now -go -to -the -well -of -the -earring -from -time -to -time -to -unload -and -freshen -up -for -further -banned -enjoyments -but -first -and -last -and -all -the -time -he -is -human -and -therefore -in -his -reflective -intervals -he -will -always -be -speculating -in -futures -he -will -make -the -great -pilgrimage -around -the -city -and -so -make -his -salvation -absolutely -sure -he -will -also -have -record -made -of -it -so -that -it -may -remain -absolutely -sure -and -not -be -forgotten -or -repudiated -in -the -confusion -of -the -final -settlement -logically -also -he -will -wish -to -have -satisfying -and -tranquilizing -personal -knowledge -that -that -salvation -is -secure -therefore -he -goes -to -the -well -of -the -knowledge -of -salvation -adds -that -completing -detail -and -then -goes -about -his -affairs -serene -and -content -serene -and -content -for -he -is -now -royally -endowed -with -an -advantage -which -no -religion -in -this -world -could -give -him -but -his -own -for -henceforth -he -may -commit -as -many -million -sins -as -he -wants -to -and -nothing -can -come -of -it -thus -the -system -properly -and -logically -ordered -is -neat -compact -clearly -defined -and -covers -the -whole -ground -i -desire -to -recommend -it -to -such -as -find -the -other -systems -too -difficult -exacting -and -irksome -for -the -uses -of -this -fretful -brief -life -of -ours -however -let -me -not -deceive -any -one -my -itinerary -lacks -a -detail -i -must -put -it -in -the -truth -is -that -after -the -pilgrim -has -faithfully -followed -the -requirements -of -the -itinerary -through -to -the -end -and -has -secured -his -salvation -and -also -the -personal -knowledge -of -that -fact -there -is -still -an -accident -possible -to -him -which -can -annul -the -whole -thing -if -he -should -ever -cross -to -the -other -side -of -the -ganges -and -get -caught -out -and -die -there -he -would -at -once -come -to -life -again -in -the -form -of -an -ass -think -of -that -after -all -this -trouble -and -expense -you -see -how -capricious -and -uncertain -salvation -is -there -the -hindoo -has -a -childish -and -unreasoning -aversion -to -being -turned -into -an -ass -it -is -hard -to -tell -why -one -could -properly -expect -an -ass -to -have -an -aversion -to -being -turned -into -a -hindoo -one -could -understand -that -he -could -lose -dignity -by -it -also -self -respect -and -nine -tenths -of -his -intelligence -but -the -hindoo -changed -into -an -ass -wouldn't -lose -anything -unless -you -count -his -religion -and -he -would -gain -much -release -from -his -slavery -to -two -million -gods -and -twenty -million -priests -fakeers -holy -mendicants -and -other -sacred -bacilli -he -would -escape -the -hindoo -hell -he -would -also -escape -the -hindoo -heaven -these -are -advantages -which -the -hindoo -ought -to -consider -then -he -would -go -over -and -die -on -the -other -side -benares -is -a -religious -vesuvius -in -its -bowels -the -theological -forces -have -been -heaving -and -tossing -rumbling -thundering -and -quaking -boiling -and -weltering -and -flaming -and -smoking -for -ages -but -a -little -group -of -missionaries -have -taken -post -at -its -base -and -they -have -hopes -there -are -the -baptist -missionary -society -the -church -missionary -society -the -london -missionary -society -the -wesleyan -missionary -society -and -the -zenana -bible -and -medical -mission -they -have -schools -and -the -principal -work -seems -to -be -among -the -children -and -no -doubt -that -part -of -the -work -prospers -best -for -grown -people -everywhere -are -always -likely -to -cling -to -the -religion -they -were -brought -up -in -chapter -lii -wrinkles -should -merely -indicate -where -smiles -have -been -pudd'nhead -wilson's -new -calendar -in -one -of -those -benares -temples -we -saw -a -devotee -working -for -salvation -in -a -curious -way -he -had -a -huge -wad -of -clay -beside -him -and -was -making -it -up -into -little -wee -gods -no -bigger -than -carpet -tacks -he -stuck -a -grain -of -rice -into -each -to -represent -the -lingam -i -think -he -turned -them -out -nimbly -for -he -had -had -long -practice -and -had -acquired -great -facility -every -day -he -made -2 -000 -gods -then -threw -them -into -the -holy -ganges -this -act -of -homage -brought -him -the -profound -homage -of -the -pious -also -their -coppers -he -had -a -sure -living -here -and -was -earning -a -high -place -in -the -hereafter -the -ganges -front -is -the -supreme -show -place -of -benares -its -tall -bluffs -are -solidly -caked -from -water -to -summit -along -a -stretch -of -three -miles -with -a -splendid -jumble -of -massive -and -picturesque -masonry -a -bewildering -and -beautiful -confusion -of -stone -platforms -temples -stair -flights -rich -and -stately -palaces -nowhere -a -break -nowhere -a -glimpse -of -the -bluff -itself -all -the -long -face -of -it -is -compactly -walled -from -sight -by -this -crammed -perspective -of -platforms -soaring -stairways -sculptured -temples -majestic -palaces -softening -away -into -the -distances -and -there -is -movement -motion -human -life -everywhere -and -brilliantly -costumed -streaming -in -rainbows -up -and -down -the -lofty -stairways -and -massed -in -metaphorical -flower -gardens -on -the -miles -of -great -platforms -at -the -river's -edge -all -this -masonry -all -this -architecture -represents -piety -the -palaces -were -built -by -native -princes -whose -homes -as -a -rule -are -far -from -benares -but -who -go -there -from -time -to -time -to -refresh -their -souls -with -the -sight -and -touch -of -the -ganges -the -river -of -their -idolatry -the -stairways -are -records -of -acts -of -piety -the -crowd -of -costly -little -temples -are -tokens -of -money -spent -by -rich -men -for -present -credit -and -hope -of -future -reward -apparently -the -rich -christian -who -spends -large -sums -upon -his -religion -is -conspicuous -with -us -by -his -rarity -but -the -rich -hindoo -who -doesn't -spend -large -sums -upon -his -religion -is -seemingly -non -existent -with -us -the -poor -spend -money -on -their -religion -but -they -keep -back -some -to -live -on -apparently -in -india -the -poor -bankrupt -themselves -daily -for -their -religion -the -rich -hindoo -can -afford -his -pious -outlays -he -gets -much -glory -for -his -spendings -yet -keeps -back -a -sufficiency -of -his -income -for -temporal -purposes -but -the -poor -hindoo -is -entitled -to -compassion -for -his -spendings -keep -him -poor -yet -get -him -no -glory -we -made -the -usual -trip -up -and -down -the -river -seated -in -chairs -under -an -awning -on -the -deck -of -the -usual -commodious -hand -propelled -ark -made -it -two -or -three -times -and -could -have -made -it -with -increasing -interest -and -enjoyment -many -times -more -for -of -course -the -palaces -and -temples -would -grow -more -and -more -beautiful -every -time -one -saw -them -for -that -happens -with -all -such -things -also -i -think -one -would -not -get -tired -of -the -bathers -nor -their -costumes -nor -of -their -ingenuities -in -getting -out -of -them -and -into -them -again -without -exposing -too -much -bronze -nor -of -their -devotional -gesticulations -and -absorbed -bead -tellings -but -i -should -get -tired -of -seeing -them -wash -their -mouths -with -that -dreadful -water -and -drink -it -in -fact -i -did -get -tired -of -it -and -very -early -too -at -one -place -where -we -halted -for -a -while -the -foul -gush -from -a -sewer -was -making -the -water -turbid -and -murky -all -around -and -there -was -a -random -corpse -slopping -around -in -it -that -had -floated -down -from -up -country -ten -steps -below -that -place -stood -a -crowd -of -men -women -and -comely -young -maidens -waist -deep -in -the -water -and -they -were -scooping -it -up -in -their -hands -and -drinking -it -faith -can -certainly -do -wonders -and -this -is -an -instance -of -it -those -people -were -not -drinking -that -fearful -stuff -to -assuage -thirst -but -in -order -to -purify -their -souls -and -the -interior -of -their -bodies -according -to -their -creed -the -ganges -water -makes -everything -pure -that -it -touches -instantly -and -utterly -pure -the -sewer -water -was -not -an -offence -to -them -the -corpse -did -not -revolt -them -the -sacred -water -had -touched -both -and -both -were -now -snow -pure -and -could -defile -no -one -the -memory -of -that -sight -will -always -stay -by -me -but -not -by -request -a -word -further -concerning -the -nasty -but -all -purifying -ganges -water -when -we -went -to -agra -by -and -by -we -happened -there -just -in -time -to -be -in -at -the -birth -of -a -marvel -a -memorable -scientific -discovery -the -discovery -that -in -certain -ways -the -foul -and -derided -ganges -water -is -the -most -puissant -purifier -in -the -world! -this -curious -fact -as -i -have -said -had -just -been -added -to -the -treasury -of -modern -science -it -had -long -been -noted -as -a -strange -thing -that -while -benares -is -often -afflicted -with -the -cholera -she -does -not -spread -it -beyond -her -borders -this -could -not -be -accounted -for -mr -henkin -the -scientist -in -the -employ -of -the -government -of -agra -concluded -to -examine -the -water -he -went -to -benares -and -made -his -tests -he -got -water -at -the -mouths -of -the -sewers -where -they -empty -into -the -river -at -the -bathing -ghats -a -cubic -centimetre -of -it -contained -millions -of -germs -at -the -end -of -six -hours -they -were -all -dead -he -caught -a -floating -corpse -towed -it -to -the -shore -and -from -beside -it -he -dipped -up -water -that -was -swarming -with -cholera -germs -at -the -end -of -six -hours -they -were -all -dead -he -added -swarm -after -swarm -of -cholera -germs -to -this -water -within -the -six -hours -they -always -died -to -the -last -sample -repeatedly -he -took -pure -well -water -which -was -bare -of -animal -life -and -put -into -it -a -few -cholera -germs -they -always -began -to -propagate -at -once -and -always -within -six -hours -they -swarmed -and -were -numberable -by -millions -upon -millions -for -ages -and -ages -the -hindoos -have -had -absolute -faith -that -the -water -of -the -ganges -was -absolutely -pure -could -not -be -defiled -by -any -contact -whatsoever -and -infallibly -made -pure -and -clean -whatsoever -thing -touched -it -they -still -believe -it -and -that -is -why -they -bathe -in -it -and -drink -it -caring -nothing -for -its -seeming -filthiness -and -the -floating -corpses -the -hindoos -have -been -laughed -at -these -many -generations -but -the -laughter -will -need -to -modify -itself -a -little -from -now -on -how -did -they -find -out -the -water's -secret -in -those -ancient -ages -had -they -germ -scientists -then -we -do -not -know -we -only -know -that -they -had -a -civilization -long -before -we -emerged -from -savagery -but -to -return -to -where -i -was -before -i -was -about -to -speak -of -the -burning -ghat -they -do -not -burn -fakeers -those -revered -mendicants -they -are -so -holy -that -they -can -get -to -their -place -without -that -sacrament -provided -they -be -consigned -to -the -consecrating -river -we -saw -one -carried -to -mid -stream -and -thrown -overboard -he -was -sandwiched -between -two -great -slabs -of -stone -we -lay -off -the -cremation -ghat -half -an -hour -and -saw -nine -corpses -burned -i -should -not -wish -to -see -any -more -of -it -unless -i -might -select -the -parties -the -mourners -follow -the -bier -through -the -town -and -down -to -the -ghat -then -the -bier -bearers -deliver -the -body -to -some -low -caste -natives -doms -and -the -mourners -turn -about -and -go -back -home -i -heard -no -crying -and -saw -no -tears -there -was -no -ceremony -of -parting -apparently -these -expressions -of -grief -and -affection -are -reserved -for -the -privacy -of -the -home -the -dead -women -came -draped -in -red -the -men -in -white -they -are -laid -in -the -water -at -the -river's -edge -while -the -pyre -is -being -prepared -the -first -subject -was -a -man -when -the -doms -unswathed -him -to -wash -him -he -proved -to -be -a -sturdily -built -well -nourished -and -handsome -old -gentleman -with -not -a -sign -about -him -to -suggest -that -he -had -ever -been -ill -dry -wood -was -brought -and -built -up -into -a -loose -pile -the -corpse -was -laid -upon -it -and -covered -over -with -fuel -then -a -naked -holy -man -who -was -sitting -on -high -ground -a -little -distance -away -began -to -talk -and -shout -with -great -energy -and -he -kept -up -this -noise -right -along -it -may -have -been -the -funeral -sermon -and -probably -was -i -forgot -to -say -that -one -of -the -mourners -remained -behind -when -the -others -went -away -this -was -the -dead -man's -son -a -boy -of -ten -or -twelve -brown -and -handsome -grave -and -self -possessed -and -clothed -in -flowing -white -he -was -there -to -burn -his -father -he -was -given -a -torch -and -while -he -slowly -walked -seven -times -around -the -pyre -the -naked -black -man -on -the -high -ground -poured -out -his -sermon -more -clamorously -than -ever -the -seventh -circuit -completed -the -boy -applied -the -torch -at -his -father's -head -then -at -his -feet -the -flames -sprang -briskly -up -with -a -sharp -crackling -noise -and -the -lad -went -away -hindoos -do -not -want -daughters -because -their -weddings -make -such -a -ruinous -expense -but -they -want -sons -so -that -at -death -they -may -have -honorable -exit -from -the -world -and -there -is -no -honor -equal -to -the -honor -of -having -one's -pyre -lighted -by -one's -son -the -father -who -dies -sonless -is -in -a -grievous -situation -indeed -and -is -pitied -life -being -uncertain -the -hindoo -marries -while -he -is -still -a -boy -in -the -hope -that -he -will -have -a -son -ready -when -the -day -of -his -need -shall -come -but -if -he -have -no -son -he -will -adopt -one -this -answers -every -purpose -meantime -the -corpse -is -burning -also -several -others -it -is -a -dismal -business -the -stokers -did -not -sit -down -in -idleness -but -moved -briskly -about -punching -up -the -fires -with -long -poles -and -now -and -then -adding -fuel -sometimes -they -hoisted -the -half -of -a -skeleton -into -the -air -then -slammed -it -down -and -beat -it -with -the -pole -breaking -it -up -so -that -it -would -burn -better -they -hoisted -skulls -up -in -the -same -way -and -banged -and -battered -them -the -sight -was -hard -to -bear -it -would -have -been -harder -if -the -mourners -had -stayed -to -witness -it -i -had -but -a -moderate -desire -to -see -a -cremation -so -it -was -soon -satisfied -for -sanitary -reasons -it -would -be -well -if -cremation -were -universal -but -this -form -is -revolting -and -not -to -be -recommended -the -fire -used -is -sacred -of -course -for -there -is -money -in -it -ordinary -fire -is -forbidden -there -is -no -money -in -it -i -was -told -that -this -sacred -fire -is -all -furnished -by -one -person -and -that -he -has -a -monopoly -of -it -and -charges -a -good -price -for -it -sometimes -a -rich -mourner -pays -a -thousand -rupees -for -it -to -get -to -paradise -from -india -is -an -expensive -thing -every -detail -connected -with -the -matter -costs -something -and -helps -to -fatten -a -priest -i -suppose -it -is -quite -safe -to -conclude -that -that -fire -bug -is -in -holy -orders -close -to -the -cremation -ground -stand -a -few -time -worn -stones -which -are -remembrances -of -the -suttee -each -has -a -rough -carving -upon -it -representing -a -man -and -a -woman -standing -or -walking -hand -in -hand -and -marks -the -spot -where -a -widow -went -to -her -death -by -fire -in -the -days -when -the -suttee -flourished -mr -parker -said -that -widows -would -burn -themselves -now -if -the -government -would -allow -it -the -family -that -can -point -to -one -of -these -little -memorials -and -say -she -who -burned -herself -there -was -an -ancestress -of -ours -is -envied -it -is -a -curious -people -with -them -all -life -seems -to -be -sacred -except -human -life -even -the -life -of -vermin -is -sacred -and -must -not -be -taken -the -good -jain -wipes -off -a -seat -before -using -it -lest -he -cause -the -death -of -some -valueless -insect -by -sitting -down -on -it -it -grieves -him -to -have -to -drink -water -because -the -provisions -in -his -stomach -may -not -agree -with -the -microbes -yet -india -invented -thuggery -and -the -suttee -india -is -a -hard -country -to -understand -we -went -to -the -temple -of -the -thug -goddess -bhowanee -or -kali -or -durga -she -has -these -names -and -others -she -is -the -only -god -to -whom -living -sacrifices -are -made -goats -are -sacrificed -to -her -monkeys -would -be -cheaper -there -are -plenty -of -them -about -the -place -being -sacred -they -make -themselves -very -free -and -scramble -around -wherever -they -please -the -temple -and -its -porch -are -beautifully -carved -but -this -is -not -the -case -with -the -idol -bhowanee -is -not -pleasant -to -look -at -she -has -a -silver -face -and -a -projecting -swollen -tongue -painted -a -deep -red -she -wears -a -necklace -of -skulls -in -fact -none -of -the -idols -in -benares -are -handsome -or -attractive -and -what -a -swarm -of -them -there -is! -the -town -is -a -vast -museum -of -idols -and -all -of -them -crude -misshapen -and -ugly -they -flock -through -one's -dreams -at -night -a -wild -mob -of -nightmares -when -you -get -tired -of -them -in -the -temples -and -take -a -trip -on -the -river -you -find -idol -giants -flashily -painted -stretched -out -side -by -side -on -the -shore -and -apparently -wherever -there -is -room -for -one -more -lingam -a -lingam -is -there -if -vishnu -had -foreseen -what -his -town -was -going -to -be -he -would -have -called -it -idolville -or -lingamburg -the -most -conspicuous -feature -of -benares -is -the -pair -of -slender -white -minarets -which -tower -like -masts -from -the -great -mosque -of -aurangzeb -they -seem -to -be -always -in -sight -from -everywhere -those -airy -graceful -inspiring -things -but -masts -is -not -the -right -word -for -masts -have -a -perceptible -taper -while -these -minarets -have -not -they -are -142 -feet -high -and -only -8 -1/2 -feet -in -diameter -at -the -base -and -7 -1/2 -at -the -summit -scarcely -any -taper -at -all -these -are -the -proportions -of -a -candle -and -fair -and -fairylike -candles -these -are -will -be -anyway -some -day -when -the -christians -inherit -them -and -top -them -with -the -electric -light -there -is -a -great -view -from -up -there -a -wonderful -view -a -large -gray -monkey -was -part -of -it -and -damaged -it -a -monkey -has -no -judgment -this -one -was -skipping -about -the -upper -great -heights -of -the -mosque -skipping -across -empty -yawning -intervals -which -were -almost -too -wide -for -him -and -which -he -only -just -barely -cleared -each -time -by -the -skin -of -his -teeth -he -got -me -so -nervous -that -i -couldn't -look -at -the -view -i -couldn't -look -at -anything -but -him -every -time -he -went -sailing -over -one -of -those -abysses -my -breath -stood -still -and -when -he -grabbed -for -the -perch -he -was -going -for -i -grabbed -too -in -sympathy -and -he -was -perfectly -indifferent -perfectly -unconcerned -and -i -did -all -the -panting -myself -he -came -within -an -ace -of -losing -his -life -a -dozen -times -and -i -was -so -troubled -about -him -that -i -would -have -shot -him -if -i -had -had -anything -to -do -it -with -but -i -strongly -recommend -the -view -there -is -more -monkey -than -view -and -there -is -always -going -to -be -more -monkey -while -that -idiot -survives -but -what -view -you -get -is -superb -all -benares -the -river -and -the -region -round -about -are -spread -before -you -take -a -gun -and -look -at -the -view -the -next -thing -i -saw -was -more -reposeful -it -was -a -new -kind -of -art -it -was -a -picture -painted -on -water -it -was -done -by -a -native -he -sprinkled -fine -dust -of -various -colors -on -the -still -surface -of -a -basin -of -water -and -out -of -these -sprinklings -a -dainty -and -pretty -picture -gradually -grew -a -picture -which -a -breath -could -destroy -somehow -it -was -impressive -after -so -much -browsing -among -massive -and -battered -and -decaying -fanes -that -rest -upon -ruins -and -those -ruins -upon -still -other -ruins -and -those -upon -still -others -again -it -was -a -sermon -an -allegory -a -symbol -of -instability -those -creations -in -stone -were -only -a -kind -of -water -pictures -after -all -a -prominent -episode -in -the -indian -career -of -warren -hastings -had -benares -for -its -theater -wherever -that -extraordinary -man -set -his -foot -he -left -his -mark -he -came -to -benares -in -1781 -to -collect -a -fine -of -l500 -000 -which -he -had -levied -upon -its -rajah -cheit -singly -on -behalf -of -the -east -india -company -hastings -was -a -long -way -from -home -and -help -there -were -probably -not -a -dozen -englishmen -within -reach -the -rajah -was -in -his -fort -with -his -myriads -around -him -but -no -matter -from -his -little -camp -in -a -neighboring -garden -hastings -sent -a -party -to -arrest -the -sovereign -he -sent -on -this -daring -mission -a -couple -of -hundred -native -soldiers -sepoys -under -command -of -three -young -english -lieutenants -the -rajah -submitted -without -a -word -the -incident -lights -up -the -indian -situation -electrically -and -gives -one -a -vivid -sense -of -the -strides -which -the -english -had -made -and -the -mastership -they -had -acquired -in -the -land -since -the -date -of -clive's -great -victory -in -a -quarter -of -a -century -from -being -nobodies -and -feared -by -none -they -were -become -confessed -lords -and -masters -feared -by -all -sovereigns -included -and -served -by -all -sovereigns -included -it -makes -the -fairy -tales -sound -true -the -english -had -not -been -afraid -to -enlist -native -soldiers -to -fight -against -their -own -people -and -keep -them -obedient -and -now -hastings -was -not -afraid -to -come -away -out -to -this -remote -place -with -a -handful -of -such -soldiers -and -send -them -to -arrest -a -native -sovereign -the -lieutenants -imprisoned -the -rajah -in -his -own -fort -it -was -beautiful -the -pluckiness -of -it -the -impudence -of -it -the -arrest -enraged -the -rajah's -people -and -all -benares -came -storming -about -the -place -and -threatening -vengeance -and -yet -but -for -an -accident -nothing -important -would -have -resulted -perhaps -the -mob -found -out -a -most -strange -thing -an -almost -incredible -thing -that -this -handful -of -soldiers -had -come -on -this -hardy -errand -with -empty -guns -and -no -ammunition -this -has -been -attributed -to -thoughtlessness -but -it -could -hardly -have -been -that -for -in -such -large -emergencies -as -this -intelligent -people -do -think -it -must -have -been -indifference -an -over -confidence -born -of -the -proved -submissiveness -of -the -native -character -when -confronted -by -even -one -or -two -stern -britons -in -their -war -paint -but -however -that -may -be -it -was -a -fatal -discovery -that -the -mob -had -made -they -were -full -of -courage -now -and -they -broke -into -the -fort -and -massacred -the -helpless -soldiers -and -their -officers -hastings -escaped -from -benares -by -night -and -got -safely -away -leaving -the -principality -in -a -state -of -wild -insurrection -but -he -was -back -again -within -the -month -and -quieted -it -down -in -his -prompt -and -virile -way -and -took -the -rajah's -throne -away -from -him -and -gave -it -to -another -man -he -was -a -capable -kind -of -person -was -warren -hastings -this -was -the -only -time -he -was -ever -out -of -ammunition -some -of -his -acts -have -left -stains -upon -his -name -which -can -never -be -washed -away -but -he -saved -to -england -the -indian -empire -and -that -was -the -best -service -that -was -ever -done -to -the -indians -themselves -those -wretched -heirs -of -a -hundred -centuries -of -pitiless -oppression -and -abuse -chapter -liii -true -irreverence -is -disrespect -for -another -man's -god -pudd'nhead -wilson's -new -calendar -it -was -in -benares -that -i -saw -another -living -god -that -makes -two -i -believe -i -have -seen -most -of -the -greater -and -lesser -wonders -of -the -world -but -i -do -not -remember -that -any -of -them -interested -me -so -overwhelmingly -as -did -that -pair -of -gods -when -i -try -to -account -for -this -effect -i -find -no -difficulty -about -it -i -find -that -as -a -rule -when -a -thing -is -a -wonder -to -us -it -is -not -because -of -what -we -see -in -it -but -because -of -what -others -have -seen -in -it -we -get -almost -all -our -wonders -at -second -hand -we -are -eager -to -see -any -celebrated -thing -and -we -never -fail -of -our -reward -just -the -deep -privilege -of -gazing -upon -an -object -which -has -stirred -the -enthusiasm -or -evoked -the -reverence -or -affection -or -admiration -of -multitudes -of -our -race -is -a -thing -which -we -value -we -are -profoundly -glad -that -we -have -seen -it -we -are -permanently -enriched -from -having -seen -it -we -would -not -part -with -the -memory -of -that -experience -for -a -great -price -and -yet -that -very -spectacle -may -be -the -taj -you -cannot -keep -your -enthusiasms -down -you -cannot -keep -your -emotions -within -bounds -when -that -soaring -bubble -of -marble -breaks -upon -your -view -but -these -are -not -your -enthusiasms -and -emotions -they -are -the -accumulated -emotions -and -enthusiasms -of -a -thousand -fervid -writers -who -have -been -slowly -and -steadily -storing -them -up -in -your -heart -day -by -day -and -year -by -year -all -your -life -and -now -they -burst -out -in -a -flood -and -overwhelm -you -and -you -could -not -be -a -whit -happier -if -they -were -your -very -own -by -and -by -you -sober -down -and -then -you -perceive -that -you -have -been -drunk -on -the -smell -of -somebody -else's -cork -for -ever -and -ever -the -memory -of -my -distant -first -glimpse -of -the -taj -will -compensate -me -for -creeping -around -the -globe -to -have -that -great -privilege -but -the -taj -with -all -your -inflation -of -delusive -emotions -acquired -at -second -hand -from -people -to -whom -in -the -majority -of -cases -they -were -also -delusions -acquired -at -second -hand -a -thing -which -you -fortunately -did -not -think -of -or -it -might -have -made -you -doubtful -of -what -you -imagined -were -your -own -what -is -the -taj -as -a -marvel -a -spectacle -and -an -uplifting -and -overpowering -wonder -compared -with -a -living -breathing -speaking -personage -whom -several -millions -of -human -beings -devoutly -and -sincerely -and -unquestioningly -believe -to -be -a -god -and -humbly -and -gratefully -worship -as -a -god -he -was -sixty -years -old -when -i -saw -him -he -is -called -sri -108 -swami -bhaskarananda -saraswati -that -is -one -form -of -it -i -think -that -that -is -what -you -would -call -him -in -speaking -to -him -because -it -is -short -but -you -would -use -more -of -his -name -in -addressing -a -letter -to -him -courtesy -would -require -this -even -then -you -would -not -have -to -use -all -of -it -but -only -this -much -sri -108 -matparamahansrzpairivrajakacharyaswamibhaskaranandasaraswati -you -do -not -put -esq -after -it -for -that -is -not -necessary -the -word -which -opens -the -volley -is -itself -a -title -of -honor -sri -the -108 -stands -for -the -rest -of -his -names -i -believe -vishnu -has -108 -names -which -he -does -not -use -in -business -and -no -doubt -it -is -a -custom -of -gods -and -a -privilege -sacred -to -their -order -to -keep -108 -extra -ones -in -stock -just -the -restricted -name -set -down -above -is -a -handsome -property -without -the -108 -by -my -count -it -has -58 -letters -in -it -this -removes -the -long -german -words -from -competition -they -are -permanently -out -of -the -race -sri -108 -s -b -saraswati -has -attained -to -what -among -the -hindoos -is -called -the -state -of -perfection -it -is -a -state -which -other -hindoos -reach -by -being -born -again -and -again -and -over -and -over -again -into -this -world -through -one -re -incarnation -after -another -a -tiresome -long -job -covering -centuries -and -decades -of -centuries -and -one -that -is -full -of -risks -too -like -the -accident -of -dying -on -the -wrong -side -of -the -ganges -some -time -or -other -and -waking -up -in -the -form -of -an -ass -with -a -fresh -start -necessary -and -the -numerous -trips -to -be -made -all -over -again -but -in -reaching -perfection -sri -108 -s -b -s -has -escaped -all -that -he -is -no -longer -a -part -or -a -feature -of -this -world -his -substance -has -changed -all -earthiness -has -departed -out -of -it -he -is -utterly -holy -utterly -pure -nothing -can -desecrate -this -holiness -or -stain -this -purity -he -is -no -longer -of -the -earth -its -concerns -are -matters -foreign -to -him -its -pains -and -griefs -and -troubles -cannot -reach -him -when -he -dies -nirvana -is -his -he -will -be -absorbed -into -the -substance -of -the -supreme -deity -and -be -at -peace -forever -the -hindoo -scriptures -point -out -how -this -state -is -to -be -reached -but -it -is -only -once -in -a -thousand -years -perhaps -that -candidate -accomplishes -it -this -one -has -traversed -the -course -required -stage -by -stage -from -the -beginning -to -the -end -and -now -has -nothing -left -to -do -but -wait -for -the -call -which -shall -release -him -from -a -world -in -which -he -has -now -no -part -nor -lot -first -he -passed -through -the -student -stage -and -became -learned -in -the -holy -books -next -he -became -citizen -householder -husband -and -father -that -was -the -required -second -stage -then -like -john -bunyan's -christian -he -bade -perpetual -good -bye -to -his -family -as -required -and -went -wandering -away -he -went -far -into -the -desert -and -served -a -term -as -hermit -next -he -became -a -beggar -in -accordance -with -the -rites -laid -down -in -the -scriptures -and -wandered -about -india -eating -the -bread -of -mendicancy -a -quarter -of -a -century -ago -he -reached -the -stage -of -purity -this -needs -no -garment -its -symbol -is -nudity -he -discarded -the -waist -cloth -which -he -had -previously -worn -he -could -resume -it -now -if -he -chose -for -neither -that -nor -any -other -contact -can -defile -him -but -he -does -not -choose -there -are -several -other -stages -i -believe -but -i -do -not -remember -what -they -are -but -he -has -been -through -them -throughout -the -long -course -he -was -perfecting -himself -in -holy -learning -and -writing -commentaries -upon -the -sacred -books -he -was -also -meditating -upon -brahma -and -he -does -that -now -white -marble -relief -portraits -of -him -are -sold -all -about -india -he -lives -in -a -good -house -in -a -noble -great -garden -in -benares -all -meet -and -proper -to -his -stupendous -rank -necessarily -he -does -not -go -abroad -in -the -streets -deities -would -never -be -able -to -move -about -handily -in -any -country -if -one -whom -we -recognized -and -adored -as -a -god -should -go -abroad -in -our -streets -and -the -day -it -was -to -happen -were -known -all -traffic -would -be -blocked -and -business -would -come -to -a -standstill -this -god -is -comfortably -housed -and -yet -modestly -all -things -considered -for -if -he -wanted -to -live -in -a -palace -he -would -only -need -to -speak -and -his -worshipers -would -gladly -build -it -sometimes -he -sees -devotees -for -a -moment -and -comforts -them -and -blesses -them -and -they -kiss -his -feet -and -go -away -happy -rank -is -nothing -to -him -he -being -a -god -to -him -all -men -are -alike -he -sees -whom -he -pleases -and -denies -himself -to -whom -he -pleases -sometimes -he -sees -a -prince -and -denies -himself -to -a -pauper -at -other -times -he -receives -the -pauper -and -turns -the -prince -away -however -he -does -not -receive -many -of -either -class -he -has -to -husband -his -time -for -his -meditations -i -think -he -would -receive -rev -mr -parker -at -any -time -i -think -he -is -sorry -for -mr -parker -and -i -think -mr -parker -is -sorry -for -him -and -no -doubt -this -compassion -is -good -for -both -of -them -when -we -arrived -we -had -to -stand -around -in -the -garden -a -little -while -and -wait -and -the -outlook -was -not -good -for -he -had -been -turning -away -maharajas -that -day -and -receiving -only -the -riff -raff -and -we -belonged -in -between -somewhere -but -presently -a -servant -came -out -saying -it -was -all -right -he -was -coming -and -sure -enough -he -came -and -i -saw -him -that -object -of -the -worship -of -millions -it -was -a -strange -sensation -and -thrilling -i -wish -i -could -feel -it -stream -through -my -veins -again -and -yet -to -me -he -was -not -a -god -he -was -only -a -taj -the -thrill -was -not -my -thrill -but -had -come -to -me -secondhand -from -those -invisible -millions -of -believers -by -a -hand -shake -with -their -god -i -had -ground -circuited -their -wire -and -got -their -monster -battery's -whole -charge -he -was -tall -and -slender -indeed -emaciated -he -had -a -clean -cut -and -conspicuously -intellectual -face -and -a -deep -and -kindly -eye -he -looked -many -years -older -than -he -really -was -but -much -study -and -meditation -and -fasting -and -prayer -with -the -arid -life -he -had -led -as -hermit -and -beggar -could -account -for -that -he -is -wholly -nude -when -he -receives -natives -of -whatever -rank -they -may -be -but -he -had -white -cloth -around -his -loins -now -a -concession -to -mr -parker's -europe -prejudices -no -doubt -as -soon -as -i -had -sobered -down -a -little -we -got -along -very -well -together -and -i -found -him -a -most -pleasant -and -friendly -deity -he -had -heard -a -deal -about -chicago -and -showed -a -quite -remarkable -interest -in -it -for -a -god -it -all -came -of -the -world's -fair -and -the -congress -of -religions -if -india -knows -about -nothing -else -american -she -knows -about -those -and -will -keep -them -in -mind -one -while -he -proposed -an -exchange -of -autographs -a -delicate -attention -which -made -me -believe -in -him -but -i -had -been -having -my -doubts -before -he -wrote -his -in -his -book -and -i -have -a -reverent -regard -for -that -book -though -the -words -run -from -right -to -left -and -so -i -can't -read -it -it -was -a -mistake -to -print -in -that -way -it -contains -his -voluminous -comments -on -the -hindoo -holy -writings -and -if -i -could -make -them -out -i -would -try -for -perfection -myself -i -gave -him -a -copy -of -huckleberry -finn -i -thought -it -might -rest -him -up -a -little -to -mix -it -in -along -with -his -meditations -on -brahma -for -he -looked -tired -and -i -knew -that -if -it -didn't -do -him -any -good -it -wouldn't -do -him -any -harm -he -has -a -scholar -meditating -under -him -mina -bahadur -rana -but -we -did -not -see -him -he -wears -clothes -and -is -very -imperfect -he -has -written -a -little -pamphlet -about -his -master -and -i -have -that -it -contains -a -wood -cut -of -the -master -and -himself -seated -on -a -rug -in -the -garden -the -portrait -of -the -master -is -very -good -indeed -the -posture -is -exactly -that -which -brahma -himself -affects -and -it -requires -long -arms -and -limber -legs -and -can -be -accumulated -only -by -gods -and -the -india -rubber -man -there -is -a -life -size -marble -relief -of -shri -108 -s -b -s -in -the -garden -it -represents -him -in -this -same -posture -dear -me! -it -is -a -strange -world -particularly -the -indian -division -of -it -this -pupil -mina -bahadur -rana -is -not -a -commonplace -person -but -a -man -of -distinguished -capacities -and -attainments -and -apparently -he -had -a -fine -worldly -career -in -front -of -him -he -was -serving -the -nepal -government -in -a -high -capacity -at -the -court -of -the -viceroy -of -india -twenty -years -ago -he -was -an -able -man -educated -a -thinker -a -man -of -property -but -the -longing -to -devote -himself -to -a -religious -life -came -upon -him -and -he -resigned -his -place -turned -his -back -upon -the -vanities -and -comforts -of -the -world -and -went -away -into -the -solitudes -to -live -in -a -hut -and -study -the -sacred -writings -and -meditate -upon -virtue -and -holiness -and -seek -to -attain -them -this -sort -of -religion -resembles -ours -christ -recommended -the -rich -to -give -away -all -their -property -and -follow -him -in -poverty -not -in -worldly -comfort -american -and -english -millionaires -do -it -every -day -and -thus -verify -and -confirm -to -the -world -the -tremendous -forces -that -lie -in -religion -yet -many -people -scoff -at -them -for -this -loyalty -to -duty -and -many -will -scoff -at -mina -bahadur -rana -and -call -him -a -crank -like -many -christians -of -great -character -and -intellect -he -has -made -the -study -of -his -scriptures -and -the -writing -of -books -of -commentaries -upon -them -the -loving -labor -of -his -life -like -them -he -has -believed -that -his -was -not -an -idle -and -foolish -waste -of -his -life -but -a -most -worthy -and -honorable -employment -of -it -yet -there -are -many -people -who -will -see -in -those -others -men -worthy -of -homage -and -deep -reverence -but -in -him -merely -a -crank -but -i -shall -not -he -has -my -reverence -and -i -don't -offer -it -as -a -common -thing -and -poor -but -as -an -unusual -thing -and -of -value -the -ordinary -reverence -the -reverence -defined -and -explained -by -the -dictionary -costs -nothing -reverence -for -one's -own -sacred -things -parents -religion -flag -laws -and -respect -for -one's -own -beliefs -these -are -feelings -which -we -cannot -even -help -they -come -natural -to -us -they -are -involuntary -like -breathing -there -is -no -personal -merit -in -breathing -but -the -reverence -which -is -difficult -and -which -has -personal -merit -in -it -is -the -respect -which -you -pay -without -compulsion -to -the -political -or -religious -attitude -of -a -man -whose -beliefs -are -not -yours -you -can't -revere -his -gods -or -his -politics -and -no -one -expects -you -to -do -that -but -you -could -respect -his -belief -in -them -if -you -tried -hard -enough -and -you -could -respect -him -too -if -you -tried -hard -enough -but -it -is -very -very -difficult -it -is -next -to -impossible -and -so -we -hardly -ever -try -if -the -man -doesn't -believe -as -we -do -we -say -he -is -a -crank -and -that -settles -it -i -mean -it -does -nowadays -because -now -we -can't -burn -him -we -are -always -canting -about -people's -irreverence -always -charging -this -offense -upon -somebody -or -other -and -thereby -intimating -that -we -are -better -than -that -person -and -do -not -commit -that -offense -ourselves -whenever -we -do -this -we -are -in -a -lying -attitude -and -our -speech -is -cant -for -none -of -us -are -reverent -in -a -meritorious -way -deep -down -in -our -hearts -we -are -all -irreverent -there -is -probably -not -a -single -exception -to -this -rule -in -the -earth -there -is -probably -not -one -person -whose -reverence -rises -higher -than -respect -for -his -own -sacred -things -and -therefore -it -is -not -a -thing -to -boast -about -and -be -proud -of -since -the -most -degraded -savage -has -that -and -like -the -best -of -us -has -nothing -higher -to -speak -plainly -we -despise -all -reverences -and -all -objects -of -reverence -which -are -outside -the -pale -of -our -own -list -of -sacred -things -and -yet -with -strange -inconsistency -we -are -shocked -when -other -people -despise -and -defile -the -things -which -are -holy -to -us -suppose -we -should -meet -with -a -paragraph -like -the -following -in -the -newspapers -yesterday -a -visiting -party -of -the -british -nobility -had -a -picnic -at -mount -vernon -and -in -the -tomb -of -washington -they -ate -their -luncheon -sang -popular -songs -played -games -and -danced -waltzes -and -polkas -should -we -be -shocked -should -we -feel -outraged -should -we -be -amazed -should -we -call -the -performance -a -desecration -yes -that -would -all -happen -we -should -denounce -those -people -in -round -terms -and -call -them -hard -names -and -suppose -we -found -this -paragraph -in -the -newspapers -yesterday -a -visiting -party -of -american -pork -millionaires -had -a -picnic -in -westminster -abbey -and -in -that -sacred -place -they -ate -their -luncheon -sang -popular -songs -played -games -and -danced -waltzes -and -polkas -would -the -english -be -shocked -would -they -feel -outraged -would -they -be -amazed -would -they -call -the -performance -a -desecration -that -would -all -happen -the -pork -millionaires -would -be -denounced -in -round -terms -they -would -be -called -hard -names -in -the -tomb -at -mount -vernon -lie -the -ashes -of -america's -most -honored -son -in -the -abbey -the -ashes -of -england's -greatest -dead -the -tomb -of -tombs -the -costliest -in -the -earth -the -wonder -of -the -world -the -taj -was -built -by -a -great -emperor -to -honor -the -memory -of -a -perfect -wife -and -perfect -mother -one -in -whom -there -was -no -spot -or -blemish -whose -love -was -his -stay -and -support -whose -life -was -the -light -of -the -world -to -him -in -it -her -ashes -lie -and -to -the -mohammedan -millions -of -india -it -is -a -holy -place -to -them -it -is -what -mount -vernon -is -to -americans -it -is -what -the -abbey -is -to -the -english -major -sleeman -wrote -forty -or -fifty -years -ago -the -italics -are -mine -i -would -here -enter -my -humble -protest -against -the -quadrille -and -lunch -parties -which -are -sometimes -given -to -european -ladies -and -gentlemen -of -the -station -at -this -imperial -tomb -drinking -and -dancing -are -no -doubt -very -good -things -in -their -season -but -they -are -sadly -out -of -place -in -a -sepulchre -were -there -any -americans -among -those -lunch -parties -if -they -were -invited -there -were -if -my -imagined -lunch -parties -in -westminster -and -the -tomb -of -washington -should -take -place -the -incident -would -cause -a -vast -outbreak -of -bitter -eloquence -about -barbarism -and -irreverence -and -it -would -come -from -two -sets -of -people -who -would -go -next -day -and -dance -in -the -taj -if -they -had -a -chance -as -we -took -our -leave -of -the -benares -god -and -started -away -we -noticed -a -group -of -natives -waiting -respectfully -just -within -the -gate -a -rajah -from -somewhere -in -india -and -some -people -of -lesser -consequence -the -god -beckoned -them -to -come -and -as -we -passed -out -the -rajah -was -kneeling -and -reverently -kissing -his -sacred -feet -if -barnum -but -barnum's -ambitions -are -at -rest -this -god -will -remain -in -the -holy -peace -and -seclusion -of -his -garden -undisturbed -barnum -could -not -have -gotten -him -anyway -still -he -would -have -found -a -substitute -that -would -answer -chapter -liv -do -not -undervalue -the -headache -while -it -is -at -its -sharpest -it -seems -a -bad -investment -but -when -relief -begins -the -unexpired -remainder -is -worth -$4 -a -minute -pudd'nhead -wilson's -new -calendar -a -comfortable -railway -journey -of -seventeen -and -a -half -hours -brought -us -to -the -capital -of -india -which -is -likewise -the -capital -of -bengal -calcutta -like -bombay -it -has -a -population -of -nearly -a -million -natives -and -a -small -gathering -of -white -people -it -is -a -huge -city -and -fine -and -is -called -the -city -of -palaces -it -is -rich -in -historical -memories -rich -in -british -achievement -military -political -commercial -rich -in -the -results -of -the -miracles -done -by -that -brace -of -mighty -magicians -clive -and -hastings -and -has -a -cloud -kissing -monument -to -one -ochterlony -it -is -a -fluted -candlestick -250 -feet -high -this -lingam -is -the -only -large -monument -in -calcutta -i -believe -it -is -a -fine -ornament -and -will -keep -ochterlony -in -mind -wherever -you -are -in -calcutta -and -for -miles -around -you -can -see -it -and -always -when -you -see -it -you -think -of -ochterlony -and -so -there -is -not -an -hour -in -the -day -that -you -do -not -think -of -ochterlony -and -wonder -who -he -was -it -is -good -that -clive -cannot -come -back -for -he -would -think -it -was -for -plassey -and -then -that -great -spirit -would -be -wounded -when -the -revelation -came -that -it -was -not -clive -would -find -out -that -it -was -for -ochterlony -and -he -would -think -ochterlony -was -a -battle -and -he -would -think -it -was -a -great -one -too -and -he -would -say -with -three -thousand -i -whipped -sixty -thousand -and -founded -the -empire -and -there -is -no -monument -this -other -soldier -must -have -whipped -a -billion -with -a -dozen -and -saved -the -world -but -he -would -be -mistaken -ochterlony -was -a -man -not -a -battle -and -he -did -good -and -honorable -service -too -as -good -and -honorable -service -as -has -been -done -in -india -by -seventy -five -or -a -hundred -other -englishmen -of -courage -rectitude -and -distinguished -capacity -for -india -has -been -a -fertile -breeding -ground -of -such -men -and -remains -so -great -men -both -in -war -and -in -the -civil -service -and -as -modest -as -great -but -they -have -no -monuments -and -were -not -expecting -any -ochterlony -could -not -have -been -expecting -one -and -it -is -not -at -all -likely -that -he -desired -one -certainly -not -until -clive -and -hastings -should -be -supplied -every -day -clive -and -hastings -lean -on -the -battlements -of -heaven -and -look -down -and -wonder -which -of -the -two -the -monument -is -for -and -they -fret -and -worry -because -they -cannot -find -out -and -so -the -peace -of -heaven -is -spoiled -for -them -and -lost -but -not -for -ochterlony -ochterlony -is -not -troubled -he -doesn't -suspect -that -it -is -his -monument -heaven -is -sweet -and -peaceful -to -him -there -is -a -sort -of -unfairness -about -it -all -indeed -if -monuments -were -always -given -in -india -for -high -achievements -duty -straitly -performed -and -smirchless -records -the -landscape -would -be -monotonous -with -them -the -handful -of -english -in -india -govern -the -indian -myriads -with -apparent -ease -and -without -noticeable -friction -through -tact -training -and -distinguished -administrative -ability -reinforced -by -just -and -liberal -laws -and -by -keeping -their -word -to -the -native -whenever -they -give -it -england -is -far -from -india -and -knows -little -about -the -eminent -services -performed -by -her -servants -there -for -it -is -the -newspaper -correspondent -who -makes -fame -and -he -is -not -sent -to -india -but -to -the -continent -to -report -the -doings -of -the -princelets -and -the -dukelets -and -where -they -are -visiting -and -whom -they -are -marrying -often -a -british -official -spends -thirty -or -forty -years -in -india -climbing -from -grade -to -grade -by -services -which -would -make -him -celebrated -anywhere -else -and -finishes -as -a -vice -sovereign -governing -a -great -realm -and -millions -of -subjects -then -he -goes -home -to -england -substantially -unknown -and -unheard -of -and -settles -down -in -some -modest -corner -and -is -as -one -extinguished -ten -years -later -there -is -a -twenty -line -obituary -in -the -london -papers -and -the -reader -is -paralyzed -by -the -splendors -of -a -career -which -he -is -not -sure -that -he -had -ever -heard -of -before -but -meanwhile -he -has -learned -all -about -the -continental -princelets -and -dukelets -the -average -man -is -profoundly -ignorant -of -countries -that -lie -remote -from -his -own -when -they -are -mentioned -in -his -presence -one -or -two -facts -and -maybe -a -couple -of -names -rise -like -torches -in -his -mind -lighting -up -an -inch -or -two -of -it -and -leaving -the -rest -all -dark -the -mention -of -egypt -suggests -some -biblical -facts -and -the -pyramids -nothing -more -the -mention -of -south -africa -suggests -kimberly -and -the -diamonds -and -there -an -end -formerly -the -mention -to -a -hindoo -of -america -suggested -a -name -george -washington -with -that -his -familiarity -with -our -country -was -exhausted -latterly -his -familiarity -with -it -has -doubled -in -bulk -so -that -when -america -is -mentioned -now -two -torches -flare -up -in -the -dark -caverns -of -his -mind -and -he -says -ah -the -country -of -the -great -man -washington -and -of -the -holy -city -chicago -for -he -knows -about -the -congress -of -religion -and -this -has -enabled -him -to -get -an -erroneous -impression -of -chicago -when -india -is -mentioned -to -the -citizen -of -a -far -country -it -suggests -clive -hastings -the -mutiny -kipling -and -a -number -of -other -great -events -and -the -mention -of -calcutta -infallibly -brings -up -the -black -hole -and -so -when -that -citizen -finds -himself -in -the -capital -of -india -he -goes -first -of -all -to -see -the -black -hole -of -calcutta -and -is -disappointed -the -black -hole -was -not -preserved -it -is -gone -long -long -ago -it -is -strange -just -as -it -stood -it -was -itself -a -monument -a -ready -made -one -it -was -finished -it -was -complete -its -materials -were -strong -and -lasting -it -needed -no -furbishing -up -no -repairs -it -merely -needed -to -be -let -alone -it -was -the -first -brick -the -foundation -stone -upon -which -was -reared -a -mighty -empire -the -indian -empire -of -great -britain -it -was -the -ghastly -episode -of -the -black -hole -that -maddened -the -british -and -brought -clive -that -young -military -marvel -raging -up -from -madras -it -was -the -seed -from -which -sprung -plassey -and -it -was -that -extraordinary -battle -whose -like -had -not -been -seen -in -the -earth -since -agincourt -that -laid -deep -and -strong -the -foundations -of -england's -colossal -indian -sovereignty -and -yet -within -the -time -of -men -who -still -live -the -black -hole -was -torn -down -and -thrown -away -as -carelessly -as -if -its -bricks -were -common -clay -not -ingots -of -historic -gold -there -is -no -accounting -for -human -beings -the -supposed -site -of -the -black -hole -is -marked -by -an -engraved -plate -i -saw -that -and -better -that -than -nothing -the -black -hole -was -a -prison -a -cell -is -nearer -the -right -word -eighteen -feet -square -the -dimensions -of -an -ordinary -bedchamber -and -into -this -place -the -victorious -nabob -of -bengal -packed -146 -of -his -english -prisoners -there -was -hardly -standing -room -for -them -scarcely -a -breath -of -air -was -to -be -got -the -time -was -night -the -weather -sweltering -hot -before -the -dawn -came -the -captives -were -all -dead -but -twenty -three -mr -holwell's -long -account -of -the -awful -episode -was -familiar -to -the -world -a -hundred -years -ago -but -one -seldom -sees -in -print -even -an -extract -from -it -in -our -day -among -the -striking -things -in -it -is -this -mr -holwell -perishing -with -thirst -kept -himself -alive -by -sucking -the -perspiration -from -his -sleeves -it -gives -one -a -vivid -idea -of -the -situation -he -presently -found -that -while -he -was -busy -drawing -life -from -one -of -his -sleeves -a -young -english -gentleman -was -stealing -supplies -from -the -other -one -holwell -was -an -unselfish -man -a -man -of -the -most -generous -impulses -he -lived -and -died -famous -for -these -fine -and -rare -qualities -yet -when -he -found -out -what -was -happening -to -that -unwatched -sleeve -he -took -the -precaution -to -suck -that -one -dry -first -the -miseries -of -the -black -hole -were -able -to -change -even -a -nature -like -his -but -that -young -gentleman -was -one -of -the -twenty -three -survivors -and -he -said -it -was -the -stolen -perspiration -that -saved -his -life -from -the -middle -of -mr -holwell's -narrative -i -will -make -a -brief -excerpt -then -a -general -prayer -to -heaven -to -hasten -the -approach -of -the -flames -to -the -right -and -left -of -us -and -put -a -period -to -our -misery -but -these -failing -they -whose -strength -and -spirits -were -quite -exhausted -laid -themselves -down -and -expired -quietly -upon -their -fellows -others -who -had -yet -some -strength -and -vigor -left -made -a -last -effort -at -the -windows -and -several -succeeded -by -leaping -and -scrambling -over -the -backs -and -heads -of -those -in -the -first -rank -and -got -hold -of -the -bars -from -which -there -was -no -removing -them -many -to -the -right -and -left -sunk -with -the -violent -pressure -and -were -soon -suffocated -for -now -a -steam -arose -from -the -living -and -the -dead -which -affected -us -in -all -its -circumstances -as -if -we -were -forcibly -held -with -our -heads -over -a -bowl -full -of -strong -volatile -spirit -of -hartshorn -until -suffocated -nor -could -the -effluvia -of -the -one -be -distinguished -from -the -other -and -frequently -when -i -was -forced -by -the -load -upon -my -head -and -shoulders -to -hold -my -face -down -i -was -obliged -near -as -i -was -to -the -window -instantly -to -raise -it -again -to -avoid -suffocation -i -need -not -my -dear -friend -ask -your -commiseration -when -i -tell -you -that -in -this -plight -from -half -an -hour -past -eleven -till -near -two -in -the -morning -i -sustained -the -weight -of -a -heavy -man -with -his -knees -in -my -back -and -the -pressure -of -his -whole -body -on -my -head -a -dutch -surgeon -who -had -taken -his -seat -upon -my -left -shoulder -and -a -topaz -a -black -christian -soldier -bearing -on -my -right -all -which -nothing -could -have -enabled -me -to -support -but -the -props -and -pressure -equally -sustaining -me -all -around -the -two -latter -i -frequently -dislodged -by -shifting -my -hold -on -the -bars -and -driving -my -knuckles -into -their -ribs -but -my -friend -above -stuck -fast -held -immovable -by -two -bars -i -exerted -anew -my -strength -and -fortitude -but -the -repeated -trials -and -efforts -i -made -to -dislodge -the -insufferable -incumbrances -upon -me -at -last -quite -exhausted -me -and -towards -two -o'clock -finding -i -must -quit -the -window -or -sink -where -i -was -i -resolved -on -the -former -having -bore -truly -for -the -sake -of -others -infinitely -more -for -life -than -the -best -of -it -is -worth -in -the -rank -close -behind -me -was -an -officer -of -one -of -the -ships -whose -name -was -cary -and -who -had -behaved -with -much -bravery -during -the -siege -his -wife -a -fine -woman -though -country -born -would -not -quit -him -but -accompanied -him -into -the -prison -and -was -one -who -survived -this -poor -wretch -had -been -long -raving -for -water -and -air -i -told -him -i -was -determined -to -give -up -life -and -recommended -his -gaining -my -station -on -my -quitting -it -he -made -a -fruitless -attempt -to -get -my -place -but -the -dutch -surgeon -who -sat -on -my -shoulder -supplanted -him -poor -cary -expressed -his -thankfulness -and -said -he -would -give -up -life -too -but -it -was -with -the -utmost -labor -we -forced -our -way -from -the -window -several -in -the -inner -ranks -appearing -to -me -dead -standing -unable -to -fall -by -the -throng -and -equal -pressure -around -he -laid -himself -down -to -die -and -his -death -i -believe -was -very -sudden -for -he -was -a -short -full -sanguine -man -his -strength -was -great -and -i -imagine -had -he -not -retired -with -me -i -should -never -have -been -able -to -force -my -way -i -was -at -this -time -sensible -of -no -pain -and -little -uneasiness -i -can -give -you -no -better -idea -of -my -situation -than -by -repeating -my -simile -of -the -bowl -of -spirit -of -hartshorn -i -found -a -stupor -coming -on -apace -and -laid -myself -down -by -that -gallant -old -man -the -rev -mr -jervas -bellamy -who -laid -dead -with -his -son -the -lieutenant -hand -in -hand -near -the -southernmost -wall -of -the -prison -when -i -had -lain -there -some -little -time -i -still -had -reflection -enough -to -suffer -some -uneasiness -in -the -thought -that -i -should -be -trampled -upon -when -dead -as -i -myself -had -done -to -others -with -some -difficulty -i -raised -myself -and -gained -the -platform -a -second -time -where -i -presently -lost -all -sensation -the -last -trace -of -sensibility -that -i -have -been -able -to -recollect -after -my -laying -down -was -my -sash -being -uneasy -about -my -waist -which -i -untied -and -threw -from -me -of -what -passed -in -this -interval -to -the -time -of -my -resurrection -from -this -hole -of -horrors -i -can -give -you -no -account -there -was -plenty -to -see -in -calcutta -but -there -was -not -plenty -of -time -for -it -i -saw -the -fort -that -clive -built -and -the -place -where -warren -hastings -and -the -author -of -the -junius -letters -fought -their -duel -and -the -great -botanical -gardens -and -the -fashionable -afternoon -turnout -in -the -maidan -and -a -grand -review -of -the -garrison -in -a -great -plain -at -sunrise -and -a -military -tournament -in -which -great -bodies -of -native -soldiery -exhibited -the -perfection -of -their -drill -at -all -arms -a -spectacular -and -beautiful -show -occupying -several -nights -and -closing -with -the -mimic -storming -of -a -native -fort -which -was -as -good -as -the -reality -for -thrilling -and -accurate -detail -and -better -than -the -reality -for -security -and -comfort -we -had -a -pleasure -excursion -on -the -'hoogly' -by -courtesy -of -friends -and -devoted -the -rest -of -the -time -to -social -life -and -the -indian -museum -one -should -spend -a -month -in -the -museum -an -enchanted -palace -of -indian -antiquities -indeed -a -person -might -spend -half -a -year -among -the -beautiful -and -wonderful -things -without -exhausting -their -interest -it -was -winter -we -were -of -kipling's -hosts -of -tourists -who -travel -up -and -down -india -in -the -cold -weather -showing -how -things -ought -to -be -managed -it -is -a -common -expression -there -the -cold -weather -and -the -people -think -there -is -such -a -thing -it -is -because -they -have -lived -there -half -a -lifetime -and -their -perceptions -have -become -blunted -when -a -person -is -accustomed -to -138 -in -the -shade -his -ideas -about -cold -weather -are -not -valuable -i -had -read -in -the -histories -that -the -june -marches -made -between -lucknow -and -cawnpore -by -the -british -forces -in -the -time -of -the -mutiny -were -made -weather -138 -in -the -shade -and -had -taken -it -for -historical -embroidery -i -had -read -it -again -in -serjeant -major -forbes -mitchell's -account -of -his -military -experiences -in -the -mutiny -at -least -i -thought -i -had -and -in -calcutta -i -asked -him -if -it -was -true -and -he -said -it -was -an -officer -of -high -rank -who -had -been -in -the -thick -of -the -mutiny -said -the -same -as -long -as -those -men -were -talking -about -what -they -knew -they -were -trustworthy -and -i -believed -them -but -when -they -said -it -was -now -cold -weather -i -saw -that -they -had -traveled -outside -of -their -sphere -of -knowledge -and -were -floundering -i -believe -that -in -india -cold -weather -is -merely -a -conventional -phrase -and -has -come -into -use -through -the -necessity -of -having -some -way -to -distinguish -between -weather -which -will -melt -a -brass -door -knob -and -weather -which -will -only -make -it -mushy -it -was -observable -that -brass -ones -were -in -use -while -i -was -in -calcutta -showing -that -it -was -not -yet -time -to -change -to -porcelain -i -was -told -the -change -to -porcelain -was -not -usually -made -until -may -but -this -cold -weather -was -too -warm -for -us -so -we -started -to -darjeeling -in -the -himalayas -a -twenty -four -hour -journey -chapter -lv -there -are -869 -different -forms -of -lying -but -only -one -of -them -has -been -squarely -forbidden -thou -shalt -not -bear -false -witness -against -thy -neighbor -pudd'nhead -wilson's -new -calendar -from -diary -february -14 -we -left -at -4 -30 -p -m -until -dark -we -moved -through -rich -vegetation -then -changed -to -a -boat -and -crossed -the -ganges -february -15 -up -with -the -sun -a -brilliant -morning -and -frosty -a -double -suit -of -flannels -is -found -necessary -the -plain -is -perfectly -level -and -seems -to -stretch -away -and -away -and -away -dimming -and -softening -to -the -uttermost -bounds -of -nowhere -what -a -soaring -strenuous -gushing -fountain -spray -of -delicate -greenery -a -bunch -of -bamboo -is! -as -far -as -the -eye -can -reach -these -grand -vegetable -geysers -grace -the -view -their -spoutings -refined -to -steam -by -distance -and -there -are -fields -of -bananas -with -the -sunshine -glancing -from -the -varnished -surface -of -their -drooping -vast -leaves -and -there -are -frequent -groves -of -palm -and -an -effective -accent -is -given -to -the -landscape -by -isolated -individuals -of -this -picturesque -family -towering -clean -stemmed -their -plumes -broken -and -hanging -ragged -nature's -imitation -of -an -umbrella -that -has -been -out -to -see -what -a -cyclone -is -like -and -is -trying -not -to -look -disappointed -and -everywhere -through -the -soft -morning -vistas -we -glimpse -the -villages -the -countless -villages -the -myriad -villages -thatched -built -of -clean -new -matting -snuggling -among -grouped -palms -and -sheaves -of -bamboo -villages -villages -no -end -of -villages -not -three -hundred -yards -apart -and -dozens -and -dozens -of -them -in -sight -all -the -time -a -mighty -city -hundreds -of -miles -long -hundreds -of -miles -broad -made -all -of -villages -the -biggest -city -in -the -earth -and -as -populous -as -a -european -kingdom -i -have -seen -no -such -city -as -this -before -and -there -is -a -continuously -repeated -and -replenished -multitude -of -naked -men -in -view -on -both -sides -and -ahead -we -fly -through -it -mile -after -mile -but -still -it -is -always -there -on -both -sides -and -ahead -brown -bodied -naked -men -and -boys -plowing -in -the -fields -but -not -woman -in -these -two -hours -i -have -not -seen -a -woman -or -a -girl -working -in -the -fields -from -greenland's -icy -mountains -from -india's -coral -strand -where -afric's -sunny -fountains -roll -down -their -golden -sand -from -many -an -ancient -river -from -many -a -palmy -plain -they -call -us -to -deliver -their -land -from -error's -chain -those -are -beautiful -verses -and -they -have -remained -in -my -memory -all -my -life -but -if -the -closing -lines -are -true -let -us -hope -that -when -we -come -to -answer -the -call -and -deliver -the -land -from -its -errors -we -shall -secrete -from -it -some -of -our -high -civilization -ways -and -at -the -same -time -borrow -some -of -its -pagan -ways -to -enrich -our -high -system -with -we -have -a -right -to -do -this -if -we -lift -those -people -up -we -have -a -right -to -lift -ourselves -up -nine -or -ten -grades -or -so -at -their -expense -a -few -years -ago -i -spent -several -weeks -at -tolz -in -bavaria -it -is -a -roman -catholic -region -and -not -even -benares -is -more -deeply -or -pervasively -or -intelligently -devout -in -my -diary -of -those -days -i -find -this -we -took -a -long -drive -yesterday -around -about -the -lovely -country -roads -but -it -was -a -drive -whose -pleasure -was -damaged -in -a -couple -of -ways -by -the -dreadful -shrines -and -by -the -shameful -spectacle -of -gray -and -venerable -old -grandmothers -toiling -in -the -fields -the -shrines -were -frequent -along -the -roads -figures -of -the -saviour -nailed -to -the -cross -and -streaming -with -blood -from -the -wounds -of -the -nails -and -the -thorns -when -missionaries -go -from -here -do -they -find -fault -with -the -pagan -idols -i -saw -many -women -seventy -and -even -eighty -years -old -mowing -and -binding -in -the -fields -and -pitchforking -the -loads -into -the -wagons -i -was -in -austria -later -and -in -munich -in -munich -i -saw -gray -old -women -pushing -trucks -up -hill -and -down -long -distances -trucks -laden -with -barrels -of -beer -incredible -loads -in -my -austrian -diary -i -find -this -in -the -fields -i -often -see -a -woman -and -a -cow -harnessed -to -the -plow -and -a -man -driving -in -the -public -street -of -marienbad -to -day -i -saw -an -old -bent -gray -headed -woman -in -harness -with -a -dog -drawing -a -laden -sled -over -bare -dirt -roads -and -bare -pavements -and -at -his -ease -walked -the -driver -smoking -his -pipe -a -hale -fellow -not -thirty -years -old -five -or -six -years -ago -i -bought -an -open -boat -made -a -kind -of -a -canvas -wagon -roof -over -the -stern -of -it -to -shelter -me -from -sun -and -rain -hired -a -courier -and -a -boatman -and -made -a -twelve -day -floating -voyage -down -the -rhone -from -lake -bourget -to -marseilles -in -my -diary -of -that -trip -i -find -this -entry -i -was -far -down -the -rhone -then -passing -st -etienne -2 -15 -p -m -on -a -distant -ridge -inland -a -tall -openwork -structure -commandingly -situated -with -a -statue -of -the -virgin -standing -on -it -a -devout -country -all -down -this -river -wherever -there -is -a -crag -there -is -a -statue -of -the -virgin -on -it -i -believe -i -have -seen -a -hundred -of -them -and -yet -in -many -respects -the -peasantry -seem -to -be -mere -pagans -and -destitute -of -any -considerable -degree -of -civilization -we -reached -a -not -very -promising -looking -village -about -4 -o'clock -and -i -concluded -to -tie -up -for -the -day -munching -fruit -and -fogging -the -hood -with -pipe -smoke -had -grown -monotonous -i -could -not -have -the -hood -furled -because -the -floods -of -rain -fell -unceasingly -the -tavern -was -on -the -river -bank -as -is -the -custom -it -was -dull -there -and -melancholy -nothing -to -do -but -look -out -of -the -window -into -the -drenching -rain -and -shiver -one -could -do -that -for -it -was -bleak -and -cold -and -windy -and -country -france -furnishes -no -fire -winter -overcoats -did -not -help -me -much -they -had -to -be -supplemented -with -rugs -the -raindrops -were -so -large -and -struck -the -river -with -such -force -that -they -knocked -up -the -water -like -pebble -splashes -with -the -exception -of -a -very -occasional -woodenshod -peasant -nobody -was -abroad -in -this -bitter -weather -i -mean -nobody -of -our -sex -but -all -weathers -are -alike -to -the -women -in -these -continental -countries -to -them -and -the -other -animals -life -is -serious -nothing -interrupts -their -slavery -three -of -them -were -washing -clothes -in -the -river -under -the -window -when -i -arrived -and -they -continued -at -it -as -long -as -there -was -light -to -work -by -one -was -apparently -thirty -another -the -mother! -above -fifty -the -third -grandmother! -so -old -and -worn -and -gray -she -could -have -passed -for -eighty -i -took -her -to -be -that -old -they -had -no -waterproofs -nor -rubbers -of -course -over -their -shoulders -they -wore -gunnysacks -simply -conductors -for -rivers -of -water -some -of -the -volume -reached -the -ground -the -rest -soaked -in -on -the -way -at -last -a -vigorous -fellow -of -thirty -five -arrived -dry -and -comfortable -smoking -his -pipe -under -his -big -umbrella -in -an -open -donkey -cart -husband -son -and -grandson -of -those -women! -he -stood -up -in -the -cart -sheltering -himself -and -began -to -superintend -issuing -his -orders -in -a -masterly -tone -of -command -and -showing -temper -when -they -were -not -obeyed -swiftly -enough -without -complaint -or -murmur -the -drowned -women -patiently -carried -out -the -orders -lifting -the -immense -baskets -of -soggy -wrung -out -clothing -into -the -cart -and -stowing -them -to -the -man's -satisfaction -there -were -six -of -the -great -baskets -and -a -man -of -mere -ordinary -strength -could -not -have -lifted -any -one -of -them -the -cart -being -full -now -the -frenchman -descended -still -sheltered -by -his -umbrella -entered -the -tavern -and -the -women -went -drooping -homeward -trudging -in -the -wake -of -the -cart -and -soon -were -blended -with -the -deluge -and -lost -to -sight -when -i -went -down -into -the -public -room -the -frenchman -had -his -bottle -of -wine -and -plate -of -food -on -a -bare -table -black -with -grease -and -was -chomping -like -a -horse -he -had -the -little -religious -paper -which -is -in -everybody's -hands -on -the -rhone -borders -and -was -enlightening -himself -with -the -histories -of -french -saints -who -used -to -flee -to -the -desert -in -the -middle -ages -to -escape -the -contamination -of -woman -for -two -hundred -years -france -has -been -sending -missionaries -to -other -savage -lands -to -spare -to -the -needy -from -poverty -like -hers -is -fine -and -true -generosity -but -to -get -back -to -india -where -as -my -favorite -poem -says -every -prospect -pleases -and -only -man -is -vile -it -is -because -bavaria -and -austria -and -france -have -not -introduced -their -civilization -to -him -yet -but -bavaria -and -austria -and -france -are -on -their -way -they -are -coming -they -will -rescue -him -they -will -refine -the -vileness -out -of -him -some -time -during -the -forenoon -approaching -the -mountains -we -changed -from -the -regular -train -to -one -composed -of -little -canvas -sheltered -cars -that -skimmed -along -within -a -foot -of -the -ground -and -seemed -to -be -going -fifty -miles -an -hour -when -they -were -really -making -about -twenty -each -car -had -seating -capacity -for -half -a -dozen -persons -and -when -the -curtains -were -up -one -was -substantially -out -of -doors -and -could -see -everywhere -and -get -all -the -breeze -and -be -luxuriously -comfortable -it -was -not -a -pleasure -excursion -in -name -only -but -in -fact -after -a -while -the -stopped -at -a -little -wooden -coop -of -a -station -just -within -the -curtain -of -the -sombre -jungle -a -place -with -a -deep -and -dense -forest -of -great -trees -and -scrub -and -vines -all -about -it -the -royal -bengal -tiger -is -in -great -force -there -and -is -very -bold -and -unconventional -from -this -lonely -little -station -a -message -once -went -to -the -railway -manager -in -calcutta -tiger -eating -station -master -on -front -porch -telegraph -instructions -it -was -there -that -i -had -my -first -tiger -hunt -i -killed -thirteen -we -were -presently -away -again -and -the -train -began -to -climb -the -mountains -in -one -place -seven -wild -elephants -crossed -the -track -but -two -of -them -got -away -before -i -could -overtake -them -the -railway -journey -up -the -mountain -is -forty -miles -and -it -takes -eight -hours -to -make -it -it -is -so -wild -and -interesting -and -exciting -and -enchanting -that -it -ought -to -take -a -week -as -for -the -vegetation -it -is -a -museum -the -jungle -seemed -to -contain -samples -of -every -rare -and -curious -tree -and -bush -that -we -had -ever -seen -or -heard -of -it -is -from -that -museum -i -think -that -the -globe -must -have -been -supplied -with -the -trees -and -vines -and -shrubs -that -it -holds -precious -the -road -is -infinitely -and -charmingly -crooked -it -goes -winding -in -and -out -under -lofty -cliffs -that -are -smothered -in -vines -and -foliage -and -around -the -edges -of -bottomless -chasms -and -all -the -way -one -glides -by -files -of -picturesque -natives -some -carrying -burdens -up -others -going -down -from -their -work -in -the -tea -gardens -and -once -there -was -a -gaudy -wedding -procession -all -bright -tinsel -and -color -and -a -bride -comely -and -girlish -who -peeped -out -from -the -curtains -of -her -palanquin -exposing -her -face -with -that -pure -delight -which -the -young -and -happy -take -in -sin -for -sin's -own -sake -by -and -by -we -were -well -up -in -the -region -of -the -clouds -and -from -that -breezy -height -we -looked -down -and -afar -over -a -wonderful -picture -the -plains -of -india -stretching -to -the -horizon -soft -and -fair -level -as -a -floor -shimmering -with -heat -mottled -with -cloud -shadows -and -cloven -with -shining -rivers -immediately -below -us -and -receding -down -down -down -toward -the -valley -was -a -shaven -confusion -of -hilltops -with -ribbony -roads -and -paths -squirming -and -snaking -cream -yellow -all -over -them -and -about -them -every -curve -and -twist -sharply -distinct -at -an -elevation -of -6 -000 -feet -we -entered -a -thick -cloud -and -it -shut -out -the -world -and -kept -it -shut -out -we -climbed -1 -000 -feet -higher -then -began -to -descend -and -presently -got -down -to -darjeeling -which -is -6 -000 -feet -above -the -level -of -the -plains -we -had -passed -many -a -mountain -village -on -the -way -up -and -seen -some -new -kinds -of -natives -among -them -many -samples -of -the -fighting -ghurkas -they -are -not -large -men -but -they -are -strong -and -resolute -there -are -no -better -soldiers -among -britain's -native -troops -and -we -had -passed -shoals -of -their -women -climbing -the -forty -miles -of -steep -road -from -the -valley -to -their -mountain -homes -with -tall -baskets -on -their -backs -hitched -to -their -foreheads -by -a -band -and -containing -a -freightage -weighing -i -will -not -say -how -many -hundreds -of -pounds -for -the -sum -is -unbelievable -these -were -young -women -and -they -strode -smartly -along -under -these -astonishing -burdens -with -the -air -of -people -out -for -a -holiday -i -was -told -that -a -woman -will -carry -a -piano -on -her -back -all -the -way -up -the -mountain -and -that -more -than -once -a -woman -had -done -it -if -these -were -old -women -i -should -regard -the -ghurkas -as -no -more -civilized -than -the -europeans -at -the -railway -station -at -darjeeling -you -find -plenty -of -cab -substitutes -open -coffins -in -which -you -sit -and -are -then -borne -on -men's -shoulders -up -the -steep -roads -into -the -town -up -there -we -found -a -fairly -comfortable -hotel -the -property -of -an -indiscriminate -and -incoherent -landlord -who -looks -after -nothing -but -leaves -everything -to -his -army -of -indian -servants -no -he -does -look -after -the -bill -to -be -just -to -him -and -the -tourist -cannot -do -better -than -follow -his -example -i -was -told -by -a -resident -that -the -summit -of -kinchinjunga -is -often -hidden -in -the -clouds -and -that -sometimes -a -tourist -has -waited -twenty -two -days -and -then -been -obliged -to -go -away -without -a -sight -of -it -and -yet -went -not -disappointed -for -when -he -got -his -hotel -bill -he -recognized -that -he -was -now -seeing -the -highest -thing -in -the -himalayas -but -this -is -probably -a -lie -after -lecturing -i -went -to -the -club -that -night -and -that -was -a -comfortable -place -it -is -loftily -situated -and -looks -out -over -a -vast -spread -of -scenery -from -it -you -can -see -where -the -boundaries -of -three -countries -come -together -some -thirty -miles -away -thibet -is -one -of -them -nepaul -another -and -i -think -herzegovina -was -the -other -apparently -in -every -town -and -city -in -india -the -gentlemen -of -the -british -civil -and -military -service -have -a -club -sometimes -it -is -a -palatial -one -always -it -is -pleasant -and -homelike -the -hotels -are -not -always -as -good -as -they -might -be -and -the -stranger -who -has -access -to -the -club -is -grateful -for -his -privilege -and -knows -how -to -value -it -next -day -was -sunday -friends -came -in -the -gray -dawn -with -horses -and -my -party -rode -away -to -a -distant -point -where -kinchinjunga -and -mount -everest -show -up -best -but -i -stayed -at -home -for -a -private -view -for -it -was -very -old -and -i -was -not -acquainted -with -the -horses -any -way -i -got -a -pipe -and -a -few -blankets -and -sat -for -two -hours -at -the -window -and -saw -the -sun -drive -away -the -veiling -gray -and -touch -up -the -snow -peaks -one -after -another -with -pale -pink -splashes -and -delicate -washes -of -gold -and -finally -flood -the -whole -mighty -convulsion -of -snow -mountains -with -a -deluge -of -rich -splendors -kinchinjunga's -peak -was -but -fitfully -visible -but -in -the -between -times -it -was -vividly -clear -against -the -sky -away -up -there -in -the -blue -dome -more -than -28 -000 -feet -above -sea -level -the -loftiest -land -i -had -ever -seen -by -12 -000 -feet -or -more -it -was -45 -miles -away -mount -everest -is -a -thousand -feet -higher -but -it -was -not -a -part -of -that -sea -of -mountains -piled -up -there -before -me -so -i -did -not -see -it -but -i -did -not -care -because -i -think -that -mountains -that -are -as -high -as -that -are -disagreeable -i -changed -from -the -back -to -the -front -of -the -house -and -spent -the -rest -of -the -morning -there -watching -the -swarthy -strange -tribes -flock -by -from -their -far -homes -in -the -himalayas -all -ages -and -both -sexes -were -represented -and -the -breeds -were -quite -new -to -me -though -the -costumes -of -the -thibetans -made -them -look -a -good -deal -like -chinamen -the -prayer -wheel -was -a -frequent -feature -it -brought -me -near -to -these -people -and -made -them -seem -kinfolk -of -mine -through -our -preacher -we -do -much -of -our -praying -by -proxy -we -do -not -whirl -him -around -a -stick -as -they -do -but -that -is -merely -a -detail -the -swarm -swung -briskly -by -hour -after -hour -a -strange -and -striking -pageant -it -was -wasted -there -and -it -seemed -a -pity -it -should -have -been -sent -streaming -through -the -cities -of -europe -or -america -to -refresh -eyes -weary -of -the -pale -monotonies -of -the -circus -pageant -these -people -were -bound -for -the -bazar -with -things -to -sell -we -went -down -there -later -and -saw -that -novel -congress -of -the -wild -peoples -and -plowed -here -and -there -through -it -and -concluded -that -it -would -be -worth -coming -from -calcutta -to -see -even -if -there -were -no -kinchinjunga -and -everest -chapter -lvi -there -are -two -times -in -a -man's -life -when -he -should -not -speculate -when -he -can't -afford -it -and -when -he -can -pudd'nhead -wilson's -new -calendar -on -monday -and -tuesday -at -sunrise -we -again -had -fair -to -middling -views -of -the -stupendous -mountains -then -being -well -cooled -off -and -refreshed -we -were -ready -to -chance -the -weather -of -the -lower -world -once -more -we -traveled -up -hill -by -the -regular -train -five -miles -to -the -summit -then -changed -to -a -little -canvas -canopied -hand -car -for -the -35 -mile -descent -it -was -the -size -of -a -sleigh -it -had -six -seats -and -was -so -low -that -it -seemed -to -rest -on -the -ground -it -had -no -engine -or -other -propelling -power -and -needed -none -to -help -it -fly -down -those -steep -inclines -it -only -needed -a -strong -brake -to -modify -its -flight -and -it -had -that -there -was -a -story -of -a -disastrous -trip -made -down -the -mountain -once -in -this -little -car -by -the -lieutenant -governor -of -bengal -when -the -car -jumped -the -track -and -threw -its -passengers -over -a -precipice -it -was -not -true -but -the -story -had -value -for -me -for -it -made -me -nervous -and -nervousness -wakes -a -person -up -and -makes -him -alive -and -alert -and -heightens -the -thrill -of -a -new -and -doubtful -experience -the -car -could -really -jump -the -track -of -course -a -pebble -on -the -track -placed -there -by -either -accident -or -malice -at -a -sharp -curve -where -one -might -strike -it -before -the -eye -could -discover -it -could -derail -the -car -and -fling -it -down -into -india -and -the -fact -that -the -lieutenant -governor -had -escaped -was -no -proof -that -i -would -have -the -same -luck -and -standing -there -looking -down -upon -the -indian -empire -from -the -airy -altitude -of -7 -000 -feet -it -seemed -unpleasantly -far -dangerously -far -to -be -flung -from -a -handcar -but -after -all -there -was -but -small -danger -for -me -what -there -was -was -for -mr -pugh -inspector -of -a -division -of -the -indian -police -in -whose -company -and -protection -we -had -come -from -calcutta -he -had -seen -long -service -as -an -artillery -officer -was -less -nervous -than -i -was -and -so -he -was -to -go -ahead -of -us -in -a -pilot -hand -car -with -a -ghurka -and -another -native -and -the -plan -was -that -when -we -should -see -his -car -jump -over -a -precipice -we -must -put -on -our -break -[sp -] -and -send -for -another -pilot -it -was -a -good -arrangement -also -mr -barnard -chief -engineer -of -the -mountain -division -of -the -road -was -to -take -personal -charge -of -our -car -and -he -had -been -down -the -mountain -in -it -many -a -time -everything -looked -safe -indeed -there -was -but -one -questionable -detail -left -the -regular -train -was -to -follow -us -as -soon -as -we -should -start -and -it -might -run -over -us -privately -i -thought -it -would -the -road -fell -sharply -down -in -front -of -us -and -went -corkscrewing -in -and -out -around -the -crags -and -precipices -down -down -forever -down -suggesting -nothing -so -exactly -or -so -uncomfortably -as -a -croaked -toboggan -slide -with -no -end -to -it -mr -pugh -waved -his -flag -and -started -like -an -arrow -from -a -bow -and -before -i -could -get -out -of -the -car -we -were -gone -too -i -had -previously -had -but -one -sensation -like -the -shock -of -that -departure -and -that -was -the -gaspy -shock -that -took -my -breath -away -the -first -time -that -i -was -discharged -from -the -summit -of -a -toboggan -slide -but -in -both -instances -the -sensation -was -pleasurable -intensely -so -it -was -a -sudden -and -immense -exaltation -a -mixed -ecstasy -of -deadly -fright -and -unimaginable -joy -i -believe -that -this -combination -makes -the -perfection -of -human -delight -the -pilot -car's -flight -down -the -mountain -suggested -the -swoop -of -a -swallow -that -is -skimming -the -ground -so -swiftly -and -smoothly -and -gracefully -it -swept -down -the -long -straight -reaches -and -soared -in -and -out -of -the -bends -and -around -the -corners -we -raced -after -it -and -seemed -to -flash -by -the -capes -and -crags -with -the -speed -of -light -and -now -and -then -we -almost -overtook -it -and -had -hopes -but -it -was -only -playing -with -us -when -we -got -near -it -released -its -brake -make -a -spring -around -a -corner -and -the -next -time -it -spun -into -view -a -few -seconds -later -it -looked -as -small -as -a -wheelbarrow -it -was -so -far -away -we -played -with -the -train -in -the -same -way -we -often -got -out -to -gather -flowers -or -sit -on -a -precipice -and -look -at -the -scenery -then -presently -we -would -hear -a -dull -and -growing -roar -and -the -long -coils -of -the -train -would -come -into -sight -behind -and -above -us -but -we -did -not -need -to -start -till -the -locomotive -was -close -down -upon -us -then -we -soon -left -it -far -behind -it -had -to -stop -at -every -station -therefore -it -was -not -an -embarrassment -to -us -our -brake -was -a -good -piece -of -machinery -it -could -bring -the -car -to -a -standstill -on -a -slope -as -steep -as -a -house -roof -the -scenery -was -grand -and -varied -and -beautiful -and -there -was -no -hurry -we -could -always -stop -and -examine -it -there -was -abundance -of -time -we -did -not -need -to -hamper -the -train -if -it -wanted -the -road -we -could -switch -off -and -let -it -go -by -then -overtake -it -and -pass -it -later -we -stopped -at -one -place -to -see -the -gladstone -cliff -a -great -crag -which -the -ages -and -the -weather -have -sculptured -into -a -recognizable -portrait -of -the -venerable -statesman -mr -gladstone -is -a -stockholder -in -the -road -and -nature -began -this -portrait -ten -thousand -years -ago -with -the -idea -of -having -the -compliment -ready -in -time -for -the -event -we -saw -a -banyan -tree -which -sent -down -supporting -stems -from -branches -which -were -sixty -feet -above -the -ground -that -is -i -suppose -it -was -a -banyan -its -bark -resembled -that -of -the -great -banyan -in -the -botanical -gardens -at -calcutta -that -spider -legged -thing -with -its -wilderness -of -vegetable -columns -and -there -were -frequent -glimpses -of -a -totally -leafless -tree -upon -whose -innumerable -twigs -and -branches -a -cloud -of -crimson -butterflies -had -lighted -apparently -in -fact -these -brilliant -red -butterflies -were -flowers -but -the -illusion -was -good -afterward -in -south -africa -i -saw -another -splendid -effect -made -by -red -flowers -this -flower -was -probably -called -the -torch -plant -should -have -been -so -named -anyway -it -had -a -slender -stem -several -feet -high -and -from -its -top -stood -up -a -single -tongue -of -flame -an -intensely -red -flower -of -the -size -and -shape -of -a -small -corn -cob -the -stems -stood -three -or -four -feet -apart -all -over -a -great -hill -slope -that -was -a -mile -long -and -make -one -think -of -what -the -place -de -la -concorde -would -be -if -its -myriad -lights -were -red -instead -of -white -and -yellow -a -few -miles -down -the -mountain -we -stopped -half -an -hour -to -see -a -thibetan -dramatic -performance -it -was -in -the -open -air -on -the -hillside -the -audience -was -composed -of -thibetans -ghurkas -and -other -unusual -people -the -costumes -of -the -actors -were -in -the -last -degree -outlandish -and -the -performance -was -in -keeping -with -the -clothes -to -an -accompaniment -of -barbarous -noises -the -actors -stepped -out -one -after -another -and -began -to -spin -around -with -immense -swiftness -and -vigor -and -violence -chanting -the -while -and -soon -the -whole -troupe -would -be -spinning -and -chanting -and -raising -the -dust -they -were -performing -an -ancient -and -celebrated -historical -play -and -a -chinaman -explained -it -to -me -in -pidjin -english -as -it -went -along -the -play -was -obscure -enough -without -the -explanation -with -the -explanation -added -it -was -opake -as -a -drama -this -ancient -historical -work -of -art -was -defective -i -thought -but -as -a -wild -and -barbarous -spectacle -the -representation -was -beyond -criticism -far -down -the -mountain -we -got -out -to -look -at -a -piece -of -remarkable -loop -engineering -a -spiral -where -the -road -curves -upon -itself -with -such -abruptness -that -when -the -regular -train -came -down -and -entered -the -loop -we -stood -over -it -and -saw -the -locomotive -disappear -under -our -bridge -then -in -a -few -moments -appear -again -chasing -its -own -tail -and -we -saw -it -gain -on -it -overtake -it -draw -ahead -past -the -rear -cars -and -run -a -race -with -that -end -of -the -train -it -was -like -a -snake -swallowing -itself -half -way -down -the -mountain -we -stopped -about -an -hour -at -mr -barnard's -house -for -refreshments -and -while -we -were -sitting -on -the -veranda -looking -at -the -distant -panorama -of -hills -through -a -gap -in -the -forest -we -came -very -near -seeing -a -leopard -kill -a -calf -[it -killed -it -the -day -before -] -it -is -a -wild -place -and -lovely -from -the -woods -all -about -came -the -songs -of -birds -among -them -the -contributions -of -a -couple -of -birds -which -i -was -not -then -acquainted -with -the -brain -fever -bird -and -the -coppersmith -the -song -of -the -brain -fever -demon -starts -on -a -low -but -steadily -rising -key -and -is -a -spiral -twist -which -augments -in -intensity -and -severity -with -each -added -spiral -growing -sharper -and -sharper -and -more -and -more -painful -more -and -more -agonizing -more -and -more -maddening -intolerable -unendurable -as -it -bores -deeper -and -deeper -and -deeper -into -the -listener's -brain -until -at -last -the -brain -fever -comes -as -a -relief -and -the -man -dies -i -am -bringing -some -of -these -birds -home -to -america -they -will -be -a -great -curiosity -there -and -it -is -believed -that -in -our -climate -they -will -multiply -like -rabbits -the -coppersmith -bird's -note -at -a -certain -distance -away -has -the -ring -of -a -sledge -on -granite -at -a -certain -other -distance -the -hammering -has -a -more -metallic -ring -and -you -might -think -that -the -bird -was -mending -a -copper -kettle -at -another -distance -it -has -a -more -woodeny -thump -but -it -is -a -thump -that -is -full -of -energy -and -sounds -just -like -starting -a -bung -so -he -is -a -hard -bird -to -name -with -a -single -name -he -is -a -stone -breaker -coppersmith -and -bung -starter -and -even -then -he -is -not -completely -named -for -when -he -is -close -by -you -find -that -there -is -a -soft -deep -melodious -quality -in -his -thump -and -for -that -no -satisfying -name -occurs -to -you -you -will -not -mind -his -other -notes -but -when -he -camps -near -enough -for -you -to -hear -that -one -you -presently -find -that -his -measured -and -monotonous -repetition -of -it -is -beginning -to -disturb -you -next -it -will -weary -you -soon -it -will -distress -you -and -before -long -each -thump -will -hurt -your -head -if -this -goes -on -you -will -lose -your -mind -with -the -pain -and -misery -of -it -and -go -crazy -i -am -bringing -some -of -these -birds -home -to -america -there -is -nothing -like -them -there -they -will -be -a -great -surprise -and -it -is -said -that -in -a -climate -like -ours -they -will -surpass -expectation -for -fecundity -i -am -bringing -some -nightingales -too -and -some -cue -owls -i -got -them -in -italy -the -song -of -the -nightingale -is -the -deadliest -known -to -ornithology -that -demoniacal -shriek -can -kill -at -thirty -yards -the -note -of -the -cue -owl -is -infinitely -soft -and -sweet -soft -and -sweet -as -the -whisper -of -a -flute -but -penetrating -oh -beyond -belief -it -can -bore -through -boiler -iron -it -is -a -lingering -note -and -comes -in -triplets -on -the -one -unchanging -key -hoo -o -o -hoo -o -o -hoo -o -o -then -a -silence -of -fifteen -seconds -then -the -triplet -again -and -so -on -all -night -at -first -it -is -divine -then -less -so -then -trying -then -distressing -then -excruciating -then -agonizing -and -at -the -end -of -two -hours -the -listener -is -a -maniac -and -so -presently -we -took -to -the -hand -car -and -went -flying -down -the -mountain -again -flying -and -stopping -flying -and -stopping -till -at -last -we -were -in -the -plain -once -more -and -stowed -for -calcutta -in -the -regular -train -that -was -the -most -enjoyable -day -i -have -spent -in -the -earth -for -rousing -tingling -rapturous -pleasure -there -is -no -holiday -trip -that -approaches -the -bird -flight -down -the -himalayas -in -a -hand -car -it -has -no -fault -no -blemish -no -lack -except -that -there -are -only -thirty -five -miles -of -it -instead -of -five -hundred -chapter -lvii -she -was -not -quite -what -you -would -call -refined -she -was -not -quite -what -you -would -call -unrefined -she -was -the -kind -of -person -that -keeps -a -parrot -pudd'nhead -wilson's -new -calendar -so -far -as -i -am -able -to -judge -nothing -has -been -left -undone -either -by -man -or -nature -to -make -india -the -most -extraordinary -country -that -the -sun -visits -on -his -round -nothing -seems -to -have -been -forgotten -nothing -over -looked -always -when -you -think -you -have -come -to -the -end -of -her -tremendous -specialties -and -have -finished -banging -tags -upon -her -as -the -land -of -the -thug -the -land -of -the -plague -the -land -of -famine -the -land -of -giant -illusions -the -land -of -stupendous -mountains -and -so -forth -another -specialty -crops -up -and -another -tag -is -required -i -have -been -overlooking -the -fact -that -india -is -by -an -unapproachable -supremacy -the -land -of -murderous -wild -creatures -perhaps -it -will -be -simplest -to -throw -away -the -tags -and -generalize -her -with -one -all -comprehensive -name -as -the -land -of -wonders -for -many -years -the -british -indian -government -has -been -trying -to -destroy -the -murderous -wild -creatures -and -has -spent -a -great -deal -of -money -in -the -effort -the -annual -official -returns -show -that -the -undertaking -is -a -difficult -one -these -returns -exhibit -a -curious -annual -uniformity -in -results -the -sort -of -uniformity -which -you -find -in -the -annual -output -of -suicides -in -the -world's -capitals -and -the -proportions -of -deaths -by -this -that -and -the -other -disease -you -can -always -come -close -to -foretelling -how -many -suicides -will -occur -in -paris -london -and -new -york -next -year -and -also -how -many -deaths -will -result -from -cancer -consumption -dog -bite -falling -out -of -the -window -getting -run -over -by -cabs -etc -if -you -know -the -statistics -of -those -matters -for -the -present -year -in -the -same -way -with -one -year's -indian -statistics -before -you -you -can -guess -closely -at -how -many -people -were -killed -in -that -empire -by -tigers -during -the -previous -year -and -the -year -before -that -and -the -year -before -that -and -at -how -many -were -killed -in -each -of -those -years -by -bears -how -many -by -wolves -and -how -many -by -snakes -and -you -can -also -guess -closely -at -how -many -people -are -going -to -be -killed -each -year -for -the -coming -five -years -by -each -of -those -agencies -you -can -also -guess -closely -at -how -many -of -each -agency -the -government -is -going -to -kill -each -year -for -the -next -five -years -i -have -before -me -statistics -covering -a -period -of -six -consecutive -years -by -these -i -know -that -in -india -the -tiger -kills -something -over -800 -persons -every -year -and -that -the -government -responds -by -killing -about -double -as -many -tigers -every -year -in -four -of -the -six -years -referred -to -the -tiger -got -800 -odd -in -one -of -the -remaining -two -years -he -got -only -700 -but -in -the -other -remaining -year -he -made -his -average -good -by -scoring -917 -he -is -always -sure -of -his -average -anyone -who -bets -that -the -tiger -will -kill -2 -400 -people -in -india -in -any -three -consecutive -years -has -invested -his -money -in -a -certainty -anyone -who -bets -that -he -will -kill -2 -600 -in -any -three -consecutive -years -is -absolutely -sure -to -lose -as -strikingly -uniform -as -are -the -statistics -of -suicide -they -are -not -any -more -so -than -are -those -of -the -tiger's -annual -output -of -slaughtered -human -beings -in -india -the -government's -work -is -quite -uniform -too -it -about -doubles -the -tiger's -average -in -six -years -the -tiger -killed -5 -000 -persons -minus -50 -in -the -same -six -years -10 -000 -tigers -were -killed -minus -400 -the -wolf -kills -nearly -as -many -people -as -the -tiger -700 -a -year -to -the -tiger's -800 -odd -but -while -he -is -doing -it -more -than -5 -000 -of -his -tribe -fall -the -leopard -kills -an -average -of -230 -people -per -year -but -loses -3 -300 -of -his -own -mess -while -he -is -doing -it -the -bear -kills -100 -people -per -year -at -a -cost -of -1 -250 -of -his -own -tribe -the -tiger -as -the -figures -show -makes -a -very -handsome -fight -against -man -but -it -is -nothing -to -the -elephant's -fight -the -king -of -beasts -the -lord -of -the -jungle -loses -four -of -his -mess -per -year -but -he -kills -forty -five -persons -to -make -up -for -it -but -when -it -comes -to -killing -cattle -the -lord -of -the -jungle -is -not -interested -he -kills -but -100 -in -six -years -horses -of -hunters -no -doubt -but -in -the -same -six -the -tiger -kills -more -than -84 -000 -the -leopard -100 -000 -the -bear -4 -000 -the -wolf -70 -000 -the -hyena -more -than -13 -000 -other -wild -beasts -27 -000 -and -the -snakes -19 -000 -a -grand -total -of -more -than -300 -000 -an -average -of -50 -000 -head -per -year -in -response -the -government -kills -in -the -six -years -a -total -of -3 -201 -232 -wild -beasts -and -snakes -ten -for -one -it -will -be -perceived -that -the -snakes -are -not -much -interested -in -cattle -they -kill -only -3 -000 -odd -per -year -the -snakes -are -much -more -interested -in -man -india -swarms -with -deadly -snakes -at -the -head -of -the -list -is -the -cobra -the -deadliest -known -to -the -world -a -snake -whose -bite -kills -where -the -rattlesnake's -bite -merely -entertains -in -india -the -annual -man -killings -by -snakes -are -as -uniform -as -regular -and -as -forecastable -as -are -the -tiger -average -and -the -suicide -average -anyone -who -bets -that -in -india -in -any -three -consecutive -years -the -snakes -will -kill -49 -500 -persons -will -win -his -bet -and -anyone -who -bets -that -in -india -in -any -three -consecutive -years -the -snakes -will -kill -53 -500 -persons -will -lose -his -bet -in -india -the -snakes -kill -17 -000 -people -a -year -they -hardly -ever -fall -short -of -it -they -as -seldom -exceed -it -an -insurance -actuary -could -take -the -indian -census -tables -and -the -government's -snake -tables -and -tell -you -within -sixpence -how -much -it -would -be -worth -to -insure -a -man -against -death -by -snake -bite -there -if -i -had -a -dollar -for -every -person -killed -per -year -in -india -i -would -rather -have -it -than -any -other -property -as -it -is -the -only -property -in -the -world -not -subject -to -shrinkage -i -should -like -to -have -a -royalty -on -the -government -end -of -the -snake -business -too -and -am -in -london -now -trying -to -get -it -but -when -i -get -it -it -is -not -going -to -be -as -regular -an -income -as -the -other -will -be -if -i -get -that -i -have -applied -for -it -the -snakes -transact -their -end -of -the -business -in -a -more -orderly -and -systematic -way -than -the -government -transacts -its -end -of -it -because -the -snakes -have -had -a -long -experience -and -know -all -about -the -traffic -you -can -make -sure -that -the -government -will -never -kill -fewer -than -110 -000 -snakes -in -a -year -and -that -it -will -newer -quite -reach -300 -000 -too -much -room -for -oscillation -good -speculative -stock -to -bear -or -bull -and -buy -and -sell -long -and -short -and -all -that -kind -of -thing -but -not -eligible -for -investment -like -the -other -the -man -that -speculates -in -the -government's -snake -crop -wants -to -go -carefully -i -would -not -advise -a -man -to -buy -a -single -crop -at -all -i -mean -a -crop -of -futures -for -the -possible -wobble -is -something -quite -extraordinary -if -he -can -buy -six -future -crops -in -a -bunch -seller -to -deliver -1 -500 -000 -altogether -that -is -another -matter -i -do -not -know -what -snakes -are -worth -now -but -i -know -what -they -would -be -worth -then -for -the -statistics -show -that -the -seller -could -not -come -within -427 -000 -of -carrying -out -his -contract -however -i -think -that -a -person -who -speculates -in -snakes -is -a -fool -anyway -he -always -regrets -it -afterwards -to -finish -the -statistics -in -six -years -the -wild -beasts -kill -20 -000 -persons -and -the -snakes -kill -103 -000 -in -the -same -six -the -government -kills -1 -073 -546 -snakes -plenty -left -there -are -narrow -escapes -in -india -in -the -very -jungle -where -i -killed -sixteen -tigers -and -all -those -elephants -a -cobra -bit -me -but -it -got -well -everyone -was -surprised -this -could -not -happen -twice -in -ten -years -perhaps -usually -death -would -result -in -fifteen -minutes -we -struck -out -westward -or -northwestward -from -calcutta -on -an -itinerary -of -a -zig -zag -sort -which -would -in -the -course -of -time -carry -us -across -india -to -its -northwestern -corner -and -the -border -of -afghanistan -the -first -part -of -the -trip -carried -us -through -a -great -region -which -was -an -endless -garden -miles -and -miles -of -the -beautiful -flower -from -whose -juices -comes -the -opium -and -at -muzaffurpore -we -were -in -the -midst -of -the -indigo -culture -thence -by -a -branch -road -to -the -ganges -at -a -point -near -dinapore -and -by -a -train -which -would -have -missed -the -connection -by -a -week -but -for -the -thoughtfulness -of -some -british -officers -who -were -along -and -who -knew -the -ways -of -trains -that -are -run -by -natives -without -white -supervision -this -train -stopped -at -every -village -for -no -purpose -connected -with -business -apparently -we -put -out -nothing -we -took -nothing -aboard -the -train -bands -stepped -ashore -and -gossiped -with -friends -a -quarter -of -an -hour -then -pulled -out -and -repeated -this -at -the -succeeding -villages -we -had -thirty -five -miles -to -go -and -six -hours -to -do -it -in -but -it -was -plain -that -we -were -not -going -to -make -it -it -was -then -that -the -english -officers -said -it -was -now -necessary -to -turn -this -gravel -train -into -an -express -so -they -gave -the -engine -driver -a -rupee -and -told -him -to -fly -it -was -a -simple -remedy -after -that -we -made -ninety -miles -an -hour -we -crossed -the -ganges -just -at -dawn -made -our -connection -and -went -to -benares -where -we -stayed -twenty -four -hours -and -inspected -that -strange -and -fascinating -piety -hive -again -then -left -for -lucknow -a -city -which -is -perhaps -the -most -conspicuous -of -the -many -monuments -of -british -fortitude -and -valor -that -are -scattered -about -the -earth -the -heat -was -pitiless -the -flat -plains -were -destitute -of -grass -and -baked -dry -by -the -sun -they -were -the -color -of -pale -dust -which -was -flying -in -clouds -but -it -was -much -hotter -than -this -when -the -relieving -forces -marched -to -lucknow -in -the -time -of -the -mutiny -those -were -the -days -of -138 -deg -in -the -shade -chapter -lviii -make -it -a -point -to -do -something -every -day -that -you -don't -want -to -do -this -is -the -golden -rule -for -acquiring -the -habit -of -doing -your -duty -without -pain -pudd'nhead -wilson's -new -calendar -it -seems -to -be -settled -now -that -among -the -many -causes -from -which -the -great -mutiny -sprang -the -main -one -was -the -annexation -of -the -kingdom -of -oudh -by -the -east -india -company -characterized -by -sir -henry -lawrence -as -the -most -unrighteous -act -that -was -ever -committed -in -the -spring -of -1857 -a -mutinous -spirit -was -observable -in -many -of -the -native -garrisons -and -it -grew -day -by -day -and -spread -wider -and -wider -the -younger -military -men -saw -something -very -serious -in -it -and -would -have -liked -to -take -hold -of -it -vigorously -and -stamp -it -out -promptly -but -they -were -not -in -authority -old -men -were -in -the -high -places -of -the -army -men -who -should -have -been -retired -long -before -because -of -their -great -age -and -they -regarded -the -matter -as -a -thing -of -no -consequence -they -loved -their -native -soldiers -and -would -not -believe -that -anything -could -move -them -to -revolt -everywhere -these -obstinate -veterans -listened -serenely -to -the -rumbling -of -the -volcanoes -under -them -and -said -it -was -nothing -and -so -the -propagators -of -mutiny -had -everything -their -own -way -they -moved -from -camp -to -camp -undisturbed -and -painted -to -the -native -soldier -the -wrongs -his -people -were -suffering -at -the -hands -of -the -english -and -made -his -heart -burn -for -revenge -they -were -able -to -point -to -two -facts -of -formidable -value -as -backers -of -their -persuasions -in -clive's -day -native -armies -were -incoherent -mobs -and -without -effective -arms -therefore -they -were -weak -against -clive's -organized -handful -of -well -armed -men -but -the -thing -was -the -other -way -now -the -british -forces -were -native -they -had -been -trained -by -the -british -organized -by -the -british -armed -by -the -british -all -the -power -was -in -their -hands -they -were -a -club -made -by -british -hands -to -beat -out -british -brains -with -there -was -nothing -to -oppose -their -mass -nothing -but -a -few -weak -battalions -of -british -soldiers -scattered -about -india -a -force -not -worth -speaking -of -this -argument -taken -alone -might -not -have -succeeded -for -the -bravest -and -best -indian -troops -had -a -wholesome -dread -of -the -white -soldier -whether -he -was -weak -or -strong -but -the -agitators -backed -it -with -their -second -and -best -point -prophecy -a -prophecy -a -hundred -years -old -the -indian -is -open -to -prophecy -at -all -times -argument -may -fail -to -convince -him -but -not -prophecy -there -was -a -prophecy -that -a -hundred -years -from -the -year -of -that -battle -of -clive's -which -founded -the -british -indian -empire -the -british -power -would -be -overthrown -and -swept -away -by -the -natives -the -mutiny -broke -out -at -meerut -on -the -10th -of -may -1857 -and -fired -a -train -of -tremendous -historical -explosions -nana -sahib's -massacre -of -the -surrendered -garrison -of -cawnpore -occurred -in -june -and -the -long -siege -of -lucknow -began -the -military -history -of -england -is -old -and -great -but -i -think -it -must -be -granted -that -the -crushing -of -the -mutiny -is -the -greatest -chapter -in -it -the -british -were -caught -asleep -and -unprepared -they -were -a -few -thousands -swallowed -up -in -an -ocean -of -hostile -populations -it -would -take -months -to -inform -england -and -get -help -but -they -did -not -falter -or -stop -to -count -the -odds -but -with -english -resolution -and -english -devotion -they -took -up -their -task -and -went -stubbornly -on -with -it -through -good -fortune -and -bad -and -fought -the -most -unpromising -fight -that -one -may -read -of -in -fiction -or -out -of -it -and -won -it -thoroughly -the -mutiny -broke -out -so -suddenly -and -spread -with -such -rapidity -that -there -was -but -little -time -for -occupants -of -weak -outlying -stations -to -escape -to -places -of -safety -attempts -were -made -of -course -but -they -were -attended -by -hardships -as -bitter -as -death -in -the -few -cases -which -were -successful -for -the -heat -ranged -between -120 -and -138 -in -the -shade -the -way -led -through -hostile -peoples -and -food -and -water -were -hardly -to -be -had -for -ladies -and -children -accustomed -to -ease -and -comfort -and -plenty -such -a -journey -must -have -been -a -cruel -experience -sir -g -o -trevelyan -quotes -an -example -this -is -what -befell -mrs -m -the -wife -of -the -surgeon -at -a -certain -station -on -the -southern -confines -of -the -insurrection -'i -heard -' -she -says -'a -number -of -shots -fired -and -looking -out -i -saw -my -husband -driving -furiously -from -the -mess -house -waving -his -whip -i -ran -to -him -and -seeing -a -bearer -with -my -child -in -his -arms -i -caught -her -up -and -got -into -the -buggy -at -the -mess -house -we -found -all -the -officers -assembled -together -with -sixty -sepoys -who -had -remained -faithful -we -went -off -in -one -large -party -amidst -a -general -conflagration -of -our -late -homes -we -reached -the -caravanserai -at -chattapore -the -next -morning -and -thence -started -for -callinger -at -this -point -our -sepoy -escort -deserted -us -we -were -fired -upon -by -match -lockmen -and -one -officer -was -shot -dead -we -heard -likewise -that -the -people -had -risen -at -callinger -so -we -returned -and -walked -back -ten -miles -that -day -m -and -i -carried -the -child -alternately -presently -mrs -smalley -died -of -sunstroke -we -had -no -food -amongst -us -an -officer -kindly -lent -us -a -horse -we -were -very -faint -the -major -died -and -was -buried -also -the -sergeant -major -and -some -women -the -bandsmen -left -us -on -the -nineteenth -of -june -we -were -fired -at -again -by -match -lockmen -and -changed -direction -for -allahabad -our -party -consisted -of -nine -gentlemen -two -children -the -sergeant -and -his -wife -on -the -morning -of -the -twentieth -captain -scott -took -lottie -on -to -his -horse -i -was -riding -behind -my -husband -and -she -was -so -crushed -between -us -she -was -two -years -old -on -the -first -of -the -month -we -were -both -weak -through -want -of -food -and -the -effect -of -the -sun -lottie -and -i -had -no -head -covering -m -had -a -sepoy's -cap -i -found -on -the -ground -soon -after -sunrise -we -were -followed -by -villagers -armed -with -clubs -and -spears -one -of -them -struck -captain -scott's -horse -on -the -leg -he -galloped -off -with -lottie -and -my -poor -husband -never -saw -his -child -again -we -rode -on -several -miles -keeping -away -from -villages -and -then -crossed -the -river -our -thirst -was -extreme -m -had -dreadful -cramps -so -that -i -had -to -hold -him -on -the -horse -i -was -very -uneasy -about -him -the -day -before -i -saw -the -drummer's -wife -eating -chupatties -and -asked -her -to -give -a -piece -to -the -child -which -she -did -i -now -saw -water -in -a -ravine -the -descent -was -steep -and -our -only -drinkingvessel -was -m -'s -cap -our -horse -got -water -and -i -bathed -my -neck -i -had -no -stockings -and -my -feet -were -torn -and -blistered -two -peasants -came -in -sight -and -we -were -frightened -and -rode -off -the -sergeant -held -our -horse -and -m -put -me -up -and -mounted -i -think -he -must -have -got -suddenly -faint -for -i -fell -and -he -over -me -on -the -road -when -the -horse -started -off -some -time -before -he -said -and -barber -too -that -he -could -not -live -many -hours -i -felt -he -was -dying -before -we -came -to -the -ravine -he -told -me -his -wishes -about -his -children -and -myself -and -took -leave -my -brain -seemed -burnt -up -no -tears -came -as -soon -as -we -fell -the -sergeant -let -go -the -horse -and -it -went -off -so -that -escape -was -cut -off -we -sat -down -on -the -ground -waiting -for -death -poor -fellow! -he -was -very -weak -his -thirst -was -frightful -and -i -went -to -get -him -water -some -villagers -came -and -took -my -rupees -and -watch -i -took -off -my -wedding -ring -and -twisted -it -in -my -hair -and -replaced -the -guard -i -tore -off -the -skirt -of -my -dress -to -bring -water -in -but -was -no -use -for -when -i -returned -my -beloved's -eyes -were -fixed -and -though -i -called -and -tried -to -restore -him -and -poured -water -into -his -mouth -it -only -rattled -in -his -throat -he -never -spoke -to -me -again -i -held -him -in -my -arms -till -he -sank -gradually -down -i -felt -frantic -but -could -not -cry -i -was -alone -i -bound -his -head -and -face -in -my -dress -for -there -was -no -earth -to -buy -him -the -pain -in -my -hands -and -feet -was -dreadful -i -went -down -to -the -ravine -and -sat -in -the -water -on -a -stone -hoping -to -get -off -at -night -and -look -for -lottie -when -i -came -back -from -the -water -i -saw -that -they -had -not -taken -her -little -watch -chain -and -seals -so -i -tied -them -under -my -petticoat -in -an -hour -about -thirty -villagers -came -they -dragged -me -out -of -the -ravine -and -took -off -my -jacket -and -found -the -little -chain -they -then -dragged -me -to -a -village -mocking -me -all -the -way -and -disputing -as -to -whom -i -was -to -belong -to -the -whole -population -came -to -look -at -me -i -asked -for -a -bedstead -and -lay -down -outside -the -door -of -a -hut -they -had -a -dozen -of -cows -and -yet -refused -me -milk -when -night -came -and -the -village -was -quiet -some -old -woman -brought -me -a -leafful -of -rice -i -was -too -parched -to -eat -and -they -gave -me -water -the -morning -after -a -neighboring -rajah -sent -a -palanquin -and -a -horseman -to -fetch -me -who -told -me -that -a -little -child -and -three -sahibs -had -come -to -his -master's -house -and -so -the -poor -mother -found -her -lost -one -'greatly -blistered -' -poor -little -creature -it -is -not -for -europeans -in -india -to -pray -that -their -flight -be -not -in -the -winter -in -the -first -days -of -june -the -aged -general -sir -hugh -wheeler -commanding -the -forces -at -cawnpore -was -deserted -by -his -native -troops -then -he -moved -out -of -the -fort -and -into -an -exposed -patch -of -open -flat -ground -and -built -a -four -foot -mud -wall -around -it -he -had -with -him -a -few -hundred -white -soldiers -and -officers -and -apparently -more -women -and -children -than -soldiers -he -was -short -of -provisions -short -of -arms -short -of -ammunition -short -of -military -wisdom -short -of -everything -but -courage -and -devotion -to -duty -the -defense -of -that -open -lot -through -twenty -one -days -and -nights -of -hunger -thirst -indian -heat -and -a -never -ceasing -storm -of -bullets -bombs -and -cannon -balls -a -defense -conducted -not -by -the -aged -and -infirm -general -but -by -a -young -officer -named -moore -is -one -of -the -most -heroic -episodes -in -history -when -at -last -the -nana -found -it -impossible -to -conquer -these -starving -men -and -women -with -powder -and -ball -he -resorted -to -treachery -and -that -succeeded -he -agreed -to -supply -them -with -food -and -send -them -to -allahabad -in -boats -their -mud -wall -and -their -barracks -were -in -ruins -their -provisions -were -at -the -point -of -exhaustion -they -had -done -all -that -the -brave -could -do -they -had -conquered -an -honorable -compromise -their -forces -had -been -fearfully -reduced -by -casualties -and -by -disease -they -were -not -able -to -continue -the -contest -longer -they -came -forth -helpless -but -suspecting -no -treachery -the -nana's -host -closed -around -them -and -at -a -signal -from -a -trumpet -the -massacre -began -about -two -hundred -women -and -children -were -spared -for -the -present -but -all -the -men -except -three -or -four -were -killed -among -the -incidents -of -the -massacre -quoted -by -sir -g -o -trevelyan -is -this -when -after -the -lapse -of -some -twenty -minutes -the -dead -began -to -outnumber -the -living -when -the -fire -slackened -as -the -marks -grew -few -and -far -between -then -the -troopers -who -had -been -drawn -up -to -the -right -of -the -temple -plunged -into -the -river -sabre -between -teeth -and -pistol -in -hand -thereupon -two -half -caste -christian -women -the -wives -of -musicians -in -the -band -of -the -fifty -sixth -witnessed -a -scene -which -should -not -be -related -at -second -hand -'in -the -boat -where -i -was -to -have -gone -' -says -mrs -bradshaw -confirmed -throughout -by -mrs -betts -'was -the -school -mistress -and -twenty -two -misses -general -wheeler -came -last -in -a -palkee -they -carried -him -into -the -water -near -the -boat -i -stood -close -by -he -said -'carry -me -a -little -further -towards -the -boat -' -but -a -trooper -said -'no -get -out -here -' -as -the -general -got -out -of -the -palkee -head -foremost -the -trooper -gave -him -a -cut -with -his -sword -into -the -neck -and -he -fell -into -the -water -my -son -was -killed -near -him -i -saw -it -alas! -alas! -some -were -stabbed -with -bayonets -others -cut -down -little -infants -were -torn -in -pieces -we -saw -it -we -did -and -tell -you -only -what -we -saw -other -children -were -stabbed -and -thrown -into -the -river -the -schoolgirls -were -burnt -to -death -i -saw -their -clothes -and -hair -catch -fire -in -the -water -a -few -paces -off -by -the -next -boat -we -saw -the -youngest -daughter -of -colonel -williams -a -sepoy -was -going -to -kill -her -with -his -bayonet -she -said -'my -father -was -always -kind -to -sepoys -' -he -turned -away -and -just -then -a -villager -struck -her -on -the -head -with -a -club -and -she -fell -into -the -water -these -people -likewise -saw -good -mr -moncrieff -the -clergyman -take -a -book -from -his -pocket -that -he -never -had -leisure -to -open -and -heard -him -commence -a -prayer -for -mercy -which -he -was -not -permitted -to -conclude -another -deponent -observed -an -european -making -for -a -drain -like -a -scared -water -rat -when -some -boatmen -armed -with -cudgels -cut -off -his -retreat -and -beat -him -down -dead -into -the -mud -the -women -and -children -who -had -been -reserved -from -the -massacre -were -imprisoned -during -a -fortnight -in -a -small -building -one -story -high -a -cramped -place -a -slightly -modified -black -hole -of -calcutta -they -were -waiting -in -suspense -there -was -none -who -could -foretaste -their -fate -meantime -the -news -of -the -massacre -had -traveled -far -and -an -army -of -rescuers -with -havelock -at -its -head -was -on -its -way -at -least -an -army -which -hoped -to -be -rescuers -it -was -crossing -the -country -by -forced -marches -and -strewing -its -way -with -its -own -dead -men -struck -down -by -cholera -and -by -a -heat -which -reached -135 -deg -it -was -in -a -vengeful -fury -and -it -stopped -for -nothing -neither -heat -nor -fatigue -nor -disease -nor -human -opposition -it -tore -its -impetuous -way -through -hostile -forces -winning -victory -after -victory -but -still -striding -on -and -on -not -halting -to -count -results -and -at -last -after -this -extraordinary -march -it -arrived -before -the -walls -of -cawnpore -met -the -nana's -massed -strength -delivered -a -crushing -defeat -and -entered -but -too -late -only -a -few -hours -too -late -for -at -the -last -moment -the -nana -had -decided -upon -the -massacre -of -the -captive -women -and -children -and -had -commissioned -three -mohammedans -and -two -hindoos -to -do -the -work -sir -g -o -trevelyan -says -thereupon -the -five -men -entered -it -was -the -short -gloaming -of -hindostan -the -hour -when -ladies -take -their -evening -drive -she -who -had -accosted -the -officer -was -standing -in -the -doorway -with -her -were -the -native -doctor -and -two -hindoo -menials -that -much -of -the -business -might -be -seen -from -the -veranda -but -all -else -was -concealed -amidst -the -interior -gloom -shrieks -and -scuffing -acquainted -those -without -that -the -journeymen -were -earning -their -hire -survur -khan -soon -emerged -with -his -sword -broken -off -at -the -hilt -he -procured -another -from -the -nana's -house -and -a -few -minutes -after -appeared -again -on -the -same -errand -the -third -blade -was -of -better -temper -or -perhaps -the -thick -of -the -work -was -already -over -by -the -time -darkness -had -closed -in -the -men -came -forth -and -locked -up -the -house -for -the -night -then -the -screams -ceased -but -the -groans -lasted -till -morning -the -sun -rose -as -usual -when -he -had -been -up -nearly -three -hours -the -five -repaired -to -the -scene -of -their -labors -over -night -they -were -attended -by -a -few -sweepers -who -proceeded -to -transfer -the -contents -of -the -house -to -a -dry -well -situated -behind -some -trees -which -grew -hard -by -'the -bodies -' -says -one -who -was -present -throughout -'were -dragged -out -most -of -them -by -the -hair -of -the -head -those -who -had -clothing -worth -taking -were -stripped -some -of -the -women -were -alive -i -cannot -say -how -many -but -three -could -speak -they -prayed -for -the -sake -of -god -that -an -end -might -be -put -to -their -sufferings -i -remarked -one -very -stout -woman -a -half -caste -who -was -severely -wounded -in -both -arms -who -entreated -to -be -killed -she -and -two -or -three -others -were -placed -against -the -bank -of -the -cut -by -which -bullocks -go -down -in -drawing -water -the -dead -were -first -thrown -in -yes -there -was -a -great -crowd -looking -on -they -were -standing -along -the -walls -of -the -compound -they -were -principally -city -people -and -villagers -yes -there -were -also -sepoys -three -boys -were -alive -they -were -fair -children -the -eldest -i -think -must -have -been -six -or -seven -and -the -youngest -five -years -they -were -running -around -the -well -where -else -could -they -go -to -and -there -was -none -to -save -them -no -one -said -a -word -or -tried -to -save -them -' -at -length -the -smallest -of -them -made -an -infantile -attempt -to -get -away -the -little -thing -had -been -frightened -past -bearing -by -the -murder -of -one -of -the -surviving -ladies -he -thus -attracted -the -observation -of -a -native -who -flung -him -and -his -companions -down -the -well -the -soldiers -had -made -a -march -of -eighteen -days -almost -without -rest -to -save -the -women -and -the -children -and -now -they -were -too -late -all -were -dead -and -the -assassin -had -flown -what -happened -then -trevelyan -hesitated -to -put -into -words -of -what -took -place -the -less -said -is -the -better -then -he -continues -but -there -was -a -spectacle -to -witness -which -might -excuse -much -those -who -straight -from -the -contested -field -wandered -sobbing -through -the -rooms -of -the -ladies' -house -saw -what -it -were -well -could -the -outraged -earth -have -straightway -hidden -the -inner -apartment -was -ankle -deep -in -blood -the -plaster -was -scored -with -sword -cuts -not -high -up -as -where -men -have -fought -but -low -down -and -about -the -corners -as -if -a -creature -had -crouched -to -avoid -the -blow -strips -of -dresses -vainly -tied -around -the -handles -of -the -doors -signified -the -contrivance -to -which -feminine -despair -had -resorted -as -a -means -of -keeping -out -the -murderers -broken -combs -were -there -and -the -frills -of -children's -trousers -and -torn -cuffs -and -pinafores -and -little -round -hats -and -one -or -two -shoes -with -burst -latchets -and -one -or -two -daguerreotype -cases -with -cracked -glasses -an -officer -picked -up -a -few -curls -preserved -in -a -bit -of -cardboard -and -marked -'ned's -hair -with -love' -but -around -were -strewn -locks -some -near -a -yard -in -length -dissevered -not -as -a -keepsake -by -quite -other -scissors -the -battle -of -waterloo -was -fought -on -the -18th -of -june -1815 -i -do -not -state -this -fact -as -a -reminder -to -the -reader -but -as -news -to -him -for -a -forgotten -fact -is -news -when -it -comes -again -writers -of -books -have -the -fashion -of -whizzing -by -vast -and -renowned -historical -events -with -the -remark -the -details -of -this -tremendous -episode -are -too -familiar -to -the -reader -to -need -repeating -here -they -know -that -that -is -not -true -it -is -a -low -kind -of -flattery -they -know -that -the -reader -has -forgotten -every -detail -of -it -and -that -nothing -of -the -tremendous -event -is -left -in -his -mind -but -a -vague -and -formless -luminous -smudge -aside -from -the -desire -to -flatter -the -reader -they -have -another -reason -for -making -the -remark -two -reasons -indeed -they -do -not -remember -the -details -themselves -and -do -not -want -the -trouble -of -hunting -them -up -and -copying -them -out -also -they -are -afraid -that -if -they -search -them -out -and -print -them -they -will -be -scoffed -at -by -the -book -reviewers -for -retelling -those -worn -old -things -which -are -familiar -to -everybody -they -should -not -mind -the -reviewer's -jeer -he -doesn't -remember -any -of -the -worn -old -things -until -the -book -which -he -is -reviewing -has -retold -them -to -him -i -have -made -the -quoted -remark -myself -at -one -time -and -another -but -i -was -not -doing -it -to -flatter -the -reader -i -was -merely -doing -it -to -save -work -if -i -had -known -the -details -without -brushing -up -i -would -have -put -them -in -but -i -didn't -and -i -did -not -want -the -labor -of -posting -myself -so -i -said -the -details -of -this -tremendous -episode -are -too -familiar -to -the -reader -to -need -repeating -here -i -do -not -like -that -kind -of -a -lie -still -it -does -save -work -i -am -not -trying -to -get -out -of -repeating -the -details -of -the -siege -of -lucknow -in -fear -of -the -reviewer -i -am -not -leaving -them -out -in -fear -that -they -would -not -interest -the -reader -i -am -leaving -them -out -partly -to -save -work -mainly -for -lack -of -room -it -is -a -pity -too -for -there -is -not -a -dull -place -anywhere -in -the -great -story -ten -days -before -the -outbreak -may -10th -of -the -mutiny -all -was -serene -at -lucknow -the -huge -capital -of -oudh -the -kingdom -which -had -recently -been -seized -by -the -india -company -there -was -a -great -garrison -composed -of -about -7 -000 -native -troops -and -between -700 -and -800 -whites -these -white -soldiers -and -their -families -were -probably -the -only -people -of -their -race -there -at -their -elbow -was -that -swarming -population -of -warlike -natives -a -race -of -born -soldiers -brave -daring -and -fond -of -fighting -on -high -ground -just -outside -the -city -stood -the -palace -of -that -great -personage -the -resident -the -representative -of -british -power -and -authority -it -stood -in -the -midst -of -spacious -grounds -with -its -due -complement -of -outbuildings -and -the -grounds -were -enclosed -by -a -wall -a -wall -not -for -defense -but -for -privacy -the -mutinous -spirit -was -in -the -air -but -the -whites -were -not -afraid -and -did -not -feel -much -troubled -then -came -the -outbreak -at -meerut -then -the -capture -of -delhi -by -the -mutineers -in -june -came -the -three -weeks -leaguer -of -sir -hugh -wheeler -in -his -open -lot -at -cawnpore -40 -miles -distant -from -lucknow -then -the -treacherous -massacre -of -that -gallant -little -garrison -and -now -the -great -revolt -was -in -full -flower -and -the -comfortable -condition -of -things -at -lucknow -was -instantly -changed -there -was -an -outbreak -there -and -sir -henry -lawrence -marched -out -of -the -residency -on -the -30th -of -june -to -put -it -down -but -was -defeated -with -heavy -loss -and -had -difficulty -in -getting -back -again -that -night -the -memorable -siege -of -the -residency -called -the -siege -of -lucknow -began -sir -henry -was -killed -three -days -later -and -brigadier -inglis -succeeded -him -in -command -outside -of -the -residency -fence -was -an -immense -host -of -hostile -and -confident -native -besiegers -inside -it -were -480 -loyal -native -soldiers -730 -white -ones -and -500 -women -and -children -in -those -days -the -english -garrisons -always -managed -to -hamper -themselves -sufficiently -with -women -and -children -the -natives -established -themselves -in -houses -close -at -hand -and -began -to -rain -bullets -and -cannon -balls -into -the -residency -and -this -they -kept -up -night -and -day -during -four -months -and -a -half -the -little -garrison -industriously -replying -all -the -time -the -women -and -children -soon -became -so -used -to -the -roar -of -the -guns -that -it -ceased -to -disturb -their -sleep -the -children -imitated -siege -and -defense -in -their -play -the -women -with -any -pretext -or -with -none -would -sally -out -into -the -storm -swept -grounds -the -defense -was -kept -up -week -after -week -with -stubborn -fortitude -in -the -midst -of -death -which -came -in -many -forms -by -bullet -small -pox -cholera -and -by -various -diseases -induced -by -unpalatable -and -insufficient -food -by -the -long -hours -of -wearying -and -exhausting -overwork -in -the -daily -and -nightly -battle -in -the -oppressive -indian -heat -and -by -the -broken -rest -caused -by -the -intolerable -pest -of -mosquitoes -flies -mice -rats -and -fleas -six -weeks -after -the -beginning -of -the -siege -more -than -one -half -of -the -original -force -of -white -soldiers -was -dead -and -close -upon -three -fifths -of -the -original -native -force -but -the -fighting -went -on -just -the -same -the -enemy -mined -the -english -counter -mined -and -turn -about -they -blew -up -each -other's -posts -the -residency -grounds -were -honey -combed -with -the -enemy's -tunnels -deadly -courtesies -were -constantly -exchanged -sorties -by -the -english -in -the -night -rushes -by -the -enemy -in -the -night -rushes -whose -purpose -was -to -breach -the -walls -or -scale -them -rushes -which -cost -heavily -and -always -failed -the -ladies -got -used -to -all -the -horrors -of -war -the -shrieks -of -mutilated -men -the -sight -of -blood -and -death -lady -inglis -makes -this -mention -in -her -diary -mrs -bruere's -nurse -was -carried -past -our -door -to -day -wounded -in -the -eye -to -extract -the -bullet -it -was -found -necessary -to -take -out -the -eye -a -fearful -operation -her -mistress -held -her -while -it -was -performed -the -first -relieving -force -failed -to -relieve -it -was -under -havelock -and -outram -and -arrived -when -the -siege -had -been -going -on -for -three -months -it -fought -its -desperate -way -to -lucknow -then -fought -its -way -through -the -city -against -odds -of -a -hundred -to -one -and -entered -the -residency -but -there -was -not -enough -left -of -it -then -to -do -any -good -it -lost -more -men -in -its -last -fight -than -it -found -in -the -residency -when -it -got -in -it -became -captive -itself -the -fighting -and -starving -and -dying -by -bullets -and -disease -went -steadily -on -both -sides -fought -with -energy -and -industry -captain -birch -puts -this -striking -incident -in -evidence -he -is -speaking -of -the -third -month -of -the -siege -as -an -instance -of -the -heavy -firing -brought -to -bear -on -our -position -this -month -may -be -mentioned -the -cutting -down -of -the -upper -story -of -a -brick -building -simply -by -musketry -firring -this -building -was -in -a -most -exposed -position -all -the -shots -which -just -missed -the -top -of -the -rampart -cut -into -the -dead -wall -pretty -much -in -a -straight -line -and -at -length -cut -right -through -and -brought -the -upper -story -tumbling -down -the -upper -structure -on -the -top -of -the -brigade -mess -also -fell -in -the -residency -house -was -a -wreck -captain -anderson's -post -had -long -ago -been -knocked -down -and -innes' -post -also -fell -in -these -two -were -riddled -with -round -shot -as -many -as -200 -were -picked -up -by -colonel -masters -the -exhausted -garrison -fought -doggedly -on -all -through -the -next -month -october -then -november -2d -news -came -sir -colin -campbell's -relieving -force -would -soon -be -on -its -way -from -cawnpore -on -the -12th -the -boom -of -his -guns -was -heard -on -the -13th -the -sounds -came -nearer -he -was -slowly -but -steadily -cutting -his -way -through -storming -one -stronghold -after -another -on -the -14th -he -captured -the -martiniere -college -and -ran -up -the -british -flag -there -it -was -seen -from -the -residency -next -he -took -the -dilkoosha -on -the -17th -he -took -the -former -mess -house -of -the -32d -regiment -a -fortified -building -and -very -strong -a -most -exciting -anxious -day -writes -lady -inglis -in -her -diary -about -4 -p -m -two -strange -officers -walked -through -our -yard -leading -their -horses -and -by -that -sign -she -knew -that -communication -was -established -between -the -forces -that -the -relief -was -real -this -time -and -that -the -long -siege -of -lucknow -was -ended -the -last -eight -or -ten -miles -of -sir -colin -campbell's -march -was -through -seas -of -blood -the -weapon -mainly -used -was -the -bayonet -the -fighting -was -desperate -the -way -was -mile -stoned -with -detached -strong -buildings -of -stone -fortified -and -heavily -garrisoned -and -these -had -to -be -taken -by -assault -neither -side -asked -for -quarter -and -neither -gave -it -at -the -secundrabagh -where -nearly -two -thousand -of -the -enemy -occupied -a -great -stone -house -in -a -garden -the -work -of -slaughter -was -continued -until -every -man -was -killed -that -is -a -sample -of -the -character -of -that -devastating -march -there -were -but -few -trees -in -the -plain -at -that -time -and -from -the -residency -the -progress -of -the -march -step -by -step -victory -by -victory -could -be -noted -the -ascending -clouds -of -battle -smoke -marked -the -way -to -the -eye -and -the -thunder -of -the -guns -marked -it -to -the -ear -sir -colin -campbell -had -not -come -to -lucknow -to -hold -it -but -to -save -the -occupants -of -the -residency -and -bring -them -away -four -or -five -days -after -his -arrival -the -secret -evacuation -by -the -troops -took -place -in -the -middle -of -a -dark -night -by -the -principal -gate -the -bailie -guard -the -two -hundred -women -and -two -hundred -and -fifty -children -had -been -previously -removed -captain -birch -says -and -now -commenced -a -movement -of -the -most -perfect -arrangement -and -successful -generalship -the -withdrawal -of -the -whole -of -the -various -forces -a -combined -movement -requiring -the -greatest -care -and -skill -first -the -garrison -in -immediate -contact -with -the -enemy -at -the -furthest -extremity -of -the -residency -position -was -marched -out -every -other -garrison -in -turn -fell -in -behind -it -and -so -passed -out -through -the -bailie -guard -gate -till -the -whole -of -our -position -was -evacuated -then -havelock's -force -was -similarly -withdrawn -post -by -post -marching -in -rear -of -our -garrison -after -them -in -turn -came -the -forces -of -the -commander -in -chief -which -joined -on -in -the -rear -of -havelock's -force -regiment -by -regiment -was -withdrawn -with -the -utmost -order -and -regularity -the -whole -operation -resembled -the -movement -of -a -telescope -stern -silence -was -kept -and -the -enemy -took -no -alarm -lady -inglis -referring -to -her -husband -and -to -general -sir -james -outram -sets -down -the -closing -detail -of -this -impressive -midnight -retreat -in -darkness -and -by -stealth -of -this -shadowy -host -through -the -gate -which -it -had -defended -so -long -and -so -well -at -twelve -precisely -they -marched -out -john -and -sir -james -outram -remaining -till -all -had -passed -and -then -they -took -off -their -hats -to -the -bailie -guard -the -scene -of -as -noble -a -defense -as -i -think -history -will -ever -have -to -relate -chapter -lix -don't -part -with -your -illusions -when -they -are -gone -you -may -still -exist -but -you -have -ceased -to -live -pudd'nhead -wilson's -new -calendar -often -the -surest -way -to -convey -misinformation -is -to -tell -the -strict -truth -pudd'nhead -wilson's -new -calendar -we -were -driven -over -sir -colin -campbell's -route -by -a -british -officer -and -when -i -arrived -at -the -residency -i -was -so -familiar -with -the -road -that -i -could -have -led -a -retreat -over -it -myself -but -the -compass -in -my -head -has -been -out -of -order -from -my -birth -and -so -as -soon -as -i -was -within -the -battered -bailie -guard -and -turned -about -to -review -the -march -and -imagine -the -relieving -forces -storming -their -way -along -it -everything -was -upside -down -and -wrong -end -first -in -a -moment -and -i -was -never -able -to -get -straightened -out -again -and -now -when -i -look -at -the -battle -plan -the -confusion -remains -in -me -the -east -was -born -west -the -battle -plans -which -have -the -east -on -the -right -hand -side -are -of -no -use -to -me -the -residency -ruins -are -draped -with -flowering -vines -and -are -impressive -and -beautiful -they -and -the -grounds -are -sacred -now -and -will -suffer -no -neglect -nor -be -profaned -by -any -sordid -or -commercial -use -while -the -british -remain -masters -of -india -within -the -grounds -are -buried -the -dead -who -gave -up -their -lives -there -in -the -long -siege -after -a -fashion -i -was -able -to -imagine -the -fiery -storm -that -raged -night -and -day -over -the -place -during -so -many -months -and -after -a -fashion -i -could -imagine -the -men -moving -through -it -but -i -could -not -satisfactorily -place -the -200 -women -and -i -could -do -nothing -at -all -with -the -250 -children -i -knew -by -lady -inglis' -diary -that -the -children -carried -on -their -small -affairs -very -much -as -if -blood -and -carnage -and -the -crash -and -thunder -of -a -siege -were -natural -and -proper -features -of -nursery -life -and -i -tried -to -realize -it -but -when -her -little -johnny -came -rushing -all -excitement -through -the -din -and -smoke -shouting -oh -mamma -the -white -hen -has -laid -an -egg! -i -saw -that -i -could -not -do -it -johnny's -place -was -under -the -bed -i -could -imagine -him -there -because -i -could -imagine -myself -there -and -i -think -i -should -not -have -been -interested -in -a -hen -that -was -laying -an -egg -my -interest -would -have -been -with -the -parties -that -were -laying -the -bombshells -i -sat -at -dinner -with -one -of -those -children -in -the -club's -indian -palace -and -i -knew -that -all -through -the -siege -he -was -perfecting -his -teething -and -learning -to -talk -and -while -to -me -he -was -the -most -impressive -object -in -lucknow -after -the -residency -ruins -i -was -not -able -to -imagine -what -his -life -had -been -during -that -tempestuous -infancy -of -his -nor -what -sort -of -a -curious -surprise -it -must -have -been -to -him -to -be -marched -suddenly -out -into -a -strange -dumb -world -where -there -wasn't -any -noise -and -nothing -going -on -he -was -only -forty -one -when -i -saw -him -a -strangely -youthful -link -to -connect -the -present -with -so -ancient -an -episode -as -the -great -mutiny -by -and -by -we -saw -cawnpore -and -the -open -lot -which -was -the -scene -of -moore's -memorable -defense -and -the -spot -on -the -shore -of -the -ganges -where -the -massacre -of -the -betrayed -garrison -occurred -and -the -small -indian -temple -whence -the -bugle -signal -notified -the -assassins -to -fall -on -this -latter -was -a -lonely -spot -and -silent -the -sluggish -river -drifted -by -almost -currentless -it -was -dead -low -water -narrow -channels -with -vast -sandbars -between -all -the -way -across -the -wide -bed -and -the -only -living -thing -in -sight -was -that -grotesque -and -solemn -bald -headed -bird -the -adjutant -standing -on -his -six -foot -stilts -solitary -on -a -distant -bar -with -his -head -sunk -between -his -shoulders -thinking -thinking -of -his -prize -i -suppose -the -dead -hindoo -that -lay -awash -at -his -feet -and -whether -to -eat -him -alone -or -invite -friends -he -and -his -prey -were -a -proper -accent -to -that -mournful -place -they -were -in -keeping -with -it -they -emphasized -its -loneliness -and -its -solemnity -and -we -saw -the -scene -of -the -slaughter -of -the -helpless -women -and -children -and -also -the -costly -memorial -that -is -built -over -the -well -which -contains -their -remains -the -black -hole -of -calcutta -is -gone -but -a -more -reverent -age -is -come -and -whatever -remembrancer -still -exists -of -the -moving -and -heroic -sufferings -and -achievements -of -the -garrisons -of -lucknow -and -cawnpore -will -be -guarded -and -preserved -in -agra -and -its -neighborhood -and -afterwards -at -delhi -we -saw -forts -mosques -and -tombs -which -were -built -in -the -great -days -of -the -mohammedan -emperors -and -which -are -marvels -of -cost -magnitude -and -richness -of -materials -and -ornamentation -creations -of -surpassing -grandeur -wonders -which -do -indeed -make -the -like -things -in -the -rest -of -the -world -seem -tame -and -inconsequential -by -comparison -i -am -not -purposing -to -describe -them -by -good -fortune -i -had -not -read -too -much -about -them -and -therefore -was -able -to -get -a -natural -and -rational -focus -upon -them -with -the -result -that -they -thrilled -blessed -and -exalted -me -but -if -i -had -previously -overheated -my -imagination -by -drinking -too -much -pestilential -literary -hot -scotch -i -should -have -suffered -disappointment -and -sorrow -i -mean -to -speak -of -only -one -of -these -many -world -renowned -buildings -the -taj -mahal -the -most -celebrated -construction -in -the -earth -i -had -read -a -great -deal -too -much -about -it -i -saw -it -in -the -daytime -i -saw -it -in -the -moonlight -i -saw -it -near -at -hand -i -saw -it -from -a -distance -and -i -knew -all -the -time -that -of -its -kind -it -was -the -wonder -of -the -world -with -no -competitor -now -and -no -possible -future -competitor -and -yet -it -was -not -my -taj -my -taj -had -been -built -by -excitable -literary -people -it -was -solidly -lodged -in -my -head -and -i -could -not -blast -it -out -i -wish -to -place -before -the -reader -some -of -the -usual -descriptions -of -the -taj -and -ask -him -to -take -note -of -the -impressions -left -in -his -mind -these -descriptions -do -really -state -the -truth -as -nearly -as -the -limitations -of -language -will -allow -but -language -is -a -treacherous -thing -a -most -unsure -vehicle -and -it -can -seldom -arrange -descriptive -words -in -such -a -way -that -they -will -not -inflate -the -facts -by -help -of -the -reader's -imagination -which -is -always -ready -to -take -a -hand -and -work -for -nothing -and -do -the -bulk -of -it -at -that -i -will -begin -with -a -few -sentences -from -the -excellent -little -local -guide -book -of -mr -satya -chandra -mukerji -i -take -them -from -here -and -there -in -his -description -the -inlaid -work -of -the -taj -and -the -flowers -and -petals -that -are -to -be -found -on -all -sides -on -the -surface -of -the -marble -evince -a -most -delicate -touch -that -is -true -the -inlaid -work -the -marble -the -flowers -the -buds -the -leaves -the -petals -and -the -lotus -stems -are -almost -without -a -rival -in -the -whole -of -the -civilized -world -the -work -of -inlaying -with -stones -and -gems -is -found -in -the -highest -perfection -in -the -taj -gems -inlaid -flowers -buds -and -leaves -to -be -found -on -all -sides -what -do -you -see -before -you -is -the -fairy -structure -growing -is -it -becoming -a -jewel -casket -the -whole -of -the -taj -produces -a -wonderful -effect -that -is -equally -sublime -and -beautiful -then -sir -william -wilson -hunter -the -taj -mahal -with -its -beautiful -domes -'a -dream -of -marble -' -rises -on -the -river -bank -the -materials -are -white -marble -and -red -sandstone -the -complexity -of -its -design -and -the -delicate -intricacy -of -the -workmanship -baffle -description -sir -william -continues -i -will -italicize -some -of -his -words -the -mausoleum -stands -on -a -raised -marble -platform -at -each -of -whose -corners -rises -a -tall -and -slender -minaret -of -graceful -proportions -and -of -exquisite -beauty -beyond -the -platform -stretch -the -two -wings -one -of -which -is -itself -a -mosque -of -great -architectural -merit -in -the -center -of -the -whole -design -the -mausoleum -occupies -a -square -of -186 -feet -with -the -angles -deeply -truncated -so -also -form -an -unequal -octagon -the -main -feature -in -this -central -pile -is -the -great -dome -which -swells -upward -to -nearly -two -thirds -of -a -sphere -and -tapers -at -its -extremity -into -a -pointed -spire -crowned -by -a -crescent -beneath -it -an -enclosure -of -marble -trellis -work -surrounds -the -tomb -of -the -princess -and -of -her -husband -the -emperor -each -corner -of -the -mausoleum -is -covered -by -a -similar -though -much -smaller -dome -erected -on -a -pediment -pierced -with -graceful -saracenic -arches -light -is -admitted -into -the -interior -through -a -double -screen -of -pierced -marble -which -tempers -the -glare -of -an -indian -sky -while -its -whiteness -prevents -the -mellow -effect -from -degenerating -into -gloom -the -internal -decorations -consist -of -inlaid -work -in -precious -stones -such -as -agate -jasper -etc -with -which -every -squandril -or -salient -point -in -the -architecture -is -richly -fretted -brown -and -violet -marble -is -also -freely -employed -in -wreaths -scrolls -and -lintels -to -relieve -the -monotony -of -white -wall -in -regard -to -color -and -design -the -interior -of -the -taj -may -rank -first -in -the -world -for -purely -decorative -workmanship -while -the -perfect -symmetry -of -its -exterior -once -seen -can -never -be -forgotten -nor -the -aerial -grace -of -its -domes -rising -like -marble -bubbles -into -the -clear -sky -the -taj -represents -the -most -highly -elaborated -stage -of -ornamentation -reached -by -the -indo -mohammedan -builders -the -stage -in -which -the -architect -ends -and -the -jeweler -begins -in -its -magnificent -gateway -the -diagonal -ornamentation -at -the -corners -which -satisfied -the -designers -of -the -gateways -of -itimad -ud -doulah -and -sikandra -mausoleums -is -superseded -by -fine -marble -cables -in -bold -twists -strong -and -handsome -the -triangular -insertions -of -white -marble -and -large -flowers -have -in -like -manner -given -place -to -fine -inlaid -work -firm -perpendicular -lines -in -black -marble -with -well -proportioned -panels -of -the -same -material -are -effectively -used -in -the -interior -of -the -gateway -on -its -top -the -hindu -brackets -and -monolithic -architraves -of -sikandra -are -replaced -by -moorish -carped -arches -usually -single -blocks -of -red -sandstone -in -the -kiosks -and -pavilions -which -adorn -the -roof -from -the -pillared -pavilions -a -magnificent -view -is -obtained -of -the -taj -gardens -below -with -the -noble -jumna -river -at -their -farther -end -and -the -city -and -fort -of -agra -in -the -distance -from -this -beautiful -and -splendid -gateway -one -passes -up -a -straight -alley -shaded -by -evergreen -trees -cooled -by -a -broad -shallow -piece -of -water -running -along -the -middle -of -the -path -to -the -taj -itself -the -taj -is -entirely -of -marble -and -gems -the -red -sandstone -of -the -other -mohammedan -buildings -has -entirely -disappeared -or -rather -the -red -sandstone -which -used -to -form -the -thickness -of -the -walls -is -in -the -taj -itself -overlaid -completely -with -white -marble -and -the -white -marble -is -itself -inlaid -with -precious -stones -arranged -in -lovely -patterns -of -flowers -a -feeling -of -purity -impresses -itself -on -the -eye -and -the -mind -from -the -absence -of -the -coarser -material -which -forms -so -invariable -a -material -in -agra -architecture -the -lower -wall -and -panels -are -covered -with -tulips -oleanders -and -fullblown -lilies -in -flat -carving -on -the -white -marble -and -although -the -inlaid -work -of -flowers -done -in -gems -is -very -brilliant -when -looked -at -closely -there -is -on -the -whole -but -little -color -and -the -all -prevailing -sentiment -is -one -of -whiteness -silence -and -calm -the -whiteness -is -broken -only -by -the -fine -color -of -the -inlaid -gems -by -lines -in -black -marble -and -by -delicately -written -inscriptions -also -in -black -from -the -koran -under -the -dome -of -the -vast -mausoleum -a -high -and -beautiful -screen -of -open -tracery -in -white -marble -rises -around -the -two -tombs -or -rather -cenotaphs -of -the -emperor -and -his -princess -and -in -this -marvel -of -marble -the -carving -has -advanced -from -the -old -geometrical -patterns -to -a -trellis -work -of -flowers -and -foliage -handled -with -great -freedom -and -spirit -the -two -cenotaphs -in -the -center -of -the -exquisite -enclosure -have -no -carving -except -the -plain -kalamdan -or -oblong -pen -box -on -the -tomb -of -emperor -shah -jehan -but -both -cenotaphs -are -inlaid -with -flowers -made -of -costly -gems -and -with -the -ever -graceful -oleander -scroll -bayard -taylor -after -describing -the -details -of -the -taj -goes -on -to -say -on -both -sides -the -palm -the -banyan -and -the -feathery -bamboo -mingle -their -foliage -the -song -of -birds -meets -your -ears -and -the -odor -of -roses -and -lemon -flowers -sweetens -the -air -down -such -a -vista -and -over -such -a -foreground -rises -the -taj -there -is -no -mystery -no -sense -of -partial -failure -about -the -taj -a -thing -of -perfect -beauty -and -of -absolute -finish -in -every -detail -it -might -pass -for -the -work -of -genii -who -knew -naught -of -the -weaknesses -and -ills -with -which -mankind -are -beset -all -of -these -details -are -true -but -taken -together -they -state -a -falsehood -to -you -you -cannot -add -them -up -correctly -those -writers -know -the -values -of -their -words -and -phrases -but -to -you -the -words -and -phrases -convey -other -and -uncertain -values -to -those -writers -their -phrases -have -values -which -i -think -i -am -now -acquainted -with -and -for -the -help -of -the -reader -i -will -here -repeat -certain -of -those -words -and -phrases -and -follow -them -with -numerals -which -shall -represent -those -values -then -we -shall -see -the -difference -between -a -writer's -ciphering -and -a -mistaken -reader's -precious -stones -such -as -agate -jasper -etc -5 -with -which -every -salient -point -is -richly -fretted -5 -first -in -the -world -for -purely -decorative -workmanship -9 -the -taj -represents -the -stage -where -the -architect -ends -and -the -jeweler -begins -5 -the -taj -is -entirely -of -marble -and -gems -7 -inlaid -with -precious -stones -in -lovely -patterns -of -flowers -5 -the -inlaid -work -of -flowers -done -in -gems -is -very -brilliant -followed -by -a -most -important -modification -which -the -reader -is -sure -to -read -too -carelessly -2 -the -vast -mausoleum -5 -this -marvel -of -marble -5 -the -exquisite -enclosure -5 -inlaid -with -flowers -made -of -costly -gems -5 -a -thing -of -perfect -beauty -and -absolute -finish -5 -those -details -are -correct -the -figures -which -i -have -placed -after -them -represent -quite -fairly -their -individual -values -then -why -as -a -whole -do -they -convey -a -false -impression -to -the -reader -it -is -because -the -reader -beguiled -by -his -heated -imagination -masses -them -in -the -wrong -way -the -writer -would -mass -the -first -three -figures -in -the -following -way -and -they -would -speak -the -truth -total -19 -but -the -reader -masses -them -thus -and -then -they -tell -a -lie -559 -the -writer -would -add -all -of -his -twelve -numerals -together -and -then -the -sum -would -express -the -whole -truth -about -the -taj -and -the -truth -only -63 -but -the -reader -always -helped -by -his -imagination -would -put -the -figures -in -a -row -one -after -the -other -and -get -this -sum -which -would -tell -him -a -noble -big -lie -559575255555 -you -must -put -in -the -commas -yourself -i -have -to -go -on -with -my -work -the -reader -will -always -be -sure -to -put -the -figures -together -in -that -wrong -way -and -then -as -surely -before -him -will -stand -sparkling -in -the -sun -a -gem -crusted -taj -tall -as -the -matterhorn -i -had -to -visit -niagara -fifteen -times -before -i -succeeded -in -getting -my -imaginary -falls -gauged -to -the -actuality -and -could -begin -to -sanely -and -wholesomely -wonder -at -them -for -what -they -were -not -what -i -had -expected -them -to -be -when -i -first -approached -them -it -was -with -my -face -lifted -toward -the -sky -for -i -thought -i -was -going -to -see -an -atlantic -ocean -pouring -down -thence -over -cloud -vexed -himalayan -heights -a -sea -green -wall -of -water -sixty -miles -front -and -six -miles -high -and -so -when -the -toy -reality -came -suddenly -into -view -that -beruiled -little -wet -apron -hanging -out -to -dry -the -shock -was -too -much -for -me -and -i -fell -with -a -dull -thud -yet -slowly -surely -steadily -in -the -course -of -my -fifteen -visits -the -proportions -adjusted -themselves -to -the -facts -and -i -came -at -last -to -realize -that -a -waterfall -a -hundred -and -sixty -five -feet -high -and -a -quarter -of -a -mile -wide -was -an -impressive -thing -it -was -not -a -dipperful -to -my -vanished -great -vision -but -it -would -answer -i -know -that -i -ought -to -do -with -the -taj -as -i -was -obliged -to -do -with -niagara -see -it -fifteen -times -and -let -my -mind -gradually -get -rid -of -the -taj -built -in -it -by -its -describers -by -help -of -my -imagination -and -substitute -for -it -the -taj -of -fact -it -would -be -noble -and -fine -then -and -a -marvel -not -the -marvel -which -it -replaced -but -still -a -marvel -and -fine -enough -i -am -a -careless -reader -i -suppose -an -impressionist -reader -an -impressionist -reader -of -what -is -not -an -impressionist -picture -a -reader -who -overlooks -the -informing -details -or -masses -their -sum -improperly -and -gets -only -a -large -splashy -general -effect -an -effect -which -is -not -correct -and -which -is -not -warranted -by -the -particulars -placed -before -me -particulars -which -i -did -not -examine -and -whose -meanings -i -did -not -cautiously -and -carefully -estimate -it -is -an -effect -which -is -some -thirty -five -or -forty -times -finer -than -the -reality -and -is -therefore -a -great -deal -better -and -more -valuable -than -the -reality -and -so -i -ought -never -to -hunt -up -the -reality -but -stay -miles -away -from -it -and -thus -preserve -undamaged -my -own -private -mighty -niagara -tumbling -out -of -the -vault -of -heaven -and -my -own -ineffable -taj -built -of -tinted -mists -upon -jeweled -arches -of -rainbows -supported -by -colonnades -of -moonlight -it -is -a -mistake -for -a -person -with -an -unregulated -imagination -to -go -and -look -at -an -illustrious -world's -wonder -i -suppose -that -many -many -years -ago -i -gathered -the -idea -that -the -taj's -place -in -the -achievements -of -man -was -exactly -the -place -of -the -ice -storm -in -the -achievements -of -nature -that -the -taj -represented -man's -supremest -possibility -in -the -creation -of -grace -and -beauty -and -exquisiteness -and -splendor -just -as -the -ice -storm -represents -nature's -supremest -possibility -in -the -combination -of -those -same -qualities -i -do -not -know -how -long -ago -that -idea -was -bred -in -me -but -i -know -that -i -cannot -remember -back -to -a -time -when -the -thought -of -either -of -these -symbols -of -gracious -and -unapproachable -perfection -did -not -at -once -suggest -the -other -if -i -thought -of -the -ice -storm -the -taj -rose -before -me -divinely -beautiful -if -i -thought -of -the -taj -with -its -encrustings -and -inlayings -of -jewels -the -vision -of -the -ice -storm -rose -and -so -to -me -all -these -years -the -taj -has -had -no -rival -among -the -temples -and -palaces -of -men -none -that -even -remotely -approached -it -it -was -man's -architectural -ice -storm -here -in -london -the -other -night -i -was -talking -with -some -scotch -and -english -friends -and -i -mentioned -the -ice -storm -using -it -as -a -figure -a -figure -which -failed -for -none -of -them -had -heard -of -the -ice -storm -one -gentleman -who -was -very -familiar -with -american -literature -said -he -had -never -seen -it -mentioned -in -any -book -that -is -strange -and -i -myself -was -not -able -to -say -that -i -had -seen -it -mentioned -in -a -book -and -yet -the -autumn -foliage -with -all -other -american -scenery -has -received -full -and -competent -attention -the -oversight -is -strange -for -in -america -the -ice -storm -is -an -event -and -it -is -not -an -event -which -one -is -careless -about -when -it -comes -the -news -flies -from -room -to -room -in -the -house -there -are -bangings -on -the -doors -and -shoutings -the -ice -storm! -the -ice -storm! -and -even -the -laziest -sleepers -throw -off -the -covers -and -join -the -rush -for -the -windows -the -ice -storm -occurs -in -midwinter -and -usually -its -enchantments -are -wrought -in -the -silence -and -the -darkness -of -the -night -a -fine -drizzling -rain -falls -hour -after -hour -upon -the -naked -twigs -and -branches -of -the -trees -and -as -it -falls -it -freezes -in -time -the -trunk -and -every -branch -and -twig -are -incased -in -hard -pure -ice -so -that -the -tree -looks -like -a -skeleton -tree -made -all -of -glass -glass -that -is -crystal -clear -all -along -the -underside -of -every -branch -and -twig -is -a -comb -of -little -icicles -the -frozen -drip -sometimes -these -pendants -do -not -quite -amount -to -icicles -but -are -round -beads -frozen -tears -the -weather -clears -toward -dawn -and -leaves -a -brisk -pure -atmosphere -and -a -sky -without -a -shred -of -cloud -in -it -and -everything -is -still -there -is -not -a -breath -of -wind -the -dawn -breaks -and -spreads -the -news -of -the -storm -goes -about -the -house -and -the -little -and -the -big -in -wraps -and -blankets -flock -to -the -window -and -press -together -there -and -gaze -intently -out -upon -the -great -white -ghost -in -the -grounds -and -nobody -says -a -word -nobody -stirs -all -are -waiting -they -know -what -is -coming -and -they -are -waiting -waiting -for -the -miracle -the -minutes -drift -on -and -on -and -on -with -not -a -sound -but -the -ticking -of -the -clock -at -last -the -sun -fires -a -sudden -sheaf -of -rays -into -the -ghostly -tree -and -turns -it -into -a -white -splendor -of -glittering -diamonds -everybody -catches -his -breath -and -feels -a -swelling -in -his -throat -and -a -moisture -in -his -eyes -but -waits -again -for -he -knows -what -is -coming -there -is -more -yet -the -sun -climbs -higher -and -still -higher -flooding -the -tree -from -its -loftiest -spread -of -branches -to -its -lowest -turning -it -to -a -glory -of -white -fire -then -in -a -moment -without -warning -comes -the -great -miracle -the -supreme -miracle -the -miracle -without -its -fellow -in -the -earth -a -gust -of -wind -sets -every -branch -and -twig -to -swaying -and -in -an -instant -turns -the -whole -white -tree -into -a -spouting -and -spraying -explosion -of -flashing -gems -of -every -conceivable -color -and -there -it -stands -and -sways -this -way -and -that -flash! -flash! -flash! -a -dancing -and -glancing -world -of -rubies -emeralds -diamonds -sapphires -the -most -radiant -spectacle -the -most -blinding -spectacle -the -divinest -the -most -exquisite -the -most -intoxicating -vision -of -fire -and -color -and -intolerable -and -unimaginable -splendor -that -ever -any -eye -has -rested -upon -in -this -world -or -will -ever -rest -upon -outside -of -the -gates -of -heaven -by -all -my -senses -all -my -faculties -i -know -that -the -icestorm -is -nature's -supremest -achievement -in -the -domain -of -the -superb -and -the -beautiful -and -by -my -reason -at -least -i -know -that -the -taj -is -man's -ice -storm -in -the -ice -storm -every -one -of -the -myriad -ice -beads -pendant -from -twig -and -branch -is -an -individual -gem -and -changes -color -with -every -motion -caused -by -the -wind -each -tree -carries -a -million -and -a -forest -front -exhibits -the -splendors -of -the -single -tree -multiplied -by -a -thousand -it -occurs -to -me -now -that -i -have -never -seen -the -ice -storm -put -upon -canvas -and -have -not -heard -that -any -painter -has -tried -to -do -it -i -wonder -why -that -is -is -it -that -paint -cannot -counterfeit -the -intense -blaze -of -a -sun -flooded -jewel -there -should -be -and -must -be -a -reason -and -a -good -one -why -the -most -enchanting -sight -that -nature -has -created -has -been -neglected -by -the -brush -often -the -surest -way -to -convey -misinformation -is -to -tell -the -strict -truth -the -describers -of -the -taj -have -used -the -word -gem -in -its -strictest -sense -its -scientific -sense -in -that -sense -it -is -a -mild -word -and -promises -but -little -to -the -eye -nothing -bright -nothing -brilliant -nothing -sparkling -nothing -splendid -in -the -way -of -color -it -accurately -describes -the -sober -and -unobtrusive -gem -work -of -the -taj -that -is -to -the -very -highly -educated -one -person -in -a -thousand -but -it -most -falsely -describes -it -to -the -999 -but -the -999 -are -the -people -who -ought -to -be -especially -taken -care -of -and -to -them -it -does -not -mean -quiet -colored -designs -wrought -in -carnelians -or -agates -or -such -things -they -know -the -word -in -its -wide -and -ordinary -sense -only -and -so -to -them -it -means -diamonds -and -rubies -and -opals -and -their -kindred -and -the -moment -their -eyes -fall -upon -it -in -print -they -see -a -vision -of -glorious -colors -clothed -in -fire -these -describers -are -writing -for -the -general -and -so -in -order -to -make -sure -of -being -understood -they -ought -to -use -words -in -their -ordinary -sense -or -else -explain -the -word -fountain -means -one -thing -in -syria -where -there -is -but -a -handful -of -people -it -means -quite -another -thing -in -north -america -where -there -are -75 -000 -000 -if -i -were -describing -some -syrian -scenery -and -should -exclaim -within -the -narrow -space -of -a -quarter -of -a -mile -square -i -saw -in -the -glory -of -the -flooding -moonlight -two -hundred -noble -fountains -imagine -the -spectacle! -the -north -american -would -have -a -vision -of -clustering -columns -of -water -soaring -aloft -bending -over -in -graceful -arches -bursting -in -beaded -spray -and -raining -white -fire -in -the -moonlight -and -he -would -be -deceived -but -the -syrian -would -not -be -deceived -he -would -merely -see -two -hundred -fresh -water -springs -two -hundred -drowsing -puddles -as -level -and -unpretentious -and -unexcited -as -so -many -door -mats -and -even -with -the -help -of -the -moonlight -he -would -not -lose -his -grip -in -the -presence -of -the -exhibition -my -word -fountain -would -be -correct -it -would -speak -the -strict -truth -and -it -would -convey -the -strict -truth -to -the -handful -of -syrians -and -the -strictest -misinformation -to -the -north -american -millions -with -their -gems -and -gems -and -more -gems -and -gems -again -and -still -other -gems -the -describers -of -the -taj -are -within -their -legal -but -not -their -moral -rights -they -are -dealing -in -the -strictest -scientific -truth -and -in -doing -it -they -succeed -to -admiration -in -telling -what -ain't -so -chapter -lx -satan -impatiently -to -new -comer -the -trouble -with -you -chicago -people -is -that -you -think -you -are -the -best -people -down -here -whereas -you -are -merely -the -most -numerous -pudd'nhead -wilson's -new -calendar -we -wandered -contentedly -around -here -and -there -in -india -to -lahore -among -other -places -where -the -lieutenant -governor -lent -me -an -elephant -this -hospitality -stands -out -in -my -experiences -in -a -stately -isolation -it -was -a -fine -elephant -affable -gentlemanly -educated -and -i -was -not -afraid -of -it -i -even -rode -it -with -confidence -through -the -crowded -lanes -of -the -native -city -where -it -scared -all -the -horses -out -of -their -senses -and -where -children -were -always -just -escaping -its -feet -it -took -the -middle -of -the -road -in -a -fine -independent -way -and -left -it -to -the -world -to -get -out -of -the -way -or -take -the -consequences -i -am -used -to -being -afraid -of -collisions -when -i -ride -or -drive -but -when -one -is -on -top -of -an -elephant -that -feeling -is -absent -i -could -have -ridden -in -comfort -through -a -regiment -of -runaway -teams -i -could -easily -learn -to -prefer -an -elephant -to -any -other -vehicle -partly -because -of -that -immunity -from -collisions -and -partly -because -of -the -fine -view -one -has -from -up -there -and -partly -because -of -the -dignity -one -feels -in -that -high -place -and -partly -because -one -can -look -in -at -the -windows -and -see -what -is -going -on -privately -among -the -family -the -lahore -horses -were -used -to -elephants -but -they -were -rapturously -afraid -of -them -just -the -same -it -seemed -curious -perhaps -the -better -they -know -the -elephant -the -more -they -respect -him -in -that -peculiar -way -in -our -own -case -we -are -not -afraid -of -dynamite -till -we -get -acquainted -with -it -we -drifted -as -far -as -rawal -pindi -away -up -on -the -afghan -frontier -i -think -it -was -the -afghan -frontier -but -it -may -have -been -hertzegovina -it -was -around -there -somewhere -and -down -again -to -delhi -to -see -the -ancient -architectural -wonders -there -and -in -old -delhi -and -not -describe -them -and -also -to -see -the -scene -of -the -illustrious -assault -in -the -mutiny -days -when -the -british -carried -delhi -by -storm -one -of -the -marvels -of -history -for -impudent -daring -and -immortal -valor -we -had -a -refreshing -rest -there -in -delhi -in -a -great -old -mansion -which -possessed -historical -interest -it -was -built -by -a -rich -englishman -who -had -become -orientalized -so -much -so -that -he -had -a -zenana -but -he -was -a -broadminded -man -and -remained -so -to -please -his -harem -he -built -a -mosque -to -please -himself -he -built -an -english -church -that -kind -of -a -man -will -arrive -somewhere -in -the -mutiny -days -the -mansion -was -the -british -general's -headquarters -it -stands -in -a -great -garden -oriental -fashion -and -about -it -are -many -noble -trees -the -trees -harbor -monkeys -and -they -are -monkeys -of -a -watchful -and -enterprising -sort -and -not -much -troubled -with -fear -they -invade -the -house -whenever -they -get -a -chance -and -carry -off -everything -they -don't -want -one -morning -the -master -of -the -house -was -in -his -bath -and -the -window -was -open -near -it -stood -a -pot -of -yellow -paint -and -a -brush -some -monkeys -appeared -in -the -window -to -scare -them -away -the -gentleman -threw -his -sponge -at -them -they -did -not -scare -at -all -they -jumped -into -the -room -and -threw -yellow -paint -all -over -him -from -the -brush -and -drove -him -out -then -they -painted -the -walls -and -the -floor -and -the -tank -and -the -windows -and -the -furniture -yellow -and -were -in -the -dressing -room -painting -that -when -help -arrived -and -routed -them -two -of -these -creatures -came -into -my -room -in -the -early -morning -through -a -window -whose -shutters -i -had -left -open -and -when -i -woke -one -of -them -was -before -the -glass -brushing -his -hair -and -the -other -one -had -my -note -book -and -was -reading -a -page -of -humorous -notes -and -crying -i -did -not -mind -the -one -with -the -hair -brush -but -the -conduct -of -the -other -one -hurt -me -it -hurts -me -yet -i -threw -something -at -him -and -that -was -wrong -for -my -host -had -told -me -that -the -monkeys -were -best -left -alone -they -threw -everything -at -me -that -they -could -lift -and -then -went -into -the -bathroom -to -get -some -more -things -and -i -shut -the -door -on -them -at -jeypore -in -rajputana -we -made -a -considerable -stay -we -were -not -in -the -native -city -but -several -miles -from -it -in -the -small -european -official -suburb -there -were -but -few -europeans -only -fourteen -but -they -were -all -kind -and -hospitable -and -it -amounted -to -being -at -home -in -jeypore -we -found -again -what -we -had -found -all -about -india -that -while -the -indian -servant -is -in -his -way -a -very -real -treasure -he -will -sometimes -bear -watching -and -the -englishman -watches -him -if -he -sends -him -on -an -errand -he -wants -more -than -the -man's -word -for -it -that -he -did -the -errand -when -fruit -and -vegetables -were -sent -to -us -a -chit -came -with -them -a -receipt -for -us -to -sign -otherwise -the -things -might -not -arrive -if -a -gentleman -sent -up -his -carriage -the -chit -stated -from -such -and -such -an -hour -to -such -and -such -an -hour -which -made -it -unhandy -for -the -coachman -and -his -two -or -three -subordinates -to -put -us -off -with -a -part -of -the -allotted -time -and -devote -the -rest -of -it -to -a -lark -of -their -own -we -were -pleasantly -situated -in -a -small -two -storied -inn -in -an -empty -large -compound -which -was -surrounded -by -a -mud -wall -as -high -as -a -man's -head -the -inn -was -kept -by -nine -hindoo -brothers -its -owners -they -lived -with -their -families -in -a -one -storied -building -within -the -compound -but -off -to -one -side -and -there -was -always -a -long -pile -of -their -little -comely -brown -children -loosely -stacked -in -its -veranda -and -a -detachment -of -the -parents -wedged -among -them -smoking -the -hookah -or -the -howdah -or -whatever -they -call -it -by -the -veranda -stood -a -palm -and -a -monkey -lived -in -it -and -led -a -lonesome -life -and -always -looked -sad -and -weary -and -the -crows -bothered -him -a -good -deal -the -inn -cow -poked -about -the -compound -and -emphasized -the -secluded -and -country -air -of -the -place -and -there -was -a -dog -of -no -particular -breed -who -was -always -present -in -the -compound -and -always -asleep -always -stretched -out -baking -in -the -sun -and -adding -to -the -deep -tranquility -and -reposefulness -of -the -place -when -the -crows -were -away -on -business -white -draperied -servants -were -coming -and -going -all -the -time -but -they -seemed -only -spirits -for -their -feet -were -bare -and -made -no -sound -down -the -lane -a -piece -lived -an -elephant -in -the -shade -of -a -noble -tree -and -rocked -and -rocked -and -reached -about -with -his -trunk -begging -of -his -brown -mistress -or -fumbling -the -children -playing -at -his -feet -and -there -were -camels -about -but -they -go -on -velvet -feet -and -were -proper -to -the -silence -and -serenity -of -the -surroundings -the -satan -mentioned -at -the -head -of -this -chapter -was -not -our -satan -but -the -other -one -our -satan -was -lost -to -us -in -these -later -days -he -had -passed -out -of -our -life -lamented -by -me -and -sincerely -i -was -missing -him -i -am -missing -him -yet -after -all -these -months -he -was -an -astonishing -creature -to -fly -around -and -do -things -he -didn't -always -do -them -quite -right -but -he -did -them -and -did -them -suddenly -there -was -no -time -wasted -you -would -say -pack -the -trunks -and -bags -satan -wair -good -very -good -then -there -would -be -a -brief -sound -of -thrashing -and -slashing -and -humming -and -buzzing -and -a -spectacle -as -of -a -whirlwind -spinning -gowns -and -jackets -and -coats -and -boots -and -things -through -the -air -and -then -with -bow -and -touch -awready -master -it -was -wonderful -it -made -one -dizzy -he -crumpled -dresses -a -good -deal -and -he -had -no -particular -plan -about -the -work -at -first -except -to -put -each -article -into -the -trunk -it -didn't -belong -in -but -he -soon -reformed -in -this -matter -not -entirely -for -to -the -last -he -would -cram -into -the -satchel -sacred -to -literature -any -odds -and -ends -of -rubbish -that -he -couldn't -find -a -handy -place -for -elsewhere -when -threatened -with -death -for -this -it -did -not -trouble -him -he -only -looked -pleasant -saluted -with -soldierly -grace -said -wair -good -and -did -it -again -next -day -he -was -always -busy -kept -the -rooms -tidied -up -the -boots -polished -the -clothes -brushed -the -wash -basin -full -of -clean -water -my -dress -clothes -laid -out -and -ready -for -the -lecture -hall -an -hour -ahead -of -time -and -he -dressed -me -from -head -to -heel -in -spite -of -my -determination -to -do -it -myself -according -to -my -lifelong -custom -he -was -a -born -boss -and -loved -to -command -and -to -jaw -and -dispute -with -inferiors -and -harry -them -and -bullyrag -them -he -was -fine -at -the -railway -station -yes -he -was -at -his -finest -there -he -would -shoulder -and -plunge -and -paw -his -violent -way -through -the -packed -multitude -of -natives -with -nineteen -coolies -at -his -tail -each -bearing -a -trifle -of -luggage -one -a -trunk -another -a -parasol -another -a -shawl -another -a -fan -and -so -on -one -article -to -each -and -the -longer -the -procession -the -better -he -was -suited -and -he -was -sure -to -make -for -some -engaged -sleeper -and -begin -to -hurl -the -owner's -things -out -of -it -swearing -that -it -was -ours -and -that -there -had -been -a -mistake -arrived -at -our -own -sleeper -he -would -undo -the -bedding -bundles -and -make -the -beds -and -put -everything -to -rights -and -shipshape -in -two -minutes -then -put -his -head -out -at -a -window -and -have -a -restful -good -time -abusing -his -gang -of -coolies -and -disputing -their -bill -until -we -arrived -and -made -him -pay -them -and -stop -his -noise -speaking -of -noise -he -certainly -was -the -noisest -little -devil -in -india -and -that -is -saying -much -very -much -indeed -i -loved -him -for -his -noise -but -the -family -detested -him -for -it -they -could -not -abide -it -they -could -not -get -reconciled -to -it -it -humiliated -them -as -a -rule -when -we -got -within -six -hundred -yards -of -one -of -those -big -railway -stations -a -mighty -racket -of -screaming -and -shrieking -and -shouting -and -storming -would -break -upon -us -and -i -would -be -happy -to -myself -and -the -family -would -say -with -shame -there -that's -satan -why -do -you -keep -him -and -sure -enough -there -in -the -whirling -midst -of -fifteen -hundred -wondering -people -we -would -find -that -little -scrap -of -a -creature -gesticulating -like -a -spider -with -the -colic -his -black -eyes -snapping -his -fez -tassel -dancing -his -jaws -pouring -out -floods -of -billingsgate -upon -his -gang -of -beseeching -and -astonished -coolies -i -loved -him -i -couldn't -help -it -but -the -family -why -they -could -hardly -speak -of -him -with -patience -to -this -day -i -regret -his -loss -and -wish -i -had -him -back -but -they -it -is -different -with -them -he -was -a -native -and -came -from -surat -twenty -degrees -of -latitude -lay -between -his -birthplace -and -manuel's -and -fifteen -hundred -between -their -ways -and -characters -and -dispositions -i -only -liked -manuel -but -i -loved -satan -this -latter's -real -name -was -intensely -indian -i -could -not -quite -get -the -hang -of -it -but -it -sounded -like -bunder -rao -ram -chunder -clam -chowder -it -was -too -long -for -handy -use -anyway -so -i -reduced -it -when -he -had -been -with -us -two -or -three -weeks -he -began -to -make -mistakes -which -i -had -difficulty -in -patching -up -for -him -approaching -benares -one -day -he -got -out -of -the -train -to -see -if -he -could -get -up -a -misunderstanding -with -somebody -for -it -had -been -a -weary -long -journey -and -he -wanted -to -freshen -up -he -found -what -he -was -after -but -kept -up -his -pow -wow -a -shade -too -long -and -got -left -so -there -we -were -in -a -strange -city -and -no -chambermaid -it -was -awkward -for -us -and -we -told -him -he -must -not -do -so -any -more -he -saluted -and -said -in -his -dear -pleasant -way -wair -good -then -at -lucknow -he -got -drunk -i -said -it -was -a -fever -and -got -the -family's -compassion -and -solicitude -aroused -so -they -gave -him -a -teaspoonful -of -liquid -quinine -and -it -set -his -vitals -on -fire -he -made -several -grimaces -which -gave -me -a -better -idea -of -the -lisbon -earthquake -than -any -i -have -ever -got -of -it -from -paintings -and -descriptions -his -drunk -was -still -portentously -solid -next -morning -but -i -could -have -pulled -him -through -with -the -family -if -he -would -only -have -taken -another -spoonful -of -that -remedy -but -no -although -he -was -stupefied -his -memory -still -had -flickerings -of -life -so -he -smiled -a -divinely -dull -smile -and -said -fumblingly -saluting -scoose -me -mem -saheb -scoose -me -missy -saheb -satan -not -prefer -it -please -then -some -instinct -revealed -to -them -that -he -was -drunk -they -gave -him -prompt -notice -that -next -time -this -happened -he -must -go -he -got -out -a -maudlin -and -most -gentle -wair -good -and -saluted -indefinitely -only -one -short -week -later -he -fell -again -and -oh -sorrow! -not -in -a -hotel -this -time -but -in -an -english -gentleman's -private -house -and -in -agra -of -all -places -so -he -had -to -go -when -i -told -him -he -said -patiently -wair -good -and -made -his -parting -salute -and -went -out -from -us -to -return -no -more -forever -dear -me! -i -would -rather -have -lost -a -hundred -angels -than -that -one -poor -lovely -devil -what -style -he -used -to -put -on -in -a -swell -hotel -or -in -a -private -house -snow -white -muslin -from -his -chin -to -his -bare -feet -a -crimson -sash -embroidered -with -gold -thread -around -his -waist -and -on -his -head -a -great -sea -green -turban -like -to -the -turban -of -the -grand -turk -he -was -not -a -liar -but -he -will -become -one -if -he -keeps -on -he -told -me -once -that -he -used -to -crack -cocoanuts -with -his -teeth -when -he -was -a -boy -and -when -i -asked -how -he -got -them -into -his -mouth -he -said -he -was -upward -of -six -feet -high -at -that -time -and -had -an -unusual -mouth -and -when -i -followed -him -up -and -asked -him -what -had -become -of -that -other -foot -he -said -a -house -fell -on -him -and -he -was -never -able -to -get -his -stature -back -again -swervings -like -these -from -the -strict -line -of -fact -often -beguile -a -truthful -man -on -and -on -until -he -eventually -becomes -a -liar -his -successor -was -a -mohammedan -sahadat -mohammed -khan -very -dark -very -tall -very -grave -he -went -always -in -flowing -masses -of -white -from -the -top -of -his -big -turban -down -to -his -bare -feet -his -voice -was -low -he -glided -about -in -a -noiseless -way -and -looked -like -a -ghost -he -was -competent -and -satisfactory -but -where -he -was -it -seemed -always -sunday -it -was -not -so -in -satan's -time -jeypore -is -intensely -indian -but -it -has -two -or -three -features -which -indicate -the -presence -of -european -science -and -european -interest -in -the -weal -of -the -common -public -such -as -the -liberal -water -supply -furnished -by -great -works -built -at -the -state's -expense -good -sanitation -resulting -in -a -degree -of -healthfulness -unusually -high -for -india -a -noble -pleasure -garden -with -privileged -days -for -women -schools -for -the -instruction -of -native -youth -in -advanced -art -both -ornamental -and -utilitarian -and -a -new -and -beautiful -palace -stocked -with -a -museum -of -extraordinary -interest -and -value -without -the -maharaja's -sympathy -and -purse -these -beneficences -could -not -have -been -created -but -he -is -a -man -of -wide -views -and -large -generosities -and -all -such -matters -find -hospitality -with -him -we -drove -often -to -the -city -from -the -hotel -kaiser -i -hind -a -journey -which -was -always -full -of -interest -both -night -and -day -for -that -country -road -was -never -quiet -never -empty -but -was -always -india -in -motion -always -a -streaming -flood -of -brown -people -clothed -in -smouchings -from -the -rainbow -a -tossing -and -moiling -flood -happy -noisy -a -charming -and -satisfying -confusion -of -strange -human -and -strange -animal -life -and -equally -strange -and -outlandish -vehicles -and -the -city -itself -is -a -curiosity -any -indian -city -is -that -but -this -one -is -not -like -any -other -that -we -saw -it -is -shut -up -in -a -lofty -turreted -wall -the -main -body -of -it -is -divided -into -six -parts -by -perfectly -straight -streets -that -are -more -than -a -hundred -feet -wide -the -blocks -of -houses -exhibit -a -long -frontage -of -the -most -taking -architectural -quaintnesses -the -straight -lines -being -broken -everywhere -by -pretty -little -balconies -pillared -and -highly -ornamented -and -other -cunning -and -cozy -and -inviting -perches -and -projections -and -many -of -the -fronts -are -curiously -pictured -by -the -brush -and -the -whole -of -them -have -the -soft -rich -tint -of -strawberry -ice -cream -one -cannot -look -down -the -far -stretch -of -the -chief -street -and -persuade -himself -that -these -are -real -houses -and -that -it -is -all -out -of -doors -the -impression -that -it -is -an -unreality -a -picture -a -scene -in -a -theater -is -the -only -one -that -will -take -hold -then -there -came -a -great -day -when -this -illusion -was -more -pronounced -than -ever -a -rich -hindoo -had -been -spending -a -fortune -upon -the -manufacture -of -a -crowd -of -idols -and -accompanying -paraphernalia -whose -purpose -was -to -illustrate -scenes -in -the -life -of -his -especial -god -or -saint -and -this -fine -show -was -to -be -brought -through -the -town -in -processional -state -at -ten -in -the -morning -as -we -passed -through -the -great -public -pleasure -garden -on -our -way -to -the -city -we -found -it -crowded -with -natives -that -was -one -sight -then -there -was -another -in -the -midst -of -the -spacious -lawns -stands -the -palace -which -contains -the -museum -a -beautiful -construction -of -stone -which -shows -arched -colonnades -one -above -another -and -receding -terrace -fashion -toward -the -sky -every -one -of -these -terraces -all -the -way -to -the -top -one -was -packed -and -jammed -with -natives -one -must -try -to -imagine -those -solid -masses -of -splendid -color -one -above -another -up -and -up -against -the -blue -sky -and -the -indian -sun -turning -them -all -to -beds -of -fire -and -flame -later -when -we -reached -the -city -and -glanced -down -the -chief -avenue -smouldering -in -its -crushed -strawberry -tint -those -splendid -effects -were -repeated -for -every -balcony -and -every -fanciful -bird -cage -of -a -snuggery -countersunk -in -the -house -fronts -and -all -the -long -lines -of -roofs -were -crowded -with -people -and -each -crowd -was -an -explosion -of -brilliant -color -then -the -wide -street -itself -away -down -and -down -and -down -into -the -distance -was -alive -with -gorgeously -clothed -people -not -still -but -moving -swaying -drifting -eddying -a -delirious -display -of -all -colors -and -all -shades -of -color -delicate -lovely -pale -soft -strong -stunning -vivid -brilliant -a -sort -of -storm -of -sweetpea -blossoms -passing -on -the -wings -of -a -hurricane -and -presently -through -this -storm -of -color -came -swaying -and -swinging -the -majestic -elephants -clothed -in -their -sunday -best -of -gaudinesses -and -the -long -procession -of -fanciful -trucks -freighted -with -their -groups -of -curious -and -costly -images -and -then -the -long -rearguard -of -stately -camels -with -their -picturesque -riders -for -color -and -picturesqueness -and -novelty -and -outlandishness -and -sustained -interest -and -fascination -it -was -the -most -satisfying -show -i -had -ever -seen -and -i -suppose -i -shall -not -have -the -privilege -of -looking -upon -its -like -again -chapter -lxi -in -the -first -place -god -made -idiots -this -was -for -practice -then -he -made -school -boards -pudd'nhead -wilson's -new -calendar -suppose -we -applied -no -more -ingenuity -to -the -instruction -of -deaf -and -dumb -and -blind -children -than -we -sometimes -apply -in -our -american -public -schools -to -the -instruction -of -children -who -are -in -possession -of -all -their -faculties -the -result -would -be -that -the -deaf -and -dumb -and -blind -would -acquire -nothing -they -would -live -and -die -as -ignorant -as -bricks -and -stones -the -methods -used -in -the -asylums -are -rational -the -teacher -exactly -measures -the -child's -capacity -to -begin -with -and -from -thence -onwards -the -tasks -imposed -are -nicely -gauged -to -the -gradual -development -of -that -capacity -the -tasks -keep -pace -with -the -steps -of -the -child's -progress -they -don't -jump -miles -and -leagues -ahead -of -it -by -irrational -caprice -and -land -in -vacancy -according -to -the -average -public -school -plan -in -the -public -school -apparently -they -teach -the -child -to -spell -cat -then -ask -it -to -calculate -an -eclipse -when -it -can -read -words -of -two -syllables -they -require -it -to -explain -the -circulation -of -the -blood -when -it -reaches -the -head -of -the -infant -class -they -bully -it -with -conundrums -that -cover -the -domain -of -universal -knowledge -this -sounds -extravagant -and -is -yet -it -goes -no -great -way -beyond -the -facts -i -received -a -curious -letter -one -day -from -the -punjab -you -must -pronounce -it -punjawb -the -handwriting -was -excellent -and -the -wording -was -english -english -and -yet -not -exactly -english -the -style -was -easy -and -smooth -and -flowing -yet -there -was -something -subtly -foreign -about -it -a -something -tropically -ornate -and -sentimental -and -rhetorical -it -turned -out -to -be -the -work -of -a -hindoo -youth -the -holder -of -a -humble -clerical -billet -in -a -railway -office -he -had -been -educated -in -one -of -the -numerous -colleges -of -india -upon -inquiry -i -was -told -that -the -country -was -full -of -young -fellows -of -his -like -they -had -been -educated -away -up -to -the -snow -summits -of -learning -and -the -market -for -all -this -elaborate -cultivation -was -minutely -out -of -proportion -to -the -vastness -of -the -product -this -market -consisted -of -some -thousands -of -small -clerical -posts -under -the -government -the -supply -of -material -for -it -was -multitudinous -if -this -youth -with -the -flowing -style -and -the -blossoming -english -was -occupying -a -small -railway -clerkship -it -meant -that -there -were -hundreds -and -hundreds -as -capable -as -he -or -he -would -be -in -a -high -place -and -it -certainly -meant -that -there -were -thousands -whose -education -and -capacity -had -fallen -a -little -short -and -that -they -would -have -to -go -without -places -apparently -then -the -colleges -of -india -were -doing -what -our -high -schools -have -long -been -doing -richly -over -supplying -the -market -for -highly -educated -service -and -thereby -doing -a -damage -to -the -scholar -and -through -him -to -the -country -at -home -i -once -made -a -speech -deploring -the -injuries -inflicted -by -the -high -school -in -making -handicrafts -distasteful -to -boys -who -would -have -been -willing -to -make -a -living -at -trades -and -agriculture -if -they -had -but -had -the -good -luck -to -stop -with -the -common -school -but -i -made -no -converts -not -one -in -a -community -overrun -with -educated -idlers -who -were -above -following -their -fathers' -mechanical -trades -yet -could -find -no -market -for -their -book -knowledge -the -same -rail -that -brought -me -the -letter -from -the -punjab -brought -also -a -little -book -published -by -messrs -thacker -spink -& -co -of -calcutta -which -interested -me -for -both -its -preface -and -its -contents -treated -of -this -matter -of -over -education -in -the -preface -occurs -this -paragraph -from -the -calcutta -review -for -government -office -read -drygoods -clerkship -and -it -will -fit -more -than -one -region -of -america -the -education -that -we -give -makes -the -boys -a -little -less -clownish -in -their -manners -and -more -intelligent -when -spoken -to -by -strangers -on -the -other -hand -it -has -made -them -less -contented -with -their -lot -in -life -and -less -willing -to -work -with -their -hands -the -form -which -discontent -takes -in -this -country -is -not -of -a -healthy -kind -for -the -natives -of -india -consider -that -the -only -occupation -worthy -of -an -educated -man -is -that -of -a -writership -in -some -office -and -especially -in -a -government -office -the -village -schoolboy -goes -back -to -the -plow -with -the -greatest -reluctance -and -the -town -schoolboy -carries -the -same -discontent -and -inefficiency -into -his -father's -workshop -sometimes -these -ex -students -positively -refuse -at -first -to -work -and -more -than -once -parents -have -openly -expressed -their -regret -that -they -ever -allowed -their -sons -to -be -inveigled -to -school -the -little -book -which -i -am -quoting -from -is -called -indo -anglian -literature -and -is -well -stocked -with -baboo -english -clerkly -english -hooky -english -acquired -in -the -schools -some -of -it -is -very -funny -almost -as -funny -perhaps -as -what -you -and -i -produce -when -we -try -to -write -in -a -language -not -our -own -but -much -of -it -is -surprisingly -correct -and -free -if -i -were -going -to -quote -good -english -but -i -am -not -india -is -well -stocked -with -natives -who -speak -it -and -write -it -as -well -as -the -best -of -us -i -merely -wish -to -show -some -of -the -quaint -imperfect -attempts -at -the -use -of -our -tongue -there -are -many -letters -in -the -book -poverty -imploring -help -bread -money -kindness -office -generally -an -office -a -clerkship -some -way -to -get -food -and -a -rag -out -of -the -applicant's -unmarketable -education -and -food -not -for -himself -alone -but -sometimes -for -a -dozen -helpless -relations -in -addition -to -his -own -family -for -those -people -are -astonishingly -unselfish -and -admirably -faithful -to -their -ties -of -kinship -among -us -i -think -there -is -nothing -approaching -it -strange -as -some -of -these -wailing -and -supplicating -letters -are -humble -and -even -groveling -as -some -of -them -are -and -quaintly -funny -and -confused -as -a -goodly -number -of -them -are -there -is -still -a -pathos -about -them -as -a -rule -that -checks -the -rising -laugh -and -reproaches -it -in -the -following -letter -father -is -not -to -be -read -literally -in -ceylon -a -little -native -beggar -girl -embarrassed -me -by -calling -me -father -although -i -knew -she -was -mistaken -i -was -so -new -that -i -did -not -know -that -she -was -merely -following -the -custom -of -the -dependent -and -the -supplicant -sir -i -pray -please -to -give -me -some -action -work -for -i -am -very -poor -boy -i -have -no -one -to -help -me -even -so -father -for -it -so -it -seemed -in -thy -good -sight -you -give -the -telegraph -office -and -another -work -what -is -your -wish -i -am -very -poor -boy -this -understand -what -is -your -wish -you -my -father -i -am -your -son -this -understand -what -is -your -wish -your -sirvent -p -c -b -through -ages -of -debasing -oppression -suffered -by -these -people -at -the -hands -of -their -native -rulers -they -come -legitimately -by -the -attitude -and -language -of -fawning -and -flattery -and -one -must -remember -this -in -mitigation -when -passing -judgment -upon -the -native -character -it -is -common -in -these -letters -to -find -the -petitioner -furtively -trying -to -get -at -the -white -man's -soft -religious -side -even -this -poor -boy -baits -his -hook -with -a -macerated -bible -text -in -the -hope -that -it -may -catch -something -if -all -else -fail -here -is -an -application -for -the -post -of -instructor -in -english -to -some -children -my -dear -sir -or -gentleman -that -your -petitioner -has -much -qualification -in -the -language -of -english -to -instruct -the -young -boys -i -was -given -to -understand -that -your -of -suitable -children -has -to -acquire -the -knowledge -of -english -language -as -a -sample -of -the -flowery -eastern -style -i -will -take -a -sentence -or -two -from -along -letter -written -by -a -young -native -to -the -lieutenant -governor -of -bengal -an -application -for -employment -honored -and -much -respected -sir -i -hope -your -honor -will -condescend -to -hear -the -tale -of -this -poor -creature -i -shall -overflow -with -gratitude -at -this -mark -of -your -royal -condescension -the -bird -like -happiness -has -flown -away -from -my -nest -like -heart -and -has -not -hitherto -returned -from -the -period -whence -the -rose -of -my -father's -life -suffered -the -autumnal -breath -of -death -in -plain -english -he -passed -through -the -gates -of -grave -and -from -that -hour -the -phantom -of -delight -has -never -danced -before -me -it -is -all -school -english -book -english -you -see -and -good -enough -too -all -things -considered -if -the -native -boy -had -but -that -one -study -he -would -shine -he -would -dazzle -no -doubt -but -that -is -not -the -case -he -is -situated -as -are -our -public -school -children -loaded -down -with -an -over -freightage -of -other -studies -and -frequently -they -are -as -far -beyond -the -actual -point -of -progress -reached -by -him -and -suited -to -the -stage -of -development -attained -as -could -be -imagined -by -the -insanest -fancy -apparently -like -our -public -school -boy -he -must -work -work -work -in -school -and -out -and -play -but -little -apparently -like -our -public -school -boy -his -education -consists -in -learning -things -not -the -meaning -of -them -he -is -fed -upon -the -husks -not -the -corn -from -several -essays -written -by -native -schoolboys -in -answer -to -the -question -of -how -they -spend -their -day -i -select -one -the -one -which -goes -most -into -detail -66 -at -the -break -of -day -i -rises -from -my -own -bed -and -finish -my -daily -duty -then -i -employ -myself -till -8 -o'clock -after -which -i -employ -myself -to -bathe -then -take -for -my -body -some -sweet -meat -and -just -at -9 -1/2 -i -came -to -school -to -attend -my -class -duty -then -at -2 -1/2 -p -m -i -return -from -school -and -engage -myself -to -do -my -natural -duty -then -i -engage -for -a -quarter -to -take -my -tithn -then -i -study -till -5 -p -m -after -which -i -began -to -play -anything -which -comes -in -my -head -after -8 -1/2 -half -pass -to -eight -we -are -began -to -sleep -before -sleeping -i -told -a -constable -just -11 -o' -he -came -and -rose -us -from -half -pass -eleven -we -began -to -read -still -morning -it -is -not -perfectly -clear -now -that -i -come -to -cipher -upon -it -he -gets -up -at -about -5 -in -the -morning -or -along -there -somewhere -and -goes -to -bed -about -fifteen -or -sixteen -hours -afterward -that -much -of -it -seems -straight -but -why -he -should -rise -again -three -hours -later -and -resume -his -studies -till -morning -is -puzzling -i -think -it -is -because -he -is -studying -history -history -requires -a -world -of -time -and -bitter -hard -work -when -your -education -is -no -further -advanced -than -the -cat's -when -you -are -merely -stuffing -yourself -with -a -mixed -up -mess -of -empty -names -and -random -incidents -and -elusive -dates -which -no -one -teaches -you -how -to -interpret -and -which -uninterpreted -pay -you -not -a -farthing's -value -for -your -waste -of -time -yes -i -think -he -had -to -get -up -at -halfpast -11 -p -m -in -order -to -be -sure -to -be -perfect -with -his -history -lesson -by -noon -with -results -as -follows -from -a -calcutta -school -examination -q -who -was -cardinal -wolsey -cardinal -wolsey -was -an -editor -of -a -paper -named -north -briton -no -45 -of -his -publication -he -charged -the -king -of -uttering -a -lie -from -the -throne -he -was -arrested -and -cast -into -prison -and -after -releasing -went -to -france -3 -as -bishop -of -york -but -died -in -disentry -in -a -church -on -his -way -to -be -blockheaded -8 -cardinal -wolsey -was -the -son -of -edward -iv -after -his -father's -death -he -himself -ascended -the -throne -at -the -age -of -10 -ten -only -but -when -he -surpassed -or -when -he -was -fallen -in -his -twenty -years -of -age -at -that -time -he -wished -to -make -a -journey -in -his -countries -under -him -but -he -was -opposed -by -his -mother -to -do -journey -and -according -to -his -mother's -example -he -remained -in -the -home -and -then -became -king -after -many -times -obstacles -and -many -confusion -he -become -king -and -afterwards -his -brother -there -is -probably -not -a -word -of -truth -in -that -q -what -is -the -meaning -of -'ich -dien' -10 -an -honor -conferred -on -the -first -or -eldest -sons -of -english -sovereigns -it -is -nothing -more -than -some -feathers -11 -ich -dien -was -the -word -which -was -written -on -the -feathers -of -the -blind -king -who -came -to -fight -being -interlaced -with -the -bridles -of -the -horse -13 -ich -dien -is -a -title -given -to -henry -vii -by -the -pope -of -rome -when -he -forwarded -the -reformation -of -cardinal -wolsy -to -rome -and -for -this -reason -he -was -called -commander -of -the -faith -a -dozen -or -so -of -this -kind -of -insane -answers -are -quoted -in -the -book -from -that -examination -each -answer -is -sweeping -proof -all -by -itself -that -the -person -uttering -it -was -pushed -ahead -of -where -he -belonged -when -he -was -put -into -history -proof -that -he -had -been -put -to -the -task -of -acquiring -history -before -he -had -had -a -single -lesson -in -the -art -of -acquiring -it -which -is -the -equivalent -of -dumping -a -pupil -into -geometry -before -he -has -learned -the -progressive -steps -which -lead -up -to -it -and -make -its -acquirement -possible -those -calcutta -novices -had -no -business -with -history -there -was -no -excuse -for -examining -them -in -it -no -excuse -for -exposing -them -and -their -teachers -they -were -totally -empty -there -was -nothing -to -examine -helen -keller -has -been -dumb -stone -deaf -and -stone -blind -ever -since -she -was -a -little -baby -a -year -and -a -half -old -and -now -at -sixteen -years -of -age -this -miraculous -creature -this -wonder -of -all -the -ages -passes -the -harvard -university -examination -in -latin -german -french -history -belles -lettres -and -such -things -and -does -it -brilliantly -too -not -in -a -commonplace -fashion -she -doesn't -know -merely -things -she -is -splendidly -familiar -with -the -meanings -of -them -when -she -writes -an -essay -on -a -shakespearean -character -her -english -is -fine -and -strong -her -grasp -of -the -subject -is -the -grasp -of -one -who -knows -and -her -page -is -electric -with -light -has -miss -sullivan -taught -her -by -the -methods -of -india -and -the -american -public -school -no -oh -no -for -then -she -would -be -deafer -and -dumber -and -blinder -than -she -was -before -it -is -a -pity -that -we -can't -educate -all -the -children -in -the -asylums -to -continue -the -calcutta -exposure -what -is -the -meaning -of -a -sheriff -25 -sheriff -is -a -post -opened -in -the -time -of -john -the -duty -of -sheriff -here -in -calcutta -to -look -out -and -catch -those -carriages -which -is -rashly -driven -out -by -the -coachman -but -it -is -a -high -post -in -england -26 -sheriff -was -the -english -bill -of -common -prayer -27 -the -man -with -whom -the -accusative -persons -are -placed -is -called -sheriff -28 -sheriff -latin -term -for -'shrub -' -we -called -broom -worn -by -the -first -earl -of -enjue -as -an -emblem -of -humility -when -they -went -to -the -pilgrimage -and -from -this -their -hairs -took -their -crest -and -surname -29 -sheriff -is -a -kind -of -titlous -sect -of -people -as -barons -nobles -etc -30 -sheriff -a -tittle -given -on -those -persons -who -were -respective -and -pious -in -england -the -students -were -examined -in -the -following -bulky -matters -geometry -the -solar -spectrum -the -habeas -corpus -act -the -british -parliament -and -in -metaphysics -they -were -asked -to -trace -the -progress -of -skepticism -from -descartes -to -hume -it -is -within -bounds -to -say -that -some -of -the -results -were -astonishing -without -doubt -there -were -students -present -who -justified -their -teacher's -wisdom -in -introducing -them -to -these -studies -but -the -fact -is -also -evident -that -others -had -been -pushed -into -these -studies -to -waste -their -time -over -them -when -they -could -have -been -profitably -employed -in -hunting -smaller -game -under -the -head -of -geometry -one -of -the -answers -is -this -49 -the -whole -bd -= -the -whole -ca -and -so -so -so -so -so -so -so -to -me -this -is -cloudy -but -i -was -never -well -up -in -geometry -that -was -the -only -effort -made -among -the -five -students -who -appeared -for -examination -in -geometry -the -other -four -wailed -and -surrendered -without -a -fight -they -are -piteous -wails -too -wails -of -despair -and -one -of -them -is -an -eloquent -reproach -it -comes -from -a -poor -fellow -who -has -been -laden -beyond -his -strength -by -a -stupid -teacher -and -is -eloquent -in -spite -of -the -poverty -of -its -english -the -poor -chap -finds -himself -required -to -explain -riddles -which -even -sir -isaac -newton -was -not -able -to -understand -50 -oh -my -dear -father -examiner -you -my -father -and -you -kindly -give -a -number -of -pass -you -my -great -father -51 -i -am -a -poor -boy -and -have -no -means -to -support -my -mother -and -two -brothers -who -are -suffering -much -for -want -of -food -i -get -four -rupees -monthly -from -charity -fund -of -this -place -from -which -i -send -two -rupees -for -their -support -and -keep -two -for -my -own -support -father -if -i -relate -the -unlucky -circumstance -under -which -we -are -placed -then -i -think -you -will -not -be -able -to -suppress -the -tender -tear -52 -sir -which -sir -isaac -newton -and -other -experienced -mathematicians -cannot -understand -i -being -third -of -entrance -class -can -understand -these -which -is -too -impossible -to -imagine -and -my -examiner -also -has -put -very -tiresome -and -very -heavy -propositions -to -prove -we -must -remember -that -these -pupils -had -to -do -their -thinking -in -one -language -and -express -themselves -in -another -and -alien -one -it -was -a -heavy -handicap -i -have -by -me -english -as -she -is -taught -a -collection -of -american -examinations -made -in -the -public -schools -of -brooklyn -by -one -of -the -teachers -miss -caroline -b -le -row -an -extract -or -two -from -its -pages -will -show -that -when -the -american -pupil -is -using -but -one -language -and -that -one -his -own -his -performance -is -no -whit -better -than -his -indian -brother's -on -history -christopher -columbus -was -called -the -father -of -his -country -queen -isabella -of -spain -sold -her -watch -and -chain -and -other -millinery -so -that -columbus -could -discover -america -the -indian -wars -were -very -desecrating -to -the -country -the -indians -pursued -their -warfare -by -hiding -in -the -bushes -and -then -scalping -them -captain -john -smith -has -been -styled -the -father -of -his -country -his -life -was -saved -by -his -daughter -pochahantas -the -puritans -found -an -insane -asylum -in -the -wilds -of -america -the -stamp -act -was -to -make -everybody -stamp -all -materials -so -they -should -be -null -and -void -washington -died -in -spain -almost -broken -hearted -his -remains -were -taken -to -the -cathedral -in -havana -gorilla -warfare -was -where -men -rode -on -gorillas -in -brooklyn -as -in -india -they -examine -a -pupil -and -when -they -find -out -he -doesn't -know -anything -they -put -him -into -literature -or -geometry -or -astronomy -or -government -or -something -like -that -so -that -he -can -properly -display -the -assification -of -the -whole -system -on -literature -'bracebridge -hall' -was -written -by -henry -irving -edgar -a -poe -was -a -very -curdling -writer -beowulf -wrote -the -scriptures -ben -johnson -survived -shakespeare -in -some -respects -in -the -'canterbury -tale' -it -gives -account -of -king -alfred -on -his -way -to -the -shrine -of -thomas -bucket -chaucer -was -the -father -of -english -pottery -chaucer -was -succeeded -by -h -wads -longfellow -we -will -finish -with -a -couple -of -samples -of -literature -one -from -america -the -other -from -india -the -first -is -a -brooklyn -public -school -boy's -attempt -to -turn -a -few -verses -of -the -lady -of -the -lake -into -prose -you -will -have -to -concede -that -he -did -it -the -man -who -rode -on -the -horse -performed -the -whip -and -an -instrument -made -of -steel -alone -with -strong -ardor -not -diminishing -for -being -tired -from -the -time -passed -with -hard -labor -overworked -with -anger -and -ignorant -with -weariness -while -every -breath -for -labor -lie -drew -with -cries -full -of -sorrow -the -young -deer -made -imperfect -who -worked -hard -filtered -in -sight -the -following -paragraph -is -from -a -little -book -which -is -famous -in -india -the -biography -of -a -distinguished -hindoo -judge -onoocool -chunder -mookerjee -it -was -written -by -his -nephew -and -is -unintentionally -funny -in -fact -exceedingly -so -i -offer -here -the -closing -scene -if -you -would -like -to -sample -the -rest -of -the -book -it -can -be -had -by -applying -to -the -publishers -messrs -thacker -spink -& -co -calcutta -and -having -said -these -words -he -hermetically -sealed -his -lips -not -to -open -them -again -all -the -well -known -doctors -of -calcutta -that -could -be -procured -for -a -man -of -his -position -and -wealth -were -brought -doctors -payne -fayrer -and -nilmadhub -mookerjee -and -others -they -did -what -they -could -do -with -their -puissance -and -knack -of -medical -knowledge -but -it -proved -after -all -as -if -to -milk -the -ram! -his -wife -and -children -had -not -the -mournful -consolation -to -hear -his -last -words -he -remained -sotto -voce -for -a -few -hours -and -then -was -taken -from -us -at -6 -12 -p -m -according -to -the -caprice -of -god -which -passeth -understanding -chapter -lxii -there -are -no -people -who -are -quite -so -vulgar -as -the -over -refined -ones -pudd'nhead -wilson's -new -calendar -we -sailed -from -calcutta -toward -the -end -of -march -stopped -a -day -at -madras -two -or -three -days -in -ceylon -then -sailed -westward -on -a -long -flight -for -mauritius -from -my -diary -april -7 -we -are -far -abroad -upon -the -smooth -waters -of -the -indian -ocean -now -it -is -shady -and -pleasant -and -peaceful -under -the -vast -spread -of -the -awnings -and -life -is -perfect -again -ideal -the -difference -between -a -river -and -the -sea -is -that -the -river -looks -fluid -the -sea -solid -usually -looks -as -if -you -could -step -out -and -walk -on -it -the -captain -has -this -peculiarity -he -cannot -tell -the -truth -in -a -plausible -way -in -this -he -is -the -very -opposite -of -the -austere -scot -who -sits -midway -of -the -table -he -cannot -tell -a -lie -in -an -unplausible -way -when -the -captain -finishes -a -statement -the -passengers -glance -at -each -other -privately -as -who -should -say -do -you -believe -that -when -the -scot -finishes -one -the -look -says -how -strange -and -interesting -the -whole -secret -is -in -the -manner -and -method -of -the -two -men -the -captain -is -a -little -shy -and -diffident -and -he -states -the -simplest -fact -as -if -he -were -a -little -afraid -of -it -while -the -scot -delivers -himself -of -the -most -abandoned -lie -with -such -an -air -of -stern -veracity -that -one -is -forced -to -believe -it -although -one -knows -it -isn't -so -for -instance -the -scot -told -about -a -pet -flying -fish -he -once -owned -that -lived -in -a -little -fountain -in -his -conservatory -and -supported -itself -by -catching -birds -and -frogs -and -rats -in -the -neighboring -fields -it -was -plain -that -no -one -at -the -table -doubted -this -statement -by -and -by -in -the -course -of -some -talk -about -custom -house -annoyances -the -captain -brought -out -the -following -simple -everyday -incident -but -through -his -infirmity -of -style -managed -to -tell -it -in -such -a -way -that -it -got -no -credence -he -said -i -went -ashore -at -naples -one -voyage -when -i -was -in -that -trade -and -stood -around -helping -my -passengers -for -i -could -speak -a -little -italian -two -or -three -times -at -intervals -the -officer -asked -me -if -i -had -anything -dutiable -about -me -and -seemed -more -and -more -put -out -and -disappointed -every -time -i -told -him -no -finally -a -passenger -whom -i -had -helped -through -asked -me -to -come -out -and -take -something -i -thanked -him -but -excused -myself -saying -i -had -taken -a -whisky -just -before -i -came -ashore -it -was -a -fatal -admission -the -officer -at -once -made -me -pay -sixpence -import -duty -on -the -whisky -just -from -ship -to -shore -you -see -and -he -fined -me -l5 -for -not -declaring -the -goods -another -l5 -for -falsely -denying -that -i -had -anything -dutiable -about -me -also -l5 -for -concealing -the -goods -and -l50 -for -smuggling -which -is -the -maximum -penalty -for -unlawfully -bringing -in -goods -under -the -value -of -sevenpence -ha'penny -altogether -sixty -five -pounds -sixpence -for -a -little -thing -like -that -the -scot -is -always -believed -yet -he -never -tells -anything -but -lies -whereas -the -captain -is -never -believed -although -he -never -tells -a -lie -so -far -as -i -can -judge -if -he -should -say -his -uncle -was -a -male -person -he -would -probably -say -it -in -such -a -way -that -nobody -would -believe -it -at -the -same -time -the -scot -could -claim -that -he -had -a -female -uncle -and -not -stir -a -doubt -in -anybody's -mind -my -own -luck -has -been -curious -all -my -literary -life -i -never -could -tell -a -lie -that -anybody -would -doubt -nor -a -truth -that -anybody -would -believe -lots -of -pets -on -board -birds -and -things -in -these -far -countries -the -white -people -do -seem -to -run -remarkably -to -pets -our -host -in -cawnpore -had -a -fine -collection -of -birds -the -finest -we -saw -in -a -private -house -in -india -and -in -colombo -dr -murray's -great -compound -and -commodious -bungalow -were -well -populated -with -domesticated -company -from -the -woods -frisky -little -squirrels -a -ceylon -mina -walking -sociably -about -the -house -a -small -green -parrot -that -whistled -a -single -urgent -note -of -call -without -motion -of -its -beak -also -chuckled -a -monkey -in -a -cage -on -the -back -veranda -and -some -more -out -in -the -trees -also -a -number -of -beautiful -macaws -in -the -trees -and -various -and -sundry -birds -and -animals -of -breeds -not -known -to -me -but -no -cat -yet -a -cat -would -have -liked -that -place -april -9 -tea -planting -is -the -great -business -in -ceylon -now -a -passenger -says -it -often -pays -40 -per -cent -on -the -investment -says -there -is -a -boom -april -10 -the -sea -is -a -mediterranean -blue -and -i -believe -that -that -is -about -the -divinest -color -known -to -nature -it -is -strange -and -fine -nature's -lavish -generosities -to -her -creatures -at -least -to -all -of -them -except -man -for -those -that -fly -she -has -provided -a -home -that -is -nobly -spacious -a -home -which -is -forty -miles -deep -and -envelops -the -whole -globe -and -has -not -an -obstruction -in -it -for -those -that -swim -she -has -provided -a -more -than -imperial -domain -a -domain -which -is -miles -deep -and -covers -four -fifths -of -the -globe -but -as -for -man -she -has -cut -him -off -with -the -mere -odds -and -ends -of -the -creation -she -has -given -him -the -thin -skin -the -meagre -skin -which -is -stretched -over -the -remaining -one -fifth -the -naked -bones -stick -up -through -it -in -most -places -on -the -one -half -of -this -domain -he -can -raise -snow -ice -sand -rocks -and -nothing -else -so -the -valuable -part -of -his -inheritance -really -consists -of -but -a -single -fifth -of -the -family -estate -and -out -of -it -he -has -to -grub -hard -to -get -enough -to -keep -him -alive -and -provide -kings -and -soldiers -and -powder -to -extend -the -blessings -of -civilization -with -yet -man -in -his -simplicity -and -complacency -and -inability -to -cipher -thinks -nature -regards -him -as -the -important -member -of -the -family -in -fact -her -favorite -surely -it -must -occur -to -even -his -dull -head -sometimes -that -she -has -a -curious -way -of -showing -it -afternoon -the -captain -has -been -telling -how -in -one -of -his -arctic -voyages -it -was -so -cold -that -the -mate's -shadow -froze -fast -to -the -deck -and -had -to -be -ripped -loose -by -main -strength -and -even -then -he -got -only -about -two -thirds -of -it -back -nobody -said -anything -and -the -captain -went -away -i -think -he -is -becoming -disheartened -also -to -be -fair -there -is -another -word -of -praise -due -to -this -ship's -library -it -contains -no -copy -of -the -vicar -of -wakefield -that -strange -menagerie -of -complacent -hypocrites -and -idiots -of -theatrical -cheap -john -heroes -and -heroines -who -are -always -showing -off -of -bad -people -who -are -not -interesting -and -good -people -who -are -fatiguing -a -singular -book -not -a -sincere -line -in -it -and -not -a -character -that -invites -respect -a -book -which -is -one -long -waste -pipe -discharge -of -goody -goody -puerilities -and -dreary -moralities -a -book -which -is -full -of -pathos -which -revolts -and -humor -which -grieves -the -heart -there -are -few -things -in -literature -that -are -more -piteous -more -pathetic -than -the -celebrated -humorous -incident -of -moses -and -the -spectacles -jane -austen's -books -too -are -absent -from -this -library -just -that -one -omission -alone -would -make -a -fairly -good -library -out -of -a -library -that -hadn't -a -book -in -it -customs -in -tropic -seas -at -5 -in -the -morning -they -pipe -to -wash -down -the -decks -and -at -once -the -ladies -who -are -sleeping -there -turn -out -and -they -and -their -beds -go -below -then -one -after -another -the -men -come -up -from -the -bath -in -their -pyjamas -and -walk -the -decks -an -hour -or -two -with -bare -legs -and -bare -feet -coffee -and -fruit -served -the -ship -cat -and -her -kitten -now -appear -and -get -about -their -toilets -next -the -barber -comes -and -flays -us -on -the -breezy -deck -breakfast -at -9 -30 -and -the -day -begins -i -do -not -know -how -a -day -could -be -more -reposeful -no -motion -a -level -blue -sea -nothing -in -sight -from -horizon -to -horizon -the -speed -of -the -ship -furnishes -a -cooling -breeze -there -is -no -mail -to -read -and -answer -no -newspapers -to -excite -you -no -telegrams -to -fret -you -or -fright -you -the -world -is -far -far -away -it -has -ceased -to -exist -for -you -seemed -a -fading -dream -along -in -the -first -days -has -dissolved -to -an -unreality -now -it -is -gone -from -your -mind -with -all -its -businesses -and -ambitions -its -prosperities -and -disasters -its -exultations -and -despairs -its -joys -and -griefs -and -cares -and -worries -they -are -no -concern -of -yours -any -more -they -have -gone -out -of -your -life -they -are -a -storm -which -has -passed -and -left -a -deep -calm -behind -the -people -group -themselves -about -the -decks -in -their -snowy -white -linen -and -read -smoke -sew -play -cards -talk -nap -and -so -on -in -other -ships -the -passengers -are -always -ciphering -about -when -they -are -going -to -arrive -out -in -these -seas -it -is -rare -very -rare -to -hear -that -subject -broached -in -other -ships -there -is -always -an -eager -rush -to -the -bulletin -board -at -noon -to -find -out -what -the -run -has -been -in -these -seas -the -bulletin -seems -to -attract -no -interest -i -have -seen -no -one -visit -it -in -thirteen -days -i -have -visited -it -only -once -then -i -happened -to -notice -the -figures -of -the -day's -run -on -that -day -there -happened -to -be -talk -at -dinner -about -the -speed -of -modern -ships -i -was -the -only -passenger -present -who -knew -this -ship's -gait -necessarily -the -atlantic -custom -of -betting -on -the -ship's -run -is -not -a -custom -here -nobody -ever -mentions -it -i -myself -am -wholly -indifferent -as -to -when -we -are -going -to -get -in -if -any -one -else -feels -interested -in -the -matter -he -has -not -indicated -it -in -my -hearing -if -i -had -my -way -we -should -never -get -in -at -all -this -sort -of -sea -life -is -charged -with -an -indestructible -charm -there -is -no -weariness -no -fatigue -no -worry -no -responsibility -no -work -no -depression -of -spirits -there -is -nothing -like -this -serenity -this -comfort -this -peace -this -deep -contentment -to -be -found -anywhere -on -land -if -i -had -my -way -i -would -sail -on -for -ever -and -never -go -to -live -on -the -solid -ground -again -one -of -kipling's -ballads -has -delivered -the -aspect -and -sentiment -of -this -bewitching -sea -correctly -the -injian -ocean -sets -an' -smiles -so -sof' -so -bright -so -bloomin' -blue -there -aren't -a -wave -for -miles -an' -miles -excep' -the -jiggle -from -the -screw -april -14 -it -turns -out -that -the -astronomical -apprentice -worked -off -a -section -of -the -milky -way -on -me -for -the -magellan -clouds -a -man -of -more -experience -in -the -business -showed -one -of -them -to -me -last -night -it -was -small -and -faint -and -delicate -and -looked -like -the -ghost -of -a -bunch -of -white -smoke -left -floating -in -the -sky -by -an -exploded -bombshell -wednesday -april -15 -mauritius -arrived -and -anchored -off -port -louis -2 -a -m -rugged -clusters -of -crags -and -peaks -green -to -their -summits -from -their -bases -to -the -sea -a -green -plain -with -just -tilt -enough -to -it -to -make -the -water -drain -off -i -believe -it -is -in -56 -e -and -22 -s -a -hot -tropical -country -the -green -plain -has -an -inviting -look -has -scattering -dwellings -nestling -among -the -greenery -scene -of -the -sentimental -adventure -of -paul -and -virginia -island -under -french -control -which -means -a -community -which -depends -upon -quarantines -not -sanitation -for -its -health -thursday -april -16 -went -ashore -in -the -forenoon -at -port -louis -a -little -town -but -with -the -largest -variety -of -nationalities -and -complexions -we -have -encountered -yet -french -english -chinese -arabs -africans -with -wool -blacks -with -straight -hair -east -indians -half -whites -quadroons -and -great -varieties -in -costumes -and -colors -took -the -train -for -curepipe -at -1 -30 -two -hours' -run -gradually -uphill -what -a -contrast -this -frantic -luxuriance -of -vegetation -with -the -arid -plains -of -india -these -architecturally -picturesque -crags -and -knobs -and -miniature -mountains -with -the -monotony -of -the -indian -dead -levels -a -native -pointed -out -a -handsome -swarthy -man -of -grave -and -dignified -bearing -and -said -in -an -awed -tone -that -is -so -and -so -has -held -office -of -one -sort -or -another -under -this -government -for -37 -years -he -is -known -all -over -this -whole -island -and -in -the -other -countries -of -the -world -perhaps -who -knows -one -thing -is -certain -you -can -speak -his -name -anywhere -in -this -whole -island -and -you -will -find -not -one -grown -person -that -has -not -heard -it -it -is -a -wonderful -thing -to -be -so -celebrated -yet -look -at -him -it -makes -no -change -in -him -he -does -not -even -seem -to -know -it -curepipe -means -pincushion -or -pegtown -probably -sixteen -miles -two -hours -by -rail -from -port -louis -at -each -end -of -every -roof -and -on -the -apex -of -every -dormer -window -a -wooden -peg -two -feet -high -stands -up -in -some -cases -its -top -is -blunt -in -others -the -peg -is -sharp -and -looks -like -a -toothpick -the -passion -for -this -humble -ornament -is -universal -apparently -there -has -been -only -one -prominent -event -in -the -history -of -mauritius -and -that -one -didn't -happen -i -refer -to -the -romantic -sojourn -of -paul -and -virginia -here -it -was -that -story -that -made -mauritius -known -to -the -world -made -the -name -familiar -to -everybody -the -geographical -position -of -it -to -nobody -a -clergyman -was -asked -to -guess -what -was -in -a -box -on -a -table -it -was -a -vellum -fan -painted -with -the -shipwreck -and -was -one -of -virginia's -wedding -gifts -april -18 -this -is -the -only -country -in -the -world -where -the -stranger -is -not -asked -how -do -you -like -this -place -this -is -indeed -a -large -distinction -here -the -citizen -does -the -talking -about -the -country -himself -the -stranger -is -not -asked -to -help -you -get -all -sorts -of -information -from -one -citizen -you -gather -the -idea -that -mauritius -was -made -first -and -then -heaven -and -that -heaven -was -copied -after -mauritius -another -one -tells -you -that -this -is -an -exaggeration -that -the -two -chief -villages -port -louis -and -curepipe -fall -short -of -heavenly -perfection -that -nobody -lives -in -port -louis -except -upon -compulsion -and -that -curepipe -is -the -wettest -and -rainiest -place -in -the -world -an -english -citizen -said -in -the -early -part -of -this -century -mauritius -was -used -by -the -french -as -a -basis -from -which -to -operate -against -england's -indian -merchantmen -so -england -captured -the -island -and -also -the -neighbor -bourbon -to -stop -that -annoyance -england -gave -bourbon -back -the -government -in -london -did -not -want -any -more -possessions -in -the -west -indies -if -the -government -had -had -a -better -quality -of -geography -in -stock -it -would -not -have -wasted -bourbon -in -that -foolish -way -a -big -war -will -temporarily -shut -up -the -suez -canal -some -day -and -the -english -ships -will -have -to -go -to -india -around -the -cape -of -good -hope -again -then -england -will -have -to -have -bourbon -and -will -take -it -mauritius -was -a -crown -colony -until -20 -years -ago -with -a -governor -appointed -by -the -crown -and -assisted -by -a -council -appointed -by -himself -but -pope -hennessey -came -out -as -governor -then -and -he -worked -hard -to -get -a -part -of -the -council -made -elective -and -succeeded -so -now -the -whole -council -is -french -and -in -all -ordinary -matters -of -legislation -they -vote -together -and -in -the -french -interest -not -the -english -the -english -population -is -very -slender -it -has -not -votes -enough -to -elect -a -legislator -half -a -dozen -rich -french -families -elect -the -legislature -pope -hennessey -was -an -irishman -a -catholic -a -home -ruler -m -p -a -hater -of -england -and -the -english -a -very -troublesome -person -and -a -serious -incumbrance -at -westminster -so -it -was -decided -to -send -him -out -to -govern -unhealthy -countries -in -hope -that -something -would -happen -to -him -but -nothing -did -the -first -experiment -was -not -merely -a -failure -it -was -more -than -a -failure -he -proved -to -be -more -of -a -disease -himself -than -any -he -was -sent -to -encounter -the -next -experiment -was -here -the -dark -scheme -failed -again -it -was -an -off -season -and -there -was -nothing -but -measles -here -at -the -time -pope -hennessey's -health -was -not -affected -he -worked -with -the -french -and -for -the -french -and -against -the -english -and -he -made -the -english -very -tired -and -the -french -very -happy -and -lived -to -have -the -joy -of -seeing -the -flag -he -served -publicly -hissed -his -memory -is -held -in -worshipful -reverence -and -affection -by -the -french -it -is -a -land -of -extraordinary -quarantines -they -quarantine -a -ship -for -anything -or -for -nothing -quarantine -her -for -20 -and -even -30 -days -they -once -quarantined -a -ship -because -her -captain -had -had -the -smallpox -when -he -was -a -boy -that -and -because -he -was -english -the -population -is -very -small -small -to -insignificance -the -majority -is -east -indian -then -mongrels -then -negroes -descendants -of -the -slaves -of -the -french -times -then -french -then -english -there -was -an -american -but -he -is -dead -or -mislaid -the -mongrels -are -the -result -of -all -kinds -of -mixtures -black -and -white -mulatto -and -white -quadroon -and -white -octoroon -and -white -and -so -there -is -every -shade -of -complexion -ebony -old -mahogany -horsechestnut -sorrel -molasses -candy -clouded -amber -clear -amber -old -ivory -white -new -ivory -white -fish -belly -white -this -latter -the -leprous -complexion -frequent -with -the -anglo -saxon -long -resident -in -tropical -climates -you -wouldn't -expect -a -person -to -be -proud -of -being -a -mauritian -now -would -you -but -it -is -so -the -most -of -them -have -never -been -out -of -the -island -and -haven't -read -much -or -studied -much -and -they -think -the -world -consists -of -three -principal -countries -judaea -france -and -mauritius -so -they -are -very -proud -of -belonging -to -one -of -the -three -grand -divisions -of -the -globe -they -think -that -russia -and -germany -are -in -england -and -that -england -does -not -amount -to -much -they -have -heard -vaguely -about -the -united -states -and -the -equator -but -they -think -both -of -them -are -monarchies -they -think -mount -peter -botte -is -the -highest -mountain -in -the -world -and -if -you -show -one -of -them -a -picture -of -milan -cathedral -he -will -swell -up -with -satisfaction -and -say -that -the -idea -of -that -jungle -of -spires -was -stolen -from -the -forest -of -peg -tops -and -toothpicks -that -makes -the -roofs -of -curepipe -look -so -fine -and -prickly -there -is -not -much -trade -in -books -the -newspapers -educate -and -entertain -the -people -mainly -the -latter -they -have -two -pages -of -large -print -reading -matter -one -of -them -english -the -other -french -the -english -page -is -a -translation -of -the -french -one -the -typography -is -super -extra -primitive -in -this -quality -it -has -not -its -equal -anywhere -there -is -no -proof -reader -now -he -is -dead -where -do -they -get -matter -to -fill -up -a -page -in -this -little -island -lost -in -the -wastes -of -the -indian -ocean -oh -madagascar -they -discuss -madagascar -and -france -that -is -the -bulk -then -they -chock -up -the -rest -with -advice -to -the -government -also -slurs -upon -the -english -administration -the -papers -are -all -owned -and -edited -by -creoles -french -the -language -of -the -country -is -french -everybody -speaks -it -has -to -you -have -to -know -french -particularly -mongrel -french -the -patois -spoken -by -tom -dick -and -harry -of -the -multiform -complexions -or -you -can't -get -along -this -was -a -flourishing -country -in -former -days -for -it -made -then -and -still -makes -the -best -sugar -in -the -world -but -first -the -suez -canal -severed -it -from -the -world -and -left -it -out -in -the -cold -and -next -the -beetroot -sugar -helped -by -bounties -captured -the -european -markets -sugar -is -the -life -of -mauritius -and -it -is -losing -its -grip -its -downward -course -was -checked -by -the -depreciation -of -the -rupee -for -the -planter -pays -wages -in -rupees -but -sells -his -crop -for -gold -and -the -insurrection -in -cuba -and -paralyzation -of -the -sugar -industry -there -have -given -our -prices -here -a -life -saving -lift -but -the -outlook -has -nothing -permanently -favorable -about -it -it -takes -a -year -to -mature -the -canes -on -the -high -ground -three -and -six -months -longer -and -there -is -always -a -chance -that -the -annual -cyclone -will -rip -the -profit -out -of -the -crop -in -recent -times -a -cyclone -took -the -whole -crop -as -you -may -say -and -the -island -never -saw -a -finer -one -some -of -the -noblest -sugar -estates -in -the -island -are -in -deep -difficulties -a -dozen -of -them -are -investments -of -english -capital -and -the -companies -that -own -them -are -at -work -now -trying -to -settle -up -and -get -out -with -a -saving -of -half -the -money -they -put -in -you -know -in -these -days -when -a -country -begins -to -introduce -the -tea -culture -it -means -that -its -own -specialty -has -gone -back -on -it -look -at -bengal -look -at -ceylon -well -they've -begun -to -introduce -the -tea -culture -here -many -copies -of -paul -and -virginia -are -sold -every -year -in -mauritius -no -other -book -is -so -popular -here -except -the -bible -by -many -it -is -supposed -to -be -a -part -of -the -bible -all -the -missionaries -work -up -their -french -on -it -when -they -come -here -to -pervert -the -catholic -mongrel -it -is -the -greatest -story -that -was -ever -written -about -mauritius -and -the -only -one -chapter -lxiii -the -principal -difference -between -a -cat -and -a -lie -is -that -the -cat -has -only -nine -lives -pudd'nhead -wilson's -new -calendar -april -20 -the -cyclone -of -1892 -killed -and -crippled -hundreds -of -people -it -was -accompanied -by -a -deluge -of -rain -which -drowned -port -louis -and -produced -a -water -famine -quite -true -for -it -burst -the -reservoir -and -the -water -pipes -and -for -a -time -after -the -flood -had -disappeared -there -was -much -distress -from -want -of -water -this -is -the -only -place -in -the -world -where -no -breed -of -matches -can -stand -the -damp -only -one -match -in -16 -will -light -the -roads -are -hard -and -smooth -some -of -the -compounds -are -spacious -some -of -the -bungalows -commodious -and -the -roadways -are -walled -by -tall -bamboo -hedges -trim -and -green -and -beautiful -and -there -are -azalea -hedges -too -both -the -white -and -the -red -i -never -saw -that -before -as -to -healthiness -i -translate -from -to -day's -april -20 -merchants' -and -planters' -gazette -from -the -article -of -a -regular -contributor -carminge -concerning -the -death -of -the -nephew -of -a -prominent -citizen -sad -and -lugubrious -existence -this -which -we -lead -in -mauritius -i -believe -there -is -no -other -country -in -the -world -where -one -dies -more -easily -than -among -us -the -least -indisposition -becomes -a -mortal -malady -a -simple -headache -develops -into -meningitis -a -cold -into -pneumonia -and -presently -when -we -are -least -expecting -it -death -is -a -guest -in -our -home -this -daily -paper -has -a -meteorological -report -which -tells -you -what -the -weather -was -day -before -yesterday -one -is -clever -pestered -by -a -beggar -or -a -peddler -in -this -town -so -far -as -i -can -see -this -is -pleasantly -different -from -india -april -22 -to -such -as -believe -that -the -quaint -product -called -french -civilization -would -be -an -improvement -upon -the -civilization -of -new -guinea -and -the -like -the -snatching -of -madagascar -and -the -laying -on -of -french -civilization -there -will -be -fully -justified -but -why -did -the -english -allow -the -french -to -have -madagascar -did -she -respect -a -theft -of -a -couple -of -centuries -ago -dear -me -robbery -by -european -nations -of -each -other's -territories -has -never -been -a -sin -is -not -a -sin -to -day -to -the -several -cabinets -the -several -political -establishments -of -the -world -are -clotheslines -and -a -large -part -of -the -official -duty -of -these -cabinets -is -to -keep -an -eye -on -each -other's -wash -and -grab -what -they -can -of -it -as -opportunity -offers -all -the -territorial -possessions -of -all -the -political -establishments -in -the -earth -including -america -of -course -consist -of -pilferings -from -other -people's -wash -no -tribe -howsoever -insignificant -and -no -nation -howsoever -mighty -occupies -a -foot -of -land -that -was -not -stolen -when -the -english -the -french -and -the -spaniards -reached -america -the -indian -tribes -had -been -raiding -each -other's -territorial -clothes -lines -for -ages -and -every -acre -of -ground -in -the -continent -had -been -stolen -and -re -stolen -500 -times -the -english -the -french -and -the -spaniards -went -to -work -and -stole -it -all -over -again -and -when -that -was -satisfactorily -accomplished -they -went -diligently -to -work -and -stole -it -from -each -other -in -europe -and -asia -and -africa -every -acre -of -ground -has -been -stolen -several -millions -of -times -a -crime -persevered -in -a -thousand -centuries -ceases -to -be -a -crime -and -becomes -a -virtue -this -is -the -law -of -custom -and -custom -supersedes -all -other -forms -of -law -christian -governments -are -as -frank -to -day -as -open -and -above -board -in -discussing -projects -for -raiding -each -other's -clothes -lines -as -ever -they -were -before -the -golden -rule -came -smiling -into -this -inhospitable -world -and -couldn't -get -a -night's -lodging -anywhere -in -150 -years -england -has -beneficently -retired -garment -after -garment -from -the -indian -lines -until -there -is -hardly -a -rag -of -the -original -wash -left -dangling -anywhere -in -800 -years -an -obscure -tribe -of -muscovite -savages -has -risen -to -the -dazzling -position -of -land -robber -in -chief -she -found -a -quarter -of -the -world -hanging -out -to -dry -on -a -hundred -parallels -of -latitude -and -she -scooped -in -the -whole -wash -she -keeps -a -sharp -eye -on -a -multitude -of -little -lines -that -stretch -along -the -northern -boundaries -of -india -and -every -now -and -then -she -snatches -a -hip -rag -or -a -pair -of -pyjamas -it -is -england's -prospective -property -and -russia -knows -it -but -russia -cares -nothing -for -that -in -fact -in -our -day -land -robbery -claim -jumping -is -become -a -european -governmental -frenzy -some -have -been -hard -at -it -in -the -borders -of -china -in -burma -in -siam -and -the -islands -of -the -sea -and -all -have -been -at -it -in -africa -africa -has -been -as -coolly -divided -up -and -portioned -out -among -the -gang -as -if -they -had -bought -it -and -paid -for -it -and -now -straightway -they -are -beginning -the -old -game -again -to -steal -each -other's -grabbings -germany -found -a -vast -slice -of -central -africa -with -the -english -flag -and -the -english -missionary -and -the -english -trader -scattered -all -over -it -but -with -certain -formalities -neglected -no -signs -up -keep -off -the -grass -trespassers -forbidden -etc -and -she -stepped -in -with -a -cold -calm -smile -and -put -up -the -signs -herself -and -swept -those -english -pioneers -promptly -out -of -the -country -there -is -a -tremendous -point -there -it -can -be -put -into -the -form -of -a -maxim -get -your -formalities -right -never -mind -about -the -moralities -it -was -an -impudent -thing -but -england -had -to -put -up -with -it -now -in -the -case -of -madagascar -the -formalities -had -originally -been -observed -but -by -neglect -they -had -fallen -into -desuetude -ages -ago -england -should -have -snatched -madagascar -from -the -french -clothes -line -without -an -effort -she -could -have -saved -those -harmless -natives -from -the -calamity -of -french -civilization -and -she -did -not -do -it -now -it -is -too -late -the -signs -of -the -times -show -plainly -enough -what -is -going -to -happen -all -the -savage -lands -in -the -world -are -going -to -be -brought -under -subjection -to -the -christian -governments -of -europe -i -am -not -sorry -but -glad -this -coming -fate -might -have -been -a -calamity -to -those -savage -peoples -two -hundred -years -ago -but -now -it -will -in -some -cases -be -a -benefaction -the -sooner -the -seizure -is -consummated -the -better -for -the -savages -the -dreary -and -dragging -ages -of -bloodshed -and -disorder -and -oppression -will -give -place -to -peace -and -order -and -the -reign -of -law -when -one -considers -what -india -was -under -her -hindoo -and -mohammedan -rulers -and -what -she -is -now -when -he -remembers -the -miseries -of -her -millions -then -and -the -protections -and -humanities -which -they -enjoy -now -he -must -concede -that -the -most -fortunate -thing -that -has -ever -befallen -that -empire -was -the -establishment -of -british -supremacy -there -the -savage -lands -of -the -world -are -to -pass -to -alien -possession -their -peoples -to -the -mercies -of -alien -rulers -let -us -hope -and -believe -that -they -will -all -benefit -by -the -change -april -23 -the -first -year -they -gather -shells -the -second -year -they -gather -shells -and -drink -the -third -year -they -do -not -gather -shells -said -of -immigrants -to -mauritius -population -375 -000 -120 -sugar -factories -population -1851 -185 -000 -the -increase -is -due -mainly -to -the -introduction -of -indian -coolies -they -now -apparently -form -the -great -majority -of -the -population -they -are -admirable -breeders -their -homes -are -always -hazy -with -children -great -savers -of -money -a -british -officer -told -me -that -in -india -he -paid -his -servant -10 -rupees -a -month -and -he -had -11 -cousins -uncles -parents -etc -dependent -upon -him -and -he -supported -them -on -his -wages -these -thrifty -coolies -are -said -to -be -acquiring -land -a -trifle -at -a -time -and -cultivating -it -and -may -own -the -island -by -and -by -the -indian -women -do -very -hard -labor -[for -wages -of -1/2 -rupee -for -twelve -hours' -work -] -they -carry -mats -of -sugar -on -their -heads -70 -pounds -all -day -lading -ships -for -half -a -rupee -and -work -at -gardening -all -day -for -less -the -camaron -is -a -fresh -water -creature -like -a -cray -fish -it -is -regarded -here -as -the -world's -chiefest -delicacy -and -certainly -it -is -good -guards -patrol -the -streams -to -prevent -poaching -it -a -fine -of -rs -200 -or -300 -they -say -for -poaching -bait -is -thrown -in -the -water -the -camaron -goes -for -it -the -fisher -drops -his -loop -in -and -works -it -around -and -about -the -camaron -he -has -selected -till -he -gets -it -over -its -tail -then -there's -a -jerk -or -something -to -certify -the -camaron -that -it -is -his -turn -now -he -suddenly -backs -away -which -moves -the -loop -still -further -up -his -person -and -draws -it -taut -and -his -days -are -ended -another -dish -called -palmiste -is -like -raw -turnip -shavings -and -tastes -like -green -almonds -is -very -delicate -and -good -costs -the -life -of -a -palm -tree -12 -to -20 -years -old -for -it -is -the -pith -another -dish -looks -like -greens -or -a -tangle -of -fine -seaweed -is -a -preparation -of -the -deadly -nightshade -good -enough -the -monkeys -live -in -the -dense -forests -on -the -flanks -of -the -toy -mountains -and -they -flock -down -nights -and -raid -the -sugar -fields -also -on -other -estates -they -come -down -and -destroy -a -sort -of -bean -crop -just -for -fun -apparently -tear -off -the -pods -and -throw -them -down -the -cyclone -of -1892 -tore -down -two -great -blocks -of -stone -buildings -in -the -center -of -port -louis -the -chief -architectural -feature -and -left -the -uncomely -and -apparently -frail -blocks -standing -everywhere -in -its -track -it -annihilated -houses -tore -off -roofs -destroyed -trees -and -crops -the -men -were -in -the -towns -the -women -and -children -at -home -in -the -country -getting -crippled -killed -frightened -to -insanity -and -the -rain -deluging -them -the -wind -howling -the -thunder -crashing -the -lightning -glaring -this -for -an -hour -or -so -then -a -lull -and -sunshine -many -ventured -out -of -safe -shelter -then -suddenly -here -it -came -again -from -the -opposite -point -and -renewed -and -completed -the -devastation -it -is -said -the -chinese -fed -the -sufferers -for -days -on -free -rice -whole -streets -in -port -louis -were -laid -flat -wrecked -during -a -minute -and -a -half -the -wind -blew -123 -miles -an -hour -no -official -record -made -after -that -when -it -may -have -reached -150 -it -cut -down -an -obelisk -it -carried -an -american -ship -into -the -woods -after -breaking -the -chains -of -two -anchors -they -now -use -four -two -forward -two -astern -common -report -says -it -killed -1 -200 -in -port -louis -alone -in -half -an -hour -then -came -the -lull -of -the -central -calm -people -did -not -know -the -barometer -was -still -going -down -then -suddenly -all -perdition -broke -loose -again -while -people -were -rushing -around -seeking -friends -and -rescuing -the -wounded -the -noise -was -comparable -to -nothing -there -is -nothing -resembling -it -but -thunder -and -cannon -and -these -are -feeble -in -comparison -what -there -is -of -mauritius -is -beautiful -you -have -undulating -wide -expanses -of -sugar -cane -a -fine -fresh -green -and -very -pleasant -to -the -eye -and -everywhere -else -you -have -a -ragged -luxuriance -of -tropic -vegetation -of -vivid -greens -of -varying -shades -a -wild -tangle -of -underbrush -with -graceful -tall -palms -lifting -their -crippled -plumes -high -above -it -and -you -have -stretches -of -shady -dense -forest -with -limpid -streams -frolicking -through -them -continually -glimpsed -and -lost -and -glimpsed -again -in -the -pleasantest -hide -and -seek -fashion -and -you -have -some -tiny -mountains -some -quaint -and -picturesque -groups -of -toy -peaks -and -a -dainty -little -vest -pocket -matterhorn -and -here -and -there -and -now -and -then -a -strip -of -sea -with -a -white -ruffle -of -surf -breaks -into -the -view -that -is -mauritius -and -pretty -enough -the -details -are -few -the -massed -result -is -charming -but -not -imposing -not -riotous -not -exciting -it -is -a -sunday -landscape -perspective -and -the -enchantments -wrought -by -distance -are -wanting -there -are -no -distances -there -is -no -perspective -so -to -speak -fifteen -miles -as -the -crow -flies -is -the -usual -limit -of -vision -mauritius -is -a -garden -and -a -park -combined -it -affects -one's -emotions -as -parks -and -gardens -affect -them -the -surfaces -of -one's -spiritual -deeps -are -pleasantly -played -upon -the -deeps -themselves -are -not -reached -not -stirred -spaciousness -remote -altitudes -the -sense -of -mystery -which -haunts -apparently -inaccessible -mountain -domes -and -summits -reposing -in -the -sky -these -are -the -things -which -exalt -the -spirit -and -move -it -to -see -visions -and -dream -dreams -the -sandwich -islands -remain -my -ideal -of -the -perfect -thing -in -the -matter -of -tropical -islands -i -would -add -another -story -to -mauna -loa's -16 -000 -feet -if -i -could -and -make -it -particularly -bold -and -steep -and -craggy -and -forbidding -and -snowy -and -i -would -make -the -volcano -spout -its -lava -floods -out -of -its -summit -instead -of -its -sides -but -aside -from -these -non -essentials -i -have -no -corrections -to -suggest -i -hope -these -will -be -attended -to -i -do -not -wish -to -have -to -speak -of -it -again -chapter -lxiv -when -your -watch -gets -out -of -order -you -have -choice -of -two -things -to -do -throw -it -in -the -fire -or -take -it -to -the -watch -tinker -the -former -is -the -quickest -pudd'nhead -wilson's -new -calendar -the -arundel -castle -is -the -finest -boat -i -have -seen -in -these -seas -she -is -thoroughly -modern -and -that -statement -covers -a -great -deal -of -ground -she -has -the -usual -defect -the -common -defect -the -universal -defect -the -defect -that -has -never -been -missing -from -any -ship -that -ever -sailed -she -has -imperfect -beds -many -ships -have -good -beds -but -no -ship -has -very -good -ones -in -the -matter -of -beds -all -ships -have -been -badly -edited -ignorantly -edited -from -the -beginning -the -selection -of -the -beds -is -given -to -some -hearty -strong -backed -self -made -man -when -it -ought -to -be -given -to -a -frail -woman -accustomed -from -girlhood -to -backaches -and -insomnia -nothing -is -so -rare -on -either -side -of -the -ocean -as -a -perfect -bed -nothing -is -so -difficult -to -make -some -of -the -hotels -on -both -sides -provide -it -but -no -ship -ever -does -or -ever -did -in -noah's -ark -the -beds -were -simply -scandalous -noah -set -the -fashion -and -it -will -endure -in -one -degree -of -modification -or -another -till -the -next -flood -8 -a -m -passing -isle -de -bourbon -broken -up -sky -line -of -volcanic -mountains -in -the -middle -surely -it -would -not -cost -much -to -repair -them -and -it -seems -inexcusable -neglect -to -leave -them -as -they -are -it -seems -stupid -to -send -tired -men -to -europe -to -rest -it -is -no -proper -rest -for -the -mind -to -clatter -from -town -to -town -in -the -dust -and -cinders -and -examine -galleries -and -architecture -and -be -always -meeting -people -and -lunching -and -teaing -and -dining -and -receiving -worrying -cables -and -letters -and -a -sea -voyage -on -the -atlantic -is -of -no -use -voyage -too -short -sea -too -rough -the -peaceful -indian -and -pacific -oceans -and -the -long -stretches -of -time -are -the -healing -thing -may -2 -am -a -fair -great -ship -in -sight -almost -the -first -we -have -seen -in -these -weeks -of -lonely -voyaging -we -are -now -in -the -mozambique -channel -between -madagascar -and -south -africa -sailing -straight -west -for -delagoa -bay -last -night -the -burly -chief -engineer -middle -aged -was -standing -telling -a -spirited -seafaring -tale -and -had -reached -the -most -exciting -place -where -a -man -overboard -was -washing -swiftly -astern -on -the -great -seas -and -uplifting -despairing -cries -everybody -racing -aft -in -a -frenzy -of -excitement -and -fading -hope -when -the -band -which -had -been -silent -a -moment -began -impressively -its -closing -piece -the -english -national -anthem -as -simply -as -if -he -was -unconscious -of -what -he -was -doing -he -stopped -his -story -uncovered -laid -his -laced -cap -against -his -breast -and -slightly -bent -his -grizzled -head -the -few -bars -finished -he -put -on -his -cap -and -took -up -his -tale -again -as -naturally -as -if -that -interjection -of -music -had -been -a -part -of -it -there -was -something -touching -and -fine -about -it -and -it -was -moving -to -reflect -that -he -was -one -of -a -myriad -scattered -over -every -part -of -the -globe -who -by -turn -was -doing -as -he -was -doing -every -hour -of -the -twenty -four -those -awake -doing -it -while -the -others -slept -those -impressive -bars -forever -floating -up -out -of -the -various -climes -never -silent -and -never -lacking -reverent -listeners -all -that -i -remember -about -madagascar -is -that -thackeray's -little -billie -went -up -to -the -top -of -the -mast -and -there -knelt -him -upon -his -knee -saying -i -see -jerusalem -and -madagascar -and -north -and -south -amerikee -may -3 -sunday -fifteen -or -twenty -africanders -who -will -end -their -voyage -to -day -and -strike -for -their -several -homes -from -delagoa -bay -to -morrow -sat -up -singing -on -the -afterdeck -in -the -moonlight -till -3 -a -m -good -fun -and -wholesome -and -the -songs -were -clean -songs -and -some -of -them -were -hallowed -by -tender -associations -finally -in -a -pause -a -man -asked -have -you -heard -about -the -fellow -that -kept -a -diary -crossing -the -atlantic -it -was -a -discord -a -wet -blanket -the -men -were -not -in -the -mood -for -humorous -dirt -the -songs -had -carried -them -to -their -homes -and -in -spirit -they -sat -by -those -far -hearthstones -and -saw -faces -and -heard -voices -other -than -those -that -were -about -them -and -so -this -disposition -to -drag -in -an -old -indecent -anecdote -got -no -welcome -nobody -answered -the -poor -man -hadn't -wit -enough -to -see -that -he -had -blundered -but -asked -his -question -again -again -there -was -no -response -it -was -embarrassing -for -him -in -his -confusion -he -chose -the -wrong -course -did -the -wrong -thing -began -the -anecdote -began -it -in -a -deep -and -hostile -stillness -where -had -been -such -life -and -stir -and -warm -comradeship -before -he -delivered -himself -of -the -brief -details -of -the -diary's -first -day -and -did -it -with -some -confidence -and -a -fair -degree -of -eagerness -it -fell -flat -there -was -an -awkward -pause -the -two -rows -of -men -sat -like -statues -there -was -no -movement -no -sound -he -had -to -go -on -there -was -no -other -way -at -least -none -that -an -animal -of -his -calibre -could -think -of -at -the -close -of -each -day's -diary -the -same -dismal -silence -followed -when -at -last -he -finished -his -tale -and -sprung -the -indelicate -surprise -which -is -wont -to -fetch -a -crash -of -laughter -not -a -ripple -of -sound -resulted -it -was -as -if -the -tale -had -been -told -to -dead -men -after -what -seemed -a -long -long -time -somebody -sighed -somebody -else -stirred -in -his -seat -presently -the -men -dropped -into -a -low -murmur -of -confidential -talk -each -with -his -neighbor -and -the -incident -was -closed -there -were -indications -that -that -man -was -fond -of -his -anecdote -that -it -was -his -pet -his -standby -his -shot -that -never -missed -his -reputation -maker -but -he -will -never -tell -it -again -no -doubt -he -will -think -of -it -sometimes -for -that -cannot -well -be -helped -and -then -he -will -see -a -picture -and -always -the -same -picture -the -double -rank -of -dead -men -the -vacant -deck -stretching -away -in -dimming -perspective -beyond -them -the -wide -desert -of -smooth -sea -all -abroad -the -rim -of -the -moon -spying -from -behind -a -rag -of -black -cloud -the -remote -top -of -the -mizzenmast -shearing -a -zigzag -path -through -the -fields -of -stars -in -the -deeps -of -space -and -this -soft -picture -will -remind -him -of -the -time -that -he -sat -in -the -midst -of -it -and -told -his -poor -little -tale -and -felt -so -lonesome -when -he -got -through -fifty -indians -and -chinamen -asleep -in -a -big -tent -in -the -waist -of -the -ship -forward -they -lie -side -by -side -with -no -space -between -the -former -wrapped -up -head -and -all -as -in -the -indian -streets -the -chinamen -uncovered -the -lamp -and -things -for -opium -smoking -in -the -center -a -passenger -said -it -was -ten -2 -ton -truck -loads -of -dynamite -that -lately -exploded -at -johannesburg -hundreds -killed -he -doesn't -know -how -many -limbs -picked -up -for -miles -around -glass -shattered -and -roofs -swept -away -or -collapsed -200 -yards -off -fragment -of -iron -flung -three -and -a -half -miles -it -occurred -at -3 -p -m -at -6 -l65 -000 -had -been -subscribed -when -this -passenger -left -l35 -000 -had -been -voted -by -city -and -state -governments -and -l100 -000 -by -citizens -and -business -corporations -when -news -of -the -disaster -was -telephoned -to -the -exchange -l35 -000 -were -subscribed -in -the -first -five -minutes -subscribing -was -still -going -on -when -he -left -the -papers -had -ceased -the -names -only -the -amounts -too -many -names -not -enough -room -l100 -000 -subscribed -by -companies -and -citizens -if -this -is -true -it -must -be -what -they -call -in -australia -a -record -the -biggest -instance -of -a -spontaneous -outpour -for -charity -in -history -considering -the -size -of -the -population -it -was -drawn -from -$8 -or -$10 -for -each -white -resident -babies -at -the -breast -included -monday -may -4 -steaming -slowly -in -the -stupendous -delagoa -bay -its -dim -arms -stretching -far -away -and -disappearing -on -both -sides -it -could -furnish -plenty -of -room -for -all -the -ships -in -the -world -but -it -is -shoal -the -lead -has -given -us -3 -1/2 -fathoms -several -times -and -we -are -drawing -that -lacking -6 -inches -a -bold -headland -precipitous -wall -150 -feet -high -very -strong -red -color -stretching -a -mile -or -so -a -man -said -it -was -portuguese -blood -battle -fought -here -with -the -natives -last -year -i -think -this -doubtful -pretty -cluster -of -houses -on -the -tableland -above -the -red -and -rolling -stretches -of -grass -and -groups -of -trees -like -england -the -portuguese -have -the -railroad -one -passenger -train -a -day -to -the -border -70 -miles -then -the -netherlands -company -have -it -thousands -of -tons -of -freight -on -the -shore -no -cover -this -is -portuguese -allover -indolence -piousness -poverty -impotence -crews -of -small -boats -and -tugs -all -jet -black -woolly -heads -and -very -muscular -winter -the -south -african -winter -is -just -beginning -now -but -nobody -but -an -expert -can -tell -it -from -summer -however -i -am -tired -of -summer -we -have -had -it -unbroken -for -eleven -months -we -spent -the -afternoon -on -shore -delagoa -bay -a -small -town -no -sights -no -carriages -three -'rickshas -but -we -couldn't -get -them -apparently -private -these -portuguese -are -a -rich -brown -like -some -of -the -indians -some -of -the -blacks -have -the -long -horse -beads -and -very -long -chins -of -the -negroes -of -the -picture -books -but -most -of -them -are -exactly -like -the -negroes -of -our -southern -states -round -faces -flat -noses -good -natured -and -easy -laughers -flocks -of -black -women -passed -along -carrying -outrageously -heavy -bags -of -freight -on -their -heads -the -quiver -of -their -leg -as -the -foot -was -planted -and -the -strain -exhibited -by -their -bodies -showed -what -a -tax -upon -their -strength -the -load -was -they -were -stevedores -and -doing -full -stevedores -work -they -were -very -erect -when -unladden -from -carrying -heavy -loads -on -their -heads -just -like -the -indian -women -it -gives -them -a -proud -fine -carriage -sometimes -one -saw -a -woman -carrying -on -her -head -a -laden -and -top -heavy -basket -the -shape -of -an -inverted -pyramid -its -top -the -size -of -a -soup -plate -its -base -the -diameter -of -a -teacup -it -required -nice -balancing -and -got -it -no -bright -colors -yet -there -were -a -good -many -hindoos -the -second -class -passenger -came -over -as -usual -at -lights -out -11 -and -we -lounged -along -the -spacious -vague -solitudes -of -the -deck -and -smoked -the -peaceful -pipe -and -talked -he -told -me -an -incident -in -mr -barnum's -life -which -was -evidently -characteristic -of -that -great -showman -in -several -ways -this -was -barnum's -purchase -of -shakespeare's -birthplace -a -quarter -of -a -century -ago -the -second -class -passenger -was -in -jamrach's -employ -at -the -time -and -knew -barnum -well -he -said -the -thing -began -in -this -way -one -morning -barnum -and -jamrach -were -in -jamrach's -little -private -snuggery -back -of -the -wilderness -of -caged -monkeys -and -snakes -and -other -commonplaces -of -jamrach's -stock -in -trade -refreshing -themselves -after -an -arduous -stroke -of -business -jamrach -with -something -orthodox -barnum -with -something -heterodox -for -barnum -was -a -teetotaler -the -stroke -of -business -was -in -the -elephant -line -jamrach -had -contracted -to -deliver -to -barnum -in -new -york -18 -elephants -for -$360 -000 -in -time -for -the -next -season's -opening -then -it -occurred -to -mr -barnum -that -he -needed -a -card -he -suggested -jumbo -jamrach -said -he -would -have -to -think -of -something -else -jumbo -couldn't -be -had -the -zoo -wouldn't -part -with -that -elephant -barnum -said -he -was -willing -to -pay -a -fortune -for -jumbo -if -he -could -get -him -jamrach -said -it -was -no -use -to -think -about -it -that -jumbo -was -as -popular -as -the -prince -of -wales -and -the -zoo -wouldn't -dare -to -sell -him -all -england -would -be -outraged -at -the -idea -jumbo -was -an -english -institution -he -was -part -of -the -national -glory -one -might -as -well -think -of -buying -the -nelson -monument -barnum -spoke -up -with -vivacity -and -said -it's -a -first -rate -idea -i'll -buy -the -monument -jamrach -was -speechless -for -a -second -then -he -said -like -one -ashamed -you -caught -me -i -was -napping -for -a -moment -i -thought -you -were -in -earnest -barnum -said -pleasantly -i -was -in -earnest -i -know -they -won't -sell -it -but -no -matter -i -will -not -throw -away -a -good -idea -for -all -that -all -i -want -is -a -big -advertisement -i -will -keep -the -thing -in -mind -and -if -nothing -better -turns -up -i -will -offer -to -buy -it -that -will -answer -every -purpose -it -will -furnish -me -a -couple -of -columns -of -gratis -advertising -in -every -english -and -american -paper -for -a -couple -of -months -and -give -my -show -the -biggest -boom -a -show -ever -had -in -this -world -jamrach -started -to -deliver -a -burst -of -admiration -but -was -interrupted -by -barnum -who -said -here -is -a -state -of -things! -england -ought -to -blush -his -eye -had -fallen -upon -something -in -the -newspaper -he -read -it -through -to -himself -then -read -it -aloud -it -said -that -the -house -that -shakespeare -was -born -in -at -stratford -on -avon -was -falling -gradually -to -ruin -through -neglect -that -the -room -where -the -poet -first -saw -the -light -was -now -serving -as -a -butcher's -shop -that -all -appeals -to -england -to -contribute -money -the -requisite -sum -stated -to -buy -and -repair -the -house -and -place -it -in -the -care -of -salaried -and -trustworthy -keepers -had -fallen -resultless -then -barnum -said -there's -my -chance -let -jumbo -and -the -monument -alone -for -the -present -they'll -keep -i'll -buy -shakespeare's -house -i'll -set -it -up -in -my -museum -in -new -york -and -put -a -glass -case -around -it -and -make -a -sacred -thing -of -it -and -you'll -see -all -america -flock -there -to -worship -yes -and -pilgrims -from -the -whole -earth -and -i'll -make -them -take -their -hats -off -too -in -america -we -know -how -to -value -anything -that -shakespeare's -touch -has -made -holy -you'll -see -in -conclusion -the -s -c -p -said -that -is -the -way -the -thing -came -about -barnum -did -buy -shakespeare's -house -he -paid -the -price -asked -and -received -the -properly -attested -documents -of -sale -then -there -was -an -explosion -i -can -tell -you -england -rose! -that -the -birthplace -of -the -master -genius -of -all -the -ages -and -all -the -climes -that -priceless -possession -of -britain -to -be -carted -out -of -the -country -like -so -much -old -lumber -and -set -up -for -sixpenny -desecration -in -a -yankee -show -shop -the -idea -was -not -to -be -tolerated -for -a -moment -england -rose -in -her -indignation -and -barnum -was -glad -to -relinquish -his -prize -and -offer -apologies -however -he -stood -out -for -a -compromise -he -claimed -a -concession -england -must -let -him -have -jumbo -and -england -consented -but -not -cheerfully -it -shows -how -by -help -of -time -a -story -can -grow -even -after -barnum -has -had -the -first -innings -in -the -telling -of -it -mr -barnum -told -me -the -story -himself -years -ago -he -said -that -the -permission -to -buy -jumbo -was -not -a -concession -the -purchase -was -made -and -the -animal -delivered -before -the -public -knew -anything -about -it -also -that -the -securing -of -jumbo -was -all -the -advertisement -he -needed -it -produced -many -columns -of -newspaper -talk -free -of -cost -and -he -was -satisfied -he -said -that -if -he -had -failed -to -get -jumbo -he -would -have -caused -his -notion -of -buying -the -nelson -monument -to -be -treacherously -smuggled -into -print -by -some -trusty -friend -and -after -he -had -gotten -a -few -hundred -pages -of -gratuitous -advertising -out -of -it -he -would -have -come -out -with -a -blundering -obtuse -but -warm -hearted -letter -of -apology -and -in -a -postscript -to -it -would -have -naively -proposed -to -let -the -monument -go -and -take -stonehenge -in -place -of -it -at -the -same -price -it -was -his -opinion -that -such -a -letter -written -with -well -simulated -asinine -innocence -and -gush -would -have -gotten -his -ignorance -and -stupidity -an -amount -of -newspaper -abuse -worth -six -fortunes -to -him -and -not -purchasable -for -twice -the -money -i -knew -mr -barnum -well -and -i -placed -every -confidence -in -the -account -which -he -gave -me -of -the -shakespeare -birthplace -episode -he -said -he -found -the -house -neglected -and -going -to -decay -and -he -inquired -into -the -matter -and -was -told -that -many -times -earnest -efforts -had -been -made -to -raise -money -for -its -proper -repair -and -preservation -but -without -success -he -then -proposed -to -buy -it -the -proposition -was -entertained -and -a -price -named -$50 -000 -i -think -but -whatever -it -was -barnum -paid -the -money -down -without -remark -and -the -papers -were -drawn -up -and -executed -he -said -that -it -had -been -his -purpose -to -set -up -the -house -in -his -museum -keep -it -in -repair -protect -it -from -name -scribblers -and -other -desecrators -and -leave -it -by -bequest -to -the -safe -and -perpetual -guardianship -of -the -smithsonian -institute -at -washington -but -as -soon -as -it -was -found -that -shakespeare's -house -had -passed -into -foreign -hands -and -was -going -to -be -carried -across -the -ocean -england -was -stirred -as -no -appeal -from -the -custodians -of -the -relic -had -ever -stirred -england -before -and -protests -came -flowing -in -and -money -too -to -stop -the -outrage -offers -of -repurchase -were -made -offers -of -double -the -money -that -mr -barnum -had -paid -for -the -house -he -handed -the -house -back -but -took -only -the -sum -which -it -had -cost -him -but -on -the -condition -that -an -endowment -sufficient -for -the -future -safeguarding -and -maintenance -of -the -sacred -relic -should -be -raised -this -condition -was -fulfilled -that -was -barnum's -account -of -the -episode -and -to -the -end -of -his -days -he -claimed -with -pride -and -satisfaction -that -not -england -but -america -represented -by -him -saved -the -birthplace -of -shakespeare -from -destruction -at -3 -p -m -may -6th -the -ship -slowed -down -off -the -land -and -thoughtfully -and -cautiously -picked -her -way -into -the -snug -harbor -of -durban -south -africa -chapter -lxv -in -statesmanship -get -the -formalities -right -never -mind -about -the -moralities -pudd'nhead -wilson's -new -calendar -from -diary -royal -hotel -comfortable -good -table -good -service -of -natives -and -madrasis -curious -jumble -of -modern -and -ancient -city -and -village -primitiveness -and -the -other -thing -electric -bells -but -they -don't -ring -asked -why -they -didn't -the -watchman -in -the -office -said -he -thought -they -must -be -out -of -order -he -thought -so -because -some -of -them -rang -but -most -of -them -didn't -wouldn't -it -be -a -good -idea -to -put -them -in -order -he -hesitated -like -one -who -isn't -quite -sure -then -conceded -the -point -may -7 -a -bang -on -the -door -at -6 -did -i -want -my -boots -cleaned -fifteen -minutes -later -another -bang -did -we -want -coffee -fifteen -later -bang -again -my -wife's -bath -ready -15 -later -my -bath -ready -two -other -bangs -i -forget -what -they -were -about -then -lots -of -shouting -back -and -forth -among -the -servants -just -as -in -an -indian -hotel -evening -at -4 -p -m -it -was -unpleasantly -warm -half -hour -after -sunset -one -needed -a -spring -overcoat -by -8 -a -winter -one -durban -is -a -neat -and -clean -town -one -notices -that -without -having -his -attention -called -to -it -rickshaws -drawn -by -splendidly -built -black -zulus -so -overflowing -with -strength -seemingly -that -it -is -a -pleasure -not -a -pain -to -see -them -snatch -a -rickshaw -along -they -smile -and -laugh -and -show -their -teeth -a -good -natured -lot -not -allowed -to -drink -2s -per -hour -for -one -person -3s -for -two -3d -for -a -course -one -person -the -chameleon -in -the -hotel -court -he -is -fat -and -indolent -and -contemplative -but -is -business -like -and -capable -when -a -fly -comes -about -reaches -out -a -tongue -like -a -teaspoon -and -takes -him -in -he -gums -his -tongue -first -he -is -always -pious -in -his -looks -and -pious -and -thankful -both -when -providence -or -one -of -us -sends -him -a -fly -he -has -a -froggy -head -and -a -back -like -a -new -grave -for -shape -and -hands -like -a -bird's -toes -that -have -been -frostbitten -but -his -eyes -are -his -exhibition -feature -a -couple -of -skinny -cones -project -from -the -sides -of -his -head -with -a -wee -shiny -bead -of -an -eye -set -in -the -apex -of -each -and -these -cones -turn -bodily -like -pivot -guns -and -point -every -which -way -and -they -are -independent -of -each -other -each -has -its -own -exclusive -machinery -when -i -am -behind -him -and -c -in -front -of -him -he -whirls -one -eye -rearwards -and -the -other -forwards -which -gives -him -a -most -congressional -expression -one -eye -on -the -constituency -and -one -on -the -swag -and -then -if -something -happens -above -and -below -him -he -shoots -out -one -eye -upward -like -a -telescope -and -the -other -downward -and -this -changes -his -expression -but -does -not -improve -it -natives -must -not -be -out -after -the -curfew -bell -without -a -pass -in -natal -there -are -ten -blacks -to -one -white -sturdy -plump -creatures -are -the -women -they -comb -their -wool -up -to -a -peak -and -keep -it -in -position -by -stiffening -it -with -brown -red -clay -half -of -this -tower -colored -denotes -engagement -the -whole -of -it -colored -denotes -marriage -none -but -heathen -zulus -on -the -police -christian -ones -not -allowed -may -9 -a -drive -yesterday -with -friends -over -the -berea -very -fine -roads -and -lofty -overlooking -the -whole -town -the -harbor -and -the -sea -beautiful -views -residences -all -along -set -in -the -midst -of -green -lawns -with -shrubs -and -generally -one -or -two -intensely -red -outbursts -of -poinsettia -the -flaming -splotch -of -blinding -red -a -stunning -contrast -with -the -world -of -surrounding -green -the -cactus -tree -candelabrum -like -and -one -twisted -like -gray -writhing -serpents -the -flat -crown -should -be -flat -roof -half -a -dozen -naked -branches -full -of -elbows -slant -upward -like -artificial -supports -and -fling -a -roof -of -delicate -foliage -out -in -a -horizontal -platform -as -flat -as -a -floor -and -you -look -up -through -this -thin -floor -as -through -a -green -cobweb -or -veil -the -branches -are -japanesich -all -about -you -is -a -bewildering -variety -of -unfamiliar -and -beautiful -trees -one -sort -wonderfully -dense -foliage -and -very -dark -green -so -dark -that -you -notice -it -at -once -notwithstanding -there -are -so -many -orange -trees -the -flamboyant -not -in -flower -now -but -when -in -flower -lives -up -to -its -name -we -are -told -another -tree -with -a -lovely -upright -tassel -scattered -among -its -rich -greenery -red -and -glowing -as -a -firecoal -here -and -there -a -gum -tree -half -a -dozen -lofty -norfolk -island -pines -lifting -their -fronded -arms -skyward -groups -of -tall -bamboo -saw -one -bird -not -many -birds -here -and -they -have -no -music -and -the -flowers -not -much -smell -they -grow -so -fast -everything -neat -and -trim -and -clean -like -the -town -the -loveliest -trees -and -the -greatest -variety -i -have -ever -seen -anywhere -except -approaching -darjeeling -have -not -heard -anyone -call -natal -the -garden -of -south -africa -but -that -is -what -it -probably -is -it -was -when -bishop -of -natal -that -colenso -raised -such -a -storm -in -the -religious -world -the -concerns -of -religion -are -a -vital -matter -here -yet -a -vigilant -eye -is -kept -upon -sunday -museums -and -other -dangerous -resorts -are -not -allowed -to -be -open -you -may -sail -on -the -bay -but -it -is -wicked -to -play -cricket -for -a -while -a -sunday -concert -was -tolerated -upon -condition -that -it -must -be -admission -free -and -the -money -taken -by -collection -but -the -collection -was -alarmingly -large -and -that -stopped -the -matter -they -are -particular -about -babies -a -clergyman -would -not -bury -a -child -according -to -the -sacred -rites -because -it -had -not -been -baptized -the -hindoo -is -more -liberal -he -burns -no -child -under -three -holding -that -it -does -not -need -purifying -the -king -of -the -zulus -a -fine -fellow -of -30 -was -banished -six -years -ago -for -a -term -of -seven -years -he -is -occupying -napoleon's -old -stand -st -helena -the -people -are -a -little -nervous -about -having -him -come -back -and -they -may -well -be -for -zulu -kings -have -been -terrible -people -sometimes -like -tchaka -dingaan -and -cetewayo -there -is -a -large -trappist -monastery -two -hours -from -durban -over -the -country -roads -and -in -company -with -mr -milligan -and -mr -hunter -general -manager -of -the -natal -government -railways -who -knew -the -heads -of -it -we -went -out -to -see -it -there -it -all -was -just -as -one -reads -about -it -in -books -and -cannot -believe -that -it -is -so -i -mean -the -rough -hard -work -the -impossible -hours -the -scanty -food -the -coarse -raiment -the -maryborough -beds -the -tabu -of -human -speech -of -social -intercourse -of -relaxation -of -amusement -of -entertainment -of -the -presence -of -woman -in -the -men's -establishment -there -it -all -was -it -was -not -a -dream -it -was -not -a -lie -and -yet -with -the -fact -before -one's -face -it -was -still -incredible -it -is -such -a -sweeping -suppression -of -human -instincts -such -an -extinction -of -the -man -as -an -individual -la -trappe -must -have -known -the -human -race -well -the -scheme -which -he -invented -hunts -out -everything -that -a -man -wants -and -values -and -withholds -it -from -him -apparently -there -is -no -detail -that -can -help -make -life -worth -living -that -has -not -been -carefully -ascertained -and -placed -out -of -the -trappist's -reach -la -trappe -must -have -known -that -there -were -men -who -would -enjoy -this -kind -of -misery -but -how -did -he -find -it -out -if -he -had -consulted -you -or -me -he -would -have -been -told -that -his -scheme -lacked -too -many -attractions -that -it -was -impossible -that -it -could -never -be -floated -but -there -in -the -monastery -was -proof -that -he -knew -the -human -race -better -than -it -knew -itself -he -set -his -foot -upon -every -desire -that -a -man -has -yet -he -floated -his -project -and -it -has -prospered -for -two -hundred -years -and -will -go -on -prospering -forever -no -doubt -man -likes -personal -distinction -there -in -the -monastery -it -is -obliterated -he -likes -delicious -food -there -he -gets -beans -and -bread -and -tea -and -not -enough -of -it -he -likes -to -lie -softly -there -he -lies -on -a -sand -mattress -and -has -a -pillow -and -a -blanket -but -no -sheet -when -he -is -dining -in -a -great -company -of -friends -he -likes -to -laugh -and -chat -there -a -monk -reads -a -holy -book -aloud -during -meals -and -nobody -speaks -or -laughs -when -a -man -has -a -hundred -friends -about -him -evenings -be -likes -to -have -a -good -time -and -run -late -there -he -and -the -rest -go -silently -to -bed -at -8 -and -in -the -dark -too -there -is -but -a -loose -brown -robe -to -discard -there -are -no -night -clothes -to -put -on -a -light -is -not -needed -man -likes -to -lie -abed -late -there -he -gets -up -once -or -twice -in -the -night -to -perform -some -religious -office -and -gets -up -finally -for -the -day -at -two -in -the -morning -man -likes -light -work -or -none -at -all -there -he -labors -all -day -in -the -field -or -in -the -blacksmith -shop -or -the -other -shops -devoted -to -the -mechanical -trades -such -as -shoemaking -saddlery -carpentry -and -so -on -man -likes -the -society -of -girls -and -women -there -he -never -has -it -he -likes -to -have -his -children -about -him -and -pet -them -and -play -with -them -there -he -has -none -he -likes -billiards -there -is -no -table -there -he -likes -outdoor -sports -and -indoor -dramatic -and -musical -and -social -entertainments -there -are -none -there -he -likes -to -bet -on -things -i -was -told -that -betting -is -forbidden -there -when -a -man's -temper -is -up -he -likes -to -pour -it -out -upon -somebody -there -this -is -not -allowed -a -man -likes -animals -pets -there -are -none -there -he -likes -to -smoke -there -he -cannot -do -it -he -likes -to -read -the -news -no -papers -or -magazines -come -there -a -man -likes -to -know -how -his -parents -and -brothers -and -sisters -are -getting -along -when -he -is -away -and -if -they -miss -him -there -he -cannot -know -a -man -likes -a -pretty -house -and -pretty -furniture -and -pretty -things -and -pretty -colors -there -he -has -nothing -but -naked -aridity -and -sombre -colors -a -man -likes -name -it -yourself -whatever -it -is -it -is -absent -from -that -place -from -what -i -could -learn -all -that -a -man -gets -for -this -is -merely -the -saving -of -his -soul -it -all -seems -strange -incredible -impossible -but -la -trappe -knew -the -race -he -knew -the -powerful -attraction -of -unattractiveness -he -knew -that -no -life -could -be -imagined -howsoever -comfortless -and -forbidding -but -somebody -would -want -to -try -it -this -parent -establishment -of -germans -began -its -work -fifteen -years -ago -strangers -poor -and -unencouraged -it -owns -15 -000 -acres -of -land -now -and -raises -grain -and -fruit -and -makes -wines -and -manufactures -all -manner -of -things -and -has -native -apprentices -in -its -shops -and -sends -them -forth -able -to -read -and -write -and -also -well -equipped -to -earn -their -living -by -their -trades -and -this -young -establishment -has -set -up -eleven -branches -in -south -africa -and -in -them -they -are -christianizing -and -educating -and -teaching -wage -yielding -mechanical -trades -to -1 -200 -boys -and -girls -protestant -missionary -work -is -coldly -regarded -by -the -commercial -white -colonist -all -over -the -heathen -world -as -a -rule -and -its -product -is -nicknamed -rice -christians -occupationless -incapables -who -join -the -church -for -revenue -only -but -i -think -it -would -be -difficult -to -pick -a -flaw -in -the -work -of -these -catholic -monks -and -i -believe -that -the -disposition -to -attempt -it -has -not -shown -itself -tuesday -may -12 -transvaal -politics -in -a -confused -condition -first -the -sentencing -of -the -johannesburg -reformers -startled -england -by -its -severity -on -the -top -of -this -came -kruger's -exposure -of -the -cipher -correspondence -which -showed -that -the -invasion -of -the -transvaal -with -the -design -of -seizing -that -country -and -adding -it -to -the -british -empire -was -planned -by -cecil -rhodes -and -beit -which -made -a -revulsion -in -english -feeling -and -brought -out -a -storm -against -rhodes -and -the -chartered -company -for -degrading -british -honor -for -a -good -while -i -couldn't -seem -to -get -at -a -clear -comprehension -of -it -it -was -so -tangled -but -at -last -by -patient -study -i -have -managed -it -i -believe -as -i -understand -it -the -uitlanders -and -other -dutchmen -were -dissatisfied -because -the -english -would -not -allow -them -to -take -any -part -in -the -government -except -to -pay -taxes -next -as -i -understand -it -dr -kruger -and -dr -jameson -not -having -been -able -to -make -the -medical -business -pay -made -a -raid -into -matabeleland -with -the -intention -of -capturing -the -capital -johannesburg -and -holding -the -women -and -children -to -ransom -until -the -uitlanders -and -the -other -boers -should -grant -to -them -and -the -chartered -company -the -political -rights -which -had -been -withheld -from -them -they -would -have -succeeded -in -this -great -scheme -as -i -understand -it -but -for -the -interference -of -cecil -rhodes -and -mr -beit -and -other -chiefs -of -the -matabele -who -persuaded -their -countrymen -to -revolt -and -throw -off -their -allegiance -to -germany -this -in -turn -as -i -understand -it -provoked -the -king -of -abyssinia -to -destroy -the -italian -army -and -fall -back -upon -johannesburg -this -at -the -instigation -of -rhodes -to -bull -the -stock -market -chapter -lxvi -every -one -is -a -moon -and -has -a -dark -side -which -he -never -shows -to -anybody -pudd'nhead -wilson's -new -calendar -when -i -scribbled -in -my -note -book -a -year -ago -the -paragraph -which -ends -the -preceding -chapter -it -was -meant -to -indicate -in -an -extravagant -form -two -things -the -conflicting -nature -of -the -information -conveyed -by -the -citizen -to -the -stranger -concerning -south -african -politics -and -the -resulting -confusion -created -in -the -stranger's -mind -thereby -but -it -does -not -seem -so -very -extravagant -now -nothing -could -in -that -disturbed -and -excited -time -make -south -african -politics -clear -or -quite -rational -to -the -citizen -of -the -country -because -his -personal -interest -and -his -political -prejudices -were -in -his -way -and -nothing -could -make -those -politics -clear -or -rational -to -the -stranger -the -sources -of -his -information -being -such -as -they -were -i -was -in -south -africa -some -little -time -when -i -arrived -there -the -political -pot -was -boiling -fiercely -four -months -previously -jameson -had -plunged -over -the -transvaal -border -with -about -600 -armed -horsemen -at -his -back -to -go -to -the -relief -of -the -women -and -children -of -johannesburg -on -the -fourth -day -of -his -march -the -boers -had -defeated -him -in -battle -and -carried -him -and -his -men -to -pretoria -the -capital -as -prisoners -the -boer -government -had -turned -jameson -and -his -officers -over -to -the -british -government -for -trial -and -shipped -them -to -england -next -it -had -arrested -64 -important -citizens -of -johannesburg -as -raid -conspirators -condemned -their -four -leaders -to -death -then -commuted -the -sentences -and -now -the -64 -were -waiting -in -jail -for -further -results -before -midsummer -they -were -all -out -excepting -two -who -refused -to -sign -the -petitions -for -release -58 -had -been -fined -$10 -000 -each -and -enlarged -and -the -four -leaders -had -gotten -off -with -fines -of -$125 -000 -each -with -permanent -exile -added -in -one -case -those -were -wonderfully -interesting -days -for -a -stranger -and -i -was -glad -to -be -in -the -thick -of -the -excitement -everybody -was -talking -and -i -expected -to -understand -the -whole -of -one -side -of -it -in -a -very -little -while -i -was -disappointed -there -were -singularities -perplexities -unaccountabilities -about -it -which -i -was -not -able -to -master -i -had -no -personal -access -to -boers -their -side -was -a -secret -to -me -aside -from -what -i -was -able -to -gather -of -it -from -published -statements -my -sympathies -were -soon -with -the -reformers -in -the -pretoria -jail -with -their -friends -and -with -their -cause -by -diligent -inquiry -in -johannesburg -i -found -out -apparently -all -the -details -of -their -side -of -the -quarrel -except -one -what -they -expected -to -accomplish -by -an -armed -rising -nobody -seemed -to -know -the -reason -why -the -reformers -were -discontented -and -wanted -some -changes -made -seemed -quite -clear -in -johannesburg -it -was -claimed -that -the -uitlanders -strangers -foreigners -paid -thirteen -fifteenths -of -the -transvaal -taxes -yet -got -little -or -nothing -for -it -their -city -had -no -charter -it -had -no -municipal -government -it -could -levy -no -taxes -for -drainage -water -supply -paving -cleaning -sanitation -policing -there -was -a -police -force -but -it -was -composed -of -boers -it -was -furnished -by -the -state -government -and -the -city -had -no -control -over -it -mining -was -very -costly -the -government -enormously -increased -the -cost -by -putting -burdensome -taxes -upon -the -mines -the -output -the -machinery -the -buildings -by -burdensome -imposts -upon -incoming -materials -by -burdensome -railway -freight -charges -hardest -of -all -to -bear -the -government -reserved -to -itself -a -monopoly -in -that -essential -thing -dynamite -and -burdened -it -with -an -extravagant -price -the -detested -hollander -from -over -the -water -held -all -the -public -offices -the -government -was -rank -with -corruption -the -uitlander -had -no -vote -and -must -live -in -the -state -ten -or -twelve -years -before -he -could -get -one -he -was -not -represented -in -the -raad -legislature -that -oppressed -him -and -fleeced -him -religion -was -not -free -there -were -no -schools -where -the -teaching -was -in -english -yet -the -great -majority -of -the -white -population -of -the -state -knew -no -tongue -but -that -the -state -would -not -pass -a -liquor -law -but -allowed -a -great -trade -in -cheap -vile -brandy -among -the -blacks -with -the -result -that -25 -per -cent -of -the -50 -000 -blacks -employed -in -the -mines -were -usually -drunk -and -incapable -of -working -there -it -was -plain -enough -that -the -reasons -for -wanting -some -changes -made -were -abundant -and -reasonable -if -this -statement -of -the -existing -grievances -was -correct -what -the -uitlanders -wanted -was -reform -under -the -existing -republic -what -they -proposed -to -do -was -to -secure -these -reforms -by -prayer -petition -and -persuasion -they -did -petition -also -they -issued -a -manifesto -whose -very -first -note -is -a -bugle -blast -of -loyalty -we -want -the -establishment -of -this -republic -as -a -true -republic -could -anything -be -clearer -than -the -uitlander's -statement -of -the -grievances -and -oppressions -under -which -they -were -suffering -could -anything -be -more -legal -and -citizen -like -and -law -respecting -than -their -attitude -as -expressed -by -their -manifesto -no -those -things -were -perfectly -clear -perfectly -comprehensible -but -at -this -point -the -puzzles -and -riddles -and -confusions -begin -to -flock -in -you -have -arrived -at -a -place -which -you -cannot -quite -understand -for -you -find -that -as -a -preparation -for -this -loyal -lawful -and -in -every -way -unexceptionable -attempt -to -persuade -the -government -to -right -their -grievances -the -uitlanders -had -smuggled -a -maxim -gun -or -two -and -1 -500 -muskets -into -the -town -concealed -in -oil -tanks -and -coal -cars -and -had -begun -to -form -and -drill -military -companies -composed -of -clerks -merchants -and -citizens -generally -what -was -their -idea -did -they -suppose -that -the -boers -would -attack -them -for -petitioning -for -redress -that -could -not -be -did -they -suppose -that -the -boers -would -attack -them -even -for -issuing -a -manifesto -demanding -relief -under -the -existing -government -yes -they -apparently -believed -so -because -the -air -was -full -of -talk -of -forcing -the -government -to -grant -redress -if -it -were -not -granted -peacefully -the -reformers -were -men -of -high -intelligence -if -they -were -in -earnest -they -were -taking -extraordinary -risks -they -had -enormously -valuable -properties -to -defend -their -town -was -full -of -women -and -children -their -mines -and -compounds -were -packed -with -thousands -upon -thousands -of -sturdy -blacks -if -the -boers -attacked -the -mines -would -close -the -blacks -would -swarm -out -and -get -drunk -riot -and -conflagration -and -the -boers -together -might -lose -the -reformers -more -in -a -day -in -money -blood -and -suffering -than -the -desired -political -relief -could -compensate -in -ten -years -if -they -won -the -fight -and -secured -the -reforms -it -is -may -1897 -now -a -year -has -gone -by -and -the -confusions -of -that -day -have -been -to -a -considerable -degree -cleared -away -mr -cecil -rhodes -dr -jameson -and -others -responsible -for -the -raid -have -testified -before -the -parliamentary -committee -of -inquiry -in -london -and -so -have -mr -lionel -phillips -and -other -johannesburg -reformers -monthly -nurses -of -the -revolution -which -was -born -dead -these -testimonies -have -thrown -light -three -books -have -added -much -to -this -light -south -africa -as -it -is -by -mr -statham -an -able -writer -partial -to -the -boers -the -story -of -an -african -crisis -by -mr -garrett -a -brilliant -writer -partial -to -rhodes -and -a -woman's -part -in -a -revolution -by -mrs -john -hays -hammond -a -vigorous -and -vivid -diarist -partial -to -the -reformers -by -liquifying -the -evidence -of -the -prejudiced -books -and -of -the -prejudiced -parliamentary -witnesses -and -stirring -the -whole -together -and -pouring -it -into -my -own -prejudiced -moulds -i -have -got -at -the -truth -of -that -puzzling -south -african -situation -which -is -this -1 -the -capitalists -and -other -chief -men -of -johannesburg -were -fretting -under -various -political -and -financial -burdens -imposed -by -the -state -the -south -african -republic -sometimes -called -the -transvaal -and -desired -to -procure -by -peaceful -means -a -modification -of -the -laws -2 -mr -cecil -rhodes -premier -of -the -british -cape -colony -millionaire -creator -and -managing -director -of -the -territorially -immense -and -financially -unproductive -south -africa -company -projector -of -vast -schemes -for -the -unification -and -consolidation -of -all -the -south -african -states -one -imposing -commonwealth -or -empire -under -the -shadow -and -general -protection -of -the -british -flag -thought -he -saw -an -opportunity -to -make -profitable -use -of -the -uitlander -discontent -above -mentioned -make -the -johannesburg -cat -help -pull -out -one -of -his -consolidation -chestnuts -for -him -with -this -view -he -set -himself -the -task -of -warming -the -lawful -and -legitimate -petitions -and -supplications -of -the -uitlanders -into -seditious -talk -and -their -frettings -into -threatenings -the -final -outcome -to -be -revolt -and -armed -rebellion -if -he -could -bring -about -a -bloody -collision -between -those -people -and -the -boer -government -great -britain -would -have -to -interfere -her -interference -would -be -resisted -by -the -boers -she -would -chastise -them -and -add -the -transvaal -to -her -south -african -possessions -it -was -not -a -foolish -idea -but -a -rational -and -practical -one -after -a -couple -of -years -of -judicious -plotting -mr -rhodes -had -his -reward -the -revolutionary -kettle -was -briskly -boiling -in -johannesburg -and -the -uitlander -leaders -were -backing -their -appeals -to -the -government -now -hardened -into -demands -by -threats -of -force -and -bloodshed -by -the -middle -of -december -1895 -the -explosion -seemed -imminent -mr -rhodes -was -diligently -helping -from -his -distant -post -in -cape -town -he -was -helping -to -procure -arms -for -johannesburg -he -was -also -arranging -to -have -jameson -break -over -the -border -and -come -to -johannesburg -with -600 -mounted -men -at -his -back -jameson -as -per -instructions -from -rhodes -perhaps -wanted -a -letter -from -the -reformers -requesting -him -to -come -to -their -aid -it -was -a -good -idea -it -would -throw -a -considerable -share -of -the -responsibility -of -his -invasion -upon -the -reformers -he -got -the -letter -that -famous -one -urging -him -to -fly -to -the -rescue -of -the -women -and -children -he -got -it -two -months -before -he -flew -the -reformers -seem -to -have -thought -it -over -and -concluded -that -they -had -not -done -wisely -for -the -next -day -after -giving -jameson -the -implicating -document -they -wanted -to -withdraw -it -and -leave -the -women -and -children -in -danger -but -they -were -told -that -it -was -too -late -the -original -had -gone -to -mr -rhodes -at -the -cape -jameson -had -kept -a -copy -though -from -that -time -until -the -29th -of -december -a -good -deal -of -the -reformers' -time -was -taken -up -with -energetic -efforts -to -keep -jameson -from -coming -to -their -assistance -jameson's -invasion -had -been -set -for -the -26th -the -reformers -were -not -ready -the -town -was -not -united -some -wanted -a -fight -some -wanted -peace -some -wanted -a -new -government -some -wanted -the -existing -one -reformed -apparently -very -few -wanted -the -revolution -to -take -place -in -the -interest -and -under -the -ultimate -shelter -of -the -imperial -flag -british -yet -a -report -began -to -spread -that -mr -rhodes's -embarrassing -assistance -had -for -its -end -this -latter -object -jameson -was -away -up -on -the -frontier -tugging -at -his -leash -fretting -to -burst -over -the -border -by -hard -work -the -reformers -got -his -starting -date -postponed -a -little -and -wanted -to -get -it -postponed -eleven -days -apparently -rhodes's -agents -were -seconding -their -efforts -in -fact -wearing -out -the -telegraph -wires -trying -to -hold -him -back -rhodes -was -himself -the -only -man -who -could -have -effectively -postponed -jameson -but -that -would -have -been -a -disadvantage -to -his -scheme -indeed -it -could -spoil -his -whole -two -years' -work -jameson -endured -postponement -three -days -then -resolved -to -wait -no -longer -without -any -orders -excepting -mr -rhodes's -significant -silence -he -cut -the -telegraph -wires -on -the -29th -and -made -his -plunge -that -night -to -go -to -the -rescue -of -the -women -and -children -by -urgent -request -of -a -letter -now -nine -days -old -as -per -date -a -couple -of -months -old -in -fact -he -read -the -letter -to -his -men -and -it -affected -them -it -did -not -affect -all -of -them -alike -some -saw -in -it -a -piece -of -piracy -of -doubtful -wisdom -and -were -sorry -to -find -that -they -had -been -assembled -to -violate -friendly -territory -instead -of -to -raid -native -kraals -as -they -had -supposed -jameson -would -have -to -ride -150 -miles -he -knew -that -there -were -suspicions -abroad -in -the -transvaal -concerning -him -but -he -expected -to -get -through -to -johannesburg -before -they -should -become -general -and -obstructive -but -a -telegraph -wire -had -been -overlooked -and -not -cut -it -spread -the -news -of -his -invasion -far -and -wide -and -a -few -hours -after -his -start -the -boer -farmers -were -riding -hard -from -every -direction -to -intercept -him -as -soon -as -it -was -known -in -johannesburg -that -he -was -on -his -way -to -rescue -the -women -and -children -the -grateful -people -put -the -women -and -children -in -a -train -and -rushed -them -for -australia -in -fact -the -approach -of -johannesburg's -saviour -created -panic -and -consternation -there -and -a -multitude -of -males -of -peaceable -disposition -swept -to -the -trains -like -a -sand -storm -the -early -ones -fared -best -they -secured -seats -by -sitting -in -them -eight -hours -before -the -first -train -was -timed -to -leave -mr -rhodes -lost -no -time -he -cabled -the -renowned -johannesburg -letter -of -invitation -to -the -london -press -the -gray -headedest -piece -of -ancient -history -that -ever -went -over -a -cable -the -new -poet -laureate -lost -no -time -he -came -out -with -a -rousing -poem -lauding -jameson's -prompt -and -splendid -heroism -in -flying -to -the -rescue -of -the -women -and -children -for -the -poet -could -not -know -that -he -did -not -fly -until -two -months -after -the -invitation -he -was -deceived -by -the -false -date -of -the -letter -which -was -december -20th -jameson -was -intercepted -by -the -boers -on -new -year's -day -and -on -the -next -day -he -surrendered -he -had -carried -his -copy -of -the -letter -along -and -if -his -instructions -required -him -in -case -of -emergency -to -see -that -it -fell -into -the -hands -of -the -boers -he -loyally -carried -them -out -mrs -hammond -gives -him -a -sharp -rap -for -his -supposed -carelessness -and -emphasizes -her -feeling -about -it -with -burning -italics -it -was -picked -up -on -the -battle -field -in -a -leathern -pouch -supposed -to -be -dr -jameson's -saddle -bag -why -in -the -name -of -all -that -is -discreet -and -honorable -didn't -he -eat -it! -she -requires -too -much -he -was -not -in -the -service -of -the -reformers -excepting -ostensibly -he -was -in -the -service -of -mr -rhodes -it -was -the -only -plain -english -document -undarkened -by -ciphers -and -mysteries -and -responsibly -signed -and -authenticated -which -squarely -implicated -the -reformers -in -the -raid -and -it -was -not -to -mr -rhodes's -interest -that -it -should -be -eaten -besides -that -letter -was -not -the -original -it -was -only -a -copy -mr -rhodes -had -the -original -and -didn't -eat -it -he -cabled -it -to -the -london -press -it -had -already -been -read -in -england -and -america -and -all -over -europe -before -jameson -dropped -it -on -the -battlefield -if -the -subordinate's -knuckles -deserved -a -rap -the -principal's -deserved -as -many -as -a -couple -of -them -that -letter -is -a -juicily -dramatic -incident -and -is -entitled -to -all -its -celebrity -because -of -the -odd -and -variegated -effects -which -it -produced -all -within -the -space -of -a -single -week -it -had -made -jameson -an -illustrious -hero -in -england -a -pirate -in -pretoria -and -an -ass -without -discretion -or -honor -in -johannesburg -also -it -had -produced -a -poet -laureatic -explosion -of -colored -fireworks -which -filled -the -world's -sky -with -giddy -splendors -and -the -knowledge -that -jameson -was -coming -with -it -to -rescue -the -women -and -children -emptied -johannesburg -of -that -detail -of -the -population -for -an -old -letter -this -was -much -for -a -letter -two -months -old -it -did -marvels -if -it -had -been -a -year -old -it -would -have -done -miracles -chapter -lxvii -first -catch -your -boer -then -kick -him -pudd'nhead -wilson's -new -calendar -those -latter -days -were -days -of -bitter -worry -and -trouble -for -the -harassed -reformers -from -mrs -hammond -we -learn -that -on -the -31st -the -day -after -johannesburg -heard -of -the -invasion -the -reform -committee -repudiates -dr -jameson's -inroad -it -also -publishes -its -intention -to -adhere -to -the -manifesto -it -also -earnestly -desires -that -the -inhabitants -shall -refrain -from -overt -acts -against -the -boer -government -it -also -distributes -arms -at -the -court -house -and -furnishes -horses -to -the -newly -enrolled -volunteers -it -also -brings -a -transvaal -flag -into -the -committee -room -and -the -entire -body -swear -allegiance -to -it -with -uncovered -heads -and -upraised -arms -also -one -thousand -lee -metford -rifles -have -been -given -out -to -rebels -also -in -a -speech -reformer -lionel -phillips -informs -the -public -that -the -reform -committee -delegation -has -been -received -with -courtesy -by -the -government -commission -and -been -assured -that -their -proposals -shall -be -earnestly -considered -that -while -the -reform -committee -regretted -jameson's -precipitate -action -they -would -stand -by -him -also -the -populace -are -in -a -state -of -wild -enthusiasm -and -46 -can -scarcely -be -restrained -they -want -to -go -out -to -meet -jameson -and -bring -him -in -with -triumphal -outcry -also -the -british -high -commissioner -has -issued -a -damnifying -proclamation -against -jameson -and -all -british -abettors -of -his -game -it -arrives -january -1st -it -is -a -difficult -position -for -the -reformers -and -full -of -hindrances -and -perplexities -their -duty -is -hard -but -plain -1 -they -have -to -repudiate -the -inroad -and -stand -by -the -inroader -2 -they -have -to -swear -allegiance -to -the -boer -government -and -distribute -cavalry -horses -to -the -rebels -3 -they -have -to -forbid -overt -acts -against -the -boer -government -and -distribute -arms -to -its -enemies -4 -they -have -to -avoid -collision -with -the -british -government -but -still -stand -by -jameson -and -their -new -oath -of -allegiance -to -the -boer -government -taken -uncovered -in -presence -of -its -flag -they -did -such -of -these -things -as -they -could -they -tried -to -do -them -all -in -fact -did -do -them -all -but -only -in -turn -not -simultaneously -in -the -nature -of -things -they -could -not -be -made -to -simultane -in -preparing -for -armed -revolution -and -in -talking -revolution -were -the -reformers -bluffing -or -were -they -in -earnest -if -they -were -in -earnest -they -were -taking -great -risks -as -has -been -already -pointed -out -a -gentleman -of -high -position -told -me -in -johannesburg -that -he -had -in -his -possession -a -printed -document -proclaiming -a -new -government -and -naming -its -president -one -of -the -reform -leaders -he -said -that -this -proclamation -had -been -ready -for -issue -but -was -suppressed -when -the -raid -collapsed -perhaps -i -misunderstood -him -indeed -i -must -have -misunderstood -him -for -i -have -not -seen -mention -of -this -large -incident -in -print -anywhere -besides -i -hope -i -am -mistaken -for -if -i -am -then -there -is -argument -that -the -reformers -were -privately -not -serious -but -were -only -trying -to -scare -the -boer -government -into -granting -the -desired -reforms -the -boer -government -was -scared -and -it -had -a -right -to -be -for -if -mr -rhodes's -plan -was -to -provoke -a -collision -that -would -compel -the -interference -of -england -that -was -a -serious -matter -if -it -could -be -shown -that -that -was -also -the -reformers' -plan -and -purpose -it -would -prove -that -they -had -marked -out -a -feasible -project -at -any -rate -although -it -was -one -which -could -hardly -fail -to -cost -them -ruinously -before -england -should -arrive -but -it -seems -clear -that -they -had -no -such -plan -nor -desire -if -when -the -worst -should -come -to -the -worst -they -meant -to -overthrow -the -government -they -also -meant -to -inherit -the -assets -themselves -no -doubt -this -scheme -could -hardly -have -succeeded -with -an -army -of -boers -at -their -gates -and -50 -000 -riotous -blacks -in -their -midst -the -odds -against -success -would -have -been -too -heavy -even -if -the -whole -town -had -been -armed -with -only -2 -500 -rifles -in -the -place -they -stood -really -no -chance -to -me -the -military -problems -of -the -situation -are -of -more -interest -than -the -political -ones -because -by -disposition -i -have -always -been -especially -fond -of -war -no -i -mean -fond -of -discussing -war -and -fond -of -giving -military -advice -if -i -had -been -with -jameson -the -morning -after -he -started -i -should -have -advised -him -to -turn -back -that -was -monday -it -was -then -that -he -received -his -first -warning -from -a -boer -source -not -to -violate -the -friendly -soil -of -the -transvaal -it -showed -that -his -invasion -was -known -if -i -had -been -with -him -on -tuesday -morning -and -afternoon -when -he -received -further -warnings -i -should -have -repeated -my -advice -if -i -had -been -with -him -the -next -morning -new -year's -when -he -received -notice -that -a -few -hundred -boers -were -waiting -for -him -a -few -miles -ahead -i -should -not -have -advised -but -commanded -him -to -go -back -and -if -i -had -been -with -him -two -or -three -hours -later -a -thing -not -conceivable -to -me -i -should -have -retired -him -by -force -for -at -that -time -he -learned -that -the -few -hundred -had -now -grown -to -800 -and -that -meant -that -the -growing -would -go -on -growing -for -by -authority -of -mr -garrett -one -knows -that -jameson's -600 -were -only -530 -at -most -when -you -count -out -his -native -drivers -etc -and -that -the -530 -consisted -largely -of -green -youths -raw -young -fellows -not -trained -and -war -worn -british -soldiers -and -i -would -have -told -jameson -that -those -lads -would -not -be -able -to -shoot -effectively -from -horseback -in -the -scamper -and -racket -of -battle -and -that -there -would -not -be -anything -for -them -to -shoot -at -anyway -but -rocks -for -the -boers -would -be -behind -the -rocks -not -out -in -the -open -i -would -have -told -him -that -300 -boer -sharpshooters -behind -rocks -would -be -an -overmatch -for -his -500 -raw -young -fellows -on -horseback -if -pluck -were -the -only -thing -essential -to -battle -winning -the -english -would -lose -no -battles -but -discretion -as -well -as -pluck -is -required -when -one -fights -boers -and -red -indians -in -south -africa -the -briton -has -always -insisted -upon -standing -bravely -up -unsheltered -before -the -hidden -boer -and -taking -the -results -jameson's -men -would -follow -the -custom -jameson -would -not -have -listened -to -me -he -would -have -been -intent -upon -repeating -history -according -to -precedent -americans -are -not -acquainted -with -the -british -boer -war -of -1881 -but -its -history -is -interesting -and -could -have -been -instructive -to -jameson -if -he -had -been -receptive -i -will -cull -some -details -of -it -from -trustworthy -sources -mainly -from -russell's -natal -mr -russell -is -not -a -boer -but -a -briton -he -is -inspector -of -schools -and -his -history -is -a -text -book -whose -purpose -is -the -instruction -of -the -natal -english -youth -after -the -seizure -of -the -transvaal -and -the -suppression -of -the -boer -government -by -england -in -1877 -the -boers -fretted -for -three -years -and -made -several -appeals -to -england -for -a -restoration -of -their -liberties -but -without -result -then -they -gathered -themselves -together -in -a -great -mass -meeting -at -krugersdorp -talked -their -troubles -over -and -resolved -to -fight -for -their -deliverance -from -the -british -yoke -krugersdorp -the -place -where -the -boers -interrupted -the -jameson -raid -the -little -handful -of -farmers -rose -against -the -strongest -empire -in -the -world -they -proclaimed -martial -law -and -the -re -establishment -of -their -republic -they -organized -their -forces -and -sent -them -forward -to -intercept -the -british -battalions -this -although -sir -garnet -wolseley -had -but -lately -made -proclamation -that -so -long -as -the -sun -shone -in -the -heavens -the -transvaal -would -be -and -remain -english -territory -and -also -in -spite -of -the -fact -that -the -commander -of -the -94th -regiment -already -on -the -march -to -suppress -this -rebellion -had -been -heard -to -say -that -the -boers -would -turn -tail -at -the -first -beat -of -the -big -drum -[ -south -africa -as -it -is -by -f -reginald -statham -page -82 -london -t -fisher -unwin -1897 -] -four -days -after -the -flag -raising -the -boer -force -which -had -been -sent -forward -to -forbid -the -invasion -of -the -english -troops -met -them -at -bronkhorst -spruit -246 -men -of -the -94th -regiment -in -command -of -a -colonel -the -big -drum -beating -the -band -playing -and -the -first -battle -was -fought -it -lasted -ten -minutes -result -british -loss -more -than -150 -officers -and -men -out -of -the -246 -surrender -of -the -remnant -boer -loss -if -any -not -stated -they -are -fine -marksmen -the -boers -from -the -cradle -up -they -live -on -horseback -and -hunt -wild -animals -with -the -rifle -they -have -a -passion -for -liberty -and -the -bible -and -care -for -nothing -else -general -sir -george -colley -lieutenant -governor -and -commander -in -chief -in -natal -felt -it -his -duty -to -proceed -at -once -to -the -relief -of -the -loyalists -and -soldiers -beleaguered -in -the -different -towns -of -the -transvaal -he -moved -out -with -1 -000 -men -and -some -artillery -he -found -the -boers -encamped -in -a -strong -and -sheltered -position -on -high -ground -at -laing's -nek -every -boer -behind -a -rock -early -in -the -morning -of -the -28th -january -1881 -he -moved -to -the -attack -with -the -58th -regiment -commanded -by -colonel -deane -a -mounted -squadron -of -70 -men -the -60th -rifles -the -naval -brigade -with -three -rocket -tubes -and -the -artillery -with -six -guns -he -shelled -the -boers -for -twenty -minutes -then -the -assault -was -delivered -the -58th -marching -up -the -slope -in -solid -column -the -battle -was -soon -finished -with -this -result -according -to -russell -british -loss -in -killed -and -wounded -174 -boer -loss -trifling -colonel -deane -was -killed -and -apparently -every -officer -above -the -grade -of -lieutenant -was -killed -or -wounded -for -the -58th -retreated -to -its -camp -in -command -of -a -lieutenant -africa -as -it -is -that -ended -the -second -battle -on -the -7th -of -february -general -colley -discovered -that -the -boers -were -flanking -his -position -the -next -morning -he -left -his -camp -at -mount -pleasant -and -marched -out -and -crossed -the -ingogo -river -with -270 -men -started -up -the -ingogo -heights -and -there -fought -a -battle -which -lasted -from -noon -till -nightfall -he -then -retreated -leaving -his -wounded -with -his -military -chaplain -and -in -recrossing -the -now -swollen -river -lost -some -of -his -men -by -drowning -that -was -the -third -boer -victory -result -according -to -mr -russell -british -loss -150 -out -of -270 -engaged -boer -loss -8 -killed -9 -wounded -17 -there -was -a -season -of -quiet -now -but -at -the -end -of -about -three -weeks -sir -george -colley -conceived -the -idea -of -climbing -with -an -infantry -and -artillery -force -the -steep -and -rugged -mountain -of -amajuba -in -the -night -a -bitter -hard -task -but -he -accomplished -it -on -the -way -he -left -about -200 -men -to -guard -a -strategic -point -and -took -about -400 -up -the -mountain -with -him -when -the -sun -rose -in -the -morning -there -was -an -unpleasant -surprise -for -the -boers -yonder -were -the -english -troops -visible -on -top -of -the -mountain -two -or -three -miles -away -and -now -their -own -position -was -at -the -mercy -of -the -english -artillery -the -boer -chief -resolved -to -retreat -up -that -mountain -he -asked -for -volunteers -and -got -them -the -storming -party -crossed -the -swale -and -began -to -creep -up -the -steeps -and -from -behind -rocks -and -bushes -they -shot -at -the -soldiers -on -the -skyline -as -if -they -were -stalking -deer -says -mr -russell -there -was -continuous -musketry -fire -steady -and -fatal -on -the -one -side -wild -and -ineffectual -on -the -other -the -boers -reached -the -top -and -began -to -put -in -their -ruinous -work -presently -the -british -broke -and -fled -for -their -lives -down -the -rugged -steep -the -boers -had -won -the -battle -result -in -killed -and -wounded -including -among -the -killed -the -british -general -british -loss -226 -out -of -400 -engaged -boer -loss -1 -killed -5 -wounded -that -ended -the -war -england -listened -to -reason -and -recognized -the -boer -republic -a -government -which -has -never -been -in -any -really -awful -danger -since -until -jameson -started -after -it -with -his -500 -raw -young -fellows -to -recapitulate -the -boer -farmers -and -british -soldiers -fought -4 -battles -and -the -boers -won -them -all -result -of -the -4 -in -killed -and -wounded -british -loss -700 -men -boer -loss -so -far -as -known -23 -men -it -is -interesting -now -to -note -how -loyally -jameson -and -his -several -trained -british -military -officers -tried -to -make -their -battles -conform -to -precedent -mr -garrett's -account -of -the -raid -is -much -the -best -one -i -have -met -with -and -my -impressions -of -the -raid -are -drawn -from -that -when -jameson -learned -that -near -krugersdorp -he -would -find -800 -boers -waiting -to -dispute -his -passage -he -was -not -in -the -least -disturbed -he -was -feeling -as -he -had -felt -two -or -three -days -before -when -he -had -opened -his -campaign -with -a -historic -remark -to -the -same -purport -as -the -one -with -which -the -commander -of -the -94th -had -opened -the -boer -british -war -of -fourteen -years -before -that -commander's -remark -was -that -the -boers -would -turn -tail -at -the -first -beat -of -the -big -drum -jameson's -was -that -with -his -raw -young -fellows -he -could -kick -the -persons -of -the -boers -all -round -the -transvaal -he -was -keeping -close -to -historic -precedent -jameson -arrived -in -the -presence -of -the -boers -they -according -to -precedent -were -not -visible -it -was -a -country -of -ridges -depressions -rocks -ditches -moraines -of -mining -tailings -not -even -as -favorable -for -cavalry -work -as -laing's -nek -had -been -in -the -former -disastrous -days -jameson -shot -at -the -ridges -and -rocks -with -his -artillery -just -as -general -colley -had -done -at -the -nek -and -did -them -no -damage -and -persuaded -no -boer -to -show -himself -then -about -a -hundred -of -his -men -formed -up -to -charge -the -ridge -according -to -the -58th's -precedent -at -the -nek -but -as -they -dashed -forward -they -opened -out -in -a -long -line -which -was -a -considerable -improvement -on -the -58th's -tactics -when -they -had -gotten -to -within -200 -yards -of -the -ridge -the -concealed -boers -opened -out -on -them -and -emptied -20 -saddles -the -unwounded -dismounted -and -fired -at -the -rocks -over -the -backs -of -their -horses -but -the -return -fire -was -too -hot -and -they -mounted -again -and -galloped -back -or -crawled -away -into -a -clump -of -reeds -for -cover -where -they -were -shortly -afterward -taken -prisoners -as -they -lay -among -the -reeds -some -thirty -prisoners -were -so -taken -and -during -the -night -which -followed -the -boers -carried -away -another -thirty -killed -and -wounded -the -wounded -to -krugersdorp -hospital -sixty -per -cent -of -the -assaulted -force -disposed -of -according -to -mr -garrett's -estimate -it -was -according -to -amajuba -precedent -where -the -british -loss -was -226 -out -of -about -400 -engaged -also -in -jameson's -camp -that -night -there -lay -about -30 -wounded -or -otherwise -disabled -men -also -during -the -night -some -30 -or -40 -young -fellows -got -separated -from -the -command -and -straggled -through -into -johannesburg -altogether -a -possible -150 -men -gone -out -of -his -530 -his -lads -had -fought -valorously -but -had -not -been -able -to -get -near -enough -to -a -boer -to -kick -him -around -the -transvaal -at -dawn -the -next -morning -the -column -of -something -short -of -400 -whites -resumed -its -march -jameson's -grit -was -stubbornly -good -indeed -it -was -always -that -he -still -had -hopes -there -was -a -long -and -tedious -zigzagging -march -through -broken -ground -with -constant -harassment -from -the -boers -and -at -last -the -column -walked -into -a -sort -of -trap -and -the -boers -closed -in -upon -it -men -and -horses -dropped -on -all -sides -in -the -column -the -feeling -grew -that -unless -it -could -burst -through -the -boer -lines -at -this -point -it -was -done -for -the -maxims -were -fired -until -they -grew -too -hot -and -water -failing -for -the -cool -jacket -five -of -them -jammed -and -went -out -of -action -the -7 -pounder -was -fired -until -only -half -an -hour's -ammunition -was -left -to -fire -with -one -last -rush -was -made -and -failed -and -then -the -staats -artillery -came -up -on -the -left -flank -and -the -game -was -up -jameson -hoisted -a -white -flag -and -surrendered -there -is -a -story -which -may -not -be -true -about -an -ignorant -boer -farmer -there -who -thought -that -this -white -flag -was -the -national -flag -of -england -he -had -been -at -bronkhorst -and -laing's -nek -and -ingogo -and -amajuba -and -supposed -that -the -english -did -not -run -up -their -flag -excepting -at -the -end -of -a -fight -the -following -is -as -i -understand -it -mr -garrett's -estimate -of -jameson's -total -loss -in -killed -and -wounded -for -the -two -days -when -they -gave -in -they -were -minus -some -20 -per -cent -of -combatants -there -were -76 -casualties -there -were -30 -men -hurt -or -sick -in -the -wagons -there -were -27 -killed -on -the -spot -or -mortally -wounded -total -133 -out -of -the -original -530 -it -is -just -25 -per -cent -[however -i -judge -that -the -total -was -really -150 -for -the -number -of -wounded -carried -to -krugersdorp -hospital -was -53 -not -30 -as -mr -garrett -reports -it -the -lady -whose -guest -i -was -in -krugerdorp -gave -me -the -figures -she -was -head -nurse -from -the -beginning -of -hostilities -jan -1 -until -the -professional -nurses -arrived -jan -8th -of -the -53 -three -or -four -were -boers -i -quote -her -words -] -this -is -a -large -improvement -upon -the -precedents -established -at -bronkhorst -laing's -nek -ingogo -and -amajuba -and -seems -to -indicate -that -boer -marksmanship -is -not -so -good -now -as -it -was -in -those -days -but -there -is -one -detail -in -which -the -raid -episode -exactly -repeats -history -by -surrender -at -bronkhorst -the -whole -british -force -disappeared -from -the -theater -of -war -this -was -the -case -with -jameson's -force -in -the -boer -loss -also -historical -precedent -is -followed -with -sufficient -fidelity -in -the -4 -battles -named -above -the -boer -loss -so -far -as -known -was -an -average -of -6 -men -per -battle -to -the -british -average -loss -of -175 -in -jameson's -battles -as -per -boer -official -report -the -boer -loss -in -killed -was -4 -two -of -these -were -killed -by -the -boers -themselves -by -accident -the -other -by -jameson's -army -one -of -them -intentionally -the -other -by -a -pathetic -mischance -a -young -boer -named -jacobz -was -moving -forward -to -give -a -drink -to -one -of -the -wounded -troopers -jameson's -after -the -first -charge -when -another -wounded -man -mistaking -his -intention -shot -him -there -were -three -or -four -wounded -boers -in -the -krugersdorp -hospital -and -apparently -no -others -have -been -reported -mr -garrett -on -a -balance -of -probabilities -fully -accepts -the -official -version -and -thanks -heaven -the -killed -was -not -larger -as -a -military -man -i -wish -to -point -out -what -seems -to -me -to -be -military -errors -in -the -conduct -of -the -campaign -which -we -have -just -been -considering -i -have -seen -active -service -in -the -field -and -it -was -in -the -actualities -of -war -that -i -acquired -my -training -and -my -right -to -speak -i -served -two -weeks -in -the -beginning -of -our -civil -war -and -during -all -that -tune -commanded -a -battery -of -infantry -composed -of -twelve -men -general -grant -knew -the -history -of -my -campaign -for -i -told -it -him -i -also -told -him -the -principle -upon -which -i -had -conducted -it -which -was -to -tire -the -enemy -i -tired -out -and -disqualified -many -battalions -yet -never -had -a -casualty -myself -nor -lost -a -man -general -grant -was -not -given -to -paying -compliments -yet -he -said -frankly -that -if -i -had -conducted -the -whole -war -much -bloodshed -would -have -been -spared -and -that -what -the -army -might -have -lost -through -the -inspiriting -results -of -collision -in -the -field -would -have -been -amply -made -up -by -the -liberalizing -influences -of -travel -further -endorsement -does -not -seem -to -me -to -be -necessary -let -us -now -examine -history -and -see -what -it -teaches -in -the -4 -battles -fought -in -1881 -and -the -two -fought -by -jameson -the -british -loss -in -killed -wounded -and -prisoners -was -substantially -1 -300 -men -the -boer -loss -as -far -as -is -ascertainable -eras -about -30 -men -these -figures -show -that -there -was -a -defect -somewhere -it -was -not -in -the -absence -of -courage -i -think -it -lay -in -the -absence -of -discretion -the -briton -should -have -done -one -thing -or -the -other -discarded -british -methods -and -fought -the -boer -with -boer -methods -or -augmented -his -own -force -until -using -british -methods -it -should -be -large -enough -to -equalize -results -with -the -boer -to -retain -the -british -method -requires -certain -things -determinable -by -arithmetic -if -for -argument's -sake -we -allow -that -the -aggregate -of -1 -716 -british -soldiers -engaged -in -the -4 -early -battles -was -opposed -by -the -same -aggregate -of -boers -we -have -this -result -the -british -loss -of -700 -and -the -boer -loss -of -23 -argues -that -in -order -to -equalize -results -in -future -battles -you -must -make -the -british -force -thirty -times -as -strong -as -the -boer -force -mr -garrett -shows -that -the -boer -force -immediately -opposed -to -jameson -was -2 -000 -and -that -there -were -6 -000 -more -on -hand -by -the -evening -of -the -second -day -arithmetic -shows -that -in -order -to -make -himself -the -equal -of -the -8 -000 -boers -jameson -should -have -had -240 -000 -men -whereas -he -merely -had -530 -boys -from -a -military -point -of -view -backed -by -the -facts -of -history -i -conceive -that -jameson's -military -judgment -was -at -fault -another -thing -jameson -was -encumbered -by -artillery -ammunition -and -rifles -the -facts -of -the -battle -show -that -he -should -have -had -none -of -those -things -along -they -were -heavy -they -were -in -his -way -they -impeded -his -march -there -was -nothing -to -shoot -at -but -rocks -he -knew -quite -well -that -there -would -be -nothing -to -shoot -at -but -rocks -and -he -knew -that -artillery -and -rifles -have -no -effect -upon -rocks -he -was -badly -overloaded -with -unessentials -he -had -8 -maxims -a -maxim -is -a -kind -of -gatling -i -believe -and -shoots -about -500 -bullets -per -minute -he -had -one -12 -1/2 -pounder -cannon -and -two -7 -pounders -also -145 -000 -rounds -of -ammunition -he -worked -the -maxims -so -hard -upon -the -rocks -that -five -of -them -became -disabled -five -of -the -maxims -not -the -rocks -it -is -believed -that -upwards -of -100 -000 -rounds -of -ammunition -of -the -various -kinds -were -fired -during -the -21 -hours -that -the -battles -lasted -one -man -killed -he -must -have -been -much -mutilated -it -was -a -pity -to -bring -those -futile -maxims -along -jameson -should -have -furnished -himself -with -a -battery -of -pudd'nhead -wilson -maxims -instead -they -are -much -more -deadly -than -those -others -and -they -are -easily -carried -because -they -have -no -weight -mr -garrett -not -very -carefully -concealing -a -smile -excuses -the -presence -of -the -maxims -by -saying -that -they -were -of -very -substantial -use -because -their -sputtering -disordered -the -aim -of -the -boers -and -in -that -way -saved -lives -three -cannon -eight -maxims -and -five -hundred -rifles -yielded -a -result -which -emphasized -a -fact -which -had -already -been -established -that -the -british -system -of -standing -out -in -the -open -to -fight -boers -who -are -behind -rocks -is -not -wise -not -excusable -and -ought -to -be -abandoned -for -something -more -efficacious -for -the -purpose -of -war -is -to -kill -not -merely -to -waste -ammunition -if -i -could -get -the -management -of -one -of -those -campaigns -i -would -know -what -to -do -for -i -have -studied -the -boer -he -values -the -bible -above -every -other -thing -the -most -delicious -edible -in -south -africa -is -biltong -you -will -have -seen -it -mentioned -in -olive -schreiner's -books -it -is -what -our -plainsmen -call -jerked -beef -it -is -the -boer's -main -standby -he -has -a -passion -for -it -and -he -is -right -if -i -had -the -command -of -the -campaign -i -would -go -with -rifles -only -no -cumbersome -maxims -and -cannon -to -spoil -good -rocks -with -i -would -move -surreptitiously -by -night -to -a -point -about -a -quarter -of -a -mile -from -the -boer -camp -and -there -i -would -build -up -a -pyramid -of -biltong -and -bibles -fifty -feet -high -and -then -conceal -my -men -all -about -in -the -morning -the -boers -would -send -out -spies -and -then -the -rest -would -come -with -a -rush -i -would -surround -them -and -they -would -have -to -fight -my -men -on -equal -terms -in -the -open -there -wouldn't -be -any -amajuba -results -[just -as -i -am -finishing -this -book -an -unfortunate -dispute -has -sprung -up -between -dr -jameson -and -his -officers -on -the -one -hand -and -colonel -rhodes -on -the -other -concerning -the -wording -of -a -note -which -colonel -rhodes -sent -from -johannesburg -by -a -cyclist -to -jameson -just -before -hostilities -began -on -the -memorable -new -year's -day -some -of -the -fragments -of -this -note -were -found -on -the -battlefield -after -the -fight -and -these -have -been -pieced -together -the -dispute -is -as -to -what -words -the -lacking -fragments -contained -jameson -says -the -note -promised -him -a -reinforcement -of -300 -men -from -johannesburg -colonel -rhodes -denies -this -and -says -he -merely -promised -to -send -out -some -men -to -meet -you -] -[it -seems -a -pity -that -these -friends -should -fall -out -over -so -little -a -thing -if -the -300 -had -been -sent -what -good -would -it -have -done -in -21 -hours -of -industrious -fighting -jameson's -530 -men -with -8 -maxims -3 -cannon -and -145 -000 -rounds -of -ammunition -killed -an -aggregate -of -1 -boer -these -statistics -show -that -a -reinforcement -of -300 -johannesburgers -armed -merely -with -muskets -would -have -killed -at -the -outside -only -a -little -over -a -half -of -another -boer -this -would -not -have -saved -the -day -it -would -not -even -have -seriously -affected -the -general -result -the -figures -show -clearly -and -with -mathematical -violence -that -the -only -way -to -save -jameson -or -even -give -him -a -fair -and -equal -chance -with -the -enemy -was -for -johannesburg -to -send -him -240 -maxims -90 -cannon -600 -carloads -of -ammunition -and -240 -000 -men -johannesburg -was -not -in -a -position -to -do -this -johannesburg -has -been -called -very -hard -names -for -not -reinforcing -jameson -but -in -every -instance -this -has -been -done -by -two -classes -of -persons -people -who -do -not -read -history -and -people -like -jameson -who -do -not -understand -what -it -means -after -they -have -read -it -] -chapter -lxviii -none -of -us -can -have -as -many -virtues -as -the -fountain -pen -or -half -its -cussedness -but -we -can -try -pudd'nhead -wilson's -new -calendar -the -duke -of -fife -has -borne -testimony -that -mr -rhodes -deceived -him -that -is -also -what -mr -rhodes -did -with -the -reformers -he -got -them -into -trouble -and -then -stayed -out -himself -a -judicious -man -he -has -always -been -that -as -to -this -there -was -a -moment -of -doubt -once -it -was -when -he -was -out -on -his -last -pirating -expedition -in -the -matabele -country -the -cable -shouted -out -that -he -had -gone -unarmed -to -visit -a -party -of -hostile -chiefs -it -was -true -too -and -this -dare -devil -thing -came -near -fetching -another -indiscretion -out -of -the -poet -laureate -it -would -have -been -too -bad -for -when -the -facts -were -all -in -it -turned -out -that -there -was -a -lady -along -too -and -she -also -was -unarmed -in -the -opinion -of -many -people -mr -rhodes -is -south -africa -others -think -he -is -only -a -large -part -of -it -these -latter -consider -that -south -africa -consists -of -table -mountain -the -diamond -mines -the -johannesburg -gold -fields -and -cecil -rhodes -the -gold -fields -are -wonderful -in -every -way -in -seven -or -eight -years -they -built -up -in -a -desert -a -city -of -a -hundred -thousand -inhabitants -counting -white -and -black -together -and -not -the -ordinary -mining -city -of -wooden -shanties -but -a -city -made -out -of -lasting -material -nowhere -in -the -world -is -there -such -a -concentration -of -rich -mines -as -at -johannesburg -mr -bonamici -my -manager -there -gave -me -a -small -gold -brick -with -some -statistics -engraved -upon -it -which -record -the -output -of -gold -from -the -early -days -to -july -1895 -and -exhibit -the -strides -which -have -been -made -in -the -development -of -the -industry -in -1888 -the -output -was -$4 -162 -440 -the -output -of -the -next -five -and -a -half -years -was -total -$17 -585 -894 -for -the -single -year -ending -with -june -1895 -it -was -$45 -553 -700 -the -capital -which -has -developed -the -mines -came -from -england -the -mining -engineers -from -america -this -is -the -case -with -the -diamond -mines -also -south -africa -seems -to -be -the -heaven -of -the -american -scientific -mining -engineer -he -gets -the -choicest -places -and -keeps -them -his -salary -is -not -based -upon -what -he -would -get -in -america -but -apparently -upon -what -a -whole -family -of -him -would -get -there -the -successful -mines -pay -great -dividends -yet -the -rock -is -not -rich -from -a -californian -point -of -view -rock -which -yields -ten -or -twelve -dollars -a -ton -is -considered -plenty -rich -enough -it -is -troubled -with -base -metals -to -such -a -degree -that -twenty -years -ago -it -would -have -been -only -about -half -as -valuable -as -it -is -now -for -at -that -time -there -was -no -paying -way -of -getting -anything -out -of -such -rock -but -the -coarser -grained -free -gold -but -the -new -cyanide -process -has -changed -all -that -and -the -gold -fields -of -the -world -now -deliver -up -fifty -million -dollars' -worth -of -gold -per -year -which -would -have -gone -into -the -tailing -pile -under -the -former -conditions -the -cyanide -process -was -new -to -me -and -full -of -interest -and -among -the -costly -and -elaborate -mining -machinery -there -were -fine -things -which -were -new -to -me -but -i -was -already -familiar -with -the -rest -of -the -details -of -the -gold -mining -industry -i -had -been -a -gold -miner -myself -in -my -day -and -knew -substantially -everything -that -those -people -knew -about -it -except -how -to -make -money -at -it -but -i -learned -a -good -deal -about -the -boers -there -and -that -was -a -fresh -subject -what -i -heard -there -was -afterwards -repeated -to -me -in -other -parts -of -south -africa -summed -up -according -to -the -information -thus -gained -this -is -the -boer -he -is -deeply -religious -profoundly -ignorant -dull -obstinate -bigoted -uncleanly -in -his -habits -hospitable -honest -in -his -dealings -with -the -whites -a -hard -master -to -his -black -servant -lazy -a -good -shot -good -horseman -addicted -to -the -chase -a -lover -of -political -independence -a -good -husband -and -father -not -fond -of -herding -together -in -towns -but -liking -the -seclusion -and -remoteness -and -solitude -and -empty -vastness -and -silence -of -the -veldt -a -man -of -a -mighty -appetite -and -not -delicate -about -what -he -appeases -it -with -well -satisfied -with -pork -and -indian -corn -and -biltong -requiring -only -that -the -quantity -shall -not -be -stinted -willing -to -ride -a -long -journey -to -take -a -hand -in -a -rude -all -night -dance -interspersed -with -vigorous -feeding -and -boisterous -jollity -but -ready -to -ride -twice -as -far -for -a -prayer -meeting -proud -of -his -dutch -and -huguenot -origin -and -its -religious -and -military -history -proud -of -his -race's -achievements -in -south -africa -its -bold -plunges -into -hostile -and -uncharted -deserts -in -search -of -free -solitudes -unvexed -by -the -pestering -and -detested -english -also -its -victories -over -the -natives -and -the -british -proudest -of -all -of -the -direct -and -effusive -personal -interest -which -the -deity -has -always -taken -in -its -affairs -he -cannot -read -he -cannot -write -he -has -one -or -two -newspapers -but -he -is -apparently -not -aware -of -it -until -latterly -he -had -no -schools -and -taught -his -children -nothing -news -is -a -term -which -has -no -meaning -to -him -and -the -thing -itself -he -cares -nothing -about -he -hates -to -be -taxed -and -resents -it -he -has -stood -stock -still -in -south -africa -for -two -centuries -and -a -half -and -would -like -to -stand -still -till -the -end -of -time -for -he -has -no -sympathy -with -uitlander -notions -of -progress -he -is -hungry -to -be -rich -for -he -is -human -but -his -preference -has -been -for -riches -in -cattle -not -in -fine -clothes -and -fine -houses -and -gold -and -diamonds -the -gold -and -the -diamonds -have -brought -the -godless -stranger -within -his -gates -also -contamination -and -broken -repose -and -he -wishes -that -they -had -never -been -discovered -i -think -that -the -bulk -of -those -details -can -be -found -in -olive -schreiner's -books -and -she -would -not -be -accused -of -sketching -the -boer's -portrait -with -an -unfair -hand -now -what -would -you -expect -from -that -unpromising -material -what -ought -you -to -expect -from -it -laws -inimical -to -religious -liberty -yes -laws -denying -representation -and -suffrage -to -the -intruder -yes -laws -unfriendly -to -educational -institutions -yes -laws -obstructive -of -gold -production -yes -discouragement -of -railway -expansion -yes -laws -heavily -taxing -the -intruder -and -overlooking -the -boer -yes -the -uitlander -seems -to -have -expected -something -very -different -from -all -that -i -do -not -know -why -nothing -different -from -it -was -rationally -to -be -expected -a -round -man -cannot -be -expected -to -fit -a -square -hole -right -away -he -must -have -time -to -modify -his -shape -the -modification -had -begun -in -a -detail -or -two -before -the -raid -and -was -making -some -progress -it -has -made -further -progress -since -there -are -wise -men -in -the -boer -government -and -that -accounts -for -the -modification -the -modification -of -the -boer -mass -has -probably -not -begun -yet -if -the -heads -of -the -boer -government -had -not -been -wise -men -they -would -have -hanged -jameson -and -thus -turned -a -very -commonplace -pirate -into -a -holy -martyr -but -even -their -wisdom -has -its -limits -and -they -will -hang -mr -rhodes -if -they -ever -catch -him -that -will -round -him -and -complete -him -and -make -him -a -saint -he -has -already -been -called -by -all -other -titles -that -symbolize -human -grandeur -and -he -ought -to -rise -to -this -one -the -grandest -of -all -it -will -be -a -dizzy -jump -from -where -he -is -now -but -that -is -nothing -it -will -land -him -in -good -company -and -be -a -pleasant -change -for -him -some -of -the -things -demanded -by -the -johannesburgers' -manifesto -have -been -conceded -since -the -days -of -the -raid -and -the -others -will -follow -in -time -no -doubt -it -was -most -fortunate -for -the -miners -of -johannesburg -that -the -taxes -which -distressed -them -so -much -were -levied -by -the -boer -government -instead -of -by -their -friend -rhodes -and -his -chartered -company -of -highwaymen -for -these -latter -take -half -of -whatever -their -mining -victims -find -they -do -not -stop -at -a -mere -percentage -if -the -johannesburg -miners -were -under -their -jurisdiction -they -would -be -in -the -poorhouse -in -twelve -months -i -have -been -under -the -impression -all -along -that -i -had -an -unpleasant -paragraph -about -the -boers -somewhere -in -my -notebook -and -also -a -pleasant -one -i -have -found -them -now -the -unpleasant -one -is -dated -at -an -interior -village -and -says -mr -z -called -he -is -an -english -afrikander -is -an -old -resident -and -has -a -boer -wife -he -speaks -the -language -and -his -professional -business -is -with -the -boers -exclusively -he -told -me -that -the -ancient -boer -families -in -the -great -region -of -which -this -village -is -the -commercial -center -are -falling -victims -to -their -inherited -indolence -and -dullness -in -the -materialistic -latter -day -race -and -struggle -and -are -dropping -one -by -one -into -the -grip -of -the -usurer -getting -hopelessly -in -debt -and -are -losing -their -high -place -and -retiring -to -second -and -lower -the -boer's -farm -does -not -go -to -another -boer -when -he -loses -it -but -to -a -foreigner -some -have -fallen -so -low -that -they -sell -their -daughters -to -the -blacks -under -date -of -another -south -african -town -i -find -the -note -which -is -creditable -to -the -boers -dr -x -told -me -that -in -the -kafir -war -1 -500 -kafirs -took -refuge -in -a -great -cave -in -the -mountains -about -90 -miles -north -of -johannesburg -and -the -boers -blocked -up -the -entrance -and -smoked -them -to -death -dr -x -has -been -in -there -and -seen -the -great -array -of -bleached -skeletons -one -a -woman -with -the -skeleton -of -a -child -hugged -to -her -breast -the -great -bulk -of -the -savages -must -go -the -white -man -wants -their -lands -and -all -must -go -excepting -such -percentage -of -them -as -he -will -need -to -do -his -work -for -him -upon -terms -to -be -determined -by -himself -since -history -has -removed -the -element -of -guesswork -from -this -matter -and -made -it -certainty -the -humanest -way -of -diminishing -the -black -population -should -be -adopted -not -the -old -cruel -ways -of -the -past -mr -rhodes -and -his -gang -have -been -following -the -old -ways -they -are -chartered -to -rob -and -slay -and -they -lawfully -do -it -but -not -in -a -compassionate -and -christian -spirit -they -rob -the -mashonas -and -the -matabeles -of -a -portion -of -their -territories -in -the -hallowed -old -style -of -purchase! -for -a -song -and -then -they -force -a -quarrel -and -take -the -rest -by -the -strong -hand -they -rob -the -natives -of -their -cattle -under -the -pretext -that -all -the -cattle -in -the -country -belonged -to -the -king -whom -they -have -tricked -and -assassinated -they -issue -regulations -requiring -the -incensed -and -harassed -natives -to -work -for -the -white -settlers -and -neglect -their -own -affairs -to -do -it -this -is -slavery -and -is -several -times -worse -than -was -the -american -slavery -which -used -to -pain -england -so -much -for -when -this -rhodesian -slave -is -sick -super -annuated -or -otherwise -disabled -he -must -support -himself -or -starve -his -master -is -under -no -obligation -to -support -him -the -reduction -of -the -population -by -rhodesian -methods -to -the -desired -limit -is -a -return -to -the -old -time -slow -misery -and -lingering -death -system -of -a -discredited -time -and -a -crude -civilization -we -humanely -reduce -an -overplus -of -dogs -by -swift -chloroform -the -boer -humanely -reduced -an -overplus -of -blacks -by -swift -suffocation -the -nameless -but -right -hearted -australian -pioneer -humanely -reduced -his -overplus -of -aboriginal -neighbors -by -a -sweetened -swift -death -concealed -in -a -poisoned -pudding -all -these -are -admirable -and -worthy -of -praise -you -and -i -would -rather -suffer -either -of -these -deaths -thirty -times -over -in -thirty -successive -days -than -linger -out -one -of -the -rhodesian -twenty -year -deaths -with -its -daily -burden -of -insult -humiliation -and -forced -labor -for -a -man -whose -entire -race -the -victim -hates -rhodesia -is -a -happy -name -for -that -land -of -piracy -and -pillage -and -puts -the -right -stain -upon -it -several -long -journeys -gave -us -experience -of -the -cape -colony -railways -easy -riding -fine -cars -all -the -conveniences -thorough -cleanliness -comfortable -beds -furnished -for -the -night -trains -it -was -in -the -first -days -of -june -and -winter -the -daytime -was -pleasant -the -nighttime -nice -and -cold -spinning -along -all -day -in -the -cars -it -was -ecstasy -to -breathe -the -bracing -air -and -gaze -out -over -the -vast -brown -solitudes -of -the -velvet -plains -soft -and -lovely -near -by -still -softer -and -lovelier -further -away -softest -and -loveliest -of -all -in -the -remote -distances -where -dim -island -hills -seemed -afloat -as -in -a -sea -a -sea -made -of -dream -stuff -and -flushed -with -colors -faint -and -rich -and -dear -me -the -depth -of -the -sky -and -the -beauty -of -the -strange -new -cloud -forms -and -the -glory -of -the -sunshine -the -lavishness -the -wastefulness -of -it! -the -vigor -and -freshness -and -inspiration -of -the -air -and -the -sunwell -it -was -all -just -as -olive -schreiner -had -made -it -in -her -books -to -me -the -veldt -in -its -sober -winter -garb -was -surpassingly -beautiful -there -were -unlevel -stretches -where -it -was -rolling -and -swelling -and -rising -and -subsiding -and -sweeping -superbly -on -and -on -and -still -on -and -on -like -an -ocean -toward -the -faraway -horizon -its -pale -brown -deepening -by -delicately -graduated -shades -to -rich -orange -and -finally -to -purple -and -crimson -where -it -washed -against -the -wooded -hills -and -naked -red -crags -at -the -base -of -the -sky -everywhere -from -cape -town -to -kimberley -and -from -kimberley -to -port -elizabeth -and -east -london -the -towns -were -well -populated -with -tamed -blacks -tamed -and -christianized -too -i -suppose -for -they -wore -the -dowdy -clothes -of -our -christian -civilization -but -for -that -many -of -them -would -have -been -remarkably -handsome -these -fiendish -clothes -together -with -the -proper -lounging -gait -good -natured -face -happy -air -and -easy -laugh -made -them -precise -counterparts -of -our -american -blacks -often -where -all -the -other -aspects -were -strikingly -and -harmoniously -and -thrillingly -african -a -flock -of -these -natives -would -intrude -looking -wholly -out -of -place -and -spoil -it -all -making -the -thing -a -grating -discord -half -african -and -half -american -one -sunday -in -king -william's -town -a -score -of -colored -women -came -mincing -across -the -great -barren -square -dressed -oh -in -the -last -perfection -of -fashion -and -newness -and -expensiveness -and -showy -mixture -of -unrelated -colors -all -just -as -i -had -seen -it -so -often -at -home -and -in -their -faces -and -their -gait -was -that -languishing -aristocratic -divine -delight -in -their -finery -which -was -so -familiar -to -me -and -had -always -been -such -a -satisfaction -to -my -eye -and -my -heart -i -seemed -among -old -old -friends -friends -of -fifty -years -and -i -stopped -and -cordially -greeted -them -they -broke -into -a -good -fellowship -laugh -flashing -their -white -teeth -upon -me -and -all -answered -at -once -i -did -not -understand -a -word -they -said -i -was -astonished -i -was -not -dreaming -that -they -would -answer -in -anything -but -american -the -voices -too -of -the -african -women -were -familiar -to -me -sweet -and -musical -just -like -those -of -the -slave -women -of -my -early -days -i -followed -a -couple -of -them -all -over -the -orange -free -state -no -over -its -capital -bloemfontein -to -hear -their -liquid -voices -and -the -happy -ripple -of -their -laughter -their -language -was -a -large -improvement -upon -american -also -upon -the -zulu -it -had -no -zulu -clicks -in -it -and -it -seemed -to -have -no -angles -or -corners -no -roughness -no -vile -s's -or -other -hissing -sounds -but -was -very -very -mellow -and -rounded -and -flowing -in -moving -about -the -country -in -the -trains -i -had -opportunity -to -see -a -good -many -boers -of -the -veldt -one -day -at -a -village -station -a -hundred -of -them -got -out -of -the -third -class -cars -to -feed -their -clothes -were -very -interesting -for -ugliness -of -shapes -and -for -miracles -of -ugly -colors -inharmoniously -associated -they -were -a -record -the -effect -was -nearly -as -exciting -and -interesting -as -that -produced -by -the -brilliant -and -beautiful -clothes -and -perfect -taste -always -on -view -at -the -indian -railway -stations -one -man -had -corduroy -trousers -of -a -faded -chewing -gum -tint -and -they -were -new -showing -that -this -tint -did -not -come -by -calamity -but -was -intentional -the -very -ugliest -color -i -have -ever -seen -a -gaunt -shackly -country -lout -six -feet -high -in -battered -gray -slouched -hat -with -wide -brim -and -old -resin -colored -breeches -had -on -a -hideous -brand -new -woolen -coat -which -was -imitation -tiger -skin -wavy -broad -stripes -of -dazzling -yellow -and -deep -brown -i -thought -he -ought -to -be -hanged -and -asked -the -station -master -if -it -could -be -arranged -he -said -no -and -not -only -that -but -said -it -rudely -said -it -with -a -quite -unnecessary -show -of -feeling -then -he -muttered -something -about -my -being -a -jackass -and -walked -away -and -pointed -me -out -to -people -and -did -everything -he -could -to -turn -public -sentiment -against -me -it -is -what -one -gets -for -trying -to -do -good -in -the -train -that -day -a -passenger -told -me -some -more -about -boer -life -out -in -the -lonely -veldt -he -said -the -boer -gets -up -early -and -sets -his -niggers -at -their -tasks -pasturing -the -cattle -and -watching -them -eats -smokes -drowses -sleeps -toward -evening -superintends -the -milking -etc -eats -smokes -drowses -goes -to -bed -at -early -candlelight -in -the -fragrant -clothes -he -and -she -have -worn -all -day -and -every -week -day -for -years -i -remember -that -last -detail -in -olive -schreiner's -story -of -an -african -farm -and -the -passenger -told -me -that -the -boers -were -justly -noted -for -their -hospitality -he -told -me -a -story -about -it -he -said -that -his -grace -the -bishop -of -a -certain -see -was -once -making -a -business -progress -through -the -tavernless -veldt -and -one -night -he -stopped -with -a -boer -after -supper -was -shown -to -bed -he -undressed -weary -and -worn -out -and -was -soon -sound -asleep -in -the -night -he -woke -up -feeling -crowded -and -suffocated -and -found -the -old -boer -and -his -fat -wife -in -bed -with -him -one -on -each -side -with -all -their -clothes -on -and -snoring -he -had -to -stay -there -and -stand -it -awake -and -suffering -until -toward -dawn -when -sleep -again -fell -upon -him -for -an -hour -then -he -woke -again -the -boer -was -gone -but -the -wife -was -still -at -his -side -those -reformers -detested -that -boer -prison -they -were -not -used -to -cramped -quarters -and -tedious -hours -and -weary -idleness -and -early -to -bed -and -limited -movement -and -arbitrary -and -irritating -rules -and -the -absence -of -the -luxuries -which -wealth -comforts -the -day -and -the -night -with -the -confinement -told -upon -their -bodies -and -their -spirits -still -they -were -superior -men -and -they -made -the -best -that -was -to -be -made -of -the -circumstances -their -wives -smuggled -delicacies -to -them -which -helped -to -smooth -the -way -down -for -the -prison -fare -in -the -train -mr -b -told -me -that -the -boer -jail -guards -treated -the -black -prisoners -even -political -ones -mercilessly -an -african -chief -and -his -following -had -been -kept -there -nine -months -without -trial -and -during -all -that -time -they -had -been -without -shelter -from -rain -and -sun -he -said -that -one -day -the -guards -put -a -big -black -in -the -stocks -for -dashing -his -soup -on -the -ground -they -stretched -his -legs -painfully -wide -apart -and -set -him -with -his -back -down -hill -he -could -not -endure -it -and -put -back -his -hands -upon -the -slope -for -a -support -the -guard -ordered -him -to -withdraw -the -support -and -kicked -him -in -the -back -then -said -mr -b -'the -powerful -black -wrenched -the -stocks -asunder -and -went -for -the -guard -a -reform -prisoner -pulled -him -off -and -thrashed -the -guard -himself -chapter -lxix -the -very -ink -with -which -all -history -is -written -is -merely -fluid -prejudice -pudd'nhead -wilsons's -new -calendar -there -isn't -a -parallel -of -latitude -but -thinks -it -would -have -been -the -equator -if -it -had -had -its -rights -pudd'nhead -wilson's -new -calendar -next -to -mr -rhodes -to -me -the -most -interesting -convulsion -of -nature -in -south -africa -was -the -diamond -crater -the -rand -gold -fields -are -a -stupendous -marvel -and -they -make -all -other -gold -fields -small -but -i -was -not -a -stranger -to -gold -mining -the -veldt -was -a -noble -thing -to -see -but -it -was -only -another -and -lovelier -variety -of -our -great -plains -the -natives -were -very -far -from -being -uninteresting -but -they -were -not -new -and -as -for -the -towns -i -could -find -my -way -without -a -guide -through -the -most -of -them -because -i -had -learned -the -streets -under -other -names -in -towns -just -like -them -in -other -lands -but -the -diamond -mine -was -a -wholly -fresh -thing -a -splendid -and -absorbing -novelty -very -few -people -in -the -world -have -seen -the -diamond -in -its -home -it -has -but -three -or -four -homes -in -the -world -whereas -gold -has -a -million -it -is -worth -while -to -journey -around -the -globe -to -see -anything -which -can -truthfully -be -called -a -novelty -and -the -diamond -mine -is -the -greatest -and -most -select -and -restricted -novelty -which -the -globe -has -in -stock -the -kimberley -diamond -deposits -were -discovered -about -1869 -i -think -when -everything -is -taken -into -consideration -the -wonder -is -that -they -were -not -discovered -five -thousand -years -ago -and -made -familiar -to -the -african -world -for -the -rest -of -time -for -this -reason -the -first -diamonds -were -found -on -the -surface -of -the -ground -they -were -smooth -and -limpid -and -in -the -sunlight -they -vomited -fire -they -were -the -very -things -which -an -african -savage -of -any -era -would -value -above -every -other -thing -in -the -world -excepting -a -glass -bead -for -two -or -three -centuries -we -have -been -buying -his -lands -his -cattle -his -neighbor -and -any -other -thing -he -had -for -sale -for -glass -beads -and -so -it -is -strange -that -he -was -indifferent -to -the -diamonds -for -he -must -have -pickets -them -up -many -and -many -a -time -it -would -not -occur -to -him -to -try -to -sell -them -to -whites -of -course -since -the -whites -already -had -plenty -of -glass -beads -and -more -fashionably -shaped -too -than -these -but -one -would -think -that -the -poorer -sort -of -black -who -could -not -afford -real -glass -would -have -been -humbly -content -to -decorate -himself -with -the -imitation -and -that -presently -the -white -trader -would -notice -the -things -and -dimly -suspect -and -carry -some -of -them -home -and -find -out -what -they -were -and -at -once -empty -a -multitude -of -fortune -hunters -into -africa -there -are -many -strange -things -in -human -history -one -of -the -strangest -is -that -the -sparkling -diamonds -laid -there -so -long -without -exciting -any -one's -interest -the -revelation -came -at -last -by -accident -in -a -boer's -hut -out -in -the -wide -solitude -of -the -plains -a -traveling -stranger -noticed -a -child -playing -with -a -bright -object -and -was -told -it -was -a -piece -of -glass -which -had -been -found -in -the -veldt -the -stranger -bought -it -for -a -trifle -and -carried -it -away -and -being -without -honor -made -another -stranger -believe -it -was -a -diamond -and -so -got -$125 -out -of -him -for -it -and -was -as -pleased -with -himself -as -if -he -had -done -a -righteous -thing -in -paris -the -wronged -stranger -sold -it -to -a -pawnshop -for -$10 -000 -who -sold -it -to -a -countess -for -$90 -000 -who -sold -it -to -a -brewer -for -$800 -000 -who -traded -it -to -a -king -for -a -dukedom -and -a -pedigree -and -the -king -put -it -up -the -spout -[handwritten -note -from -the -greek -meaning -'pawned -it -' -m -t -] -i -know -these -particulars -to -be -correct -the -news -flew -around -and -the -south -african -diamond -boom -began -the -original -traveler -the -dishonest -one -now -remembered -that -he -had -once -seen -a -boer -teamster -chocking -his -wagon -wheel -on -a -steep -grade -with -a -diamond -as -large -as -a -football -and -he -laid -aside -his -occupations -and -started -out -to -hunt -for -it -but -not -with -the -intention -of -cheating -anybody -out -of -$125 -with -it -for -he -had -reformed -we -now -come -to -matters -more -didactic -diamonds -are -not -imbedded -in -rock -ledges -fifty -miles -long -like -the -johannesburg -gold -but -are -distributed -through -the -rubbish -of -a -filled -up -well -so -to -speak -the -well -is -rich -its -walls -are -sharply -defined -outside -of -the -walls -are -no -diamonds -the -well -is -a -crater -and -a -large -one -before -it -had -been -meddled -with -its -surface -was -even -with -the -level -plain -and -there -was -no -sign -to -suggest -that -it -was -there -the -pasturage -covering -the -surface -of -the -kimberley -crater -was -sufficient -for -the -support -of -a -cow -and -the -pasturage -underneath -was -sufficient -for -the -support -of -a -kingdom -but -the -cow -did -not -know -it -and -lost -her -chance -the -kimberley -crater -is -roomy -enough -to -admit -the -roman -coliseum -the -bottom -of -the -crater -has -not -been -reached -and -no -one -can -tell -how -far -down -in -the -bowels -of -the -earth -it -goes -originally -it -was -a -perpendicular -hole -packed -solidly -full -of -blue -rock -or -cement -and -scattered -through -that -blue -mass -like -raisins -in -a -pudding -were -the -diamonds -as -deep -down -in -the -earth -as -the -blue -stuff -extends -so -deep -will -the -diamonds -be -found -there -are -three -or -four -other -celebrated -craters -near -by -a -circle -three -miles -in -diameter -would -enclose -them -all -they -are -owned -by -the -de -beers -company -a -consolidation -of -diamond -properties -arranged -by -mr -rhodes -twelve -or -fourteen -years -ago -the -de -beers -owns -other -craters -they -are -under -the -grass -but -the -de -beers -knows -where -they -are -and -will -open -them -some -day -if -the -market -should -require -it -originally -the -diamond -deposits -were -the -property -of -the -orange -free -state -but -a -judicious -rectification -of -the -boundary -line -shifted -them -over -into -the -british -territory -of -cape -colony -a -high -official -of -the -free -state -told -me -that -the -sum -of -$4 -00 -000 -was -handed -to -his -commonwealth -as -a -compromise -or -indemnity -or -something -of -the -sort -and -that -he -thought -his -commonwealth -did -wisely -to -take -the -money -and -keep -out -of -a -dispute -since -the -power -was -all -on -the -one -side -and -the -weakness -all -on -the -other -the -de -beers -company -dig -out -$400 -000 -worth -of -diamonds -per -week -now -the -cape -got -the -territory -but -no -profit -for -mr -rhodes -and -the -rothschilds -and -the -other -de -beers -people -own -the -mines -and -they -pay -no -taxes -in -our -day -the -mines -are -worked -upon -scientific -principles -under -the -guidance -of -the -ablest -mining -engineering -talent -procurable -in -america -there -are -elaborate -works -for -reducing -the -blue -rock -and -passing -it -through -one -process -after -another -until -every -diamond -it -contains -has -been -hunted -down -and -secured -i -watched -the -concentrators -at -work -big -tanks -containing -mud -and -water -and -invisible -diamonds -and -was -told -that -each -could -stir -and -churn -and -properly -treat -300 -car -loads -of -mud -per -day -1 -600 -pounds -to -the -car -load -and -reduce -it -to -3 -car -loads -of -slush -i -saw -the -3 -carloads -of -slush -taken -to -the -pulsators -and -there -reduced -to -quarter -of -a -load -of -nice -clean -dark -colored -sand -then -i -followed -it -to -the -sorting -tables -and -saw -the -men -deftly -and -swiftly -spread -it -out -and -brush -it -about -and -seize -the -diamonds -as -they -showed -up -i -assisted -and -once -i -found -a -diamond -half -as -large -as -an -almond -it -is -an -exciting -kind -of -fishing -and -you -feel -a -fine -thrill -of -pleasure -every -time -you -detect -the -glow -of -one -of -those -limpid -pebbles -through -the -veil -of -dark -sand -i -would -like -to -spend -my -saturday -holidays -in -that -charming -sport -every -now -and -then -of -course -there -are -disappointments -sometimes -you -find -a -diamond -which -is -not -a -diamond -it -is -only -a -quartz -crystal -or -some -such -worthless -thing -the -expert -can -generally -distinguish -it -from -the -precious -stone -which -it -is -counterfeiting -but -if -he -is -in -doubt -he -lays -it -on -a -flatiron -and -hits -it -with -a -sledgehammer -if -it -is -a -diamond -it -holds -its -own -if -it -is -anything -else -it -is -reduced -to -powder -i -liked -that -experiment -very -much -and -did -not -tire -of -repetitions -of -it -it -was -full -of -enjoyable -apprehensions -unmarred -by -any -personal -sense -of -risk -the -de -beers -concern -treats -8 -000 -carloads -about -6 -000 -tons -of -blue -rock -per -day -and -the -result -is -three -pounds -of -diamonds -value -uncut -$50 -000 -to -$70 -000 -after -cutting -they -will -weigh -considerably -less -than -a -pound -but -will -be -worth -four -or -five -times -as -much -as -they -were -before -all -the -plain -around -that -region -is -spread -over -a -foot -deep -with -blue -rock -placed -there -by -the -company -and -looks -like -a -plowed -field -exposure -for -a -length -of -time -make -the -rock -easier -to -work -than -it -is -when -it -comes -out -of -the -mine -if -mining -should -cease -now -the -supply -of -rock -spread -over -those -fields -would -furnish -the -usual -8 -000 -car -loads -per -day -to -the -separating -works -during -three -years -the -fields -are -fenced -and -watched -and -at -night -they -are -under -the -constant -inspection -of -lofty -electric -searchlight -they -contain -fifty -or -sixty -million -dollars' -worth' -of -diamonds -and -there -is -an -abundance -of -enterprising -thieves -around -in -the -dirt -of -the -kimberley -streets -there -is -much -hidden -wealth -some -time -ago -the -people -were -granted -the -privilege -of -a -free -wash -up -there -was -a -general -rush -the -work -was -done -with -thoroughness -and -a -good -harvest -of -diamonds -was -gathered -the -deep -mining -is -done -by -natives -there -are -many -hundreds -of -them -they -live -in -quarters -built -around -the -inside -of -a -great -compound -they -are -a -jolly -and -good -natured -lot -and -accommodating -they -performed -a -war -dance -for -us -which -was -the -wildest -exhibition -i -have -ever -seen -they -are -not -allowed -outside -of -the -compound -during -their -term -of -service -three -months -i -think -it -is -as -a -rule -they -go -down -the -shaft -stand -their -watch -come -up -again -are -searched -and -go -to -bed -or -to -their -amusements -in -the -compound -and -this -routine -they -repeat -day -in -and -day -out -it -is -thought -that -they -do -not -now -steal -many -diamonds -successfully -they -used -to -swallow -them -and -find -other -ways -of -concealing -them -but -the -white -man -found -ways -of -beating -their -various -games -one -man -cut -his -leg -and -shoved -a -diamond -into -the -wound -but -even -that -project -did -not -succeed -when -they -find -a -fine -large -diamond -they -are -more -likely -to -report -it -than -to -steal -it -for -in -the -former -case -they -get -a -reward -and -in -the -latter -they -are -quite -apt -to -merely -get -into -trouble -some -years -ago -in -a -mine -not -owned -by -the -de -beers -a -black -found -what -has -been -claimed -to -be -the -largest -diamond -known -to -the -world's -history -and -as -a -reward -he -was -released -from -service -and -given -a -blanket -a -horse -and -five -hundred -dollars -it -made -him -a -vanderbilt -he -could -buy -four -wives -and -have -money -left -four -wives -are -an -ample -support -for -a -native -with -four -wives -he -is -wholly -independent -and -need -never -do -a -stroke -of -work -again -that -great -diamond -weighs -97l -carats -some -say -it -is -as -big -as -a -piece -of -alum -others -say -it -is -as -large -as -a -bite -of -rock -candy -but -the -best -authorities -agree -that -it -is -almost -exactly -the -size -of -a -chunk -of -ice -but -those -details -are -not -important -and -in -my -opinion -not -trustworthy -it -has -a -flaw -in -it -otherwise -it -would -be -of -incredible -value -as -it -is -it -is -held -to -be -worth -$2 -000 -000 -after -cutting -it -ought -to -be -worth -from -$5 -000 -000 -to -$8 -000 -000 -therefore -persons -desiring -to -save -money -should -buy -it -now -it -is -owned -by -a -syndicate -and -apparently -there -is -no -satisfactory -market -for -it -it -is -earning -nothing -it -is -eating -its -head -off -up -to -this -time -it -has -made -nobody -rich -but -the -native -who -found -it -he -found -it -in -a -mine -which -was -being -worked -by -contract -that -is -to -say -a -company -had -bought -the -privilege -of -taking -from -the -mine -5 -000 -000 -carloads -of -blue -rock -for -a -sum -down -and -a -royalty -their -speculation -had -not -paid -but -on -the -very -day -that -their -privilege -ran -out -that -native -found -the -$2 -000 -000 -diamond -and -handed -it -over -to -them -even -the -diamond -culture -is -not -without -its -romantic -episodes -the -koh -i -noor -is -a -large -diamond -and -valuable -but -it -cannot -compete -in -these -matters -with -three -which -according -to -legend -are -among -the -crown -trinkets -of -portugal -and -russia -one -of -these -is -held -to -be -worth -$20 -000 -000 -another -$25 -000 -000 -and -the -third -something -over -$28 -000 -000 -those -are -truly -wonderful -diamonds -whether -they -exist -or -not -and -yet -they -are -of -but -little -importance -by -comparison -with -the -one -wherewith -the -boer -wagoner -chocked -his -wheel -on -that -steep -grade -as -heretofore -referred -to -in -kimberley -i -had -some -conversation -with -the -man -who -saw -the -boer -do -that -an -incident -which -had -occurred -twenty -seven -or -twenty -eight -years -before -i -had -my -talk -with -him -he -assured -me -that -that -diamond's -value -could -have -been -over -a -billion -dollars -but -not -under -it -i -believed -him -because -he -had -devoted -twenty -seven -years -to -hunting -for -it -and -was -in -a -position -to -know -a -fitting -and -interesting -finish -to -an -examination -of -the -tedious -and -laborious -and -costly -processes -whereby -the -diamonds -are -gotten -out -of -the -deeps -of -the -earth -and -freed -from -the -base -stuffs -which -imprison -them -is -the -visit -to -the -de -beers -offices -in -the -town -of -kimberley -where -the -result -of -each -day's -mining -is -brought -every -day -and -weighed -assorted -valued -and -deposited -in -safes -against -shipping -day -an -unknown -and -unaccredited -person -cannot -get -into -that -place -and -it -seemed -apparent -from -the -generous -supply -of -warning -and -protective -and -prohibitory -signs -that -were -posted -all -about -that -not -even -the -known -and -accredited -can -steal -diamonds -there -without -inconvenience -we -saw -the -day's -output -shining -little -nests -of -diamonds -distributed -a -foot -apart -along -a -counter -each -nest -reposing -upon -a -sheet -of -white -paper -that -day's -catch -was -about -$70 -000 -worth -in -the -course -of -a -year -half -a -ton -of -diamonds -pass -under -the -scales -there -and -sleep -on -that -counter -the -resulting -money -is -$18 -000 -000 -or -$20 -000 -000 -profit -about -$12 -000 -000 -young -girls -were -doing -the -sorting -a -nice -clean -dainty -and -probably -distressing -employment -every -day -ducal -incomes -sift -and -sparkle -through -the -fingers -of -those -young -girls -yet -they -go -to -bed -at -night -as -poor -as -they -were -when -they -got -up -in -the -morning -the -same -thing -next -day -and -all -the -days -they -are -beautiful -things -those -diamonds -in -their -native -state -they -are -of -various -shapes -they -have -flat -surfaces -rounded -borders -and -never -a -sharp -edge -they -are -of -all -colors -and -shades -of -color -from -dewdrop -white -to -actual -black -and -their -smooth -and -rounded -surfaces -and -contours -variety -of -color -and -transparent -limpidity -make -them -look -like -piles -of -assorted -candies -a -very -light -straw -color -is -their -commonest -tint -it -seemed -to -me -that -these -uncut -gems -must -be -more -beautiful -than -any -cut -ones -could -be -but -when -a -collection -of -cut -ones -was -brought -out -i -saw -my -mistake -nothing -is -so -beautiful -as -a -rose -diamond -with -the -light -playing -through -it -except -that -uncostly -thing -which -is -just -like -it -wavy -sea -water -with -the -sunlight -playing -through -it -and -striking -a -white -sand -bottom -before -the -middle -of -july -we -reached -cape -town -and -the -end -of -our -african -journeyings -and -well -satisfied -for -towering -above -us -was -table -mountain -a -reminder -that -we -had -now -seen -each -and -all -of -the -great -features -of -south -africa -except -mr -cecil -rhodes -i -realize -that -that -is -a -large -exception -i -know -quite -well -that -whether -mr -rhodes -is -the -lofty -and -worshipful -patriot -and -statesman -that -multitudes -believe -him -to -be -or -satan -come -again -as -the -rest -of -the -world -account -him -he -is -still -the -most -imposing -figure -in -the -british -empire -outside -of -england -when -he -stands -on -the -cape -of -good -hope -his -shadow -falls -to -the -zambesi -he -is -the -only -colonial -in -the -british -dominions -whose -goings -and -comings -are -chronicled -and -discussed -under -all -the -globe's -meridians -and -whose -speeches -unclipped -are -cabled -from -the -ends -of -the -earth -and -he -is -the -only -unroyal -outsider -whose -arrival -in -london -can -compete -for -attention -with -an -eclipse -that -he -is -an -extraordinary -man -and -not -an -accident -of -fortune -not -even -his -dearest -south -african -enemies -were -willing -to -deny -so -far -as -i -heard -them -testify -the -whole -south -african -world -seemed -to -stand -in -a -kind -of -shuddering -awe -of -him -friend -and -enemy -alike -it -was -as -if -he -were -deputy -god -on -the -one -side -deputy -satan -on -the -other -proprietor -of -the -people -able -to -make -them -or -ruin -them -by -his -breath -worshiped -by -many -hated -by -many -but -blasphemed -by -none -among -the -judicious -and -even -by -the -indiscreet -in -guarded -whispers -only -what -is -the -secret -of -his -formidable -supremacy -one -says -it -is -his -prodigious -wealth -a -wealth -whose -drippings -in -salaries -and -in -other -ways -support -multitudes -and -make -them -his -interested -and -loyal -vassals -another -says -it -is -his -personal -magnetism -and -his -persuasive -tongue -and -that -these -hypnotize -and -make -happy -slaves -of -all -that -drift -within -the -circle -of -their -influence -another -says -it -is -his -majestic -ideas -his -vast -schemes -for -the -territorial -aggrandizement -of -england -his -patriotic -and -unselfish -ambition -to -spread -her -beneficent -protection -and -her -just -rule -over -the -pagan -wastes -of -africa -and -make -luminous -the -african -darkness -with -the -glory -of -her -name -and -another -says -he -wants -the -earth -and -wants -it -for -his -own -and -that -the -belief -that -he -will -get -it -and -let -his -friends -in -on -the -ground -floor -is -the -secret -that -rivets -so -many -eyes -upon -him -and -keeps -him -in -the -zenith -where -the -view -is -unobstructed -one -may -take -his -choice -they -are -all -the -same -price -one -fact -is -sure -he -keeps -his -prominence -and -a -vast -following -no -matter -what -he -does -he -deceives -the -duke -of -fife -it -is -the -duke's -word -but -that -does -not -destroy -the -duke's -loyalty -to -him -he -tricks -the -reformers -into -immense -trouble -with -his -raid -but -the -most -of -them -believe -he -meant -well -he -weeps -over -the -harshly -taxed -johannesburgers -and -makes -them -his -friends -at -the -same -time -he -taxes -his -charter -settlers -50 -per -cent -and -so -wins -their -affection -and -their -confidence -that -they -are -squelched -with -despair -at -every -rumor -that -the -charter -is -to -be -annulled -he -raids -and -robs -and -slays -and -enslaves -the -matabele -and -gets -worlds -of -charter -christian -applause -for -it -he -has -beguiled -england -into -buying -charter -waste -paper -for -bank -of -england -notes -ton -for -ton -and -the -ravished -still -burn -incense -to -him -as -the -eventual -god -of -plenty -he -has -done -everything -he -could -think -of -to -pull -himself -down -to -the -ground -he -has -done -more -than -enough -to -pull -sixteen -common -run -great -men -down -yet -there -he -stands -to -this -day -upon -his -dizzy -summit -under -the -dome -of -the -sky -an -apparent -permanency -the -marvel -of -the -time -the -mystery -of -the -age -an -archangel -with -wings -to -half -the -world -satan -with -a -tail -to -the -other -half -i -admire -him -i -frankly -confess -it -and -when -his -time -comes -i -shall -buy -a -piece -of -the -rope -for -a -keepsake -conclusion -i -have -traveled -more -than -anyone -else -and -i -have -noticed -that -even -the -angels -speak -english -with -an -accent -pudd'nhead -wilson's -new -calendar -i -saw -table -rock -anyway -a -majestic -pile -it -is -3 -000 -feet -high -it -is -also -17 -000 -feet -high -these -figures -may -be -relied -upon -i -got -them -in -cape -town -from -the -two -best -informed -citizens -men -who -had -made -table -rock -the -study -of -their -lives -and -i -saw -table -bay -so -named -for -its -levelness -i -saw -the -castle -built -by -the -dutch -east -india -company -three -hundred -years -ago -where -the -commanding -general -lives -i -saw -st -simon's -bay -where -the -admiral -lives -i -saw -the -government -also -the -parliament -where -they -quarreled -in -two -languages -when -i -was -there -and -agreed -in -none -i -saw -the -club -i -saw -and -explored -the -beautiful -sea -girt -drives -that -wind -about -the -mountains -and -through -the -paradise -where -the -villas -are -also -i -saw -some -of -the -fine -old -dutch -mansions -pleasant -homes -of -the -early -times -pleasant -homes -to -day -and -enjoyed -the -privilege -of -their -hospitalities -and -just -before -i -sailed -i -saw -in -one -of -them -a -quaint -old -picture -which -was -a -link -in -a -curious -romance -a -picture -of -a -pale -intellectual -young -man -in -a -pink -coat -with -a -high -black -collar -it -was -a -portrait -of -dr -james -barry -a -military -surgeon -who -came -out -to -the -cape -fifty -years -ago -with -his -regiment -he -was -a -wild -young -fellow -and -was -guilty -of -various -kinds -of -misbehavior -he -was -several -times -reported -to -headquarters -in -england -and -it -was -in -each -case -expected -that -orders -would -come -out -to -deal -with -him -promptly -and -severely -but -for -some -mysterious -reason -no -orders -of -any -kind -ever -came -back -nothing -came -but -just -an -impressive -silence -this -made -him -an -imposing -and -uncanny -wonder -to -the -town -next -he -was -promoted -away -up -he -was -made -medical -superintendent -general -and -transferred -to -india -presently -he -was -back -at -the -cape -again -and -at -his -escapades -once -more -there -were -plenty -of -pretty -girls -but -none -of -them -caught -him -none -of -them -could -get -hold -of -his -heart -evidently -he -was -not -a -marrying -man -and -that -was -another -marvel -another -puzzle -and -made -no -end -of -perplexed -talk -once -he -was -called -in -the -night -an -obstetric -service -to -do -what -he -could -for -a -woman -who -was -believed -to -be -dying -he -was -prompt -and -scientific -and -saved -both -mother -and -child -there -are -other -instances -of -record -which -testify -to -his -mastership -of -his -profession -and -many -which -testify -to -his -love -of -it -and -his -devotion -to -it -among -other -adventures -of -his -was -a -duel -of -a -desperate -sort -fought -with -swords -at -the -castle -he -killed -his -man -the -child -heretofore -mentioned -as -having -been -saved -by -dr -barry -so -long -ago -was -named -for -him -and -still -lives -in -cape -town -he -had -dr -barry's -portrait -painted -and -gave -it -to -the -gentleman -in -whose -old -dutch -house -i -saw -it -the -quaint -figure -in -pink -coat -and -high -black -collar -the -story -seems -to -be -arriving -nowhere -but -that -is -because -i -have -not -finished -dr -barry -died -in -cape -town -30 -years -ago -it -was -then -discovered -that -he -was -a -woman -the -legend -goes -that -enquiries -soon -silenced -developed -the -fact -that -she -was -a -daughter -of -a -great -english -house -and -that -that -was -why -her -cape -wildnesses -brought -no -punishment -and -got -no -notice -when -reported -to -the -government -at -home -her -name -was -an -alias -she -had -disgraced -herself -with -her -people -so -she -chose -to -change -her -name -and -her -sex -and -take -a -new -start -in -the -world -we -sailed -on -the -15th -of -july -in -the -norman -a -beautiful -ship -perfectly -appointed -the -voyage -to -england -occupied -a -short -fortnight -without -a -stop -except -at -madeira -a -good -and -restful -voyage -for -tired -people -and -there -were -several -of -us -i -seemed -to -have -been -lecturing -a -thousand -years -though -it -was -only -a -twelvemonth -and -a -considerable -number -of -the -others -were -reformers -who -were -fagged -out -with -their -five -months -of -seclusion -in -the -pretoria -prison -our -trip -around -the -earth -ended -at -the -southampton -pier -where -we -embarked -thirteen -months -before -it -seemed -a -fine -and -large -thing -to -have -accomplished -the -circumnavigation -of -this -great -globe -in -that -little -time -and -i -was -privately -proud -of -it -for -a -moment -then -came -one -of -those -vanity -snubbing -astronomical -reports -from -the -observatory -people -whereby -it -appeared -that -another -great -body -of -light -had -lately -flamed -up -in -the -remotenesses -of -space -which -was -traveling -at -a -gait -which -would -enable -it -to -do -all -that -i -had -done -in -a -minute -and -a -half -human -pride -is -not -worth -while -there -is -always -something -lying -in -wait -to -take -the -wind -out -of -it -end -of -the -project -gutenberg -ebook -of -following -the -equator -complete -by -mark -twain -samuel -clemens -the -full -project -gutenberg -license -please -read -this -before -you -distribute -or -use -this -work -to -protect -the -project -gutenberg -tm -mission -of -promoting -the -free -distribution -of -electronic -works -by -using -or -distributing -this -work -or -any -other -work -associated -in -any -way -with -the -phrase -project -gutenberg -you -agree -to -comply -with -all -the -terms -of -the -full -project -gutenberg -tm -license -available -with -this -file -or -online -at -http -//gutenberg -net/license -section -1 -general -terms -of -use -and -redistributing -project -gutenberg -tm -electronic -works -1 -a -by -reading -or -using -any -part -of -this -project -gutenberg -tm -electronic -work -you -indicate -that -you -have -read -understand -agree -to -and -accept -all -the -terms -of -this -license -and -intellectual -property -trademark/copyright -agreement -if -you -do -not -agree -to -abide -by -all -the -terms -of -this -agreement -you -must -cease -using -and -return -or -destroy -all -copies -of -project -gutenberg -tm -electronic -works -in -your -possession -if -you -paid -a -fee -for -obtaining -a -copy -of -or -access -to -a -project -gutenberg -tm -electronic -work -and -you -do -not -agree -to -be -bound -by -the -terms -of -this -agreement -you -may -obtain -a -refund -from -the -person -or -entity -to -whom -you -paid -the -fee -as -set -forth -in -paragraph -1 -e -8 -1 -b -project -gutenberg -is -a -registered -trademark -it -may -only -be -used -on -or -associated -in -any -way -with -an -electronic -work -by -people -who -agree -to -be -bound -by -the -terms -of -this -agreement -there -are -a -few -things -that -you -can -do -with -most -project -gutenberg -tm -electronic -works -even -without -complying -with -the -full -terms -of -this -agreement -see -paragraph -1 -c -below -there -are -a -lot -of -things -you -can -do -with -project -gutenberg -tm -electronic -works -if -you -follow -the -terms -of -this -agreement -and -help -preserve -free -future -access -to -project -gutenberg -tm -electronic -works -see -paragraph -1 -e -below -1 -c -the -project -gutenberg -literary -archive -foundation -the -foundation -or -pglaf -owns -a -compilation -copyright -in -the -collection -of -project -gutenberg -tm -electronic -works -nearly -all -the -individual -works -in -the -collection -are -in -the -public -domain -in -the -united -states -if -an -individual -work -is -in -the -public -domain -in -the -united -states -and -you -are -located -in -the -united -states -we -do -not -claim -a -right -to -prevent -you -from -copying -distributing -performing -displaying -or -creating -derivative -works -based -on -the -work -as -long -as -all -references -to -project -gutenberg -are -removed -of -course -we -hope -that -you -will -support -the -project -gutenberg -tm -mission -of -promoting -free -access -to -electronic -works -by -freely -sharing -project -gutenberg -tm -works -in -compliance -with -the -terms -of -this -agreement -for -keeping -the -project -gutenberg -tm -name -associated -with -the -work -you -can -easily -comply -with -the -terms -of -this -agreement -by -keeping -this -work -in -the -same -format -with -its -attached -full -project -gutenberg -tm -license -when -you -share -it -without -charge -with -others -1 -d -the -copyright -laws -of -the -place -where -you -are -located -also -govern -what -you -can -do -with -this -work -copyright -laws -in -most -countries -are -in -a -constant -state -of -change -if -you -are -outside -the -united -states -check -the -laws -of -your -country -in -addition -to -the -terms -of -this -agreement -before -downloading -copying -displaying -performing -distributing -or -creating -derivative -works -based -on -this -work -or -any -other -project -gutenberg -tm -work -the -foundation -makes -no -representations -concerning -the -copyright -status -of -any -work -in -any -country -outside -the -united -states -1 -e -unless -you -have -removed -all -references -to -project -gutenberg -1 -e -1 -the -following -sentence -with -active -links -to -or -other -immediate -access -to -the -full -project -gutenberg -tm -license -must -appear -prominently -whenever -any -copy -of -a -project -gutenberg -tm -work -any -work -on -which -the -phrase -project -gutenberg -appears -or -with -which -the -phrase -project -gutenberg -is -associated -is -accessed -displayed -performed -viewed -copied -or -distributed -this -ebook -is -for -the -use -of -anyone -anywhere -at -no -cost -and -with -almost -no -restrictions -whatsoever -you -may -copy -it -give -it -away -or -re -use -it -under -the -terms -of -the -project -gutenberg -license -included -with -this -ebook -or -online -at -www -gutenberg -net -1 -e -2 -if -an -individual -project -gutenberg -tm -electronic -work -is -derived -from -the -public -domain -does -not -contain -a -notice -indicating -that -it -is -posted -with -permission -of -the -copyright -holder -the -work -can -be -copied -and -distributed -to -anyone -in -the -united -states -without -paying -any -fees -or -charges -if -you -are -redistributing -or -providing -access -to -a -work -with -the -phrase -project -gutenberg -associated -with -or -appearing -on -the -work -you -must -comply -either -with -the -requirements -of -paragraphs -1 -e -1 -through -1 -e -7 -or -obtain -permission -for -the -use -of -the -work -and -the -project -gutenberg -tm -trademark -as -set -forth -in -paragraphs -1 -e -8 -or -1 -e -9 -1 -e -3 -if -an -individual -project -gutenberg -tm -electronic -work -is -posted -with -the -permission -of -the -copyright -holder -your -use -and -distribution -must -comply -with -both -paragraphs -1 -e -1 -through -1 -e -7 -and -any -additional -terms -imposed -by -the -copyright -holder -additional -terms -will -be -linked -to -the -project -gutenberg -tm -license -for -all -works -posted -with -the -permission -of -the -copyright -holder -found -at -the -beginning -of -this -work -1 -e -4 -do -not -unlink -or -detach -or -remove -the -full -project -gutenberg -tm -license -terms -from -this -work -or -any -files -containing -a -part -of -this -work -or -any -other -work -associated -with -project -gutenberg -tm -1 -e -5 -do -not -copy -display -perform -distribute -or -redistribute -this -electronic -work -or -any -part -of -this -electronic -work -without -prominently -displaying -the -sentence -set -forth -in -paragraph -1 -e -1 -with -active -links -or -immediate -access -to -the -full -terms -of -the -project -gutenberg -tm -license -1 -e -6 -you -may -convert -to -and -distribute -this -work -in -any -binary -compressed -marked -up -nonproprietary -or -proprietary -form -including -any -word -processing -or -hypertext -form -however -if -you -provide -access -to -or -distribute -copies -of -a -project -gutenberg -tm -work -in -a -format -other -than -plain -vanilla -ascii -or -other -format -used -in -the -official -version -posted -on -the -official -project -gutenberg -tm -web -site -www -gutenberg -net -you -must -at -no -additional -cost -fee -or -expense -to -the -user -provide -a -copy -a -means -of -exporting -a -copy -or -a -means -of -obtaining -a -copy -upon -request -of -the -work -in -its -original -plain -vanilla -ascii -or -other -form -any -alternate -format -must -include -the -full -project -gutenberg -tm -license -as -specified -in -paragraph -1 -e -1 -1 -e -7 -do -not -charge -a -fee -for -access -to -viewing -displaying -performing -copying -or -distributing -any -project -gutenberg -tm -works -unless -you -comply -with -paragraph -1 -e -8 -or -1 -e -9 -1 -e -8 -you -may -charge -a -reasonable -fee -for -copies -of -or -providing -access -to -or -distributing -project -gutenberg -tm -electronic -works -provided -that -you -pay -a -royalty -fee -of -20% -of -the -gross -profits -you -derive -from -the -use -of -project -gutenberg -tm -works -calculated -using -the -method -you -already -use -to -calculate -your -applicable -taxes -the -fee -is -owed -to -the -owner -of -the -project -gutenberg -tm -trademark -but -he -has -agreed -to -donate -royalties -under -this -paragraph -to -the -project -gutenberg -literary -archive -foundation -royalty -payments -must -be -paid -within -60 -days -following -each -date -on -which -you -prepare -or -are -legally -required -to -prepare -your -periodic -tax -returns -royalty -payments -should -be -clearly -marked -as -such -and -sent -to -the -project -gutenberg -literary -archive -foundation -at -the -address -specified -in -section -4 -information -about -donations -to -the -project -gutenberg -literary -archive -foundation -you -provide -a -full -refund -of -any -money -paid -by -a -user -who -notifies -you -in -writing -or -by -e -mail -within -30 -days -of -receipt -that -s/he -does -not -agree -to -the -terms -of -the -full -project -gutenberg -tm -license -you -must -require -such -a -user -to -return -or -destroy -all -copies -of -the -works -possessed -in -a -physical -medium -and -discontinue -all -use -of -and -all -access -to -other -copies -of -project -gutenberg -tm -works -you -provide -in -accordance -with -paragraph -1 -f -3 -a -full -refund -of -any -money -paid -for -a -work -or -a -replacement -copy -if -a -defect -in -the -electronic -work -is -discovered -and -reported -to -you -within -90 -days -of -receipt -of -the -work -you -comply -with -all -other -terms -of -this -agreement -for -free -distribution -of -project -gutenberg -tm -works -1 -e -9 -if -you -wish -to -charge -a -fee -or -distribute -a -project -gutenberg -tm -electronic -work -or -group -of -works -on -different -terms -than -are -set -forth -in -this -agreement -you -must -obtain -permission -in -writing -from -both -the -project -gutenberg -literary -archive -foundation -and -michael -hart -the -owner -of -the -project -gutenberg -tm -trademark -contact -the -foundation -as -set -forth -in -section -3 -below -1 -f -1 -f -1 -project -gutenberg -volunteers -and -employees -expend -considerable -effort -to -identify -do -copyright -research -on -transcribe -and -proofread -public -domain -works -in -creating -the -project -gutenberg -tm -collection -despite -these -efforts -project -gutenberg -tm -electronic -works -and -the -medium -on -which -they -may -be -stored -may -contain -defects -such -as -but -not -limited -to -incomplete -inaccurate -or -corrupt -data -transcription -errors -a -copyright -or -other -intellectual -property -infringement -a -defective -or -damaged -disk -or -other -medium -a -computer -virus -or -computer -codes -that -damage -or -cannot -be -read -by -your -equipment -1 -f -2 -limited -warranty -disclaimer -of -damages -except -for -the -right -of -replacement -or -refund -described -in -paragraph -1 -f -3 -the -project -gutenberg -literary -archive -foundation -the -owner -of -the -project -gutenberg -tm -trademark -and -any -other -party -distributing -a -project -gutenberg -tm -electronic -work -under -this -agreement -disclaim -all -liability -to -you -for -damages -costs -and -expenses -including -legal -fees -you -agree -that -you -have -no -remedies -for -negligence -strict -liability -breach -of -warranty -or -breach -of -contract -except -those -provided -in -paragraph -f3 -you -agree -that -the -foundation -the -trademark -owner -and -any -distributor -under -this -agreement -will -not -be -liable -to -you -for -actual -direct -indirect -consequential -punitive -or -incidental -damages -even -if -you -give -notice -of -the -possibility -of -such -damage -1 -f -3 -limited -right -of -replacement -or -refund -if -you -discover -a -defect -in -this -electronic -work -within -90 -days -of -receiving -it -you -can -receive -a -refund -of -the -money -if -any -you -paid -for -it -by -sending -a -written -explanation -to -the -person -you -received -the -work -from -if -you -received -the -work -on -a -physical -medium -you -must -return -the -medium -with -your -written -explanation -the -person -or -entity -that -provided -you -with -the -defective -work -may -elect -to -provide -a -replacement -copy -in -lieu -of -a -refund -if -you -received -the -work -electronically -the -person -or -entity -providing -it -to -you -may -choose -to -give -you -a -second -opportunity -to -receive -the -work -electronically -in -lieu -of -a -refund -if -the -second -copy -is -also -defective -you -may -demand -a -refund -in -writing -without -further -opportunities -to -fix -the -problem -1 -f -4 -except -for -the -limited -right -of -replacement -or -refund -set -forth -in -paragraph -1 -f -3 -this -work -is -provided -to -you -'as -is' -with -no -other -warranties -of -any -kind -express -or -implied -including -but -not -limited -to -warranties -of -merchantibility -or -fitness -for -any -purpose -1 -f -5 -some -states -do -not -allow -disclaimers -of -certain -implied -warranties -or -the -exclusion -or -limitation -of -certain -types -of -damages -if -any -disclaimer -or -limitation -set -forth -in -this -agreement -violates -the -law -of -the -state -applicable -to -this -agreement -the -agreement -shall -be -interpreted -to -make -the -maximum -disclaimer -or -limitation -permitted -by -the -applicable -state -law -the -invalidity -or -unenforceability -of -any -provision -of -this -agreement -shall -not -void -the -remaining -provisions -1 -f -6 -indemnity -you -agree -to -indemnify -and -hold -the -foundation -the -trademark -owner -any -agent -or -employee -of -the -foundation -anyone -providing -copies -of -project -gutenberg -tm -electronic -works -in -accordance -with -this -agreement -and -any -volunteers -associated -with -the -production -promotion -and -distribution -of -project -gutenberg -tm -electronic -works -harmless -from -all -liability -costs -and -expenses -including -legal -fees -that -arise -directly -or -indirectly -from -any -of -the -following -which -you -do -or -cause -to -occur -a -distribution -of -this -or -any -project -gutenberg -tm -work -b -alteration -modification -or -additions -or -deletions -to -any -project -gutenberg -tm -work -and -c -any -defect -you -cause -section -2 -information -about -the -mission -of -project -gutenberg -tm -project -gutenberg -tm -is -synonymous -with -the -free -distribution -of -electronic -works -in -formats -readable -by -the -widest -variety -of -computers -including -obsolete -old -middle -aged -and -new -computers -it -exists -because -of -the -efforts -of -hundreds -of -volunteers -and -donations -from -people -in -all -walks -of -life -volunteers -and -financial -support -to -provide -volunteers -with -the -assistance -they -need -is -critical -to -reaching -project -gutenberg -tm's -goals -and -ensuring -that -the -project -gutenberg -tm -collection -will -remain -freely -available -for -generations -to -come -in -2001 -the -project -gutenberg -literary -archive -foundation -was -created -to -provide -a -secure -and -permanent -future -for -project -gutenberg -tm -and -future -generations -to -learn -more -about -the -project -gutenberg -literary -archive -foundation -and -how -your -efforts -and -donations -can -help -see -sections -3 -and -4 -and -the -foundation -web -page -at -http -//www -pglaf -org -section -3 -information -about -the -project -gutenberg -literary -archive -foundation -the -project -gutenberg -literary -archive -foundation -is -a -non -profit -501 -c -3 -educational -corporation -organized -under -the -laws -of -the -state -of -mississippi -and -granted -tax -exempt -status -by -the -internal -revenue -service -the -foundation's -ein -or -federal -tax -identification -number -is -64 -6221541 -its -501 -c -3 -letter -is -posted -at -http -//pglaf -org/fundraising -contributions -to -the -project -gutenberg -literary -archive -foundation -are -tax -deductible -to -the -full -extent -permitted -by -u -s -federal -laws -and -your -state's -laws -the -foundation's -principal -office -is -located -at -4557 -melan -dr -s -fairbanks -ak -99712 -but -its -volunteers -and -employees -are -scattered -throughout -numerous -locations -its -business -office -is -located -at -809 -north -1500 -west -salt -lake -city -ut -84116 -801 -596 -1887 -email -business@pglaf -org -email -contact -links -and -up -to -date -contact -information -can -be -found -at -the -foundation's -web -site -and -official -page -at -http -//pglaf -org -for -additional -contact -information -dr -gregory -b -newby -chief -executive -and -director -gbnewby@pglaf -org -section -4 -information -about -donations -to -the -project -gutenberg -literary -archive -foundation -project -gutenberg -tm -depends -upon -and -cannot -survive -without -wide -spread -public -support -and -donations -to -carry -out -its -mission -of -increasing -the -number -of -public -domain -and -licensed -works -that -can -be -freely -distributed -in -machine -readable -form -accessible -by -the -widest -array -of -equipment -including -outdated -equipment -many -small -donations -$1 -to -$5 -000 -are -particularly -important -to -maintaining -tax -exempt -status -with -the -irs -the -foundation -is -committed -to -complying -with -the -laws -regulating -charities -and -charitable -donations -in -all -50 -states -of -the -united -states -compliance -requirements -are -not -uniform -and -it -takes -a -considerable -effort -much -paperwork -and -many -fees -to -meet -and -keep -up -with -these -requirements -we -do -not -solicit -donations -in -locations -where -we -have -not -received -written -confirmation -of -compliance -to -send -donations -or -determine -the -status -of -compliance -for -any -particular -state -visit -http -//pglaf -org -while -we -cannot -and -do -not -solicit -contributions -from -states -where -we -have -not -met -the -solicitation -requirements -we -know -of -no -prohibition -against -accepting -unsolicited -donations -from -donors -in -such -states -who -approach -us -with -offers -to -donate -international -donations -are -gratefully -accepted -but -we -cannot -make -any -statements -concerning -tax -treatment -of -donations -received -from -outside -the -united -states -u -s -laws -alone -swamp -our -small -staff -please -check -the -project -gutenberg -web -pages -for -current -donation -methods -and -addresses -donations -are -accepted -in -a -number -of -other -ways -including -including -checks -online -payments -and -credit -card -donations -to -donate -please -visit -http -//pglaf -org/donate -section -5 -general -information -about -project -gutenberg -tm -electronic -works -professor -michael -s -hart -is -the -originator -of -the -project -gutenberg -tm -concept -of -a -library -of -electronic -works -that -could -be -freely -shared -with -anyone -for -thirty -years -he -produced -and -distributed -project -gutenberg -tm -ebooks -with -only -a -loose -network -of -volunteer -support -project -gutenberg -tm -ebooks -are -often -created -from -several -printed -editions -all -of -which -are -confirmed -as -public -domain -in -the -u -s -unless -a -copyright -notice -is -included -thus -we -do -not -necessarily -keep -ebooks -in -compliance -with -any -particular -paper -edition -most -people -start -at -our -web -site -which -has -the -main -pg -search -facility -http -//www -gutenberg -net -this -web -site -includes -information -about -project -gutenberg -tm -including -how -to -make -donations -to -the -project -gutenberg -literary -archive -foundation -how -to -help -produce -our -new -ebooks -and -how -to -subscribe -to -our -email -newsletter -to -hear -about -new -ebooks diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/equator_03b.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/equator_03b.pde deleted file mode 100644 index 22afb4fa1..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/equator_03b.pde +++ /dev/null @@ -1,40 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -import treemap.*; - -Treemap map; - -void setup() { - size(1024, 768); - - smooth(); - strokeWeight(0.25f); - PFont font = createFont("Serif", 13); - textFont(font); - - WordMap mapData = new WordMap(); - - String[] lines = loadStrings("equator.txt"); - for (int i = 0; i < lines.length; i++) { - mapData.addWord(lines[i]); - } - mapData.finishAdd(); - - // different choices for the layout method - //MapLayout algorithm = new SliceLayout(); - //MapLayout algorithm = new StripTreemap(); - //MapLayout algorithm = new PivotBySplitSize(); - //MapLayout algorithm = new SquarifiedLayout(); - - map = new Treemap(mapData, 0, 0, width, height); - - // only run draw() once - noLoop(); -} - - -void draw() { - background(255); - map.draw(); -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/file_tree_queue_08b/Node.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/file_tree_queue_08b/Node.pde deleted file mode 100644 index e6ddcf43c..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/file_tree_queue_08b/Node.pde +++ /dev/null @@ -1,58 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -class Node { - File file; - - Node[] children; - int childCount; - - Node(File file) { - this.file = file; - if (file.isDirectory()) { - addFolder(this); - } - } - - void check() { - String[] contents = file.list(); - if (contents != null) { - // Sort the file names in case insensitive order - contents = sort(contents); - - children = new Node[contents.length]; - for (int i = 0 ; i < contents.length; i++) { - // Skip the . and .. directory entries on Unix systems - if (contents[i].equals(".") || contents[i].equals("..")) { - continue; - } - File childFile = new File(file, contents[i]); - // Skip any file that appears to be a symbolic link - try { - String absPath = childFile.getAbsolutePath(); - String canPath = childFile.getCanonicalPath(); - if (!absPath.equals(canPath)) { - continue; - } - } catch (IOException e) { } - - Node child = new Node(childFile); - children[childCount++] = child; - } - } - } - - - void printList(int depth) { - // print four spaces for each level of depth; - for (int i = 0; i < depth; i++) { - print(" "); - } - println(file.getName()); - - // now handle the children, if any - for (int i = 0; i < childCount; i++) { - children[i].printList(depth + 1); - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/file_tree_queue_08b/file_tree_queue_08b.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/file_tree_queue_08b/file_tree_queue_08b.pde deleted file mode 100644 index 73eea9e81..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/file_tree_queue_08b/file_tree_queue_08b.pde +++ /dev/null @@ -1,67 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -Node[] folders = new Node[10]; -int folderCount; -int folderIndex; - -Node rootNode; - - -void setup() { - size(400, 130); - // Replace this location with a folder on your machine - //File rootFile = new File("/Applications/Processing.app"); - //File rootFile = new File("c:\\processing-2.0"); - File rootFile = new File(System.getProperty("user.home")); - rootNode = new Node(rootFile); - PFont font = createFont("SansSerif", 11); - textFont(font); -} - - -void draw() { - background(224); - nextFolder(); - drawStatus(); -} - - -void drawStatus() { - float statusX = 30; - float statusW = width - statusX*2; - float statusY = 60; - float statusH = 20; - - fill(0); - if (folderIndex != folderCount) { - text("Reading " + nfc(folderIndex+1) + - " out of " + nfc(folderCount) + " folders...", - statusX, statusY - 10); - } else { - text("Done reading.", statusX, statusY - 10); - } - fill(128); - rect(statusX, statusY, statusW, statusH); - - float completedW = map(folderIndex + 1, 0, folderCount, 0, statusW); - fill(255); - rect(statusX, statusY, completedW, statusH); -} - - -void addFolder(Node folder) { - if (folderCount == folders.length) { - folders = (Node[]) expand(folders); - } - folders[folderCount++] = folder; -} - - -void nextFolder() { - if (folderIndex != folderCount) { - Node n = folders[folderIndex++]; - n.check(); - } -} - diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/BoundsIntegrator.java b/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/BoundsIntegrator.java deleted file mode 100644 index a568a930d..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/BoundsIntegrator.java +++ /dev/null @@ -1,178 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -public class BoundsIntegrator { - - static final float ATTRACTION = 0.2f; - static final float DAMPING = 0.5f; - - float valueX, velocityX, accelerationX; - float valueY, velocityY, accelerationY; - float valueW, velocityW, accelerationW; - float valueH, velocityH, accelerationH; - - float damping; - float attraction; - - boolean targeting; - float targetX, targetY, targetW, targetH; - - - public BoundsIntegrator() { - this.valueX = 0; - this.valueY = 0; - this.valueW = 1; - this.valueH = 1; - - this.damping = DAMPING; - this.attraction = ATTRACTION; - } - - - public BoundsIntegrator(float x, float y, float w, float h) { - this.valueX = x; - this.valueY = y; - this.valueW = w; - this.valueH = h; - - this.damping = DAMPING; - this.attraction = ATTRACTION; - } - - - public void set(float x, float y, float w, float h) { - this.valueX = x; - this.valueY = y; - this.valueW = w; - this.valueH = h; - } - - - public float getX() { - return valueX; - } - - - public float getY() { - return valueY; - } - - - public float getW() { - return valueW; - } - - - public float getH() { - return valueH; - } - - - public float spanX(float pointX, float start, float span) { - if (valueW != 0) { - //return (pointX - valueX) / valueW; - float n = (pointX - valueX) / valueW; - return start + n*span; - } else { - return Float.NaN; - } - } - - - public float spanY(float pointY, float start, float span) { - if (valueH != 0) { - //return (pointY - valueY) / valueH; - float n = (pointY - valueY) / valueH; - return start + n*span; - } else { - return Float.NaN; - } - } - - - public void setAttraction(float a) { - attraction = a; - } - - - public void setDamping(float d) { - damping = d; - } - - - public boolean update() { - if (targeting) { - accelerationX += attraction * (targetX - valueX); - velocityX = (velocityX + accelerationX) * damping; - valueX += velocityX; - accelerationX = 0; - boolean updated = (Math.abs(velocityX) > 0.0001f); - - accelerationY += attraction * (targetY - valueY); - velocityY = (velocityY + accelerationY) * damping; - valueY += velocityY; - accelerationY = 0; - updated |= (Math.abs(velocityY) > 0.0001f); - - accelerationW += attraction * (targetW - valueW); - velocityW = (velocityW + accelerationW) * damping; - valueW += velocityW; - accelerationW = 0; - updated |= (Math.abs(velocityW) > 0.0001f); - - accelerationH += attraction * (targetH - valueH); - velocityH = (velocityH + accelerationH) * damping; - valueH += velocityH; - accelerationH = 0; - updated |= (Math.abs(velocityH) > 0.0001f); - } - return false; - } - - - public void target(float tx, float ty, float tw, float th) { - targeting = true; - targetX = tx; - targetY = ty; - targetW = tw; - targetH = th; - } - - - public void targetLocation(float tx, float ty) { - targeting = true; - targetX = tx; - targetY = ty; - } - - - public void targetSize(float tw, float th) { - targeting = true; - targetW = tw; - targetH = th; - } - - - public void targetX(float tx) { - targeting = true; - targetX = tx; - } - - - public void targetY(float ty) { - targeting = true; - targetY = ty; - } - - - public void targetW(float tw) { - targeting = true; - targetW = tw; - } - - - public void targetH(float th) { - targeting = true; - targetH = th; - } -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/FileItem.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/FileItem.pde deleted file mode 100644 index 0ff648a82..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/FileItem.pde +++ /dev/null @@ -1,118 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -class FileItem extends SimpleMapItem { - FolderItem parent; - File file; - String name; - int level; - - color c; - float hue; - float brightness; - - float textPadding = 8; - - float boxLeft, boxTop; - float boxRight, boxBottom; - - - FileItem(FolderItem parent, File file, int level, int order) { - this.parent = parent; - this.file = file; - this.order = order; - this.level = level; - - name = file.getName(); - size = file.length(); - - modTimes.add(file.lastModified()); - } - - - void updateColors() { - if (parent != null) { - hue = map(order, 0, parent.getItemCount(), 0, 360); - } - brightness = modTimes.percentile(file.lastModified()) * 100; - - colorMode(HSB, 360, 100, 100); - if (parent == zoomItem) { - c = color(hue, 80, 80); - } else if (parent != null) { - c = color(parent.hue, 80, brightness); - } - colorMode(RGB, 255); - } - - - void calcBox() { - boxLeft = zoomBounds.spanX(x, 0, width); - boxRight = zoomBounds.spanX(x+w, 0, width); - boxTop = zoomBounds.spanY(y, 0, height); - boxBottom = zoomBounds.spanY(y+h, 0, height); - } - - - void draw() { - calcBox(); - - fill(c); - rect(boxLeft, boxTop, boxRight, boxBottom); - - if (textFits()) { - drawTitle(); - } else if (mouseInside()) { - rolloverItem = this; - } - } - - - void drawTitle() { - fill(255, 200); - - float middleX = (boxLeft + boxRight) / 2; - float middleY = (boxTop + boxBottom) / 2; - if (middleX > 0 && middleX < width && middleY > 0 && middleY < height) { - if (boxLeft + textWidth(name) + textPadding*2 > width) { - textAlign(RIGHT); - text(name, width - textPadding, boxBottom - textPadding); - } else { - textAlign(LEFT); - text(name, boxLeft + textPadding, boxBottom - textPadding); - } - } - } - - - boolean textFits() { - float wide = textWidth(name) + textPadding*2; - float high = textAscent() + textDescent() + textPadding*2; - return (boxRight - boxLeft > wide) && (boxBottom - boxTop > high); - } - - - boolean mouseInside() { - return (mouseX > boxLeft && mouseX < boxRight && - mouseY > boxTop && mouseY < boxBottom); - } - - - boolean mousePressed() { - if (mouseInside()) { - if (mouseButton == LEFT) { - parent.zoomIn(); - return true; - - } else if (mouseButton == RIGHT) { - if (parent == zoomItem) { - parent.zoomOut(); - } else { - parent.hideContents(); - } - return true; - } - } - return false; - } -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/FolderItem.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/FolderItem.pde deleted file mode 100644 index 87b30c982..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/FolderItem.pde +++ /dev/null @@ -1,213 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -class FolderItem extends FileItem implements MapModel { - MapLayout algorithm = new PivotBySplitSize(); - Mappable[] items; - boolean contentsVisible; - boolean layoutValid; - float darkness; - - - public FolderItem(FolderItem parent, File folder, int level, int order) { - super(parent, folder, level, order); - - String[] contents = folder.list(); - if (contents != null) { - contents = sort(contents); - items = new Mappable[contents.length]; - int count = 0; - for (int i = 0; i < contents.length; i++) { - if (contents[i].equals(".") || contents[i].equals("..")) { - continue; - } - File fileItem = new File(folder, contents[i]); - try { - String absolutePath = fileItem.getAbsolutePath(); - String canonicalPath = fileItem.getCanonicalPath(); - if (!absolutePath.equals(canonicalPath)) { - continue; - } - } catch (IOException e) { } - - FileItem newItem = null; - if (fileItem.isDirectory()) { - newItem = new FolderItem(this, fileItem, level+1, count); - } else { - newItem = new FileItem(this, fileItem, level+1, count); - } - items[count++] = newItem; - size += newItem.getSize(); - } - if (count != items.length) { - items = (Mappable[]) subset(items, 0, count); - } - } else { - // If no items found in this folder, create a dummy array so that - // items will not be null, which will ensure that items.length will - // return 0 rather than causing a NullPointerException. - items = new Mappable[0]; - } - } - - void updateColors() { - super.updateColors(); - - for (int i = 0; i < items.length; i++) { - FileItem fi = (FileItem) items[i]; - fi.updateColors(); - } - } - - void checkLayout() { - if (!layoutValid) { - if (getItemCount() != 0) { - algorithm.layout(this, bounds); - } - layoutValid = true; - } - } - - - boolean mousePressed() { - if (mouseInside()) { - if (contentsVisible) { - // Pass the mouse press to the child items - for (int i = 0; i < items.length; i++) { - FileItem fi = (FileItem) items[i]; - if (fi.mousePressed()) { - return true; - } - } - } else { // not opened - if (mouseButton == LEFT) { - if (parent == zoomItem) { - showContents(); - } else { - parent.zoomIn(); - } - } else if (mouseButton == RIGHT) { - if (parent == zoomItem) { - parent.zoomOut(); - } else { - parent.hideContents(); - } - } - return true; - } - } - return false; - } - - - // Zoom to the parent's boundary, zooming out from this item - void zoomOut() { - if (parent != null) { - // Close contents of any opened children - for (int i = 0; i < items.length; i++) { - if (items[i] instanceof FolderItem) { - ((FolderItem)items[i]).hideContents(); - } - } - parent.zoomIn(); - } - } - - - void zoomIn() { - zoomItem = this; - zoomBounds.target(x, y, w, h); ///width, h/height); - } - - - void showContents() { - contentsVisible = true; - } - - - void hideContents() { - // Prevent the user from closing the root level - if (parent != null) { - contentsVisible = false; - } - } - - - void draw() { - checkLayout(); - calcBox(); - - if (contentsVisible) { - for (int i = 0; i < items.length; i++) { - items[i].draw(); - } - } else { - super.draw(); - } - - if (contentsVisible) { - if (mouseInside()) { - if (parent == zoomItem) { - taggedItem = this; - } - } - } - if (mouseInside()) { - darkness *= 0.05; - } else { - darkness += (150 - darkness) * 0.05; - } - if (parent == zoomItem) { - colorMode(RGB, 255); - fill(0, darkness); - rect(boxLeft, boxTop, boxRight, boxBottom); - } - } - - - void drawTitle() { - if (!contentsVisible) { - super.drawTitle(); - } - } - - - void drawTag() { - float boxHeight = textAscent() + textPadding*2; - - if (boxBottom - boxTop > boxHeight*2) { - // if the height of the box is at least twice the height of the tag, - // draw the tag inside the box itself - fill(0, 128); - rect(boxLeft, boxTop, boxRight, boxTop+boxHeight); - fill(255); - textAlign(LEFT, TOP); - text(name, boxLeft+textPadding, boxTop+textPadding); - - } else if (boxTop > boxHeight) { - // if there's enough room to draw above, draw it there - fill(0, 128); - rect(boxLeft, boxTop-boxHeight, boxRight, boxTop); - fill(255); - text(name, boxLeft+textPadding, boxTop-textPadding); - - } else if (boxBottom + boxHeight < height) { - // otherwise draw the tag below - fill(0, 128); - rect(boxLeft, boxBottom, boxRight, boxBottom+boxHeight); - fill(255); - textAlign(LEFT, TOP); - text(name, boxLeft+textPadding, boxBottom+textPadding); - } - } - - - Mappable[] getItems() { - return items; - } - - - int getItemCount() { - return items.length; - } -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/RankedLongArray.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/RankedLongArray.pde deleted file mode 100644 index efc68f46b..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/RankedLongArray.pde +++ /dev/null @@ -1,57 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - -import java.util.Arrays; - - -class RankedLongArray { - long[] values = new long[100]; - int count; - boolean dirty; - - public void add(long what) { - if (count == values.length) { - values = (long[]) expand(values); - } - values[count++] = what; - dirty = true; - } - - public void remove(long what) { - int index = find(what, 0, count-1); - arraycopy(values, index+1, values, index, count-index-1); - count--; - } - - private void update() { - Arrays.sort(values, 0, count); - dirty = false; - } - - public float percentile(long what) { - int index = find(what); - return index / (float)count; - } - - public int find(long what) { - return find(what, 0, count-1); - } - - private int find(long num, int start, int stop) { - if (dirty) update(); - - int middle = (start + stop) / 2; - - // if this is the char, then return it - if (num == values[middle]) return middle; - - // doesn't exist, otherwise would have been the middle - if (start >= stop) return -1; - - // if it's in the lower half, continue searching that - if (num < values[middle]) { - return find(num, start, middle-1); - } - // otherwise continue in the upper half - return find(num, middle+1, stop); - } -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/filetreemap_06b.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/filetreemap_06b.pde deleted file mode 100644 index 1b1d43504..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/filetreemap_06b.pde +++ /dev/null @@ -1,93 +0,0 @@ -/* -This book is here to help you get your job done. In general, you may use the -code in this book in your programs and documentation. You do not need to contact -us for permission unless you’re reproducing a significant portion of the code. -For example, writing a program that uses several chunks of code from this book -does not require permission. Selling or distributing a CD-ROM of examples from -O’Reilly books does require permission. Answering a question by citing this book -and quoting example code does not require permission. Incorporating a significant -amount of example code from this book into your product’s documentation does -require permission. - -We appreciate, but do not require, attribution. An attribution usually includes -the title, author, publisher, and ISBN. For example: “Visualizing Data, First -Edition by Ben Fry. Copyright 2008 Ben Fry, 9780596514556.” - -If you feel your use of code examples falls outside fair use or the permission -given above, feel free to contact us at permissions@oreilly.com. -*/ -//import treemap.*; - -import javax.swing.*; - -FolderItem rootItem; -FileItem rolloverItem; -FolderItem taggedItem; - -BoundsIntegrator zoomBounds; -FolderItem zoomItem; - -RankedLongArray modTimes = new RankedLongArray(); - -PFont font; - - -void setup() { - size(1024, 768); - zoomBounds = new BoundsIntegrator(0, 0, width, height); - - cursor(CROSS); - rectMode(CORNERS); - smooth(); - noStroke(); - - font = createFont("SansSerif", 13); - - selectFolder("Choose a folder to browse...", "setRoot"); -} - - -void setRoot(File folder) { - if (folder == null) { - println("No folder selected."); - - } else { - FolderItem tm = new FolderItem(null, folder, 0, 0); - tm.setBounds(0, 0, width, height); - tm.contentsVisible = true; - - rootItem = tm; - rootItem.zoomIn(); - rootItem.updateColors(); - } -} - - -void draw() { - background(0); - textFont(font); - - frameRate(30); - zoomBounds.update(); - - rolloverItem = null; - taggedItem = null; - - if (rootItem != null) { - rootItem.draw(); - } - if (rolloverItem != null) { - rolloverItem.drawTitle(); - } - if (taggedItem != null) { - taggedItem.drawTag(); - } -} - - -void mousePressed() { - if (zoomItem != null) { - zoomItem.mousePressed(); - } -} - diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/Edge.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/Edge.pde deleted file mode 100644 index 589f1cba0..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/Edge.pde +++ /dev/null @@ -1,45 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -class Edge { - Node from; - Node to; - float len; - int count; - - - Edge(Node from, Node to) { - this.from = from; - this.to = to; - this.len = 50; - } - - - void increment() { - count++; - } - - - void relax() { - float vx = to.x - from.x; - float vy = to.y - from.y; - float d = mag(vx, vy); - if (d > 0) { - float f = (len - d) / (d * 3); - float dx = f * vx; - float dy = f * vy; - to.dx += dx; - to.dy += dy; - from.dx -= dx; - from.dy -= dy; - } - } - - - void draw() { - stroke(edgeColor); - strokeWeight(0.35); - line(from.x, from.y, to.x, to.y); - } -} diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/Node.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/Node.pde deleted file mode 100644 index 6bf898f6d..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/Node.pde +++ /dev/null @@ -1,80 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -class Node { - float x, y; - float dx, dy; - boolean fixed; - String label; - int count; - - - Node(String label) { - this.label = label; - x = random(width); - y = random(height); - } - - - void increment() { - count++; - } - - - void relax() { - float ddx = 0; - float ddy = 0; - - for (int j = 0; j < nodeCount; j++) { - Node n = nodes[j]; - if (n != this) { - float vx = x - n.x; - float vy = y - n.y; - float lensq = vx * vx + vy * vy; - if (lensq == 0) { - ddx += random(1); - ddy += random(1); - } else if (lensq < 100*100) { - ddx += vx / lensq; - ddy += vy / lensq; - } - } - } - float dlen = mag(ddx, ddy) / 2; - if (dlen > 0) { - dx += ddx / dlen; - dy += ddy / dlen; - } - } - - - void update() { - if (!fixed) { - x += constrain(dx, -5, 5); - y += constrain(dy, -5, 5); - - x = constrain(x, 0, width); - y = constrain(y, 0, height); - } - dx /= 2; - dy /= 2; - } - - - void draw() { - fill(nodeColor); - stroke(0); - strokeWeight(0.5); - - ellipse(x, y, count, count); - float w = textWidth(label); - - if (count > w+2) { - fill(0); - textAlign(CENTER, CENTER); - text(label, x, y); - } - } -} - diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/data/huckfinn.txt b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/data/huckfinn.txt deleted file mode 100644 index b524c3811..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/data/huckfinn.txt +++ /dev/null @@ -1,17 +0,0 @@ -YOU don't know about me without you have read a book by the name of The Adventures of Tom Sawyer; but that ain't no matter. That book was made by Mr. Mark Twain, and he told the truth, mainly. There was things which he stretched, but mainly he told the truth. That is nothing. I never seen anybody but lied one time or another, without it was Aunt Polly, or the widow, or maybe Mary. Aunt Polly--Tom's Aunt Polly, she is--and Mary, and the Widow Douglas is all told about in that book, which is mostly a true book, with some stretchers, as I said before. - -Now the way that the book winds up is this: Tom and me found the money that the robbers hid in the cave, and it made us rich. We got six thousand dollars apiece--all gold. It was an awful sight of money when it was piled up. Well, Judge Thatcher he took it and put it out at interest, and it fetched us a dollar a day apiece all the year round--more than a body could tell what to do with. The Widow Douglas she took me for her son, and allowed she would sivilize me; but it was rough living in the house all the time, considering how dismal regular and decent the widow was in all her ways; and so when I couldn't stand it no longer I lit out. I got into my old rags and my sugar-hogshead again, and was free and satisfied. But Tom Sawyer he hunted me up and said he was going to start a band of robbers, and I might join if I would go back to the widow and be respectable. So I went back. - -The widow she cried over me, and called me a poor lost lamb, and she called me a lot of other names, too, but she never meant no harm by it. She put me in them new clothes again, and I couldn't do nothing but sweat and sweat, and feel all cramped up. Well, then, the old thing commenced again. The widow rung a bell for supper, and you had to come to time. When you got to the table you couldn't go right to eating, but you had to wait for the widow to tuck down her head and grumble a little over the victuals, though there warn't really anything the matter with them,--that is, nothing only everything was cooked by itself. In a barrel of odds and ends it is different; things get mixed up, and the juice kind of swaps around, and the things go better. - -After supper she got out her book and learned me about Moses and the Bulrushers, and I was in a sweat to find out all about him; but by and by she let it out that Moses had been dead a considerable long time; so then I didn't care no more about him, because I don't take no stock in dead people. - -Pretty soon I wanted to smoke, and asked the widow to let me. But she wouldn't. She said it was a mean practice and wasn't clean, and I must try to not do it any more. That is just the way with some people. They get down on a thing when they don't know nothing about it. Here she was a-bothering about Moses, which was no kin to her, and no use to anybody, being gone, you see, yet finding a power of fault with me for doing a thing that had some good in it. And she took snuff, too; of course that was all right, because she done it herself. - -Her sister, Miss Watson, a tolerable slim old maid, with goggles on, had just come to live with her, and took a set at me now with a spelling-book. She worked me middling hard for about an hour, and then the widow made her ease up. I couldn't stood it much longer. Then for an hour it was deadly dull, and I was fidgety. Miss Watson would say, "Don't put your feet up there, Huckleberry;" and "Don't scrunch up like that, Huckleberry--set up straight;" and pretty soon she would say, "Don't gap and stretch like that, Huckleberry--why don't you try to behave?" Then she told me all about the bad place, and I said I wished I was there. She got mad then, but I didn't mean no harm. All I wanted was to go somewheres; all I wanted was a change, I warn't particular. She said it was wicked to say what I said; said she wouldn't say it for the whole world; she was going to live so as to go to the good place. Well, I couldn't see no advantage in going where she was going, so I made up my mind I wouldn't try for it. But I never said so, because it would only make trouble, and wouldn't do no good. - -Now she had got a start, and she went on and told me all about the good place. She said all a body would have to do there was to go around all day long with a harp and sing, forever and ever. So I didn't think much of it. But I never said so. I asked her if she reckoned Tom Sawyer would go there, and she said not by a considerable sight. I was glad about that, because I wanted him and me to be together. - -Miss Watson she kept pecking at me, and it got tiresome and lonesome. By and by they fetched the niggers in and had prayers, and then everybody was off to bed. I went up to my room with a piece of candle, and put it on the table. Then I set down in a chair by the window and tried to think of something cheerful, but it warn't no use. I felt so lonesome I most wished I was dead. The stars were shining, and the leaves rustled in the woods ever so mournful; and I heard an owl, away off, who-whooing about somebody that was dead, and a whippowill and a dog crying about somebody that was going to die; and the wind was trying to whisper something to me, and I couldn't make out what it was, and so it made the cold shivers run over me. Then away out in the woods I heard that kind of a sound that a ghost makes when it wants to tell about something that's on its mind and can't make itself understood, and so can't rest easy in its grave, and has to go about that way every night grieving. I got so down-hearted and scared I did wish I had some company. Pretty soon a spider went crawling up my shoulder, and I flipped it off and it lit in the candle; and before I could budge it was all shriveled up. I didn't need anybody to tell me that that was an awful bad sign and would fetch me some bad luck, so I was scared and most shook the clothes off of me. I got up and turned around in my tracks three times and crossed my breast every time; and then I tied up a little lock of my hair with a thread to keep witches away. But I hadn't no confidence. You do that when you've lost a horseshoe that you've found, instead of nailing it up over the door, but I hadn't ever heard anybody say it was any way to keep off bad luck when you'd killed a spider. - -I set down again, a-shaking all over, and got out my pipe for a smoke; for the house was all as still as death now, and so the widow wouldn't know. Well, after a long time I heard the clock away off in the town go boom--boom--boom--twelve licks; and all still again--stiller than ever. Pretty soon I heard a twig snap down in the dark amongst the trees--something was a stirring. I set still and listened. Directly I could just barely hear a "me-yow! me-yow!" down there. That was good! Says I, "me-yow! me-yow!" as soft as I could, and then I put out the light and scrambled out of the window on to the shed. Then I slipped down to the ground and crawled in among the trees, and, sure enough, there was Tom Sawyer waiting for me. diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/step_06c_variable_size_nodes.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/step_06c_variable_size_nodes.pde deleted file mode 100644 index bf893b7e4..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/step_06c_variable_size_nodes.pde +++ /dev/null @@ -1,186 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -int nodeCount; -Node[] nodes = new Node[100]; -HashMap nodeTable = new HashMap(); - -int edgeCount; -Edge[] edges = new Edge[500]; - -static final color nodeColor = #F0C070; -static final color selectColor = #FF3030; -static final color fixedColor = #FF8080; -static final color edgeColor = #000000; - -PFont font; - - -void setup() { - size(600, 600); - loadData(); - println(edgeCount); - font = createFont("SansSerif", 10); - textFont(font); - smooth(); -} - - -void loadData() { - String[] lines = loadStrings("huckfinn.txt"); - - // Make the text into a single String object - String line = join(lines, " "); - - // Replace -- with an actual em dash - line = line.replaceAll("--", "\u2014"); - - // Split into phrases using any of the provided tokens - String[] phrases = splitTokens(line, ".,;:?!\u2014\""); - //println(phrases); - - for (int i = 0; i < phrases.length; i++) { - // Make this phrase lowercase - String phrase = phrases[i].toLowerCase(); - // Split each phrase into individual words at one or more spaces - String[] words = splitTokens(phrase, " "); - for (int w = 0; w < words.length-1; w++) { - addEdge(words[w], words[w+1]); - } - } -} - - -void addEdge(String fromLabel, String toLabel) { - // Filter out unnecessary words - if (ignoreWord(fromLabel) || ignoreWord(toLabel)) return; - - Node from = findNode(fromLabel); - Node to = findNode(toLabel); - from.increment(); - to.increment(); - - for (int i = 0; i < edgeCount; i++) { - if (edges[i].from == from && edges[i].to == to) { - edges[i].increment(); - return; - } - } - - Edge e = new Edge(from, to); - e.increment(); - if (edgeCount == edges.length) { - edges = (Edge[]) expand(edges); - } - edges[edgeCount++] = e; -} - - -String[] ignore = { "a", "of", "the", "i", "it", "you", "and", "to" }; - -boolean ignoreWord(String what) { - for (int i = 0; i < ignore.length; i++) { - if (what.equals(ignore[i])) { - return true; - } - } - return false; -} - - -Node findNode(String label) { - label = label.toLowerCase(); - Node n = (Node) nodeTable.get(label); - if (n == null) { - return addNode(label); - } - return n; -} - - -Node addNode(String label) { - Node n = new Node(label); - if (nodeCount == nodes.length) { - nodes = (Node[]) expand(nodes); - } - nodeTable.put(label, n); - nodes[nodeCount++] = n; - return n; -} - - -void draw() { - if (record) { - beginRecord(PDF, "output.pdf"); - } - - background(255); - - for (int i = 0 ; i < edgeCount ; i++) { - edges[i].relax(); - } - for (int i = 0; i < nodeCount; i++) { - nodes[i].relax(); - } - for (int i = 0; i < nodeCount; i++) { - nodes[i].update(); - } - for (int i = 0 ; i < edgeCount ; i++) { - edges[i].draw(); - } - for (int i = 0 ; i < nodeCount ; i++) { - nodes[i].draw(); - } - - if (record) { - endRecord(); - record = false; - } -} - - -boolean record; - -void keyPressed() { - if (key == 'r') { - record = true; - } -} - - -Node selection; - - -void mousePressed() { - // Ignore anything greater than this distance - float closest = 20; - for (int i = 0; i < nodeCount; i++) { - Node n = nodes[i]; - float d = dist(mouseX, mouseY, n.x, n.y); - if (d < closest) { - selection = n; - closest = d; - } - } - if (selection != null) { - if (mouseButton == LEFT) { - selection.fixed = true; - } else if (mouseButton == RIGHT) { - selection.fixed = false; - } - } -} - - -void mouseDragged() { - if (selection != null) { - selection.x = mouseX; - selection.y = mouseY; - } -} - - -void mouseReleased() { - selection = null; -} diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/Edge.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/Edge.pde deleted file mode 100644 index 589f1cba0..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/Edge.pde +++ /dev/null @@ -1,45 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -class Edge { - Node from; - Node to; - float len; - int count; - - - Edge(Node from, Node to) { - this.from = from; - this.to = to; - this.len = 50; - } - - - void increment() { - count++; - } - - - void relax() { - float vx = to.x - from.x; - float vy = to.y - from.y; - float d = mag(vx, vy); - if (d > 0) { - float f = (len - d) / (d * 3); - float dx = f * vx; - float dy = f * vy; - to.dx += dx; - to.dy += dy; - from.dx -= dx; - from.dy -= dy; - } - } - - - void draw() { - stroke(edgeColor); - strokeWeight(0.35); - line(from.x, from.y, to.x, to.y); - } -} diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/Node.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/Node.pde deleted file mode 100644 index 6bf898f6d..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/Node.pde +++ /dev/null @@ -1,80 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -class Node { - float x, y; - float dx, dy; - boolean fixed; - String label; - int count; - - - Node(String label) { - this.label = label; - x = random(width); - y = random(height); - } - - - void increment() { - count++; - } - - - void relax() { - float ddx = 0; - float ddy = 0; - - for (int j = 0; j < nodeCount; j++) { - Node n = nodes[j]; - if (n != this) { - float vx = x - n.x; - float vy = y - n.y; - float lensq = vx * vx + vy * vy; - if (lensq == 0) { - ddx += random(1); - ddy += random(1); - } else if (lensq < 100*100) { - ddx += vx / lensq; - ddy += vy / lensq; - } - } - } - float dlen = mag(ddx, ddy) / 2; - if (dlen > 0) { - dx += ddx / dlen; - dy += ddy / dlen; - } - } - - - void update() { - if (!fixed) { - x += constrain(dx, -5, 5); - y += constrain(dy, -5, 5); - - x = constrain(x, 0, width); - y = constrain(y, 0, height); - } - dx /= 2; - dy /= 2; - } - - - void draw() { - fill(nodeColor); - stroke(0); - strokeWeight(0.5); - - ellipse(x, y, count, count); - float w = textWidth(label); - - if (count > w+2) { - fill(0); - textAlign(CENTER, CENTER); - text(label, x, y); - } - } -} - diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/data/huckfinn.txt b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/data/huckfinn.txt deleted file mode 100644 index b524c3811..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/data/huckfinn.txt +++ /dev/null @@ -1,17 +0,0 @@ -YOU don't know about me without you have read a book by the name of The Adventures of Tom Sawyer; but that ain't no matter. That book was made by Mr. Mark Twain, and he told the truth, mainly. There was things which he stretched, but mainly he told the truth. That is nothing. I never seen anybody but lied one time or another, without it was Aunt Polly, or the widow, or maybe Mary. Aunt Polly--Tom's Aunt Polly, she is--and Mary, and the Widow Douglas is all told about in that book, which is mostly a true book, with some stretchers, as I said before. - -Now the way that the book winds up is this: Tom and me found the money that the robbers hid in the cave, and it made us rich. We got six thousand dollars apiece--all gold. It was an awful sight of money when it was piled up. Well, Judge Thatcher he took it and put it out at interest, and it fetched us a dollar a day apiece all the year round--more than a body could tell what to do with. The Widow Douglas she took me for her son, and allowed she would sivilize me; but it was rough living in the house all the time, considering how dismal regular and decent the widow was in all her ways; and so when I couldn't stand it no longer I lit out. I got into my old rags and my sugar-hogshead again, and was free and satisfied. But Tom Sawyer he hunted me up and said he was going to start a band of robbers, and I might join if I would go back to the widow and be respectable. So I went back. - -The widow she cried over me, and called me a poor lost lamb, and she called me a lot of other names, too, but she never meant no harm by it. She put me in them new clothes again, and I couldn't do nothing but sweat and sweat, and feel all cramped up. Well, then, the old thing commenced again. The widow rung a bell for supper, and you had to come to time. When you got to the table you couldn't go right to eating, but you had to wait for the widow to tuck down her head and grumble a little over the victuals, though there warn't really anything the matter with them,--that is, nothing only everything was cooked by itself. In a barrel of odds and ends it is different; things get mixed up, and the juice kind of swaps around, and the things go better. - -After supper she got out her book and learned me about Moses and the Bulrushers, and I was in a sweat to find out all about him; but by and by she let it out that Moses had been dead a considerable long time; so then I didn't care no more about him, because I don't take no stock in dead people. - -Pretty soon I wanted to smoke, and asked the widow to let me. But she wouldn't. She said it was a mean practice and wasn't clean, and I must try to not do it any more. That is just the way with some people. They get down on a thing when they don't know nothing about it. Here she was a-bothering about Moses, which was no kin to her, and no use to anybody, being gone, you see, yet finding a power of fault with me for doing a thing that had some good in it. And she took snuff, too; of course that was all right, because she done it herself. - -Her sister, Miss Watson, a tolerable slim old maid, with goggles on, had just come to live with her, and took a set at me now with a spelling-book. She worked me middling hard for about an hour, and then the widow made her ease up. I couldn't stood it much longer. Then for an hour it was deadly dull, and I was fidgety. Miss Watson would say, "Don't put your feet up there, Huckleberry;" and "Don't scrunch up like that, Huckleberry--set up straight;" and pretty soon she would say, "Don't gap and stretch like that, Huckleberry--why don't you try to behave?" Then she told me all about the bad place, and I said I wished I was there. She got mad then, but I didn't mean no harm. All I wanted was to go somewheres; all I wanted was a change, I warn't particular. She said it was wicked to say what I said; said she wouldn't say it for the whole world; she was going to live so as to go to the good place. Well, I couldn't see no advantage in going where she was going, so I made up my mind I wouldn't try for it. But I never said so, because it would only make trouble, and wouldn't do no good. - -Now she had got a start, and she went on and told me all about the good place. She said all a body would have to do there was to go around all day long with a harp and sing, forever and ever. So I didn't think much of it. But I never said so. I asked her if she reckoned Tom Sawyer would go there, and she said not by a considerable sight. I was glad about that, because I wanted him and me to be together. - -Miss Watson she kept pecking at me, and it got tiresome and lonesome. By and by they fetched the niggers in and had prayers, and then everybody was off to bed. I went up to my room with a piece of candle, and put it on the table. Then I set down in a chair by the window and tried to think of something cheerful, but it warn't no use. I felt so lonesome I most wished I was dead. The stars were shining, and the leaves rustled in the woods ever so mournful; and I heard an owl, away off, who-whooing about somebody that was dead, and a whippowill and a dog crying about somebody that was going to die; and the wind was trying to whisper something to me, and I couldn't make out what it was, and so it made the cold shivers run over me. Then away out in the woods I heard that kind of a sound that a ghost makes when it wants to tell about something that's on its mind and can't make itself understood, and so can't rest easy in its grave, and has to go about that way every night grieving. I got so down-hearted and scared I did wish I had some company. Pretty soon a spider went crawling up my shoulder, and I flipped it off and it lit in the candle; and before I could budge it was all shriveled up. I didn't need anybody to tell me that that was an awful bad sign and would fetch me some bad luck, so I was scared and most shook the clothes off of me. I got up and turned around in my tracks three times and crossed my breast every time; and then I tied up a little lock of my hair with a thread to keep witches away. But I hadn't no confidence. You do that when you've lost a horseshoe that you've found, instead of nailing it up over the door, but I hadn't ever heard anybody say it was any way to keep off bad luck when you'd killed a spider. - -I set down again, a-shaking all over, and got out my pipe for a smoke; for the house was all as still as death now, and so the widow wouldn't know. Well, after a long time I heard the clock away off in the town go boom--boom--boom--twelve licks; and all still again--stiller than ever. Pretty soon I heard a twig snap down in the dark amongst the trees--something was a stirring. I set still and listened. Directly I could just barely hear a "me-yow! me-yow!" down there. That was good! Says I, "me-yow! me-yow!" as soft as I could, and then I put out the light and scrambled out of the window on to the shed. Then I slipped down to the ground and crawled in among the trees, and, sure enough, there was Tom Sawyer waiting for me. diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/step_07c_save_pdf.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/step_07c_save_pdf.pde deleted file mode 100644 index e16073bab..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/step_07c_save_pdf.pde +++ /dev/null @@ -1,186 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -int nodeCount; -Node[] nodes = new Node[100]; -HashMap nodeTable = new HashMap(); - -int edgeCount; -Edge[] edges = new Edge[500]; - -static final color nodeColor = #F0C070; -static final color selectColor = #FF3030; -static final color fixedColor = #FF8080; -static final color edgeColor = #000000; - -PFont font; - - -void setup() { - size(600, 600); - loadData(); - println(edgeCount); - font = createFont("SansSerif", 10); -} - - -void loadData() { - String[] lines = loadStrings("huckfinn.txt"); - - // Make the text into a single String object - String line = join(lines, " "); - - // Replace -- with an actual em dash - line = line.replaceAll("--", "\u2014"); - - // Split into phrases using any of the provided tokens - String[] phrases = splitTokens(line, ".,;:?!\u2014\""); - //println(phrases); - - for (int i = 0; i < phrases.length; i++) { - // Make this phrase lowercase - String phrase = phrases[i].toLowerCase(); - // Split each phrase into individual words at one or more spaces - String[] words = splitTokens(phrase, " "); - for (int w = 0; w < words.length-1; w++) { - addEdge(words[w], words[w+1]); - } - } -} - - -void addEdge(String fromLabel, String toLabel) { - // Filter out unnecessary words - if (ignoreWord(fromLabel) || ignoreWord(toLabel)) return; - - Node from = findNode(fromLabel); - Node to = findNode(toLabel); - from.increment(); - to.increment(); - - for (int i = 0; i < edgeCount; i++) { - if (edges[i].from == from && edges[i].to == to) { - edges[i].increment(); - return; - } - } - - Edge e = new Edge(from, to); - e.increment(); - if (edgeCount == edges.length) { - edges = (Edge[]) expand(edges); - } - edges[edgeCount++] = e; -} - - -String[] ignore = { "a", "of", "the", "i", "it", "you", "and", "to" }; - -boolean ignoreWord(String what) { - for (int i = 0; i < ignore.length; i++) { - if (what.equals(ignore[i])) { - return true; - } - } - return false; -} - - -Node findNode(String label) { - label = label.toLowerCase(); - Node n = (Node) nodeTable.get(label); - if (n == null) { - return addNode(label); - } - return n; -} - - -Node addNode(String label) { - Node n = new Node(label); - if (nodeCount == nodes.length) { - nodes = (Node[]) expand(nodes); - } - nodeTable.put(label, n); - nodes[nodeCount++] = n; - return n; -} - - -void draw() { - if (record) { - beginRecord(PDF, "output.pdf"); - } - - background(255); - textFont(font); - smooth(); - - for (int i = 0 ; i < edgeCount ; i++) { - edges[i].relax(); - } - for (int i = 0; i < nodeCount; i++) { - nodes[i].relax(); - } - for (int i = 0; i < nodeCount; i++) { - nodes[i].update(); - } - for (int i = 0 ; i < edgeCount ; i++) { - edges[i].draw(); - } - for (int i = 0 ; i < nodeCount ; i++) { - nodes[i].draw(); - } - - if (record) { - endRecord(); - record = false; - } -} - - -boolean record; - -void keyPressed() { - if (key == 'r') { - record = true; - } -} - - -Node selection; - - -void mousePressed() { - // Ignore anything greater than this distance - float closest = 20; - for (int i = 0; i < nodeCount; i++) { - Node n = nodes[i]; - float d = dist(mouseX, mouseY, n.x, n.y); - if (d < closest) { - selection = n; - closest = d; - } - } - if (selection != null) { - if (mouseButton == LEFT) { - selection.fixed = true; - } else if (mouseButton == RIGHT) { - selection.fixed = false; - } - } -} - - -void mouseDragged() { - if (selection != null) { - selection.x = mouseX; - selection.y = mouseY; - } -} - - -void mouseReleased() { - selection = null; -} diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/Edge.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/Edge.pde deleted file mode 100644 index 589f1cba0..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/Edge.pde +++ /dev/null @@ -1,45 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -class Edge { - Node from; - Node to; - float len; - int count; - - - Edge(Node from, Node to) { - this.from = from; - this.to = to; - this.len = 50; - } - - - void increment() { - count++; - } - - - void relax() { - float vx = to.x - from.x; - float vy = to.y - from.y; - float d = mag(vx, vy); - if (d > 0) { - float f = (len - d) / (d * 3); - float dx = f * vx; - float dy = f * vy; - to.dx += dx; - to.dy += dy; - from.dx -= dx; - from.dy -= dy; - } - } - - - void draw() { - stroke(edgeColor); - strokeWeight(0.35); - line(from.x, from.y, to.x, to.y); - } -} diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/Node.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/Node.pde deleted file mode 100644 index 6bf898f6d..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/Node.pde +++ /dev/null @@ -1,80 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -class Node { - float x, y; - float dx, dy; - boolean fixed; - String label; - int count; - - - Node(String label) { - this.label = label; - x = random(width); - y = random(height); - } - - - void increment() { - count++; - } - - - void relax() { - float ddx = 0; - float ddy = 0; - - for (int j = 0; j < nodeCount; j++) { - Node n = nodes[j]; - if (n != this) { - float vx = x - n.x; - float vy = y - n.y; - float lensq = vx * vx + vy * vy; - if (lensq == 0) { - ddx += random(1); - ddy += random(1); - } else if (lensq < 100*100) { - ddx += vx / lensq; - ddy += vy / lensq; - } - } - } - float dlen = mag(ddx, ddy) / 2; - if (dlen > 0) { - dx += ddx / dlen; - dy += ddy / dlen; - } - } - - - void update() { - if (!fixed) { - x += constrain(dx, -5, 5); - y += constrain(dy, -5, 5); - - x = constrain(x, 0, width); - y = constrain(y, 0, height); - } - dx /= 2; - dy /= 2; - } - - - void draw() { - fill(nodeColor); - stroke(0); - strokeWeight(0.5); - - ellipse(x, y, count, count); - float w = textWidth(label); - - if (count > w+2) { - fill(0); - textAlign(CENTER, CENTER); - text(label, x, y); - } - } -} - diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/data/huckfinn.txt b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/data/huckfinn.txt deleted file mode 100644 index b524c3811..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/data/huckfinn.txt +++ /dev/null @@ -1,17 +0,0 @@ -YOU don't know about me without you have read a book by the name of The Adventures of Tom Sawyer; but that ain't no matter. That book was made by Mr. Mark Twain, and he told the truth, mainly. There was things which he stretched, but mainly he told the truth. That is nothing. I never seen anybody but lied one time or another, without it was Aunt Polly, or the widow, or maybe Mary. Aunt Polly--Tom's Aunt Polly, she is--and Mary, and the Widow Douglas is all told about in that book, which is mostly a true book, with some stretchers, as I said before. - -Now the way that the book winds up is this: Tom and me found the money that the robbers hid in the cave, and it made us rich. We got six thousand dollars apiece--all gold. It was an awful sight of money when it was piled up. Well, Judge Thatcher he took it and put it out at interest, and it fetched us a dollar a day apiece all the year round--more than a body could tell what to do with. The Widow Douglas she took me for her son, and allowed she would sivilize me; but it was rough living in the house all the time, considering how dismal regular and decent the widow was in all her ways; and so when I couldn't stand it no longer I lit out. I got into my old rags and my sugar-hogshead again, and was free and satisfied. But Tom Sawyer he hunted me up and said he was going to start a band of robbers, and I might join if I would go back to the widow and be respectable. So I went back. - -The widow she cried over me, and called me a poor lost lamb, and she called me a lot of other names, too, but she never meant no harm by it. She put me in them new clothes again, and I couldn't do nothing but sweat and sweat, and feel all cramped up. Well, then, the old thing commenced again. The widow rung a bell for supper, and you had to come to time. When you got to the table you couldn't go right to eating, but you had to wait for the widow to tuck down her head and grumble a little over the victuals, though there warn't really anything the matter with them,--that is, nothing only everything was cooked by itself. In a barrel of odds and ends it is different; things get mixed up, and the juice kind of swaps around, and the things go better. - -After supper she got out her book and learned me about Moses and the Bulrushers, and I was in a sweat to find out all about him; but by and by she let it out that Moses had been dead a considerable long time; so then I didn't care no more about him, because I don't take no stock in dead people. - -Pretty soon I wanted to smoke, and asked the widow to let me. But she wouldn't. She said it was a mean practice and wasn't clean, and I must try to not do it any more. That is just the way with some people. They get down on a thing when they don't know nothing about it. Here she was a-bothering about Moses, which was no kin to her, and no use to anybody, being gone, you see, yet finding a power of fault with me for doing a thing that had some good in it. And she took snuff, too; of course that was all right, because she done it herself. - -Her sister, Miss Watson, a tolerable slim old maid, with goggles on, had just come to live with her, and took a set at me now with a spelling-book. She worked me middling hard for about an hour, and then the widow made her ease up. I couldn't stood it much longer. Then for an hour it was deadly dull, and I was fidgety. Miss Watson would say, "Don't put your feet up there, Huckleberry;" and "Don't scrunch up like that, Huckleberry--set up straight;" and pretty soon she would say, "Don't gap and stretch like that, Huckleberry--why don't you try to behave?" Then she told me all about the bad place, and I said I wished I was there. She got mad then, but I didn't mean no harm. All I wanted was to go somewheres; all I wanted was a change, I warn't particular. She said it was wicked to say what I said; said she wouldn't say it for the whole world; she was going to live so as to go to the good place. Well, I couldn't see no advantage in going where she was going, so I made up my mind I wouldn't try for it. But I never said so, because it would only make trouble, and wouldn't do no good. - -Now she had got a start, and she went on and told me all about the good place. She said all a body would have to do there was to go around all day long with a harp and sing, forever and ever. So I didn't think much of it. But I never said so. I asked her if she reckoned Tom Sawyer would go there, and she said not by a considerable sight. I was glad about that, because I wanted him and me to be together. - -Miss Watson she kept pecking at me, and it got tiresome and lonesome. By and by they fetched the niggers in and had prayers, and then everybody was off to bed. I went up to my room with a piece of candle, and put it on the table. Then I set down in a chair by the window and tried to think of something cheerful, but it warn't no use. I felt so lonesome I most wished I was dead. The stars were shining, and the leaves rustled in the woods ever so mournful; and I heard an owl, away off, who-whooing about somebody that was dead, and a whippowill and a dog crying about somebody that was going to die; and the wind was trying to whisper something to me, and I couldn't make out what it was, and so it made the cold shivers run over me. Then away out in the woods I heard that kind of a sound that a ghost makes when it wants to tell about something that's on its mind and can't make itself understood, and so can't rest easy in its grave, and has to go about that way every night grieving. I got so down-hearted and scared I did wish I had some company. Pretty soon a spider went crawling up my shoulder, and I flipped it off and it lit in the candle; and before I could budge it was all shriveled up. I didn't need anybody to tell me that that was an awful bad sign and would fetch me some bad luck, so I was scared and most shook the clothes off of me. I got up and turned around in my tracks three times and crossed my breast every time; and then I tied up a little lock of my hair with a thread to keep witches away. But I hadn't no confidence. You do that when you've lost a horseshoe that you've found, instead of nailing it up over the door, but I hadn't ever heard anybody say it was any way to keep off bad luck when you'd killed a spider. - -I set down again, a-shaking all over, and got out my pipe for a smoke; for the house was all as still as death now, and so the widow wouldn't know. Well, after a long time I heard the clock away off in the town go boom--boom--boom--twelve licks; and all still again--stiller than ever. Pretty soon I heard a twig snap down in the dark amongst the trees--something was a stirring. I set still and listened. Directly I could just barely hear a "me-yow! me-yow!" down there. That was good! Says I, "me-yow! me-yow!" as soft as I could, and then I put out the light and scrambled out of the window on to the shed. Then I slipped down to the ground and crawled in among the trees, and, sure enough, there was Tom Sawyer waiting for me. diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/step_08c_graphviz.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/step_08c_graphviz.pde deleted file mode 100644 index 7b2a4a842..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/step_08c_graphviz.pde +++ /dev/null @@ -1,200 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -int nodeCount; -Node[] nodes = new Node[100]; -HashMap nodeTable = new HashMap(); - -int edgeCount; -Edge[] edges = new Edge[500]; - -static final color nodeColor = #F0C070; -static final color selectColor = #FF3030; -static final color fixedColor = #FF8080; -static final color edgeColor = #000000; - -PFont font; - - -void setup() { - size(600, 600); - loadData(); - font = createFont("SansSerif", 10); - writeData(); -} - - -void writeData() { - PrintWriter writer = createWriter("huckfinn.dot"); - writer.println("digraph output {"); - for (int i = 0; i < edgeCount; i++) { - String from = "\"" + edges[i].from.label + "\""; - String to = "\"" + edges[i].to.label + "\""; - writer.println(TAB + from + " -> " + to + ";"); - } - writer.println("}"); - writer.flush(); - writer.close(); -} - - -void loadData() { - String[] lines = loadStrings("huckfinn.txt"); - - // Make the text into a single String object - String line = join(lines, " "); - - // Replace -- with an actual em dash - line = line.replaceAll("--", "\u2014"); - - // Split into phrases using any of the provided tokens - String[] phrases = splitTokens(line, ".,;:?!\u2014\""); - //println(phrases); - - for (int i = 0; i < phrases.length; i++) { - // Make this phrase lowercase - String phrase = phrases[i].toLowerCase(); - // Split each phrase into individual words at one or more spaces - String[] words = splitTokens(phrase, " "); - for (int w = 0; w < words.length-1; w++) { - addEdge(words[w], words[w+1]); - } - } -} - - -void addEdge(String fromLabel, String toLabel) { - // Filter out unnecessary words - if (ignoreWord(fromLabel) || ignoreWord(toLabel)) return; - - Node from = findNode(fromLabel); - Node to = findNode(toLabel); - from.increment(); - to.increment(); - - for (int i = 0; i < edgeCount; i++) { - if (edges[i].from == from && edges[i].to == to) { - edges[i].increment(); - return; - } - } - - Edge e = new Edge(from, to); - e.increment(); - if (edgeCount == edges.length) { - edges = (Edge[]) expand(edges); - } - edges[edgeCount++] = e; -} - - -String[] ignore = { "a", "of", "the", "i", "it", "you", "and", "to" }; - -boolean ignoreWord(String what) { - for (int i = 0; i < ignore.length; i++) { - if (what.equals(ignore[i])) { - return true; - } - } - return false; -} - - -Node findNode(String label) { - label = label.toLowerCase(); - Node n = (Node) nodeTable.get(label); - if (n == null) { - return addNode(label); - } - return n; -} - - -Node addNode(String label) { - Node n = new Node(label); - if (nodeCount == nodes.length) { - nodes = (Node[]) expand(nodes); - } - nodeTable.put(label, n); - nodes[nodeCount++] = n; - return n; -} - - -void draw() { - if (record) { - beginRecord(PDF, "output.pdf"); - } - - background(255); - textFont(font); - smooth(); - - for (int i = 0 ; i < edgeCount ; i++) { - edges[i].relax(); - } - for (int i = 0; i < nodeCount; i++) { - nodes[i].relax(); - } - for (int i = 0; i < nodeCount; i++) { - nodes[i].update(); - } - for (int i = 0 ; i < edgeCount ; i++) { - edges[i].draw(); - } - for (int i = 0 ; i < nodeCount ; i++) { - nodes[i].draw(); - } - - if (record) { - endRecord(); - record = false; - } -} - - -boolean record; - -void keyPressed() { - if (key == 'r') { - record = true; - } -} - - -Node selection; - - -void mousePressed() { - // Ignore anything greater than this distance - float closest = 20; - for (int i = 0; i < nodeCount; i++) { - Node n = nodes[i]; - float d = dist(mouseX, mouseY, n.x, n.y); - if (d < closest) { - selection = n; - closest = d; - } - } - if (selection != null) { - if (mouseButton == LEFT) { - selection.fixed = true; - } else if (mouseButton == RIGHT) { - selection.fixed = false; - } - } -} - - -void mouseDragged() { - if (selection != null) { - selection.x = mouseX; - selection.y = mouseY; - } -} - - -void mouseReleased() { - selection = null; -} diff --git a/java/examples/Demos/Graphics/LowLevelGL/LowLevelGL.pde b/java/examples/Demos/Graphics/LowLevelGL/LowLevelGL.pde deleted file mode 100644 index 0e7d6a628..000000000 --- a/java/examples/Demos/Graphics/LowLevelGL/LowLevelGL.pde +++ /dev/null @@ -1,103 +0,0 @@ -// Draws a triangle using low-level OpenGL calls. -import java.nio.*; - -PGL pgl; -PShader sh; - -int vertLoc; -int colorLoc; - -float[] vertices; -float[] colors; - -FloatBuffer vertData; -FloatBuffer colorData; - -void setup() { - size(640, 360, P3D); - - // Loads a shader to render geometry w/out - // textures and lights. - sh = loadShader("frag.glsl", "vert.glsl"); - - vertices = new float[12]; - vertData = allocateDirectFloatBuffer(12); - - colors = new float[12]; - colorData = allocateDirectFloatBuffer(12); -} - -void draw() { - background(0); - - // The geometric transformations will be automatically passed - // to the shader. - rotate(frameCount * 0.01, width, height, 0); - - updateGeometry(); - - pgl = beginPGL(); - sh.bind(); - - vertLoc = pgl.getAttribLocation(sh.glProgram, "vertex"); - colorLoc = pgl.getAttribLocation(sh.glProgram, "color"); - - pgl.enableVertexAttribArray(vertLoc); - pgl.enableVertexAttribArray(colorLoc); - - pgl.vertexAttribPointer(vertLoc, 4, PGL.FLOAT, false, 0, vertData); - pgl.vertexAttribPointer(colorLoc, 4, PGL.FLOAT, false, 0, colorData); - - pgl.drawArrays(PGL.TRIANGLES, 0, 3); - - pgl.disableVertexAttribArray(vertLoc); - pgl.disableVertexAttribArray(colorLoc); - - sh.unbind(); - - endPGL(); -} - -void updateGeometry() { - // Vertex 1 - vertices[0] = 0; - vertices[1] = 0; - vertices[2] = 0; - vertices[3] = 1; - colors[0] = 1; - colors[1] = 0; - colors[2] = 0; - colors[3] = 1; - - // Corner 2 - vertices[4] = width/2; - vertices[5] = height; - vertices[6] = 0; - vertices[7] = 1; - colors[4] = 0; - colors[5] = 1; - colors[6] = 0; - colors[7] = 1; - - // Corner 3 - vertices[8] = width; - vertices[9] = 0; - vertices[10] = 0; - vertices[11] = 1; - colors[8] = 0; - colors[9] = 0; - colors[10] = 1; - colors[11] = 1; - - vertData.rewind(); - vertData.put(vertices); - vertData.position(0); - - colorData.rewind(); - colorData.put(colors); - colorData.position(0); -} - -FloatBuffer allocateDirectFloatBuffer(int n) { - return ByteBuffer.allocateDirect(n * Float.SIZE/8).order(ByteOrder.nativeOrder()).asFloatBuffer(); -} diff --git a/java/examples/Demos/Graphics/Particles/Particle.pde b/java/examples/Demos/Graphics/Particles/Particle.pde deleted file mode 100644 index b205887c8..000000000 --- a/java/examples/Demos/Graphics/Particles/Particle.pde +++ /dev/null @@ -1,59 +0,0 @@ -class Particle { - - PVector velocity; - float lifespan = 255; - - PShape part; - float partSize; - - PVector gravity = new PVector(0,0.1); - - - Particle() { - partSize = random(10,60); - part = createShape(); - part.beginShape(QUAD); - part.noStroke(); - part.texture(sprite); - part.normal(0, 0, 1); - part.vertex(-partSize/2, -partSize/2, 0, 0); - part.vertex(+partSize/2, -partSize/2, sprite.width, 0); - part.vertex(+partSize/2, +partSize/2, sprite.width, sprite.height); - part.vertex(-partSize/2, +partSize/2, 0, sprite.height); - part.endShape(); - - rebirth(width/2,height/2); - lifespan = random(255); - } - - PShape getShape() { - return part; - } - - void rebirth(float x, float y) { - float a = random(TWO_PI); - float speed = random(0.5,4); - velocity = new PVector(cos(a), sin(a)); - velocity.mult(speed); - lifespan = 255; - part.resetMatrix(); - part.translate(x, y); - } - - boolean isDead() { - if (lifespan < 0) { - return true; - } else { - return false; - } - } - - - public void update() { - lifespan = lifespan - 1; - velocity.add(gravity); - - part.setTint(color(255,lifespan)); - part.translate(velocity.x, velocity.y); - } -} diff --git a/java/examples/Demos/Graphics/Particles/ParticleSystem.pde b/java/examples/Demos/Graphics/Particles/ParticleSystem.pde deleted file mode 100644 index 0d164dcd7..000000000 --- a/java/examples/Demos/Graphics/Particles/ParticleSystem.pde +++ /dev/null @@ -1,36 +0,0 @@ -class ParticleSystem { - ArrayList particles; - - PShape particleShape; - - ParticleSystem(int n) { - particles = new ArrayList(); - particleShape = createShape(PShape.GROUP); - - for (int i = 0; i < n; i++) { - Particle p = new Particle(); - particles.add(p); - particleShape.addChild(p.getShape()); - } - } - - void update() { - for (Particle p : particles) { - p.update(); - } - } - - void setEmitter(float x, float y) { - for (Particle p : particles) { - if (p.isDead()) { - p.rebirth(x, y); - } - } - } - - void display() { - - shape(particleShape); - } -} - diff --git a/java/examples/Demos/Graphics/Particles/Particles.pde b/java/examples/Demos/Graphics/Particles/Particles.pde deleted file mode 100644 index cb3d6da90..000000000 --- a/java/examples/Demos/Graphics/Particles/Particles.pde +++ /dev/null @@ -1,31 +0,0 @@ -// Particles, by Daniel Shiffman. - -ParticleSystem ps; -PImage sprite; - -void setup() { - size(1024, 768, P2D); - orientation(LANDSCAPE); - sprite = loadImage("sprite.png"); - ps = new ParticleSystem(10000); - - // Writing to the depth buffer is disabled to avoid rendering - // artifacts due to the fact that the particles are semi-transparent - // but not z-sorted. - hint(DISABLE_DEPTH_MASK); -} - -void draw () { - background(0); - ps.update(); - ps.display(); - - ps.setEmitter(mouseX,mouseY); - - fill(255); - textSize(16); - text("Frame rate: " + int(frameRate), 10, 20); - -} - - diff --git a/java/examples/Demos/Graphics/Patch/Patch.pde b/java/examples/Demos/Graphics/Patch/Patch.pde deleted file mode 100644 index 2fd61636b..000000000 --- a/java/examples/Demos/Graphics/Patch/Patch.pde +++ /dev/null @@ -1,161 +0,0 @@ -// Bezier patch By Maritus Watz: -// http://www.openprocessing.org/sketch/57709 -// Normal calculation added by Andres Colubri -// Direct port of sample code by Paul Bourke. -// Original code: http://paulbourke.net/geometry/bezier/ - -int ni=4, nj=5, RESI=ni*10, RESJ=nj*10; -PVector outp[][], inp[][]; -PVector normp[][]; -boolean autoNormals = false; - -void setup() { - size(1024, 768, P3D); - build(); -} - -void draw() { - background(255); - translate(width/2,height/2); - lights(); - scale(0.9); - rotateY(map(mouseX,0,width,-PI,PI)); - rotateX(map(mouseY,0,height,-PI,PI)); - - noStroke(); - fill(255); - for(int i=0; i= 1) { - blend *= nn; - nn--; - if (kn > 1) { - blend /= (double)kn; - kn--; - } - if (nkn > 1) { - blend /= (double)nkn; - nkn--; - } - } - if (k > 0) - blend *= Math.pow(mu, (double)k); - if (n-k > 0) - blend *= Math.pow(1-mu, (double)(n-k)); - - return(blend); -} - -double DBezierBlend(int k, double mu, int n) { - int nn, kn, nkn; - double dblendf = 1; - - nn = n; - kn = k; - nkn = n - k; - - while (nn >= 1) { - dblendf *= nn; - nn--; - if (kn > 1) { - dblendf /= (double)kn; - kn--; - } - if (nkn > 1) { - dblendf /= (double)nkn; - nkn--; - } - } - - double fk = 1; - double dk = 0; - double fnk = 1; - double dnk = 0; - if (k > 0) { - fk = Math.pow(mu, (double)k); - dk = k*Math.pow(mu, (double)k-1); - } - if (n-k > 0) { - fnk = Math.pow(1-mu, (double)(n-k)); - dnk = (k-n)*Math.pow(1-mu, (double)(n-k-1)); - } - dblendf *= (dk * fnk + fk * dnk); - - return(dblendf); -} diff --git a/java/examples/Demos/Graphics/Planets/Perlin.pde b/java/examples/Demos/Graphics/Planets/Perlin.pde deleted file mode 100644 index 20963499d..000000000 --- a/java/examples/Demos/Graphics/Planets/Perlin.pde +++ /dev/null @@ -1,261 +0,0 @@ -// Implementation of 1D, 2D, and 3D Perlin noise. Based on the -// C code by Paul Bourke: -// http://local.wasp.uwa.edu.au/~pbourke/texture_colour/perlin/ -class Perlin { - int B = 0x100; - int BM = 0xff; - int N = 0x1000; - int NP = 12; - int NM = 0xfff; - - int p[]; - float g3[][]; - float g2[][]; - float g1[]; - - void normalize2(float v[]) { - float s = sqrt(v[0] * v[0] + v[1] * v[1]); - v[0] = v[0] / s; - v[1] = v[1] / s; - } - - void normalize3(float v[]) { - float s = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); - v[0] = v[0] / s; - v[1] = v[1] / s; - v[2] = v[2] / s; - } - - float sCurve(float t) { - return t * t * (3.0 - 2.0 * t); - } - - float at2(float q[], float rx, float ry) { - return rx * q[0] + ry * q[1]; - } - - float at3(float q[], float rx, float ry, float rz) { - return rx * q[0] + ry * q[1] + rz * q[2]; - } - - Perlin() { - p = new int[B + B + 2]; - g3 = new float[B + B + 2][3]; - g2 = new float[B + B + 2][2]; - g1 = new float[B + B + 2]; - - init(); - } - - void init() { - int i, j, k; - - for (i = 0 ; i < B ; i++) { - p[i] = i; - g1[i] = (random(B + B) - B) / B; - - for (j = 0 ; j < 2 ; j++) - g2[i][j] = (random(B + B) - B) / B; - normalize2(g2[i]); - - for (j = 0 ; j < 3 ; j++) - g3[i][j] = (random(B + B) - B) / B; - normalize3(g3[i]); - } - - while (0 < --i) { - k = p[i]; - p[i] = p[j = int(random(B))]; - p[j] = k; - } - - for (i = 0 ; i < B + 2 ; i++) { - p[B + i] = p[i]; - g1[B + i] = g1[i]; - for (j = 0 ; j < 2 ; j++) - g2[B + i][j] = g2[i][j]; - for (j = 0 ; j < 3 ; j++) - g3[B + i][j] = g3[i][j]; - } - } - - float noise1(float[] vec) { - int bx0, bx1; - float rx0, rx1, sx, t, u, v; - - t = vec[0] + N; - bx0 = int(t) & BM; - bx1 = (bx0 + 1) & BM; - rx0 = t - int(t); - rx1 = rx0 - 1.0; - - sx = sCurve(rx0); - u = rx0 * g1[p[bx0]]; - v = rx1 * g1[p[bx1]]; - - return lerp(u, v, sx); - } - - float noise2(float[] vec) { - int bx0, bx1, by0, by1, b00, b10, b01, b11; - float rx0, rx1, ry0, ry1, sx, sy, a, b, t, u, v; - float[] q; - int i, j; - - t = vec[0] + N; - bx0 = int(t) & BM; - bx1 = (bx0 + 1) & BM; - rx0 = t - int(t); - rx1 = rx0 - 1.0; - - t = vec[1] + N; - by0 = int(t) & BM; - by1 = (by0 + 1) & BM; - ry0 = t - int(t); - ry1 = ry0 - 1.0; - - i = p[bx0]; - j = p[bx1]; - - b00 = p[i + by0]; - b10 = p[j + by0]; - b01 = p[i + by1]; - b11 = p[j + by1]; - - sx = sCurve(rx0); - sy = sCurve(ry0); - - q = g2[b00]; - u = at2(q, rx0, ry0); - q = g2[b10]; - v = at2(q, rx1, ry0); - a = lerp(u, v, sx); - - q = g2[b01] ; - u = at2(q, rx0, ry1); - q = g2[b11] ; - v = at2(q, rx1, ry1); - b = lerp(u, v, sx); - - return lerp(a, b, sy); - } - - float noise3(float[] vec) { - int bx0, bx1, by0, by1, bz0, bz1, b00, b10, b01, b11; - float rx0, rx1, ry0, ry1, rz0, rz1, sy, sz, a, b, c, d, t, u, v; - float[] q; - int i, j; - - t = vec[0] + N; - bx0 = int(t) & BM; - bx1 = (bx0 + 1) & BM; - rx0 = t - int(t); - rx1 = rx0 - 1.0; - - t = vec[1] + N; - by0 = int(t) & BM; - by1 = (by0 + 1) & BM; - ry0 = t - int(t); - ry1 = ry0 - 1.0; - - t = vec[2] + N; - bz0 = int(t) & BM; - bz1 = (bz0 + 1) & BM; - rz0 = t - int(t); - rz1 = rz0 - 1.0; - - i = p[bx0]; - j = p[bx1]; - - b00 = p[i + by0]; - b10 = p[j + by0]; - b01 = p[i + by1]; - b11 = p[j + by1]; - - t = sCurve(rx0); - sy = sCurve(ry0); - sz = sCurve(rz0); - - q = g3[b00 + bz0]; - u = at3(q, rx0, ry0, rz0); - q = g3[b10 + bz0]; - v = at3(q, rx1, ry0, rz0); - a = lerp(u, v, t); - - q = g3[b01 + bz0]; - u = at3(q, rx0, ry1, rz0); - q = g3[b11 + bz0]; - v = at3(q, rx1, ry1, rz0); - b = lerp(u, v, t); - - c = lerp(a, b, sy); - - q = g3[b00 + bz1]; - u = at3(q, rx0, ry0, rz1); - q = g3[b10 + bz1]; - v = at3(q, rx1, ry0, rz1); - a = lerp(u, v, t); - - q = g3[b01 + bz1]; - u = at3(q, rx0, ry1, rz1); - q = g3[b11 + bz1]; - v = at3(q, rx1, ry1, rz1); - b = lerp(u, v, t); - - d = lerp(a, b, sy); - - return lerp(c, d, sz); - } - - // In what follows "nalpha" is the weight when the sum is formed. - // Typically it is 2, as this approaches 1 the function is noisier. - // "nbeta" is the harmonic scaling/spacing, typically 2. n is the - // number of harmonics added up in the final result. Higher number - // results in more detailed noise. - - float noise1D(float x, float nalpha, float nbeta, int n) { - float val, sum = 0; - float v[] = {x}; - float nscale = 1; - - for (int i = 0; i < n; i++) { - val = noise1(v); - sum += val / nscale; - nscale *= nalpha; - v[0] *= nbeta; - } - return sum; - } - - float noise2D(float x, float y, float nalpha, float nbeta, int n) { - float val,sum = 0; - float v[] = {x, y}; - float nscale = 1; - - for (int i = 0; i < n; i++) { - val = noise2(v); - sum += val / nscale; - nscale *= nalpha; - v[0] *= nbeta; - v[1] *= nbeta; - } - return sum; - } - - float noise3D(float x, float y, float z, float nalpha, float nbeta, int n) { - float val, sum = 0; - float v[] = {x, y, z}; - float nscale = 1; - - for (int i = 0 ; i < n; i++) { - val = noise3(v); - sum += val / nscale; - nscale *= nalpha; - v[0] *= nbeta; - v[1] *= nbeta; - v[2] *= nbeta; - } - return sum; - } -} - diff --git a/java/examples/Demos/Graphics/Planets/Planets.pde b/java/examples/Demos/Graphics/Planets/Planets.pde deleted file mode 100644 index 3e6494a54..000000000 --- a/java/examples/Demos/Graphics/Planets/Planets.pde +++ /dev/null @@ -1,122 +0,0 @@ -// Planets, by Andres Colubri -// -// Sun and mercury textures from http://planetpixelemporium.com -// Star field picture from http://www.galacticimages.com/ - -PImage starfield; - -PShape sun; -PImage suntex; - -PShape planet1; -PImage surftex1; -PImage cloudtex; - -PShape planet2; -PImage surftex2; - -void setup() { - size(1024, 768, P3D); - - starfield = loadImage("starfield.jpg"); - suntex = loadImage("sun.jpg"); - surftex1 = loadImage("planet.jpg"); - - // We need trilinear sampling for this texture so it looks good - // even when rendered very small. - //PTexture.Parameters params1 = PTexture.newParameters(ARGB, TRILINEAR); - surftex2 = loadImage("mercury.jpg"); - - /* - // The clouds texture will "move" having the values of its u - // texture coordinates displaced by adding a constant increment - // in each frame. This requires REPEAT wrapping mode so texture - // coordinates can be larger than 1. - //PTexture.Parameters params2 = PTexture.newParameters(); - //params2.wrapU = REPEAT; - cloudtex = createImage(512, 256); - - // Using 3D Perlin noise to generate a clouds texture that is seamless on - // its edges so it can be applied on a sphere. - cloudtex.loadPixels(); - Perlin perlin = new Perlin(); - for (int j = 0; j < cloudtex.height; j++) { - for (int i = 0; i < cloudtex.width; i++) { - // The angle values corresponding to each u,v pair: - float u = float(i) / cloudtex.width; - float v = float(j) / cloudtex.height; - float phi = map(u, 0, 1, TWO_PI, 0); - float theta = map(v, 0, 1, -HALF_PI, HALF_PI); - // The x, y, z point corresponding to these angles: - float x = cos(phi) * cos(theta); - float y = sin(theta); - float z = sin(phi) * cos(theta); - float n = perlin.noise3D(x, y, z, 1.2, 2, 8); - cloudtex.pixels[j * cloudtex.width + i] = color(255, 255, 255, 255 * n * n); - } - } - cloudtex.updatePixels(); - */ - - noStroke(); - fill(255); - sphereDetail(40); - - sun = createShape(SPHERE, 150); - sun.setTexture(suntex); - - planet1 = createShape(SPHERE, 150); - planet1.setTexture(surftex1); - - planet2 = createShape(SPHERE, 50); - planet2.setTexture(surftex2); -} - -void draw() { - // Even we draw a full screen image after this, it is recommended to use - // background to clear the screen anyways, otherwise A3D will think - // you want to keep each drawn frame in the framebuffer, which results in - // slower rendering. - background(0); - - // Disabling writing to the depth mask so the - // background image doesn't occludes any 3D object. - hint(DISABLE_DEPTH_MASK); - image(starfield, 0, 0, width, height); - hint(ENABLE_DEPTH_MASK); - - /* - // Displacing the u texture coordinate of layer 1 in planet - // so it creates the effect of moving clouds. - PShape3D p = (PShape3D)planet1; - p.loadTexcoords(1); - for (int i = 0; i < p.getVertexCount(); i++) { - float u = p.texcoords[2 * i + 0]; - u += 0.002; - p.texcoords[2 * i + 0] = u; - } - p.updateTexcoords(); - */ - - pushMatrix(); - translate(width/2, height/2, -300); - - pushMatrix(); - rotateY(PI * frameCount / 500); - shape(sun); - popMatrix(); - - pointLight(255, 255, 255, 0, 0, 0); - rotateY(PI * frameCount / 300); - translate(0, 0, 300); - - shape(planet2); - - popMatrix(); - - noLights(); - pointLight(255, 255, 255, 0, 0, -150); - - translate(0.75 * width, 0.6 * height, 50); - shape(planet1); -} diff --git a/java/examples/Demos/Graphics/Ribbons/ArcBall.pde b/java/examples/Demos/Graphics/Ribbons/ArcBall.pde deleted file mode 100644 index 5c4f74cc2..000000000 --- a/java/examples/Demos/Graphics/Ribbons/ArcBall.pde +++ /dev/null @@ -1,190 +0,0 @@ -// Ariel and V3ga's arcball class with a couple tiny mods by Robert Hodgin - -class Arcball { - float center_x, center_y, radius; - Vec3 v_down, v_drag; - Quat q_now, q_down, q_drag; - Vec3[] axisSet; - int axis; - float mxv, myv; - float x, y; - - Arcball(float center_x, float center_y, float radius){ - this.center_x = center_x; - this.center_y = center_y; - this.radius = radius; - - v_down = new Vec3(); - v_drag = new Vec3(); - - q_now = new Quat(); - q_down = new Quat(); - q_drag = new Quat(); - - axisSet = new Vec3[] {new Vec3(1.0f, 0.0f, 0.0f), new Vec3(0.0f, 1.0f, 0.0f), new Vec3(0.0f, 0.0f, 1.0f)}; - axis = -1; // no constraints... - } - - void mousePressed(){ - v_down = mouse_to_sphere(mouseX, mouseY); - q_down.set(q_now); - q_drag.reset(); - } - - void mouseDragged(){ - v_drag = mouse_to_sphere(mouseX, mouseY); - q_drag.set(Vec3.dot(v_down, v_drag), Vec3.cross(v_down, v_drag)); - } - - void run(){ - q_now = Quat.mul(q_drag, q_down); - applyQuat2Matrix(q_now); - - x += mxv; - y += myv; - mxv -= mxv * .01; - myv -= myv * .01; - } - - Vec3 mouse_to_sphere(float x, float y){ - Vec3 v = new Vec3(); - v.x = (x - center_x) / radius; - v.y = (y - center_y) / radius; - - float mag = v.x * v.x + v.y * v.y; - if (mag > 1.0f){ - v.normalize(); - } else { - v.z = sqrt(1.0f - mag); - } - - return (axis == -1) ? v : constrain_vector(v, axisSet[axis]); - } - - Vec3 constrain_vector(Vec3 vector, Vec3 axis){ - Vec3 res = new Vec3(); - res.sub(vector, Vec3.mul(axis, Vec3.dot(axis, vector))); - res.normalize(); - return res; - } - - void applyQuat2Matrix(Quat q){ - // instead of transforming q into a matrix and applying it... - - float[] aa = q.getValue(); - rotate(aa[0], aa[1], aa[2], aa[3]); - } -} - -static class Vec3{ - float x, y, z; - - Vec3(){ - } - - Vec3(float x, float y, float z){ - this.x = x; - this.y = y; - this.z = z; - } - - void normalize(){ - float length = length(); - x /= length; - y /= length; - z /= length; - } - - float length(){ - return (float) Math.sqrt(x * x + y * y + z * z); - } - - static Vec3 cross(Vec3 v1, Vec3 v2){ - Vec3 res = new Vec3(); - res.x = v1.y * v2.z - v1.z * v2.y; - res.y = v1.z * v2.x - v1.x * v2.z; - res.z = v1.x * v2.y - v1.y * v2.x; - return res; - } - - static float dot(Vec3 v1, Vec3 v2){ - return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z; - } - - static Vec3 mul(Vec3 v, float d){ - Vec3 res = new Vec3(); - res.x = v.x * d; - res.y = v.y * d; - res.z = v.z * d; - return res; - } - - void sub(Vec3 v1, Vec3 v2){ - x = v1.x - v2.x; - y = v1.y - v2.y; - z = v1.z - v2.z; - } -} - -static class Quat{ - float w, x, y, z; - - Quat(){ - reset(); - } - - Quat(float w, float x, float y, float z){ - this.w = w; - this.x = x; - this.y = y; - this.z = z; - } - - void reset(){ - w = 1.0f; - x = 0.0f; - y = 0.0f; - z = 0.0f; - } - - void set(float w, Vec3 v){ - this.w = w; - x = v.x; - y = v.y; - z = v.z; - } - - void set(Quat q){ - w = q.w; - x = q.x; - y = q.y; - z = q.z; - } - - static Quat mul(Quat q1, Quat q2){ - Quat res = new Quat(); - res.w = q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z; - res.x = q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y; - res.y = q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z; - res.z = q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x; - return res; - } - - float[] getValue(){ - // transforming this quat into an angle and an axis vector... - - float[] res = new float[4]; - - float sa = (float) Math.sqrt(1.0f - w * w); - if (sa < EPSILON){ - sa = 1.0f; - } - - res[0] = (float) Math.acos(w) * 2.0f; - res[1] = x / sa; - res[2] = y / sa; - res[3] = z / sa; - - return res; - } -} diff --git a/java/examples/Demos/Graphics/Ribbons/BSpline.pde b/java/examples/Demos/Graphics/Ribbons/BSpline.pde deleted file mode 100644 index b622e8498..000000000 --- a/java/examples/Demos/Graphics/Ribbons/BSpline.pde +++ /dev/null @@ -1,307 +0,0 @@ -final int MAX_BEZIER_ORDER = 10; // Maximum curve order. - -final float[][] BSplineMatrix = { - {-1.0/6.0, 1.0/2.0, -1.0/2.0, 1.0/6.0}, - { 1.0/2.0, -1.0, 1.0/2.0, 0.0}, - {-1.0/2.0, 0.0, 1.0/2.0, 0.0}, - { 1.0/6.0, 2.0/3.0, 1.0/6.0, 0.0} -}; - -// The element(i, n) of this array contains the binomial coefficient -// C(i, n) = n!/(i!(n-i)!) -final int[][] BinomialCoefTable = { - {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, - {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, - {0, 1, 3, 6, 10, 15, 21, 28, 36, 45}, - {0, 0, 1, 4, 10, 20, 35, 56, 84, 120}, - {0, 0, 0, 1, 5, 15, 35, 70, 126, 210}, - {0, 0, 0, 0, 1, 6, 21, 56, 126, 252}, - {0, 0, 0, 0, 0, 1, 7, 28, 84, 210}, - {0, 0, 0, 0, 0, 0, 1, 8, 36, 120}, - {0, 0, 0, 0, 0, 0, 0, 1, 9, 45}, - {0, 0, 0, 0, 0, 0, 0, 0, 1, 10}, - {0, 0, 0, 0, 0, 0, 0, 0, 0, 1} -}; - -// The element of this(i, j) of this table contains(i/10)^(3-j). -final float[][] TVectorTable = { -// t^3, t^2, t^1, t^0 - { 0, 0, 0, 1}, // t = 0.0 - {0.001, 0.01, 0.1, 1}, // t = 0.1 - {0.008, 0.04, 0.2, 1}, // t = 0.2 - {0.027, 0.09, 0.3, 1}, // t = 0.3 - {0.064, 0.16, 0.4, 1}, // t = 0.4 - {0.125, 0.25, 0.5, 1}, // t = 0.5 - {0.216, 0.36, 0.6, 1}, // t = 0.6 - {0.343, 0.49, 0.7, 1}, // t = 0.7 - {0.512, 0.64, 0.8, 1}, // u = 0.8 - {0.729, 0.81, 0.9, 1}, // t = 0.9 - { 1, 1, 1, 1} // t = 1.0 -}; - -// The element of this(i, j) of this table contains(3-j)*(i/10)^(2-j) if -// j < 3, 0 otherwise. -final float[][] DTVectorTable = { -// 3t^2, 2t^1, t^0 - { 0, 0, 1, 0}, // t = 0.0 - {0.03, 0.2, 1, 0}, // t = 0.1 - {0.12, 0.4, 1, 0}, // t = 0.2 - {0.27, 0.6, 1, 0}, // t = 0.3 - {0.48, 0.8, 1, 0}, // t = 0.4 - {0.75, 1.0, 1, 0}, // t = 0.5 - {1.08, 1.2, 1, 0}, // t = 0.6 - {1.47, 1.4, 1, 0}, // t = 0.7 - {1.92, 1.6, 1, 0}, // t = 0.8 - {2.43, 1.8, 1, 0}, // t = 0.9 - { 3, 2, 1, 0} // t = 1.0 -}; - -abstract class Curve3D { - abstract void feval(float t, PVector p); - abstract void deval(float t, PVector d); - abstract float fevalX(float t); - abstract float fevalY(float t); - abstract float fevalZ(float t); - abstract float devalX(float t); - abstract float devalY(float t); - abstract float devalZ(float t); -} - -abstract class Spline extends Curve3D { - // The factorial of n. - int factorial(int n) { - return n <= 0 ? 1 : n * factorial(n - 1); - } - - // Gives n!/(i!(n-i)!). - int binomialCoef(int i, int n) { - if ((i <= MAX_BEZIER_ORDER) && (n <= MAX_BEZIER_ORDER)) return BinomialCoefTable[i][n - 1]; - else return int(factorial(n) / (factorial(i) * factorial(n - i))); - } - - // Evaluates the Berstein polinomial(i, n) at u. - float bersteinPol(int i, int n, float u) { - return binomialCoef(i, n) * pow(u, i) * pow(1 - u, n - i); - } - - // The derivative of the Berstein polinomial. - float dbersteinPol(int i, int n, float u) { - float s1, s2; - if (i == 0) s1 = 0; - else s1 = i * pow(u, i-1) * pow(1 - u, n - i); - if (n == i) s2 = 0; - else s2 = -(n - i) * pow(u, i) * pow(1 - u, n - i - 1); - return binomialCoef(i, n) *(s1 + s2); - } -} - -class BSpline extends Spline { - // Control points. - float[][] bsplineCPoints; - - // Parameters. - boolean lookup; - - // Auxiliary arrays used in the calculations. - float[][] M3; - float[] TVector, DTVector; - - // Point and tangent vectors. - float[] pt, tg; - - BSpline() { - initParameters(true); - } - - BSpline(boolean t) { - initParameters(t); - } - - // Sets lookup table use. - void initParameters(boolean t) { - bsplineCPoints = new float[4][3]; - TVector = new float[4]; - DTVector = new float[4]; - M3 = new float[4][3]; - pt = new float[3]; - tg = new float[3]; - lookup = t; - } - - // Sets n-th control point. - void setCPoint(int n, PVector P) { - bsplineCPoints[n][0] = P.x; - bsplineCPoints[n][1] = P.y; - bsplineCPoints[n][2] = P.z; - updateMatrix3(); - } - - // Gets n-th control point. - void getCPoint(int n, PVector P) { - P.set(bsplineCPoints[n]); - } - - // Replaces the current B-spline control points(0, 1, 2) with(1, 2, 3). This - // is used when a new spline is to be joined to the recently drawn. - void shiftBSplineCPoints() { - for (int i = 0; i < 3; i++) { - bsplineCPoints[0][i] = bsplineCPoints[1][i]; - bsplineCPoints[1][i] = bsplineCPoints[2][i]; - bsplineCPoints[2][i] = bsplineCPoints[3][i]; - } - updateMatrix3(); - } - - void copyCPoints(int n_source, int n_dest) { - for (int i = 0; i < 3; i++) { - bsplineCPoints[n_dest][i] = bsplineCPoints[n_source][i]; - } - } - - // Updates the temporal matrix used in order 3 calculations. - void updateMatrix3() { - float s; - int i, j, k; - for(i = 0; i < 4; i++) { - for(j = 0; j < 3; j++) { - s = 0; - for(k = 0; k < 4; k++) s += BSplineMatrix[i][k] * bsplineCPoints[k][j]; - M3[i][j] = s; - } - } - } - - void feval(float t, PVector p) { - evalPoint(t); - p.set(pt); - } - - void deval(float t, PVector d) { - evalTangent(t); - d.set(tg); - } - - float fevalX(float t) { - evalPoint(t); - return pt[0]; - } - - float fevalY(float t) { - evalPoint(t); - return pt[1]; - } - - float fevalZ(float t) { - evalPoint(t); - return pt[2]; - } - - float devalX(float t) { - evalTangent(t); - return tg[0]; - } - - float devalY(float t) { - evalTangent(t); - return tg[1]; - } - - float devalZ(float t) { - evalTangent(t); - return tg[2]; - } - - // Point evaluation. - void evalPoint(float t) { - if (lookup) { - bsplinePointI(int(10 * t)); - } else { - bsplinePoint(t); - } - } - - // Tangent evaluation. - void evalTangent(float t) { - if (lookup) { - bsplineTangentI(int(10 * t)); - } else { - bsplineTangent(t); - } - } - - // Calculates the point on the cubic spline corresponding to the parameter value t in [0, 1]. - void bsplinePoint(float t) { - // Q(u) = UVector * BSplineMatrix * BSplineCPoints - - float s; - int i, j, k; - - for(i = 0; i < 4; i++) { - TVector[i] = pow(t, 3 - i); - } - - for(j = 0; j < 3; j++) { - s = 0; - for(k = 0; k < 4; k++) { - s += TVector[k] * M3[k][j]; - } - pt[j] = s; - } - } - - // Calculates the tangent vector of the spline at t. - void bsplineTangent(float t) { - // Q(u) = DTVector * BSplineMatrix * BSplineCPoints - - float s; - int i, j, k; - - for(i = 0; i < 4; i++) { - if (i < 3) { - DTVector[i] = (3 - i) * pow(t, 2 - i); - } else { - DTVector[i] = 0; - } - } - - for(j = 0; j < 3; j++) { - s = 0; - for(k = 0; k < 4; k++) { - s += DTVector[k] * M3[k][j]; - } - tg[j] = s; - } - } - - // Gives the point on the cubic spline corresponding to t/10(using the lookup table). - void bsplinePointI(int t) { - // Q(u) = TVectorTable[u] * BSplineMatrix * BSplineCPoints - - float s; - int j, k; - - for(j = 0; j < 3; j++) { - s = 0; - for(k = 0; k < 4; k++) { - s += TVectorTable[t][k] * M3[k][j]; - } - pt[j] = s; - } - } - - // Calulates the tangent vector of the spline at t/10. - void bsplineTangentI(int t) { - // Q(u) = DTVectorTable[u] * BSplineMatrix * BSplineCPoints - - float s; - int j, k; - - for(j = 0; j < 3; j++) { - s = 0; - for(k = 0; k < 4; k++) { - s += DTVectorTable[t][k] * M3[k][j]; - } - tg[j] = s; - } - } -} diff --git a/java/examples/Demos/Graphics/Ribbons/Geometry.pde b/java/examples/Demos/Graphics/Ribbons/Geometry.pde deleted file mode 100644 index 302b0f413..000000000 --- a/java/examples/Demos/Graphics/Ribbons/Geometry.pde +++ /dev/null @@ -1,497 +0,0 @@ -BSpline splineSide1; -BSpline splineCenter; -BSpline splineSide2; -PVector flipTestV; -int uspacing; - -int HELIX = 0; -int STRAND = 1; -int COIL = 2; -int LHANDED = -1; -int RHANDED = 1; - -void createRibbonModel(ArrayList residues, PShape model, ArrayList trj) { - // For line ribbons - ArrayList vertices0 = new ArrayList(); - ArrayList vertices1 = new ArrayList(); - ArrayList vertices2 = new ArrayList(); - - // For flat ribbons - ArrayList vertices = new ArrayList(); - ArrayList normals = new ArrayList(); - - if (ribbonDetail == 1) uspacing = 10; - else if (ribbonDetail == 2) uspacing = 5; - else if (ribbonDetail == 3) uspacing = 2; - else uspacing = 1; - - flipTestV = new PVector(); - splineSide1 = new BSpline(false); - splineCenter = new BSpline(false); - splineSide2 = new BSpline(false); - - int[] ss = new int[residues.size()]; - int[] handness = new int[residues.size()]; - - calculateSecStr(residues, ss, handness); - - for (int i = 0; i < residues.size(); i++) { - constructControlPoints(residues, i, ss[i], handness[i]); - - if (renderMode == 0) { - generateSpline(0, vertices0); - generateSpline(1, vertices1); - generateSpline(2, vertices2); - } - else { - generateFlatRibbon(vertices, normals); - } - } - - if (renderMode == 0) { - model = createShape(); - model.beginShape(); - model.stroke(ribbonColor); - model.noFill(); - model.beginContour(); - for (int i = 0; i < vertices0.size(); i++) { - PVector posVec = (PVector)vertices0.get(i); - model.vertex(posVec.x, posVec.y, posVec.z); - } - model.endContour(); - model.beginContour(); - for (int i = 0; i < vertices1.size(); i++) { - PVector posVec = (PVector)vertices1.get(i); - model.vertex(posVec.x, posVec.y, posVec.z); - } - model.endContour(); - model.beginContour(); - for (int i = 0; i < vertices2.size(); i++) { - PVector posVec = (PVector)vertices2.get(i); - model.vertex(posVec.x, posVec.y, posVec.z); - } - model.endContour(); - model.endShape(OPEN); - } else { - // The ribbon construction is fairly inneficient here, since - // it could use triangle strips instead to avoid duplicating - // shared vertices... - model = createShape(); - model.beginShape(TRIANGLES); - model.noStroke(); - model.fill(ribbonColor); - for (int i = 0; i < vertices.size(); i++) { - PVector posVec = (PVector)vertices.get(i); - PVector normVec = (PVector)normals.get(i); - model.normal(-normVec.x, -normVec.y, -normVec.z); - model.vertex(posVec.x, posVec.y, posVec.z); - } - model.endShape(); - } - - trj.add(model); - - if (renderMode == 0) { - int totCount = vertices0.size() + vertices1.size() + vertices2.size(); - println("Adding new model with " + totCount + " vertices."); - } else { - println("Adding new model with " + vertices.size() + " vertices."); - } -} - -float calculateGyrRadius(ArrayList atoms) { - PVector ati, atj; - float dx, dy, dz; - float r = 0; - for (int i = 0; i < atoms.size(); i++) { - ati = (PVector)atoms.get(i); - for (int j = i + 1; j < atoms.size(); j++) { - atj = (PVector)atoms.get(j); - - dx = ati.x - atj.x; - dy = ati.y - atj.y; - dz = ati.z - atj.z; - r += dx * dx + dy * dy + dz * dz; - } - } - return sqrt(r) / (atoms.size() + 1); -} - -// Does a cheap and dirty secondary structure assignment to the protein -// residues given in the array. -void calculateSecStr(ArrayList residues, int[] ss, int[] handness) { - PVector c0, n1, ca1, c1, n2; - HashMap res0, res1, res2; - int n = residues.size(); - - float[] phi = new float[n]; - float[] psi = new float[n]; - - for (int i = 0; i < n; i++) { - if (i == 0 || i == n - 1) { - phi[i] = 90; - psi[i] = 90; - } else { - res0 = (HashMap)residues.get(i - 1); - res1 = (HashMap)residues.get(i); - res2 = (HashMap)residues.get(i + 1); - - c0 = (PVector)res0.get("C"); - n1 = (PVector)res1.get("N"); - ca1 = (PVector)res1.get("CA"); - c1 = (PVector)res1.get("C"); - n2 = (PVector)res2.get("N"); - - phi[i] = calculateTorsionalAngle(c0, n1, ca1, c1); - psi[i] = calculateTorsionalAngle(n1, ca1, c1, n2); - } - } - - int firstHelix = 0; - int nconsRHelix = 0; - int nconsLHelix = 0; - int firstStrand = 0; - int nconsStrand = 0; - for (int i = 0; i < n; i++) { - // Right-handed helix - if ((dist(phi[i], psi[i], -60, -45) < 30) && (i < n - 1)) { - if (nconsRHelix == 0) firstHelix = i; - nconsRHelix++; - } - else { - if (3 <= nconsRHelix) { - for (int k = firstHelix; k < i; k++) { - ss[k] = HELIX; - handness[k] = RHANDED; - } - } - nconsRHelix = 0; - } - - // Left-handed helix - if ((dist(phi[i], psi[i], +60, +45) < 30) && (i < n - 1)) { - if (nconsLHelix == 0) firstHelix = i; - nconsLHelix++; - - } else { - if (3 <= nconsLHelix) { - for (int k = firstHelix; k < i; k++) { - ss[k] = HELIX; - handness[k] = LHANDED; - } - } - nconsLHelix = 0; - } - - // Strand - if ((dist(phi[i], psi[i], -110, +130) < 30) && (i < n - 1)) { - if (nconsStrand == 0) firstStrand = i; - nconsStrand++; - } else { - if (2 <= nconsStrand) { - for (int k = firstStrand; k < i; k++) { - ss[k] = STRAND; - handness[k] = RHANDED; - - } - } - nconsStrand = 0; - } - - ss[i] = COIL; - handness[i] = RHANDED; - } -} - -// Calculates the torsional angle defined by four atoms with positions at0, at1, at2 and at3. -float calculateTorsionalAngle(PVector at0, PVector at1, PVector at2, PVector at3) { - PVector r01 = PVector.sub(at0, at1); - PVector r32 = PVector.sub(at3, at2); - PVector r12 = PVector.sub(at1, at2); - - PVector p = r12.cross(r01); - PVector q = r12.cross(r32); - PVector r = r12.cross(q); - - float u = q.dot(q); - float v = r.dot(r); - - float a; - if (u <= 0.0 || v <= 0.0) { - a = 360.0; - } else { - float u1 = p.dot(q); // u1 = p * q - float v1 = p.dot(r); // v1 = p * r - - u = u1 / sqrt(u); - v = v1 / sqrt(v); - - if (abs(u) > 0.01 || abs(v) > 0.01) a = degrees(atan2(v, u)); - else a = 360.0; - } - return a; -} - -void generateSpline(int n, ArrayList vertices) { - int ui; - float u; - PVector v0, v1; - - v1 = new PVector(); - - if (n == 0) splineSide1.feval(0, v1); - else if (n == 1) splineCenter.feval(0, v1); - else splineSide2.feval(0, v1); - vertices.add(new PVector(v1.x, v1.y, v1.z)); - - for (ui = 1; ui <= 10; ui ++) { - if (ui % uspacing == 0) { - u = 0.1 * ui; - - if (n == 0) splineSide1.feval(u, v1); - else if (n == 1) splineCenter.feval(u, v1); - else splineSide2.feval(u, v1); - - vertices.add(new PVector(v1.x, v1.y, v1.z)); - } - } -} - -void generateFlatRibbon(ArrayList vertices, ArrayList normals) { - PVector CentPoint0, CentPoint1; - PVector Sid1Point0, Sid1Point1; - PVector Sid2Point0, Sid2Point1; - PVector Transversal, Tangent; - PVector Normal0, Normal1; - int ui; - float u; - - CentPoint0 = new PVector(); - CentPoint1 = new PVector(); - Sid1Point0 = new PVector(); - Sid1Point1 = new PVector(); - Sid2Point0 = new PVector(); - Sid2Point1 = new PVector(); - Transversal = new PVector(); - Tangent = new PVector(); - Normal0 = new PVector(); - Normal1 = new PVector(); - - // The initial geometry is generated. - splineSide1.feval(0, Sid1Point1); - splineCenter.feval(0, CentPoint1); - splineSide2.feval(0, Sid2Point1); - - // The tangents at the three previous points are the same. - splineSide2.deval(0, Tangent); - - // Vector transversal to the ribbon. - Transversal = PVector.sub(Sid1Point1, Sid2Point1); - - // The normal is calculated. - Normal1 = Transversal.cross(Tangent); - Normal1.normalize(); - - for (ui = 1; ui <= 10; ui ++) { - if (ui % uspacing == 0) { - u = 0.1 * ui; - - // The geometry of the previous iteration is saved. - Sid1Point0.set(Sid1Point1); - CentPoint0.set(CentPoint1); - Sid2Point0.set(Sid2Point1); - Normal0.set(Normal1); - - // The new geometry is generated. - splineSide1.feval(u, Sid1Point1); - splineCenter.feval(u, CentPoint1); - splineSide2.feval(u, Sid2Point1); - - // The tangents at the three previous points are the same. - splineSide2.deval(u, Tangent); - // Vector transversal to the ribbon. - Transversal = PVector.sub(Sid1Point1, Sid2Point1); - // The normal is calculated. - Normal1 = Transversal.cross(Tangent); - Normal1.normalize(); - - // The (Sid1Point0, Sid1Point1, CentPoint1) triangle is added. - vertices.add(new PVector(Sid1Point0.x, Sid1Point0.y, Sid1Point0.z)); - normals.add(new PVector(Normal0.x, Normal0.y, Normal0.z)); - - vertices.add(new PVector(Sid1Point1.x, Sid1Point1.y, Sid1Point1.z)); - normals.add(new PVector(Normal1.x, Normal1.y, Normal1.z)); - - vertices.add(new PVector(CentPoint1.x, CentPoint1.y, CentPoint1.z)); - normals.add(new PVector(Normal1.x, Normal1.y, Normal1.z)); - - // The (Sid1Point0, CentPoint1, CentPoint0) triangle is added. - vertices.add(new PVector(Sid1Point0.x, Sid1Point0.y, Sid1Point0.z)); - normals.add(new PVector(Normal0.x, Normal0.y, Normal0.z)); - - vertices.add(new PVector(CentPoint1.x, CentPoint1.y, CentPoint1.z)); - normals.add(new PVector(Normal1.x, Normal1.y, Normal1.z)); - - vertices.add(new PVector(CentPoint0.x, CentPoint0.y, CentPoint0.z)); - normals.add(new PVector(Normal0.x, Normal0.y, Normal0.z)); - - // (Sid2Point0, Sid2Point1, CentPoint1) triangle is added. - vertices.add(new PVector(Sid2Point0.x, Sid2Point0.y, Sid2Point0.z)); - normals.add(new PVector(Normal0.x, Normal0.y, Normal0.z)); - - vertices.add(new PVector(Sid2Point1.x, Sid2Point1.y, Sid2Point1.z)); - normals.add(new PVector(Normal1.x, Normal1.y, Normal1.z)); - - vertices.add(new PVector(CentPoint1.x, CentPoint1.y, CentPoint1.z)); - normals.add(new PVector(Normal1.x, Normal1.y, Normal1.z)); - - // (Sid2Point0, CentPoint1, CentPoint0) triangle is added. - vertices.add(new PVector(Sid2Point0.x, Sid2Point0.y, Sid2Point0.z)); - normals.add(new PVector(Normal0.x, Normal0.y, Normal0.z)); - - vertices.add(new PVector(CentPoint1.x, CentPoint1.y, CentPoint1.z)); - normals.add(new PVector(Normal1.x, Normal1.y, Normal1.z)); - - vertices.add(new PVector(CentPoint0.x, CentPoint0.y, CentPoint0.z)); - normals.add(new PVector(Normal0.x, Normal0.y, Normal0.z)); - } - } -} - -/****************************************************************************** - * The code in the following three functions is based in the method introduced - * in this paper: - * "Algorithm for ribbon models of proteins." - * Authors: Mike Carson and Charles E. Bugg - * Published in: J.Mol.Graphics 4, pp. 121-122 (1986) - ******************************************************************************/ - -// Shifts the control points one place to the left. -void shiftControlPoints() { - splineSide1.shiftBSplineCPoints(); - splineCenter.shiftBSplineCPoints(); - splineSide2.shiftBSplineCPoints(); -} - -// Adds a new control point to the arrays CPCenter, CPRight and CPLeft -void addControlPoints(PVector ca0, PVector ox0, PVector ca1, int ss, int handness) { - PVector A, B, C, D, p0, cpt0, cpt1, cpt2; - - A = PVector.sub(ca1, ca0); - B = PVector.sub(ox0, ca0); - - // Vector normal to the peptide plane (pointing outside in the case of the - // alpha helix). - C = A.cross(B); - - // Vector contained in the peptide plane (perpendicular to its direction). - D = C.cross(A); - - // Normalizing vectors. - C.normalize(); - D.normalize(); - - // Flipping test (to avoid self crossing in the strands). - if ((ss != HELIX) && (90.0 < degrees(PVector.angleBetween(flipTestV, D)))) { - // Flip detected. The plane vector is inverted. - D.mult(-1.0); - } - - // The central control point is constructed. - cpt0 = linearComb(0.5, ca0, 0.5, ca1); - splineCenter.setCPoint(3, cpt0); - - if (ss == HELIX) { - // When residue i is contained in a helix, the control point is moved away - // from the helix axis, along the C direction. - p0 = new PVector(); - splineCenter.getCPoint(3, p0); - cpt0 = linearComb(1.0, p0, handness * helixDiam, C); - splineCenter.setCPoint(3, cpt0); - } - - // The control points for the side ribbons are constructed. - cpt1 = linearComb(1.0, cpt0, +ribbonWidth[ss], D); - splineSide1.setCPoint(3, cpt1); - - cpt2 = linearComb(1.0, cpt0, -ribbonWidth[ss], D); - splineSide2.setCPoint(3, cpt2); - - // Saving the plane vector (for the flipping test in the next call). - flipTestV.set(D); -} - -void constructControlPoints(ArrayList residues, int res, int ss, int handness) { - PVector ca0, ox0, ca1; - PVector p0, p1, p2, p3; - - p1 = new PVector(); - p2 = new PVector(); - p3 = new PVector(); - - HashMap res0, res1; - - res0 = res1 = null; - if (res == 0) { - // The control points 2 and 3 are created. - flipTestV.set(0, 0, 0); - - res0 = (HashMap)residues.get(res); - res1 = (HashMap)residues.get(res + 1); - ca0 = (PVector)res0.get("CA"); - ox0 = (PVector)res0.get("O"); - ca1 = (PVector)res1.get("CA"); - addControlPoints(ca0, ox0, ca1, ss, handness); - splineSide1.copyCPoints(3, 2); - splineCenter.copyCPoints(3, 2); - splineSide2.copyCPoints(3, 2); - - res0 = (HashMap)residues.get(res + 1); - res1 = (HashMap)residues.get(res + 2); - ca0 = (PVector)res0.get("CA"); - ox0 = (PVector)res0.get("O"); - ca1 = (PVector)res1.get("CA"); - addControlPoints(ca0, ox0, ca1, ss, handness); - - // We still need the two first control points. - // Moving backwards along the cp_center[2] - cp_center[3] direction. - splineCenter.getCPoint(2, p2); - splineCenter.getCPoint(3, p3); - - p1 = linearComb(2.0, p2, -1, p3); - splineCenter.setCPoint(1, p1); - splineSide1.setCPoint(1, linearComb(1.0, p1, +ribbonWidth[ss], flipTestV)); - splineSide2.setCPoint(1, linearComb(1.0, p1, -ribbonWidth[ss], flipTestV)); - - p0 = linearComb(2.0, p1, -1, p2); - splineCenter.setCPoint(0, p0); - splineSide1.setCPoint(0, linearComb(1.0, p0, +ribbonWidth[ss], flipTestV)); - splineSide2.setCPoint(0, linearComb(1.0, p0, -ribbonWidth[ss], flipTestV)); - } else { - shiftControlPoints(); - if ((residues.size() - 1 == res) || (residues.size() - 2 == res)) { - // Moving forward along the cp_center[1] - cp_center[2] direction. - splineCenter.getCPoint(1, p1); - splineCenter.getCPoint(2, p2); - - p3 = linearComb(2.0, p2, -1, p1); - splineCenter.setCPoint(3, p3); - splineSide1.setCPoint(3, linearComb(1.0, p3, +ribbonWidth[ss], flipTestV)); - splineSide2.setCPoint(3, linearComb(1.0, p3, -ribbonWidth[ss], flipTestV)); - } else { - res0 = (HashMap)residues.get(res + 1); - res1 = (HashMap)residues.get(res + 2); - ca0 = (PVector)res0.get("CA"); - ox0 = (PVector)res0.get("O"); - ca1 = (PVector)res1.get("CA"); - addControlPoints(ca0, ox0, ca1, ss, handness); - } - } - splineSide1.updateMatrix3(); - splineCenter.updateMatrix3(); - splineSide2.updateMatrix3(); -} - -PVector linearComb(float scalar0, PVector vector0, float scalar1, PVector vector1) { - return PVector.add(PVector.mult(vector0, scalar0), PVector.mult(vector1, scalar1)); -} diff --git a/java/examples/Demos/Graphics/Ribbons/PDB.pde b/java/examples/Demos/Graphics/Ribbons/PDB.pde deleted file mode 100644 index c3daf443b..000000000 --- a/java/examples/Demos/Graphics/Ribbons/PDB.pde +++ /dev/null @@ -1,115 +0,0 @@ -void readPDB(String filename) { - String strLines[]; - - float xmin, xmax, ymin, ymax, zmin, zmax; - - String xstr, ystr, zstr; - float x, y, z; - int res, res0; - int nmdl; - String atstr, resstr; - - PShape model; - ArrayList atoms; - ArrayList residues; - HashMap residue; - PVector v; - String s; - strLines = loadStrings(filename); - - models = new ArrayList(); - - xmin = ymin = zmin = 10000; - xmax = ymax = zmax = -10000; - - atoms = null; - residues = null; - residue = null; - model = null; - res0 = -1; - nmdl = -1; - for (int i = 0; i < strLines.length; i++) { - s = strLines[i]; - - if (s.startsWith("MODEL") || (s.startsWith("ATOM") && res0 == -1)) { - nmdl++; - - res0 = -1; - - atoms = new ArrayList(); - residues = new ArrayList(); - } - - if (s.startsWith("ATOM")) { - atstr = s.substring(12, 15); - atstr = atstr.trim(); - resstr = s.substring(22, 26); - resstr = resstr.trim(); - res = parseInt(resstr); - - xstr = s.substring(30, 37); - xstr = xstr.trim(); - ystr = s.substring(38, 45); - ystr = ystr.trim(); - zstr = s.substring(46, 53); - zstr = zstr.trim(); - - x = scaleFactor * parseFloat(xstr); - y = scaleFactor * parseFloat(ystr); - z = scaleFactor * parseFloat(zstr); - v = new PVector(x, y, z); - - xmin = min(xmin, x); - xmax = max(xmax, x); - - ymin = min(ymin, y); - ymax = max(ymax, y); - - zmin = min(zmin, z); - zmax = max(zmax, z); - - atoms.add(v); - - if (res0 != res) { - if (residue != null) residues.add(residue); - residue = new HashMap(); - } - residue.put(atstr, v); - - res0 = res; - } - - if (s.startsWith("ENDMDL") || s.startsWith("TER")) { - if (residue != null) residues.add(residue); - - createRibbonModel(residues, model, models); - float rgyr = calculateGyrRadius(atoms); - - res0 = -1; - residue = null; - atoms = null; - residues = null; - } - } - - if (residue != null) { - if (residue != null) residues.add(residue); - - createRibbonModel(residues, model, models); - float rgyr = calculateGyrRadius(atoms); - - atoms = null; - residues = null; - } - - // Centering models at (0, 0, 0). - float dx = -0.5f * (xmin + xmax); - float dy = -0.5f * (ymin + ymax); - float dz = -0.5f * (zmin + zmax); - for (int n = 0; n < models.size(); n++) { - model = (PShape) models.get(n); - model.translate(dx, dy, dz); - } - - println("Loaded PDB file with " + models.size() + " models."); -} diff --git a/java/examples/Demos/Graphics/Ribbons/Ribbons.pde b/java/examples/Demos/Graphics/Ribbons/Ribbons.pde deleted file mode 100644 index e581e8114..000000000 --- a/java/examples/Demos/Graphics/Ribbons/Ribbons.pde +++ /dev/null @@ -1,51 +0,0 @@ -// Ribbons, by Andres Colubri -// ArcBall class by Ariel, V3ga and Robert Hodgin (flight404) -// This sketch loads 3D atomic coordinates of a protein molecule -// from a file in PDB format (http://www.pdb.org/) and displays -// the structure using a ribbon representation. - -String pdbFile = "4HHB.pdb"; // PDB file to read -//String pdbFile = "1CBS.pdb"; -//String pdbFile = "2POR.pdb"; - -// Some parameters to control the visual appearance: -float scaleFactor = 10; // Size factor -int renderMode = 1; // 0 = lines, 1 = flat ribbons -int ribbonDetail = 4; // Ribbon detail: from 1 (lowest) to 4 (highest) -float helixDiam = 10; // Helix diameter. -int[] ribbonWidth = {10, 7, 2}; // Ribbon widths for helix, strand and coil -color ribbonColor = color(0, 102, 153, 255); // Ribbon color - -// All the molecular models read from the PDB file (it could contain more than one) -ArrayList models; - -Arcball arcball; - -void setup() { - size(1024, 768, P3D); - - arcball = new Arcball(width/2, height/2, 600); - readPDB(pdbFile); -} - -void draw() { - background(0); - - ambient(80); - lights(); - - translate(width/2, height/2, 200); - arcball.run(); - - for (int i = 0; i < models.size(); i++) { - shape((PShape)models.get(i)); - } -} - -void mousePressed(){ - arcball.mousePressed(); -} - -void mouseDragged(){ - arcball.mouseDragged(); -} diff --git a/java/examples/Demos/Graphics/Ribbons/data/1CBS.pdb b/java/examples/Demos/Graphics/Ribbons/data/1CBS.pdb deleted file mode 100644 index 2f1693c72..000000000 --- a/java/examples/Demos/Graphics/Ribbons/data/1CBS.pdb +++ /dev/null @@ -1,1573 +0,0 @@ -HEADER RETINOIC-ACID TRANSPORT 28-SEP-94 1CBS -TITLE CRYSTAL STRUCTURE OF CELLULAR RETINOIC-ACID-BINDING -TITLE 2 PROTEINS I AND II IN COMPLEX WITH ALL-TRANS-RETINOIC ACID -TITLE 3 AND A SYNTHETIC RETINOID -COMPND MOL_ID: 1; -COMPND 2 MOLECULE: CELLULAR RETINOIC ACID BINDING PROTEIN TYPE II; -COMPND 3 CHAIN: A; -COMPND 4 ENGINEERED: YES -SOURCE MOL_ID: 1; -SOURCE 2 ORGANISM_SCIENTIFIC: HOMO SAPIENS; -SOURCE 3 ORGANISM_COMMON: HUMAN; -SOURCE 4 ORGANISM_TAXID: 9606; -SOURCE 5 CELL_LINE: BL21; -SOURCE 6 GENE: HUMAN CRABP-II; -SOURCE 7 EXPRESSION_SYSTEM: ESCHERICHIA COLI BL21(DE3); -SOURCE 8 EXPRESSION_SYSTEM_TAXID: 469008; -SOURCE 9 EXPRESSION_SYSTEM_STRAIN: BL21 (DE3); -SOURCE 10 EXPRESSION_SYSTEM_PLASMID: PET-3A -KEYWDS RETINOIC-ACID TRANSPORT -EXPDTA X-RAY DIFFRACTION -AUTHOR G.J.KLEYWEGT,T.BERGFORS,T.A.JONES -REVDAT 3 24-FEB-09 1CBS 1 VERSN -REVDAT 2 01-APR-03 1CBS 1 JRNL -REVDAT 1 26-JAN-95 1CBS 0 -JRNL AUTH G.J.KLEYWEGT,T.BERGFORS,H.SENN,P.LE MOTTE,B.GSELL, -JRNL AUTH 2 K.SHUDO,T.A.JONES -JRNL TITL CRYSTAL STRUCTURES OF CELLULAR RETINOIC ACID -JRNL TITL 2 BINDING PROTEINS I AND II IN COMPLEX WITH -JRNL TITL 3 ALL-TRANS-RETINOIC ACID AND A SYNTHETIC RETINOID. -JRNL REF STRUCTURE V. 2 1241 1994 -JRNL REFN ISSN 0969-2126 -JRNL PMID 7704533 -JRNL DOI 10.1016/S0969-2126(94)00125-1 -REMARK 1 -REMARK 1 REFERENCE 1 -REMARK 1 AUTH L.BANASZAK,N.WINTER,Z.XU,D.A.BERNLOHR,S.W.COWAN, -REMARK 1 AUTH 2 T.A.JONES -REMARK 1 TITL LIPID-BINDING PROTEINS: A FAMILY OF FATTY ACID AND -REMARK 1 TITL 2 RETINOID TRANSPORT PROTEINS -REMARK 1 REF ADV.PROTEIN CHEM. V. 45 89 1994 -REMARK 1 REFN ISSN 0065-3233 -REMARK 1 REFERENCE 2 -REMARK 1 AUTH T.BERGFORS,G.J.KLEYWEGT,T.A.JONES -REMARK 1 TITL CRYSTALLISATION AND PRELIMINARY X-RAY ANALYSIS OF -REMARK 1 TITL 2 RECOMBINANT BOVINE CELLULAR RETINOIC ACID-BINDING -REMARK 1 TITL 3 PROTEIN -REMARK 1 REF ACTA CRYSTALLOGR.,SECT.D V. 50 370 1994 -REMARK 1 REFN ISSN 0907-4449 -REMARK 1 REFERENCE 3 -REMARK 1 AUTH S.W.COWAN,M.E.NEWCOMER,T.A.JONES -REMARK 1 TITL CRYSTALLOGRAPHIC STUDIES ON A FAMILY OF LIPOPHILIC -REMARK 1 TITL 2 TRANSPORT PROTEINS. REFINEMENT OF P2 MYELIN -REMARK 1 TITL 3 PROTEIN AND THE STRUCTURE DETERMINATION AND -REMARK 1 TITL 4 REFINEMENT OF CELLULAR RETINOL-BINDING PROTEIN IN -REMARK 1 TITL 5 COMPLEX WITH ALL-TRANS-RETINOL -REMARK 1 REF J.MOL.BIOL. V. 230 1225 1993 -REMARK 1 REFN ISSN 0022-2836 -REMARK 1 REFERENCE 4 -REMARK 1 AUTH T.A.JONES,T.BERGFORS,J.SEDZIK,T.UNGE -REMARK 1 TITL THE THREE-DIMENSIONAL STRUCTURE OF P2 MYELIN -REMARK 1 TITL 2 PROTEIN -REMARK 1 REF EMBO J. V. 7 1597 1988 -REMARK 1 REFN ISSN 0261-4189 -REMARK 2 -REMARK 2 RESOLUTION. 1.80 ANGSTROMS. -REMARK 3 -REMARK 3 REFINEMENT. -REMARK 3 PROGRAM : X-PLOR -REMARK 3 AUTHORS : BRUNGER -REMARK 3 -REMARK 3 DATA USED IN REFINEMENT. -REMARK 3 RESOLUTION RANGE HIGH (ANGSTROMS) : 1.80 -REMARK 3 RESOLUTION RANGE LOW (ANGSTROMS) : 8.00 -REMARK 3 DATA CUTOFF (SIGMA(F)) : 2.000 -REMARK 3 DATA CUTOFF HIGH (ABS(F)) : NULL -REMARK 3 DATA CUTOFF LOW (ABS(F)) : NULL -REMARK 3 COMPLETENESS (WORKING+TEST) (%) : 90.3 -REMARK 3 NUMBER OF REFLECTIONS : 14312 -REMARK 3 -REMARK 3 FIT TO DATA USED IN REFINEMENT. -REMARK 3 CROSS-VALIDATION METHOD : NULL -REMARK 3 FREE R VALUE TEST SET SELECTION : NULL -REMARK 3 R VALUE (WORKING SET) : 0.200 -REMARK 3 FREE R VALUE : 0.237 -REMARK 3 FREE R VALUE TEST SET SIZE (%) : NULL -REMARK 3 FREE R VALUE TEST SET COUNT : NULL -REMARK 3 ESTIMATED ERROR OF FREE R VALUE : NULL -REMARK 3 -REMARK 3 FIT IN THE HIGHEST RESOLUTION BIN. -REMARK 3 TOTAL NUMBER OF BINS USED : NULL -REMARK 3 BIN RESOLUTION RANGE HIGH (A) : NULL -REMARK 3 BIN RESOLUTION RANGE LOW (A) : NULL -REMARK 3 BIN COMPLETENESS (WORKING+TEST) (%) : NULL -REMARK 3 REFLECTIONS IN BIN (WORKING SET) : NULL -REMARK 3 BIN R VALUE (WORKING SET) : NULL -REMARK 3 BIN FREE R VALUE : NULL -REMARK 3 BIN FREE R VALUE TEST SET SIZE (%) : NULL -REMARK 3 BIN FREE R VALUE TEST SET COUNT : NULL -REMARK 3 ESTIMATED ERROR OF BIN FREE R VALUE : NULL -REMARK 3 -REMARK 3 NUMBER OF NON-HYDROGEN ATOMS USED IN REFINEMENT. -REMARK 3 PROTEIN ATOMS : 1091 -REMARK 3 NUCLEIC ACID ATOMS : 0 -REMARK 3 HETEROGEN ATOMS : 22 -REMARK 3 SOLVENT ATOMS : 100 -REMARK 3 -REMARK 3 B VALUES. -REMARK 3 FROM WILSON PLOT (A**2) : NULL -REMARK 3 MEAN B VALUE (OVERALL, A**2) : 16.60 -REMARK 3 OVERALL ANISOTROPIC B VALUE. -REMARK 3 B11 (A**2) : NULL -REMARK 3 B22 (A**2) : NULL -REMARK 3 B33 (A**2) : NULL -REMARK 3 B12 (A**2) : NULL -REMARK 3 B13 (A**2) : NULL -REMARK 3 B23 (A**2) : NULL -REMARK 3 -REMARK 3 ESTIMATED COORDINATE ERROR. -REMARK 3 ESD FROM LUZZATI PLOT (A) : 0.20 -REMARK 3 ESD FROM SIGMAA (A) : NULL -REMARK 3 LOW RESOLUTION CUTOFF (A) : NULL -REMARK 3 -REMARK 3 CROSS-VALIDATED ESTIMATED COORDINATE ERROR. -REMARK 3 ESD FROM C-V LUZZATI PLOT (A) : NULL -REMARK 3 ESD FROM C-V SIGMAA (A) : NULL -REMARK 3 -REMARK 3 RMS DEVIATIONS FROM IDEAL VALUES. -REMARK 3 BOND LENGTHS (A) : 0.010 -REMARK 3 BOND ANGLES (DEGREES) : 1.51 -REMARK 3 DIHEDRAL ANGLES (DEGREES) : 27.40 -REMARK 3 IMPROPER ANGLES (DEGREES) : 1.32 -REMARK 3 -REMARK 3 ISOTROPIC THERMAL MODEL : NULL -REMARK 3 -REMARK 3 ISOTROPIC THERMAL FACTOR RESTRAINTS. RMS SIGMA -REMARK 3 MAIN-CHAIN BOND (A**2) : NULL ; NULL -REMARK 3 MAIN-CHAIN ANGLE (A**2) : NULL ; NULL -REMARK 3 SIDE-CHAIN BOND (A**2) : NULL ; NULL -REMARK 3 SIDE-CHAIN ANGLE (A**2) : NULL ; NULL -REMARK 3 -REMARK 3 NCS MODEL : NULL -REMARK 3 -REMARK 3 NCS RESTRAINTS. RMS SIGMA/WEIGHT -REMARK 3 GROUP 1 POSITIONAL (A) : NULL ; NULL -REMARK 3 GROUP 1 B-FACTOR (A**2) : NULL ; NULL -REMARK 3 -REMARK 3 PARAMETER FILE 1 : NULL -REMARK 3 TOPOLOGY FILE 1 : NULL -REMARK 3 -REMARK 3 OTHER REFINEMENT REMARKS: NULL -REMARK 4 -REMARK 4 1CBS COMPLIES WITH FORMAT V. 3.15, 01-DEC-08 -REMARK 100 -REMARK 100 THIS ENTRY HAS BEEN PROCESSED BY BNL. -REMARK 200 -REMARK 200 EXPERIMENTAL DETAILS -REMARK 200 EXPERIMENT TYPE : X-RAY DIFFRACTION -REMARK 200 DATE OF DATA COLLECTION : NULL -REMARK 200 TEMPERATURE (KELVIN) : NULL -REMARK 200 PH : NULL -REMARK 200 NUMBER OF CRYSTALS USED : NULL -REMARK 200 -REMARK 200 SYNCHROTRON (Y/N) : NULL -REMARK 200 RADIATION SOURCE : NULL -REMARK 200 BEAMLINE : NULL -REMARK 200 X-RAY GENERATOR MODEL : NULL -REMARK 200 MONOCHROMATIC OR LAUE (M/L) : NULL -REMARK 200 WAVELENGTH OR RANGE (A) : NULL -REMARK 200 MONOCHROMATOR : NULL -REMARK 200 OPTICS : NULL -REMARK 200 -REMARK 200 DETECTOR TYPE : NULL -REMARK 200 DETECTOR MANUFACTURER : NULL -REMARK 200 INTENSITY-INTEGRATION SOFTWARE : NULL -REMARK 200 DATA SCALING SOFTWARE : NULL -REMARK 200 -REMARK 200 NUMBER OF UNIQUE REFLECTIONS : 14678 -REMARK 200 RESOLUTION RANGE HIGH (A) : NULL -REMARK 200 RESOLUTION RANGE LOW (A) : NULL -REMARK 200 REJECTION CRITERIA (SIGMA(I)) : 3.000 -REMARK 200 -REMARK 200 OVERALL. -REMARK 200 COMPLETENESS FOR RANGE (%) : 90.3 -REMARK 200 DATA REDUNDANCY : NULL -REMARK 200 R MERGE (I) : NULL -REMARK 200 R SYM (I) : NULL -REMARK 200 FOR THE DATA SET : NULL -REMARK 200 -REMARK 200 IN THE HIGHEST RESOLUTION SHELL. -REMARK 200 HIGHEST RESOLUTION SHELL, RANGE HIGH (A) : NULL -REMARK 200 HIGHEST RESOLUTION SHELL, RANGE LOW (A) : NULL -REMARK 200 COMPLETENESS FOR SHELL (%) : NULL -REMARK 200 DATA REDUNDANCY IN SHELL : NULL -REMARK 200 R MERGE FOR SHELL (I) : NULL -REMARK 200 R SYM FOR SHELL (I) : NULL -REMARK 200 FOR SHELL : NULL -REMARK 200 -REMARK 200 DIFFRACTION PROTOCOL: NULL -REMARK 200 METHOD USED TO DETERMINE THE STRUCTURE: NULL -REMARK 200 SOFTWARE USED: X-PLOR -REMARK 200 STARTING MODEL: NULL -REMARK 200 -REMARK 200 REMARK: NULL -REMARK 280 -REMARK 280 CRYSTAL -REMARK 280 SOLVENT CONTENT, VS (%): 54.49 -REMARK 280 MATTHEWS COEFFICIENT, VM (ANGSTROMS**3/DA): 2.70 -REMARK 280 -REMARK 280 CRYSTALLIZATION CONDITIONS: NULL -REMARK 290 -REMARK 290 CRYSTALLOGRAPHIC SYMMETRY -REMARK 290 SYMMETRY OPERATORS FOR SPACE GROUP: P 21 21 21 -REMARK 290 -REMARK 290 SYMOP SYMMETRY -REMARK 290 NNNMMM OPERATOR -REMARK 290 1555 X,Y,Z -REMARK 290 2555 -X+1/2,-Y,Z+1/2 -REMARK 290 3555 -X,Y+1/2,-Z+1/2 -REMARK 290 4555 X+1/2,-Y+1/2,-Z -REMARK 290 -REMARK 290 WHERE NNN -> OPERATOR NUMBER -REMARK 290 MMM -> TRANSLATION VECTOR -REMARK 290 -REMARK 290 CRYSTALLOGRAPHIC SYMMETRY TRANSFORMATIONS -REMARK 290 THE FOLLOWING TRANSFORMATIONS OPERATE ON THE ATOM/HETATM -REMARK 290 RECORDS IN THIS ENTRY TO PRODUCE CRYSTALLOGRAPHICALLY -REMARK 290 RELATED MOLECULES. -REMARK 290 SMTRY1 1 1.000000 0.000000 0.000000 0.00000 -REMARK 290 SMTRY2 1 0.000000 1.000000 0.000000 0.00000 -REMARK 290 SMTRY3 1 0.000000 0.000000 1.000000 0.00000 -REMARK 290 SMTRY1 2 -1.000000 0.000000 0.000000 22.82500 -REMARK 290 SMTRY2 2 0.000000 -1.000000 0.000000 0.00000 -REMARK 290 SMTRY3 2 0.000000 0.000000 1.000000 38.80500 -REMARK 290 SMTRY1 3 -1.000000 0.000000 0.000000 0.00000 -REMARK 290 SMTRY2 3 0.000000 1.000000 0.000000 23.78000 -REMARK 290 SMTRY3 3 0.000000 0.000000 -1.000000 38.80500 -REMARK 290 SMTRY1 4 1.000000 0.000000 0.000000 22.82500 -REMARK 290 SMTRY2 4 0.000000 -1.000000 0.000000 23.78000 -REMARK 290 SMTRY3 4 0.000000 0.000000 -1.000000 0.00000 -REMARK 290 -REMARK 290 REMARK: NULL -REMARK 300 -REMARK 300 BIOMOLECULE: 1 -REMARK 300 SEE REMARK 350 FOR THE AUTHOR PROVIDED AND/OR PROGRAM -REMARK 300 GENERATED ASSEMBLY INFORMATION FOR THE STRUCTURE IN -REMARK 300 THIS ENTRY. THE REMARK MAY ALSO PROVIDE INFORMATION ON -REMARK 300 BURIED SURFACE AREA. -REMARK 350 -REMARK 350 COORDINATES FOR A COMPLETE MULTIMER REPRESENTING THE KNOWN -REMARK 350 BIOLOGICALLY SIGNIFICANT OLIGOMERIZATION STATE OF THE -REMARK 350 MOLECULE CAN BE GENERATED BY APPLYING BIOMT TRANSFORMATIONS -REMARK 350 GIVEN BELOW. BOTH NON-CRYSTALLOGRAPHIC AND -REMARK 350 CRYSTALLOGRAPHIC OPERATIONS ARE GIVEN. -REMARK 350 -REMARK 350 BIOMOLECULE: 1 -REMARK 350 AUTHOR DETERMINED BIOLOGICAL UNIT: MONOMERIC -REMARK 350 APPLY THE FOLLOWING TO CHAINS: A -REMARK 350 BIOMT1 1 1.000000 0.000000 0.000000 0.00000 -REMARK 350 BIOMT2 1 0.000000 1.000000 0.000000 0.00000 -REMARK 350 BIOMT3 1 0.000000 0.000000 1.000000 0.00000 -REMARK 500 -REMARK 500 GEOMETRY AND STEREOCHEMISTRY -REMARK 500 SUBTOPIC: TORSION ANGLES -REMARK 500 -REMARK 500 TORSION ANGLES OUTSIDE THE EXPECTED RAMACHANDRAN REGIONS: -REMARK 500 (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN IDENTIFIER; -REMARK 500 SSEQ=SEQUENCE NUMBER; I=INSERTION CODE). -REMARK 500 -REMARK 500 STANDARD TABLE: -REMARK 500 FORMAT:(10X,I3,1X,A3,1X,A1,I4,A1,4X,F7.2,3X,F7.2) -REMARK 500 -REMARK 500 EXPECTED VALUES: GJ KLEYWEGT AND TA JONES (1996). PHI/PSI- -REMARK 500 CHOLOGY: RAMACHANDRAN REVISITED. STRUCTURE 4, 1395 - 1400 -REMARK 500 -REMARK 500 M RES CSSEQI PSI PHI -REMARK 500 GLU A 73 -154.28 -144.94 -REMARK 500 ASP A 126 -115.96 55.69 -REMARK 500 -REMARK 500 REMARK: NULL -REMARK 525 -REMARK 525 SOLVENT -REMARK 525 -REMARK 525 THE SOLVENT MOLECULES HAVE CHAIN IDENTIFIERS THAT -REMARK 525 INDICATE THE POLYMER CHAIN WITH WHICH THEY ARE MOST -REMARK 525 CLOSELY ASSOCIATED. THE REMARK LISTS ALL THE SOLVENT -REMARK 525 MOLECULES WHICH ARE MORE THAN 5A AWAY FROM THE -REMARK 525 NEAREST POLYMER CHAIN (M = MODEL NUMBER; -REMARK 525 RES=RESIDUE NAME; C=CHAIN IDENTIFIER; SSEQ=SEQUENCE -REMARK 525 NUMBER; I=INSERTION CODE): -REMARK 525 -REMARK 525 M RES CSSEQI -REMARK 525 HOH A 376 DISTANCE = 5.94 ANGSTROMS -REMARK 800 -REMARK 800 SITE -REMARK 800 SITE_IDENTIFIER: AC1 -REMARK 800 EVIDENCE_CODE: SOFTWARE -REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE REA A 200 -DBREF 1CBS A 1 137 UNP P29373 RABP2_HUMAN 1 137 -SEQRES 1 A 137 PRO ASN PHE SER GLY ASN TRP LYS ILE ILE ARG SER GLU -SEQRES 2 A 137 ASN PHE GLU GLU LEU LEU LYS VAL LEU GLY VAL ASN VAL -SEQRES 3 A 137 MET LEU ARG LYS ILE ALA VAL ALA ALA ALA SER LYS PRO -SEQRES 4 A 137 ALA VAL GLU ILE LYS GLN GLU GLY ASP THR PHE TYR ILE -SEQRES 5 A 137 LYS THR SER THR THR VAL ARG THR THR GLU ILE ASN PHE -SEQRES 6 A 137 LYS VAL GLY GLU GLU PHE GLU GLU GLN THR VAL ASP GLY -SEQRES 7 A 137 ARG PRO CYS LYS SER LEU VAL LYS TRP GLU SER GLU ASN -SEQRES 8 A 137 LYS MET VAL CYS GLU GLN LYS LEU LEU LYS GLY GLU GLY -SEQRES 9 A 137 PRO LYS THR SER TRP THR ARG GLU LEU THR ASN ASP GLY -SEQRES 10 A 137 GLU LEU ILE LEU THR MET THR ALA ASP ASP VAL VAL CYS -SEQRES 11 A 137 THR ARG VAL TYR VAL ARG GLU -HET REA A 200 22 -HETNAM REA RETINOIC ACID -FORMUL 2 REA C20 H28 O2 -FORMUL 3 HOH *100(H2 O) -HELIX 1 1 ASN A 14 LEU A 22 1 9 -HELIX 2 2 ASN A 25 SER A 37 1 13 -SHEET 1 A10 THR A 60 LYS A 66 0 -SHEET 2 A10 THR A 49 SER A 55 -1 N PHE A 50 O PHE A 65 -SHEET 3 A10 ALA A 40 GLU A 46 -1 O ALA A 40 N SER A 55 -SHEET 4 A10 GLY A 5 GLU A 13 -1 O GLY A 5 N ILE A 43 -SHEET 5 A10 VAL A 128 ARG A 136 -1 O THR A 131 N GLU A 13 -SHEET 6 A10 LEU A 119 ALA A 125 -1 O LEU A 119 N TYR A 134 -SHEET 7 A10 THR A 107 LEU A 113 -1 O SER A 108 N THR A 124 -SHEET 8 A10 LYS A 92 LEU A 99 -1 N MET A 93 O ARG A 111 -SHEET 9 A10 PRO A 80 SER A 89 -1 N LYS A 82 O LYS A 98 -SHEET 10 A10 PHE A 71 GLN A 74 -1 O PHE A 71 N SER A 83 -SITE 1 AC1 10 GLU A 13 ALA A 32 THR A 54 VAL A 58 -SITE 2 AC1 10 VAL A 76 LEU A 121 ARG A 132 TYR A 134 -SITE 3 AC1 10 HOH A 309 HOH A 343 -CRYST1 45.650 47.560 77.610 90.00 90.00 90.00 P 21 21 21 4 -ORIGX1 1.000000 0.000000 0.000000 0.00000 -ORIGX2 0.000000 1.000000 0.000000 0.00000 -ORIGX3 0.000000 0.000000 1.000000 0.00000 -SCALE1 0.021906 0.000000 0.000000 0.00000 -SCALE2 0.000000 0.021026 0.000000 0.00000 -SCALE3 0.000000 0.000000 0.012885 0.00000 -ATOM 1 N PRO A 1 16.979 13.301 44.555 1.00 30.05 N -ATOM 2 CA PRO A 1 18.150 13.525 43.680 1.00 28.82 C -ATOM 3 C PRO A 1 18.656 14.966 43.784 1.00 26.59 C -ATOM 4 O PRO A 1 17.890 15.889 44.078 1.00 26.84 O -ATOM 5 CB PRO A 1 17.678 13.270 42.255 1.00 29.24 C -ATOM 6 CG PRO A 1 16.248 13.734 42.347 1.00 29.29 C -ATOM 7 CD PRO A 1 15.762 13.216 43.724 1.00 30.71 C -ATOM 8 N ASN A 2 19.957 15.139 43.558 1.00 24.04 N -ATOM 9 CA ASN A 2 20.576 16.457 43.578 1.00 20.79 C -ATOM 10 C ASN A 2 21.301 16.714 42.262 1.00 16.75 C -ATOM 11 O ASN A 2 22.402 16.215 42.028 1.00 15.23 O -ATOM 12 CB ASN A 2 21.559 16.620 44.724 1.00 22.81 C -ATOM 13 CG ASN A 2 22.240 17.968 44.685 1.00 24.29 C -ATOM 14 OD1 ASN A 2 21.612 18.984 44.358 1.00 21.87 O -ATOM 15 ND2 ASN A 2 23.537 17.983 44.966 1.00 27.94 N -ATOM 16 N PHE A 3 20.637 17.477 41.402 1.00 14.69 N -ATOM 17 CA PHE A 3 21.144 17.838 40.087 1.00 12.62 C -ATOM 18 C PHE A 3 22.152 18.987 40.140 1.00 12.43 C -ATOM 19 O PHE A 3 22.796 19.289 39.136 1.00 12.12 O -ATOM 20 CB PHE A 3 19.970 18.262 39.188 1.00 10.74 C -ATOM 21 CG PHE A 3 19.073 17.128 38.750 1.00 11.85 C -ATOM 22 CD1 PHE A 3 18.066 16.646 39.581 1.00 10.90 C -ATOM 23 CD2 PHE A 3 19.189 16.588 37.475 1.00 13.26 C -ATOM 24 CE1 PHE A 3 17.200 15.662 39.149 1.00 9.12 C -ATOM 25 CE2 PHE A 3 18.312 15.594 37.041 1.00 11.76 C -ATOM 26 CZ PHE A 3 17.324 15.137 37.878 1.00 10.30 C -ATOM 27 N SER A 4 22.282 19.630 41.299 1.00 11.24 N -ATOM 28 CA SER A 4 23.170 20.780 41.464 1.00 11.30 C -ATOM 29 C SER A 4 24.627 20.568 41.091 1.00 10.39 C -ATOM 30 O SER A 4 25.201 19.532 41.384 1.00 10.24 O -ATOM 31 CB SER A 4 23.112 21.301 42.906 1.00 13.53 C -ATOM 32 OG SER A 4 21.821 21.787 43.240 1.00 16.76 O -ATOM 33 N GLY A 5 25.224 21.572 40.460 1.00 9.87 N -ATOM 34 CA GLY A 5 26.628 21.486 40.103 1.00 10.86 C -ATOM 35 C GLY A 5 26.985 22.158 38.794 1.00 11.21 C -ATOM 36 O GLY A 5 26.123 22.761 38.142 1.00 9.91 O -ATOM 37 N ASN A 6 28.277 22.142 38.475 1.00 10.41 N -ATOM 38 CA ASN A 6 28.796 22.676 37.211 1.00 11.06 C -ATOM 39 C ASN A 6 29.117 21.435 36.378 1.00 10.33 C -ATOM 40 O ASN A 6 29.947 20.603 36.754 1.00 11.28 O -ATOM 41 CB ASN A 6 30.023 23.548 37.445 1.00 12.95 C -ATOM 42 CG ASN A 6 29.675 24.816 38.200 1.00 18.08 C -ATOM 43 OD1 ASN A 6 29.022 25.708 37.665 1.00 19.52 O -ATOM 44 ND2 ASN A 6 30.047 24.872 39.467 1.00 21.23 N -ATOM 45 N TRP A 7 28.399 21.289 35.272 1.00 8.66 N -ATOM 46 CA TRP A 7 28.518 20.119 34.424 1.00 8.74 C -ATOM 47 C TRP A 7 29.246 20.352 33.092 1.00 9.63 C -ATOM 48 O TRP A 7 29.064 21.389 32.440 1.00 9.45 O -ATOM 49 CB TRP A 7 27.115 19.563 34.152 1.00 8.00 C -ATOM 50 CG TRP A 7 26.325 19.198 35.391 1.00 8.01 C -ATOM 51 CD1 TRP A 7 25.556 20.031 36.159 1.00 8.29 C -ATOM 52 CD2 TRP A 7 26.174 17.885 35.947 1.00 7.60 C -ATOM 53 NE1 TRP A 7 24.922 19.308 37.156 1.00 9.20 N -ATOM 54 CE2 TRP A 7 25.286 17.987 37.046 1.00 8.73 C -ATOM 55 CE3 TRP A 7 26.694 16.625 35.618 1.00 6.99 C -ATOM 56 CZ2 TRP A 7 24.909 16.876 37.815 1.00 7.67 C -ATOM 57 CZ3 TRP A 7 26.320 15.527 36.380 1.00 7.58 C -ATOM 58 CH2 TRP A 7 25.433 15.663 37.468 1.00 5.92 C -ATOM 59 N LYS A 8 30.052 19.368 32.702 1.00 9.39 N -ATOM 60 CA LYS A 8 30.802 19.424 31.450 1.00 11.56 C -ATOM 61 C LYS A 8 30.342 18.243 30.611 1.00 10.56 C -ATOM 62 O LYS A 8 30.091 17.158 31.138 1.00 10.14 O -ATOM 63 CB LYS A 8 32.308 19.360 31.710 1.00 15.20 C -ATOM 64 CG LYS A 8 32.785 18.080 32.313 1.00 18.52 C -ATOM 65 CD LYS A 8 34.263 18.182 32.618 1.00 26.26 C -ATOM 66 CE LYS A 8 35.091 18.499 31.378 1.00 29.22 C -ATOM 67 NZ LYS A 8 35.067 17.393 30.369 1.00 32.48 N -ATOM 68 N ILE A 9 30.222 18.447 29.308 1.00 8.21 N -ATOM 69 CA ILE A 9 29.739 17.384 28.441 1.00 8.08 C -ATOM 70 C ILE A 9 30.798 16.325 28.117 1.00 7.86 C -ATOM 71 O ILE A 9 31.990 16.635 28.028 1.00 8.38 O -ATOM 72 CB ILE A 9 29.148 17.997 27.144 1.00 10.70 C -ATOM 73 CG1 ILE A 9 28.285 16.981 26.401 1.00 10.95 C -ATOM 74 CG2 ILE A 9 30.261 18.500 26.243 1.00 10.70 C -ATOM 75 CD1 ILE A 9 27.586 17.597 25.207 1.00 13.23 C -ATOM 76 N ILE A 10 30.373 15.067 27.995 1.00 7.08 N -ATOM 77 CA ILE A 10 31.288 13.988 27.656 1.00 7.45 C -ATOM 78 C ILE A 10 30.812 13.201 26.441 1.00 8.49 C -ATOM 79 O ILE A 10 31.561 12.397 25.892 1.00 9.49 O -ATOM 80 CB ILE A 10 31.586 13.023 28.847 1.00 10.28 C -ATOM 81 CG1 ILE A 10 30.304 12.393 29.382 1.00 10.51 C -ATOM 82 CG2 ILE A 10 32.349 13.756 29.963 1.00 10.10 C -ATOM 83 CD1 ILE A 10 30.578 11.242 30.325 1.00 12.18 C -ATOM 84 N ARG A 11 29.566 13.419 26.030 1.00 7.59 N -ATOM 85 CA ARG A 11 29.015 12.742 24.851 1.00 8.70 C -ATOM 86 C ARG A 11 27.821 13.500 24.290 1.00 9.41 C -ATOM 87 O ARG A 11 26.990 14.004 25.043 1.00 9.84 O -ATOM 88 CB ARG A 11 28.563 11.316 25.184 1.00 8.07 C -ATOM 89 CG ARG A 11 27.912 10.616 23.998 1.00 12.26 C -ATOM 90 CD ARG A 11 27.234 9.340 24.394 1.00 13.46 C -ATOM 91 NE ARG A 11 28.157 8.304 24.847 1.00 15.44 N -ATOM 92 CZ ARG A 11 28.815 7.470 24.037 1.00 19.59 C -ATOM 93 NH1 ARG A 11 28.677 7.559 22.714 1.00 19.40 N -ATOM 94 NH2 ARG A 11 29.521 6.467 24.547 1.00 17.50 N -ATOM 95 N SER A 12 27.748 13.594 22.965 1.00 8.84 N -ATOM 96 CA SER A 12 26.621 14.245 22.310 1.00 8.61 C -ATOM 97 C SER A 12 26.278 13.431 21.063 1.00 9.48 C -ATOM 98 O SER A 12 27.159 13.147 20.250 1.00 9.84 O -ATOM 99 CB SER A 12 26.966 15.676 21.925 1.00 9.02 C -ATOM 100 OG SER A 12 25.863 16.285 21.273 1.00 11.97 O -ATOM 101 N GLU A 13 25.016 13.038 20.924 1.00 7.59 N -ATOM 102 CA GLU A 13 24.586 12.258 19.768 1.00 9.67 C -ATOM 103 C GLU A 13 23.368 12.887 19.118 1.00 9.06 C -ATOM 104 O GLU A 13 22.457 13.343 19.815 1.00 7.34 O -ATOM 105 CB GLU A 13 24.185 10.833 20.184 1.00 9.72 C -ATOM 106 CG GLU A 13 25.257 10.018 20.895 1.00 15.17 C -ATOM 107 CD GLU A 13 26.262 9.340 19.954 1.00 18.75 C -ATOM 108 OE1 GLU A 13 26.031 9.310 18.726 1.00 18.53 O -ATOM 109 OE2 GLU A 13 27.286 8.822 20.457 1.00 19.23 O -ATOM 110 N ASN A 14 23.363 12.919 17.786 1.00 8.79 N -ATOM 111 CA ASN A 14 22.202 13.408 17.025 1.00 8.29 C -ATOM 112 C ASN A 14 21.813 14.896 17.153 1.00 7.35 C -ATOM 113 O ASN A 14 20.681 15.245 16.860 1.00 7.00 O -ATOM 114 CB ASN A 14 20.989 12.522 17.383 1.00 7.23 C -ATOM 115 CG ASN A 14 20.358 11.833 16.172 1.00 9.38 C -ATOM 116 OD1 ASN A 14 20.996 11.670 15.128 1.00 10.37 O -ATOM 117 ND2 ASN A 14 19.106 11.436 16.310 1.00 6.35 N -ATOM 118 N PHE A 15 22.734 15.777 17.536 1.00 7.26 N -ATOM 119 CA PHE A 15 22.385 17.198 17.681 1.00 9.06 C -ATOM 120 C PHE A 15 22.041 17.878 16.358 1.00 9.15 C -ATOM 121 O PHE A 15 21.041 18.578 16.265 1.00 8.64 O -ATOM 122 CB PHE A 15 23.497 17.990 18.379 1.00 10.05 C -ATOM 123 CG PHE A 15 23.102 19.397 18.746 1.00 10.57 C -ATOM 124 CD1 PHE A 15 22.032 19.633 19.605 1.00 13.39 C -ATOM 125 CD2 PHE A 15 23.813 20.485 18.254 1.00 11.47 C -ATOM 126 CE1 PHE A 15 21.678 20.929 19.968 1.00 13.52 C -ATOM 127 CE2 PHE A 15 23.467 21.784 18.609 1.00 11.60 C -ATOM 128 CZ PHE A 15 22.399 22.006 19.469 1.00 13.52 C -ATOM 129 N GLU A 16 22.878 17.699 15.342 1.00 11.17 N -ATOM 130 CA GLU A 16 22.583 18.313 14.053 1.00 12.58 C -ATOM 131 C GLU A 16 21.271 17.797 13.468 1.00 11.71 C -ATOM 132 O GLU A 16 20.503 18.567 12.888 1.00 12.66 O -ATOM 133 CB GLU A 16 23.711 18.081 13.060 1.00 15.91 C -ATOM 134 CG GLU A 16 23.274 18.337 11.626 1.00 21.31 C -ATOM 135 CD GLU A 16 24.376 18.878 10.757 1.00 25.39 C -ATOM 136 OE1 GLU A 16 25.526 18.984 11.240 1.00 27.92 O -ATOM 137 OE2 GLU A 16 24.084 19.213 9.588 1.00 28.60 O -ATOM 138 N GLU A 17 21.018 16.497 13.619 1.00 11.67 N -ATOM 139 CA GLU A 17 19.785 15.878 13.116 1.00 13.65 C -ATOM 140 C GLU A 17 18.529 16.490 13.767 1.00 13.48 C -ATOM 141 O GLU A 17 17.490 16.662 13.115 1.00 11.68 O -ATOM 142 CB GLU A 17 19.811 14.361 13.325 1.00 17.06 C -ATOM 143 CG GLU A 17 20.806 13.602 12.430 1.00 23.45 C -ATOM 144 CD GLU A 17 22.279 13.624 12.909 1.00 27.80 C -ATOM 145 OE1 GLU A 17 22.637 14.338 13.881 1.00 26.52 O -ATOM 146 OE2 GLU A 17 23.097 12.897 12.291 1.00 31.80 O -ATOM 147 N LEU A 18 18.640 16.834 15.048 1.00 10.82 N -ATOM 148 CA LEU A 18 17.547 17.468 15.777 1.00 9.45 C -ATOM 149 C LEU A 18 17.302 18.849 15.155 1.00 9.27 C -ATOM 150 O LEU A 18 16.153 19.246 14.927 1.00 9.04 O -ATOM 151 CB LEU A 18 17.931 17.644 17.253 1.00 9.77 C -ATOM 152 CG LEU A 18 16.921 18.358 18.163 1.00 11.36 C -ATOM 153 CD1 LEU A 18 15.817 17.402 18.554 1.00 13.85 C -ATOM 154 CD2 LEU A 18 17.616 18.876 19.409 1.00 12.69 C -ATOM 155 N LEU A 19 18.387 19.568 14.864 1.00 10.75 N -ATOM 156 CA LEU A 19 18.275 20.906 14.276 1.00 11.15 C -ATOM 157 C LEU A 19 17.671 20.873 12.874 1.00 12.52 C -ATOM 158 O LEU A 19 16.932 21.777 12.485 1.00 10.05 O -ATOM 159 CB LEU A 19 19.631 21.616 14.263 1.00 12.01 C -ATOM 160 CG LEU A 19 20.282 21.963 15.614 1.00 10.42 C -ATOM 161 CD1 LEU A 19 21.560 22.763 15.369 1.00 13.01 C -ATOM 162 CD2 LEU A 19 19.312 22.742 16.513 1.00 11.45 C -ATOM 163 N LYS A 20 17.944 19.795 12.150 1.00 14.41 N -ATOM 164 CA LYS A 20 17.427 19.628 10.800 1.00 16.54 C -ATOM 165 C LYS A 20 15.902 19.512 10.832 1.00 16.17 C -ATOM 166 O LYS A 20 15.201 20.164 10.053 1.00 15.90 O -ATOM 167 CB LYS A 20 18.048 18.390 10.157 1.00 20.07 C -ATOM 168 CG LYS A 20 18.592 18.643 8.765 1.00 26.61 C -ATOM 169 CD LYS A 20 18.960 17.349 8.027 1.00 30.95 C -ATOM 170 CE LYS A 20 20.226 16.690 8.579 1.00 35.68 C -ATOM 171 NZ LYS A 20 21.485 17.466 8.342 1.00 39.27 N -ATOM 172 N VAL A 21 15.395 18.700 11.759 1.00 15.31 N -ATOM 173 CA VAL A 21 13.958 18.508 11.927 1.00 14.41 C -ATOM 174 C VAL A 21 13.275 19.831 12.316 1.00 15.02 C -ATOM 175 O VAL A 21 12.150 20.119 11.878 1.00 13.59 O -ATOM 176 CB VAL A 21 13.674 17.422 12.998 1.00 14.93 C -ATOM 177 CG1 VAL A 21 12.194 17.383 13.364 1.00 17.29 C -ATOM 178 CG2 VAL A 21 14.115 16.082 12.482 1.00 15.09 C -ATOM 179 N LEU A 22 13.966 20.643 13.119 1.00 14.52 N -ATOM 180 CA LEU A 22 13.432 21.938 13.569 1.00 14.42 C -ATOM 181 C LEU A 22 13.478 22.984 12.467 1.00 15.49 C -ATOM 182 O LEU A 22 13.038 24.115 12.666 1.00 16.81 O -ATOM 183 CB LEU A 22 14.180 22.440 14.818 1.00 13.61 C -ATOM 184 CG LEU A 22 13.986 21.565 16.069 1.00 13.97 C -ATOM 185 CD1 LEU A 22 14.852 22.047 17.225 1.00 13.25 C -ATOM 186 CD2 LEU A 22 12.525 21.580 16.467 1.00 14.62 C -ATOM 187 N GLY A 23 14.062 22.618 11.328 1.00 16.41 N -ATOM 188 CA GLY A 23 14.123 23.516 10.183 1.00 17.05 C -ATOM 189 C GLY A 23 15.241 24.539 10.125 1.00 18.00 C -ATOM 190 O GLY A 23 15.112 25.545 9.425 1.00 19.45 O -ATOM 191 N VAL A 24 16.320 24.315 10.869 1.00 14.78 N -ATOM 192 CA VAL A 24 17.440 25.241 10.860 1.00 13.71 C -ATOM 193 C VAL A 24 18.289 24.983 9.607 1.00 15.09 C -ATOM 194 O VAL A 24 18.679 23.840 9.334 1.00 14.12 O -ATOM 195 CB VAL A 24 18.297 25.081 12.139 1.00 12.19 C -ATOM 196 CG1 VAL A 24 19.465 26.054 12.109 1.00 8.69 C -ATOM 197 CG2 VAL A 24 17.416 25.294 13.388 1.00 11.37 C -ATOM 198 N ASN A 25 18.595 26.047 8.866 1.00 15.37 N -ATOM 199 CA ASN A 25 19.360 25.914 7.635 1.00 17.74 C -ATOM 200 C ASN A 25 20.808 25.466 7.819 1.00 18.29 C -ATOM 201 O ASN A 25 21.377 25.592 8.903 1.00 18.05 O -ATOM 202 CB ASN A 25 19.230 27.172 6.742 1.00 19.41 C -ATOM 203 CG ASN A 25 20.090 28.351 7.200 1.00 22.35 C -ATOM 204 OD1 ASN A 25 21.207 28.189 7.698 1.00 22.64 O -ATOM 205 ND2 ASN A 25 19.602 29.558 6.933 1.00 24.15 N -ATOM 206 N VAL A 26 21.398 24.971 6.733 1.00 18.67 N -ATOM 207 CA VAL A 26 22.755 24.444 6.742 1.00 19.24 C -ATOM 208 C VAL A 26 23.825 25.280 7.421 1.00 18.39 C -ATOM 209 O VAL A 26 24.558 24.764 8.261 1.00 18.50 O -ATOM 210 CB VAL A 26 23.223 24.088 5.320 1.00 20.77 C -ATOM 211 CG1 VAL A 26 24.624 23.523 5.378 1.00 22.39 C -ATOM 212 CG2 VAL A 26 22.276 23.084 4.698 1.00 21.28 C -ATOM 213 N MET A 27 23.932 26.556 7.052 1.00 19.00 N -ATOM 214 CA MET A 27 24.948 27.433 7.628 1.00 19.54 C -ATOM 215 C MET A 27 24.734 27.741 9.099 1.00 19.04 C -ATOM 216 O MET A 27 25.702 27.820 9.849 1.00 18.28 O -ATOM 217 CB MET A 27 25.104 28.736 6.830 1.00 23.31 C -ATOM 218 CG MET A 27 25.955 28.602 5.552 1.00 29.99 C -ATOM 219 SD MET A 27 24.975 28.527 4.010 1.00 37.48 S -ATOM 220 CE MET A 27 26.198 29.150 2.776 1.00 35.24 C -ATOM 221 N LEU A 28 23.480 27.932 9.507 1.00 16.74 N -ATOM 222 CA LEU A 28 23.190 28.209 10.912 1.00 16.39 C -ATOM 223 C LEU A 28 23.477 26.954 11.722 1.00 16.86 C -ATOM 224 O LEU A 28 23.954 27.038 12.852 1.00 15.09 O -ATOM 225 CB LEU A 28 21.739 28.679 11.111 1.00 15.94 C -ATOM 226 CG LEU A 28 21.490 30.154 10.741 1.00 16.72 C -ATOM 227 CD1 LEU A 28 20.008 30.496 10.780 1.00 14.38 C -ATOM 228 CD2 LEU A 28 22.302 31.074 11.665 1.00 12.81 C -ATOM 229 N ARG A 29 23.228 25.791 11.121 1.00 16.05 N -ATOM 230 CA ARG A 29 23.498 24.524 11.798 1.00 18.43 C -ATOM 231 C ARG A 29 24.980 24.377 12.076 1.00 19.22 C -ATOM 232 O ARG A 29 25.383 23.987 13.171 1.00 17.97 O -ATOM 233 CB ARG A 29 23.030 23.334 10.969 1.00 18.63 C -ATOM 234 CG ARG A 29 21.596 22.983 11.189 1.00 21.26 C -ATOM 235 CD ARG A 29 21.339 21.572 10.739 1.00 24.71 C -ATOM 236 NE ARG A 29 20.571 21.564 9.513 1.00 29.88 N -ATOM 237 CZ ARG A 29 21.019 21.147 8.340 1.00 29.19 C -ATOM 238 NH1 ARG A 29 22.248 20.682 8.205 1.00 30.52 N -ATOM 239 NH2 ARG A 29 20.232 21.233 7.295 1.00 31.61 N -ATOM 240 N LYS A 30 25.790 24.709 11.078 1.00 19.76 N -ATOM 241 CA LYS A 30 27.235 24.619 11.198 1.00 21.96 C -ATOM 242 C LYS A 30 27.706 25.418 12.417 1.00 20.91 C -ATOM 243 O LYS A 30 28.470 24.916 13.239 1.00 22.15 O -ATOM 244 CB LYS A 30 27.894 25.143 9.915 1.00 25.07 C -ATOM 245 CG LYS A 30 29.404 25.031 9.905 1.00 30.48 C -ATOM 246 CD LYS A 30 30.013 25.631 8.639 1.00 35.43 C -ATOM 247 CE LYS A 30 31.533 25.759 8.778 1.00 37.96 C -ATOM 248 NZ LYS A 30 32.180 26.388 7.584 1.00 41.61 N -ATOM 249 N ILE A 31 27.208 26.643 12.544 1.00 18.38 N -ATOM 250 CA ILE A 31 27.557 27.527 13.652 1.00 16.41 C -ATOM 251 C ILE A 31 27.105 26.932 14.989 1.00 15.39 C -ATOM 252 O ILE A 31 27.888 26.855 15.930 1.00 14.90 O -ATOM 253 CB ILE A 31 26.881 28.920 13.471 1.00 16.63 C -ATOM 254 CG1 ILE A 31 27.419 29.606 12.208 1.00 18.74 C -ATOM 255 CG2 ILE A 31 27.071 29.791 14.713 1.00 15.71 C -ATOM 256 CD1 ILE A 31 26.735 30.946 11.858 1.00 17.27 C -ATOM 257 N ALA A 32 25.853 26.487 15.048 1.00 13.39 N -ATOM 258 CA ALA A 32 25.271 25.930 16.267 1.00 12.76 C -ATOM 259 C ALA A 32 25.994 24.685 16.775 1.00 12.11 C -ATOM 260 O ALA A 32 26.325 24.598 17.946 1.00 10.54 O -ATOM 261 CB ALA A 32 23.790 25.638 16.040 1.00 12.45 C -ATOM 262 N VAL A 33 26.252 23.731 15.886 1.00 11.95 N -ATOM 263 CA VAL A 33 26.932 22.490 16.256 1.00 13.80 C -ATOM 264 C VAL A 33 28.328 22.701 16.855 1.00 14.00 C -ATOM 265 O VAL A 33 28.693 22.048 17.832 1.00 14.07 O -ATOM 266 CB VAL A 33 27.016 21.504 15.044 1.00 13.56 C -ATOM 267 CG1 VAL A 33 27.909 20.318 15.375 1.00 16.07 C -ATOM 268 CG2 VAL A 33 25.621 21.006 14.684 1.00 14.96 C -ATOM 269 N ALA A 34 29.101 23.620 16.281 1.00 14.73 N -ATOM 270 CA ALA A 34 30.443 23.898 16.780 1.00 14.95 C -ATOM 271 C ALA A 34 30.381 24.505 18.178 1.00 15.59 C -ATOM 272 O ALA A 34 31.120 24.085 19.065 1.00 16.65 O -ATOM 273 CB ALA A 34 31.191 24.844 15.833 1.00 16.10 C -ATOM 274 N ALA A 35 29.495 25.480 18.375 1.00 13.20 N -ATOM 275 CA ALA A 35 29.371 26.134 19.671 1.00 13.04 C -ATOM 276 C ALA A 35 28.807 25.200 20.749 1.00 12.91 C -ATOM 277 O ALA A 35 29.245 25.239 21.895 1.00 12.32 O -ATOM 278 CB ALA A 35 28.517 27.387 19.552 1.00 12.14 C -ATOM 279 N ALA A 36 27.878 24.332 20.362 1.00 11.40 N -ATOM 280 CA ALA A 36 27.253 23.416 21.312 1.00 12.63 C -ATOM 281 C ALA A 36 28.128 22.256 21.770 1.00 13.40 C -ATOM 282 O ALA A 36 27.743 21.512 22.668 1.00 13.47 O -ATOM 283 CB ALA A 36 25.952 22.883 20.744 1.00 11.79 C -ATOM 284 N SER A 37 29.286 22.080 21.148 1.00 13.86 N -ATOM 285 CA SER A 37 30.169 20.983 21.520 1.00 15.95 C -ATOM 286 C SER A 37 30.938 21.245 22.818 1.00 16.46 C -ATOM 287 O SER A 37 31.488 20.320 23.406 1.00 18.23 O -ATOM 288 CB SER A 37 31.145 20.689 20.388 1.00 16.93 C -ATOM 289 OG SER A 37 32.100 21.729 20.293 1.00 21.65 O -ATOM 290 N LYS A 38 30.957 22.496 23.272 1.00 16.91 N -ATOM 291 CA LYS A 38 31.657 22.869 24.502 1.00 18.36 C -ATOM 292 C LYS A 38 30.817 23.809 25.382 1.00 15.90 C -ATOM 293 O LYS A 38 31.175 24.975 25.591 1.00 16.72 O -ATOM 294 CB LYS A 38 33.004 23.539 24.156 1.00 23.99 C -ATOM 295 CG LYS A 38 32.907 24.607 23.046 1.00 30.97 C -ATOM 296 CD LYS A 38 34.250 25.320 22.792 1.00 36.44 C -ATOM 297 CE LYS A 38 34.266 26.098 21.456 1.00 38.70 C -ATOM 298 NZ LYS A 38 33.193 27.131 21.321 1.00 39.37 N -ATOM 299 N PRO A 39 29.669 23.321 25.906 1.00 13.53 N -ATOM 300 CA PRO A 39 28.851 24.201 26.747 1.00 11.87 C -ATOM 301 C PRO A 39 29.292 24.248 28.211 1.00 12.05 C -ATOM 302 O PRO A 39 30.027 23.380 28.676 1.00 12.12 O -ATOM 303 CB PRO A 39 27.469 23.560 26.649 1.00 9.34 C -ATOM 304 CG PRO A 39 27.779 22.131 26.593 1.00 10.32 C -ATOM 305 CD PRO A 39 29.009 22.020 25.703 1.00 10.86 C -ATOM 306 N ALA A 40 28.921 25.316 28.898 1.00 11.52 N -ATOM 307 CA ALA A 40 29.192 25.423 30.329 1.00 11.84 C -ATOM 308 C ALA A 40 27.773 25.329 30.894 1.00 10.23 C -ATOM 309 O ALA A 40 26.894 26.080 30.478 1.00 10.42 O -ATOM 310 CB ALA A 40 29.830 26.767 30.673 1.00 11.40 C -ATOM 311 N VAL A 41 27.518 24.345 31.750 1.00 10.73 N -ATOM 312 CA VAL A 41 26.185 24.169 32.333 1.00 9.92 C -ATOM 313 C VAL A 41 26.226 24.295 33.854 1.00 11.64 C -ATOM 314 O VAL A 41 27.026 23.627 34.514 1.00 11.40 O -ATOM 315 CB VAL A 41 25.594 22.772 31.987 1.00 10.67 C -ATOM 316 CG1 VAL A 41 24.204 22.596 32.612 1.00 11.34 C -ATOM 317 CG2 VAL A 41 25.507 22.583 30.475 1.00 11.31 C -ATOM 318 N GLU A 42 25.364 25.147 34.399 1.00 10.94 N -ATOM 319 CA GLU A 42 25.271 25.327 35.845 1.00 12.40 C -ATOM 320 C GLU A 42 23.837 25.095 36.316 1.00 11.42 C -ATOM 321 O GLU A 42 22.898 25.720 35.825 1.00 10.46 O -ATOM 322 CB GLU A 42 25.711 26.721 36.270 1.00 16.26 C -ATOM 323 CG GLU A 42 25.495 26.947 37.768 1.00 23.78 C -ATOM 324 CD GLU A 42 25.944 28.311 38.242 1.00 27.94 C -ATOM 325 OE1 GLU A 42 25.308 29.329 37.872 1.00 29.92 O -ATOM 326 OE2 GLU A 42 26.935 28.351 39.002 1.00 32.64 O -ATOM 327 N ILE A 43 23.673 24.176 37.261 1.00 10.55 N -ATOM 328 CA ILE A 43 22.362 23.864 37.794 1.00 10.69 C -ATOM 329 C ILE A 43 22.360 24.120 39.300 1.00 11.07 C -ATOM 330 O ILE A 43 23.307 23.764 39.992 1.00 10.83 O -ATOM 331 CB ILE A 43 21.996 22.374 37.552 1.00 10.47 C -ATOM 332 CG1 ILE A 43 21.974 22.072 36.056 1.00 10.46 C -ATOM 333 CG2 ILE A 43 20.636 22.031 38.186 1.00 10.34 C -ATOM 334 CD1 ILE A 43 21.607 20.639 35.726 1.00 9.00 C -ATOM 335 N LYS A 44 21.315 24.784 39.778 1.00 12.26 N -ATOM 336 CA LYS A 44 21.127 25.051 41.201 1.00 13.96 C -ATOM 337 C LYS A 44 19.729 24.528 41.516 1.00 14.16 C -ATOM 338 O LYS A 44 18.749 24.920 40.873 1.00 14.12 O -ATOM 339 CB LYS A 44 21.220 26.545 41.503 1.00 16.58 C -ATOM 340 CG LYS A 44 22.580 27.150 41.170 1.00 22.90 C -ATOM 341 CD LYS A 44 22.571 28.654 41.385 1.00 29.01 C -ATOM 342 CE LYS A 44 23.890 29.293 40.982 1.00 31.56 C -ATOM 343 NZ LYS A 44 23.818 30.781 41.111 1.00 34.70 N -ATOM 344 N GLN A 45 19.649 23.594 42.460 1.00 15.66 N -ATOM 345 CA GLN A 45 18.377 22.993 42.852 1.00 16.03 C -ATOM 346 C GLN A 45 18.098 23.182 44.342 1.00 17.60 C -ATOM 347 O GLN A 45 18.989 23.024 45.164 1.00 17.17 O -ATOM 348 CB GLN A 45 18.397 21.498 42.544 1.00 15.51 C -ATOM 349 CG GLN A 45 17.168 20.744 43.015 1.00 13.62 C -ATOM 350 CD GLN A 45 17.312 19.256 42.838 1.00 15.68 C -ATOM 351 OE1 GLN A 45 18.348 18.769 42.397 1.00 18.84 O -ATOM 352 NE2 GLN A 45 16.276 18.521 43.177 1.00 16.73 N -ATOM 353 N GLU A 46 16.868 23.551 44.670 1.00 18.48 N -ATOM 354 CA GLU A 46 16.441 23.718 46.062 1.00 21.26 C -ATOM 355 C GLU A 46 15.108 23.004 46.105 1.00 19.06 C -ATOM 356 O GLU A 46 14.080 23.589 45.784 1.00 20.08 O -ATOM 357 CB GLU A 46 16.239 25.194 46.408 1.00 26.45 C -ATOM 358 CG GLU A 46 17.284 25.787 47.361 1.00 37.46 C -ATOM 359 CD GLU A 46 17.093 25.374 48.832 1.00 42.24 C -ATOM 360 OE1 GLU A 46 16.192 25.944 49.501 1.00 44.05 O -ATOM 361 OE2 GLU A 46 17.867 24.507 49.320 1.00 44.14 O -ATOM 362 N GLY A 47 15.131 21.720 46.429 1.00 18.35 N -ATOM 363 CA GLY A 47 13.893 20.970 46.463 1.00 18.96 C -ATOM 364 C GLY A 47 13.382 20.755 45.053 1.00 18.27 C -ATOM 365 O GLY A 47 14.067 20.157 44.238 1.00 18.05 O -ATOM 366 N ASP A 48 12.194 21.262 44.755 1.00 16.66 N -ATOM 367 CA ASP A 48 11.617 21.107 43.420 1.00 16.86 C -ATOM 368 C ASP A 48 11.771 22.378 42.566 1.00 15.92 C -ATOM 369 O ASP A 48 11.139 22.511 41.504 1.00 14.50 O -ATOM 370 CB ASP A 48 10.136 20.694 43.513 1.00 19.00 C -ATOM 371 CG ASP A 48 9.943 19.221 43.897 1.00 21.49 C -ATOM 372 OD1 ASP A 48 10.901 18.406 43.840 1.00 23.51 O -ATOM 373 OD2 ASP A 48 8.802 18.868 44.243 1.00 25.04 O -ATOM 374 N THR A 49 12.610 23.299 43.042 1.00 13.75 N -ATOM 375 CA THR A 49 12.870 24.551 42.348 1.00 13.82 C -ATOM 376 C THR A 49 14.231 24.460 41.678 1.00 13.22 C -ATOM 377 O THR A 49 15.235 24.152 42.322 1.00 12.56 O -ATOM 378 CB THR A 49 12.847 25.741 43.316 1.00 16.10 C -ATOM 379 OG1 THR A 49 11.556 25.815 43.941 1.00 17.94 O -ATOM 380 CG2 THR A 49 13.100 27.037 42.571 1.00 16.15 C -ATOM 381 N PHE A 50 14.266 24.794 40.392 1.00 12.20 N -ATOM 382 CA PHE A 50 15.485 24.704 39.602 1.00 10.82 C -ATOM 383 C PHE A 50 15.842 25.979 38.855 1.00 10.40 C -ATOM 384 O PHE A 50 14.968 26.758 38.460 1.00 9.90 O -ATOM 385 CB PHE A 50 15.338 23.591 38.547 1.00 10.78 C -ATOM 386 CG PHE A 50 15.316 22.192 39.107 1.00 13.13 C -ATOM 387 CD1 PHE A 50 14.146 21.653 39.634 1.00 11.97 C -ATOM 388 CD2 PHE A 50 16.464 21.401 39.079 1.00 14.34 C -ATOM 389 CE1 PHE A 50 14.113 20.367 40.120 1.00 12.69 C -ATOM 390 CE2 PHE A 50 16.439 20.098 39.569 1.00 14.64 C -ATOM 391 CZ PHE A 50 15.258 19.582 40.092 1.00 13.15 C -ATOM 392 N TYR A 51 17.147 26.165 38.678 1.00 10.37 N -ATOM 393 CA TYR A 51 17.709 27.258 37.910 1.00 10.95 C -ATOM 394 C TYR A 51 18.714 26.513 37.039 1.00 9.84 C -ATOM 395 O TYR A 51 19.540 25.761 37.547 1.00 9.78 O -ATOM 396 CB TYR A 51 18.436 28.284 38.790 1.00 12.57 C -ATOM 397 CG TYR A 51 19.396 29.178 38.014 1.00 12.91 C -ATOM 398 CD1 TYR A 51 18.939 30.302 37.327 1.00 15.83 C -ATOM 399 CD2 TYR A 51 20.762 28.896 37.974 1.00 14.05 C -ATOM 400 CE1 TYR A 51 19.822 31.126 36.621 1.00 16.52 C -ATOM 401 CE2 TYR A 51 21.655 29.705 37.275 1.00 14.62 C -ATOM 402 CZ TYR A 51 21.179 30.818 36.604 1.00 16.59 C -ATOM 403 OH TYR A 51 22.060 31.633 35.932 1.00 17.52 O -ATOM 404 N ILE A 52 18.610 26.676 35.726 1.00 10.57 N -ATOM 405 CA ILE A 52 19.520 26.004 34.801 1.00 9.09 C -ATOM 406 C ILE A 52 20.066 27.020 33.801 1.00 8.55 C -ATOM 407 O ILE A 52 19.296 27.652 33.086 1.00 10.49 O -ATOM 408 CB ILE A 52 18.807 24.859 34.026 1.00 8.96 C -ATOM 409 CG1 ILE A 52 18.242 23.814 35.013 1.00 9.15 C -ATOM 410 CG2 ILE A 52 19.792 24.189 33.070 1.00 10.39 C -ATOM 411 CD1 ILE A 52 17.585 22.616 34.366 1.00 8.10 C -ATOM 412 N LYS A 53 21.388 27.197 33.791 1.00 8.61 N -ATOM 413 CA LYS A 53 22.049 28.115 32.868 1.00 9.66 C -ATOM 414 C LYS A 53 22.939 27.319 31.924 1.00 8.71 C -ATOM 415 O LYS A 53 23.815 26.583 32.362 1.00 7.58 O -ATOM 416 CB LYS A 53 22.909 29.120 33.611 1.00 10.60 C -ATOM 417 CG LYS A 53 23.580 30.135 32.688 1.00 14.21 C -ATOM 418 CD LYS A 53 24.496 31.006 33.505 1.00 20.27 C -ATOM 419 CE LYS A 53 24.831 32.319 32.828 1.00 26.91 C -ATOM 420 NZ LYS A 53 25.878 33.009 33.659 1.00 29.12 N -ATOM 421 N THR A 54 22.686 27.445 30.625 1.00 8.49 N -ATOM 422 CA THR A 54 23.478 26.747 29.628 1.00 7.98 C -ATOM 423 C THR A 54 24.118 27.820 28.764 1.00 8.23 C -ATOM 424 O THR A 54 23.433 28.584 28.087 1.00 8.40 O -ATOM 425 CB THR A 54 22.621 25.817 28.789 1.00 8.33 C -ATOM 426 OG1 THR A 54 21.896 24.946 29.660 1.00 9.95 O -ATOM 427 CG2 THR A 54 23.505 24.976 27.873 1.00 4.95 C -ATOM 428 N SER A 55 25.444 27.840 28.758 1.00 8.75 N -ATOM 429 CA SER A 55 26.171 28.865 28.047 1.00 10.50 C -ATOM 430 C SER A 55 27.116 28.382 26.950 1.00 9.24 C -ATOM 431 O SER A 55 27.802 27.370 27.101 1.00 8.98 O -ATOM 432 CB SER A 55 26.934 29.694 29.082 1.00 13.09 C -ATOM 433 OG SER A 55 27.781 30.646 28.473 1.00 23.11 O -ATOM 434 N THR A 56 27.091 29.094 25.825 1.00 8.86 N -ATOM 435 CA THR A 56 27.978 28.831 24.684 1.00 8.05 C -ATOM 436 C THR A 56 28.393 30.215 24.138 1.00 8.09 C -ATOM 437 O THR A 56 27.834 31.237 24.525 1.00 7.17 O -ATOM 438 CB THR A 56 27.296 28.024 23.534 1.00 6.70 C -ATOM 439 OG1 THR A 56 26.294 28.829 22.909 1.00 9.76 O -ATOM 440 CG2 THR A 56 26.653 26.751 24.049 1.00 7.76 C -ATOM 441 N THR A 57 29.381 30.242 23.249 1.00 9.17 N -ATOM 442 CA THR A 57 29.871 31.485 22.644 1.00 8.49 C -ATOM 443 C THR A 57 28.820 32.222 21.802 1.00 7.50 C -ATOM 444 O THR A 57 28.952 33.412 21.565 1.00 9.40 O -ATOM 445 CB THR A 57 31.091 31.205 21.716 1.00 9.12 C -ATOM 446 OG1 THR A 57 30.758 30.171 20.786 1.00 9.41 O -ATOM 447 CG2 THR A 57 32.297 30.775 22.516 1.00 11.48 C -ATOM 448 N VAL A 58 27.786 31.510 21.356 1.00 8.04 N -ATOM 449 CA VAL A 58 26.733 32.090 20.500 1.00 9.09 C -ATOM 450 C VAL A 58 25.328 32.224 21.102 1.00 8.67 C -ATOM 451 O VAL A 58 24.466 32.892 20.531 1.00 6.97 O -ATOM 452 CB VAL A 58 26.602 31.287 19.155 1.00 9.96 C -ATOM 453 CG1 VAL A 58 27.976 31.161 18.454 1.00 11.08 C -ATOM 454 CG2 VAL A 58 26.010 29.890 19.404 1.00 9.41 C -ATOM 455 N ARG A 59 25.100 31.620 22.266 1.00 8.88 N -ATOM 456 CA ARG A 59 23.783 31.655 22.882 1.00 9.95 C -ATOM 457 C ARG A 59 23.843 31.140 24.303 1.00 10.14 C -ATOM 458 O ARG A 59 24.440 30.108 24.556 1.00 10.10 O -ATOM 459 CB ARG A 59 22.837 30.751 22.074 1.00 13.11 C -ATOM 460 CG ARG A 59 21.417 30.569 22.623 1.00 16.80 C -ATOM 461 CD ARG A 59 20.521 29.961 21.535 1.00 18.74 C -ATOM 462 NE ARG A 59 19.250 29.440 22.032 1.00 20.63 N -ATOM 463 CZ ARG A 59 18.147 30.165 22.193 1.00 22.94 C -ATOM 464 NH1 ARG A 59 18.138 31.462 21.894 1.00 22.55 N -ATOM 465 NH2 ARG A 59 17.051 29.594 22.686 1.00 23.68 N -ATOM 466 N THR A 60 23.183 31.849 25.211 1.00 11.23 N -ATOM 467 CA THR A 60 23.120 31.458 26.611 1.00 11.84 C -ATOM 468 C THR A 60 21.650 31.500 27.005 1.00 11.73 C -ATOM 469 O THR A 60 20.934 32.423 26.620 1.00 13.69 O -ATOM 470 CB THR A 60 23.916 32.451 27.519 1.00 10.13 C -ATOM 471 OG1 THR A 60 25.320 32.302 27.276 1.00 10.55 O -ATOM 472 CG2 THR A 60 23.632 32.181 29.003 1.00 11.01 C -ATOM 473 N THR A 61 21.183 30.470 27.706 1.00 11.78 N -ATOM 474 CA THR A 61 19.797 30.413 28.175 1.00 11.54 C -ATOM 475 C THR A 61 19.831 30.214 29.686 1.00 10.88 C -ATOM 476 O THR A 61 20.734 29.570 30.205 1.00 9.63 O -ATOM 477 CB THR A 61 18.965 29.229 27.539 1.00 12.65 C -ATOM 478 OG1 THR A 61 19.563 27.976 27.874 1.00 14.13 O -ATOM 479 CG2 THR A 61 18.889 29.336 26.012 1.00 14.15 C -ATOM 480 N GLU A 62 18.878 30.828 30.382 1.00 12.14 N -ATOM 481 CA GLU A 62 18.749 30.698 31.833 1.00 12.88 C -ATOM 482 C GLU A 62 17.283 30.444 32.100 1.00 12.21 C -ATOM 483 O GLU A 62 16.450 31.270 31.745 1.00 13.95 O -ATOM 484 CB GLU A 62 19.151 31.990 32.538 1.00 16.15 C -ATOM 485 CG GLU A 62 20.585 32.344 32.326 1.00 23.65 C -ATOM 486 CD GLU A 62 20.961 33.649 32.979 1.00 29.90 C -ATOM 487 OE1 GLU A 62 20.969 33.703 34.229 1.00 31.84 O -ATOM 488 OE2 GLU A 62 21.258 34.616 32.236 1.00 33.89 O -ATOM 489 N ILE A 63 16.943 29.292 32.657 1.00 10.43 N -ATOM 490 CA ILE A 63 15.548 29.021 32.946 1.00 11.02 C -ATOM 491 C ILE A 63 15.352 28.816 34.446 1.00 11.60 C -ATOM 492 O ILE A 63 16.286 28.434 35.144 1.00 9.20 O -ATOM 493 CB ILE A 63 14.976 27.816 32.125 1.00 11.28 C -ATOM 494 CG1 ILE A 63 15.717 26.519 32.431 1.00 10.60 C -ATOM 495 CG2 ILE A 63 15.020 28.129 30.638 1.00 11.62 C -ATOM 496 CD1 ILE A 63 15.126 25.293 31.720 1.00 13.40 C -ATOM 497 N ASN A 64 14.184 29.219 34.933 1.00 12.13 N -ATOM 498 CA ASN A 64 13.824 29.083 36.343 1.00 14.79 C -ATOM 499 C ASN A 64 12.451 28.441 36.375 1.00 13.29 C -ATOM 500 O ASN A 64 11.490 28.976 35.802 1.00 13.29 O -ATOM 501 CB ASN A 64 13.732 30.450 37.054 1.00 16.87 C -ATOM 502 CG ASN A 64 15.079 31.089 37.279 1.00 20.91 C -ATOM 503 OD1 ASN A 64 15.775 30.764 38.238 1.00 22.91 O -ATOM 504 ND2 ASN A 64 15.459 32.007 36.393 1.00 22.20 N -ATOM 505 N PHE A 65 12.347 27.301 37.044 1.00 12.90 N -ATOM 506 CA PHE A 65 11.058 26.641 37.132 1.00 12.63 C -ATOM 507 C PHE A 65 10.858 25.841 38.410 1.00 13.07 C -ATOM 508 O PHE A 65 11.811 25.531 39.121 1.00 12.50 O -ATOM 509 CB PHE A 65 10.829 25.731 35.922 1.00 11.31 C -ATOM 510 CG PHE A 65 11.794 24.586 35.825 1.00 12.32 C -ATOM 511 CD1 PHE A 65 11.549 23.386 36.494 1.00 10.31 C -ATOM 512 CD2 PHE A 65 12.947 24.706 35.070 1.00 11.23 C -ATOM 513 CE1 PHE A 65 12.441 22.329 36.413 1.00 11.00 C -ATOM 514 CE2 PHE A 65 13.847 23.645 34.984 1.00 11.69 C -ATOM 515 CZ PHE A 65 13.593 22.461 35.655 1.00 12.20 C -ATOM 516 N LYS A 66 9.599 25.560 38.713 1.00 13.15 N -ATOM 517 CA LYS A 66 9.251 24.735 39.849 1.00 13.41 C -ATOM 518 C LYS A 66 8.555 23.552 39.178 1.00 12.17 C -ATOM 519 O LYS A 66 7.763 23.747 38.251 1.00 12.93 O -ATOM 520 CB LYS A 66 8.313 25.498 40.800 1.00 16.68 C -ATOM 521 CG LYS A 66 7.722 24.639 41.907 1.00 24.60 C -ATOM 522 CD LYS A 66 7.391 25.453 43.165 1.00 28.53 C -ATOM 523 CE LYS A 66 6.664 24.585 44.213 1.00 32.17 C -ATOM 524 NZ LYS A 66 7.393 23.332 44.604 1.00 32.54 N -ATOM 525 N VAL A 67 8.918 22.329 39.562 1.00 11.82 N -ATOM 526 CA VAL A 67 8.295 21.141 38.975 1.00 10.93 C -ATOM 527 C VAL A 67 6.783 21.174 39.226 1.00 11.97 C -ATOM 528 O VAL A 67 6.343 21.480 40.342 1.00 13.54 O -ATOM 529 CB VAL A 67 8.908 19.827 39.541 1.00 10.09 C -ATOM 530 CG1 VAL A 67 8.271 18.617 38.883 1.00 10.96 C -ATOM 531 CG2 VAL A 67 10.410 19.808 39.320 1.00 10.21 C -ATOM 532 N GLY A 68 6.006 20.965 38.160 1.00 9.80 N -ATOM 533 CA GLY A 68 4.557 20.962 38.265 1.00 9.33 C -ATOM 534 C GLY A 68 3.887 22.298 38.031 1.00 10.60 C -ATOM 535 O GLY A 68 2.653 22.389 38.039 1.00 11.93 O -ATOM 536 N GLU A 69 4.688 23.337 37.809 1.00 11.12 N -ATOM 537 CA GLU A 69 4.165 24.682 37.553 1.00 12.64 C -ATOM 538 C GLU A 69 4.604 25.185 36.184 1.00 13.09 C -ATOM 539 O GLU A 69 5.774 25.107 35.820 1.00 12.17 O -ATOM 540 CB GLU A 69 4.578 25.642 38.668 1.00 12.20 C -ATOM 541 CG GLU A 69 3.857 25.282 39.964 1.00 17.44 C -ATOM 542 CD GLU A 69 4.116 26.211 41.138 1.00 21.02 C -ATOM 543 OE1 GLU A 69 4.496 27.384 40.945 1.00 21.43 O -ATOM 544 OE2 GLU A 69 3.902 25.753 42.282 1.00 23.44 O -ATOM 545 N GLU A 70 3.633 25.622 35.397 1.00 14.53 N -ATOM 546 CA GLU A 70 3.912 26.102 34.059 1.00 15.80 C -ATOM 547 C GLU A 70 4.816 27.329 34.007 1.00 13.72 C -ATOM 548 O GLU A 70 4.761 28.208 34.863 1.00 13.66 O -ATOM 549 CB GLU A 70 2.606 26.359 33.320 1.00 19.99 C -ATOM 550 CG GLU A 70 2.814 26.634 31.851 1.00 28.23 C -ATOM 551 CD GLU A 70 1.518 26.678 31.097 1.00 32.73 C -ATOM 552 OE1 GLU A 70 0.975 25.589 30.789 1.00 35.76 O -ATOM 553 OE2 GLU A 70 1.045 27.802 30.823 1.00 35.75 O -ATOM 554 N PHE A 71 5.713 27.340 33.028 1.00 12.80 N -ATOM 555 CA PHE A 71 6.638 28.448 32.837 1.00 12.36 C -ATOM 556 C PHE A 71 6.856 28.678 31.350 1.00 12.97 C -ATOM 557 O PHE A 71 6.382 27.917 30.516 1.00 12.54 O -ATOM 558 CB PHE A 71 7.975 28.243 33.589 1.00 10.02 C -ATOM 559 CG PHE A 71 8.851 27.148 33.033 1.00 10.48 C -ATOM 560 CD1 PHE A 71 8.549 25.815 33.256 1.00 9.95 C -ATOM 561 CD2 PHE A 71 10.006 27.459 32.331 1.00 9.29 C -ATOM 562 CE1 PHE A 71 9.380 24.811 32.793 1.00 9.74 C -ATOM 563 CE2 PHE A 71 10.832 26.464 31.868 1.00 9.51 C -ATOM 564 CZ PHE A 71 10.518 25.136 32.102 1.00 8.47 C -ATOM 565 N GLU A 72 7.581 29.733 31.028 1.00 15.04 N -ATOM 566 CA GLU A 72 7.826 30.063 29.644 1.00 17.19 C -ATOM 567 C GLU A 72 9.323 30.036 29.357 1.00 15.53 C -ATOM 568 O GLU A 72 10.130 30.511 30.158 1.00 16.16 O -ATOM 569 CB GLU A 72 7.248 31.448 29.379 1.00 22.03 C -ATOM 570 CG GLU A 72 6.700 31.658 28.002 1.00 30.80 C -ATOM 571 CD GLU A 72 6.157 33.060 27.827 1.00 34.75 C -ATOM 572 OE1 GLU A 72 5.014 33.309 28.276 1.00 35.88 O -ATOM 573 OE2 GLU A 72 6.885 33.912 27.255 1.00 38.91 O -ATOM 574 N GLU A 73 9.691 29.378 28.263 1.00 13.46 N -ATOM 575 CA GLU A 73 11.088 29.302 27.836 1.00 13.89 C -ATOM 576 C GLU A 73 11.083 29.318 26.301 1.00 13.70 C -ATOM 577 O GLU A 73 10.159 29.859 25.690 1.00 13.63 O -ATOM 578 CB GLU A 73 11.780 28.032 28.379 1.00 12.63 C -ATOM 579 CG GLU A 73 11.145 26.706 27.986 1.00 10.55 C -ATOM 580 CD GLU A 73 11.997 25.499 28.366 1.00 8.94 C -ATOM 581 OE1 GLU A 73 13.191 25.650 28.642 1.00 12.29 O -ATOM 582 OE2 GLU A 73 11.485 24.374 28.363 1.00 10.37 O -ATOM 583 N GLN A 74 12.115 28.751 25.685 1.00 13.09 N -ATOM 584 CA GLN A 74 12.187 28.691 24.239 1.00 13.16 C -ATOM 585 C GLN A 74 12.618 27.315 23.806 1.00 12.86 C -ATOM 586 O GLN A 74 13.290 26.596 24.552 1.00 13.17 O -ATOM 587 CB GLN A 74 13.218 29.685 23.706 1.00 15.91 C -ATOM 588 CG GLN A 74 12.803 31.133 23.779 1.00 19.68 C -ATOM 589 CD GLN A 74 13.827 32.066 23.159 1.00 21.00 C -ATOM 590 OE1 GLN A 74 15.010 31.730 23.024 1.00 22.37 O -ATOM 591 NE2 GLN A 74 13.373 33.247 22.774 1.00 24.07 N -ATOM 592 N THR A 75 12.229 26.935 22.600 1.00 10.98 N -ATOM 593 CA THR A 75 12.664 25.656 22.056 1.00 11.83 C -ATOM 594 C THR A 75 14.162 25.828 21.729 1.00 11.24 C -ATOM 595 O THR A 75 14.681 26.951 21.764 1.00 9.95 O -ATOM 596 CB THR A 75 11.895 25.325 20.757 1.00 11.93 C -ATOM 597 OG1 THR A 75 12.123 26.366 19.795 1.00 13.31 O -ATOM 598 CG2 THR A 75 10.396 25.202 21.042 1.00 13.29 C -ATOM 599 N VAL A 76 14.841 24.731 21.377 1.00 13.77 N -ATOM 600 CA VAL A 76 16.278 24.762 21.049 1.00 14.39 C -ATOM 601 C VAL A 76 16.612 25.734 19.914 1.00 12.97 C -ATOM 602 O VAL A 76 17.639 26.407 19.956 1.00 13.75 O -ATOM 603 CB VAL A 76 16.827 23.351 20.680 1.00 15.44 C -ATOM 604 CG1 VAL A 76 18.332 23.314 20.844 1.00 17.74 C -ATOM 605 CG2 VAL A 76 16.218 22.293 21.548 1.00 19.99 C -ATOM 606 N ASP A 77 15.730 25.824 18.921 1.00 13.67 N -ATOM 607 CA ASP A 77 15.933 26.727 17.789 1.00 14.47 C -ATOM 608 C ASP A 77 15.486 28.172 18.061 1.00 15.23 C -ATOM 609 O ASP A 77 15.461 29.002 17.153 1.00 14.90 O -ATOM 610 CB ASP A 77 15.301 26.158 16.503 1.00 15.63 C -ATOM 611 CG ASP A 77 13.790 26.007 16.585 1.00 15.92 C -ATOM 612 OD1 ASP A 77 13.260 25.470 17.586 1.00 14.64 O -ATOM 613 OD2 ASP A 77 13.123 26.409 15.613 1.00 17.79 O -ATOM 614 N GLY A 78 15.095 28.445 19.312 1.00 15.17 N -ATOM 615 CA GLY A 78 14.709 29.790 19.726 1.00 15.90 C -ATOM 616 C GLY A 78 13.268 30.281 19.701 1.00 16.89 C -ATOM 617 O GLY A 78 13.038 31.489 19.790 1.00 19.37 O -ATOM 618 N ARG A 79 12.292 29.389 19.620 1.00 16.76 N -ATOM 619 CA ARG A 79 10.896 29.822 19.587 1.00 18.08 C -ATOM 620 C ARG A 79 10.229 29.768 20.961 1.00 16.55 C -ATOM 621 O ARG A 79 10.379 28.787 21.680 1.00 16.57 O -ATOM 622 CB ARG A 79 10.112 28.961 18.604 1.00 20.74 C -ATOM 623 CG ARG A 79 10.667 28.997 17.194 1.00 25.89 C -ATOM 624 CD ARG A 79 9.986 27.976 16.310 1.00 29.77 C -ATOM 625 NE ARG A 79 10.144 26.626 16.842 1.00 34.52 N -ATOM 626 CZ ARG A 79 10.128 25.516 16.109 1.00 35.90 C -ATOM 627 NH1 ARG A 79 9.971 25.580 14.789 1.00 37.70 N -ATOM 628 NH2 ARG A 79 10.266 24.337 16.702 1.00 35.58 N -ATOM 629 N PRO A 80 9.501 30.830 21.352 1.00 15.98 N -ATOM 630 CA PRO A 80 8.819 30.867 22.651 1.00 15.47 C -ATOM 631 C PRO A 80 7.825 29.725 22.833 1.00 14.23 C -ATOM 632 O PRO A 80 7.058 29.393 21.926 1.00 14.56 O -ATOM 633 CB PRO A 80 8.100 32.220 22.628 1.00 15.48 C -ATOM 634 CG PRO A 80 9.010 33.057 21.846 1.00 18.18 C -ATOM 635 CD PRO A 80 9.418 32.145 20.696 1.00 17.08 C -ATOM 636 N CYS A 81 7.817 29.148 24.028 1.00 13.52 N -ATOM 637 CA CYS A 81 6.914 28.055 24.331 1.00 12.41 C -ATOM 638 C CYS A 81 6.548 28.054 25.811 1.00 12.52 C -ATOM 639 O CYS A 81 7.202 28.718 26.624 1.00 11.74 O -ATOM 640 CB CYS A 81 7.563 26.705 23.950 1.00 11.59 C -ATOM 641 SG CYS A 81 9.063 26.255 24.894 1.00 12.86 S -ATOM 642 N LYS A 82 5.448 27.379 26.121 1.00 13.86 N -ATOM 643 CA LYS A 82 4.988 27.197 27.492 1.00 14.38 C -ATOM 644 C LYS A 82 5.436 25.779 27.839 1.00 13.51 C -ATOM 645 O LYS A 82 5.227 24.842 27.063 1.00 12.69 O -ATOM 646 CB LYS A 82 3.473 27.299 27.589 1.00 18.36 C -ATOM 647 CG LYS A 82 2.940 28.716 27.584 1.00 26.02 C -ATOM 648 CD LYS A 82 3.353 29.506 28.826 1.00 31.13 C -ATOM 649 CE LYS A 82 2.686 30.894 28.832 1.00 35.39 C -ATOM 650 NZ LYS A 82 2.868 31.652 30.120 1.00 37.63 N -ATOM 651 N SER A 83 6.110 25.638 28.974 1.00 11.15 N -ATOM 652 CA SER A 83 6.624 24.352 29.397 1.00 10.10 C -ATOM 653 C SER A 83 6.083 23.931 30.752 1.00 11.16 C -ATOM 654 O SER A 83 5.721 24.769 31.575 1.00 10.21 O -ATOM 655 CB SER A 83 8.149 24.418 29.446 1.00 10.30 C -ATOM 656 OG SER A 83 8.686 24.518 28.132 1.00 11.50 O -ATOM 657 N LEU A 84 6.028 22.620 30.954 1.00 11.17 N -ATOM 658 CA LEU A 84 5.557 22.016 32.192 1.00 11.84 C -ATOM 659 C LEU A 84 6.427 20.793 32.470 1.00 10.42 C -ATOM 660 O LEU A 84 6.444 19.846 31.684 1.00 11.20 O -ATOM 661 CB LEU A 84 4.091 21.576 32.067 1.00 13.44 C -ATOM 662 CG LEU A 84 3.552 20.784 33.270 1.00 15.74 C -ATOM 663 CD1 LEU A 84 3.515 21.683 34.484 1.00 16.96 C -ATOM 664 CD2 LEU A 84 2.178 20.231 32.982 1.00 18.76 C -ATOM 665 N VAL A 85 7.146 20.828 33.589 1.00 9.60 N -ATOM 666 CA VAL A 85 8.028 19.738 34.006 1.00 9.50 C -ATOM 667 C VAL A 85 7.344 18.878 35.082 1.00 9.74 C -ATOM 668 O VAL A 85 6.680 19.404 35.985 1.00 9.28 O -ATOM 669 CB VAL A 85 9.384 20.291 34.598 1.00 8.89 C -ATOM 670 CG1 VAL A 85 10.327 19.140 34.970 1.00 8.20 C -ATOM 671 CG2 VAL A 85 10.062 21.227 33.612 1.00 8.48 C -ATOM 672 N LYS A 86 7.504 17.563 34.971 1.00 9.96 N -ATOM 673 CA LYS A 86 6.946 16.621 35.945 1.00 11.92 C -ATOM 674 C LYS A 86 8.003 15.558 36.247 1.00 11.88 C -ATOM 675 O LYS A 86 8.917 15.340 35.453 1.00 11.00 O -ATOM 676 CB LYS A 86 5.700 15.911 35.385 1.00 12.40 C -ATOM 677 CG LYS A 86 4.538 16.819 35.058 1.00 16.01 C -ATOM 678 CD LYS A 86 3.333 16.017 34.559 1.00 21.36 C -ATOM 679 CE LYS A 86 2.140 16.939 34.345 1.00 23.23 C -ATOM 680 NZ LYS A 86 0.919 16.212 33.929 1.00 28.41 N -ATOM 681 N TRP A 87 7.868 14.889 37.386 1.00 10.75 N -ATOM 682 CA TRP A 87 8.775 13.811 37.738 1.00 9.53 C -ATOM 683 C TRP A 87 8.238 12.559 37.052 1.00 9.89 C -ATOM 684 O TRP A 87 7.144 12.107 37.370 1.00 11.80 O -ATOM 685 CB TRP A 87 8.791 13.569 39.268 1.00 8.76 C -ATOM 686 CG TRP A 87 9.494 14.641 40.062 1.00 8.86 C -ATOM 687 CD1 TRP A 87 8.923 15.525 40.939 1.00 8.80 C -ATOM 688 CD2 TRP A 87 10.889 14.990 39.992 1.00 9.42 C -ATOM 689 NE1 TRP A 87 9.872 16.410 41.400 1.00 8.01 N -ATOM 690 CE2 TRP A 87 11.086 16.103 40.835 1.00 10.85 C -ATOM 691 CE3 TRP A 87 11.985 14.475 39.283 1.00 9.60 C -ATOM 692 CZ2 TRP A 87 12.340 16.716 40.994 1.00 11.45 C -ATOM 693 CZ3 TRP A 87 13.230 15.084 39.438 1.00 10.72 C -ATOM 694 CH2 TRP A 87 13.395 16.192 40.289 1.00 11.78 C -ATOM 695 N GLU A 88 8.954 12.040 36.064 1.00 9.93 N -ATOM 696 CA GLU A 88 8.526 10.807 35.416 1.00 11.30 C -ATOM 697 C GLU A 88 8.826 9.726 36.448 1.00 11.75 C -ATOM 698 O GLU A 88 8.068 8.784 36.623 1.00 12.78 O -ATOM 699 CB GLU A 88 9.337 10.541 34.156 1.00 13.50 C -ATOM 700 CG GLU A 88 8.917 9.261 33.454 1.00 18.67 C -ATOM 701 CD GLU A 88 9.756 8.958 32.226 1.00 23.49 C -ATOM 702 OE1 GLU A 88 9.581 9.650 31.205 1.00 26.53 O -ATOM 703 OE2 GLU A 88 10.587 8.025 32.276 1.00 26.54 O -ATOM 704 N SER A 89 9.972 9.870 37.103 1.00 11.49 N -ATOM 705 CA SER A 89 10.402 8.954 38.158 1.00 11.10 C -ATOM 706 C SER A 89 11.206 9.776 39.163 1.00 11.14 C -ATOM 707 O SER A 89 11.397 10.983 38.979 1.00 9.92 O -ATOM 708 CB SER A 89 11.221 7.778 37.604 1.00 12.43 C -ATOM 709 OG SER A 89 12.396 8.215 36.947 1.00 14.39 O -ATOM 710 N GLU A 90 11.674 9.130 40.227 1.00 10.17 N -ATOM 711 CA GLU A 90 12.433 9.826 41.254 1.00 10.83 C -ATOM 712 C GLU A 90 13.657 10.629 40.772 1.00 9.86 C -ATOM 713 O GLU A 90 13.932 11.715 41.289 1.00 10.30 O -ATOM 714 CB GLU A 90 12.858 8.846 42.348 1.00 11.92 C -ATOM 715 CG GLU A 90 13.536 9.572 43.487 1.00 16.53 C -ATOM 716 CD GLU A 90 13.912 8.671 44.644 1.00 19.80 C -ATOM 717 OE1 GLU A 90 14.122 7.464 44.426 1.00 21.18 O -ATOM 718 OE2 GLU A 90 14.012 9.187 45.774 1.00 22.91 O -ATOM 719 N ASN A 91 14.376 10.102 39.783 1.00 8.79 N -ATOM 720 CA ASN A 91 15.578 10.767 39.274 1.00 10.50 C -ATOM 721 C ASN A 91 15.455 11.289 37.855 1.00 9.69 C -ATOM 722 O ASN A 91 16.467 11.627 37.246 1.00 7.10 O -ATOM 723 CB ASN A 91 16.760 9.798 39.305 1.00 14.33 C -ATOM 724 CG ASN A 91 17.064 9.307 40.693 1.00 17.71 C -ATOM 725 OD1 ASN A 91 17.445 10.087 41.560 1.00 20.87 O -ATOM 726 ND2 ASN A 91 16.855 8.016 40.928 1.00 19.39 N -ATOM 727 N LYS A 92 14.230 11.387 37.352 1.00 8.60 N -ATOM 728 CA LYS A 92 14.016 11.835 35.981 1.00 8.88 C -ATOM 729 C LYS A 92 12.861 12.812 35.807 1.00 8.61 C -ATOM 730 O LYS A 92 11.721 12.511 36.168 1.00 8.95 O -ATOM 731 CB LYS A 92 13.781 10.626 35.078 1.00 9.10 C -ATOM 732 CG LYS A 92 13.566 10.996 33.618 1.00 11.95 C -ATOM 733 CD LYS A 92 13.467 9.762 32.759 1.00 14.04 C -ATOM 734 CE LYS A 92 13.333 10.124 31.299 1.00 16.33 C -ATOM 735 NZ LYS A 92 13.129 8.884 30.506 1.00 17.37 N -ATOM 736 N MET A 93 13.172 13.988 35.268 1.00 7.58 N -ATOM 737 CA MET A 93 12.159 14.985 34.995 1.00 8.21 C -ATOM 738 C MET A 93 11.915 15.038 33.496 1.00 9.18 C -ATOM 739 O MET A 93 12.833 14.838 32.690 1.00 7.74 O -ATOM 740 CB MET A 93 12.565 16.359 35.523 1.00 9.68 C -ATOM 741 CG MET A 93 13.826 16.925 34.937 1.00 13.16 C -ATOM 742 SD MET A 93 14.238 18.543 35.628 1.00 17.49 S -ATOM 743 CE MET A 93 15.009 18.106 37.076 1.00 18.53 C -ATOM 744 N VAL A 94 10.658 15.239 33.128 1.00 9.48 N -ATOM 745 CA VAL A 94 10.266 15.334 31.726 1.00 9.55 C -ATOM 746 C VAL A 94 9.516 16.639 31.528 1.00 10.10 C -ATOM 747 O VAL A 94 8.683 17.024 32.364 1.00 9.47 O -ATOM 748 CB VAL A 94 9.371 14.164 31.315 1.00 11.05 C -ATOM 749 CG1 VAL A 94 8.878 14.354 29.878 1.00 12.88 C -ATOM 750 CG2 VAL A 94 10.147 12.866 31.420 1.00 14.00 C -ATOM 751 N CYS A 95 9.802 17.312 30.413 1.00 9.49 N -ATOM 752 CA CYS A 95 9.169 18.582 30.094 1.00 8.82 C -ATOM 753 C CYS A 95 8.431 18.559 28.758 1.00 11.70 C -ATOM 754 O CYS A 95 9.014 18.215 27.723 1.00 12.29 O -ATOM 755 CB CYS A 95 10.229 19.679 30.059 1.00 8.79 C -ATOM 756 SG CYS A 95 9.620 21.322 29.690 1.00 10.97 S -ATOM 757 N GLU A 96 7.149 18.902 28.791 1.00 10.87 N -ATOM 758 CA GLU A 96 6.342 18.962 27.587 1.00 14.78 C -ATOM 759 C GLU A 96 6.267 20.439 27.182 1.00 13.83 C -ATOM 760 O GLU A 96 6.044 21.311 28.030 1.00 12.79 O -ATOM 761 CB GLU A 96 4.957 18.397 27.885 1.00 20.21 C -ATOM 762 CG GLU A 96 3.981 18.432 26.726 1.00 32.46 C -ATOM 763 CD GLU A 96 2.646 17.765 27.065 1.00 38.97 C -ATOM 764 OE1 GLU A 96 2.053 18.108 28.128 1.00 42.61 O -ATOM 765 OE2 GLU A 96 2.201 16.892 26.271 1.00 42.17 O -ATOM 766 N GLN A 97 6.513 20.725 25.903 1.00 13.39 N -ATOM 767 CA GLN A 97 6.489 22.100 25.402 1.00 13.55 C -ATOM 768 C GLN A 97 5.357 22.334 24.400 1.00 15.88 C -ATOM 769 O GLN A 97 5.013 21.455 23.591 1.00 16.25 O -ATOM 770 CB GLN A 97 7.823 22.465 24.747 1.00 12.20 C -ATOM 771 CG GLN A 97 9.033 22.324 25.650 1.00 12.55 C -ATOM 772 CD GLN A 97 10.321 22.613 24.927 1.00 14.20 C -ATOM 773 OE1 GLN A 97 10.478 22.288 23.749 1.00 12.94 O -ATOM 774 NE2 GLN A 97 11.260 23.235 25.627 1.00 14.75 N -ATOM 775 N LYS A 98 4.801 23.541 24.450 1.00 17.30 N -ATOM 776 CA LYS A 98 3.696 23.952 23.582 1.00 19.78 C -ATOM 777 C LYS A 98 3.990 25.340 23.019 1.00 18.56 C -ATOM 778 O LYS A 98 4.162 26.293 23.771 1.00 17.70 O -ATOM 779 CB LYS A 98 2.389 23.953 24.389 1.00 23.30 C -ATOM 780 CG LYS A 98 1.294 24.857 23.867 1.00 30.94 C -ATOM 781 CD LYS A 98 0.210 25.047 24.934 1.00 37.10 C -ATOM 782 CE LYS A 98 -0.849 26.072 24.520 1.00 39.73 C -ATOM 783 NZ LYS A 98 -0.326 27.476 24.541 1.00 42.46 N -ATOM 784 N LEU A 99 4.073 25.445 21.696 1.00 19.35 N -ATOM 785 CA LEU A 99 4.357 26.721 21.041 1.00 21.32 C -ATOM 786 C LEU A 99 3.307 27.770 21.351 1.00 22.86 C -ATOM 787 O LEU A 99 2.108 27.496 21.261 1.00 23.41 O -ATOM 788 CB LEU A 99 4.466 26.542 19.526 1.00 22.09 C -ATOM 789 CG LEU A 99 5.692 25.792 18.997 1.00 22.72 C -ATOM 790 CD1 LEU A 99 5.585 25.639 17.490 1.00 23.04 C -ATOM 791 CD2 LEU A 99 6.951 26.548 19.372 1.00 23.61 C -ATOM 792 N LEU A 100 3.767 28.962 21.722 1.00 24.11 N -ATOM 793 CA LEU A 100 2.879 30.070 22.051 1.00 27.59 C -ATOM 794 C LEU A 100 2.130 30.545 20.815 1.00 30.94 C -ATOM 795 O LEU A 100 0.951 30.908 20.877 1.00 31.34 O -ATOM 796 CB LEU A 100 3.680 31.227 22.640 1.00 25.50 C -ATOM 797 CG LEU A 100 4.254 30.947 24.020 1.00 24.80 C -ATOM 798 CD1 LEU A 100 4.960 32.171 24.542 1.00 26.59 C -ATOM 799 CD2 LEU A 100 3.141 30.554 24.935 1.00 24.80 C -ATOM 800 N LYS A 101 2.835 30.531 19.689 1.00 34.60 N -ATOM 801 CA LYS A 101 2.282 30.961 18.413 1.00 37.81 C -ATOM 802 C LYS A 101 2.847 30.088 17.292 1.00 37.39 C -ATOM 803 O LYS A 101 4.019 29.687 17.319 1.00 37.22 O -ATOM 804 CB LYS A 101 2.653 32.429 18.147 1.00 40.57 C -ATOM 805 CG LYS A 101 2.182 33.426 19.212 1.00 45.13 C -ATOM 806 CD LYS A 101 2.955 34.741 19.125 1.00 48.57 C -ATOM 807 CE LYS A 101 4.479 34.527 19.248 1.00 51.31 C -ATOM 808 NZ LYS A 101 4.917 33.952 20.559 1.00 51.14 N -ATOM 809 N GLY A 102 1.997 29.786 16.318 1.00 37.21 N -ATOM 810 CA GLY A 102 2.423 28.993 15.184 1.00 36.82 C -ATOM 811 C GLY A 102 2.333 27.494 15.344 1.00 36.36 C -ATOM 812 O GLY A 102 1.690 26.977 16.265 1.00 35.74 O -ATOM 813 N GLU A 103 2.954 26.803 14.395 1.00 35.74 N -ATOM 814 CA GLU A 103 2.988 25.348 14.377 1.00 35.50 C -ATOM 815 C GLU A 103 4.418 24.880 14.140 1.00 31.92 C -ATOM 816 O GLU A 103 5.281 25.654 13.723 1.00 31.61 O -ATOM 817 CB GLU A 103 2.077 24.784 13.274 1.00 39.37 C -ATOM 818 CG GLU A 103 0.652 24.422 13.712 1.00 45.52 C -ATOM 819 CD GLU A 103 -0.383 25.503 13.395 1.00 50.23 C -ATOM 820 OE1 GLU A 103 -0.130 26.346 12.499 1.00 53.12 O -ATOM 821 OE2 GLU A 103 -1.464 25.500 14.036 1.00 52.16 O -ATOM 822 N GLY A 104 4.653 23.604 14.414 1.00 28.97 N -ATOM 823 CA GLY A 104 5.967 23.024 14.231 1.00 25.41 C -ATOM 824 C GLY A 104 6.012 21.648 14.863 1.00 22.09 C -ATOM 825 O GLY A 104 4.987 21.160 15.347 1.00 21.89 O -ATOM 826 N PRO A 105 7.176 20.976 14.832 1.00 19.50 N -ATOM 827 CA PRO A 105 7.338 19.640 15.418 1.00 17.92 C -ATOM 828 C PRO A 105 7.020 19.664 16.914 1.00 15.61 C -ATOM 829 O PRO A 105 7.170 20.696 17.567 1.00 14.42 O -ATOM 830 CB PRO A 105 8.828 19.348 15.202 1.00 18.86 C -ATOM 831 CG PRO A 105 9.188 20.164 14.005 1.00 18.76 C -ATOM 832 CD PRO A 105 8.423 21.440 14.199 1.00 18.40 C -ATOM 833 N LYS A 106 6.552 18.541 17.444 1.00 16.02 N -ATOM 834 CA LYS A 106 6.255 18.453 18.868 1.00 16.93 C -ATOM 835 C LYS A 106 7.609 18.305 19.554 1.00 15.49 C -ATOM 836 O LYS A 106 8.397 17.437 19.183 1.00 14.76 O -ATOM 837 CB LYS A 106 5.387 17.229 19.174 1.00 20.98 C -ATOM 838 CG LYS A 106 5.015 17.097 20.662 1.00 27.98 C -ATOM 839 CD LYS A 106 4.463 18.433 21.229 1.00 33.23 C -ATOM 840 CE LYS A 106 4.250 18.417 22.764 1.00 35.21 C -ATOM 841 NZ LYS A 106 5.519 18.251 23.566 1.00 33.75 N -ATOM 842 N THR A 107 7.907 19.167 20.515 1.00 13.91 N -ATOM 843 CA THR A 107 9.203 19.086 21.190 1.00 12.14 C -ATOM 844 C THR A 107 9.083 18.819 22.681 1.00 11.66 C -ATOM 845 O THR A 107 8.061 19.120 23.295 1.00 10.59 O -ATOM 846 CB THR A 107 10.012 20.382 21.016 1.00 12.37 C -ATOM 847 OG1 THR A 107 9.263 21.480 21.547 1.00 12.36 O -ATOM 848 CG2 THR A 107 10.327 20.643 19.544 1.00 12.62 C -ATOM 849 N SER A 108 10.140 18.249 23.250 1.00 10.16 N -ATOM 850 CA SER A 108 10.192 17.975 24.681 1.00 9.98 C -ATOM 851 C SER A 108 11.649 17.774 25.081 1.00 9.90 C -ATOM 852 O SER A 108 12.549 17.774 24.227 1.00 8.48 O -ATOM 853 CB SER A 108 9.370 16.729 25.024 1.00 9.84 C -ATOM 854 OG SER A 108 9.844 15.601 24.313 1.00 13.87 O -ATOM 855 N TRP A 109 11.890 17.708 26.386 1.00 7.96 N -ATOM 856 CA TRP A 109 13.233 17.446 26.894 1.00 7.85 C -ATOM 857 C TRP A 109 13.109 16.693 28.209 1.00 7.56 C -ATOM 858 O TRP A 109 12.053 16.728 28.837 1.00 8.14 O -ATOM 859 CB TRP A 109 14.094 18.722 27.051 1.00 8.25 C -ATOM 860 CG TRP A 109 13.627 19.829 28.007 1.00 8.07 C -ATOM 861 CD1 TRP A 109 13.120 21.046 27.648 1.00 9.28 C -ATOM 862 CD2 TRP A 109 13.745 19.865 29.450 1.00 9.31 C -ATOM 863 NE1 TRP A 109 12.929 21.836 28.760 1.00 9.69 N -ATOM 864 CE2 TRP A 109 13.306 21.136 29.878 1.00 9.04 C -ATOM 865 CE3 TRP A 109 14.186 18.939 30.416 1.00 9.92 C -ATOM 866 CZ2 TRP A 109 13.286 21.515 31.228 1.00 9.72 C -ATOM 867 CZ3 TRP A 109 14.163 19.316 31.758 1.00 10.25 C -ATOM 868 CH2 TRP A 109 13.717 20.593 32.149 1.00 10.11 C -ATOM 869 N THR A 110 14.136 15.924 28.549 1.00 7.39 N -ATOM 870 CA THR A 110 14.168 15.176 29.808 1.00 6.23 C -ATOM 871 C THR A 110 15.577 15.334 30.395 1.00 7.40 C -ATOM 872 O THR A 110 16.558 15.563 29.652 1.00 6.43 O -ATOM 873 CB THR A 110 13.887 13.633 29.626 1.00 7.17 C -ATOM 874 OG1 THR A 110 15.000 13.002 28.973 1.00 7.49 O -ATOM 875 CG2 THR A 110 12.616 13.377 28.803 1.00 6.64 C -ATOM 876 N ARG A 111 15.669 15.293 31.727 1.00 6.72 N -ATOM 877 CA ARG A 111 16.966 15.356 32.425 1.00 6.27 C -ATOM 878 C ARG A 111 16.924 14.287 33.483 1.00 7.89 C -ATOM 879 O ARG A 111 15.928 14.156 34.193 1.00 8.35 O -ATOM 880 CB ARG A 111 17.240 16.722 33.068 1.00 6.20 C -ATOM 881 CG ARG A 111 17.703 17.765 32.060 1.00 7.38 C -ATOM 882 CD ARG A 111 18.100 19.072 32.727 1.00 8.70 C -ATOM 883 NE ARG A 111 18.783 19.965 31.784 1.00 9.83 N -ATOM 884 CZ ARG A 111 18.158 20.804 30.963 1.00 10.23 C -ATOM 885 NH1 ARG A 111 16.840 20.869 30.966 1.00 10.89 N -ATOM 886 NH2 ARG A 111 18.847 21.590 30.144 1.00 11.56 N -ATOM 887 N GLU A 112 17.957 13.464 33.534 1.00 7.64 N -ATOM 888 CA GLU A 112 17.977 12.402 34.527 1.00 10.31 C -ATOM 889 C GLU A 112 19.356 12.142 35.113 1.00 9.93 C -ATOM 890 O GLU A 112 20.367 12.273 34.425 1.00 7.92 O -ATOM 891 CB GLU A 112 17.401 11.118 33.940 1.00 14.05 C -ATOM 892 CG GLU A 112 18.213 10.489 32.836 1.00 20.37 C -ATOM 893 CD GLU A 112 17.484 9.325 32.177 1.00 25.09 C -ATOM 894 OE1 GLU A 112 17.223 8.308 32.883 1.00 22.36 O -ATOM 895 OE2 GLU A 112 17.175 9.443 30.955 1.00 25.10 O -ATOM 896 N LEU A 113 19.387 11.816 36.401 1.00 8.96 N -ATOM 897 CA LEU A 113 20.634 11.503 37.091 1.00 12.04 C -ATOM 898 C LEU A 113 20.789 9.991 37.081 1.00 12.06 C -ATOM 899 O LEU A 113 19.906 9.270 37.559 1.00 12.08 O -ATOM 900 CB LEU A 113 20.575 11.983 38.532 1.00 14.38 C -ATOM 901 CG LEU A 113 20.768 13.465 38.799 1.00 17.46 C -ATOM 902 CD1 LEU A 113 20.709 13.656 40.298 1.00 19.61 C -ATOM 903 CD2 LEU A 113 22.128 13.945 38.266 1.00 18.46 C -ATOM 904 N THR A 114 21.895 9.502 36.535 1.00 11.06 N -ATOM 905 CA THR A 114 22.110 8.062 36.452 1.00 11.74 C -ATOM 906 C THR A 114 22.816 7.522 37.686 1.00 11.41 C -ATOM 907 O THR A 114 23.327 8.282 38.501 1.00 11.47 O -ATOM 908 CB THR A 114 22.894 7.700 35.188 1.00 12.89 C -ATOM 909 OG1 THR A 114 24.109 8.451 35.164 1.00 15.50 O -ATOM 910 CG2 THR A 114 22.075 8.037 33.951 1.00 14.75 C -ATOM 911 N ASN A 115 22.834 6.202 37.808 1.00 13.23 N -ATOM 912 CA ASN A 115 23.441 5.538 38.951 1.00 16.19 C -ATOM 913 C ASN A 115 24.930 5.761 39.139 1.00 14.24 C -ATOM 914 O ASN A 115 25.432 5.626 40.256 1.00 14.74 O -ATOM 915 CB ASN A 115 23.123 4.047 38.918 1.00 21.89 C -ATOM 916 CG ASN A 115 21.703 3.754 39.357 1.00 29.77 C -ATOM 917 OD1 ASN A 115 20.955 3.046 38.669 1.00 34.83 O -ATOM 918 ND2 ASN A 115 21.313 4.310 40.516 1.00 32.90 N -ATOM 919 N ASP A 116 25.626 6.095 38.055 1.00 12.05 N -ATOM 920 CA ASP A 116 27.061 6.364 38.094 1.00 11.99 C -ATOM 921 C ASP A 116 27.424 7.821 38.397 1.00 11.45 C -ATOM 922 O ASP A 116 28.592 8.184 38.393 1.00 12.23 O -ATOM 923 CB ASP A 116 27.764 5.875 36.806 1.00 13.89 C -ATOM 924 CG ASP A 116 27.177 6.474 35.512 1.00 16.58 C -ATOM 925 OD1 ASP A 116 26.263 7.303 35.569 1.00 19.66 O -ATOM 926 OD2 ASP A 116 27.651 6.113 34.422 1.00 20.14 O -ATOM 927 N GLY A 117 26.420 8.647 38.675 1.00 10.58 N -ATOM 928 CA GLY A 117 26.669 10.042 38.997 1.00 9.83 C -ATOM 929 C GLY A 117 26.652 11.019 37.831 1.00 9.97 C -ATOM 930 O GLY A 117 26.945 12.192 38.019 1.00 10.45 O -ATOM 931 N GLU A 118 26.289 10.550 36.638 1.00 9.43 N -ATOM 932 CA GLU A 118 26.242 11.413 35.458 1.00 7.79 C -ATOM 933 C GLU A 118 24.834 11.955 35.213 1.00 7.60 C -ATOM 934 O GLU A 118 23.872 11.565 35.885 1.00 8.05 O -ATOM 935 CB GLU A 118 26.776 10.653 34.241 1.00 8.86 C -ATOM 936 CG GLU A 118 28.227 10.234 34.427 1.00 9.64 C -ATOM 937 CD GLU A 118 28.770 9.370 33.310 1.00 13.39 C -ATOM 938 OE1 GLU A 118 28.036 9.043 32.355 1.00 11.90 O -ATOM 939 OE2 GLU A 118 29.956 8.998 33.405 1.00 16.59 O -ATOM 940 N LEU A 119 24.732 12.884 34.269 1.00 7.57 N -ATOM 941 CA LEU A 119 23.467 13.513 33.917 1.00 6.94 C -ATOM 942 C LEU A 119 23.189 13.277 32.431 1.00 8.29 C -ATOM 943 O LEU A 119 24.070 13.506 31.593 1.00 8.23 O -ATOM 944 CB LEU A 119 23.556 15.023 34.184 1.00 7.83 C -ATOM 945 CG LEU A 119 22.417 15.972 33.810 1.00 9.54 C -ATOM 946 CD1 LEU A 119 21.213 15.661 34.618 1.00 11.05 C -ATOM 947 CD2 LEU A 119 22.822 17.421 34.066 1.00 12.54 C -ATOM 948 N ILE A 120 22.010 12.743 32.119 1.00 6.17 N -ATOM 949 CA ILE A 120 21.638 12.529 30.730 1.00 6.22 C -ATOM 950 C ILE A 120 20.527 13.511 30.354 1.00 7.47 C -ATOM 951 O ILE A 120 19.493 13.580 31.036 1.00 6.54 O -ATOM 952 CB ILE A 120 21.103 11.118 30.485 1.00 7.19 C -ATOM 953 CG1 ILE A 120 22.171 10.070 30.801 1.00 8.26 C -ATOM 954 CG2 ILE A 120 20.556 11.003 29.047 1.00 6.54 C -ATOM 955 CD1 ILE A 120 21.668 8.658 30.600 1.00 9.35 C -ATOM 956 N LEU A 121 20.771 14.301 29.306 1.00 6.41 N -ATOM 957 CA LEU A 121 19.783 15.236 28.779 1.00 6.25 C -ATOM 958 C LEU A 121 19.299 14.693 27.426 1.00 7.41 C -ATOM 959 O LEU A 121 20.115 14.242 26.619 1.00 6.01 O -ATOM 960 CB LEU A 121 20.400 16.624 28.526 1.00 7.37 C -ATOM 961 CG LEU A 121 19.607 17.580 27.597 1.00 7.96 C -ATOM 962 CD1 LEU A 121 18.340 18.117 28.290 1.00 7.91 C -ATOM 963 CD2 LEU A 121 20.501 18.739 27.151 1.00 7.96 C -ATOM 964 N THR A 122 17.988 14.607 27.222 1.00 6.71 N -ATOM 965 CA THR A 122 17.514 14.205 25.898 1.00 7.80 C -ATOM 966 C THR A 122 16.633 15.334 25.402 1.00 8.58 C -ATOM 967 O THR A 122 15.988 16.034 26.194 1.00 7.21 O -ATOM 968 CB THR A 122 16.754 12.843 25.832 1.00 7.51 C -ATOM 969 OG1 THR A 122 15.422 12.992 26.313 1.00 9.27 O -ATOM 970 CG2 THR A 122 17.484 11.759 26.622 1.00 7.86 C -ATOM 971 N MET A 123 16.732 15.613 24.110 1.00 7.87 N -ATOM 972 CA MET A 123 15.904 16.643 23.494 1.00 9.22 C -ATOM 973 C MET A 123 15.194 15.950 22.337 1.00 8.66 C -ATOM 974 O MET A 123 15.828 15.189 21.601 1.00 8.09 O -ATOM 975 CB MET A 123 16.760 17.818 23.019 1.00 9.37 C -ATOM 976 CG MET A 123 17.359 18.612 24.171 1.00 11.81 C -ATOM 977 SD MET A 123 18.325 20.048 23.658 1.00 16.59 S -ATOM 978 CE MET A 123 19.871 19.278 23.173 1.00 14.10 C -ATOM 979 N THR A 124 13.895 16.195 22.186 1.00 7.20 N -ATOM 980 CA THR A 124 13.133 15.534 21.134 1.00 9.54 C -ATOM 981 C THR A 124 12.407 16.513 20.222 1.00 10.12 C -ATOM 982 O THR A 124 11.941 17.563 20.665 1.00 9.54 O -ATOM 983 CB THR A 124 12.073 14.552 21.756 1.00 10.74 C -ATOM 984 OG1 THR A 124 12.740 13.544 22.535 1.00 11.99 O -ATOM 985 CG2 THR A 124 11.247 13.865 20.679 1.00 11.66 C -ATOM 986 N ALA A 125 12.346 16.167 18.935 1.00 11.06 N -ATOM 987 CA ALA A 125 11.634 16.962 17.923 1.00 11.63 C -ATOM 988 C ALA A 125 10.981 15.878 17.078 1.00 13.46 C -ATOM 989 O ALA A 125 11.669 15.144 16.352 1.00 13.11 O -ATOM 990 CB ALA A 125 12.603 17.786 17.091 1.00 13.16 C -ATOM 991 N ASP A 126 9.664 15.754 17.216 1.00 14.63 N -ATOM 992 CA ASP A 126 8.901 14.721 16.536 1.00 17.86 C -ATOM 993 C ASP A 126 9.512 13.364 16.905 1.00 18.66 C -ATOM 994 O ASP A 126 9.519 13.006 18.080 1.00 19.38 O -ATOM 995 CB ASP A 126 8.835 14.982 15.023 1.00 18.40 C -ATOM 996 CG ASP A 126 7.786 16.032 14.660 1.00 22.34 C -ATOM 997 OD1 ASP A 126 6.800 16.198 15.422 1.00 23.23 O -ATOM 998 OD2 ASP A 126 7.940 16.702 13.621 1.00 24.32 O -ATOM 999 N ASP A 127 10.064 12.629 15.945 1.00 20.19 N -ATOM 1000 CA ASP A 127 10.656 11.333 16.271 1.00 21.56 C -ATOM 1001 C ASP A 127 12.175 11.279 16.416 1.00 18.85 C -ATOM 1002 O ASP A 127 12.732 10.219 16.657 1.00 20.67 O -ATOM 1003 CB ASP A 127 10.178 10.263 15.303 1.00 26.47 C -ATOM 1004 CG ASP A 127 9.043 9.450 15.880 1.00 33.21 C -ATOM 1005 OD1 ASP A 127 7.892 9.959 15.934 1.00 36.08 O -ATOM 1006 OD2 ASP A 127 9.318 8.308 16.318 1.00 38.35 O -ATOM 1007 N VAL A 128 12.836 12.418 16.281 1.00 15.22 N -ATOM 1008 CA VAL A 128 14.286 12.486 16.407 1.00 12.83 C -ATOM 1009 C VAL A 128 14.681 12.843 17.835 1.00 11.58 C -ATOM 1010 O VAL A 128 14.176 13.811 18.408 1.00 9.74 O -ATOM 1011 CB VAL A 128 14.864 13.503 15.423 1.00 12.79 C -ATOM 1012 CG1 VAL A 128 16.338 13.757 15.706 1.00 12.93 C -ATOM 1013 CG2 VAL A 128 14.677 12.968 14.005 1.00 14.30 C -ATOM 1014 N VAL A 129 15.586 12.051 18.397 1.00 9.29 N -ATOM 1015 CA VAL A 129 16.054 12.257 19.761 1.00 7.95 C -ATOM 1016 C VAL A 129 17.558 12.546 19.842 1.00 7.49 C -ATOM 1017 O VAL A 129 18.374 11.816 19.276 1.00 8.73 O -ATOM 1018 CB VAL A 129 15.764 11.007 20.617 1.00 9.43 C -ATOM 1019 CG1 VAL A 129 16.153 11.253 22.076 1.00 9.09 C -ATOM 1020 CG2 VAL A 129 14.293 10.610 20.495 1.00 9.45 C -ATOM 1021 N CYS A 130 17.912 13.630 20.534 1.00 7.54 N -ATOM 1022 CA CYS A 130 19.305 14.010 20.756 1.00 6.47 C -ATOM 1023 C CYS A 130 19.670 13.627 22.200 1.00 6.61 C -ATOM 1024 O CYS A 130 18.955 13.992 23.135 1.00 7.53 O -ATOM 1025 CB CYS A 130 19.485 15.517 20.544 1.00 6.05 C -ATOM 1026 SG CYS A 130 21.063 16.183 21.077 1.00 8.82 S -ATOM 1027 N THR A 131 20.786 12.925 22.372 1.00 6.58 N -ATOM 1028 CA THR A 131 21.241 12.462 23.693 1.00 5.93 C -ATOM 1029 C THR A 131 22.569 13.102 24.054 1.00 6.18 C -ATOM 1030 O THR A 131 23.528 13.003 23.294 1.00 5.77 O -ATOM 1031 CB THR A 131 21.419 10.914 23.699 1.00 6.63 C -ATOM 1032 OG1 THR A 131 20.199 10.299 23.289 1.00 7.60 O -ATOM 1033 CG2 THR A 131 21.763 10.399 25.091 1.00 7.76 C -ATOM 1034 N ARG A 132 22.624 13.780 25.202 1.00 6.29 N -ATOM 1035 CA ARG A 132 23.853 14.429 25.660 1.00 7.67 C -ATOM 1036 C ARG A 132 24.108 13.960 27.093 1.00 7.19 C -ATOM 1037 O ARG A 132 23.184 13.895 27.902 1.00 8.65 O -ATOM 1038 CB ARG A 132 23.719 15.957 25.621 1.00 9.67 C -ATOM 1039 CG ARG A 132 22.945 16.470 24.429 1.00 15.02 C -ATOM 1040 CD ARG A 132 23.781 17.260 23.476 1.00 16.80 C -ATOM 1041 NE ARG A 132 24.140 18.580 23.984 1.00 12.48 N -ATOM 1042 CZ ARG A 132 25.030 19.377 23.395 1.00 12.93 C -ATOM 1043 NH1 ARG A 132 25.641 19.005 22.279 1.00 13.84 N -ATOM 1044 NH2 ARG A 132 25.398 20.506 23.973 1.00 11.57 N -ATOM 1045 N VAL A 133 25.359 13.633 27.397 1.00 5.99 N -ATOM 1046 CA VAL A 133 25.739 13.124 28.719 1.00 5.92 C -ATOM 1047 C VAL A 133 26.773 14.055 29.345 1.00 5.85 C -ATOM 1048 O VAL A 133 27.713 14.492 28.681 1.00 5.50 O -ATOM 1049 CB VAL A 133 26.333 11.698 28.608 1.00 6.37 C -ATOM 1050 CG1 VAL A 133 26.609 11.120 29.988 1.00 7.95 C -ATOM 1051 CG2 VAL A 133 25.385 10.782 27.832 1.00 6.46 C -ATOM 1052 N TYR A 134 26.619 14.337 30.635 1.00 5.35 N -ATOM 1053 CA TYR A 134 27.538 15.228 31.322 1.00 4.57 C -ATOM 1054 C TYR A 134 28.014 14.611 32.617 1.00 5.30 C -ATOM 1055 O TYR A 134 27.371 13.712 33.165 1.00 3.92 O -ATOM 1056 CB TYR A 134 26.846 16.550 31.686 1.00 6.84 C -ATOM 1057 CG TYR A 134 26.118 17.251 30.574 1.00 8.89 C -ATOM 1058 CD1 TYR A 134 24.901 16.762 30.122 1.00 10.29 C -ATOM 1059 CD2 TYR A 134 26.628 18.406 29.992 1.00 10.49 C -ATOM 1060 CE1 TYR A 134 24.212 17.386 29.133 1.00 13.03 C -ATOM 1061 CE2 TYR A 134 25.930 19.051 28.982 1.00 12.15 C -ATOM 1062 CZ TYR A 134 24.723 18.517 28.567 1.00 12.80 C -ATOM 1063 OH TYR A 134 23.991 19.082 27.567 1.00 18.07 O -ATOM 1064 N VAL A 135 29.113 15.158 33.119 1.00 6.63 N -ATOM 1065 CA VAL A 135 29.697 14.762 34.394 1.00 8.42 C -ATOM 1066 C VAL A 135 30.100 16.086 35.064 1.00 9.05 C -ATOM 1067 O VAL A 135 30.340 17.086 34.385 1.00 9.02 O -ATOM 1068 CB VAL A 135 30.925 13.815 34.204 1.00 8.05 C -ATOM 1069 CG1 VAL A 135 32.109 14.556 33.596 1.00 9.27 C -ATOM 1070 CG2 VAL A 135 31.304 13.151 35.533 1.00 10.37 C -ATOM 1071 N ARG A 136 30.117 16.133 36.390 1.00 9.57 N -ATOM 1072 CA ARG A 136 30.498 17.375 37.040 1.00 10.86 C -ATOM 1073 C ARG A 136 31.964 17.676 36.776 1.00 11.68 C -ATOM 1074 O ARG A 136 32.782 16.765 36.686 1.00 11.35 O -ATOM 1075 CB ARG A 136 30.221 17.319 38.536 1.00 11.99 C -ATOM 1076 CG ARG A 136 28.746 17.454 38.885 1.00 13.89 C -ATOM 1077 CD ARG A 136 28.576 17.533 40.382 1.00 15.85 C -ATOM 1078 NE ARG A 136 27.185 17.407 40.754 1.00 17.08 N -ATOM 1079 CZ ARG A 136 26.561 16.245 40.926 1.00 21.69 C -ATOM 1080 NH1 ARG A 136 27.217 15.102 40.754 1.00 23.26 N -ATOM 1081 NH2 ARG A 136 25.278 16.227 41.283 1.00 22.60 N -ATOM 1082 N GLU A 137 32.282 18.963 36.663 1.00 15.12 N -ATOM 1083 CA GLU A 137 33.641 19.430 36.400 1.00 18.00 C -ATOM 1084 C GLU A 137 34.615 19.038 37.493 1.00 18.96 C -ATOM 1085 O GLU A 137 34.221 19.175 38.659 1.00 17.37 O -ATOM 1086 CB GLU A 137 33.661 20.943 36.293 1.00 19.89 C -ATOM 1087 CG GLU A 137 33.092 21.492 35.035 1.00 28.03 C -ATOM 1088 CD GLU A 137 33.469 22.953 34.865 1.00 33.22 C -ATOM 1089 OE1 GLU A 137 34.630 23.217 34.473 1.00 37.31 O -ATOM 1090 OE2 GLU A 137 32.636 23.836 35.164 1.00 36.38 O -ATOM 1091 OXT GLU A 137 35.776 18.680 37.173 1.00 22.23 O -TER 1092 GLU A 137 -HETATM 1093 C1 REA A 200 21.972 29.831 16.739 1.00 15.25 C -HETATM 1094 C2 REA A 200 20.921 30.524 15.841 1.00 15.61 C -HETATM 1095 C3 REA A 200 20.245 29.635 14.848 1.00 16.19 C -HETATM 1096 C4 REA A 200 19.555 28.479 15.488 1.00 14.59 C -HETATM 1097 C5 REA A 200 20.389 27.812 16.587 1.00 14.10 C -HETATM 1098 C6 REA A 200 21.425 28.446 17.218 1.00 14.42 C -HETATM 1099 C7 REA A 200 22.242 27.851 18.297 1.00 13.89 C -HETATM 1100 C8 REA A 200 21.868 26.977 19.240 1.00 11.86 C -HETATM 1101 C9 REA A 200 22.705 26.434 20.286 1.00 10.87 C -HETATM 1102 C10 REA A 200 22.159 25.536 21.131 1.00 9.19 C -HETATM 1103 C11 REA A 200 22.875 24.924 22.234 1.00 10.35 C -HETATM 1104 C12 REA A 200 22.237 24.026 22.990 1.00 10.53 C -HETATM 1105 C13 REA A 200 22.856 23.377 24.125 1.00 10.91 C -HETATM 1106 C14 REA A 200 22.135 22.473 24.834 1.00 11.88 C -HETATM 1107 C15 REA A 200 22.563 21.710 26.016 1.00 14.86 C -HETATM 1108 C16 REA A 200 22.238 30.737 17.948 1.00 15.47 C -HETATM 1109 C17 REA A 200 23.292 29.620 15.948 1.00 13.42 C -HETATM 1110 C18 REA A 200 19.791 26.449 16.947 1.00 12.61 C -HETATM 1111 C19 REA A 200 24.181 26.841 20.385 1.00 10.08 C -HETATM 1112 C20 REA A 200 24.303 23.747 24.489 1.00 10.10 C -HETATM 1113 O1 REA A 200 23.640 21.075 25.978 1.00 13.29 O -HETATM 1114 O2 REA A 200 21.840 21.712 27.037 1.00 10.99 O -HETATM 1115 O HOH A 300 21.817 19.604 31.169 1.00 17.43 O -HETATM 1116 O HOH A 301 7.617 26.892 37.107 1.00 12.66 O -HETATM 1117 O HOH A 302 22.885 27.835 25.056 1.00 18.86 O -HETATM 1118 O HOH A 303 30.685 27.402 22.818 1.00 14.12 O -HETATM 1119 O HOH A 304 29.930 20.839 40.398 1.00 16.48 O -HETATM 1120 O HOH A 305 31.492 21.096 28.452 1.00 16.65 O -HETATM 1121 O HOH A 306 19.459 26.601 30.320 1.00 9.81 O -HETATM 1122 O HOH A 307 19.116 26.759 22.930 1.00 22.33 O -HETATM 1123 O HOH A 308 16.356 22.299 28.453 1.00 35.46 O -HETATM 1124 O HOH A 309 21.823 21.939 29.734 1.00 13.95 O -HETATM 1125 O HOH A 310 13.206 22.267 22.102 1.00 20.07 O -HETATM 1126 O HOH A 311 30.300 22.803 12.740 1.00 24.70 O -HETATM 1127 O HOH A 312 7.344 23.059 35.600 1.00 8.82 O -HETATM 1128 O HOH A 313 6.876 22.668 20.375 1.00 29.74 O -HETATM 1129 O HOH A 314 17.917 24.800 29.159 1.00 23.69 O -HETATM 1130 O HOH A 315 37.101 16.714 38.714 1.00 19.84 O -HETATM 1131 O HOH A 316 28.721 7.425 30.043 1.00 14.94 O -HETATM 1132 O HOH A 317 13.212 14.450 25.193 1.00 18.03 O -HETATM 1133 O HOH A 318 6.094 9.777 39.151 1.00 13.98 O -HETATM 1134 O HOH A 319 19.296 10.379 13.144 1.00 27.20 O -HETATM 1135 O HOH A 320 25.337 10.931 16.577 1.00 18.41 O -HETATM 1136 O HOH A 321 25.244 34.269 18.193 1.00 9.65 O -HETATM 1137 O HOH A 322 23.567 10.727 14.429 1.00 11.13 O -HETATM 1138 O HOH A 323 17.151 12.178 30.238 1.00 11.53 O -HETATM 1139 O HOH A 324 27.768 11.967 42.077 1.00 23.33 O -HETATM 1140 O HOH A 325 30.270 12.554 21.386 1.00 25.05 O -HETATM 1141 O HOH A 326 25.662 15.488 18.515 1.00 10.80 O -HETATM 1142 O HOH A 327 4.514 21.426 18.685 1.00 45.94 O -HETATM 1143 O HOH A 328 8.081 23.201 17.690 1.00 30.16 O -HETATM 1144 O HOH A 329 13.242 29.389 14.924 1.00 39.93 O -HETATM 1145 O HOH A 330 10.514 18.772 10.176 1.00 33.65 O -HETATM 1146 O HOH A 331 10.555 13.666 26.313 1.00 32.55 O -HETATM 1147 O HOH A 332 5.189 16.418 31.375 1.00 35.78 O -HETATM 1148 O HOH A 333 0.738 25.633 36.349 1.00 29.00 O -HETATM 1149 O HOH A 334 2.976 28.966 37.321 1.00 40.14 O -HETATM 1150 O HOH A 335 6.424 28.750 38.849 1.00 32.17 O -HETATM 1151 O HOH A 336 12.503 30.488 31.704 1.00 41.11 O -HETATM 1152 O HOH A 337 14.979 30.157 27.559 1.00 23.78 O -HETATM 1153 O HOH A 338 17.312 32.981 28.812 1.00 20.84 O -HETATM 1154 O HOH A 339 29.473 25.946 34.693 1.00 29.05 O -HETATM 1155 O HOH A 340 30.328 23.817 33.494 1.00 24.17 O -HETATM 1156 O HOH A 341 31.158 28.144 26.433 1.00 42.66 O -HETATM 1157 O HOH A 342 30.276 28.397 16.400 1.00 21.90 O -HETATM 1158 O HOH A 343 19.533 23.600 26.857 1.00 21.12 O -HETATM 1159 O HOH A 344 17.892 24.675 24.549 1.00 48.11 O -HETATM 1160 O HOH A 345 14.211 24.152 25.435 1.00 21.09 O -HETATM 1161 O HOH A 346 15.223 27.626 27.056 1.00 27.16 O -HETATM 1162 O HOH A 347 3.502 22.911 43.083 1.00 30.15 O -HETATM 1163 O HOH A 348 20.610 7.668 40.212 1.00 49.06 O -HETATM 1164 O HOH A 349 24.813 2.899 36.403 1.00 48.98 O -HETATM 1165 O HOH A 350 29.900 5.163 26.918 1.00 23.60 O -HETATM 1166 O HOH A 351 14.333 5.466 42.757 1.00 22.90 O -HETATM 1167 O HOH A 352 8.914 5.771 35.515 1.00 35.92 O -HETATM 1168 O HOH A 353 14.519 28.906 40.193 1.00 28.73 O -HETATM 1169 O HOH A 354 17.573 20.203 47.080 1.00 37.63 O -HETATM 1170 O HOH A 355 13.324 32.251 34.152 1.00 47.79 O -HETATM 1171 O HOH A 356 12.491 24.840 7.594 1.00 39.45 O -HETATM 1172 O HOH A 357 25.066 15.777 15.214 1.00 27.39 O -HETATM 1173 O HOH A 358 27.138 17.638 17.834 1.00 45.12 O -HETATM 1174 O HOH A 359 27.611 19.792 19.503 1.00 24.45 O -HETATM 1175 O HOH A 360 11.358 8.880 19.119 1.00 24.31 O -HETATM 1176 O HOH A 361 16.252 27.169 24.557 1.00 25.40 O -HETATM 1177 O HOH A 362 22.049 27.870 4.565 1.00 25.37 O -HETATM 1178 O HOH A 363 11.533 6.689 34.501 1.00 29.92 O -HETATM 1179 O HOH A 364 13.269 4.551 36.338 1.00 45.75 O -HETATM 1180 O HOH A 365 23.149 9.493 41.173 1.00 30.10 O -HETATM 1181 O HOH A 366 21.090 12.171 43.973 1.00 27.97 O -HETATM 1182 O HOH A 367 11.884 13.399 42.560 1.00 23.28 O -HETATM 1183 O HOH A 368 29.542 17.520 20.025 1.00 38.32 O -HETATM 1184 O HOH A 369 31.058 17.427 22.538 1.00 37.85 O -HETATM 1185 O HOH A 370 31.928 9.444 23.294 1.00 46.07 O -HETATM 1186 O HOH A 371 25.699 10.933 9.557 1.00 44.12 O -HETATM 1187 O HOH A 372 26.533 13.428 16.334 1.00 45.21 O -HETATM 1188 O HOH A 373 27.078 16.850 13.245 1.00 39.52 O -HETATM 1189 O HOH A 374 20.596 32.070 6.807 1.00 36.38 O -HETATM 1190 O HOH A 375 17.126 28.421 9.515 1.00 23.81 O -HETATM 1191 O HOH A 376 16.626 32.383 11.231 1.00 20.11 O -HETATM 1192 O HOH A 377 6.046 30.510 19.639 1.00 29.02 O -HETATM 1193 O HOH A 378 9.543 16.072 11.145 1.00 50.91 O -HETATM 1194 O HOH A 379 8.174 14.289 20.240 1.00 54.21 O -HETATM 1195 O HOH A 380 11.561 10.834 22.873 1.00 43.23 O -HETATM 1196 O HOH A 381 5.486 15.385 24.922 1.00 50.19 O -HETATM 1197 O HOH A 382 6.038 21.424 43.276 1.00 46.64 O -HETATM 1198 O HOH A 383 34.144 19.165 27.284 1.00 41.41 O -HETATM 1199 O HOH A 384 16.916 27.142 42.621 1.00 29.32 O -HETATM 1200 O HOH A 385 25.509 24.918 41.520 1.00 32.12 O -HETATM 1201 O HOH A 386 31.446 7.504 31.389 1.00 28.93 O -HETATM 1202 O HOH A 387 18.212 20.893 5.892 1.00 29.90 O -HETATM 1203 O HOH A 388 15.148 27.608 7.685 1.00 30.91 O -HETATM 1204 O HOH A 389 2.656 23.148 20.117 1.00 35.98 O -HETATM 1205 O HOH A 390 3.100 22.690 28.640 1.00 31.31 O -HETATM 1206 O HOH A 391 13.699 19.720 21.819 1.00 26.56 O -HETATM 1207 O HOH A 392 26.833 28.283 32.272 1.00 31.48 O -HETATM 1208 O HOH A 393 20.458 26.214 25.811 1.00 24.39 O -HETATM 1209 O HOH A 394 32.304 27.731 18.152 1.00 41.66 O -HETATM 1210 O HOH A 395 24.283 13.868 42.687 1.00 35.59 O -HETATM 1211 O HOH A 396 11.833 12.657 45.160 1.00 38.30 O -HETATM 1212 O HOH A 397 1.988 27.992 43.589 1.00 33.97 O -HETATM 1213 O HOH A 398 32.913 22.982 40.176 1.00 39.26 O -HETATM 1214 O HOH A 399 32.435 20.043 40.169 1.00 33.87 O -CONECT 1093 1094 1098 1108 1109 -CONECT 1094 1093 1095 -CONECT 1095 1094 1096 -CONECT 1096 1095 1097 -CONECT 1097 1096 1098 1110 -CONECT 1098 1093 1097 1099 -CONECT 1099 1098 1100 -CONECT 1100 1099 1101 -CONECT 1101 1100 1102 1111 -CONECT 1102 1101 1103 -CONECT 1103 1102 1104 -CONECT 1104 1103 1105 -CONECT 1105 1104 1106 1112 -CONECT 1106 1105 1107 -CONECT 1107 1106 1113 1114 -CONECT 1108 1093 -CONECT 1109 1093 -CONECT 1110 1097 -CONECT 1111 1101 -CONECT 1112 1105 -CONECT 1113 1107 -CONECT 1114 1107 -MASTER 264 0 1 2 10 0 3 6 1213 1 22 11 -END diff --git a/java/examples/Demos/Graphics/Ribbons/data/2POR.pdb b/java/examples/Demos/Graphics/Ribbons/data/2POR.pdb deleted file mode 100644 index 67a93b82e..000000000 --- a/java/examples/Demos/Graphics/Ribbons/data/2POR.pdb +++ /dev/null @@ -1,3257 +0,0 @@ -HEADER INTEGRAL MEMBRANE PROTEIN PORIN 24-APR-92 2POR -TITLE STRUCTURE OF PORIN REFINED AT 1.8 ANGSTROMS RESOLUTION -COMPND MOL_ID: 1; -COMPND 2 MOLECULE: PORIN; -COMPND 3 CHAIN: A; -COMPND 4 ENGINEERED: YES -SOURCE MOL_ID: 1; -SOURCE 2 ORGANISM_SCIENTIFIC: RHODOBACTER CAPSULATUS; -SOURCE 3 ORGANISM_TAXID: 1061 -KEYWDS INTEGRAL MEMBRANE PROTEIN PORIN -EXPDTA X-RAY DIFFRACTION -AUTHOR M.S.WEISS,G.E.SCHULZ -REVDAT 3 24-FEB-09 2POR 1 VERSN -REVDAT 2 01-APR-03 2POR 1 JRNL -REVDAT 1 15-JUL-93 2POR 0 -JRNL AUTH M.S.WEISS,G.E.SCHULZ -JRNL TITL STRUCTURE OF PORIN REFINED AT 1.8 A RESOLUTION. -JRNL REF J.MOL.BIOL. V. 227 493 1992 -JRNL REFN ISSN 0022-2836 -JRNL PMID 1328651 -JRNL DOI 10.1016/0022-2836(92)90903-W -REMARK 1 -REMARK 1 REFERENCE 1 -REMARK 1 AUTH M.S.WEISS,U.ABELE,J.WECKESSER,W.WELTE,E.SCHILTZ, -REMARK 1 AUTH 2 G.E.SCHULZ -REMARK 1 TITL MOLECULAR ARCHITECTURE AND ELECTROSTATIC -REMARK 1 TITL 2 PROPERTIES OF A BACTERIAL PORIN -REMARK 1 REF SCIENCE V. 254 1627 1991 -REMARK 1 REFN ISSN 0036-8075 -REMARK 1 REFERENCE 2 -REMARK 1 AUTH E.SCHILTZ,A.KREUSCH,U.NESTEL,G.E.SCHULZ -REMARK 1 TITL PRIMARY STRUCTURE OF PORIN FROM RHODOBACTER -REMARK 1 TITL 2 CAPSULATUS -REMARK 1 REF EUR.J.BIOCHEM. V. 199 587 1991 -REMARK 1 REFN ISSN 0014-2956 -REMARK 1 REFERENCE 3 -REMARK 1 AUTH M.S.WEISS,A.KREUSCH,E.SCHILTZ,U.NESTEL,W.WELTE, -REMARK 1 AUTH 2 J.WECKESSER,G.E.SCHULZ -REMARK 1 TITL THE STRUCTURE OF PORIN FROM RHODOBACTER CAPSULATUS -REMARK 1 TITL 2 AT 1.8 ANGSTROMS RESOLUTION -REMARK 1 REF FEBS LETT. V. 280 379 1991 -REMARK 1 REFN ISSN 0014-5793 -REMARK 1 REFERENCE 4 -REMARK 1 AUTH A.KREUSCH,M.S.WEISS,W.WELTE,J.WECKESSER,G.E.SCHULZ -REMARK 1 TITL CRYSTALS OF AN INTEGRAL MEMBRANE PROTEIN -REMARK 1 TITL 2 DIFFRACTING TO 1.8 ANGSTROMS RESOLUTION -REMARK 1 REF J.MOL.BIOL. V. 217 9 1991 -REMARK 1 REFN ISSN 0022-2836 -REMARK 1 REFERENCE 5 -REMARK 1 AUTH M.S.WEISS,T.WACKER,J.WECKESSER,W.WELTE,G.E.SCHULZ -REMARK 1 TITL THE THREE-DIMENSIONAL STRUCTURE OF PORIN FROM -REMARK 1 TITL 2 RHODOBACTER CAPSULATUS AT 3 ANGSTROMS RESOLUTION -REMARK 1 REF FEBS LETT. V. 267 268 1990 -REMARK 1 REFN ISSN 0014-5793 -REMARK 1 REFERENCE 6 -REMARK 1 AUTH M.S.WEISS,T.WACKER,U.NESTEL,D.WOITZIK,J.WECKESSER, -REMARK 1 AUTH 2 W.KREUTZ,W.WELTE,G.E.SCHULZ -REMARK 1 TITL THE STRUCTURE OF PORIN FROM RHODOBACTER CAPSULATUS -REMARK 1 TITL 2 AT 0.6 NM RESOLUTION -REMARK 1 REF FEBS LETT. V. 256 143 1989 -REMARK 1 REFN ISSN 0014-5793 -REMARK 1 REFERENCE 7 -REMARK 1 AUTH U.NESTEL,T.WACKER,D.WOITZIK,J.WECKESSER,W.KREUTZ, -REMARK 1 AUTH 2 W.WELTE -REMARK 1 TITL CRYSTALLIZATION AND PRELIMINARY X-RAY ANALYSIS OF -REMARK 1 TITL 2 PORIN FROM RHODOBACTER CAPSULATUS -REMARK 1 REF FEBS LETT. V. 242 405 1989 -REMARK 1 REFN ISSN 0014-5793 -REMARK 2 -REMARK 2 RESOLUTION. 1.80 ANGSTROMS. -REMARK 3 -REMARK 3 REFINEMENT. -REMARK 3 PROGRAM : X-PLOR -REMARK 3 AUTHORS : BRUNGER -REMARK 3 -REMARK 3 DATA USED IN REFINEMENT. -REMARK 3 RESOLUTION RANGE HIGH (ANGSTROMS) : 1.80 -REMARK 3 RESOLUTION RANGE LOW (ANGSTROMS) : 10.00 -REMARK 3 DATA CUTOFF (SIGMA(F)) : NULL -REMARK 3 DATA CUTOFF HIGH (ABS(F)) : NULL -REMARK 3 DATA CUTOFF LOW (ABS(F)) : NULL -REMARK 3 COMPLETENESS (WORKING+TEST) (%) : NULL -REMARK 3 NUMBER OF REFLECTIONS : 42851 -REMARK 3 -REMARK 3 FIT TO DATA USED IN REFINEMENT. -REMARK 3 CROSS-VALIDATION METHOD : NULL -REMARK 3 FREE R VALUE TEST SET SELECTION : NULL -REMARK 3 R VALUE (WORKING SET) : 0.186 -REMARK 3 FREE R VALUE : NULL -REMARK 3 FREE R VALUE TEST SET SIZE (%) : NULL -REMARK 3 FREE R VALUE TEST SET COUNT : NULL -REMARK 3 ESTIMATED ERROR OF FREE R VALUE : NULL -REMARK 3 -REMARK 3 FIT IN THE HIGHEST RESOLUTION BIN. -REMARK 3 TOTAL NUMBER OF BINS USED : NULL -REMARK 3 BIN RESOLUTION RANGE HIGH (A) : NULL -REMARK 3 BIN RESOLUTION RANGE LOW (A) : NULL -REMARK 3 BIN COMPLETENESS (WORKING+TEST) (%) : NULL -REMARK 3 REFLECTIONS IN BIN (WORKING SET) : NULL -REMARK 3 BIN R VALUE (WORKING SET) : NULL -REMARK 3 BIN FREE R VALUE : NULL -REMARK 3 BIN FREE R VALUE TEST SET SIZE (%) : NULL -REMARK 3 BIN FREE R VALUE TEST SET COUNT : NULL -REMARK 3 ESTIMATED ERROR OF BIN FREE R VALUE : NULL -REMARK 3 -REMARK 3 NUMBER OF NON-HYDROGEN ATOMS USED IN REFINEMENT. -REMARK 3 PROTEIN ATOMS : 2228 -REMARK 3 NUCLEIC ACID ATOMS : 0 -REMARK 3 HETEROGEN ATOMS : 87 -REMARK 3 SOLVENT ATOMS : 274 -REMARK 3 -REMARK 3 B VALUES. -REMARK 3 FROM WILSON PLOT (A**2) : NULL -REMARK 3 MEAN B VALUE (OVERALL, A**2) : NULL -REMARK 3 OVERALL ANISOTROPIC B VALUE. -REMARK 3 B11 (A**2) : NULL -REMARK 3 B22 (A**2) : NULL -REMARK 3 B33 (A**2) : NULL -REMARK 3 B12 (A**2) : NULL -REMARK 3 B13 (A**2) : NULL -REMARK 3 B23 (A**2) : NULL -REMARK 3 -REMARK 3 ESTIMATED COORDINATE ERROR. -REMARK 3 ESD FROM LUZZATI PLOT (A) : NULL -REMARK 3 ESD FROM SIGMAA (A) : NULL -REMARK 3 LOW RESOLUTION CUTOFF (A) : NULL -REMARK 3 -REMARK 3 CROSS-VALIDATED ESTIMATED COORDINATE ERROR. -REMARK 3 ESD FROM C-V LUZZATI PLOT (A) : NULL -REMARK 3 ESD FROM C-V SIGMAA (A) : NULL -REMARK 3 -REMARK 3 RMS DEVIATIONS FROM IDEAL VALUES. -REMARK 3 BOND LENGTHS (A) : 0.015 -REMARK 3 BOND ANGLES (DEGREES) : 2.80 -REMARK 3 DIHEDRAL ANGLES (DEGREES) : NULL -REMARK 3 IMPROPER ANGLES (DEGREES) : NULL -REMARK 3 -REMARK 3 ISOTROPIC THERMAL MODEL : NULL -REMARK 3 -REMARK 3 ISOTROPIC THERMAL FACTOR RESTRAINTS. RMS SIGMA -REMARK 3 MAIN-CHAIN BOND (A**2) : NULL ; NULL -REMARK 3 MAIN-CHAIN ANGLE (A**2) : NULL ; NULL -REMARK 3 SIDE-CHAIN BOND (A**2) : NULL ; NULL -REMARK 3 SIDE-CHAIN ANGLE (A**2) : NULL ; NULL -REMARK 3 -REMARK 3 NCS MODEL : NULL -REMARK 3 -REMARK 3 NCS RESTRAINTS. RMS SIGMA/WEIGHT -REMARK 3 GROUP 1 POSITIONAL (A) : NULL ; NULL -REMARK 3 GROUP 1 B-FACTOR (A**2) : NULL ; NULL -REMARK 3 -REMARK 3 PARAMETER FILE 1 : NULL -REMARK 3 TOPOLOGY FILE 1 : NULL -REMARK 3 -REMARK 3 OTHER REFINEMENT REMARKS: THE CRYSTALS HAVE FORM *B* AS -REMARK 3 DESCRIBED IN THE *JRNL* REFERENCE. RESIDUE 545 HAS NOT BEEN -REMARK 3 UNAMBIGUOUSLY IDENTIFIED. IT HAS BEEN MODELED AS A DETERGENT N -REMARK 3 -OCTYLTETRAOXYETHYLENE -REMARK 4 -REMARK 4 2POR COMPLIES WITH FORMAT V. 3.15, 01-DEC-08 -REMARK 100 -REMARK 100 THIS ENTRY HAS BEEN PROCESSED BY BNL. -REMARK 200 -REMARK 200 EXPERIMENTAL DETAILS -REMARK 200 EXPERIMENT TYPE : X-RAY DIFFRACTION -REMARK 200 DATE OF DATA COLLECTION : NULL -REMARK 200 TEMPERATURE (KELVIN) : NULL -REMARK 200 PH : NULL -REMARK 200 NUMBER OF CRYSTALS USED : NULL -REMARK 200 -REMARK 200 SYNCHROTRON (Y/N) : NULL -REMARK 200 RADIATION SOURCE : NULL -REMARK 200 BEAMLINE : NULL -REMARK 200 X-RAY GENERATOR MODEL : NULL -REMARK 200 MONOCHROMATIC OR LAUE (M/L) : NULL -REMARK 200 WAVELENGTH OR RANGE (A) : NULL -REMARK 200 MONOCHROMATOR : NULL -REMARK 200 OPTICS : NULL -REMARK 200 -REMARK 200 DETECTOR TYPE : NULL -REMARK 200 DETECTOR MANUFACTURER : NULL -REMARK 200 INTENSITY-INTEGRATION SOFTWARE : NULL -REMARK 200 DATA SCALING SOFTWARE : NULL -REMARK 200 -REMARK 200 NUMBER OF UNIQUE REFLECTIONS : NULL -REMARK 200 RESOLUTION RANGE HIGH (A) : NULL -REMARK 200 RESOLUTION RANGE LOW (A) : NULL -REMARK 200 REJECTION CRITERIA (SIGMA(I)) : NULL -REMARK 200 -REMARK 200 OVERALL. -REMARK 200 COMPLETENESS FOR RANGE (%) : NULL -REMARK 200 DATA REDUNDANCY : NULL -REMARK 200 R MERGE (I) : NULL -REMARK 200 R SYM (I) : NULL -REMARK 200 FOR THE DATA SET : NULL -REMARK 200 -REMARK 200 IN THE HIGHEST RESOLUTION SHELL. -REMARK 200 HIGHEST RESOLUTION SHELL, RANGE HIGH (A) : NULL -REMARK 200 HIGHEST RESOLUTION SHELL, RANGE LOW (A) : NULL -REMARK 200 COMPLETENESS FOR SHELL (%) : NULL -REMARK 200 DATA REDUNDANCY IN SHELL : NULL -REMARK 200 R MERGE FOR SHELL (I) : NULL -REMARK 200 R SYM FOR SHELL (I) : NULL -REMARK 200 FOR SHELL : NULL -REMARK 200 -REMARK 200 DIFFRACTION PROTOCOL: NULL -REMARK 200 METHOD USED TO DETERMINE THE STRUCTURE: NULL -REMARK 200 SOFTWARE USED: NULL -REMARK 200 STARTING MODEL: NULL -REMARK 200 -REMARK 200 REMARK: NULL -REMARK 280 -REMARK 280 CRYSTAL -REMARK 280 SOLVENT CONTENT, VS (%): 67.61 -REMARK 280 MATTHEWS COEFFICIENT, VM (ANGSTROMS**3/DA): 3.80 -REMARK 280 -REMARK 280 CRYSTALLIZATION CONDITIONS: NULL -REMARK 290 -REMARK 290 CRYSTALLOGRAPHIC SYMMETRY -REMARK 290 SYMMETRY OPERATORS FOR SPACE GROUP: H 3 -REMARK 290 -REMARK 290 SYMOP SYMMETRY -REMARK 290 NNNMMM OPERATOR -REMARK 290 1555 X,Y,Z -REMARK 290 2555 -Y,X-Y,Z -REMARK 290 3555 -X+Y,-X,Z -REMARK 290 4555 X+2/3,Y+1/3,Z+1/3 -REMARK 290 5555 -Y+2/3,X-Y+1/3,Z+1/3 -REMARK 290 6555 -X+Y+2/3,-X+1/3,Z+1/3 -REMARK 290 7555 X+1/3,Y+2/3,Z+2/3 -REMARK 290 8555 -Y+1/3,X-Y+2/3,Z+2/3 -REMARK 290 9555 -X+Y+1/3,-X+2/3,Z+2/3 -REMARK 290 -REMARK 290 WHERE NNN -> OPERATOR NUMBER -REMARK 290 MMM -> TRANSLATION VECTOR -REMARK 290 -REMARK 290 CRYSTALLOGRAPHIC SYMMETRY TRANSFORMATIONS -REMARK 290 THE FOLLOWING TRANSFORMATIONS OPERATE ON THE ATOM/HETATM -REMARK 290 RECORDS IN THIS ENTRY TO PRODUCE CRYSTALLOGRAPHICALLY -REMARK 290 RELATED MOLECULES. -REMARK 290 SMTRY1 1 1.000000 0.000000 0.000000 0.00000 -REMARK 290 SMTRY2 1 0.000000 1.000000 0.000000 0.00000 -REMARK 290 SMTRY3 1 0.000000 0.000000 1.000000 0.00000 -REMARK 290 SMTRY1 2 -0.500000 -0.866025 0.000000 0.00000 -REMARK 290 SMTRY2 2 0.866025 -0.500000 0.000000 0.00000 -REMARK 290 SMTRY3 2 0.000000 0.000000 1.000000 0.00000 -REMARK 290 SMTRY1 3 -0.500000 0.866025 0.000000 0.00000 -REMARK 290 SMTRY2 3 -0.866025 -0.500000 0.000000 0.00000 -REMARK 290 SMTRY3 3 0.000000 0.000000 1.000000 0.00000 -REMARK 290 SMTRY1 4 1.000000 0.000000 0.000000 46.15000 -REMARK 290 SMTRY2 4 0.000000 1.000000 0.000000 26.64471 -REMARK 290 SMTRY3 4 0.000000 0.000000 1.000000 48.73333 -REMARK 290 SMTRY1 5 -0.500000 -0.866025 0.000000 46.15000 -REMARK 290 SMTRY2 5 0.866025 -0.500000 0.000000 26.64471 -REMARK 290 SMTRY3 5 0.000000 0.000000 1.000000 48.73333 -REMARK 290 SMTRY1 6 -0.500000 0.866025 0.000000 46.15000 -REMARK 290 SMTRY2 6 -0.866025 -0.500000 0.000000 26.64471 -REMARK 290 SMTRY3 6 0.000000 0.000000 1.000000 48.73333 -REMARK 290 SMTRY1 7 1.000000 0.000000 0.000000 0.00000 -REMARK 290 SMTRY2 7 0.000000 1.000000 0.000000 53.28943 -REMARK 290 SMTRY3 7 0.000000 0.000000 1.000000 97.46667 -REMARK 290 SMTRY1 8 -0.500000 -0.866025 0.000000 0.00000 -REMARK 290 SMTRY2 8 0.866025 -0.500000 0.000000 53.28943 -REMARK 290 SMTRY3 8 0.000000 0.000000 1.000000 97.46667 -REMARK 290 SMTRY1 9 -0.500000 0.866025 0.000000 0.00000 -REMARK 290 SMTRY2 9 -0.866025 -0.500000 0.000000 53.28943 -REMARK 290 SMTRY3 9 0.000000 0.000000 1.000000 97.46667 -REMARK 290 -REMARK 290 REMARK: NULL -REMARK 300 -REMARK 300 BIOMOLECULE: 1 -REMARK 300 SEE REMARK 350 FOR THE AUTHOR PROVIDED AND/OR PROGRAM -REMARK 300 GENERATED ASSEMBLY INFORMATION FOR THE STRUCTURE IN -REMARK 300 THIS ENTRY. THE REMARK MAY ALSO PROVIDE INFORMATION ON -REMARK 300 BURIED SURFACE AREA. -REMARK 350 -REMARK 350 COORDINATES FOR A COMPLETE MULTIMER REPRESENTING THE KNOWN -REMARK 350 BIOLOGICALLY SIGNIFICANT OLIGOMERIZATION STATE OF THE -REMARK 350 MOLECULE CAN BE GENERATED BY APPLYING BIOMT TRANSFORMATIONS -REMARK 350 GIVEN BELOW. BOTH NON-CRYSTALLOGRAPHIC AND -REMARK 350 CRYSTALLOGRAPHIC OPERATIONS ARE GIVEN. -REMARK 350 -REMARK 350 BIOMOLECULE: 1 -REMARK 350 AUTHOR DETERMINED BIOLOGICAL UNIT: TRIMERIC -REMARK 350 APPLY THE FOLLOWING TO CHAINS: A -REMARK 350 BIOMT1 1 1.000000 0.000000 0.000000 0.00000 -REMARK 350 BIOMT2 1 0.000000 1.000000 0.000000 0.00000 -REMARK 350 BIOMT3 1 0.000000 0.000000 1.000000 0.00000 -REMARK 350 BIOMT1 2 -0.500000 -0.866025 0.000000 0.00000 -REMARK 350 BIOMT2 2 0.866025 -0.500000 0.000000 0.00000 -REMARK 350 BIOMT3 2 0.000000 0.000000 1.000000 0.00000 -REMARK 350 BIOMT1 3 -0.500000 0.866025 0.000000 0.00000 -REMARK 350 BIOMT2 3 -0.866025 -0.500000 0.000000 0.00000 -REMARK 350 BIOMT3 3 0.000000 0.000000 1.000000 0.00000 -REMARK 375 -REMARK 375 SPECIAL POSITION -REMARK 375 THE FOLLOWING ATOMS ARE FOUND TO BE WITHIN 0.15 ANGSTROMS -REMARK 375 OF A SYMMETRY RELATED ATOM AND ARE ASSUMED TO BE ON SPECIAL -REMARK 375 POSITIONS. -REMARK 375 -REMARK 375 ATOM RES CSSEQI -REMARK 375 HOH A 361 LIES ON A SPECIAL POSITION. -REMARK 500 -REMARK 500 GEOMETRY AND STEREOCHEMISTRY -REMARK 500 SUBTOPIC: COVALENT BOND LENGTHS -REMARK 500 -REMARK 500 THE STEREOCHEMICAL PARAMETERS OF THE FOLLOWING RESIDUES -REMARK 500 HAVE VALUES WHICH DEVIATE FROM EXPECTED VALUES BY MORE -REMARK 500 THAN 6*RMSD (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN -REMARK 500 IDENTIFIER; SSEQ=SEQUENCE NUMBER; I=INSERTION CODE). -REMARK 500 -REMARK 500 STANDARD TABLE: -REMARK 500 FORMAT: (10X,I3,1X,2(A3,1X,A1,I4,A1,1X,A4,3X),1X,F6.3) -REMARK 500 -REMARK 500 EXPECTED VALUES PROTEIN: ENGH AND HUBER, 1999 -REMARK 500 EXPECTED VALUES NUCLEIC ACID: CLOWNEY ET AL 1996 -REMARK 500 -REMARK 500 M RES CSSEQI ATM1 RES CSSEQI ATM2 DEVIATION -REMARK 500 HIS A 229 NE2 HIS A 229 CD2 -0.067 -REMARK 500 -REMARK 500 REMARK: NULL -REMARK 500 -REMARK 500 GEOMETRY AND STEREOCHEMISTRY -REMARK 500 SUBTOPIC: COVALENT BOND ANGLES -REMARK 500 -REMARK 500 THE STEREOCHEMICAL PARAMETERS OF THE FOLLOWING RESIDUES -REMARK 500 HAVE VALUES WHICH DEVIATE FROM EXPECTED VALUES BY MORE -REMARK 500 THAN 6*RMSD (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN -REMARK 500 IDENTIFIER; SSEQ=SEQUENCE NUMBER; I=INSERTION CODE). -REMARK 500 -REMARK 500 STANDARD TABLE: -REMARK 500 FORMAT: (10X,I3,1X,A3,1X,A1,I4,A1,3(1X,A4,2X),12X,F5.1) -REMARK 500 -REMARK 500 EXPECTED VALUES PROTEIN: ENGH AND HUBER, 1999 -REMARK 500 EXPECTED VALUES NUCLEIC ACID: CLOWNEY ET AL 1996 -REMARK 500 -REMARK 500 M RES CSSEQI ATM1 ATM2 ATM3 -REMARK 500 ARG A 9 NE - CZ - NH2 ANGL. DEV. = -3.2 DEGREES -REMARK 500 TRP A 19 CD1 - CG - CD2 ANGL. DEV. = 6.6 DEGREES -REMARK 500 TRP A 19 CE2 - CD2 - CG ANGL. DEV. = -5.6 DEGREES -REMARK 500 ARG A 24 NE - CZ - NH1 ANGL. DEV. = 3.1 DEGREES -REMARK 500 ASP A 101 CB - CG - OD1 ANGL. DEV. = 7.3 DEGREES -REMARK 500 TYR A 123 CB - CG - CD1 ANGL. DEV. = -3.9 DEGREES -REMARK 500 ASP A 136 CB - CG - OD1 ANGL. DEV. = 6.2 DEGREES -REMARK 500 TYR A 167 CB - CG - CD2 ANGL. DEV. = -4.2 DEGREES -REMARK 500 TYR A 263 CB - CG - CD1 ANGL. DEV. = -4.4 DEGREES -REMARK 500 -REMARK 500 REMARK: NULL -REMARK 500 -REMARK 500 GEOMETRY AND STEREOCHEMISTRY -REMARK 500 SUBTOPIC: TORSION ANGLES -REMARK 500 -REMARK 500 TORSION ANGLES OUTSIDE THE EXPECTED RAMACHANDRAN REGIONS: -REMARK 500 (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN IDENTIFIER; -REMARK 500 SSEQ=SEQUENCE NUMBER; I=INSERTION CODE). -REMARK 500 -REMARK 500 STANDARD TABLE: -REMARK 500 FORMAT:(10X,I3,1X,A3,1X,A1,I4,A1,4X,F7.2,3X,F7.2) -REMARK 500 -REMARK 500 EXPECTED VALUES: GJ KLEYWEGT AND TA JONES (1996). PHI/PSI- -REMARK 500 CHOLOGY: RAMACHANDRAN REVISITED. STRUCTURE 4, 1395 - 1400 -REMARK 500 -REMARK 500 M RES CSSEQI PSI PHI -REMARK 500 ASP A 17 -37.35 -132.37 -REMARK 500 ASP A 93 83.99 64.70 -REMARK 500 THR A 256 -7.57 73.01 -REMARK 500 ILE A 257 -77.43 -108.97 -REMARK 500 SER A 289 112.52 -34.30 -REMARK 500 -REMARK 500 REMARK: NULL -REMARK 525 -REMARK 525 SOLVENT -REMARK 525 -REMARK 525 THE SOLVENT MOLECULES HAVE CHAIN IDENTIFIERS THAT -REMARK 525 INDICATE THE POLYMER CHAIN WITH WHICH THEY ARE MOST -REMARK 525 CLOSELY ASSOCIATED. THE REMARK LISTS ALL THE SOLVENT -REMARK 525 MOLECULES WHICH ARE MORE THAN 5A AWAY FROM THE -REMARK 525 NEAREST POLYMER CHAIN (M = MODEL NUMBER; -REMARK 525 RES=RESIDUE NAME; C=CHAIN IDENTIFIER; SSEQ=SEQUENCE -REMARK 525 NUMBER; I=INSERTION CODE): -REMARK 525 -REMARK 525 M RES CSSEQI -REMARK 525 HOH A 446 DISTANCE = 5.96 ANGSTROMS -REMARK 525 HOH A 558 DISTANCE = 7.12 ANGSTROMS -REMARK 525 HOH A 565 DISTANCE = 6.72 ANGSTROMS -REMARK 525 HOH A 568 DISTANCE = 7.37 ANGSTROMS -REMARK 525 HOH A 571 DISTANCE = 5.80 ANGSTROMS -REMARK 525 HOH A 573 DISTANCE = 5.38 ANGSTROMS -REMARK 525 HOH A 582 DISTANCE = 5.49 ANGSTROMS -REMARK 600 -REMARK 600 HETEROGEN -REMARK 600 THIRTY FOUR DETERGENT FRAGMENTS HAVE BEEN MODELED AS WATERS -REMARK 620 -REMARK 620 METAL COORDINATION -REMARK 620 (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN IDENTIFIER; -REMARK 620 SSEQ=SEQUENCE NUMBER; I=INSERTION CODE): -REMARK 620 -REMARK 620 COORDINATION ANGLES FOR: M RES CSSEQI METAL -REMARK 620 CA A 302 CA -REMARK 620 N RES CSSEQI ATOM -REMARK 620 1 HOH A 312 O -REMARK 620 2 HOH A 307 O 79.4 -REMARK 620 3 HOH A 339 O 86.7 74.4 -REMARK 620 4 GLU A 80 OE2 80.9 75.3 148.9 -REMARK 620 5 GLU A 80 OE1 92.0 125.5 159.5 50.2 -REMARK 620 6 ASP A 108 OD2 175.3 95.8 92.3 97.7 90.6 -REMARK 620 7 HOH A 305 O 86.9 150.3 78.6 128.6 80.9 97.5 -REMARK 620 N 1 2 3 4 5 6 -REMARK 620 -REMARK 620 COORDINATION ANGLES FOR: M RES CSSEQI METAL -REMARK 620 CA A 303 CA -REMARK 620 N RES CSSEQI ATOM -REMARK 620 1 ASP A 95 OD1 -REMARK 620 2 ASN A 100 OD1 73.7 -REMARK 620 3 ASP A 101 OD1 85.1 81.2 -REMARK 620 4 HOH A 331 O 150.5 76.9 93.2 -REMARK 620 5 ASP A 93 OD1 77.7 77.7 155.8 93.5 -REMARK 620 6 ASP A 93 OD2 113.9 122.8 151.9 80.1 52.3 -REMARK 620 7 ASP A 95 OD2 49.5 123.2 94.3 159.4 87.3 84.2 -REMARK 620 8 HOH A 327 O 126.7 146.6 75.5 80.8 128.6 76.5 82.6 -REMARK 620 N 1 2 3 4 5 6 7 -REMARK 620 -REMARK 620 COORDINATION ANGLES FOR: M RES CSSEQI METAL -REMARK 620 CA A 304 CA -REMARK 620 N RES CSSEQI ATOM -REMARK 620 1 ASN A 116 OD1 -REMARK 620 2 ASP A 136 OD2 103.7 -REMARK 620 3 LYS A 138 O 81.6 128.0 -REMARK 620 4 GLY A 140 O 95.7 145.2 82.9 -REMARK 620 5 HOH A 314 O 84.5 78.0 152.9 75.4 -REMARK 620 6 ASP A 136 OD1 89.8 52.3 76.4 157.5 126.9 -REMARK 620 7 ASN A 20 OD1 174.7 81.5 94.8 79.9 97.2 93.2 -REMARK 620 N 1 2 3 4 5 6 -REMARK 700 -REMARK 700 SHEET -REMARK 700 THE SHEET PRESENTED AS *S1* ON SHEET RECORDS BELOW IS -REMARK 700 ACTUALLY A SIXTEEN-STRANDED BETA-BARREL. THIS IS -REMARK 700 REPRESENTED AS A SEVENTEEN-STRANDED SHEET IN WHICH THE -REMARK 700 FIRST AND LAST STRANDS ARE IDENTICAL. -REMARK 800 -REMARK 800 SITE -REMARK 800 SITE_IDENTIFIER: AC1 -REMARK 800 EVIDENCE_CODE: SOFTWARE -REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE CA A 302 -REMARK 800 SITE_IDENTIFIER: AC2 -REMARK 800 EVIDENCE_CODE: SOFTWARE -REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE CA A 303 -REMARK 800 SITE_IDENTIFIER: AC3 -REMARK 800 EVIDENCE_CODE: SOFTWARE -REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE CA A 304 -REMARK 800 SITE_IDENTIFIER: AC4 -REMARK 800 EVIDENCE_CODE: SOFTWARE -REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE C8E A 545 -REMARK 800 SITE_IDENTIFIER: AC5 -REMARK 800 EVIDENCE_CODE: SOFTWARE -REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE C8E A 546 -REMARK 800 SITE_IDENTIFIER: AC6 -REMARK 800 EVIDENCE_CODE: SOFTWARE -REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE C8E A 548 -DBREF 2POR A 1 301 UNP P31243 PORI_RHOCA 1 301 -SEQRES 1 A 301 GLU VAL LYS LEU SER GLY ASP ALA ARG MET GLY VAL MET -SEQRES 2 A 301 TYR ASN GLY ASP ASP TRP ASN PHE SER SER ARG SER ARG -SEQRES 3 A 301 VAL LEU PHE THR MET SER GLY THR THR ASP SER GLY LEU -SEQRES 4 A 301 GLU PHE GLY ALA SER PHE LYS ALA HIS GLU SER VAL GLY -SEQRES 5 A 301 ALA GLU THR GLY GLU ASP GLY THR VAL PHE LEU SER GLY -SEQRES 6 A 301 ALA PHE GLY LYS ILE GLU MET GLY ASP ALA LEU GLY ALA -SEQRES 7 A 301 SER GLU ALA LEU PHE GLY ASP LEU TYR GLU VAL GLY TYR -SEQRES 8 A 301 THR ASP LEU ASP ASP ARG GLY GLY ASN ASP ILE PRO TYR -SEQRES 9 A 301 LEU THR GLY ASP GLU ARG LEU THR ALA GLU ASP ASN PRO -SEQRES 10 A 301 VAL LEU LEU TYR THR TYR SER ALA GLY ALA PHE SER VAL -SEQRES 11 A 301 ALA ALA SER MET SER ASP GLY LYS VAL GLY GLU THR SER -SEQRES 12 A 301 GLU ASP ASP ALA GLN GLU MET ALA VAL ALA ALA ALA TYR -SEQRES 13 A 301 THR PHE GLY ASN TYR THR VAL GLY LEU GLY TYR GLU LYS -SEQRES 14 A 301 ILE ASP SER PRO ASP THR ALA LEU MET ALA ASP MET GLU -SEQRES 15 A 301 GLN LEU GLU LEU ALA ALA ILE ALA LYS PHE GLY ALA THR -SEQRES 16 A 301 ASN VAL LYS ALA TYR TYR ALA ASP GLY GLU LEU ASP ARG -SEQRES 17 A 301 ASP PHE ALA ARG ALA VAL PHE ASP LEU THR PRO VAL ALA -SEQRES 18 A 301 ALA ALA ALA THR ALA VAL ASP HIS LYS ALA TYR GLY LEU -SEQRES 19 A 301 SER VAL ASP SER THR PHE GLY ALA THR THR VAL GLY GLY -SEQRES 20 A 301 TYR VAL GLN VAL LEU ASP ILE ASP THR ILE ASP ASP VAL -SEQRES 21 A 301 THR TYR TYR GLY LEU GLY ALA SER TYR ASP LEU GLY GLY -SEQRES 22 A 301 GLY ALA SER ILE VAL GLY GLY ILE ALA ASP ASN ASP LEU -SEQRES 23 A 301 PRO ASN SER ASP MET VAL ALA ASP LEU GLY VAL LYS PHE -SEQRES 24 A 301 LYS PHE -HET CA A 302 1 -HET CA A 303 1 -HET CA A 304 1 -HET C8E A 545 21 -HET C8E A 546 21 -HET C8E A 547 21 -HET C8E A 548 21 -HETNAM CA CALCIUM ION -HETNAM C8E (HYDROXYETHYLOXY)TRI(ETHYLOXY)OCTANE -FORMUL 2 CA 3(CA 2+) -FORMUL 5 C8E 4(C16 H34 O5) -FORMUL 9 HOH *274(H2 O) -HELIX 1 H1 SER A 50 GLU A 54 1 5 -HELIX 2 H2 GLY A 77 PHE A 83 1 7 -HELIX 3 H3 ARG A 208 VAL A 214 1 7 -SHEET 1 S117 GLU A 1 ASN A 15 0 -SHEET 2 S117 ASP A 18 THR A 35 -1 O ASP A 18 N ASN A 15 -SHEET 3 S117 LEU A 39 LYS A 46 -1 O LEU A 39 N THR A 35 -SHEET 4 S117 GLY A 59 GLY A 65 -1 N THR A 60 O SER A 44 -SHEET 5 S117 GLY A 68 ASP A 74 -1 N GLY A 68 O GLY A 65 -SHEET 6 S117 VAL A 118 ALA A 125 -1 N VAL A 118 O GLY A 73 -SHEET 7 S117 PHE A 128 SER A 135 -1 N PHE A 128 O ALA A 125 -SHEET 8 S117 GLN A 148 PHE A 158 -1 O GLU A 149 N SER A 135 -SHEET 9 S117 TYR A 161 ASP A 171 -1 N TYR A 161 O PHE A 158 -SHEET 10 S117 MET A 181 PHE A 192 -1 N MET A 181 O ILE A 170 -SHEET 11 S117 THR A 195 LEU A 206 -1 N THR A 195 O PHE A 192 -SHEET 12 S117 VAL A 227 PHE A 240 -1 N VAL A 227 O LEU A 206 -SHEET 13 S117 THR A 243 ILE A 254 -1 N THR A 243 O PHE A 240 -SHEET 14 S117 ASP A 258 LEU A 271 -1 N ASP A 258 O ILE A 254 -SHEET 15 S117 ALA A 275 ASP A 285 -1 O ALA A 275 N LEU A 271 -SHEET 16 S117 VAL A 292 PHE A 301 -1 N VAL A 292 O ALA A 282 -SHEET 17 S117 GLU A 1 ASN A 15 1 N GLY A 6 O PHE A 301 -LINK CA CA A 302 O HOH A 312 1555 1555 2.28 -LINK CA CA A 302 O HOH A 307 1555 1555 2.32 -LINK CA CA A 302 O HOH A 339 1555 1555 2.38 -LINK CA CA A 302 OE2 GLU A 80 1555 1555 2.48 -LINK CA CA A 302 OE1 GLU A 80 1555 1555 2.53 -LINK CA CA A 302 OD2 ASP A 108 1555 1555 2.24 -LINK CA CA A 302 O HOH A 305 1555 1555 2.43 -LINK CA CA A 303 OD1 ASP A 95 1555 1555 2.63 -LINK CA CA A 303 OD1 ASN A 100 1555 1555 2.31 -LINK CA CA A 303 OD1 ASP A 101 1555 1555 2.25 -LINK CA CA A 303 O HOH A 331 1555 1555 2.39 -LINK CA CA A 303 OD1 ASP A 93 1555 1555 2.33 -LINK CA CA A 303 OD2 ASP A 93 1555 1555 2.45 -LINK CA CA A 303 OD2 ASP A 95 1555 1555 2.40 -LINK CA CA A 303 O HOH A 327 1555 1555 2.24 -LINK CA CA A 304 OD1 ASN A 116 1555 1555 2.16 -LINK CA CA A 304 OD2 ASP A 136 1555 1555 2.39 -LINK CA CA A 304 O LYS A 138 1555 1555 2.55 -LINK CA CA A 304 O GLY A 140 1555 1555 2.18 -LINK CA CA A 304 O HOH A 314 1555 1555 2.35 -LINK CA CA A 304 OD1 ASP A 136 1555 1555 2.35 -LINK CA CA A 304 OD1 ASN A 20 1555 2555 2.18 -SITE 1 AC1 6 GLU A 80 ASP A 108 HOH A 305 HOH A 307 -SITE 2 AC1 6 HOH A 312 HOH A 339 -SITE 1 AC2 6 ASP A 93 ASP A 95 ASN A 100 ASP A 101 -SITE 2 AC2 6 HOH A 327 HOH A 331 -SITE 1 AC3 6 ASN A 20 ASN A 116 ASP A 136 LYS A 138 -SITE 2 AC3 6 GLY A 140 HOH A 314 -SITE 1 AC4 4 GLN A 183 VAL A 214 LEU A 286 ASN A 288 -SITE 1 AC5 4 TRP A 19 MET A 134 GLN A 148 GLY A 280 -SITE 1 AC6 4 TYR A 200 TYR A 232 VAL A 249 THR A 261 -CRYST1 92.300 92.300 146.200 90.00 90.00 120.00 H 3 9 -ORIGX1 1.000000 0.000000 0.000000 0.00000 -ORIGX2 0.000000 1.000000 0.000000 0.00000 -ORIGX3 0.000000 0.000000 1.000000 0.00000 -SCALE1 0.010834 0.006255 0.000000 0.00000 -SCALE2 0.000000 0.012510 0.000000 0.00000 -SCALE3 0.000000 0.000000 0.006840 0.00000 -ATOM 1 N GLU A 1 10.975 -2.428 6.735 1.00 27.59 N -ATOM 2 CA GLU A 1 9.566 -2.578 6.405 1.00 36.06 C -ATOM 3 C GLU A 1 8.689 -3.034 7.601 1.00 22.34 C -ATOM 4 O GLU A 1 9.156 -3.908 8.335 1.00 23.38 O -ATOM 5 CB GLU A 1 9.513 -3.583 5.273 1.00 27.56 C -ATOM 6 CG GLU A 1 8.120 -3.932 4.767 1.00 46.76 C -ATOM 7 CD GLU A 1 8.059 -5.151 3.839 1.00 78.17 C -ATOM 8 OE1 GLU A 1 8.986 -5.978 3.838 1.00 83.62 O -ATOM 9 OE2 GLU A 1 7.059 -5.270 3.122 1.00 88.58 O -ATOM 10 N VAL A 2 7.445 -2.564 7.760 1.00 24.91 N -ATOM 11 CA VAL A 2 6.554 -2.916 8.868 1.00 26.19 C -ATOM 12 C VAL A 2 5.235 -3.431 8.314 1.00 21.63 C -ATOM 13 O VAL A 2 4.554 -2.685 7.614 1.00 25.05 O -ATOM 14 CB VAL A 2 6.258 -1.672 9.795 1.00 21.80 C -ATOM 15 CG1 VAL A 2 5.414 -2.151 10.975 1.00 21.14 C -ATOM 16 CG2 VAL A 2 7.526 -1.022 10.328 1.00 21.61 C -ATOM 17 N LYS A 3 4.811 -4.658 8.584 1.00 17.35 N -ATOM 18 CA LYS A 3 3.536 -5.187 8.138 1.00 16.93 C -ATOM 19 C LYS A 3 2.611 -5.431 9.336 1.00 22.75 C -ATOM 20 O LYS A 3 3.086 -5.703 10.440 1.00 24.29 O -ATOM 21 CB LYS A 3 3.712 -6.524 7.421 1.00 20.86 C -ATOM 22 CG LYS A 3 4.477 -6.434 6.116 1.00 49.31 C -ATOM 23 CD LYS A 3 4.137 -7.645 5.248 1.00 66.30 C -ATOM 24 CE LYS A 3 4.389 -7.309 3.763 1.00 91.35 C -ATOM 25 NZ LYS A 3 3.660 -6.128 3.288 1.00 86.70 N -ATOM 26 N LEU A 4 1.317 -5.393 9.102 1.00 18.28 N -ATOM 27 CA LEU A 4 0.307 -5.586 10.089 1.00 17.20 C -ATOM 28 C LEU A 4 -0.511 -6.790 9.822 1.00 25.71 C -ATOM 29 O LEU A 4 -0.857 -7.096 8.688 1.00 22.60 O -ATOM 30 CB LEU A 4 -0.658 -4.425 10.135 1.00 17.62 C -ATOM 31 CG LEU A 4 -0.154 -3.047 10.591 1.00 25.02 C -ATOM 32 CD1 LEU A 4 -1.260 -2.032 10.663 1.00 27.49 C -ATOM 33 CD2 LEU A 4 0.342 -3.158 12.001 1.00 28.78 C -ATOM 34 N SER A 5 -0.858 -7.520 10.854 1.00 18.09 N -ATOM 35 CA SER A 5 -1.843 -8.581 10.759 1.00 16.56 C -ATOM 36 C SER A 5 -2.590 -8.569 12.107 1.00 21.22 C -ATOM 37 O SER A 5 -2.231 -7.755 12.976 1.00 17.63 O -ATOM 38 CB SER A 5 -1.182 -9.918 10.543 1.00 15.90 C -ATOM 39 OG SER A 5 -0.206 -10.289 11.503 1.00 22.45 O -ATOM 40 N GLY A 6 -3.582 -9.404 12.337 1.00 22.36 N -ATOM 41 CA GLY A 6 -4.313 -9.399 13.598 1.00 18.52 C -ATOM 42 C GLY A 6 -5.194 -10.590 13.711 1.00 20.43 C -ATOM 43 O GLY A 6 -5.272 -11.470 12.839 1.00 19.89 O -ATOM 44 N ASP A 7 -5.858 -10.676 14.845 1.00 17.75 N -ATOM 45 CA ASP A 7 -6.828 -11.730 15.071 1.00 14.63 C -ATOM 46 C ASP A 7 -7.839 -11.230 16.099 1.00 17.50 C -ATOM 47 O ASP A 7 -7.656 -10.162 16.698 1.00 17.10 O -ATOM 48 CB ASP A 7 -6.157 -13.038 15.557 1.00 15.83 C -ATOM 49 CG ASP A 7 -5.230 -12.906 16.760 1.00 23.05 C -ATOM 50 OD1 ASP A 7 -5.656 -12.431 17.801 1.00 20.15 O -ATOM 51 OD2 ASP A 7 -4.071 -13.234 16.640 1.00 25.78 O -ATOM 52 N ALA A 8 -8.944 -11.946 16.224 1.00 19.52 N -ATOM 53 CA ALA A 8 -10.035 -11.603 17.141 1.00 15.71 C -ATOM 54 C ALA A 8 -10.861 -12.858 17.357 1.00 19.05 C -ATOM 55 O ALA A 8 -10.682 -13.866 16.641 1.00 18.32 O -ATOM 56 CB ALA A 8 -10.945 -10.502 16.587 1.00 14.05 C -ATOM 57 N ARG A 9 -11.662 -12.914 18.432 1.00 16.33 N -ATOM 58 CA ARG A 9 -12.501 -14.065 18.709 1.00 13.95 C -ATOM 59 C ARG A 9 -13.651 -13.601 19.567 1.00 17.40 C -ATOM 60 O ARG A 9 -13.553 -12.536 20.208 1.00 18.39 O -ATOM 61 CB ARG A 9 -11.687 -15.156 19.410 1.00 15.94 C -ATOM 62 CG ARG A 9 -11.320 -14.825 20.843 1.00 16.00 C -ATOM 63 CD ARG A 9 -10.256 -15.772 21.276 1.00 19.18 C -ATOM 64 NE ARG A 9 -10.038 -15.564 22.699 1.00 20.39 N -ATOM 65 CZ ARG A 9 -8.998 -16.081 23.374 1.00 23.61 C -ATOM 66 NH1 ARG A 9 -8.039 -16.818 22.792 1.00 19.92 N -ATOM 67 NH2 ARG A 9 -8.922 -15.805 24.689 1.00 23.34 N -ATOM 68 N MET A 10 -14.789 -14.262 19.531 1.00 15.77 N -ATOM 69 CA MET A 10 -15.931 -13.891 20.365 1.00 19.06 C -ATOM 70 C MET A 10 -16.832 -15.099 20.499 1.00 24.44 C -ATOM 71 O MET A 10 -16.838 -15.965 19.620 1.00 18.02 O -ATOM 72 CB MET A 10 -16.723 -12.707 19.809 1.00 18.72 C -ATOM 73 CG MET A 10 -17.489 -12.938 18.541 1.00 25.28 C -ATOM 74 SD MET A 10 -18.482 -11.490 18.191 1.00 30.85 S -ATOM 75 CE MET A 10 -18.740 -12.010 16.541 1.00 33.80 C -ATOM 76 N GLY A 11 -17.502 -15.304 21.642 1.00 17.85 N -ATOM 77 CA GLY A 11 -18.325 -16.491 21.829 1.00 18.79 C -ATOM 78 C GLY A 11 -18.676 -16.572 23.288 1.00 25.94 C -ATOM 79 O GLY A 11 -18.702 -15.531 23.959 1.00 21.22 O -ATOM 80 N VAL A 12 -18.929 -17.776 23.769 1.00 22.43 N -ATOM 81 CA VAL A 12 -19.310 -18.051 25.177 1.00 22.84 C -ATOM 82 C VAL A 12 -18.421 -19.118 25.753 1.00 21.81 C -ATOM 83 O VAL A 12 -18.005 -20.034 25.037 1.00 20.69 O -ATOM 84 CB VAL A 12 -20.786 -18.518 25.319 1.00 23.09 C -ATOM 85 CG1 VAL A 12 -21.639 -17.287 25.071 1.00 21.02 C -ATOM 86 CG2 VAL A 12 -21.167 -19.632 24.355 1.00 22.56 C -ATOM 87 N MET A 13 -18.010 -18.982 27.018 1.00 16.86 N -ATOM 88 CA MET A 13 -17.066 -19.909 27.604 1.00 18.95 C -ATOM 89 C MET A 13 -17.695 -20.359 28.938 1.00 26.49 C -ATOM 90 O MET A 13 -18.277 -19.533 29.649 1.00 22.68 O -ATOM 91 CB MET A 13 -15.725 -19.176 27.821 1.00 19.57 C -ATOM 92 CG AMET A 13 -14.661 -20.018 28.553 0.51 33.28 C -ATOM 93 CG BMET A 13 -14.564 -19.969 28.448 0.49 31.07 C -ATOM 94 SD AMET A 13 -14.864 -20.093 30.362 0.51 18.59 S -ATOM 95 SD BMET A 13 -14.047 -19.495 30.135 0.49 33.60 S -ATOM 96 CE AMET A 13 -14.637 -18.365 30.663 0.51 14.41 C -ATOM 97 CE BMET A 13 -13.423 -21.075 30.594 0.49 12.77 C -ATOM 98 N TYR A 14 -17.572 -21.615 29.305 1.00 23.01 N -ATOM 99 CA TYR A 14 -18.178 -22.199 30.497 1.00 25.16 C -ATOM 100 C TYR A 14 -17.029 -22.485 31.428 1.00 23.22 C -ATOM 101 O TYR A 14 -16.171 -23.295 31.063 1.00 23.70 O -ATOM 102 CB TYR A 14 -18.841 -23.482 30.133 1.00 24.00 C -ATOM 103 CG TYR A 14 -19.541 -24.129 31.300 1.00 28.72 C -ATOM 104 CD1 TYR A 14 -20.727 -23.561 31.734 1.00 29.42 C -ATOM 105 CD2 TYR A 14 -19.017 -25.283 31.856 1.00 27.77 C -ATOM 106 CE1 TYR A 14 -21.430 -24.167 32.750 1.00 32.13 C -ATOM 107 CE2 TYR A 14 -19.717 -25.895 32.876 1.00 30.23 C -ATOM 108 CZ TYR A 14 -20.915 -25.329 33.305 1.00 32.81 C -ATOM 109 OH TYR A 14 -21.626 -25.944 34.326 1.00 50.72 O -ATOM 110 N ASN A 15 -17.000 -21.905 32.638 1.00 22.01 N -ATOM 111 CA ASN A 15 -15.841 -22.047 33.535 1.00 22.52 C -ATOM 112 C ASN A 15 -15.889 -23.250 34.484 1.00 31.39 C -ATOM 113 O ASN A 15 -15.038 -23.447 35.359 1.00 32.32 O -ATOM 114 CB ASN A 15 -15.660 -20.755 34.380 1.00 24.87 C -ATOM 115 CG ASN A 15 -16.856 -20.434 35.271 1.00 23.96 C -ATOM 116 OD1 ASN A 15 -17.708 -21.291 35.515 1.00 23.91 O -ATOM 117 ND2 ASN A 15 -17.090 -19.204 35.695 1.00 26.01 N -ATOM 118 N GLY A 16 -16.865 -24.119 34.303 1.00 26.28 N -ATOM 119 CA GLY A 16 -17.013 -25.246 35.198 1.00 33.32 C -ATOM 120 C GLY A 16 -18.353 -25.113 35.878 1.00 30.42 C -ATOM 121 O GLY A 16 -18.975 -26.124 36.199 1.00 36.69 O -ATOM 122 N ASP A 17 -18.860 -23.882 36.047 1.00 29.56 N -ATOM 123 CA ASP A 17 -20.141 -23.614 36.727 1.00 29.65 C -ATOM 124 C ASP A 17 -21.077 -22.659 35.981 1.00 32.17 C -ATOM 125 O ASP A 17 -22.304 -22.831 35.929 1.00 30.83 O -ATOM 126 CB ASP A 17 -19.849 -23.042 38.165 1.00 35.32 C -ATOM 127 CG ASP A 17 -18.950 -23.913 39.090 1.00 51.32 C -ATOM 128 OD1 ASP A 17 -19.361 -25.019 39.486 1.00 59.35 O -ATOM 129 OD2 ASP A 17 -17.822 -23.488 39.391 1.00 65.43 O -ATOM 130 N ASP A 18 -20.505 -21.638 35.336 1.00 24.80 N -ATOM 131 CA ASP A 18 -21.301 -20.661 34.621 1.00 23.22 C -ATOM 132 C ASP A 18 -20.689 -20.330 33.261 1.00 26.47 C -ATOM 133 O ASP A 18 -19.485 -20.520 33.049 1.00 25.52 O -ATOM 134 CB ASP A 18 -21.381 -19.351 35.370 1.00 25.98 C -ATOM 135 CG ASP A 18 -22.210 -19.562 36.608 1.00 43.16 C -ATOM 136 OD1 ASP A 18 -23.428 -19.634 36.500 1.00 41.16 O -ATOM 137 OD2 ASP A 18 -21.610 -19.689 37.666 1.00 33.11 O -ATOM 138 N TRP A 19 -21.570 -19.845 32.394 1.00 24.02 N -ATOM 139 CA TRP A 19 -21.228 -19.334 31.074 1.00 29.52 C -ATOM 140 C TRP A 19 -20.887 -17.850 31.201 1.00 34.72 C -ATOM 141 O TRP A 19 -21.489 -17.150 32.023 1.00 26.95 O -ATOM 142 CB TRP A 19 -22.413 -19.489 30.099 1.00 20.45 C -ATOM 143 CG TRP A 19 -22.600 -20.931 29.671 1.00 34.12 C -ATOM 144 CD1 TRP A 19 -23.521 -21.735 30.283 1.00 38.42 C -ATOM 145 CD2 TRP A 19 -21.879 -21.586 28.704 1.00 43.20 C -ATOM 146 NE1 TRP A 19 -23.378 -22.907 29.705 1.00 28.98 N -ATOM 147 CE2 TRP A 19 -22.416 -22.861 28.769 1.00 43.13 C -ATOM 148 CE3 TRP A 19 -20.869 -21.291 27.804 1.00 27.67 C -ATOM 149 CZ2 TRP A 19 -21.955 -23.858 27.942 1.00 37.29 C -ATOM 150 CZ3 TRP A 19 -20.404 -22.293 26.974 1.00 26.31 C -ATOM 151 CH2 TRP A 19 -20.947 -23.560 27.045 1.00 34.35 C -ATOM 152 N ASN A 20 -19.915 -17.345 30.439 1.00 20.14 N -ATOM 153 CA ASN A 20 -19.610 -15.934 30.363 1.00 20.63 C -ATOM 154 C ASN A 20 -19.325 -15.585 28.909 1.00 21.59 C -ATOM 155 O ASN A 20 -18.824 -16.452 28.179 1.00 20.91 O -ATOM 156 CB ASN A 20 -18.358 -15.571 31.135 1.00 19.26 C -ATOM 157 CG ASN A 20 -18.632 -15.209 32.594 1.00 16.94 C -ATOM 158 OD1 ASN A 20 -18.981 -14.061 32.912 1.00 19.32 O -ATOM 159 ND2 ASN A 20 -18.356 -16.193 33.429 1.00 18.90 N -ATOM 160 N PHE A 21 -19.579 -14.348 28.511 1.00 20.31 N -ATOM 161 CA PHE A 21 -19.123 -13.839 27.208 1.00 18.80 C -ATOM 162 C PHE A 21 -17.596 -13.740 27.273 1.00 29.01 C -ATOM 163 O PHE A 21 -17.046 -13.375 28.323 1.00 18.59 O -ATOM 164 CB PHE A 21 -19.693 -12.434 26.920 1.00 15.96 C -ATOM 165 CG PHE A 21 -21.210 -12.260 26.798 1.00 16.47 C -ATOM 166 CD1 PHE A 21 -22.038 -13.317 26.450 1.00 18.25 C -ATOM 167 CD2 PHE A 21 -21.730 -11.004 27.047 1.00 17.20 C -ATOM 168 CE1 PHE A 21 -23.387 -13.081 26.366 1.00 20.58 C -ATOM 169 CE2 PHE A 21 -23.088 -10.789 26.954 1.00 18.95 C -ATOM 170 CZ PHE A 21 -23.906 -11.831 26.615 1.00 18.40 C -ATOM 171 N SER A 22 -16.849 -14.072 26.211 1.00 16.37 N -ATOM 172 CA SER A 22 -15.406 -13.978 26.201 1.00 15.71 C -ATOM 173 C SER A 22 -14.989 -13.518 24.795 1.00 27.98 C -ATOM 174 O SER A 22 -15.346 -14.160 23.810 1.00 18.52 O -ATOM 175 CB SER A 22 -14.824 -15.314 26.508 1.00 13.95 C -ATOM 176 OG SER A 22 -13.431 -15.173 26.702 1.00 17.49 O -ATOM 177 N SER A 23 -14.273 -12.416 24.652 1.00 17.53 N -ATOM 178 CA SER A 23 -13.869 -11.906 23.350 1.00 21.71 C -ATOM 179 C SER A 23 -12.546 -11.168 23.448 1.00 27.30 C -ATOM 180 O SER A 23 -12.101 -10.859 24.561 1.00 18.45 O -ATOM 181 CB SER A 23 -14.984 -11.006 22.851 1.00 13.04 C -ATOM 182 OG SER A 23 -15.192 -9.821 23.590 1.00 17.20 O -ATOM 183 N ARG A 24 -11.805 -10.927 22.371 1.00 16.47 N -ATOM 184 CA ARG A 24 -10.586 -10.139 22.390 1.00 18.28 C -ATOM 185 C ARG A 24 -10.232 -9.787 20.944 1.00 21.67 C -ATOM 186 O ARG A 24 -10.765 -10.417 20.032 1.00 17.72 O -ATOM 187 CB ARG A 24 -9.384 -10.889 22.934 1.00 14.39 C -ATOM 188 CG ARG A 24 -8.805 -12.022 22.187 1.00 17.95 C -ATOM 189 CD ARG A 24 -7.506 -12.385 22.785 1.00 18.22 C -ATOM 190 NE ARG A 24 -6.965 -13.447 21.943 1.00 16.16 N -ATOM 191 CZ ARG A 24 -5.984 -14.286 22.251 1.00 22.92 C -ATOM 192 NH1 ARG A 24 -5.364 -14.285 23.426 1.00 23.47 N -ATOM 193 NH2 ARG A 24 -5.544 -15.105 21.299 1.00 24.06 N -ATOM 194 N SER A 25 -9.355 -8.836 20.719 1.00 19.57 N -ATOM 195 CA SER A 25 -8.788 -8.593 19.406 1.00 19.55 C -ATOM 196 C SER A 25 -7.354 -8.200 19.668 1.00 22.34 C -ATOM 197 O SER A 25 -7.009 -7.632 20.724 1.00 18.07 O -ATOM 198 CB SER A 25 -9.563 -7.488 18.650 1.00 15.96 C -ATOM 199 OG SER A 25 -9.822 -6.295 19.331 1.00 31.90 O -ATOM 200 N ARG A 26 -6.442 -8.524 18.741 1.00 16.42 N -ATOM 201 CA ARG A 26 -5.006 -8.261 18.856 1.00 14.69 C -ATOM 202 C ARG A 26 -4.472 -7.806 17.479 1.00 18.06 C -ATOM 203 O ARG A 26 -5.093 -8.135 16.455 1.00 16.70 O -ATOM 204 CB ARG A 26 -4.249 -9.528 19.261 1.00 15.19 C -ATOM 205 CG ARG A 26 -4.855 -10.136 20.527 1.00 18.12 C -ATOM 206 CD ARG A 26 -3.970 -11.208 21.079 1.00 19.43 C -ATOM 207 NE ARG A 26 -3.803 -12.232 20.097 1.00 17.77 N -ATOM 208 CZ ARG A 26 -2.963 -13.245 20.234 1.00 29.11 C -ATOM 209 NH1 ARG A 26 -2.202 -13.413 21.297 1.00 20.54 N -ATOM 210 NH2 ARG A 26 -2.829 -14.114 19.235 1.00 23.76 N -ATOM 211 N VAL A 27 -3.371 -7.074 17.436 1.00 18.18 N -ATOM 212 CA VAL A 27 -2.700 -6.649 16.202 1.00 17.02 C -ATOM 213 C VAL A 27 -1.254 -7.078 16.396 1.00 20.98 C -ATOM 214 O VAL A 27 -0.700 -6.935 17.506 1.00 18.90 O -ATOM 215 CB VAL A 27 -2.810 -5.120 16.021 1.00 13.14 C -ATOM 216 CG1 VAL A 27 -1.844 -4.555 14.983 1.00 20.80 C -ATOM 217 CG2 VAL A 27 -4.232 -4.852 15.560 1.00 18.48 C -ATOM 218 N LEU A 28 -0.669 -7.658 15.334 1.00 13.21 N -ATOM 219 CA LEU A 28 0.727 -8.028 15.294 1.00 12.34 C -ATOM 220 C LEU A 28 1.508 -7.115 14.333 1.00 16.60 C -ATOM 221 O LEU A 28 1.087 -6.828 13.211 1.00 19.12 O -ATOM 222 CB LEU A 28 0.834 -9.503 14.877 1.00 15.44 C -ATOM 223 CG LEU A 28 2.234 -10.063 14.618 1.00 17.29 C -ATOM 224 CD1 LEU A 28 3.075 -10.180 15.886 1.00 19.53 C -ATOM 225 CD2 LEU A 28 2.062 -11.434 14.044 1.00 18.79 C -ATOM 226 N PHE A 29 2.623 -6.562 14.779 1.00 14.46 N -ATOM 227 CA PHE A 29 3.533 -5.760 13.971 1.00 19.10 C -ATOM 228 C PHE A 29 4.627 -6.700 13.519 1.00 28.14 C -ATOM 229 O PHE A 29 5.273 -7.290 14.396 1.00 19.55 O -ATOM 230 CB PHE A 29 4.201 -4.663 14.773 1.00 14.05 C -ATOM 231 CG PHE A 29 3.203 -3.682 15.339 1.00 21.24 C -ATOM 232 CD1 PHE A 29 2.576 -2.776 14.523 1.00 17.81 C -ATOM 233 CD2 PHE A 29 2.900 -3.706 16.696 1.00 23.31 C -ATOM 234 CE1 PHE A 29 1.646 -1.902 15.054 1.00 26.27 C -ATOM 235 CE2 PHE A 29 1.972 -2.831 17.226 1.00 20.41 C -ATOM 236 CZ PHE A 29 1.340 -1.928 16.407 1.00 22.27 C -ATOM 237 N THR A 30 4.879 -6.914 12.210 1.00 18.98 N -ATOM 238 CA THR A 30 6.001 -7.751 11.761 1.00 17.37 C -ATOM 239 C THR A 30 6.950 -6.853 11.010 1.00 18.66 C -ATOM 240 O THR A 30 6.537 -6.160 10.078 1.00 21.64 O -ATOM 241 CB THR A 30 5.535 -8.820 10.853 1.00 16.98 C -ATOM 242 OG1 THR A 30 4.602 -9.605 11.567 1.00 23.49 O -ATOM 243 CG2 THR A 30 6.660 -9.675 10.412 1.00 20.20 C -ATOM 244 N MET A 31 8.199 -6.782 11.425 1.00 16.66 N -ATOM 245 CA MET A 31 9.149 -5.864 10.838 1.00 17.95 C -ATOM 246 C MET A 31 10.236 -6.670 10.197 1.00 20.41 C -ATOM 247 O MET A 31 10.633 -7.704 10.743 1.00 16.53 O -ATOM 248 CB MET A 31 9.738 -4.957 11.902 1.00 18.36 C -ATOM 249 CG MET A 31 8.614 -4.154 12.542 1.00 28.91 C -ATOM 250 SD MET A 31 9.221 -2.829 13.578 1.00 29.44 S -ATOM 251 CE MET A 31 9.642 -3.773 14.989 1.00 24.49 C -ATOM 252 N SER A 32 10.719 -6.278 9.007 1.00 18.58 N -ATOM 253 CA SER A 32 11.747 -7.076 8.317 1.00 18.25 C -ATOM 254 C SER A 32 12.663 -6.231 7.441 1.00 17.77 C -ATOM 255 O SER A 32 12.309 -5.074 7.116 1.00 21.99 O -ATOM 256 CB SER A 32 11.084 -8.169 7.454 1.00 21.16 C -ATOM 257 OG SER A 32 10.036 -7.595 6.687 1.00 36.32 O -ATOM 258 N GLY A 33 13.846 -6.810 7.214 1.00 18.75 N -ATOM 259 CA GLY A 33 14.879 -6.169 6.423 1.00 19.45 C -ATOM 260 C GLY A 33 15.928 -7.193 5.988 1.00 19.89 C -ATOM 261 O GLY A 33 15.912 -8.349 6.429 1.00 18.98 O -ATOM 262 N THR A 34 16.861 -6.765 5.111 1.00 20.70 N -ATOM 263 CA THR A 34 17.891 -7.609 4.533 1.00 18.70 C -ATOM 264 C THR A 34 19.122 -6.741 4.408 1.00 15.56 C -ATOM 265 O THR A 34 19.002 -5.588 3.989 1.00 22.55 O -ATOM 266 CB THR A 34 17.516 -8.091 3.111 1.00 23.51 C -ATOM 267 OG1 THR A 34 16.253 -8.696 3.212 1.00 25.34 O -ATOM 268 CG2 THR A 34 18.429 -9.157 2.563 1.00 21.14 C -ATOM 269 N THR A 35 20.302 -7.237 4.741 1.00 16.89 N -ATOM 270 CA THR A 35 21.478 -6.410 4.639 1.00 19.04 C -ATOM 271 C THR A 35 21.964 -6.602 3.189 1.00 31.99 C -ATOM 272 O THR A 35 21.482 -7.478 2.459 1.00 22.91 O -ATOM 273 CB THR A 35 22.529 -6.898 5.632 1.00 21.23 C -ATOM 274 OG1 THR A 35 22.879 -8.235 5.245 1.00 19.46 O -ATOM 275 CG2 THR A 35 21.993 -6.888 7.090 1.00 20.86 C -ATOM 276 N ASP A 36 22.997 -5.869 2.796 1.00 26.13 N -ATOM 277 CA ASP A 36 23.590 -5.924 1.463 1.00 25.73 C -ATOM 278 C ASP A 36 24.060 -7.327 1.137 1.00 25.09 C -ATOM 279 O ASP A 36 23.867 -7.777 0.000 1.00 31.82 O -ATOM 280 CB ASP A 36 24.735 -4.929 1.425 1.00 23.29 C -ATOM 281 CG ASP A 36 24.297 -3.456 1.398 1.00 29.35 C -ATOM 282 OD1 ASP A 36 23.086 -3.192 1.251 1.00 32.92 O -ATOM 283 OD2 ASP A 36 25.180 -2.587 1.538 1.00 36.59 O -ATOM 284 N SER A 37 24.590 -8.117 2.070 1.00 25.70 N -ATOM 285 CA SER A 37 24.981 -9.467 1.714 1.00 23.90 C -ATOM 286 C SER A 37 23.883 -10.508 1.852 1.00 22.34 C -ATOM 287 O SER A 37 24.157 -11.702 1.670 1.00 24.38 O -ATOM 288 CB SER A 37 26.190 -9.852 2.557 1.00 30.09 C -ATOM 289 OG SER A 37 25.867 -9.979 3.940 1.00 48.00 O -ATOM 290 N GLY A 38 22.646 -10.103 2.203 1.00 21.78 N -ATOM 291 CA GLY A 38 21.563 -11.054 2.307 1.00 18.40 C -ATOM 292 C GLY A 38 21.344 -11.680 3.691 1.00 21.34 C -ATOM 293 O GLY A 38 20.692 -12.732 3.780 1.00 22.81 O -ATOM 294 N LEU A 39 21.905 -11.117 4.777 1.00 21.84 N -ATOM 295 CA LEU A 39 21.498 -11.566 6.115 1.00 23.27 C -ATOM 296 C LEU A 39 20.097 -10.977 6.290 1.00 19.54 C -ATOM 297 O LEU A 39 19.805 -9.851 5.869 1.00 23.50 O -ATOM 298 CB LEU A 39 22.375 -10.994 7.207 1.00 22.31 C -ATOM 299 CG LEU A 39 23.816 -11.396 7.138 1.00 21.30 C -ATOM 300 CD1 LEU A 39 24.572 -10.776 8.272 1.00 28.69 C -ATOM 301 CD2 LEU A 39 23.898 -12.869 7.179 1.00 25.27 C -ATOM 302 N GLU A 40 19.151 -11.696 6.862 1.00 18.39 N -ATOM 303 CA GLU A 40 17.800 -11.215 7.032 1.00 18.96 C -ATOM 304 C GLU A 40 17.670 -10.825 8.514 1.00 26.64 C -ATOM 305 O GLU A 40 18.276 -11.448 9.393 1.00 22.66 O -ATOM 306 CB GLU A 40 16.815 -12.318 6.729 1.00 21.71 C -ATOM 307 CG GLU A 40 16.895 -12.947 5.330 1.00 36.43 C -ATOM 308 CD GLU A 40 16.532 -11.980 4.209 1.00 58.73 C -ATOM 309 OE1 GLU A 40 15.614 -11.176 4.367 1.00 52.82 O -ATOM 310 OE2 GLU A 40 17.172 -12.043 3.163 1.00 61.13 O -ATOM 311 N PHE A 41 16.903 -9.813 8.825 1.00 23.28 N -ATOM 312 CA PHE A 41 16.729 -9.397 10.204 1.00 20.43 C -ATOM 313 C PHE A 41 15.288 -9.003 10.392 1.00 33.11 C -ATOM 314 O PHE A 41 14.563 -8.770 9.407 1.00 17.55 O -ATOM 315 CB PHE A 41 17.694 -8.252 10.489 1.00 17.40 C -ATOM 316 CG PHE A 41 17.603 -6.962 9.670 1.00 19.97 C -ATOM 317 CD1 PHE A 41 16.752 -5.938 10.031 1.00 18.79 C -ATOM 318 CD2 PHE A 41 18.455 -6.794 8.582 1.00 24.90 C -ATOM 319 CE1 PHE A 41 16.740 -4.744 9.333 1.00 18.42 C -ATOM 320 CE2 PHE A 41 18.444 -5.600 7.882 1.00 18.53 C -ATOM 321 CZ PHE A 41 17.594 -4.583 8.257 1.00 20.56 C -ATOM 322 N GLY A 42 14.810 -8.936 11.626 1.00 16.60 N -ATOM 323 CA GLY A 42 13.432 -8.570 11.827 1.00 15.94 C -ATOM 324 C GLY A 42 13.130 -8.441 13.326 1.00 18.51 C -ATOM 325 O GLY A 42 14.038 -8.612 14.142 1.00 17.74 O -ATOM 326 N ALA A 43 11.882 -8.141 13.619 1.00 19.68 N -ATOM 327 CA ALA A 43 11.393 -8.009 14.983 1.00 19.54 C -ATOM 328 C ALA A 43 9.876 -8.122 14.929 1.00 25.22 C -ATOM 329 O ALA A 43 9.252 -7.819 13.898 1.00 20.81 O -ATOM 330 CB ALA A 43 11.797 -6.646 15.537 1.00 16.52 C -ATOM 331 N SER A 44 9.180 -8.631 15.949 1.00 17.32 N -ATOM 332 CA SER A 44 7.736 -8.545 15.971 1.00 13.95 C -ATOM 333 C SER A 44 7.250 -8.527 17.428 1.00 17.36 C -ATOM 334 O SER A 44 7.963 -9.025 18.307 1.00 16.29 O -ATOM 335 CB SER A 44 7.093 -9.733 15.268 1.00 18.32 C -ATOM 336 OG SER A 44 7.556 -10.959 15.751 1.00 28.70 O -ATOM 337 N PHE A 45 6.076 -7.971 17.629 1.00 18.21 N -ATOM 338 CA PHE A 45 5.403 -7.974 18.916 1.00 19.59 C -ATOM 339 C PHE A 45 3.972 -7.562 18.664 1.00 21.25 C -ATOM 340 O PHE A 45 3.681 -7.002 17.593 1.00 19.84 O -ATOM 341 CB PHE A 45 6.102 -6.994 19.881 1.00 12.80 C -ATOM 342 CG PHE A 45 6.124 -5.522 19.533 1.00 16.76 C -ATOM 343 CD1 PHE A 45 5.086 -4.685 19.910 1.00 13.03 C -ATOM 344 CD2 PHE A 45 7.207 -4.996 18.829 1.00 15.77 C -ATOM 345 CE1 PHE A 45 5.134 -3.325 19.575 1.00 18.11 C -ATOM 346 CE2 PHE A 45 7.242 -3.644 18.503 1.00 14.29 C -ATOM 347 CZ PHE A 45 6.208 -2.799 18.869 1.00 18.49 C -ATOM 348 N LYS A 46 3.049 -7.825 19.601 1.00 14.65 N -ATOM 349 CA LYS A 46 1.661 -7.465 19.434 1.00 13.19 C -ATOM 350 C LYS A 46 1.393 -6.162 20.108 1.00 16.83 C -ATOM 351 O LYS A 46 2.154 -5.743 20.989 1.00 18.21 O -ATOM 352 CB LYS A 46 0.738 -8.518 20.001 1.00 14.48 C -ATOM 353 CG LYS A 46 1.038 -9.835 19.322 1.00 19.35 C -ATOM 354 CD LYS A 46 -0.003 -10.886 19.568 1.00 22.07 C -ATOM 355 CE LYS A 46 0.414 -12.179 18.892 1.00 29.45 C -ATOM 356 NZ LYS A 46 1.569 -12.753 19.553 1.00 30.58 N -ATOM 357 N ALA A 47 0.308 -5.501 19.763 1.00 13.74 N -ATOM 358 CA ALA A 47 0.078 -4.159 20.218 1.00 14.51 C -ATOM 359 C ALA A 47 -0.066 -4.148 21.761 1.00 17.84 C -ATOM 360 O ALA A 47 0.398 -3.213 22.427 1.00 16.71 O -ATOM 361 CB ALA A 47 -1.210 -3.622 19.625 1.00 13.21 C -ATOM 362 N HIS A 48 -0.708 -5.145 22.361 1.00 18.81 N -ATOM 363 CA HIS A 48 -0.891 -5.162 23.828 1.00 17.50 C -ATOM 364 C HIS A 48 0.419 -5.424 24.553 1.00 22.24 C -ATOM 365 O HIS A 48 0.466 -5.259 25.766 1.00 17.89 O -ATOM 366 CB HIS A 48 -1.945 -6.227 24.217 1.00 11.96 C -ATOM 367 CG HIS A 48 -1.534 -7.665 24.011 1.00 19.24 C -ATOM 368 ND1 HIS A 48 -1.497 -8.384 22.895 1.00 19.50 N -ATOM 369 CD2 HIS A 48 -1.086 -8.486 25.013 1.00 18.37 C -ATOM 370 CE1 HIS A 48 -1.055 -9.584 23.167 1.00 20.35 C -ATOM 371 NE2 HIS A 48 -0.808 -9.640 24.459 1.00 20.64 N -ATOM 372 N GLU A 49 1.498 -5.770 23.833 1.00 14.70 N -ATOM 373 CA GLU A 49 2.792 -6.076 24.377 1.00 14.46 C -ATOM 374 C GLU A 49 3.721 -4.937 24.115 1.00 14.22 C -ATOM 375 O GLU A 49 4.926 -5.114 24.355 1.00 15.82 O -ATOM 376 CB GLU A 49 3.502 -7.231 23.733 1.00 15.73 C -ATOM 377 CG GLU A 49 2.678 -8.470 23.628 1.00 24.60 C -ATOM 378 CD GLU A 49 3.401 -9.595 22.894 1.00 32.30 C -ATOM 379 OE1 GLU A 49 3.947 -9.415 21.802 1.00 21.35 O -ATOM 380 OE2 GLU A 49 3.405 -10.693 23.434 1.00 21.91 O -ATOM 381 N SER A 50 3.267 -3.778 23.639 1.00 14.73 N -ATOM 382 CA SER A 50 4.225 -2.763 23.249 1.00 13.74 C -ATOM 383 C SER A 50 5.102 -2.232 24.381 1.00 20.29 C -ATOM 384 O SER A 50 6.283 -1.952 24.134 1.00 16.11 O -ATOM 385 CB ASER A 50 3.509 -1.575 22.648 0.60 12.78 C -ATOM 386 CB BSER A 50 3.508 -1.603 22.576 0.40 12.35 C -ATOM 387 OG ASER A 50 2.591 -1.903 21.621 0.60 15.12 O -ATOM 388 OG BSER A 50 2.465 -1.023 23.337 0.40 13.87 O -ATOM 389 N VAL A 51 4.593 -2.082 25.643 1.00 15.56 N -ATOM 390 CA VAL A 51 5.457 -1.647 26.754 1.00 16.90 C -ATOM 391 C VAL A 51 6.573 -2.640 27.042 1.00 10.27 C -ATOM 392 O VAL A 51 7.741 -2.242 27.190 1.00 17.77 O -ATOM 393 CB VAL A 51 4.552 -1.433 27.990 1.00 16.34 C -ATOM 394 CG1 VAL A 51 5.421 -1.112 29.187 1.00 18.56 C -ATOM 395 CG2 VAL A 51 3.614 -0.273 27.756 1.00 16.82 C -ATOM 396 N GLY A 52 6.229 -3.936 27.076 1.00 12.24 N -ATOM 397 CA GLY A 52 7.179 -4.995 27.308 1.00 13.64 C -ATOM 398 C GLY A 52 8.163 -5.141 26.173 1.00 15.14 C -ATOM 399 O GLY A 52 9.333 -5.412 26.407 1.00 15.99 O -ATOM 400 N ALA A 53 7.731 -4.935 24.916 1.00 18.76 N -ATOM 401 CA ALA A 53 8.646 -5.080 23.781 1.00 14.32 C -ATOM 402 C ALA A 53 9.731 -4.043 23.846 1.00 10.54 C -ATOM 403 O ALA A 53 10.860 -4.300 23.428 1.00 15.30 O -ATOM 404 CB ALA A 53 7.858 -4.926 22.504 1.00 14.72 C -ATOM 405 N GLU A 54 9.478 -2.845 24.408 1.00 13.35 N -ATOM 406 CA GLU A 54 10.494 -1.846 24.572 1.00 13.86 C -ATOM 407 C GLU A 54 11.561 -2.194 25.631 1.00 17.54 C -ATOM 408 O GLU A 54 12.581 -1.509 25.658 1.00 17.99 O -ATOM 409 CB GLU A 54 9.754 -0.556 24.867 1.00 16.36 C -ATOM 410 CG GLU A 54 10.604 0.728 24.700 1.00 19.98 C -ATOM 411 CD GLU A 54 11.242 1.324 25.973 1.00 33.77 C -ATOM 412 OE1 GLU A 54 10.752 1.040 27.063 1.00 26.33 O -ATOM 413 OE2 GLU A 54 12.220 2.070 25.890 1.00 28.75 O -ATOM 414 N THR A 55 11.475 -3.220 26.506 1.00 19.05 N -ATOM 415 CA THR A 55 12.551 -3.557 27.444 1.00 15.96 C -ATOM 416 C THR A 55 13.110 -4.947 27.155 1.00 17.46 C -ATOM 417 O THR A 55 14.042 -5.381 27.817 1.00 21.17 O -ATOM 418 CB THR A 55 12.005 -3.513 28.919 1.00 13.94 C -ATOM 419 OG1 THR A 55 11.287 -4.727 29.108 1.00 16.77 O -ATOM 420 CG2 THR A 55 11.073 -2.348 29.195 1.00 18.93 C -ATOM 421 N GLY A 56 12.570 -5.748 26.218 1.00 18.11 N -ATOM 422 CA GLY A 56 13.084 -7.088 25.925 1.00 14.36 C -ATOM 423 C GLY A 56 12.237 -8.176 26.524 1.00 14.53 C -ATOM 424 O GLY A 56 12.434 -9.374 26.329 1.00 19.77 O -ATOM 425 N GLU A 57 11.236 -7.772 27.302 1.00 17.95 N -ATOM 426 CA GLU A 57 10.388 -8.714 28.003 1.00 14.56 C -ATOM 427 C GLU A 57 9.399 -9.429 27.094 1.00 19.55 C -ATOM 428 O GLU A 57 8.985 -10.570 27.364 1.00 18.74 O -ATOM 429 CB GLU A 57 9.647 -7.937 29.080 1.00 15.25 C -ATOM 430 CG GLU A 57 8.695 -8.852 29.844 1.00 25.44 C -ATOM 431 CD GLU A 57 7.968 -8.238 31.032 1.00 32.41 C -ATOM 432 OE1 GLU A 57 7.965 -7.015 31.165 1.00 25.94 O -ATOM 433 OE2 GLU A 57 7.404 -9.005 31.819 1.00 40.55 O -ATOM 434 N ASP A 58 8.907 -8.711 26.061 1.00 16.20 N -ATOM 435 CA ASP A 58 7.928 -9.271 25.141 1.00 12.73 C -ATOM 436 C ASP A 58 8.437 -9.040 23.703 1.00 13.30 C -ATOM 437 O ASP A 58 9.261 -8.155 23.492 1.00 14.77 O -ATOM 438 CB ASP A 58 6.608 -8.577 25.263 1.00 14.67 C -ATOM 439 CG ASP A 58 5.857 -8.919 26.553 1.00 21.34 C -ATOM 440 OD1 ASP A 58 5.853 -10.077 26.968 1.00 21.30 O -ATOM 441 OD2 ASP A 58 5.266 -8.004 27.106 1.00 23.15 O -ATOM 442 N GLY A 59 7.926 -9.816 22.763 1.00 19.15 N -ATOM 443 CA GLY A 59 8.326 -9.704 21.358 1.00 17.18 C -ATOM 444 C GLY A 59 9.697 -10.284 21.149 1.00 19.54 C -ATOM 445 O GLY A 59 10.389 -10.660 22.106 1.00 19.80 O -ATOM 446 N THR A 60 10.154 -10.452 19.904 1.00 16.10 N -ATOM 447 CA THR A 60 11.516 -10.939 19.634 1.00 16.20 C -ATOM 448 C THR A 60 12.208 -10.120 18.533 1.00 19.22 C -ATOM 449 O THR A 60 11.492 -9.446 17.781 1.00 17.59 O -ATOM 450 CB THR A 60 11.550 -12.410 19.180 1.00 22.89 C -ATOM 451 OG1 THR A 60 10.585 -12.586 18.156 1.00 24.63 O -ATOM 452 CG2 THR A 60 11.269 -13.368 20.330 1.00 22.82 C -ATOM 453 N VAL A 61 13.543 -10.107 18.509 1.00 17.23 N -ATOM 454 CA VAL A 61 14.372 -9.452 17.504 1.00 19.01 C -ATOM 455 C VAL A 61 15.238 -10.597 16.937 1.00 26.28 C -ATOM 456 O VAL A 61 15.644 -11.502 17.696 1.00 18.85 O -ATOM 457 CB VAL A 61 15.254 -8.357 18.149 1.00 17.83 C -ATOM 458 CG1 VAL A 61 16.149 -7.691 17.106 1.00 18.08 C -ATOM 459 CG2 VAL A 61 14.370 -7.300 18.743 1.00 17.74 C -ATOM 460 N PHE A 62 15.514 -10.677 15.619 1.00 19.51 N -ATOM 461 CA PHE A 62 16.360 -11.751 15.103 1.00 17.61 C -ATOM 462 C PHE A 62 17.285 -11.275 13.976 1.00 21.17 C -ATOM 463 O PHE A 62 17.061 -10.220 13.354 1.00 17.39 O -ATOM 464 CB PHE A 62 15.511 -12.906 14.593 1.00 17.41 C -ATOM 465 CG PHE A 62 14.791 -12.663 13.262 1.00 22.01 C -ATOM 466 CD1 PHE A 62 15.435 -12.942 12.052 1.00 26.08 C -ATOM 467 CD2 PHE A 62 13.491 -12.194 13.274 1.00 20.41 C -ATOM 468 CE1 PHE A 62 14.763 -12.753 10.858 1.00 24.18 C -ATOM 469 CE2 PHE A 62 12.832 -12.009 12.065 1.00 39.24 C -ATOM 470 CZ PHE A 62 13.459 -12.287 10.860 1.00 26.42 C -ATOM 471 N LEU A 63 18.313 -12.091 13.770 1.00 21.61 N -ATOM 472 CA LEU A 63 19.300 -11.936 12.695 1.00 23.98 C -ATOM 473 C LEU A 63 19.526 -13.326 12.165 1.00 24.88 C -ATOM 474 O LEU A 63 19.743 -14.212 12.996 1.00 20.07 O -ATOM 475 CB LEU A 63 20.666 -11.435 13.169 1.00 23.98 C -ATOM 476 CG LEU A 63 21.744 -11.227 12.093 1.00 27.68 C -ATOM 477 CD1 LEU A 63 21.356 -10.091 11.154 1.00 22.99 C -ATOM 478 CD2 LEU A 63 23.025 -10.825 12.760 1.00 34.32 C -ATOM 479 N SER A 64 19.433 -13.609 10.848 1.00 21.19 N -ATOM 480 CA SER A 64 19.710 -14.943 10.320 1.00 18.57 C -ATOM 481 C SER A 64 20.561 -14.868 9.041 1.00 18.66 C -ATOM 482 O SER A 64 20.680 -13.840 8.382 1.00 22.26 O -ATOM 483 CB SER A 64 18.431 -15.690 10.024 1.00 18.27 C -ATOM 484 OG SER A 64 17.538 -15.009 9.176 1.00 24.76 O -ATOM 485 N GLY A 65 21.253 -15.940 8.800 1.00 21.15 N -ATOM 486 CA GLY A 65 22.140 -16.038 7.682 1.00 24.41 C -ATOM 487 C GLY A 65 22.359 -17.507 7.432 1.00 28.66 C -ATOM 488 O GLY A 65 21.615 -18.399 7.867 1.00 22.09 O -ATOM 489 N ALA A 66 23.471 -17.768 6.775 1.00 26.28 N -ATOM 490 CA ALA A 66 23.831 -19.125 6.445 1.00 25.46 C -ATOM 491 C ALA A 66 24.142 -19.955 7.687 1.00 26.02 C -ATOM 492 O ALA A 66 24.006 -21.176 7.675 1.00 27.00 O -ATOM 493 CB ALA A 66 25.052 -19.103 5.562 1.00 28.91 C -ATOM 494 N PHE A 67 24.560 -19.236 8.733 1.00 33.18 N -ATOM 495 CA PHE A 67 24.872 -19.766 10.064 1.00 33.95 C -ATOM 496 C PHE A 67 23.639 -20.176 10.879 1.00 35.16 C -ATOM 497 O PHE A 67 23.792 -20.833 11.897 1.00 30.66 O -ATOM 498 CB PHE A 67 25.670 -18.717 10.875 1.00 23.01 C -ATOM 499 CG PHE A 67 24.970 -17.367 11.142 1.00 45.98 C -ATOM 500 CD1 PHE A 67 24.078 -17.228 12.210 1.00 41.66 C -ATOM 501 CD2 PHE A 67 25.204 -16.287 10.294 1.00 34.67 C -ATOM 502 CE1 PHE A 67 23.430 -16.028 12.410 1.00 40.95 C -ATOM 503 CE2 PHE A 67 24.550 -15.087 10.505 1.00 32.83 C -ATOM 504 CZ PHE A 67 23.665 -14.960 11.562 1.00 35.21 C -ATOM 505 N GLY A 68 22.416 -19.819 10.532 1.00 20.84 N -ATOM 506 CA GLY A 68 21.265 -20.203 11.306 1.00 21.82 C -ATOM 507 C GLY A 68 20.642 -18.916 11.769 1.00 28.92 C -ATOM 508 O GLY A 68 20.925 -17.877 11.156 1.00 24.29 O -ATOM 509 N LYS A 69 19.851 -18.891 12.843 1.00 21.72 N -ATOM 510 CA LYS A 69 19.098 -17.707 13.231 1.00 18.84 C -ATOM 511 C LYS A 69 19.320 -17.462 14.730 1.00 23.51 C -ATOM 512 O LYS A 69 19.251 -18.415 15.506 1.00 20.90 O -ATOM 513 CB LYS A 69 17.634 -17.977 12.954 1.00 16.30 C -ATOM 514 CG LYS A 69 16.700 -16.815 13.294 1.00 16.85 C -ATOM 515 CD LYS A 69 15.304 -17.356 13.064 1.00 20.17 C -ATOM 516 CE LYS A 69 14.288 -16.324 13.436 1.00 31.92 C -ATOM 517 NZ LYS A 69 12.951 -16.787 13.098 1.00 46.73 N -ATOM 518 N ILE A 70 19.558 -16.242 15.121 1.00 19.45 N -ATOM 519 CA ILE A 70 19.738 -15.850 16.517 1.00 23.74 C -ATOM 520 C ILE A 70 18.550 -14.960 16.846 1.00 25.87 C -ATOM 521 O ILE A 70 18.354 -13.935 16.184 1.00 20.11 O -ATOM 522 CB ILE A 70 21.033 -15.053 16.665 1.00 25.58 C -ATOM 523 CG1 ILE A 70 22.222 -15.938 16.316 1.00 43.31 C -ATOM 524 CG2 ILE A 70 21.155 -14.549 18.101 1.00 33.44 C -ATOM 525 CD1 ILE A 70 23.489 -15.098 16.072 1.00 57.37 C -ATOM 526 N GLU A 71 17.762 -15.262 17.870 1.00 19.38 N -ATOM 527 CA GLU A 71 16.580 -14.500 18.236 1.00 17.37 C -ATOM 528 C GLU A 71 16.710 -14.081 19.723 1.00 24.39 C -ATOM 529 O GLU A 71 17.124 -14.941 20.523 1.00 20.85 O -ATOM 530 CB GLU A 71 15.440 -15.420 18.004 1.00 15.42 C -ATOM 531 CG GLU A 71 14.084 -14.781 18.104 1.00 22.29 C -ATOM 532 CD GLU A 71 12.943 -15.740 17.774 1.00 23.14 C -ATOM 533 OE1 GLU A 71 13.125 -16.928 17.975 1.00 42.67 O -ATOM 534 OE2 GLU A 71 11.889 -15.293 17.301 1.00 53.77 O -ATOM 535 N MET A 72 16.371 -12.852 20.135 1.00 19.50 N -ATOM 536 CA MET A 72 16.509 -12.441 21.530 1.00 17.32 C -ATOM 537 C MET A 72 15.222 -11.759 21.904 1.00 23.46 C -ATOM 538 O MET A 72 14.672 -11.008 21.078 1.00 19.57 O -ATOM 539 CB MET A 72 17.661 -11.496 21.646 1.00 18.57 C -ATOM 540 CG MET A 72 18.009 -11.158 23.111 1.00 19.11 C -ATOM 541 SD MET A 72 19.490 -10.156 23.277 1.00 23.42 S -ATOM 542 CE MET A 72 20.692 -11.366 22.863 1.00 18.32 C -ATOM 543 N GLY A 73 14.688 -12.049 23.105 1.00 17.35 N -ATOM 544 CA GLY A 73 13.504 -11.376 23.637 1.00 14.94 C -ATOM 545 C GLY A 73 12.683 -12.424 24.343 1.00 13.51 C -ATOM 546 O GLY A 73 13.232 -13.308 25.002 1.00 18.04 O -ATOM 547 N ASP A 74 11.386 -12.433 24.107 1.00 15.69 N -ATOM 548 CA ASP A 74 10.515 -13.406 24.681 1.00 17.65 C -ATOM 549 C ASP A 74 10.486 -14.603 23.728 1.00 22.75 C -ATOM 550 O ASP A 74 9.524 -14.828 23.003 1.00 21.21 O -ATOM 551 CB ASP A 74 9.137 -12.740 24.892 1.00 14.59 C -ATOM 552 CG ASP A 74 8.076 -13.590 25.598 1.00 19.98 C -ATOM 553 OD1 ASP A 74 8.318 -14.775 25.902 1.00 18.00 O -ATOM 554 OD2 ASP A 74 6.980 -13.063 25.837 1.00 24.40 O -ATOM 555 N ALA A 75 11.532 -15.419 23.750 1.00 18.50 N -ATOM 556 CA ALA A 75 11.713 -16.573 22.864 1.00 19.75 C -ATOM 557 C ALA A 75 11.337 -17.890 23.491 1.00 25.86 C -ATOM 558 O ALA A 75 11.278 -18.023 24.725 1.00 24.49 O -ATOM 559 CB ALA A 75 13.178 -16.655 22.429 1.00 15.70 C -ATOM 560 N LEU A 76 11.070 -18.878 22.664 1.00 18.04 N -ATOM 561 CA LEU A 76 10.802 -20.214 23.107 1.00 15.51 C -ATOM 562 C LEU A 76 12.092 -20.838 23.503 1.00 14.71 C -ATOM 563 O LEU A 76 13.152 -20.342 23.143 1.00 17.59 O -ATOM 564 CB LEU A 76 10.206 -21.060 22.015 1.00 16.00 C -ATOM 565 CG LEU A 76 8.883 -20.535 21.479 1.00 22.46 C -ATOM 566 CD1 LEU A 76 8.475 -21.434 20.341 1.00 21.79 C -ATOM 567 CD2 LEU A 76 7.799 -20.480 22.572 1.00 22.12 C -ATOM 568 N GLY A 77 12.076 -21.891 24.310 1.00 17.76 N -ATOM 569 CA GLY A 77 13.327 -22.567 24.572 1.00 17.10 C -ATOM 570 C GLY A 77 13.556 -23.559 23.419 1.00 17.15 C -ATOM 571 O GLY A 77 12.610 -23.809 22.655 1.00 18.35 O -ATOM 572 N ALA A 78 14.754 -24.139 23.296 1.00 20.25 N -ATOM 573 CA ALA A 78 15.128 -25.036 22.197 1.00 16.35 C -ATOM 574 C ALA A 78 14.198 -26.183 21.912 1.00 23.67 C -ATOM 575 O ALA A 78 13.814 -26.393 20.755 1.00 22.78 O -ATOM 576 CB ALA A 78 16.462 -25.588 22.481 1.00 18.71 C -ATOM 577 N SER A 79 13.714 -26.937 22.908 1.00 18.97 N -ATOM 578 CA SER A 79 12.786 -28.017 22.665 1.00 20.71 C -ATOM 579 C SER A 79 11.439 -27.556 22.153 1.00 27.48 C -ATOM 580 O SER A 79 10.922 -28.131 21.189 1.00 21.54 O -ATOM 581 CB SER A 79 12.560 -28.836 23.938 1.00 24.34 C -ATOM 582 OG SER A 79 13.824 -29.214 24.459 1.00 24.45 O -ATOM 583 N GLU A 80 10.819 -26.536 22.748 1.00 20.47 N -ATOM 584 CA GLU A 80 9.535 -26.056 22.298 1.00 18.48 C -ATOM 585 C GLU A 80 9.685 -25.501 20.868 1.00 15.64 C -ATOM 586 O GLU A 80 8.783 -25.769 20.080 1.00 21.68 O -ATOM 587 CB GLU A 80 9.069 -24.969 23.223 1.00 14.52 C -ATOM 588 CG GLU A 80 7.633 -24.660 22.893 1.00 19.36 C -ATOM 589 CD GLU A 80 6.848 -23.844 23.889 1.00 21.31 C -ATOM 590 OE1 GLU A 80 7.308 -23.565 24.990 1.00 23.28 O -ATOM 591 OE2 GLU A 80 5.698 -23.516 23.611 1.00 17.31 O -ATOM 592 N ALA A 81 10.788 -24.801 20.564 1.00 18.80 N -ATOM 593 CA ALA A 81 11.098 -24.231 19.243 1.00 19.97 C -ATOM 594 C ALA A 81 11.057 -25.363 18.192 1.00 25.91 C -ATOM 595 O ALA A 81 10.494 -25.167 17.108 1.00 26.82 O -ATOM 596 CB ALA A 81 12.488 -23.601 19.244 1.00 18.56 C -ATOM 597 N LEU A 82 11.536 -26.581 18.470 1.00 24.81 N -ATOM 598 CA LEU A 82 11.430 -27.667 17.504 1.00 20.49 C -ATOM 599 C LEU A 82 10.182 -28.507 17.592 1.00 30.61 C -ATOM 600 O LEU A 82 9.701 -28.908 16.531 1.00 30.38 O -ATOM 601 CB LEU A 82 12.645 -28.604 17.602 1.00 18.07 C -ATOM 602 CG LEU A 82 14.010 -27.947 17.469 1.00 23.91 C -ATOM 603 CD1 LEU A 82 15.093 -28.988 17.327 1.00 21.74 C -ATOM 604 CD2 LEU A 82 13.996 -27.023 16.282 1.00 22.55 C -ATOM 605 N PHE A 83 9.531 -28.797 18.743 1.00 23.86 N -ATOM 606 CA PHE A 83 8.420 -29.760 18.772 1.00 18.13 C -ATOM 607 C PHE A 83 7.055 -29.177 18.997 1.00 21.39 C -ATOM 608 O PHE A 83 6.075 -29.879 18.742 1.00 24.29 O -ATOM 609 CB PHE A 83 8.669 -30.868 19.847 1.00 20.46 C -ATOM 610 CG PHE A 83 10.096 -31.430 19.770 1.00 31.47 C -ATOM 611 CD1 PHE A 83 10.595 -31.925 18.569 1.00 36.76 C -ATOM 612 CD2 PHE A 83 10.920 -31.396 20.884 1.00 29.87 C -ATOM 613 CE1 PHE A 83 11.894 -32.359 18.508 1.00 29.95 C -ATOM 614 CE2 PHE A 83 12.217 -31.832 20.811 1.00 27.18 C -ATOM 615 CZ PHE A 83 12.701 -32.308 19.620 1.00 28.91 C -ATOM 616 N GLY A 84 6.950 -27.901 19.432 1.00 21.59 N -ATOM 617 CA GLY A 84 5.655 -27.273 19.633 1.00 19.54 C -ATOM 618 C GLY A 84 4.752 -27.918 20.688 1.00 20.13 C -ATOM 619 O GLY A 84 5.208 -28.576 21.628 1.00 24.79 O -ATOM 620 N ASP A 85 3.452 -27.708 20.541 1.00 18.15 N -ATOM 621 CA ASP A 85 2.428 -28.142 21.477 1.00 22.04 C -ATOM 622 C ASP A 85 1.488 -29.149 20.869 1.00 32.84 C -ATOM 623 O ASP A 85 1.564 -29.420 19.679 1.00 25.86 O -ATOM 624 CB ASP A 85 1.613 -26.922 21.969 1.00 21.66 C -ATOM 625 CG ASP A 85 2.469 -26.050 22.883 1.00 22.97 C -ATOM 626 OD1 ASP A 85 3.261 -26.564 23.668 1.00 22.67 O -ATOM 627 OD2 ASP A 85 2.388 -24.840 22.763 1.00 22.22 O -ATOM 628 N LEU A 86 0.563 -29.709 21.643 1.00 21.52 N -ATOM 629 CA LEU A 86 -0.397 -30.678 21.160 1.00 19.15 C -ATOM 630 C LEU A 86 -1.549 -29.874 20.579 1.00 18.35 C -ATOM 631 O LEU A 86 -1.559 -28.627 20.662 1.00 21.62 O -ATOM 632 CB LEU A 86 -0.857 -31.592 22.322 1.00 18.02 C -ATOM 633 CG LEU A 86 0.206 -32.397 23.057 1.00 21.20 C -ATOM 634 CD1 LEU A 86 -0.562 -33.296 24.012 1.00 24.06 C -ATOM 635 CD2 LEU A 86 1.083 -33.271 22.144 1.00 22.07 C -ATOM 636 N TYR A 87 -2.516 -30.554 19.969 1.00 20.03 N -ATOM 637 CA TYR A 87 -3.665 -29.918 19.323 1.00 23.10 C -ATOM 638 C TYR A 87 -4.395 -28.937 20.251 1.00 35.01 C -ATOM 639 O TYR A 87 -4.824 -29.313 21.327 1.00 21.25 O -ATOM 640 CB TYR A 87 -4.648 -31.014 18.836 1.00 22.33 C -ATOM 641 CG TYR A 87 -5.850 -30.450 18.083 1.00 24.26 C -ATOM 642 CD1 TYR A 87 -5.703 -29.865 16.826 1.00 29.11 C -ATOM 643 CD2 TYR A 87 -7.092 -30.502 18.680 1.00 25.25 C -ATOM 644 CE1 TYR A 87 -6.812 -29.336 16.187 1.00 24.19 C -ATOM 645 CE2 TYR A 87 -8.197 -29.969 18.054 1.00 23.60 C -ATOM 646 CZ TYR A 87 -8.038 -29.393 16.820 1.00 32.01 C -ATOM 647 OH TYR A 87 -9.141 -28.823 16.238 1.00 38.33 O -ATOM 648 N GLU A 88 -4.612 -27.696 19.830 1.00 24.04 N -ATOM 649 CA GLU A 88 -5.228 -26.664 20.628 1.00 23.00 C -ATOM 650 C GLU A 88 -6.711 -26.782 20.555 1.00 28.26 C -ATOM 651 O GLU A 88 -7.325 -26.777 19.487 1.00 25.13 O -ATOM 652 CB GLU A 88 -4.745 -25.312 20.120 1.00 19.61 C -ATOM 653 CG GLU A 88 -5.293 -24.187 20.941 1.00 19.84 C -ATOM 654 CD GLU A 88 -4.733 -22.814 20.603 1.00 19.96 C -ATOM 655 OE1 GLU A 88 -3.531 -22.588 20.634 1.00 22.24 O -ATOM 656 OE2 GLU A 88 -5.525 -21.927 20.345 1.00 28.96 O -ATOM 657 N VAL A 89 -7.293 -26.892 21.731 1.00 20.98 N -ATOM 658 CA VAL A 89 -8.725 -27.043 21.863 1.00 19.79 C -ATOM 659 C VAL A 89 -9.368 -25.772 22.381 1.00 21.24 C -ATOM 660 O VAL A 89 -8.820 -25.141 23.301 1.00 25.75 O -ATOM 661 CB VAL A 89 -8.985 -28.240 22.811 1.00 21.18 C -ATOM 662 CG1 VAL A 89 -10.471 -28.313 23.162 1.00 20.32 C -ATOM 663 CG2 VAL A 89 -8.500 -29.529 22.147 1.00 23.18 C -ATOM 664 N GLY A 90 -10.544 -25.508 21.775 1.00 18.46 N -ATOM 665 CA GLY A 90 -11.503 -24.447 22.072 1.00 17.42 C -ATOM 666 C GLY A 90 -11.182 -23.088 21.423 1.00 16.29 C -ATOM 667 O GLY A 90 -10.017 -22.772 21.178 1.00 21.52 O -ATOM 668 N TYR A 91 -12.170 -22.231 21.137 1.00 15.81 N -ATOM 669 CA TYR A 91 -11.894 -20.937 20.537 1.00 16.90 C -ATOM 670 C TYR A 91 -11.119 -20.046 21.479 1.00 20.78 C -ATOM 671 O TYR A 91 -10.452 -19.147 20.996 1.00 20.06 O -ATOM 672 CB TYR A 91 -13.201 -20.266 20.121 1.00 14.86 C -ATOM 673 CG TYR A 91 -13.911 -19.353 21.115 1.00 20.42 C -ATOM 674 CD1 TYR A 91 -13.614 -18.019 21.136 1.00 17.43 C -ATOM 675 CD2 TYR A 91 -14.866 -19.845 21.983 1.00 21.36 C -ATOM 676 CE1 TYR A 91 -14.268 -17.195 22.018 1.00 21.64 C -ATOM 677 CE2 TYR A 91 -15.536 -19.021 22.871 1.00 17.13 C -ATOM 678 CZ TYR A 91 -15.218 -17.704 22.874 1.00 16.53 C -ATOM 679 OH TYR A 91 -15.829 -16.860 23.749 1.00 19.49 O -ATOM 680 N THR A 92 -11.188 -20.209 22.824 1.00 22.98 N -ATOM 681 CA THR A 92 -10.447 -19.354 23.771 1.00 20.64 C -ATOM 682 C THR A 92 -9.123 -20.013 24.167 1.00 19.15 C -ATOM 683 O THR A 92 -8.362 -19.403 24.901 1.00 20.90 O -ATOM 684 CB THR A 92 -11.280 -19.076 25.084 1.00 15.66 C -ATOM 685 OG1 THR A 92 -11.525 -20.348 25.670 1.00 19.23 O -ATOM 686 CG2 THR A 92 -12.624 -18.457 24.881 1.00 13.61 C -ATOM 687 N ASP A 93 -8.787 -21.221 23.667 1.00 18.00 N -ATOM 688 CA ASP A 93 -7.643 -22.059 24.031 1.00 18.24 C -ATOM 689 C ASP A 93 -7.851 -22.464 25.485 1.00 25.81 C -ATOM 690 O ASP A 93 -7.377 -21.806 26.430 1.00 22.47 O -ATOM 691 CB ASP A 93 -6.291 -21.317 23.863 1.00 17.88 C -ATOM 692 CG ASP A 93 -5.053 -22.146 24.152 1.00 20.65 C -ATOM 693 OD1 ASP A 93 -5.084 -23.364 24.383 1.00 25.25 O -ATOM 694 OD2 ASP A 93 -3.957 -21.594 24.164 1.00 20.38 O -ATOM 695 N LEU A 94 -8.639 -23.527 25.668 1.00 23.49 N -ATOM 696 CA LEU A 94 -9.100 -23.935 27.007 1.00 22.32 C -ATOM 697 C LEU A 94 -8.008 -24.604 27.802 1.00 20.94 C -ATOM 698 O LEU A 94 -7.974 -25.821 27.928 1.00 22.40 O -ATOM 699 CB LEU A 94 -10.273 -24.902 26.917 1.00 24.80 C -ATOM 700 CG LEU A 94 -11.581 -24.375 26.447 1.00 24.83 C -ATOM 701 CD1 LEU A 94 -12.516 -25.561 26.131 1.00 24.63 C -ATOM 702 CD2 LEU A 94 -12.146 -23.440 27.488 1.00 23.77 C -ATOM 703 N ASP A 95 -7.099 -23.826 28.366 1.00 18.41 N -ATOM 704 CA ASP A 95 -6.002 -24.365 29.143 1.00 18.77 C -ATOM 705 C ASP A 95 -6.284 -24.434 30.644 1.00 24.15 C -ATOM 706 O ASP A 95 -5.442 -24.795 31.454 1.00 20.30 O -ATOM 707 CB ASP A 95 -4.809 -23.519 28.974 1.00 17.45 C -ATOM 708 CG ASP A 95 -4.129 -23.674 27.640 1.00 24.99 C -ATOM 709 OD1 ASP A 95 -4.161 -24.728 27.031 1.00 21.65 O -ATOM 710 OD2 ASP A 95 -3.530 -22.716 27.180 1.00 22.05 O -ATOM 711 N ASP A 96 -7.492 -24.085 31.012 1.00 20.70 N -ATOM 712 CA ASP A 96 -7.930 -23.954 32.391 1.00 32.92 C -ATOM 713 C ASP A 96 -7.735 -25.224 33.224 1.00 36.10 C -ATOM 714 O ASP A 96 -7.517 -25.108 34.428 1.00 35.21 O -ATOM 715 CB ASP A 96 -9.409 -23.549 32.372 1.00 30.21 C -ATOM 716 CG ASP A 96 -9.729 -22.319 31.536 1.00 59.42 C -ATOM 717 OD1 ASP A 96 -9.849 -22.388 30.298 1.00 30.49 O -ATOM 718 OD2 ASP A 96 -9.838 -21.277 32.168 1.00 41.87 O -ATOM 719 N ARG A 97 -7.799 -26.443 32.668 1.00 26.01 N -ATOM 720 CA ARG A 97 -7.645 -27.688 33.412 1.00 19.44 C -ATOM 721 C ARG A 97 -6.329 -28.368 33.142 1.00 21.06 C -ATOM 722 O ARG A 97 -6.125 -29.539 33.499 1.00 27.98 O -ATOM 723 CB ARG A 97 -8.821 -28.616 33.064 1.00 19.30 C -ATOM 724 CG ARG A 97 -10.199 -28.149 33.511 1.00 23.19 C -ATOM 725 CD ARG A 97 -10.293 -28.108 35.047 1.00 30.26 C -ATOM 726 NE ARG A 97 -11.599 -27.602 35.423 1.00 30.05 N -ATOM 727 CZ ARG A 97 -11.841 -26.321 35.774 1.00 29.77 C -ATOM 728 NH1 ARG A 97 -10.861 -25.427 35.835 1.00 40.21 N -ATOM 729 NH2 ARG A 97 -13.097 -25.868 35.956 1.00 29.73 N -ATOM 730 N GLY A 98 -5.379 -27.669 32.518 1.00 22.17 N -ATOM 731 CA GLY A 98 -4.081 -28.250 32.166 1.00 19.78 C -ATOM 732 C GLY A 98 -3.587 -27.777 30.785 1.00 21.06 C -ATOM 733 O GLY A 98 -2.408 -27.445 30.590 1.00 26.48 O -ATOM 734 N GLY A 99 -4.531 -27.865 29.847 1.00 26.61 N -ATOM 735 CA GLY A 99 -4.325 -27.364 28.504 1.00 26.18 C -ATOM 736 C GLY A 99 -3.553 -28.261 27.572 1.00 24.45 C -ATOM 737 O GLY A 99 -3.059 -29.334 27.906 1.00 23.54 O -ATOM 738 N ASN A 100 -3.380 -27.785 26.358 1.00 25.90 N -ATOM 739 CA ASN A 100 -2.760 -28.567 25.281 1.00 19.24 C -ATOM 740 C ASN A 100 -1.272 -28.389 25.247 1.00 19.02 C -ATOM 741 O ASN A 100 -0.561 -29.090 24.545 1.00 22.88 O -ATOM 742 CB ASN A 100 -3.383 -28.115 23.946 1.00 23.30 C -ATOM 743 CG ASN A 100 -3.047 -26.667 23.616 1.00 22.39 C -ATOM 744 OD1 ASN A 100 -3.379 -25.727 24.342 1.00 24.51 O -ATOM 745 ND2 ASN A 100 -2.335 -26.428 22.526 1.00 21.36 N -ATOM 746 N ASP A 101 -0.712 -27.422 25.954 1.00 21.84 N -ATOM 747 CA ASP A 101 0.699 -27.106 25.874 1.00 16.59 C -ATOM 748 C ASP A 101 1.559 -28.190 26.422 1.00 26.25 C -ATOM 749 O ASP A 101 1.207 -28.795 27.422 1.00 24.73 O -ATOM 750 CB ASP A 101 0.994 -25.823 26.639 1.00 17.86 C -ATOM 751 CG ASP A 101 0.141 -24.622 26.220 1.00 18.10 C -ATOM 752 OD1 ASP A 101 -1.064 -24.668 25.870 1.00 23.14 O -ATOM 753 OD2 ASP A 101 0.747 -23.573 26.231 1.00 23.00 O -ATOM 754 N ILE A 102 2.666 -28.500 25.798 1.00 19.76 N -ATOM 755 CA ILE A 102 3.537 -29.509 26.333 1.00 21.70 C -ATOM 756 C ILE A 102 4.321 -28.842 27.477 1.00 22.28 C -ATOM 757 O ILE A 102 4.686 -27.665 27.349 1.00 20.29 O -ATOM 758 CB ILE A 102 4.443 -30.043 25.154 1.00 19.72 C -ATOM 759 CG1 ILE A 102 3.599 -30.939 24.230 1.00 25.08 C -ATOM 760 CG2 ILE A 102 5.665 -30.807 25.682 1.00 18.10 C -ATOM 761 CD1 ILE A 102 4.422 -31.467 23.005 1.00 22.45 C -ATOM 762 N PRO A 103 4.621 -29.544 28.600 1.00 24.84 N -ATOM 763 CA PRO A 103 5.227 -28.946 29.789 1.00 28.04 C -ATOM 764 C PRO A 103 6.720 -28.787 29.684 1.00 25.87 C -ATOM 765 O PRO A 103 7.484 -29.523 30.324 1.00 26.05 O -ATOM 766 CB PRO A 103 4.775 -29.866 30.923 1.00 21.68 C -ATOM 767 CG PRO A 103 4.679 -31.225 30.267 1.00 24.38 C -ATOM 768 CD PRO A 103 4.108 -30.899 28.902 1.00 21.16 C -ATOM 769 N TYR A 104 7.182 -27.838 28.863 1.00 18.31 N -ATOM 770 CA TYR A 104 8.608 -27.635 28.761 1.00 18.73 C -ATOM 771 C TYR A 104 9.073 -26.921 30.023 1.00 20.07 C -ATOM 772 O TYR A 104 8.361 -26.098 30.593 1.00 21.70 O -ATOM 773 CB TYR A 104 8.971 -26.789 27.514 1.00 20.72 C -ATOM 774 CG TYR A 104 8.556 -27.514 26.228 1.00 20.99 C -ATOM 775 CD1 TYR A 104 9.331 -28.550 25.758 1.00 23.25 C -ATOM 776 CD2 TYR A 104 7.414 -27.137 25.529 1.00 21.35 C -ATOM 777 CE1 TYR A 104 8.951 -29.198 24.590 1.00 23.05 C -ATOM 778 CE2 TYR A 104 7.042 -27.786 24.360 1.00 18.76 C -ATOM 779 CZ TYR A 104 7.830 -28.816 23.914 1.00 22.33 C -ATOM 780 OH TYR A 104 7.505 -29.528 22.797 1.00 26.62 O -ATOM 781 N LEU A 105 10.287 -27.267 30.428 1.00 19.68 N -ATOM 782 CA LEU A 105 10.892 -26.687 31.606 1.00 27.46 C -ATOM 783 C LEU A 105 11.398 -25.269 31.384 1.00 24.74 C -ATOM 784 O LEU A 105 11.335 -24.466 32.314 1.00 18.69 O -ATOM 785 CB LEU A 105 12.060 -27.619 32.094 1.00 24.81 C -ATOM 786 CG LEU A 105 12.850 -27.282 33.414 1.00 23.54 C -ATOM 787 CD1 LEU A 105 11.903 -27.421 34.607 1.00 22.08 C -ATOM 788 CD2 LEU A 105 14.036 -28.212 33.581 1.00 19.57 C -ATOM 789 N THR A 106 11.939 -24.878 30.204 1.00 22.99 N -ATOM 790 CA THR A 106 12.566 -23.563 30.052 1.00 22.98 C -ATOM 791 C THR A 106 11.922 -22.739 28.921 1.00 18.20 C -ATOM 792 O THR A 106 11.066 -23.276 28.199 1.00 21.22 O -ATOM 793 CB THR A 106 14.132 -23.718 29.810 1.00 29.35 C -ATOM 794 OG1 THR A 106 14.327 -24.208 28.473 1.00 25.92 O -ATOM 795 CG2 THR A 106 14.823 -24.635 30.873 1.00 19.42 C -ATOM 796 N GLY A 107 12.329 -21.461 28.785 1.00 17.26 N -ATOM 797 CA GLY A 107 11.894 -20.551 27.729 1.00 18.97 C -ATOM 798 C GLY A 107 10.440 -20.263 27.925 1.00 27.01 C -ATOM 799 O GLY A 107 9.838 -20.634 28.939 1.00 22.34 O -ATOM 800 N ASP A 108 9.898 -19.520 26.977 1.00 18.09 N -ATOM 801 CA ASP A 108 8.489 -19.175 26.967 1.00 14.02 C -ATOM 802 C ASP A 108 8.007 -18.619 28.318 1.00 16.56 C -ATOM 803 O ASP A 108 7.084 -19.135 28.971 1.00 19.46 O -ATOM 804 CB ASP A 108 7.652 -20.396 26.617 1.00 14.02 C -ATOM 805 CG ASP A 108 6.232 -20.071 26.186 1.00 20.04 C -ATOM 806 OD1 ASP A 108 5.930 -18.919 25.882 1.00 22.75 O -ATOM 807 OD2 ASP A 108 5.399 -20.983 26.091 1.00 21.20 O -ATOM 808 N GLU A 109 8.764 -17.583 28.705 1.00 18.15 N -ATOM 809 CA GLU A 109 8.495 -16.749 29.872 1.00 24.76 C -ATOM 810 C GLU A 109 8.816 -17.406 31.222 1.00 28.53 C -ATOM 811 O GLU A 109 8.360 -16.907 32.248 1.00 24.18 O -ATOM 812 CB GLU A 109 7.031 -16.306 29.903 1.00 23.74 C -ATOM 813 CG GLU A 109 6.609 -15.513 28.685 1.00 39.02 C -ATOM 814 CD GLU A 109 5.164 -15.091 28.776 1.00 35.83 C -ATOM 815 OE1 GLU A 109 4.307 -15.965 28.666 1.00 42.26 O -ATOM 816 OE2 GLU A 109 4.922 -13.901 28.984 1.00 50.54 O -ATOM 817 N ARG A 110 9.587 -18.495 31.296 1.00 23.57 N -ATOM 818 CA ARG A 110 10.058 -19.072 32.572 1.00 25.84 C -ATOM 819 C ARG A 110 10.919 -18.036 33.304 1.00 30.43 C -ATOM 820 O ARG A 110 10.672 -17.724 34.475 1.00 24.85 O -ATOM 821 CB ARG A 110 10.883 -20.353 32.319 1.00 21.39 C -ATOM 822 CG ARG A 110 11.404 -21.078 33.569 1.00 23.85 C -ATOM 823 CD ARG A 110 10.161 -21.588 34.342 1.00 24.89 C -ATOM 824 NE ARG A 110 9.647 -22.774 33.671 1.00 27.06 N -ATOM 825 CZ ARG A 110 8.375 -23.149 33.571 1.00 24.00 C -ATOM 826 NH1 ARG A 110 7.435 -22.413 34.118 1.00 34.29 N -ATOM 827 NH2 ARG A 110 8.022 -24.277 32.956 1.00 26.57 N -ATOM 828 N LEU A 111 11.915 -17.438 32.657 1.00 17.88 N -ATOM 829 CA LEU A 111 12.745 -16.429 33.264 1.00 18.66 C -ATOM 830 C LEU A 111 12.707 -15.080 32.576 1.00 19.35 C -ATOM 831 O LEU A 111 13.309 -14.108 33.051 1.00 18.67 O -ATOM 832 CB LEU A 111 14.157 -16.942 33.296 1.00 19.31 C -ATOM 833 CG LEU A 111 14.430 -18.083 34.253 1.00 24.75 C -ATOM 834 CD1 LEU A 111 15.824 -18.593 34.125 1.00 28.02 C -ATOM 835 CD2 LEU A 111 14.261 -17.553 35.646 1.00 33.78 C -ATOM 836 N THR A 112 12.007 -14.963 31.439 1.00 18.03 N -ATOM 837 CA THR A 112 11.980 -13.716 30.682 1.00 18.21 C -ATOM 838 C THR A 112 11.282 -12.671 31.542 1.00 16.40 C -ATOM 839 O THR A 112 10.238 -12.982 32.125 1.00 21.37 O -ATOM 840 CB THR A 112 11.196 -13.930 29.365 1.00 20.52 C -ATOM 841 OG1 THR A 112 11.651 -15.180 28.849 1.00 21.48 O -ATOM 842 CG2 THR A 112 11.362 -12.778 28.399 1.00 16.54 C -ATOM 843 N ALA A 113 11.761 -11.438 31.610 1.00 17.64 N -ATOM 844 CA ALA A 113 11.156 -10.417 32.442 1.00 22.16 C -ATOM 845 C ALA A 113 11.625 -9.054 31.967 1.00 23.20 C -ATOM 846 O ALA A 113 12.433 -8.975 31.031 1.00 21.50 O -ATOM 847 CB ALA A 113 11.606 -10.647 33.900 1.00 20.45 C -ATOM 848 N GLU A 114 11.168 -7.983 32.636 1.00 17.56 N -ATOM 849 CA GLU A 114 11.550 -6.643 32.300 1.00 17.62 C -ATOM 850 C GLU A 114 13.050 -6.545 32.268 1.00 20.21 C -ATOM 851 O GLU A 114 13.744 -7.079 33.127 1.00 19.38 O -ATOM 852 CB GLU A 114 10.943 -5.731 33.326 1.00 21.43 C -ATOM 853 CG GLU A 114 11.353 -4.286 33.067 1.00 31.92 C -ATOM 854 CD GLU A 114 10.679 -3.178 33.891 1.00 50.58 C -ATOM 855 OE1 GLU A 114 9.970 -3.484 34.845 1.00 58.25 O -ATOM 856 OE2 GLU A 114 10.863 -1.999 33.570 1.00 57.25 O -ATOM 857 N ASP A 115 13.595 -5.983 31.191 1.00 18.34 N -ATOM 858 CA ASP A 115 15.035 -5.858 30.963 1.00 18.30 C -ATOM 859 C ASP A 115 15.803 -7.156 30.977 1.00 14.16 C -ATOM 860 O ASP A 115 17.021 -7.232 31.237 1.00 18.02 O -ATOM 861 CB ASP A 115 15.700 -4.964 32.002 1.00 19.01 C -ATOM 862 CG ASP A 115 15.275 -3.526 32.012 1.00 25.40 C -ATOM 863 OD1 ASP A 115 14.861 -3.002 30.973 1.00 28.95 O -ATOM 864 OD2 ASP A 115 15.386 -2.918 33.069 1.00 32.28 O -ATOM 865 N ASN A 116 15.080 -8.231 30.694 1.00 16.08 N -ATOM 866 CA ASN A 116 15.715 -9.515 30.775 1.00 21.18 C -ATOM 867 C ASN A 116 15.183 -10.408 29.648 1.00 17.53 C -ATOM 868 O ASN A 116 14.329 -11.285 29.847 1.00 18.38 O -ATOM 869 CB ASN A 116 15.462 -10.131 32.189 1.00 13.57 C -ATOM 870 CG ASN A 116 16.452 -11.274 32.370 1.00 13.13 C -ATOM 871 OD1 ASN A 116 17.716 -11.114 32.335 1.00 22.25 O -ATOM 872 ND2 ASN A 116 15.861 -12.462 32.579 1.00 17.70 N -ATOM 873 N PRO A 117 15.676 -10.216 28.405 1.00 19.89 N -ATOM 874 CA PRO A 117 15.360 -11.102 27.297 1.00 22.27 C -ATOM 875 C PRO A 117 16.088 -12.442 27.412 1.00 18.54 C -ATOM 876 O PRO A 117 17.132 -12.521 28.078 1.00 18.89 O -ATOM 877 CB PRO A 117 15.760 -10.264 26.087 1.00 15.27 C -ATOM 878 CG PRO A 117 16.976 -9.504 26.572 1.00 17.83 C -ATOM 879 CD PRO A 117 16.553 -9.125 27.988 1.00 17.26 C -ATOM 880 N VAL A 118 15.596 -13.518 26.766 1.00 16.16 N -ATOM 881 CA VAL A 118 16.341 -14.777 26.664 1.00 16.43 C -ATOM 882 C VAL A 118 16.766 -14.959 25.175 1.00 25.34 C -ATOM 883 O VAL A 118 16.320 -14.206 24.289 1.00 19.32 O -ATOM 884 CB VAL A 118 15.473 -16.017 27.179 1.00 18.45 C -ATOM 885 CG1 VAL A 118 15.247 -15.671 28.696 1.00 15.26 C -ATOM 886 CG2 VAL A 118 14.085 -16.264 26.552 1.00 15.58 C -ATOM 887 N LEU A 119 17.618 -15.929 24.877 1.00 20.33 N -ATOM 888 CA LEU A 119 18.212 -16.171 23.561 1.00 20.99 C -ATOM 889 C LEU A 119 17.806 -17.484 22.914 1.00 20.18 C -ATOM 890 O LEU A 119 17.746 -18.515 23.600 1.00 19.36 O -ATOM 891 CB LEU A 119 19.702 -16.108 23.761 1.00 19.83 C -ATOM 892 CG LEU A 119 20.525 -16.192 22.531 1.00 29.38 C -ATOM 893 CD1 LEU A 119 20.499 -14.841 21.877 1.00 33.62 C -ATOM 894 CD2 LEU A 119 21.929 -16.539 22.872 1.00 28.54 C -ATOM 895 N LEU A 120 17.509 -17.596 21.616 1.00 16.23 N -ATOM 896 CA LEU A 120 17.189 -18.885 21.005 1.00 12.16 C -ATOM 897 C LEU A 120 17.994 -18.923 19.717 1.00 23.81 C -ATOM 898 O LEU A 120 17.999 -17.948 18.969 1.00 18.46 O -ATOM 899 CB LEU A 120 15.739 -19.008 20.630 1.00 14.54 C -ATOM 900 CG LEU A 120 15.309 -20.190 19.798 1.00 17.59 C -ATOM 901 CD1 LEU A 120 15.600 -21.483 20.543 1.00 20.38 C -ATOM 902 CD2 LEU A 120 13.811 -20.074 19.496 1.00 15.97 C -ATOM 903 N TYR A 121 18.739 -19.971 19.482 1.00 22.12 N -ATOM 904 CA TYR A 121 19.505 -20.129 18.261 1.00 23.52 C -ATOM 905 C TYR A 121 18.888 -21.304 17.518 1.00 22.86 C -ATOM 906 O TYR A 121 18.665 -22.334 18.165 1.00 23.27 O -ATOM 907 CB TYR A 121 20.961 -20.421 18.590 1.00 22.24 C -ATOM 908 CG TYR A 121 21.739 -20.937 17.382 1.00 25.99 C -ATOM 909 CD1 TYR A 121 22.117 -20.087 16.352 1.00 34.91 C -ATOM 910 CD2 TYR A 121 21.999 -22.288 17.324 1.00 26.29 C -ATOM 911 CE1 TYR A 121 22.758 -20.613 15.256 1.00 27.38 C -ATOM 912 CE2 TYR A 121 22.633 -22.826 16.234 1.00 35.27 C -ATOM 913 CZ TYR A 121 23.005 -21.983 15.214 1.00 36.17 C -ATOM 914 OH TYR A 121 23.631 -22.562 14.125 1.00 35.43 O -ATOM 915 N THR A 122 18.599 -21.227 16.193 1.00 22.81 N -ATOM 916 CA THR A 122 18.112 -22.375 15.451 1.00 19.32 C -ATOM 917 C THR A 122 18.914 -22.461 14.151 1.00 27.70 C -ATOM 918 O THR A 122 19.473 -21.465 13.656 1.00 21.98 O -ATOM 919 CB THR A 122 16.640 -22.248 15.110 1.00 21.37 C -ATOM 920 OG1 THR A 122 16.478 -20.913 14.669 1.00 27.26 O -ATOM 921 CG2 THR A 122 15.706 -22.489 16.285 1.00 29.49 C -ATOM 922 N TYR A 123 18.931 -23.678 13.643 1.00 26.58 N -ATOM 923 CA TYR A 123 19.626 -23.982 12.406 1.00 28.58 C -ATOM 924 C TYR A 123 19.029 -25.198 11.750 1.00 30.09 C -ATOM 925 O TYR A 123 18.779 -26.203 12.416 1.00 26.30 O -ATOM 926 CB TYR A 123 21.060 -24.251 12.713 1.00 29.46 C -ATOM 927 CG TYR A 123 21.859 -24.701 11.507 1.00 31.07 C -ATOM 928 CD1 TYR A 123 22.355 -23.720 10.683 1.00 39.10 C -ATOM 929 CD2 TYR A 123 22.061 -26.048 11.277 1.00 34.75 C -ATOM 930 CE1 TYR A 123 23.083 -24.079 9.583 1.00 35.87 C -ATOM 931 CE2 TYR A 123 22.787 -26.421 10.180 1.00 42.57 C -ATOM 932 CZ TYR A 123 23.284 -25.427 9.354 1.00 47.35 C -ATOM 933 OH TYR A 123 24.014 -25.777 8.240 1.00 53.04 O -ATOM 934 N SER A 124 18.827 -25.167 10.444 1.00 29.07 N -ATOM 935 CA SER A 124 18.380 -26.360 9.780 1.00 25.74 C -ATOM 936 C SER A 124 19.212 -26.528 8.512 1.00 32.52 C -ATOM 937 O SER A 124 19.737 -25.560 7.954 1.00 28.10 O -ATOM 938 CB SER A 124 16.959 -26.266 9.361 1.00 29.36 C -ATOM 939 OG SER A 124 16.102 -26.031 10.448 1.00 40.97 O -ATOM 940 N ALA A 125 19.358 -27.755 8.074 1.00 38.12 N -ATOM 941 CA ALA A 125 20.047 -28.066 6.845 1.00 28.40 C -ATOM 942 C ALA A 125 19.350 -29.333 6.392 1.00 30.58 C -ATOM 943 O ALA A 125 19.430 -30.369 7.065 1.00 39.26 O -ATOM 944 CB ALA A 125 21.487 -28.341 7.146 1.00 24.99 C -ATOM 945 N GLY A 126 18.578 -29.298 5.319 1.00 37.02 N -ATOM 946 CA GLY A 126 17.941 -30.499 4.836 1.00 31.57 C -ATOM 947 C GLY A 126 16.898 -31.059 5.780 1.00 47.32 C -ATOM 948 O GLY A 126 15.877 -30.451 6.108 1.00 45.65 O -ATOM 949 N ALA A 127 17.180 -32.278 6.195 1.00 33.24 N -ATOM 950 CA ALA A 127 16.275 -33.037 7.039 1.00 42.64 C -ATOM 951 C ALA A 127 16.458 -32.822 8.549 1.00 33.08 C -ATOM 952 O ALA A 127 15.702 -33.301 9.402 1.00 40.51 O -ATOM 953 CB ALA A 127 16.490 -34.498 6.705 1.00 35.42 C -ATOM 954 N PHE A 128 17.468 -32.083 8.902 1.00 27.81 N -ATOM 955 CA PHE A 128 17.848 -32.020 10.258 1.00 28.97 C -ATOM 956 C PHE A 128 17.701 -30.613 10.786 1.00 40.19 C -ATOM 957 O PHE A 128 17.975 -29.634 10.085 1.00 29.96 O -ATOM 958 CB PHE A 128 19.218 -32.562 10.176 1.00 27.26 C -ATOM 959 CG PHE A 128 20.062 -32.313 11.399 1.00 62.21 C -ATOM 960 CD1 PHE A 128 19.988 -33.205 12.457 1.00 68.83 C -ATOM 961 CD2 PHE A 128 20.908 -31.200 11.430 1.00 68.66 C -ATOM 962 CE1 PHE A 128 20.783 -32.970 13.564 1.00 68.63 C -ATOM 963 CE2 PHE A 128 21.699 -30.972 12.540 1.00 72.56 C -ATOM 964 CZ PHE A 128 21.630 -31.866 13.601 1.00 71.50 C -ATOM 965 N SER A 129 17.331 -30.540 12.060 1.00 32.05 N -ATOM 966 CA SER A 129 17.219 -29.262 12.751 1.00 30.97 C -ATOM 967 C SER A 129 17.830 -29.309 14.144 1.00 26.59 C -ATOM 968 O SER A 129 17.736 -30.344 14.808 1.00 27.36 O -ATOM 969 CB SER A 129 15.772 -28.871 12.897 1.00 27.55 C -ATOM 970 OG SER A 129 15.072 -28.729 11.673 1.00 47.00 O -ATOM 971 N VAL A 130 18.521 -28.261 14.560 1.00 28.17 N -ATOM 972 CA VAL A 130 19.019 -28.143 15.916 1.00 29.20 C -ATOM 973 C VAL A 130 18.641 -26.796 16.512 1.00 40.17 C -ATOM 974 O VAL A 130 18.516 -25.799 15.787 1.00 25.40 O -ATOM 975 CB VAL A 130 20.511 -28.239 16.012 1.00 24.69 C -ATOM 976 CG1 VAL A 130 20.801 -29.679 15.851 1.00 34.50 C -ATOM 977 CG2 VAL A 130 21.225 -27.340 15.037 1.00 27.14 C -ATOM 978 N ALA A 131 18.434 -26.730 17.829 1.00 24.58 N -ATOM 979 CA ALA A 131 18.111 -25.468 18.511 1.00 21.75 C -ATOM 980 C ALA A 131 18.877 -25.407 19.842 1.00 27.70 C -ATOM 981 O ALA A 131 19.246 -26.460 20.409 1.00 27.02 O -ATOM 982 CB ALA A 131 16.591 -25.405 18.742 1.00 16.82 C -ATOM 983 N ALA A 132 19.238 -24.228 20.323 1.00 24.98 N -ATOM 984 CA ALA A 132 19.932 -24.098 21.596 1.00 25.03 C -ATOM 985 C ALA A 132 19.448 -22.801 22.221 1.00 34.14 C -ATOM 986 O ALA A 132 19.250 -21.814 21.513 1.00 20.34 O -ATOM 987 CB ALA A 132 21.444 -24.029 21.375 1.00 23.74 C -ATOM 988 N SER A 133 19.188 -22.737 23.518 1.00 21.23 N -ATOM 989 CA SER A 133 18.664 -21.524 24.131 1.00 18.46 C -ATOM 990 C SER A 133 19.284 -21.285 25.516 1.00 24.03 C -ATOM 991 O SER A 133 19.802 -22.239 26.115 1.00 22.23 O -ATOM 992 CB SER A 133 17.176 -21.672 24.250 1.00 14.79 C -ATOM 993 OG SER A 133 16.814 -22.952 24.768 1.00 19.72 O -ATOM 994 N MET A 134 19.303 -20.077 26.055 1.00 22.25 N -ATOM 995 CA MET A 134 19.802 -19.845 27.405 1.00 21.58 C -ATOM 996 C MET A 134 19.357 -18.485 27.899 1.00 33.98 C -ATOM 997 O MET A 134 18.998 -17.634 27.066 1.00 19.01 O -ATOM 998 CB MET A 134 21.317 -19.910 27.405 1.00 18.41 C -ATOM 999 CG MET A 134 21.955 -18.746 26.654 1.00 25.36 C -ATOM 1000 SD MET A 134 23.758 -18.772 26.669 1.00 35.96 S -ATOM 1001 CE MET A 134 24.092 -18.494 28.385 1.00 37.35 C -ATOM 1002 N SER A 135 19.314 -18.261 29.212 1.00 18.02 N -ATOM 1003 CA SER A 135 19.041 -16.944 29.746 1.00 16.76 C -ATOM 1004 C SER A 135 20.400 -16.477 30.208 1.00 16.94 C -ATOM 1005 O SER A 135 21.361 -17.253 30.182 1.00 20.09 O -ATOM 1006 CB SER A 135 18.034 -17.017 30.907 1.00 20.02 C -ATOM 1007 OG SER A 135 18.468 -17.881 31.957 1.00 20.86 O -ATOM 1008 N ASP A 136 20.575 -15.243 30.638 1.00 16.31 N -ATOM 1009 CA ASP A 136 21.896 -14.789 30.953 1.00 16.45 C -ATOM 1010 C ASP A 136 22.306 -14.956 32.433 1.00 22.62 C -ATOM 1011 O ASP A 136 23.431 -14.549 32.746 1.00 22.11 O -ATOM 1012 CB ASP A 136 22.008 -13.322 30.545 1.00 18.28 C -ATOM 1013 CG ASP A 136 21.118 -12.306 31.234 1.00 26.65 C -ATOM 1014 OD1 ASP A 136 20.599 -12.470 32.340 1.00 23.99 O -ATOM 1015 OD2 ASP A 136 20.891 -11.237 30.680 1.00 20.64 O -ATOM 1016 N GLY A 137 21.469 -15.440 33.377 1.00 24.48 N -ATOM 1017 CA GLY A 137 21.879 -15.654 34.775 1.00 23.91 C -ATOM 1018 C GLY A 137 21.825 -14.434 35.682 1.00 26.85 C -ATOM 1019 O GLY A 137 22.169 -14.569 36.854 1.00 25.96 O -ATOM 1020 N LYS A 138 21.421 -13.236 35.265 1.00 17.66 N -ATOM 1021 CA LYS A 138 21.367 -12.055 36.104 1.00 18.17 C -ATOM 1022 C LYS A 138 20.022 -11.408 35.986 1.00 30.18 C -ATOM 1023 O LYS A 138 19.466 -11.268 34.880 1.00 21.24 O -ATOM 1024 CB LYS A 138 22.372 -10.986 35.727 1.00 16.38 C -ATOM 1025 CG LYS A 138 23.792 -11.496 35.715 1.00 23.82 C -ATOM 1026 CD LYS A 138 24.140 -11.859 37.123 1.00 27.64 C -ATOM 1027 CE LYS A 138 25.533 -12.379 37.245 1.00 44.82 C -ATOM 1028 NZ LYS A 138 26.012 -11.923 38.538 1.00 46.52 N -ATOM 1029 N VAL A 139 19.474 -10.987 37.108 1.00 18.51 N -ATOM 1030 CA VAL A 139 18.174 -10.375 37.172 1.00 17.22 C -ATOM 1031 C VAL A 139 18.172 -9.096 36.379 1.00 17.48 C -ATOM 1032 O VAL A 139 19.123 -8.335 36.540 1.00 19.74 O -ATOM 1033 CB VAL A 139 17.788 -10.042 38.624 1.00 22.74 C -ATOM 1034 CG1 VAL A 139 16.425 -9.380 38.662 1.00 20.52 C -ATOM 1035 CG2 VAL A 139 17.643 -11.326 39.407 1.00 19.66 C -ATOM 1036 N GLY A 140 17.163 -8.830 35.530 1.00 20.23 N -ATOM 1037 CA GLY A 140 17.145 -7.617 34.718 1.00 18.19 C -ATOM 1038 C GLY A 140 18.483 -7.470 33.993 1.00 15.63 C -ATOM 1039 O GLY A 140 19.102 -8.463 33.521 1.00 24.74 O -ATOM 1040 N GLU A 141 18.944 -6.222 34.012 1.00 20.17 N -ATOM 1041 CA GLU A 141 20.259 -5.874 33.503 1.00 22.48 C -ATOM 1042 C GLU A 141 21.126 -5.535 34.696 1.00 27.63 C -ATOM 1043 O GLU A 141 22.035 -4.706 34.600 1.00 24.54 O -ATOM 1044 CB GLU A 141 20.171 -4.664 32.566 1.00 23.70 C -ATOM 1045 CG GLU A 141 19.722 -5.124 31.158 1.00 28.35 C -ATOM 1046 CD GLU A 141 19.280 -4.042 30.161 1.00 35.14 C -ATOM 1047 OE1 GLU A 141 19.521 -2.849 30.346 1.00 29.71 O -ATOM 1048 OE2 GLU A 141 18.647 -4.398 29.172 1.00 26.87 O -ATOM 1049 N THR A 142 20.874 -6.205 35.825 1.00 24.87 N -ATOM 1050 CA THR A 142 21.602 -5.920 37.045 1.00 26.14 C -ATOM 1051 C THR A 142 22.691 -6.951 37.228 1.00 26.00 C -ATOM 1052 O THR A 142 22.900 -7.827 36.391 1.00 26.49 O -ATOM 1053 CB THR A 142 20.652 -5.937 38.303 1.00 22.12 C -ATOM 1054 OG1 THR A 142 20.367 -7.309 38.664 1.00 23.47 O -ATOM 1055 CG2 THR A 142 19.428 -5.058 38.051 1.00 22.33 C -ATOM 1056 N SER A 143 23.421 -6.876 38.341 1.00 25.41 N -ATOM 1057 CA SER A 143 24.368 -7.911 38.667 1.00 24.21 C -ATOM 1058 C SER A 143 23.801 -8.929 39.653 1.00 29.13 C -ATOM 1059 O SER A 143 24.544 -9.831 40.060 1.00 29.64 O -ATOM 1060 CB SER A 143 25.611 -7.272 39.238 1.00 30.36 C -ATOM 1061 OG SER A 143 26.293 -6.538 38.236 1.00 34.01 O -ATOM 1062 N GLU A 144 22.512 -8.883 40.023 1.00 25.37 N -ATOM 1063 CA GLU A 144 21.989 -9.861 40.964 1.00 23.57 C -ATOM 1064 C GLU A 144 21.841 -11.232 40.318 1.00 32.22 C -ATOM 1065 O GLU A 144 21.251 -11.321 39.236 1.00 26.96 O -ATOM 1066 CB GLU A 144 20.651 -9.323 41.474 1.00 30.98 C -ATOM 1067 CG GLU A 144 20.131 -10.086 42.704 1.00 55.43 C -ATOM 1068 CD GLU A 144 18.655 -9.917 43.094 1.00 68.87 C -ATOM 1069 OE1 GLU A 144 18.059 -8.877 42.796 1.00 57.51 O -ATOM 1070 OE2 GLU A 144 18.102 -10.844 43.704 1.00 82.75 O -ATOM 1071 N ASP A 145 22.347 -12.300 40.937 1.00 24.45 N -ATOM 1072 CA ASP A 145 22.274 -13.644 40.397 1.00 23.62 C -ATOM 1073 C ASP A 145 20.885 -14.160 40.292 1.00 31.40 C -ATOM 1074 O ASP A 145 20.085 -13.976 41.211 1.00 27.58 O -ATOM 1075 CB ASP A 145 23.020 -14.680 41.223 1.00 27.22 C -ATOM 1076 CG ASP A 145 24.550 -14.597 41.158 1.00 43.72 C -ATOM 1077 OD1 ASP A 145 25.098 -14.301 40.098 1.00 55.35 O -ATOM 1078 OD2 ASP A 145 25.207 -14.860 42.168 1.00 70.49 O -ATOM 1079 N ASP A 146 20.597 -14.825 39.175 1.00 23.66 N -ATOM 1080 CA ASP A 146 19.260 -15.333 38.926 1.00 18.81 C -ATOM 1081 C ASP A 146 19.452 -16.804 38.675 1.00 10.77 C -ATOM 1082 O ASP A 146 20.572 -17.306 38.563 1.00 22.23 O -ATOM 1083 CB ASP A 146 18.641 -14.610 37.668 1.00 21.54 C -ATOM 1084 CG ASP A 146 17.119 -14.645 37.537 1.00 31.62 C -ATOM 1085 OD1 ASP A 146 16.459 -15.328 38.315 1.00 34.30 O -ATOM 1086 OD2 ASP A 146 16.552 -13.985 36.671 1.00 26.76 O -ATOM 1087 N ALA A 147 18.352 -17.567 38.662 1.00 16.46 N -ATOM 1088 CA ALA A 147 18.384 -18.938 38.146 1.00 23.36 C -ATOM 1089 C ALA A 147 18.787 -18.819 36.658 1.00 25.54 C -ATOM 1090 O ALA A 147 18.528 -17.764 36.053 1.00 21.29 O -ATOM 1091 CB ALA A 147 17.004 -19.572 38.198 1.00 18.36 C -ATOM 1092 N GLN A 148 19.417 -19.794 36.046 1.00 20.67 N -ATOM 1093 CA GLN A 148 19.780 -19.644 34.654 1.00 21.13 C -ATOM 1094 C GLN A 148 19.249 -20.829 33.907 1.00 28.17 C -ATOM 1095 O GLN A 148 19.476 -21.942 34.380 1.00 24.20 O -ATOM 1096 CB GLN A 148 21.233 -19.585 34.578 1.00 21.13 C -ATOM 1097 CG GLN A 148 21.619 -19.436 33.129 1.00 25.80 C -ATOM 1098 CD GLN A 148 23.080 -19.135 32.982 1.00 34.87 C -ATOM 1099 OE1 GLN A 148 23.490 -18.474 32.035 1.00 38.87 O -ATOM 1100 NE2 GLN A 148 23.954 -19.503 33.912 1.00 47.02 N -ATOM 1101 N GLU A 149 18.555 -20.666 32.777 1.00 17.81 N -ATOM 1102 CA GLU A 149 18.010 -21.814 32.074 1.00 17.51 C -ATOM 1103 C GLU A 149 18.825 -22.040 30.814 1.00 20.63 C -ATOM 1104 O GLU A 149 19.517 -21.103 30.376 1.00 18.55 O -ATOM 1105 CB GLU A 149 16.573 -21.597 31.681 1.00 19.12 C -ATOM 1106 CG GLU A 149 16.351 -20.335 30.838 1.00 18.36 C -ATOM 1107 CD GLU A 149 14.915 -19.997 30.523 1.00 20.39 C -ATOM 1108 OE1 GLU A 149 14.001 -20.666 31.017 1.00 21.55 O -ATOM 1109 OE2 GLU A 149 14.713 -19.031 29.780 1.00 21.49 O -ATOM 1110 N MET A 150 18.765 -23.266 30.310 1.00 18.17 N -ATOM 1111 CA MET A 150 19.475 -23.652 29.080 1.00 20.14 C -ATOM 1112 C MET A 150 18.815 -24.867 28.505 1.00 28.58 C -ATOM 1113 O MET A 150 18.294 -25.697 29.249 1.00 27.20 O -ATOM 1114 CB MET A 150 20.897 -24.106 29.266 1.00 27.78 C -ATOM 1115 CG MET A 150 21.860 -23.060 29.696 1.00 64.16 C -ATOM 1116 SD MET A 150 23.096 -23.853 30.745 1.00 78.93 S -ATOM 1117 CE MET A 150 24.207 -22.466 30.751 1.00 70.32 C -ATOM 1118 N ALA A 151 18.839 -25.057 27.189 1.00 21.76 N -ATOM 1119 CA ALA A 151 18.277 -26.257 26.591 1.00 22.34 C -ATOM 1120 C ALA A 151 18.943 -26.437 25.223 1.00 22.98 C -ATOM 1121 O ALA A 151 19.548 -25.489 24.661 1.00 20.23 O -ATOM 1122 CB ALA A 151 16.789 -26.128 26.374 1.00 15.31 C -ATOM 1123 N VAL A 152 18.928 -27.676 24.774 1.00 21.53 N -ATOM 1124 CA VAL A 152 19.474 -28.033 23.471 1.00 23.07 C -ATOM 1125 C VAL A 152 18.471 -29.062 22.924 1.00 29.71 C -ATOM 1126 O VAL A 152 17.850 -29.818 23.689 1.00 27.21 O -ATOM 1127 CB VAL A 152 20.971 -28.628 23.592 1.00 25.13 C -ATOM 1128 CG1AVAL A 152 21.917 -27.575 24.154 0.53 28.48 C -ATOM 1129 CG1BVAL A 152 21.452 -29.025 22.205 0.26 24.20 C -ATOM 1130 CG1CVAL A 152 21.013 -29.912 24.410 0.21 26.31 C -ATOM 1131 CG2AVAL A 152 20.993 -29.863 24.477 0.53 23.43 C -ATOM 1132 CG2BVAL A 152 21.950 -27.615 24.169 0.26 29.11 C -ATOM 1133 CG2CVAL A 152 21.509 -28.858 22.190 0.21 24.18 C -ATOM 1134 N ALA A 153 18.188 -29.091 21.614 1.00 27.54 N -ATOM 1135 CA ALA A 153 17.282 -30.081 21.038 1.00 23.02 C -ATOM 1136 C ALA A 153 17.694 -30.354 19.578 1.00 25.00 C -ATOM 1137 O ALA A 153 18.306 -29.478 18.939 1.00 23.08 O -ATOM 1138 CB ALA A 153 15.849 -29.557 21.074 1.00 20.58 C -ATOM 1139 N ALA A 154 17.409 -31.528 19.045 1.00 25.22 N -ATOM 1140 CA ALA A 154 17.720 -31.854 17.658 1.00 31.60 C -ATOM 1141 C ALA A 154 16.571 -32.634 17.111 1.00 28.50 C -ATOM 1142 O ALA A 154 15.874 -33.314 17.860 1.00 28.42 O -ATOM 1143 CB ALA A 154 18.932 -32.711 17.543 1.00 24.29 C -ATOM 1144 N ALA A 155 16.262 -32.535 15.825 1.00 26.24 N -ATOM 1145 CA ALA A 155 15.174 -33.295 15.245 1.00 31.59 C -ATOM 1146 C ALA A 155 15.619 -33.740 13.846 1.00 32.78 C -ATOM 1147 O ALA A 155 16.532 -33.181 13.226 1.00 27.08 O -ATOM 1148 CB ALA A 155 13.908 -32.446 15.078 1.00 29.48 C -ATOM 1149 N TYR A 156 14.961 -34.772 13.379 1.00 27.28 N -ATOM 1150 CA TYR A 156 15.207 -35.330 12.082 1.00 27.65 C -ATOM 1151 C TYR A 156 13.878 -35.745 11.455 1.00 25.30 C -ATOM 1152 O TYR A 156 13.049 -36.464 12.029 1.00 31.37 O -ATOM 1153 CB TYR A 156 16.168 -36.499 12.279 1.00 40.64 C -ATOM 1154 CG TYR A 156 16.505 -37.195 10.962 1.00 72.25 C -ATOM 1155 CD1 TYR A 156 17.270 -36.535 10.007 1.00 68.07 C -ATOM 1156 CD2 TYR A 156 15.995 -38.472 10.714 1.00 78.75 C -ATOM 1157 CE1 TYR A 156 17.511 -37.161 8.799 1.00 70.03 C -ATOM 1158 CE2 TYR A 156 16.239 -39.101 9.507 1.00 76.52 C -ATOM 1159 CZ TYR A 156 16.995 -38.430 8.559 1.00 81.42 C -ATOM 1160 OH TYR A 156 17.234 -39.034 7.335 1.00 98.25 O -ATOM 1161 N THR A 157 13.640 -35.245 10.249 1.00 33.54 N -ATOM 1162 CA THR A 157 12.446 -35.609 9.529 1.00 41.02 C -ATOM 1163 C THR A 157 12.781 -36.673 8.478 1.00 45.31 C -ATOM 1164 O THR A 157 13.782 -36.556 7.773 1.00 47.36 O -ATOM 1165 CB THR A 157 11.885 -34.354 8.890 1.00 31.49 C -ATOM 1166 OG1 THR A 157 11.816 -33.382 9.932 1.00 47.00 O -ATOM 1167 CG2 THR A 157 10.503 -34.583 8.279 1.00 34.86 C -ATOM 1168 N PHE A 158 12.016 -37.750 8.382 1.00 40.52 N -ATOM 1169 CA PHE A 158 12.155 -38.795 7.393 1.00 46.68 C -ATOM 1170 C PHE A 158 10.739 -39.174 7.005 1.00 44.70 C -ATOM 1171 O PHE A 158 9.926 -39.803 7.693 1.00 50.08 O -ATOM 1172 CB PHE A 158 12.915 -40.006 7.961 1.00 40.11 C -ATOM 1173 CG PHE A 158 12.415 -40.654 9.250 1.00 60.39 C -ATOM 1174 CD1 PHE A 158 12.675 -40.063 10.478 1.00 73.87 C -ATOM 1175 CD2 PHE A 158 11.701 -41.847 9.191 1.00 75.24 C -ATOM 1176 CE1 PHE A 158 12.219 -40.663 11.632 1.00 73.60 C -ATOM 1177 CE2 PHE A 158 11.249 -42.442 10.357 1.00 79.76 C -ATOM 1178 CZ PHE A 158 11.509 -41.848 11.575 1.00 79.46 C -ATOM 1179 N GLY A 159 10.399 -38.592 5.878 1.00 54.47 N -ATOM 1180 CA GLY A 159 9.112 -38.851 5.291 1.00 53.05 C -ATOM 1181 C GLY A 159 8.071 -38.135 6.113 1.00 50.28 C -ATOM 1182 O GLY A 159 8.189 -36.924 6.359 1.00 60.39 O -ATOM 1183 N ASN A 160 7.122 -38.958 6.579 1.00 40.08 N -ATOM 1184 CA ASN A 160 5.983 -38.481 7.367 1.00 58.74 C -ATOM 1185 C ASN A 160 6.321 -38.149 8.812 1.00 49.02 C -ATOM 1186 O ASN A 160 5.490 -37.547 9.498 1.00 47.25 O -ATOM 1187 CB ASN A 160 4.845 -39.503 7.494 1.00 63.82 C -ATOM 1188 CG ASN A 160 4.460 -40.322 6.266 1.00 89.40 C -ATOM 1189 OD1 ASN A 160 5.283 -41.093 5.758 1.00107.52 O -ATOM 1190 ND2 ASN A 160 3.234 -40.234 5.751 1.00 92.23 N -ATOM 1191 N TYR A 161 7.518 -38.572 9.221 1.00 38.38 N -ATOM 1192 CA TYR A 161 7.993 -38.571 10.582 1.00 39.40 C -ATOM 1193 C TYR A 161 9.020 -37.553 10.920 1.00 45.36 C -ATOM 1194 O TYR A 161 9.923 -37.343 10.126 1.00 41.06 O -ATOM 1195 CB TYR A 161 8.619 -39.886 10.939 1.00 34.37 C -ATOM 1196 CG TYR A 161 7.655 -40.974 10.566 1.00 57.59 C -ATOM 1197 CD1 TYR A 161 6.653 -41.311 11.450 1.00 69.71 C -ATOM 1198 CD2 TYR A 161 7.725 -41.562 9.317 1.00 70.14 C -ATOM 1199 CE1 TYR A 161 5.689 -42.237 11.087 1.00 73.90 C -ATOM 1200 CE2 TYR A 161 6.765 -42.487 8.947 1.00 73.04 C -ATOM 1201 CZ TYR A 161 5.750 -42.816 9.836 1.00 78.64 C -ATOM 1202 OH TYR A 161 4.758 -43.712 9.471 1.00 85.47 O -ATOM 1203 N THR A 162 8.891 -36.915 12.069 1.00 30.45 N -ATOM 1204 CA THR A 162 9.994 -36.168 12.600 1.00 27.25 C -ATOM 1205 C THR A 162 10.140 -36.784 13.950 1.00 35.32 C -ATOM 1206 O THR A 162 9.140 -37.069 14.615 1.00 33.92 O -ATOM 1207 CB THR A 162 9.703 -34.725 12.782 1.00 31.07 C -ATOM 1208 OG1 THR A 162 9.394 -34.238 11.483 1.00 39.71 O -ATOM 1209 CG2 THR A 162 10.889 -33.987 13.414 1.00 29.14 C -ATOM 1210 N VAL A 163 11.356 -37.105 14.293 1.00 27.12 N -ATOM 1211 CA VAL A 163 11.576 -37.553 15.642 1.00 37.49 C -ATOM 1212 C VAL A 163 12.619 -36.613 16.222 1.00 30.21 C -ATOM 1213 O VAL A 163 13.349 -35.952 15.479 1.00 33.78 O -ATOM 1214 CB VAL A 163 12.069 -39.057 15.742 1.00 34.36 C -ATOM 1215 CG1 VAL A 163 10.966 -39.939 15.165 1.00 32.38 C -ATOM 1216 CG2 VAL A 163 13.420 -39.271 15.075 1.00 43.54 C -ATOM 1217 N GLY A 164 12.688 -36.440 17.536 1.00 28.78 N -ATOM 1218 CA GLY A 164 13.703 -35.572 18.098 1.00 30.23 C -ATOM 1219 C GLY A 164 13.877 -35.769 19.601 1.00 28.31 C -ATOM 1220 O GLY A 164 13.120 -36.518 20.239 1.00 28.35 O -ATOM 1221 N LEU A 165 14.870 -35.075 20.147 1.00 24.05 N -ATOM 1222 CA LEU A 165 15.090 -35.081 21.571 1.00 31.20 C -ATOM 1223 C LEU A 165 15.630 -33.765 22.024 1.00 23.08 C -ATOM 1224 O LEU A 165 16.230 -33.001 21.279 1.00 27.04 O -ATOM 1225 CB LEU A 165 16.049 -36.185 21.995 1.00 40.23 C -ATOM 1226 CG LEU A 165 17.491 -36.359 21.615 1.00 55.61 C -ATOM 1227 CD1 LEU A 165 18.360 -36.288 22.871 1.00 64.27 C -ATOM 1228 CD2 LEU A 165 17.674 -37.743 20.975 1.00 58.44 C -ATOM 1229 N GLY A 166 15.339 -33.481 23.275 1.00 28.71 N -ATOM 1230 CA GLY A 166 15.723 -32.228 23.857 1.00 24.37 C -ATOM 1231 C GLY A 166 16.128 -32.454 25.298 1.00 22.71 C -ATOM 1232 O GLY A 166 15.752 -33.451 25.916 1.00 23.22 O -ATOM 1233 N TYR A 167 16.924 -31.547 25.782 1.00 22.54 N -ATOM 1234 CA TYR A 167 17.385 -31.601 27.114 1.00 21.68 C -ATOM 1235 C TYR A 167 17.386 -30.166 27.552 1.00 22.97 C -ATOM 1236 O TYR A 167 18.019 -29.272 26.994 1.00 25.70 O -ATOM 1237 CB TYR A 167 18.742 -32.178 27.097 1.00 19.60 C -ATOM 1238 CG TYR A 167 19.294 -32.136 28.482 1.00 30.51 C -ATOM 1239 CD1 TYR A 167 18.831 -33.005 29.458 1.00 31.48 C -ATOM 1240 CD2 TYR A 167 20.232 -31.163 28.747 1.00 35.86 C -ATOM 1241 CE1 TYR A 167 19.337 -32.873 30.737 1.00 34.71 C -ATOM 1242 CE2 TYR A 167 20.735 -31.024 30.022 1.00 45.09 C -ATOM 1243 CZ TYR A 167 20.279 -31.881 31.001 1.00 45.63 C -ATOM 1244 OH TYR A 167 20.781 -31.711 32.274 1.00 43.91 O -ATOM 1245 N GLU A 168 16.761 -30.020 28.698 1.00 25.32 N -ATOM 1246 CA GLU A 168 16.579 -28.730 29.323 1.00 22.85 C -ATOM 1247 C GLU A 168 17.031 -28.704 30.781 1.00 23.46 C -ATOM 1248 O GLU A 168 16.833 -29.685 31.510 1.00 21.97 O -ATOM 1249 CB GLU A 168 15.129 -28.374 29.303 1.00 23.96 C -ATOM 1250 CG GLU A 168 14.336 -28.524 28.005 1.00 18.08 C -ATOM 1251 CD GLU A 168 12.978 -27.879 28.137 1.00 17.37 C -ATOM 1252 OE1 GLU A 168 12.883 -26.660 28.050 1.00 19.97 O -ATOM 1253 OE2 GLU A 168 11.995 -28.566 28.325 1.00 21.50 O -ATOM 1254 N LYS A 169 17.600 -27.609 31.238 1.00 21.91 N -ATOM 1255 CA LYS A 169 17.934 -27.489 32.645 1.00 26.98 C -ATOM 1256 C LYS A 169 17.850 -26.074 33.211 1.00 33.90 C -ATOM 1257 O LYS A 169 17.944 -25.073 32.479 1.00 21.78 O -ATOM 1258 CB LYS A 169 19.311 -28.049 32.861 1.00 22.39 C -ATOM 1259 CG LYS A 169 20.349 -27.286 32.129 1.00 33.73 C -ATOM 1260 CD LYS A 169 21.591 -27.849 32.707 1.00 55.00 C -ATOM 1261 CE LYS A 169 22.497 -26.654 32.902 1.00 70.05 C -ATOM 1262 NZ LYS A 169 23.579 -27.016 33.806 1.00 76.45 N -ATOM 1263 N ILE A 170 17.570 -25.964 34.531 1.00 24.31 N -ATOM 1264 CA ILE A 170 17.564 -24.681 35.251 1.00 26.64 C -ATOM 1265 C ILE A 170 18.554 -24.824 36.423 1.00 22.64 C -ATOM 1266 O ILE A 170 18.462 -25.750 37.218 1.00 26.39 O -ATOM 1267 CB ILE A 170 16.144 -24.293 35.810 1.00 22.23 C -ATOM 1268 CG1 ILE A 170 15.068 -24.222 34.712 1.00 18.13 C -ATOM 1269 CG2 ILE A 170 16.296 -22.936 36.512 1.00 20.59 C -ATOM 1270 CD1 ILE A 170 13.666 -23.890 35.214 1.00 22.57 C -ATOM 1271 N ASP A 171 19.579 -24.004 36.473 1.00 21.42 N -ATOM 1272 CA ASP A 171 20.512 -23.901 37.562 1.00 22.65 C -ATOM 1273 C ASP A 171 20.069 -22.845 38.533 1.00 24.81 C -ATOM 1274 O ASP A 171 19.879 -21.676 38.196 1.00 25.52 O -ATOM 1275 CB ASP A 171 21.876 -23.496 37.110 1.00 24.09 C -ATOM 1276 CG ASP A 171 22.500 -24.534 36.202 1.00 37.12 C -ATOM 1277 OD1 ASP A 171 22.150 -25.716 36.302 1.00 39.08 O -ATOM 1278 OD2 ASP A 171 23.325 -24.134 35.385 1.00 63.64 O -ATOM 1279 N SER A 172 19.937 -23.309 39.769 1.00 28.50 N -ATOM 1280 CA SER A 172 19.500 -22.508 40.890 1.00 29.34 C -ATOM 1281 C SER A 172 20.603 -21.582 41.329 1.00 19.80 C -ATOM 1282 O SER A 172 21.745 -22.025 41.398 1.00 27.09 O -ATOM 1283 CB SER A 172 19.152 -23.383 42.069 1.00 25.55 C -ATOM 1284 OG SER A 172 18.727 -22.499 43.089 1.00 28.00 O -ATOM 1285 N PRO A 173 20.365 -20.329 41.698 1.00 23.04 N -ATOM 1286 CA PRO A 173 21.386 -19.495 42.291 1.00 24.44 C -ATOM 1287 C PRO A 173 21.652 -19.986 43.713 1.00 46.59 C -ATOM 1288 O PRO A 173 22.743 -19.708 44.184 1.00 45.87 O -ATOM 1289 CB PRO A 173 20.825 -18.111 42.244 1.00 21.93 C -ATOM 1290 CG PRO A 173 19.367 -18.345 42.486 1.00 24.05 C -ATOM 1291 CD PRO A 173 19.060 -19.699 41.802 1.00 23.65 C -ATOM 1292 N ASP A 174 20.755 -20.703 44.425 1.00 32.74 N -ATOM 1293 CA ASP A 174 21.015 -21.137 45.794 1.00 29.56 C -ATOM 1294 C ASP A 174 20.241 -22.413 46.005 1.00 19.81 C -ATOM 1295 O ASP A 174 19.009 -22.376 46.189 1.00 27.36 O -ATOM 1296 CB ASP A 174 20.540 -20.070 46.777 1.00 37.96 C -ATOM 1297 CG ASP A 174 20.907 -20.292 48.261 1.00 44.06 C -ATOM 1298 OD1 ASP A 174 21.200 -21.404 48.694 1.00 35.40 O -ATOM 1299 OD2 ASP A 174 20.893 -19.320 49.006 1.00 47.06 O -ATOM 1300 N THR A 175 20.975 -23.537 46.006 1.00 25.91 N -ATOM 1301 CA THR A 175 20.332 -24.837 46.136 1.00 31.18 C -ATOM 1302 C THR A 175 19.824 -25.196 47.551 1.00 37.44 C -ATOM 1303 O THR A 175 19.134 -26.220 47.700 1.00 34.89 O -ATOM 1304 CB THR A 175 21.284 -25.941 45.576 1.00 35.52 C -ATOM 1305 OG1 THR A 175 22.537 -25.807 46.225 1.00 41.72 O -ATOM 1306 CG2 THR A 175 21.422 -25.836 44.040 1.00 30.09 C -ATOM 1307 N ALA A 176 20.096 -24.349 48.577 1.00 36.77 N -ATOM 1308 CA ALA A 176 19.430 -24.459 49.880 1.00 34.55 C -ATOM 1309 C ALA A 176 18.005 -23.977 49.703 1.00 34.09 C -ATOM 1310 O ALA A 176 17.077 -24.499 50.335 1.00 32.18 O -ATOM 1311 CB ALA A 176 20.016 -23.557 50.947 1.00 29.40 C -ATOM 1312 N LEU A 177 17.824 -22.983 48.808 1.00 25.68 N -ATOM 1313 CA LEU A 177 16.506 -22.431 48.562 1.00 24.25 C -ATOM 1314 C LEU A 177 15.700 -23.029 47.398 1.00 30.49 C -ATOM 1315 O LEU A 177 14.464 -23.081 47.479 1.00 25.58 O -ATOM 1316 CB LEU A 177 16.683 -20.949 48.375 1.00 34.03 C -ATOM 1317 CG LEU A 177 17.151 -20.199 49.612 1.00 41.02 C -ATOM 1318 CD1 LEU A 177 17.335 -18.758 49.257 1.00 40.73 C -ATOM 1319 CD2 LEU A 177 16.116 -20.270 50.711 1.00 41.14 C -ATOM 1320 N MET A 178 16.328 -23.506 46.315 1.00 27.88 N -ATOM 1321 CA MET A 178 15.605 -24.068 45.157 1.00 24.64 C -ATOM 1322 C MET A 178 16.543 -25.061 44.535 1.00 15.20 C -ATOM 1323 O MET A 178 17.697 -24.725 44.299 1.00 22.04 O -ATOM 1324 CB MET A 178 15.272 -22.965 44.134 1.00 24.97 C -ATOM 1325 CG MET A 178 14.350 -23.526 43.050 1.00 37.40 C -ATOM 1326 SD MET A 178 14.025 -22.325 41.726 1.00 34.16 S -ATOM 1327 CE MET A 178 15.624 -22.293 40.939 1.00 28.69 C -ATOM 1328 N ALA A 179 16.135 -26.306 44.380 1.00 18.97 N -ATOM 1329 CA ALA A 179 16.960 -27.343 43.800 1.00 21.25 C -ATOM 1330 C ALA A 179 17.175 -27.052 42.312 1.00 32.90 C -ATOM 1331 O ALA A 179 16.345 -26.407 41.660 1.00 23.82 O -ATOM 1332 CB ALA A 179 16.276 -28.705 43.867 1.00 19.86 C -ATOM 1333 N ASP A 180 18.275 -27.497 41.758 1.00 25.51 N -ATOM 1334 CA ASP A 180 18.459 -27.512 40.305 1.00 29.77 C -ATOM 1335 C ASP A 180 17.437 -28.418 39.632 1.00 35.87 C -ATOM 1336 O ASP A 180 17.017 -29.425 40.230 1.00 25.57 O -ATOM 1337 CB ASP A 180 19.804 -28.048 39.948 1.00 22.82 C -ATOM 1338 CG ASP A 180 20.966 -27.176 40.326 1.00 19.28 C -ATOM 1339 OD1 ASP A 180 20.783 -25.984 40.534 1.00 24.24 O -ATOM 1340 OD2 ASP A 180 22.072 -27.706 40.385 1.00 34.46 O -ATOM 1341 N MET A 181 17.040 -28.135 38.384 1.00 21.42 N -ATOM 1342 CA MET A 181 16.020 -28.935 37.732 1.00 19.55 C -ATOM 1343 C MET A 181 16.540 -29.368 36.348 1.00 26.26 C -ATOM 1344 O MET A 181 17.428 -28.705 35.790 1.00 23.03 O -ATOM 1345 CB MET A 181 14.741 -28.115 37.558 1.00 20.30 C -ATOM 1346 CG MET A 181 14.208 -27.429 38.832 1.00 22.93 C -ATOM 1347 SD MET A 181 12.538 -26.784 38.747 1.00 27.32 S -ATOM 1348 CE MET A 181 13.039 -25.172 39.188 1.00 22.23 C -ATOM 1349 N GLU A 182 16.055 -30.464 35.782 1.00 23.25 N -ATOM 1350 CA GLU A 182 16.419 -30.849 34.433 1.00 28.22 C -ATOM 1351 C GLU A 182 15.314 -31.697 33.888 1.00 22.99 C -ATOM 1352 O GLU A 182 14.491 -32.218 34.658 1.00 23.60 O -ATOM 1353 CB GLU A 182 17.693 -31.633 34.372 1.00 27.70 C -ATOM 1354 CG GLU A 182 17.653 -32.917 35.150 1.00 39.91 C -ATOM 1355 CD GLU A 182 18.798 -33.865 34.827 1.00 49.50 C -ATOM 1356 OE1 GLU A 182 19.958 -33.436 34.775 1.00 46.27 O -ATOM 1357 OE2 GLU A 182 18.494 -35.043 34.614 1.00 81.45 O -ATOM 1358 N GLN A 183 15.218 -31.801 32.555 1.00 23.57 N -ATOM 1359 CA GLN A 183 14.186 -32.607 31.917 1.00 20.27 C -ATOM 1360 C GLN A 183 14.734 -33.027 30.559 1.00 24.71 C -ATOM 1361 O GLN A 183 15.397 -32.226 29.892 1.00 25.60 O -ATOM 1362 CB GLN A 183 12.923 -31.774 31.752 1.00 21.67 C -ATOM 1363 CG GLN A 183 11.739 -32.520 31.215 1.00 22.57 C -ATOM 1364 CD GLN A 183 10.536 -31.621 31.271 1.00 34.59 C -ATOM 1365 OE1 GLN A 183 10.031 -31.397 32.344 1.00 33.27 O -ATOM 1366 NE2 GLN A 183 9.947 -31.040 30.243 1.00 26.73 N -ATOM 1367 N LEU A 184 14.506 -34.276 30.212 1.00 25.90 N -ATOM 1368 CA LEU A 184 14.900 -34.830 28.935 1.00 25.47 C -ATOM 1369 C LEU A 184 13.623 -35.127 28.194 1.00 30.93 C -ATOM 1370 O LEU A 184 12.692 -35.640 28.813 1.00 29.59 O -ATOM 1371 CB LEU A 184 15.656 -36.119 29.106 1.00 30.36 C -ATOM 1372 CG LEU A 184 16.019 -36.860 27.796 1.00 53.58 C -ATOM 1373 CD1 LEU A 184 17.325 -36.325 27.169 1.00 41.36 C -ATOM 1374 CD2 LEU A 184 16.137 -38.333 28.120 1.00 61.50 C -ATOM 1375 N GLU A 185 13.503 -34.832 26.895 1.00 24.93 N -ATOM 1376 CA GLU A 185 12.284 -35.106 26.139 1.00 21.56 C -ATOM 1377 C GLU A 185 12.589 -35.929 24.871 1.00 20.96 C -ATOM 1378 O GLU A 185 13.661 -35.744 24.270 1.00 25.62 O -ATOM 1379 CB GLU A 185 11.596 -33.838 25.621 1.00 28.40 C -ATOM 1380 CG GLU A 185 11.036 -32.816 26.599 1.00 33.30 C -ATOM 1381 CD GLU A 185 11.903 -31.609 26.892 1.00 31.54 C -ATOM 1382 OE1 GLU A 185 12.775 -31.231 26.123 1.00 27.29 O -ATOM 1383 OE2 GLU A 185 11.691 -31.016 27.928 1.00 25.85 O -ATOM 1384 N LEU A 186 11.646 -36.789 24.489 1.00 24.15 N -ATOM 1385 CA LEU A 186 11.653 -37.500 23.212 1.00 28.00 C -ATOM 1386 C LEU A 186 10.327 -37.093 22.629 1.00 28.26 C -ATOM 1387 O LEU A 186 9.305 -37.108 23.330 1.00 29.09 O -ATOM 1388 CB LEU A 186 11.600 -39.020 23.305 1.00 30.48 C -ATOM 1389 CG LEU A 186 12.737 -39.599 24.072 1.00 49.76 C -ATOM 1390 CD1 LEU A 186 12.437 -41.058 24.322 1.00 56.71 C -ATOM 1391 CD2 LEU A 186 14.029 -39.335 23.332 1.00 41.46 C -ATOM 1392 N ALA A 187 10.310 -36.701 21.364 1.00 23.92 N -ATOM 1393 CA ALA A 187 9.078 -36.291 20.743 1.00 23.34 C -ATOM 1394 C ALA A 187 9.031 -36.945 19.363 1.00 27.75 C -ATOM 1395 O ALA A 187 10.069 -37.214 18.757 1.00 26.70 O -ATOM 1396 CB ALA A 187 9.074 -34.777 20.610 1.00 24.93 C -ATOM 1397 N ALA A 188 7.853 -37.216 18.873 1.00 25.88 N -ATOM 1398 CA ALA A 188 7.663 -37.789 17.563 1.00 34.01 C -ATOM 1399 C ALA A 188 6.512 -37.031 16.935 1.00 33.31 C -ATOM 1400 O ALA A 188 5.540 -36.744 17.644 1.00 29.55 O -ATOM 1401 CB ALA A 188 7.278 -39.264 17.674 1.00 26.52 C -ATOM 1402 N ILE A 189 6.550 -36.671 15.649 1.00 36.39 N -ATOM 1403 CA ILE A 189 5.415 -36.037 14.968 1.00 27.67 C -ATOM 1404 C ILE A 189 5.231 -36.770 13.625 1.00 37.92 C -ATOM 1405 O ILE A 189 6.221 -37.089 12.968 1.00 33.44 O -ATOM 1406 CB ILE A 189 5.690 -34.555 14.703 1.00 29.72 C -ATOM 1407 CG1 ILE A 189 5.971 -33.831 15.991 1.00 39.00 C -ATOM 1408 CG2 ILE A 189 4.471 -33.934 14.052 1.00 33.27 C -ATOM 1409 CD1 ILE A 189 7.077 -32.793 15.839 1.00 38.17 C -ATOM 1410 N ALA A 190 4.005 -37.054 13.215 1.00 34.42 N -ATOM 1411 CA ALA A 190 3.697 -37.834 12.044 1.00 33.15 C -ATOM 1412 C ALA A 190 2.509 -37.223 11.388 1.00 43.94 C -ATOM 1413 O ALA A 190 1.528 -36.880 12.068 1.00 36.50 O -ATOM 1414 CB ALA A 190 3.273 -39.248 12.368 1.00 29.97 C -ATOM 1415 N LYS A 191 2.600 -37.037 10.076 1.00 49.78 N -ATOM 1416 CA LYS A 191 1.414 -36.648 9.317 1.00 48.56 C -ATOM 1417 C LYS A 191 1.095 -37.790 8.400 1.00 51.68 C -ATOM 1418 O LYS A 191 1.979 -38.318 7.727 1.00 65.27 O -ATOM 1419 CB LYS A 191 1.596 -35.413 8.439 1.00 49.42 C -ATOM 1420 CG LYS A 191 2.988 -35.255 7.842 1.00 75.96 C -ATOM 1421 CD LYS A 191 3.450 -33.831 8.138 1.00 86.39 C -ATOM 1422 CE LYS A 191 3.796 -33.646 9.617 1.00 88.43 C -ATOM 1423 NZ LYS A 191 3.690 -32.249 10.002 1.00 91.69 N -ATOM 1424 N PHE A 192 -0.144 -38.241 8.423 1.00 57.59 N -ATOM 1425 CA PHE A 192 -0.631 -39.312 7.574 1.00 49.63 C -ATOM 1426 C PHE A 192 -1.764 -38.691 6.778 1.00 55.22 C -ATOM 1427 O PHE A 192 -2.963 -38.943 6.982 1.00 60.13 O -ATOM 1428 CB PHE A 192 -1.160 -40.470 8.406 1.00 52.90 C -ATOM 1429 CG PHE A 192 -0.106 -41.110 9.279 1.00 55.44 C -ATOM 1430 CD1 PHE A 192 1.159 -41.341 8.773 1.00 63.13 C -ATOM 1431 CD2 PHE A 192 -0.444 -41.441 10.573 1.00 62.68 C -ATOM 1432 CE1 PHE A 192 2.102 -41.910 9.584 1.00 71.79 C -ATOM 1433 CE2 PHE A 192 0.510 -42.012 11.376 1.00 64.06 C -ATOM 1434 CZ PHE A 192 1.776 -42.244 10.882 1.00 66.40 C -ATOM 1435 N GLY A 193 -1.361 -37.770 5.903 1.00 53.26 N -ATOM 1436 CA GLY A 193 -2.343 -37.079 5.097 1.00 64.96 C -ATOM 1437 C GLY A 193 -3.109 -36.029 5.906 1.00 72.86 C -ATOM 1438 O GLY A 193 -2.497 -35.117 6.471 1.00 83.89 O -ATOM 1439 N ALA A 194 -4.437 -36.170 6.010 1.00 65.54 N -ATOM 1440 CA ALA A 194 -5.274 -35.195 6.707 1.00 58.81 C -ATOM 1441 C ALA A 194 -5.139 -35.243 8.241 1.00 53.68 C -ATOM 1442 O ALA A 194 -5.696 -34.378 8.931 1.00 41.71 O -ATOM 1443 CB ALA A 194 -6.725 -35.456 6.319 1.00 56.03 C -ATOM 1444 N THR A 195 -4.446 -36.286 8.739 1.00 51.68 N -ATOM 1445 CA THR A 195 -4.191 -36.606 10.142 1.00 43.81 C -ATOM 1446 C THR A 195 -2.808 -36.267 10.679 1.00 45.19 C -ATOM 1447 O THR A 195 -1.786 -36.640 10.106 1.00 37.22 O -ATOM 1448 CB THR A 195 -4.464 -38.101 10.326 1.00 33.57 C -ATOM 1449 OG1 THR A 195 -5.800 -38.272 9.841 1.00 41.80 O -ATOM 1450 CG2 THR A 195 -4.342 -38.606 11.756 1.00 33.82 C -ATOM 1451 N ASN A 196 -2.749 -35.582 11.812 1.00 33.40 N -ATOM 1452 CA ASN A 196 -1.485 -35.230 12.428 1.00 34.17 C -ATOM 1453 C ASN A 196 -1.419 -35.980 13.746 1.00 26.07 C -ATOM 1454 O ASN A 196 -2.456 -36.072 14.427 1.00 31.07 O -ATOM 1455 CB ASN A 196 -1.462 -33.757 12.688 1.00 34.94 C -ATOM 1456 CG ASN A 196 -1.494 -32.946 11.405 1.00 37.97 C -ATOM 1457 OD1 ASN A 196 -0.518 -32.901 10.654 1.00 38.93 O -ATOM 1458 ND2 ASN A 196 -2.596 -32.276 11.098 1.00 35.68 N -ATOM 1459 N VAL A 197 -0.292 -36.559 14.121 1.00 27.67 N -ATOM 1460 CA VAL A 197 -0.188 -37.257 15.380 1.00 27.06 C -ATOM 1461 C VAL A 197 1.051 -36.667 16.017 1.00 32.58 C -ATOM 1462 O VAL A 197 2.038 -36.440 15.321 1.00 35.46 O -ATOM 1463 CB VAL A 197 -0.021 -38.766 15.163 1.00 26.96 C -ATOM 1464 CG1 VAL A 197 0.146 -39.477 16.495 1.00 31.44 C -ATOM 1465 CG2 VAL A 197 -1.285 -39.339 14.562 1.00 30.72 C -ATOM 1466 N LYS A 198 1.028 -36.336 17.304 1.00 28.97 N -ATOM 1467 CA LYS A 198 2.191 -35.794 17.991 1.00 23.59 C -ATOM 1468 C LYS A 198 2.177 -36.537 19.331 1.00 20.72 C -ATOM 1469 O LYS A 198 1.100 -36.798 19.904 1.00 25.42 O -ATOM 1470 CB LYS A 198 2.030 -34.282 18.191 1.00 22.91 C -ATOM 1471 CG LYS A 198 3.317 -33.727 18.781 1.00 31.46 C -ATOM 1472 CD LYS A 198 3.327 -32.223 18.990 1.00 27.19 C -ATOM 1473 CE LYS A 198 3.301 -31.529 17.642 1.00 27.71 C -ATOM 1474 NZ LYS A 198 3.444 -30.081 17.745 1.00 22.82 N -ATOM 1475 N ALA A 199 3.360 -36.920 19.792 1.00 23.92 N -ATOM 1476 CA ALA A 199 3.512 -37.643 21.050 1.00 29.51 C -ATOM 1477 C ALA A 199 4.826 -37.264 21.694 1.00 31.31 C -ATOM 1478 O ALA A 199 5.773 -36.903 20.976 1.00 27.54 O -ATOM 1479 CB ALA A 199 3.547 -39.137 20.831 1.00 29.98 C -ATOM 1480 N TYR A 200 4.948 -37.287 23.029 1.00 24.08 N -ATOM 1481 CA TYR A 200 6.232 -36.978 23.647 1.00 25.77 C -ATOM 1482 C TYR A 200 6.312 -37.781 24.957 1.00 19.77 C -ATOM 1483 O TYR A 200 5.285 -38.229 25.471 1.00 25.09 O -ATOM 1484 CB TYR A 200 6.366 -35.468 23.965 1.00 21.68 C -ATOM 1485 CG TYR A 200 5.449 -35.011 25.114 1.00 27.89 C -ATOM 1486 CD1 TYR A 200 4.100 -34.740 24.906 1.00 23.60 C -ATOM 1487 CD2 TYR A 200 5.979 -34.928 26.414 1.00 26.80 C -ATOM 1488 CE1 TYR A 200 3.280 -34.398 25.985 1.00 21.78 C -ATOM 1489 CE2 TYR A 200 5.167 -34.592 27.493 1.00 21.58 C -ATOM 1490 CZ TYR A 200 3.825 -34.331 27.276 1.00 29.96 C -ATOM 1491 OH TYR A 200 3.038 -34.016 28.377 1.00 24.28 O -ATOM 1492 N TYR A 201 7.499 -37.895 25.487 1.00 22.60 N -ATOM 1493 CA TYR A 201 7.706 -38.468 26.778 1.00 24.74 C -ATOM 1494 C TYR A 201 8.768 -37.559 27.381 1.00 26.88 C -ATOM 1495 O TYR A 201 9.741 -37.191 26.708 1.00 24.56 O -ATOM 1496 CB TYR A 201 8.194 -39.901 26.603 1.00 25.19 C -ATOM 1497 CG TYR A 201 8.675 -40.448 27.936 1.00 34.01 C -ATOM 1498 CD1 TYR A 201 7.727 -40.932 28.815 1.00 36.14 C -ATOM 1499 CD2 TYR A 201 10.031 -40.414 28.250 1.00 34.68 C -ATOM 1500 CE1 TYR A 201 8.137 -41.392 30.041 1.00 36.17 C -ATOM 1501 CE2 TYR A 201 10.442 -40.870 29.481 1.00 35.36 C -ATOM 1502 CZ TYR A 201 9.481 -41.356 30.357 1.00 36.59 C -ATOM 1503 OH TYR A 201 9.869 -41.825 31.601 1.00 56.03 O -ATOM 1504 N ALA A 202 8.630 -37.196 28.663 1.00 27.52 N -ATOM 1505 CA ALA A 202 9.600 -36.329 29.339 1.00 25.10 C -ATOM 1506 C ALA A 202 9.877 -36.931 30.722 1.00 25.08 C -ATOM 1507 O ALA A 202 8.982 -37.486 31.356 1.00 25.54 O -ATOM 1508 CB ALA A 202 9.058 -34.895 29.564 1.00 22.21 C -ATOM 1509 N ASP A 203 11.085 -36.782 31.198 1.00 24.00 N -ATOM 1510 CA ASP A 203 11.489 -37.363 32.447 1.00 28.68 C -ATOM 1511 C ASP A 203 12.535 -36.459 33.079 1.00 29.57 C -ATOM 1512 O ASP A 203 13.419 -35.951 32.363 1.00 32.82 O -ATOM 1513 CB ASP A 203 12.041 -38.754 32.119 1.00 37.41 C -ATOM 1514 CG ASP A 203 12.421 -39.547 33.336 1.00 48.02 C -ATOM 1515 OD1 ASP A 203 11.555 -40.148 33.968 1.00 75.41 O -ATOM 1516 OD2 ASP A 203 13.595 -39.536 33.663 1.00 67.85 O -ATOM 1517 N GLY A 204 12.517 -36.218 34.397 1.00 32.61 N -ATOM 1518 CA GLY A 204 13.595 -35.437 34.988 1.00 28.05 C -ATOM 1519 C GLY A 204 13.367 -35.210 36.468 1.00 28.93 C -ATOM 1520 O GLY A 204 12.778 -36.061 37.158 1.00 27.42 O -ATOM 1521 N GLU A 205 13.792 -34.049 36.946 1.00 23.03 N -ATOM 1522 CA GLU A 205 13.529 -33.721 38.332 1.00 27.54 C -ATOM 1523 C GLU A 205 13.293 -32.246 38.482 1.00 28.34 C -ATOM 1524 O GLU A 205 13.832 -31.424 37.742 1.00 25.57 O -ATOM 1525 CB GLU A 205 14.677 -34.139 39.236 1.00 27.61 C -ATOM 1526 CG GLU A 205 15.986 -33.454 38.992 1.00 43.67 C -ATOM 1527 CD GLU A 205 17.151 -34.034 39.790 1.00 51.38 C -ATOM 1528 OE1 GLU A 205 17.227 -35.262 39.922 1.00 51.17 O -ATOM 1529 OE2 GLU A 205 17.983 -33.235 40.248 1.00 66.67 O -ATOM 1530 N LEU A 206 12.434 -31.947 39.450 1.00 21.41 N -ATOM 1531 CA LEU A 206 11.951 -30.610 39.719 1.00 19.79 C -ATOM 1532 C LEU A 206 12.248 -30.216 41.161 1.00 33.84 C -ATOM 1533 O LEU A 206 12.428 -31.096 42.002 1.00 26.21 O -ATOM 1534 CB LEU A 206 10.459 -30.554 39.522 1.00 20.83 C -ATOM 1535 CG LEU A 206 9.898 -30.808 38.130 1.00 25.89 C -ATOM 1536 CD1 LEU A 206 8.383 -30.698 38.181 1.00 25.84 C -ATOM 1537 CD2 LEU A 206 10.522 -29.805 37.148 1.00 21.85 C -ATOM 1538 N ASP A 207 12.317 -28.920 41.474 1.00 24.31 N -ATOM 1539 CA ASP A 207 12.413 -28.443 42.833 1.00 26.55 C -ATOM 1540 C ASP A 207 11.104 -28.863 43.501 1.00 29.31 C -ATOM 1541 O ASP A 207 10.014 -28.742 42.920 1.00 22.97 O -ATOM 1542 CB ASP A 207 12.536 -26.942 42.841 1.00 22.03 C -ATOM 1543 CG ASP A 207 12.384 -26.355 44.241 1.00 23.24 C -ATOM 1544 OD1 ASP A 207 13.308 -26.532 45.038 1.00 24.98 O -ATOM 1545 OD2 ASP A 207 11.350 -25.751 44.519 1.00 24.03 O -ATOM 1546 N ARG A 208 11.204 -29.311 44.760 1.00 26.76 N -ATOM 1547 CA ARG A 208 10.052 -29.752 45.541 1.00 22.68 C -ATOM 1548 C ARG A 208 8.952 -28.731 45.619 1.00 17.48 C -ATOM 1549 O ARG A 208 7.799 -29.036 45.306 1.00 22.76 O -ATOM 1550 CB ARG A 208 10.450 -30.093 46.997 1.00 24.59 C -ATOM 1551 CG ARG A 208 9.280 -30.540 47.905 1.00 26.44 C -ATOM 1552 CD ARG A 208 9.711 -30.470 49.382 1.00 20.80 C -ATOM 1553 NE ARG A 208 9.912 -29.091 49.803 1.00 20.58 N -ATOM 1554 CZ ARG A 208 11.067 -28.707 50.348 1.00 17.56 C -ATOM 1555 NH1 ARG A 208 12.081 -29.547 50.557 1.00 22.76 N -ATOM 1556 NH2 ARG A 208 11.220 -27.432 50.651 1.00 19.37 N -ATOM 1557 N ASP A 209 9.283 -27.519 46.063 1.00 16.79 N -ATOM 1558 CA ASP A 209 8.224 -26.561 46.241 1.00 17.98 C -ATOM 1559 C ASP A 209 7.692 -26.008 44.913 1.00 25.82 C -ATOM 1560 O ASP A 209 6.514 -25.676 44.824 1.00 23.17 O -ATOM 1561 CB ASP A 209 8.746 -25.456 47.156 1.00 24.37 C -ATOM 1562 CG ASP A 209 8.958 -25.951 48.609 1.00 28.77 C -ATOM 1563 OD1 ASP A 209 8.332 -26.917 49.039 1.00 22.89 O -ATOM 1564 OD2 ASP A 209 9.773 -25.356 49.292 1.00 27.21 O -ATOM 1565 N PHE A 210 8.491 -25.966 43.857 1.00 24.91 N -ATOM 1566 CA PHE A 210 7.994 -25.609 42.515 1.00 27.45 C -ATOM 1567 C PHE A 210 6.967 -26.694 42.077 1.00 21.30 C -ATOM 1568 O PHE A 210 5.830 -26.381 41.667 1.00 22.41 O -ATOM 1569 CB PHE A 210 9.258 -25.511 41.609 1.00 24.74 C -ATOM 1570 CG PHE A 210 9.033 -25.362 40.108 1.00 36.77 C -ATOM 1571 CD1 PHE A 210 8.844 -26.489 39.318 1.00 36.73 C -ATOM 1572 CD2 PHE A 210 9.010 -24.107 39.535 1.00 48.62 C -ATOM 1573 CE1 PHE A 210 8.629 -26.361 37.958 1.00 42.01 C -ATOM 1574 CE2 PHE A 210 8.796 -23.984 38.169 1.00 38.96 C -ATOM 1575 CZ PHE A 210 8.605 -25.107 37.388 1.00 34.54 C -ATOM 1576 N ALA A 211 7.288 -27.989 42.248 1.00 18.70 N -ATOM 1577 CA ALA A 211 6.367 -29.070 41.962 1.00 17.41 C -ATOM 1578 C ALA A 211 5.078 -28.999 42.740 1.00 21.61 C -ATOM 1579 O ALA A 211 3.986 -29.206 42.197 1.00 23.50 O -ATOM 1580 CB ALA A 211 7.087 -30.370 42.259 1.00 20.52 C -ATOM 1581 N ARG A 212 5.119 -28.675 44.039 1.00 24.46 N -ATOM 1582 CA ARG A 212 3.907 -28.580 44.840 1.00 21.96 C -ATOM 1583 C ARG A 212 3.031 -27.442 44.354 1.00 20.18 C -ATOM 1584 O ARG A 212 1.803 -27.553 44.346 1.00 23.86 O -ATOM 1585 CB ARG A 212 4.259 -28.343 46.321 1.00 19.67 C -ATOM 1586 CG ARG A 212 5.020 -29.538 46.960 1.00 22.71 C -ATOM 1587 CD ARG A 212 5.446 -29.292 48.472 1.00 23.65 C -ATOM 1588 NE ARG A 212 4.273 -28.986 49.277 1.00 20.64 N -ATOM 1589 CZ ARG A 212 3.513 -29.926 49.838 1.00 19.45 C -ATOM 1590 NH1 ARG A 212 3.829 -31.205 49.748 1.00 22.61 N -ATOM 1591 NH2 ARG A 212 2.434 -29.615 50.517 1.00 22.43 N -ATOM 1592 N ALA A 213 3.637 -26.328 43.942 1.00 22.64 N -ATOM 1593 CA ALA A 213 2.875 -25.177 43.421 1.00 24.94 C -ATOM 1594 C ALA A 213 2.142 -25.528 42.113 1.00 28.90 C -ATOM 1595 O ALA A 213 1.063 -24.985 41.886 1.00 28.23 O -ATOM 1596 CB ALA A 213 3.804 -23.997 43.173 1.00 18.67 C -ATOM 1597 N VAL A 214 2.628 -26.470 41.272 1.00 27.53 N -ATOM 1598 CA VAL A 214 1.899 -26.961 40.096 1.00 24.66 C -ATOM 1599 C VAL A 214 0.549 -27.454 40.554 1.00 28.81 C -ATOM 1600 O VAL A 214 -0.439 -27.180 39.876 1.00 36.46 O -ATOM 1601 CB VAL A 214 2.580 -28.169 39.376 1.00 28.48 C -ATOM 1602 CG1 VAL A 214 1.708 -28.805 38.273 1.00 34.90 C -ATOM 1603 CG2 VAL A 214 3.853 -27.658 38.787 1.00 30.97 C -ATOM 1604 N PHE A 215 0.479 -28.167 41.701 1.00 30.95 N -ATOM 1605 CA PHE A 215 -0.780 -28.734 42.192 1.00 22.46 C -ATOM 1606 C PHE A 215 -1.475 -27.849 43.206 1.00 22.21 C -ATOM 1607 O PHE A 215 -2.456 -28.240 43.854 1.00 31.72 O -ATOM 1608 CB PHE A 215 -0.532 -30.139 42.785 1.00 25.11 C -ATOM 1609 CG PHE A 215 -0.220 -31.216 41.740 1.00 24.68 C -ATOM 1610 CD1 PHE A 215 -1.257 -31.912 41.157 1.00 29.63 C -ATOM 1611 CD2 PHE A 215 1.084 -31.461 41.357 1.00 33.02 C -ATOM 1612 CE1 PHE A 215 -0.979 -32.845 40.185 1.00 29.05 C -ATOM 1613 CE2 PHE A 215 1.353 -32.394 40.383 1.00 34.93 C -ATOM 1614 CZ PHE A 215 0.323 -33.079 39.802 1.00 28.48 C -ATOM 1615 N ASP A 216 -0.985 -26.613 43.281 1.00 21.70 N -ATOM 1616 CA ASP A 216 -1.535 -25.593 44.127 1.00 28.43 C -ATOM 1617 C ASP A 216 -1.438 -25.965 45.612 1.00 31.75 C -ATOM 1618 O ASP A 216 -2.385 -25.730 46.383 1.00 34.20 O -ATOM 1619 CB ASP A 216 -2.975 -25.386 43.685 1.00 30.70 C -ATOM 1620 CG ASP A 216 -3.447 -23.971 43.857 1.00 58.07 C -ATOM 1621 OD1 ASP A 216 -2.615 -23.066 43.765 1.00 71.62 O -ATOM 1622 OD2 ASP A 216 -4.644 -23.792 44.079 1.00 83.68 O -ATOM 1623 N LEU A 217 -0.302 -26.558 45.999 1.00 27.44 N -ATOM 1624 CA LEU A 217 -0.097 -27.045 47.363 1.00 27.84 C -ATOM 1625 C LEU A 217 0.868 -26.098 48.046 1.00 27.78 C -ATOM 1626 O LEU A 217 1.775 -25.587 47.365 1.00 26.69 O -ATOM 1627 CB LEU A 217 0.482 -28.462 47.339 1.00 22.43 C -ATOM 1628 CG LEU A 217 -0.368 -29.545 46.687 1.00 21.31 C -ATOM 1629 CD1 LEU A 217 0.425 -30.812 46.668 1.00 20.93 C -ATOM 1630 CD2 LEU A 217 -1.675 -29.707 47.397 1.00 24.17 C -ATOM 1631 N THR A 218 0.654 -25.760 49.335 1.00 24.26 N -ATOM 1632 CA THR A 218 1.603 -24.878 50.056 1.00 27.38 C -ATOM 1633 C THR A 218 2.998 -25.499 50.095 1.00 19.15 C -ATOM 1634 O THR A 218 3.123 -26.738 50.111 1.00 25.68 O -ATOM 1635 CB THR A 218 1.172 -24.558 51.583 1.00 30.12 C -ATOM 1636 OG1 THR A 218 0.441 -25.619 52.157 1.00 46.14 O -ATOM 1637 CG2 THR A 218 0.361 -23.302 51.629 1.00 61.20 C -ATOM 1638 N PRO A 219 4.068 -24.709 50.157 1.00 21.50 N -ATOM 1639 CA PRO A 219 5.423 -25.218 50.277 1.00 23.92 C -ATOM 1640 C PRO A 219 5.713 -25.861 51.643 1.00 32.60 C -ATOM 1641 O PRO A 219 4.957 -25.603 52.600 1.00 29.02 O -ATOM 1642 CB PRO A 219 6.264 -24.003 49.999 1.00 26.19 C -ATOM 1643 CG PRO A 219 5.428 -22.849 50.465 1.00 25.43 C -ATOM 1644 CD PRO A 219 4.030 -23.251 50.079 1.00 20.73 C -ATOM 1645 N VAL A 220 6.764 -26.694 51.739 1.00 33.44 N -ATOM 1646 CA VAL A 220 7.141 -27.212 53.041 1.00 28.14 C -ATOM 1647 C VAL A 220 8.321 -26.376 53.539 1.00 37.97 C -ATOM 1648 O VAL A 220 9.198 -25.938 52.775 1.00 26.48 O -ATOM 1649 CB VAL A 220 7.474 -28.788 53.044 1.00 32.32 C -ATOM 1650 CG1 VAL A 220 6.828 -29.437 51.860 1.00 24.32 C -ATOM 1651 CG2 VAL A 220 8.915 -29.093 53.141 1.00 34.39 C -ATOM 1652 N ALA A 221 8.313 -26.094 54.847 1.00 25.77 N -ATOM 1653 CA ALA A 221 9.325 -25.258 55.460 1.00 22.75 C -ATOM 1654 C ALA A 221 10.534 -26.080 55.804 1.00 34.19 C -ATOM 1655 O ALA A 221 10.722 -26.485 56.955 1.00 35.48 O -ATOM 1656 CB ALA A 221 8.750 -24.626 56.716 1.00 25.04 C -ATOM 1657 N ALA A 222 11.347 -26.358 54.787 1.00 25.99 N -ATOM 1658 CA ALA A 222 12.566 -27.158 54.881 1.00 20.53 C -ATOM 1659 C ALA A 222 13.474 -26.719 53.755 1.00 27.31 C -ATOM 1660 O ALA A 222 13.019 -25.985 52.869 1.00 32.70 O -ATOM 1661 CB ALA A 222 12.334 -28.656 54.664 1.00 17.91 C -ATOM 1662 N ALA A 223 14.750 -27.089 53.799 1.00 27.27 N -ATOM 1663 CA ALA A 223 15.696 -26.836 52.713 1.00 33.28 C -ATOM 1664 C ALA A 223 15.235 -27.607 51.455 1.00 43.31 C -ATOM 1665 O ALA A 223 14.658 -28.721 51.516 1.00 26.72 O -ATOM 1666 CB ALA A 223 17.090 -27.326 53.081 1.00 24.82 C -ATOM 1667 N ALA A 224 15.479 -26.956 50.312 1.00 32.68 N -ATOM 1668 CA ALA A 224 15.033 -27.446 49.021 1.00 27.30 C -ATOM 1669 C ALA A 224 15.546 -28.827 48.722 1.00 25.24 C -ATOM 1670 O ALA A 224 16.683 -29.196 49.031 1.00 29.56 O -ATOM 1671 CB ALA A 224 15.531 -26.539 47.921 1.00 25.05 C -ATOM 1672 N THR A 225 14.685 -29.618 48.132 1.00 24.13 N -ATOM 1673 CA THR A 225 15.074 -30.941 47.687 1.00 25.61 C -ATOM 1674 C THR A 225 14.543 -31.084 46.261 1.00 36.20 C -ATOM 1675 O THR A 225 13.669 -30.284 45.868 1.00 26.28 O -ATOM 1676 CB THR A 225 14.448 -32.041 48.615 1.00 32.35 C -ATOM 1677 OG1 THR A 225 13.015 -31.944 48.645 1.00 30.23 O -ATOM 1678 CG2 THR A 225 14.976 -31.857 50.034 1.00 42.70 C -ATOM 1679 N ALA A 226 15.011 -32.065 45.487 1.00 30.91 N -ATOM 1680 CA ALA A 226 14.462 -32.311 44.154 1.00 36.76 C -ATOM 1681 C ALA A 226 13.513 -33.515 44.156 1.00 34.85 C -ATOM 1682 O ALA A 226 13.738 -34.427 44.952 1.00 40.82 O -ATOM 1683 CB ALA A 226 15.588 -32.581 43.203 1.00 25.21 C -ATOM 1684 N VAL A 227 12.415 -33.564 43.381 1.00 31.55 N -ATOM 1685 CA VAL A 227 11.510 -34.715 43.239 1.00 25.98 C -ATOM 1686 C VAL A 227 11.584 -35.229 41.797 1.00 37.72 C -ATOM 1687 O VAL A 227 11.799 -34.425 40.888 1.00 30.25 O -ATOM 1688 CB VAL A 227 10.031 -34.368 43.536 1.00 26.42 C -ATOM 1689 CG1 VAL A 227 9.922 -34.313 45.040 1.00 35.42 C -ATOM 1690 CG2 VAL A 227 9.569 -33.052 42.897 1.00 24.43 C -ATOM 1691 N ASP A 228 11.438 -36.512 41.495 1.00 28.65 N -ATOM 1692 CA ASP A 228 11.515 -37.003 40.118 1.00 30.27 C -ATOM 1693 C ASP A 228 10.189 -36.852 39.473 1.00 27.49 C -ATOM 1694 O ASP A 228 9.171 -36.951 40.160 1.00 27.44 O -ATOM 1695 CB ASP A 228 11.888 -38.488 40.051 1.00 29.18 C -ATOM 1696 CG ASP A 228 13.287 -38.733 40.626 1.00 36.93 C -ATOM 1697 OD1 ASP A 228 14.240 -38.049 40.232 1.00 60.99 O -ATOM 1698 OD2 ASP A 228 13.419 -39.588 41.502 1.00 67.40 O -ATOM 1699 N HIS A 229 10.128 -36.639 38.165 1.00 27.81 N -ATOM 1700 CA HIS A 229 8.830 -36.503 37.511 1.00 27.57 C -ATOM 1701 C HIS A 229 8.896 -37.122 36.125 1.00 22.47 C -ATOM 1702 O HIS A 229 9.984 -37.331 35.560 1.00 25.44 O -ATOM 1703 CB HIS A 229 8.397 -35.013 37.341 1.00 24.81 C -ATOM 1704 CG HIS A 229 9.312 -34.181 36.403 1.00 25.52 C -ATOM 1705 ND1 HIS A 229 10.615 -33.896 36.508 1.00 26.06 N -ATOM 1706 CD2 HIS A 229 8.872 -33.550 35.242 1.00 26.80 C -ATOM 1707 CE1 HIS A 229 10.975 -33.137 35.493 1.00 31.27 C -ATOM 1708 NE2 HIS A 229 9.917 -32.942 34.749 1.00 24.74 N -ATOM 1709 N LYS A 230 7.707 -37.415 35.634 1.00 25.04 N -ATOM 1710 CA LYS A 230 7.595 -37.800 34.269 1.00 31.02 C -ATOM 1711 C LYS A 230 6.333 -37.202 33.715 1.00 29.49 C -ATOM 1712 O LYS A 230 5.422 -36.866 34.461 1.00 24.54 O -ATOM 1713 CB LYS A 230 7.587 -39.292 34.172 1.00 26.28 C -ATOM 1714 CG LYS A 230 6.388 -40.093 34.564 1.00 47.78 C -ATOM 1715 CD LYS A 230 6.930 -41.543 34.609 1.00 73.52 C -ATOM 1716 CE LYS A 230 8.071 -41.699 35.655 1.00 89.17 C -ATOM 1717 NZ LYS A 230 8.899 -42.887 35.501 1.00101.19 N -ATOM 1718 N ALA A 231 6.307 -36.988 32.407 1.00 28.59 N -ATOM 1719 CA ALA A 231 5.160 -36.419 31.722 1.00 23.31 C -ATOM 1720 C ALA A 231 5.135 -37.079 30.339 1.00 23.75 C -ATOM 1721 O ALA A 231 6.189 -37.406 29.764 1.00 27.95 O -ATOM 1722 CB ALA A 231 5.364 -34.920 31.575 1.00 23.08 C -ATOM 1723 N TYR A 232 3.972 -37.375 29.801 1.00 23.45 N -ATOM 1724 CA TYR A 232 3.874 -37.908 28.445 1.00 32.26 C -ATOM 1725 C TYR A 232 2.487 -37.605 27.895 1.00 29.25 C -ATOM 1726 O TYR A 232 1.550 -37.348 28.668 1.00 27.46 O -ATOM 1727 CB TYR A 232 4.162 -39.439 28.413 1.00 28.02 C -ATOM 1728 CG TYR A 232 3.494 -40.240 29.515 1.00 27.17 C -ATOM 1729 CD1 TYR A 232 4.167 -40.375 30.718 1.00 35.93 C -ATOM 1730 CD2 TYR A 232 2.236 -40.789 29.331 1.00 30.56 C -ATOM 1731 CE1 TYR A 232 3.571 -41.057 31.753 1.00 40.00 C -ATOM 1732 CE2 TYR A 232 1.634 -41.488 30.366 1.00 39.00 C -ATOM 1733 CZ TYR A 232 2.312 -41.611 31.573 1.00 38.48 C -ATOM 1734 OH TYR A 232 1.717 -42.278 32.642 1.00 56.10 O -ATOM 1735 N GLY A 233 2.285 -37.561 26.574 1.00 22.51 N -ATOM 1736 CA GLY A 233 0.985 -37.244 26.014 1.00 24.02 C -ATOM 1737 C GLY A 233 0.950 -37.507 24.514 1.00 26.25 C -ATOM 1738 O GLY A 233 1.941 -37.833 23.856 1.00 24.83 O -ATOM 1739 N LEU A 234 -0.223 -37.323 23.996 1.00 25.95 N -ATOM 1740 CA LEU A 234 -0.460 -37.640 22.618 1.00 24.03 C -ATOM 1741 C LEU A 234 -1.584 -36.777 22.103 1.00 28.04 C -ATOM 1742 O LEU A 234 -2.514 -36.506 22.890 1.00 28.24 O -ATOM 1743 CB LEU A 234 -0.866 -39.070 22.566 1.00 31.10 C -ATOM 1744 CG LEU A 234 -1.539 -39.544 21.317 1.00 41.38 C -ATOM 1745 CD1 LEU A 234 -0.480 -39.786 20.245 1.00 34.15 C -ATOM 1746 CD2 LEU A 234 -2.356 -40.751 21.648 1.00 42.03 C -ATOM 1747 N SER A 235 -1.534 -36.329 20.833 1.00 26.13 N -ATOM 1748 CA SER A 235 -2.724 -35.732 20.265 1.00 25.83 C -ATOM 1749 C SER A 235 -2.895 -36.213 18.836 1.00 25.93 C -ATOM 1750 O SER A 235 -1.899 -36.580 18.179 1.00 28.39 O -ATOM 1751 CB SER A 235 -2.699 -34.190 20.226 1.00 32.71 C -ATOM 1752 OG SER A 235 -1.734 -33.546 19.431 1.00 30.62 O -ATOM 1753 N VAL A 236 -4.162 -36.183 18.415 1.00 24.17 N -ATOM 1754 CA VAL A 236 -4.537 -36.596 17.082 1.00 35.92 C -ATOM 1755 C VAL A 236 -5.526 -35.562 16.575 1.00 30.98 C -ATOM 1756 O VAL A 236 -6.478 -35.231 17.299 1.00 29.40 O -ATOM 1757 CB VAL A 236 -5.242 -37.999 17.076 1.00 37.21 C -ATOM 1758 CG1 VAL A 236 -5.538 -38.410 15.632 1.00 36.84 C -ATOM 1759 CG2 VAL A 236 -4.348 -39.079 17.632 1.00 26.11 C -ATOM 1760 N ASP A 237 -5.348 -35.028 15.361 1.00 32.91 N -ATOM 1761 CA ASP A 237 -6.394 -34.211 14.758 1.00 25.51 C -ATOM 1762 C ASP A 237 -6.495 -34.598 13.289 1.00 35.12 C -ATOM 1763 O ASP A 237 -5.479 -35.003 12.696 1.00 26.89 O -ATOM 1764 CB ASP A 237 -6.092 -32.730 14.842 1.00 18.52 C -ATOM 1765 CG ASP A 237 -4.815 -32.240 14.216 1.00 30.05 C -ATOM 1766 OD1 ASP A 237 -3.766 -32.292 14.847 1.00 32.68 O -ATOM 1767 OD2 ASP A 237 -4.885 -31.769 13.090 1.00 32.21 O -ATOM 1768 N SER A 238 -7.670 -34.485 12.706 1.00 26.63 N -ATOM 1769 CA SER A 238 -7.842 -34.834 11.317 1.00 37.70 C -ATOM 1770 C SER A 238 -8.823 -33.890 10.690 1.00 32.20 C -ATOM 1771 O SER A 238 -9.807 -33.469 11.318 1.00 31.51 O -ATOM 1772 CB SER A 238 -8.377 -36.244 11.179 1.00 41.15 C -ATOM 1773 OG SER A 238 -8.165 -36.687 9.837 1.00 71.90 O -ATOM 1774 N THR A 239 -8.540 -33.586 9.431 1.00 36.96 N -ATOM 1775 CA THR A 239 -9.398 -32.696 8.670 1.00 32.71 C -ATOM 1776 C THR A 239 -10.155 -33.389 7.544 1.00 36.75 C -ATOM 1777 O THR A 239 -9.556 -34.067 6.710 1.00 49.53 O -ATOM 1778 CB THR A 239 -8.536 -31.582 8.106 1.00 32.24 C -ATOM 1779 OG1 THR A 239 -7.852 -30.961 9.187 1.00 37.41 O -ATOM 1780 CG2 THR A 239 -9.370 -30.533 7.409 1.00 43.12 C -ATOM 1781 N PHE A 240 -11.462 -33.214 7.506 1.00 32.39 N -ATOM 1782 CA PHE A 240 -12.341 -33.703 6.445 1.00 34.60 C -ATOM 1783 C PHE A 240 -13.163 -32.519 5.907 1.00 35.95 C -ATOM 1784 O PHE A 240 -14.186 -32.080 6.472 1.00 35.29 O -ATOM 1785 CB PHE A 240 -13.350 -34.771 6.926 1.00 44.97 C -ATOM 1786 CG PHE A 240 -13.345 -35.118 8.409 1.00 76.78 C -ATOM 1787 CD1 PHE A 240 -12.351 -35.948 8.916 1.00 80.80 C -ATOM 1788 CD2 PHE A 240 -14.340 -34.611 9.227 1.00 80.91 C -ATOM 1789 CE1 PHE A 240 -12.351 -36.280 10.251 1.00 68.89 C -ATOM 1790 CE2 PHE A 240 -14.331 -34.950 10.563 1.00 82.55 C -ATOM 1791 CZ PHE A 240 -13.340 -35.778 11.067 1.00 81.89 C -ATOM 1792 N GLY A 241 -12.680 -31.948 4.808 1.00 34.25 N -ATOM 1793 CA GLY A 241 -13.350 -30.824 4.204 1.00 33.96 C -ATOM 1794 C GLY A 241 -13.040 -29.537 4.968 1.00 29.52 C -ATOM 1795 O GLY A 241 -11.882 -29.126 5.127 1.00 42.22 O -ATOM 1796 N ALA A 242 -14.115 -28.897 5.419 1.00 36.46 N -ATOM 1797 CA ALA A 242 -14.010 -27.686 6.217 1.00 38.95 C -ATOM 1798 C ALA A 242 -13.882 -28.010 7.720 1.00 32.64 C -ATOM 1799 O ALA A 242 -13.627 -27.086 8.491 1.00 34.81 O -ATOM 1800 CB ALA A 242 -15.262 -26.850 5.969 1.00 29.62 C -ATOM 1801 N THR A 243 -14.038 -29.268 8.161 1.00 28.72 N -ATOM 1802 CA THR A 243 -14.065 -29.689 9.551 1.00 32.77 C -ATOM 1803 C THR A 243 -12.794 -30.303 10.043 1.00 38.01 C -ATOM 1804 O THR A 243 -12.331 -31.287 9.467 1.00 34.60 O -ATOM 1805 CB THR A 243 -15.173 -30.719 9.790 1.00 29.34 C -ATOM 1806 OG1 THR A 243 -16.361 -30.152 9.254 1.00 38.80 O -ATOM 1807 CG2 THR A 243 -15.431 -31.019 11.255 1.00 36.27 C -ATOM 1808 N THR A 244 -12.219 -29.739 11.095 1.00 27.70 N -ATOM 1809 CA THR A 244 -11.122 -30.407 11.774 1.00 21.95 C -ATOM 1810 C THR A 244 -11.688 -30.849 13.123 1.00 38.04 C -ATOM 1811 O THR A 244 -12.524 -30.149 13.726 1.00 29.47 O -ATOM 1812 CB THR A 244 -10.004 -29.457 11.967 1.00 27.11 C -ATOM 1813 OG1 THR A 244 -9.643 -29.054 10.641 1.00 30.63 O -ATOM 1814 CG2 THR A 244 -8.854 -30.056 12.776 1.00 22.16 C -ATOM 1815 N VAL A 245 -11.298 -32.053 13.533 1.00 32.84 N -ATOM 1816 CA VAL A 245 -11.691 -32.672 14.799 1.00 23.59 C -ATOM 1817 C VAL A 245 -10.380 -33.151 15.399 1.00 30.46 C -ATOM 1818 O VAL A 245 -9.480 -33.587 14.666 1.00 28.97 O -ATOM 1819 CB VAL A 245 -12.643 -33.860 14.564 1.00 26.50 C -ATOM 1820 CG1 VAL A 245 -12.936 -34.616 15.851 1.00 42.06 C -ATOM 1821 CG2 VAL A 245 -13.983 -33.313 14.105 1.00 29.56 C -ATOM 1822 N GLY A 246 -10.217 -32.981 16.715 1.00 30.97 N -ATOM 1823 CA GLY A 246 -8.989 -33.402 17.357 1.00 28.37 C -ATOM 1824 C GLY A 246 -9.056 -33.404 18.881 1.00 31.52 C -ATOM 1825 O GLY A 246 -10.015 -32.875 19.467 1.00 29.24 O -ATOM 1826 N GLY A 247 -8.033 -33.959 19.524 1.00 26.92 N -ATOM 1827 CA GLY A 247 -8.013 -34.006 20.963 1.00 25.58 C -ATOM 1828 C GLY A 247 -6.646 -34.406 21.421 1.00 36.99 C -ATOM 1829 O GLY A 247 -5.803 -34.741 20.587 1.00 25.32 O -ATOM 1830 N TYR A 248 -6.416 -34.408 22.735 1.00 23.62 N -ATOM 1831 CA TYR A 248 -5.115 -34.748 23.270 1.00 20.94 C -ATOM 1832 C TYR A 248 -5.325 -35.358 24.660 1.00 20.63 C -ATOM 1833 O TYR A 248 -6.406 -35.164 25.255 1.00 21.90 O -ATOM 1834 CB TYR A 248 -4.231 -33.486 23.387 1.00 21.56 C -ATOM 1835 CG TYR A 248 -4.760 -32.431 24.364 1.00 25.21 C -ATOM 1836 CD1 TYR A 248 -4.438 -32.548 25.708 1.00 27.92 C -ATOM 1837 CD2 TYR A 248 -5.615 -31.411 23.968 1.00 24.90 C -ATOM 1838 CE1 TYR A 248 -4.966 -31.665 26.639 1.00 26.26 C -ATOM 1839 CE2 TYR A 248 -6.151 -30.519 24.904 1.00 31.70 C -ATOM 1840 CZ TYR A 248 -5.819 -30.648 26.258 1.00 26.70 C -ATOM 1841 OH TYR A 248 -6.318 -29.797 27.251 1.00 25.24 O -ATOM 1842 N VAL A 249 -4.321 -36.040 25.195 1.00 24.77 N -ATOM 1843 CA VAL A 249 -4.367 -36.470 26.593 1.00 27.74 C -ATOM 1844 C VAL A 249 -2.923 -36.423 27.059 1.00 28.50 C -ATOM 1845 O VAL A 249 -1.975 -36.725 26.318 1.00 24.37 O -ATOM 1846 CB VAL A 249 -5.003 -37.894 26.729 1.00 30.76 C -ATOM 1847 CG1 VAL A 249 -4.158 -38.959 26.069 1.00 36.77 C -ATOM 1848 CG2 VAL A 249 -5.154 -38.207 28.211 1.00 29.16 C -ATOM 1849 N GLN A 250 -2.715 -35.905 28.269 1.00 22.78 N -ATOM 1850 CA GLN A 250 -1.387 -35.776 28.807 1.00 23.77 C -ATOM 1851 C GLN A 250 -1.468 -36.243 30.256 1.00 25.06 C -ATOM 1852 O GLN A 250 -2.549 -36.178 30.872 1.00 21.33 O -ATOM 1853 CB GLN A 250 -0.900 -34.339 28.864 1.00 23.22 C -ATOM 1854 CG GLN A 250 -1.124 -33.547 27.625 1.00 24.76 C -ATOM 1855 CD GLN A 250 -0.215 -32.353 27.600 1.00 18.99 C -ATOM 1856 OE1 GLN A 250 0.992 -32.480 27.720 1.00 23.92 O -ATOM 1857 NE2 GLN A 250 -0.707 -31.141 27.461 1.00 20.19 N -ATOM 1858 N VAL A 251 -0.358 -36.761 30.770 1.00 29.03 N -ATOM 1859 CA VAL A 251 -0.307 -37.017 32.189 1.00 26.98 C -ATOM 1860 C VAL A 251 1.015 -36.492 32.676 1.00 25.15 C -ATOM 1861 O VAL A 251 2.068 -36.481 32.014 1.00 26.27 O -ATOM 1862 CB VAL A 251 -0.510 -38.552 32.608 1.00 33.15 C -ATOM 1863 CG1 VAL A 251 -0.968 -39.355 31.434 1.00 26.27 C -ATOM 1864 CG2 VAL A 251 0.702 -39.104 33.283 1.00 32.70 C -ATOM 1865 N LEU A 252 0.873 -35.954 33.891 1.00 23.70 N -ATOM 1866 CA LEU A 252 2.023 -35.435 34.601 1.00 21.27 C -ATOM 1867 C LEU A 252 2.033 -36.219 35.906 1.00 26.27 C -ATOM 1868 O LEU A 252 0.990 -36.303 36.555 1.00 26.01 O -ATOM 1869 CB LEU A 252 1.825 -33.976 34.863 1.00 22.83 C -ATOM 1870 CG LEU A 252 2.836 -33.284 35.749 1.00 32.44 C -ATOM 1871 CD1 LEU A 252 4.251 -33.390 35.206 1.00 25.21 C -ATOM 1872 CD2 LEU A 252 2.333 -31.861 35.904 1.00 28.50 C -ATOM 1873 N ASP A 253 3.167 -36.799 36.251 1.00 25.12 N -ATOM 1874 CA ASP A 253 3.301 -37.651 37.415 1.00 34.71 C -ATOM 1875 C ASP A 253 4.503 -37.199 38.247 1.00 25.50 C -ATOM 1876 O ASP A 253 5.652 -37.463 37.851 1.00 26.91 O -ATOM 1877 CB ASP A 253 3.454 -39.066 36.865 1.00 31.51 C -ATOM 1878 CG ASP A 253 3.436 -40.240 37.841 1.00 52.04 C -ATOM 1879 OD1 ASP A 253 3.598 -40.015 39.040 1.00 49.77 O -ATOM 1880 OD2 ASP A 253 3.257 -41.381 37.389 1.00 67.89 O -ATOM 1881 N ILE A 254 4.327 -36.531 39.394 1.00 24.18 N -ATOM 1882 CA ILE A 254 5.467 -36.087 40.166 1.00 23.34 C -ATOM 1883 C ILE A 254 5.483 -36.909 41.440 1.00 30.07 C -ATOM 1884 O ILE A 254 4.540 -36.908 42.249 1.00 29.61 O -ATOM 1885 CB ILE A 254 5.378 -34.625 40.550 1.00 20.78 C -ATOM 1886 CG1 ILE A 254 5.120 -33.770 39.278 1.00 23.54 C -ATOM 1887 CG2 ILE A 254 6.696 -34.241 41.236 1.00 20.01 C -ATOM 1888 CD1 ILE A 254 4.936 -32.261 39.497 1.00 30.48 C -ATOM 1889 N ASP A 255 6.606 -37.585 41.539 1.00 27.10 N -ATOM 1890 CA ASP A 255 6.902 -38.482 42.630 1.00 37.11 C -ATOM 1891 C ASP A 255 6.845 -37.723 43.957 1.00 34.48 C -ATOM 1892 O ASP A 255 7.377 -36.618 44.107 1.00 33.20 O -ATOM 1893 CB ASP A 255 8.290 -39.064 42.417 1.00 36.96 C -ATOM 1894 CG ASP A 255 8.690 -40.163 43.403 1.00 61.77 C -ATOM 1895 OD1 ASP A 255 7.879 -41.053 43.678 1.00 63.74 O -ATOM 1896 OD2 ASP A 255 9.818 -40.132 43.893 1.00 54.70 O -ATOM 1897 N THR A 256 6.132 -38.389 44.869 1.00 38.04 N -ATOM 1898 CA THR A 256 5.860 -37.972 46.235 1.00 27.79 C -ATOM 1899 C THR A 256 4.849 -36.835 46.246 1.00 45.76 C -ATOM 1900 O THR A 256 4.408 -36.503 47.344 1.00 49.10 O -ATOM 1901 CB THR A 256 7.129 -37.485 47.075 1.00 37.48 C -ATOM 1902 OG1 THR A 256 7.491 -36.195 46.656 1.00 37.65 O -ATOM 1903 CG2 THR A 256 8.331 -38.390 46.918 1.00 36.65 C -ATOM 1904 N ILE A 257 4.398 -36.198 45.147 1.00 46.16 N -ATOM 1905 CA ILE A 257 3.436 -35.093 45.238 1.00 36.33 C -ATOM 1906 C ILE A 257 2.150 -35.643 44.702 1.00 45.12 C -ATOM 1907 O ILE A 257 1.300 -36.026 45.495 1.00 39.40 O -ATOM 1908 CB ILE A 257 3.835 -33.831 44.393 1.00 30.69 C -ATOM 1909 CG1 ILE A 257 5.261 -33.393 44.729 1.00 26.95 C -ATOM 1910 CG2 ILE A 257 2.776 -32.750 44.585 1.00 28.34 C -ATOM 1911 CD1 ILE A 257 5.617 -33.165 46.186 1.00 47.06 C -ATOM 1912 N ASP A 258 1.980 -35.772 43.386 1.00 26.70 N -ATOM 1913 CA ASP A 258 0.726 -36.235 42.834 1.00 20.95 C -ATOM 1914 C ASP A 258 0.900 -36.477 41.310 1.00 21.68 C -ATOM 1915 O ASP A 258 1.987 -36.248 40.781 1.00 25.33 O -ATOM 1916 CB ASP A 258 -0.359 -35.176 43.097 1.00 24.31 C -ATOM 1917 CG ASP A 258 -1.793 -35.738 43.188 1.00 39.02 C -ATOM 1918 OD1 ASP A 258 -2.027 -36.953 43.009 1.00 36.22 O -ATOM 1919 OD2 ASP A 258 -2.705 -34.944 43.447 1.00 49.23 O -ATOM 1920 N ASP A 259 -0.152 -36.966 40.657 1.00 32.03 N -ATOM 1921 CA ASP A 259 -0.230 -37.188 39.229 1.00 35.51 C -ATOM 1922 C ASP A 259 -1.548 -36.603 38.763 1.00 29.00 C -ATOM 1923 O ASP A 259 -2.461 -36.390 39.566 1.00 29.90 O -ATOM 1924 CB ASP A 259 -0.192 -38.674 38.860 1.00 29.16 C -ATOM 1925 CG ASP A 259 -1.224 -39.576 39.537 1.00 32.42 C -ATOM 1926 OD1 ASP A 259 -2.393 -39.544 39.181 1.00 53.80 O -ATOM 1927 OD2 ASP A 259 -0.846 -40.322 40.433 1.00 66.04 O -ATOM 1928 N VAL A 260 -1.665 -36.276 37.483 1.00 23.61 N -ATOM 1929 CA VAL A 260 -2.910 -35.780 36.928 1.00 21.31 C -ATOM 1930 C VAL A 260 -2.886 -36.211 35.452 1.00 25.64 C -ATOM 1931 O VAL A 260 -1.818 -36.338 34.836 1.00 25.09 O -ATOM 1932 CB VAL A 260 -2.958 -34.221 37.123 1.00 21.65 C -ATOM 1933 CG1 VAL A 260 -1.779 -33.495 36.460 1.00 22.43 C -ATOM 1934 CG2 VAL A 260 -4.300 -33.747 36.600 1.00 23.25 C -ATOM 1935 N THR A 261 -4.073 -36.529 34.953 1.00 26.37 N -ATOM 1936 CA THR A 261 -4.323 -36.788 33.551 1.00 29.83 C -ATOM 1937 C THR A 261 -5.306 -35.690 33.145 1.00 28.17 C -ATOM 1938 O THR A 261 -6.336 -35.465 33.799 1.00 27.71 O -ATOM 1939 CB THR A 261 -4.949 -38.190 33.349 1.00 28.09 C -ATOM 1940 OG1 THR A 261 -3.930 -39.126 33.734 1.00 29.64 O -ATOM 1941 CG2 THR A 261 -5.462 -38.417 31.908 1.00 25.84 C -ATOM 1942 N TYR A 262 -4.983 -34.982 32.066 1.00 29.21 N -ATOM 1943 CA TYR A 262 -5.785 -33.861 31.598 1.00 24.79 C -ATOM 1944 C TYR A 262 -5.915 -34.030 30.083 1.00 23.96 C -ATOM 1945 O TYR A 262 -5.044 -34.609 29.415 1.00 24.24 O -ATOM 1946 CB TYR A 262 -5.088 -32.537 31.993 1.00 24.82 C -ATOM 1947 CG TYR A 262 -3.579 -32.350 31.796 1.00 25.17 C -ATOM 1948 CD1 TYR A 262 -2.604 -33.061 32.501 1.00 21.56 C -ATOM 1949 CD2 TYR A 262 -3.159 -31.368 30.913 1.00 32.68 C -ATOM 1950 CE1 TYR A 262 -1.248 -32.785 32.330 1.00 28.66 C -ATOM 1951 CE2 TYR A 262 -1.802 -31.079 30.741 1.00 24.26 C -ATOM 1952 CZ TYR A 262 -0.855 -31.784 31.449 1.00 29.01 C -ATOM 1953 OH TYR A 262 0.468 -31.450 31.285 1.00 26.50 O -ATOM 1954 N TYR A 263 -7.042 -33.622 29.559 1.00 22.32 N -ATOM 1955 CA TYR A 263 -7.335 -33.906 28.175 1.00 30.67 C -ATOM 1956 C TYR A 263 -8.337 -32.893 27.616 1.00 32.19 C -ATOM 1957 O TYR A 263 -8.975 -32.135 28.353 1.00 24.76 O -ATOM 1958 CB TYR A 263 -7.857 -35.363 28.104 1.00 25.45 C -ATOM 1959 CG TYR A 263 -9.175 -35.513 28.819 1.00 36.72 C -ATOM 1960 CD1 TYR A 263 -10.316 -35.199 28.093 1.00 42.51 C -ATOM 1961 CD2 TYR A 263 -9.207 -35.844 30.165 1.00 40.64 C -ATOM 1962 CE1 TYR A 263 -11.539 -35.174 28.691 1.00 50.49 C -ATOM 1963 CE2 TYR A 263 -10.438 -35.822 30.778 1.00 36.33 C -ATOM 1964 CZ TYR A 263 -11.580 -35.477 30.032 1.00 50.61 C -ATOM 1965 OH TYR A 263 -12.823 -35.358 30.642 1.00 80.92 O -ATOM 1966 N GLY A 264 -8.571 -32.889 26.313 1.00 25.91 N -ATOM 1967 CA GLY A 264 -9.496 -31.983 25.661 1.00 21.27 C -ATOM 1968 C GLY A 264 -9.816 -32.541 24.276 1.00 23.07 C -ATOM 1969 O GLY A 264 -9.062 -33.344 23.705 1.00 25.86 O -ATOM 1970 N LEU A 265 -10.947 -32.088 23.794 1.00 23.56 N -ATOM 1971 CA LEU A 265 -11.537 -32.566 22.562 1.00 26.65 C -ATOM 1972 C LEU A 265 -12.237 -31.344 21.956 1.00 27.04 C -ATOM 1973 O LEU A 265 -13.041 -30.658 22.628 1.00 23.67 O -ATOM 1974 CB LEU A 265 -12.584 -33.655 22.879 1.00 27.27 C -ATOM 1975 CG LEU A 265 -12.649 -34.995 22.175 1.00 60.41 C -ATOM 1976 CD1 LEU A 265 -12.763 -34.816 20.658 1.00 50.33 C -ATOM 1977 CD2 LEU A 265 -11.395 -35.779 22.546 1.00 66.28 C -ATOM 1978 N GLY A 266 -11.951 -31.022 20.694 1.00 24.66 N -ATOM 1979 CA GLY A 266 -12.640 -29.907 20.061 1.00 28.90 C -ATOM 1980 C GLY A 266 -12.729 -30.028 18.549 1.00 30.41 C -ATOM 1981 O GLY A 266 -12.123 -30.912 17.929 1.00 27.92 O -ATOM 1982 N ALA A 267 -13.472 -29.113 17.964 1.00 24.95 N -ATOM 1983 CA ALA A 267 -13.627 -29.097 16.532 1.00 33.88 C -ATOM 1984 C ALA A 267 -13.626 -27.690 16.016 1.00 31.63 C -ATOM 1985 O ALA A 267 -13.943 -26.760 16.764 1.00 24.94 O -ATOM 1986 CB ALA A 267 -14.947 -29.688 16.119 1.00 24.74 C -ATOM 1987 N SER A 268 -13.311 -27.544 14.737 1.00 29.24 N -ATOM 1988 CA SER A 268 -13.505 -26.275 14.076 1.00 25.82 C -ATOM 1989 C SER A 268 -14.077 -26.503 12.695 1.00 31.52 C -ATOM 1990 O SER A 268 -13.861 -27.550 12.082 1.00 28.68 O -ATOM 1991 CB SER A 268 -12.188 -25.504 13.964 1.00 24.92 C -ATOM 1992 OG SER A 268 -11.044 -26.303 13.739 1.00 39.59 O -ATOM 1993 N TYR A 269 -14.763 -25.494 12.230 1.00 26.59 N -ATOM 1994 CA TYR A 269 -15.364 -25.502 10.940 1.00 25.66 C -ATOM 1995 C TYR A 269 -14.905 -24.252 10.228 1.00 25.81 C -ATOM 1996 O TYR A 269 -15.202 -23.132 10.648 1.00 25.05 O -ATOM 1997 CB TYR A 269 -16.841 -25.513 11.147 1.00 23.54 C -ATOM 1998 CG TYR A 269 -17.518 -25.612 9.808 1.00 33.37 C -ATOM 1999 CD1 TYR A 269 -17.639 -26.848 9.204 1.00 29.64 C -ATOM 2000 CD2 TYR A 269 -17.940 -24.462 9.180 1.00 39.37 C -ATOM 2001 CE1 TYR A 269 -18.189 -26.926 7.938 1.00 52.56 C -ATOM 2002 CE2 TYR A 269 -18.482 -24.534 7.916 1.00 51.57 C -ATOM 2003 CZ TYR A 269 -18.605 -25.768 7.301 1.00 58.86 C -ATOM 2004 OH TYR A 269 -19.150 -25.833 6.027 1.00 61.25 O -ATOM 2005 N ASP A 270 -14.225 -24.389 9.114 1.00 22.56 N -ATOM 2006 CA ASP A 270 -13.728 -23.239 8.392 1.00 20.61 C -ATOM 2007 C ASP A 270 -14.818 -22.578 7.539 1.00 29.68 C -ATOM 2008 O ASP A 270 -15.426 -23.238 6.697 1.00 34.39 O -ATOM 2009 CB ASP A 270 -12.550 -23.739 7.549 1.00 24.95 C -ATOM 2010 CG ASP A 270 -11.686 -22.678 6.877 1.00 33.53 C -ATOM 2011 OD1 ASP A 270 -12.079 -21.518 6.858 1.00 33.68 O -ATOM 2012 OD2 ASP A 270 -10.599 -23.005 6.391 1.00 54.40 O -ATOM 2013 N LEU A 271 -15.094 -21.291 7.724 1.00 24.09 N -ATOM 2014 CA LEU A 271 -16.068 -20.546 6.940 1.00 21.32 C -ATOM 2015 C LEU A 271 -15.387 -19.861 5.747 1.00 23.96 C -ATOM 2016 O LEU A 271 -16.039 -19.186 4.965 1.00 23.54 O -ATOM 2017 CB LEU A 271 -16.718 -19.450 7.764 1.00 19.85 C -ATOM 2018 CG LEU A 271 -17.482 -19.817 9.037 1.00 23.59 C -ATOM 2019 CD1 LEU A 271 -18.005 -18.566 9.724 1.00 24.13 C -ATOM 2020 CD2 LEU A 271 -18.614 -20.710 8.684 1.00 25.97 C -ATOM 2021 N GLY A 272 -14.077 -19.917 5.657 1.00 21.11 N -ATOM 2022 CA GLY A 272 -13.297 -19.265 4.646 1.00 20.61 C -ATOM 2023 C GLY A 272 -13.020 -17.808 4.960 1.00 23.49 C -ATOM 2024 O GLY A 272 -13.642 -17.214 5.841 1.00 26.07 O -ATOM 2025 N GLY A 273 -12.048 -17.183 4.294 1.00 16.10 N -ATOM 2026 CA GLY A 273 -11.850 -15.758 4.404 1.00 15.88 C -ATOM 2027 C GLY A 273 -11.120 -15.370 5.693 1.00 23.40 C -ATOM 2028 O GLY A 273 -10.858 -14.193 5.896 1.00 24.50 O -ATOM 2029 N GLY A 274 -10.716 -16.337 6.529 1.00 27.38 N -ATOM 2030 CA GLY A 274 -10.024 -16.087 7.796 1.00 27.44 C -ATOM 2031 C GLY A 274 -10.951 -16.319 9.003 1.00 31.13 C -ATOM 2032 O GLY A 274 -10.559 -15.962 10.109 1.00 26.17 O -ATOM 2033 N ALA A 275 -12.150 -16.880 8.849 1.00 21.61 N -ATOM 2034 CA ALA A 275 -13.084 -17.081 9.935 1.00 21.23 C -ATOM 2035 C ALA A 275 -13.397 -18.550 10.106 1.00 31.65 C -ATOM 2036 O ALA A 275 -13.438 -19.304 9.129 1.00 22.67 O -ATOM 2037 CB ALA A 275 -14.384 -16.338 9.664 1.00 16.02 C -ATOM 2038 N SER A 276 -13.567 -19.003 11.350 1.00 19.43 N -ATOM 2039 CA SER A 276 -13.933 -20.370 11.654 1.00 19.76 C -ATOM 2040 C SER A 276 -14.798 -20.406 12.926 1.00 25.83 C -ATOM 2041 O SER A 276 -14.736 -19.480 13.750 1.00 23.50 O -ATOM 2042 CB SER A 276 -12.659 -21.228 11.821 1.00 21.87 C -ATOM 2043 OG SER A 276 -11.650 -20.655 12.638 1.00 34.39 O -ATOM 2044 N ILE A 277 -15.679 -21.387 13.049 1.00 22.23 N -ATOM 2045 CA ILE A 277 -16.508 -21.592 14.227 1.00 22.99 C -ATOM 2046 C ILE A 277 -15.711 -22.641 14.979 1.00 28.21 C -ATOM 2047 O ILE A 277 -15.281 -23.638 14.373 1.00 23.58 O -ATOM 2048 CB ILE A 277 -17.884 -22.116 13.800 1.00 26.04 C -ATOM 2049 CG1 ILE A 277 -18.611 -21.066 13.027 1.00 28.06 C -ATOM 2050 CG2 ILE A 277 -18.730 -22.472 15.023 1.00 24.61 C -ATOM 2051 CD1 ILE A 277 -19.860 -21.684 12.370 1.00 28.49 C -ATOM 2052 N VAL A 278 -15.414 -22.462 16.276 1.00 24.26 N -ATOM 2053 CA VAL A 278 -14.525 -23.365 17.035 1.00 25.14 C -ATOM 2054 C VAL A 278 -15.179 -23.631 18.396 1.00 25.78 C -ATOM 2055 O VAL A 278 -15.724 -22.712 19.016 1.00 23.74 O -ATOM 2056 CB VAL A 278 -13.131 -22.725 17.291 1.00 22.54 C -ATOM 2057 CG1 VAL A 278 -12.205 -23.783 17.813 1.00 18.27 C -ATOM 2058 CG2 VAL A 278 -12.549 -22.120 16.040 1.00 24.97 C -ATOM 2059 N GLY A 279 -15.140 -24.844 18.907 1.00 22.69 N -ATOM 2060 CA GLY A 279 -15.720 -25.165 20.201 1.00 23.27 C -ATOM 2061 C GLY A 279 -14.945 -26.330 20.772 1.00 25.33 C -ATOM 2062 O GLY A 279 -14.236 -27.024 20.031 1.00 26.35 O -ATOM 2063 N GLY A 280 -15.009 -26.605 22.070 1.00 22.79 N -ATOM 2064 CA GLY A 280 -14.234 -27.694 22.641 1.00 23.14 C -ATOM 2065 C GLY A 280 -14.617 -27.915 24.096 1.00 20.25 C -ATOM 2066 O GLY A 280 -15.400 -27.157 24.669 1.00 22.34 O -ATOM 2067 N ILE A 281 -14.043 -28.956 24.637 1.00 18.86 N -ATOM 2068 CA ILE A 281 -14.332 -29.423 25.969 1.00 27.28 C -ATOM 2069 C ILE A 281 -12.965 -29.757 26.547 1.00 24.01 C -ATOM 2070 O ILE A 281 -12.083 -30.231 25.818 1.00 25.84 O -ATOM 2071 CB ILE A 281 -15.335 -30.615 25.721 1.00 34.33 C -ATOM 2072 CG1 ILE A 281 -16.473 -30.269 26.569 1.00 32.29 C -ATOM 2073 CG2 ILE A 281 -14.878 -32.035 26.009 1.00 32.21 C -ATOM 2074 CD1 ILE A 281 -17.453 -29.412 25.782 1.00 41.67 C -ATOM 2075 N ALA A 282 -12.689 -29.490 27.833 1.00 25.05 N -ATOM 2076 CA ALA A 282 -11.411 -29.873 28.421 1.00 21.98 C -ATOM 2077 C ALA A 282 -11.621 -30.175 29.916 1.00 30.82 C -ATOM 2078 O ALA A 282 -12.518 -29.625 30.583 1.00 25.28 O -ATOM 2079 CB ALA A 282 -10.373 -28.757 28.319 1.00 19.90 C -ATOM 2080 N ASP A 283 -10.792 -31.067 30.451 1.00 29.24 N -ATOM 2081 CA ASP A 283 -10.865 -31.448 31.852 1.00 27.15 C -ATOM 2082 C ASP A 283 -9.629 -32.154 32.344 1.00 28.94 C -ATOM 2083 O ASP A 283 -8.650 -32.367 31.612 1.00 25.65 O -ATOM 2084 CB ASP A 283 -12.056 -32.351 32.044 1.00 25.99 C -ATOM 2085 CG ASP A 283 -12.651 -32.316 33.442 1.00 44.57 C -ATOM 2086 OD1 ASP A 283 -12.188 -31.605 34.358 1.00 33.69 O -ATOM 2087 OD2 ASP A 283 -13.632 -33.032 33.566 1.00 35.12 O -ATOM 2088 N ASN A 284 -9.624 -32.469 33.630 1.00 25.13 N -ATOM 2089 CA ASN A 284 -8.575 -33.323 34.132 1.00 24.84 C -ATOM 2090 C ASN A 284 -9.281 -34.178 35.168 1.00 32.53 C -ATOM 2091 O ASN A 284 -10.446 -33.966 35.501 1.00 27.71 O -ATOM 2092 CB ASN A 284 -7.428 -32.531 34.784 1.00 22.73 C -ATOM 2093 CG ASN A 284 -7.841 -31.655 35.937 1.00 35.10 C -ATOM 2094 OD1 ASN A 284 -8.594 -32.043 36.830 1.00 32.48 O -ATOM 2095 ND2 ASN A 284 -7.398 -30.419 35.956 1.00 26.62 N -ATOM 2096 N ASP A 285 -8.571 -35.160 35.662 1.00 26.45 N -ATOM 2097 CA ASP A 285 -9.119 -36.062 36.668 1.00 41.39 C -ATOM 2098 C ASP A 285 -8.918 -35.651 38.136 1.00 38.31 C -ATOM 2099 O ASP A 285 -9.037 -36.477 39.045 1.00 41.71 O -ATOM 2100 CB ASP A 285 -8.515 -37.458 36.442 1.00 22.77 C -ATOM 2101 CG ASP A 285 -7.018 -37.619 36.682 1.00 23.18 C -ATOM 2102 OD1 ASP A 285 -6.299 -36.642 36.961 1.00 33.04 O -ATOM 2103 OD2 ASP A 285 -6.564 -38.760 36.574 1.00 41.33 O -ATOM 2104 N LEU A 286 -8.522 -34.433 38.464 1.00 31.53 N -ATOM 2105 CA LEU A 286 -8.375 -34.096 39.864 1.00 25.13 C -ATOM 2106 C LEU A 286 -9.781 -34.072 40.470 1.00 41.07 C -ATOM 2107 O LEU A 286 -10.786 -33.987 39.738 1.00 43.63 O -ATOM 2108 CB LEU A 286 -7.705 -32.751 39.998 1.00 27.21 C -ATOM 2109 CG LEU A 286 -6.270 -32.835 39.611 1.00 27.72 C -ATOM 2110 CD1 LEU A 286 -5.760 -31.443 39.694 1.00 35.20 C -ATOM 2111 CD2 LEU A 286 -5.476 -33.794 40.484 1.00 33.80 C -ATOM 2112 N PRO A 287 -9.877 -34.225 41.816 1.00 72.08 N -ATOM 2113 CA PRO A 287 -11.137 -34.283 42.564 1.00 57.25 C -ATOM 2114 C PRO A 287 -12.204 -33.202 42.339 1.00 55.50 C -ATOM 2115 O PRO A 287 -13.372 -33.508 42.071 1.00 64.32 O -ATOM 2116 CB PRO A 287 -10.653 -34.366 44.012 1.00 64.34 C -ATOM 2117 CG PRO A 287 -9.230 -33.836 43.996 1.00 69.23 C -ATOM 2118 CD PRO A 287 -8.755 -34.511 42.729 1.00 60.19 C -ATOM 2119 N ASN A 288 -11.828 -31.922 42.497 1.00 54.09 N -ATOM 2120 CA ASN A 288 -12.770 -30.799 42.318 1.00 73.15 C -ATOM 2121 C ASN A 288 -13.272 -30.582 40.876 1.00 74.10 C -ATOM 2122 O ASN A 288 -14.484 -30.447 40.665 1.00 75.41 O -ATOM 2123 CB ASN A 288 -12.090 -29.477 42.876 1.00 81.36 C -ATOM 2124 CG ASN A 288 -12.242 -28.127 42.121 1.00 97.42 C -ATOM 2125 OD1 ASN A 288 -13.325 -27.546 41.955 1.00 97.46 O -ATOM 2126 ND2 ASN A 288 -11.144 -27.539 41.643 1.00101.92 N -ATOM 2127 N SER A 289 -12.316 -30.570 39.928 1.00 69.19 N -ATOM 2128 CA SER A 289 -12.486 -30.226 38.533 1.00 50.17 C -ATOM 2129 C SER A 289 -13.769 -30.567 37.808 1.00 43.85 C -ATOM 2130 O SER A 289 -14.129 -31.734 37.591 1.00 46.69 O -ATOM 2131 CB SER A 289 -11.310 -30.821 37.778 1.00 52.12 C -ATOM 2132 OG SER A 289 -10.127 -30.246 38.340 1.00 71.82 O -ATOM 2133 N ASP A 290 -14.474 -29.478 37.467 1.00 38.06 N -ATOM 2134 CA ASP A 290 -15.638 -29.592 36.585 1.00 44.01 C -ATOM 2135 C ASP A 290 -15.048 -29.256 35.203 1.00 33.18 C -ATOM 2136 O ASP A 290 -14.076 -28.504 35.098 1.00 32.33 O -ATOM 2137 CB ASP A 290 -16.736 -28.563 36.815 1.00 56.50 C -ATOM 2138 CG ASP A 290 -16.866 -28.005 38.221 1.00 77.24 C -ATOM 2139 OD1 ASP A 290 -16.176 -27.018 38.549 1.00 84.59 O -ATOM 2140 OD2 ASP A 290 -17.688 -28.568 38.949 1.00 73.57 O -ATOM 2141 N MET A 291 -15.650 -29.801 34.153 1.00 36.97 N -ATOM 2142 CA MET A 291 -15.240 -29.609 32.773 1.00 34.70 C -ATOM 2143 C MET A 291 -15.491 -28.176 32.316 1.00 26.12 C -ATOM 2144 O MET A 291 -16.588 -27.636 32.596 1.00 28.32 O -ATOM 2145 CB MET A 291 -16.046 -30.548 31.941 1.00 33.14 C -ATOM 2146 CG MET A 291 -15.721 -30.633 30.469 1.00 52.66 C -ATOM 2147 SD MET A 291 -17.054 -31.586 29.705 1.00 48.22 S -ATOM 2148 CE MET A 291 -18.376 -30.408 29.816 1.00 41.88 C -ATOM 2149 N VAL A 292 -14.461 -27.601 31.653 1.00 30.89 N -ATOM 2150 CA VAL A 292 -14.602 -26.296 30.995 1.00 28.79 C -ATOM 2151 C VAL A 292 -15.001 -26.548 29.519 1.00 27.78 C -ATOM 2152 O VAL A 292 -14.798 -27.642 28.964 1.00 23.47 O -ATOM 2153 CB VAL A 292 -13.278 -25.451 31.060 1.00 21.26 C -ATOM 2154 CG1 VAL A 292 -13.068 -25.121 32.513 1.00 24.54 C -ATOM 2155 CG2 VAL A 292 -12.062 -26.151 30.493 1.00 17.97 C -ATOM 2156 N ALA A 293 -15.630 -25.598 28.853 1.00 24.90 N -ATOM 2157 CA ALA A 293 -16.075 -25.765 27.478 1.00 28.34 C -ATOM 2158 C ALA A 293 -16.194 -24.388 26.843 1.00 31.62 C -ATOM 2159 O ALA A 293 -16.271 -23.380 27.571 1.00 21.58 O -ATOM 2160 CB ALA A 293 -17.455 -26.411 27.425 1.00 21.46 C -ATOM 2161 N ASP A 294 -16.208 -24.253 25.507 1.00 20.79 N -ATOM 2162 CA ASP A 294 -16.521 -22.962 24.906 1.00 18.22 C -ATOM 2163 C ASP A 294 -17.085 -23.151 23.509 1.00 23.81 C -ATOM 2164 O ASP A 294 -16.994 -24.277 22.981 1.00 21.81 O -ATOM 2165 CB ASP A 294 -15.275 -22.092 24.862 1.00 16.80 C -ATOM 2166 CG ASP A 294 -14.135 -22.482 23.933 1.00 28.79 C -ATOM 2167 OD1 ASP A 294 -14.298 -23.157 22.922 1.00 23.51 O -ATOM 2168 OD2 ASP A 294 -13.027 -22.066 24.222 1.00 20.09 O -ATOM 2169 N LEU A 295 -17.630 -22.092 22.934 1.00 22.29 N -ATOM 2170 CA LEU A 295 -18.156 -22.143 21.590 1.00 23.66 C -ATOM 2171 C LEU A 295 -18.129 -20.735 21.068 1.00 20.00 C -ATOM 2172 O LEU A 295 -18.736 -19.833 21.657 1.00 18.17 O -ATOM 2173 CB LEU A 295 -19.584 -22.665 21.597 1.00 22.86 C -ATOM 2174 CG LEU A 295 -20.239 -22.727 20.174 1.00 36.71 C -ATOM 2175 CD1 LEU A 295 -19.494 -23.716 19.279 1.00 28.60 C -ATOM 2176 CD2 LEU A 295 -21.662 -23.194 20.270 1.00 32.46 C -ATOM 2177 N GLY A 296 -17.427 -20.481 19.963 1.00 17.67 N -ATOM 2178 CA GLY A 296 -17.406 -19.135 19.432 1.00 17.33 C -ATOM 2179 C GLY A 296 -16.815 -19.125 18.034 1.00 21.99 C -ATOM 2180 O GLY A 296 -16.764 -20.163 17.371 1.00 20.73 O -ATOM 2181 N VAL A 297 -16.360 -17.965 17.591 1.00 23.91 N -ATOM 2182 CA VAL A 297 -15.762 -17.790 16.259 1.00 24.04 C -ATOM 2183 C VAL A 297 -14.373 -17.194 16.384 1.00 27.04 C -ATOM 2184 O VAL A 297 -14.139 -16.389 17.291 1.00 20.84 O -ATOM 2185 CB VAL A 297 -16.662 -16.873 15.351 1.00 20.97 C -ATOM 2186 CG1 VAL A 297 -17.934 -17.628 15.031 1.00 27.35 C -ATOM 2187 CG2 VAL A 297 -17.101 -15.596 16.010 1.00 23.73 C -ATOM 2188 N LYS A 298 -13.401 -17.578 15.569 1.00 18.69 N -ATOM 2189 CA LYS A 298 -12.053 -17.027 15.608 1.00 16.67 C -ATOM 2190 C LYS A 298 -11.825 -16.348 14.264 1.00 23.47 C -ATOM 2191 O LYS A 298 -12.314 -16.874 13.261 1.00 24.58 O -ATOM 2192 CB LYS A 298 -11.017 -18.111 15.770 1.00 19.12 C -ATOM 2193 CG LYS A 298 -10.986 -18.627 17.195 1.00 21.33 C -ATOM 2194 CD LYS A 298 -10.117 -19.822 17.223 1.00 18.34 C -ATOM 2195 CE LYS A 298 -8.728 -19.349 17.070 1.00 21.34 C -ATOM 2196 NZ LYS A 298 -7.845 -20.499 17.110 1.00 30.35 N -ATOM 2197 N PHE A 299 -11.150 -15.210 14.187 1.00 18.24 N -ATOM 2198 CA PHE A 299 -10.953 -14.448 12.960 1.00 17.66 C -ATOM 2199 C PHE A 299 -9.485 -14.163 12.794 1.00 26.51 C -ATOM 2200 O PHE A 299 -8.769 -13.944 13.784 1.00 22.18 O -ATOM 2201 CB PHE A 299 -11.681 -13.135 13.055 1.00 14.69 C -ATOM 2202 CG PHE A 299 -13.179 -13.199 13.267 1.00 21.01 C -ATOM 2203 CD1 PHE A 299 -13.978 -14.058 12.533 1.00 22.78 C -ATOM 2204 CD2 PHE A 299 -13.765 -12.359 14.185 1.00 20.84 C -ATOM 2205 CE1 PHE A 299 -15.346 -14.077 12.712 1.00 23.54 C -ATOM 2206 CE2 PHE A 299 -15.137 -12.388 14.348 1.00 22.22 C -ATOM 2207 CZ PHE A 299 -15.934 -13.240 13.619 1.00 21.26 C -ATOM 2208 N LYS A 300 -8.952 -14.173 11.593 1.00 17.76 N -ATOM 2209 CA LYS A 300 -7.572 -13.787 11.346 1.00 17.46 C -ATOM 2210 C LYS A 300 -7.649 -12.631 10.356 1.00 24.16 C -ATOM 2211 O LYS A 300 -8.564 -12.607 9.499 1.00 26.46 O -ATOM 2212 CB LYS A 300 -6.813 -14.912 10.727 1.00 22.55 C -ATOM 2213 CG LYS A 300 -6.657 -16.072 11.650 1.00 34.41 C -ATOM 2214 CD LYS A 300 -5.385 -16.857 11.324 1.00 54.10 C -ATOM 2215 CE LYS A 300 -5.453 -17.720 10.063 1.00 75.73 C -ATOM 2216 NZ LYS A 300 -4.221 -18.486 9.901 1.00 84.85 N -ATOM 2217 N PHE A 301 -6.747 -11.655 10.457 1.00 19.50 N -ATOM 2218 CA PHE A 301 -6.819 -10.437 9.678 1.00 18.21 C -ATOM 2219 C PHE A 301 -5.466 -10.102 9.104 1.00 22.86 C -ATOM 2220 O PHE A 301 -4.454 -10.631 9.571 1.00 17.64 O -ATOM 2221 CB PHE A 301 -7.251 -9.193 10.471 1.00 18.80 C -ATOM 2222 CG PHE A 301 -8.614 -9.367 11.100 1.00 24.96 C -ATOM 2223 CD1 PHE A 301 -9.760 -9.256 10.344 1.00 18.68 C -ATOM 2224 CD2 PHE A 301 -8.718 -9.610 12.461 1.00 23.97 C -ATOM 2225 CE1 PHE A 301 -11.019 -9.379 10.920 1.00 19.16 C -ATOM 2226 CE2 PHE A 301 -9.983 -9.730 13.030 1.00 19.39 C -ATOM 2227 CZ PHE A 301 -11.135 -9.616 12.275 1.00 20.43 C -ATOM 2228 OXT PHE A 301 -5.445 -9.316 8.144 1.00 28.38 O -TER 2229 PHE A 301 -HETATM 2230 CA CA A 302 5.011 -23.190 25.968 1.00 21.26 CA -HETATM 2231 CA CA A 303 -2.860 -23.590 25.053 1.00 18.82 CA -HETATM 2232 CA CA A 304 19.713 -10.305 32.535 1.00 19.02 CA -HETATM 2233 C1 C8E A 545 8.213 -29.709 34.111 0.88 42.96 C -HETATM 2234 C2 C8E A 545 7.552 -28.411 34.504 0.88 41.67 C -HETATM 2235 C3 C8E A 545 6.087 -28.660 34.394 0.88 42.57 C -HETATM 2236 C4 C8E A 545 5.485 -27.321 34.709 0.88 43.55 C -HETATM 2237 C5 C8E A 545 4.152 -27.105 34.003 0.88 44.03 C -HETATM 2238 C6 C8E A 545 3.097 -28.172 34.277 0.88 42.16 C -HETATM 2239 C7 C8E A 545 1.680 -27.738 33.857 0.88 39.75 C -HETATM 2240 C8 C8E A 545 0.806 -28.916 34.194 0.88 37.75 C -HETATM 2241 O9 C8E A 545 -0.600 -28.806 34.267 0.88 38.94 O -HETATM 2242 C10 C8E A 545 -1.108 -29.343 35.484 0.88 40.72 C -HETATM 2243 C11 C8E A 545 -2.584 -29.539 35.411 0.88 45.43 C -HETATM 2244 O12 C8E A 545 -3.364 -29.456 36.593 0.88 54.18 O -HETATM 2245 C13 C8E A 545 -3.888 -28.142 36.821 0.88 63.79 C -HETATM 2246 C14 C8E A 545 -3.546 -27.475 38.160 0.88 72.45 C -HETATM 2247 O15 C8E A 545 -3.840 -28.181 39.385 0.88 79.05 O -HETATM 2248 C16 C8E A 545 -4.714 -27.481 40.299 0.88 84.79 C -HETATM 2249 C17 C8E A 545 -6.141 -28.045 40.520 0.88 88.54 C -HETATM 2250 O18 C8E A 545 -6.994 -27.791 41.671 0.88 91.31 O -HETATM 2251 C19 C8E A 545 -6.710 -28.672 42.798 0.88 93.11 C -HETATM 2252 C20 C8E A 545 -7.835 -29.597 43.315 0.88 93.71 C -HETATM 2253 O21 C8E A 545 -8.715 -29.939 42.235 0.88 93.34 O -HETATM 2254 C1 C8E A 546 -16.910 -30.948 20.987 0.83 50.61 C -HETATM 2255 C2 C8E A 546 -17.003 -29.492 20.487 0.83 51.77 C -HETATM 2256 C3 C8E A 546 -18.226 -28.681 20.944 0.83 50.98 C -HETATM 2257 C4 C8E A 546 -18.230 -28.157 22.386 0.83 51.13 C -HETATM 2258 C5 C8E A 546 -19.478 -27.295 22.528 0.83 52.63 C -HETATM 2259 C6 C8E A 546 -19.775 -26.873 23.954 0.83 55.60 C -HETATM 2260 C7 C8E A 546 -21.264 -26.522 24.126 0.83 60.07 C -HETATM 2261 C8 C8E A 546 -21.652 -25.072 23.799 0.83 64.27 C -HETATM 2262 O9 C8E A 546 -23.025 -24.744 23.463 0.83 66.21 O -HETATM 2263 C10 C8E A 546 -23.879 -24.185 24.492 0.83 66.45 C -HETATM 2264 C11 C8E A 546 -24.241 -22.690 24.589 0.83 65.91 C -HETATM 2265 O12 C8E A 546 -25.371 -22.371 25.423 0.83 65.26 O -HETATM 2266 C13 C8E A 546 -25.072 -21.784 26.706 0.83 65.04 C -HETATM 2267 C14 C8E A 546 -25.775 -20.508 27.231 0.83 64.60 C -HETATM 2268 O15 C8E A 546 -25.456 -19.172 26.782 0.83 63.35 O -HETATM 2269 C16 C8E A 546 -25.077 -18.304 27.864 0.83 61.87 C -HETATM 2270 C17 C8E A 546 -25.057 -16.798 27.655 0.83 60.37 C -HETATM 2271 O18 C8E A 546 -24.686 -15.946 28.736 0.83 60.64 O -HETATM 2272 C19 C8E A 546 -25.722 -14.991 28.972 0.83 62.75 C -HETATM 2273 C20 C8E A 546 -26.625 -15.182 30.187 0.83 65.74 C -HETATM 2274 O21 C8E A 546 -27.717 -14.265 30.253 0.83 68.59 O -HETATM 2275 C1 C8E A 547 -27.555 -14.778 24.966 0.69 53.41 C -HETATM 2276 C2 C8E A 547 -26.516 -15.667 24.244 0.69 52.85 C -HETATM 2277 C3 C8E A 547 -25.613 -14.788 23.406 0.69 51.32 C -HETATM 2278 C4 C8E A 547 -24.590 -15.611 22.646 0.69 50.00 C -HETATM 2279 C5 C8E A 547 -23.742 -14.660 21.812 0.69 48.73 C -HETATM 2280 C6 C8E A 547 -22.770 -15.402 20.910 0.69 49.05 C -HETATM 2281 C7 C8E A 547 -21.887 -14.406 20.188 0.69 50.17 C -HETATM 2282 C8 C8E A 547 -20.855 -15.059 19.282 0.69 51.75 C -HETATM 2283 O9 C8E A 547 -21.254 -15.638 18.040 0.69 53.80 O -HETATM 2284 C10 C8E A 547 -20.727 -16.961 17.815 0.69 55.39 C -HETATM 2285 C11 C8E A 547 -21.412 -18.239 18.340 0.69 57.31 C -HETATM 2286 O12 C8E A 547 -20.997 -19.520 17.825 0.69 59.43 O -HETATM 2287 C13 C8E A 547 -21.900 -20.072 16.839 0.69 62.71 C -HETATM 2288 C14 C8E A 547 -21.762 -19.847 15.315 0.69 66.12 C -HETATM 2289 O15 C8E A 547 -21.863 -18.520 14.749 0.69 68.53 O -HETATM 2290 C16 C8E A 547 -21.503 -18.438 13.354 0.69 69.38 C -HETATM 2291 C17 C8E A 547 -22.432 -17.855 12.267 0.69 69.19 C -HETATM 2292 O18 C8E A 547 -23.574 -18.559 11.772 0.69 69.55 O -HETATM 2293 C19 C8E A 547 -23.224 -19.417 10.680 0.69 71.17 C -HETATM 2294 C20 C8E A 547 -23.699 -19.093 9.256 0.69 73.02 C -HETATM 2295 O21 C8E A 547 -23.190 -19.997 8.271 0.69 74.35 O -HETATM 2296 C1 C8E A 548 8.635 -40.960 22.015 0.66 38.33 C -HETATM 2297 C2 C8E A 548 7.129 -40.823 22.217 0.66 39.82 C -HETATM 2298 C3 C8E A 548 6.553 -41.828 23.201 0.66 42.86 C -HETATM 2299 C4 C8E A 548 5.132 -41.410 23.650 0.66 46.04 C -HETATM 2300 C5 C8E A 548 4.404 -42.484 24.470 0.66 48.47 C -HETATM 2301 C6 C8E A 548 3.158 -42.049 25.250 0.66 49.60 C -HETATM 2302 C7 C8E A 548 1.937 -41.675 24.427 0.66 50.98 C -HETATM 2303 C8 C8E A 548 0.665 -42.117 25.157 0.66 53.35 C -HETATM 2304 O9 C8E A 548 0.300 -41.619 26.461 0.66 56.73 O -HETATM 2305 C10 C8E A 548 -1.055 -41.115 26.530 0.66 60.75 C -HETATM 2306 C11 C8E A 548 -1.893 -41.075 27.835 0.66 64.78 C -HETATM 2307 O12 C8E A 548 -2.307 -42.251 28.554 0.66 68.03 O -HETATM 2308 C13 C8E A 548 -3.602 -42.750 28.183 0.66 70.92 C -HETATM 2309 C14 C8E A 548 -4.589 -43.152 29.296 0.66 73.54 C -HETATM 2310 O15 C8E A 548 -5.324 -42.194 30.083 0.66 75.50 O -HETATM 2311 C16 C8E A 548 -6.755 -42.418 30.010 0.66 77.12 C -HETATM 2312 C17 C8E A 548 -7.846 -41.611 30.782 0.66 78.17 C -HETATM 2313 O18 C8E A 548 -8.228 -40.241 30.482 0.66 78.30 O -HETATM 2314 C19 C8E A 548 -9.532 -40.067 29.908 0.66 78.18 C -HETATM 2315 C20 C8E A 548 -9.622 -39.737 28.426 0.66 78.11 C -HETATM 2316 O21 C8E A 548 -10.967 -39.509 28.017 0.66 79.53 O -HETATM 2317 O HOH A 305 6.190 -23.830 27.989 1.00 20.83 O -HETATM 2318 O HOH A 306 -2.513 -6.904 20.688 1.00 16.79 O -HETATM 2319 O HOH A 307 3.039 -23.016 24.751 1.00 20.86 O -HETATM 2320 O HOH A 308 17.950 -13.715 34.357 1.00 19.18 O -HETATM 2321 O HOH A 309 -4.859 -6.074 21.898 1.00 17.25 O -HETATM 2322 O HOH A 310 6.039 -11.790 23.498 1.00 19.05 O -HETATM 2323 O HOH A 311 18.294 -13.615 30.404 1.00 18.03 O -HETATM 2324 O HOH A 312 4.466 -25.396 25.736 1.00 18.77 O -HETATM 2325 O HOH A 313 -6.309 -26.069 24.210 1.00 19.97 O -HETATM 2326 O HOH A 314 19.069 -8.882 30.781 1.00 16.16 O -HETATM 2327 O HOH A 315 18.817 -16.108 33.989 1.00 22.41 O -HETATM 2328 O HOH A 316 10.011 -23.278 25.760 1.00 19.18 O -HETATM 2329 O HOH A 317 18.991 -18.503 7.840 1.00 26.78 O -HETATM 2330 O HOH A 318 -7.473 -27.703 26.057 1.00 23.41 O -HETATM 2331 O HOH A 319 -13.465 -11.566 27.451 1.00 17.66 O -HETATM 2332 O HOH A 320 11.714 -25.598 25.532 1.00 19.10 O -HETATM 2333 O HOH A 321 13.702 -8.194 22.282 1.00 17.80 O -HETATM 2334 O HOH A 322 -2.605 -12.728 24.049 1.00 21.07 O -HETATM 2335 O HOH A 323 -7.669 -27.382 30.103 1.00 21.64 O -HETATM 2336 O HOH A 324 8.492 -23.381 29.404 1.00 23.75 O -HETATM 2337 O HOH A 325 -11.446 -14.377 24.890 1.00 23.49 O -HETATM 2338 O HOH A 326 -7.805 -13.385 19.252 1.00 21.15 O -HETATM 2339 O HOH A 327 -1.282 -22.004 25.223 1.00 26.61 O -HETATM 2340 O HOH A 328 10.411 -16.311 26.801 1.00 17.22 O -HETATM 2341 O HOH A 329 16.385 -22.562 27.462 1.00 18.42 O -HETATM 2342 O HOH A 330 15.053 -19.043 24.819 1.00 21.28 O -HETATM 2343 O HOH A 331 -2.033 -23.630 22.810 1.00 20.17 O -HETATM 2344 O HOH A 332 16.071 -18.702 16.398 1.00 23.35 O -HETATM 2345 O HOH A 333 11.348 -6.919 22.129 1.00 20.95 O -HETATM 2346 O HOH A 334 10.900 -18.006 19.817 1.00 19.73 O -HETATM 2347 O HOH A 335 2.111 -8.782 11.097 1.00 21.76 O -HETATM 2348 O HOH A 336 15.747 -19.876 27.405 1.00 21.38 O -HETATM 2349 O HOH A 337 8.435 0.102 28.114 1.00 20.97 O -HETATM 2350 O HOH A 338 14.119 -13.294 35.691 1.00 24.59 O -HETATM 2351 O HOH A 339 3.274 -23.071 27.583 1.00 22.54 O -HETATM 2352 O HOH A 340 3.727 -5.504 27.684 1.00 30.10 O -HETATM 2353 O HOH A 341 20.299 -15.296 4.898 1.00 27.64 O -HETATM 2354 O HOH A 342 -7.206 -29.986 29.888 1.00 24.28 O -HETATM 2355 O HOH A 343 -7.959 -18.152 20.294 1.00 28.57 O -HETATM 2356 O HOH A 344 8.762 -4.598 30.296 1.00 31.66 O -HETATM 2357 O HOH A 345 -7.654 -16.035 18.504 1.00 27.53 O -HETATM 2358 O HOH A 346 5.672 -25.355 30.536 1.00 33.44 O -HETATM 2359 O HOH A 347 7.619 -6.968 7.308 1.00 28.72 O -HETATM 2360 O HOH A 348 12.106 -27.183 47.407 1.00 24.32 O -HETATM 2361 O HOH A 349 0.478 -23.170 21.728 1.00 32.87 O -HETATM 2362 O HOH A 350 18.157 -15.935 6.506 1.00 25.47 O -HETATM 2363 O HOH A 351 12.279 -17.795 29.840 1.00 20.42 O -HETATM 2364 O HOH A 352 14.939 -10.637 35.420 1.00 23.31 O -HETATM 2365 O HOH A 353 -17.331 -18.796 32.329 1.00 28.26 O -HETATM 2366 O HOH A 354 -10.692 -19.212 6.721 1.00 31.00 O -HETATM 2367 O HOH A 355 -10.459 -12.836 28.783 1.00 28.25 O -HETATM 2368 O HOH A 356 -11.477 -26.875 19.463 1.00 29.65 O -HETATM 2369 O HOH A 357 16.141 -3.886 4.277 1.00 31.85 O -HETATM 2370 O HOH A 358 4.524 -23.752 21.031 1.00 29.74 O -HETATM 2371 O HOH A 359 -10.030 -18.674 11.768 1.00 26.75 O -HETATM 2372 O HOH A 360 -24.381 -19.610 33.507 1.00 42.24 O -HETATM 2373 O HOH A 361 0.000 0.000 29.011 1.00 48.27 O -HETATM 2374 O HOH A 362 4.589 -24.630 46.774 1.00 32.73 O -HETATM 2375 O HOH A 363 6.578 -32.633 49.463 1.00 37.66 O -HETATM 2376 O HOH A 364 25.694 -6.688 4.569 1.00 40.03 O -HETATM 2377 O HOH A 365 1.755 -2.930 26.627 1.00 29.16 O -HETATM 2378 O HOH A 366 -5.526 -19.104 20.325 1.00 43.77 O -HETATM 2379 O HOH A 367 -7.843 -16.280 15.397 1.00 34.97 O -HETATM 2380 O HOH A 368 19.857 -29.108 43.670 1.00 37.84 O -HETATM 2381 O HOH A 369 -11.211 -17.107 28.043 1.00 35.39 O -HETATM 2382 O HOH A 370 14.990 0.034 26.464 1.00 36.44 O -HETATM 2383 O HOH A 371 -8.092 -22.145 19.499 1.00 36.57 O -HETATM 2384 O HOH A 372 10.405 -22.698 48.281 1.00 43.83 O -HETATM 2385 O HOH A 373 11.850 -23.603 46.017 1.00 33.68 O -HETATM 2386 O HOH A 374 4.425 -11.538 20.182 1.00 35.76 O -HETATM 2387 O HOH A 375 7.444 -13.328 21.435 1.00 32.10 O -HETATM 2388 O HOH A 376 -2.266 -33.722 16.734 1.00 27.51 O -HETATM 2389 O HOH A 377 6.830 -21.304 30.790 1.00 40.21 O -HETATM 2390 O HOH A 378 -2.927 -15.540 24.275 1.00 47.68 O -HETATM 2391 O HOH A 379 -10.545 -20.059 28.206 1.00 34.03 O -HETATM 2392 O HOH A 380 -1.346 -12.314 13.279 1.00 43.15 O -HETATM 2393 O HOH A 381 13.767 -31.917 11.168 1.00 41.20 O -HETATM 2394 O HOH A 382 17.255 -3.976 35.357 1.00 36.40 O -HETATM 2395 O HOH A 383 0.396 -4.333 6.326 1.00 39.85 O -HETATM 2396 O HOH A 384 -12.123 -22.655 35.807 1.00 48.67 O -HETATM 2397 O HOH A 385 23.092 -24.324 40.946 1.00 47.58 O -HETATM 2398 O HOH A 386 25.532 -15.924 6.357 1.00 40.32 O -HETATM 2399 O HOH A 387 13.903 -23.443 52.205 1.00 38.71 O -HETATM 2400 O HOH A 388 0.585 -6.342 28.179 1.00 38.73 O -HETATM 2401 O HOH A 389 -6.137 -17.395 25.246 1.00 39.55 O -HETATM 2402 O HOH A 390 -11.281 -26.866 9.706 1.00 44.19 O -HETATM 2403 O HOH A 391 15.765 -28.449 56.448 1.00 44.93 O -HETATM 2404 O HOH A 392 9.171 -8.256 34.890 1.00 41.01 O -HETATM 2405 O HOH A 393 -6.013 -32.205 10.535 1.00 37.42 O -HETATM 2406 O HOH A 394 18.746 -31.079 42.115 1.00 49.33 O -HETATM 2407 O HOH A 395 6.332 -11.876 18.420 1.00 53.49 O -HETATM 2408 O HOH A 396 8.026 -2.478 31.687 1.00 46.06 O -HETATM 2409 O HOH A 397 -0.055 -34.380 47.695 1.00 50.52 O -HETATM 2410 O HOH A 398 21.271 -25.134 5.337 1.00 44.63 O -HETATM 2411 O HOH A 399 -9.488 -22.353 13.924 1.00 46.80 O -HETATM 2412 O HOH A 400 15.734 -19.165 9.159 1.00 56.53 O -HETATM 2413 O HOH A 401 2.338 -26.278 18.066 1.00 41.82 O -HETATM 2414 O HOH A 402 10.433 -23.644 51.740 1.00 40.08 O -HETATM 2415 O HOH A 403 12.597 -21.278 37.850 1.00 51.56 O -HETATM 2416 O HOH A 404 -25.186 -24.967 30.656 1.00 54.32 O -HETATM 2417 O HOH A 405 18.299 -6.839 40.824 1.00 44.63 O -HETATM 2418 O HOH A 406 4.650 -23.154 18.361 1.00 75.55 O -HETATM 2419 O HOH A 407 -0.008 -4.901 30.754 1.00 49.18 O -HETATM 2420 O HOH A 408 1.872 -33.925 49.640 1.00 57.48 O -HETATM 2421 O HOH A 409 7.040 -24.438 17.754 1.00 42.07 O -HETATM 2422 O HOH A 410 -3.254 -13.637 11.943 1.00 48.26 O -HETATM 2423 O HOH A 411 18.028 -20.224 9.740 1.00 48.76 O -HETATM 2424 O HOH A 412 25.458 -8.685 6.151 1.00 61.69 O -HETATM 2425 O HOH A 413 12.316 1.336 29.307 1.00 45.17 O -HETATM 2426 O HOH A 414 -12.699 -18.312 34.507 1.00 42.63 O -HETATM 2427 O HOH A 415 16.663 -21.820 11.396 1.00 53.03 O -HETATM 2428 O HOH A 416 7.348 -12.211 28.736 1.00 39.48 O -HETATM 2429 O HOH A 417 10.478 -12.015 14.973 1.00 46.65 O -HETATM 2430 O HOH A 418 -5.879 -30.859 46.808 1.00 48.30 O -HETATM 2431 O HOH A 419 13.821 -10.350 6.801 1.00 53.86 O -HETATM 2432 O HOH A 420 10.873 -19.767 38.963 1.00 68.06 O -HETATM 2433 O HOH A 421 -3.553 -27.075 16.792 1.00 49.89 O -HETATM 2434 O HOH A 422 -4.659 -28.801 12.842 1.00 61.39 O -HETATM 2435 O HOH A 423 4.059 -19.738 23.834 1.00 57.43 O -HETATM 2436 O HOH A 424 0.410 -28.151 30.141 1.00 41.42 O -HETATM 2437 O HOH A 425 7.366 -39.760 38.638 1.00 50.68 O -HETATM 2438 O HOH A 426 1.421 -2.870 29.704 1.00 45.66 O -HETATM 2439 O HOH A 427 -7.977 -18.799 13.558 1.00 51.14 O -HETATM 2440 O HOH A 428 -9.936 -18.793 30.658 1.00 40.22 O -HETATM 2441 O HOH A 429 -0.583 -26.657 18.732 1.00 42.31 O -HETATM 2442 O HOH A 430 9.412 -14.531 34.411 1.00 46.27 O -HETATM 2443 O HOH A 431 -11.155 -17.058 32.393 1.00 49.31 O -HETATM 2444 O HOH A 432 4.672 -9.906 30.002 1.00 51.14 O -HETATM 2445 O HOH A 433 9.764 -22.104 43.517 1.00 61.72 O -HETATM 2446 O HOH A 434 3.091 -25.536 29.792 1.00 54.50 O -HETATM 2447 O HOH A 435 -3.234 -19.131 23.927 1.00 48.27 O -HETATM 2448 O HOH A 436 7.747 -11.972 31.658 1.00 44.09 O -HETATM 2449 O HOH A 437 -21.260 -27.979 29.311 1.00 52.83 O -HETATM 2450 O HOH A 438 -3.320 -15.277 14.229 1.00 60.95 O -HETATM 2451 O HOH A 439 -3.236 -23.883 48.320 1.00 57.64 O -HETATM 2452 O HOH A 440 6.985 -0.498 5.672 1.00 55.03 O -HETATM 2453 O HOH A 441 13.244 -18.776 16.145 1.00 47.33 O -HETATM 2454 O HOH A 442 12.435 -24.416 49.444 1.00 42.38 O -HETATM 2455 O HOH A 443 11.545 -34.010 48.466 1.00 47.66 O -HETATM 2456 O HOH A 444 7.079 -16.967 24.430 1.00 44.53 O -HETATM 2457 O HOH A 445 -13.286 -27.152 39.025 1.00 62.40 O -HETATM 2458 O HOH A 446 5.906 -18.733 19.699 1.00 74.18 O -HETATM 2459 O HOH A 447 23.374 -11.624 43.898 1.00 50.06 O -HETATM 2460 O HOH A 448 8.721 0.013 30.916 1.00 39.51 O -HETATM 2461 O HOH A 449 -3.066 -8.233 6.997 1.00 53.63 O -HETATM 2462 O HOH A 450 -7.364 -20.734 29.488 1.00 37.68 O -HETATM 2463 O HOH A 451 5.654 -12.347 12.613 1.00 53.20 O -HETATM 2464 O HOH A 452 -8.412 -26.868 14.398 1.00 47.15 O -HETATM 2465 O HOH A 453 4.183 -22.036 46.452 1.00 58.11 O -HETATM 2466 O HOH A 454 -16.832 -30.212 5.669 1.00 66.31 O -HETATM 2467 O HOH A 455 18.868 -33.707 4.064 1.00 70.96 O -HETATM 2468 O HOH A 456 -3.664 -39.512 36.539 1.00 51.90 O -HETATM 2469 O HOH A 457 27.016 -12.573 5.049 1.00 76.94 O -HETATM 2470 O HOH A 458 -25.119 -23.325 33.171 1.00 75.09 O -HETATM 2471 O HOH A 459 -1.458 -7.896 28.585 1.00 56.50 O -HETATM 2472 O HOH A 460 11.504 -38.042 43.991 1.00 45.95 O -HETATM 2473 O HOH A 461 -11.171 -18.623 1.902 1.00 59.14 O -HETATM 2474 O HOH A 462 10.010 -10.532 10.832 1.00 52.16 O -HETATM 2475 O HOH A 463 13.737 -7.752 35.913 1.00 35.27 O -HETATM 2476 O HOH A 464 25.692 -15.689 34.348 1.00 67.65 O -HETATM 2477 O HOH A 465 15.408 -35.291 2.794 1.00 73.43 O -HETATM 2478 O HOH A 466 8.907 -34.814 48.496 1.00 57.98 O -HETATM 2479 O HOH A 467 4.516 -34.612 49.401 1.00 72.32 O -HETATM 2480 O HOH A 468 -9.019 -15.380 28.445 1.00 70.17 O -HETATM 2481 O HOH A 469 -10.223 -12.395 26.157 1.00 36.34 O -HETATM 2482 O HOH A 470 -5.859 -25.485 16.336 1.00 56.33 O -HETATM 2483 O HOH A 471 13.126 -33.897 4.119 1.00 75.50 O -HETATM 2484 O HOH A 472 -1.899 -19.466 26.293 1.00 66.81 O -HETATM 2485 O HOH A 473 -5.232 -26.610 46.500 1.00 54.10 O -HETATM 2486 O HOH A 474 3.194 -39.452 42.635 1.00 58.95 O -HETATM 2487 O HOH A 475 5.417 -19.041 32.998 1.00 64.71 O -HETATM 2488 O HOH A 476 -5.159 -20.076 27.294 1.00 53.66 O -HETATM 2489 O HOH A 477 -7.560 -20.565 33.886 1.00 74.59 O -HETATM 2490 O HOH A 478 14.733 -29.399 8.426 1.00 52.60 O -HETATM 2491 O HOH A 479 12.989 -5.891 3.303 1.00 73.28 O -HETATM 2492 O HOH A 480 11.888 -4.745 37.090 1.00 79.45 O -HETATM 2493 O HOH A 481 -9.719 -33.018 3.473 1.00 79.74 O -HETATM 2494 O HOH A 482 -4.477 -30.281 44.408 1.00 55.45 O -HETATM 2495 O HOH A 483 23.282 -4.364 40.147 1.00 62.96 O -HETATM 2496 O HOH A 484 -2.579 -20.233 21.451 1.00 54.07 O -HETATM 2497 O HOH A 485 -0.965 -23.721 18.378 1.00 69.32 O -HETATM 2498 O HOH A 486 4.489 -3.984 31.120 1.00 70.03 O -HETATM 2499 O HOH A 487 8.811 -22.700 16.234 1.00 66.77 O -HETATM 2500 O HOH A 488 2.660 -12.859 10.427 1.00 58.10 O -HETATM 2501 O HOH A 489 -1.387 -22.273 29.103 1.00 65.27 O -HETATM 2502 O HOH A 490 -24.219 -16.069 32.703 1.00 56.86 O -HETATM 2503 O HOH A 491 13.243 -24.599 13.470 1.00 56.42 O -HETATM 2504 O HOH A 492 12.805 -39.013 36.774 1.00 56.25 O -HETATM 2505 O HOH A 493 -9.880 -19.986 9.385 1.00 49.66 O -HETATM 2506 O HOH A 494 13.601 -14.414 38.762 1.00 62.01 O -HETATM 2507 O HOH A 495 -3.474 -42.227 33.006 1.00 61.29 O -HETATM 2508 O HOH A 496 10.775 -20.406 17.335 1.00 61.82 O -HETATM 2509 O HOH A 497 -16.983 -22.582 4.035 1.00 81.82 O -HETATM 2510 O HOH A 498 -0.061 -32.045 16.343 1.00 52.03 O -HETATM 2511 O HOH A 499 1.700 -8.945 27.927 1.00 55.91 O -HETATM 2512 O HOH A 500 6.985 -35.205 10.094 1.00 54.60 O -HETATM 2513 O HOH A 501 -18.744 -29.204 33.911 1.00 62.48 O -HETATM 2514 O HOH A 502 -3.013 -32.508 44.619 1.00 56.15 O -HETATM 2515 O HOH A 503 -9.599 -26.433 17.708 1.00 47.52 O -HETATM 2516 O HOH A 504 23.100 -23.126 5.577 1.00 66.96 O -HETATM 2517 O HOH A 505 -9.245 -18.936 35.479 1.00 88.14 O -HETATM 2518 O HOH A 506 2.537 -11.203 26.087 1.00 70.57 O -HETATM 2519 O HOH A 507 25.103 -27.995 42.947 1.00 77.52 O -HETATM 2520 O HOH A 508 10.413 -40.233 37.531 1.00 68.06 O -HETATM 2521 O HOH A 509 -0.334 -29.010 17.030 1.00 60.83 O -HETATM 2522 O HOH A 510 -9.223 -11.719 6.742 1.00 43.72 O -HETATM 2523 O HOH A 511 -1.417 -2.836 32.189 1.00 64.23 O -HETATM 2524 O HOH A 512 2.862 -14.652 12.746 1.00 67.86 O -HETATM 2525 O HOH A 513 -1.741 -11.688 16.055 1.00 48.46 O -HETATM 2526 O HOH A 514 1.544 -22.784 46.295 1.00 58.53 O -HETATM 2527 O HOH A 515 18.967 -28.869 46.391 1.00 49.61 O -HETATM 2528 O HOH A 516 18.900 -1.671 35.946 1.00 63.03 O -HETATM 2529 O HOH A 517 25.588 -9.757 43.162 1.00 70.54 O -HETATM 2530 O HOH A 518 -5.187 -16.800 15.371 1.00 71.25 O -HETATM 2531 O HOH A 519 23.680 -16.891 38.002 1.00 49.95 O -HETATM 2532 O HOH A 520 22.376 -19.370 38.400 1.00 48.64 O -HETATM 2533 O HOH A 521 3.024 -14.199 16.344 1.00 66.81 O -HETATM 2534 O HOH A 522 -20.871 -27.856 37.688 1.00 77.42 O -HETATM 2535 O HOH A 523 14.349 -31.425 53.433 1.00 76.39 O -HETATM 2536 O HOH A 524 25.962 -3.949 39.123 1.00 73.03 O -HETATM 2537 O HOH A 525 -1.900 -17.739 19.749 1.00 77.39 O -HETATM 2538 O HOH A 526 15.300 -15.636 5.977 1.00 67.58 O -HETATM 2539 O HOH A 527 14.023 -21.234 12.521 1.00 62.67 O -HETATM 2540 O HOH A 528 -2.577 -33.369 47.317 1.00 67.32 O -HETATM 2541 O HOH A 529 3.580 -21.150 21.484 1.00 76.35 O -HETATM 2542 O HOH A 530 13.429 -0.224 31.429 1.00 66.81 O -HETATM 2543 O HOH A 531 24.396 -18.463 40.400 1.00 71.46 O -HETATM 2544 O HOH A 532 8.064 -11.657 35.360 1.00 79.97 O -HETATM 2545 O HOH A 533 4.163 -19.214 29.519 1.00 65.18 O -HETATM 2546 O HOH A 534 16.247 -4.931 40.302 1.00 66.98 O -HETATM 2547 O HOH A 535 -12.361 -20.969 33.706 1.00 57.49 O -HETATM 2548 O HOH A 536 2.542 -10.157 8.311 1.00 63.19 O -HETATM 2549 O HOH A 537 -10.391 -21.350 3.340 1.00 61.09 O -HETATM 2550 O HOH A 538 22.816 -29.263 43.850 1.00 71.51 O -HETATM 2551 O HOH A 539 1.548 -32.124 14.108 1.00 65.27 O -HETATM 2552 O HOH A 540 4.442 -14.466 22.488 1.00 66.67 O -HETATM 2553 O HOH A 541 14.949 -15.727 9.137 1.00 57.15 O -HETATM 2554 O HOH A 542 -3.841 -17.336 21.933 1.00 73.37 O -HETATM 2555 O HOH A 543 0.148 -1.579 25.046 1.00 57.28 O -HETATM 2556 O HOH A 544 1.772 -33.983 12.170 1.00 64.62 O -HETATM 2557 O HOH A 549 -17.923 -26.775 15.606 1.00 45.08 O -HETATM 2558 O HOH A 550 23.530 -24.401 25.957 1.00 57.73 O -HETATM 2559 O HOH A 551 26.759 -24.207 11.635 1.00 54.12 O -HETATM 2560 O HOH A 552 23.462 -20.651 22.231 1.00 49.12 O -HETATM 2561 O HOH A 553 -23.391 -27.104 30.643 1.00 53.13 O -HETATM 2562 O HOH A 554 3.998 -44.799 28.989 1.00 65.70 O -HETATM 2563 O HOH A 555 -8.344 -38.052 23.422 1.00 51.43 O -HETATM 2564 O HOH A 556 -19.689 -30.737 11.462 1.00 74.75 O -HETATM 2565 O HOH A 557 23.241 -22.420 24.265 1.00 58.01 O -HETATM 2566 O HOH A 558 20.793 -38.159 27.686 1.00 76.00 O -HETATM 2567 O HOH A 559 25.724 -26.198 13.506 1.00 63.30 O -HETATM 2568 O HOH A 560 28.575 -20.254 8.172 1.00 78.96 O -HETATM 2569 O HOH A 561 -6.785 -38.481 21.333 1.00 56.46 O -HETATM 2570 O HOH A 562 -8.442 -40.548 13.066 1.00 74.14 O -HETATM 2571 O HOH A 563 5.420 -44.518 31.307 1.00 72.99 O -HETATM 2572 O HOH A 564 -9.958 -37.743 18.331 1.00 62.33 O -HETATM 2573 O HOH A 565 -18.589 -32.618 15.228 1.00 72.81 O -HETATM 2574 O HOH A 566 18.004 -36.417 16.015 1.00 60.73 O -HETATM 2575 O HOH A 567 -20.827 -28.396 26.744 1.00 60.68 O -HETATM 2576 O HOH A 568 18.980 -40.765 25.192 1.00 66.66 O -HETATM 2577 O HOH A 569 20.580 -34.799 24.845 1.00 69.04 O -HETATM 2578 O HOH A 570 -9.200 -42.458 17.427 1.00 71.01 O -HETATM 2579 O HOH A 571 9.238 -44.707 26.611 1.00 69.97 O -HETATM 2580 O HOH A 572 -7.335 -42.291 15.281 1.00 83.29 O -HETATM 2581 O HOH A 573 -23.107 -27.093 18.628 1.00 74.27 O -HETATM 2582 O HOH A 574 -4.629 -42.624 14.481 1.00 69.37 O -HETATM 2583 O HOH A 575 20.398 -33.206 22.405 1.00 58.19 O -HETATM 2584 O HOH A 576 -9.431 -37.868 15.541 1.00 74.36 O -HETATM 2585 O HOH A 577 -17.338 -34.648 10.071 1.00 89.58 O -HETATM 2586 O HOH A 578 22.986 -33.974 26.496 1.00 75.72 O -HETATM 2587 O HOH A 579 22.497 -27.333 27.869 1.00 68.59 O -HETATM 2588 O HOH A 580 -10.506 -37.902 25.211 1.00 58.90 O -HETATM 2589 O HOH A 581 5.670 -43.729 27.194 1.00 69.01 O -HETATM 2590 O HOH A 582 -22.243 -24.640 11.035 1.00 82.74 O -CONECT 590 2230 -CONECT 591 2230 -CONECT 693 2231 -CONECT 694 2231 -CONECT 709 2231 -CONECT 710 2231 -CONECT 744 2231 -CONECT 752 2231 -CONECT 807 2230 -CONECT 871 2232 -CONECT 1014 2232 -CONECT 1015 2232 -CONECT 1023 2232 -CONECT 1039 2232 -CONECT 2230 590 591 807 2317 -CONECT 2230 2319 2324 2351 -CONECT 2231 693 694 709 710 -CONECT 2231 744 752 2339 2343 -CONECT 2232 871 1014 1015 1023 -CONECT 2232 1039 2326 -CONECT 2233 2234 -CONECT 2234 2233 2235 -CONECT 2235 2234 2236 -CONECT 2236 2235 2237 -CONECT 2237 2236 2238 -CONECT 2238 2237 2239 -CONECT 2239 2238 2240 -CONECT 2240 2239 2241 -CONECT 2241 2240 2242 -CONECT 2242 2241 2243 -CONECT 2243 2242 2244 -CONECT 2244 2243 2245 -CONECT 2245 2244 2246 -CONECT 2246 2245 2247 -CONECT 2247 2246 2248 -CONECT 2248 2247 2249 -CONECT 2249 2248 2250 -CONECT 2250 2249 2251 -CONECT 2251 2250 2252 -CONECT 2252 2251 2253 -CONECT 2253 2252 -CONECT 2254 2255 -CONECT 2255 2254 2256 -CONECT 2256 2255 2257 -CONECT 2257 2256 2258 -CONECT 2258 2257 2259 -CONECT 2259 2258 2260 -CONECT 2260 2259 2261 -CONECT 2261 2260 2262 -CONECT 2262 2261 2263 -CONECT 2263 2262 2264 -CONECT 2264 2263 2265 -CONECT 2265 2264 2266 -CONECT 2266 2265 2267 -CONECT 2267 2266 2268 -CONECT 2268 2267 2269 -CONECT 2269 2268 2270 -CONECT 2270 2269 2271 -CONECT 2271 2270 2272 -CONECT 2272 2271 2273 -CONECT 2273 2272 2274 -CONECT 2274 2273 -CONECT 2275 2276 -CONECT 2276 2275 2277 -CONECT 2277 2276 2278 -CONECT 2278 2277 2279 -CONECT 2279 2278 2280 -CONECT 2280 2279 2281 -CONECT 2281 2280 2282 -CONECT 2282 2281 2283 -CONECT 2283 2282 2284 -CONECT 2284 2283 2285 -CONECT 2285 2284 2286 -CONECT 2286 2285 2287 -CONECT 2287 2286 2288 -CONECT 2288 2287 2289 -CONECT 2289 2288 2290 -CONECT 2290 2289 2291 -CONECT 2291 2290 2292 -CONECT 2292 2291 2293 -CONECT 2293 2292 2294 -CONECT 2294 2293 2295 -CONECT 2295 2294 -CONECT 2296 2297 -CONECT 2297 2296 2298 -CONECT 2298 2297 2299 -CONECT 2299 2298 2300 -CONECT 2300 2299 2301 -CONECT 2301 2300 2302 -CONECT 2302 2301 2303 -CONECT 2303 2302 2304 -CONECT 2304 2303 2305 -CONECT 2305 2304 2306 -CONECT 2306 2305 2307 -CONECT 2307 2306 2308 -CONECT 2308 2307 2309 -CONECT 2309 2308 2310 -CONECT 2310 2309 2311 -CONECT 2311 2310 2312 -CONECT 2312 2311 2313 -CONECT 2313 2312 2314 -CONECT 2314 2313 2315 -CONECT 2315 2314 2316 -CONECT 2316 2315 -CONECT 2317 2230 -CONECT 2319 2230 -CONECT 2324 2230 -CONECT 2326 2232 -CONECT 2339 2231 -CONECT 2343 2231 -CONECT 2351 2230 -MASTER 438 4 7 3 17 17 9 6 2589 1 111 24 -END diff --git a/java/examples/Demos/Graphics/Ribbons/data/4HHB.pdb b/java/examples/Demos/Graphics/Ribbons/data/4HHB.pdb deleted file mode 100644 index 8a55a2886..000000000 --- a/java/examples/Demos/Graphics/Ribbons/data/4HHB.pdb +++ /dev/null @@ -1,5991 +0,0 @@ -HEADER OXYGEN TRANSPORT 07-MAR-84 4HHB -TITLE THE CRYSTAL STRUCTURE OF HUMAN DEOXYHAEMOGLOBIN AT 1.74 -TITLE 2 ANGSTROMS RESOLUTION -COMPND MOL_ID: 1; -COMPND 2 MOLECULE: HEMOGLOBIN (DEOXY) (ALPHA CHAIN); -COMPND 3 CHAIN: A, C; -COMPND 4 ENGINEERED: YES; -COMPND 5 MOL_ID: 2; -COMPND 6 MOLECULE: HEMOGLOBIN (DEOXY) (BETA CHAIN); -COMPND 7 CHAIN: B, D; -COMPND 8 ENGINEERED: YES -SOURCE MOL_ID: 1; -SOURCE 2 ORGANISM_SCIENTIFIC: HOMO SAPIENS; -SOURCE 3 ORGANISM_COMMON: HUMAN; -SOURCE 4 ORGANISM_TAXID: 9606; -SOURCE 5 MOL_ID: 2; -SOURCE 6 ORGANISM_SCIENTIFIC: HOMO SAPIENS; -SOURCE 7 ORGANISM_COMMON: HUMAN; -SOURCE 8 ORGANISM_TAXID: 9606 -KEYWDS OXYGEN TRANSPORT -EXPDTA X-RAY DIFFRACTION -AUTHOR G.FERMI,M.F.PERUTZ -REVDAT 4 24-FEB-09 4HHB 1 VERSN -REVDAT 3 01-APR-03 4HHB 1 JRNL -REVDAT 2 15-OCT-89 4HHB 3 MTRIX -REVDAT 1 17-JUL-84 4HHB 0 -SPRSDE 17-JUL-84 4HHB 1HHB -JRNL AUTH G.FERMI,M.F.PERUTZ,B.SHAANAN,R.FOURME -JRNL TITL THE CRYSTAL STRUCTURE OF HUMAN DEOXYHAEMOGLOBIN AT -JRNL TITL 2 1.74 A RESOLUTION -JRNL REF J.MOL.BIOL. V. 175 159 1984 -JRNL REFN ISSN 0022-2836 -JRNL PMID 6726807 -JRNL DOI 10.1016/0022-2836(84)90472-8 -REMARK 1 -REMARK 1 REFERENCE 1 -REMARK 1 AUTH M.F.PERUTZ,S.S.HASNAIN,P.J.DUKE,J.L.SESSLER, -REMARK 1 AUTH 2 J.E.HAHN -REMARK 1 TITL STEREOCHEMISTRY OF IRON IN DEOXYHAEMOGLOBIN -REMARK 1 REF NATURE V. 295 535 1982 -REMARK 1 REFN ISSN 0028-0836 -REMARK 1 REFERENCE 2 -REMARK 1 AUTH G.FERMI,M.F.PERUTZ -REMARK 1 REF HAEMOGLOBIN AND MYOGLOBIN. V. 2 1981 -REMARK 1 REF 2 ATLAS OF MOLECULAR -REMARK 1 REF 3 STRUCTURES IN BIOLOGY -REMARK 1 PUBL OXFORD UNIVERSITY PRESS -REMARK 1 REFN -REMARK 1 REFERENCE 3 -REMARK 1 AUTH M.F.PERUTZ -REMARK 1 TITL REGULATION OF OXYGEN AFFINITY OF HEMOGLOBIN. -REMARK 1 TITL 2 INFLUENCE OF STRUCTURE OF THE GLOBIN ON THE HEME -REMARK 1 TITL 3 IRON -REMARK 1 REF ANNU.REV.BIOCHEM. V. 48 327 1979 -REMARK 1 REFN ISSN 0066-4154 -REMARK 1 REFERENCE 4 -REMARK 1 AUTH L.F.TENEYCK,A.ARNONE -REMARK 1 TITL THREE-DIMENSIONAL FOURIER SYNTHESIS OF HUMAN -REMARK 1 TITL 2 DEOXYHEMOGLOBIN AT 2.5 ANGSTROMS RESOLUTION, -REMARK 1 TITL 3 I.X-RAY ANALYSIS -REMARK 1 REF J.MOL.BIOL. V. 100 3 1976 -REMARK 1 REFN ISSN 0022-2836 -REMARK 1 REFERENCE 5 -REMARK 1 AUTH G.FERMI -REMARK 1 TITL THREE-DIMENSIONAL FOURIER SYNTHESIS OF HUMAN -REMARK 1 TITL 2 DEOXYHAEMOGLOBIN AT 2.5 ANGSTROMS RESOLUTION, -REMARK 1 TITL 3 REFINEMENT OF THE ATOMIC MODEL -REMARK 1 REF J.MOL.BIOL. V. 97 237 1975 -REMARK 1 REFN ISSN 0022-2836 -REMARK 1 REFERENCE 6 -REMARK 1 AUTH H.MUIRHEAD,J.GREER -REMARK 1 TITL THREE-DIMENSIONAL FOURIER SYNTHESIS OF HUMAN -REMARK 1 TITL 2 DEOXYHAEMOGLOBIN AT 3.5 ANGSTROMS RESOLUTION -REMARK 1 REF NATURE V. 228 516 1970 -REMARK 1 REFN ISSN 0028-0836 -REMARK 1 REFERENCE 7 -REMARK 1 EDIT M.O.DAYHOFF -REMARK 1 REF ATLAS OF PROTEIN SEQUENCE V. 5 56 1972 -REMARK 1 REF 2 AND STRUCTURE (DATA SECTION) -REMARK 1 PUBL NATIONAL BIOMEDICAL RESEARCH FOUNDATION, SILVER -REMARK 1 PUBL 2 SPRING,MD. -REMARK 1 REFN -REMARK 1 REFERENCE 8 -REMARK 1 EDIT M.O.DAYHOFF -REMARK 1 REF ATLAS OF PROTEIN SEQUENCE V. 5 64 1972 -REMARK 1 REF 2 AND STRUCTURE (DATA SECTION) -REMARK 1 PUBL NATIONAL BIOMEDICAL RESEARCH FOUNDATION, SILVER -REMARK 1 PUBL 2 SPRING,MD. -REMARK 1 REFN -REMARK 2 -REMARK 2 RESOLUTION. 1.74 ANGSTROMS. -REMARK 3 -REMARK 3 REFINEMENT. -REMARK 3 PROGRAM : NULL -REMARK 3 AUTHORS : NULL -REMARK 3 -REMARK 3 DATA USED IN REFINEMENT. -REMARK 3 RESOLUTION RANGE HIGH (ANGSTROMS) : 1.74 -REMARK 3 RESOLUTION RANGE LOW (ANGSTROMS) : NULL -REMARK 3 DATA CUTOFF (SIGMA(F)) : NULL -REMARK 3 DATA CUTOFF HIGH (ABS(F)) : NULL -REMARK 3 DATA CUTOFF LOW (ABS(F)) : NULL -REMARK 3 COMPLETENESS (WORKING+TEST) (%) : NULL -REMARK 3 NUMBER OF REFLECTIONS : NULL -REMARK 3 -REMARK 3 FIT TO DATA USED IN REFINEMENT. -REMARK 3 CROSS-VALIDATION METHOD : NULL -REMARK 3 FREE R VALUE TEST SET SELECTION : NULL -REMARK 3 R VALUE (WORKING SET) : 0.135 -REMARK 3 FREE R VALUE : NULL -REMARK 3 FREE R VALUE TEST SET SIZE (%) : NULL -REMARK 3 FREE R VALUE TEST SET COUNT : NULL -REMARK 3 ESTIMATED ERROR OF FREE R VALUE : NULL -REMARK 3 -REMARK 3 FIT IN THE HIGHEST RESOLUTION BIN. -REMARK 3 TOTAL NUMBER OF BINS USED : NULL -REMARK 3 BIN RESOLUTION RANGE HIGH (A) : NULL -REMARK 3 BIN RESOLUTION RANGE LOW (A) : NULL -REMARK 3 BIN COMPLETENESS (WORKING+TEST) (%) : NULL -REMARK 3 REFLECTIONS IN BIN (WORKING SET) : NULL -REMARK 3 BIN R VALUE (WORKING SET) : NULL -REMARK 3 BIN FREE R VALUE : NULL -REMARK 3 BIN FREE R VALUE TEST SET SIZE (%) : NULL -REMARK 3 BIN FREE R VALUE TEST SET COUNT : NULL -REMARK 3 ESTIMATED ERROR OF BIN FREE R VALUE : NULL -REMARK 3 -REMARK 3 NUMBER OF NON-HYDROGEN ATOMS USED IN REFINEMENT. -REMARK 3 PROTEIN ATOMS : 4384 -REMARK 3 NUCLEIC ACID ATOMS : 0 -REMARK 3 HETEROGEN ATOMS : 174 -REMARK 3 SOLVENT ATOMS : 221 -REMARK 3 -REMARK 3 B VALUES. -REMARK 3 FROM WILSON PLOT (A**2) : NULL -REMARK 3 MEAN B VALUE (OVERALL, A**2) : NULL -REMARK 3 OVERALL ANISOTROPIC B VALUE. -REMARK 3 B11 (A**2) : NULL -REMARK 3 B22 (A**2) : NULL -REMARK 3 B33 (A**2) : NULL -REMARK 3 B12 (A**2) : NULL -REMARK 3 B13 (A**2) : NULL -REMARK 3 B23 (A**2) : NULL -REMARK 3 -REMARK 3 ESTIMATED COORDINATE ERROR. -REMARK 3 ESD FROM LUZZATI PLOT (A) : NULL -REMARK 3 ESD FROM SIGMAA (A) : NULL -REMARK 3 LOW RESOLUTION CUTOFF (A) : NULL -REMARK 3 -REMARK 3 CROSS-VALIDATED ESTIMATED COORDINATE ERROR. -REMARK 3 ESD FROM C-V LUZZATI PLOT (A) : NULL -REMARK 3 ESD FROM C-V SIGMAA (A) : NULL -REMARK 3 -REMARK 3 RMS DEVIATIONS FROM IDEAL VALUES. -REMARK 3 BOND LENGTHS (A) : NULL -REMARK 3 BOND ANGLES (DEGREES) : NULL -REMARK 3 DIHEDRAL ANGLES (DEGREES) : NULL -REMARK 3 IMPROPER ANGLES (DEGREES) : NULL -REMARK 3 -REMARK 3 ISOTROPIC THERMAL MODEL : NULL -REMARK 3 -REMARK 3 ISOTROPIC THERMAL FACTOR RESTRAINTS. RMS SIGMA -REMARK 3 MAIN-CHAIN BOND (A**2) : NULL ; NULL -REMARK 3 MAIN-CHAIN ANGLE (A**2) : NULL ; NULL -REMARK 3 SIDE-CHAIN BOND (A**2) : NULL ; NULL -REMARK 3 SIDE-CHAIN ANGLE (A**2) : NULL ; NULL -REMARK 3 -REMARK 3 NCS MODEL : NULL -REMARK 3 -REMARK 3 NCS RESTRAINTS. RMS SIGMA/WEIGHT -REMARK 3 GROUP 1 POSITIONAL (A) : NULL ; NULL -REMARK 3 GROUP 1 B-FACTOR (A**2) : NULL ; NULL -REMARK 3 -REMARK 3 PARAMETER FILE 1 : NULL -REMARK 3 TOPOLOGY FILE 1 : NULL -REMARK 3 -REMARK 3 OTHER REFINEMENT REMARKS: THE COORDINATES GIVEN HERE ARE IN -REMARK 3 THE ORTHOGONAL ANGSTROM SYSTEM STANDARD FOR HEMOGLOBINS. THE Y -REMARK 3 AXIS IS THE (NON CRYSTALLOGRAPHIC) MOLECULAR DIAD AND THE X -REMARK 3 AXIS IS THE PSEUDO DIAD WHICH RELATES THE ALPHA-1 AND BETA-1 -REMARK 3 CHAINS. THE TRANSFORMATION GIVEN IN THE *MTRIX* RECORDS BELOW -REMARK 3 WILL GENERATE COORDINATES FOR THE *C* AND *D* CHAINS FROM THE -REMARK 3 *A* AND *B* CHAINS RESPECTIVELY. -REMARK 4 -REMARK 4 4HHB COMPLIES WITH FORMAT V. 3.15, 01-DEC-08 -REMARK 100 -REMARK 100 THIS ENTRY HAS BEEN PROCESSED BY BNL. -REMARK 200 -REMARK 200 EXPERIMENTAL DETAILS -REMARK 200 EXPERIMENT TYPE : X-RAY DIFFRACTION -REMARK 200 DATE OF DATA COLLECTION : NULL -REMARK 200 TEMPERATURE (KELVIN) : NULL -REMARK 200 PH : NULL -REMARK 200 NUMBER OF CRYSTALS USED : NULL -REMARK 200 -REMARK 200 SYNCHROTRON (Y/N) : NULL -REMARK 200 RADIATION SOURCE : NULL -REMARK 200 BEAMLINE : NULL -REMARK 200 X-RAY GENERATOR MODEL : NULL -REMARK 200 MONOCHROMATIC OR LAUE (M/L) : NULL -REMARK 200 WAVELENGTH OR RANGE (A) : NULL -REMARK 200 MONOCHROMATOR : NULL -REMARK 200 OPTICS : NULL -REMARK 200 -REMARK 200 DETECTOR TYPE : NULL -REMARK 200 DETECTOR MANUFACTURER : NULL -REMARK 200 INTENSITY-INTEGRATION SOFTWARE : NULL -REMARK 200 DATA SCALING SOFTWARE : NULL -REMARK 200 -REMARK 200 NUMBER OF UNIQUE REFLECTIONS : NULL -REMARK 200 RESOLUTION RANGE HIGH (A) : NULL -REMARK 200 RESOLUTION RANGE LOW (A) : NULL -REMARK 200 REJECTION CRITERIA (SIGMA(I)) : NULL -REMARK 200 -REMARK 200 OVERALL. -REMARK 200 COMPLETENESS FOR RANGE (%) : NULL -REMARK 200 DATA REDUNDANCY : NULL -REMARK 200 R MERGE (I) : NULL -REMARK 200 R SYM (I) : NULL -REMARK 200 FOR THE DATA SET : NULL -REMARK 200 -REMARK 200 IN THE HIGHEST RESOLUTION SHELL. -REMARK 200 HIGHEST RESOLUTION SHELL, RANGE HIGH (A) : NULL -REMARK 200 HIGHEST RESOLUTION SHELL, RANGE LOW (A) : NULL -REMARK 200 COMPLETENESS FOR SHELL (%) : NULL -REMARK 200 DATA REDUNDANCY IN SHELL : NULL -REMARK 200 R MERGE FOR SHELL (I) : NULL -REMARK 200 R SYM FOR SHELL (I) : NULL -REMARK 200 FOR SHELL : NULL -REMARK 200 -REMARK 200 DIFFRACTION PROTOCOL: NULL -REMARK 200 METHOD USED TO DETERMINE THE STRUCTURE: NULL -REMARK 200 SOFTWARE USED: NULL -REMARK 200 STARTING MODEL: NULL -REMARK 200 -REMARK 200 REMARK: NULL -REMARK 280 -REMARK 280 CRYSTAL -REMARK 280 SOLVENT CONTENT, VS (%): 45.48 -REMARK 280 MATTHEWS COEFFICIENT, VM (ANGSTROMS**3/DA): 2.26 -REMARK 280 -REMARK 280 CRYSTALLIZATION CONDITIONS: NULL -REMARK 290 -REMARK 290 CRYSTALLOGRAPHIC SYMMETRY -REMARK 290 SYMMETRY OPERATORS FOR SPACE GROUP: P 1 21 1 -REMARK 290 -REMARK 290 SYMOP SYMMETRY -REMARK 290 NNNMMM OPERATOR -REMARK 290 1555 X,Y,Z -REMARK 290 2555 -X,Y+1/2,-Z -REMARK 290 -REMARK 290 WHERE NNN -> OPERATOR NUMBER -REMARK 290 MMM -> TRANSLATION VECTOR -REMARK 290 -REMARK 290 CRYSTALLOGRAPHIC SYMMETRY TRANSFORMATIONS -REMARK 290 THE FOLLOWING TRANSFORMATIONS OPERATE ON THE ATOM/HETATM -REMARK 290 RECORDS IN THIS ENTRY TO PRODUCE CRYSTALLOGRAPHICALLY -REMARK 290 RELATED MOLECULES. -REMARK 290 SMTRY1 1 1.000000 0.000000 0.000000 0.00000 -REMARK 290 SMTRY2 1 0.000000 1.000000 0.000000 0.00000 -REMARK 290 SMTRY3 1 0.000000 0.000000 1.000000 0.00000 -REMARK 290 SMTRY1 2 -0.949456 -0.312801 -0.025883 -6.64347 -REMARK 290 SMTRY2 2 -0.312858 0.936202 0.160212 41.12228 -REMARK 290 SMTRY3 2 -0.025884 0.160188 -0.986745 3.40218 -REMARK 290 -REMARK 290 REMARK: NULL -REMARK 300 -REMARK 300 BIOMOLECULE: 1 -REMARK 300 SEE REMARK 350 FOR THE AUTHOR PROVIDED AND/OR PROGRAM -REMARK 300 GENERATED ASSEMBLY INFORMATION FOR THE STRUCTURE IN -REMARK 300 THIS ENTRY. THE REMARK MAY ALSO PROVIDE INFORMATION ON -REMARK 300 BURIED SURFACE AREA. -REMARK 350 -REMARK 350 COORDINATES FOR A COMPLETE MULTIMER REPRESENTING THE KNOWN -REMARK 350 BIOLOGICALLY SIGNIFICANT OLIGOMERIZATION STATE OF THE -REMARK 350 MOLECULE CAN BE GENERATED BY APPLYING BIOMT TRANSFORMATIONS -REMARK 350 GIVEN BELOW. BOTH NON-CRYSTALLOGRAPHIC AND -REMARK 350 CRYSTALLOGRAPHIC OPERATIONS ARE GIVEN. -REMARK 350 -REMARK 350 BIOMOLECULE: 1 -REMARK 350 AUTHOR DETERMINED BIOLOGICAL UNIT: TETRAMERIC -REMARK 350 SOFTWARE DETERMINED QUATERNARY STRUCTURE: TETRAMERIC -REMARK 350 SOFTWARE USED: PISA -REMARK 350 TOTAL BURIED SURFACE AREA: 11630 ANGSTROM**2 -REMARK 350 SURFACE AREA OF THE COMPLEX: 24010 ANGSTROM**2 -REMARK 350 CHANGE IN SOLVENT FREE ENERGY: -98.0 KCAL/MOL -REMARK 350 APPLY THE FOLLOWING TO CHAINS: A, B, C, D -REMARK 350 BIOMT1 1 1.000000 0.000000 0.000000 0.00000 -REMARK 350 BIOMT2 1 0.000000 1.000000 0.000000 0.00000 -REMARK 350 BIOMT3 1 0.000000 0.000000 1.000000 0.00000 -REMARK 500 -REMARK 500 GEOMETRY AND STEREOCHEMISTRY -REMARK 500 SUBTOPIC: CLOSE CONTACTS IN SAME ASYMMETRIC UNIT -REMARK 500 -REMARK 500 THE FOLLOWING ATOMS ARE IN CLOSE CONTACT. -REMARK 500 -REMARK 500 ATM1 RES C SSEQI ATM2 RES C SSEQI DISTANCE -REMARK 500 CB THR D 4 OE2 GLU D 6 2.00 -REMARK 500 NZ LYS D 66 O1A HEM D 148 2.06 -REMARK 500 OD2 ASP D 73 O HOH D 174 2.10 -REMARK 500 OG1 THR D 4 OE2 GLU D 6 2.19 -REMARK 500 -REMARK 500 REMARK: NULL -REMARK 500 -REMARK 500 GEOMETRY AND STEREOCHEMISTRY -REMARK 500 SUBTOPIC: CLOSE CONTACTS -REMARK 500 -REMARK 500 THE FOLLOWING ATOMS THAT ARE RELATED BY CRYSTALLOGRAPHIC -REMARK 500 SYMMETRY ARE IN CLOSE CONTACT. AN ATOM LOCATED WITHIN 0.15 -REMARK 500 ANGSTROMS OF A SYMMETRY RELATED ATOM IS ASSUMED TO BE ON A -REMARK 500 SPECIAL POSITION AND IS, THEREFORE, LISTED IN REMARK 375 -REMARK 500 INSTEAD OF REMARK 500. ATOMS WITH NON-BLANK ALTERNATE -REMARK 500 LOCATION INDICATORS ARE NOT INCLUDED IN THE CALCULATIONS. -REMARK 500 -REMARK 500 DISTANCE CUTOFF: -REMARK 500 2.2 ANGSTROMS FOR CONTACTS NOT INVOLVING HYDROGEN ATOMS -REMARK 500 1.6 ANGSTROMS FOR CONTACTS INVOLVING HYDROGEN ATOMS -REMARK 500 -REMARK 500 ATM1 RES C SSEQI ATM2 RES C SSEQI SSYMOP DISTANCE -REMARK 500 OD2 ASP C 85 O HOH B 204 2657 1.41 -REMARK 500 O HOH B 204 O HOH C 161 2647 2.02 -REMARK 500 -REMARK 500 REMARK: NULL -REMARK 500 -REMARK 500 GEOMETRY AND STEREOCHEMISTRY -REMARK 500 SUBTOPIC: COVALENT BOND LENGTHS -REMARK 500 -REMARK 500 THE STEREOCHEMICAL PARAMETERS OF THE FOLLOWING RESIDUES -REMARK 500 HAVE VALUES WHICH DEVIATE FROM EXPECTED VALUES BY MORE -REMARK 500 THAN 6*RMSD (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN -REMARK 500 IDENTIFIER; SSEQ=SEQUENCE NUMBER; I=INSERTION CODE). -REMARK 500 -REMARK 500 STANDARD TABLE: -REMARK 500 FORMAT: (10X,I3,1X,2(A3,1X,A1,I4,A1,1X,A4,3X),1X,F6.3) -REMARK 500 -REMARK 500 EXPECTED VALUES PROTEIN: ENGH AND HUBER, 1999 -REMARK 500 EXPECTED VALUES NUCLEIC ACID: CLOWNEY ET AL 1996 -REMARK 500 -REMARK 500 M RES CSSEQI ATM1 RES CSSEQI ATM2 DEVIATION -REMARK 500 VAL A 1 N VAL A 1 CA -0.295 -REMARK 500 VAL A 1 CA VAL A 1 CB 0.299 -REMARK 500 VAL A 1 CB VAL A 1 CG1 -0.206 -REMARK 500 VAL A 1 CB VAL A 1 CG2 -0.283 -REMARK 500 LEU A 2 CA LEU A 2 C 0.249 -REMARK 500 SER A 3 N SER A 3 CA 0.167 -REMARK 500 SER A 3 CB SER A 3 OG -0.132 -REMARK 500 LEU A 2 C SER A 3 N -0.320 -REMARK 500 PRO A 4 N PRO A 4 CA -0.149 -REMARK 500 PRO A 4 CA PRO A 4 CB 0.200 -REMARK 500 SER A 3 C PRO A 4 N 0.282 -REMARK 500 ALA A 5 N ALA A 5 CA -0.130 -REMARK 500 ALA A 5 CA ALA A 5 CB 0.247 -REMARK 500 PRO A 4 C ALA A 5 N 0.257 -REMARK 500 LYS A 7 N LYS A 7 CA 0.157 -REMARK 500 THR A 8 CA THR A 8 CB 0.178 -REMARK 500 THR A 8 CB THR A 8 OG1 -0.173 -REMARK 500 THR A 8 CB THR A 8 CG2 -0.245 -REMARK 500 THR A 8 CA THR A 8 C -0.174 -REMARK 500 LYS A 7 C THR A 8 N 0.258 -REMARK 500 THR A 8 C ASN A 9 N 0.179 -REMARK 500 VAL A 10 CB VAL A 10 CG2 -0.179 -REMARK 500 VAL A 10 CA VAL A 10 C 0.160 -REMARK 500 LYS A 11 N LYS A 11 CA 0.131 -REMARK 500 LYS A 11 CA LYS A 11 CB -0.137 -REMARK 500 LYS A 11 CB LYS A 11 CG -0.196 -REMARK 500 LYS A 11 CG LYS A 11 CD -0.206 -REMARK 500 LYS A 11 CD LYS A 11 CE 0.454 -REMARK 500 ALA A 12 N ALA A 12 CA -0.133 -REMARK 500 ALA A 12 C ALA A 12 O 0.225 -REMARK 500 ALA A 13 CA ALA A 13 C 0.201 -REMARK 500 TRP A 14 CA TRP A 14 CB 0.291 -REMARK 500 TRP A 14 CB TRP A 14 CG -0.274 -REMARK 500 TRP A 14 CG TRP A 14 CD1 0.306 -REMARK 500 TRP A 14 CD1 TRP A 14 NE1 0.158 -REMARK 500 TRP A 14 NE1 TRP A 14 CE2 -0.234 -REMARK 500 TRP A 14 CE2 TRP A 14 CZ2 -0.243 -REMARK 500 TRP A 14 CE2 TRP A 14 CD2 0.221 -REMARK 500 TRP A 14 CH2 TRP A 14 CZ2 -0.217 -REMARK 500 GLY A 15 CA GLY A 15 C 0.182 -REMARK 500 GLY A 15 C GLY A 15 O 0.437 -REMARK 500 LYS A 16 CB LYS A 16 CG 0.164 -REMARK 500 LYS A 16 CG LYS A 16 CD 0.488 -REMARK 500 LYS A 16 CD LYS A 16 CE 0.410 -REMARK 500 LYS A 16 C LYS A 16 O -0.149 -REMARK 500 GLY A 15 C LYS A 16 N -0.418 -REMARK 500 VAL A 17 N VAL A 17 CA -0.191 -REMARK 500 VAL A 17 CA VAL A 17 CB -0.168 -REMARK 500 VAL A 17 CA VAL A 17 C 0.432 -REMARK 500 VAL A 17 C VAL A 17 O -0.483 -REMARK 500 -REMARK 500 THIS ENTRY HAS 1277 BOND DEVIATIONS. -REMARK 500 -REMARK 500 REMARK: NULL -REMARK 500 -REMARK 500 GEOMETRY AND STEREOCHEMISTRY -REMARK 500 SUBTOPIC: COVALENT BOND ANGLES -REMARK 500 -REMARK 500 THE STEREOCHEMICAL PARAMETERS OF THE FOLLOWING RESIDUES -REMARK 500 HAVE VALUES WHICH DEVIATE FROM EXPECTED VALUES BY MORE -REMARK 500 THAN 6*RMSD (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN -REMARK 500 IDENTIFIER; SSEQ=SEQUENCE NUMBER; I=INSERTION CODE). -REMARK 500 -REMARK 500 STANDARD TABLE: -REMARK 500 FORMAT: (10X,I3,1X,A3,1X,A1,I4,A1,3(1X,A4,2X),12X,F5.1) -REMARK 500 -REMARK 500 EXPECTED VALUES PROTEIN: ENGH AND HUBER, 1999 -REMARK 500 EXPECTED VALUES NUCLEIC ACID: CLOWNEY ET AL 1996 -REMARK 500 -REMARK 500 M RES CSSEQI ATM1 ATM2 ATM3 -REMARK 500 VAL A 1 CG1 - CB - CG2 ANGL. DEV. = 27.5 DEGREES -REMARK 500 VAL A 1 CA - CB - CG2 ANGL. DEV. = -25.9 DEGREES -REMARK 500 LEU A 2 N - CA - CB ANGL. DEV. = -17.9 DEGREES -REMARK 500 LEU A 2 CB - CG - CD1 ANGL. DEV. = 13.0 DEGREES -REMARK 500 LEU A 2 CA - C - O ANGL. DEV. = -21.8 DEGREES -REMARK 500 VAL A 1 CA - C - N ANGL. DEV. = -13.3 DEGREES -REMARK 500 VAL A 1 O - C - N ANGL. DEV. = 12.7 DEGREES -REMARK 500 LEU A 2 C - N - CA ANGL. DEV. = -20.6 DEGREES -REMARK 500 SER A 3 N - CA - CB ANGL. DEV. = -9.7 DEGREES -REMARK 500 SER A 3 CA - C - O ANGL. DEV. = 15.9 DEGREES -REMARK 500 LEU A 2 O - C - N ANGL. DEV. = 30.2 DEGREES -REMARK 500 PRO A 4 CB - CA - C ANGL. DEV. = -30.7 DEGREES -REMARK 500 PRO A 4 CA - CB - CG ANGL. DEV. = -14.9 DEGREES -REMARK 500 PRO A 4 N - CD - CG ANGL. DEV. = -12.4 DEGREES -REMARK 500 SER A 3 O - C - N ANGL. DEV. = -14.6 DEGREES -REMARK 500 PRO A 4 C - N - CA ANGL. DEV. = -14.1 DEGREES -REMARK 500 ALA A 5 CB - CA - C ANGL. DEV. = -10.8 DEGREES -REMARK 500 PRO A 4 O - C - N ANGL. DEV. = -9.9 DEGREES -REMARK 500 ASP A 6 CB - CG - OD1 ANGL. DEV. = 6.5 DEGREES -REMARK 500 ASP A 6 CB - CG - OD2 ANGL. DEV. = -8.8 DEGREES -REMARK 500 LYS A 7 N - CA - CB ANGL. DEV. = -13.5 DEGREES -REMARK 500 LYS A 7 CD - CE - NZ ANGL. DEV. = -27.4 DEGREES -REMARK 500 LYS A 7 N - CA - C ANGL. DEV. = 22.1 DEGREES -REMARK 500 ASP A 6 O - C - N ANGL. DEV. = 14.8 DEGREES -REMARK 500 LYS A 7 C - N - CA ANGL. DEV. = -20.2 DEGREES -REMARK 500 THR A 8 CA - CB - CG2 ANGL. DEV. = -10.7 DEGREES -REMARK 500 THR A 8 CA - C - O ANGL. DEV. = 21.3 DEGREES -REMARK 500 LYS A 7 CA - C - N ANGL. DEV. = -20.1 DEGREES -REMARK 500 THR A 8 C - N - CA ANGL. DEV. = -15.7 DEGREES -REMARK 500 VAL A 10 O - C - N ANGL. DEV. = 11.4 DEGREES -REMARK 500 ALA A 12 CB - CA - C ANGL. DEV. = -29.5 DEGREES -REMARK 500 ALA A 12 N - CA - CB ANGL. DEV. = -14.5 DEGREES -REMARK 500 ALA A 12 C - N - CA ANGL. DEV. = -22.9 DEGREES -REMARK 500 ALA A 12 O - C - N ANGL. DEV. = -25.9 DEGREES -REMARK 500 TRP A 14 CA - CB - CG ANGL. DEV. = -22.4 DEGREES -REMARK 500 TRP A 14 CG - CD1 - NE1 ANGL. DEV. = -13.5 DEGREES -REMARK 500 TRP A 14 CD1 - NE1 - CE2 ANGL. DEV. = 19.8 DEGREES -REMARK 500 TRP A 14 NE1 - CE2 - CZ2 ANGL. DEV. = 11.2 DEGREES -REMARK 500 TRP A 14 CH2 - CZ2 - CE2 ANGL. DEV. = 13.2 DEGREES -REMARK 500 ALA A 13 O - C - N ANGL. DEV. = 13.6 DEGREES -REMARK 500 GLY A 15 N - CA - C ANGL. DEV. = -24.3 DEGREES -REMARK 500 GLY A 15 CA - C - O ANGL. DEV. = -21.6 DEGREES -REMARK 500 GLY A 15 C - N - CA ANGL. DEV. = -19.0 DEGREES -REMARK 500 LYS A 16 N - CA - CB ANGL. DEV. = 14.8 DEGREES -REMARK 500 LYS A 16 CG - CD - CE ANGL. DEV. = -48.6 DEGREES -REMARK 500 LYS A 16 CD - CE - NZ ANGL. DEV. = 17.9 DEGREES -REMARK 500 GLY A 15 CA - C - N ANGL. DEV. = 25.6 DEGREES -REMARK 500 GLY A 15 O - C - N ANGL. DEV. = -10.0 DEGREES -REMARK 500 LYS A 16 C - N - CA ANGL. DEV. = 15.1 DEGREES -REMARK 500 VAL A 17 N - CA - CB ANGL. DEV. = 15.3 DEGREES -REMARK 500 -REMARK 500 THIS ENTRY HAS 1473 ANGLE DEVIATIONS. -REMARK 500 -REMARK 500 REMARK: NULL -REMARK 500 -REMARK 500 GEOMETRY AND STEREOCHEMISTRY -REMARK 500 SUBTOPIC: TORSION ANGLES -REMARK 500 -REMARK 500 TORSION ANGLES OUTSIDE THE EXPECTED RAMACHANDRAN REGIONS: -REMARK 500 (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN IDENTIFIER; -REMARK 500 SSEQ=SEQUENCE NUMBER; I=INSERTION CODE). -REMARK 500 -REMARK 500 STANDARD TABLE: -REMARK 500 FORMAT:(10X,I3,1X,A3,1X,A1,I4,A1,4X,F7.2,3X,F7.2) -REMARK 500 -REMARK 500 EXPECTED VALUES: GJ KLEYWEGT AND TA JONES (1996). PHI/PSI- -REMARK 500 CHOLOGY: RAMACHANDRAN REVISITED. STRUCTURE 4, 1395 - 1400 -REMARK 500 -REMARK 500 M RES CSSEQI PSI PHI -REMARK 500 SER A 3 -176.01 -60.80 -REMARK 500 LYS A 16 -55.41 -1.55 -REMARK 500 ALA A 21 -76.55 -47.40 -REMARK 500 LEU A 48 40.81 -103.90 -REMARK 500 SER A 52 150.87 -47.80 -REMARK 500 HIS A 122 -70.12 -41.02 -REMARK 500 THR B 4 -176.32 -55.07 -REMARK 500 GLU B 7 -71.39 -64.26 -REMARK 500 PHE B 45 -9.16 -52.07 -REMARK 500 ASN B 80 59.72 -142.35 -REMARK 500 TYR B 145 130.62 -35.71 -REMARK 500 SER C 3 172.94 -57.29 -REMARK 500 VAL C 17 -70.34 -65.44 -REMARK 500 LEU C 48 32.06 -92.63 -REMARK 500 ASP C 75 72.45 -151.27 -REMARK 500 LYS C 90 -77.18 -122.52 -REMARK 500 LEU C 113 71.25 -107.78 -REMARK 500 LEU D 3 -163.80 -100.24 -REMARK 500 ASN D 19 94.43 -63.05 -REMARK 500 GLN D 39 0.49 -67.48 -REMARK 500 SER D 72 -71.73 -40.75 -REMARK 500 ASP D 73 -43.09 -22.67 -REMARK 500 ALA D 76 7.73 -63.28 -REMARK 500 HIS D 77 62.58 -172.71 -REMARK 500 LEU D 78 -50.86 -25.69 -REMARK 500 ASN D 80 85.05 -167.04 -REMARK 500 HIS D 97 35.26 76.08 -REMARK 500 -REMARK 500 REMARK: NULL -REMARK 500 -REMARK 500 GEOMETRY AND STEREOCHEMISTRY -REMARK 500 SUBTOPIC: NON-CIS, NON-TRANS -REMARK 500 -REMARK 500 THE FOLLOWING PEPTIDE BONDS DEVIATE SIGNIFICANTLY FROM BOTH -REMARK 500 CIS AND TRANS CONFORMATION. CIS BONDS, IF ANY, ARE LISTED -REMARK 500 ON CISPEP RECORDS. TRANS IS DEFINED AS 180 +/- 30 AND -REMARK 500 CIS IS DEFINED AS 0 +/- 30 DEGREES. -REMARK 500 MODEL OMEGA -REMARK 500 GLY A 18 ALA A 19 -145.49 -REMARK 500 SER B 49 THR B 50 113.74 -REMARK 500 LEU D 3 THR D 4 148.65 -REMARK 500 VAL D 18 ASN D 19 148.41 -REMARK 500 LEU D 48 SER D 49 -144.37 -REMARK 500 SER D 49 THR D 50 143.57 -REMARK 500 -REMARK 500 REMARK: NULL -REMARK 500 -REMARK 500 GEOMETRY AND STEREOCHEMISTRY -REMARK 500 SUBTOPIC: PLANAR GROUPS -REMARK 500 -REMARK 500 PLANAR GROUPS IN THE FOLLOWING RESIDUES HAVE A TOTAL -REMARK 500 RMS DISTANCE OF ALL ATOMS FROM THE BEST-FIT PLANE -REMARK 500 BY MORE THAN AN EXPECTED VALUE OF 6*RMSD, WITH AN -REMARK 500 RMSD 0.02 ANGSTROMS, OR AT LEAST ONE ATOM HAS -REMARK 500 AN RMSD GREATER THAN THIS VALUE -REMARK 500 (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN IDENTIFIER; -REMARK 500 SSEQ=SEQUENCE NUMBER; I=INSERTION CODE). -REMARK 500 -REMARK 500 M RES CSSEQI RMS TYPE -REMARK 500 HIS A 20 0.17 SIDE_CHAIN -REMARK 500 GLU A 23 0.25 SIDE_CHAIN -REMARK 500 TYR A 24 0.10 SIDE_CHAIN -REMARK 500 PHE A 36 0.09 SIDE_CHAIN -REMARK 500 HIS A 45 0.11 SIDE_CHAIN -REMARK 500 HIS A 50 0.20 SIDE_CHAIN -REMARK 500 GLN A 54 0.10 SIDE_CHAIN -REMARK 500 ASP A 64 0.14 SIDE_CHAIN -REMARK 500 HIS A 72 0.24 SIDE_CHAIN -REMARK 500 ASN A 78 0.08 SIDE_CHAIN -REMARK 500 ASP A 85 0.09 SIDE_CHAIN -REMARK 500 ARG A 92 0.08 SIDE_CHAIN -REMARK 500 ASP A 126 0.10 SIDE_CHAIN -REMARK 500 ARG A 141 0.08 SIDE_CHAIN -REMARK 500 HIS B 2 0.16 SIDE_CHAIN -REMARK 500 GLU B 6 0.16 SIDE_CHAIN -REMARK 500 ASN B 19 0.08 SIDE_CHAIN -REMARK 500 ASP B 21 0.15 SIDE_CHAIN -REMARK 500 GLU B 22 0.51 SIDE_CHAIN -REMARK 500 GLU B 26 0.38 SIDE_CHAIN -REMARK 500 ASP B 47 0.14 SIDE_CHAIN -REMARK 500 ASP B 52 0.19 SIDE_CHAIN -REMARK 500 HIS B 63 0.11 SIDE_CHAIN -REMARK 500 ASP B 79 0.11 SIDE_CHAIN -REMARK 500 ASN B 80 0.20 SIDE_CHAIN -REMARK 500 GLU B 90 0.15 SIDE_CHAIN -REMARK 500 ARG B 104 0.39 SIDE_CHAIN -REMARK 500 HIS B 117 0.22 SIDE_CHAIN -REMARK 500 PHE B 118 0.13 SIDE_CHAIN -REMARK 500 GLU B 121 0.26 SIDE_CHAIN -REMARK 500 HIS B 143 0.10 SIDE_CHAIN -REMARK 500 HIS B 146 0.31 SIDE_CHAIN -REMARK 500 ASN C 9 0.08 SIDE_CHAIN -REMARK 500 HIS C 20 0.14 SIDE_CHAIN -REMARK 500 GLU C 23 0.30 SIDE_CHAIN -REMARK 500 HIS C 45 0.10 SIDE_CHAIN -REMARK 500 PHE C 46 0.10 SIDE_CHAIN -REMARK 500 ASP C 47 0.15 SIDE_CHAIN -REMARK 500 ASP C 64 0.08 SIDE_CHAIN -REMARK 500 ASP C 75 0.07 SIDE_CHAIN -REMARK 500 ASN C 78 0.11 SIDE_CHAIN -REMARK 500 ARG C 92 0.20 SIDE_CHAIN -REMARK 500 GLU C 116 0.09 SIDE_CHAIN -REMARK 500 ASP C 126 0.11 SIDE_CHAIN -REMARK 500 ARG C 141 0.08 SIDE_CHAIN -REMARK 500 HIS D 2 0.10 SIDE_CHAIN -REMARK 500 GLU D 6 0.17 SIDE_CHAIN -REMARK 500 GLU D 7 0.10 SIDE_CHAIN -REMARK 500 ASN D 19 0.38 SIDE_CHAIN -REMARK 500 ASP D 21 0.18 SIDE_CHAIN -REMARK 500 GLU D 22 0.21 SIDE_CHAIN -REMARK 500 GLU D 26 0.54 SIDE_CHAIN -REMARK 500 ARG D 40 0.12 SIDE_CHAIN -REMARK 500 GLU D 43 0.15 SIDE_CHAIN -REMARK 500 ASP D 52 0.33 SIDE_CHAIN -REMARK 500 HIS D 63 0.18 SIDE_CHAIN -REMARK 500 HIS D 77 0.14 SIDE_CHAIN -REMARK 500 ASP D 79 0.33 SIDE_CHAIN -REMARK 500 GLU D 90 0.34 SIDE_CHAIN -REMARK 500 HIS D 92 0.08 SIDE_CHAIN -REMARK 500 ASP D 94 0.08 SIDE_CHAIN -REMARK 500 GLU D 101 0.10 SIDE_CHAIN -REMARK 500 ARG D 104 0.29 SIDE_CHAIN -REMARK 500 ASN D 108 0.10 SIDE_CHAIN -REMARK 500 HIS D 117 0.08 SIDE_CHAIN -REMARK 500 PHE D 118 0.10 SIDE_CHAIN -REMARK 500 GLU D 121 0.32 SIDE_CHAIN -REMARK 500 GLN D 127 0.07 SIDE_CHAIN -REMARK 500 ASN D 139 0.21 SIDE_CHAIN -REMARK 500 HIS D 143 0.09 SIDE_CHAIN -REMARK 500 HIS D 146 0.10 SIDE_CHAIN -REMARK 500 -REMARK 500 REMARK: NULL -REMARK 500 -REMARK 500 GEOMETRY AND STEREOCHEMISTRY -REMARK 500 SUBTOPIC: MAIN CHAIN PLANARITY -REMARK 500 -REMARK 500 THE FOLLOWING RESIDUES HAVE A PSEUDO PLANARITY -REMARK 500 TORSION, C(I) - CA(I) - N(I+1) - O(I), GREATER -REMARK 500 10.0 DEGREES. (M=MODEL NUMBER; RES=RESIDUE NAME; -REMARK 500 C=CHAIN IDENTIFIER; SSEQ=SEQUENCE NUMBER; -REMARK 500 I=INSERTION CODE). -REMARK 500 -REMARK 500 M RES CSSEQI ANGLE -REMARK 500 VAL A 1 -12.66 -REMARK 500 SER A 3 -13.96 -REMARK 500 PRO A 4 -17.06 -REMARK 500 ASN A 9 10.02 -REMARK 500 LYS A 11 -14.58 -REMARK 500 ALA A 12 -29.94 -REMARK 500 GLY A 15 25.08 -REMARK 500 ALA A 19 -16.87 -REMARK 500 ALA A 21 26.61 -REMARK 500 GLY A 22 15.67 -REMARK 500 THR A 41 10.65 -REMARK 500 PHE A 46 -10.97 -REMARK 500 LEU A 48 -25.01 -REMARK 500 SER A 52 -10.23 -REMARK 500 LYS A 56 14.67 -REMARK 500 GLY A 59 -10.71 -REMARK 500 LYS A 61 -11.09 -REMARK 500 ALA A 63 -17.65 -REMARK 500 ASP A 74 18.25 -REMARK 500 ASP A 75 -17.02 -REMARK 500 MET A 76 -10.23 -REMARK 500 ASN A 78 -10.93 -REMARK 500 SER A 81 -10.91 -REMARK 500 ALA A 82 11.29 -REMARK 500 LEU A 83 -10.53 -REMARK 500 ASP A 85 -12.19 -REMARK 500 ALA A 88 11.87 -REMARK 500 LYS A 90 -14.75 -REMARK 500 ASN A 97 -10.48 -REMARK 500 LYS A 99 -15.40 -REMARK 500 LEU A 101 -10.99 -REMARK 500 LEU A 106 -10.02 -REMARK 500 ALA A 111 10.63 -REMARK 500 PRO A 114 -12.36 -REMARK 500 THR A 118 -18.84 -REMARK 500 HIS A 122 17.52 -REMARK 500 VAL B 1 34.93 -REMARK 500 LEU B 3 14.19 -REMARK 500 THR B 4 -16.98 -REMARK 500 GLU B 7 12.85 -REMARK 500 LEU B 14 12.16 -REMARK 500 ASP B 21 -10.62 -REMARK 500 THR B 38 14.87 -REMARK 500 GLU B 43 -24.15 -REMARK 500 SER B 44 54.71 -REMARK 500 ASP B 47 16.36 -REMARK 500 SER B 49 -74.55 -REMARK 500 GLY B 56 -31.39 -REMARK 500 LYS B 59 -12.59 -REMARK 500 VAL B 60 10.98 -REMARK 500 LYS B 61 -15.00 -REMARK 500 ALA B 62 10.49 -REMARK 500 HIS B 63 -10.22 -REMARK 500 LEU B 78 -25.59 -REMARK 500 ASP B 79 22.50 -REMARK 500 ASN B 80 -11.76 -REMARK 500 LEU B 81 11.29 -REMARK 500 THR B 84 10.62 -REMARK 500 GLU B 90 -10.55 -REMARK 500 PRO B 100 -11.02 -REMARK 500 GLU B 101 -10.37 -REMARK 500 LEU B 114 12.32 -REMARK 500 THR B 123 -10.84 -REMARK 500 VAL B 126 -11.54 -REMARK 500 GLN B 131 -10.69 -REMARK 500 ASN B 139 -17.46 -REMARK 500 LEU B 141 16.07 -REMARK 500 SER C 3 -11.99 -REMARK 500 ALA C 5 12.77 -REMARK 500 TRP C 14 -12.14 -REMARK 500 VAL C 17 12.38 -REMARK 500 GLY C 18 -13.67 -REMARK 500 ALA C 21 -14.14 -REMARK 500 GLY C 25 -12.75 -REMARK 500 PRO C 44 -13.45 -REMARK 500 HIS C 45 12.45 -REMARK 500 PHE C 46 -11.87 -REMARK 500 ASP C 47 19.24 -REMARK 500 LEU C 48 -13.66 -REMARK 500 ALA C 69 11.81 -REMARK 500 ALA C 71 22.14 -REMARK 500 HIS C 72 13.20 -REMARK 500 ASP C 74 12.29 -REMARK 500 ASP C 75 -23.66 -REMARK 500 LEU C 80 -11.12 -REMARK 500 LEU C 83 -10.01 -REMARK 500 ALA C 88 13.88 -REMARK 500 PRO C 95 -13.42 -REMARK 500 LEU C 109 16.42 -REMARK 500 ALA C 110 13.99 -REMARK 500 ALA C 111 15.47 -REMARK 500 HIS C 112 15.18 -REMARK 500 LEU C 113 -20.94 -REMARK 500 PRO C 114 -32.91 -REMARK 500 GLU C 116 -12.30 -REMARK 500 PRO C 119 11.39 -REMARK 500 LEU C 125 -10.17 -REMARK 500 VAL C 135 14.71 -REMARK 500 SER C 138 10.64 -REMARK 500 VAL D 1 -18.79 -REMARK 500 HIS D 2 -12.81 -REMARK 500 LEU D 3 -69.40 -REMARK 500 PRO D 5 -10.95 -REMARK 500 LYS D 8 -16.56 -REMARK 500 LYS D 17 10.52 -REMARK 500 ASP D 21 -17.88 -REMARK 500 GLU D 22 23.39 -REMARK 500 VAL D 33 11.00 -REMARK 500 VAL D 34 11.48 -REMARK 500 PHE D 42 10.18 -REMARK 500 GLY D 46 -18.80 -REMARK 500 LEU D 48 13.68 -REMARK 500 SER D 49 -21.45 -REMARK 500 ASP D 52 12.37 -REMARK 500 GLY D 56 17.16 -REMARK 500 VAL D 60 10.39 -REMARK 500 GLY D 64 -10.31 -REMARK 500 LYS D 66 16.91 -REMARK 500 ASP D 73 -11.34 -REMARK 500 LEU D 75 15.44 -REMARK 500 ALA D 76 -28.12 -REMARK 500 ASP D 79 -15.13 -REMARK 500 ASN D 80 -17.79 -REMARK 500 GLY D 83 -24.24 -REMARK 500 THR D 84 23.01 -REMARK 500 HIS D 92 -12.19 -REMARK 500 LEU D 96 11.44 -REMARK 500 HIS D 117 12.17 -REMARK 500 LYS D 120 -25.33 -REMARK 500 VAL D 137 -19.82 -REMARK 500 LYS D 144 17.08 -REMARK 500 -REMARK 500 REMARK: NULL -REMARK 500 -REMARK 500 GEOMETRY AND STEREOCHEMISTRY -REMARK 500 SUBTOPIC: CHIRAL CENTERS -REMARK 500 -REMARK 500 UNEXPECTED CONFIGURATION OF THE FOLLOWING CHIRAL -REMARK 500 CENTER(S) USING IMPROPER CA--C--CB--N CHIRALITY -REMARK 500 M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN -REMARK 500 IDENTIFIER; SSEQ=SEQUENCE NUMBER; I=INSERTION CODE -REMARK 500 -REMARK 500 STANDARD TABLE: -REMARK 500 FORMAT: (11X,I3,1X,A3,1X,A1,I4,A1,6X,F5.1,6X,A1,10X,A1,3X,A16) -REMARK 500 -REMARK 500 M RES CSSEQI IMPROPER EXPECTED FOUND DETAILS -REMARK 500 SER A 3 47.5 L L OUTSIDE RANGE -REMARK 500 LYS A 7 22.9 L L OUTSIDE RANGE -REMARK 500 LYS A 16 14.6 L L OUTSIDE RANGE -REMARK 500 VAL A 17 18.2 L L OUTSIDE RANGE -REMARK 500 ALA A 26 18.6 L L OUTSIDE RANGE -REMARK 500 PHE A 33 25.0 L L OUTSIDE RANGE -REMARK 500 SER A 49 47.6 L L OUTSIDE RANGE -REMARK 500 LYS A 56 14.8 L L OUTSIDE RANGE -REMARK 500 LYS A 60 22.7 L L OUTSIDE RANGE -REMARK 500 ALA A 71 48.3 L L OUTSIDE RANGE -REMARK 500 PRO A 77 16.7 L L OUTSIDE RANGE -REMARK 500 SER A 84 23.0 L L OUTSIDE RANGE -REMARK 500 HIS A 89 23.9 L L OUTSIDE RANGE -REMARK 500 LYS A 90 17.4 L L OUTSIDE RANGE -REMARK 500 HIS A 103 22.3 L L OUTSIDE RANGE -REMARK 500 ALA A 111 21.3 L L OUTSIDE RANGE -REMARK 500 PRO A 114 49.5 L L OUTSIDE RANGE -REMARK 500 PHE A 117 21.9 L L OUTSIDE RANGE -REMARK 500 ALA A 120 20.3 L L OUTSIDE RANGE -REMARK 500 HIS A 122 46.2 L L OUTSIDE RANGE -REMARK 500 TYR A 140 23.5 L L OUTSIDE RANGE -REMARK 500 PRO B 5 18.3 L L OUTSIDE RANGE -REMARK 500 SER B 9 13.0 L L OUTSIDE RANGE -REMARK 500 ALA B 13 23.4 L L OUTSIDE RANGE -REMARK 500 LEU B 28 16.4 L L OUTSIDE RANGE -REMARK 500 THR B 38 24.4 L L OUTSIDE RANGE -REMARK 500 GLU B 43 46.6 L L OUTSIDE RANGE -REMARK 500 ASP B 47 45.8 L L OUTSIDE RANGE -REMARK 500 SER B 49 53.4 L L OUTSIDE RANGE -REMARK 500 VAL B 60 24.9 L L OUTSIDE RANGE -REMARK 500 LYS B 65 20.6 L L OUTSIDE RANGE -REMARK 500 HIS B 77 47.6 L L OUTSIDE RANGE -REMARK 500 ASP B 79 51.3 L L OUTSIDE RANGE -REMARK 500 ASN B 80 45.3 L L OUTSIDE RANGE -REMARK 500 LYS B 82 47.0 L L OUTSIDE RANGE -REMARK 500 THR B 84 23.8 L L OUTSIDE RANGE -REMARK 500 GLU B 90 11.1 L L OUTSIDE RANGE -REMARK 500 LEU B 96 22.2 L L OUTSIDE RANGE -REMARK 500 ASP B 99 47.0 L L OUTSIDE RANGE -REMARK 500 HIS B 117 22.8 L L OUTSIDE RANGE -REMARK 500 GLN B 127 23.5 L L OUTSIDE RANGE -REMARK 500 VAL B 134 20.6 L L OUTSIDE RANGE -REMARK 500 TYR B 145 13.6 L L OUTSIDE RANGE -REMARK 500 VAL C 1 85.9 L L OUTSIDE RANGE -REMARK 500 ALA C 5 23.1 L L OUTSIDE RANGE -REMARK 500 ALA C 12 13.9 L L OUTSIDE RANGE -REMARK 500 LYS C 16 18.8 L L OUTSIDE RANGE -REMARK 500 VAL C 17 23.9 L L OUTSIDE RANGE -REMARK 500 TYR C 24 23.1 L L OUTSIDE RANGE -REMARK 500 ALA C 26 24.5 L L OUTSIDE RANGE -REMARK 500 PRO C 44 49.8 L L OUTSIDE RANGE -REMARK 500 ALA C 53 18.8 L L OUTSIDE RANGE -REMARK 500 HIS C 72 10.8 L L OUTSIDE RANGE -REMARK 500 VAL C 73 21.3 L L OUTSIDE RANGE -REMARK 500 ASP C 75 50.5 L L OUTSIDE RANGE -REMARK 500 PRO C 77 23.1 L L OUTSIDE RANGE -REMARK 500 ASN C 78 7.6 L D EXPECTING SP3 -REMARK 500 SER C 84 22.3 L L OUTSIDE RANGE -REMARK 500 ALA C 88 23.4 L L OUTSIDE RANGE -REMARK 500 HIS C 89 24.6 L L OUTSIDE RANGE -REMARK 500 LYS C 90 16.1 L L OUTSIDE RANGE -REMARK 500 LYS C 99 23.5 L L OUTSIDE RANGE -REMARK 500 VAL C 107 23.4 L L OUTSIDE RANGE -REMARK 500 PRO C 114 58.4 L L OUTSIDE RANGE -REMARK 500 ALA C 115 17.3 L L OUTSIDE RANGE -REMARK 500 ARG C 141 24.7 L L OUTSIDE RANGE -REMARK 500 HIS D 2 0.2 L D EXPECTING SP3 -REMARK 500 THR D 4 19.6 L L OUTSIDE RANGE -REMARK 500 ALA D 10 48.1 L L OUTSIDE RANGE -REMARK 500 ALA D 13 16.1 L L OUTSIDE RANGE -REMARK 500 LYS D 17 21.9 L L OUTSIDE RANGE -REMARK 500 ASN D 19 20.8 L L OUTSIDE RANGE -REMARK 500 VAL D 20 14.8 L L OUTSIDE RANGE -REMARK 500 ASP D 21 18.2 L L OUTSIDE RANGE -REMARK 500 LEU D 31 23.7 L L OUTSIDE RANGE -REMARK 500 ASP D 47 70.5 L L OUTSIDE RANGE -REMARK 500 ASP D 52 59.4 L L OUTSIDE RANGE -REMARK 500 ALA D 53 24.1 L L OUTSIDE RANGE -REMARK 500 LYS D 59 23.2 L L OUTSIDE RANGE -REMARK 500 SER D 72 4.3 L D EXPECTING SP3 -REMARK 500 ASP D 73 7.4 L D EXPECTING SP3 -REMARK 500 ALA D 76 83.0 L L OUTSIDE RANGE -REMARK 500 LEU D 78 -0.1 L D EXPECTING SP3 -REMARK 500 HIS D 92 48.8 L L OUTSIDE RANGE -REMARK 500 ASP D 94 47.8 L L OUTSIDE RANGE -REMARK 500 PRO D 100 22.6 L L OUTSIDE RANGE -REMARK 500 CYS D 112 22.5 L L OUTSIDE RANGE -REMARK 500 PHE D 122 45.5 L L OUTSIDE RANGE -REMARK 500 GLN D 131 24.7 L L OUTSIDE RANGE -REMARK 500 VAL D 137 22.8 L L OUTSIDE RANGE -REMARK 500 HIS D 143 24.9 L L OUTSIDE RANGE -REMARK 500 LYS D 144 3.0 L D EXPECTING SP3 -REMARK 500 TYR D 145 23.9 L L OUTSIDE RANGE -REMARK 500 HIS D 146 48.0 L L OUTSIDE RANGE -REMARK 500 -REMARK 500 REMARK: NULL -REMARK 610 -REMARK 610 MISSING HETEROATOM -REMARK 610 THE FOLLOWING RESIDUES HAVE MISSING ATOMS (M=MODEL NUMBER; -REMARK 610 RES=RESIDUE NAME; C=CHAIN IDENTIFIER; SSEQ=SEQUENCE NUMBER; -REMARK 610 I=INSERTION CODE): -REMARK 610 M RES C SSEQI -REMARK 610 PO4 D 147 -REMARK 610 PO4 B 147 -REMARK 800 -REMARK 800 SITE -REMARK 800 SITE_IDENTIFIER: AC1 -REMARK 800 EVIDENCE_CODE: SOFTWARE -REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE PO4 D 147 -REMARK 800 SITE_IDENTIFIER: AC2 -REMARK 800 EVIDENCE_CODE: SOFTWARE -REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE PO4 B 147 -REMARK 800 SITE_IDENTIFIER: AC3 -REMARK 800 EVIDENCE_CODE: SOFTWARE -REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE HEM A 142 -REMARK 800 SITE_IDENTIFIER: AC4 -REMARK 800 EVIDENCE_CODE: SOFTWARE -REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE HEM B 148 -REMARK 800 SITE_IDENTIFIER: AC5 -REMARK 800 EVIDENCE_CODE: SOFTWARE -REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE HEM C 142 -REMARK 800 SITE_IDENTIFIER: AC6 -REMARK 800 EVIDENCE_CODE: SOFTWARE -REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE HEM D 148 -REMARK 900 -REMARK 900 RELATED ENTRIES -REMARK 900 RELATED ID: 2HHB RELATED DB: PDB -REMARK 900 REFINED BY THE METHOD OF JACK AND LEVITT. THIS ENTRY -REMARK 900 PRESENTS THE BEST ESTIMATE OF THE COORDINATES. -REMARK 900 RELATED ID: 3HHB RELATED DB: PDB -REMARK 900 SYMMETRY AVERAGED ABOUT THE (NON-CRYSTALLOGRAPHIC) -REMARK 900 MOLECULAR AXIS AND THEN RE-REGULARIZED BY THE ENERGY -REMARK 900 REFINEMENT METHOD OF LEVITT. THIS ENTRY PRESENTS -REMARK 900 COORDINATES THAT ARE ADEQUATE FOR MOST PURPOSES, SUCH AS -REMARK 900 COMPARISON WITH OTHER STRUCTURES. -REMARK 900 RELATED ID: 1GLI RELATED DB: PDB -DBREF 4HHB A 1 141 UNP P69905 HBA_HUMAN 1 141 -DBREF 4HHB B 1 146 UNP P68871 HBB_HUMAN 1 146 -DBREF 4HHB C 1 141 UNP P69905 HBA_HUMAN 1 141 -DBREF 4HHB D 1 146 UNP P68871 HBB_HUMAN 1 146 -SEQRES 1 A 141 VAL LEU SER PRO ALA ASP LYS THR ASN VAL LYS ALA ALA -SEQRES 2 A 141 TRP GLY LYS VAL GLY ALA HIS ALA GLY GLU TYR GLY ALA -SEQRES 3 A 141 GLU ALA LEU GLU ARG MET PHE LEU SER PHE PRO THR THR -SEQRES 4 A 141 LYS THR TYR PHE PRO HIS PHE ASP LEU SER HIS GLY SER -SEQRES 5 A 141 ALA GLN VAL LYS GLY HIS GLY LYS LYS VAL ALA ASP ALA -SEQRES 6 A 141 LEU THR ASN ALA VAL ALA HIS VAL ASP ASP MET PRO ASN -SEQRES 7 A 141 ALA LEU SER ALA LEU SER ASP LEU HIS ALA HIS LYS LEU -SEQRES 8 A 141 ARG VAL ASP PRO VAL ASN PHE LYS LEU LEU SER HIS CYS -SEQRES 9 A 141 LEU LEU VAL THR LEU ALA ALA HIS LEU PRO ALA GLU PHE -SEQRES 10 A 141 THR PRO ALA VAL HIS ALA SER LEU ASP LYS PHE LEU ALA -SEQRES 11 A 141 SER VAL SER THR VAL LEU THR SER LYS TYR ARG -SEQRES 1 B 146 VAL HIS LEU THR PRO GLU GLU LYS SER ALA VAL THR ALA -SEQRES 2 B 146 LEU TRP GLY LYS VAL ASN VAL ASP GLU VAL GLY GLY GLU -SEQRES 3 B 146 ALA LEU GLY ARG LEU LEU VAL VAL TYR PRO TRP THR GLN -SEQRES 4 B 146 ARG PHE PHE GLU SER PHE GLY ASP LEU SER THR PRO ASP -SEQRES 5 B 146 ALA VAL MET GLY ASN PRO LYS VAL LYS ALA HIS GLY LYS -SEQRES 6 B 146 LYS VAL LEU GLY ALA PHE SER ASP GLY LEU ALA HIS LEU -SEQRES 7 B 146 ASP ASN LEU LYS GLY THR PHE ALA THR LEU SER GLU LEU -SEQRES 8 B 146 HIS CYS ASP LYS LEU HIS VAL ASP PRO GLU ASN PHE ARG -SEQRES 9 B 146 LEU LEU GLY ASN VAL LEU VAL CYS VAL LEU ALA HIS HIS -SEQRES 10 B 146 PHE GLY LYS GLU PHE THR PRO PRO VAL GLN ALA ALA TYR -SEQRES 11 B 146 GLN LYS VAL VAL ALA GLY VAL ALA ASN ALA LEU ALA HIS -SEQRES 12 B 146 LYS TYR HIS -SEQRES 1 C 141 VAL LEU SER PRO ALA ASP LYS THR ASN VAL LYS ALA ALA -SEQRES 2 C 141 TRP GLY LYS VAL GLY ALA HIS ALA GLY GLU TYR GLY ALA -SEQRES 3 C 141 GLU ALA LEU GLU ARG MET PHE LEU SER PHE PRO THR THR -SEQRES 4 C 141 LYS THR TYR PHE PRO HIS PHE ASP LEU SER HIS GLY SER -SEQRES 5 C 141 ALA GLN VAL LYS GLY HIS GLY LYS LYS VAL ALA ASP ALA -SEQRES 6 C 141 LEU THR ASN ALA VAL ALA HIS VAL ASP ASP MET PRO ASN -SEQRES 7 C 141 ALA LEU SER ALA LEU SER ASP LEU HIS ALA HIS LYS LEU -SEQRES 8 C 141 ARG VAL ASP PRO VAL ASN PHE LYS LEU LEU SER HIS CYS -SEQRES 9 C 141 LEU LEU VAL THR LEU ALA ALA HIS LEU PRO ALA GLU PHE -SEQRES 10 C 141 THR PRO ALA VAL HIS ALA SER LEU ASP LYS PHE LEU ALA -SEQRES 11 C 141 SER VAL SER THR VAL LEU THR SER LYS TYR ARG -SEQRES 1 D 146 VAL HIS LEU THR PRO GLU GLU LYS SER ALA VAL THR ALA -SEQRES 2 D 146 LEU TRP GLY LYS VAL ASN VAL ASP GLU VAL GLY GLY GLU -SEQRES 3 D 146 ALA LEU GLY ARG LEU LEU VAL VAL TYR PRO TRP THR GLN -SEQRES 4 D 146 ARG PHE PHE GLU SER PHE GLY ASP LEU SER THR PRO ASP -SEQRES 5 D 146 ALA VAL MET GLY ASN PRO LYS VAL LYS ALA HIS GLY LYS -SEQRES 6 D 146 LYS VAL LEU GLY ALA PHE SER ASP GLY LEU ALA HIS LEU -SEQRES 7 D 146 ASP ASN LEU LYS GLY THR PHE ALA THR LEU SER GLU LEU -SEQRES 8 D 146 HIS CYS ASP LYS LEU HIS VAL ASP PRO GLU ASN PHE ARG -SEQRES 9 D 146 LEU LEU GLY ASN VAL LEU VAL CYS VAL LEU ALA HIS HIS -SEQRES 10 D 146 PHE GLY LYS GLU PHE THR PRO PRO VAL GLN ALA ALA TYR -SEQRES 11 D 146 GLN LYS VAL VAL ALA GLY VAL ALA ASN ALA LEU ALA HIS -SEQRES 12 D 146 LYS TYR HIS -HET PO4 D 147 1 -HET PO4 B 147 1 -HET HEM A 142 43 -HET HEM B 148 43 -HET HEM C 142 43 -HET HEM D 148 43 -HETNAM PO4 PHOSPHATE ION -HETNAM HEM PROTOPORPHYRIN IX CONTAINING FE -HETSYN HEM HEME -FORMUL 5 PO4 2(O4 P 3-) -FORMUL 7 HEM 4(C34 H32 FE N4 O4) -FORMUL 11 HOH *221(H2 O) -HELIX 1 AA SER A 3 GLY A 18 1 16 -HELIX 2 AB HIS A 20 SER A 35 1 16 -HELIX 3 AC PHE A 36 TYR A 42 1 7 -HELIX 4 AD HIS A 50 GLY A 51 1DEGEN 2 RES HLX RETAIN HOMOL 2 -HELIX 5 AE SER A 52 ALA A 71 1 20 -HELIX 6 AF LEU A 80 ALA A 88 1 9 -HELIX 7 AG ASP A 94 HIS A 112 1 19 -HELIX 8 AH THR A 118 SER A 138 1 21 -HELIX 9 BA THR B 4 VAL B 18 1 15 -HELIX 10 BB ASN B 19 VAL B 34 1 16 -HELIX 11 BC TYR B 35 PHE B 41 1 7 -HELIX 12 BD THR B 50 GLY B 56 1 7 -HELIX 13 BE ASN B 57 ALA B 76 1 20 -HELIX 14 BF PHE B 85 CYS B 93 1 9 -HELIX 15 BG ASP B 99 HIS B 117 1 19 -HELIX 16 BH THR B 123 HIS B 143 1 21 -HELIX 17 CA SER C 3 GLY C 18 1 16 -HELIX 18 CB HIS C 20 SER C 35 1 16 -HELIX 19 CC PHE C 36 TYR C 42 1 7 -HELIX 20 CD HIS C 50 GLY C 51 1DEGEN 2 RES HLX RETAIN HOMOL 2 -HELIX 21 CE SER C 52 ALA C 71 1 20 -HELIX 22 CF LEU C 80 ALA C 88 1 9 -HELIX 23 CG ASP C 94 HIS C 112 1 19 -HELIX 24 CH THR C 118 SER C 138 1 21 -HELIX 25 DA THR D 4 VAL D 18 1 15 -HELIX 26 DB ASN D 19 VAL D 34 1 16 -HELIX 27 DC TYR D 35 PHE D 41 1 7 -HELIX 28 DD THR D 50 GLY D 56 1 7 -HELIX 29 DE ASN D 57 ALA D 76 1 20 -HELIX 30 DF PHE D 85 CYS D 93 1 9 -HELIX 31 DG ASP D 99 HIS D 117 1 19 -HELIX 32 DH THR D 123 HIS D 143 1 21 -LINK NE2 HIS A 87 FE HEM A 142 1555 1555 2.14 -LINK NE2 HIS B 92 FE HEM B 148 1555 1555 2.22 -LINK NE2 HIS C 87 FE HEM C 142 1555 1555 2.26 -LINK NE2 HIS D 92 FE HEM D 148 1555 1555 1.98 -SITE 1 AC1 1 VAL D 1 -SITE 1 AC2 1 HOH B 197 -SITE 1 AC3 16 TYR A 42 PHE A 43 HIS A 45 PHE A 46 -SITE 2 AC3 16 HIS A 58 LYS A 61 LEU A 86 HIS A 87 -SITE 3 AC3 16 LEU A 91 VAL A 93 ASN A 97 PHE A 98 -SITE 4 AC3 16 LEU A 101 LEU A 136 HOH A 144 HOH A 159 -SITE 1 AC4 13 ALA A 53 HOH A 145 PHE B 41 HIS B 63 -SITE 2 AC4 13 LYS B 66 VAL B 67 HIS B 92 LEU B 96 -SITE 3 AC4 13 ASN B 102 PHE B 103 LEU B 141 HOH B 175 -SITE 4 AC4 13 HOH B 193 -SITE 1 AC5 15 TYR C 42 PHE C 43 HIS C 45 HIS C 58 -SITE 2 AC5 15 LYS C 61 LEU C 83 LEU C 86 HIS C 87 -SITE 3 AC5 15 LEU C 91 VAL C 93 ASN C 97 PHE C 98 -SITE 4 AC5 15 LEU C 136 HOH C 149 HOH C 164 -SITE 1 AC6 7 HIS D 63 LYS D 66 VAL D 67 HIS D 92 -SITE 2 AC6 7 LEU D 96 ASN D 102 LEU D 141 -CRYST1 63.150 83.590 53.800 90.00 99.34 90.00 P 1 21 1 4 -ORIGX1 0.963457 0.136613 0.230424 16.61000 -ORIGX2 -0.158977 0.983924 0.081383 13.72000 -ORIGX3 -0.215598 -0.115048 0.969683 37.65000 -SCALE1 0.015462 0.002192 0.003698 0.26656 -SCALE2 -0.001902 0.011771 0.000974 0.16413 -SCALE3 -0.001062 -0.001721 0.018728 0.75059 -MTRIX1 1 -1.000000 0.000000 0.000000 0.00001 1 -MTRIX2 1 0.000000 1.000000 0.000000 0.00002 1 -MTRIX3 1 0.000000 0.000000 -1.000000 0.00002 1 -ATOM 1 N VAL A 1 6.204 16.869 4.854 1.00 49.05 N -ATOM 2 CA VAL A 1 6.913 17.759 4.607 1.00 43.14 C -ATOM 3 C VAL A 1 8.504 17.378 4.797 1.00 24.80 C -ATOM 4 O VAL A 1 8.805 17.011 5.943 1.00 37.68 O -ATOM 5 CB VAL A 1 6.369 19.044 5.810 1.00 72.12 C -ATOM 6 CG1 VAL A 1 7.009 20.127 5.418 1.00 61.79 C -ATOM 7 CG2 VAL A 1 5.246 18.533 5.681 1.00 80.12 C -ATOM 8 N LEU A 2 9.096 18.040 3.857 1.00 26.44 N -ATOM 9 CA LEU A 2 10.600 17.889 4.283 1.00 26.32 C -ATOM 10 C LEU A 2 11.265 19.184 5.297 1.00 32.96 C -ATOM 11 O LEU A 2 10.813 20.177 4.647 1.00 31.90 O -ATOM 12 CB LEU A 2 11.099 18.007 2.815 1.00 29.23 C -ATOM 13 CG LEU A 2 11.322 16.956 1.934 1.00 37.71 C -ATOM 14 CD1 LEU A 2 11.468 15.596 2.337 1.00 39.10 C -ATOM 15 CD2 LEU A 2 11.423 17.268 0.300 1.00 37.47 C -ATOM 16 N SER A 3 11.584 18.730 6.148 1.00 28.01 N -ATOM 17 CA SER A 3 12.263 19.871 7.087 1.00 26.03 C -ATOM 18 C SER A 3 13.304 20.329 6.300 1.00 25.99 C -ATOM 19 O SER A 3 14.085 19.818 5.364 1.00 25.98 O -ATOM 20 CB SER A 3 12.744 19.045 8.223 1.00 23.41 C -ATOM 21 OG SER A 3 13.781 18.286 8.179 1.00 30.00 O -ATOM 22 N PRO A 4 14.196 21.422 7.097 1.00 37.49 N -ATOM 23 CA PRO A 4 15.048 21.890 6.206 1.00 38.81 C -ATOM 24 C PRO A 4 16.464 21.282 6.288 1.00 25.63 C -ATOM 25 O PRO A 4 17.212 20.899 5.409 1.00 34.38 O -ATOM 26 CB PRO A 4 15.814 23.113 7.166 1.00 50.44 C -ATOM 27 CG PRO A 4 14.493 23.536 7.638 1.00 43.42 C -ATOM 28 CD PRO A 4 13.298 22.523 7.651 1.00 42.77 C -ATOM 29 N ALA A 5 16.399 20.279 7.524 1.00 24.33 N -ATOM 30 CA ALA A 5 17.552 19.622 7.588 1.00 24.06 C -ATOM 31 C ALA A 5 17.376 18.283 6.601 1.00 20.01 C -ATOM 32 O ALA A 5 18.422 17.849 6.010 1.00 24.46 O -ATOM 33 CB ALA A 5 17.454 18.830 9.164 1.00 28.15 C -ATOM 34 N ASP A 6 16.050 17.799 6.298 1.00 21.19 N -ATOM 35 CA ASP A 6 15.881 16.887 5.120 1.00 23.14 C -ATOM 36 C ASP A 6 16.573 17.497 3.915 1.00 15.75 C -ATOM 37 O ASP A 6 17.240 16.611 3.235 1.00 18.92 O -ATOM 38 CB ASP A 6 14.530 16.515 4.983 1.00 18.68 C -ATOM 39 CG ASP A 6 13.966 15.638 6.125 1.00 21.70 C -ATOM 40 OD1 ASP A 6 14.573 14.751 6.678 1.00 19.76 O -ATOM 41 OD2 ASP A 6 12.734 15.931 6.321 1.00 21.26 O -ATOM 42 N LYS A 7 16.082 18.800 3.719 1.00 15.62 N -ATOM 43 CA LYS A 7 16.897 19.255 2.400 1.00 26.74 C -ATOM 44 C LYS A 7 18.354 19.319 2.072 1.00 24.82 C -ATOM 45 O LYS A 7 18.858 18.855 1.145 1.00 21.36 O -ATOM 46 CB LYS A 7 16.022 20.503 2.054 1.00 28.73 C -ATOM 47 CG LYS A 7 14.518 20.443 2.287 1.00 34.11 C -ATOM 48 CD LYS A 7 13.833 21.967 2.124 1.00 46.50 C -ATOM 49 CE LYS A 7 12.524 21.830 2.733 1.00 40.75 C -ATOM 50 NZ LYS A 7 12.310 23.286 2.231 1.00 50.05 N -ATOM 51 N THR A 8 18.879 19.583 3.554 1.00 20.80 N -ATOM 52 CA THR A 8 20.359 19.452 3.495 1.00 23.21 C -ATOM 53 C THR A 8 21.000 18.322 3.125 1.00 17.85 C -ATOM 54 O THR A 8 21.907 17.957 2.500 1.00 20.04 O -ATOM 55 CB THR A 8 20.762 20.269 4.939 1.00 31.90 C -ATOM 56 OG1 THR A 8 20.363 21.458 4.886 1.00 31.01 O -ATOM 57 CG2 THR A 8 22.026 20.115 4.978 1.00 43.78 C -ATOM 58 N ASN A 9 20.249 17.203 3.818 1.00 16.13 N -ATOM 59 CA ASN A 9 20.591 15.889 3.728 1.00 17.84 C -ATOM 60 C ASN A 9 20.630 15.286 2.184 1.00 14.45 C -ATOM 61 O ASN A 9 21.319 14.475 1.822 1.00 21.78 O -ATOM 62 CB ASN A 9 19.836 14.946 4.644 1.00 20.10 C -ATOM 63 CG ASN A 9 20.193 15.272 6.089 1.00 34.82 C -ATOM 64 OD1 ASN A 9 21.294 15.680 6.444 1.00 26.93 O -ATOM 65 ND2 ASN A 9 19.527 14.719 6.950 1.00 28.08 N -ATOM 66 N VAL A 10 19.435 15.546 1.583 1.00 19.64 N -ATOM 67 CA VAL A 10 19.157 15.110 0.179 1.00 13.04 C -ATOM 68 C VAL A 10 20.341 15.904 -0.719 1.00 18.71 C -ATOM 69 O VAL A 10 20.832 15.221 -1.618 1.00 22.34 O -ATOM 70 CB VAL A 10 17.776 15.394 -0.119 1.00 19.07 C -ATOM 71 CG1 VAL A 10 17.623 15.138 -1.549 1.00 21.59 C -ATOM 72 CG2 VAL A 10 16.816 14.756 0.575 1.00 22.75 C -ATOM 73 N LYS A 11 20.392 17.201 -0.404 1.00 18.31 N -ATOM 74 CA LYS A 11 21.297 18.030 -1.415 1.00 24.80 C -ATOM 75 C LYS A 11 22.762 17.451 -1.066 1.00 19.51 C -ATOM 76 O LYS A 11 23.584 17.190 -2.069 1.00 22.33 O -ATOM 77 CB LYS A 11 21.334 19.381 -1.059 1.00 39.77 C -ATOM 78 CG LYS A 11 20.229 20.052 -1.350 1.00 34.41 C -ATOM 79 CD LYS A 11 20.256 21.365 -1.389 1.00 46.95 C -ATOM 80 CE LYS A 11 18.633 21.891 -2.358 1.00 49.55 C -ATOM 81 NZ LYS A 11 18.398 23.088 -1.720 1.00 78.67 N -ATOM 82 N ALA A 12 23.031 16.766 0.069 1.00 20.60 N -ATOM 83 CA ALA A 12 24.347 16.671 -0.059 1.00 25.98 C -ATOM 84 C ALA A 12 24.529 15.278 -0.129 1.00 38.04 C -ATOM 85 O ALA A 12 25.505 14.711 -1.045 1.00 31.19 O -ATOM 86 CB ALA A 12 24.641 16.359 1.529 1.00 28.13 C -ATOM 87 N ALA A 13 23.581 14.281 -0.261 1.00 21.69 N -ATOM 88 CA ALA A 13 23.822 13.010 -0.701 1.00 19.11 C -ATOM 89 C ALA A 13 23.807 12.890 -2.423 1.00 22.93 C -ATOM 90 O ALA A 13 24.517 12.116 -2.938 1.00 24.98 O -ATOM 91 CB ALA A 13 22.612 12.109 -0.160 1.00 23.17 C -ATOM 92 N TRP A 14 22.807 13.763 -2.832 1.00 22.14 N -ATOM 93 CA TRP A 14 22.715 13.681 -4.311 1.00 21.27 C -ATOM 94 C TRP A 14 24.007 14.453 -5.015 1.00 28.97 C -ATOM 95 O TRP A 14 24.452 13.999 -6.086 1.00 27.61 O -ATOM 96 CB TRP A 14 21.129 14.484 -4.728 1.00 29.00 C -ATOM 97 CG TRP A 14 21.116 13.951 -5.830 1.00 25.79 C -ATOM 98 CD1 TRP A 14 21.182 14.904 -7.199 1.00 22.38 C -ATOM 99 CD2 TRP A 14 20.358 12.768 -6.306 1.00 20.46 C -ATOM 100 NE1 TRP A 14 20.545 13.886 -8.152 1.00 29.74 N -ATOM 101 CE2 TRP A 14 20.127 12.855 -7.917 1.00 27.75 C -ATOM 102 CE3 TRP A 14 19.993 11.556 -5.760 1.00 34.00 C -ATOM 103 CZ2 TRP A 14 19.685 11.924 -8.428 1.00 34.81 C -ATOM 104 CZ3 TRP A 14 19.443 10.605 -6.677 1.00 42.11 C -ATOM 105 CH2 TRP A 14 19.361 10.910 -7.988 1.00 47.54 C -ATOM 106 N GLY A 15 24.563 15.294 -4.064 1.00 40.92 N -ATOM 107 CA GLY A 15 25.545 16.032 -4.810 1.00 38.97 C -ATOM 108 C GLY A 15 26.606 14.720 -4.643 1.00 34.61 C -ATOM 109 O GLY A 15 27.532 14.956 -6.011 1.00 36.24 O -ATOM 110 N LYS A 16 27.023 14.192 -4.019 1.00 35.37 N -ATOM 111 CA LYS A 16 27.691 12.809 -3.990 1.00 29.09 C -ATOM 112 C LYS A 16 27.692 11.980 -5.322 1.00 27.28 C -ATOM 113 O LYS A 16 28.444 11.335 -5.752 1.00 36.62 O -ATOM 114 CB LYS A 16 27.773 11.881 -2.758 1.00 30.47 C -ATOM 115 CG LYS A 16 29.128 10.897 -2.949 1.00 47.02 C -ATOM 116 CD LYS A 16 30.512 12.265 -2.454 1.00 66.41 C -ATOM 117 CE LYS A 16 31.160 10.590 -3.127 1.00 65.00 C -ATOM 118 NZ LYS A 16 31.293 9.343 -2.468 1.00 69.28 N -ATOM 119 N VAL A 17 26.231 11.894 -5.716 1.00 40.63 N -ATOM 120 CA VAL A 17 25.763 11.093 -6.580 1.00 32.19 C -ATOM 121 C VAL A 17 26.644 11.417 -8.297 1.00 51.53 C -ATOM 122 O VAL A 17 27.090 10.850 -8.486 1.00 36.95 O -ATOM 123 CB VAL A 17 24.455 10.688 -6.704 1.00 24.77 C -ATOM 124 CG1 VAL A 17 24.024 10.418 -8.088 1.00 21.73 C -ATOM 125 CG2 VAL A 17 23.718 9.922 -5.546 1.00 23.90 C -ATOM 126 N GLY A 18 26.340 12.947 -7.963 1.00 36.07 N -ATOM 127 CA GLY A 18 27.063 13.723 -8.931 1.00 37.64 C -ATOM 128 C GLY A 18 26.574 12.969 -10.560 1.00 27.84 C -ATOM 129 O GLY A 18 25.253 13.110 -10.707 1.00 34.16 O -ATOM 130 N ALA A 19 27.657 12.515 -11.022 1.00 35.70 N -ATOM 131 CA ALA A 19 27.728 12.613 -12.429 1.00 37.59 C -ATOM 132 C ALA A 19 27.500 10.976 -12.552 1.00 34.69 C -ATOM 133 O ALA A 19 27.084 10.420 -13.842 1.00 48.59 O -ATOM 134 CB ALA A 19 29.012 12.664 -13.280 1.00 46.19 C -ATOM 135 N HIS A 20 27.156 10.119 -11.606 1.00 20.24 N -ATOM 136 CA HIS A 20 26.883 8.665 -11.713 1.00 19.03 C -ATOM 137 C HIS A 20 25.297 8.749 -11.742 1.00 17.82 C -ATOM 138 O HIS A 20 24.744 7.547 -11.745 1.00 20.59 O -ATOM 139 CB HIS A 20 27.211 8.007 -10.561 1.00 31.92 C -ATOM 140 CG HIS A 20 28.495 7.629 -10.284 1.00 45.35 C -ATOM 141 ND1 HIS A 20 29.488 7.023 -11.531 1.00 52.86 N -ATOM 142 CD2 HIS A 20 29.445 8.698 -9.743 1.00 43.12 C -ATOM 143 CE1 HIS A 20 30.546 7.246 -10.801 1.00 68.75 C -ATOM 144 NE2 HIS A 20 30.729 7.865 -10.003 1.00 55.89 N -ATOM 145 N ALA A 21 24.687 9.784 -11.799 1.00 29.55 N -ATOM 146 CA ALA A 21 23.159 9.917 -11.488 1.00 29.36 C -ATOM 147 C ALA A 21 22.579 8.284 -12.650 1.00 46.23 C -ATOM 148 O ALA A 21 21.659 8.109 -12.129 1.00 27.88 O -ATOM 149 CB ALA A 21 22.561 11.174 -11.335 1.00 28.64 C -ATOM 150 N GLY A 22 22.741 9.029 -13.713 1.00 27.74 N -ATOM 151 CA GLY A 22 22.302 7.955 -14.644 1.00 29.10 C -ATOM 152 C GLY A 22 22.405 6.768 -14.523 1.00 40.30 C -ATOM 153 O GLY A 22 21.884 5.714 -14.971 1.00 33.08 O -ATOM 154 N GLU A 23 23.751 6.163 -14.331 1.00 22.76 N -ATOM 155 CA GLU A 23 24.084 4.748 -14.144 1.00 14.60 C -ATOM 156 C GLU A 23 23.211 4.210 -12.893 1.00 13.41 C -ATOM 157 O GLU A 23 22.937 3.039 -12.842 1.00 16.24 O -ATOM 158 CB GLU A 23 25.664 4.939 -13.797 1.00 20.16 C -ATOM 159 CG GLU A 23 26.201 3.519 -13.776 1.00 40.65 C -ATOM 160 CD GLU A 23 28.243 3.900 -13.483 1.00 70.75 C -ATOM 161 OE1 GLU A 23 27.931 3.380 -11.875 1.00 57.57 O -ATOM 162 OE2 GLU A 23 28.452 5.212 -13.971 1.00 57.46 O -ATOM 163 N TYR A 24 23.179 5.044 -11.863 1.00 18.60 N -ATOM 164 CA TYR A 24 22.505 4.593 -10.679 1.00 26.35 C -ATOM 165 C TYR A 24 21.016 4.562 -11.095 1.00 17.67 C -ATOM 166 O TYR A 24 20.360 3.603 -10.478 1.00 17.15 O -ATOM 167 CB TYR A 24 22.464 5.807 -9.581 1.00 21.47 C -ATOM 168 CG TYR A 24 23.992 5.643 -8.868 1.00 17.94 C -ATOM 169 CD1 TYR A 24 24.282 6.445 -7.897 1.00 25.54 C -ATOM 170 CD2 TYR A 24 24.950 4.858 -9.353 1.00 18.41 C -ATOM 171 CE1 TYR A 24 25.677 6.369 -7.422 1.00 27.77 C -ATOM 172 CE2 TYR A 24 26.305 4.768 -8.960 1.00 24.84 C -ATOM 173 CZ TYR A 24 26.528 5.702 -7.748 1.00 28.92 C -ATOM 174 OH TYR A 24 27.827 5.849 -7.564 1.00 33.79 O -ATOM 175 N GLY A 25 20.378 5.478 -11.759 1.00 17.58 N -ATOM 176 CA GLY A 25 19.016 5.420 -12.390 1.00 16.95 C -ATOM 177 C GLY A 25 18.833 4.130 -12.941 1.00 12.93 C -ATOM 178 O GLY A 25 17.819 3.343 -12.872 1.00 14.53 O -ATOM 179 N ALA A 26 19.615 3.604 -13.915 1.00 15.78 N -ATOM 180 CA ALA A 26 19.582 2.579 -14.539 1.00 18.05 C -ATOM 181 C ALA A 26 19.480 1.089 -13.772 1.00 13.38 C -ATOM 182 O ALA A 26 18.901 0.084 -13.805 1.00 13.68 O -ATOM 183 CB ALA A 26 20.556 2.124 -15.501 1.00 21.17 C -ATOM 184 N GLU A 27 20.535 1.124 -12.715 1.00 13.26 N -ATOM 185 CA GLU A 27 20.575 0.021 -11.753 1.00 15.73 C -ATOM 186 C GLU A 27 19.308 -0.043 -10.886 1.00 9.69 C -ATOM 187 O GLU A 27 18.918 -1.164 -10.735 1.00 13.70 O -ATOM 188 CB GLU A 27 21.903 0.397 -10.962 1.00 17.47 C -ATOM 189 CG GLU A 27 21.998 -0.702 -9.888 1.00 16.72 C -ATOM 190 CD GLU A 27 23.378 -0.554 -8.914 1.00 28.34 C -ATOM 191 OE1 GLU A 27 23.164 -0.938 -7.844 1.00 20.53 O -ATOM 192 OE2 GLU A 27 24.282 0.068 -9.385 1.00 20.32 O -ATOM 193 N ALA A 28 18.802 1.101 -10.459 1.00 11.71 N -ATOM 194 CA ALA A 28 17.589 1.092 -9.707 1.00 14.08 C -ATOM 195 C ALA A 28 16.437 0.281 -10.410 1.00 18.50 C -ATOM 196 O ALA A 28 15.609 -0.358 -10.010 1.00 12.43 O -ATOM 197 CB ALA A 28 17.166 2.432 -9.252 1.00 19.09 C -ATOM 198 N LEU A 29 16.400 0.918 -11.698 1.00 12.19 N -ATOM 199 CA LEU A 29 15.328 0.075 -12.594 1.00 17.48 C -ATOM 200 C LEU A 29 15.559 -1.439 -12.734 1.00 9.74 C -ATOM 201 O LEU A 29 14.606 -2.189 -12.644 1.00 10.80 O -ATOM 202 CB LEU A 29 15.302 0.859 -14.203 1.00 12.13 C -ATOM 203 CG LEU A 29 14.894 2.291 -14.067 1.00 14.66 C -ATOM 204 CD1 LEU A 29 15.261 2.690 -15.515 1.00 16.80 C -ATOM 205 CD2 LEU A 29 13.402 2.225 -13.944 1.00 18.58 C -ATOM 206 N GLU A 30 16.843 -1.859 -13.083 1.00 9.20 N -ATOM 207 CA GLU A 30 17.065 -3.260 -13.067 1.00 11.66 C -ATOM 208 C GLU A 30 16.682 -4.043 -11.806 1.00 13.48 C -ATOM 209 O GLU A 30 16.222 -5.112 -11.842 1.00 17.00 O -ATOM 210 CB GLU A 30 18.445 -3.450 -13.556 1.00 19.11 C -ATOM 211 CG GLU A 30 18.613 -4.789 -13.421 1.00 27.23 C -ATOM 212 CD GLU A 30 20.397 -5.050 -14.290 1.00 43.77 C -ATOM 213 OE1 GLU A 30 21.034 -4.018 -14.191 1.00 45.21 O -ATOM 214 OE2 GLU A 30 20.320 -6.204 -14.925 1.00 45.13 O -ATOM 215 N ARG A 31 17.074 -3.325 -10.709 1.00 11.70 N -ATOM 216 CA ARG A 31 16.706 -3.885 -9.384 1.00 13.69 C -ATOM 217 C ARG A 31 15.116 -4.077 -9.266 1.00 13.95 C -ATOM 218 O ARG A 31 14.772 -5.201 -8.729 1.00 16.42 O -ATOM 219 CB ARG A 31 17.207 -3.143 -8.212 1.00 9.32 C -ATOM 220 CG ARG A 31 18.786 -3.298 -8.162 1.00 14.85 C -ATOM 221 CD ARG A 31 19.223 -2.383 -7.101 1.00 20.12 C -ATOM 222 NE ARG A 31 20.863 -2.372 -6.759 1.00 14.83 N -ATOM 223 CZ ARG A 31 21.361 -3.431 -6.210 1.00 13.22 C -ATOM 224 NH1 ARG A 31 20.746 -4.460 -5.716 1.00 11.40 N -ATOM 225 NH2 ARG A 31 22.719 -3.344 -6.301 1.00 17.34 N -ATOM 226 N MET A 32 14.439 -3.020 -9.681 1.00 11.37 N -ATOM 227 CA MET A 32 13.032 -3.139 -9.600 1.00 10.16 C -ATOM 228 C MET A 32 12.471 -4.206 -10.484 1.00 12.10 C -ATOM 229 O MET A 32 11.562 -5.027 -10.075 1.00 12.78 O -ATOM 230 CB MET A 32 12.387 -1.842 -9.978 1.00 12.48 C -ATOM 231 CG MET A 32 10.889 -1.620 -9.930 1.00 17.73 C -ATOM 232 SD MET A 32 10.285 -0.089 -10.543 1.00 15.12 S -ATOM 233 CE MET A 32 10.633 -0.449 -12.284 1.00 11.32 C -ATOM 234 N PHE A 33 12.859 -4.341 -11.658 1.00 13.98 N -ATOM 235 CA PHE A 33 12.423 -5.476 -12.584 1.00 16.07 C -ATOM 236 C PHE A 33 12.551 -6.737 -12.305 1.00 12.29 C -ATOM 237 O PHE A 33 11.788 -7.686 -12.349 1.00 14.84 O -ATOM 238 CB PHE A 33 12.947 -5.237 -13.990 1.00 11.16 C -ATOM 239 CG PHE A 33 12.536 -3.998 -14.641 1.00 10.01 C -ATOM 240 CD1 PHE A 33 11.466 -3.383 -14.673 1.00 13.62 C -ATOM 241 CD2 PHE A 33 13.679 -3.464 -15.536 1.00 19.46 C -ATOM 242 CE1 PHE A 33 11.074 -2.180 -15.483 1.00 17.65 C -ATOM 243 CE2 PHE A 33 13.177 -2.070 -16.087 1.00 14.83 C -ATOM 244 CZ PHE A 33 12.158 -1.591 -16.095 1.00 12.93 C -ATOM 245 N LEU A 34 13.735 -6.963 -11.432 1.00 16.04 N -ATOM 246 CA LEU A 34 14.079 -8.337 -11.022 1.00 14.57 C -ATOM 247 C LEU A 34 13.293 -8.578 -9.676 1.00 17.64 C -ATOM 248 O LEU A 34 12.997 -9.724 -9.442 1.00 18.98 O -ATOM 249 CB LEU A 34 15.453 -8.526 -10.814 1.00 18.08 C -ATOM 250 CG LEU A 34 16.401 -8.680 -11.761 1.00 28.60 C -ATOM 251 CD1 LEU A 34 17.957 -8.573 -11.703 1.00 25.37 C -ATOM 252 CD2 LEU A 34 15.936 -9.330 -12.871 1.00 34.83 C -ATOM 253 N SER A 35 13.220 -7.510 -8.706 1.00 15.41 N -ATOM 254 CA SER A 35 12.815 -7.908 -7.502 1.00 14.95 C -ATOM 255 C SER A 35 11.238 -7.909 -7.418 1.00 15.69 C -ATOM 256 O SER A 35 10.517 -8.531 -6.585 1.00 14.29 O -ATOM 257 CB SER A 35 13.131 -6.749 -6.442 1.00 13.14 C -ATOM 258 OG SER A 35 14.485 -7.014 -6.085 1.00 17.78 O -ATOM 259 N PHE A 36 10.680 -7.033 -8.262 1.00 13.54 N -ATOM 260 CA PHE A 36 9.195 -6.850 -8.454 1.00 13.46 C -ATOM 261 C PHE A 36 8.843 -6.910 -9.927 1.00 8.62 C -ATOM 262 O PHE A 36 8.478 -5.788 -10.556 1.00 14.12 O -ATOM 263 CB PHE A 36 8.936 -5.457 -7.919 1.00 16.50 C -ATOM 264 CG PHE A 36 9.418 -4.974 -6.493 1.00 13.63 C -ATOM 265 CD1 PHE A 36 10.591 -4.292 -6.329 1.00 11.92 C -ATOM 266 CD2 PHE A 36 8.828 -5.831 -5.362 1.00 19.28 C -ATOM 267 CE1 PHE A 36 11.048 -4.090 -5.054 1.00 15.75 C -ATOM 268 CE2 PHE A 36 9.372 -5.629 -4.112 1.00 13.78 C -ATOM 269 CZ PHE A 36 10.535 -4.872 -4.007 1.00 15.33 C -ATOM 270 N PRO A 37 8.621 -8.156 -10.145 1.00 14.18 N -ATOM 271 CA PRO A 37 8.292 -8.333 -11.715 1.00 17.12 C -ATOM 272 C PRO A 37 7.088 -7.804 -12.224 1.00 17.85 C -ATOM 273 O PRO A 37 6.976 -7.542 -13.453 1.00 18.50 O -ATOM 274 CB PRO A 37 8.433 -9.844 -11.897 1.00 23.37 C -ATOM 275 CG PRO A 37 8.573 -10.410 -10.572 1.00 28.27 C -ATOM 276 CD PRO A 37 8.857 -9.204 -9.532 1.00 20.43 C -ATOM 277 N THR A 38 6.105 -7.481 -11.322 1.00 18.86 N -ATOM 278 CA THR A 38 4.849 -6.949 -11.938 1.00 14.66 C -ATOM 279 C THR A 38 5.134 -5.609 -12.568 1.00 12.72 C -ATOM 280 O THR A 38 4.433 -5.064 -13.326 1.00 15.75 O -ATOM 281 CB THR A 38 3.879 -6.749 -10.732 1.00 19.10 C -ATOM 282 OG1 THR A 38 4.340 -6.112 -9.661 1.00 18.82 O -ATOM 283 CG2 THR A 38 3.543 -8.224 -10.416 1.00 22.69 C -ATOM 284 N THR A 39 6.269 -4.882 -12.154 1.00 14.27 N -ATOM 285 CA THR A 39 6.491 -3.556 -12.776 1.00 10.19 C -ATOM 286 C THR A 39 6.886 -3.690 -14.302 1.00 10.17 C -ATOM 287 O THR A 39 6.836 -2.719 -14.886 1.00 14.01 O -ATOM 288 CB THR A 39 7.510 -2.917 -11.996 1.00 15.56 C -ATOM 289 OG1 THR A 39 8.881 -3.562 -11.937 1.00 14.68 O -ATOM 290 CG2 THR A 39 7.258 -2.652 -10.511 1.00 20.52 C -ATOM 291 N LYS A 40 7.174 -4.831 -14.593 1.00 14.72 N -ATOM 292 CA LYS A 40 7.574 -4.871 -15.954 1.00 15.89 C -ATOM 293 C LYS A 40 6.392 -4.785 -17.012 1.00 21.37 C -ATOM 294 O LYS A 40 6.437 -4.614 -18.103 1.00 15.72 O -ATOM 295 CB LYS A 40 8.145 -6.482 -16.338 1.00 11.64 C -ATOM 296 CG LYS A 40 9.529 -6.584 -15.725 1.00 16.19 C -ATOM 297 CD LYS A 40 10.167 -7.889 -16.138 1.00 23.35 C -ATOM 298 CE LYS A 40 9.677 -9.033 -15.597 1.00 24.42 C -ATOM 299 NZ LYS A 40 10.352 -10.362 -15.922 1.00 19.04 N -ATOM 300 N THR A 41 5.127 -4.865 -16.397 1.00 13.16 N -ATOM 301 CA THR A 41 3.875 -4.707 -17.174 1.00 14.78 C -ATOM 302 C THR A 41 3.932 -3.487 -17.746 1.00 15.32 C -ATOM 303 O THR A 41 3.044 -3.054 -18.672 1.00 15.67 O -ATOM 304 CB THR A 41 2.612 -5.037 -16.228 1.00 15.38 C -ATOM 305 OG1 THR A 41 2.526 -4.071 -15.248 1.00 14.93 O -ATOM 306 CG2 THR A 41 2.578 -6.405 -15.884 1.00 16.57 C -ATOM 307 N TYR A 42 4.610 -2.356 -17.311 1.00 10.46 N -ATOM 308 CA TYR A 42 4.398 -1.015 -17.861 1.00 12.73 C -ATOM 309 C TYR A 42 5.571 -0.792 -19.101 1.00 7.07 C -ATOM 310 O TYR A 42 5.611 0.312 -19.642 1.00 12.11 O -ATOM 311 CB TYR A 42 4.898 -0.049 -16.794 1.00 14.67 C -ATOM 312 CG TYR A 42 3.618 0.026 -15.875 1.00 13.54 C -ATOM 313 CD1 TYR A 42 2.437 0.794 -16.095 1.00 19.68 C -ATOM 314 CD2 TYR A 42 3.661 -0.765 -14.634 1.00 18.38 C -ATOM 315 CE1 TYR A 42 1.433 0.570 -15.142 1.00 23.98 C -ATOM 316 CE2 TYR A 42 2.601 -0.739 -13.758 1.00 13.41 C -ATOM 317 CZ TYR A 42 1.469 -0.048 -14.033 1.00 18.96 C -ATOM 318 OH TYR A 42 0.436 -0.054 -13.115 1.00 19.81 O -ATOM 319 N PHE A 43 6.476 -1.826 -19.154 1.00 17.11 N -ATOM 320 CA PHE A 43 7.621 -1.843 -20.115 1.00 18.18 C -ATOM 321 C PHE A 43 7.472 -2.895 -21.133 1.00 24.86 C -ATOM 322 O PHE A 43 8.506 -3.413 -21.456 1.00 22.13 O -ATOM 323 CB PHE A 43 8.883 -1.731 -19.445 1.00 15.44 C -ATOM 324 CG PHE A 43 9.117 -0.406 -18.576 1.00 14.36 C -ATOM 325 CD1 PHE A 43 8.554 -0.479 -17.198 1.00 14.47 C -ATOM 326 CD2 PHE A 43 9.564 0.739 -18.886 1.00 16.54 C -ATOM 327 CE1 PHE A 43 8.777 0.624 -16.478 1.00 20.56 C -ATOM 328 CE2 PHE A 43 9.747 1.973 -18.107 1.00 17.61 C -ATOM 329 CZ PHE A 43 9.344 1.707 -16.778 1.00 18.88 C -ATOM 330 N PRO A 44 6.315 -3.239 -21.641 1.00 18.09 N -ATOM 331 CA PRO A 44 6.381 -4.414 -22.439 1.00 22.24 C -ATOM 332 C PRO A 44 7.028 -3.933 -24.077 1.00 24.15 C -ATOM 333 O PRO A 44 7.495 -4.754 -24.733 1.00 24.01 O -ATOM 334 CB PRO A 44 5.048 -4.531 -22.752 1.00 28.44 C -ATOM 335 CG PRO A 44 4.370 -3.210 -22.675 1.00 24.77 C -ATOM 336 CD PRO A 44 5.151 -2.594 -21.501 1.00 21.37 C -ATOM 337 N HIS A 45 7.181 -2.759 -24.200 1.00 22.61 N -ATOM 338 CA HIS A 45 7.861 -2.190 -25.416 1.00 32.33 C -ATOM 339 C HIS A 45 9.330 -2.042 -25.421 1.00 27.50 C -ATOM 340 O HIS A 45 9.974 -1.539 -26.257 1.00 22.34 O -ATOM 341 CB HIS A 45 7.358 -0.919 -25.693 1.00 28.91 C -ATOM 342 CG HIS A 45 7.192 0.375 -24.801 1.00 24.48 C -ATOM 343 ND1 HIS A 45 6.886 -0.058 -23.407 1.00 28.61 N -ATOM 344 CD2 HIS A 45 7.956 1.463 -24.795 1.00 25.11 C -ATOM 345 CE1 HIS A 45 7.011 1.085 -22.716 1.00 26.97 C -ATOM 346 NE2 HIS A 45 7.765 2.042 -23.628 1.00 30.40 N -ATOM 347 N PHE A 46 10.122 -2.386 -24.054 1.00 17.28 N -ATOM 348 CA PHE A 46 11.455 -2.262 -23.909 1.00 16.89 C -ATOM 349 C PHE A 46 12.005 -3.636 -24.127 1.00 16.17 C -ATOM 350 O PHE A 46 11.604 -4.686 -23.635 1.00 18.14 O -ATOM 351 CB PHE A 46 11.684 -1.700 -22.434 1.00 19.02 C -ATOM 352 CG PHE A 46 11.699 -0.399 -22.451 1.00 24.73 C -ATOM 353 CD1 PHE A 46 12.430 0.377 -21.434 1.00 19.60 C -ATOM 354 CD2 PHE A 46 11.298 0.412 -23.118 1.00 32.07 C -ATOM 355 CE1 PHE A 46 12.410 1.666 -21.260 1.00 16.62 C -ATOM 356 CE2 PHE A 46 11.265 1.969 -23.113 1.00 32.95 C -ATOM 357 CZ PHE A 46 11.777 2.738 -22.175 1.00 26.82 C -ATOM 358 N ASP A 47 13.392 -3.464 -24.534 1.00 19.28 N -ATOM 359 CA ASP A 47 14.201 -4.676 -24.267 1.00 21.11 C -ATOM 360 C ASP A 47 14.839 -4.498 -22.659 1.00 19.86 C -ATOM 361 O ASP A 47 15.431 -3.489 -22.547 1.00 21.26 O -ATOM 362 CB ASP A 47 15.523 -4.420 -25.240 1.00 18.49 C -ATOM 363 CG ASP A 47 16.401 -5.761 -25.037 1.00 31.25 C -ATOM 364 OD1 ASP A 47 16.311 -6.607 -24.275 1.00 29.75 O -ATOM 365 OD2 ASP A 47 17.439 -5.328 -25.588 1.00 43.41 O -ATOM 366 N LEU A 48 14.368 -5.324 -22.041 1.00 24.03 N -ATOM 367 CA LEU A 48 14.753 -5.341 -20.734 1.00 18.27 C -ATOM 368 C LEU A 48 15.791 -6.404 -20.198 1.00 36.02 C -ATOM 369 O LEU A 48 16.171 -6.209 -19.141 1.00 39.74 O -ATOM 370 CB LEU A 48 13.415 -5.610 -19.721 1.00 19.69 C -ATOM 371 CG LEU A 48 12.489 -4.486 -19.789 1.00 21.82 C -ATOM 372 CD1 LEU A 48 11.174 -5.208 -18.951 1.00 33.27 C -ATOM 373 CD2 LEU A 48 12.620 -3.262 -19.549 1.00 24.10 C -ATOM 374 N SER A 49 16.783 -6.499 -21.225 1.00 29.95 N -ATOM 375 CA SER A 49 18.122 -7.384 -21.060 1.00 36.57 C -ATOM 376 C SER A 49 18.846 -6.374 -20.277 1.00 27.84 C -ATOM 377 O SER A 49 19.000 -5.086 -20.358 1.00 22.88 O -ATOM 378 CB SER A 49 18.154 -8.122 -22.211 1.00 37.22 C -ATOM 379 OG SER A 49 18.651 -7.428 -22.904 1.00 43.53 O -ATOM 380 N HIS A 50 19.910 -7.126 -19.381 1.00 28.70 N -ATOM 381 CA HIS A 50 20.458 -5.929 -18.816 1.00 33.73 C -ATOM 382 C HIS A 50 21.497 -5.179 -19.493 1.00 26.32 C -ATOM 383 O HIS A 50 22.162 -5.918 -20.594 1.00 31.00 O -ATOM 384 CB HIS A 50 21.839 -7.147 -17.996 1.00 52.72 C -ATOM 385 CG HIS A 50 22.748 -6.326 -17.477 1.00 44.40 C -ATOM 386 ND1 HIS A 50 22.626 -5.701 -16.215 1.00 33.80 N -ATOM 387 CD2 HIS A 50 24.218 -6.937 -17.247 1.00 47.43 C -ATOM 388 CE1 HIS A 50 23.812 -5.042 -15.891 1.00 41.56 C -ATOM 389 NE2 HIS A 50 24.721 -5.696 -16.698 1.00 46.05 N -ATOM 390 N GLY A 51 21.750 -4.254 -19.494 1.00 24.77 N -ATOM 391 CA GLY A 51 22.455 -3.151 -20.084 1.00 47.57 C -ATOM 392 C GLY A 51 21.857 -2.536 -21.373 1.00 38.90 C -ATOM 393 O GLY A 51 22.594 -2.038 -22.085 1.00 36.29 O -ATOM 394 N SER A 52 20.675 -3.017 -21.484 1.00 31.32 N -ATOM 395 CA SER A 52 19.963 -2.196 -22.851 1.00 26.23 C -ATOM 396 C SER A 52 20.134 -0.997 -22.782 1.00 16.57 C -ATOM 397 O SER A 52 19.933 -0.129 -21.983 1.00 20.02 O -ATOM 398 CB SER A 52 18.619 -2.881 -22.964 1.00 27.24 C -ATOM 399 OG SER A 52 17.746 -2.046 -22.388 1.00 23.82 O -ATOM 400 N ALA A 53 20.194 -0.382 -24.103 1.00 17.74 N -ATOM 401 CA ALA A 53 20.270 0.998 -24.154 1.00 23.86 C -ATOM 402 C ALA A 53 18.923 1.773 -23.848 1.00 16.18 C -ATOM 403 O ALA A 53 18.953 2.849 -23.330 1.00 19.42 O -ATOM 404 CB ALA A 53 20.303 1.395 -25.787 1.00 25.47 C -ATOM 405 N GLN A 54 17.736 0.981 -23.874 1.00 20.85 N -ATOM 406 CA GLN A 54 16.512 1.657 -23.573 1.00 13.59 C -ATOM 407 C GLN A 54 16.574 1.828 -21.914 1.00 19.26 C -ATOM 408 O GLN A 54 15.942 2.867 -21.609 1.00 20.48 O -ATOM 409 CB GLN A 54 15.353 0.611 -23.904 1.00 15.39 C -ATOM 410 CG GLN A 54 14.983 0.803 -25.364 1.00 20.40 C -ATOM 411 CD GLN A 54 14.209 -0.311 -25.782 1.00 15.48 C -ATOM 412 OE1 GLN A 54 14.579 -1.521 -25.849 1.00 23.45 O -ATOM 413 NE2 GLN A 54 13.268 -0.063 -26.856 1.00 19.86 N -ATOM 414 N VAL A 55 16.964 0.770 -21.300 1.00 16.87 N -ATOM 415 CA VAL A 55 17.057 0.967 -19.825 1.00 16.48 C -ATOM 416 C VAL A 55 17.956 2.003 -19.318 1.00 17.36 C -ATOM 417 O VAL A 55 17.791 2.873 -18.570 1.00 18.40 O -ATOM 418 CB VAL A 55 17.306 -0.514 -19.268 1.00 14.78 C -ATOM 419 CG1 VAL A 55 17.609 -0.401 -17.796 1.00 21.77 C -ATOM 420 CG2 VAL A 55 16.107 -1.297 -19.446 1.00 16.83 C -ATOM 421 N LYS A 56 19.228 1.986 -19.953 1.00 16.43 N -ATOM 422 CA LYS A 56 20.094 3.039 -19.797 1.00 16.52 C -ATOM 423 C LYS A 56 19.566 4.272 -19.699 1.00 21.58 C -ATOM 424 O LYS A 56 19.825 5.350 -19.163 1.00 20.11 O -ATOM 425 CB LYS A 56 21.563 2.786 -20.316 1.00 18.35 C -ATOM 426 CG LYS A 56 21.968 1.412 -19.848 1.00 28.49 C -ATOM 427 CD LYS A 56 23.832 1.798 -20.631 1.00 44.71 C -ATOM 428 CE LYS A 56 24.647 0.185 -20.276 1.00 47.65 C -ATOM 429 NZ LYS A 56 26.042 0.618 -20.926 1.00 52.31 N -ATOM 430 N GLY A 57 19.018 4.549 -21.123 1.00 17.21 N -ATOM 431 CA GLY A 57 18.386 5.829 -21.439 1.00 25.10 C -ATOM 432 C GLY A 57 17.163 6.322 -20.441 1.00 19.44 C -ATOM 433 O GLY A 57 17.339 7.478 -20.078 1.00 20.54 O -ATOM 434 N HIS A 58 16.465 5.322 -20.170 1.00 18.79 N -ATOM 435 CA HIS A 58 15.350 5.701 -19.218 1.00 20.27 C -ATOM 436 C HIS A 58 15.995 6.080 -17.623 1.00 13.51 C -ATOM 437 O HIS A 58 15.432 7.056 -17.182 1.00 17.47 O -ATOM 438 CB HIS A 58 14.449 4.447 -19.262 1.00 17.90 C -ATOM 439 CG HIS A 58 13.058 4.996 -18.478 1.00 15.76 C -ATOM 440 ND1 HIS A 58 12.287 6.114 -18.800 1.00 20.40 N -ATOM 441 CD2 HIS A 58 12.522 4.394 -17.450 1.00 20.31 C -ATOM 442 CE1 HIS A 58 11.473 6.092 -17.719 1.00 20.13 C -ATOM 443 NE2 HIS A 58 11.497 5.103 -17.065 1.00 21.08 N -ATOM 444 N GLY A 59 16.881 5.222 -17.443 1.00 14.95 N -ATOM 445 CA GLY A 59 17.562 5.623 -16.096 1.00 18.11 C -ATOM 446 C GLY A 59 18.124 6.806 -15.942 1.00 19.85 C -ATOM 447 O GLY A 59 17.932 7.718 -15.003 1.00 15.36 O -ATOM 448 N LYS A 60 18.701 7.399 -17.074 1.00 17.17 N -ATOM 449 CA LYS A 60 19.105 8.846 -17.109 1.00 18.34 C -ATOM 450 C LYS A 60 18.266 9.905 -16.940 1.00 18.03 C -ATOM 451 O LYS A 60 18.249 10.847 -16.377 1.00 18.72 O -ATOM 452 CB LYS A 60 20.142 9.096 -18.402 1.00 30.65 C -ATOM 453 CG LYS A 60 20.617 10.355 -18.546 1.00 41.57 C -ATOM 454 CD LYS A 60 21.486 10.272 -19.721 1.00 63.44 C -ATOM 455 CE LYS A 60 22.042 12.123 -19.760 1.00 44.10 C -ATOM 456 NZ LYS A 60 23.253 10.931 -21.838 1.00 49.08 N -ATOM 457 N LYS A 61 17.057 9.480 -17.740 1.00 16.33 N -ATOM 458 CA LYS A 61 15.986 10.442 -17.612 1.00 17.87 C -ATOM 459 C LYS A 61 15.127 10.479 -16.158 1.00 14.89 C -ATOM 460 O LYS A 61 14.981 11.608 -15.829 1.00 19.71 O -ATOM 461 CB LYS A 61 14.717 10.033 -18.529 1.00 25.67 C -ATOM 462 CG LYS A 61 14.971 10.361 -20.143 1.00 41.04 C -ATOM 463 CD LYS A 61 13.959 9.646 -21.043 1.00 54.25 C -ATOM 464 CE LYS A 61 14.061 9.666 -21.851 1.00 78.95 C -ATOM 465 NZ LYS A 61 13.029 9.011 -23.092 1.00 43.58 N -ATOM 466 N VAL A 62 15.316 9.304 -15.709 1.00 15.10 N -ATOM 467 CA VAL A 62 14.699 9.322 -14.234 1.00 16.18 C -ATOM 468 C VAL A 62 15.686 10.200 -13.093 1.00 18.93 C -ATOM 469 O VAL A 62 15.095 11.051 -12.555 1.00 16.64 O -ATOM 470 CB VAL A 62 14.660 7.890 -13.835 1.00 13.59 C -ATOM 471 CG1 VAL A 62 14.141 7.704 -12.419 1.00 20.28 C -ATOM 472 CG2 VAL A 62 13.407 7.365 -14.552 1.00 17.24 C -ATOM 473 N ALA A 63 16.863 9.822 -13.546 1.00 18.60 N -ATOM 474 CA ALA A 63 17.806 10.661 -12.634 1.00 14.91 C -ATOM 475 C ALA A 63 18.050 11.967 -12.922 1.00 18.47 C -ATOM 476 O ALA A 63 17.940 12.889 -11.976 1.00 18.58 O -ATOM 477 CB ALA A 63 19.170 9.768 -12.782 1.00 37.76 C -ATOM 478 N ASP A 64 17.821 12.573 -14.198 1.00 16.80 N -ATOM 479 CA ASP A 64 17.733 13.912 -14.174 1.00 24.74 C -ATOM 480 C ASP A 64 16.549 14.773 -13.697 1.00 17.12 C -ATOM 481 O ASP A 64 16.672 15.717 -13.116 1.00 22.08 O -ATOM 482 CB ASP A 64 17.603 14.212 -15.737 1.00 35.97 C -ATOM 483 CG ASP A 64 19.349 14.293 -16.612 1.00 31.06 C -ATOM 484 OD1 ASP A 64 20.156 13.672 -15.497 1.00 35.72 O -ATOM 485 OD2 ASP A 64 18.977 14.172 -17.839 1.00 43.58 O -ATOM 486 N ALA A 65 15.332 13.912 -13.869 1.00 13.28 N -ATOM 487 CA ALA A 65 14.329 14.415 -13.017 1.00 17.27 C -ATOM 488 C ALA A 65 14.445 14.482 -11.415 1.00 13.03 C -ATOM 489 O ALA A 65 13.989 15.536 -11.013 1.00 17.77 O -ATOM 490 CB ALA A 65 12.982 13.578 -13.361 1.00 23.35 C -ATOM 491 N LEU A 66 15.162 13.498 -11.063 1.00 15.51 N -ATOM 492 CA LEU A 66 15.339 13.706 -9.605 1.00 11.63 C -ATOM 493 C LEU A 66 16.337 14.754 -9.333 1.00 19.15 C -ATOM 494 O LEU A 66 16.146 15.585 -8.334 1.00 19.52 O -ATOM 495 CB LEU A 66 15.829 12.371 -9.144 1.00 13.76 C -ATOM 496 CG LEU A 66 14.823 11.115 -8.963 1.00 19.82 C -ATOM 497 CD1 LEU A 66 15.489 9.880 -8.746 1.00 18.79 C -ATOM 498 CD2 LEU A 66 13.658 11.434 -8.143 1.00 21.54 C -ATOM 499 N THR A 67 17.286 14.890 -10.137 1.00 15.35 N -ATOM 500 CA THR A 67 18.223 15.978 -10.096 1.00 19.22 C -ATOM 501 C THR A 67 17.538 17.420 -10.103 1.00 19.35 C -ATOM 502 O THR A 67 17.647 18.426 -9.135 1.00 25.50 O -ATOM 503 CB THR A 67 19.391 15.815 -10.975 1.00 27.92 C -ATOM 504 OG1 THR A 67 20.048 14.951 -10.890 1.00 31.77 O -ATOM 505 CG2 THR A 67 20.007 17.263 -11.105 1.00 31.55 C -ATOM 506 N ASN A 68 16.575 17.470 -11.016 1.00 18.73 N -ATOM 507 CA ASN A 68 15.744 18.747 -11.028 1.00 18.68 C -ATOM 508 C ASN A 68 14.923 18.912 -9.894 1.00 24.52 C -ATOM 509 O ASN A 68 14.765 20.137 -9.247 1.00 25.75 O -ATOM 510 CB ASN A 68 14.756 18.608 -12.121 1.00 25.79 C -ATOM 511 CG ASN A 68 13.735 19.831 -12.299 1.00 36.65 C -ATOM 512 OD1 ASN A 68 14.126 20.875 -12.151 1.00 38.63 O -ATOM 513 ND2 ASN A 68 12.596 19.698 -13.037 1.00 39.67 N -ATOM 514 N ALA A 69 14.365 17.791 -9.099 1.00 17.85 N -ATOM 515 CA ALA A 69 13.480 18.120 -7.964 1.00 16.12 C -ATOM 516 C ALA A 69 14.454 18.477 -6.733 1.00 15.28 C -ATOM 517 O ALA A 69 14.055 19.178 -5.996 1.00 20.90 O -ATOM 518 CB ALA A 69 13.019 16.796 -7.635 1.00 21.91 C -ATOM 519 N VAL A 70 15.742 17.807 -6.739 1.00 18.42 N -ATOM 520 CA VAL A 70 16.670 18.320 -5.560 1.00 18.79 C -ATOM 521 C VAL A 70 17.052 19.774 -5.743 1.00 21.40 C -ATOM 522 O VAL A 70 16.986 20.472 -4.749 1.00 22.44 O -ATOM 523 CB VAL A 70 17.782 17.521 -5.616 1.00 19.75 C -ATOM 524 CG1 VAL A 70 19.021 17.739 -4.714 1.00 24.49 C -ATOM 525 CG2 VAL A 70 17.476 16.043 -5.206 1.00 30.23 C -ATOM 526 N ALA A 71 17.156 20.293 -6.971 1.00 20.17 N -ATOM 527 CA ALA A 71 17.389 21.815 -7.308 1.00 23.56 C -ATOM 528 C ALA A 71 16.370 22.294 -6.912 1.00 25.98 C -ATOM 529 O ALA A 71 16.635 23.655 -6.511 1.00 33.09 O -ATOM 530 CB ALA A 71 17.654 21.789 -8.655 1.00 32.78 C -ATOM 531 N HIS A 72 15.081 22.080 -6.888 1.00 23.78 N -ATOM 532 CA HIS A 72 13.997 22.837 -6.617 1.00 21.95 C -ATOM 533 C HIS A 72 13.181 22.411 -5.617 1.00 20.17 C -ATOM 534 O HIS A 72 11.897 22.212 -5.613 1.00 23.99 O -ATOM 535 CB HIS A 72 12.821 22.953 -7.947 1.00 35.07 C -ATOM 536 CG HIS A 72 13.866 23.277 -8.689 1.00 34.89 C -ATOM 537 ND1 HIS A 72 13.873 24.932 -9.510 1.00 43.74 N -ATOM 538 CD2 HIS A 72 14.464 23.117 -10.031 1.00 29.96 C -ATOM 539 CE1 HIS A 72 15.153 25.255 -9.959 1.00 41.69 C -ATOM 540 NE2 HIS A 72 15.223 24.225 -10.948 1.00 44.85 N -ATOM 541 N VAL A 73 13.752 21.857 -4.446 1.00 23.31 N -ATOM 542 CA VAL A 73 13.057 21.077 -3.315 1.00 23.32 C -ATOM 543 C VAL A 73 12.075 21.651 -2.904 1.00 32.07 C -ATOM 544 O VAL A 73 10.955 21.485 -2.533 1.00 42.18 O -ATOM 545 CB VAL A 73 13.998 20.556 -2.485 1.00 41.19 C -ATOM 546 CG1 VAL A 73 14.923 21.399 -1.795 1.00 52.76 C -ATOM 547 CG2 VAL A 73 13.799 19.262 -2.036 1.00 47.91 C -ATOM 548 N ASP A 74 12.275 23.065 -2.789 1.00 30.40 N -ATOM 549 CA ASP A 74 11.145 24.002 -2.142 1.00 34.95 C -ATOM 550 C ASP A 74 10.049 24.015 -3.350 1.00 50.97 C -ATOM 551 O ASP A 74 9.132 24.778 -2.717 1.00 49.62 O -ATOM 552 CB ASP A 74 11.678 25.422 -2.020 1.00 42.77 C -ATOM 553 CG ASP A 74 12.830 25.304 -0.645 1.00 52.01 C -ATOM 554 OD1 ASP A 74 12.752 24.865 0.015 1.00 49.67 O -ATOM 555 OD2 ASP A 74 14.337 25.661 -0.918 1.00 51.46 O -ATOM 556 N ASP A 75 9.922 23.915 -4.261 1.00 36.55 N -ATOM 557 CA ASP A 75 8.668 23.936 -5.208 1.00 36.46 C -ATOM 558 C ASP A 75 8.874 22.788 -6.315 1.00 19.07 C -ATOM 559 O ASP A 75 8.567 23.036 -7.581 1.00 22.77 O -ATOM 560 CB ASP A 75 9.451 25.163 -6.540 1.00 64.13 C -ATOM 561 CG ASP A 75 8.868 25.436 -6.330 1.00 74.46 C -ATOM 562 OD1 ASP A 75 7.314 26.337 -6.605 1.00 47.43 O -ATOM 563 OD2 ASP A 75 8.881 25.994 -8.289 1.00 60.83 O -ATOM 564 N MET A 76 8.625 21.775 -5.634 1.00 28.83 N -ATOM 565 CA MET A 76 8.674 20.530 -6.647 1.00 25.75 C -ATOM 566 C MET A 76 7.271 20.288 -7.401 1.00 26.47 C -ATOM 567 O MET A 76 7.358 19.996 -8.579 1.00 25.06 O -ATOM 568 CB MET A 76 8.643 19.305 -5.552 1.00 26.87 C -ATOM 569 CG MET A 76 9.740 19.092 -5.553 1.00 44.91 C -ATOM 570 SD MET A 76 10.207 17.317 -4.716 1.00 43.69 S -ATOM 571 CE MET A 76 10.186 17.272 -3.278 1.00 47.45 C -ATOM 572 N PRO A 77 6.289 20.734 -6.858 1.00 24.72 N -ATOM 573 CA PRO A 77 5.288 21.011 -7.720 1.00 32.25 C -ATOM 574 C PRO A 77 5.404 21.500 -8.895 1.00 33.71 C -ATOM 575 O PRO A 77 4.843 20.983 -10.107 1.00 27.50 O -ATOM 576 CB PRO A 77 3.868 21.504 -6.885 1.00 35.42 C -ATOM 577 CG PRO A 77 4.538 21.027 -5.570 1.00 42.65 C -ATOM 578 CD PRO A 77 5.873 20.979 -5.490 1.00 26.77 C -ATOM 579 N ASN A 78 5.832 22.745 -9.066 1.00 28.71 N -ATOM 580 CA ASN A 78 5.931 23.542 -10.146 1.00 29.25 C -ATOM 581 C ASN A 78 7.105 22.960 -10.923 1.00 25.30 C -ATOM 582 O ASN A 78 7.043 22.562 -12.258 1.00 31.49 O -ATOM 583 CB ASN A 78 6.292 25.075 -10.189 1.00 52.85 C -ATOM 584 CG ASN A 78 5.615 25.627 -10.060 1.00 62.76 C -ATOM 585 OD1 ASN A 78 4.765 26.184 -8.258 1.00 71.55 O -ATOM 586 ND2 ASN A 78 4.594 25.811 -10.486 1.00 72.60 N -ATOM 587 N ALA A 79 8.114 22.456 -10.315 1.00 21.06 N -ATOM 588 CA ALA A 79 9.264 21.897 -10.989 1.00 28.88 C -ATOM 589 C ALA A 79 8.963 20.522 -11.944 1.00 27.69 C -ATOM 590 O ALA A 79 9.465 20.431 -13.022 1.00 25.51 O -ATOM 591 CB ALA A 79 10.294 21.701 -10.105 1.00 35.64 C -ATOM 592 N LEU A 80 8.232 19.781 -11.312 1.00 22.21 N -ATOM 593 CA LEU A 80 7.767 18.341 -11.815 1.00 24.91 C -ATOM 594 C LEU A 80 6.510 18.562 -12.698 1.00 29.49 C -ATOM 595 O LEU A 80 5.875 17.479 -12.950 1.00 21.47 O -ATOM 596 CB LEU A 80 7.734 17.285 -10.765 1.00 17.03 C -ATOM 597 CG LEU A 80 9.126 17.077 -10.078 1.00 26.04 C -ATOM 598 CD1 LEU A 80 8.930 16.109 -9.016 1.00 30.97 C -ATOM 599 CD2 LEU A 80 10.040 16.545 -11.282 1.00 40.31 C -ATOM 600 N SER A 81 5.857 19.827 -12.942 1.00 21.07 N -ATOM 601 CA SER A 81 4.431 19.687 -13.335 1.00 18.09 C -ATOM 602 C SER A 81 4.363 19.087 -14.671 1.00 20.48 C -ATOM 603 O SER A 81 3.314 18.257 -14.890 1.00 25.77 O -ATOM 604 CB SER A 81 4.467 21.619 -13.861 1.00 32.64 C -ATOM 605 OG SER A 81 2.994 21.456 -13.913 1.00 44.30 O -ATOM 606 N ALA A 82 5.219 18.957 -15.594 1.00 23.80 N -ATOM 607 CA ALA A 82 5.295 18.397 -16.849 1.00 21.23 C -ATOM 608 C ALA A 82 5.047 16.984 -16.596 1.00 19.91 C -ATOM 609 O ALA A 82 4.419 16.133 -17.266 1.00 24.36 O -ATOM 610 CB ALA A 82 6.433 18.664 -17.830 1.00 22.94 C -ATOM 611 N LEU A 83 6.039 16.444 -15.755 1.00 18.35 N -ATOM 612 CA LEU A 83 5.983 14.900 -15.664 1.00 19.01 C -ATOM 613 C LEU A 83 4.967 14.491 -14.735 1.00 18.91 C -ATOM 614 O LEU A 83 4.393 13.347 -14.967 1.00 18.17 O -ATOM 615 CB LEU A 83 7.250 14.624 -14.735 1.00 22.27 C -ATOM 616 CG LEU A 83 8.130 13.821 -15.009 1.00 34.66 C -ATOM 617 CD1 LEU A 83 8.449 13.918 -16.558 1.00 28.24 C -ATOM 618 CD2 LEU A 83 9.756 14.153 -14.680 1.00 38.79 C -ATOM 619 N SER A 84 4.321 15.210 -13.869 1.00 13.22 N -ATOM 620 CA SER A 84 3.091 14.769 -13.309 1.00 14.54 C -ATOM 621 C SER A 84 1.806 14.643 -14.240 1.00 13.50 C -ATOM 622 O SER A 84 1.081 13.802 -14.037 1.00 20.19 O -ATOM 623 CB SER A 84 2.316 15.701 -11.953 1.00 25.45 C -ATOM 624 OG SER A 84 3.028 16.684 -12.075 1.00 36.19 O -ATOM 625 N ASP A 85 1.894 15.645 -15.194 1.00 15.99 N -ATOM 626 CA ASP A 85 0.657 15.457 -16.246 1.00 18.10 C -ATOM 627 C ASP A 85 0.872 14.320 -17.117 1.00 20.71 C -ATOM 628 O ASP A 85 0.085 13.524 -17.249 1.00 20.01 O -ATOM 629 CB ASP A 85 0.847 16.636 -17.207 1.00 30.89 C -ATOM 630 CG ASP A 85 0.240 17.791 -16.350 1.00 57.00 C -ATOM 631 OD1 ASP A 85 -0.408 17.890 -15.984 1.00 51.34 O -ATOM 632 OD2 ASP A 85 0.645 19.250 -17.189 1.00 50.68 O -ATOM 633 N LEU A 86 2.217 13.883 -17.444 1.00 20.13 N -ATOM 634 CA LEU A 86 2.516 12.802 -18.225 1.00 17.03 C -ATOM 635 C LEU A 86 2.094 11.499 -17.604 1.00 14.48 C -ATOM 636 O LEU A 86 1.613 10.536 -18.155 1.00 18.46 O -ATOM 637 CB LEU A 86 4.085 12.859 -18.555 1.00 16.01 C -ATOM 638 CG LEU A 86 4.479 11.856 -19.204 1.00 23.66 C -ATOM 639 CD1 LEU A 86 4.217 11.927 -20.682 1.00 40.43 C -ATOM 640 CD2 LEU A 86 6.063 11.399 -19.455 1.00 33.72 C -ATOM 641 N HIS A 87 2.488 11.534 -16.185 1.00 12.17 N -ATOM 642 CA HIS A 87 2.237 10.125 -15.649 1.00 12.85 C -ATOM 643 C HIS A 87 0.524 10.055 -15.280 1.00 15.39 C -ATOM 644 O HIS A 87 0.114 8.957 -15.394 1.00 15.03 O -ATOM 645 CB HIS A 87 2.873 10.043 -14.177 1.00 13.63 C -ATOM 646 CG HIS A 87 4.357 9.531 -14.510 1.00 14.91 C -ATOM 647 ND1 HIS A 87 5.315 10.638 -14.847 1.00 15.35 N -ATOM 648 CD2 HIS A 87 5.128 8.461 -14.450 1.00 17.85 C -ATOM 649 CE1 HIS A 87 6.425 9.938 -15.110 1.00 15.29 C -ATOM 650 NE2 HIS A 87 6.410 8.672 -14.776 1.00 15.64 N -ATOM 651 N ALA A 88 0.070 11.240 -15.092 1.00 19.56 N -ATOM 652 CA ALA A 88 -1.450 11.245 -14.731 1.00 16.45 C -ATOM 653 C ALA A 88 -2.307 10.782 -16.164 1.00 28.29 C -ATOM 654 O ALA A 88 -3.217 10.321 -15.884 1.00 25.27 O -ATOM 655 CB ALA A 88 -1.985 12.408 -13.954 1.00 17.34 C -ATOM 656 N HIS A 89 -1.856 11.542 -17.115 1.00 21.56 N -ATOM 657 CA HIS A 89 -2.652 11.471 -18.284 1.00 29.42 C -ATOM 658 C HIS A 89 -2.430 10.590 -19.375 1.00 27.17 C -ATOM 659 O HIS A 89 -3.237 9.974 -20.183 1.00 22.35 O -ATOM 660 CB HIS A 89 -2.855 12.836 -18.839 1.00 26.26 C -ATOM 661 CG HIS A 89 -3.474 13.775 -17.933 1.00 44.45 C -ATOM 662 ND1 HIS A 89 -4.582 13.545 -17.082 1.00 45.59 N -ATOM 663 CD2 HIS A 89 -3.036 15.133 -17.376 1.00 45.61 C -ATOM 664 CE1 HIS A 89 -4.931 14.373 -15.965 1.00 42.72 C -ATOM 665 NE2 HIS A 89 -3.969 15.212 -16.507 1.00 43.49 N -ATOM 666 N LYS A 90 -1.237 10.085 -19.553 1.00 18.65 N -ATOM 667 CA LYS A 90 -0.701 9.212 -20.311 1.00 28.92 C -ATOM 668 C LYS A 90 -0.235 7.836 -20.094 1.00 28.09 C -ATOM 669 O LYS A 90 -0.814 6.865 -20.213 1.00 25.04 O -ATOM 670 CB LYS A 90 0.483 9.973 -21.248 1.00 32.47 C -ATOM 671 CG LYS A 90 -0.258 11.271 -22.102 1.00 49.97 C -ATOM 672 CD LYS A 90 -1.161 11.150 -22.865 1.00 58.54 C -ATOM 673 CE LYS A 90 -0.717 12.584 -23.928 1.00 66.22 C -ATOM 674 NZ LYS A 90 -3.148 11.648 -24.501 1.00 63.54 N -ATOM 675 N LEU A 91 0.684 7.834 -19.083 1.00 17.50 N -ATOM 676 CA LEU A 91 1.357 6.678 -18.728 1.00 15.47 C -ATOM 677 C LEU A 91 0.469 5.814 -17.729 1.00 18.54 C -ATOM 678 O LEU A 91 0.360 4.623 -17.933 1.00 17.03 O -ATOM 679 CB LEU A 91 2.810 6.867 -17.956 1.00 13.84 C -ATOM 680 CG LEU A 91 3.828 7.564 -18.848 1.00 16.01 C -ATOM 681 CD1 LEU A 91 4.943 7.934 -18.256 1.00 18.27 C -ATOM 682 CD2 LEU A 91 3.998 6.811 -20.081 1.00 22.12 C -ATOM 683 N ARG A 92 -0.013 6.544 -16.785 1.00 18.03 N -ATOM 684 CA ARG A 92 -1.120 5.962 -15.831 1.00 14.41 C -ATOM 685 C ARG A 92 -0.663 4.876 -15.136 1.00 15.84 C -ATOM 686 O ARG A 92 -1.280 3.746 -14.964 1.00 17.92 O -ATOM 687 CB ARG A 92 -2.457 5.762 -16.768 1.00 18.61 C -ATOM 688 CG ARG A 92 -3.108 6.901 -17.068 1.00 25.14 C -ATOM 689 CD ARG A 92 -3.735 6.578 -19.206 1.00 53.25 C -ATOM 690 NE ARG A 92 -4.375 7.010 -18.108 1.00 51.61 N -ATOM 691 CZ ARG A 92 -5.273 6.721 -20.498 1.00 59.18 C -ATOM 692 NH1 ARG A 92 -4.092 6.059 -21.138 1.00 31.30 N -ATOM 693 NH2 ARG A 92 -6.080 6.715 -20.222 1.00 36.70 N -ATOM 694 N VAL A 93 0.444 4.876 -14.510 1.00 14.32 N -ATOM 695 CA VAL A 93 1.119 3.933 -13.665 1.00 16.19 C -ATOM 696 C VAL A 93 0.472 3.844 -12.448 1.00 13.83 C -ATOM 697 O VAL A 93 0.272 4.879 -11.643 1.00 14.88 O -ATOM 698 CB VAL A 93 2.564 4.273 -13.453 1.00 12.60 C -ATOM 699 CG1 VAL A 93 3.153 3.301 -12.513 1.00 15.68 C -ATOM 700 CG2 VAL A 93 3.314 4.342 -14.815 1.00 15.91 C -ATOM 701 N ASP A 94 0.015 2.696 -11.867 1.00 14.66 N -ATOM 702 CA ASP A 94 -0.813 2.633 -10.611 1.00 11.73 C -ATOM 703 C ASP A 94 0.271 3.244 -9.468 1.00 12.54 C -ATOM 704 O ASP A 94 1.339 2.859 -9.516 1.00 16.42 O -ATOM 705 CB ASP A 94 -1.010 1.197 -10.262 1.00 12.92 C -ATOM 706 CG ASP A 94 -1.972 1.228 -9.080 1.00 22.91 C -ATOM 707 OD1 ASP A 94 -3.187 1.146 -9.201 1.00 22.17 O -ATOM 708 OD2 ASP A 94 -1.457 1.316 -7.935 1.00 19.01 O -ATOM 709 N PRO A 95 -0.249 3.901 -8.527 1.00 16.46 N -ATOM 710 CA PRO A 95 0.567 4.636 -7.596 1.00 14.67 C -ATOM 711 C PRO A 95 1.260 3.622 -6.816 1.00 17.74 C -ATOM 712 O PRO A 95 2.400 4.046 -6.219 1.00 22.38 O -ATOM 713 CB PRO A 95 -0.368 5.238 -6.654 1.00 22.16 C -ATOM 714 CG PRO A 95 -1.377 5.777 -7.565 1.00 21.38 C -ATOM 715 CD PRO A 95 -1.576 4.623 -8.536 1.00 20.78 C -ATOM 716 N VAL A 96 0.927 2.374 -6.618 1.00 13.01 N -ATOM 717 CA VAL A 96 1.730 1.539 -5.762 1.00 11.93 C -ATOM 718 C VAL A 96 3.098 1.350 -6.142 1.00 21.27 C -ATOM 719 O VAL A 96 4.069 1.031 -5.537 1.00 16.07 O -ATOM 720 CB VAL A 96 0.857 0.099 -5.620 1.00 29.83 C -ATOM 721 CG1 VAL A 96 0.923 -0.687 -6.401 1.00 48.43 C -ATOM 722 CG2 VAL A 96 1.322 -0.240 -4.779 1.00 70.91 C -ATOM 723 N ASN A 97 3.269 1.470 -7.559 1.00 15.63 N -ATOM 724 CA ASN A 97 4.615 1.047 -8.098 1.00 10.10 C -ATOM 725 C ASN A 97 5.675 2.262 -7.895 1.00 4.91 C -ATOM 726 O ASN A 97 6.828 1.839 -7.860 1.00 9.67 O -ATOM 727 CB ASN A 97 4.581 0.892 -9.670 1.00 13.43 C -ATOM 728 CG ASN A 97 3.716 -0.282 -9.938 1.00 17.91 C -ATOM 729 OD1 ASN A 97 4.086 -1.378 -9.937 1.00 10.92 O -ATOM 730 ND2 ASN A 97 2.339 0.119 -10.294 1.00 21.96 N -ATOM 731 N PHE A 98 5.251 3.390 -7.458 1.00 9.20 N -ATOM 732 CA PHE A 98 6.132 4.482 -7.110 1.00 12.10 C -ATOM 733 C PHE A 98 6.958 4.075 -5.773 1.00 12.02 C -ATOM 734 O PHE A 98 8.240 4.323 -5.676 1.00 11.50 O -ATOM 735 CB PHE A 98 5.590 5.923 -6.936 1.00 16.66 C -ATOM 736 CG PHE A 98 5.051 6.336 -8.208 1.00 14.23 C -ATOM 737 CD1 PHE A 98 5.894 7.220 -8.806 1.00 16.70 C -ATOM 738 CD2 PHE A 98 3.842 5.962 -8.759 1.00 12.76 C -ATOM 739 CE1 PHE A 98 5.529 7.688 -9.904 1.00 23.57 C -ATOM 740 CE2 PHE A 98 3.513 6.440 -10.107 1.00 15.74 C -ATOM 741 CZ PHE A 98 4.374 7.231 -10.516 1.00 17.50 C -ATOM 742 N LYS A 99 6.362 3.356 -4.846 1.00 13.69 N -ATOM 743 CA LYS A 99 7.109 2.770 -3.687 1.00 13.57 C -ATOM 744 C LYS A 99 7.912 1.744 -3.941 1.00 14.35 C -ATOM 745 O LYS A 99 9.044 1.864 -3.350 1.00 13.29 O -ATOM 746 CB LYS A 99 5.909 2.378 -2.665 1.00 22.01 C -ATOM 747 CG LYS A 99 5.016 2.967 -2.454 1.00 54.35 C -ATOM 748 CD LYS A 99 4.488 3.000 -1.609 1.00 72.56 C -ATOM 749 CE LYS A 99 2.959 1.795 -1.600 1.00 73.99 C -ATOM 750 NZ LYS A 99 1.741 2.896 -0.134 1.00 80.12 N -ATOM 751 N LEU A 100 7.785 1.013 -5.037 1.00 9.89 N -ATOM 752 CA LEU A 100 8.665 -0.028 -5.354 1.00 8.80 C -ATOM 753 C LEU A 100 9.884 0.546 -6.019 1.00 9.28 C -ATOM 754 O LEU A 100 11.014 0.165 -5.616 1.00 12.09 O -ATOM 755 CB LEU A 100 8.009 -1.084 -6.185 1.00 11.00 C -ATOM 756 CG LEU A 100 6.724 -1.520 -5.691 1.00 16.83 C -ATOM 757 CD1 LEU A 100 6.069 -2.688 -6.703 1.00 20.94 C -ATOM 758 CD2 LEU A 100 7.065 -2.491 -4.548 1.00 18.49 C -ATOM 759 N LEU A 101 9.812 1.484 -6.927 1.00 8.39 N -ATOM 760 CA LEU A 101 10.986 2.076 -7.511 1.00 10.30 C -ATOM 761 C LEU A 101 11.701 2.979 -6.551 1.00 14.49 C -ATOM 762 O LEU A 101 12.986 2.948 -6.333 1.00 16.14 O -ATOM 763 CB LEU A 101 10.485 2.971 -8.570 1.00 11.44 C -ATOM 764 CG LEU A 101 11.708 3.704 -9.282 1.00 15.06 C -ATOM 765 CD1 LEU A 101 12.805 2.937 -9.771 1.00 17.72 C -ATOM 766 CD2 LEU A 101 11.060 4.651 -10.427 1.00 19.38 C -ATOM 767 N SER A 102 11.019 3.662 -5.475 1.00 15.17 N -ATOM 768 CA SER A 102 11.653 4.426 -4.454 1.00 9.19 C -ATOM 769 C SER A 102 12.577 3.423 -3.620 1.00 9.91 C -ATOM 770 O SER A 102 13.768 3.831 -3.267 1.00 14.07 O -ATOM 771 CB SER A 102 10.597 5.003 -3.570 1.00 12.36 C -ATOM 772 OG SER A 102 9.919 6.079 -4.248 1.00 16.52 O -ATOM 773 N HIS A 103 12.034 2.275 -3.168 1.00 12.27 N -ATOM 774 CA HIS A 103 12.685 1.217 -2.471 1.00 10.16 C -ATOM 775 C HIS A 103 14.063 1.009 -3.068 1.00 13.13 C -ATOM 776 O HIS A 103 15.226 0.862 -2.602 1.00 13.37 O -ATOM 777 CB HIS A 103 11.949 0.073 -2.013 1.00 12.31 C -ATOM 778 CG HIS A 103 12.674 -1.002 -1.380 1.00 10.33 C -ATOM 779 ND1 HIS A 103 12.899 -2.229 -2.007 1.00 10.01 N -ATOM 780 CD2 HIS A 103 13.318 -0.937 -0.179 1.00 9.56 C -ATOM 781 CE1 HIS A 103 13.687 -2.798 -1.043 1.00 12.63 C -ATOM 782 NE2 HIS A 103 14.053 -2.093 0.083 1.00 10.77 N -ATOM 783 N CYS A 104 13.914 0.657 -4.439 1.00 11.06 N -ATOM 784 CA CYS A 104 15.233 0.205 -5.307 1.00 11.72 C -ATOM 785 C CYS A 104 16.049 1.418 -5.518 1.00 9.58 C -ATOM 786 O CYS A 104 17.228 1.081 -5.567 1.00 14.10 O -ATOM 787 CB CYS A 104 14.671 -0.439 -6.552 1.00 16.81 C -ATOM 788 SG CYS A 104 13.797 -1.958 -6.414 1.00 14.76 S -ATOM 789 N LEU A 105 15.618 2.594 -5.516 1.00 7.99 N -ATOM 790 CA LEU A 105 16.723 3.634 -5.593 1.00 10.43 C -ATOM 791 C LEU A 105 17.448 3.890 -4.202 1.00 11.96 C -ATOM 792 O LEU A 105 18.594 3.985 -4.326 1.00 15.19 O -ATOM 793 CB LEU A 105 15.765 4.895 -6.092 1.00 16.93 C -ATOM 794 CG LEU A 105 15.765 5.438 -7.260 1.00 44.57 C -ATOM 795 CD1 LEU A 105 14.641 6.498 -7.442 1.00 40.98 C -ATOM 796 CD2 LEU A 105 16.687 5.564 -8.008 1.00 33.21 C -ATOM 797 N LEU A 106 16.617 3.676 -3.143 1.00 10.40 N -ATOM 798 CA LEU A 106 17.322 3.635 -1.869 1.00 15.02 C -ATOM 799 C LEU A 106 18.190 2.641 -1.668 1.00 13.79 C -ATOM 800 O LEU A 106 19.481 2.857 -1.263 1.00 13.12 O -ATOM 801 CB LEU A 106 16.241 3.634 -0.757 1.00 16.59 C -ATOM 802 CG LEU A 106 15.821 4.348 0.036 1.00 26.87 C -ATOM 803 CD1 LEU A 106 14.832 4.036 0.973 1.00 28.01 C -ATOM 804 CD2 LEU A 106 16.399 5.824 0.153 1.00 18.73 C -ATOM 805 N VAL A 107 18.054 1.391 -2.126 1.00 9.58 N -ATOM 806 CA VAL A 107 18.953 0.372 -2.172 1.00 10.69 C -ATOM 807 C VAL A 107 20.116 0.640 -3.008 1.00 12.39 C -ATOM 808 O VAL A 107 21.316 0.322 -2.651 1.00 13.09 O -ATOM 809 CB VAL A 107 18.301 -0.968 -2.671 1.00 14.48 C -ATOM 810 CG1 VAL A 107 19.286 -1.955 -2.913 1.00 19.64 C -ATOM 811 CG2 VAL A 107 17.236 -1.532 -1.566 1.00 13.81 C -ATOM 812 N THR A 108 19.963 1.288 -4.127 1.00 12.66 N -ATOM 813 CA THR A 108 21.110 1.595 -5.027 1.00 11.04 C -ATOM 814 C THR A 108 21.986 2.516 -4.350 1.00 11.25 C -ATOM 815 O THR A 108 23.209 2.402 -4.407 1.00 13.68 O -ATOM 816 CB THR A 108 20.373 2.089 -6.467 1.00 8.55 C -ATOM 817 OG1 THR A 108 19.740 1.009 -7.110 1.00 9.51 O -ATOM 818 CG2 THR A 108 21.547 2.322 -7.342 1.00 15.85 C -ATOM 819 N LEU A 109 21.371 3.638 -3.771 1.00 11.20 N -ATOM 820 CA LEU A 109 22.189 4.682 -3.080 1.00 12.61 C -ATOM 821 C LEU A 109 23.015 3.976 -1.882 1.00 16.09 C -ATOM 822 O LEU A 109 24.210 4.291 -1.739 1.00 14.60 O -ATOM 823 CB LEU A 109 21.280 5.707 -2.657 1.00 17.08 C -ATOM 824 CG LEU A 109 20.748 6.795 -3.713 1.00 24.50 C -ATOM 825 CD1 LEU A 109 19.679 7.424 -3.306 1.00 22.52 C -ATOM 826 CD2 LEU A 109 21.379 6.943 -4.782 1.00 32.08 C -ATOM 827 N ALA A 110 22.243 3.090 -1.228 1.00 13.55 N -ATOM 828 CA ALA A 110 22.985 2.551 -0.107 1.00 19.86 C -ATOM 829 C ALA A 110 24.128 1.797 -0.396 1.00 18.59 C -ATOM 830 O ALA A 110 25.285 1.654 0.094 1.00 14.76 O -ATOM 831 CB ALA A 110 21.957 1.572 0.573 1.00 17.34 C -ATOM 832 N ALA A 111 24.211 0.998 -1.558 1.00 15.15 N -ATOM 833 CA ALA A 111 25.062 0.161 -2.216 1.00 13.42 C -ATOM 834 C ALA A 111 26.376 1.017 -2.643 1.00 16.84 C -ATOM 835 O ALA A 111 27.331 0.420 -2.883 1.00 21.50 O -ATOM 836 CB ALA A 111 24.726 -0.813 -3.252 1.00 16.85 C -ATOM 837 N HIS A 112 26.089 2.220 -3.063 1.00 17.71 N -ATOM 838 CA HIS A 112 27.174 3.032 -3.686 1.00 25.83 C -ATOM 839 C HIS A 112 27.556 4.174 -2.656 1.00 21.86 C -ATOM 840 O HIS A 112 28.710 4.609 -3.162 1.00 23.07 O -ATOM 841 CB HIS A 112 26.642 3.736 -5.093 1.00 17.12 C -ATOM 842 CG HIS A 112 26.500 2.730 -6.083 1.00 18.91 C -ATOM 843 ND1 HIS A 112 27.696 2.669 -6.792 1.00 20.25 N -ATOM 844 CD2 HIS A 112 25.457 2.082 -6.643 1.00 13.97 C -ATOM 845 CE1 HIS A 112 27.065 1.572 -7.791 1.00 16.16 C -ATOM 846 NE2 HIS A 112 25.728 1.142 -7.624 1.00 16.17 N -ATOM 847 N LEU A 113 26.962 4.473 -1.633 1.00 16.18 N -ATOM 848 CA LEU A 113 27.430 5.708 -0.856 1.00 18.52 C -ATOM 849 C LEU A 113 27.676 5.161 0.490 1.00 15.09 C -ATOM 850 O LEU A 113 26.991 5.652 1.418 1.00 22.00 O -ATOM 851 CB LEU A 113 26.385 6.569 -0.567 1.00 26.60 C -ATOM 852 CG LEU A 113 25.991 7.546 -1.915 1.00 26.91 C -ATOM 853 CD1 LEU A 113 25.025 8.844 -1.799 1.00 38.78 C -ATOM 854 CD2 LEU A 113 27.117 7.882 -2.870 1.00 35.29 C -ATOM 855 N PRO A 114 28.523 4.242 0.795 1.00 18.92 N -ATOM 856 CA PRO A 114 28.714 3.528 2.218 1.00 24.61 C -ATOM 857 C PRO A 114 29.102 4.799 3.218 1.00 23.92 C -ATOM 858 O PRO A 114 28.415 4.826 4.106 1.00 21.99 O -ATOM 859 CB PRO A 114 30.033 2.940 1.849 1.00 23.94 C -ATOM 860 CG PRO A 114 30.698 3.344 0.612 1.00 18.92 C -ATOM 861 CD PRO A 114 29.469 3.904 -0.168 1.00 16.59 C -ATOM 862 N ALA A 115 29.794 5.877 2.767 1.00 18.42 N -ATOM 863 CA ALA A 115 30.159 6.863 3.921 1.00 21.98 C -ATOM 864 C ALA A 115 28.895 7.716 4.285 1.00 22.41 C -ATOM 865 O ALA A 115 28.703 8.192 5.284 1.00 22.94 O -ATOM 866 CB ALA A 115 31.247 7.657 3.369 1.00 30.20 C -ATOM 867 N GLU A 116 28.136 8.035 3.290 1.00 15.58 N -ATOM 868 CA GLU A 116 27.073 9.160 3.429 1.00 17.43 C -ATOM 869 C GLU A 116 25.648 8.548 3.788 1.00 15.97 C -ATOM 870 O GLU A 116 24.768 9.367 4.171 1.00 23.49 O -ATOM 871 CB GLU A 116 26.875 9.750 1.910 1.00 21.21 C -ATOM 872 CG GLU A 116 27.948 10.674 1.482 1.00 24.18 C -ATOM 873 CD GLU A 116 28.950 9.665 0.967 1.00 26.12 C -ATOM 874 OE1 GLU A 116 28.992 8.438 0.543 1.00 28.16 O -ATOM 875 OE2 GLU A 116 30.132 10.301 0.462 1.00 33.82 O -ATOM 876 N PHE A 117 25.414 7.310 3.661 1.00 16.62 N -ATOM 877 CA PHE A 117 24.245 6.614 3.985 1.00 14.17 C -ATOM 878 C PHE A 117 23.918 6.335 5.559 1.00 17.74 C -ATOM 879 O PHE A 117 23.649 5.222 5.819 1.00 19.92 O -ATOM 880 CB PHE A 117 23.936 5.421 3.086 1.00 12.47 C -ATOM 881 CG PHE A 117 22.448 4.906 2.825 1.00 9.61 C -ATOM 882 CD1 PHE A 117 21.681 5.713 2.037 1.00 15.09 C -ATOM 883 CD2 PHE A 117 22.071 3.807 3.568 1.00 15.73 C -ATOM 884 CE1 PHE A 117 20.396 5.197 1.858 1.00 17.90 C -ATOM 885 CE2 PHE A 117 20.593 3.448 3.517 1.00 23.05 C -ATOM 886 CZ PHE A 117 19.914 4.171 2.606 1.00 14.00 C -ATOM 887 N THR A 118 23.856 7.434 6.252 1.00 11.56 N -ATOM 888 CA THR A 118 23.660 7.280 7.655 1.00 10.93 C -ATOM 889 C THR A 118 22.259 6.982 7.820 1.00 15.34 C -ATOM 890 O THR A 118 21.447 7.435 7.051 1.00 14.33 O -ATOM 891 CB THR A 118 23.982 8.621 8.138 1.00 22.78 C -ATOM 892 OG1 THR A 118 23.375 9.780 7.827 1.00 25.00 O -ATOM 893 CG2 THR A 118 25.586 8.842 8.226 1.00 25.00 C -ATOM 894 N PRO A 119 21.833 6.884 9.086 1.00 16.93 N -ATOM 895 CA PRO A 119 20.398 6.708 9.436 1.00 7.97 C -ATOM 896 C PRO A 119 19.633 7.821 9.121 1.00 9.71 C -ATOM 897 O PRO A 119 18.484 7.899 8.632 1.00 13.14 O -ATOM 898 CB PRO A 119 20.352 6.336 10.909 1.00 15.02 C -ATOM 899 CG PRO A 119 21.556 5.500 11.105 1.00 20.08 C -ATOM 900 CD PRO A 119 22.686 6.188 10.125 1.00 23.85 C -ATOM 901 N ALA A 120 20.184 9.026 9.484 1.00 18.30 N -ATOM 902 CA ALA A 120 19.624 10.215 9.304 1.00 20.48 C -ATOM 903 C ALA A 120 19.441 10.650 7.769 1.00 11.11 C -ATOM 904 O ALA A 120 18.342 11.025 7.255 1.00 14.90 O -ATOM 905 CB ALA A 120 20.042 11.527 10.014 1.00 21.25 C -ATOM 906 N VAL A 121 20.278 10.312 7.027 1.00 15.02 N -ATOM 907 CA VAL A 121 20.243 10.488 5.614 1.00 11.64 C -ATOM 908 C VAL A 121 19.214 9.526 4.899 1.00 13.80 C -ATOM 909 O VAL A 121 18.469 9.919 4.066 1.00 15.60 O -ATOM 910 CB VAL A 121 21.606 10.473 4.939 1.00 16.28 C -ATOM 911 CG1 VAL A 121 21.595 10.524 3.309 1.00 17.80 C -ATOM 912 CG2 VAL A 121 22.496 11.659 5.330 1.00 19.30 C -ATOM 913 N HIS A 122 19.312 8.350 5.306 1.00 15.45 N -ATOM 914 CA HIS A 122 18.254 7.136 4.913 1.00 11.57 C -ATOM 915 C HIS A 122 16.950 7.952 5.022 1.00 13.88 C -ATOM 916 O HIS A 122 16.085 7.716 4.230 1.00 13.87 O -ATOM 917 CB HIS A 122 18.754 5.950 5.667 1.00 12.36 C -ATOM 918 CG HIS A 122 17.848 4.887 5.471 1.00 15.49 C -ATOM 919 ND1 HIS A 122 18.318 3.588 6.013 1.00 14.41 N -ATOM 920 CD2 HIS A 122 16.770 4.643 4.716 1.00 16.00 C -ATOM 921 CE1 HIS A 122 17.238 2.617 5.530 1.00 20.76 C -ATOM 922 NE2 HIS A 122 16.304 3.230 4.756 1.00 17.17 N -ATOM 923 N ALA A 123 16.659 8.268 6.248 1.00 12.31 N -ATOM 924 CA ALA A 123 15.409 8.791 6.637 1.00 12.34 C -ATOM 925 C ALA A 123 14.961 9.969 5.694 1.00 12.36 C -ATOM 926 O ALA A 123 13.756 10.012 5.125 1.00 16.22 O -ATOM 927 CB ALA A 123 15.295 9.229 8.074 1.00 18.20 C -ATOM 928 N SER A 124 15.970 10.909 5.411 1.00 11.72 N -ATOM 929 CA SER A 124 15.641 12.024 4.678 1.00 15.71 C -ATOM 930 C SER A 124 15.409 11.594 3.146 1.00 11.97 C -ATOM 931 O SER A 124 14.491 12.176 2.530 1.00 13.78 O -ATOM 932 CB SER A 124 16.719 13.075 4.649 1.00 17.31 C -ATOM 933 OG SER A 124 16.856 13.618 5.975 1.00 19.36 O -ATOM 934 N LEU A 125 16.244 10.663 2.745 1.00 11.45 N -ATOM 935 CA LEU A 125 16.012 10.336 1.348 1.00 9.77 C -ATOM 936 C LEU A 125 14.814 9.607 1.165 1.00 13.87 C -ATOM 937 O LEU A 125 14.134 9.697 0.072 1.00 12.03 O -ATOM 938 CB LEU A 125 17.131 9.446 0.945 1.00 14.61 C -ATOM 939 CG LEU A 125 18.555 9.965 0.565 1.00 15.39 C -ATOM 940 CD1 LEU A 125 19.590 8.976 0.528 1.00 26.84 C -ATOM 941 CD2 LEU A 125 18.455 10.851 -0.577 1.00 19.46 C -ATOM 942 N ASP A 126 14.277 8.735 2.034 1.00 13.89 N -ATOM 943 CA ASP A 126 13.042 7.997 2.040 1.00 14.28 C -ATOM 944 C ASP A 126 11.977 8.930 1.898 1.00 13.60 C -ATOM 945 O ASP A 126 10.911 8.959 1.188 1.00 12.25 O -ATOM 946 CB ASP A 126 12.901 7.025 3.127 1.00 9.77 C -ATOM 947 CG ASP A 126 11.751 5.958 3.086 1.00 17.51 C -ATOM 948 OD1 ASP A 126 11.597 5.517 1.933 1.00 22.67 O -ATOM 949 OD2 ASP A 126 10.812 6.013 3.738 1.00 20.83 O -ATOM 950 N LYS A 127 11.945 10.077 2.732 1.00 11.87 N -ATOM 951 CA LYS A 127 11.051 11.143 2.756 1.00 11.94 C -ATOM 952 C LYS A 127 11.080 11.794 1.382 1.00 16.34 C -ATOM 953 O LYS A 127 9.925 12.173 0.922 1.00 15.26 O -ATOM 954 CB LYS A 127 11.131 11.830 4.210 1.00 27.23 C -ATOM 955 CG LYS A 127 10.719 12.405 4.298 1.00 41.38 C -ATOM 956 CD LYS A 127 10.893 12.716 6.240 1.00 22.35 C -ATOM 957 CE LYS A 127 10.245 13.990 6.093 1.00 24.85 C -ATOM 958 NZ LYS A 127 10.431 14.893 7.319 1.00 27.43 N -ATOM 959 N PHE A 128 12.109 12.155 0.978 1.00 9.60 N -ATOM 960 CA PHE A 128 12.219 12.896 -0.315 1.00 9.45 C -ATOM 961 C PHE A 128 11.648 12.055 -1.437 1.00 11.35 C -ATOM 962 O PHE A 128 10.825 12.624 -2.222 1.00 13.72 O -ATOM 963 CB PHE A 128 13.691 13.118 -0.597 1.00 10.04 C -ATOM 964 CG PHE A 128 13.845 13.645 -2.016 1.00 12.71 C -ATOM 965 CD1 PHE A 128 13.433 15.022 -2.350 1.00 22.47 C -ATOM 966 CD2 PHE A 128 14.442 12.953 -2.821 1.00 15.10 C -ATOM 967 CE1 PHE A 128 13.646 15.369 -3.684 1.00 21.90 C -ATOM 968 CE2 PHE A 128 15.006 13.229 -4.197 1.00 24.41 C -ATOM 969 CZ PHE A 128 14.491 14.511 -4.397 1.00 19.00 C -ATOM 970 N LEU A 129 11.863 10.701 -1.438 1.00 10.92 N -ATOM 971 CA LEU A 129 11.247 9.983 -2.588 1.00 8.59 C -ATOM 972 C LEU A 129 9.888 9.762 -2.445 1.00 15.58 C -ATOM 973 O LEU A 129 9.123 9.780 -3.420 1.00 12.33 O -ATOM 974 CB LEU A 129 11.971 8.639 -2.709 1.00 11.08 C -ATOM 975 CG LEU A 129 13.553 8.574 -3.067 1.00 16.43 C -ATOM 976 CD1 LEU A 129 14.162 7.385 -2.920 1.00 21.21 C -ATOM 977 CD2 LEU A 129 13.509 9.197 -4.648 1.00 24.11 C -ATOM 978 N ALA A 130 9.315 9.777 -1.285 1.00 13.59 N -ATOM 979 CA ALA A 130 7.861 9.751 -0.992 1.00 12.80 C -ATOM 980 C ALA A 130 7.198 11.000 -1.487 1.00 13.10 C -ATOM 981 O ALA A 130 6.124 11.123 -2.087 1.00 16.72 O -ATOM 982 CB ALA A 130 7.566 9.549 0.507 1.00 11.70 C -ATOM 983 N SER A 131 7.929 12.205 -1.316 1.00 12.15 N -ATOM 984 CA SER A 131 7.318 13.421 -1.788 1.00 17.97 C -ATOM 985 C SER A 131 7.403 13.484 -3.383 1.00 14.23 C -ATOM 986 O SER A 131 6.313 14.078 -3.819 1.00 17.89 O -ATOM 987 CB SER A 131 8.230 14.652 -1.217 1.00 19.09 C -ATOM 988 OG SER A 131 7.985 14.599 -0.027 1.00 34.89 O -ATOM 989 N VAL A 132 8.509 13.092 -3.817 1.00 11.02 N -ATOM 990 CA VAL A 132 8.474 13.187 -5.332 1.00 13.44 C -ATOM 991 C VAL A 132 7.379 12.239 -5.739 1.00 13.26 C -ATOM 992 O VAL A 132 6.574 12.766 -6.727 1.00 14.28 O -ATOM 993 CB VAL A 132 9.676 12.669 -5.775 1.00 17.47 C -ATOM 994 CG1 VAL A 132 9.886 12.366 -7.268 1.00 23.96 C -ATOM 995 CG2 VAL A 132 10.893 13.605 -5.556 1.00 15.24 C -ATOM 996 N SER A 133 7.084 11.034 -5.279 1.00 11.44 N -ATOM 997 CA SER A 133 6.003 10.145 -5.616 1.00 14.28 C -ATOM 998 C SER A 133 4.653 10.824 -5.346 1.00 22.70 C -ATOM 999 O SER A 133 3.857 10.661 -6.312 1.00 18.73 O -ATOM 1000 CB SER A 133 6.206 8.913 -4.797 1.00 14.07 C -ATOM 1001 OG SER A 133 7.326 8.157 -5.136 1.00 16.41 O -ATOM 1002 N THR A 134 4.415 11.603 -4.390 1.00 14.75 N -ATOM 1003 CA THR A 134 3.185 12.188 -4.293 1.00 11.93 C -ATOM 1004 C THR A 134 3.018 13.180 -5.135 1.00 12.33 C -ATOM 1005 O THR A 134 1.906 13.411 -5.657 1.00 15.87 O -ATOM 1006 CB THR A 134 3.337 12.691 -2.840 1.00 23.98 C -ATOM 1007 OG1 THR A 134 3.226 11.963 -1.926 1.00 24.65 O -ATOM 1008 CG2 THR A 134 2.127 13.740 -2.527 1.00 35.48 C -ATOM 1009 N VAL A 135 3.914 14.063 -5.633 1.00 16.85 N -ATOM 1010 CA VAL A 135 3.773 15.122 -6.561 1.00 15.02 C -ATOM 1011 C VAL A 135 3.692 14.401 -7.901 1.00 18.49 C -ATOM 1012 O VAL A 135 2.676 14.854 -8.623 1.00 17.84 O -ATOM 1013 CB VAL A 135 5.097 16.044 -6.643 1.00 21.41 C -ATOM 1014 CG1 VAL A 135 5.125 16.829 -7.908 1.00 28.88 C -ATOM 1015 CG2 VAL A 135 5.265 16.767 -5.381 1.00 18.54 C -ATOM 1016 N LEU A 136 4.254 13.322 -8.291 1.00 15.13 N -ATOM 1017 CA LEU A 136 3.951 12.616 -9.538 1.00 14.14 C -ATOM 1018 C LEU A 136 2.480 12.083 -9.717 1.00 16.82 C -ATOM 1019 O LEU A 136 2.071 11.725 -10.914 1.00 16.56 O -ATOM 1020 CB LEU A 136 5.082 11.671 -9.878 1.00 19.05 C -ATOM 1021 CG LEU A 136 6.468 12.174 -10.486 1.00 19.99 C -ATOM 1022 CD1 LEU A 136 7.357 11.046 -10.401 1.00 23.33 C -ATOM 1023 CD2 LEU A 136 6.502 13.371 -11.272 1.00 20.84 C -ATOM 1024 N THR A 137 1.951 11.790 -8.618 1.00 14.14 N -ATOM 1025 CA THR A 137 0.509 10.996 -8.584 1.00 17.11 C -ATOM 1026 C THR A 137 -0.385 12.070 -8.267 1.00 15.43 C -ATOM 1027 O THR A 137 -1.637 11.700 -8.230 1.00 15.99 O -ATOM 1028 CB THR A 137 0.560 9.964 -6.978 1.00 17.27 C -ATOM 1029 OG1 THR A 137 1.278 8.939 -8.074 1.00 28.37 O -ATOM 1030 CG2 THR A 137 1.320 10.263 -6.388 1.00 47.04 C -ATOM 1031 N SER A 138 -0.164 13.266 -8.168 1.00 16.91 N -ATOM 1032 CA SER A 138 -0.947 14.363 -7.753 1.00 23.51 C -ATOM 1033 C SER A 138 -2.266 14.743 -8.597 1.00 23.60 C -ATOM 1034 O SER A 138 -3.250 14.937 -8.017 1.00 27.80 O -ATOM 1035 CB SER A 138 0.046 16.222 -7.976 1.00 22.76 C -ATOM 1036 OG SER A 138 -0.261 15.617 -6.862 1.00 45.85 O -ATOM 1037 N LYS A 139 -2.026 14.453 -9.807 1.00 19.13 N -ATOM 1038 CA LYS A 139 -3.058 14.995 -10.892 1.00 21.43 C -ATOM 1039 C LYS A 139 -3.804 13.721 -11.284 1.00 18.35 C -ATOM 1040 O LYS A 139 -4.384 13.814 -12.266 1.00 22.16 O -ATOM 1041 CB LYS A 139 -2.474 15.794 -11.975 1.00 24.13 C -ATOM 1042 CG LYS A 139 -1.839 16.973 -11.481 1.00 28.98 C -ATOM 1043 CD LYS A 139 -0.886 17.619 -12.549 1.00 33.18 C -ATOM 1044 CE LYS A 139 -0.495 18.885 -12.192 1.00 52.82 C -ATOM 1045 NZ LYS A 139 0.788 19.253 -13.621 1.00 55.02 N -ATOM 1046 N TYR A 140 -3.715 12.530 -10.777 1.00 17.12 N -ATOM 1047 CA TYR A 140 -4.275 11.374 -11.162 1.00 22.48 C -ATOM 1048 C TYR A 140 -5.830 11.291 -11.160 1.00 18.75 C -ATOM 1049 O TYR A 140 -6.423 10.704 -12.162 1.00 22.47 O -ATOM 1050 CB TYR A 140 -3.896 10.028 -10.426 1.00 23.15 C -ATOM 1051 CG TYR A 140 -2.655 9.444 -11.006 1.00 15.57 C -ATOM 1052 CD1 TYR A 140 -2.495 7.940 -11.096 1.00 16.98 C -ATOM 1053 CD2 TYR A 140 -1.471 10.093 -11.392 1.00 18.11 C -ATOM 1054 CE1 TYR A 140 -1.296 7.400 -11.625 1.00 19.97 C -ATOM 1055 CE2 TYR A 140 -0.267 9.379 -11.806 1.00 14.94 C -ATOM 1056 CZ TYR A 140 -0.246 7.948 -11.911 1.00 17.89 C -ATOM 1057 OH TYR A 140 0.808 7.493 -12.283 1.00 18.05 O -ATOM 1058 N ARG A 141 -6.399 12.034 -10.391 1.00 17.59 N -ATOM 1059 CA ARG A 141 -8.000 12.137 -10.191 1.00 24.58 C -ATOM 1060 C ARG A 141 -8.327 13.610 -9.572 1.00 44.44 C -ATOM 1061 O ARG A 141 -7.492 14.016 -8.882 1.00 21.81 O -ATOM 1062 CB ARG A 141 -8.478 10.914 -9.869 1.00 33.40 C -ATOM 1063 CG ARG A 141 -8.068 10.650 -8.145 1.00 17.28 C -ATOM 1064 CD ARG A 141 -9.053 9.446 -7.867 1.00 14.66 C -ATOM 1065 NE ARG A 141 -8.372 9.269 -6.610 1.00 22.73 N -ATOM 1066 CZ ARG A 141 -9.233 8.420 -5.781 1.00 26.88 C -ATOM 1067 NH1 ARG A 141 -10.147 7.455 -6.079 1.00 23.24 N -ATOM 1068 NH2 ARG A 141 -8.672 8.328 -4.506 1.00 33.34 N -ATOM 1069 OXT ARG A 141 -9.474 13.682 -9.742 1.00 31.52 O -TER 1070 ARG A 141 -ATOM 1071 N VAL B 1 9.223 -20.614 1.365 1.00 46.08 N -ATOM 1072 CA VAL B 1 8.694 -20.026 -0.123 1.00 70.96 C -ATOM 1073 C VAL B 1 9.668 -21.068 -1.645 1.00 69.74 C -ATOM 1074 O VAL B 1 9.370 -22.612 -0.994 1.00 71.82 O -ATOM 1075 CB VAL B 1 9.283 -18.281 -0.381 1.00 59.18 C -ATOM 1076 CG1 VAL B 1 7.449 -17.518 -0.791 1.00 57.89 C -ATOM 1077 CG2 VAL B 1 10.416 -18.038 0.066 1.00 44.20 C -ATOM 1078 N HIS B 2 9.270 -20.650 -2.180 1.00 53.55 N -ATOM 1079 CA HIS B 2 10.245 -21.378 -3.143 1.00 62.62 C -ATOM 1080 C HIS B 2 11.419 -20.331 -4.099 1.00 51.71 C -ATOM 1081 O HIS B 2 11.252 -19.250 -5.024 1.00 48.42 O -ATOM 1082 CB HIS B 2 9.225 -20.955 -4.825 1.00 62.58 C -ATOM 1083 CG HIS B 2 9.378 -21.082 -5.634 1.00 73.96 C -ATOM 1084 ND1 HIS B 2 9.645 -19.683 -6.869 1.00 80.12 N -ATOM 1085 CD2 HIS B 2 10.077 -22.950 -6.116 1.00 63.02 C -ATOM 1086 CE1 HIS B 2 10.672 -21.165 -8.087 1.00 76.40 C -ATOM 1087 NE2 HIS B 2 11.344 -22.584 -7.734 1.00 62.86 N -ATOM 1088 N LEU B 3 12.365 -20.722 -3.649 1.00 43.89 N -ATOM 1089 CA LEU B 3 13.611 -20.183 -4.477 1.00 43.79 C -ATOM 1090 C LEU B 3 14.557 -21.356 -5.125 1.00 32.77 C -ATOM 1091 O LEU B 3 14.340 -22.536 -4.780 1.00 41.84 O -ATOM 1092 CB LEU B 3 14.522 -19.852 -2.996 1.00 28.80 C -ATOM 1093 CG LEU B 3 13.980 -18.598 -2.183 1.00 28.70 C -ATOM 1094 CD1 LEU B 3 14.846 -18.445 -1.199 1.00 63.39 C -ATOM 1095 CD2 LEU B 3 14.509 -17.517 -3.001 1.00 32.10 C -ATOM 1096 N THR B 4 14.840 -20.756 -6.280 1.00 42.35 N -ATOM 1097 CA THR B 4 15.864 -21.825 -6.744 1.00 41.74 C -ATOM 1098 C THR B 4 16.873 -22.187 -6.071 1.00 36.91 C -ATOM 1099 O THR B 4 17.370 -21.395 -5.237 1.00 31.57 O -ATOM 1100 CB THR B 4 15.949 -21.050 -8.090 1.00 38.91 C -ATOM 1101 OG1 THR B 4 16.952 -20.015 -8.082 1.00 52.85 O -ATOM 1102 CG2 THR B 4 14.967 -20.467 -9.056 1.00 56.94 C -ATOM 1103 N PRO B 5 17.854 -23.111 -6.524 1.00 45.56 N -ATOM 1104 CA PRO B 5 18.731 -23.731 -6.023 1.00 47.54 C -ATOM 1105 C PRO B 5 19.935 -22.444 -5.760 1.00 37.80 C -ATOM 1106 O PRO B 5 20.658 -22.372 -4.793 1.00 33.06 O -ATOM 1107 CB PRO B 5 19.534 -24.900 -6.291 1.00 62.12 C -ATOM 1108 CG PRO B 5 18.296 -25.318 -7.157 1.00 42.55 C -ATOM 1109 CD PRO B 5 17.186 -24.560 -7.385 1.00 48.08 C -ATOM 1110 N GLU B 6 19.819 -21.815 -6.978 1.00 27.00 N -ATOM 1111 CA GLU B 6 20.898 -20.991 -7.230 1.00 34.37 C -ATOM 1112 C GLU B 6 20.521 -19.635 -6.155 1.00 23.02 C -ATOM 1113 O GLU B 6 21.687 -18.920 -5.617 1.00 28.54 O -ATOM 1114 CB GLU B 6 20.842 -20.165 -8.661 1.00 37.20 C -ATOM 1115 CG GLU B 6 20.141 -19.957 -9.396 1.00 66.65 C -ATOM 1116 CD GLU B 6 19.153 -21.597 -10.181 1.00 60.44 C -ATOM 1117 OE1 GLU B 6 20.183 -22.830 -9.731 1.00 63.16 O -ATOM 1118 OE2 GLU B 6 18.299 -21.975 -10.007 1.00 70.62 O -ATOM 1119 N GLU B 7 19.362 -19.413 -5.964 1.00 31.47 N -ATOM 1120 CA GLU B 7 18.560 -18.284 -5.124 1.00 34.08 C -ATOM 1121 C GLU B 7 19.160 -18.789 -3.682 1.00 21.49 C -ATOM 1122 O GLU B 7 19.620 -17.847 -3.008 1.00 27.04 O -ATOM 1123 CB GLU B 7 17.625 -18.097 -5.359 1.00 35.55 C -ATOM 1124 CG GLU B 7 17.103 -17.196 -6.791 1.00 33.74 C -ATOM 1125 CD GLU B 7 15.759 -16.911 -6.659 1.00 31.89 C -ATOM 1126 OE1 GLU B 7 15.476 -15.756 -7.225 1.00 52.51 O -ATOM 1127 OE2 GLU B 7 14.748 -17.803 -6.419 1.00 32.56 O -ATOM 1128 N LYS B 8 18.747 -19.865 -3.237 1.00 26.08 N -ATOM 1129 CA LYS B 8 19.026 -20.305 -2.016 1.00 32.23 C -ATOM 1130 C LYS B 8 20.466 -20.216 -1.796 1.00 26.59 C -ATOM 1131 O LYS B 8 21.162 -19.731 -0.601 1.00 26.11 O -ATOM 1132 CB LYS B 8 18.395 -21.925 -1.875 1.00 36.34 C -ATOM 1133 CG LYS B 8 18.802 -22.252 -1.182 1.00 64.20 C -ATOM 1134 CD LYS B 8 18.769 -23.771 -0.248 1.00 73.64 C -ATOM 1135 CE LYS B 8 19.461 -24.137 0.849 1.00 79.30 C -ATOM 1136 NZ LYS B 8 19.874 -26.365 1.034 1.00 66.73 N -ATOM 1137 N SER B 9 21.467 -20.675 -2.533 1.00 23.88 N -ATOM 1138 CA SER B 9 22.559 -20.677 -2.426 1.00 36.76 C -ATOM 1139 C SER B 9 23.490 -19.070 -2.230 1.00 37.61 C -ATOM 1140 O SER B 9 24.284 -18.831 -1.430 1.00 28.84 O -ATOM 1141 CB SER B 9 23.619 -21.853 -3.256 1.00 36.63 C -ATOM 1142 OG SER B 9 23.958 -20.627 -4.033 1.00 64.02 O -ATOM 1143 N ALA B 10 22.719 -18.196 -3.034 1.00 21.54 N -ATOM 1144 CA ALA B 10 23.262 -17.029 -2.963 1.00 32.77 C -ATOM 1145 C ALA B 10 22.792 -16.202 -1.459 1.00 23.64 C -ATOM 1146 O ALA B 10 23.628 -15.408 -0.898 1.00 26.26 O -ATOM 1147 CB ALA B 10 22.504 -16.176 -3.856 1.00 30.88 C -ATOM 1148 N VAL B 11 21.589 -16.575 -0.940 1.00 22.75 N -ATOM 1149 CA VAL B 11 21.174 -16.108 0.417 1.00 18.12 C -ATOM 1150 C VAL B 11 22.242 -16.512 1.434 1.00 18.13 C -ATOM 1151 O VAL B 11 22.655 -15.680 2.245 1.00 19.40 O -ATOM 1152 CB VAL B 11 19.853 -16.542 0.518 1.00 19.48 C -ATOM 1153 CG1 VAL B 11 19.403 -16.415 1.946 1.00 26.15 C -ATOM 1154 CG2 VAL B 11 18.815 -15.702 -0.276 1.00 23.37 C -ATOM 1155 N THR B 12 22.386 -17.775 1.358 1.00 19.01 N -ATOM 1156 CA THR B 12 23.153 -18.592 2.377 1.00 25.04 C -ATOM 1157 C THR B 12 24.569 -18.098 2.437 1.00 20.68 C -ATOM 1158 O THR B 12 25.254 -17.692 3.335 1.00 23.87 O -ATOM 1159 CB THR B 12 23.196 -20.284 2.185 1.00 42.63 C -ATOM 1160 OG1 THR B 12 22.010 -20.433 2.444 1.00 42.78 O -ATOM 1161 CG2 THR B 12 23.729 -20.348 1.974 1.00 67.38 C -ATOM 1162 N ALA B 13 25.190 -17.913 1.267 1.00 22.79 N -ATOM 1163 CA ALA B 13 26.401 -17.387 1.166 1.00 26.66 C -ATOM 1164 C ALA B 13 26.828 -16.135 1.582 1.00 26.26 C -ATOM 1165 O ALA B 13 27.614 -15.809 2.378 1.00 27.07 O -ATOM 1166 CB ALA B 13 26.857 -17.378 -0.445 1.00 26.35 C -ATOM 1167 N LEU B 14 25.928 -14.999 1.236 1.00 15.70 N -ATOM 1168 CA LEU B 14 26.092 -13.737 1.994 1.00 15.10 C -ATOM 1169 C LEU B 14 25.996 -13.791 3.419 1.00 17.25 C -ATOM 1170 O LEU B 14 26.440 -13.013 4.127 1.00 15.43 O -ATOM 1171 CB LEU B 14 25.023 -12.816 1.145 1.00 16.82 C -ATOM 1172 CG LEU B 14 25.284 -11.388 1.257 1.00 27.27 C -ATOM 1173 CD1 LEU B 14 26.470 -10.984 0.911 1.00 40.43 C -ATOM 1174 CD2 LEU B 14 23.923 -10.655 1.151 1.00 24.81 C -ATOM 1175 N TRP B 15 24.847 -14.542 3.847 1.00 17.75 N -ATOM 1176 CA TRP B 15 24.543 -14.533 5.293 1.00 20.73 C -ATOM 1177 C TRP B 15 25.779 -15.040 6.144 1.00 17.66 C -ATOM 1178 O TRP B 15 25.791 -14.500 7.295 1.00 18.75 O -ATOM 1179 CB TRP B 15 23.337 -15.255 5.477 1.00 17.11 C -ATOM 1180 CG TRP B 15 22.785 -14.972 6.964 1.00 17.91 C -ATOM 1181 CD1 TRP B 15 22.809 -15.647 8.020 1.00 21.87 C -ATOM 1182 CD2 TRP B 15 21.992 -13.854 7.213 1.00 17.58 C -ATOM 1183 NE1 TRP B 15 22.135 -15.153 9.079 1.00 18.04 N -ATOM 1184 CE2 TRP B 15 21.659 -13.824 8.669 1.00 16.29 C -ATOM 1185 CE3 TRP B 15 21.610 -12.684 6.475 1.00 16.29 C -ATOM 1186 CZ2 TRP B 15 20.847 -12.810 9.252 1.00 25.87 C -ATOM 1187 CZ3 TRP B 15 20.839 -11.689 7.176 1.00 17.96 C -ATOM 1188 CH2 TRP B 15 20.450 -11.898 8.453 1.00 24.12 C -ATOM 1189 N GLY B 16 26.491 -15.885 5.456 1.00 18.59 N -ATOM 1190 CA GLY B 16 27.793 -16.367 6.203 1.00 18.72 C -ATOM 1191 C GLY B 16 28.640 -15.293 6.479 1.00 24.14 C -ATOM 1192 O GLY B 16 29.526 -15.462 7.418 1.00 24.08 O -ATOM 1193 N LYS B 17 28.533 -14.214 5.902 1.00 16.20 N -ATOM 1194 CA LYS B 17 29.341 -13.100 6.055 1.00 17.17 C -ATOM 1195 C LYS B 17 28.732 -12.165 6.877 1.00 17.84 C -ATOM 1196 O LYS B 17 29.459 -11.044 7.345 1.00 23.03 O -ATOM 1197 CB LYS B 17 29.636 -12.212 4.866 1.00 27.63 C -ATOM 1198 CG LYS B 17 30.260 -13.332 3.793 1.00 26.84 C -ATOM 1199 CD LYS B 17 30.681 -12.758 2.663 1.00 36.92 C -ATOM 1200 CE LYS B 17 31.201 -13.748 1.394 1.00 48.09 C -ATOM 1201 NZ LYS B 17 31.749 -12.471 0.760 1.00 51.60 N -ATOM 1202 N VAL B 18 27.632 -12.163 7.561 1.00 19.79 N -ATOM 1203 CA VAL B 18 26.839 -11.228 8.296 1.00 15.59 C -ATOM 1204 C VAL B 18 27.221 -11.355 9.806 1.00 24.20 C -ATOM 1205 O VAL B 18 27.181 -12.396 10.461 1.00 22.49 O -ATOM 1206 CB VAL B 18 25.375 -11.611 8.249 1.00 13.43 C -ATOM 1207 CG1 VAL B 18 24.680 -10.797 9.203 1.00 20.38 C -ATOM 1208 CG2 VAL B 18 25.124 -10.816 6.753 1.00 25.54 C -ATOM 1209 N ASN B 19 27.508 -10.243 10.525 1.00 20.52 N -ATOM 1210 CA ASN B 19 27.647 -10.334 12.056 1.00 15.58 C -ATOM 1211 C ASN B 19 26.161 -10.008 12.553 1.00 13.56 C -ATOM 1212 O ASN B 19 25.706 -8.798 12.411 1.00 14.77 O -ATOM 1213 CB ASN B 19 28.532 -9.065 12.579 1.00 26.08 C -ATOM 1214 CG ASN B 19 28.340 -8.916 14.065 1.00 29.11 C -ATOM 1215 OD1 ASN B 19 27.732 -9.412 14.784 1.00 27.77 O -ATOM 1216 ND2 ASN B 19 29.702 -8.401 14.383 1.00 33.88 N -ATOM 1217 N VAL B 20 25.621 -11.024 13.009 1.00 18.83 N -ATOM 1218 CA VAL B 20 24.087 -11.031 13.284 1.00 19.05 C -ATOM 1219 C VAL B 20 23.851 -10.149 14.214 1.00 20.02 C -ATOM 1220 O VAL B 20 22.901 -9.142 14.245 1.00 17.50 O -ATOM 1221 CB VAL B 20 23.694 -12.517 13.598 1.00 25.16 C -ATOM 1222 CG1 VAL B 20 22.215 -12.356 13.912 1.00 29.32 C -ATOM 1223 CG2 VAL B 20 23.748 -13.338 12.333 1.00 21.26 C -ATOM 1224 N ASP B 21 24.547 -9.725 15.239 1.00 19.64 N -ATOM 1225 CA ASP B 21 24.274 -8.816 16.395 1.00 20.67 C -ATOM 1226 C ASP B 21 24.562 -7.492 15.870 1.00 18.97 C -ATOM 1227 O ASP B 21 23.606 -6.622 16.080 1.00 21.29 O -ATOM 1228 CB ASP B 21 25.312 -9.108 17.415 1.00 34.10 C -ATOM 1229 CG ASP B 21 25.029 -10.570 18.492 1.00 53.28 C -ATOM 1230 OD1 ASP B 21 23.848 -10.805 18.323 1.00 40.86 O -ATOM 1231 OD2 ASP B 21 25.861 -10.240 19.644 1.00 50.69 O -ATOM 1232 N GLU B 22 25.464 -7.225 14.999 1.00 17.77 N -ATOM 1233 CA GLU B 22 25.739 -5.702 14.538 1.00 21.32 C -ATOM 1234 C GLU B 22 24.523 -5.287 13.546 1.00 17.53 C -ATOM 1235 O GLU B 22 23.957 -4.290 13.703 1.00 21.51 O -ATOM 1236 CB GLU B 22 27.018 -5.846 13.812 1.00 24.38 C -ATOM 1237 CG GLU B 22 27.214 -4.730 13.144 1.00 38.60 C -ATOM 1238 CD GLU B 22 28.169 -3.862 11.812 1.00 75.75 C -ATOM 1239 OE1 GLU B 22 28.555 -5.400 11.034 1.00 53.89 O -ATOM 1240 OE2 GLU B 22 29.808 -4.745 12.821 1.00 65.14 O -ATOM 1241 N VAL B 23 24.347 -6.274 12.578 1.00 19.15 N -ATOM 1242 CA VAL B 23 23.303 -6.039 11.518 1.00 16.52 C -ATOM 1243 C VAL B 23 21.857 -5.985 12.342 1.00 19.25 C -ATOM 1244 O VAL B 23 20.964 -5.128 11.822 1.00 16.10 O -ATOM 1245 CB VAL B 23 23.294 -7.123 10.403 1.00 21.83 C -ATOM 1246 CG1 VAL B 23 22.065 -7.019 9.672 1.00 26.98 C -ATOM 1247 CG2 VAL B 23 24.689 -6.722 9.825 1.00 24.14 C -ATOM 1248 N GLY B 24 21.684 -6.753 13.284 1.00 11.83 N -ATOM 1249 CA GLY B 24 20.512 -6.666 14.003 1.00 15.96 C -ATOM 1250 C GLY B 24 20.131 -5.391 14.689 1.00 15.32 C -ATOM 1251 O GLY B 24 19.133 -4.694 14.628 1.00 13.59 O -ATOM 1252 N GLY B 25 21.093 -4.853 15.395 1.00 19.52 N -ATOM 1253 CA GLY B 25 21.202 -3.549 15.972 1.00 15.79 C -ATOM 1254 C GLY B 25 20.921 -2.401 14.917 1.00 12.82 C -ATOM 1255 O GLY B 25 20.200 -1.481 15.135 1.00 18.05 O -ATOM 1256 N GLU B 26 21.598 -2.510 13.849 1.00 12.16 N -ATOM 1257 CA GLU B 26 21.567 -1.493 12.736 1.00 11.32 C -ATOM 1258 C GLU B 26 20.042 -1.534 12.176 1.00 13.79 C -ATOM 1259 O GLU B 26 19.605 -0.362 11.944 1.00 14.59 O -ATOM 1260 CB GLU B 26 22.564 -1.757 11.778 1.00 13.18 C -ATOM 1261 CG GLU B 26 23.022 -0.301 10.974 1.00 29.90 C -ATOM 1262 CD GLU B 26 23.535 0.894 10.508 1.00 51.34 C -ATOM 1263 OE1 GLU B 26 23.767 -0.209 7.916 1.00 54.93 O -ATOM 1264 OE2 GLU B 26 24.549 -1.302 10.298 1.00 37.93 O -ATOM 1265 N ALA B 27 19.659 -2.698 11.904 1.00 13.14 N -ATOM 1266 CA ALA B 27 18.339 -2.622 11.197 1.00 9.05 C -ATOM 1267 C ALA B 27 17.188 -2.188 12.064 1.00 10.83 C -ATOM 1268 O ALA B 27 16.247 -1.538 11.698 1.00 11.12 O -ATOM 1269 CB ALA B 27 18.124 -4.039 10.850 1.00 14.07 C -ATOM 1270 N LEU B 28 17.097 -2.654 13.364 1.00 11.19 N -ATOM 1271 CA LEU B 28 16.289 -2.225 14.403 1.00 14.47 C -ATOM 1272 C LEU B 28 16.216 -0.842 14.498 1.00 12.13 C -ATOM 1273 O LEU B 28 15.292 -0.024 14.599 1.00 12.32 O -ATOM 1274 CB LEU B 28 16.089 -3.101 15.599 1.00 9.21 C -ATOM 1275 CG LEU B 28 14.602 -2.613 16.344 1.00 20.67 C -ATOM 1276 CD1 LEU B 28 13.558 -3.287 15.723 1.00 17.60 C -ATOM 1277 CD2 LEU B 28 15.036 -3.349 17.556 1.00 34.99 C -ATOM 1278 N GLY B 29 17.488 -0.244 14.733 1.00 10.00 N -ATOM 1279 CA GLY B 29 17.555 1.107 14.942 1.00 15.27 C -ATOM 1280 C GLY B 29 17.147 1.979 13.686 1.00 10.88 C -ATOM 1281 O GLY B 29 16.406 2.945 13.855 1.00 14.42 O -ATOM 1282 N ARG B 30 17.503 1.503 12.514 1.00 11.39 N -ATOM 1283 CA ARG B 30 17.138 2.392 11.410 1.00 14.49 C -ATOM 1284 C ARG B 30 15.517 2.168 11.180 1.00 10.79 C -ATOM 1285 O ARG B 30 14.997 3.218 10.749 1.00 13.81 O -ATOM 1286 CB ARG B 30 17.883 1.854 10.134 1.00 19.88 C -ATOM 1287 CG ARG B 30 19.264 2.550 9.848 1.00 16.11 C -ATOM 1288 CD ARG B 30 19.816 1.919 8.615 1.00 14.71 C -ATOM 1289 NE ARG B 30 21.229 2.190 8.567 1.00 21.05 N -ATOM 1290 CZ ARG B 30 21.899 3.048 7.943 1.00 18.56 C -ATOM 1291 NH1 ARG B 30 21.169 3.859 7.078 1.00 19.13 N -ATOM 1292 NH2 ARG B 30 23.126 3.441 7.930 1.00 19.91 N -ATOM 1293 N LEU B 31 14.954 1.034 11.546 1.00 12.04 N -ATOM 1294 CA LEU B 31 13.557 0.954 11.581 1.00 10.54 C -ATOM 1295 C LEU B 31 13.079 2.129 12.312 1.00 13.93 C -ATOM 1296 O LEU B 31 12.053 2.837 11.993 1.00 14.67 O -ATOM 1297 CB LEU B 31 12.999 -0.394 11.933 1.00 12.99 C -ATOM 1298 CG LEU B 31 11.476 -0.524 12.150 1.00 10.97 C -ATOM 1299 CD1 LEU B 31 11.036 -0.535 10.722 1.00 19.46 C -ATOM 1300 CD2 LEU B 31 11.106 -1.700 13.040 1.00 13.98 C -ATOM 1301 N LEU B 32 13.531 2.329 13.530 1.00 10.13 N -ATOM 1302 CA LEU B 32 12.882 3.156 14.401 1.00 11.52 C -ATOM 1303 C LEU B 32 13.149 4.616 14.057 1.00 12.11 C -ATOM 1304 O LEU B 32 12.467 5.633 14.438 1.00 15.31 O -ATOM 1305 CB LEU B 32 13.453 3.038 15.919 1.00 11.75 C -ATOM 1306 CG LEU B 32 12.805 1.940 16.581 1.00 16.68 C -ATOM 1307 CD1 LEU B 32 12.104 0.941 16.260 1.00 22.26 C -ATOM 1308 CD2 LEU B 32 13.566 1.603 17.835 1.00 28.90 C -ATOM 1309 N VAL B 33 14.250 4.899 13.351 1.00 10.32 N -ATOM 1310 CA VAL B 33 14.628 6.174 12.868 1.00 11.98 C -ATOM 1311 C VAL B 33 13.704 6.548 11.535 1.00 12.10 C -ATOM 1312 O VAL B 33 13.345 7.771 11.481 1.00 13.28 O -ATOM 1313 CB VAL B 33 16.139 6.304 12.522 1.00 14.87 C -ATOM 1314 CG1 VAL B 33 16.518 7.591 11.880 1.00 11.54 C -ATOM 1315 CG2 VAL B 33 16.745 6.275 13.788 1.00 16.57 C -ATOM 1316 N VAL B 34 13.820 5.650 10.638 1.00 13.66 N -ATOM 1317 CA VAL B 34 13.156 6.096 9.258 1.00 9.59 C -ATOM 1318 C VAL B 34 11.591 6.042 9.368 1.00 8.72 C -ATOM 1319 O VAL B 34 11.052 6.910 8.763 1.00 9.42 O -ATOM 1320 CB VAL B 34 13.681 5.042 8.326 1.00 9.09 C -ATOM 1321 CG1 VAL B 34 13.079 5.328 6.958 1.00 9.82 C -ATOM 1322 CG2 VAL B 34 15.076 5.133 8.253 1.00 17.00 C -ATOM 1323 N TYR B 35 11.088 5.155 10.260 1.00 10.80 N -ATOM 1324 CA TYR B 35 9.613 5.019 10.405 1.00 13.73 C -ATOM 1325 C TYR B 35 9.249 5.241 11.959 1.00 14.87 C -ATOM 1326 O TYR B 35 9.056 4.156 12.514 1.00 16.30 O -ATOM 1327 CB TYR B 35 9.162 3.628 9.962 1.00 14.97 C -ATOM 1328 CG TYR B 35 9.590 3.397 8.554 1.00 16.57 C -ATOM 1329 CD1 TYR B 35 9.059 4.138 7.400 1.00 17.11 C -ATOM 1330 CD2 TYR B 35 10.495 2.446 8.096 1.00 21.02 C -ATOM 1331 CE1 TYR B 35 9.473 3.862 6.085 1.00 16.53 C -ATOM 1332 CE2 TYR B 35 10.987 2.455 6.905 1.00 21.07 C -ATOM 1333 CZ TYR B 35 10.434 2.948 5.860 1.00 16.91 C -ATOM 1334 OH TYR B 35 11.073 2.851 4.537 1.00 21.07 O -ATOM 1335 N PRO B 36 9.337 6.384 12.381 1.00 18.32 N -ATOM 1336 CA PRO B 36 9.299 6.665 13.797 1.00 15.72 C -ATOM 1337 C PRO B 36 8.010 6.232 14.403 1.00 27.07 C -ATOM 1338 O PRO B 36 8.028 5.977 15.694 1.00 15.67 O -ATOM 1339 CB PRO B 36 9.448 8.143 14.056 1.00 16.26 C -ATOM 1340 CG PRO B 36 9.504 8.813 12.839 1.00 21.27 C -ATOM 1341 CD PRO B 36 9.498 7.681 11.841 1.00 25.93 C -ATOM 1342 N TRP B 37 6.917 5.884 13.840 1.00 14.10 N -ATOM 1343 CA TRP B 37 5.821 5.395 14.601 1.00 12.74 C -ATOM 1344 C TRP B 37 5.965 3.976 15.036 1.00 15.06 C -ATOM 1345 O TRP B 37 5.268 3.465 15.926 1.00 15.27 O -ATOM 1346 CB TRP B 37 4.670 5.475 13.490 1.00 19.41 C -ATOM 1347 CG TRP B 37 4.766 4.831 12.253 1.00 14.79 C -ATOM 1348 CD1 TRP B 37 4.298 3.513 11.774 1.00 18.82 C -ATOM 1349 CD2 TRP B 37 5.265 5.442 10.984 1.00 18.23 C -ATOM 1350 NE1 TRP B 37 4.669 3.435 10.535 1.00 23.72 N -ATOM 1351 CE2 TRP B 37 5.184 4.400 9.923 1.00 22.13 C -ATOM 1352 CE3 TRP B 37 5.947 6.691 10.672 1.00 21.52 C -ATOM 1353 CZ2 TRP B 37 5.584 4.556 8.589 1.00 18.19 C -ATOM 1354 CZ3 TRP B 37 6.183 6.773 9.398 1.00 31.71 C -ATOM 1355 CH2 TRP B 37 6.069 5.844 8.520 1.00 14.12 C -ATOM 1356 N THR B 38 7.039 3.221 14.646 1.00 14.17 N -ATOM 1357 CA THR B 38 7.466 1.912 14.979 1.00 13.46 C -ATOM 1358 C THR B 38 7.760 1.960 16.519 1.00 16.65 C -ATOM 1359 O THR B 38 8.073 0.918 17.118 1.00 18.86 O -ATOM 1360 CB THR B 38 8.456 1.107 14.212 1.00 12.74 C -ATOM 1361 OG1 THR B 38 9.507 1.962 14.105 1.00 14.09 O -ATOM 1362 CG2 THR B 38 7.863 1.128 12.798 1.00 15.42 C -ATOM 1363 N GLN B 39 8.203 3.108 16.922 1.00 19.91 N -ATOM 1364 CA GLN B 39 8.656 3.567 18.379 1.00 23.22 C -ATOM 1365 C GLN B 39 7.604 3.201 19.358 1.00 19.19 C -ATOM 1366 O GLN B 39 7.968 2.987 20.495 1.00 19.29 O -ATOM 1367 CB GLN B 39 9.277 4.878 18.529 1.00 24.35 C -ATOM 1368 CG GLN B 39 10.405 5.137 17.759 1.00 25.27 C -ATOM 1369 CD GLN B 39 10.983 6.633 17.918 1.00 24.35 C -ATOM 1370 OE1 GLN B 39 10.480 7.189 18.922 1.00 26.75 O -ATOM 1371 NE2 GLN B 39 11.852 7.006 16.956 1.00 30.18 N -ATOM 1372 N ARG B 40 6.347 3.079 18.900 1.00 20.02 N -ATOM 1373 CA ARG B 40 5.184 2.850 19.816 1.00 21.80 C -ATOM 1374 C ARG B 40 5.511 1.455 20.630 1.00 29.36 C -ATOM 1375 O ARG B 40 4.888 1.619 21.749 1.00 24.42 O -ATOM 1376 CB ARG B 40 3.944 2.700 18.938 1.00 16.52 C -ATOM 1377 CG ARG B 40 3.694 1.420 18.404 1.00 20.34 C -ATOM 1378 CD ARG B 40 2.451 1.519 17.302 1.00 25.31 C -ATOM 1379 NE ARG B 40 1.370 1.856 17.810 1.00 29.70 N -ATOM 1380 CZ ARG B 40 0.400 1.022 18.648 1.00 34.46 C -ATOM 1381 NH1 ARG B 40 0.678 -0.097 18.556 1.00 31.34 N -ATOM 1382 NH2 ARG B 40 -0.783 2.010 18.877 1.00 39.12 N -ATOM 1383 N PHE B 41 6.149 0.541 20.453 1.00 19.21 N -ATOM 1384 CA PHE B 41 6.133 -0.730 21.151 1.00 16.53 C -ATOM 1385 C PHE B 41 7.442 -0.621 22.343 1.00 21.34 C -ATOM 1386 O PHE B 41 7.412 -1.538 22.897 1.00 23.45 O -ATOM 1387 CB PHE B 41 6.675 -1.804 20.080 1.00 10.39 C -ATOM 1388 CG PHE B 41 5.553 -1.984 19.152 1.00 13.84 C -ATOM 1389 CD1 PHE B 41 5.763 -1.448 17.828 1.00 17.38 C -ATOM 1390 CD2 PHE B 41 4.239 -2.655 19.578 1.00 25.55 C -ATOM 1391 CE1 PHE B 41 4.713 -1.720 16.922 1.00 15.72 C -ATOM 1392 CE2 PHE B 41 3.272 -2.680 18.459 1.00 21.40 C -ATOM 1393 CZ PHE B 41 3.586 -2.146 17.207 1.00 13.46 C -ATOM 1394 N PHE B 42 8.072 0.397 22.159 1.00 18.41 N -ATOM 1395 CA PHE B 42 9.433 0.476 22.639 1.00 17.88 C -ATOM 1396 C PHE B 42 9.683 1.552 23.631 1.00 26.28 C -ATOM 1397 O PHE B 42 10.712 1.963 24.025 1.00 30.16 O -ATOM 1398 CB PHE B 42 10.561 0.553 21.602 1.00 16.57 C -ATOM 1399 CG PHE B 42 10.524 -0.621 20.906 1.00 18.87 C -ATOM 1400 CD1 PHE B 42 10.208 -0.431 19.261 1.00 17.08 C -ATOM 1401 CD2 PHE B 42 10.804 -1.937 21.065 1.00 17.75 C -ATOM 1402 CE1 PHE B 42 10.137 -1.716 18.672 1.00 12.34 C -ATOM 1403 CE2 PHE B 42 10.625 -2.998 20.314 1.00 16.32 C -ATOM 1404 CZ PHE B 42 10.370 -2.870 18.826 1.00 14.29 C -ATOM 1405 N GLU B 43 8.703 2.022 24.176 1.00 32.94 N -ATOM 1406 CA GLU B 43 9.021 3.274 25.060 1.00 42.17 C -ATOM 1407 C GLU B 43 9.315 2.924 26.617 1.00 21.09 C -ATOM 1408 O GLU B 43 10.204 3.362 27.291 1.00 37.55 O -ATOM 1409 CB GLU B 43 7.798 3.586 25.059 1.00 73.91 C -ATOM 1410 CG GLU B 43 6.528 3.291 25.915 1.00 61.81 C -ATOM 1411 CD GLU B 43 4.777 4.930 25.558 1.00 78.77 C -ATOM 1412 OE1 GLU B 43 5.276 5.543 25.252 1.00 63.33 O -ATOM 1413 OE2 GLU B 43 4.274 3.783 26.403 1.00 59.41 O -ATOM 1414 N SER B 44 9.424 1.477 26.805 1.00 22.68 N -ATOM 1415 CA SER B 44 10.261 0.951 28.039 1.00 28.45 C -ATOM 1416 C SER B 44 11.527 1.680 27.935 1.00 36.10 C -ATOM 1417 O SER B 44 12.578 0.776 28.511 1.00 25.24 O -ATOM 1418 CB SER B 44 9.957 -0.409 28.119 1.00 27.61 C -ATOM 1419 OG SER B 44 10.204 -1.503 27.766 1.00 37.26 O -ATOM 1420 N PHE B 45 12.292 1.349 26.626 1.00 28.36 N -ATOM 1421 CA PHE B 45 13.648 1.329 26.186 1.00 25.47 C -ATOM 1422 C PHE B 45 14.197 2.590 26.508 1.00 26.28 C -ATOM 1423 O PHE B 45 15.451 2.670 26.190 1.00 31.39 O -ATOM 1424 CB PHE B 45 13.618 0.947 24.623 1.00 22.10 C -ATOM 1425 CG PHE B 45 13.541 -0.652 24.249 1.00 18.85 C -ATOM 1426 CD1 PHE B 45 13.939 -0.880 22.983 1.00 29.27 C -ATOM 1427 CD2 PHE B 45 12.982 -1.450 24.626 1.00 31.57 C -ATOM 1428 CE1 PHE B 45 13.682 -2.441 22.618 1.00 29.02 C -ATOM 1429 CE2 PHE B 45 12.642 -2.810 24.625 1.00 30.34 C -ATOM 1430 CZ PHE B 45 13.202 -2.999 23.312 1.00 36.33 C -ATOM 1431 N GLY B 46 13.772 3.730 26.937 1.00 39.28 N -ATOM 1432 CA GLY B 46 14.529 4.785 27.301 1.00 46.90 C -ATOM 1433 C GLY B 46 14.720 5.977 26.137 1.00 45.06 C -ATOM 1434 O GLY B 46 13.492 6.152 25.410 1.00 36.42 O -ATOM 1435 N ASP B 47 15.717 6.365 26.037 1.00 38.00 N -ATOM 1436 CA ASP B 47 15.729 7.801 25.184 1.00 38.15 C -ATOM 1437 C ASP B 47 16.096 7.362 23.534 1.00 25.86 C -ATOM 1438 O ASP B 47 16.860 6.380 23.281 1.00 25.46 O -ATOM 1439 CB ASP B 47 17.237 8.136 25.516 1.00 44.07 C -ATOM 1440 CG ASP B 47 17.345 9.494 25.209 1.00 52.06 C -ATOM 1441 OD1 ASP B 47 18.506 10.069 24.917 1.00 44.54 O -ATOM 1442 OD2 ASP B 47 16.192 10.248 24.076 1.00 35.33 O -ATOM 1443 N LEU B 48 14.758 7.696 22.981 1.00 25.27 N -ATOM 1444 CA LEU B 48 14.475 7.473 21.435 1.00 28.75 C -ATOM 1445 C LEU B 48 14.468 8.903 20.740 1.00 27.19 C -ATOM 1446 O LEU B 48 13.953 8.921 19.724 1.00 27.20 O -ATOM 1447 CB LEU B 48 13.484 6.505 21.317 1.00 23.96 C -ATOM 1448 CG LEU B 48 13.754 5.148 21.718 1.00 24.35 C -ATOM 1449 CD1 LEU B 48 12.414 4.237 21.541 1.00 34.74 C -ATOM 1450 CD2 LEU B 48 14.775 4.377 21.408 1.00 34.58 C -ATOM 1451 N SER B 49 15.103 9.812 21.342 1.00 41.94 N -ATOM 1452 CA SER B 49 14.421 11.168 20.634 1.00 46.28 C -ATOM 1453 C SER B 49 15.582 11.613 20.219 1.00 38.86 C -ATOM 1454 O SER B 49 14.817 12.605 18.942 1.00 41.94 O -ATOM 1455 CB SER B 49 14.717 12.244 22.089 1.00 37.98 C -ATOM 1456 OG SER B 49 16.403 12.088 22.302 1.00 37.71 O -ATOM 1457 N THR B 50 16.507 11.264 19.343 1.00 28.29 N -ATOM 1458 CA THR B 50 17.236 11.360 18.289 1.00 30.77 C -ATOM 1459 C THR B 50 17.885 10.175 17.455 1.00 28.12 C -ATOM 1460 O THR B 50 17.899 9.107 18.221 1.00 25.38 O -ATOM 1461 CB THR B 50 18.076 12.160 18.824 1.00 33.39 C -ATOM 1462 OG1 THR B 50 19.415 11.795 19.160 1.00 37.96 O -ATOM 1463 CG2 THR B 50 18.083 13.812 19.397 1.00 29.64 C -ATOM 1464 N PRO B 51 18.477 10.443 16.283 1.00 28.96 N -ATOM 1465 CA PRO B 51 18.840 9.268 15.580 1.00 22.25 C -ATOM 1466 C PRO B 51 20.003 8.659 16.259 1.00 19.80 C -ATOM 1467 O PRO B 51 20.229 7.322 16.651 1.00 21.55 O -ATOM 1468 CB PRO B 51 19.279 9.752 14.257 1.00 27.29 C -ATOM 1469 CG PRO B 51 18.236 10.849 14.019 1.00 23.54 C -ATOM 1470 CD PRO B 51 18.120 11.592 15.204 1.00 26.04 C -ATOM 1471 N ASP B 52 20.955 9.490 16.887 1.00 21.99 N -ATOM 1472 CA ASP B 52 22.107 9.063 17.596 1.00 20.50 C -ATOM 1473 C ASP B 52 21.711 8.282 18.816 1.00 16.32 C -ATOM 1474 O ASP B 52 22.264 7.261 19.307 1.00 25.55 O -ATOM 1475 CB ASP B 52 22.971 10.246 17.966 1.00 32.17 C -ATOM 1476 CG ASP B 52 24.234 10.367 16.728 1.00 47.24 C -ATOM 1477 OD1 ASP B 52 24.140 9.731 15.886 1.00 41.78 O -ATOM 1478 OD2 ASP B 52 24.041 11.689 16.359 1.00 62.08 O -ATOM 1479 N ALA B 53 20.654 8.843 19.515 1.00 23.18 N -ATOM 1480 CA ALA B 53 20.143 8.181 20.776 1.00 24.60 C -ATOM 1481 C ALA B 53 19.728 6.737 20.669 1.00 20.91 C -ATOM 1482 O ALA B 53 19.736 5.693 21.187 1.00 20.19 O -ATOM 1483 CB ALA B 53 19.176 8.937 21.371 1.00 23.45 C -ATOM 1484 N VAL B 54 18.925 6.610 19.428 1.00 19.02 N -ATOM 1485 CA VAL B 54 18.396 5.367 18.970 1.00 17.30 C -ATOM 1486 C VAL B 54 19.363 4.542 18.660 1.00 15.03 C -ATOM 1487 O VAL B 54 19.429 3.266 19.120 1.00 19.06 O -ATOM 1488 CB VAL B 54 17.268 5.613 17.733 1.00 27.63 C -ATOM 1489 CG1 VAL B 54 17.019 4.214 17.213 1.00 22.46 C -ATOM 1490 CG2 VAL B 54 16.224 6.564 17.992 1.00 27.27 C -ATOM 1491 N MET B 55 20.370 4.888 17.834 1.00 21.73 N -ATOM 1492 CA MET B 55 21.262 3.920 17.351 1.00 17.86 C -ATOM 1493 C MET B 55 22.215 3.437 18.454 1.00 32.16 C -ATOM 1494 O MET B 55 22.701 2.355 18.174 1.00 26.15 O -ATOM 1495 CB MET B 55 22.167 4.509 16.152 1.00 19.12 C -ATOM 1496 CG MET B 55 21.367 4.924 14.914 1.00 18.10 C -ATOM 1497 SD MET B 55 20.328 3.573 14.221 1.00 21.28 S -ATOM 1498 CE MET B 55 21.373 2.471 13.659 1.00 20.66 C -ATOM 1499 N GLY B 56 22.406 4.339 19.361 1.00 24.42 N -ATOM 1500 CA GLY B 56 23.329 3.841 20.456 1.00 36.79 C -ATOM 1501 C GLY B 56 22.514 3.565 21.746 1.00 33.28 C -ATOM 1502 O GLY B 56 23.093 2.903 22.699 1.00 24.94 O -ATOM 1503 N ASN B 57 21.348 2.997 21.778 1.00 22.01 N -ATOM 1504 CA ASN B 57 20.559 2.685 22.827 1.00 15.71 C -ATOM 1505 C ASN B 57 20.755 1.267 22.976 1.00 17.88 C -ATOM 1506 O ASN B 57 20.502 0.300 22.098 1.00 18.04 O -ATOM 1507 CB ASN B 57 19.144 2.920 22.701 1.00 21.80 C -ATOM 1508 CG ASN B 57 18.247 2.358 23.776 1.00 18.78 C -ATOM 1509 OD1 ASN B 57 18.261 1.376 24.212 1.00 23.41 O -ATOM 1510 ND2 ASN B 57 17.583 3.338 24.270 1.00 26.53 N -ATOM 1511 N PRO B 58 21.174 0.662 24.086 1.00 24.81 N -ATOM 1512 CA PRO B 58 21.379 -0.699 24.384 1.00 24.38 C -ATOM 1513 C PRO B 58 20.320 -1.707 24.238 1.00 16.45 C -ATOM 1514 O PRO B 58 20.621 -2.865 23.942 1.00 22.03 O -ATOM 1515 CB PRO B 58 22.199 -0.585 25.810 1.00 41.00 C -ATOM 1516 CG PRO B 58 21.985 0.546 26.007 1.00 36.46 C -ATOM 1517 CD PRO B 58 21.572 1.751 25.438 1.00 41.75 C -ATOM 1518 N LYS B 59 19.129 -1.092 24.601 1.00 16.03 N -ATOM 1519 CA LYS B 59 17.877 -2.002 24.599 1.00 22.04 C -ATOM 1520 C LYS B 59 17.389 -2.185 23.113 1.00 13.98 C -ATOM 1521 O LYS B 59 17.132 -3.370 22.712 1.00 15.67 O -ATOM 1522 CB LYS B 59 16.893 -1.439 25.346 1.00 22.22 C -ATOM 1523 CG LYS B 59 17.003 -1.840 26.817 1.00 45.70 C -ATOM 1524 CD LYS B 59 17.133 -0.988 27.329 1.00 44.05 C -ATOM 1525 CE LYS B 59 17.311 -2.126 29.392 1.00 71.22 C -ATOM 1526 NZ LYS B 59 16.304 -0.516 29.672 1.00 61.54 N -ATOM 1527 N VAL B 60 17.762 -1.228 22.435 1.00 17.28 N -ATOM 1528 CA VAL B 60 17.489 -1.267 20.987 1.00 18.21 C -ATOM 1529 C VAL B 60 18.198 -2.383 20.467 1.00 17.60 C -ATOM 1530 O VAL B 60 18.065 -3.331 19.597 1.00 19.11 O -ATOM 1531 CB VAL B 60 17.415 0.000 20.196 1.00 19.15 C -ATOM 1532 CG1 VAL B 60 17.700 -0.242 18.743 1.00 20.44 C -ATOM 1533 CG2 VAL B 60 16.452 0.957 20.699 1.00 20.64 C -ATOM 1534 N LYS B 61 19.612 -2.162 20.575 1.00 16.19 N -ATOM 1535 CA LYS B 61 20.529 -3.146 20.062 1.00 15.00 C -ATOM 1536 C LYS B 61 20.399 -4.610 20.622 1.00 17.90 C -ATOM 1537 O LYS B 61 20.213 -5.649 19.890 1.00 20.52 O -ATOM 1538 CB LYS B 61 21.934 -2.794 20.686 1.00 23.50 C -ATOM 1539 CG LYS B 61 22.389 -1.790 20.123 1.00 34.21 C -ATOM 1540 CD LYS B 61 23.914 -1.121 21.095 1.00 48.05 C -ATOM 1541 CE LYS B 61 24.659 -0.514 19.697 1.00 65.12 C -ATOM 1542 NZ LYS B 61 25.928 0.153 20.694 1.00 66.26 N -ATOM 1543 N ALA B 62 19.935 -4.789 21.817 1.00 18.99 N -ATOM 1544 CA ALA B 62 19.613 -6.179 22.281 1.00 20.11 C -ATOM 1545 C ALA B 62 18.327 -6.740 21.532 1.00 23.44 C -ATOM 1546 O ALA B 62 18.260 -7.852 21.400 1.00 21.26 O -ATOM 1547 CB ALA B 62 19.287 -6.023 23.792 1.00 28.90 C -ATOM 1548 N HIS B 63 17.361 -5.800 21.608 1.00 20.40 N -ATOM 1549 CA HIS B 63 16.190 -6.291 20.805 1.00 18.39 C -ATOM 1550 C HIS B 63 16.516 -6.639 19.256 1.00 14.88 C -ATOM 1551 O HIS B 63 16.111 -7.828 18.863 1.00 18.29 O -ATOM 1552 CB HIS B 63 15.116 -5.410 20.859 1.00 22.46 C -ATOM 1553 CG HIS B 63 13.751 -5.776 20.554 1.00 25.19 C -ATOM 1554 ND1 HIS B 63 13.281 -7.248 21.117 1.00 24.68 N -ATOM 1555 CD2 HIS B 63 13.005 -5.716 19.310 1.00 20.46 C -ATOM 1556 CE1 HIS B 63 11.969 -7.447 20.274 1.00 21.48 C -ATOM 1557 NE2 HIS B 63 11.891 -6.627 19.400 1.00 20.00 N -ATOM 1558 N GLY B 64 17.369 -5.912 18.807 1.00 15.81 N -ATOM 1559 CA GLY B 64 17.753 -6.266 17.372 1.00 16.57 C -ATOM 1560 C GLY B 64 18.356 -7.523 17.041 1.00 14.05 C -ATOM 1561 O GLY B 64 18.321 -8.353 16.306 1.00 17.38 O -ATOM 1562 N LYS B 65 19.222 -7.845 18.080 1.00 15.77 N -ATOM 1563 CA LYS B 65 19.749 -9.096 18.187 1.00 17.79 C -ATOM 1564 C LYS B 65 18.945 -10.321 18.319 1.00 18.32 C -ATOM 1565 O LYS B 65 19.205 -11.332 17.796 1.00 19.33 O -ATOM 1566 CB LYS B 65 21.117 -9.195 19.352 1.00 34.65 C -ATOM 1567 CG LYS B 65 20.823 -9.337 19.828 1.00 64.04 C -ATOM 1568 CD LYS B 65 22.866 -9.404 21.254 1.00 58.77 C -ATOM 1569 CE LYS B 65 21.591 -11.376 21.213 1.00 64.47 C -ATOM 1570 NZ LYS B 65 22.762 -11.190 23.512 1.00 67.19 N -ATOM 1571 N LYS B 66 17.979 -10.126 19.094 1.00 17.45 N -ATOM 1572 CA LYS B 66 17.297 -11.071 19.293 1.00 20.10 C -ATOM 1573 C LYS B 66 16.171 -11.403 18.033 1.00 21.06 C -ATOM 1574 O LYS B 66 15.915 -12.596 17.725 1.00 17.84 O -ATOM 1575 CB LYS B 66 16.183 -10.827 20.504 1.00 22.19 C -ATOM 1576 CG LYS B 66 15.115 -11.668 20.860 1.00 40.97 C -ATOM 1577 CD LYS B 66 14.348 -11.289 22.165 1.00 49.22 C -ATOM 1578 CE LYS B 66 14.883 -13.426 23.031 1.00 72.58 C -ATOM 1579 NZ LYS B 66 13.505 -13.329 24.195 1.00 70.66 N -ATOM 1580 N VAL B 67 15.722 -10.213 17.591 1.00 16.93 N -ATOM 1581 CA VAL B 67 14.967 -10.430 16.204 1.00 19.22 C -ATOM 1582 C VAL B 67 15.793 -10.926 15.110 1.00 11.08 C -ATOM 1583 O VAL B 67 15.419 -12.032 14.481 1.00 14.57 O -ATOM 1584 CB VAL B 67 14.239 -9.056 15.913 1.00 21.56 C -ATOM 1585 CG1 VAL B 67 13.929 -8.835 14.427 1.00 18.58 C -ATOM 1586 CG2 VAL B 67 13.400 -8.550 17.010 1.00 21.34 C -ATOM 1587 N LEU B 68 16.954 -10.461 14.916 1.00 11.62 N -ATOM 1588 CA LEU B 68 17.765 -11.045 13.835 1.00 15.23 C -ATOM 1589 C LEU B 68 18.198 -12.546 14.030 1.00 13.22 C -ATOM 1590 O LEU B 68 18.576 -13.320 13.014 1.00 14.49 O -ATOM 1591 CB LEU B 68 18.788 -10.157 13.424 1.00 22.80 C -ATOM 1592 CG LEU B 68 18.947 -9.620 11.990 1.00 26.57 C -ATOM 1593 CD1 LEU B 68 20.192 -10.323 11.868 1.00 62.38 C -ATOM 1594 CD2 LEU B 68 17.922 -9.301 11.306 1.00 35.30 C -ATOM 1595 N GLY B 69 18.512 -12.954 15.230 1.00 14.77 N -ATOM 1596 CA GLY B 69 18.843 -14.169 15.499 1.00 20.29 C -ATOM 1597 C GLY B 69 17.847 -15.440 15.178 1.00 17.59 C -ATOM 1598 O GLY B 69 17.982 -16.324 14.534 1.00 19.02 O -ATOM 1599 N ALA B 70 16.471 -14.870 15.541 1.00 19.76 N -ATOM 1600 CA ALA B 70 15.432 -15.582 15.055 1.00 20.35 C -ATOM 1601 C ALA B 70 15.296 -15.691 13.506 1.00 16.36 C -ATOM 1602 O ALA B 70 14.996 -16.706 12.805 1.00 18.12 O -ATOM 1603 CB ALA B 70 14.137 -15.174 15.556 1.00 18.92 C -ATOM 1604 N PHE B 71 15.441 -14.520 12.868 1.00 14.47 N -ATOM 1605 CA PHE B 71 15.473 -14.523 11.393 1.00 18.37 C -ATOM 1606 C PHE B 71 16.681 -15.484 10.885 1.00 23.80 C -ATOM 1607 O PHE B 71 16.324 -16.238 10.064 1.00 20.23 O -ATOM 1608 CB PHE B 71 15.760 -13.050 11.104 1.00 13.73 C -ATOM 1609 CG PHE B 71 15.796 -12.885 9.606 1.00 18.08 C -ATOM 1610 CD1 PHE B 71 14.729 -12.558 8.930 1.00 25.10 C -ATOM 1611 CD2 PHE B 71 17.072 -12.967 8.830 1.00 17.17 C -ATOM 1612 CE1 PHE B 71 14.623 -12.282 7.460 1.00 19.10 C -ATOM 1613 CE2 PHE B 71 16.901 -12.741 7.550 1.00 22.20 C -ATOM 1614 CZ PHE B 71 15.701 -12.364 6.812 1.00 12.94 C -ATOM 1615 N SER B 72 17.595 -15.502 11.393 1.00 20.10 N -ATOM 1616 CA SER B 72 18.969 -16.288 11.125 1.00 20.52 C -ATOM 1617 C SER B 72 18.446 -17.702 11.027 1.00 24.58 C -ATOM 1618 O SER B 72 18.709 -18.593 10.064 1.00 22.06 O -ATOM 1619 CB SER B 72 20.232 -15.732 11.864 1.00 15.28 C -ATOM 1620 OG SER B 72 21.400 -16.267 11.544 1.00 25.10 O -ATOM 1621 N ASP B 73 17.933 -17.999 12.102 1.00 27.59 N -ATOM 1622 CA ASP B 73 17.456 -19.508 12.282 1.00 37.45 C -ATOM 1623 C ASP B 73 16.631 -19.746 11.447 1.00 25.08 C -ATOM 1624 O ASP B 73 16.306 -20.962 10.848 1.00 31.64 O -ATOM 1625 CB ASP B 73 17.022 -19.613 13.914 1.00 36.32 C -ATOM 1626 CG ASP B 73 18.407 -19.595 14.926 1.00 45.09 C -ATOM 1627 OD1 ASP B 73 19.800 -19.407 14.506 1.00 37.33 O -ATOM 1628 OD2 ASP B 73 18.096 -19.496 15.880 1.00 52.94 O -ATOM 1629 N GLY B 74 15.535 -19.019 10.954 1.00 21.04 N -ATOM 1630 CA GLY B 74 14.735 -19.149 9.973 1.00 15.14 C -ATOM 1631 C GLY B 74 14.988 -19.490 8.722 1.00 22.81 C -ATOM 1632 O GLY B 74 14.637 -20.071 7.621 1.00 25.94 O -ATOM 1633 N LEU B 75 16.509 -18.919 8.215 1.00 20.94 N -ATOM 1634 CA LEU B 75 17.037 -19.090 6.965 1.00 15.84 C -ATOM 1635 C LEU B 75 17.465 -20.570 6.842 1.00 26.11 C -ATOM 1636 O LEU B 75 17.646 -20.979 5.741 1.00 28.14 O -ATOM 1637 CB LEU B 75 18.377 -18.389 6.691 1.00 21.09 C -ATOM 1638 CG LEU B 75 18.160 -17.146 6.885 1.00 27.76 C -ATOM 1639 CD1 LEU B 75 19.415 -16.065 6.621 1.00 33.03 C -ATOM 1640 CD2 LEU B 75 17.192 -16.405 5.891 1.00 30.01 C -ATOM 1641 N ALA B 76 17.528 -21.312 7.923 1.00 21.21 N -ATOM 1642 CA ALA B 76 17.717 -22.609 7.710 1.00 22.79 C -ATOM 1643 C ALA B 76 16.647 -23.681 7.464 1.00 40.88 C -ATOM 1644 O ALA B 76 16.656 -24.527 7.123 1.00 38.44 O -ATOM 1645 CB ALA B 76 18.164 -23.328 9.061 1.00 29.05 C -ATOM 1646 N HIS B 77 15.219 -22.886 7.385 1.00 23.87 N -ATOM 1647 CA HIS B 77 13.929 -23.700 7.284 1.00 21.57 C -ATOM 1648 C HIS B 77 13.284 -22.870 6.150 1.00 18.37 C -ATOM 1649 O HIS B 77 12.059 -22.798 6.220 1.00 23.13 O -ATOM 1650 CB HIS B 77 13.250 -23.395 8.460 1.00 29.02 C -ATOM 1651 CG HIS B 77 14.079 -24.146 9.683 1.00 36.16 C -ATOM 1652 ND1 HIS B 77 14.936 -23.842 10.757 1.00 45.10 N -ATOM 1653 CD2 HIS B 77 14.095 -25.953 9.360 1.00 41.12 C -ATOM 1654 CE1 HIS B 77 15.178 -24.891 11.130 1.00 37.52 C -ATOM 1655 NE2 HIS B 77 14.852 -25.983 10.561 1.00 42.04 N -ATOM 1656 N LEU B 78 13.874 -22.553 5.099 1.00 22.31 N -ATOM 1657 CA LEU B 78 13.302 -21.614 4.148 1.00 20.28 C -ATOM 1658 C LEU B 78 12.283 -22.522 3.216 1.00 31.20 C -ATOM 1659 O LEU B 78 11.288 -21.899 3.087 1.00 34.80 O -ATOM 1660 CB LEU B 78 14.257 -21.383 2.881 1.00 19.92 C -ATOM 1661 CG LEU B 78 14.986 -19.978 3.420 1.00 39.49 C -ATOM 1662 CD1 LEU B 78 16.407 -19.926 2.680 1.00 34.16 C -ATOM 1663 CD2 LEU B 78 14.406 -18.731 3.892 1.00 31.09 C -ATOM 1664 N ASP B 79 12.097 -23.916 3.393 1.00 31.59 N -ATOM 1665 CA ASP B 79 11.104 -24.882 2.602 1.00 37.85 C -ATOM 1666 C ASP B 79 9.843 -24.653 3.569 1.00 38.72 C -ATOM 1667 O ASP B 79 9.096 -25.342 3.631 1.00 37.62 O -ATOM 1668 CB ASP B 79 11.737 -26.234 3.104 1.00 48.10 C -ATOM 1669 CG ASP B 79 12.662 -26.319 2.384 1.00 61.60 C -ATOM 1670 OD1 ASP B 79 13.286 -27.317 2.464 1.00 57.05 O -ATOM 1671 OD2 ASP B 79 12.655 -25.818 0.790 1.00 50.26 O -ATOM 1672 N ASN B 80 10.028 -24.212 4.945 1.00 35.73 N -ATOM 1673 CA ASN B 80 8.836 -24.555 6.146 1.00 42.30 C -ATOM 1674 C ASN B 80 9.062 -22.961 6.944 1.00 30.43 C -ATOM 1675 O ASN B 80 8.998 -23.185 7.997 1.00 27.17 O -ATOM 1676 CB ASN B 80 9.098 -25.723 6.800 1.00 45.64 C -ATOM 1677 CG ASN B 80 7.793 -26.259 7.837 1.00 49.79 C -ATOM 1678 OD1 ASN B 80 6.751 -25.228 7.493 1.00 49.18 O -ATOM 1679 ND2 ASN B 80 8.556 -26.466 8.946 1.00 48.18 N -ATOM 1680 N LEU B 81 8.851 -21.845 6.271 1.00 31.23 N -ATOM 1681 CA LEU B 81 8.683 -20.637 7.429 1.00 24.59 C -ATOM 1682 C LEU B 81 7.679 -20.724 8.281 1.00 25.32 C -ATOM 1683 O LEU B 81 7.523 -20.208 9.309 1.00 23.54 O -ATOM 1684 CB LEU B 81 8.987 -19.631 6.449 1.00 29.09 C -ATOM 1685 CG LEU B 81 10.160 -19.226 5.665 1.00 21.46 C -ATOM 1686 CD1 LEU B 81 10.084 -18.185 4.643 1.00 28.62 C -ATOM 1687 CD2 LEU B 81 11.341 -18.875 6.546 1.00 30.82 C -ATOM 1688 N LYS B 82 6.283 -21.136 7.490 1.00 26.15 N -ATOM 1689 CA LYS B 82 5.156 -20.862 8.452 1.00 24.25 C -ATOM 1690 C LYS B 82 5.202 -21.643 9.461 1.00 23.08 C -ATOM 1691 O LYS B 82 4.869 -21.389 10.597 1.00 24.88 O -ATOM 1692 CB LYS B 82 4.142 -21.433 7.392 1.00 40.41 C -ATOM 1693 CG LYS B 82 3.479 -20.229 6.738 1.00 39.73 C -ATOM 1694 CD LYS B 82 2.160 -20.747 5.755 1.00 66.91 C -ATOM 1695 CE LYS B 82 1.685 -20.767 6.266 1.00 59.33 C -ATOM 1696 NZ LYS B 82 -0.023 -22.087 5.346 1.00 80.12 N -ATOM 1697 N GLY B 83 5.725 -22.942 9.358 1.00 26.18 N -ATOM 1698 CA GLY B 83 5.798 -23.724 10.746 1.00 41.64 C -ATOM 1699 C GLY B 83 6.819 -23.249 11.591 1.00 31.59 C -ATOM 1700 O GLY B 83 6.621 -23.464 12.858 1.00 36.40 O -ATOM 1701 N THR B 84 7.985 -22.864 11.019 1.00 26.72 N -ATOM 1702 CA THR B 84 9.150 -22.242 11.744 1.00 25.47 C -ATOM 1703 C THR B 84 8.609 -21.278 12.796 1.00 33.72 C -ATOM 1704 O THR B 84 8.964 -20.907 13.790 1.00 27.43 O -ATOM 1705 CB THR B 84 10.394 -21.742 11.042 1.00 25.58 C -ATOM 1706 OG1 THR B 84 10.806 -23.108 10.337 1.00 39.04 O -ATOM 1707 CG2 THR B 84 11.362 -21.482 11.789 1.00 30.76 C -ATOM 1708 N PHE B 85 7.740 -20.301 12.125 1.00 23.61 N -ATOM 1709 CA PHE B 85 7.236 -18.963 12.749 1.00 21.59 C -ATOM 1710 C PHE B 85 5.980 -19.056 13.414 1.00 28.51 C -ATOM 1711 O PHE B 85 5.496 -18.006 13.809 1.00 18.85 O -ATOM 1712 CB PHE B 85 7.575 -17.733 11.855 1.00 18.34 C -ATOM 1713 CG PHE B 85 8.914 -17.486 11.587 1.00 13.87 C -ATOM 1714 CD1 PHE B 85 9.583 -17.701 10.358 1.00 16.61 C -ATOM 1715 CD2 PHE B 85 9.616 -17.039 12.693 1.00 18.32 C -ATOM 1716 CE1 PHE B 85 11.009 -17.444 10.305 1.00 27.99 C -ATOM 1717 CE2 PHE B 85 11.013 -16.752 12.253 1.00 21.68 C -ATOM 1718 CZ PHE B 85 11.837 -16.973 11.161 1.00 21.59 C -ATOM 1719 N ALA B 86 5.328 -20.141 13.373 1.00 22.16 N -ATOM 1720 CA ALA B 86 3.899 -20.242 13.948 1.00 23.14 C -ATOM 1721 C ALA B 86 3.715 -19.788 15.246 1.00 20.99 C -ATOM 1722 O ALA B 86 2.881 -18.975 15.595 1.00 20.07 O -ATOM 1723 CB ALA B 86 3.272 -21.660 13.783 1.00 23.69 C -ATOM 1724 N THR B 87 4.501 -20.280 16.157 1.00 14.82 N -ATOM 1725 CA THR B 87 4.271 -19.764 17.443 1.00 18.61 C -ATOM 1726 C THR B 87 4.737 -18.271 17.729 1.00 25.42 C -ATOM 1727 O THR B 87 4.013 -17.569 18.383 1.00 23.63 O -ATOM 1728 CB THR B 87 5.631 -20.439 18.664 1.00 36.27 C -ATOM 1729 OG1 THR B 87 5.010 -21.597 18.659 1.00 56.82 O -ATOM 1730 CG2 THR B 87 4.455 -20.311 20.305 1.00 60.80 C -ATOM 1731 N LEU B 88 5.836 -17.770 16.978 1.00 19.44 N -ATOM 1732 CA LEU B 88 5.984 -16.362 17.087 1.00 17.97 C -ATOM 1733 C LEU B 88 4.882 -15.510 16.526 1.00 11.34 C -ATOM 1734 O LEU B 88 4.682 -14.416 16.964 1.00 17.71 O -ATOM 1735 CB LEU B 88 7.361 -16.058 16.476 1.00 20.20 C -ATOM 1736 CG LEU B 88 8.654 -16.553 17.229 1.00 27.17 C -ATOM 1737 CD1 LEU B 88 9.614 -15.962 16.454 1.00 32.32 C -ATOM 1738 CD2 LEU B 88 8.631 -15.491 18.343 1.00 27.72 C -ATOM 1739 N SER B 89 4.254 -16.087 15.451 1.00 12.58 N -ATOM 1740 CA SER B 89 3.084 -15.313 14.877 1.00 15.21 C -ATOM 1741 C SER B 89 1.999 -14.995 15.898 1.00 14.13 C -ATOM 1742 O SER B 89 1.472 -13.894 16.189 1.00 14.29 O -ATOM 1743 CB SER B 89 2.771 -16.248 13.670 1.00 18.34 C -ATOM 1744 OG SER B 89 1.531 -15.441 13.107 1.00 17.85 O -ATOM 1745 N GLU B 90 1.628 -16.201 16.484 1.00 14.25 N -ATOM 1746 CA GLU B 90 0.931 -16.070 17.617 1.00 20.50 C -ATOM 1747 C GLU B 90 0.876 -15.142 18.820 1.00 13.47 C -ATOM 1748 O GLU B 90 0.179 -14.243 19.122 1.00 16.05 O -ATOM 1749 CB GLU B 90 0.387 -17.706 18.270 1.00 21.76 C -ATOM 1750 CG GLU B 90 0.049 -18.266 17.145 1.00 48.13 C -ATOM 1751 CD GLU B 90 -0.726 -20.095 17.710 1.00 78.64 C -ATOM 1752 OE1 GLU B 90 -1.132 -19.837 18.495 1.00 55.55 O -ATOM 1753 OE2 GLU B 90 0.235 -20.950 17.492 1.00 74.37 O -ATOM 1754 N LEU B 91 2.312 -15.215 19.185 1.00 13.36 N -ATOM 1755 CA LEU B 91 2.718 -14.253 20.128 1.00 14.20 C -ATOM 1756 C LEU B 91 2.527 -12.831 19.767 1.00 8.80 C -ATOM 1757 O LEU B 91 2.160 -11.906 20.481 1.00 10.74 O -ATOM 1758 CB LEU B 91 4.110 -14.807 20.432 1.00 12.00 C -ATOM 1759 CG LEU B 91 4.669 -13.801 21.348 1.00 18.50 C -ATOM 1760 CD1 LEU B 91 4.127 -14.212 22.834 1.00 20.79 C -ATOM 1761 CD2 LEU B 91 5.943 -13.652 21.455 1.00 37.40 C -ATOM 1762 N HIS B 92 3.059 -12.662 18.493 1.00 10.78 N -ATOM 1763 CA HIS B 92 3.032 -11.268 18.253 1.00 11.85 C -ATOM 1764 C HIS B 92 1.536 -10.600 17.895 1.00 11.06 C -ATOM 1765 O HIS B 92 1.291 -9.431 18.158 1.00 13.45 O -ATOM 1766 CB HIS B 92 3.754 -11.078 16.807 1.00 9.95 C -ATOM 1767 CG HIS B 92 5.289 -10.900 17.051 1.00 15.50 C -ATOM 1768 ND1 HIS B 92 6.099 -12.172 17.134 1.00 15.27 N -ATOM 1769 CD2 HIS B 92 6.215 -9.905 16.994 1.00 23.76 C -ATOM 1770 CE1 HIS B 92 7.432 -11.572 17.375 1.00 16.99 C -ATOM 1771 NE2 HIS B 92 7.367 -10.337 17.129 1.00 14.76 N -ATOM 1772 N CYS B 93 0.636 -11.512 17.534 1.00 14.83 N -ATOM 1773 CA CYS B 93 -0.706 -11.057 17.499 1.00 12.23 C -ATOM 1774 C CYS B 93 -1.360 -10.953 18.986 1.00 10.49 C -ATOM 1775 O CYS B 93 -1.843 -9.987 19.222 1.00 18.01 O -ATOM 1776 CB CYS B 93 -1.330 -12.054 16.605 1.00 15.43 C -ATOM 1777 SG CYS B 93 -3.259 -11.741 16.494 1.00 18.37 S -ATOM 1778 N ASP B 94 -1.338 -12.094 19.598 1.00 13.11 N -ATOM 1779 CA ASP B 94 -2.308 -12.076 20.721 1.00 15.32 C -ATOM 1780 C ASP B 94 -1.586 -11.449 21.803 1.00 25.71 C -ATOM 1781 O ASP B 94 -2.319 -10.827 22.800 1.00 21.65 O -ATOM 1782 CB ASP B 94 -2.522 -13.477 21.183 1.00 21.65 C -ATOM 1783 CG ASP B 94 -3.443 -14.553 20.246 1.00 42.42 C -ATOM 1784 OD1 ASP B 94 -3.967 -13.792 19.626 1.00 30.02 O -ATOM 1785 OD2 ASP B 94 -3.094 -15.441 20.443 1.00 43.30 O -ATOM 1786 N LYS B 95 -0.348 -11.361 22.144 1.00 18.55 N -ATOM 1787 CA LYS B 95 0.080 -10.591 23.184 1.00 19.10 C -ATOM 1788 C LYS B 95 0.803 -9.499 23.130 1.00 19.57 C -ATOM 1789 O LYS B 95 0.736 -8.565 23.699 1.00 21.87 O -ATOM 1790 CB LYS B 95 1.151 -11.737 23.890 1.00 25.95 C -ATOM 1791 CG LYS B 95 0.477 -13.054 24.377 1.00 24.86 C -ATOM 1792 CD LYS B 95 -0.659 -12.473 25.407 1.00 36.14 C -ATOM 1793 CE LYS B 95 -1.063 -13.745 26.122 1.00 47.76 C -ATOM 1794 NZ LYS B 95 -2.126 -13.501 26.952 1.00 55.91 N -ATOM 1795 N LEU B 96 1.669 -9.358 21.897 1.00 12.40 N -ATOM 1796 CA LEU B 96 2.264 -8.159 21.581 1.00 11.86 C -ATOM 1797 C LEU B 96 1.626 -7.005 20.824 1.00 15.10 C -ATOM 1798 O LEU B 96 2.002 -5.926 20.849 1.00 17.50 O -ATOM 1799 CB LEU B 96 3.645 -8.491 21.134 1.00 14.08 C -ATOM 1800 CG LEU B 96 4.528 -9.722 21.739 1.00 12.34 C -ATOM 1801 CD1 LEU B 96 5.778 -9.939 20.848 1.00 13.78 C -ATOM 1802 CD2 LEU B 96 4.863 -8.876 23.113 1.00 22.81 C -ATOM 1803 N HIS B 97 0.616 -7.508 20.069 1.00 15.44 N -ATOM 1804 CA HIS B 97 -0.223 -6.510 19.374 1.00 18.15 C -ATOM 1805 C HIS B 97 0.581 -5.736 18.319 1.00 12.24 C -ATOM 1806 O HIS B 97 0.337 -4.532 18.056 1.00 15.82 O -ATOM 1807 CB HIS B 97 -1.053 -5.508 20.203 1.00 17.74 C -ATOM 1808 CG HIS B 97 -1.716 -6.273 21.483 1.00 16.77 C -ATOM 1809 ND1 HIS B 97 -2.602 -7.310 21.250 1.00 19.56 N -ATOM 1810 CD2 HIS B 97 -1.189 -6.197 22.703 1.00 23.33 C -ATOM 1811 CE1 HIS B 97 -2.759 -7.812 22.476 1.00 19.82 C -ATOM 1812 NE2 HIS B 97 -2.056 -7.104 23.341 1.00 20.39 N -ATOM 1813 N VAL B 98 1.359 -6.524 17.506 1.00 13.81 N -ATOM 1814 CA VAL B 98 2.284 -5.763 16.567 1.00 9.22 C -ATOM 1815 C VAL B 98 1.443 -5.905 15.109 1.00 9.86 C -ATOM 1816 O VAL B 98 1.420 -7.012 14.615 1.00 12.90 O -ATOM 1817 CB VAL B 98 3.592 -6.460 16.393 1.00 9.87 C -ATOM 1818 CG1 VAL B 98 4.438 -5.824 15.405 1.00 14.91 C -ATOM 1819 CG2 VAL B 98 4.444 -6.258 17.798 1.00 11.36 C -ATOM 1820 N ASP B 99 1.147 -4.763 14.513 1.00 11.46 N -ATOM 1821 CA ASP B 99 0.360 -4.723 13.272 1.00 9.02 C -ATOM 1822 C ASP B 99 1.555 -5.328 12.375 1.00 15.41 C -ATOM 1823 O ASP B 99 2.744 -4.931 12.235 1.00 10.63 O -ATOM 1824 CB ASP B 99 0.336 -3.327 12.907 1.00 9.79 C -ATOM 1825 CG ASP B 99 -0.231 -3.002 11.431 1.00 10.69 C -ATOM 1826 OD1 ASP B 99 -0.535 -1.748 11.309 1.00 15.04 O -ATOM 1827 OD2 ASP B 99 -0.299 -4.052 10.734 1.00 11.07 O -ATOM 1828 N PRO B 100 1.274 -6.350 11.556 1.00 10.46 N -ATOM 1829 CA PRO B 100 2.264 -7.099 10.669 1.00 11.87 C -ATOM 1830 C PRO B 100 2.744 -6.170 9.522 1.00 13.04 C -ATOM 1831 O PRO B 100 3.883 -6.627 8.995 1.00 13.79 O -ATOM 1832 CB PRO B 100 1.545 -8.233 10.081 1.00 17.03 C -ATOM 1833 CG PRO B 100 0.234 -8.243 10.793 1.00 17.33 C -ATOM 1834 CD PRO B 100 -0.030 -7.028 11.592 1.00 9.97 C -ATOM 1835 N GLU B 101 2.300 -4.973 9.393 1.00 9.66 N -ATOM 1836 CA GLU B 101 2.927 -3.983 8.469 1.00 11.29 C -ATOM 1837 C GLU B 101 4.322 -3.633 8.825 1.00 17.59 C -ATOM 1838 O GLU B 101 5.293 -3.640 8.196 1.00 16.98 O -ATOM 1839 CB GLU B 101 2.178 -2.819 8.156 1.00 18.71 C -ATOM 1840 CG GLU B 101 2.755 -1.760 7.270 1.00 30.25 C -ATOM 1841 CD GLU B 101 2.569 -2.612 5.445 1.00 26.27 C -ATOM 1842 OE1 GLU B 101 1.725 -3.411 5.564 1.00 25.29 O -ATOM 1843 OE2 GLU B 101 3.441 -1.765 5.293 1.00 34.30 O -ATOM 1844 N ASN B 102 4.601 -3.752 10.314 1.00 12.60 N -ATOM 1845 CA ASN B 102 5.969 -3.548 10.721 1.00 9.48 C -ATOM 1846 C ASN B 102 6.861 -4.572 10.309 1.00 8.44 C -ATOM 1847 O ASN B 102 8.118 -4.224 10.106 1.00 13.92 O -ATOM 1848 CB ASN B 102 5.901 -3.665 12.265 1.00 18.27 C -ATOM 1849 CG ASN B 102 5.284 -2.285 12.825 1.00 26.18 C -ATOM 1850 OD1 ASN B 102 5.641 -1.422 12.815 1.00 20.87 O -ATOM 1851 ND2 ASN B 102 4.003 -2.618 13.502 1.00 25.76 N -ATOM 1852 N PHE B 103 6.584 -5.846 10.057 1.00 11.66 N -ATOM 1853 CA PHE B 103 7.332 -6.920 9.605 1.00 11.79 C -ATOM 1854 C PHE B 103 7.931 -6.435 8.177 1.00 19.35 C -ATOM 1855 O PHE B 103 8.997 -6.751 7.762 1.00 16.06 O -ATOM 1856 CB PHE B 103 6.816 -8.253 9.574 1.00 12.75 C -ATOM 1857 CG PHE B 103 6.173 -8.727 10.951 1.00 17.48 C -ATOM 1858 CD1 PHE B 103 6.884 -8.372 12.079 1.00 13.65 C -ATOM 1859 CD2 PHE B 103 5.035 -9.335 10.925 1.00 13.36 C -ATOM 1860 CE1 PHE B 103 6.240 -8.652 13.315 1.00 14.94 C -ATOM 1861 CE2 PHE B 103 4.498 -9.665 12.273 1.00 14.24 C -ATOM 1862 CZ PHE B 103 5.298 -9.364 13.368 1.00 19.61 C -ATOM 1863 N ARG B 104 6.970 -5.873 7.380 1.00 13.60 N -ATOM 1864 CA ARG B 104 7.430 -5.624 6.005 1.00 17.00 C -ATOM 1865 C ARG B 104 8.326 -4.499 5.935 1.00 13.66 C -ATOM 1866 O ARG B 104 9.337 -4.368 5.141 1.00 13.41 O -ATOM 1867 CB ARG B 104 6.018 -5.177 5.223 1.00 18.62 C -ATOM 1868 CG ARG B 104 5.137 -6.280 4.965 1.00 31.60 C -ATOM 1869 CD ARG B 104 3.494 -6.093 4.370 1.00 44.99 C -ATOM 1870 NE ARG B 104 2.810 -7.429 5.065 1.00 53.69 N -ATOM 1871 CZ ARG B 104 1.600 -6.829 3.420 1.00 80.12 C -ATOM 1872 NH1 ARG B 104 0.761 -5.157 3.344 1.00 72.76 N -ATOM 1873 NH2 ARG B 104 1.186 -8.540 2.528 1.00 80.07 N -ATOM 1874 N LEU B 105 8.064 -3.438 6.831 1.00 12.29 N -ATOM 1875 CA LEU B 105 8.899 -2.275 6.982 1.00 11.07 C -ATOM 1876 C LEU B 105 10.327 -2.808 7.482 1.00 13.91 C -ATOM 1877 O LEU B 105 11.317 -2.347 6.887 1.00 14.94 O -ATOM 1878 CB LEU B 105 8.443 -1.409 8.005 1.00 12.50 C -ATOM 1879 CG LEU B 105 7.121 -0.514 7.549 1.00 17.21 C -ATOM 1880 CD1 LEU B 105 6.747 0.236 8.813 1.00 19.52 C -ATOM 1881 CD2 LEU B 105 7.420 0.384 6.353 1.00 25.82 C -ATOM 1882 N LEU B 106 10.302 -3.738 8.415 1.00 16.16 N -ATOM 1883 CA LEU B 106 11.679 -4.227 8.855 1.00 11.19 C -ATOM 1884 C LEU B 106 12.325 -4.914 7.713 1.00 11.49 C -ATOM 1885 O LEU B 106 13.544 -4.734 7.492 1.00 14.59 O -ATOM 1886 CB LEU B 106 11.615 -5.043 10.074 1.00 9.57 C -ATOM 1887 CG LEU B 106 12.904 -5.567 10.740 1.00 14.52 C -ATOM 1888 CD1 LEU B 106 13.738 -4.483 11.015 1.00 20.21 C -ATOM 1889 CD2 LEU B 106 12.609 -6.504 11.567 1.00 25.23 C -ATOM 1890 N GLY B 107 11.728 -5.699 6.854 1.00 8.80 N -ATOM 1891 CA GLY B 107 12.297 -6.476 5.851 1.00 11.35 C -ATOM 1892 C GLY B 107 12.781 -5.426 4.844 1.00 11.83 C -ATOM 1893 O GLY B 107 13.958 -5.700 4.332 1.00 14.42 O -ATOM 1894 N ASN B 108 12.187 -4.243 4.553 1.00 11.55 N -ATOM 1895 CA ASN B 108 12.802 -3.506 3.538 1.00 9.47 C -ATOM 1896 C ASN B 108 14.026 -2.647 4.184 1.00 9.85 C -ATOM 1897 O ASN B 108 14.983 -2.466 3.460 1.00 13.16 O -ATOM 1898 CB ASN B 108 11.824 -2.458 3.182 1.00 16.47 C -ATOM 1899 CG ASN B 108 10.727 -3.234 1.924 1.00 25.36 C -ATOM 1900 OD1 ASN B 108 11.335 -4.320 1.398 1.00 28.00 O -ATOM 1901 ND2 ASN B 108 10.036 -2.270 2.100 1.00 42.45 N -ATOM 1902 N VAL B 109 14.008 -2.327 5.491 1.00 11.97 N -ATOM 1903 CA VAL B 109 15.193 -1.717 6.001 1.00 8.99 C -ATOM 1904 C VAL B 109 16.259 -2.676 6.124 1.00 12.55 C -ATOM 1905 O VAL B 109 17.518 -2.304 5.902 1.00 13.71 O -ATOM 1906 CB VAL B 109 14.853 -1.250 7.488 1.00 15.07 C -ATOM 1907 CG1 VAL B 109 16.100 -0.810 8.069 1.00 19.91 C -ATOM 1908 CG2 VAL B 109 13.852 0.066 7.393 1.00 15.78 C -ATOM 1909 N LEU B 110 16.030 -4.023 6.388 1.00 9.97 N -ATOM 1910 CA LEU B 110 17.059 -5.101 6.357 1.00 9.78 C -ATOM 1911 C LEU B 110 17.764 -5.056 5.040 1.00 13.14 C -ATOM 1912 O LEU B 110 18.980 -5.187 4.895 1.00 11.97 O -ATOM 1913 CB LEU B 110 16.410 -6.369 6.847 1.00 11.11 C -ATOM 1914 CG LEU B 110 17.490 -7.596 6.862 1.00 18.59 C -ATOM 1915 CD1 LEU B 110 18.696 -7.290 7.723 1.00 24.07 C -ATOM 1916 CD2 LEU B 110 17.031 -8.897 7.193 1.00 21.67 C -ATOM 1917 N VAL B 111 17.015 -5.083 3.938 1.00 10.25 N -ATOM 1918 CA VAL B 111 17.517 -5.121 2.535 1.00 8.08 C -ATOM 1919 C VAL B 111 18.459 -3.959 2.465 1.00 10.10 C -ATOM 1920 O VAL B 111 19.605 -3.960 1.822 1.00 14.18 O -ATOM 1921 CB VAL B 111 16.320 -5.216 1.576 1.00 11.95 C -ATOM 1922 CG1 VAL B 111 16.949 -4.942 0.196 1.00 16.64 C -ATOM 1923 CG2 VAL B 111 15.888 -6.643 1.659 1.00 12.92 C -ATOM 1924 N CYS B 112 18.155 -2.685 2.811 1.00 10.01 N -ATOM 1925 CA CYS B 112 18.863 -1.400 2.699 1.00 9.19 C -ATOM 1926 C CYS B 112 20.143 -1.657 3.581 1.00 14.92 C -ATOM 1927 O CYS B 112 21.199 -1.284 3.015 1.00 13.93 O -ATOM 1928 CB CYS B 112 18.369 -0.230 3.207 1.00 15.04 C -ATOM 1929 SG CYS B 112 16.911 0.308 2.042 1.00 18.10 S -ATOM 1930 N VAL B 113 19.969 -2.202 4.651 1.00 9.52 N -ATOM 1931 CA VAL B 113 21.202 -2.512 5.398 1.00 11.92 C -ATOM 1932 C VAL B 113 22.035 -3.532 4.865 1.00 15.57 C -ATOM 1933 O VAL B 113 23.397 -3.138 4.862 1.00 13.38 O -ATOM 1934 CB VAL B 113 20.888 -2.948 6.932 1.00 12.70 C -ATOM 1935 CG1 VAL B 113 22.031 -3.383 7.663 1.00 17.23 C -ATOM 1936 CG2 VAL B 113 20.282 -1.893 7.694 1.00 17.43 C -ATOM 1937 N LEU B 114 21.768 -4.615 4.224 1.00 10.74 N -ATOM 1938 CA LEU B 114 22.632 -5.454 3.485 1.00 10.20 C -ATOM 1939 C LEU B 114 23.346 -4.641 2.455 1.00 10.87 C -ATOM 1940 O LEU B 114 24.522 -5.071 2.156 1.00 12.76 O -ATOM 1941 CB LEU B 114 21.856 -6.600 3.242 1.00 6.84 C -ATOM 1942 CG LEU B 114 21.362 -7.530 4.328 1.00 10.74 C -ATOM 1943 CD1 LEU B 114 20.435 -8.554 3.798 1.00 15.38 C -ATOM 1944 CD2 LEU B 114 22.500 -8.141 5.077 1.00 21.35 C -ATOM 1945 N ALA B 115 22.472 -3.897 1.677 1.00 9.28 N -ATOM 1946 CA ALA B 115 23.134 -3.206 0.546 1.00 9.22 C -ATOM 1947 C ALA B 115 24.284 -2.278 1.091 1.00 9.44 C -ATOM 1948 O ALA B 115 25.320 -2.142 0.446 1.00 12.10 O -ATOM 1949 CB ALA B 115 21.930 -2.539 -0.036 1.00 12.15 C -ATOM 1950 N HIS B 116 23.975 -1.612 2.171 1.00 13.11 N -ATOM 1951 CA HIS B 116 25.023 -0.593 2.641 1.00 12.81 C -ATOM 1952 C HIS B 116 26.176 -1.395 3.061 1.00 18.85 C -ATOM 1953 O HIS B 116 27.357 -0.986 2.878 1.00 16.05 O -ATOM 1954 CB HIS B 116 24.442 0.070 3.767 1.00 17.43 C -ATOM 1955 CG HIS B 116 25.164 1.158 4.279 1.00 27.80 C -ATOM 1956 ND1 HIS B 116 25.567 1.157 5.736 1.00 27.30 N -ATOM 1957 CD2 HIS B 116 25.793 2.195 3.793 1.00 25.62 C -ATOM 1958 CE1 HIS B 116 26.226 2.480 5.818 1.00 29.22 C -ATOM 1959 NE2 HIS B 116 26.570 2.986 4.660 1.00 26.05 N -ATOM 1960 N HIS B 117 26.066 -2.490 3.850 1.00 11.35 N -ATOM 1961 CA HIS B 117 27.064 -3.366 4.194 1.00 18.75 C -ATOM 1962 C HIS B 117 27.881 -3.985 3.242 1.00 20.53 C -ATOM 1963 O HIS B 117 29.104 -4.114 3.403 1.00 17.07 O -ATOM 1964 CB HIS B 117 26.621 -4.637 5.175 1.00 19.57 C -ATOM 1965 CG HIS B 117 27.096 -4.621 6.444 1.00 39.90 C -ATOM 1966 ND1 HIS B 117 26.039 -3.036 6.824 1.00 47.73 N -ATOM 1967 CD2 HIS B 117 28.146 -5.329 7.512 1.00 38.82 C -ATOM 1968 CE1 HIS B 117 26.295 -2.928 8.550 1.00 27.38 C -ATOM 1969 NE2 HIS B 117 26.763 -4.335 8.924 1.00 51.83 N -ATOM 1970 N PHE B 118 27.367 -4.628 2.104 1.00 13.44 N -ATOM 1971 CA PHE B 118 27.888 -5.419 1.096 1.00 13.47 C -ATOM 1972 C PHE B 118 28.280 -4.574 -0.126 1.00 14.52 C -ATOM 1973 O PHE B 118 29.082 -5.219 -0.874 1.00 15.85 O -ATOM 1974 CB PHE B 118 27.174 -6.618 0.947 1.00 14.99 C -ATOM 1975 CG PHE B 118 27.310 -7.470 1.980 1.00 22.65 C -ATOM 1976 CD1 PHE B 118 26.224 -7.666 2.855 1.00 28.61 C -ATOM 1977 CD2 PHE B 118 28.549 -8.159 2.601 1.00 34.26 C -ATOM 1978 CE1 PHE B 118 26.242 -8.675 3.981 1.00 29.50 C -ATOM 1979 CE2 PHE B 118 28.351 -9.080 3.277 1.00 36.60 C -ATOM 1980 CZ PHE B 118 27.627 -9.130 4.417 1.00 30.15 C -ATOM 1981 N GLY B 119 27.701 -3.412 -0.335 1.00 13.81 N -ATOM 1982 CA GLY B 119 28.107 -2.567 -1.533 1.00 14.28 C -ATOM 1983 C GLY B 119 27.814 -3.353 -2.686 1.00 17.07 C -ATOM 1984 O GLY B 119 26.808 -4.212 -2.888 1.00 16.48 O -ATOM 1985 N LYS B 120 28.740 -3.472 -3.465 1.00 19.17 N -ATOM 1986 CA LYS B 120 28.535 -4.059 -4.848 1.00 27.00 C -ATOM 1987 C LYS B 120 28.486 -5.640 -4.886 1.00 25.94 C -ATOM 1988 O LYS B 120 27.868 -6.039 -5.935 1.00 20.66 O -ATOM 1989 CB LYS B 120 29.863 -3.838 -5.852 1.00 31.85 C -ATOM 1990 CG LYS B 120 30.960 -4.510 -5.562 1.00 36.58 C -ATOM 1991 CD LYS B 120 32.161 -4.170 -6.625 1.00 49.76 C -ATOM 1992 CE LYS B 120 33.201 -5.292 -5.966 1.00 55.47 C -ATOM 1993 NZ LYS B 120 34.292 -5.686 -6.589 1.00 71.03 N -ATOM 1994 N GLU B 121 28.720 -6.302 -3.902 1.00 20.26 N -ATOM 1995 CA GLU B 121 28.393 -7.556 -3.778 1.00 15.17 C -ATOM 1996 C GLU B 121 26.786 -7.871 -3.622 1.00 13.63 C -ATOM 1997 O GLU B 121 26.362 -9.055 -3.923 1.00 17.16 O -ATOM 1998 CB GLU B 121 29.233 -8.318 -2.533 1.00 29.40 C -ATOM 1999 CG GLU B 121 29.541 -9.342 -2.700 1.00 50.25 C -ATOM 2000 CD GLU B 121 30.241 -9.882 -0.830 1.00 42.74 C -ATOM 2001 OE1 GLU B 121 29.786 -11.667 -1.141 1.00 47.83 O -ATOM 2002 OE2 GLU B 121 31.217 -9.425 -1.168 1.00 34.52 O -ATOM 2003 N PHE B 122 26.054 -6.831 -3.241 1.00 14.63 N -ATOM 2004 CA PHE B 122 24.581 -7.077 -3.075 1.00 15.34 C -ATOM 2005 C PHE B 122 24.015 -6.737 -4.532 1.00 13.61 C -ATOM 2006 O PHE B 122 23.478 -5.701 -4.760 1.00 14.29 O -ATOM 2007 CB PHE B 122 24.133 -6.005 -1.987 1.00 12.07 C -ATOM 2008 CG PHE B 122 22.750 -6.466 -1.525 1.00 11.02 C -ATOM 2009 CD1 PHE B 122 22.540 -7.652 -0.894 1.00 16.65 C -ATOM 2010 CD2 PHE B 122 21.790 -5.593 -1.747 1.00 10.83 C -ATOM 2011 CE1 PHE B 122 21.288 -8.069 -0.329 1.00 13.73 C -ATOM 2012 CE2 PHE B 122 20.427 -5.937 -1.325 1.00 12.97 C -ATOM 2013 CZ PHE B 122 20.322 -7.247 -0.672 1.00 16.05 C -ATOM 2014 N THR B 123 24.216 -7.664 -5.332 1.00 18.07 N -ATOM 2015 CA THR B 123 23.866 -7.444 -6.796 1.00 21.03 C -ATOM 2016 C THR B 123 22.176 -7.347 -6.888 1.00 27.18 C -ATOM 2017 O THR B 123 21.678 -7.911 -6.078 1.00 14.31 O -ATOM 2018 CB THR B 123 24.352 -8.535 -7.622 1.00 19.82 C -ATOM 2019 OG1 THR B 123 24.030 -9.746 -7.305 1.00 17.47 O -ATOM 2020 CG2 THR B 123 25.945 -8.568 -7.681 1.00 22.67 C -ATOM 2021 N PRO B 124 21.821 -7.033 -7.981 1.00 19.47 N -ATOM 2022 CA PRO B 124 20.309 -7.060 -8.306 1.00 20.19 C -ATOM 2023 C PRO B 124 19.874 -8.457 -8.199 1.00 20.69 C -ATOM 2024 O PRO B 124 18.738 -8.543 -7.455 1.00 13.34 O -ATOM 2025 CB PRO B 124 20.074 -6.480 -9.678 1.00 17.09 C -ATOM 2026 CG PRO B 124 21.308 -5.510 -9.842 1.00 18.87 C -ATOM 2027 CD PRO B 124 22.649 -6.190 -9.202 1.00 24.42 C -ATOM 2028 N PRO B 125 20.354 -9.489 -8.576 1.00 16.20 N -ATOM 2029 CA PRO B 125 19.952 -10.892 -8.433 1.00 16.84 C -ATOM 2030 C PRO B 125 19.925 -11.341 -6.992 1.00 14.92 C -ATOM 2031 O PRO B 125 18.950 -11.983 -6.530 1.00 16.05 O -ATOM 2032 CB PRO B 125 20.675 -11.924 -9.198 1.00 19.48 C -ATOM 2033 CG PRO B 125 21.240 -11.056 -10.143 1.00 21.56 C -ATOM 2034 CD PRO B 125 21.611 -9.723 -9.654 1.00 25.73 C -ATOM 2035 N VAL B 126 20.904 -10.923 -6.329 1.00 13.83 N -ATOM 2036 CA VAL B 126 20.919 -11.183 -4.904 1.00 19.80 C -ATOM 2037 C VAL B 126 20.061 -10.295 -4.143 1.00 14.89 C -ATOM 2038 O VAL B 126 19.229 -10.946 -3.203 1.00 13.92 O -ATOM 2039 CB VAL B 126 22.424 -10.769 -4.382 1.00 19.55 C -ATOM 2040 CG1 VAL B 126 22.408 -11.156 -2.912 1.00 21.55 C -ATOM 2041 CG2 VAL B 126 23.366 -11.841 -4.809 1.00 27.82 C -ATOM 2042 N GLN B 127 19.711 -9.155 -4.321 1.00 13.64 N -ATOM 2043 CA GLN B 127 18.607 -8.382 -3.880 1.00 9.72 C -ATOM 2044 C GLN B 127 17.397 -9.130 -3.899 1.00 16.14 C -ATOM 2045 O GLN B 127 16.431 -9.272 -3.189 1.00 12.24 O -ATOM 2046 CB GLN B 127 18.574 -6.951 -4.292 1.00 13.15 C -ATOM 2047 CG GLN B 127 17.258 -6.340 -3.818 1.00 13.42 C -ATOM 2048 CD GLN B 127 17.180 -5.056 -4.465 1.00 16.28 C -ATOM 2049 OE1 GLN B 127 17.979 -4.488 -5.247 1.00 16.20 O -ATOM 2050 NE2 GLN B 127 16.107 -4.400 -4.118 1.00 19.47 N -ATOM 2051 N ALA B 128 17.014 -9.478 -5.230 1.00 15.15 N -ATOM 2052 CA ALA B 128 15.847 -10.225 -5.543 1.00 15.02 C -ATOM 2053 C ALA B 128 15.496 -11.450 -4.737 1.00 11.97 C -ATOM 2054 O ALA B 128 14.413 -11.642 -4.228 1.00 16.35 O -ATOM 2055 CB ALA B 128 15.759 -10.403 -7.092 1.00 17.08 C -ATOM 2056 N ALA B 129 16.462 -12.287 -4.461 1.00 13.66 N -ATOM 2057 CA ALA B 129 16.408 -13.427 -3.647 1.00 13.76 C -ATOM 2058 C ALA B 129 16.208 -12.966 -2.160 1.00 10.22 C -ATOM 2059 O ALA B 129 15.192 -13.627 -1.584 1.00 10.46 O -ATOM 2060 CB ALA B 129 17.632 -14.165 -3.702 1.00 13.23 C -ATOM 2061 N TYR B 130 16.867 -11.953 -1.693 1.00 10.66 N -ATOM 2062 CA TYR B 130 16.462 -11.629 -0.331 1.00 13.05 C -ATOM 2063 C TYR B 130 15.102 -10.929 -0.163 1.00 11.70 C -ATOM 2064 O TYR B 130 14.473 -11.012 0.813 1.00 11.83 O -ATOM 2065 CB TYR B 130 17.543 -10.575 0.161 1.00 11.97 C -ATOM 2066 CG TYR B 130 18.623 -11.287 0.924 1.00 13.90 C -ATOM 2067 CD1 TYR B 130 18.650 -11.526 2.272 1.00 15.61 C -ATOM 2068 CD2 TYR B 130 19.782 -11.574 0.237 1.00 14.18 C -ATOM 2069 CE1 TYR B 130 19.630 -12.272 2.811 1.00 19.97 C -ATOM 2070 CE2 TYR B 130 20.865 -12.543 0.889 1.00 19.65 C -ATOM 2071 CZ TYR B 130 20.770 -12.571 2.260 1.00 22.28 C -ATOM 2072 OH TYR B 130 21.731 -13.339 2.902 1.00 21.52 O -ATOM 2073 N GLN B 131 14.606 -10.236 -1.202 1.00 12.03 N -ATOM 2074 CA GLN B 131 13.282 -9.830 -1.214 1.00 12.03 C -ATOM 2075 C GLN B 131 12.216 -10.851 -1.125 1.00 12.76 C -ATOM 2076 O GLN B 131 11.369 -10.664 -0.189 1.00 15.09 O -ATOM 2077 CB GLN B 131 12.944 -9.078 -2.464 1.00 14.85 C -ATOM 2078 CG GLN B 131 13.735 -7.716 -2.449 1.00 19.57 C -ATOM 2079 CD GLN B 131 13.251 -6.548 -1.638 1.00 22.82 C -ATOM 2080 OE1 GLN B 131 13.981 -5.553 -1.833 1.00 18.44 O -ATOM 2081 NE2 GLN B 131 12.251 -6.415 -0.990 1.00 16.43 N -ATOM 2082 N LYS B 132 12.503 -11.991 -1.746 1.00 12.50 N -ATOM 2083 CA LYS B 132 11.644 -13.098 -1.708 1.00 14.23 C -ATOM 2084 C LYS B 132 11.592 -13.603 -0.224 1.00 17.46 C -ATOM 2085 O LYS B 132 10.599 -13.851 0.497 1.00 14.87 O -ATOM 2086 CB LYS B 132 11.937 -14.147 -2.452 1.00 19.74 C -ATOM 2087 CG LYS B 132 11.561 -13.879 -3.966 1.00 26.28 C -ATOM 2088 CD LYS B 132 11.989 -15.031 -4.739 1.00 31.58 C -ATOM 2089 CE LYS B 132 11.660 -14.274 -6.180 1.00 32.98 C -ATOM 2090 NZ LYS B 132 12.119 -15.998 -6.779 1.00 37.48 N -ATOM 2091 N VAL B 133 12.856 -13.702 0.483 1.00 17.22 N -ATOM 2092 CA VAL B 133 13.038 -14.205 1.805 1.00 11.45 C -ATOM 2093 C VAL B 133 12.401 -13.319 2.840 1.00 11.90 C -ATOM 2094 O VAL B 133 11.556 -13.799 3.731 1.00 13.71 O -ATOM 2095 CB VAL B 133 14.459 -14.401 2.160 1.00 16.41 C -ATOM 2096 CG1 VAL B 133 14.632 -14.683 3.511 1.00 36.18 C -ATOM 2097 CG2 VAL B 133 15.014 -15.541 1.250 1.00 15.51 C -ATOM 2098 N VAL B 134 12.512 -11.981 2.749 1.00 13.21 N -ATOM 2099 CA VAL B 134 12.091 -11.081 3.574 1.00 12.26 C -ATOM 2100 C VAL B 134 10.632 -11.128 3.483 1.00 16.19 C -ATOM 2101 O VAL B 134 9.763 -10.888 4.517 1.00 17.40 O -ATOM 2102 CB VAL B 134 12.356 -9.643 3.780 1.00 11.96 C -ATOM 2103 CG1 VAL B 134 13.841 -9.777 4.082 1.00 18.38 C -ATOM 2104 CG2 VAL B 134 12.314 -8.873 2.475 1.00 14.78 C -ATOM 2105 N ALA B 135 9.938 -11.113 2.262 1.00 13.32 N -ATOM 2106 CA ALA B 135 8.505 -11.237 2.119 1.00 21.37 C -ATOM 2107 C ALA B 135 7.942 -12.494 2.777 1.00 17.09 C -ATOM 2108 O ALA B 135 6.829 -12.512 3.348 1.00 17.43 O -ATOM 2109 CB ALA B 135 8.135 -10.953 0.769 1.00 28.77 C -ATOM 2110 N GLY B 136 8.572 -13.635 2.636 1.00 18.26 N -ATOM 2111 CA GLY B 136 8.219 -15.058 3.189 1.00 19.82 C -ATOM 2112 C GLY B 136 8.146 -14.912 4.633 1.00 16.67 C -ATOM 2113 O GLY B 136 7.260 -15.405 5.231 1.00 15.34 O -ATOM 2114 N VAL B 137 9.300 -14.354 5.275 1.00 19.06 N -ATOM 2115 CA VAL B 137 9.275 -14.229 6.676 1.00 13.40 C -ATOM 2116 C VAL B 137 8.222 -13.320 7.172 1.00 14.98 C -ATOM 2117 O VAL B 137 7.448 -13.726 8.127 1.00 15.32 O -ATOM 2118 CB VAL B 137 10.681 -13.683 7.141 1.00 12.05 C -ATOM 2119 CG1 VAL B 137 10.587 -13.517 8.589 1.00 24.37 C -ATOM 2120 CG2 VAL B 137 11.663 -14.723 6.701 1.00 11.44 C -ATOM 2121 N ALA B 138 7.830 -12.223 6.567 1.00 14.63 N -ATOM 2122 CA ALA B 138 6.739 -11.343 6.960 1.00 14.97 C -ATOM 2123 C ALA B 138 5.477 -12.035 7.025 1.00 14.00 C -ATOM 2124 O ALA B 138 4.520 -11.965 7.766 1.00 15.18 O -ATOM 2125 CB ALA B 138 6.733 -10.129 6.135 1.00 21.60 C -ATOM 2126 N ASN B 139 5.257 -12.632 5.801 1.00 14.76 N -ATOM 2127 CA ASN B 139 3.965 -13.443 5.693 1.00 19.56 C -ATOM 2128 C ASN B 139 3.788 -14.741 6.508 1.00 16.64 C -ATOM 2129 O ASN B 139 2.773 -14.813 7.122 1.00 15.66 O -ATOM 2130 CB ASN B 139 3.915 -14.281 4.273 1.00 32.30 C -ATOM 2131 CG ASN B 139 3.642 -13.817 3.893 1.00 58.46 C -ATOM 2132 OD1 ASN B 139 3.350 -12.337 3.410 1.00 49.38 O -ATOM 2133 ND2 ASN B 139 4.138 -13.358 1.997 1.00 59.02 N -ATOM 2134 N ALA B 140 4.975 -15.279 6.996 1.00 12.53 N -ATOM 2135 CA ALA B 140 4.880 -16.341 7.880 1.00 19.39 C -ATOM 2136 C ALA B 140 4.686 -15.725 9.225 1.00 15.37 C -ATOM 2137 O ALA B 140 3.890 -16.337 10.107 1.00 15.92 O -ATOM 2138 CB ALA B 140 6.298 -17.186 7.962 1.00 22.20 C -ATOM 2139 N LEU B 141 5.135 -14.663 9.697 1.00 12.47 N -ATOM 2140 CA LEU B 141 4.897 -13.957 10.913 1.00 15.63 C -ATOM 2141 C LEU B 141 3.480 -13.697 11.034 1.00 21.66 C -ATOM 2142 O LEU B 141 2.905 -13.294 12.092 1.00 17.40 O -ATOM 2143 CB LEU B 141 5.926 -12.962 11.275 1.00 15.12 C -ATOM 2144 CG LEU B 141 7.158 -13.407 11.868 1.00 17.02 C -ATOM 2145 CD1 LEU B 141 8.083 -12.226 12.076 1.00 19.94 C -ATOM 2146 CD2 LEU B 141 7.122 -13.935 13.238 1.00 21.74 C -ATOM 2147 N ALA B 142 2.836 -13.244 9.876 1.00 12.86 N -ATOM 2148 CA ALA B 142 1.608 -12.628 9.849 1.00 14.61 C -ATOM 2149 C ALA B 142 0.405 -13.995 9.823 1.00 20.31 C -ATOM 2150 O ALA B 142 -0.813 -13.424 10.022 1.00 18.06 O -ATOM 2151 CB ALA B 142 1.282 -11.676 8.702 1.00 21.40 C -ATOM 2152 N HIS B 143 0.842 -15.030 9.582 1.00 17.95 N -ATOM 2153 CA HIS B 143 0.024 -16.256 9.074 1.00 26.37 C -ATOM 2154 C HIS B 143 -1.200 -16.456 10.329 1.00 19.76 C -ATOM 2155 O HIS B 143 -2.306 -16.886 9.956 1.00 21.59 O -ATOM 2156 CB HIS B 143 0.773 -17.382 8.911 1.00 35.96 C -ATOM 2157 CG HIS B 143 -0.236 -18.629 8.237 1.00 57.59 C -ATOM 2158 ND1 HIS B 143 0.057 -19.594 9.608 1.00 48.44 N -ATOM 2159 CD2 HIS B 143 -0.841 -18.281 7.293 1.00 54.87 C -ATOM 2160 CE1 HIS B 143 -0.983 -20.316 8.077 1.00 74.03 C -ATOM 2161 NE2 HIS B 143 -1.640 -19.381 7.013 1.00 57.99 N -ATOM 2162 N LYS B 144 -0.804 -16.302 11.559 1.00 18.69 N -ATOM 2163 CA LYS B 144 -1.735 -16.737 12.588 1.00 14.86 C -ATOM 2164 C LYS B 144 -2.396 -15.617 12.962 1.00 16.55 C -ATOM 2165 O LYS B 144 -3.129 -15.705 14.113 1.00 18.03 O -ATOM 2166 CB LYS B 144 -0.819 -17.365 13.621 1.00 17.13 C -ATOM 2167 CG LYS B 144 -0.392 -18.897 13.123 1.00 20.99 C -ATOM 2168 CD LYS B 144 -1.238 -19.970 13.316 1.00 34.56 C -ATOM 2169 CE LYS B 144 -2.035 -21.775 13.683 1.00 62.41 C -ATOM 2170 NZ LYS B 144 -0.955 -22.424 15.226 1.00 62.40 N -ATOM 2171 N TYR B 145 -2.408 -14.424 12.668 1.00 19.33 N -ATOM 2172 CA TYR B 145 -3.111 -13.193 12.851 1.00 25.80 C -ATOM 2173 C TYR B 145 -4.833 -13.485 12.942 1.00 37.10 C -ATOM 2174 O TYR B 145 -4.989 -14.273 11.858 1.00 25.59 O -ATOM 2175 CB TYR B 145 -2.815 -11.990 12.502 1.00 20.19 C -ATOM 2176 CG TYR B 145 -1.513 -11.202 13.062 1.00 16.11 C -ATOM 2177 CD1 TYR B 145 -1.713 -10.043 13.732 1.00 13.84 C -ATOM 2178 CD2 TYR B 145 -0.444 -12.052 12.964 1.00 19.35 C -ATOM 2179 CE1 TYR B 145 -0.716 -9.470 14.306 1.00 14.00 C -ATOM 2180 CE2 TYR B 145 0.824 -11.431 13.760 1.00 16.15 C -ATOM 2181 CZ TYR B 145 0.705 -10.123 14.396 1.00 11.23 C -ATOM 2182 OH TYR B 145 1.824 -9.505 14.779 1.00 11.07 O -ATOM 2183 N HIS B 146 -5.455 -13.156 13.610 1.00 22.40 N -ATOM 2184 CA HIS B 146 -7.082 -13.260 13.817 1.00 24.36 C -ATOM 2185 C HIS B 146 -7.642 -12.243 14.547 1.00 19.29 C -ATOM 2186 O HIS B 146 -6.896 -11.423 15.229 1.00 20.20 O -ATOM 2187 CB HIS B 146 -7.319 -14.676 14.251 1.00 17.91 C -ATOM 2188 CG HIS B 146 -7.349 -14.408 16.278 1.00 30.29 C -ATOM 2189 ND1 HIS B 146 -7.504 -15.329 16.577 1.00 56.02 N -ATOM 2190 CD2 HIS B 146 -5.754 -14.700 16.400 1.00 32.02 C -ATOM 2191 CE1 HIS B 146 -6.763 -15.571 18.243 1.00 45.40 C -ATOM 2192 NE2 HIS B 146 -6.023 -14.569 17.782 1.00 35.25 N -ATOM 2193 OXT HIS B 146 -8.867 -12.118 14.478 1.00 28.98 O -TER 2194 HIS B 146 -ATOM 2195 N VAL C 1 -6.932 15.801 -4.736 1.00 53.78 N -ATOM 2196 CA VAL C 1 -6.986 18.132 -4.726 1.00 39.83 C -ATOM 2197 C VAL C 1 -8.725 18.013 -5.289 1.00 29.73 C -ATOM 2198 O VAL C 1 -9.322 17.317 -6.202 1.00 31.20 O -ATOM 2199 CB VAL C 1 -6.406 17.702 -5.747 1.00 52.94 C -ATOM 2200 CG1 VAL C 1 -7.045 19.788 -6.149 1.00 47.73 C -ATOM 2201 CG2 VAL C 1 -5.138 19.765 -5.197 1.00 67.01 C -ATOM 2202 N LEU C 2 -9.481 18.489 -4.357 1.00 33.50 N -ATOM 2203 CA LEU C 2 -10.829 18.318 -4.244 1.00 35.54 C -ATOM 2204 C LEU C 2 -11.593 19.461 -5.392 1.00 25.83 C -ATOM 2205 O LEU C 2 -11.224 20.587 -4.763 1.00 37.30 O -ATOM 2206 CB LEU C 2 -11.320 18.570 -2.993 1.00 38.49 C -ATOM 2207 CG LEU C 2 -11.368 17.191 -2.068 1.00 34.89 C -ATOM 2208 CD1 LEU C 2 -11.559 17.406 -0.855 1.00 40.00 C -ATOM 2209 CD2 LEU C 2 -11.556 16.072 -2.571 1.00 36.30 C -ATOM 2210 N SER C 3 -12.051 19.126 -6.445 1.00 20.82 N -ATOM 2211 CA SER C 3 -12.764 20.102 -7.265 1.00 16.99 C -ATOM 2212 C SER C 3 -13.851 20.641 -6.492 1.00 19.86 C -ATOM 2213 O SER C 3 -14.562 20.118 -5.605 1.00 23.30 O -ATOM 2214 CB SER C 3 -12.915 19.412 -8.479 1.00 21.69 C -ATOM 2215 OG SER C 3 -14.045 18.617 -8.438 1.00 24.96 O -ATOM 2216 N PRO C 4 -14.614 21.747 -7.040 1.00 27.73 N -ATOM 2217 CA PRO C 4 -15.686 22.248 -6.606 1.00 18.30 C -ATOM 2218 C PRO C 4 -16.940 21.185 -6.683 1.00 21.79 C -ATOM 2219 O PRO C 4 -17.669 21.118 -5.776 1.00 30.78 O -ATOM 2220 CB PRO C 4 -16.024 23.555 -7.534 1.00 35.17 C -ATOM 2221 CG PRO C 4 -14.548 23.940 -7.997 1.00 39.10 C -ATOM 2222 CD PRO C 4 -13.753 22.599 -7.931 1.00 33.69 C -ATOM 2223 N ALA C 5 -16.700 20.569 -7.707 1.00 20.53 N -ATOM 2224 CA ALA C 5 -17.694 19.448 -7.877 1.00 15.17 C -ATOM 2225 C ALA C 5 -17.668 18.427 -6.566 1.00 17.36 C -ATOM 2226 O ALA C 5 -18.567 17.818 -6.161 1.00 18.86 O -ATOM 2227 CB ALA C 5 -17.845 18.678 -9.144 1.00 14.70 C -ATOM 2228 N ASP C 6 -16.408 17.997 -6.530 1.00 17.28 N -ATOM 2229 CA ASP C 6 -16.090 17.056 -5.440 1.00 13.65 C -ATOM 2230 C ASP C 6 -16.737 17.558 -4.126 1.00 16.19 C -ATOM 2231 O ASP C 6 -17.234 16.746 -3.292 1.00 18.77 O -ATOM 2232 CB ASP C 6 -14.589 16.808 -5.234 1.00 14.90 C -ATOM 2233 CG ASP C 6 -14.039 15.955 -6.391 1.00 15.46 C -ATOM 2234 OD1 ASP C 6 -14.772 14.926 -6.958 1.00 20.59 O -ATOM 2235 OD2 ASP C 6 -12.866 16.168 -6.605 1.00 19.80 O -ATOM 2236 N LYS C 7 -16.400 18.816 -3.902 1.00 17.95 N -ATOM 2237 CA LYS C 7 -17.103 19.561 -2.483 1.00 25.53 C -ATOM 2238 C LYS C 7 -18.248 19.426 -2.208 1.00 19.12 C -ATOM 2239 O LYS C 7 -18.931 19.046 -1.371 1.00 19.71 O -ATOM 2240 CB LYS C 7 -16.318 20.793 -2.391 1.00 27.50 C -ATOM 2241 CG LYS C 7 -14.901 20.741 -2.614 1.00 53.71 C -ATOM 2242 CD LYS C 7 -13.993 22.186 -1.677 1.00 60.72 C -ATOM 2243 CE LYS C 7 -13.186 22.490 -2.528 1.00 63.74 C -ATOM 2244 NZ LYS C 7 -12.305 23.225 -2.858 1.00 80.12 N -ATOM 2245 N THR C 8 -18.940 19.776 -3.501 1.00 18.59 N -ATOM 2246 CA THR C 8 -20.439 19.567 -3.523 1.00 17.68 C -ATOM 2247 C THR C 8 -21.010 18.410 -3.219 1.00 15.92 C -ATOM 2248 O THR C 8 -21.956 18.189 -2.497 1.00 18.11 O -ATOM 2249 CB THR C 8 -21.005 20.281 -5.121 1.00 18.41 C -ATOM 2250 OG1 THR C 8 -20.596 21.570 -4.936 1.00 22.00 O -ATOM 2251 CG2 THR C 8 -22.332 20.382 -5.020 1.00 19.72 C -ATOM 2252 N ASN C 9 -20.389 17.337 -3.881 1.00 14.52 N -ATOM 2253 CA ASN C 9 -20.679 15.854 -3.720 1.00 11.76 C -ATOM 2254 C ASN C 9 -20.524 15.368 -2.372 1.00 13.43 C -ATOM 2255 O ASN C 9 -21.452 14.760 -1.788 1.00 14.77 O -ATOM 2256 CB ASN C 9 -19.952 14.978 -4.802 1.00 15.52 C -ATOM 2257 CG ASN C 9 -20.502 14.902 -6.224 1.00 21.23 C -ATOM 2258 OD1 ASN C 9 -21.551 15.460 -6.366 1.00 17.78 O -ATOM 2259 ND2 ASN C 9 -19.655 14.764 -7.036 1.00 16.93 N -ATOM 2260 N VAL C 10 -19.456 15.819 -1.845 1.00 15.37 N -ATOM 2261 CA VAL C 10 -19.214 15.430 -0.511 1.00 15.09 C -ATOM 2262 C VAL C 10 -20.248 16.151 0.791 1.00 19.82 C -ATOM 2263 O VAL C 10 -20.653 15.344 1.499 1.00 21.55 O -ATOM 2264 CB VAL C 10 -17.776 15.740 -0.056 1.00 23.83 C -ATOM 2265 CG1 VAL C 10 -17.369 15.319 1.491 1.00 26.38 C -ATOM 2266 CG2 VAL C 10 -16.835 14.843 -0.837 1.00 22.96 C -ATOM 2267 N LYS C 11 -20.423 17.395 0.515 1.00 19.06 N -ATOM 2268 CA LYS C 11 -21.545 18.040 1.267 1.00 21.27 C -ATOM 2269 C LYS C 11 -22.705 17.621 1.194 1.00 24.36 C -ATOM 2270 O LYS C 11 -23.497 17.219 2.050 1.00 26.88 O -ATOM 2271 CB LYS C 11 -21.200 19.455 1.180 1.00 24.11 C -ATOM 2272 CG LYS C 11 -19.982 20.187 1.471 1.00 39.96 C -ATOM 2273 CD LYS C 11 -20.184 21.708 1.326 1.00 36.60 C -ATOM 2274 CE LYS C 11 -19.119 22.424 1.599 1.00 40.99 C -ATOM 2275 NZ LYS C 11 -18.303 23.379 0.156 1.00 57.68 N -ATOM 2276 N ALA C 12 -23.071 17.255 -0.098 1.00 26.89 N -ATOM 2277 CA ALA C 12 -24.190 16.574 -0.166 1.00 22.80 C -ATOM 2278 C ALA C 12 -24.709 15.466 0.479 1.00 22.96 C -ATOM 2279 O ALA C 12 -25.641 14.894 1.303 1.00 25.17 O -ATOM 2280 CB ALA C 12 -24.758 16.354 -1.436 1.00 30.68 C -ATOM 2281 N ALA C 13 -23.698 14.326 0.213 1.00 19.81 N -ATOM 2282 CA ALA C 13 -23.581 12.980 0.775 1.00 20.52 C -ATOM 2283 C ALA C 13 -23.620 13.074 2.219 1.00 17.10 C -ATOM 2284 O ALA C 13 -24.459 12.346 2.958 1.00 22.70 O -ATOM 2285 CB ALA C 13 -22.559 12.176 0.137 1.00 20.00 C -ATOM 2286 N TRP C 14 -22.646 13.784 2.878 1.00 18.93 N -ATOM 2287 CA TRP C 14 -22.430 13.732 4.346 1.00 19.61 C -ATOM 2288 C TRP C 14 -23.567 14.473 4.894 1.00 29.50 C -ATOM 2289 O TRP C 14 -24.277 14.100 6.022 1.00 22.89 O -ATOM 2290 CB TRP C 14 -21.334 14.670 4.695 1.00 20.94 C -ATOM 2291 CG TRP C 14 -20.803 14.092 5.924 1.00 20.44 C -ATOM 2292 CD1 TRP C 14 -21.097 15.028 7.151 1.00 25.06 C -ATOM 2293 CD2 TRP C 14 -20.135 12.848 6.216 1.00 19.23 C -ATOM 2294 NE1 TRP C 14 -20.337 14.117 8.027 1.00 26.03 N -ATOM 2295 CE2 TRP C 14 -19.941 12.969 7.773 1.00 27.20 C -ATOM 2296 CE3 TRP C 14 -19.861 11.878 5.555 1.00 24.26 C -ATOM 2297 CZ2 TRP C 14 -19.510 11.822 8.284 1.00 29.42 C -ATOM 2298 CZ3 TRP C 14 -19.277 10.605 6.015 1.00 27.47 C -ATOM 2299 CH2 TRP C 14 -19.230 10.798 7.728 1.00 31.11 C -ATOM 2300 N GLY C 15 -24.359 15.298 4.516 1.00 39.26 N -ATOM 2301 CA GLY C 15 -25.631 16.086 4.525 1.00 27.60 C -ATOM 2302 C GLY C 15 -26.650 15.043 4.748 1.00 35.88 C -ATOM 2303 O GLY C 15 -27.292 14.929 6.180 1.00 44.35 O -ATOM 2304 N LYS C 16 -26.927 14.192 4.125 1.00 34.61 N -ATOM 2305 CA LYS C 16 -27.870 13.141 3.632 1.00 36.98 C -ATOM 2306 C LYS C 16 -27.538 12.020 5.023 1.00 26.09 C -ATOM 2307 O LYS C 16 -28.345 11.313 5.635 1.00 33.01 O -ATOM 2308 CB LYS C 16 -28.251 12.406 2.440 1.00 27.30 C -ATOM 2309 CG LYS C 16 -30.036 12.836 1.831 1.00 50.84 C -ATOM 2310 CD LYS C 16 -30.158 11.081 2.262 1.00 68.28 C -ATOM 2311 CE LYS C 16 -32.371 10.866 2.370 1.00 73.16 C -ATOM 2312 NZ LYS C 16 -32.038 9.453 3.272 1.00 69.52 N -ATOM 2313 N VAL C 17 -26.252 12.133 5.573 1.00 35.88 N -ATOM 2314 CA VAL C 17 -25.770 11.297 6.645 1.00 27.62 C -ATOM 2315 C VAL C 17 -26.612 11.695 7.685 1.00 30.67 C -ATOM 2316 O VAL C 17 -27.281 11.042 8.701 1.00 29.27 O -ATOM 2317 CB VAL C 17 -24.169 10.853 6.795 1.00 24.84 C -ATOM 2318 CG1 VAL C 17 -23.946 10.589 8.064 1.00 24.66 C -ATOM 2319 CG2 VAL C 17 -23.794 9.916 5.483 1.00 36.95 C -ATOM 2320 N GLY C 18 -26.104 13.085 7.958 1.00 37.42 N -ATOM 2321 CA GLY C 18 -26.962 13.614 9.161 1.00 36.79 C -ATOM 2322 C GLY C 18 -26.609 13.344 10.447 1.00 35.54 C -ATOM 2323 O GLY C 18 -25.379 12.833 10.941 1.00 34.05 O -ATOM 2324 N ALA C 19 -27.875 13.044 10.943 1.00 30.07 N -ATOM 2325 CA ALA C 19 -27.686 12.652 12.207 1.00 42.34 C -ATOM 2326 C ALA C 19 -27.441 11.246 12.497 1.00 38.75 C -ATOM 2327 O ALA C 19 -27.016 10.579 13.697 1.00 34.11 O -ATOM 2328 CB ALA C 19 -28.889 12.929 12.875 1.00 49.98 C -ATOM 2329 N HIS C 20 -27.337 10.243 11.555 1.00 27.23 N -ATOM 2330 CA HIS C 20 -26.912 8.767 11.705 1.00 31.96 C -ATOM 2331 C HIS C 20 -25.296 8.716 11.689 1.00 24.34 C -ATOM 2332 O HIS C 20 -24.833 7.499 11.716 1.00 23.07 O -ATOM 2333 CB HIS C 20 -27.281 8.149 10.528 1.00 47.99 C -ATOM 2334 CG HIS C 20 -28.926 8.104 10.076 1.00 49.70 C -ATOM 2335 ND1 HIS C 20 -29.432 7.280 11.405 1.00 46.00 N -ATOM 2336 CD2 HIS C 20 -29.730 9.020 9.630 1.00 46.72 C -ATOM 2337 CE1 HIS C 20 -31.098 7.852 11.111 1.00 49.28 C -ATOM 2338 NE2 HIS C 20 -30.830 8.671 9.800 1.00 51.94 N -ATOM 2339 N ALA C 21 -24.619 9.813 11.399 1.00 28.71 N -ATOM 2340 CA ALA C 21 -23.098 9.802 11.331 1.00 32.59 C -ATOM 2341 C ALA C 21 -22.391 9.015 12.473 1.00 33.22 C -ATOM 2342 O ALA C 21 -21.700 8.030 11.964 1.00 25.05 O -ATOM 2343 CB ALA C 21 -22.805 11.312 11.238 1.00 28.99 C -ATOM 2344 N GLY C 22 -22.670 8.973 13.605 1.00 30.50 N -ATOM 2345 CA GLY C 22 -22.269 8.117 14.625 1.00 25.20 C -ATOM 2346 C GLY C 22 -22.605 6.970 14.498 1.00 28.87 C -ATOM 2347 O GLY C 22 -21.738 5.901 14.583 1.00 21.09 O -ATOM 2348 N GLU C 23 -23.752 6.203 14.168 1.00 19.95 N -ATOM 2349 CA GLU C 23 -24.151 4.976 13.969 1.00 21.38 C -ATOM 2350 C GLU C 23 -23.181 4.329 12.723 1.00 15.02 C -ATOM 2351 O GLU C 23 -22.815 3.097 12.742 1.00 16.54 O -ATOM 2352 CB GLU C 23 -25.689 4.819 13.452 1.00 29.82 C -ATOM 2353 CG GLU C 23 -26.106 3.452 13.736 1.00 36.93 C -ATOM 2354 CD GLU C 23 -28.202 3.924 13.602 1.00 80.12 C -ATOM 2355 OE1 GLU C 23 -27.795 2.922 11.489 1.00 66.02 O -ATOM 2356 OE2 GLU C 23 -27.964 4.694 13.267 1.00 59.79 O -ATOM 2357 N TYR C 24 -23.207 5.173 11.697 1.00 21.28 N -ATOM 2358 CA TYR C 24 -22.418 4.812 10.585 1.00 19.46 C -ATOM 2359 C TYR C 24 -20.849 4.466 10.860 1.00 15.33 C -ATOM 2360 O TYR C 24 -20.148 3.754 10.360 1.00 13.77 O -ATOM 2361 CB TYR C 24 -22.651 5.606 9.406 1.00 16.14 C -ATOM 2362 CG TYR C 24 -24.080 5.727 8.793 1.00 13.71 C -ATOM 2363 CD1 TYR C 24 -24.170 6.732 7.640 1.00 24.76 C -ATOM 2364 CD2 TYR C 24 -25.002 4.824 9.337 1.00 21.84 C -ATOM 2365 CE1 TYR C 24 -25.645 6.832 7.377 1.00 25.66 C -ATOM 2366 CE2 TYR C 24 -26.453 4.934 8.784 1.00 17.49 C -ATOM 2367 CZ TYR C 24 -26.325 5.877 7.791 1.00 27.32 C -ATOM 2368 OH TYR C 24 -27.810 6.069 7.401 1.00 31.23 O -ATOM 2369 N GLY C 25 -20.290 5.421 11.638 1.00 18.29 N -ATOM 2370 CA GLY C 25 -19.027 5.388 12.069 1.00 15.33 C -ATOM 2371 C GLY C 25 -18.807 4.272 12.918 1.00 12.64 C -ATOM 2372 O GLY C 25 -17.733 3.304 12.661 1.00 15.23 O -ATOM 2373 N ALA C 26 -19.542 3.599 13.820 1.00 16.00 N -ATOM 2374 CA ALA C 26 -19.471 2.386 14.471 1.00 11.42 C -ATOM 2375 C ALA C 26 -19.307 1.193 13.564 1.00 10.94 C -ATOM 2376 O ALA C 26 -18.739 0.230 13.578 1.00 13.65 O -ATOM 2377 CB ALA C 26 -20.512 2.232 15.656 1.00 11.99 C -ATOM 2378 N GLU C 27 -20.425 1.260 12.521 1.00 12.87 N -ATOM 2379 CA GLU C 27 -20.638 0.028 11.636 1.00 15.51 C -ATOM 2380 C GLU C 27 -19.412 0.022 10.785 1.00 12.84 C -ATOM 2381 O GLU C 27 -18.849 -1.119 10.534 1.00 15.95 O -ATOM 2382 CB GLU C 27 -21.715 0.427 10.623 1.00 15.50 C -ATOM 2383 CG GLU C 27 -21.926 -0.710 9.772 1.00 17.08 C -ATOM 2384 CD GLU C 27 -23.164 -0.586 8.872 1.00 30.48 C -ATOM 2385 OE1 GLU C 27 -23.095 -0.770 7.588 1.00 18.71 O -ATOM 2386 OE2 GLU C 27 -24.194 0.119 9.312 1.00 24.16 O -ATOM 2387 N ALA C 28 -18.789 1.258 10.332 1.00 11.36 N -ATOM 2388 CA ALA C 28 -17.460 1.158 9.500 1.00 9.58 C -ATOM 2389 C ALA C 28 -16.340 0.418 10.332 1.00 9.29 C -ATOM 2390 O ALA C 28 -15.677 -0.370 9.760 1.00 12.64 O -ATOM 2391 CB ALA C 28 -17.171 2.523 9.159 1.00 13.35 C -ATOM 2392 N LEU C 29 -16.325 0.834 11.666 1.00 12.01 N -ATOM 2393 CA LEU C 29 -15.240 0.036 12.460 1.00 9.42 C -ATOM 2394 C LEU C 29 -15.351 -1.296 12.531 1.00 8.04 C -ATOM 2395 O LEU C 29 -14.557 -2.221 12.462 1.00 11.27 O -ATOM 2396 CB LEU C 29 -15.253 0.792 13.944 1.00 13.39 C -ATOM 2397 CG LEU C 29 -14.671 2.120 14.000 1.00 14.28 C -ATOM 2398 CD1 LEU C 29 -15.060 2.641 15.229 1.00 21.17 C -ATOM 2399 CD2 LEU C 29 -13.328 2.186 13.586 1.00 17.52 C -ATOM 2400 N GLU C 30 -16.582 -1.891 12.768 1.00 12.13 N -ATOM 2401 CA GLU C 30 -17.039 -3.158 12.830 1.00 15.15 C -ATOM 2402 C GLU C 30 -16.575 -3.834 11.597 1.00 15.74 C -ATOM 2403 O GLU C 30 -16.144 -4.973 11.643 1.00 15.15 O -ATOM 2404 CB GLU C 30 -18.512 -3.390 13.241 1.00 16.95 C -ATOM 2405 CG GLU C 30 -18.749 -4.796 13.397 1.00 22.01 C -ATOM 2406 CD GLU C 30 -20.492 -5.310 14.125 1.00 33.25 C -ATOM 2407 OE1 GLU C 30 -20.859 -4.170 14.215 1.00 33.78 O -ATOM 2408 OE2 GLU C 30 -20.298 -6.063 14.309 1.00 40.59 O -ATOM 2409 N ARG C 31 -17.016 -3.172 10.500 1.00 9.68 N -ATOM 2410 CA ARG C 31 -16.706 -3.791 9.173 1.00 8.70 C -ATOM 2411 C ARG C 31 -15.092 -4.029 9.070 1.00 13.62 C -ATOM 2412 O ARG C 31 -14.706 -5.080 8.618 1.00 13.67 O -ATOM 2413 CB ARG C 31 -17.211 -2.898 8.144 1.00 12.42 C -ATOM 2414 CG ARG C 31 -18.743 -3.121 7.942 1.00 11.84 C -ATOM 2415 CD ARG C 31 -19.136 -2.201 6.911 1.00 15.20 C -ATOM 2416 NE ARG C 31 -20.701 -2.256 6.631 1.00 14.19 N -ATOM 2417 CZ ARG C 31 -21.363 -3.224 5.977 1.00 11.42 C -ATOM 2418 NH1 ARG C 31 -20.645 -4.259 5.462 1.00 11.92 N -ATOM 2419 NH2 ARG C 31 -22.607 -3.167 6.110 1.00 15.15 N -ATOM 2420 N MET C 32 -14.391 -2.999 9.390 1.00 10.57 N -ATOM 2421 CA MET C 32 -12.880 -2.985 9.431 1.00 8.16 C -ATOM 2422 C MET C 32 -12.304 -4.106 10.303 1.00 7.80 C -ATOM 2423 O MET C 32 -11.482 -4.880 9.804 1.00 11.64 O -ATOM 2424 CB MET C 32 -12.387 -1.587 9.793 1.00 8.09 C -ATOM 2425 CG MET C 32 -10.949 -1.623 9.744 1.00 11.10 C -ATOM 2426 SD MET C 32 -10.226 -0.081 10.328 1.00 18.02 S -ATOM 2427 CE MET C 32 -10.638 -0.209 12.043 1.00 20.04 C -ATOM 2428 N PHE C 33 -12.802 -4.206 11.603 1.00 13.50 N -ATOM 2429 CA PHE C 33 -12.271 -5.320 12.432 1.00 12.85 C -ATOM 2430 C PHE C 33 -12.547 -6.578 11.951 1.00 15.05 C -ATOM 2431 O PHE C 33 -11.717 -7.551 12.143 1.00 13.38 O -ATOM 2432 CB PHE C 33 -12.756 -5.046 13.817 1.00 12.45 C -ATOM 2433 CG PHE C 33 -12.568 -3.710 14.467 1.00 10.81 C -ATOM 2434 CD1 PHE C 33 -11.266 -3.320 14.428 1.00 14.60 C -ATOM 2435 CD2 PHE C 33 -13.526 -3.151 15.305 1.00 15.15 C -ATOM 2436 CE1 PHE C 33 -10.894 -2.155 15.062 1.00 15.80 C -ATOM 2437 CE2 PHE C 33 -13.010 -1.947 15.768 1.00 13.43 C -ATOM 2438 CZ PHE C 33 -11.786 -1.494 15.661 1.00 22.23 C -ATOM 2439 N LEU C 34 -13.672 -6.909 11.292 1.00 11.85 N -ATOM 2440 CA LEU C 34 -14.025 -8.262 10.744 1.00 12.31 C -ATOM 2441 C LEU C 34 -13.308 -8.546 9.433 1.00 15.72 C -ATOM 2442 O LEU C 34 -12.814 -9.634 9.197 1.00 19.67 O -ATOM 2443 CB LEU C 34 -15.490 -8.519 10.506 1.00 16.89 C -ATOM 2444 CG LEU C 34 -16.308 -8.523 11.809 1.00 26.21 C -ATOM 2445 CD1 LEU C 34 -17.801 -8.703 11.585 1.00 26.59 C -ATOM 2446 CD2 LEU C 34 -15.886 -9.544 12.837 1.00 38.34 C -ATOM 2447 N SER C 35 -13.287 -7.520 8.527 1.00 12.82 N -ATOM 2448 CA SER C 35 -12.594 -7.794 7.329 1.00 10.93 C -ATOM 2449 C SER C 35 -11.162 -7.828 7.166 1.00 14.27 C -ATOM 2450 O SER C 35 -10.505 -8.327 6.376 1.00 16.71 O -ATOM 2451 CB SER C 35 -13.015 -6.732 6.237 1.00 13.98 C -ATOM 2452 OG SER C 35 -14.406 -6.851 5.967 1.00 18.75 O -ATOM 2453 N PHE C 36 -10.441 -6.974 8.104 1.00 11.09 N -ATOM 2454 CA PHE C 36 -9.024 -6.696 8.153 1.00 10.70 C -ATOM 2455 C PHE C 36 -8.606 -6.742 9.707 1.00 13.97 C -ATOM 2456 O PHE C 36 -8.344 -5.778 10.402 1.00 16.32 O -ATOM 2457 CB PHE C 36 -8.759 -5.327 7.682 1.00 12.71 C -ATOM 2458 CG PHE C 36 -9.244 -5.034 6.227 1.00 14.13 C -ATOM 2459 CD1 PHE C 36 -10.405 -4.227 6.071 1.00 14.98 C -ATOM 2460 CD2 PHE C 36 -8.716 -5.826 5.029 1.00 21.47 C -ATOM 2461 CE1 PHE C 36 -10.962 -3.950 4.805 1.00 23.41 C -ATOM 2462 CE2 PHE C 36 -9.304 -5.498 3.966 1.00 24.62 C -ATOM 2463 CZ PHE C 36 -10.428 -4.612 3.839 1.00 15.55 C -ATOM 2464 N PRO C 37 -8.487 -8.050 9.947 1.00 18.65 N -ATOM 2465 CA PRO C 37 -8.320 -8.334 11.359 1.00 17.35 C -ATOM 2466 C PRO C 37 -6.962 -7.708 12.012 1.00 18.35 C -ATOM 2467 O PRO C 37 -6.854 -7.465 13.248 1.00 14.04 O -ATOM 2468 CB PRO C 37 -8.349 -9.870 11.562 1.00 27.87 C -ATOM 2469 CG PRO C 37 -8.429 -10.372 10.373 1.00 37.42 C -ATOM 2470 CD PRO C 37 -8.767 -9.192 9.450 1.00 22.48 C -ATOM 2471 N THR C 38 -6.066 -7.410 11.173 1.00 12.63 N -ATOM 2472 CA THR C 38 -4.834 -6.636 11.753 1.00 17.25 C -ATOM 2473 C THR C 38 -5.049 -5.478 12.414 1.00 15.32 C -ATOM 2474 O THR C 38 -4.264 -5.001 13.219 1.00 11.09 O -ATOM 2475 CB THR C 38 -3.639 -7.011 10.452 1.00 12.40 C -ATOM 2476 OG1 THR C 38 -4.178 -5.757 9.596 1.00 15.33 O -ATOM 2477 CG2 THR C 38 -4.507 -7.126 9.385 1.00 80.12 C -ATOM 2478 N THR C 39 -6.072 -4.797 11.866 1.00 10.35 N -ATOM 2479 CA THR C 39 -6.458 -3.530 12.499 1.00 11.60 C -ATOM 2480 C THR C 39 -6.867 -3.675 13.987 1.00 11.25 C -ATOM 2481 O THR C 39 -6.719 -2.683 14.751 1.00 15.31 O -ATOM 2482 CB THR C 39 -7.618 -2.839 11.782 1.00 10.41 C -ATOM 2483 OG1 THR C 39 -8.902 -3.535 11.780 1.00 8.43 O -ATOM 2484 CG2 THR C 39 -7.110 -2.694 10.278 1.00 7.27 C -ATOM 2485 N LYS C 40 -7.142 -4.800 14.416 1.00 12.10 N -ATOM 2486 CA LYS C 40 -7.571 -4.948 15.946 1.00 12.37 C -ATOM 2487 C LYS C 40 -6.340 -4.815 16.822 1.00 12.69 C -ATOM 2488 O LYS C 40 -6.554 -4.646 17.995 1.00 13.50 O -ATOM 2489 CB LYS C 40 -8.135 -6.441 16.142 1.00 13.01 C -ATOM 2490 CG LYS C 40 -9.508 -6.644 15.446 1.00 16.35 C -ATOM 2491 CD LYS C 40 -9.585 -8.284 15.551 1.00 21.60 C -ATOM 2492 CE LYS C 40 -10.395 -8.518 15.432 1.00 41.58 C -ATOM 2493 NZ LYS C 40 -10.104 -10.161 15.709 1.00 24.62 N -ATOM 2494 N THR C 41 -5.213 -4.883 16.231 1.00 15.39 N -ATOM 2495 CA THR C 41 -3.858 -4.878 17.048 1.00 15.24 C -ATOM 2496 C THR C 41 -3.895 -3.538 17.513 1.00 24.53 C -ATOM 2497 O THR C 41 -3.052 -3.276 18.625 1.00 20.94 O -ATOM 2498 CB THR C 41 -2.611 -5.058 16.204 1.00 10.27 C -ATOM 2499 OG1 THR C 41 -2.473 -4.084 15.265 1.00 10.56 O -ATOM 2500 CG2 THR C 41 -2.649 -6.370 15.637 1.00 13.16 C -ATOM 2501 N TYR C 42 -4.559 -2.347 17.313 1.00 15.74 N -ATOM 2502 CA TYR C 42 -4.420 -1.045 17.757 1.00 10.60 C -ATOM 2503 C TYR C 42 -5.479 -0.829 18.921 1.00 12.75 C -ATOM 2504 O TYR C 42 -5.553 0.201 19.530 1.00 15.68 O -ATOM 2505 CB TYR C 42 -4.800 0.068 16.774 1.00 16.68 C -ATOM 2506 CG TYR C 42 -3.607 -0.087 15.746 1.00 10.99 C -ATOM 2507 CD1 TYR C 42 -2.328 0.661 16.011 1.00 17.16 C -ATOM 2508 CD2 TYR C 42 -3.699 -0.743 14.478 1.00 12.51 C -ATOM 2509 CE1 TYR C 42 -1.337 0.521 15.154 1.00 15.83 C -ATOM 2510 CE2 TYR C 42 -2.696 -0.758 13.617 1.00 12.91 C -ATOM 2511 CZ TYR C 42 -1.386 -0.114 13.943 1.00 12.97 C -ATOM 2512 OH TYR C 42 -0.401 -0.078 12.976 1.00 13.25 O -ATOM 2513 N PHE C 43 -6.271 -1.850 19.113 1.00 15.49 N -ATOM 2514 CA PHE C 43 -7.459 -1.760 20.167 1.00 17.75 C -ATOM 2515 C PHE C 43 -7.514 -3.016 21.053 1.00 20.04 C -ATOM 2516 O PHE C 43 -8.605 -3.535 21.334 1.00 17.05 O -ATOM 2517 CB PHE C 43 -8.817 -1.519 19.333 1.00 26.70 C -ATOM 2518 CG PHE C 43 -8.906 -0.392 18.437 1.00 14.42 C -ATOM 2519 CD1 PHE C 43 -8.473 -0.554 17.054 1.00 15.73 C -ATOM 2520 CD2 PHE C 43 -9.700 0.777 18.998 1.00 15.90 C -ATOM 2521 CE1 PHE C 43 -8.663 0.579 16.317 1.00 16.99 C -ATOM 2522 CE2 PHE C 43 -9.585 1.781 18.059 1.00 19.76 C -ATOM 2523 CZ PHE C 43 -9.193 1.883 16.726 1.00 10.96 C -ATOM 2524 N PRO C 44 -6.303 -3.266 21.758 1.00 17.51 N -ATOM 2525 CA PRO C 44 -6.430 -4.575 22.577 1.00 22.01 C -ATOM 2526 C PRO C 44 -7.021 -4.034 23.952 1.00 23.34 C -ATOM 2527 O PRO C 44 -7.479 -5.004 24.549 1.00 23.67 O -ATOM 2528 CB PRO C 44 -4.725 -4.600 22.823 1.00 28.76 C -ATOM 2529 CG PRO C 44 -4.302 -3.265 22.722 1.00 30.00 C -ATOM 2530 CD PRO C 44 -5.000 -2.496 21.564 1.00 18.17 C -ATOM 2531 N HIS C 45 -7.313 -2.986 24.170 1.00 23.82 N -ATOM 2532 CA HIS C 45 -8.129 -2.454 25.363 1.00 24.33 C -ATOM 2533 C HIS C 45 -9.774 -2.425 25.223 1.00 36.67 C -ATOM 2534 O HIS C 45 -10.201 -1.856 26.159 1.00 32.61 O -ATOM 2535 CB HIS C 45 -7.724 -1.122 25.714 1.00 29.73 C -ATOM 2536 CG HIS C 45 -7.512 0.207 24.830 1.00 29.43 C -ATOM 2537 ND1 HIS C 45 -6.904 -0.240 23.536 1.00 26.84 N -ATOM 2538 CD2 HIS C 45 -8.212 1.313 24.765 1.00 33.54 C -ATOM 2539 CE1 HIS C 45 -7.241 0.770 23.119 1.00 37.75 C -ATOM 2540 NE2 HIS C 45 -7.901 1.880 23.651 1.00 39.11 N -ATOM 2541 N PHE C 46 -10.097 -2.588 23.981 1.00 19.71 N -ATOM 2542 CA PHE C 46 -11.427 -2.447 23.784 1.00 16.71 C -ATOM 2543 C PHE C 46 -11.984 -3.704 23.878 1.00 21.27 C -ATOM 2544 O PHE C 46 -11.601 -4.890 23.408 1.00 23.84 O -ATOM 2545 CB PHE C 46 -11.721 -1.909 22.223 1.00 21.57 C -ATOM 2546 CG PHE C 46 -11.812 -0.571 22.355 1.00 17.89 C -ATOM 2547 CD1 PHE C 46 -12.584 0.134 21.407 1.00 29.22 C -ATOM 2548 CD2 PHE C 46 -11.092 0.466 22.932 1.00 29.35 C -ATOM 2549 CE1 PHE C 46 -12.539 1.579 21.231 1.00 23.51 C -ATOM 2550 CE2 PHE C 46 -11.283 1.342 22.737 1.00 34.19 C -ATOM 2551 CZ PHE C 46 -11.794 2.381 21.680 1.00 30.38 C -ATOM 2552 N ASP C 47 -13.484 -3.924 24.123 1.00 21.22 N -ATOM 2553 CA ASP C 47 -14.200 -5.093 23.710 1.00 21.17 C -ATOM 2554 C ASP C 47 -14.972 -4.945 22.231 1.00 15.44 C -ATOM 2555 O ASP C 47 -15.394 -3.747 22.085 1.00 19.22 O -ATOM 2556 CB ASP C 47 -15.564 -4.912 24.743 1.00 26.87 C -ATOM 2557 CG ASP C 47 -16.291 -6.456 24.524 1.00 44.60 C -ATOM 2558 OD1 ASP C 47 -16.314 -6.539 23.491 1.00 38.14 O -ATOM 2559 OD2 ASP C 47 -17.247 -6.397 25.386 1.00 35.16 O -ATOM 2560 N LEU C 48 -14.283 -5.744 21.445 1.00 20.23 N -ATOM 2561 CA LEU C 48 -14.738 -5.455 19.945 1.00 22.13 C -ATOM 2562 C LEU C 48 -15.716 -6.250 19.550 1.00 26.79 C -ATOM 2563 O LEU C 48 -16.269 -6.380 18.272 1.00 28.79 O -ATOM 2564 CB LEU C 48 -13.468 -5.863 19.207 1.00 20.10 C -ATOM 2565 CG LEU C 48 -12.283 -5.143 19.138 1.00 22.13 C -ATOM 2566 CD1 LEU C 48 -10.976 -5.443 18.455 1.00 30.66 C -ATOM 2567 CD2 LEU C 48 -12.440 -3.412 19.024 1.00 21.27 C -ATOM 2568 N SER C 49 -16.750 -6.795 20.348 1.00 29.67 N -ATOM 2569 CA SER C 49 -17.996 -7.682 20.348 1.00 26.45 C -ATOM 2570 C SER C 49 -18.688 -6.784 19.661 1.00 19.97 C -ATOM 2571 O SER C 49 -18.950 -5.536 19.662 1.00 20.96 O -ATOM 2572 CB SER C 49 -18.391 -8.577 21.574 1.00 26.72 C -ATOM 2573 OG SER C 49 -18.238 -7.994 22.499 1.00 34.29 O -ATOM 2574 N HIS C 50 -19.776 -7.581 18.833 1.00 28.23 N -ATOM 2575 CA HIS C 50 -20.784 -6.859 18.155 1.00 26.06 C -ATOM 2576 C HIS C 50 -21.742 -6.003 19.283 1.00 24.81 C -ATOM 2577 O HIS C 50 -21.976 -6.730 20.143 1.00 27.33 O -ATOM 2578 CB HIS C 50 -21.772 -7.860 17.171 1.00 33.58 C -ATOM 2579 CG HIS C 50 -22.495 -6.997 16.501 1.00 21.75 C -ATOM 2580 ND1 HIS C 50 -24.098 -7.224 16.903 1.00 37.61 N -ATOM 2581 CD2 HIS C 50 -22.721 -6.030 15.749 1.00 24.11 C -ATOM 2582 CE1 HIS C 50 -24.713 -6.289 16.301 1.00 35.12 C -ATOM 2583 NE2 HIS C 50 -23.972 -5.305 15.362 1.00 42.35 N -ATOM 2584 N GLY C 51 -21.911 -4.827 19.019 1.00 24.42 N -ATOM 2585 CA GLY C 51 -22.633 -4.098 19.831 1.00 26.56 C -ATOM 2586 C GLY C 51 -22.082 -3.387 20.930 1.00 23.39 C -ATOM 2587 O GLY C 51 -22.536 -2.501 21.731 1.00 25.53 O -ATOM 2588 N SER C 52 -20.724 -3.498 20.885 1.00 22.06 N -ATOM 2589 CA SER C 52 -19.739 -2.846 21.982 1.00 25.03 C -ATOM 2590 C SER C 52 -19.903 -1.593 22.193 1.00 31.37 C -ATOM 2591 O SER C 52 -19.945 -0.663 21.200 1.00 22.94 O -ATOM 2592 CB SER C 52 -18.376 -3.162 21.704 1.00 30.26 C -ATOM 2593 OG SER C 52 -17.567 -2.497 22.631 1.00 21.66 O -ATOM 2594 N ALA C 53 -20.311 -0.885 23.302 1.00 22.15 N -ATOM 2595 CA ALA C 53 -20.223 0.561 23.639 1.00 29.32 C -ATOM 2596 C ALA C 53 -19.008 1.341 23.195 1.00 23.50 C -ATOM 2597 O ALA C 53 -19.144 2.489 22.964 1.00 19.56 O -ATOM 2598 CB ALA C 53 -21.016 0.770 24.778 1.00 46.37 C -ATOM 2599 N GLN C 54 -18.075 0.456 23.565 1.00 20.69 N -ATOM 2600 CA GLN C 54 -16.671 1.124 23.388 1.00 22.13 C -ATOM 2601 C GLN C 54 -16.498 1.625 21.724 1.00 21.00 C -ATOM 2602 O GLN C 54 -15.986 2.677 21.452 1.00 19.66 O -ATOM 2603 CB GLN C 54 -15.533 0.388 23.780 1.00 23.01 C -ATOM 2604 CG GLN C 54 -15.387 0.264 25.146 1.00 26.98 C -ATOM 2605 CD GLN C 54 -14.244 -0.704 25.751 1.00 17.64 C -ATOM 2606 OE1 GLN C 54 -14.213 -1.867 25.317 1.00 23.97 O -ATOM 2607 NE2 GLN C 54 -13.269 -0.029 26.343 1.00 35.16 N -ATOM 2608 N VAL C 55 -16.998 0.495 20.976 1.00 18.58 N -ATOM 2609 CA VAL C 55 -16.782 0.728 19.397 1.00 18.23 C -ATOM 2610 C VAL C 55 -17.788 1.835 19.121 1.00 15.73 C -ATOM 2611 O VAL C 55 -17.557 2.638 18.250 1.00 16.15 O -ATOM 2612 CB VAL C 55 -17.023 -0.655 18.769 1.00 16.13 C -ATOM 2613 CG1 VAL C 55 -17.141 -0.282 17.289 1.00 22.56 C -ATOM 2614 CG2 VAL C 55 -15.953 -1.526 19.088 1.00 16.34 C -ATOM 2615 N LYS C 56 -19.064 1.844 19.638 1.00 17.00 N -ATOM 2616 CA LYS C 56 -20.011 2.798 19.335 1.00 18.57 C -ATOM 2617 C LYS C 56 -19.657 4.015 19.595 1.00 20.36 C -ATOM 2618 O LYS C 56 -19.638 5.117 18.950 1.00 20.10 O -ATOM 2619 CB LYS C 56 -21.306 2.565 20.099 1.00 27.04 C -ATOM 2620 CG LYS C 56 -22.017 1.239 19.517 1.00 42.35 C -ATOM 2621 CD LYS C 56 -23.983 2.334 19.796 1.00 43.36 C -ATOM 2622 CE LYS C 56 -24.238 -0.016 19.420 1.00 48.38 C -ATOM 2623 NZ LYS C 56 -25.547 0.420 20.454 1.00 67.70 N -ATOM 2624 N GLY C 57 -18.873 4.239 20.758 1.00 16.00 N -ATOM 2625 CA GLY C 57 -18.397 5.432 21.231 1.00 21.54 C -ATOM 2626 C GLY C 57 -17.299 6.086 20.387 1.00 18.61 C -ATOM 2627 O GLY C 57 -17.174 7.416 20.069 1.00 24.59 O -ATOM 2628 N HIS C 58 -16.421 5.133 20.063 1.00 15.81 N -ATOM 2629 CA HIS C 58 -15.259 5.492 19.163 1.00 16.10 C -ATOM 2630 C HIS C 58 -15.968 5.977 17.705 1.00 21.16 C -ATOM 2631 O HIS C 58 -15.334 6.873 17.165 1.00 17.74 O -ATOM 2632 CB HIS C 58 -14.298 4.450 19.037 1.00 15.43 C -ATOM 2633 CG HIS C 58 -13.084 4.816 18.336 1.00 18.98 C -ATOM 2634 ND1 HIS C 58 -12.377 5.886 18.887 1.00 21.14 N -ATOM 2635 CD2 HIS C 58 -12.537 4.339 17.359 1.00 16.95 C -ATOM 2636 CE1 HIS C 58 -11.397 5.896 17.811 1.00 21.77 C -ATOM 2637 NE2 HIS C 58 -11.418 4.951 16.789 1.00 17.45 N -ATOM 2638 N GLY C 59 -16.820 5.155 17.321 1.00 20.04 N -ATOM 2639 CA GLY C 59 -17.341 5.505 16.148 1.00 24.32 C -ATOM 2640 C GLY C 59 -18.005 6.810 15.949 1.00 16.44 C -ATOM 2641 O GLY C 59 -17.768 7.655 14.926 1.00 16.63 O -ATOM 2642 N LYS C 60 -18.641 7.304 17.045 1.00 14.40 N -ATOM 2643 CA LYS C 60 -19.047 8.674 17.195 1.00 14.87 C -ATOM 2644 C LYS C 60 -18.066 9.704 17.103 1.00 17.20 C -ATOM 2645 O LYS C 60 -18.083 10.725 16.452 1.00 19.10 O -ATOM 2646 CB LYS C 60 -20.090 8.722 18.417 1.00 20.14 C -ATOM 2647 CG LYS C 60 -20.474 10.102 18.286 1.00 36.22 C -ATOM 2648 CD LYS C 60 -21.736 10.498 19.120 1.00 67.45 C -ATOM 2649 CE LYS C 60 -22.281 11.583 18.549 1.00 61.41 C -ATOM 2650 NZ LYS C 60 -21.104 12.754 19.691 1.00 67.02 N -ATOM 2651 N LYS C 61 -16.927 9.423 17.774 1.00 17.79 N -ATOM 2652 CA LYS C 61 -15.858 10.357 17.767 1.00 21.13 C -ATOM 2653 C LYS C 61 -15.164 10.595 16.162 1.00 16.24 C -ATOM 2654 O LYS C 61 -14.881 11.695 15.808 1.00 15.80 O -ATOM 2655 CB LYS C 61 -14.696 9.830 18.603 1.00 23.05 C -ATOM 2656 CG LYS C 61 -15.062 10.074 19.860 1.00 29.48 C -ATOM 2657 CD LYS C 61 -14.168 9.693 20.841 1.00 35.76 C -ATOM 2658 CE LYS C 61 -14.859 10.184 22.437 1.00 58.26 C -ATOM 2659 NZ LYS C 61 -13.290 9.055 22.853 1.00 59.87 N -ATOM 2660 N VAL C 62 -15.053 9.278 15.522 1.00 15.31 N -ATOM 2661 CA VAL C 62 -14.623 9.355 14.153 1.00 17.56 C -ATOM 2662 C VAL C 62 -15.371 10.194 13.113 1.00 16.25 C -ATOM 2663 O VAL C 62 -15.014 11.087 12.455 1.00 13.61 O -ATOM 2664 CB VAL C 62 -14.380 7.809 13.720 1.00 18.84 C -ATOM 2665 CG1 VAL C 62 -14.183 7.763 12.290 1.00 17.19 C -ATOM 2666 CG2 VAL C 62 -13.252 7.305 14.521 1.00 18.33 C -ATOM 2667 N ALA C 63 -16.701 9.866 13.495 1.00 13.67 N -ATOM 2668 CA ALA C 63 -17.818 10.501 12.645 1.00 21.56 C -ATOM 2669 C ALA C 63 -17.715 11.855 12.728 1.00 19.04 C -ATOM 2670 O ALA C 63 -17.832 12.775 11.974 1.00 17.01 O -ATOM 2671 CB ALA C 63 -19.206 9.890 12.827 1.00 17.02 C -ATOM 2672 N ASP C 64 -17.653 12.417 13.991 1.00 16.51 N -ATOM 2673 CA ASP C 64 -17.709 13.830 14.243 1.00 19.49 C -ATOM 2674 C ASP C 64 -16.540 14.535 13.748 1.00 14.91 C -ATOM 2675 O ASP C 64 -16.584 15.604 13.224 1.00 19.95 O -ATOM 2676 CB ASP C 64 -17.991 14.096 15.799 1.00 24.76 C -ATOM 2677 CG ASP C 64 -19.393 13.818 16.643 1.00 34.25 C -ATOM 2678 OD1 ASP C 64 -20.152 13.414 15.899 1.00 28.85 O -ATOM 2679 OD2 ASP C 64 -19.056 13.688 17.650 1.00 27.13 O -ATOM 2680 N ALA C 65 -15.369 13.857 13.860 1.00 16.65 N -ATOM 2681 CA ALA C 65 -14.163 14.481 13.291 1.00 16.32 C -ATOM 2682 C ALA C 65 -14.252 14.735 11.694 1.00 13.95 C -ATOM 2683 O ALA C 65 -13.994 15.689 11.048 1.00 16.33 O -ATOM 2684 CB ALA C 65 -13.017 13.593 13.359 1.00 16.15 C -ATOM 2685 N LEU C 66 -15.064 13.712 10.969 1.00 17.13 N -ATOM 2686 CA LEU C 66 -15.337 13.726 9.525 1.00 13.55 C -ATOM 2687 C LEU C 66 -16.272 14.810 9.233 1.00 14.32 C -ATOM 2688 O LEU C 66 -16.159 15.647 8.296 1.00 15.99 O -ATOM 2689 CB LEU C 66 -15.780 12.400 8.970 1.00 12.37 C -ATOM 2690 CG LEU C 66 -14.557 11.353 8.900 1.00 14.22 C -ATOM 2691 CD1 LEU C 66 -15.162 10.177 8.798 1.00 25.53 C -ATOM 2692 CD2 LEU C 66 -13.636 11.641 7.894 1.00 14.43 C -ATOM 2693 N THR C 67 -17.292 14.977 10.145 1.00 14.80 N -ATOM 2694 CA THR C 67 -18.300 16.119 9.983 1.00 15.27 C -ATOM 2695 C THR C 67 -17.479 17.374 10.100 1.00 19.15 C -ATOM 2696 O THR C 67 -17.741 18.262 9.274 1.00 21.53 O -ATOM 2697 CB THR C 67 -19.282 15.886 11.189 1.00 13.22 C -ATOM 2698 OG1 THR C 67 -20.066 14.785 10.961 1.00 17.30 O -ATOM 2699 CG2 THR C 67 -20.207 17.226 11.132 1.00 30.44 C -ATOM 2700 N ASN C 68 -16.541 17.536 11.125 1.00 19.52 N -ATOM 2701 CA ASN C 68 -15.765 18.613 11.088 1.00 21.49 C -ATOM 2702 C ASN C 68 -14.901 18.833 9.858 1.00 19.25 C -ATOM 2703 O ASN C 68 -14.653 20.197 9.353 1.00 22.73 O -ATOM 2704 CB ASN C 68 -14.964 18.621 12.362 1.00 16.47 C -ATOM 2705 CG ASN C 68 -13.974 19.880 12.584 1.00 43.34 C -ATOM 2706 OD1 ASN C 68 -14.128 20.746 12.326 1.00 49.22 O -ATOM 2707 ND2 ASN C 68 -12.524 19.654 13.058 1.00 50.67 N -ATOM 2708 N ALA C 69 -14.378 17.793 9.402 1.00 16.22 N -ATOM 2709 CA ALA C 69 -13.526 17.929 8.006 1.00 15.27 C -ATOM 2710 C ALA C 69 -14.531 18.551 6.897 1.00 20.32 C -ATOM 2711 O ALA C 69 -13.858 19.250 6.103 1.00 22.38 O -ATOM 2712 CB ALA C 69 -12.891 16.615 7.759 1.00 15.52 C -ATOM 2713 N VAL C 70 -15.649 17.853 6.837 1.00 18.62 N -ATOM 2714 CA VAL C 70 -16.708 18.432 5.673 1.00 21.72 C -ATOM 2715 C VAL C 70 -16.947 20.121 6.025 1.00 33.94 C -ATOM 2716 O VAL C 70 -16.795 20.608 4.872 1.00 26.93 O -ATOM 2717 CB VAL C 70 -17.884 17.598 5.765 1.00 16.50 C -ATOM 2718 CG1 VAL C 70 -18.759 18.120 4.709 1.00 19.06 C -ATOM 2719 CG2 VAL C 70 -17.623 16.139 5.358 1.00 16.14 C -ATOM 2720 N ALA C 71 -17.135 20.362 6.965 1.00 27.30 N -ATOM 2721 CA ALA C 71 -17.392 21.922 7.494 1.00 22.92 C -ATOM 2722 C ALA C 71 -16.435 22.534 6.896 1.00 25.79 C -ATOM 2723 O ALA C 71 -16.374 23.836 6.718 1.00 24.88 O -ATOM 2724 CB ALA C 71 -17.865 21.980 8.684 1.00 26.73 C -ATOM 2725 N HIS C 72 -15.134 22.254 6.980 1.00 25.11 N -ATOM 2726 CA HIS C 72 -13.948 22.613 6.662 1.00 31.54 C -ATOM 2727 C HIS C 72 -13.174 22.493 5.762 1.00 23.73 C -ATOM 2728 O HIS C 72 -11.739 22.306 5.638 1.00 26.60 O -ATOM 2729 CB HIS C 72 -12.834 22.798 8.133 1.00 34.18 C -ATOM 2730 CG HIS C 72 -13.458 23.235 9.080 1.00 46.84 C -ATOM 2731 ND1 HIS C 72 -13.546 24.937 9.646 1.00 41.84 N -ATOM 2732 CD2 HIS C 72 -14.636 22.949 10.155 1.00 36.64 C -ATOM 2733 CE1 HIS C 72 -14.088 24.896 10.559 1.00 46.81 C -ATOM 2734 NE2 HIS C 72 -14.920 23.926 11.193 1.00 49.65 N -ATOM 2735 N VAL C 73 -13.783 21.917 4.647 1.00 19.28 N -ATOM 2736 CA VAL C 73 -13.123 21.287 3.673 1.00 19.45 C -ATOM 2737 C VAL C 73 -11.827 22.122 2.987 1.00 29.84 C -ATOM 2738 O VAL C 73 -10.987 21.361 2.509 1.00 35.51 O -ATOM 2739 CB VAL C 73 -14.122 20.427 2.448 1.00 30.11 C -ATOM 2740 CG1 VAL C 73 -14.780 21.629 2.180 1.00 33.72 C -ATOM 2741 CG2 VAL C 73 -13.307 19.397 1.916 1.00 28.74 C -ATOM 2742 N ASP C 74 -12.046 23.454 3.145 1.00 28.51 N -ATOM 2743 CA ASP C 74 -10.850 24.295 2.500 1.00 28.33 C -ATOM 2744 C ASP C 74 -9.537 24.483 3.294 1.00 41.00 C -ATOM 2745 O ASP C 74 -8.999 25.130 2.953 1.00 39.68 O -ATOM 2746 CB ASP C 74 -11.641 25.551 2.038 1.00 34.16 C -ATOM 2747 CG ASP C 74 -12.636 25.691 1.138 1.00 52.11 C -ATOM 2748 OD1 ASP C 74 -12.809 24.845 -0.109 1.00 41.95 O -ATOM 2749 OD2 ASP C 74 -13.725 26.027 1.050 1.00 57.27 O -ATOM 2750 N ASP C 75 -9.900 24.071 4.497 1.00 29.36 N -ATOM 2751 CA ASP C 75 -8.638 24.283 5.628 1.00 35.73 C -ATOM 2752 C ASP C 75 -9.022 23.128 6.558 1.00 33.10 C -ATOM 2753 O ASP C 75 -8.649 23.257 7.697 1.00 33.04 O -ATOM 2754 CB ASP C 75 -9.160 25.604 6.376 1.00 60.97 C -ATOM 2755 CG ASP C 75 -8.310 26.492 7.214 1.00 66.84 C -ATOM 2756 OD1 ASP C 75 -7.090 26.471 6.833 1.00 48.92 O -ATOM 2757 OD2 ASP C 75 -9.269 26.482 8.164 1.00 62.98 O -ATOM 2758 N MET C 76 -8.644 21.799 5.775 1.00 27.58 N -ATOM 2759 CA MET C 76 -8.452 20.656 6.738 1.00 27.89 C -ATOM 2760 C MET C 76 -7.374 20.534 7.506 1.00 27.58 C -ATOM 2761 O MET C 76 -7.529 20.166 8.646 1.00 20.50 O -ATOM 2762 CB MET C 76 -8.792 19.438 5.724 1.00 26.12 C -ATOM 2763 CG MET C 76 -10.257 19.383 5.400 1.00 43.36 C -ATOM 2764 SD MET C 76 -10.271 17.473 4.652 1.00 37.03 S -ATOM 2765 CE MET C 76 -9.415 17.721 3.291 1.00 44.39 C -ATOM 2766 N PRO C 77 -6.212 20.856 6.950 1.00 20.45 N -ATOM 2767 CA PRO C 77 -5.120 20.876 8.013 1.00 25.45 C -ATOM 2768 C PRO C 77 -5.008 21.386 9.255 1.00 36.43 C -ATOM 2769 O PRO C 77 -4.686 20.931 10.357 1.00 30.57 O -ATOM 2770 CB PRO C 77 -3.910 21.274 7.011 1.00 26.13 C -ATOM 2771 CG PRO C 77 -4.232 21.298 5.608 1.00 24.41 C -ATOM 2772 CD PRO C 77 -5.794 21.507 5.765 1.00 18.39 C -ATOM 2773 N ASN C 78 -5.556 22.597 9.438 1.00 27.78 N -ATOM 2774 CA ASN C 78 -6.067 23.245 10.604 1.00 53.47 C -ATOM 2775 C ASN C 78 -6.714 22.831 11.450 1.00 25.06 C -ATOM 2776 O ASN C 78 -6.836 22.551 12.629 1.00 27.11 O -ATOM 2777 CB ASN C 78 -5.848 24.913 10.378 1.00 49.62 C -ATOM 2778 CG ASN C 78 -5.937 25.817 11.891 1.00 27.09 C -ATOM 2779 OD1 ASN C 78 -5.094 25.489 12.673 1.00 25.78 O -ATOM 2780 ND2 ASN C 78 -7.164 26.163 12.327 1.00 30.98 N -ATOM 2781 N ALA C 79 -8.038 22.510 10.822 1.00 21.32 N -ATOM 2782 CA ALA C 79 -9.063 21.943 11.591 1.00 21.47 C -ATOM 2783 C ALA C 79 -8.803 20.510 12.317 1.00 24.81 C -ATOM 2784 O ALA C 79 -9.440 20.242 13.323 1.00 25.13 O -ATOM 2785 CB ALA C 79 -10.333 21.459 10.764 1.00 25.42 C -ATOM 2786 N LEU C 80 -8.034 19.757 11.542 1.00 14.71 N -ATOM 2787 CA LEU C 80 -7.693 18.364 12.080 1.00 14.80 C -ATOM 2788 C LEU C 80 -6.147 18.320 12.632 1.00 13.69 C -ATOM 2789 O LEU C 80 -5.765 17.251 13.012 1.00 17.02 O -ATOM 2790 CB LEU C 80 -7.618 17.425 10.975 1.00 23.31 C -ATOM 2791 CG LEU C 80 -9.017 17.241 10.096 1.00 28.90 C -ATOM 2792 CD1 LEU C 80 -8.888 16.179 9.066 1.00 22.59 C -ATOM 2793 CD2 LEU C 80 -9.912 16.862 11.126 1.00 28.24 C -ATOM 2794 N SER C 81 -5.642 19.595 13.022 1.00 15.20 N -ATOM 2795 CA SER C 81 -4.176 19.598 13.532 1.00 16.69 C -ATOM 2796 C SER C 81 -4.082 18.751 14.821 1.00 15.66 C -ATOM 2797 O SER C 81 -3.121 18.036 14.913 1.00 18.30 O -ATOM 2798 CB SER C 81 -4.200 21.212 13.927 1.00 20.04 C -ATOM 2799 OG SER C 81 -2.662 21.194 13.956 1.00 27.86 O -ATOM 2800 N ALA C 82 -4.975 18.951 15.740 1.00 16.14 N -ATOM 2801 CA ALA C 82 -4.666 18.152 16.940 1.00 27.63 C -ATOM 2802 C ALA C 82 -4.666 16.766 16.844 1.00 26.48 C -ATOM 2803 O ALA C 82 -4.201 15.804 17.443 1.00 22.53 O -ATOM 2804 CB ALA C 82 -5.631 18.625 18.033 1.00 26.01 C -ATOM 2805 N LEU C 83 -5.794 16.171 15.738 1.00 16.69 N -ATOM 2806 CA LEU C 83 -5.833 14.767 15.713 1.00 11.24 C -ATOM 2807 C LEU C 83 -4.721 14.342 14.699 1.00 14.18 C -ATOM 2808 O LEU C 83 -4.218 13.107 15.018 1.00 18.82 O -ATOM 2809 CB LEU C 83 -7.049 14.621 14.641 1.00 19.57 C -ATOM 2810 CG LEU C 83 -8.323 14.343 15.598 1.00 31.08 C -ATOM 2811 CD1 LEU C 83 -9.453 13.945 14.510 1.00 37.56 C -ATOM 2812 CD2 LEU C 83 -8.174 13.408 16.783 1.00 31.25 C -ATOM 2813 N SER C 84 -4.154 15.133 13.918 1.00 17.80 N -ATOM 2814 CA SER C 84 -2.888 14.776 13.267 1.00 16.31 C -ATOM 2815 C SER C 84 -1.740 14.590 14.181 1.00 16.72 C -ATOM 2816 O SER C 84 -0.882 13.728 14.196 1.00 20.08 O -ATOM 2817 CB SER C 84 -1.928 15.701 12.069 1.00 25.74 C -ATOM 2818 OG SER C 84 -2.988 16.059 11.690 1.00 36.74 O -ATOM 2819 N ASP C 85 -1.671 15.596 15.245 1.00 14.56 N -ATOM 2820 CA ASP C 85 -0.682 15.299 16.354 1.00 16.51 C -ATOM 2821 C ASP C 85 -0.794 14.103 17.109 1.00 12.46 C -ATOM 2822 O ASP C 85 0.064 13.405 17.411 1.00 15.88 O -ATOM 2823 CB ASP C 85 -0.758 16.459 17.195 1.00 24.70 C -ATOM 2824 CG ASP C 85 -0.167 17.721 16.629 1.00 34.11 C -ATOM 2825 OD1 ASP C 85 0.446 17.900 15.796 1.00 25.15 O -ATOM 2826 OD2 ASP C 85 -0.625 18.754 17.406 1.00 33.76 O -ATOM 2827 N LEU C 86 -2.190 13.771 17.337 1.00 12.70 N -ATOM 2828 CA LEU C 86 -2.467 12.693 18.111 1.00 16.53 C -ATOM 2829 C LEU C 86 -2.015 11.303 17.695 1.00 14.13 C -ATOM 2830 O LEU C 86 -1.425 10.432 18.116 1.00 17.79 O -ATOM 2831 CB LEU C 86 -3.980 12.638 18.447 1.00 18.93 C -ATOM 2832 CG LEU C 86 -4.506 11.657 19.521 1.00 29.36 C -ATOM 2833 CD1 LEU C 86 -3.802 11.791 20.879 1.00 25.18 C -ATOM 2834 CD2 LEU C 86 -5.938 11.585 19.602 1.00 37.62 C -ATOM 2835 N HIS C 87 -2.350 11.290 16.308 1.00 15.64 N -ATOM 2836 CA HIS C 87 -2.196 9.988 15.684 1.00 15.27 C -ATOM 2837 C HIS C 87 -0.432 9.776 15.294 1.00 11.96 C -ATOM 2838 O HIS C 87 -0.010 8.655 15.509 1.00 15.54 O -ATOM 2839 CB HIS C 87 -2.877 9.761 14.248 1.00 15.31 C -ATOM 2840 CG HIS C 87 -4.370 9.569 14.496 1.00 12.16 C -ATOM 2841 ND1 HIS C 87 -5.204 10.514 14.931 1.00 15.96 N -ATOM 2842 CD2 HIS C 87 -5.162 8.339 14.571 1.00 14.58 C -ATOM 2843 CE1 HIS C 87 -6.508 9.921 15.132 1.00 13.46 C -ATOM 2844 NE2 HIS C 87 -6.403 8.796 14.850 1.00 17.27 N -ATOM 2845 N ALA C 88 0.106 11.030 15.024 1.00 14.25 N -ATOM 2846 CA ALA C 88 1.440 11.027 14.747 1.00 15.37 C -ATOM 2847 C ALA C 88 2.402 10.439 15.994 1.00 19.72 C -ATOM 2848 O ALA C 88 3.419 9.888 15.742 1.00 18.60 O -ATOM 2849 CB ALA C 88 2.009 12.263 14.095 1.00 17.41 C -ATOM 2850 N HIS C 89 2.139 11.270 17.065 1.00 17.52 N -ATOM 2851 CA HIS C 89 2.856 11.246 18.393 1.00 20.01 C -ATOM 2852 C HIS C 89 2.445 10.295 19.376 1.00 19.52 C -ATOM 2853 O HIS C 89 3.400 9.856 20.127 1.00 22.69 O -ATOM 2854 CB HIS C 89 3.204 12.750 18.766 1.00 26.82 C -ATOM 2855 CG HIS C 89 3.898 13.462 17.550 1.00 23.76 C -ATOM 2856 ND1 HIS C 89 5.028 13.110 16.879 1.00 28.14 N -ATOM 2857 CD2 HIS C 89 3.344 14.574 17.213 1.00 25.55 C -ATOM 2858 CE1 HIS C 89 4.845 14.030 16.064 1.00 32.36 C -ATOM 2859 NE2 HIS C 89 4.173 15.010 16.064 1.00 29.26 N -ATOM 2860 N LYS C 90 1.340 9.800 19.443 1.00 16.72 N -ATOM 2861 CA LYS C 90 0.718 9.223 20.440 1.00 20.32 C -ATOM 2862 C LYS C 90 0.299 7.707 20.002 1.00 20.91 C -ATOM 2863 O LYS C 90 0.862 6.631 20.320 1.00 23.22 O -ATOM 2864 CB LYS C 90 -0.138 9.844 21.447 1.00 20.81 C -ATOM 2865 CG LYS C 90 -0.560 8.580 22.285 1.00 29.14 C -ATOM 2866 CD LYS C 90 -1.751 9.734 23.205 1.00 67.74 C -ATOM 2867 CE LYS C 90 -1.793 8.441 24.607 1.00 66.29 C -ATOM 2868 NZ LYS C 90 -1.676 10.047 25.898 1.00 56.99 N -ATOM 2869 N LEU C 91 -0.852 7.689 19.140 1.00 13.37 N -ATOM 2870 CA LEU C 91 -1.388 6.384 18.683 1.00 10.47 C -ATOM 2871 C LEU C 91 -0.395 5.670 17.757 1.00 15.87 C -ATOM 2872 O LEU C 91 -0.337 4.504 17.810 1.00 17.45 O -ATOM 2873 CB LEU C 91 -2.734 6.916 18.060 1.00 11.80 C -ATOM 2874 CG LEU C 91 -3.503 7.677 18.936 1.00 14.59 C -ATOM 2875 CD1 LEU C 91 -4.817 8.063 18.135 1.00 18.31 C -ATOM 2876 CD2 LEU C 91 -3.927 6.656 20.006 1.00 19.42 C -ATOM 2877 N ARG C 92 0.163 6.386 16.757 1.00 17.30 N -ATOM 2878 CA ARG C 92 1.225 5.888 15.973 1.00 16.69 C -ATOM 2879 C ARG C 92 0.801 4.590 15.144 1.00 18.80 C -ATOM 2880 O ARG C 92 1.289 3.690 14.985 1.00 19.26 O -ATOM 2881 CB ARG C 92 2.462 5.556 16.835 1.00 13.64 C -ATOM 2882 CG ARG C 92 3.207 6.871 17.042 1.00 14.42 C -ATOM 2883 CD ARG C 92 4.320 6.680 18.089 1.00 27.16 C -ATOM 2884 NE ARG C 92 4.955 7.507 17.826 1.00 44.94 N -ATOM 2885 CZ ARG C 92 5.808 6.749 20.563 1.00 38.22 C -ATOM 2886 NH1 ARG C 92 4.053 6.376 21.084 1.00 33.94 N -ATOM 2887 NH2 ARG C 92 6.026 7.349 19.817 1.00 48.21 N -ATOM 2888 N VAL C 93 -0.511 4.844 14.546 1.00 13.36 N -ATOM 2889 CA VAL C 93 -1.122 3.790 13.672 1.00 14.31 C -ATOM 2890 C VAL C 93 -0.425 3.861 12.310 1.00 12.63 C -ATOM 2891 O VAL C 93 -0.266 4.875 11.618 1.00 14.78 O -ATOM 2892 CB VAL C 93 -2.622 4.322 13.422 1.00 8.72 C -ATOM 2893 CG1 VAL C 93 -3.298 3.413 12.409 1.00 14.83 C -ATOM 2894 CG2 VAL C 93 -3.256 4.402 14.761 1.00 15.34 C -ATOM 2895 N ASP C 94 -0.069 2.672 11.865 1.00 14.84 N -ATOM 2896 CA ASP C 94 0.516 2.634 10.645 1.00 17.19 C -ATOM 2897 C ASP C 94 -0.337 3.187 9.492 1.00 13.94 C -ATOM 2898 O ASP C 94 -1.496 2.844 9.436 1.00 13.55 O -ATOM 2899 CB ASP C 94 1.001 1.175 10.166 1.00 19.19 C -ATOM 2900 CG ASP C 94 2.066 1.114 9.015 1.00 25.98 C -ATOM 2901 OD1 ASP C 94 3.132 1.101 9.167 1.00 23.44 O -ATOM 2902 OD2 ASP C 94 1.457 1.246 7.818 1.00 20.10 O -ATOM 2903 N PRO C 95 0.336 3.997 8.656 1.00 13.43 N -ATOM 2904 CA PRO C 95 -0.533 4.680 7.482 1.00 16.10 C -ATOM 2905 C PRO C 95 -1.120 3.788 6.667 1.00 11.12 C -ATOM 2906 O PRO C 95 -2.331 4.229 6.243 1.00 14.55 O -ATOM 2907 CB PRO C 95 0.512 5.399 6.750 1.00 19.09 C -ATOM 2908 CG PRO C 95 1.437 5.610 7.677 1.00 18.28 C -ATOM 2909 CD PRO C 95 1.704 4.489 8.616 1.00 15.64 C -ATOM 2910 N VAL C 96 -0.975 2.426 6.418 1.00 15.60 N -ATOM 2911 CA VAL C 96 -1.688 1.553 5.597 1.00 13.24 C -ATOM 2912 C VAL C 96 -3.093 1.373 6.108 1.00 11.50 C -ATOM 2913 O VAL C 96 -4.125 1.168 5.337 1.00 13.19 O -ATOM 2914 CB VAL C 96 -0.963 0.166 5.595 1.00 20.64 C -ATOM 2915 CG1 VAL C 96 0.380 0.545 5.130 1.00 37.75 C -ATOM 2916 CG2 VAL C 96 -0.986 -0.723 6.614 1.00 28.85 C -ATOM 2917 N ASN C 97 -3.362 1.525 7.446 1.00 9.54 N -ATOM 2918 CA ASN C 97 -4.626 1.297 7.971 1.00 11.68 C -ATOM 2919 C ASN C 97 -5.641 2.261 7.562 1.00 9.63 C -ATOM 2920 O ASN C 97 -6.898 1.950 7.745 1.00 9.95 O -ATOM 2921 CB ASN C 97 -4.431 1.174 9.336 1.00 13.42 C -ATOM 2922 CG ASN C 97 -3.599 -0.084 9.836 1.00 14.06 C -ATOM 2923 OD1 ASN C 97 -3.997 -1.327 9.652 1.00 8.45 O -ATOM 2924 ND2 ASN C 97 -2.374 0.157 10.197 1.00 18.92 N -ATOM 2925 N PHE C 98 -5.236 3.438 7.306 1.00 11.20 N -ATOM 2926 CA PHE C 98 -6.082 4.528 6.931 1.00 10.00 C -ATOM 2927 C PHE C 98 -6.998 4.116 5.628 1.00 12.29 C -ATOM 2928 O PHE C 98 -8.203 4.405 5.580 1.00 11.85 O -ATOM 2929 CB PHE C 98 -5.520 5.917 6.784 1.00 11.84 C -ATOM 2930 CG PHE C 98 -4.966 6.392 8.161 1.00 10.85 C -ATOM 2931 CD1 PHE C 98 -5.796 7.234 8.908 1.00 20.50 C -ATOM 2932 CD2 PHE C 98 -3.900 5.913 8.688 1.00 15.66 C -ATOM 2933 CE1 PHE C 98 -5.555 7.714 10.141 1.00 25.62 C -ATOM 2934 CE2 PHE C 98 -3.735 6.528 10.021 1.00 23.17 C -ATOM 2935 CZ PHE C 98 -4.378 7.442 10.790 1.00 16.17 C -ATOM 2936 N LYS C 99 -6.268 3.417 4.783 1.00 12.40 N -ATOM 2937 CA LYS C 99 -6.999 2.958 3.593 1.00 16.89 C -ATOM 2938 C LYS C 99 -8.208 2.150 3.790 1.00 16.36 C -ATOM 2939 O LYS C 99 -9.081 1.954 3.131 1.00 12.00 O -ATOM 2940 CB LYS C 99 -5.965 2.519 2.404 1.00 37.75 C -ATOM 2941 CG LYS C 99 -5.634 1.867 2.299 1.00 60.42 C -ATOM 2942 CD LYS C 99 -4.523 1.328 0.960 1.00 80.12 C -ATOM 2943 CE LYS C 99 -5.145 -0.811 1.345 1.00 54.41 C -ATOM 2944 NZ LYS C 99 -4.072 -1.896 0.975 1.00 73.17 N -ATOM 2945 N LEU C 100 -7.771 1.248 4.812 1.00 11.58 N -ATOM 2946 CA LEU C 100 -8.668 0.083 5.298 1.00 10.08 C -ATOM 2947 C LEU C 100 -9.923 0.739 5.824 1.00 15.81 C -ATOM 2948 O LEU C 100 -11.033 0.328 5.495 1.00 12.64 O -ATOM 2949 CB LEU C 100 -7.919 -0.962 6.095 1.00 11.52 C -ATOM 2950 CG LEU C 100 -6.700 -1.456 5.659 1.00 12.29 C -ATOM 2951 CD1 LEU C 100 -6.140 -2.487 6.602 1.00 13.43 C -ATOM 2952 CD2 LEU C 100 -6.937 -2.037 4.366 1.00 20.82 C -ATOM 2953 N LEU C 101 -9.764 1.698 6.763 1.00 9.97 N -ATOM 2954 CA LEU C 101 -10.983 2.177 7.355 1.00 11.48 C -ATOM 2955 C LEU C 101 -11.756 3.062 6.216 1.00 15.63 C -ATOM 2956 O LEU C 101 -12.976 2.978 6.299 1.00 14.14 O -ATOM 2957 CB LEU C 101 -10.599 3.208 8.498 1.00 14.89 C -ATOM 2958 CG LEU C 101 -11.670 3.902 9.072 1.00 22.22 C -ATOM 2959 CD1 LEU C 101 -12.818 2.883 9.487 1.00 22.49 C -ATOM 2960 CD2 LEU C 101 -11.241 4.642 10.285 1.00 23.89 C -ATOM 2961 N SER C 102 -11.033 3.737 5.313 1.00 13.80 N -ATOM 2962 CA SER C 102 -11.714 4.605 4.376 1.00 7.27 C -ATOM 2963 C SER C 102 -12.532 3.565 3.508 1.00 8.13 C -ATOM 2964 O SER C 102 -13.716 4.048 3.196 1.00 14.48 O -ATOM 2965 CB SER C 102 -10.627 5.223 3.513 1.00 12.53 C -ATOM 2966 OG SER C 102 -9.908 6.246 4.205 1.00 16.99 O -ATOM 2967 N HIS C 103 -12.013 2.448 3.076 1.00 9.47 N -ATOM 2968 CA HIS C 103 -12.856 1.553 2.231 1.00 7.87 C -ATOM 2969 C HIS C 103 -13.969 1.179 3.005 1.00 9.96 C -ATOM 2970 O HIS C 103 -15.145 1.064 2.463 1.00 11.06 O -ATOM 2971 CB HIS C 103 -12.045 0.334 2.007 1.00 13.28 C -ATOM 2972 CG HIS C 103 -12.687 -0.723 1.251 1.00 12.69 C -ATOM 2973 ND1 HIS C 103 -12.940 -2.084 2.021 1.00 13.59 N -ATOM 2974 CD2 HIS C 103 -13.286 -0.768 0.111 1.00 11.80 C -ATOM 2975 CE1 HIS C 103 -13.607 -2.702 0.895 1.00 18.03 C -ATOM 2976 NE2 HIS C 103 -13.846 -2.052 -0.281 1.00 12.75 N -ATOM 2977 N CYS C 104 -13.956 0.809 4.281 1.00 11.32 N -ATOM 2978 CA CYS C 104 -15.102 0.402 5.220 1.00 10.36 C -ATOM 2979 C CYS C 104 -16.128 1.576 5.312 1.00 10.40 C -ATOM 2980 O CYS C 104 -17.326 1.230 5.408 1.00 13.45 O -ATOM 2981 CB CYS C 104 -14.679 -0.210 6.511 1.00 10.60 C -ATOM 2982 SG CYS C 104 -13.758 -1.766 6.256 1.00 14.84 S -ATOM 2983 N LEU C 105 -15.610 2.759 5.400 1.00 7.19 N -ATOM 2984 CA LEU C 105 -16.550 3.718 5.401 1.00 7.94 C -ATOM 2985 C LEU C 105 -17.308 3.811 4.064 1.00 12.20 C -ATOM 2986 O LEU C 105 -18.557 4.127 4.121 1.00 10.34 O -ATOM 2987 CB LEU C 105 -15.878 5.040 5.656 1.00 21.49 C -ATOM 2988 CG LEU C 105 -16.527 6.202 6.207 1.00 44.61 C -ATOM 2989 CD1 LEU C 105 -16.548 5.934 7.976 1.00 29.90 C -ATOM 2990 CD2 LEU C 105 -14.638 7.055 6.645 1.00 67.41 C -ATOM 2991 N LEU C 106 -16.563 3.801 3.055 1.00 12.01 N -ATOM 2992 CA LEU C 106 -17.399 3.653 1.720 1.00 11.59 C -ATOM 2993 C LEU C 106 -18.331 2.701 1.716 1.00 13.18 C -ATOM 2994 O LEU C 106 -19.445 3.007 1.174 1.00 13.67 O -ATOM 2995 CB LEU C 106 -16.393 3.784 0.463 1.00 15.01 C -ATOM 2996 CG LEU C 106 -15.665 4.920 0.043 1.00 26.98 C -ATOM 2997 CD1 LEU C 106 -14.786 4.477 -0.938 1.00 27.15 C -ATOM 2998 CD2 LEU C 106 -16.427 6.222 -0.197 1.00 28.82 C -ATOM 2999 N VAL C 107 -18.135 1.497 2.015 1.00 9.69 N -ATOM 3000 CA VAL C 107 -18.836 0.268 2.127 1.00 13.59 C -ATOM 3001 C VAL C 107 -20.197 0.605 2.883 1.00 17.84 C -ATOM 3002 O VAL C 107 -21.451 0.519 2.577 1.00 16.17 O -ATOM 3003 CB VAL C 107 -18.247 -1.024 2.534 1.00 6.66 C -ATOM 3004 CG1 VAL C 107 -19.313 -1.975 2.757 1.00 10.41 C -ATOM 3005 CG2 VAL C 107 -17.243 -1.377 1.493 1.00 9.95 C -ATOM 3006 N THR C 108 -20.022 1.317 4.069 1.00 12.50 N -ATOM 3007 CA THR C 108 -21.156 1.586 4.961 1.00 12.00 C -ATOM 3008 C THR C 108 -22.004 2.672 4.235 1.00 8.53 C -ATOM 3009 O THR C 108 -23.266 2.600 4.430 1.00 13.95 O -ATOM 3010 CB THR C 108 -20.489 2.175 6.313 1.00 10.15 C -ATOM 3011 OG1 THR C 108 -19.618 1.211 6.782 1.00 10.65 O -ATOM 3012 CG2 THR C 108 -21.574 2.581 7.303 1.00 9.30 C -ATOM 3013 N LEU C 109 -21.432 3.696 3.675 1.00 9.01 N -ATOM 3014 CA LEU C 109 -22.256 4.765 2.941 1.00 9.31 C -ATOM 3015 C LEU C 109 -23.120 4.001 2.078 1.00 15.85 C -ATOM 3016 O LEU C 109 -24.157 4.405 1.752 1.00 14.26 O -ATOM 3017 CB LEU C 109 -21.296 5.848 2.566 1.00 11.02 C -ATOM 3018 CG LEU C 109 -20.716 6.843 3.619 1.00 19.91 C -ATOM 3019 CD1 LEU C 109 -19.558 7.677 2.954 1.00 29.96 C -ATOM 3020 CD2 LEU C 109 -21.630 7.225 4.484 1.00 27.29 C -ATOM 3021 N ALA C 110 -22.355 3.185 1.097 1.00 14.51 N -ATOM 3022 CA ALA C 110 -22.975 2.438 -0.100 1.00 13.69 C -ATOM 3023 C ALA C 110 -24.179 1.916 0.467 1.00 24.66 C -ATOM 3024 O ALA C 110 -25.339 1.691 -0.205 1.00 18.31 O -ATOM 3025 CB ALA C 110 -21.958 1.541 -0.721 1.00 13.14 C -ATOM 3026 N ALA C 111 -24.108 1.069 1.636 1.00 17.30 N -ATOM 3027 CA ALA C 111 -25.131 0.205 2.227 1.00 14.98 C -ATOM 3028 C ALA C 111 -26.406 1.141 2.649 1.00 17.59 C -ATOM 3029 O ALA C 111 -27.374 0.392 2.964 1.00 18.70 O -ATOM 3030 CB ALA C 111 -24.528 -0.603 3.334 1.00 14.01 C -ATOM 3031 N HIS C 112 -26.145 2.311 3.092 1.00 17.57 N -ATOM 3032 CA HIS C 112 -27.157 3.218 3.684 1.00 17.81 C -ATOM 3033 C HIS C 112 -27.592 4.143 2.662 1.00 23.35 C -ATOM 3034 O HIS C 112 -28.643 4.846 3.027 1.00 25.70 O -ATOM 3035 CB HIS C 112 -26.632 3.907 4.985 1.00 19.09 C -ATOM 3036 CG HIS C 112 -26.731 2.953 5.878 1.00 25.33 C -ATOM 3037 ND1 HIS C 112 -25.315 2.095 6.535 1.00 35.05 N -ATOM 3038 CD2 HIS C 112 -27.507 2.446 6.914 1.00 26.57 C -ATOM 3039 CE1 HIS C 112 -25.696 1.397 7.484 1.00 18.65 C -ATOM 3040 NE2 HIS C 112 -27.041 1.550 7.786 1.00 32.92 N -ATOM 3041 N LEU C 113 -27.112 4.669 1.736 1.00 23.20 N -ATOM 3042 CA LEU C 113 -27.336 5.646 0.694 1.00 19.73 C -ATOM 3043 C LEU C 113 -27.527 4.917 -0.780 1.00 24.44 C -ATOM 3044 O LEU C 113 -26.931 5.709 -1.436 1.00 27.49 O -ATOM 3045 CB LEU C 113 -26.346 6.534 0.722 1.00 30.36 C -ATOM 3046 CG LEU C 113 -26.291 7.305 1.871 1.00 29.78 C -ATOM 3047 CD1 LEU C 113 -24.949 8.197 1.187 1.00 35.69 C -ATOM 3048 CD2 LEU C 113 -27.165 7.743 2.593 1.00 47.79 C -ATOM 3049 N PRO C 114 -28.533 4.269 -1.071 1.00 23.63 N -ATOM 3050 CA PRO C 114 -28.972 3.222 -2.364 1.00 26.62 C -ATOM 3051 C PRO C 114 -29.185 4.694 -3.555 1.00 35.32 C -ATOM 3052 O PRO C 114 -28.033 5.030 -4.238 1.00 38.93 O -ATOM 3053 CB PRO C 114 -29.692 2.344 -1.692 1.00 32.82 C -ATOM 3054 CG PRO C 114 -30.705 3.466 -1.031 1.00 48.45 C -ATOM 3055 CD PRO C 114 -29.572 3.964 0.093 1.00 44.41 C -ATOM 3056 N ALA C 115 -29.614 5.816 -3.110 1.00 34.13 N -ATOM 3057 CA ALA C 115 -29.733 6.788 -3.943 1.00 25.13 C -ATOM 3058 C ALA C 115 -28.814 7.547 -4.176 1.00 23.70 C -ATOM 3059 O ALA C 115 -28.484 8.189 -5.293 1.00 28.59 O -ATOM 3060 CB ALA C 115 -31.178 7.688 -4.040 1.00 49.66 C -ATOM 3061 N GLU C 116 -27.955 7.979 -3.256 1.00 19.87 N -ATOM 3062 CA GLU C 116 -26.996 9.192 -3.337 1.00 15.46 C -ATOM 3063 C GLU C 116 -25.546 8.615 -3.591 1.00 17.63 C -ATOM 3064 O GLU C 116 -24.903 9.456 -4.305 1.00 21.65 O -ATOM 3065 CB GLU C 116 -26.603 9.453 -1.769 1.00 24.21 C -ATOM 3066 CG GLU C 116 -28.465 8.862 -0.493 1.00 64.07 C -ATOM 3067 CD GLU C 116 -28.940 10.160 -0.964 1.00 64.09 C -ATOM 3068 OE1 GLU C 116 -28.783 10.922 -1.780 1.00 59.54 O -ATOM 3069 OE2 GLU C 116 -30.228 9.634 -0.550 1.00 58.51 O -ATOM 3070 N PHE C 117 -25.343 7.424 -3.452 1.00 18.06 N -ATOM 3071 CA PHE C 117 -24.055 6.750 -3.919 1.00 15.96 C -ATOM 3072 C PHE C 117 -23.837 6.451 -5.366 1.00 17.62 C -ATOM 3073 O PHE C 117 -23.697 5.333 -5.682 1.00 20.40 O -ATOM 3074 CB PHE C 117 -23.795 5.597 -3.019 1.00 11.69 C -ATOM 3075 CG PHE C 117 -22.482 5.073 -2.755 1.00 15.94 C -ATOM 3076 CD1 PHE C 117 -21.516 5.939 -2.024 1.00 20.23 C -ATOM 3077 CD2 PHE C 117 -21.879 3.939 -3.352 1.00 18.29 C -ATOM 3078 CE1 PHE C 117 -20.010 5.429 -1.856 1.00 21.74 C -ATOM 3079 CE2 PHE C 117 -20.499 3.543 -3.388 1.00 15.69 C -ATOM 3080 CZ PHE C 117 -19.734 4.357 -2.542 1.00 19.08 C -ATOM 3081 N THR C 118 -23.888 7.554 -6.187 1.00 16.36 N -ATOM 3082 CA THR C 118 -23.750 7.200 -7.579 1.00 24.73 C -ATOM 3083 C THR C 118 -22.162 7.085 -7.979 1.00 20.24 C -ATOM 3084 O THR C 118 -21.404 7.258 -6.938 1.00 17.57 O -ATOM 3085 CB THR C 118 -23.989 8.809 -8.229 1.00 24.50 C -ATOM 3086 OG1 THR C 118 -25.423 9.053 -8.024 1.00 43.24 O -ATOM 3087 CG2 THR C 118 -23.399 9.727 -8.021 1.00 20.86 C -ATOM 3088 N PRO C 119 -21.965 6.771 -8.980 1.00 16.01 N -ATOM 3089 CA PRO C 119 -20.523 6.700 -9.434 1.00 19.05 C -ATOM 3090 C PRO C 119 -19.780 7.932 -9.012 1.00 19.72 C -ATOM 3091 O PRO C 119 -18.600 7.893 -8.606 1.00 14.74 O -ATOM 3092 CB PRO C 119 -20.464 6.235 -10.815 1.00 21.12 C -ATOM 3093 CG PRO C 119 -21.872 5.425 -11.078 1.00 19.58 C -ATOM 3094 CD PRO C 119 -22.940 6.131 -10.122 1.00 19.86 C -ATOM 3095 N ALA C 120 -20.252 9.094 -9.502 1.00 19.86 N -ATOM 3096 CA ALA C 120 -19.548 10.276 -9.334 1.00 18.74 C -ATOM 3097 C ALA C 120 -19.388 10.637 -7.832 1.00 10.87 C -ATOM 3098 O ALA C 120 -18.248 11.251 -7.450 1.00 14.38 O -ATOM 3099 CB ALA C 120 -20.260 11.491 -9.979 1.00 23.51 C -ATOM 3100 N VAL C 121 -20.385 10.350 -7.040 1.00 15.38 N -ATOM 3101 CA VAL C 121 -20.425 10.526 -5.562 1.00 17.86 C -ATOM 3102 C VAL C 121 -19.282 9.640 -4.960 1.00 13.56 C -ATOM 3103 O VAL C 121 -18.551 10.181 -4.182 1.00 14.98 O -ATOM 3104 CB VAL C 121 -21.712 10.598 -4.961 1.00 16.82 C -ATOM 3105 CG1 VAL C 121 -21.586 10.574 -3.474 1.00 15.23 C -ATOM 3106 CG2 VAL C 121 -22.399 11.837 -5.508 1.00 18.21 C -ATOM 3107 N HIS C 122 -19.274 8.429 -5.423 1.00 13.62 N -ATOM 3108 CA HIS C 122 -18.258 7.352 -4.974 1.00 13.41 C -ATOM 3109 C HIS C 122 -16.927 7.953 -5.183 1.00 19.70 C -ATOM 3110 O HIS C 122 -16.069 7.929 -4.270 1.00 15.94 O -ATOM 3111 CB HIS C 122 -18.661 6.175 -5.608 1.00 13.44 C -ATOM 3112 CG HIS C 122 -17.896 4.996 -5.506 1.00 11.42 C -ATOM 3113 ND1 HIS C 122 -18.152 3.694 -5.975 1.00 16.43 N -ATOM 3114 CD2 HIS C 122 -16.677 4.952 -4.678 1.00 17.04 C -ATOM 3115 CE1 HIS C 122 -17.175 2.906 -5.621 1.00 20.17 C -ATOM 3116 NE2 HIS C 122 -16.333 3.490 -4.734 1.00 16.87 N -ATOM 3117 N ALA C 123 -16.663 8.527 -6.359 1.00 13.94 N -ATOM 3118 CA ALA C 123 -15.263 8.979 -6.644 1.00 17.63 C -ATOM 3119 C ALA C 123 -14.878 10.124 -5.801 1.00 15.63 C -ATOM 3120 O ALA C 123 -13.855 10.169 -5.195 1.00 16.32 O -ATOM 3121 CB ALA C 123 -15.304 9.355 -8.200 1.00 21.15 C -ATOM 3122 N SER C 124 -15.845 11.044 -5.588 1.00 11.75 N -ATOM 3123 CA SER C 124 -15.443 12.245 -4.719 1.00 15.01 C -ATOM 3124 C SER C 124 -15.332 11.744 -3.177 1.00 15.67 C -ATOM 3125 O SER C 124 -14.471 12.374 -2.655 1.00 13.45 O -ATOM 3126 CB SER C 124 -16.754 13.206 -4.754 1.00 14.78 C -ATOM 3127 OG SER C 124 -17.033 13.770 -6.107 1.00 17.64 O -ATOM 3128 N LEU C 125 -16.158 10.923 -2.823 1.00 10.43 N -ATOM 3129 CA LEU C 125 -15.983 10.431 -1.427 1.00 12.66 C -ATOM 3130 C LEU C 125 -14.705 9.708 -1.135 1.00 12.01 C -ATOM 3131 O LEU C 125 -13.873 9.973 -0.196 1.00 10.58 O -ATOM 3132 CB LEU C 125 -17.093 9.515 -1.060 1.00 10.32 C -ATOM 3133 CG LEU C 125 -18.393 10.264 -0.600 1.00 16.01 C -ATOM 3134 CD1 LEU C 125 -19.493 9.231 -0.642 1.00 21.31 C -ATOM 3135 CD2 LEU C 125 -18.244 11.194 0.645 1.00 19.17 C -ATOM 3136 N ASP C 126 -14.179 8.973 -2.132 1.00 15.23 N -ATOM 3137 CA ASP C 126 -12.896 8.220 -2.060 1.00 15.01 C -ATOM 3138 C ASP C 126 -11.877 9.262 -2.029 1.00 17.34 C -ATOM 3139 O ASP C 126 -10.873 9.161 -1.311 1.00 17.16 O -ATOM 3140 CB ASP C 126 -12.829 7.258 -3.164 1.00 14.23 C -ATOM 3141 CG ASP C 126 -11.630 6.072 -2.962 1.00 15.33 C -ATOM 3142 OD1 ASP C 126 -11.594 5.816 -1.849 1.00 21.18 O -ATOM 3143 OD2 ASP C 126 -10.723 6.195 -3.670 1.00 18.49 O -ATOM 3144 N LYS C 127 -11.889 10.369 -2.865 1.00 10.51 N -ATOM 3145 CA LYS C 127 -10.843 11.346 -2.937 1.00 9.26 C -ATOM 3146 C LYS C 127 -10.985 12.090 -1.550 1.00 10.60 C -ATOM 3147 O LYS C 127 -9.736 12.501 -1.011 1.00 13.38 O -ATOM 3148 CB LYS C 127 -11.128 12.473 -4.012 1.00 12.57 C -ATOM 3149 CG LYS C 127 -10.837 11.844 -5.259 1.00 21.03 C -ATOM 3150 CD LYS C 127 -11.084 12.905 -6.433 1.00 27.03 C -ATOM 3151 CE LYS C 127 -10.200 14.180 -6.287 1.00 36.89 C -ATOM 3152 NZ LYS C 127 -10.401 15.128 -7.495 1.00 25.75 N -ATOM 3153 N PHE C 128 -12.089 12.351 -1.096 1.00 12.44 N -ATOM 3154 CA PHE C 128 -12.150 13.112 0.060 1.00 14.73 C -ATOM 3155 C PHE C 128 -11.573 12.159 1.379 1.00 19.70 C -ATOM 3156 O PHE C 128 -10.742 12.890 2.141 1.00 15.58 O -ATOM 3157 CB PHE C 128 -13.559 13.504 0.502 1.00 11.17 C -ATOM 3158 CG PHE C 128 -13.873 13.981 2.080 1.00 11.86 C -ATOM 3159 CD1 PHE C 128 -13.416 15.303 2.300 1.00 15.77 C -ATOM 3160 CD2 PHE C 128 -14.468 13.060 2.611 1.00 23.89 C -ATOM 3161 CE1 PHE C 128 -13.803 15.496 3.630 1.00 14.00 C -ATOM 3162 CE2 PHE C 128 -14.618 13.544 4.103 1.00 26.48 C -ATOM 3163 CZ PHE C 128 -14.347 14.715 4.443 1.00 15.47 C -ATOM 3164 N LEU C 129 -11.958 10.929 1.410 1.00 14.00 N -ATOM 3165 CA LEU C 129 -11.373 10.116 2.580 1.00 13.04 C -ATOM 3166 C LEU C 129 -9.834 9.957 2.377 1.00 17.30 C -ATOM 3167 O LEU C 129 -8.955 10.001 3.360 1.00 14.75 O -ATOM 3168 CB LEU C 129 -11.850 8.796 2.608 1.00 12.12 C -ATOM 3169 CG LEU C 129 -13.240 8.898 3.000 1.00 20.92 C -ATOM 3170 CD1 LEU C 129 -14.044 7.674 2.880 1.00 26.64 C -ATOM 3171 CD2 LEU C 129 -13.522 9.300 4.355 1.00 35.02 C -ATOM 3172 N ALA C 130 -9.238 9.941 1.192 1.00 16.20 N -ATOM 3173 CA ALA C 130 -7.860 10.006 0.893 1.00 14.56 C -ATOM 3174 C ALA C 130 -7.216 11.214 1.438 1.00 19.27 C -ATOM 3175 O ALA C 130 -5.982 11.322 1.999 1.00 14.14 O -ATOM 3176 CB ALA C 130 -7.442 9.870 -0.423 1.00 17.10 C -ATOM 3177 N SER C 131 -7.839 12.284 1.109 1.00 18.74 N -ATOM 3178 CA SER C 131 -7.158 13.685 1.577 1.00 19.45 C -ATOM 3179 C SER C 131 -7.424 13.831 3.307 1.00 14.53 C -ATOM 3180 O SER C 131 -6.317 14.261 3.681 1.00 12.58 O -ATOM 3181 CB SER C 131 -8.220 14.954 1.086 1.00 22.90 C -ATOM 3182 OG SER C 131 -8.002 14.782 -0.395 1.00 37.64 O -ATOM 3183 N VAL C 132 -8.436 13.257 3.800 1.00 12.03 N -ATOM 3184 CA VAL C 132 -8.508 13.199 5.238 1.00 13.41 C -ATOM 3185 C VAL C 132 -7.272 12.425 5.809 1.00 19.42 C -ATOM 3186 O VAL C 132 -6.491 12.809 6.794 1.00 14.00 O -ATOM 3187 CB VAL C 132 -9.726 12.697 5.713 1.00 15.91 C -ATOM 3188 CG1 VAL C 132 -9.619 12.379 7.255 1.00 17.14 C -ATOM 3189 CG2 VAL C 132 -11.022 13.817 5.553 1.00 19.41 C -ATOM 3190 N SER C 133 -7.133 11.157 5.180 1.00 14.01 N -ATOM 3191 CA SER C 133 -6.066 10.266 5.421 1.00 13.12 C -ATOM 3192 C SER C 133 -4.733 10.965 5.281 1.00 21.83 C -ATOM 3193 O SER C 133 -3.772 10.686 6.325 1.00 18.12 O -ATOM 3194 CB SER C 133 -5.938 8.996 4.603 1.00 13.61 C -ATOM 3195 OG SER C 133 -7.161 8.346 5.111 1.00 18.98 O -ATOM 3196 N THR C 134 -4.427 11.617 4.350 1.00 17.53 N -ATOM 3197 CA THR C 134 -3.144 12.409 4.136 1.00 15.95 C -ATOM 3198 C THR C 134 -2.914 13.473 5.177 1.00 16.97 C -ATOM 3199 O THR C 134 -1.750 13.477 5.831 1.00 20.39 O -ATOM 3200 CB THR C 134 -3.269 13.086 2.683 1.00 18.28 C -ATOM 3201 OG1 THR C 134 -3.148 12.134 1.784 1.00 22.72 O -ATOM 3202 CG2 THR C 134 -2.059 13.978 2.401 1.00 22.70 C -ATOM 3203 N VAL C 135 -3.965 14.094 5.504 1.00 15.13 N -ATOM 3204 CA VAL C 135 -3.754 15.191 6.579 1.00 16.51 C -ATOM 3205 C VAL C 135 -3.260 14.323 7.873 1.00 16.40 C -ATOM 3206 O VAL C 135 -2.487 14.902 8.617 1.00 15.94 O -ATOM 3207 CB VAL C 135 -5.059 16.100 6.780 1.00 18.21 C -ATOM 3208 CG1 VAL C 135 -5.021 16.981 8.022 1.00 17.40 C -ATOM 3209 CG2 VAL C 135 -5.230 16.888 5.569 1.00 19.71 C -ATOM 3210 N LEU C 136 -4.222 13.312 8.307 1.00 12.10 N -ATOM 3211 CA LEU C 136 -4.023 12.675 9.630 1.00 15.98 C -ATOM 3212 C LEU C 136 -2.564 12.099 9.666 1.00 16.04 C -ATOM 3213 O LEU C 136 -2.112 11.725 10.867 1.00 16.42 O -ATOM 3214 CB LEU C 136 -5.060 11.690 9.725 1.00 16.86 C -ATOM 3215 CG LEU C 136 -6.464 12.340 9.949 1.00 24.99 C -ATOM 3216 CD1 LEU C 136 -7.273 11.133 10.442 1.00 18.69 C -ATOM 3217 CD2 LEU C 136 -6.479 13.221 11.104 1.00 43.05 C -ATOM 3218 N THR C 137 -1.948 11.875 8.493 1.00 14.30 N -ATOM 3219 CA THR C 137 -0.644 11.078 8.570 1.00 16.72 C -ATOM 3220 C THR C 137 0.600 12.250 8.229 1.00 20.27 C -ATOM 3221 O THR C 137 1.641 11.779 8.219 1.00 19.99 O -ATOM 3222 CB THR C 137 -0.616 9.898 7.452 1.00 21.82 C -ATOM 3223 OG1 THR C 137 -0.747 10.397 6.348 1.00 20.00 O -ATOM 3224 CG2 THR C 137 -1.429 8.802 8.131 1.00 20.00 C -ATOM 3225 N SER C 138 0.217 13.432 7.965 1.00 21.45 N -ATOM 3226 CA SER C 138 1.195 14.450 7.576 1.00 24.00 C -ATOM 3227 C SER C 138 2.427 14.664 8.641 1.00 26.98 C -ATOM 3228 O SER C 138 3.195 15.345 8.032 1.00 21.99 O -ATOM 3229 CB SER C 138 0.001 16.139 8.122 1.00 21.69 C -ATOM 3230 OG SER C 138 0.377 15.823 6.927 1.00 42.20 O -ATOM 3231 N LYS C 139 2.133 14.403 9.912 1.00 22.73 N -ATOM 3232 CA LYS C 139 3.191 14.934 10.883 1.00 27.59 C -ATOM 3233 C LYS C 139 3.975 13.581 11.372 1.00 19.22 C -ATOM 3234 O LYS C 139 4.646 13.643 12.389 1.00 14.35 O -ATOM 3235 CB LYS C 139 2.358 15.487 11.974 1.00 19.55 C -ATOM 3236 CG LYS C 139 2.071 17.001 11.340 1.00 22.79 C -ATOM 3237 CD LYS C 139 1.307 17.445 12.283 1.00 42.21 C -ATOM 3238 CE LYS C 139 1.086 19.324 11.798 1.00 36.26 C -ATOM 3239 NZ LYS C 139 -0.244 18.940 13.010 1.00 30.87 N -ATOM 3240 N TYR C 140 3.750 12.465 10.738 1.00 18.17 N -ATOM 3241 CA TYR C 140 4.409 11.291 11.242 1.00 17.49 C -ATOM 3242 C TYR C 140 5.879 11.300 11.241 1.00 19.10 C -ATOM 3243 O TYR C 140 6.366 10.507 12.197 1.00 22.35 O -ATOM 3244 CB TYR C 140 3.865 10.055 10.357 1.00 16.87 C -ATOM 3245 CG TYR C 140 2.674 9.300 10.891 1.00 12.61 C -ATOM 3246 CD1 TYR C 140 2.521 8.093 11.003 1.00 19.13 C -ATOM 3247 CD2 TYR C 140 1.410 10.025 11.225 1.00 16.63 C -ATOM 3248 CE1 TYR C 140 1.365 7.496 11.459 1.00 21.26 C -ATOM 3249 CE2 TYR C 140 0.269 9.420 11.748 1.00 17.45 C -ATOM 3250 CZ TYR C 140 0.153 8.203 11.775 1.00 14.84 C -ATOM 3251 OH TYR C 140 -0.838 7.429 12.277 1.00 15.53 O -ATOM 3252 N ARG C 141 6.450 11.994 10.246 1.00 20.34 N -ATOM 3253 CA ARG C 141 7.886 11.986 10.168 1.00 25.59 C -ATOM 3254 C ARG C 141 8.484 13.451 9.626 1.00 21.46 C -ATOM 3255 O ARG C 141 7.587 13.891 9.012 1.00 24.60 O -ATOM 3256 CB ARG C 141 8.511 10.698 9.627 1.00 27.67 C -ATOM 3257 CG ARG C 141 8.124 10.586 8.132 1.00 20.44 C -ATOM 3258 CD ARG C 141 8.972 9.192 7.851 1.00 27.35 C -ATOM 3259 NE ARG C 141 8.521 8.970 6.409 1.00 21.57 N -ATOM 3260 CZ ARG C 141 9.349 8.234 5.557 1.00 17.72 C -ATOM 3261 NH1 ARG C 141 10.182 7.400 5.980 1.00 16.11 N -ATOM 3262 NH2 ARG C 141 8.583 8.168 4.338 1.00 19.55 N -ATOM 3263 OXT ARG C 141 9.695 13.488 9.645 1.00 22.97 O -TER 3264 ARG C 141 -ATOM 3265 N VAL D 1 -8.916 -20.986 -1.208 1.00 44.53 N -ATOM 3266 CA VAL D 1 -8.728 -19.973 0.230 1.00 40.54 C -ATOM 3267 C VAL D 1 -9.597 -21.119 1.649 1.00 54.57 C -ATOM 3268 O VAL D 1 -10.511 -21.747 0.927 1.00 46.03 O -ATOM 3269 CB VAL D 1 -9.741 -18.620 0.365 1.00 59.62 C -ATOM 3270 CG1 VAL D 1 -8.976 -17.356 -0.533 1.00 56.25 C -ATOM 3271 CG2 VAL D 1 -10.766 -18.689 -0.199 1.00 44.49 C -ATOM 3272 N HIS D 2 -9.359 -20.204 2.359 1.00 54.55 N -ATOM 3273 CA HIS D 2 -10.028 -20.478 3.617 1.00 76.16 C -ATOM 3274 C HIS D 2 -11.503 -19.997 4.189 1.00 40.79 C -ATOM 3275 O HIS D 2 -10.949 -18.900 5.117 1.00 42.23 O -ATOM 3276 CB HIS D 2 -8.550 -21.746 4.671 1.00 61.25 C -ATOM 3277 CG HIS D 2 -9.111 -22.384 5.289 1.00 73.35 C -ATOM 3278 ND1 HIS D 2 -9.292 -20.744 7.139 1.00 63.32 N -ATOM 3279 CD2 HIS D 2 -10.298 -23.586 6.052 1.00 68.03 C -ATOM 3280 CE1 HIS D 2 -10.663 -21.227 8.362 1.00 55.48 C -ATOM 3281 NE2 HIS D 2 -10.906 -22.743 7.235 1.00 54.14 N -ATOM 3282 N LEU D 3 -12.538 -20.903 4.013 1.00 31.51 N -ATOM 3283 CA LEU D 3 -13.638 -20.047 4.223 1.00 32.74 C -ATOM 3284 C LEU D 3 -13.624 -20.741 5.723 1.00 43.55 C -ATOM 3285 O LEU D 3 -14.592 -22.168 5.344 1.00 38.09 O -ATOM 3286 CB LEU D 3 -14.958 -19.886 3.451 1.00 39.97 C -ATOM 3287 CG LEU D 3 -14.306 -18.748 2.457 1.00 33.25 C -ATOM 3288 CD1 LEU D 3 -15.545 -18.399 1.653 1.00 35.36 C -ATOM 3289 CD2 LEU D 3 -14.311 -17.477 2.906 1.00 43.98 C -ATOM 3290 N THR D 4 -14.873 -20.575 6.573 1.00 40.52 N -ATOM 3291 CA THR D 4 -15.571 -21.118 7.446 1.00 35.01 C -ATOM 3292 C THR D 4 -16.965 -21.835 7.057 1.00 36.50 C -ATOM 3293 O THR D 4 -17.217 -21.032 5.924 1.00 26.93 O -ATOM 3294 CB THR D 4 -15.866 -20.187 8.979 1.00 42.32 C -ATOM 3295 OG1 THR D 4 -16.874 -19.360 8.569 1.00 35.61 O -ATOM 3296 CG2 THR D 4 -14.805 -19.826 9.491 1.00 41.74 C -ATOM 3297 N PRO D 5 -17.421 -22.638 7.348 1.00 38.01 N -ATOM 3298 CA PRO D 5 -18.819 -22.801 6.165 1.00 45.26 C -ATOM 3299 C PRO D 5 -19.967 -21.905 6.477 1.00 40.88 C -ATOM 3300 O PRO D 5 -20.833 -21.591 5.783 1.00 35.71 O -ATOM 3301 CB PRO D 5 -19.489 -24.074 7.971 1.00 80.12 C -ATOM 3302 CG PRO D 5 -18.622 -24.429 8.450 1.00 36.53 C -ATOM 3303 CD PRO D 5 -17.099 -23.867 8.283 1.00 38.83 C -ATOM 3304 N GLU D 6 -19.807 -20.993 7.524 1.00 38.95 N -ATOM 3305 CA GLU D 6 -20.826 -20.251 7.892 1.00 54.36 C -ATOM 3306 C GLU D 6 -20.257 -18.491 6.516 1.00 29.53 C -ATOM 3307 O GLU D 6 -21.186 -18.231 6.189 1.00 34.33 O -ATOM 3308 CB GLU D 6 -20.808 -19.128 9.200 1.00 67.37 C -ATOM 3309 CG GLU D 6 -20.143 -19.295 9.841 1.00 68.32 C -ATOM 3310 CD GLU D 6 -19.833 -20.908 10.929 1.00 80.07 C -ATOM 3311 OE1 GLU D 6 -19.263 -21.552 10.554 1.00 62.33 O -ATOM 3312 OE2 GLU D 6 -17.422 -20.947 9.979 1.00 75.27 O -ATOM 3313 N GLU D 7 -19.046 -18.647 6.494 1.00 32.30 N -ATOM 3314 CA GLU D 7 -18.571 -17.615 5.450 1.00 26.92 C -ATOM 3315 C GLU D 7 -19.016 -18.399 3.955 1.00 36.61 C -ATOM 3316 O GLU D 7 -19.572 -17.530 3.297 1.00 31.61 O -ATOM 3317 CB GLU D 7 -17.035 -17.606 5.380 1.00 22.74 C -ATOM 3318 CG GLU D 7 -16.644 -16.558 6.886 1.00 25.68 C -ATOM 3319 CD GLU D 7 -15.325 -16.832 6.956 1.00 21.07 C -ATOM 3320 OE1 GLU D 7 -14.977 -15.445 7.269 1.00 41.17 O -ATOM 3321 OE2 GLU D 7 -14.302 -17.526 6.337 1.00 26.19 O -ATOM 3322 N LYS D 8 -18.754 -19.547 3.890 1.00 24.35 N -ATOM 3323 CA LYS D 8 -19.098 -20.158 2.364 1.00 27.18 C -ATOM 3324 C LYS D 8 -20.384 -20.203 2.052 1.00 23.43 C -ATOM 3325 O LYS D 8 -21.074 -19.662 1.178 1.00 23.08 O -ATOM 3326 CB LYS D 8 -18.527 -21.857 2.829 1.00 28.41 C -ATOM 3327 CG LYS D 8 -18.698 -21.991 1.053 1.00 48.31 C -ATOM 3328 CD LYS D 8 -18.147 -23.072 0.880 1.00 69.34 C -ATOM 3329 CE LYS D 8 -18.957 -23.705 -0.872 1.00 38.29 C -ATOM 3330 NZ LYS D 8 -17.931 -25.269 -1.374 1.00 72.55 N -ATOM 3331 N SER D 9 -21.307 -20.301 3.110 1.00 21.45 N -ATOM 3332 CA SER D 9 -22.632 -20.010 2.800 1.00 23.49 C -ATOM 3333 C SER D 9 -23.050 -18.608 2.651 1.00 32.73 C -ATOM 3334 O SER D 9 -24.111 -18.558 1.973 1.00 27.24 O -ATOM 3335 CB SER D 9 -23.425 -20.879 3.815 1.00 48.80 C -ATOM 3336 OG SER D 9 -24.248 -20.636 4.597 1.00 54.12 O -ATOM 3337 N ALA D 10 -22.340 -17.847 3.521 1.00 26.97 N -ATOM 3338 CA ALA D 10 -23.067 -16.421 3.397 1.00 27.01 C -ATOM 3339 C ALA D 10 -22.551 -15.974 1.781 1.00 23.29 C -ATOM 3340 O ALA D 10 -23.475 -15.280 1.185 1.00 20.87 O -ATOM 3341 CB ALA D 10 -22.056 -15.660 3.934 1.00 28.42 C -ATOM 3342 N VAL D 11 -21.472 -16.449 1.276 1.00 31.33 N -ATOM 3343 CA VAL D 11 -21.016 -15.993 -0.163 1.00 25.10 C -ATOM 3344 C VAL D 11 -21.923 -16.557 -1.184 1.00 18.64 C -ATOM 3345 O VAL D 11 -22.347 -15.774 -1.949 1.00 19.73 O -ATOM 3346 CB VAL D 11 -19.580 -16.599 -0.312 1.00 18.52 C -ATOM 3347 CG1 VAL D 11 -19.332 -16.430 -1.555 1.00 28.45 C -ATOM 3348 CG2 VAL D 11 -18.563 -15.544 0.540 1.00 21.05 C -ATOM 3349 N THR D 12 -22.095 -17.881 -0.865 1.00 19.99 N -ATOM 3350 CA THR D 12 -23.012 -18.659 -2.043 1.00 26.25 C -ATOM 3351 C THR D 12 -24.298 -18.196 -1.973 1.00 24.29 C -ATOM 3352 O THR D 12 -25.087 -17.804 -3.054 1.00 26.52 O -ATOM 3353 CB THR D 12 -23.024 -20.432 -1.285 1.00 24.72 C -ATOM 3354 OG1 THR D 12 -21.642 -20.629 -1.920 1.00 32.38 O -ATOM 3355 CG2 THR D 12 -24.127 -20.769 -2.067 1.00 56.05 C -ATOM 3356 N ALA D 13 -24.939 -17.863 -0.966 1.00 25.46 N -ATOM 3357 CA ALA D 13 -26.249 -17.368 -0.697 1.00 25.21 C -ATOM 3358 C ALA D 13 -26.716 -16.016 -1.505 1.00 24.39 C -ATOM 3359 O ALA D 13 -27.502 -15.783 -2.239 1.00 27.12 O -ATOM 3360 CB ALA D 13 -26.840 -17.284 0.237 1.00 40.91 C -ATOM 3361 N LEU D 14 -25.588 -15.038 -1.202 1.00 21.51 N -ATOM 3362 CA LEU D 14 -25.805 -13.895 -1.844 1.00 19.28 C -ATOM 3363 C LEU D 14 -25.557 -13.900 -3.355 1.00 20.58 C -ATOM 3364 O LEU D 14 -26.325 -13.141 -4.012 1.00 19.87 O -ATOM 3365 CB LEU D 14 -24.748 -12.802 -1.037 1.00 18.39 C -ATOM 3366 CG LEU D 14 -24.944 -11.344 -1.539 1.00 32.12 C -ATOM 3367 CD1 LEU D 14 -25.966 -10.962 -0.374 1.00 41.26 C -ATOM 3368 CD2 LEU D 14 -23.927 -10.587 -1.223 1.00 34.27 C -ATOM 3369 N TRP D 15 -24.663 -14.787 -3.692 1.00 16.79 N -ATOM 3370 CA TRP D 15 -24.253 -14.609 -5.178 1.00 13.47 C -ATOM 3371 C TRP D 15 -25.414 -15.354 -5.958 1.00 22.23 C -ATOM 3372 O TRP D 15 -25.691 -14.922 -7.051 1.00 22.75 O -ATOM 3373 CB TRP D 15 -23.003 -15.504 -5.278 1.00 17.27 C -ATOM 3374 CG TRP D 15 -22.390 -15.264 -6.607 1.00 18.39 C -ATOM 3375 CD1 TRP D 15 -22.417 -16.024 -7.714 1.00 29.85 C -ATOM 3376 CD2 TRP D 15 -21.683 -13.937 -6.966 1.00 19.14 C -ATOM 3377 NE1 TRP D 15 -21.775 -15.472 -8.770 1.00 25.67 N -ATOM 3378 CE2 TRP D 15 -21.205 -14.132 -8.458 1.00 18.90 C -ATOM 3379 CE3 TRP D 15 -21.251 -12.883 -6.227 1.00 24.35 C -ATOM 3380 CZ2 TRP D 15 -20.568 -13.098 -9.104 1.00 22.83 C -ATOM 3381 CZ3 TRP D 15 -20.364 -11.928 -6.894 1.00 24.62 C -ATOM 3382 CH2 TRP D 15 -20.127 -12.198 -8.397 1.00 30.44 C -ATOM 3383 N GLY D 16 -26.279 -16.244 -5.358 1.00 23.06 N -ATOM 3384 CA GLY D 16 -27.474 -16.657 -6.225 1.00 23.16 C -ATOM 3385 C GLY D 16 -28.300 -15.570 -6.485 1.00 26.54 C -ATOM 3386 O GLY D 16 -29.203 -15.791 -7.472 1.00 26.11 O -ATOM 3387 N LYS D 17 -28.475 -14.360 -5.980 1.00 18.84 N -ATOM 3388 CA LYS D 17 -29.272 -13.270 -5.974 1.00 24.96 C -ATOM 3389 C LYS D 17 -29.000 -12.271 -6.961 1.00 22.00 C -ATOM 3390 O LYS D 17 -29.037 -11.079 -7.508 1.00 24.63 O -ATOM 3391 CB LYS D 17 -29.587 -12.449 -4.588 1.00 28.33 C -ATOM 3392 CG LYS D 17 -30.108 -13.362 -3.795 1.00 27.71 C -ATOM 3393 CD LYS D 17 -30.415 -12.422 -2.822 1.00 33.37 C -ATOM 3394 CE LYS D 17 -30.390 -12.386 -1.399 1.00 43.68 C -ATOM 3395 NZ LYS D 17 -31.873 -11.072 -1.369 1.00 36.22 N -ATOM 3396 N VAL D 18 -27.474 -12.385 -7.448 1.00 33.39 N -ATOM 3397 CA VAL D 18 -26.489 -11.309 -8.320 1.00 24.51 C -ATOM 3398 C VAL D 18 -27.096 -11.570 -9.917 1.00 27.24 C -ATOM 3399 O VAL D 18 -26.940 -12.785 -10.011 1.00 26.54 O -ATOM 3400 CB VAL D 18 -25.245 -11.428 -8.185 1.00 31.98 C -ATOM 3401 CG1 VAL D 18 -24.320 -10.896 -8.917 1.00 31.25 C -ATOM 3402 CG2 VAL D 18 -24.647 -11.020 -6.542 1.00 22.12 C -ATOM 3403 N ASN D 19 -27.428 -10.545 -10.401 1.00 25.81 N -ATOM 3404 CA ASN D 19 -27.299 -10.403 -11.802 1.00 27.55 C -ATOM 3405 C ASN D 19 -26.159 -10.452 -12.333 1.00 24.31 C -ATOM 3406 O ASN D 19 -25.632 -9.111 -12.336 1.00 20.67 O -ATOM 3407 CB ASN D 19 -28.399 -9.524 -12.285 1.00 40.49 C -ATOM 3408 CG ASN D 19 -28.856 -10.175 -13.808 1.00 44.62 C -ATOM 3409 OD1 ASN D 19 -27.731 -9.601 -14.786 1.00 45.68 O -ATOM 3410 ND2 ASN D 19 -29.658 -8.823 -14.484 1.00 50.78 N -ATOM 3411 N VAL D 20 -25.460 -11.215 -12.835 1.00 22.82 N -ATOM 3412 CA VAL D 20 -23.926 -10.940 -13.321 1.00 40.38 C -ATOM 3413 C VAL D 20 -23.628 -9.968 -13.933 1.00 37.93 C -ATOM 3414 O VAL D 20 -22.741 -9.105 -14.256 1.00 32.18 O -ATOM 3415 CB VAL D 20 -22.926 -12.781 -13.318 1.00 54.80 C -ATOM 3416 CG1 VAL D 20 -22.524 -12.140 -14.217 1.00 63.33 C -ATOM 3417 CG2 VAL D 20 -23.373 -13.095 -12.306 1.00 34.72 C -ATOM 3418 N ASP D 21 -24.469 -9.996 -15.091 1.00 36.66 N -ATOM 3419 CA ASP D 21 -24.588 -8.635 -15.872 1.00 54.12 C -ATOM 3420 C ASP D 21 -24.717 -7.685 -15.749 1.00 46.84 C -ATOM 3421 O ASP D 21 -23.610 -6.686 -15.937 1.00 32.53 O -ATOM 3422 CB ASP D 21 -25.603 -8.934 -17.011 1.00 60.03 C -ATOM 3423 CG ASP D 21 -25.523 -10.565 -17.717 1.00 75.30 C -ATOM 3424 OD1 ASP D 21 -24.242 -11.481 -17.893 1.00 51.52 O -ATOM 3425 OD2 ASP D 21 -25.948 -10.502 -18.826 1.00 64.70 O -ATOM 3426 N GLU D 22 -25.623 -7.162 -14.906 1.00 27.09 N -ATOM 3427 CA GLU D 22 -25.919 -5.886 -14.386 1.00 23.15 C -ATOM 3428 C GLU D 22 -24.427 -5.530 -13.395 1.00 19.08 C -ATOM 3429 O GLU D 22 -24.197 -4.407 -13.172 1.00 21.80 O -ATOM 3430 CB GLU D 22 -27.280 -5.934 -13.774 1.00 35.52 C -ATOM 3431 CG GLU D 22 -27.211 -5.635 -13.083 1.00 68.74 C -ATOM 3432 CD GLU D 22 -28.960 -4.398 -12.033 1.00 80.12 C -ATOM 3433 OE1 GLU D 22 -29.624 -5.184 -11.024 1.00 61.13 O -ATOM 3434 OE2 GLU D 22 -29.463 -4.100 -13.136 1.00 73.88 O -ATOM 3435 N VAL D 23 -24.426 -6.315 -12.392 1.00 20.94 N -ATOM 3436 CA VAL D 23 -23.348 -6.099 -11.326 1.00 17.82 C -ATOM 3437 C VAL D 23 -21.966 -6.004 -12.061 1.00 15.07 C -ATOM 3438 O VAL D 23 -21.155 -5.154 -11.664 1.00 21.11 O -ATOM 3439 CB VAL D 23 -23.341 -7.268 -10.216 1.00 18.64 C -ATOM 3440 CG1 VAL D 23 -22.169 -7.160 -9.566 1.00 21.45 C -ATOM 3441 CG2 VAL D 23 -24.676 -6.892 -9.537 1.00 21.02 C -ATOM 3442 N GLY D 24 -21.629 -6.780 -12.936 1.00 12.96 N -ATOM 3443 CA GLY D 24 -20.442 -6.846 -13.669 1.00 18.39 C -ATOM 3444 C GLY D 24 -20.261 -5.559 -14.312 1.00 16.60 C -ATOM 3445 O GLY D 24 -19.233 -4.768 -14.272 1.00 15.31 O -ATOM 3446 N GLY D 25 -21.132 -4.866 -15.117 1.00 17.32 N -ATOM 3447 CA GLY D 25 -21.127 -3.499 -15.792 1.00 16.45 C -ATOM 3448 C GLY D 25 -21.008 -2.525 -14.804 1.00 12.17 C -ATOM 3449 O GLY D 25 -20.114 -1.633 -15.055 1.00 21.20 O -ATOM 3450 N GLU D 26 -21.690 -2.622 -13.683 1.00 15.97 N -ATOM 3451 CA GLU D 26 -21.600 -1.628 -12.730 1.00 13.66 C -ATOM 3452 C GLU D 26 -20.044 -1.546 -12.031 1.00 11.75 C -ATOM 3453 O GLU D 26 -19.572 -0.450 -11.864 1.00 13.88 O -ATOM 3454 CB GLU D 26 -22.662 -1.686 -11.514 1.00 18.62 C -ATOM 3455 CG GLU D 26 -23.979 0.008 -11.890 1.00 39.81 C -ATOM 3456 CD GLU D 26 -22.700 -0.395 -10.542 1.00 31.77 C -ATOM 3457 OE1 GLU D 26 -23.368 1.259 -10.392 1.00 34.99 O -ATOM 3458 OE2 GLU D 26 -24.210 -0.810 -9.865 1.00 54.79 O -ATOM 3459 N ALA D 27 -19.673 -2.710 -11.707 1.00 12.60 N -ATOM 3460 CA ALA D 27 -18.269 -2.901 -11.078 1.00 17.85 C -ATOM 3461 C ALA D 27 -17.180 -2.341 -11.937 1.00 15.51 C -ATOM 3462 O ALA D 27 -16.331 -1.489 -11.550 1.00 14.90 O -ATOM 3463 CB ALA D 27 -18.048 -4.225 -10.534 1.00 15.58 C -ATOM 3464 N LEU D 28 -17.183 -2.729 -13.203 1.00 16.04 N -ATOM 3465 CA LEU D 28 -16.186 -2.309 -14.163 1.00 11.08 C -ATOM 3466 C LEU D 28 -16.248 -0.897 -14.292 1.00 13.51 C -ATOM 3467 O LEU D 28 -15.238 -0.124 -14.487 1.00 14.05 O -ATOM 3468 CB LEU D 28 -16.275 -3.066 -15.497 1.00 12.20 C -ATOM 3469 CG LEU D 28 -14.973 -2.764 -16.433 1.00 28.52 C -ATOM 3470 CD1 LEU D 28 -13.779 -3.087 -15.679 1.00 36.95 C -ATOM 3471 CD2 LEU D 28 -15.242 -3.401 -17.606 1.00 34.25 C -ATOM 3472 N GLY D 29 -17.518 -0.283 -14.622 1.00 12.33 N -ATOM 3473 CA GLY D 29 -17.751 1.088 -14.735 1.00 13.25 C -ATOM 3474 C GLY D 29 -17.136 1.954 -13.603 1.00 12.50 C -ATOM 3475 O GLY D 29 -16.531 3.012 -13.890 1.00 16.69 O -ATOM 3476 N ARG D 30 -17.539 1.491 -12.441 1.00 15.15 N -ATOM 3477 CA ARG D 30 -17.026 2.243 -11.337 1.00 17.77 C -ATOM 3478 C ARG D 30 -15.527 2.171 -11.160 1.00 14.35 C -ATOM 3479 O ARG D 30 -14.968 3.218 -10.798 1.00 14.59 O -ATOM 3480 CB ARG D 30 -17.892 1.792 -10.040 1.00 15.53 C -ATOM 3481 CG ARG D 30 -19.275 2.313 -9.820 1.00 16.65 C -ATOM 3482 CD ARG D 30 -19.931 1.839 -8.709 1.00 28.01 C -ATOM 3483 NE ARG D 30 -21.099 2.164 -8.522 1.00 23.10 N -ATOM 3484 CZ ARG D 30 -21.731 3.109 -7.922 1.00 16.06 C -ATOM 3485 NH1 ARG D 30 -22.965 3.397 -7.723 1.00 17.46 N -ATOM 3486 NH2 ARG D 30 -21.050 3.807 -6.871 1.00 10.32 N -ATOM 3487 N LEU D 31 -14.961 1.160 -11.442 1.00 15.53 N -ATOM 3488 CA LEU D 31 -13.554 1.103 -11.546 1.00 14.63 C -ATOM 3489 C LEU D 31 -12.894 2.305 -12.254 1.00 16.67 C -ATOM 3490 O LEU D 31 -11.964 2.890 -11.986 1.00 15.33 O -ATOM 3491 CB LEU D 31 -12.961 -0.342 -11.951 1.00 12.02 C -ATOM 3492 CG LEU D 31 -11.524 -0.502 -11.963 1.00 17.81 C -ATOM 3493 CD1 LEU D 31 -10.867 -0.718 -10.607 1.00 18.94 C -ATOM 3494 CD2 LEU D 31 -11.112 -1.549 -12.889 1.00 18.38 C -ATOM 3495 N LEU D 32 -13.461 2.265 -13.601 1.00 8.95 N -ATOM 3496 CA LEU D 32 -13.016 3.232 -14.475 1.00 13.61 C -ATOM 3497 C LEU D 32 -13.249 4.589 -14.109 1.00 13.07 C -ATOM 3498 O LEU D 32 -12.457 5.593 -14.562 1.00 15.98 O -ATOM 3499 CB LEU D 32 -13.512 2.944 -15.805 1.00 14.00 C -ATOM 3500 CG LEU D 32 -12.943 1.707 -16.403 1.00 23.55 C -ATOM 3501 CD1 LEU D 32 -13.857 1.407 -17.761 1.00 25.80 C -ATOM 3502 CD2 LEU D 32 -11.759 1.263 -16.551 1.00 26.67 C -ATOM 3503 N VAL D 33 -14.340 4.892 -13.280 1.00 13.83 N -ATOM 3504 CA VAL D 33 -14.717 6.296 -12.776 1.00 13.13 C -ATOM 3505 C VAL D 33 -13.702 6.655 -11.697 1.00 16.82 C -ATOM 3506 O VAL D 33 -13.288 7.735 -11.589 1.00 15.10 O -ATOM 3507 CB VAL D 33 -16.181 6.271 -12.468 1.00 11.59 C -ATOM 3508 CG1 VAL D 33 -16.396 7.592 -11.833 1.00 21.42 C -ATOM 3509 CG2 VAL D 33 -16.955 6.215 -13.830 1.00 18.60 C -ATOM 3510 N VAL D 34 -13.788 5.741 -10.696 1.00 12.61 N -ATOM 3511 CA VAL D 34 -13.205 6.102 -9.422 1.00 13.03 C -ATOM 3512 C VAL D 34 -11.709 6.268 -9.501 1.00 15.88 C -ATOM 3513 O VAL D 34 -11.074 6.862 -8.702 1.00 16.40 O -ATOM 3514 CB VAL D 34 -13.754 5.224 -8.226 1.00 15.07 C -ATOM 3515 CG1 VAL D 34 -13.038 5.375 -6.973 1.00 13.90 C -ATOM 3516 CG2 VAL D 34 -15.220 5.422 -8.063 1.00 18.23 C -ATOM 3517 N TYR D 35 -11.136 5.248 -10.266 1.00 11.62 N -ATOM 3518 CA TYR D 35 -9.629 5.095 -10.409 1.00 14.47 C -ATOM 3519 C TYR D 35 -9.420 5.204 -11.973 1.00 16.31 C -ATOM 3520 O TYR D 35 -9.060 4.177 -12.606 1.00 17.14 O -ATOM 3521 CB TYR D 35 -9.241 3.705 -9.961 1.00 14.04 C -ATOM 3522 CG TYR D 35 -9.664 3.371 -8.620 1.00 16.50 C -ATOM 3523 CD1 TYR D 35 -9.076 4.102 -7.605 1.00 16.28 C -ATOM 3524 CD2 TYR D 35 -10.520 2.540 -8.304 1.00 21.92 C -ATOM 3525 CE1 TYR D 35 -9.315 3.966 -6.162 1.00 18.51 C -ATOM 3526 CE2 TYR D 35 -10.873 2.362 -6.966 1.00 25.13 C -ATOM 3527 CZ TYR D 35 -10.254 3.015 -5.920 1.00 19.91 C -ATOM 3528 OH TYR D 35 -10.861 2.820 -4.629 1.00 21.91 O -ATOM 3529 N PRO D 36 -9.392 6.463 -12.417 1.00 14.59 N -ATOM 3530 CA PRO D 36 -9.346 6.600 -14.037 1.00 16.73 C -ATOM 3531 C PRO D 36 -8.099 6.185 -14.723 1.00 13.23 C -ATOM 3532 O PRO D 36 -8.183 5.907 -15.944 1.00 15.17 O -ATOM 3533 CB PRO D 36 -9.750 8.096 -14.119 1.00 24.30 C -ATOM 3534 CG PRO D 36 -9.458 8.680 -12.746 1.00 25.67 C -ATOM 3535 CD PRO D 36 -9.575 7.632 -11.872 1.00 17.58 C -ATOM 3536 N TRP D 37 -6.974 5.929 -13.940 1.00 13.75 N -ATOM 3537 CA TRP D 37 -5.897 5.496 -14.615 1.00 15.13 C -ATOM 3538 C TRP D 37 -5.961 4.094 -15.089 1.00 14.32 C -ATOM 3539 O TRP D 37 -5.292 3.617 -16.098 1.00 19.70 O -ATOM 3540 CB TRP D 37 -4.642 5.522 -13.687 1.00 13.13 C -ATOM 3541 CG TRP D 37 -4.793 4.873 -12.298 1.00 8.65 C -ATOM 3542 CD1 TRP D 37 -4.494 3.633 -11.929 1.00 13.10 C -ATOM 3543 CD2 TRP D 37 -5.201 5.532 -10.999 1.00 14.59 C -ATOM 3544 NE1 TRP D 37 -4.604 3.407 -10.644 1.00 17.65 N -ATOM 3545 CE2 TRP D 37 -5.232 4.530 -10.117 1.00 16.05 C -ATOM 3546 CE3 TRP D 37 -5.786 6.762 -10.728 1.00 11.20 C -ATOM 3547 CZ2 TRP D 37 -5.541 4.775 -8.606 1.00 26.88 C -ATOM 3548 CZ3 TRP D 37 -6.287 7.021 -9.443 1.00 11.28 C -ATOM 3549 CH2 TRP D 37 -5.996 6.001 -8.551 1.00 16.90 C -ATOM 3550 N THR D 38 -6.984 3.333 -14.581 1.00 16.64 N -ATOM 3551 CA THR D 38 -7.362 1.995 -14.995 1.00 14.14 C -ATOM 3552 C THR D 38 -7.792 2.033 -16.539 1.00 18.16 C -ATOM 3553 O THR D 38 -7.920 0.930 -17.161 1.00 16.15 O -ATOM 3554 CB THR D 38 -8.440 1.318 -14.155 1.00 11.09 C -ATOM 3555 OG1 THR D 38 -9.618 2.008 -14.130 1.00 14.48 O -ATOM 3556 CG2 THR D 38 -7.730 1.043 -12.892 1.00 16.14 C -ATOM 3557 N GLN D 39 -8.345 3.275 -16.962 1.00 12.07 N -ATOM 3558 CA GLN D 39 -8.833 3.256 -18.352 1.00 10.72 C -ATOM 3559 C GLN D 39 -7.732 3.116 -19.349 1.00 16.84 C -ATOM 3560 O GLN D 39 -7.933 2.801 -20.471 1.00 21.52 O -ATOM 3561 CB GLN D 39 -9.205 4.786 -18.517 1.00 13.63 C -ATOM 3562 CG GLN D 39 -10.419 4.929 -17.639 1.00 17.04 C -ATOM 3563 CD GLN D 39 -10.861 6.282 -17.855 1.00 23.47 C -ATOM 3564 OE1 GLN D 39 -10.432 7.200 -18.833 1.00 25.04 O -ATOM 3565 NE2 GLN D 39 -11.740 6.840 -16.888 1.00 28.38 N -ATOM 3566 N ARG D 40 -6.331 2.999 -19.002 1.00 12.32 N -ATOM 3567 CA ARG D 40 -5.095 2.844 -19.730 1.00 16.79 C -ATOM 3568 C ARG D 40 -5.433 1.605 -20.411 1.00 17.58 C -ATOM 3569 O ARG D 40 -4.682 1.315 -21.633 1.00 20.86 O -ATOM 3570 CB ARG D 40 -3.966 2.461 -18.813 1.00 22.83 C -ATOM 3571 CG ARG D 40 -3.694 1.460 -18.189 1.00 37.26 C -ATOM 3572 CD ARG D 40 -2.418 1.834 -17.304 1.00 23.75 C -ATOM 3573 NE ARG D 40 -1.279 2.091 -17.831 1.00 28.71 N -ATOM 3574 CZ ARG D 40 -0.609 1.176 -18.760 1.00 41.77 C -ATOM 3575 NH1 ARG D 40 -0.700 0.067 -18.486 1.00 31.05 N -ATOM 3576 NH2 ARG D 40 0.625 1.911 -19.038 1.00 37.79 N -ATOM 3577 N PHE D 41 -6.207 0.540 -20.107 1.00 15.17 N -ATOM 3578 CA PHE D 41 -6.336 -0.770 -20.711 1.00 16.55 C -ATOM 3579 C PHE D 41 -7.612 -0.691 -21.880 1.00 20.00 C -ATOM 3580 O PHE D 41 -7.651 -1.868 -22.265 1.00 23.52 O -ATOM 3581 CB PHE D 41 -6.568 -1.995 -19.811 1.00 13.75 C -ATOM 3582 CG PHE D 41 -5.344 -2.033 -18.714 1.00 12.41 C -ATOM 3583 CD1 PHE D 41 -5.592 -1.379 -17.449 1.00 16.97 C -ATOM 3584 CD2 PHE D 41 -4.233 -2.496 -19.084 1.00 18.05 C -ATOM 3585 CE1 PHE D 41 -4.371 -1.693 -16.818 1.00 23.07 C -ATOM 3586 CE2 PHE D 41 -3.008 -2.505 -18.298 1.00 24.82 C -ATOM 3587 CZ PHE D 41 -3.359 -2.006 -17.025 1.00 25.09 C -ATOM 3588 N PHE D 42 -8.192 0.386 -21.832 1.00 15.21 N -ATOM 3589 CA PHE D 42 -9.461 0.148 -22.436 1.00 14.18 C -ATOM 3590 C PHE D 42 -9.645 1.104 -23.586 1.00 19.41 C -ATOM 3591 O PHE D 42 -10.690 1.871 -23.828 1.00 18.71 O -ATOM 3592 CB PHE D 42 -10.613 0.298 -21.592 1.00 21.58 C -ATOM 3593 CG PHE D 42 -10.602 -1.034 -20.710 1.00 17.63 C -ATOM 3594 CD1 PHE D 42 -10.145 -0.545 -19.164 1.00 20.37 C -ATOM 3595 CD2 PHE D 42 -11.012 -2.318 -21.048 1.00 20.14 C -ATOM 3596 CE1 PHE D 42 -10.225 -1.848 -18.434 1.00 27.02 C -ATOM 3597 CE2 PHE D 42 -10.887 -3.301 -20.223 1.00 27.08 C -ATOM 3598 CZ PHE D 42 -10.474 -2.972 -18.757 1.00 18.28 C -ATOM 3599 N GLU D 43 -8.375 1.400 -24.058 1.00 32.32 N -ATOM 3600 CA GLU D 43 -8.561 2.747 -24.914 1.00 33.61 C -ATOM 3601 C GLU D 43 -9.574 2.656 -26.563 1.00 12.75 C -ATOM 3602 O GLU D 43 -9.904 3.604 -26.926 1.00 26.94 O -ATOM 3603 CB GLU D 43 -7.590 2.897 -25.572 1.00 65.31 C -ATOM 3604 CG GLU D 43 -6.882 2.859 -25.890 1.00 43.00 C -ATOM 3605 CD GLU D 43 -6.060 4.011 -24.596 1.00 32.00 C -ATOM 3606 OE1 GLU D 43 -6.764 5.450 -24.611 1.00 29.89 O -ATOM 3607 OE2 GLU D 43 -4.721 4.728 -24.142 1.00 58.55 O -ATOM 3608 N SER D 44 -9.605 1.289 -26.702 1.00 19.02 N -ATOM 3609 CA SER D 44 -10.333 0.707 -27.924 1.00 25.67 C -ATOM 3610 C SER D 44 -11.604 0.898 -27.554 1.00 26.66 C -ATOM 3611 O SER D 44 -12.646 0.619 -28.203 1.00 32.13 O -ATOM 3612 CB SER D 44 -10.139 -0.585 -28.237 1.00 42.87 C -ATOM 3613 OG SER D 44 -10.504 -1.572 -27.556 1.00 44.29 O -ATOM 3614 N PHE D 45 -12.328 1.230 -26.297 1.00 27.34 N -ATOM 3615 CA PHE D 45 -13.753 1.140 -25.852 1.00 24.93 C -ATOM 3616 C PHE D 45 -14.575 2.593 -26.282 1.00 23.30 C -ATOM 3617 O PHE D 45 -15.815 2.187 -25.861 1.00 31.71 O -ATOM 3618 CB PHE D 45 -13.703 0.919 -24.328 1.00 26.07 C -ATOM 3619 CG PHE D 45 -13.645 -0.527 -24.075 1.00 19.10 C -ATOM 3620 CD1 PHE D 45 -14.209 -0.901 -22.815 1.00 43.96 C -ATOM 3621 CD2 PHE D 45 -13.155 -1.495 -24.645 1.00 26.17 C -ATOM 3622 CE1 PHE D 45 -14.066 -2.469 -22.506 1.00 29.49 C -ATOM 3623 CE2 PHE D 45 -12.912 -2.782 -24.307 1.00 32.75 C -ATOM 3624 CZ PHE D 45 -13.459 -3.397 -23.316 1.00 28.04 C -ATOM 3625 N GLY D 46 -14.104 3.279 -26.525 1.00 35.08 N -ATOM 3626 CA GLY D 46 -14.935 4.262 -26.788 1.00 34.51 C -ATOM 3627 C GLY D 46 -15.024 5.841 -25.884 1.00 32.00 C -ATOM 3628 O GLY D 46 -13.703 5.710 -25.436 1.00 42.65 O -ATOM 3629 N ASP D 47 -16.270 6.088 -25.501 1.00 33.75 N -ATOM 3630 CA ASP D 47 -15.315 7.928 -25.257 1.00 43.29 C -ATOM 3631 C ASP D 47 -15.918 7.002 -23.097 1.00 24.69 C -ATOM 3632 O ASP D 47 -17.090 6.340 -23.091 1.00 33.08 O -ATOM 3633 CB ASP D 47 -17.246 8.111 -25.348 1.00 48.49 C -ATOM 3634 CG ASP D 47 -17.316 9.636 -24.481 1.00 50.77 C -ATOM 3635 OD1 ASP D 47 -18.624 9.821 -24.553 1.00 57.75 O -ATOM 3636 OD2 ASP D 47 -16.233 10.163 -24.247 1.00 45.03 O -ATOM 3637 N LEU D 48 -14.887 7.498 -22.782 1.00 25.73 N -ATOM 3638 CA LEU D 48 -14.700 7.013 -21.145 1.00 29.97 C -ATOM 3639 C LEU D 48 -14.723 8.417 -20.213 1.00 32.06 C -ATOM 3640 O LEU D 48 -13.912 8.444 -19.219 1.00 36.43 O -ATOM 3641 CB LEU D 48 -13.472 6.468 -21.109 1.00 41.80 C -ATOM 3642 CG LEU D 48 -13.862 5.004 -21.634 1.00 22.03 C -ATOM 3643 CD1 LEU D 48 -12.363 4.146 -21.342 1.00 37.56 C -ATOM 3644 CD2 LEU D 48 -15.085 4.189 -21.243 1.00 29.67 C -ATOM 3645 N SER D 49 -15.191 9.523 -21.130 1.00 38.40 N -ATOM 3646 CA SER D 49 -14.387 10.788 -20.677 1.00 43.30 C -ATOM 3647 C SER D 49 -15.473 11.721 -19.486 1.00 46.97 C -ATOM 3648 O SER D 49 -14.763 12.145 -18.356 1.00 46.32 O -ATOM 3649 CB SER D 49 -14.644 11.939 -21.771 1.00 47.25 C -ATOM 3650 OG SER D 49 -16.017 12.123 -22.081 1.00 49.74 O -ATOM 3651 N THR D 50 -16.621 11.041 -19.530 1.00 43.91 N -ATOM 3652 CA THR D 50 -16.855 11.313 -17.860 1.00 36.95 C -ATOM 3653 C THR D 50 -18.023 10.172 -17.341 1.00 36.10 C -ATOM 3654 O THR D 50 -18.171 9.157 -18.076 1.00 28.99 O -ATOM 3655 CB THR D 50 -18.590 12.293 -18.547 1.00 37.26 C -ATOM 3656 OG1 THR D 50 -19.750 11.618 -19.297 1.00 36.38 O -ATOM 3657 CG2 THR D 50 -18.025 13.508 -19.178 1.00 56.40 C -ATOM 3658 N PRO D 51 -18.501 10.284 -16.193 1.00 37.42 N -ATOM 3659 CA PRO D 51 -19.225 9.303 -15.560 1.00 32.59 C -ATOM 3660 C PRO D 51 -20.269 8.625 -16.174 1.00 29.25 C -ATOM 3661 O PRO D 51 -20.632 7.313 -16.333 1.00 26.15 O -ATOM 3662 CB PRO D 51 -19.687 9.933 -14.153 1.00 37.41 C -ATOM 3663 CG PRO D 51 -18.587 10.776 -13.939 1.00 36.57 C -ATOM 3664 CD PRO D 51 -18.147 11.586 -15.357 1.00 42.54 C -ATOM 3665 N ASP D 52 -21.166 9.545 -16.896 1.00 30.65 N -ATOM 3666 CA ASP D 52 -22.575 8.738 -17.587 1.00 39.40 C -ATOM 3667 C ASP D 52 -21.861 8.056 -18.864 1.00 56.69 C -ATOM 3668 O ASP D 52 -22.611 7.193 -19.113 1.00 40.69 O -ATOM 3669 CB ASP D 52 -23.192 10.048 -17.807 1.00 43.19 C -ATOM 3670 CG ASP D 52 -24.003 11.080 -16.646 1.00 63.04 C -ATOM 3671 OD1 ASP D 52 -23.975 10.324 -15.803 1.00 49.71 O -ATOM 3672 OD2 ASP D 52 -21.902 12.263 -16.248 1.00 60.40 O -ATOM 3673 N ALA D 53 -21.035 8.713 -19.489 1.00 26.05 N -ATOM 3674 CA ALA D 53 -20.460 8.256 -20.648 1.00 33.75 C -ATOM 3675 C ALA D 53 -19.850 6.612 -20.478 1.00 42.76 C -ATOM 3676 O ALA D 53 -20.052 5.785 -20.744 1.00 38.58 O -ATOM 3677 CB ALA D 53 -19.424 8.739 -21.252 1.00 40.18 C -ATOM 3678 N VAL D 54 -18.829 6.696 -19.306 1.00 27.10 N -ATOM 3679 CA VAL D 54 -18.358 5.224 -18.836 1.00 25.12 C -ATOM 3680 C VAL D 54 -19.446 4.410 -18.467 1.00 26.50 C -ATOM 3681 O VAL D 54 -19.614 3.128 -18.953 1.00 24.76 O -ATOM 3682 CB VAL D 54 -17.388 5.607 -17.705 1.00 26.67 C -ATOM 3683 CG1 VAL D 54 -17.066 4.042 -17.246 1.00 25.19 C -ATOM 3684 CG2 VAL D 54 -16.359 6.289 -17.975 1.00 31.48 C -ATOM 3685 N MET D 55 -20.628 4.739 -17.700 1.00 25.87 N -ATOM 3686 CA MET D 55 -21.589 3.767 -17.229 1.00 29.84 C -ATOM 3687 C MET D 55 -22.865 3.307 -18.556 1.00 35.52 C -ATOM 3688 O MET D 55 -23.112 2.208 -18.285 1.00 32.07 O -ATOM 3689 CB MET D 55 -22.456 4.472 -15.982 1.00 26.28 C -ATOM 3690 CG MET D 55 -21.631 4.626 -15.056 1.00 36.16 C -ATOM 3691 SD MET D 55 -20.389 3.558 -14.111 1.00 25.36 S -ATOM 3692 CE MET D 55 -21.479 2.431 -13.702 1.00 19.21 C -ATOM 3693 N GLY D 56 -22.639 4.442 -19.311 1.00 30.97 N -ATOM 3694 CA GLY D 56 -23.658 3.737 -20.126 1.00 35.09 C -ATOM 3695 C GLY D 56 -22.967 3.067 -21.283 1.00 44.75 C -ATOM 3696 O GLY D 56 -23.331 2.815 -22.514 1.00 34.49 O -ATOM 3697 N ASN D 57 -21.558 3.094 -21.617 1.00 25.90 N -ATOM 3698 CA ASN D 57 -20.747 2.578 -22.658 1.00 29.86 C -ATOM 3699 C ASN D 57 -21.034 1.130 -22.652 1.00 26.15 C -ATOM 3700 O ASN D 57 -20.989 0.128 -21.968 1.00 26.55 O -ATOM 3701 CB ASN D 57 -19.324 2.902 -22.444 1.00 30.42 C -ATOM 3702 CG ASN D 57 -18.502 2.332 -23.503 1.00 23.49 C -ATOM 3703 OD1 ASN D 57 -18.423 1.194 -24.009 1.00 31.02 O -ATOM 3704 ND2 ASN D 57 -17.712 3.179 -23.808 1.00 27.30 N -ATOM 3705 N PRO D 58 -21.467 0.671 -23.926 1.00 29.25 N -ATOM 3706 CA PRO D 58 -21.926 -0.726 -24.096 1.00 25.97 C -ATOM 3707 C PRO D 58 -20.503 -1.629 -24.124 1.00 16.05 C -ATOM 3708 O PRO D 58 -20.837 -2.940 -23.655 1.00 24.61 O -ATOM 3709 CB PRO D 58 -22.522 -0.927 -25.620 1.00 33.18 C -ATOM 3710 CG PRO D 58 -21.947 0.977 -25.418 1.00 59.49 C -ATOM 3711 CD PRO D 58 -21.892 1.180 -25.502 1.00 43.36 C -ATOM 3712 N LYS D 59 -19.460 -1.283 -24.501 1.00 21.03 N -ATOM 3713 CA LYS D 59 -18.361 -2.042 -24.450 1.00 25.38 C -ATOM 3714 C LYS D 59 -17.715 -2.407 -22.856 1.00 17.84 C -ATOM 3715 O LYS D 59 -17.308 -3.569 -22.731 1.00 21.39 O -ATOM 3716 CB LYS D 59 -17.227 -1.661 -25.270 1.00 32.15 C -ATOM 3717 CG LYS D 59 -17.383 -1.768 -26.732 1.00 48.59 C -ATOM 3718 CD LYS D 59 -16.823 -1.145 -27.228 1.00 53.12 C -ATOM 3719 CE LYS D 59 -15.877 -1.703 -28.754 1.00 53.54 C -ATOM 3720 NZ LYS D 59 -16.728 -0.847 -29.838 1.00 62.98 N -ATOM 3721 N VAL D 60 -18.099 -1.250 -22.201 1.00 18.98 N -ATOM 3722 CA VAL D 60 -17.893 -1.490 -20.566 1.00 19.06 C -ATOM 3723 C VAL D 60 -18.582 -2.535 -20.118 1.00 17.34 C -ATOM 3724 O VAL D 60 -18.311 -3.436 -19.262 1.00 23.46 O -ATOM 3725 CB VAL D 60 -17.740 -0.068 -19.973 1.00 21.26 C -ATOM 3726 CG1 VAL D 60 -17.894 -0.452 -18.381 1.00 33.14 C -ATOM 3727 CG2 VAL D 60 -16.838 0.852 -20.547 1.00 22.06 C -ATOM 3728 N LYS D 61 -20.037 -2.374 -20.306 1.00 22.59 N -ATOM 3729 CA LYS D 61 -21.055 -3.383 -19.935 1.00 26.15 C -ATOM 3730 C LYS D 61 -20.810 -4.741 -20.319 1.00 17.30 C -ATOM 3731 O LYS D 61 -20.683 -5.728 -19.595 1.00 21.45 O -ATOM 3732 CB LYS D 61 -22.507 -2.996 -20.257 1.00 26.85 C -ATOM 3733 CG LYS D 61 -22.914 -1.601 -19.668 1.00 38.21 C -ATOM 3734 CD LYS D 61 -23.980 -1.298 -20.293 1.00 63.66 C -ATOM 3735 CE LYS D 61 -25.073 -0.202 -19.530 1.00 68.06 C -ATOM 3736 NZ LYS D 61 -26.116 0.022 -20.150 1.00 60.84 N -ATOM 3737 N ALA D 62 -20.349 -4.906 -21.599 1.00 19.16 N -ATOM 3738 CA ALA D 62 -20.005 -6.284 -22.177 1.00 20.58 C -ATOM 3739 C ALA D 62 -18.862 -7.045 -21.486 1.00 20.27 C -ATOM 3740 O ALA D 62 -18.872 -8.142 -21.107 1.00 20.37 O -ATOM 3741 CB ALA D 62 -19.803 -6.090 -23.619 1.00 22.88 C -ATOM 3742 N HIS D 63 -17.847 -6.087 -21.291 1.00 19.01 N -ATOM 3743 CA HIS D 63 -16.655 -6.703 -20.657 1.00 22.19 C -ATOM 3744 C HIS D 63 -16.866 -6.900 -19.133 1.00 18.77 C -ATOM 3745 O HIS D 63 -16.263 -7.930 -18.702 1.00 19.91 O -ATOM 3746 CB HIS D 63 -15.613 -5.996 -20.822 1.00 33.38 C -ATOM 3747 CG HIS D 63 -13.969 -6.285 -20.598 1.00 22.34 C -ATOM 3748 ND1 HIS D 63 -13.645 -7.369 -21.205 1.00 25.81 N -ATOM 3749 CD2 HIS D 63 -13.423 -5.898 -19.324 1.00 33.81 C -ATOM 3750 CE1 HIS D 63 -12.413 -7.623 -20.166 1.00 24.99 C -ATOM 3751 NE2 HIS D 63 -12.303 -6.521 -19.735 1.00 32.42 N -ATOM 3752 N GLY D 64 -17.554 -5.957 -18.637 1.00 15.38 N -ATOM 3753 CA GLY D 64 -17.922 -6.237 -17.300 1.00 18.66 C -ATOM 3754 C GLY D 64 -18.656 -7.558 -16.822 1.00 23.30 C -ATOM 3755 O GLY D 64 -18.361 -8.374 -16.052 1.00 21.27 O -ATOM 3756 N LYS D 65 -19.546 -7.946 -17.963 1.00 22.12 N -ATOM 3757 CA LYS D 65 -20.149 -9.350 -17.810 1.00 26.40 C -ATOM 3758 C LYS D 65 -19.206 -10.475 -18.054 1.00 25.29 C -ATOM 3759 O LYS D 65 -19.376 -11.449 -17.320 1.00 24.58 O -ATOM 3760 CB LYS D 65 -21.237 -9.249 -19.016 1.00 42.10 C -ATOM 3761 CG LYS D 65 -21.741 -10.662 -18.763 1.00 41.04 C -ATOM 3762 CD LYS D 65 -22.779 -10.191 -20.722 1.00 41.66 C -ATOM 3763 CE LYS D 65 -22.954 -12.381 -20.558 1.00 58.61 C -ATOM 3764 NZ LYS D 65 -24.294 -12.168 -21.421 1.00 49.59 N -ATOM 3765 N LYS D 66 -18.192 -10.318 -18.949 1.00 22.59 N -ATOM 3766 CA LYS D 66 -17.187 -11.342 -19.305 1.00 23.91 C -ATOM 3767 C LYS D 66 -16.648 -11.569 -17.853 1.00 25.32 C -ATOM 3768 O LYS D 66 -16.190 -12.713 -17.500 1.00 23.23 O -ATOM 3769 CB LYS D 66 -16.360 -10.927 -20.397 1.00 18.18 C -ATOM 3770 CG LYS D 66 -15.506 -11.226 -21.025 1.00 49.93 C -ATOM 3771 CD LYS D 66 -15.452 -11.136 -23.086 1.00 31.44 C -ATOM 3772 CE LYS D 66 -14.594 -13.236 -23.101 1.00 50.83 C -ATOM 3773 NZ LYS D 66 -13.105 -13.073 -24.350 1.00 53.30 N -ATOM 3774 N VAL D 67 -16.012 -10.379 -17.238 1.00 17.89 N -ATOM 3775 CA VAL D 67 -15.129 -10.761 -16.039 1.00 17.07 C -ATOM 3776 C VAL D 67 -15.858 -11.174 -14.995 1.00 11.37 C -ATOM 3777 O VAL D 67 -15.392 -12.090 -14.267 1.00 18.26 O -ATOM 3778 CB VAL D 67 -14.485 -9.126 -15.950 1.00 18.16 C -ATOM 3779 CG1 VAL D 67 -14.204 -9.183 -14.372 1.00 22.61 C -ATOM 3780 CG2 VAL D 67 -13.683 -8.637 -17.078 1.00 19.30 C -ATOM 3781 N LEU D 68 -17.081 -10.772 -14.714 1.00 12.24 N -ATOM 3782 CA LEU D 68 -17.709 -11.246 -13.544 1.00 14.83 C -ATOM 3783 C LEU D 68 -18.294 -12.710 -13.662 1.00 13.25 C -ATOM 3784 O LEU D 68 -18.430 -13.575 -12.845 1.00 18.25 O -ATOM 3785 CB LEU D 68 -18.960 -10.522 -12.977 1.00 23.35 C -ATOM 3786 CG LEU D 68 -19.065 -9.950 -11.782 1.00 32.52 C -ATOM 3787 CD1 LEU D 68 -18.211 -10.021 -10.888 1.00 40.78 C -ATOM 3788 CD2 LEU D 68 -20.119 -9.201 -11.516 1.00 39.22 C -ATOM 3789 N GLY D 69 -18.532 -13.001 -15.044 1.00 22.38 N -ATOM 3790 CA GLY D 69 -18.677 -14.387 -15.364 1.00 27.48 C -ATOM 3791 C GLY D 69 -17.639 -15.482 -15.016 1.00 17.57 C -ATOM 3792 O GLY D 69 -17.849 -16.416 -14.366 1.00 21.01 O -ATOM 3793 N ALA D 70 -16.381 -14.966 -15.333 1.00 17.61 N -ATOM 3794 CA ALA D 70 -15.237 -15.816 -14.969 1.00 17.42 C -ATOM 3795 C ALA D 70 -15.098 -15.818 -13.537 1.00 19.59 C -ATOM 3796 O ALA D 70 -14.642 -16.873 -12.761 1.00 18.72 O -ATOM 3797 CB ALA D 70 -14.109 -15.221 -15.702 1.00 18.83 C -ATOM 3798 N PHE D 71 -15.369 -14.689 -12.922 1.00 18.97 N -ATOM 3799 CA PHE D 71 -15.352 -14.546 -11.295 1.00 24.55 C -ATOM 3800 C PHE D 71 -16.405 -15.564 -10.716 1.00 22.73 C -ATOM 3801 O PHE D 71 -15.988 -16.296 -9.916 1.00 26.00 O -ATOM 3802 CB PHE D 71 -15.526 -13.076 -10.943 1.00 18.78 C -ATOM 3803 CG PHE D 71 -15.587 -12.889 -9.418 1.00 15.63 C -ATOM 3804 CD1 PHE D 71 -14.330 -12.356 -8.913 1.00 23.81 C -ATOM 3805 CD2 PHE D 71 -16.955 -13.108 -8.941 1.00 34.86 C -ATOM 3806 CE1 PHE D 71 -14.431 -12.324 -7.507 1.00 19.91 C -ATOM 3807 CE2 PHE D 71 -16.645 -13.000 -7.472 1.00 36.36 C -ATOM 3808 CZ PHE D 71 -15.423 -12.584 -6.796 1.00 26.08 C -ATOM 3809 N SER D 72 -17.526 -15.632 -11.448 1.00 19.94 N -ATOM 3810 CA SER D 72 -18.560 -16.484 -11.205 1.00 23.38 C -ATOM 3811 C SER D 72 -18.098 -17.836 -10.814 1.00 24.72 C -ATOM 3812 O SER D 72 -18.305 -18.802 -9.908 1.00 26.53 O -ATOM 3813 CB SER D 72 -20.212 -16.588 -11.400 1.00 29.23 C -ATOM 3814 OG SER D 72 -20.268 -15.282 -11.624 1.00 41.11 O -ATOM 3815 N ASP D 73 -17.601 -18.307 -12.047 1.00 28.33 N -ATOM 3816 CA ASP D 73 -16.810 -19.464 -12.087 1.00 41.54 C -ATOM 3817 C ASP D 73 -16.106 -20.105 -11.342 1.00 28.94 C -ATOM 3818 O ASP D 73 -15.997 -21.061 -10.645 1.00 34.21 O -ATOM 3819 CB ASP D 73 -16.190 -20.100 -13.720 1.00 46.96 C -ATOM 3820 CG ASP D 73 -17.426 -20.027 -14.053 1.00 54.92 C -ATOM 3821 OD1 ASP D 73 -18.701 -19.481 -14.810 1.00 44.49 O -ATOM 3822 OD2 ASP D 73 -16.811 -19.333 -16.112 1.00 50.27 O -ATOM 3823 N GLY D 74 -15.211 -19.059 -10.501 1.00 26.75 N -ATOM 3824 CA GLY D 74 -14.376 -19.390 -9.473 1.00 22.69 C -ATOM 3825 C GLY D 74 -14.851 -19.537 -8.039 1.00 23.14 C -ATOM 3826 O GLY D 74 -14.419 -20.191 -7.094 1.00 29.20 O -ATOM 3827 N LEU D 75 -16.177 -18.924 -8.005 1.00 21.18 N -ATOM 3828 CA LEU D 75 -16.870 -19.385 -6.815 1.00 34.17 C -ATOM 3829 C LEU D 75 -17.117 -20.780 -6.565 1.00 37.46 C -ATOM 3830 O LEU D 75 -17.563 -21.063 -5.534 1.00 40.90 O -ATOM 3831 CB LEU D 75 -18.078 -18.207 -6.714 1.00 36.63 C -ATOM 3832 CG LEU D 75 -17.957 -16.908 -6.209 1.00 28.96 C -ATOM 3833 CD1 LEU D 75 -16.674 -16.783 -5.652 1.00 54.84 C -ATOM 3834 CD2 LEU D 75 -18.450 -15.831 -6.570 1.00 41.72 C -ATOM 3835 N ALA D 76 -17.372 -21.329 -7.689 1.00 36.74 N -ATOM 3836 CA ALA D 76 -17.490 -23.239 -8.009 1.00 46.27 C -ATOM 3837 C ALA D 76 -16.460 -23.394 -7.753 1.00 39.68 C -ATOM 3838 O ALA D 76 -16.371 -24.793 -7.251 1.00 39.55 O -ATOM 3839 CB ALA D 76 -18.034 -22.779 -9.158 1.00 52.59 C -ATOM 3840 N HIS D 77 -15.221 -22.931 -7.252 1.00 34.88 N -ATOM 3841 CA HIS D 77 -14.175 -23.705 -7.014 1.00 37.75 C -ATOM 3842 C HIS D 77 -12.911 -22.947 -6.253 1.00 36.30 C -ATOM 3843 O HIS D 77 -11.715 -22.807 -6.207 1.00 30.91 O -ATOM 3844 CB HIS D 77 -13.016 -23.968 -8.303 1.00 35.95 C -ATOM 3845 CG HIS D 77 -13.662 -24.672 -9.381 1.00 39.15 C -ATOM 3846 ND1 HIS D 77 -14.327 -23.756 -10.232 1.00 58.22 N -ATOM 3847 CD2 HIS D 77 -13.455 -26.062 -9.566 1.00 48.66 C -ATOM 3848 CE1 HIS D 77 -15.214 -25.034 -11.337 1.00 49.77 C -ATOM 3849 NE2 HIS D 77 -14.945 -25.798 -10.683 1.00 36.55 N -ATOM 3850 N LEU D 78 -13.652 -22.590 -4.941 1.00 30.38 N -ATOM 3851 CA LEU D 78 -13.049 -22.225 -3.904 1.00 35.53 C -ATOM 3852 C LEU D 78 -11.853 -22.307 -3.241 1.00 31.52 C -ATOM 3853 O LEU D 78 -11.095 -21.930 -2.681 1.00 30.87 O -ATOM 3854 CB LEU D 78 -14.166 -21.218 -2.929 1.00 35.71 C -ATOM 3855 CG LEU D 78 -14.517 -19.696 -3.089 1.00 42.09 C -ATOM 3856 CD1 LEU D 78 -16.000 -19.812 -2.269 1.00 40.33 C -ATOM 3857 CD2 LEU D 78 -14.206 -18.936 -3.409 1.00 43.79 C -ATOM 3858 N ASP D 79 -11.841 -23.798 -3.366 1.00 27.09 N -ATOM 3859 CA ASP D 79 -10.671 -24.163 -2.603 1.00 39.93 C -ATOM 3860 C ASP D 79 -9.351 -24.818 -3.691 1.00 38.31 C -ATOM 3861 O ASP D 79 -8.220 -24.950 -3.380 1.00 37.24 O -ATOM 3862 CB ASP D 79 -11.204 -25.807 -2.720 1.00 49.19 C -ATOM 3863 CG ASP D 79 -12.348 -25.806 -2.280 1.00 60.14 C -ATOM 3864 OD1 ASP D 79 -12.747 -27.563 -1.436 1.00 58.54 O -ATOM 3865 OD2 ASP D 79 -11.720 -25.378 -0.450 1.00 49.76 O -ATOM 3866 N ASN D 80 -9.928 -24.165 -4.813 1.00 33.30 N -ATOM 3867 CA ASN D 80 -8.432 -24.074 -5.725 1.00 41.52 C -ATOM 3868 C ASN D 80 -8.757 -22.972 -7.024 1.00 29.72 C -ATOM 3869 O ASN D 80 -8.410 -23.186 -8.009 1.00 26.63 O -ATOM 3870 CB ASN D 80 -8.335 -25.027 -6.387 1.00 65.88 C -ATOM 3871 CG ASN D 80 -8.226 -26.006 -7.178 1.00 79.70 C -ATOM 3872 OD1 ASN D 80 -6.646 -26.141 -7.665 1.00 64.12 O -ATOM 3873 ND2 ASN D 80 -9.445 -26.052 -7.340 1.00 80.04 N -ATOM 3874 N LEU D 81 -8.454 -21.884 -6.206 1.00 24.36 N -ATOM 3875 CA LEU D 81 -8.539 -20.715 -7.081 1.00 25.83 C -ATOM 3876 C LEU D 81 -7.273 -20.637 -8.041 1.00 31.94 C -ATOM 3877 O LEU D 81 -7.415 -20.270 -9.214 1.00 25.17 O -ATOM 3878 CB LEU D 81 -8.579 -19.629 -6.126 1.00 20.37 C -ATOM 3879 CG LEU D 81 -9.997 -19.259 -5.589 1.00 25.65 C -ATOM 3880 CD1 LEU D 81 -9.956 -18.414 -4.674 1.00 40.59 C -ATOM 3881 CD2 LEU D 81 -11.103 -19.225 -6.396 1.00 23.30 C -ATOM 3882 N LYS D 82 -6.051 -20.893 -7.415 1.00 30.20 N -ATOM 3883 CA LYS D 82 -4.933 -20.852 -8.394 1.00 28.24 C -ATOM 3884 C LYS D 82 -5.124 -21.707 -9.528 1.00 33.91 C -ATOM 3885 O LYS D 82 -4.821 -21.459 -10.648 1.00 25.48 O -ATOM 3886 CB LYS D 82 -3.611 -21.239 -7.521 1.00 33.73 C -ATOM 3887 CG LYS D 82 -3.123 -20.210 -6.921 1.00 40.61 C -ATOM 3888 CD LYS D 82 -1.453 -20.533 -6.100 1.00 64.29 C -ATOM 3889 CE LYS D 82 -2.245 -18.592 -4.901 1.00 50.61 C -ATOM 3890 NZ LYS D 82 -1.640 -20.210 -4.012 1.00 57.77 N -ATOM 3891 N GLY D 83 -5.684 -23.133 -9.543 1.00 30.21 N -ATOM 3892 CA GLY D 83 -5.556 -24.039 -10.631 1.00 23.41 C -ATOM 3893 C GLY D 83 -6.710 -23.708 -11.373 1.00 31.79 C -ATOM 3894 O GLY D 83 -6.545 -23.384 -12.827 1.00 27.38 O -ATOM 3895 N THR D 84 -7.929 -22.850 -10.943 1.00 27.06 N -ATOM 3896 CA THR D 84 -8.896 -22.475 -11.769 1.00 31.17 C -ATOM 3897 C THR D 84 -8.254 -21.368 -12.862 1.00 35.08 C -ATOM 3898 O THR D 84 -9.023 -21.163 -13.732 1.00 26.93 O -ATOM 3899 CB THR D 84 -10.186 -21.934 -10.990 1.00 26.68 C -ATOM 3900 OG1 THR D 84 -10.450 -22.939 -10.341 1.00 41.82 O -ATOM 3901 CG2 THR D 84 -11.436 -21.350 -11.615 1.00 32.36 C -ATOM 3902 N PHE D 85 -7.713 -20.405 -12.026 1.00 23.78 N -ATOM 3903 CA PHE D 85 -7.538 -18.984 -12.806 1.00 17.94 C -ATOM 3904 C PHE D 85 -6.138 -19.115 -13.564 1.00 20.32 C -ATOM 3905 O PHE D 85 -5.528 -18.116 -14.137 1.00 18.46 O -ATOM 3906 CB PHE D 85 -7.425 -17.913 -11.819 1.00 16.82 C -ATOM 3907 CG PHE D 85 -8.885 -17.567 -11.680 1.00 15.41 C -ATOM 3908 CD1 PHE D 85 -9.422 -17.861 -10.346 1.00 21.43 C -ATOM 3909 CD2 PHE D 85 -9.605 -16.833 -12.552 1.00 29.52 C -ATOM 3910 CE1 PHE D 85 -10.820 -17.512 -9.993 1.00 27.35 C -ATOM 3911 CE2 PHE D 85 -11.060 -16.678 -12.198 1.00 23.38 C -ATOM 3912 CZ PHE D 85 -11.788 -16.979 -10.988 1.00 20.96 C -ATOM 3913 N ALA D 86 -5.306 -20.190 -13.510 1.00 16.78 N -ATOM 3914 CA ALA D 86 -3.786 -20.129 -13.990 1.00 21.66 C -ATOM 3915 C ALA D 86 -3.859 -19.751 -15.592 1.00 13.70 C -ATOM 3916 O ALA D 86 -2.977 -18.900 -15.942 1.00 16.83 O -ATOM 3917 CB ALA D 86 -3.276 -21.717 -14.150 1.00 23.60 C -ATOM 3918 N THR D 87 -4.799 -20.235 -16.291 1.00 17.09 N -ATOM 3919 CA THR D 87 -4.700 -19.770 -17.696 1.00 15.85 C -ATOM 3920 C THR D 87 -4.913 -18.223 -17.934 1.00 17.61 C -ATOM 3921 O THR D 87 -4.226 -17.589 -18.665 1.00 21.97 O -ATOM 3922 CB THR D 87 -5.803 -20.551 -18.552 1.00 23.34 C -ATOM 3923 OG1 THR D 87 -5.495 -21.943 -18.388 1.00 26.37 O -ATOM 3924 CG2 THR D 87 -5.595 -20.344 -19.930 1.00 26.08 C -ATOM 3925 N LEU D 88 -5.980 -17.807 -17.359 1.00 19.60 N -ATOM 3926 CA LEU D 88 -6.271 -16.457 -17.415 1.00 18.18 C -ATOM 3927 C LEU D 88 -5.187 -15.518 -16.684 1.00 15.66 C -ATOM 3928 O LEU D 88 -4.841 -14.368 -17.168 1.00 16.54 O -ATOM 3929 CB LEU D 88 -7.631 -16.058 -16.725 1.00 24.93 C -ATOM 3930 CG LEU D 88 -8.806 -16.413 -17.604 1.00 29.68 C -ATOM 3931 CD1 LEU D 88 -9.913 -16.362 -16.626 1.00 33.11 C -ATOM 3932 CD2 LEU D 88 -8.780 -15.785 -18.779 1.00 21.96 C -ATOM 3933 N SER D 89 -4.550 -16.190 -15.577 1.00 21.20 N -ATOM 3934 CA SER D 89 -3.384 -15.545 -14.950 1.00 17.78 C -ATOM 3935 C SER D 89 -2.295 -15.067 -15.986 1.00 16.70 C -ATOM 3936 O SER D 89 -1.619 -14.055 -16.257 1.00 15.86 O -ATOM 3937 CB SER D 89 -2.725 -16.272 -13.880 1.00 19.29 C -ATOM 3938 OG SER D 89 -1.733 -15.529 -13.240 1.00 14.95 O -ATOM 3939 N GLU D 90 -1.806 -16.218 -16.719 1.00 15.58 N -ATOM 3940 CA GLU D 90 -0.961 -16.101 -17.900 1.00 21.65 C -ATOM 3941 C GLU D 90 -1.319 -15.129 -19.030 1.00 13.57 C -ATOM 3942 O GLU D 90 -0.576 -14.403 -19.451 1.00 18.38 O -ATOM 3943 CB GLU D 90 -0.700 -17.640 -18.253 1.00 19.08 C -ATOM 3944 CG GLU D 90 0.585 -17.390 -19.009 1.00 38.09 C -ATOM 3945 CD GLU D 90 0.916 -19.788 -19.196 1.00 62.85 C -ATOM 3946 OE1 GLU D 90 0.495 -19.279 -20.696 1.00 54.38 O -ATOM 3947 OE2 GLU D 90 -0.172 -20.134 -18.632 1.00 49.69 O -ATOM 3948 N LEU D 91 -2.614 -15.260 -19.279 1.00 12.64 N -ATOM 3949 CA LEU D 91 -2.918 -14.282 -20.199 1.00 11.29 C -ATOM 3950 C LEU D 91 -2.769 -12.767 -19.975 1.00 14.82 C -ATOM 3951 O LEU D 91 -2.486 -11.814 -20.708 1.00 14.36 O -ATOM 3952 CB LEU D 91 -4.443 -14.616 -20.526 1.00 13.30 C -ATOM 3953 CG LEU D 91 -5.325 -13.643 -21.412 1.00 17.13 C -ATOM 3954 CD1 LEU D 91 -4.702 -13.618 -23.000 1.00 25.95 C -ATOM 3955 CD2 LEU D 91 -6.752 -13.787 -21.472 1.00 20.87 C -ATOM 3956 N HIS D 92 -3.278 -12.509 -18.598 1.00 14.55 N -ATOM 3957 CA HIS D 92 -3.429 -10.968 -18.356 1.00 18.41 C -ATOM 3958 C HIS D 92 -1.750 -10.659 -17.942 1.00 25.22 C -ATOM 3959 O HIS D 92 -1.542 -9.487 -18.276 1.00 15.09 O -ATOM 3960 CB HIS D 92 -3.870 -11.061 -16.956 1.00 16.94 C -ATOM 3961 CG HIS D 92 -5.443 -10.779 -17.044 1.00 14.87 C -ATOM 3962 ND1 HIS D 92 -6.226 -12.088 -17.324 1.00 14.65 N -ATOM 3963 CD2 HIS D 92 -6.494 -9.930 -17.027 1.00 12.93 C -ATOM 3964 CE1 HIS D 92 -7.513 -11.488 -17.344 1.00 12.97 C -ATOM 3965 NE2 HIS D 92 -7.794 -10.264 -17.456 1.00 18.10 N -ATOM 3966 N CYS D 93 -0.853 -11.610 -17.750 1.00 16.12 N -ATOM 3967 CA CYS D 93 0.671 -11.156 -17.799 1.00 16.35 C -ATOM 3968 C CYS D 93 1.184 -10.895 -19.303 1.00 18.55 C -ATOM 3969 O CYS D 93 1.616 -9.948 -19.471 1.00 17.22 O -ATOM 3970 CB CYS D 93 1.177 -12.201 -16.844 1.00 20.93 C -ATOM 3971 SG CYS D 93 3.106 -11.680 -16.838 1.00 18.90 S -ATOM 3972 N ASP D 94 1.071 -12.148 -19.853 1.00 14.32 N -ATOM 3973 CA ASP D 94 2.076 -12.170 -21.195 1.00 16.01 C -ATOM 3974 C ASP D 94 1.351 -11.461 -22.242 1.00 19.68 C -ATOM 3975 O ASP D 94 1.981 -11.016 -23.089 1.00 27.14 O -ATOM 3976 CB ASP D 94 2.163 -13.661 -21.334 1.00 20.44 C -ATOM 3977 CG ASP D 94 3.220 -14.533 -20.409 1.00 36.43 C -ATOM 3978 OD1 ASP D 94 3.523 -13.728 -19.788 1.00 32.86 O -ATOM 3979 OD2 ASP D 94 2.735 -15.960 -20.657 1.00 40.09 O -ATOM 3980 N LYS D 95 0.079 -11.509 -22.378 1.00 14.90 N -ATOM 3981 CA LYS D 95 -0.657 -10.830 -23.618 1.00 16.76 C -ATOM 3982 C LYS D 95 -1.037 -9.542 -23.369 1.00 18.82 C -ATOM 3983 O LYS D 95 -1.025 -8.517 -23.887 1.00 19.72 O -ATOM 3984 CB LYS D 95 -1.739 -11.719 -24.171 1.00 24.57 C -ATOM 3985 CG LYS D 95 -1.405 -13.254 -24.270 1.00 49.61 C -ATOM 3986 CD LYS D 95 0.033 -12.822 -25.830 1.00 60.17 C -ATOM 3987 CE LYS D 95 0.875 -13.698 -26.541 1.00 57.82 C -ATOM 3988 NZ LYS D 95 1.951 -12.652 -27.842 1.00 59.53 N -ATOM 3989 N LEU D 96 -1.816 -9.347 -21.943 1.00 16.80 N -ATOM 3990 CA LEU D 96 -2.489 -8.095 -21.711 1.00 16.58 C -ATOM 3991 C LEU D 96 -1.557 -6.998 -20.981 1.00 16.01 C -ATOM 3992 O LEU D 96 -2.025 -5.870 -20.986 1.00 15.73 O -ATOM 3993 CB LEU D 96 -3.813 -8.447 -21.040 1.00 21.01 C -ATOM 3994 CG LEU D 96 -4.799 -9.421 -21.657 1.00 22.06 C -ATOM 3995 CD1 LEU D 96 -6.039 -9.748 -20.763 1.00 15.50 C -ATOM 3996 CD2 LEU D 96 -5.152 -8.823 -22.921 1.00 34.04 C -ATOM 3997 N HIS D 97 -0.781 -7.579 -20.217 1.00 18.03 N -ATOM 3998 CA HIS D 97 0.244 -6.637 -19.580 1.00 18.48 C -ATOM 3999 C HIS D 97 -0.432 -5.796 -18.443 1.00 13.60 C -ATOM 4000 O HIS D 97 -0.253 -4.620 -18.215 1.00 15.07 O -ATOM 4001 CB HIS D 97 0.990 -5.653 -20.400 1.00 24.24 C -ATOM 4002 CG HIS D 97 1.776 -6.391 -21.656 1.00 28.24 C -ATOM 4003 ND1 HIS D 97 2.554 -7.432 -21.385 1.00 26.25 N -ATOM 4004 CD2 HIS D 97 1.271 -6.244 -22.910 1.00 35.10 C -ATOM 4005 CE1 HIS D 97 3.136 -7.961 -22.703 1.00 25.85 C -ATOM 4006 NE2 HIS D 97 2.325 -7.208 -23.322 1.00 28.28 N -ATOM 4007 N VAL D 98 -1.455 -6.545 -17.703 1.00 15.21 N -ATOM 4008 CA VAL D 98 -2.210 -5.794 -16.736 1.00 14.55 C -ATOM 4009 C VAL D 98 -1.489 -5.841 -15.285 1.00 10.52 C -ATOM 4010 O VAL D 98 -1.368 -7.002 -14.827 1.00 11.77 O -ATOM 4011 CB VAL D 98 -3.549 -6.468 -16.502 1.00 15.30 C -ATOM 4012 CG1 VAL D 98 -4.339 -5.933 -15.325 1.00 15.30 C -ATOM 4013 CG2 VAL D 98 -4.285 -6.152 -17.968 1.00 17.14 C -ATOM 4014 N ASP D 99 -1.167 -4.730 -14.701 1.00 9.86 N -ATOM 4015 CA ASP D 99 -0.610 -4.765 -13.282 1.00 10.99 C -ATOM 4016 C ASP D 99 -1.652 -5.465 -12.445 1.00 12.34 C -ATOM 4017 O ASP D 99 -2.837 -4.921 -12.433 1.00 15.90 O -ATOM 4018 CB ASP D 99 -0.421 -3.334 -12.976 1.00 12.59 C -ATOM 4019 CG ASP D 99 0.231 -3.018 -11.481 1.00 12.64 C -ATOM 4020 OD1 ASP D 99 0.529 -1.770 -11.464 1.00 11.35 O -ATOM 4021 OD2 ASP D 99 0.421 -4.097 -10.818 1.00 14.04 O -ATOM 4022 N PRO D 100 -1.293 -6.422 -11.755 1.00 16.57 N -ATOM 4023 CA PRO D 100 -2.075 -7.130 -10.712 1.00 11.14 C -ATOM 4024 C PRO D 100 -2.767 -6.164 -9.672 1.00 11.03 C -ATOM 4025 O PRO D 100 -3.730 -6.728 -9.131 1.00 12.40 O -ATOM 4026 CB PRO D 100 -1.455 -8.509 -10.454 1.00 18.57 C -ATOM 4027 CG PRO D 100 -0.120 -8.351 -10.644 1.00 16.52 C -ATOM 4028 CD PRO D 100 0.008 -7.085 -11.678 1.00 15.61 C -ATOM 4029 N GLU D 101 -2.120 -5.022 -9.432 1.00 9.29 N -ATOM 4030 CA GLU D 101 -2.721 -4.184 -8.535 1.00 12.45 C -ATOM 4031 C GLU D 101 -4.150 -3.766 -8.894 1.00 20.07 C -ATOM 4032 O GLU D 101 -5.139 -3.640 -8.044 1.00 15.47 O -ATOM 4033 CB GLU D 101 -1.898 -2.971 -8.352 1.00 18.48 C -ATOM 4034 CG GLU D 101 -2.751 -1.912 -7.301 1.00 30.49 C -ATOM 4035 CD GLU D 101 -2.928 -2.595 -5.361 1.00 32.99 C -ATOM 4036 OE1 GLU D 101 -1.814 -3.251 -5.501 1.00 22.72 O -ATOM 4037 OE2 GLU D 101 -3.790 -1.433 -5.275 1.00 37.16 O -ATOM 4038 N ASN D 102 -4.416 -3.866 -10.222 1.00 14.86 N -ATOM 4039 CA ASN D 102 -5.827 -3.553 -10.820 1.00 14.38 C -ATOM 4040 C ASN D 102 -6.730 -4.706 -10.375 1.00 12.83 C -ATOM 4041 O ASN D 102 -8.073 -4.305 -10.051 1.00 15.98 O -ATOM 4042 CB ASN D 102 -5.825 -3.726 -12.202 1.00 15.85 C -ATOM 4043 CG ASN D 102 -5.178 -2.418 -12.728 1.00 20.86 C -ATOM 4044 OD1 ASN D 102 -5.594 -1.386 -12.707 1.00 17.49 O -ATOM 4045 ND2 ASN D 102 -3.900 -2.610 -13.401 1.00 22.52 N -ATOM 4046 N PHE D 103 -6.450 -5.902 -10.088 1.00 11.06 N -ATOM 4047 CA PHE D 103 -7.223 -7.062 -9.594 1.00 11.10 C -ATOM 4048 C PHE D 103 -7.838 -6.627 -8.138 1.00 14.83 C -ATOM 4049 O PHE D 103 -9.038 -6.926 -7.755 1.00 12.07 O -ATOM 4050 CB PHE D 103 -6.641 -8.378 -9.453 1.00 14.26 C -ATOM 4051 CG PHE D 103 -5.978 -8.685 -10.884 1.00 14.43 C -ATOM 4052 CD1 PHE D 103 -6.722 -8.442 -12.150 1.00 22.91 C -ATOM 4053 CD2 PHE D 103 -4.777 -9.418 -10.920 1.00 19.84 C -ATOM 4054 CE1 PHE D 103 -6.285 -8.812 -13.376 1.00 22.48 C -ATOM 4055 CE2 PHE D 103 -4.350 -9.752 -12.200 1.00 13.44 C -ATOM 4056 CZ PHE D 103 -4.988 -9.426 -13.435 1.00 16.91 C -ATOM 4057 N ARG D 104 -6.979 -6.041 -7.313 1.00 14.96 N -ATOM 4058 CA ARG D 104 -7.236 -5.640 -5.946 1.00 18.64 C -ATOM 4059 C ARG D 104 -8.352 -4.439 -5.984 1.00 17.76 C -ATOM 4060 O ARG D 104 -9.251 -4.482 -5.206 1.00 14.29 O -ATOM 4061 CB ARG D 104 -5.925 -5.205 -5.097 1.00 19.67 C -ATOM 4062 CG ARG D 104 -5.188 -6.366 -5.055 1.00 39.66 C -ATOM 4063 CD ARG D 104 -3.686 -6.042 -4.324 1.00 67.99 C -ATOM 4064 NE ARG D 104 -3.285 -7.833 -4.405 1.00 67.11 N -ATOM 4065 CZ ARG D 104 -0.829 -7.130 -4.074 1.00 80.12 C -ATOM 4066 NH1 ARG D 104 -1.228 -5.714 -3.904 1.00 77.56 N -ATOM 4067 NH2 ARG D 104 -1.024 -7.904 -3.149 1.00 80.12 N -ATOM 4068 N LEU D 105 -8.019 -3.490 -6.857 1.00 14.78 N -ATOM 4069 CA LEU D 105 -8.933 -2.377 -6.997 1.00 11.66 C -ATOM 4070 C LEU D 105 -10.366 -2.815 -7.384 1.00 13.52 C -ATOM 4071 O LEU D 105 -11.325 -2.484 -6.781 1.00 12.56 O -ATOM 4072 CB LEU D 105 -8.385 -1.463 -7.865 1.00 16.32 C -ATOM 4073 CG LEU D 105 -7.155 -0.533 -7.691 1.00 23.61 C -ATOM 4074 CD1 LEU D 105 -6.564 0.347 -8.601 1.00 25.65 C -ATOM 4075 CD2 LEU D 105 -7.175 -0.008 -6.272 1.00 30.28 C -ATOM 4076 N LEU D 106 -10.388 -3.731 -8.359 1.00 11.11 N -ATOM 4077 CA LEU D 106 -11.776 -4.169 -8.774 1.00 10.81 C -ATOM 4078 C LEU D 106 -12.425 -4.909 -7.735 1.00 7.04 C -ATOM 4079 O LEU D 106 -13.596 -4.860 -7.508 1.00 8.65 O -ATOM 4080 CB LEU D 106 -11.565 -5.136 -9.996 1.00 12.84 C -ATOM 4081 CG LEU D 106 -12.908 -5.591 -10.559 1.00 16.25 C -ATOM 4082 CD1 LEU D 106 -13.855 -4.506 -11.046 1.00 16.77 C -ATOM 4083 CD2 LEU D 106 -12.516 -6.548 -11.540 1.00 20.04 C -ATOM 4084 N GLY D 107 -11.735 -5.688 -6.939 1.00 12.52 N -ATOM 4085 CA GLY D 107 -12.179 -6.516 -5.777 1.00 16.15 C -ATOM 4086 C GLY D 107 -12.899 -5.574 -4.792 1.00 14.99 C -ATOM 4087 O GLY D 107 -14.015 -5.773 -4.332 1.00 12.81 O -ATOM 4088 N ASN D 108 -12.285 -4.436 -4.514 1.00 12.36 N -ATOM 4089 CA ASN D 108 -12.802 -3.491 -3.621 1.00 14.00 C -ATOM 4090 C ASN D 108 -13.963 -2.724 -4.098 1.00 11.43 C -ATOM 4091 O ASN D 108 -15.056 -2.507 -3.385 1.00 12.39 O -ATOM 4092 CB ASN D 108 -11.844 -2.454 -3.053 1.00 18.57 C -ATOM 4093 CG ASN D 108 -10.617 -3.293 -1.988 1.00 22.26 C -ATOM 4094 OD1 ASN D 108 -11.199 -4.293 -1.311 1.00 22.78 O -ATOM 4095 ND2 ASN D 108 -9.853 -2.344 -1.843 1.00 30.03 N -ATOM 4096 N VAL D 109 -13.924 -2.387 -5.385 1.00 10.09 N -ATOM 4097 CA VAL D 109 -15.064 -1.848 -6.032 1.00 8.21 C -ATOM 4098 C VAL D 109 -16.234 -2.783 -6.101 1.00 9.89 C -ATOM 4099 O VAL D 109 -17.335 -2.321 -5.728 1.00 11.76 O -ATOM 4100 CB VAL D 109 -14.656 -1.351 -7.492 1.00 11.59 C -ATOM 4101 CG1 VAL D 109 -15.861 -0.846 -8.320 1.00 17.96 C -ATOM 4102 CG2 VAL D 109 -13.771 -0.178 -7.377 1.00 17.98 C -ATOM 4103 N LEU D 110 -15.952 -4.083 -6.403 1.00 9.62 N -ATOM 4104 CA LEU D 110 -17.024 -5.059 -6.369 1.00 14.08 C -ATOM 4105 C LEU D 110 -17.831 -5.035 -5.141 1.00 11.97 C -ATOM 4106 O LEU D 110 -19.008 -5.257 -4.826 1.00 10.97 O -ATOM 4107 CB LEU D 110 -16.600 -6.309 -6.770 1.00 15.34 C -ATOM 4108 CG LEU D 110 -17.478 -7.458 -6.761 1.00 14.97 C -ATOM 4109 CD1 LEU D 110 -18.670 -7.282 -7.592 1.00 23.21 C -ATOM 4110 CD2 LEU D 110 -16.862 -8.829 -7.132 1.00 26.92 C -ATOM 4111 N VAL D 111 -16.932 -5.013 -3.909 1.00 14.50 N -ATOM 4112 CA VAL D 111 -17.557 -5.003 -2.482 1.00 11.82 C -ATOM 4113 C VAL D 111 -18.496 -3.835 -2.339 1.00 14.01 C -ATOM 4114 O VAL D 111 -19.560 -3.938 -1.746 1.00 12.03 O -ATOM 4115 CB VAL D 111 -16.468 -5.174 -1.423 1.00 12.62 C -ATOM 4116 CG1 VAL D 111 -17.105 -4.887 -0.077 1.00 15.85 C -ATOM 4117 CG2 VAL D 111 -15.845 -6.615 -1.505 1.00 10.77 C -ATOM 4118 N CYS D 112 -17.954 -2.598 -2.876 1.00 13.62 N -ATOM 4119 CA CYS D 112 -18.674 -1.428 -2.875 1.00 13.72 C -ATOM 4120 C CYS D 112 -20.245 -1.545 -3.397 1.00 20.10 C -ATOM 4121 O CYS D 112 -21.199 -1.153 -2.984 1.00 16.56 O -ATOM 4122 CB CYS D 112 -18.077 -0.213 -3.441 1.00 12.95 C -ATOM 4123 SG CYS D 112 -16.890 0.371 -2.238 1.00 15.21 S -ATOM 4124 N VAL D 113 -20.090 -2.259 -4.565 1.00 17.02 N -ATOM 4125 CA VAL D 113 -21.229 -2.476 -5.537 1.00 12.28 C -ATOM 4126 C VAL D 113 -22.216 -3.415 -4.943 1.00 12.56 C -ATOM 4127 O VAL D 113 -23.393 -3.166 -4.833 1.00 15.84 O -ATOM 4128 CB VAL D 113 -20.819 -3.012 -6.914 1.00 17.85 C -ATOM 4129 CG1 VAL D 113 -22.007 -3.440 -7.657 1.00 18.74 C -ATOM 4130 CG2 VAL D 113 -20.123 -1.688 -7.807 1.00 21.41 C -ATOM 4131 N LEU D 114 -21.799 -4.480 -4.273 1.00 10.75 N -ATOM 4132 CA LEU D 114 -22.611 -5.453 -3.526 1.00 10.78 C -ATOM 4133 C LEU D 114 -23.336 -4.689 -2.455 1.00 19.00 C -ATOM 4134 O LEU D 114 -24.454 -4.811 -2.196 1.00 11.46 O -ATOM 4135 CB LEU D 114 -21.815 -6.582 -3.114 1.00 14.56 C -ATOM 4136 CG LEU D 114 -21.183 -7.401 -4.241 1.00 17.11 C -ATOM 4137 CD1 LEU D 114 -20.368 -8.591 -3.652 1.00 17.06 C -ATOM 4138 CD2 LEU D 114 -22.473 -8.135 -5.021 1.00 20.86 C -ATOM 4139 N ALA D 115 -22.573 -3.965 -1.677 1.00 11.71 N -ATOM 4140 CA ALA D 115 -23.177 -3.124 -0.512 1.00 11.69 C -ATOM 4141 C ALA D 115 -24.286 -2.193 -1.056 1.00 15.12 C -ATOM 4142 O ALA D 115 -25.190 -2.078 -0.405 1.00 15.47 O -ATOM 4143 CB ALA D 115 -22.014 -2.336 0.283 1.00 12.28 C -ATOM 4144 N HIS D 116 -23.996 -1.420 -2.116 1.00 15.03 N -ATOM 4145 CA HIS D 116 -24.955 -0.497 -2.730 1.00 12.09 C -ATOM 4146 C HIS D 116 -26.163 -1.244 -3.183 1.00 12.50 C -ATOM 4147 O HIS D 116 -27.367 -0.733 -2.977 1.00 15.93 O -ATOM 4148 CB HIS D 116 -24.260 0.137 -3.930 1.00 20.66 C -ATOM 4149 CG HIS D 116 -25.177 1.236 -4.511 1.00 27.72 C -ATOM 4150 ND1 HIS D 116 -25.302 1.194 -5.752 1.00 29.99 N -ATOM 4151 CD2 HIS D 116 -25.633 2.207 -3.823 1.00 30.96 C -ATOM 4152 CE1 HIS D 116 -26.002 2.415 -6.103 1.00 27.26 C -ATOM 4153 NE2 HIS D 116 -26.344 3.000 -4.762 1.00 28.89 N -ATOM 4154 N HIS D 117 -26.018 -2.363 -3.828 1.00 13.33 N -ATOM 4155 CA HIS D 117 -27.076 -3.136 -4.425 1.00 15.24 C -ATOM 4156 C HIS D 117 -27.870 -3.712 -3.255 1.00 17.50 C -ATOM 4157 O HIS D 117 -29.133 -3.855 -3.315 1.00 16.06 O -ATOM 4158 CB HIS D 117 -26.496 -4.135 -5.434 1.00 17.22 C -ATOM 4159 CG HIS D 117 -27.385 -4.774 -6.024 1.00 54.91 C -ATOM 4160 ND1 HIS D 117 -28.250 -3.991 -7.312 1.00 47.40 N -ATOM 4161 CD2 HIS D 117 -28.517 -5.901 -5.930 1.00 49.34 C -ATOM 4162 CE1 HIS D 117 -29.253 -5.278 -7.522 1.00 48.36 C -ATOM 4163 NE2 HIS D 117 -29.230 -6.041 -6.924 1.00 37.10 N -ATOM 4164 N PHE D 118 -27.360 -4.464 -2.297 1.00 14.50 N -ATOM 4165 CA PHE D 118 -28.031 -5.299 -1.218 1.00 19.30 C -ATOM 4166 C PHE D 118 -28.313 -4.501 -0.028 1.00 20.52 C -ATOM 4167 O PHE D 118 -29.066 -5.081 0.915 1.00 18.09 O -ATOM 4168 CB PHE D 118 -27.213 -6.481 -0.908 1.00 18.97 C -ATOM 4169 CG PHE D 118 -27.223 -7.413 -2.204 1.00 18.93 C -ATOM 4170 CD1 PHE D 118 -26.304 -7.801 -3.109 1.00 24.34 C -ATOM 4171 CD2 PHE D 118 -28.509 -8.118 -2.367 1.00 26.48 C -ATOM 4172 CE1 PHE D 118 -26.170 -8.548 -4.227 1.00 20.81 C -ATOM 4173 CE2 PHE D 118 -28.524 -8.992 -3.636 1.00 22.90 C -ATOM 4174 CZ PHE D 118 -27.563 -8.928 -4.575 1.00 38.52 C -ATOM 4175 N GLY D 119 -27.754 -3.376 0.316 1.00 12.95 N -ATOM 4176 CA GLY D 119 -28.196 -2.563 1.458 1.00 17.60 C -ATOM 4177 C GLY D 119 -27.642 -3.404 2.740 1.00 22.58 C -ATOM 4178 O GLY D 119 -26.745 -4.123 2.946 1.00 17.60 O -ATOM 4179 N LYS D 120 -28.738 -3.418 3.697 1.00 21.46 N -ATOM 4180 CA LYS D 120 -28.403 -3.844 5.025 1.00 20.05 C -ATOM 4181 C LYS D 120 -28.472 -5.257 5.045 1.00 21.98 C -ATOM 4182 O LYS D 120 -27.730 -5.889 5.925 1.00 18.57 O -ATOM 4183 CB LYS D 120 -29.674 -3.273 5.899 1.00 27.28 C -ATOM 4184 CG LYS D 120 -30.525 -4.321 5.995 1.00 44.07 C -ATOM 4185 CD LYS D 120 -31.907 -4.631 6.867 1.00 48.21 C -ATOM 4186 CE LYS D 120 -33.041 -5.118 5.873 1.00 53.23 C -ATOM 4187 NZ LYS D 120 -34.578 -6.152 7.224 1.00 62.54 N -ATOM 4188 N GLU D 121 -28.504 -6.080 4.008 1.00 25.88 N -ATOM 4189 CA GLU D 121 -28.273 -7.343 3.934 1.00 20.02 C -ATOM 4190 C GLU D 121 -26.675 -7.822 3.749 1.00 18.96 C -ATOM 4191 O GLU D 121 -26.335 -8.975 4.074 1.00 16.05 O -ATOM 4192 CB GLU D 121 -29.032 -8.153 2.527 1.00 28.13 C -ATOM 4193 CG GLU D 121 -28.995 -9.238 2.561 1.00 40.20 C -ATOM 4194 CD GLU D 121 -30.346 -10.237 1.461 1.00 49.97 C -ATOM 4195 OE1 GLU D 121 -29.357 -11.293 1.004 1.00 36.73 O -ATOM 4196 OE2 GLU D 121 -30.336 -9.346 0.552 1.00 38.86 O -ATOM 4197 N PHE D 122 -26.073 -6.783 3.271 1.00 14.83 N -ATOM 4198 CA PHE D 122 -24.573 -7.060 3.133 1.00 20.37 C -ATOM 4199 C PHE D 122 -23.961 -6.641 4.530 1.00 15.94 C -ATOM 4200 O PHE D 122 -23.307 -5.592 4.698 1.00 17.73 O -ATOM 4201 CB PHE D 122 -24.256 -6.093 2.128 1.00 14.63 C -ATOM 4202 CG PHE D 122 -22.862 -6.484 1.494 1.00 12.39 C -ATOM 4203 CD1 PHE D 122 -22.569 -7.575 0.927 1.00 14.73 C -ATOM 4204 CD2 PHE D 122 -21.593 -5.712 1.717 1.00 15.96 C -ATOM 4205 CE1 PHE D 122 -21.227 -8.021 0.354 1.00 19.03 C -ATOM 4206 CE2 PHE D 122 -20.268 -6.011 1.383 1.00 16.31 C -ATOM 4207 CZ PHE D 122 -20.290 -7.145 0.714 1.00 19.86 C -ATOM 4208 N THR D 123 -24.154 -7.525 5.413 1.00 12.54 N -ATOM 4209 CA THR D 123 -23.654 -7.132 6.808 1.00 13.34 C -ATOM 4210 C THR D 123 -22.221 -7.283 6.854 1.00 15.73 C -ATOM 4211 O THR D 123 -21.546 -7.802 6.060 1.00 13.84 O -ATOM 4212 CB THR D 123 -24.160 -8.212 7.778 1.00 17.72 C -ATOM 4213 OG1 THR D 123 -23.892 -9.520 7.414 1.00 19.04 O -ATOM 4214 CG2 THR D 123 -25.951 -8.264 7.657 1.00 20.06 C -ATOM 4215 N PRO D 124 -21.722 -6.789 8.010 1.00 17.46 N -ATOM 4216 CA PRO D 124 -20.251 -6.940 8.311 1.00 14.41 C -ATOM 4217 C PRO D 124 -19.706 -8.259 8.132 1.00 12.05 C -ATOM 4218 O PRO D 124 -18.668 -8.405 7.486 1.00 13.28 O -ATOM 4219 CB PRO D 124 -20.088 -6.243 9.615 1.00 14.54 C -ATOM 4220 CG PRO D 124 -21.223 -5.227 9.715 1.00 15.93 C -ATOM 4221 CD PRO D 124 -22.358 -6.045 9.113 1.00 14.57 C -ATOM 4222 N PRO D 125 -20.257 -9.372 8.599 1.00 11.40 N -ATOM 4223 CA PRO D 125 -19.807 -10.596 8.366 1.00 17.87 C -ATOM 4224 C PRO D 125 -19.690 -11.236 6.993 1.00 15.21 C -ATOM 4225 O PRO D 125 -18.781 -11.857 6.488 1.00 14.41 O -ATOM 4226 CB PRO D 125 -20.651 -11.465 9.240 1.00 23.30 C -ATOM 4227 CG PRO D 125 -21.148 -10.683 10.183 1.00 26.37 C -ATOM 4228 CD PRO D 125 -21.413 -9.462 9.802 1.00 17.49 C -ATOM 4229 N VAL D 126 -20.833 -10.714 6.263 1.00 17.66 N -ATOM 4230 CA VAL D 126 -20.828 -11.114 4.812 1.00 21.55 C -ATOM 4231 C VAL D 126 -19.574 -10.424 3.938 1.00 16.49 C -ATOM 4232 O VAL D 126 -19.053 -10.988 3.156 1.00 13.46 O -ATOM 4233 CB VAL D 126 -22.452 -10.640 4.161 1.00 13.98 C -ATOM 4234 CG1 VAL D 126 -22.335 -11.055 2.842 1.00 20.70 C -ATOM 4235 CG2 VAL D 126 -23.218 -11.661 4.994 1.00 18.54 C -ATOM 4236 N GLN D 127 -19.567 -8.990 4.377 1.00 10.60 N -ATOM 4237 CA GLN D 127 -18.404 -8.336 3.872 1.00 12.83 C -ATOM 4238 C GLN D 127 -17.168 -9.034 3.964 1.00 13.74 C -ATOM 4239 O GLN D 127 -16.333 -9.154 3.044 1.00 12.71 O -ATOM 4240 CB GLN D 127 -18.494 -6.875 4.230 1.00 11.73 C -ATOM 4241 CG GLN D 127 -17.167 -6.142 3.667 1.00 13.68 C -ATOM 4242 CD GLN D 127 -16.957 -4.845 4.400 1.00 11.81 C -ATOM 4243 OE1 GLN D 127 -17.847 -4.243 5.015 1.00 13.99 O -ATOM 4244 NE2 GLN D 127 -15.920 -4.250 3.871 1.00 15.96 N -ATOM 4245 N ALA D 128 -16.860 -9.470 5.254 1.00 12.61 N -ATOM 4246 CA ALA D 128 -15.629 -10.118 5.636 1.00 9.64 C -ATOM 4247 C ALA D 128 -15.294 -11.332 4.779 1.00 7.66 C -ATOM 4248 O ALA D 128 -14.216 -11.498 4.302 1.00 11.68 O -ATOM 4249 CB ALA D 128 -15.618 -10.468 7.105 1.00 13.80 C -ATOM 4250 N ALA D 129 -16.442 -11.965 4.516 1.00 13.18 N -ATOM 4251 CA ALA D 129 -16.351 -13.231 3.750 1.00 11.17 C -ATOM 4252 C ALA D 129 -15.929 -12.840 2.277 1.00 11.52 C -ATOM 4253 O ALA D 129 -15.098 -13.537 1.657 1.00 13.56 O -ATOM 4254 CB ALA D 129 -17.591 -14.039 3.811 1.00 14.35 C -ATOM 4255 N TYR D 130 -16.661 -11.959 1.697 1.00 13.36 N -ATOM 4256 CA TYR D 130 -16.475 -11.445 0.343 1.00 13.72 C -ATOM 4257 C TYR D 130 -15.053 -10.791 0.256 1.00 15.10 C -ATOM 4258 O TYR D 130 -14.355 -11.020 -0.750 1.00 13.21 O -ATOM 4259 CB TYR D 130 -17.422 -10.440 -0.057 1.00 13.30 C -ATOM 4260 CG TYR D 130 -18.539 -11.158 -0.682 1.00 15.19 C -ATOM 4261 CD1 TYR D 130 -18.456 -11.539 -1.989 1.00 16.58 C -ATOM 4262 CD2 TYR D 130 -19.661 -11.646 -0.093 1.00 11.73 C -ATOM 4263 CE1 TYR D 130 -19.348 -12.381 -2.950 1.00 20.28 C -ATOM 4264 CE2 TYR D 130 -20.692 -12.412 -0.867 1.00 14.90 C -ATOM 4265 CZ TYR D 130 -20.584 -12.824 -2.071 1.00 22.05 C -ATOM 4266 OH TYR D 130 -21.522 -13.470 -2.725 1.00 20.92 O -ATOM 4267 N GLN D 131 -14.583 -10.235 1.300 1.00 12.24 N -ATOM 4268 CA GLN D 131 -13.174 -9.715 1.275 1.00 13.72 C -ATOM 4269 C GLN D 131 -12.128 -10.656 1.064 1.00 20.69 C -ATOM 4270 O GLN D 131 -11.251 -10.668 0.401 1.00 17.83 O -ATOM 4271 CB GLN D 131 -12.830 -8.708 2.421 1.00 13.45 C -ATOM 4272 CG GLN D 131 -13.616 -7.579 2.534 1.00 20.19 C -ATOM 4273 CD GLN D 131 -13.161 -6.166 1.573 1.00 18.43 C -ATOM 4274 OE1 GLN D 131 -14.035 -5.385 1.692 1.00 14.48 O -ATOM 4275 NE2 GLN D 131 -12.233 -6.377 0.841 1.00 16.06 N -ATOM 4276 N LYS D 132 -12.389 -11.876 1.744 1.00 12.67 N -ATOM 4277 CA LYS D 132 -11.377 -12.991 1.725 1.00 15.63 C -ATOM 4278 C LYS D 132 -11.407 -13.587 0.293 1.00 18.80 C -ATOM 4279 O LYS D 132 -10.481 -13.843 -0.328 1.00 14.05 O -ATOM 4280 CB LYS D 132 -11.780 -14.083 2.621 1.00 24.81 C -ATOM 4281 CG LYS D 132 -11.356 -13.759 4.081 1.00 25.97 C -ATOM 4282 CD LYS D 132 -11.952 -14.985 5.007 1.00 26.81 C -ATOM 4283 CE LYS D 132 -12.396 -14.023 6.345 1.00 50.23 C -ATOM 4284 NZ LYS D 132 -12.099 -16.364 7.125 1.00 63.38 N -ATOM 4285 N VAL D 133 -12.646 -13.574 -0.320 1.00 13.42 N -ATOM 4286 CA VAL D 133 -12.819 -14.186 -1.656 1.00 18.27 C -ATOM 4287 C VAL D 133 -12.113 -13.235 -2.641 1.00 19.39 C -ATOM 4288 O VAL D 133 -11.376 -13.757 -3.529 1.00 15.06 O -ATOM 4289 CB VAL D 133 -14.347 -14.459 -2.009 1.00 17.40 C -ATOM 4290 CG1 VAL D 133 -14.482 -14.527 -3.527 1.00 22.79 C -ATOM 4291 CG2 VAL D 133 -14.897 -15.429 -1.020 1.00 19.90 C -ATOM 4292 N VAL D 134 -12.419 -12.044 -2.631 1.00 14.66 N -ATOM 4293 CA VAL D 134 -11.817 -11.184 -3.697 1.00 17.41 C -ATOM 4294 C VAL D 134 -10.205 -10.998 -3.622 1.00 17.93 C -ATOM 4295 O VAL D 134 -9.555 -11.088 -4.632 1.00 17.13 O -ATOM 4296 CB VAL D 134 -12.523 -9.795 -3.826 1.00 16.69 C -ATOM 4297 CG1 VAL D 134 -13.942 -9.809 -3.996 1.00 22.42 C -ATOM 4298 CG2 VAL D 134 -12.135 -9.012 -2.596 1.00 16.30 C -ATOM 4299 N ALA D 135 -9.754 -11.116 -2.425 1.00 16.25 N -ATOM 4300 CA ALA D 135 -8.338 -11.031 -2.088 1.00 14.79 C -ATOM 4301 C ALA D 135 -7.743 -12.494 -2.790 1.00 21.70 C -ATOM 4302 O ALA D 135 -6.667 -12.571 -3.342 1.00 16.89 O -ATOM 4303 CB ALA D 135 -7.946 -11.087 -0.719 1.00 18.34 C -ATOM 4304 N GLY D 136 -8.430 -13.631 -2.593 1.00 17.40 N -ATOM 4305 CA GLY D 136 -8.238 -14.854 -2.994 1.00 16.77 C -ATOM 4306 C GLY D 136 -8.046 -14.863 -4.547 1.00 21.35 C -ATOM 4307 O GLY D 136 -7.103 -15.386 -5.248 1.00 16.80 O -ATOM 4308 N VAL D 137 -9.061 -14.287 -5.106 1.00 23.70 N -ATOM 4309 CA VAL D 137 -9.117 -14.207 -6.516 1.00 26.49 C -ATOM 4310 C VAL D 137 -8.271 -13.386 -7.311 1.00 33.07 C -ATOM 4311 O VAL D 137 -7.434 -13.729 -8.023 1.00 30.90 O -ATOM 4312 CB VAL D 137 -10.635 -13.731 -7.203 1.00 15.94 C -ATOM 4313 CG1 VAL D 137 -10.606 -13.355 -8.722 1.00 21.57 C -ATOM 4314 CG2 VAL D 137 -11.540 -14.757 -6.690 1.00 21.46 C -ATOM 4315 N ALA D 138 -7.804 -12.254 -6.635 1.00 14.66 N -ATOM 4316 CA ALA D 138 -6.688 -11.339 -7.074 1.00 18.95 C -ATOM 4317 C ALA D 138 -5.417 -12.079 -7.070 1.00 18.17 C -ATOM 4318 O ALA D 138 -4.593 -11.997 -7.851 1.00 14.81 O -ATOM 4319 CB ALA D 138 -6.540 -10.040 -6.183 1.00 19.78 C -ATOM 4320 N ASN D 139 -5.187 -12.811 -5.928 1.00 15.30 N -ATOM 4321 CA ASN D 139 -3.937 -13.374 -5.586 1.00 18.41 C -ATOM 4322 C ASN D 139 -3.703 -14.483 -6.697 1.00 25.63 C -ATOM 4323 O ASN D 139 -2.635 -14.913 -7.329 1.00 23.38 O -ATOM 4324 CB ASN D 139 -3.989 -14.050 -4.592 1.00 50.89 C -ATOM 4325 CG ASN D 139 -3.194 -13.790 -3.503 1.00 63.06 C -ATOM 4326 OD1 ASN D 139 -2.135 -15.017 -3.938 1.00 52.41 O -ATOM 4327 ND2 ASN D 139 -3.072 -12.228 -3.482 1.00 29.84 N -ATOM 4328 N ALA D 140 -4.873 -15.260 -6.949 1.00 19.40 N -ATOM 4329 CA ALA D 140 -5.005 -16.402 -7.986 1.00 23.09 C -ATOM 4330 C ALA D 140 -4.740 -15.710 -9.403 1.00 18.16 C -ATOM 4331 O ALA D 140 -3.930 -16.420 -10.089 1.00 16.51 O -ATOM 4332 CB ALA D 140 -6.303 -16.997 -8.071 1.00 18.14 C -ATOM 4333 N LEU D 141 -5.172 -14.659 -9.775 1.00 14.97 N -ATOM 4334 CA LEU D 141 -4.899 -14.068 -11.011 1.00 14.94 C -ATOM 4335 C LEU D 141 -3.434 -13.602 -11.198 1.00 11.73 C -ATOM 4336 O LEU D 141 -2.840 -13.285 -12.242 1.00 15.21 O -ATOM 4337 CB LEU D 141 -6.006 -12.939 -11.311 1.00 15.16 C -ATOM 4338 CG LEU D 141 -7.325 -13.394 -11.757 1.00 17.87 C -ATOM 4339 CD1 LEU D 141 -7.836 -12.121 -12.278 1.00 24.86 C -ATOM 4340 CD2 LEU D 141 -6.860 -13.940 -13.382 1.00 16.07 C -ATOM 4341 N ALA D 142 -2.826 -13.097 -10.036 1.00 14.26 N -ATOM 4342 CA ALA D 142 -1.439 -12.718 -10.054 1.00 17.21 C -ATOM 4343 C ALA D 142 -0.379 -13.783 -9.991 1.00 18.46 C -ATOM 4344 O ALA D 142 0.751 -13.412 -10.228 1.00 18.92 O -ATOM 4345 CB ALA D 142 -1.279 -11.774 -8.892 1.00 19.11 C -ATOM 4346 N HIS D 143 -0.748 -15.020 -9.767 1.00 19.75 N -ATOM 4347 CA HIS D 143 0.079 -16.200 -9.518 1.00 26.63 C -ATOM 4348 C HIS D 143 1.176 -16.436 -10.670 1.00 23.72 C -ATOM 4349 O HIS D 143 2.224 -16.803 -10.136 1.00 24.41 O -ATOM 4350 CB HIS D 143 -0.669 -17.339 -8.942 1.00 25.89 C -ATOM 4351 CG HIS D 143 0.097 -18.406 -8.683 1.00 56.45 C -ATOM 4352 ND1 HIS D 143 0.122 -19.475 -9.292 1.00 44.25 N -ATOM 4353 CD2 HIS D 143 1.035 -18.261 -7.098 1.00 48.81 C -ATOM 4354 CE1 HIS D 143 1.293 -20.089 -8.356 1.00 56.93 C -ATOM 4355 NE2 HIS D 143 1.407 -19.517 -7.123 1.00 49.27 N -ATOM 4356 N LYS D 144 0.773 -16.313 -11.824 1.00 19.26 N -ATOM 4357 CA LYS D 144 1.442 -16.574 -13.172 1.00 33.94 C -ATOM 4358 C LYS D 144 2.421 -15.633 -13.479 1.00 32.28 C -ATOM 4359 O LYS D 144 2.996 -15.637 -14.654 1.00 23.60 O -ATOM 4360 CB LYS D 144 1.055 -17.526 -13.968 1.00 31.20 C -ATOM 4361 CG LYS D 144 0.220 -18.870 -13.388 1.00 40.85 C -ATOM 4362 CD LYS D 144 1.002 -19.972 -13.512 1.00 59.03 C -ATOM 4363 CE LYS D 144 0.888 -21.048 -13.306 1.00 56.19 C -ATOM 4364 NZ LYS D 144 1.510 -22.846 -14.338 1.00 70.96 N -ATOM 4365 N TYR D 145 2.435 -14.424 -12.946 1.00 24.92 N -ATOM 4366 CA TYR D 145 3.207 -13.372 -13.244 1.00 29.13 C -ATOM 4367 C TYR D 145 4.717 -13.524 -13.102 1.00 38.17 C -ATOM 4368 O TYR D 145 5.061 -14.114 -12.139 1.00 27.99 O -ATOM 4369 CB TYR D 145 2.744 -12.016 -12.590 1.00 17.99 C -ATOM 4370 CG TYR D 145 1.621 -11.268 -13.262 1.00 17.42 C -ATOM 4371 CD1 TYR D 145 1.523 -10.110 -13.925 1.00 16.93 C -ATOM 4372 CD2 TYR D 145 0.375 -12.020 -13.134 1.00 18.60 C -ATOM 4373 CE1 TYR D 145 0.498 -9.521 -14.492 1.00 17.99 C -ATOM 4374 CE2 TYR D 145 -0.813 -11.356 -13.802 1.00 14.96 C -ATOM 4375 CZ TYR D 145 -0.763 -10.275 -14.381 1.00 12.85 C -ATOM 4376 OH TYR D 145 -1.813 -9.580 -14.987 1.00 13.31 O -ATOM 4377 N HIS D 146 5.428 -13.165 -14.072 1.00 26.11 N -ATOM 4378 CA HIS D 146 7.054 -13.167 -14.050 1.00 31.89 C -ATOM 4379 C HIS D 146 7.429 -12.153 -15.048 1.00 21.33 C -ATOM 4380 O HIS D 146 6.931 -11.249 -15.530 1.00 27.92 O -ATOM 4381 CB HIS D 146 7.223 -14.769 -14.665 1.00 30.13 C -ATOM 4382 CG HIS D 146 6.497 -14.789 -15.882 1.00 40.51 C -ATOM 4383 ND1 HIS D 146 7.552 -14.702 -17.398 1.00 47.51 N -ATOM 4384 CD2 HIS D 146 5.784 -14.325 -16.776 1.00 45.49 C -ATOM 4385 CE1 HIS D 146 7.188 -14.800 -17.949 1.00 56.67 C -ATOM 4386 NE2 HIS D 146 5.714 -14.339 -18.353 1.00 37.33 N -ATOM 4387 OXT HIS D 146 8.812 -12.134 -14.847 1.00 21.61 O -TER 4388 HIS D 146 -HETATM 4389 FE HEM A 142 8.116 7.403 -15.045 1.00 18.07 FE -HETATM 4390 CHA HEM A 142 8.585 7.902 -18.282 1.00 16.31 C -HETATM 4391 CHB HEM A 142 10.355 9.805 -14.208 1.00 26.27 C -HETATM 4392 CHC HEM A 142 8.341 6.363 -11.589 1.00 13.23 C -HETATM 4393 CHD HEM A 142 6.988 4.088 -15.744 1.00 14.77 C -HETATM 4394 NA HEM A 142 9.397 8.686 -16.211 1.00 16.46 N -HETATM 4395 C1A HEM A 142 9.141 8.725 -17.504 1.00 17.40 C -HETATM 4396 C2A HEM A 142 10.098 9.952 -17.887 1.00 18.53 C -HETATM 4397 C3A HEM A 142 10.636 10.499 -16.796 1.00 18.36 C -HETATM 4398 C4A HEM A 142 10.137 9.679 -15.611 1.00 16.88 C -HETATM 4399 CMA HEM A 142 11.613 11.590 -16.732 1.00 21.20 C -HETATM 4400 CAA HEM A 142 10.403 10.367 -19.312 1.00 25.54 C -HETATM 4401 CBA HEM A 142 9.552 11.270 -19.659 1.00 31.38 C -HETATM 4402 CGA HEM A 142 10.793 12.286 -21.342 1.00 44.82 C -HETATM 4403 O1A HEM A 142 9.887 11.345 -21.943 1.00 39.10 O -HETATM 4404 O2A HEM A 142 9.308 12.698 -21.487 1.00 54.71 O -HETATM 4405 NB HEM A 142 9.343 8.012 -13.298 1.00 12.29 N -HETATM 4406 C1B HEM A 142 9.938 9.271 -13.145 1.00 23.63 C -HETATM 4407 C2B HEM A 142 10.318 9.380 -11.838 1.00 11.67 C -HETATM 4408 C3B HEM A 142 9.660 8.341 -11.052 1.00 17.41 C -HETATM 4409 C4B HEM A 142 9.028 7.467 -11.975 1.00 14.84 C -HETATM 4410 CMB HEM A 142 11.048 10.634 -11.389 1.00 12.32 C -HETATM 4411 CAB HEM A 142 9.567 8.336 -9.634 1.00 24.30 C -HETATM 4412 CBB HEM A 142 10.576 8.441 -8.785 1.00 28.40 C -HETATM 4413 NC HEM A 142 7.604 5.533 -13.949 1.00 15.07 N -HETATM 4414 C1C HEM A 142 7.680 5.498 -12.499 1.00 13.39 C -HETATM 4415 C2C HEM A 142 7.270 4.198 -12.170 1.00 11.20 C -HETATM 4416 C3C HEM A 142 6.975 3.441 -13.304 1.00 8.94 C -HETATM 4417 C4C HEM A 142 7.207 4.445 -14.517 1.00 10.29 C -HETATM 4418 CMC HEM A 142 7.098 3.618 -10.845 1.00 13.77 C -HETATM 4419 CAC HEM A 142 6.342 2.184 -13.525 1.00 13.45 C -HETATM 4420 CBC HEM A 142 6.722 1.153 -12.766 1.00 11.27 C -HETATM 4421 ND HEM A 142 7.715 6.202 -16.788 1.00 13.07 N -HETATM 4422 C1D HEM A 142 7.302 4.989 -16.733 1.00 11.32 C -HETATM 4423 C2D HEM A 142 7.141 4.644 -18.240 1.00 16.69 C -HETATM 4424 C3D HEM A 142 7.540 5.718 -18.887 1.00 20.49 C -HETATM 4425 C4D HEM A 142 8.172 6.582 -18.158 1.00 16.46 C -HETATM 4426 CMD HEM A 142 6.354 3.385 -18.817 1.00 19.45 C -HETATM 4427 CAD HEM A 142 7.621 5.740 -20.408 1.00 21.31 C -HETATM 4428 CBD HEM A 142 8.764 5.354 -20.767 1.00 38.22 C -HETATM 4429 CGD HEM A 142 9.138 5.049 -22.798 1.00 41.21 C -HETATM 4430 O1D HEM A 142 9.998 5.836 -22.703 1.00 42.81 O -HETATM 4431 O2D HEM A 142 8.349 4.920 -23.144 1.00 40.12 O -HETATM 4432 P PO4 B 147 5.931 -21.573 3.319 1.00 32.97 P -HETATM 4433 FE HEM B 148 9.333 -9.335 17.389 1.00 15.00 FE -HETATM 4434 CHA HEM B 148 9.659 -10.155 20.773 1.00 21.59 C -HETATM 4435 CHB HEM B 148 11.121 -12.190 16.575 1.00 16.50 C -HETATM 4436 CHC HEM B 148 9.762 -8.175 14.122 1.00 16.82 C -HETATM 4437 CHD HEM B 148 8.223 -6.187 18.294 1.00 16.19 C -HETATM 4438 NA HEM B 148 10.260 -10.823 18.453 1.00 15.64 N -HETATM 4439 C1A HEM B 148 10.199 -10.977 19.856 1.00 24.57 C -HETATM 4440 C2A HEM B 148 10.940 -12.186 20.114 1.00 17.10 C -HETATM 4441 C3A HEM B 148 11.529 -12.852 19.028 1.00 13.46 C -HETATM 4442 C4A HEM B 148 10.911 -11.942 17.916 1.00 18.78 C -HETATM 4443 CMA HEM B 148 12.211 -14.084 18.855 1.00 20.21 C -HETATM 4444 CAA HEM B 148 11.171 -12.750 21.554 1.00 21.16 C -HETATM 4445 CBA HEM B 148 10.089 -13.674 21.941 1.00 27.78 C -HETATM 4446 CGA HEM B 148 9.936 -14.643 23.585 1.00 59.12 C -HETATM 4447 O1A HEM B 148 10.040 -13.299 24.151 1.00 44.32 O -HETATM 4448 O2A HEM B 148 9.582 -15.171 23.405 1.00 46.16 O -HETATM 4449 NB HEM B 148 10.199 -10.051 15.722 1.00 12.71 N -HETATM 4450 C1B HEM B 148 10.820 -11.284 15.524 1.00 10.36 C -HETATM 4451 C2B HEM B 148 11.247 -11.528 14.048 1.00 7.33 C -HETATM 4452 C3B HEM B 148 10.827 -10.448 13.495 1.00 15.63 C -HETATM 4453 C4B HEM B 148 10.176 -9.458 14.534 1.00 15.33 C -HETATM 4454 CMB HEM B 148 11.793 -12.748 13.802 1.00 14.96 C -HETATM 4455 CAB HEM B 148 10.965 -10.083 11.934 1.00 19.63 C -HETATM 4456 CBB HEM B 148 12.063 -10.466 11.288 1.00 39.39 C -HETATM 4457 NC HEM B 148 9.104 -7.643 16.544 1.00 11.22 N -HETATM 4458 C1C HEM B 148 9.223 -7.280 15.193 1.00 14.39 C -HETATM 4459 C2C HEM B 148 8.943 -5.947 14.698 1.00 10.78 C -HETATM 4460 C3C HEM B 148 8.461 -5.188 15.934 1.00 10.68 C -HETATM 4461 C4C HEM B 148 8.575 -6.422 16.809 1.00 8.70 C -HETATM 4462 CMC HEM B 148 9.067 -5.306 13.381 1.00 13.95 C -HETATM 4463 CAC HEM B 148 7.915 -3.899 16.132 1.00 11.87 C -HETATM 4464 CBC HEM B 148 8.359 -2.863 15.599 1.00 12.63 C -HETATM 4465 ND HEM B 148 9.090 -8.239 19.067 1.00 16.72 N -HETATM 4466 C1D HEM B 148 8.576 -7.046 19.346 1.00 18.32 C -HETATM 4467 C2D HEM B 148 8.195 -6.791 20.753 1.00 15.48 C -HETATM 4468 C3D HEM B 148 8.512 -8.051 21.256 1.00 14.57 C -HETATM 4469 C4D HEM B 148 9.290 -8.905 20.340 1.00 20.76 C -HETATM 4470 CMD HEM B 148 7.722 -5.449 21.269 1.00 27.50 C -HETATM 4471 CAD HEM B 148 8.696 -7.989 22.865 1.00 13.85 C -HETATM 4472 CBD HEM B 148 10.051 -7.739 23.453 1.00 17.11 C -HETATM 4473 CGD HEM B 148 10.333 -8.222 25.219 1.00 27.09 C -HETATM 4474 O1D HEM B 148 11.372 -7.572 25.386 1.00 27.49 O -HETATM 4475 O2D HEM B 148 9.169 -8.132 25.625 1.00 23.65 O -HETATM 4476 FE HEM C 142 -8.129 7.348 15.002 1.00 16.89 FE -HETATM 4477 CHA HEM C 142 -8.630 7.776 18.352 1.00 18.96 C -HETATM 4478 CHB HEM C 142 -10.320 10.048 14.384 1.00 20.49 C -HETATM 4479 CHC HEM C 142 -8.304 6.446 11.794 1.00 15.25 C -HETATM 4480 CHD HEM C 142 -6.900 4.052 15.698 1.00 14.70 C -HETATM 4481 NA HEM C 142 -9.276 8.702 16.089 1.00 16.55 N -HETATM 4482 C1A HEM C 142 -9.195 8.664 17.417 1.00 16.72 C -HETATM 4483 C2A HEM C 142 -10.045 9.791 17.916 1.00 15.73 C -HETATM 4484 C3A HEM C 142 -10.613 10.462 16.942 1.00 17.27 C -HETATM 4485 C4A HEM C 142 -10.077 9.749 15.710 1.00 12.07 C -HETATM 4486 CMA HEM C 142 -11.422 11.658 16.756 1.00 31.88 C -HETATM 4487 CAA HEM C 142 -10.321 10.351 19.308 1.00 24.60 C -HETATM 4488 CBA HEM C 142 -9.201 11.341 19.696 1.00 36.28 C -HETATM 4489 CGA HEM C 142 -10.014 12.024 21.724 1.00 43.70 C -HETATM 4490 O1A HEM C 142 -9.511 10.786 22.089 1.00 38.93 O -HETATM 4491 O2A HEM C 142 -9.503 12.583 21.415 1.00 46.28 O -HETATM 4492 NB HEM C 142 -9.138 8.185 13.333 1.00 12.79 N -HETATM 4493 C1B HEM C 142 -9.882 9.419 13.260 1.00 18.45 C -HETATM 4494 C2B HEM C 142 -10.342 9.474 11.782 1.00 12.95 C -HETATM 4495 C3B HEM C 142 -9.631 8.558 11.160 1.00 12.49 C -HETATM 4496 C4B HEM C 142 -8.945 7.665 12.157 1.00 8.33 C -HETATM 4497 CMB HEM C 142 -11.015 10.631 11.441 1.00 15.16 C -HETATM 4498 CAB HEM C 142 -9.701 8.335 9.552 1.00 21.83 C -HETATM 4499 CBB HEM C 142 -10.742 8.875 9.052 1.00 33.11 C -HETATM 4500 NC HEM C 142 -7.518 5.627 13.990 1.00 12.28 N -HETATM 4501 C1C HEM C 142 -7.751 5.629 12.596 1.00 15.97 C -HETATM 4502 C2C HEM C 142 -7.320 4.232 12.130 1.00 9.41 C -HETATM 4503 C3C HEM C 142 -6.879 3.543 13.304 1.00 11.73 C -HETATM 4504 C4C HEM C 142 -7.009 4.441 14.484 1.00 15.36 C -HETATM 4505 CMC HEM C 142 -7.210 3.774 10.722 1.00 13.23 C -HETATM 4506 CAC HEM C 142 -6.459 2.233 13.437 1.00 19.55 C -HETATM 4507 CBC HEM C 142 -6.761 1.082 12.572 1.00 14.52 C -HETATM 4508 ND HEM C 142 -7.740 6.303 16.793 1.00 12.30 N -HETATM 4509 C1D HEM C 142 -7.305 4.996 16.751 1.00 11.54 C -HETATM 4510 C2D HEM C 142 -6.959 4.620 18.250 1.00 12.94 C -HETATM 4511 C3D HEM C 142 -7.527 5.654 18.907 1.00 11.38 C -HETATM 4512 C4D HEM C 142 -7.947 6.663 18.081 1.00 11.29 C -HETATM 4513 CMD HEM C 142 -6.299 3.375 18.648 1.00 13.29 C -HETATM 4514 CAD HEM C 142 -7.594 5.618 20.504 1.00 15.84 C -HETATM 4515 CBD HEM C 142 -8.833 5.076 20.877 1.00 21.27 C -HETATM 4516 CGD HEM C 142 -9.085 5.314 22.774 1.00 26.94 C -HETATM 4517 O1D HEM C 142 -10.036 5.486 22.824 1.00 30.21 O -HETATM 4518 O2D HEM C 142 -8.326 4.541 23.113 1.00 25.95 O -HETATM 4519 P PO4 D 147 -6.147 -21.111 -3.332 1.00 31.17 P -HETATM 4520 FE HEM D 148 -9.504 -9.265 -17.387 1.00 15.46 FE -HETATM 4521 CHA HEM D 148 -9.813 -9.884 -20.599 1.00 19.84 C -HETATM 4522 CHB HEM D 148 -11.252 -11.989 -16.610 1.00 16.61 C -HETATM 4523 CHC HEM D 148 -9.951 -8.302 -14.119 1.00 13.93 C -HETATM 4524 CHD HEM D 148 -8.200 -5.985 -18.127 1.00 15.88 C -HETATM 4525 NA HEM D 148 -10.454 -10.804 -18.459 1.00 15.98 N -HETATM 4526 C1A HEM D 148 -10.428 -10.865 -19.783 1.00 28.09 C -HETATM 4527 C2A HEM D 148 -11.318 -12.071 -20.258 1.00 22.30 C -HETATM 4528 C3A HEM D 148 -11.693 -12.664 -19.188 1.00 22.59 C -HETATM 4529 C4A HEM D 148 -11.051 -11.756 -18.004 1.00 25.38 C -HETATM 4530 CMA HEM D 148 -12.566 -13.772 -18.973 1.00 20.23 C -HETATM 4531 CAA HEM D 148 -11.486 -12.464 -21.884 1.00 19.24 C -HETATM 4532 CBA HEM D 148 -10.405 -12.971 -22.194 1.00 50.08 C -HETATM 4533 CGA HEM D 148 -9.805 -13.296 -24.484 1.00 47.00 C -HETATM 4534 O1A HEM D 148 -11.117 -13.581 -24.158 1.00 49.99 O -HETATM 4535 O2A HEM D 148 -9.172 -14.946 -24.346 1.00 55.24 O -HETATM 4536 NB HEM D 148 -10.364 -9.999 -15.688 1.00 14.27 N -HETATM 4537 C1B HEM D 148 -10.937 -11.332 -15.462 1.00 14.32 C -HETATM 4538 C2B HEM D 148 -11.232 -11.509 -14.176 1.00 15.75 C -HETATM 4539 C3B HEM D 148 -10.801 -10.525 -13.479 1.00 14.95 C -HETATM 4540 C4B HEM D 148 -10.217 -9.585 -14.421 1.00 12.78 C -HETATM 4541 CMB HEM D 148 -11.799 -12.726 -13.757 1.00 18.74 C -HETATM 4542 CAB HEM D 148 -10.869 -10.291 -11.895 1.00 16.19 C -HETATM 4543 CBB HEM D 148 -11.756 -10.396 -11.494 1.00 34.22 C -HETATM 4544 NC HEM D 148 -9.228 -7.489 -16.235 1.00 12.21 N -HETATM 4545 C1C HEM D 148 -9.469 -7.417 -14.891 1.00 14.15 C -HETATM 4546 C2C HEM D 148 -8.915 -5.898 -14.609 1.00 16.84 C -HETATM 4547 C3C HEM D 148 -8.353 -5.322 -15.741 1.00 13.21 C -HETATM 4548 C4C HEM D 148 -8.605 -6.360 -16.751 1.00 15.07 C -HETATM 4549 CMC HEM D 148 -9.128 -5.229 -13.166 1.00 18.77 C -HETATM 4550 CAC HEM D 148 -7.843 -4.077 -15.916 1.00 13.84 C -HETATM 4551 CBC HEM D 148 -8.331 -3.032 -15.408 1.00 20.77 C -HETATM 4552 ND HEM D 148 -9.282 -8.209 -19.162 1.00 12.94 N -HETATM 4553 C1D HEM D 148 -8.465 -7.065 -19.281 1.00 18.28 C -HETATM 4554 C2D HEM D 148 -8.394 -6.595 -20.574 1.00 20.40 C -HETATM 4555 C3D HEM D 148 -8.861 -7.841 -21.341 1.00 19.16 C -HETATM 4556 C4D HEM D 148 -9.573 -8.702 -20.531 1.00 19.80 C -HETATM 4557 CMD HEM D 148 -7.686 -5.397 -21.106 1.00 25.65 C -HETATM 4558 CAD HEM D 148 -8.956 -7.733 -22.890 1.00 23.94 C -HETATM 4559 CBD HEM D 148 -10.040 -6.949 -23.304 1.00 45.78 C -HETATM 4560 CGD HEM D 148 -10.579 -7.365 -25.200 1.00 48.49 C -HETATM 4561 O1D HEM D 148 -9.907 -5.916 -25.395 1.00 40.71 O -HETATM 4562 O2D HEM D 148 -9.982 -7.978 -25.490 1.00 45.79 O -HETATM 4563 O HOH A 143 27.864 0.667 0.584 1.00 21.15 O -HETATM 4564 O HOH A 144 10.459 5.072 -14.201 1.00 29.96 O -HETATM 4565 O HOH A 145 17.782 -1.325 -26.109 1.00 23.65 O -HETATM 4566 O HOH A 146 13.825 2.114 3.861 1.00 23.17 O -HETATM 4567 O HOH A 147 16.741 12.813 9.083 1.00 26.86 O -HETATM 4568 O HOH A 148 22.374 9.235 11.515 1.00 30.53 O -HETATM 4569 O HOH A 149 25.903 -1.921 -7.245 1.00 27.68 O -HETATM 4570 O HOH A 150 11.472 3.167 0.508 1.00 27.27 O -HETATM 4571 O HOH A 151 30.661 6.822 -0.101 1.00 29.31 O -HETATM 4572 O HOH A 152 -3.585 1.717 -5.969 1.00 29.54 O -HETATM 4573 O HOH A 153 32.341 10.298 6.014 1.00 35.74 O -HETATM 4574 O HOH A 154 34.406 10.442 4.080 1.00 31.58 O -HETATM 4575 O HOH A 155 30.017 0.297 -1.177 1.00 37.73 O -HETATM 4576 O HOH A 156 21.428 14.396 -13.024 1.00 37.58 O -HETATM 4577 O HOH A 157 10.103 6.463 -0.224 1.00 29.83 O -HETATM 4578 O HOH A 158 28.011 -0.672 -5.493 1.00 34.75 O -HETATM 4579 O HOH A 159 12.221 6.676 -21.742 1.00 35.95 O -HETATM 4580 O HOH A 160 0.070 13.369 -11.506 1.00 27.36 O -HETATM 4581 O HOH A 161 6.073 -7.542 -8.224 1.00 27.80 O -HETATM 4582 O HOH A 162 0.959 -1.910 -19.919 1.00 29.65 O -HETATM 4583 O HOH A 163 -5.435 9.067 -14.288 1.00 30.27 O -HETATM 4584 O HOH A 164 3.108 18.897 -10.351 1.00 37.13 O -HETATM 4585 O HOH A 165 9.253 2.690 -0.595 1.00 31.92 O -HETATM 4586 O HOH A 166 3.509 1.516 -20.390 1.00 30.86 O -HETATM 4587 O HOH A 167 7.323 6.472 -2.528 1.00 34.91 O -HETATM 4588 O HOH A 168 8.069 21.100 -2.836 1.00 34.13 O -HETATM 4589 O HOH A 169 22.069 5.076 -17.599 1.00 36.10 O -HETATM 4590 O HOH A 170 12.511 23.031 -13.238 1.00 37.77 O -HETATM 4591 O HOH A 171 27.846 5.439 7.283 1.00 39.01 O -HETATM 4592 O HOH A 172 16.593 -6.697 -7.432 1.00 35.74 O -HETATM 4593 O HOH A 173 19.969 -3.554 -17.319 1.00 36.03 O -HETATM 4594 O HOH A 174 14.440 13.918 -17.292 1.00 34.06 O -HETATM 4595 O HOH A 175 30.151 3.417 -5.741 1.00 35.04 O -HETATM 4596 O HOH A 176 8.360 5.321 2.557 1.00 38.02 O -HETATM 4597 O HOH A 177 -6.479 11.748 -17.967 1.00 39.72 O -HETATM 4598 O HOH A 178 8.608 18.432 -15.341 1.00 36.40 O -HETATM 4599 O HOH A 179 13.827 13.620 8.994 1.00 37.52 O -HETATM 4600 O HOH A 180 16.070 12.039 11.262 1.00 38.53 O -HETATM 4601 O HOH A 181 2.747 5.937 -4.128 1.00 42.85 O -HETATM 4602 O HOH A 182 7.523 20.881 -15.648 1.00 39.27 O -HETATM 4603 O HOH A 183 11.712 -10.960 -5.769 1.00 38.61 O -HETATM 4604 O HOH A 184 30.119 4.139 -8.587 1.00 34.80 O -HETATM 4605 O HOH A 185 25.533 1.205 -11.184 1.00 42.30 O -HETATM 4606 O HOH A 186 -4.812 12.384 -7.265 1.00 38.29 O -HETATM 4607 O HOH A 187 23.809 19.925 1.758 1.00 39.37 O -HETATM 4608 O HOH A 188 26.015 11.766 5.159 1.00 40.95 O -HETATM 4609 O HOH A 189 14.639 24.823 -4.300 1.00 41.35 O -HETATM 4610 O HOH A 190 14.903 5.393 -23.047 1.00 37.45 O -HETATM 4611 O HOH A 191 16.650 -5.137 -16.717 1.00 39.12 O -HETATM 4612 O HOH A 192 7.424 -6.700 -20.085 1.00 38.62 O -HETATM 4613 O HOH A 193 23.120 -3.118 -12.992 1.00 37.05 O -HETATM 4614 O HOH A 194 23.664 0.968 -14.389 1.00 36.25 O -HETATM 4615 O HOH A 195 25.698 7.981 -15.362 1.00 35.85 O -HETATM 4616 O HOH A 196 30.009 16.347 -6.794 1.00 37.62 O -HETATM 4617 O HOH A 197 27.728 16.677 -1.376 1.00 42.54 O -HETATM 4618 O HOH A 198 8.142 18.836 1.041 1.00 39.90 O -HETATM 4619 O HOH B 149 0.093 -2.470 16.222 1.00 21.64 O -HETATM 4620 O HOH B 150 -5.404 -9.289 14.863 1.00 29.94 O -HETATM 4621 O HOH B 151 17.543 -13.863 -8.044 1.00 26.33 O -HETATM 4622 O HOH B 152 10.126 -8.396 -0.639 1.00 27.87 O -HETATM 4623 O HOH B 153 25.765 -4.888 -7.482 1.00 33.60 O -HETATM 4624 O HOH B 154 31.028 -6.924 -0.005 1.00 27.86 O -HETATM 4625 O HOH B 155 10.572 -9.505 7.329 1.00 34.89 O -HETATM 4626 O HOH B 156 2.908 -19.221 10.523 1.00 29.82 O -HETATM 4627 O HOH B 157 27.245 -11.383 -5.263 1.00 34.30 O -HETATM 4628 O HOH B 158 5.726 -17.664 4.076 1.00 29.36 O -HETATM 4629 O HOH B 159 30.677 -1.382 -3.264 1.00 34.23 O -HETATM 4630 O HOH B 160 21.396 -19.202 9.299 1.00 34.06 O -HETATM 4631 O HOH B 161 3.400 -4.625 22.878 1.00 34.98 O -HETATM 4632 O HOH B 162 23.029 7.858 13.868 1.00 34.02 O -HETATM 4633 O HOH B 163 10.054 0.537 2.970 1.00 33.29 O -HETATM 4634 O HOH B 164 16.523 -14.815 19.144 1.00 32.12 O -HETATM 4635 O HOH B 165 -3.521 -7.996 18.788 1.00 35.56 O -HETATM 4636 O HOH B 166 9.429 -6.067 3.140 1.00 34.98 O -HETATM 4637 O HOH B 167 25.800 -14.208 -2.740 1.00 37.65 O -HETATM 4638 O HOH B 168 0.313 -14.430 5.859 1.00 34.45 O -HETATM 4639 O HOH B 169 25.879 -15.224 10.033 1.00 33.37 O -HETATM 4640 O HOH B 170 35.602 -4.153 -9.289 1.00 35.71 O -HETATM 4641 O HOH B 171 20.781 6.254 23.632 1.00 38.68 O -HETATM 4642 O HOH B 172 21.800 -18.543 12.994 1.00 40.56 O -HETATM 4643 O HOH B 173 7.807 -19.735 16.230 1.00 34.56 O -HETATM 4644 O HOH B 174 -2.047 -12.487 30.048 1.00 36.28 O -HETATM 4645 O HOH B 175 13.681 -7.349 23.790 1.00 31.60 O -HETATM 4646 O HOH B 176 24.831 -18.968 5.896 1.00 34.00 O -HETATM 4647 O HOH B 177 5.475 -5.297 23.977 1.00 36.71 O -HETATM 4648 O HOH B 178 15.904 -5.466 24.689 1.00 34.84 O -HETATM 4649 O HOH B 179 22.123 0.182 16.584 1.00 33.20 O -HETATM 4650 O HOH B 180 19.207 -15.705 -9.408 1.00 37.19 O -HETATM 4651 O HOH B 181 25.174 -12.029 -8.381 1.00 35.87 O -HETATM 4652 O HOH B 182 -10.362 -13.333 12.465 1.00 36.08 O -HETATM 4653 O HOH B 183 12.092 8.997 23.297 1.00 38.22 O -HETATM 4654 O HOH B 184 7.727 5.204 22.116 1.00 43.17 O -HETATM 4655 O HOH B 185 30.137 -14.006 10.129 1.00 36.03 O -HETATM 4656 O HOH B 186 13.730 -18.833 14.202 1.00 39.57 O -HETATM 4657 O HOH B 187 22.379 8.870 23.585 1.00 37.45 O -HETATM 4658 O HOH B 188 -4.205 -14.646 8.671 1.00 38.65 O -HETATM 4659 O HOH B 189 12.589 14.261 19.653 1.00 36.93 O -HETATM 4660 O HOH B 190 24.652 6.230 17.996 1.00 42.01 O -HETATM 4661 O HOH B 191 8.775 -23.438 16.055 1.00 42.33 O -HETATM 4662 O HOH B 192 -7.480 -10.898 17.998 1.00 38.06 O -HETATM 4663 O HOH B 193 11.388 -11.044 24.763 1.00 39.34 O -HETATM 4664 O HOH B 194 3.735 -3.643 2.734 1.00 42.17 O -HETATM 4665 O HOH B 195 3.149 -0.692 2.083 1.00 41.40 O -HETATM 4666 O HOH B 196 4.511 -25.886 13.006 1.00 39.83 O -HETATM 4667 O HOH B 197 8.712 -21.655 3.577 1.00 43.08 O -HETATM 4668 O HOH B 198 22.926 -4.304 24.079 1.00 38.10 O -HETATM 4669 O HOH B 199 11.435 9.654 20.618 1.00 40.23 O -HETATM 4670 O HOH B 200 18.099 5.542 27.744 1.00 39.03 O -HETATM 4671 O HOH B 201 12.174 9.951 9.804 1.00 44.34 O -HETATM 4672 O HOH B 202 24.745 -2.501 15.270 1.00 39.78 O -HETATM 4673 O HOH B 203 24.231 0.100 14.764 1.00 42.94 O -HETATM 4674 O HOH B 204 23.324 -18.136 10.981 1.00 53.60 O -HETATM 4675 O HOH B 205 25.576 -22.211 6.309 1.00 45.18 O -HETATM 4676 O HOH C 143 -2.661 -3.608 9.261 1.00 21.26 O -HETATM 4677 O HOH C 144 0.111 13.200 11.373 1.00 21.54 O -HETATM 4678 O HOH C 145 -16.704 12.691 -9.201 1.00 23.30 O -HETATM 4679 O HOH C 146 -13.774 2.466 -4.032 1.00 22.15 O -HETATM 4680 O HOH C 147 5.273 9.077 14.193 1.00 28.02 O -HETATM 4681 O HOH C 148 -11.466 3.494 -0.405 1.00 32.97 O -HETATM 4682 O HOH C 149 -10.454 4.898 14.327 1.00 33.04 O -HETATM 4683 O HOH C 150 -7.824 6.701 2.273 1.00 27.40 O -HETATM 4684 O HOH C 151 -1.248 -1.596 20.098 1.00 29.84 O -HETATM 4685 O HOH C 152 2.150 -0.244 14.446 1.00 30.74 O -HETATM 4686 O HOH C 153 -2.060 18.771 19.773 1.00 29.22 O -HETATM 4687 O HOH C 154 -21.154 14.002 13.362 1.00 32.40 O -HETATM 4688 O HOH C 155 -9.105 3.030 0.663 1.00 28.46 O -HETATM 4689 O HOH C 156 0.739 12.802 4.676 1.00 38.51 O -HETATM 4690 O HOH C 157 -8.549 18.107 15.436 1.00 35.20 O -HETATM 4691 O HOH C 158 -3.358 1.489 20.400 1.00 39.88 O -HETATM 4692 O HOH C 159 -2.351 -4.643 6.766 1.00 36.39 O -HETATM 4693 O HOH C 160 -9.995 6.820 0.255 1.00 29.81 O -HETATM 4694 O HOH C 161 -1.621 21.259 16.530 1.00 33.74 O -HETATM 4695 O HOH C 162 -5.469 23.850 15.062 1.00 31.03 O -HETATM 4696 O HOH C 163 3.572 1.751 6.044 1.00 29.72 O -HETATM 4697 O HOH C 164 -12.295 6.520 21.611 1.00 31.11 O -HETATM 4698 O HOH C 165 -14.251 13.845 17.234 1.00 30.77 O -HETATM 4699 O HOH C 166 -17.414 -5.952 27.962 1.00 34.94 O -HETATM 4700 O HOH C 167 -3.547 16.435 20.027 1.00 34.58 O -HETATM 4701 O HOH C 168 -16.355 -6.652 7.174 1.00 37.69 O -HETATM 4702 O HOH C 169 -7.541 12.855 -2.773 1.00 34.39 O -HETATM 4703 O HOH C 170 -4.225 9.070 1.455 1.00 35.72 O -HETATM 4704 O HOH C 171 -25.974 -1.828 7.173 1.00 32.50 O -HETATM 4705 O HOH C 172 -9.581 -6.364 21.942 1.00 37.91 O -HETATM 4706 O HOH C 173 -14.874 4.521 23.126 1.00 36.81 O -HETATM 4707 O HOH C 174 -15.534 20.875 -10.339 1.00 37.83 O -HETATM 4708 O HOH C 175 -8.242 21.385 2.969 1.00 35.70 O -HETATM 4709 O HOH C 176 -5.634 24.523 6.954 1.00 37.22 O -HETATM 4710 O HOH C 177 -22.981 14.501 -8.660 1.00 34.30 O -HETATM 4711 O HOH C 178 -13.871 16.688 -10.143 1.00 36.92 O -HETATM 4712 O HOH C 179 -20.275 19.235 8.097 1.00 34.30 O -HETATM 4713 O HOH C 180 1.720 15.273 3.670 1.00 39.46 O -HETATM 4714 O HOH C 181 -2.824 18.993 10.315 1.00 37.49 O -HETATM 4715 O HOH C 182 -2.160 0.091 22.111 1.00 39.39 O -HETATM 4716 O HOH C 183 7.922 12.037 14.216 1.00 34.40 O -HETATM 4717 O HOH C 184 -2.698 5.986 4.174 1.00 37.01 O -HETATM 4718 O HOH C 185 6.321 10.115 3.931 1.00 35.17 O -HETATM 4719 O HOH C 186 -7.096 21.140 15.539 1.00 35.39 O -HETATM 4720 O HOH C 187 -10.581 17.364 16.459 1.00 39.95 O -HETATM 4721 O HOH C 188 -4.668 13.050 -0.747 1.00 39.36 O -HETATM 4722 O HOH C 189 -4.764 -6.228 5.515 1.00 40.89 O -HETATM 4723 O HOH C 190 4.693 12.083 7.558 1.00 40.24 O -HETATM 4724 O HOH C 191 -4.731 16.453 2.295 1.00 36.37 O -HETATM 4725 O HOH C 192 -1.055 11.866 -0.448 1.00 43.19 O -HETATM 4726 O HOH C 193 -18.517 -8.355 15.267 1.00 35.55 O -HETATM 4727 O HOH C 194 6.547 9.706 16.296 1.00 41.86 O -HETATM 4728 O HOH C 195 0.029 22.606 14.164 1.00 43.02 O -HETATM 4729 O HOH C 196 -11.367 0.306 28.463 1.00 44.30 O -HETATM 4730 O HOH C 197 -19.950 -10.635 14.301 1.00 40.17 O -HETATM 4731 O HOH C 198 -7.047 -6.324 20.098 1.00 36.98 O -HETATM 4732 O HOH C 199 -23.876 1.108 14.102 1.00 33.31 O -HETATM 4733 O HOH C 200 -34.199 8.033 11.037 1.00 40.72 O -HETATM 4734 O HOH C 201 -14.173 13.393 -8.778 1.00 43.21 O -HETATM 4735 O HOH D 149 0.061 -2.494 -16.397 1.00 18.64 O -HETATM 4736 O HOH D 150 -8.041 -19.581 -16.153 1.00 26.28 O -HETATM 4737 O HOH D 151 2.825 -3.769 -9.602 1.00 23.08 O -HETATM 4738 O HOH D 152 -2.494 -0.118 -14.151 1.00 25.33 O -HETATM 4739 O HOH D 153 -9.792 -8.060 0.750 1.00 30.48 O -HETATM 4740 O HOH D 154 -6.518 -22.534 -15.665 1.00 34.60 O -HETATM 4741 O HOH D 155 -17.398 -13.549 8.357 1.00 35.82 O -HETATM 4742 O HOH D 156 5.350 -9.378 -15.018 1.00 27.68 O -HETATM 4743 O HOH D 157 -6.300 -24.347 -19.100 1.00 35.93 O -HETATM 4744 O HOH D 158 -9.520 7.447 -21.130 1.00 40.04 O -HETATM 4745 O HOH D 159 -16.425 -5.250 -24.764 1.00 32.57 O -HETATM 4746 O HOH D 160 -7.987 -14.493 1.146 1.00 34.30 O -HETATM 4747 O HOH D 161 -3.890 0.572 -11.856 1.00 34.78 O -HETATM 4748 O HOH D 162 -29.504 -0.198 -4.474 1.00 38.63 O -HETATM 4749 O HOH D 163 -25.631 -15.732 -9.906 1.00 33.22 O -HETATM 4750 O HOH D 164 -2.623 -18.453 -21.128 1.00 35.47 O -HETATM 4751 O HOH D 165 -2.780 -19.130 -10.800 1.00 30.23 O -HETATM 4752 O HOH D 166 -25.734 -4.456 7.605 1.00 34.33 O -HETATM 4753 O HOH D 167 -11.771 -10.816 5.496 1.00 38.68 O -HETATM 4754 O HOH D 168 -9.924 0.291 -2.970 1.00 38.71 O -HETATM 4755 O HOH D 169 -25.514 -14.066 2.449 1.00 36.60 O -HETATM 4756 O HOH D 170 -5.455 -17.392 -4.316 1.00 34.43 O -HETATM 4757 O HOH D 171 2.688 -11.418 -8.564 1.00 35.73 O -HETATM 4758 O HOH D 172 7.091 -10.993 -18.224 1.00 32.39 O -HETATM 4759 O HOH D 173 -9.377 -6.399 -3.029 1.00 35.44 O -HETATM 4760 O HOH D 174 -16.565 -17.782 -17.506 1.00 41.02 O -HETATM 4761 O HOH D 175 -8.141 -3.463 -24.390 1.00 37.14 O -HETATM 4762 O HOH D 176 -16.560 -15.177 -19.016 1.00 34.89 O -HETATM 4763 O HOH D 177 3.477 -8.048 -19.033 1.00 35.94 O -HETATM 4764 O HOH D 178 -24.698 -11.573 8.724 1.00 38.01 O -HETATM 4765 O HOH D 179 2.193 -4.435 -6.557 1.00 38.51 O -HETATM 4766 O HOH D 180 -29.898 -16.926 -2.135 1.00 36.37 O -HETATM 4767 O HOH D 181 -7.374 8.034 -17.831 1.00 34.05 O -HETATM 4768 O HOH D 182 -24.015 0.401 -15.301 1.00 39.14 O -HETATM 4769 O HOH D 183 -12.141 9.790 -10.238 1.00 38.30 O -HETATM 4770 O HOH D 184 -5.765 -3.569 -23.682 1.00 36.68 O -HETATM 4771 O HOH D 185 -4.860 -9.811 -2.967 1.00 37.10 O -HETATM 4772 O HOH D 186 -23.107 -4.490 -24.359 1.00 37.97 O -HETATM 4773 O HOH D 187 -10.377 -9.632 -7.043 1.00 38.85 O -HETATM 4774 O HOH D 188 -7.871 -9.078 2.406 1.00 43.37 O -HETATM 4775 O HOH D 189 -27.610 -10.991 5.353 1.00 43.46 O -HETATM 4776 O HOH D 190 -14.034 2.806 -30.367 1.00 41.77 O -HETATM 4777 O HOH D 191 -32.905 -9.033 0.480 1.00 43.68 O -HETATM 4778 O HOH D 192 -28.749 -13.315 1.938 1.00 45.36 O -HETATM 4779 O HOH D 193 0.516 -8.074 -26.354 1.00 41.53 O -HETATM 4780 O HOH D 194 -20.080 -9.873 -22.862 1.00 36.25 O -HETATM 4781 O HOH D 195 -13.442 9.778 -13.572 1.00 39.70 O -HETATM 4782 O HOH D 196 -24.804 -2.608 -15.488 1.00 37.79 O -HETATM 4783 O HOH D 197 -1.263 -2.837 -21.251 1.00 45.10 O -CONECT 650 4389 -CONECT 1771 4433 -CONECT 2844 4476 -CONECT 3965 4520 -CONECT 4389 650 4394 4405 4413 -CONECT 4389 4421 -CONECT 4390 4395 4425 -CONECT 4391 4398 4406 -CONECT 4392 4409 4414 -CONECT 4393 4417 4422 -CONECT 4394 4389 4395 4398 -CONECT 4395 4390 4394 4396 -CONECT 4396 4395 4397 4400 -CONECT 4397 4396 4398 4399 -CONECT 4398 4391 4394 4397 -CONECT 4399 4397 -CONECT 4400 4396 4401 -CONECT 4401 4400 4402 -CONECT 4402 4401 4403 4404 -CONECT 4403 4402 -CONECT 4404 4402 -CONECT 4405 4389 4406 4409 -CONECT 4406 4391 4405 4407 -CONECT 4407 4406 4408 4410 -CONECT 4408 4407 4409 4411 -CONECT 4409 4392 4405 4408 -CONECT 4410 4407 -CONECT 4411 4408 4412 -CONECT 4412 4411 -CONECT 4413 4389 4414 4417 -CONECT 4414 4392 4413 4415 -CONECT 4415 4414 4416 4418 -CONECT 4416 4415 4417 4419 -CONECT 4417 4393 4413 4416 -CONECT 4418 4415 -CONECT 4419 4416 4420 -CONECT 4420 4419 -CONECT 4421 4389 4422 4425 -CONECT 4422 4393 4421 4423 -CONECT 4423 4422 4424 4426 -CONECT 4424 4423 4425 4427 -CONECT 4425 4390 4421 4424 -CONECT 4426 4423 -CONECT 4427 4424 4428 -CONECT 4428 4427 4429 -CONECT 4429 4428 4430 4431 -CONECT 4430 4429 -CONECT 4431 4429 -CONECT 4433 1771 4438 4449 4457 -CONECT 4433 4465 -CONECT 4434 4439 4469 -CONECT 4435 4442 4450 -CONECT 4436 4453 4458 -CONECT 4437 4461 4466 -CONECT 4438 4433 4439 4442 -CONECT 4439 4434 4438 4440 -CONECT 4440 4439 4441 4444 -CONECT 4441 4440 4442 4443 -CONECT 4442 4435 4438 4441 -CONECT 4443 4441 -CONECT 4444 4440 4445 -CONECT 4445 4444 4446 -CONECT 4446 4445 4447 4448 -CONECT 4447 4446 -CONECT 4448 4446 -CONECT 4449 4433 4450 4453 -CONECT 4450 4435 4449 4451 -CONECT 4451 4450 4452 4454 -CONECT 4452 4451 4453 4455 -CONECT 4453 4436 4449 4452 -CONECT 4454 4451 -CONECT 4455 4452 4456 -CONECT 4456 4455 -CONECT 4457 4433 4458 4461 -CONECT 4458 4436 4457 4459 -CONECT 4459 4458 4460 4462 -CONECT 4460 4459 4461 4463 -CONECT 4461 4437 4457 4460 -CONECT 4462 4459 -CONECT 4463 4460 4464 -CONECT 4464 4463 -CONECT 4465 4433 4466 4469 -CONECT 4466 4437 4465 4467 -CONECT 4467 4466 4468 4470 -CONECT 4468 4467 4469 4471 -CONECT 4469 4434 4465 4468 -CONECT 4470 4467 -CONECT 4471 4468 4472 -CONECT 4472 4471 4473 -CONECT 4473 4472 4474 4475 -CONECT 4474 4473 -CONECT 4475 4473 -CONECT 4476 2844 4481 4492 4500 -CONECT 4476 4508 -CONECT 4477 4482 4512 -CONECT 4478 4485 4493 -CONECT 4479 4496 4501 -CONECT 4480 4504 4509 -CONECT 4481 4476 4482 4485 -CONECT 4482 4477 4481 4483 -CONECT 4483 4482 4484 4487 -CONECT 4484 4483 4485 4486 -CONECT 4485 4478 4481 4484 -CONECT 4486 4484 -CONECT 4487 4483 4488 -CONECT 4488 4487 4489 -CONECT 4489 4488 4490 4491 -CONECT 4490 4489 -CONECT 4491 4489 -CONECT 4492 4476 4493 4496 -CONECT 4493 4478 4492 4494 -CONECT 4494 4493 4495 4497 -CONECT 4495 4494 4496 4498 -CONECT 4496 4479 4492 4495 -CONECT 4497 4494 -CONECT 4498 4495 4499 -CONECT 4499 4498 -CONECT 4500 4476 4501 4504 -CONECT 4501 4479 4500 4502 -CONECT 4502 4501 4503 4505 -CONECT 4503 4502 4504 4506 -CONECT 4504 4480 4500 4503 -CONECT 4505 4502 -CONECT 4506 4503 4507 -CONECT 4507 4506 -CONECT 4508 4476 4509 4512 -CONECT 4509 4480 4508 4510 -CONECT 4510 4509 4511 4513 -CONECT 4511 4510 4512 4514 -CONECT 4512 4477 4508 4511 -CONECT 4513 4510 -CONECT 4514 4511 4515 -CONECT 4515 4514 4516 -CONECT 4516 4515 4517 4518 -CONECT 4517 4516 -CONECT 4518 4516 -CONECT 4520 3965 4525 4536 4544 -CONECT 4520 4552 -CONECT 4521 4526 4556 -CONECT 4522 4529 4537 -CONECT 4523 4540 4545 -CONECT 4524 4548 4553 -CONECT 4525 4520 4526 4529 -CONECT 4526 4521 4525 4527 -CONECT 4527 4526 4528 4531 -CONECT 4528 4527 4529 4530 -CONECT 4529 4522 4525 4528 -CONECT 4530 4528 -CONECT 4531 4527 4532 -CONECT 4532 4531 4533 -CONECT 4533 4532 4534 4535 -CONECT 4534 4533 -CONECT 4535 4533 -CONECT 4536 4520 4537 4540 -CONECT 4537 4522 4536 4538 -CONECT 4538 4537 4539 4541 -CONECT 4539 4538 4540 4542 -CONECT 4540 4523 4536 4539 -CONECT 4541 4538 -CONECT 4542 4539 4543 -CONECT 4543 4542 -CONECT 4544 4520 4545 4548 -CONECT 4545 4523 4544 4546 -CONECT 4546 4545 4547 4549 -CONECT 4547 4546 4548 4550 -CONECT 4548 4524 4544 4547 -CONECT 4549 4546 -CONECT 4550 4547 4551 -CONECT 4551 4550 -CONECT 4552 4520 4553 4556 -CONECT 4553 4524 4552 4554 -CONECT 4554 4553 4555 4557 -CONECT 4555 4554 4556 4558 -CONECT 4556 4521 4552 4555 -CONECT 4557 4554 -CONECT 4558 4555 4559 -CONECT 4559 4558 4560 -CONECT 4560 4559 4561 4562 -CONECT 4561 4560 -CONECT 4562 4560 -MASTER 868 1 6 32 0 0 16 9 4779 4 180 46 -END diff --git a/java/examples/Demos/Graphics/RotatingArcs/RotatingArcs.pde b/java/examples/Demos/Graphics/RotatingArcs/RotatingArcs.pde deleted file mode 100755 index 8bbb32bd3..000000000 --- a/java/examples/Demos/Graphics/RotatingArcs/RotatingArcs.pde +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Geometry - * by Marius Watz. - * - * Using sin/cos lookup tables, blends colors, and draws a series of - * rotating arcs on the screen. -*/ - -// Trig lookup tables borrowed from Toxi; cryptic but effective. -float sinLUT[]; -float cosLUT[]; -float SINCOS_PRECISION=1.0; -int SINCOS_LENGTH= int((360.0/SINCOS_PRECISION)); - -// System data -boolean dosave=false; -int num; -float pt[]; -int style[]; - - -void setup() { - size(1024, 768, P3D); - background(255); - - // Fill the tables - sinLUT=new float[SINCOS_LENGTH]; - cosLUT=new float[SINCOS_LENGTH]; - for (int i = 0; i < SINCOS_LENGTH; i++) { - sinLUT[i]= (float)Math.sin(i*DEG_TO_RAD*SINCOS_PRECISION); - cosLUT[i]= (float)Math.cos(i*DEG_TO_RAD*SINCOS_PRECISION); - } - - num = 150; - pt = new float[6*num]; // rotx, roty, deg, rad, w, speed - style = new int[2*num]; // color, render style - - // Set up arc shapes - int index=0; - float prob; - for (int i=0; i90) pt[index]=(int)random(8,27)*10; - - pt[index++] = int(random(2,50)*5); // Radius. Space them out nicely - - pt[index++] = random(4,32); // Width of band - if(random(100)>90) pt[index]=random(40,60); // Width of band - - pt[index++] = radians(random(5,30))/5; // Speed of rotation - - // get colors - prob = random(100); - if(prob<30) style[i*2]=colorBlended(random(1), 255,0,100, 255,0,0, 210); - else if(prob<70) style[i*2]=colorBlended(random(1), 0,153,255, 170,225,255, 210); - else if(prob<90) style[i*2]=colorBlended(random(1), 200,255,0, 150,255,0, 210); - else style[i*2]=color(255,255,255, 220); - - if(prob<50) style[i*2]=colorBlended(random(1), 200,255,0, 50,120,0, 210); - else if(prob<90) style[i*2]=colorBlended(random(1), 255,100,0, 255,255,0, 210); - else style[i*2]=color(255,255,255, 220); - - style[i*2+1]=(int)(random(100))%3; - } -} - -void draw() { - - background(0); - - int index=0; - translate(width/2, height/2, 0); - rotateX(PI/6); - rotateY(PI/6); - - for (int i = 0; i < num; i++) { - pushMatrix(); - - rotateX(pt[index++]); - rotateY(pt[index++]); - - if(style[i*2+1]==0) { - stroke(style[i*2]); - noFill(); - strokeWeight(1); - arcLine(0,0, pt[index++],pt[index++],pt[index++]); - } - else if(style[i*2+1]==1) { - fill(style[i*2]); - noStroke(); - arcLineBars(0,0, pt[index++],pt[index++],pt[index++]); - } - else { - fill(style[i*2]); - noStroke(); - arc(0,0, pt[index++],pt[index++],pt[index++]); - } - - // increase rotation - pt[index-5]+=pt[index]/10; - pt[index-4]+=pt[index++]/20; - - popMatrix(); - } -} - - -// Get blend of two colors -int colorBlended(float fract, -float r, float g, float b, -float r2, float g2, float b2, float a) { - - r2 = (r2 - r); - g2 = (g2 - g); - b2 = (b2 - b); - return color(r + r2 * fract, g + g2 * fract, b + b2 * fract, a); -} - - -// Draw arc line -void arcLine(float x,float y,float deg,float rad,float w) { - int a=(int)(min (deg/SINCOS_PRECISION,SINCOS_LENGTH-1)); - int numlines=(int)(w/2); - - for (int j=0; j= capacity) { - // there are all sorts of possible solutions here, - // but for abject simplicity, I don't do anything. - } - else { - float v = distToLast(x, y); - float p = getPressureFromVelocity(v); - path[nPoints++].set(x,y,p); - - if (nPoints > 1) { - exists = true; - jumpDx = path[nPoints-1].x - path[0].x; - jumpDy = path[nPoints-1].y - path[0].y; - } - } - - } - - float getPressureFromVelocity(float v) { - final float scale = 18; - final float minP = 0.02; - final float oldP = (nPoints > 0) ? path[nPoints-1].p : 0; - return ((minP + max(0, 1.0 - v/scale)) + (damp1*oldP))*dampInv; - } - - void setPressures() { - // pressures vary from 0...1 - float pressure; - Vec3f tmp; - float t = 0; - float u = 1.0 / (nPoints - 1)*TWO_PI; - for (int i = 0; i < nPoints; i++) { - pressure = sqrt((1.0 - cos(t))*0.5); - path[i].p = pressure; - t += u; - } - } - - float distToLast(float ix, float iy) { - if (nPoints > 0) { - Vec3f v = path[nPoints-1]; - float dx = v.x - ix; - float dy = v.y - iy; - return mag(dx, dy); - } - else { - return 30; - } - } - - void compile() { - // compute the polygons from the path of Vec3f's - if (exists) { - clearPolys(); - - Vec3f p0, p1, p2; - float radius0, radius1; - float ax, bx, cx, dx; - float ay, by, cy, dy; - int axi, bxi, cxi, dxi, axip, axid; - int ayi, byi, cyi, dyi, ayip, ayid; - float p1x, p1y; - float dx01, dy01, hp01, si01, co01; - float dx02, dy02, hp02, si02, co02; - float dx13, dy13, hp13, si13, co13; - float taper = 1.0; - - int nPathPoints = nPoints - 1; - int lastPolyIndex = nPathPoints - 1; - float npm1finv = 1.0 / max(1, nPathPoints - 1); - - // handle the first point - p0 = path[0]; - p1 = path[1]; - radius0 = p0.p * thickness; - dx01 = p1.x - p0.x; - dy01 = p1.y - p0.y; - hp01 = sqrt(dx01*dx01 + dy01*dy01); - if (hp01 == 0) { - hp02 = 0.0001; - } - co01 = radius0 * dx01 / hp01; - si01 = radius0 * dy01 / hp01; - ax = p0.x - si01; - ay = p0.y + co01; - bx = p0.x + si01; - by = p0.y - co01; - - int xpts[]; - int ypts[]; - - int LC = 20; - int RC = w-LC; - int TC = 20; - int BC = h-TC; - float mint = 0.618; - float tapow = 0.4; - - // handle the middle points - int i = 1; - Polygon apoly; - for (i = 1; i < nPathPoints; i++) { - taper = pow((lastPolyIndex-i)*npm1finv,tapow); - - p0 = path[i-1]; - p1 = path[i ]; - p2 = path[i+1]; - p1x = p1.x; - p1y = p1.y; - radius1 = Math.max(mint,taper*p1.p*thickness); - - // assumes all segments are roughly the same length... - dx02 = p2.x - p0.x; - dy02 = p2.y - p0.y; - hp02 = (float) Math.sqrt(dx02*dx02 + dy02*dy02); - if (hp02 != 0) { - hp02 = radius1/hp02; - } - co02 = dx02 * hp02; - si02 = dy02 * hp02; - - // translate the integer coordinates to the viewing rectangle - axi = axip = (int)ax; - ayi = ayip = (int)ay; - axi=(axi<0)?(w-((-axi)%w)):axi%w; - axid = axi-axip; - ayi=(ayi<0)?(h-((-ayi)%h)):ayi%h; - ayid = ayi-ayip; - - // set the vertices of the polygon - apoly = polygons[nPolys++]; - xpts = apoly.xpoints; - ypts = apoly.ypoints; - xpts[0] = axi = axid + axip; - xpts[1] = bxi = axid + (int) bx; - xpts[2] = cxi = axid + (int)(cx = p1x + si02); - xpts[3] = dxi = axid + (int)(dx = p1x - si02); - ypts[0] = ayi = ayid + ayip; - ypts[1] = byi = ayid + (int) by; - ypts[2] = cyi = ayid + (int)(cy = p1y - co02); - ypts[3] = dyi = ayid + (int)(dy = p1y + co02); - - // keep a record of where we cross the edge of the screen - crosses[i] = 0; - if ((axi<=LC)||(bxi<=LC)||(cxi<=LC)||(dxi<=LC)) { - crosses[i]|=1; - } - if ((axi>=RC)||(bxi>=RC)||(cxi>=RC)||(dxi>=RC)) { - crosses[i]|=2; - } - if ((ayi<=TC)||(byi<=TC)||(cyi<=TC)||(dyi<=TC)) { - crosses[i]|=4; - } - if ((ayi>=BC)||(byi>=BC)||(cyi>=BC)||(dyi>=BC)) { - crosses[i]|=8; - } - - //swap data for next time - ax = dx; - ay = dy; - bx = cx; - by = cy; - } - - // handle the last point - p2 = path[nPathPoints]; - apoly = polygons[nPolys++]; - xpts = apoly.xpoints; - ypts = apoly.ypoints; - - xpts[0] = (int)ax; - xpts[1] = (int)bx; - xpts[2] = (int)(p2.x); - xpts[3] = (int)(p2.x); - - ypts[0] = (int)ay; - ypts[1] = (int)by; - ypts[2] = (int)(p2.y); - ypts[3] = (int)(p2.y); - - } - } - - void smooth() { - // average neighboring points - - final float weight = 18; - final float scale = 1.0 / (weight + 2); - int nPointsMinusTwo = nPoints - 2; - Vec3f lower, upper, center; - - for (int i = 1; i < nPointsMinusTwo; i++) { - lower = path[i-1]; - center = path[i]; - upper = path[i+1]; - - center.x = (lower.x + weight*center.x + upper.x)*scale; - center.y = (lower.y + weight*center.y + upper.y)*scale; - } - } -} - diff --git a/java/examples/Demos/Graphics/Yellowtail/Vec3f.pde b/java/examples/Demos/Graphics/Yellowtail/Vec3f.pde deleted file mode 100755 index 865d3c32f..000000000 --- a/java/examples/Demos/Graphics/Yellowtail/Vec3f.pde +++ /dev/null @@ -1,19 +0,0 @@ -class Vec3f { - float x; - float y; - float p; // Pressure - - Vec3f() { - set(0, 0, 0); - } - - Vec3f(float ix, float iy, float ip) { - set(ix, iy, ip); - } - - void set(float ix, float iy, float ip) { - x = ix; - y = iy; - p = ip; - } -} diff --git a/java/examples/Demos/Graphics/Yellowtail/Yellowtail.pde b/java/examples/Demos/Graphics/Yellowtail/Yellowtail.pde deleted file mode 100755 index 5a28ea837..000000000 --- a/java/examples/Demos/Graphics/Yellowtail/Yellowtail.pde +++ /dev/null @@ -1,189 +0,0 @@ -/** - * Yellowtail - * by Golan Levin (www.flong.com). - * - * Click, drag, and release to create a kinetic gesture. - * - * Yellowtail (1998-2000) is an interactive software system for the gestural - * creation and performance of real-time abstract animation. Yellowtail repeats - * a user's strokes end-over-end, enabling simultaneous specification of a - * line's shape and quality of movement. Each line repeats according to its - * own period, producing an ever-changing and responsive display of lively, - * worm-like textures. - */ - - -import java.awt.Polygon; - -Gesture gestureArray[]; -final int nGestures = 36; // Number of gestures -final int minMove = 3; // Minimum travel for a new point -int currentGestureID; - -Polygon tempP; -int tmpXp[]; -int tmpYp[]; - - -void setup() { - size(1024, 768, P2D); - background(0, 0, 0); - noStroke(); - - currentGestureID = -1; - gestureArray = new Gesture[nGestures]; - for (int i = 0; i < nGestures; i++) { - gestureArray[i] = new Gesture(width, height); - } - clearGestures(); -} - - -void draw() { - background(0); - - updateGeometry(); - fill(255, 255, 245); - for (int i = 0; i < nGestures; i++) { - renderGesture(gestureArray[i], width, height); - } -} - -void mousePressed() { - currentGestureID = (currentGestureID+1) % nGestures; - Gesture G = gestureArray[currentGestureID]; - G.clear(); - G.clearPolys(); - G.addPoint(mouseX, mouseY); -} - - -void mouseDragged() { - if (currentGestureID >= 0) { - Gesture G = gestureArray[currentGestureID]; - if (G.distToLast(mouseX, mouseY) > minMove) { - G.addPoint(mouseX, mouseY); - G.smooth(); - G.compile(); - } - } -} - - -void keyPressed() { - if (key == '+' || key == '=') { - if (currentGestureID >= 0) { - float th = gestureArray[currentGestureID].thickness; - gestureArray[currentGestureID].thickness = min(96, th+1); - gestureArray[currentGestureID].compile(); - } - } else if (key == '-') { - if (currentGestureID >= 0) { - float th = gestureArray[currentGestureID].thickness; - gestureArray[currentGestureID].thickness = max(2, th-1); - gestureArray[currentGestureID].compile(); - } - } else if (key == ' ') { - clearGestures(); - } -} - - -void renderGesture(Gesture gesture, int w, int h) { - if (gesture.exists) { - if (gesture.nPolys > 0) { - Polygon polygons[] = gesture.polygons; - int crosses[] = gesture.crosses; - - int xpts[]; - int ypts[]; - Polygon p; - int cr; - - beginShape(QUADS); - int gnp = gesture.nPolys; - for (int i=0; i 0) { - if ((cr & 3)>0) { - vertex(xpts[0]+w, ypts[0]); - vertex(xpts[1]+w, ypts[1]); - vertex(xpts[2]+w, ypts[2]); - vertex(xpts[3]+w, ypts[3]); - - vertex(xpts[0]-w, ypts[0]); - vertex(xpts[1]-w, ypts[1]); - vertex(xpts[2]-w, ypts[2]); - vertex(xpts[3]-w, ypts[3]); - } - if ((cr & 12)>0) { - vertex(xpts[0], ypts[0]+h); - vertex(xpts[1], ypts[1]+h); - vertex(xpts[2], ypts[2]+h); - vertex(xpts[3], ypts[3]+h); - - vertex(xpts[0], ypts[0]-h); - vertex(xpts[1], ypts[1]-h); - vertex(xpts[2], ypts[2]-h); - vertex(xpts[3], ypts[3]-h); - } - - // I have knowingly retained the small flaw of not - // completely dealing with the corner conditions - // (the case in which both of the above are true). - } - } - endShape(); - } - } -} - -void updateGeometry() { - Gesture J; - for (int g=0; g 0) { - path = gesture.path; - for (int i = nPts1; i > 0; i--) { - path[i].x = path[i-1].x; - path[i].y = path[i-1].y; - } - path[0].x = path[nPts1].x - jx; - path[0].y = path[nPts1].y - jy; - gesture.compile(); - } - } -} - -void clearGestures() { - for (int i = 0; i < nGestures; i++) { - gestureArray[i].clear(); - } -} diff --git a/java/examples/Demos/Performance/CubicGridImmediate/CubicGridImmediate.pde b/java/examples/Demos/Performance/CubicGridImmediate/CubicGridImmediate.pde deleted file mode 100644 index c6089cd3e..000000000 --- a/java/examples/Demos/Performance/CubicGridImmediate/CubicGridImmediate.pde +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Cubic Grid - * by Ira Greenberg. - * - * 3D translucent colored grid uses nested pushMatrix() - * and popMatrix() functions. - */ - -float boxSize = 20; -float margin = boxSize*2; -float depth = 400; -color boxFill; - -int fcount, lastm; -float frate; -int fint = 3; - -void setup() { - size(640, 360, P3D); - frameRate(60); - noSmooth(); - noStroke(); -} - -void draw() { - background(255); - - hint(DISABLE_DEPTH_TEST); - - // Center and spin grid - pushMatrix(); - translate(width/2, height/2, -depth); - rotateY(frameCount * 0.01); - rotateX(frameCount * 0.01); - - // Build grid using multiple translations - for (float i =- depth/2+margin; i <= depth/2-margin; i += boxSize){ - for (float j =- height+margin; j <= height-margin; j += boxSize){ - for (float k =- width+margin; k <= width-margin; k += boxSize){ - // Base fill color on counter values, abs function - // ensures values stay within legal range - boxFill = color(abs(i), abs(j), abs(k), 50); - pushMatrix(); - translate(k, j, i); - fill(boxFill); - box(boxSize, boxSize, boxSize); - popMatrix(); - } - } - } - popMatrix(); - - hint(ENABLE_DEPTH_TEST); - - fcount += 1; - int m = millis(); - if (m - lastm > 1000 * fint) { - frate = float(fcount) / fint; - fcount = 0; - lastm = m; - println("fps: " + frate); - } - fill(0); - text("fps: " + frate, 10, 20); -} \ No newline at end of file diff --git a/java/examples/Demos/Performance/CubicGridRetained/CubicGridRetained.pde b/java/examples/Demos/Performance/CubicGridRetained/CubicGridRetained.pde deleted file mode 100644 index 70906fbde..000000000 --- a/java/examples/Demos/Performance/CubicGridRetained/CubicGridRetained.pde +++ /dev/null @@ -1,67 +0,0 @@ -/* CubicGridRetained - * - * You may need to increase the maximum available memory in the - * Processing preferences menu. -*/ -float boxSize = 20; -float margin = boxSize*2; -float depth = 400; -color boxFill; - -PShape grid; - -int fcount, lastm; -float frate; -int fint = 3; - -void setup() { - size(640, 360, P3D); - frameRate(60); - noSmooth(); - noStroke(); - - grid = createShape(GROUP); - - // Build grid using multiple translations - for (float i =- depth/2+margin; i <= depth/2-margin; i += boxSize){ - for (float j =- height+margin; j <= height-margin; j += boxSize){ - for (float k =- width+margin; k <= width-margin; k += boxSize){ - // Base fill color on counter values, abs function - // ensures values stay within legal range - boxFill = color(abs(i), abs(j), abs(k), 50); - PShape cube = createShape(BOX, boxSize, boxSize, boxSize); - cube.setFill(boxFill); - cube.translate(k, j, i); - grid.addChild(cube); - } - } - } -} - -void draw() { - background(255); - - hint(DISABLE_DEPTH_TEST); - - // Center and spin grid - pushMatrix(); - translate(width/2, height/2, -depth); - rotateY(frameCount * 0.01); - rotateX(frameCount * 0.01); - - shape(grid); - popMatrix(); - - hint(ENABLE_DEPTH_TEST); - - fcount += 1; - int m = millis(); - if (m - lastm > 1000 * fint) { - frate = float(fcount) / fint; - fcount = 0; - lastm = m; - println("fps: " + frate); - } - fill(0); - text("fps: " + frate, 10, 20); -} diff --git a/java/examples/Demos/Performance/DynamicParticlesImmediate/DynamicParticlesImmediate.pde b/java/examples/Demos/Performance/DynamicParticlesImmediate/DynamicParticlesImmediate.pde deleted file mode 100644 index edc5d15c9..000000000 --- a/java/examples/Demos/Performance/DynamicParticlesImmediate/DynamicParticlesImmediate.pde +++ /dev/null @@ -1,118 +0,0 @@ -PImage sprite; - -int npartTotal = 10000; -int npartPerFrame = 25; -float speed = 1.0; -float gravity = 0.05; -float partSize = 20; - -int partLifetime; -PVector positions[]; -PVector velocities[]; -int lifetimes[]; - -int fcount, lastm; -float frate; -int fint = 3; - -void setup() { - size(640, 480, P3D); - frameRate(120); - - sprite = loadImage("sprite.png"); - - partLifetime = npartTotal / npartPerFrame; - initPositions(); - initVelocities(); - initLifetimes(); - - // Writing to the depth buffer is disabled to avoid rendering - // artifacts due to the fact that the particles are semi-transparent - // but not z-sorted. - hint(DISABLE_DEPTH_MASK); - - // Testing some hints - //hint(DISABLE_TRANSFORM_CACHE); - //hint(ENABLE_ACCURATE_2D); -} - -void draw () { - background(0); - - for (int n = 0; n < npartTotal; n++) { - lifetimes[n]++; - if (lifetimes[n] == partLifetime) { - lifetimes[n] = 0; - } - - if (0 <= lifetimes[n]) { - float opacity = 1.0 - float(lifetimes[n]) / partLifetime; - - if (lifetimes[n] == 0) { - // Re-spawn dead particle - positions[n].x = mouseX; - positions[n].y = mouseY; - - float angle = random(0, TWO_PI); - float s = random(0.5 * speed, 0.5 * speed); - velocities[n].x = s * cos(angle); - velocities[n].y = s * sin(angle); - } else { - positions[n].x += velocities[n].x; - positions[n].y += velocities[n].y; - - velocities[n].y += gravity; - } - drawParticle(positions[n], opacity); - } - } - - fcount += 1; - int m = millis(); - if (m - lastm > 1000 * fint) { - frate = float(fcount) / fint; - fcount = 0; - lastm = m; - println("fps: " + frate); - } -} - -void drawParticle(PVector center, float opacity) { - beginShape(QUAD); - noStroke(); - tint(255, opacity * 255); - texture(sprite); - normal(0, 0, 1); - vertex(center.x - partSize/2, center.y - partSize/2, 0, 0); - vertex(center.x + partSize/2, center.y - partSize/2, sprite.width, 0); - vertex(center.x + partSize/2, center.y + partSize/2, sprite.width, sprite.height); - vertex(center.x - partSize/2, center.y + partSize/2, 0, sprite.height); - endShape(); -} - -void initPositions() { - positions = new PVector[npartTotal]; - for (int n = 0; n < positions.length; n++) { - positions[n] = new PVector(); - } -} - -void initVelocities() { - velocities = new PVector[npartTotal]; - for (int n = 0; n < velocities.length; n++) { - velocities[n] = new PVector(); - } -} - -void initLifetimes() { - // Initializing particles with negative lifetimes so they are added - // progressively into the screen during the first frames of the sketch - lifetimes = new int[npartTotal]; - int t = -1; - for (int n = 0; n < lifetimes.length; n++) { - if (n % npartPerFrame == 0) { - t++; - } - lifetimes[n] = -t; - } -} diff --git a/java/examples/Demos/Performance/DynamicParticlesRetained/DynamicParticlesRetained.pde b/java/examples/Demos/Performance/DynamicParticlesRetained/DynamicParticlesRetained.pde deleted file mode 100644 index 52165799c..000000000 --- a/java/examples/Demos/Performance/DynamicParticlesRetained/DynamicParticlesRetained.pde +++ /dev/null @@ -1,111 +0,0 @@ -PShape particles; -PImage sprite; - -int npartTotal = 10000; -int npartPerFrame = 25; -float speed = 1.0; -float gravity = 0.05; -float partSize = 20; - -int partLifetime; -PVector velocities[]; -int lifetimes[]; - -int fcount, lastm; -float frate; -int fint = 3; - -void setup() { - size(640, 480, P3D); - frameRate(120); - - particles = createShape(PShape.GROUP); - sprite = loadImage("sprite.png"); - - for (int n = 0; n < npartTotal; n++) { - PShape part = createShape(); - part.beginShape(QUAD); - part.noStroke(); - part.texture(sprite); - part.normal(0, 0, 1); - part.vertex(-partSize/2, -partSize/2, 0, 0); - part.vertex(+partSize/2, -partSize/2, sprite.width, 0); - part.vertex(+partSize/2, +partSize/2, sprite.width, sprite.height); - part.vertex(-partSize/2, +partSize/2, 0, sprite.height); - part.endShape(); - particles.addChild(part); - } - - partLifetime = npartTotal / npartPerFrame; - initVelocities(); - initLifetimes(); - - // Writing to the depth buffer is disabled to avoid rendering - // artifacts due to the fact that the particles are semi-transparent - // but not z-sorted. - hint(DISABLE_DEPTH_MASK); -} - -void draw () { - background(0); - - for (int n = 0; n < particles.getChildCount(); n++) { - PShape part = particles.getChild(n); - - lifetimes[n]++; - if (lifetimes[n] == partLifetime) { - lifetimes[n] = 0; - } - - if (0 <= lifetimes[n]) { - float opacity = 1.0 - float(lifetimes[n]) / partLifetime; - part.setTint(color(255, opacity * 255)); - - if (lifetimes[n] == 0) { - // Re-spawn dead particle - part.resetMatrix(); - part.translate(mouseX, mouseY); - float angle = random(0, TWO_PI); - float s = random(0.5 * speed, 0.5 * speed); - velocities[n].x = s * cos(angle); - velocities[n].y = s * sin(angle); - } else { - part.translate(velocities[n].x, velocities[n].y); - velocities[n].y += gravity; - } - } else { - part.setTint(color(0)); - } - } - - shape(particles); - - fcount += 1; - int m = millis(); - if (m - lastm > 1000 * fint) { - frate = float(fcount) / fint; - fcount = 0; - lastm = m; - println("fps: " + frate); - } -} - -void initVelocities() { - velocities = new PVector[npartTotal]; - for (int n = 0; n < velocities.length; n++) { - velocities[n] = new PVector(); - } -} - -void initLifetimes() { - // Initializing particles with negative lifetimes so they are added - // progressively into the screen during the first frames of the sketch - lifetimes = new int[npartTotal]; - int t = -1; - for (int n = 0; n < lifetimes.length; n++) { - if (n % npartPerFrame == 0) { - t++; - } - lifetimes[n] = -t; - } -} diff --git a/java/examples/Demos/Performance/Esfera/Esfera.pde b/java/examples/Demos/Performance/Esfera/Esfera.pde deleted file mode 100644 index 1b84f291d..000000000 --- a/java/examples/Demos/Performance/Esfera/Esfera.pde +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Esfera - * by David Pena. - * - * Distribucion aleatoria uniforme sobre la superficie de una esfera. - */ - -int cuantos = 16000; -Pelo[] lista ; -float radio = 200; -float rx = 0; -float ry =0; - -void setup() { - size(1024, 768, P3D); - - radio = height/3.5; - - lista = new Pelo[cuantos]; - for (int i = 0; i < lista.length; i++) { - lista[i] = new Pelo(); - } - noiseDetail(3); -} - -void draw() { - background(0); - - float rxp = (mouseX-(width/2)) * 0.005; - float ryp = (mouseY-(height/2)) * 0.005; - rx = rx*0.9 + rxp*0.1; - ry = ry*0.9 + ryp*0.1; - - translate(width/2, height/2); - rotateY(rx); - rotateX(ry); - fill(0); - noStroke(); - sphere(radio); - - for (int i = 0; i < lista.length; i++) { - lista[i].dibujar(); - } - -} - - -class Pelo -{ - float z = random(-radio, radio); - float phi = random(TWO_PI); - float largo = random(1.15, 1.2); - float theta = asin(z/radio); - - Pelo() { // what's wrong with a constructor here - z = random(-radio, radio); - phi = random(TWO_PI); - largo = random(1.15, 1.2); - theta = asin(z/radio); - } - - void dibujar() { - - float off = (noise(millis() * 0.0005, sin(phi))-0.5) * 0.3; - float offb = (noise(millis() * 0.0007, sin(z) * 0.01)-0.5) * 0.3; - - float thetaff = theta+off; - float phff = phi+offb; - float x = radio * cos(theta) * cos(phi); - float y = radio * cos(theta) * sin(phi); - float z = radio * sin(theta); - - float xo = radio * cos(thetaff) * cos(phff); - float yo = radio * cos(thetaff) * sin(phff); - float zo = radio * sin(thetaff); - - float xb = xo * largo; - float yb = yo * largo; - float zb = zo * largo; - - strokeWeight(1); - beginShape(LINES); - stroke(0); - vertex(x, y, z); - stroke(200, 150); - vertex(xb, yb, zb); - endShape(); - } -} - diff --git a/java/examples/Demos/Performance/LineRendering/LineRendering.pde b/java/examples/Demos/Performance/LineRendering/LineRendering.pde deleted file mode 100755 index 2323e86a5..000000000 --- a/java/examples/Demos/Performance/LineRendering/LineRendering.pde +++ /dev/null @@ -1,24 +0,0 @@ - -public void setup() { - size(800, 600, P2D); -} - -public void draw() { - background(255); - stroke(0, 10); - for (int i = 0; i < 50000; i++) { - float x0 = random(width); - float y0 = random(height); - float z0 = random(-100, 100); - float x1 = random(width); - float y1 = random(height); - float z1 = random(-100, 100); - - // purely 2D lines will trigger the GLU - // tessellator to add accurate line caps, - // but performance will be substantially - // lower. - line(x0, y0, z0, x1, y1, z1); - } - if (frameCount % 10 == 0) println(frameRate); -} diff --git a/java/examples/Demos/Performance/QuadRendering/QuadRendering.pde b/java/examples/Demos/Performance/QuadRendering/QuadRendering.pde deleted file mode 100755 index 8323b42bc..000000000 --- a/java/examples/Demos/Performance/QuadRendering/QuadRendering.pde +++ /dev/null @@ -1,17 +0,0 @@ - -public void setup() { - size(800, 600, P2D); - - noStroke(); - fill(0, 1); -} - -public void draw() { - background(255); - for (int i = 0; i < 50000; i++) { - float x = random(width); - float y = random(height); - rect(x, y, 30, 30); - } - if (frameCount % 10 == 0) println(frameRate); -} diff --git a/java/examples/Demos/Performance/StaticParticlesImmediate/StaticParticlesImmediate.pde b/java/examples/Demos/Performance/StaticParticlesImmediate/StaticParticlesImmediate.pde deleted file mode 100644 index 366f9f7ad..000000000 --- a/java/examples/Demos/Performance/StaticParticlesImmediate/StaticParticlesImmediate.pde +++ /dev/null @@ -1,65 +0,0 @@ -PImage sprite; - -int npartTotal = 50000; -float partSize = 20; - -PVector positions[]; - -int fcount, lastm; -float frate; -int fint = 3; - -void setup() { - size(800, 600, P3D); - frameRate(60); - - sprite = loadImage("sprite.png"); - - initPositions(); - - // Writing to the depth buffer is disabled to avoid rendering - // artifacts due to the fact that the particles are semi-transparent - // but not z-sorted. - hint(DISABLE_DEPTH_MASK); -} - -void draw () { - background(0); - - translate(width/2, height/2); - rotateY(frameCount * 0.01); - - for (int n = 0; n < npartTotal; n++) { - drawParticle(positions[n]); - } - - fcount += 1; - int m = millis(); - if (m - lastm > 1000 * fint) { - frate = float(fcount) / fint; - fcount = 0; - lastm = m; - println("fps: " + frate); - } -} - -void drawParticle(PVector center) { - beginShape(QUAD); - noStroke(); - tint(255); - texture(sprite); - normal(0, 0, 1); - vertex(center.x - partSize/2, center.y - partSize/2, center.z, 0, 0); - vertex(center.x + partSize/2, center.y - partSize/2, center.z, sprite.width, 0); - vertex(center.x + partSize/2, center.y + partSize/2, center.z, sprite.width, sprite.height); - vertex(center.x - partSize/2, center.y + partSize/2, center.z, 0, sprite.height); - endShape(); -} - -void initPositions() { - positions = new PVector[npartTotal]; - for (int n = 0; n < positions.length; n++) { - positions[n] = new PVector(random(-500, +500), random(-500, +500), random(-500, +500)); - } -} - diff --git a/java/examples/Demos/Performance/StaticParticlesRetained/StaticParticlesRetained.pde b/java/examples/Demos/Performance/StaticParticlesRetained/StaticParticlesRetained.pde deleted file mode 100644 index 76f807473..000000000 --- a/java/examples/Demos/Performance/StaticParticlesRetained/StaticParticlesRetained.pde +++ /dev/null @@ -1,60 +0,0 @@ -PShape particles; -PImage sprite; - -int npartTotal = 50000; -float partSize = 20; - -int fcount, lastm; -float frate; -int fint = 3; - -void setup() { - size(800, 600, P3D); - frameRate(60); - - particles = createShape(PShape.GROUP); - sprite = loadImage("sprite.png"); - - for (int n = 0; n < npartTotal; n++) { - float cx = random(-500, +500); - float cy = random(-500, +500); - float cz = random(-500, +500); - - PShape part = createShape(); - part.beginShape(QUAD); - part.noStroke(); - part.tint(255); - part.texture(sprite); - part.normal(0, 0, 1); - part.vertex(cx - partSize/2, cy - partSize/2, cz, 0, 0); - part.vertex(cx + partSize/2, cy - partSize/2, cz, sprite.width, 0); - part.vertex(cx + partSize/2, cy + partSize/2, cz, sprite.width, sprite.height); - part.vertex(cx - partSize/2, cy + partSize/2, cz, 0, sprite.height); - part.endShape(); - particles.addChild(part); - } - - // Writing to the depth buffer is disabled to avoid rendering - // artifacts due to the fact that the particles are semi-transparent - // but not z-sorted. - hint(DISABLE_DEPTH_MASK); -} - -void draw () { - background(0); - - translate(width/2, height/2); - rotateY(frameCount * 0.01); - - shape(particles); - - fcount += 1; - int m = millis(); - if (m - lastm > 1000 * fint) { - frate = float(fcount) / fint; - fcount = 0; - lastm = m; - println("fps: " + frate); - } -} - diff --git a/java/examples/Demos/Performance/TextRendering/TextRendering.pde b/java/examples/Demos/Performance/TextRendering/TextRendering.pde deleted file mode 100755 index ddb144e5d..000000000 --- a/java/examples/Demos/Performance/TextRendering/TextRendering.pde +++ /dev/null @@ -1,15 +0,0 @@ - -public void setup() { - size(800, 600, P2D); - fill(0); -} - -public void draw() { - background(255); - for (int i = 0; i < 10000; i++) { - float x = random(width); - float y = random(height); - text("HELLO", x, y); - } - if (frameCount % 10 == 0) println(frameRate); -} diff --git a/java/examples/Demos/Tests/EmbedFrameTest/Arcball.pde b/java/examples/Demos/Tests/EmbedFrameTest/Arcball.pde deleted file mode 100644 index 914e0d1d6..000000000 --- a/java/examples/Demos/Tests/EmbedFrameTest/Arcball.pde +++ /dev/null @@ -1,194 +0,0 @@ -// Ariel and V3ga's arcball class with a couple tiny mods by Robert Hodgin - -class Arcball { - PApplet parent; - float center_x, center_y, radius; - Vec3 v_down, v_drag; - Quat q_now, q_down, q_drag; - Vec3[] axisSet; - int axis; - float mxv, myv; - float x, y; - - Arcball(PApplet parent, float radius){ - this.parent = parent; - this.radius = radius; - - v_down = new Vec3(); - v_drag = new Vec3(); - - q_now = new Quat(); - q_down = new Quat(); - q_drag = new Quat(); - - axisSet = new Vec3[] {new Vec3(1.0f, 0.0f, 0.0f), new Vec3(0.0f, 1.0f, 0.0f), new Vec3(0.0f, 0.0f, 1.0f)}; - axis = -1; // no constraints... - } - - void mousePressed(){ - v_down = mouse_to_sphere(parent.mouseX, parent.mouseY); - q_down.set(q_now); - q_drag.reset(); - } - - void mouseDragged(){ - v_drag = mouse_to_sphere(parent.mouseX, parent.mouseY); - q_drag.set(Vec3.dot(v_down, v_drag), Vec3.cross(v_down, v_drag)); - } - - void run(){ - center_x = parent.width/2.0; - center_y = parent.height/2.0; - - q_now = Quat.mul(q_drag, q_down); - parent.translate(center_x, center_y); - applyQuat2Matrix(q_now); - - x += mxv; - y += myv; - mxv -= mxv * .01; - myv -= myv * .01; - } - - Vec3 mouse_to_sphere(float x, float y){ - Vec3 v = new Vec3(); - v.x = (x - center_x) / radius; - v.y = (y - center_y) / radius; - - float mag = v.x * v.x + v.y * v.y; - if (mag > 1.0f){ - v.normalize(); - } else { - v.z = sqrt(1.0f - mag); - } - - return (axis == -1) ? v : constrain_vector(v, axisSet[axis]); - } - - Vec3 constrain_vector(Vec3 vector, Vec3 axis){ - Vec3 res = new Vec3(); - res.sub(vector, Vec3.mul(axis, Vec3.dot(axis, vector))); - res.normalize(); - return res; - } - - void applyQuat2Matrix(Quat q){ - // instead of transforming q into a matrix and applying it... - - float[] aa = q.getValue(); - parent.rotate(aa[0], aa[1], aa[2], aa[3]); - } -} - -static class Vec3{ - float x, y, z; - - Vec3(){ - } - - Vec3(float x, float y, float z){ - this.x = x; - this.y = y; - this.z = z; - } - - void normalize(){ - float length = length(); - x /= length; - y /= length; - z /= length; - } - - float length(){ - return (float) Math.sqrt(x * x + y * y + z * z); - } - - static Vec3 cross(Vec3 v1, Vec3 v2){ - Vec3 res = new Vec3(); - res.x = v1.y * v2.z - v1.z * v2.y; - res.y = v1.z * v2.x - v1.x * v2.z; - res.z = v1.x * v2.y - v1.y * v2.x; - return res; - } - - static float dot(Vec3 v1, Vec3 v2){ - return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z; - } - - static Vec3 mul(Vec3 v, float d){ - Vec3 res = new Vec3(); - res.x = v.x * d; - res.y = v.y * d; - res.z = v.z * d; - return res; - } - - void sub(Vec3 v1, Vec3 v2){ - x = v1.x - v2.x; - y = v1.y - v2.y; - z = v1.z - v2.z; - } -} - -static class Quat{ - float w, x, y, z; - - Quat(){ - reset(); - } - - Quat(float w, float x, float y, float z){ - this.w = w; - this.x = x; - this.y = y; - this.z = z; - } - - void reset(){ - w = 1.0f; - x = 0.0f; - y = 0.0f; - z = 0.0f; - } - - void set(float w, Vec3 v){ - this.w = w; - x = v.x; - y = v.y; - z = v.z; - } - - void set(Quat q){ - w = q.w; - x = q.x; - y = q.y; - z = q.z; - } - - static Quat mul(Quat q1, Quat q2){ - Quat res = new Quat(); - res.w = q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z; - res.x = q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y; - res.y = q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z; - res.z = q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x; - return res; - } - - float[] getValue(){ - // transforming this quat into an angle and an axis vector... - - float[] res = new float[4]; - - float sa = (float) Math.sqrt(1.0f - w * w); - if (sa < EPSILON){ - sa = 1.0f; - } - - res[0] = (float) Math.acos(w) * 2.0f; - res[1] = x / sa; - res[2] = y / sa; - res[3] = z / sa; - - return res; - } -} diff --git a/java/examples/Demos/Tests/EmbedFrameTest/EmbedFrameTest.pde b/java/examples/Demos/Tests/EmbedFrameTest/EmbedFrameTest.pde deleted file mode 100644 index 2dda37a4e..000000000 --- a/java/examples/Demos/Tests/EmbedFrameTest/EmbedFrameTest.pde +++ /dev/null @@ -1,103 +0,0 @@ -// Based on code by GeneKao (https://github.com/GeneKao) - -import javax.swing.JFrame; -import java.awt.BorderLayout; -import java.awt.Insets; -EmbeddedSketch eSketch; -ChildApplet child = new ChildApplet(); -boolean mousePressedOnParent = false; -Arcball arcball, arcball2; - -void setup() { - size(320, 240, P3D); - arcball = new Arcball(this, 300); - eSketch = new EmbeddedSketch(child); - smooth(); -} - -void draw() { - background(250); - arcball.run(); - if (mousePressed) { - fill(0); - text("Mouse pressed on parent.", 10, 10); - fill(0, 240, 0); - ellipse(mouseX, mouseY, 60, 60); - mousePressedOnParent = true; - } else { - fill(20); - ellipse(width/2, height/2, 60, 60); - mousePressedOnParent = false; - } - box(100); - if (eSketch.sketch.mousePressed) { - text("Mouse pressed on child.", 10, 30); - } -} - -void mousePressed(){ - arcball.mousePressed(); -} - -void mouseDragged(){ - arcball.mouseDragged(); -} - -//The JFrame which will contain the child applet -class EmbeddedSketch extends JFrame { - PApplet sketch; - EmbeddedSketch(PApplet p) { - int w = 400; - int h = 400; - sketch = p; - setVisible(true); - - setLayout(new BorderLayout()); - add(p, BorderLayout.CENTER); - p.init(); - - Insets insets = getInsets(); - setSize(insets.left + w, insets.top + h); - p.setBounds(insets.left, insets.top, w, h); - - setLocation(500, 200); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - } -} - -class ChildApplet extends PApplet { - void setup() { - size(400, 400, P3D); - smooth(); - arcball2 = new Arcball(this, 300); - } - - void draw() { - background(0); - arcball2.run(); - if (mousePressed) { - fill(240, 0, 0); - ellipse(mouseX, mouseY, 20, 20); - fill(255); - text("Mouse pressed on child.", 10, 30); - } else { - fill(255); - ellipse(width/2, height/2, 20, 20); - } - - box(100, 200, 100); - if (mousePressedOnParent) { - fill(255); - text("Mouse pressed on parent", 20, 20); - } - } - - void mousePressed(){ - arcball2.mousePressed(); - } - - void mouseDragged(){ - arcball2.mouseDragged(); - } -} - diff --git a/java/examples/Demos/Tests/NoBackgroundTest/NoBackgroundTest.pde b/java/examples/Demos/Tests/NoBackgroundTest/NoBackgroundTest.pde deleted file mode 100644 index a5a1d5aa0..000000000 --- a/java/examples/Demos/Tests/NoBackgroundTest/NoBackgroundTest.pde +++ /dev/null @@ -1,10 +0,0 @@ -void setup() { - size(400, 400, P2D); - background(255, 0, 0); - fill(255, 150); -} - -void draw() { - ellipse(mouseX, mouseY, 100, 100); -} - diff --git a/java/examples/Demos/Tests/OffscreenTest/OffscreenTest.pde b/java/examples/Demos/Tests/OffscreenTest/OffscreenTest.pde deleted file mode 100644 index 1c4a56e7e..000000000 --- a/java/examples/Demos/Tests/OffscreenTest/OffscreenTest.pde +++ /dev/null @@ -1,29 +0,0 @@ -PGraphics pg; - -void setup() { - size(400, 400, P3D); - - pg = createGraphics(400, 400, P3D); - pg.smooth(4); -} - -void draw() { - background(0); - - pg.beginDraw(); - pg.background(255, 0, 0); - pg.ellipse(mouseX, mouseY, 100, 100); - pg.endDraw(); - - image(pg, 0, 0, 400, 400); -} - -void keyPressed() { - if (key == '1') pg.smooth(1); - else if (key == '2') pg.smooth(2); - else if (key == '3') pg.smooth(4); - else if (key == '4') pg.smooth(8); - else if (key == '5') pg.smooth(16); - else if (key == '6') pg.smooth(32); -} - diff --git a/java/examples/Demos/Tests/RedrawTest/RedrawTest.pde b/java/examples/Demos/Tests/RedrawTest/RedrawTest.pde deleted file mode 100644 index 7cd352736..000000000 --- a/java/examples/Demos/Tests/RedrawTest/RedrawTest.pde +++ /dev/null @@ -1,14 +0,0 @@ -void setup() { - size(400, 400, P3D); - noLoop(); -} - -void draw() { - background(255, 0, 0); - ellipse(mouseX, mouseY, 100, 50); - println("draw"); -} - -void keyPressed() { - redraw(); -} diff --git a/java/examples/Demos/Tests/ResizeTest/ResizeTest.pde b/java/examples/Demos/Tests/ResizeTest/ResizeTest.pde deleted file mode 100644 index 5e6fe68bf..000000000 --- a/java/examples/Demos/Tests/ResizeTest/ResizeTest.pde +++ /dev/null @@ -1,10 +0,0 @@ -void setup() { - size(400, 400, P3D); - frame.setResizable(true); -} - -void draw() { - background(255, 0, 0); - ellipse(width/2, height/2, 100, 50); -} - diff --git a/java/examples/Demos/Tests/RestartTest/RestartTest.pde b/java/examples/Demos/Tests/RestartTest/RestartTest.pde deleted file mode 100644 index 8d03730cd..000000000 --- a/java/examples/Demos/Tests/RestartTest/RestartTest.pde +++ /dev/null @@ -1,26 +0,0 @@ -PShape cube; - -void setup() { - size(400, 400, P3D); - smooth(); - - cube = createShape(BOX, 100); -} - -void draw() { - background(120); - - lights(); - - translate(mouseX, mouseY); - rotateX(frameCount * 0.01f); - rotateY(frameCount * 0.01f); - - shape(cube); -} - -void keyPressed() { - // Changing the smooth configuration restarts the OpenGL surface. - // Automatically recreates all the current GL resources. - noSmooth(); -} diff --git a/java/examples/Demos/Tests/SmoothTest/SmoothTest.pde b/java/examples/Demos/Tests/SmoothTest/SmoothTest.pde deleted file mode 100644 index dfefb30a4..000000000 --- a/java/examples/Demos/Tests/SmoothTest/SmoothTest.pde +++ /dev/null @@ -1,19 +0,0 @@ -void setup() { - size(400, 400, P3D); - smooth(2); -} - -void draw() { - background(255, 0, 0); - ellipse(mouseX, mouseY, 100, 100); -} - -void keyPressed() { - if (key == '1') smooth(1); - else if (key == '2') smooth(2); - else if (key == '3') smooth(4); - else if (key == '4') smooth(8); - else if (key == '5') smooth(16); - else if (key == '6') smooth(32); -} - diff --git a/java/examples/Demos/Tests/SpecsTest/SpecsTest.pde b/java/examples/Demos/Tests/SpecsTest/SpecsTest.pde deleted file mode 100644 index 4217d51b1..000000000 --- a/java/examples/Demos/Tests/SpecsTest/SpecsTest.pde +++ /dev/null @@ -1,7 +0,0 @@ -size(100, 100, P3D); -PGraphicsOpenGL pg = (PGraphicsOpenGL)g; -println(pg.OPENGL_VENDOR); -println(pg.OPENGL_RENDERER); -println(pg.OPENGL_VERSION); -println(pg.GLSL_VERSION); -println(pg.OPENGL_EXTENSIONS); \ No newline at end of file diff --git a/java/examples/Topics/Advanced Data/ArrayListClass/ArrayListClass.pde b/java/examples/Topics/Advanced Data/ArrayListClass/ArrayListClass.pde deleted file mode 100644 index 475d8344b..000000000 --- a/java/examples/Topics/Advanced Data/ArrayListClass/ArrayListClass.pde +++ /dev/null @@ -1,51 +0,0 @@ -/** - * ArrayList of objects - * by Daniel Shiffman. - * - * This example demonstrates how to use a Java ArrayList to store - * a variable number of objects. Items can be added and removed - * from the ArrayList. - * - * Click the mouse to add bouncing balls. - */ - -ArrayList balls; -int ballWidth = 48; - -void setup() { - size(640, 360); - noStroke(); - - // Create an empty ArrayList (will store Ball objects) - balls = new ArrayList(); - - // Start by adding one element - balls.add(new Ball(width/2, 0, ballWidth)); -} - -void draw() { - background(255); - - // With an array, we say balls.length, with an ArrayList, we say balls.size() - // The length of an ArrayList is dynamic - // Notice how we are looping through the ArrayList backwards - // This is because we are deleting elements from the list - for (int i = balls.size()-1; i >= 0; i--) { - // An ArrayList doesn't know what it is storing so we have to cast the object coming out - Ball ball = balls.get(i); - ball.move(); - ball.display(); - if (ball.finished()) { - // Items can be deleted with remove() - balls.remove(i); - } - - } - -} - -void mousePressed() { - // A new ball object is added to the ArrayList (by default to the end) - balls.add(new Ball(mouseX, mouseY, ballWidth)); -} - diff --git a/java/examples/Topics/Advanced Data/ArrayListClass/Ball.pde b/java/examples/Topics/Advanced Data/ArrayListClass/Ball.pde deleted file mode 100644 index 3f613b787..000000000 --- a/java/examples/Topics/Advanced Data/ArrayListClass/Ball.pde +++ /dev/null @@ -1,50 +0,0 @@ -// Simple bouncing ball class - -class Ball { - - float x; - float y; - float speed; - float gravity; - float w; - float life = 255; - - Ball(float tempX, float tempY, float tempW) { - x = tempX; - y = tempY; - w = tempW; - speed = 0; - gravity = 0.1; - } - - void move() { - // Add gravity to speed - speed = speed + gravity; - // Add speed to y location - y = y + speed; - // If square reaches the bottom - // Reverse speed - if (y > height) { - // Dampening - speed = speed * -0.8; - y = height; - } - } - - boolean finished() { - // Balls fade out - life--; - if (life < 0) { - return true; - } else { - return false; - } - } - - void display() { - // Display the circle - fill(0,life); - //stroke(0,life); - ellipse(x,y,w,w); - } -} diff --git a/java/examples/Topics/Advanced Data/CountingStrings/CountingStrings.pde b/java/examples/Topics/Advanced Data/CountingStrings/CountingStrings.pde deleted file mode 100644 index 77775c61a..000000000 --- a/java/examples/Topics/Advanced Data/CountingStrings/CountingStrings.pde +++ /dev/null @@ -1,84 +0,0 @@ -/** - * CountingString example - * by Daniel Shiffman. - * - * This example demonstrates how to use a IntDict to store - * a number associated with a String. Java HashMaps can also - * be used for this, however, this example uses the IntDict - * class offered by Processing's data package for simplicity - * and added functionality. - * - * This example uses the IntDict to perform a simple concordance - * http://en.wikipedia.org/wiki/Concordance_(publishing) - * - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs font="Georgia.ttf"; */ - -// An IntDict pairs Strings with integers -IntDict concordance; - -// The raw array of words in -String[] tokens; -int counter = 0; - -void setup() { - size(640, 360); - - concordance = new IntDict(); - - // Load file and chop it up - String[] lines = loadStrings("dracula.txt"); - String allText = join(lines, " ").toLowerCase(); - tokens = splitTokens(allText, " ,.?!:;[]-\""); - - // Create the font - textFont(createFont("Georgia", 24)); -} - -void draw() { - background(51); - fill(255); - - // Look at words one at a time - if (counter < tokens.length) { - String s = tokens[counter]; - counter++; - concordance.increment(s); - } - - // x and y will be used to locate each word - float x = 0; - float y = 48; - - concordance.sortValues(); - - String[] keys = concordance.keyArray(); - - // Look at each word - for (String word : keys) { - int count = concordance.get(word); - - // Only display words that appear 3 times - if (count > 3) { - // The size is the count - int fsize = constrain(count, 0, 48); - textSize(fsize); - text(word, x, y); - // Move along the x-axis - x += textWidth(word + " "); - } - - // If x gets to the end, move y - if (x > width) { - x = 0; - y += 48; - // If y gets to the end, we're done - if (y > height) { - break; - } - } - } -} - diff --git a/java/examples/Topics/Advanced Data/CountingStrings/data/Georgia.ttf b/java/examples/Topics/Advanced Data/CountingStrings/data/Georgia.ttf deleted file mode 100644 index 27d1c1951..000000000 Binary files a/java/examples/Topics/Advanced Data/CountingStrings/data/Georgia.ttf and /dev/null differ diff --git a/java/examples/Topics/Advanced Data/CountingStrings/data/dracula.txt b/java/examples/Topics/Advanced Data/CountingStrings/data/dracula.txt deleted file mode 100644 index 7fb73f568..000000000 --- a/java/examples/Topics/Advanced Data/CountingStrings/data/dracula.txt +++ /dev/null @@ -1,16624 +0,0 @@ -The Project Gutenberg EBook of Dracula, by Bram Stoker - -This eBook is for the use of anyone anywhere at no cost and with -almost no restrictions whatsoever. You may copy it, give it away or -re-use it under the terms of the Project Gutenberg License included -with this eBook or online at www.gutenberg.net - - -Title: Dracula - -Author: Bram Stoker - -Release Date: May 9, 2008 [EBook #345] - -Language: English - -Character set encoding: ASCII - -*** START OF THIS PROJECT GUTENBERG EBOOK DRACULA *** - - - - - - - - - - - - - - -DRACULA - -by - -Bram Stoker - - -1897 edition - - - - -TABLE OF CONTENTS - - -CHAPTER - - 1 Jonathan Harker's Journal - 2 Jonathan Harker's Journal - 3 Jonathan Harker's Journal - 4 Jonathan Harker's Journal - 5 Letter From Miss Mina Murray To Miss Lucy Westenra - 6 Mina Murray's Journal - 7 Cutting From "The Dailygraph", 8 August - 8 Mina Murray's Journal - 9 Letter, Mina Harker To Lucy Westenra - 10 Letter, Dr. Seward To Hon. Arthur Holmwood - 11 Lucy Westenra's Diary - 12 Dr. Seward's Diary - 13 Dr. Seward's Diary - 14 Mina Harker's Journal - 15 Dr. Seward's Diary - 16 Dr. Seward's Diary - 17 Dr. Seward's Diary - 18 Dr. Seward's Diary - 19 Jonathan Harker's Journal - 20 Jonathan Harker's Journal - 21 Dr. Seward's Diary - 22 Jonathan Harker's Journal - 23 Dr. Seward's Diary - 24 Dr. Seward's Phonograph Diary - 25 Dr. Seward's Diary - 26 Dr. Seward's Diary - 27 Mina Harker's Journal - - - - -CHAPTER 1 - - -Jonathan Harker's Journal - -3 May. Bistritz.--Left Munich at 8:35 P.M., on 1st May, arriving at -Vienna early next morning; should have arrived at 6:46, but train was -an hour late. Buda-Pesth seems a wonderful place, from the glimpse -which I got of it from the train and the little I could walk through -the streets. I feared to go very far from the station, as we had -arrived late and would start as near the correct time as possible. - -The impression I had was that we were leaving the West and entering the -East; the most western of splendid bridges over the Danube, which is -here of noble width and depth, took us among the traditions of Turkish -rule. - -We left in pretty good time, and came after nightfall to Klausenburgh. -Here I stopped for the night at the Hotel Royale. I had for dinner, -or rather supper, a chicken done up some way with red pepper, which -was very good but thirsty. (Mem. get recipe for Mina.) I asked the -waiter, and he said it was called "paprika hendl," and that, as it was -a national dish, I should be able to get it anywhere along the -Carpathians. - -I found my smattering of German very useful here, indeed, I don't know -how I should be able to get on without it. - -Having had some time at my disposal when in London, I had visited the -British Museum, and made search among the books and maps in the -library regarding Transylvania; it had struck me that some -foreknowledge of the country could hardly fail to have some importance -in dealing with a nobleman of that country. - - -I find that the district he named is in the extreme east of the -country, just on the borders of three states, Transylvania, Moldavia, -and Bukovina, in the midst of the Carpathian mountains; one of the -wildest and least known portions of Europe. - -I was not able to light on any map or work giving the exact locality -of the Castle Dracula, as there are no maps of this country as yet to -compare with our own Ordance Survey Maps; but I found that Bistritz, -the post town named by Count Dracula, is a fairly well-known place. I -shall enter here some of my notes, as they may refresh my memory when -I talk over my travels with Mina. - -In the population of Transylvania there are four distinct -nationalities: Saxons in the South, and mixed with them the Wallachs, -who are the descendants of the Dacians; Magyars in the West, and -Szekelys in the East and North. I am going among the latter, who -claim to be descended from Attila and the Huns. This may be so, for -when the Magyars conquered the country in the eleventh century they -found the Huns settled in it. - -I read that every known superstition in the world is gathered into the -horseshoe of the Carpathians, as if it were the centre of some sort of -imaginative whirlpool; if so my stay may be very interesting. (Mem., -I must ask the Count all about them.) - -I did not sleep well, though my bed was comfortable enough, for I had -all sorts of queer dreams. There was a dog howling all night under my -window, which may have had something to do with it; or it may have -been the paprika, for I had to drink up all the water in my carafe, -and was still thirsty. Towards morning I slept and was wakened by the -continuous knocking at my door, so I guess I must have been sleeping -soundly then. - -I had for breakfast more paprika, and a sort of porridge of maize -flour which they said was "mamaliga", and egg-plant stuffed with -forcemeat, a very excellent dish, which they call "impletata". (Mem., -get recipe for this also.) - -I had to hurry breakfast, for the train started a little before eight, -or rather it ought to have done so, for after rushing to the station -at 7:30 I had to sit in the carriage for more than an hour before we -began to move. - -It seems to me that the further east you go the more unpunctual are -the trains. What ought they to be in China? - -All day long we seemed to dawdle through a country which was full of -beauty of every kind. Sometimes we saw little towns or castles on the -top of steep hills such as we see in old missals; sometimes we ran by -rivers and streams which seemed from the wide stony margin on each -side of them to be subject to great floods. It takes a lot of water, -and running strong, to sweep the outside edge of a river clear. - -At every station there were groups of people, sometimes crowds, and in -all sorts of attire. Some of them were just like the peasants at home -or those I saw coming through France and Germany, with short jackets, -and round hats, and home-made trousers; but others were very -picturesque. - -The women looked pretty, except when you got near them, but they were -very clumsy about the waist. They had all full white sleeves of some -kind or other, and most of them had big belts with a lot of strips of -something fluttering from them like the dresses in a ballet, but of -course there were petticoats under them. - -The strangest figures we saw were the Slovaks, who were more barbarian -than the rest, with their big cow-boy hats, great baggy dirty-white -trousers, white linen shirts, and enormous heavy leather belts, nearly -a foot wide, all studded over with brass nails. They wore high boots, -with their trousers tucked into them, and had long black hair and -heavy black moustaches. They are very picturesque, but do not look -prepossessing. On the stage they would be set down at once as some -old Oriental band of brigands. They are, however, I am told, very -harmless and rather wanting in natural self-assertion. - -It was on the dark side of twilight when we got to Bistritz, which is -a very interesting old place. Being practically on the frontier--for -the Borgo Pass leads from it into Bukovina--it has had a very stormy -existence, and it certainly shows marks of it. Fifty years ago a -series of great fires took place, which made terrible havoc on five -separate occasions. At the very beginning of the seventeenth century -it underwent a siege of three weeks and lost 13,000 people, the -casualties of war proper being assisted by famine and disease. - -Count Dracula had directed me to go to the Golden Krone Hotel, which I -found, to my great delight, to be thoroughly old-fashioned, for of -course I wanted to see all I could of the ways of the country. - -I was evidently expected, for when I got near the door I faced a -cheery-looking elderly woman in the usual peasant dress--white -undergarment with a long double apron, front, and back, of coloured -stuff fitting almost too tight for modesty. When I came close she -bowed and said, "The Herr Englishman?" - -"Yes," I said, "Jonathan Harker." - -She smiled, and gave some message to an elderly man in white -shirtsleeves, who had followed her to the door. - -He went, but immediately returned with a letter: - -"My friend.--Welcome to the Carpathians. I am anxiously expecting -you. Sleep well tonight. At three tomorrow the diligence will -start for Bukovina; a place on it is kept for you. At the Borgo -Pass my carriage will await you and will bring you to me. I trust -that your journey from London has been a happy one, and that you -will enjoy your stay in my beautiful land.--Your friend, Dracula." - - -4 May--I found that my landlord had got a letter from the Count, -directing him to secure the best place on the coach for me; but on -making inquiries as to details he seemed somewhat reticent, and -pretended that he could not understand my German. - -This could not be true, because up to then he had understood it -perfectly; at least, he answered my questions exactly as if he did. - -He and his wife, the old lady who had received me, looked at each -other in a frightened sort of way. He mumbled out that the money had -been sent in a letter, and that was all he knew. When I asked him if -he knew Count Dracula, and could tell me anything of his castle, both -he and his wife crossed themselves, and, saying that they knew nothing -at all, simply refused to speak further. It was so near the time of -starting that I had no time to ask anyone else, for it was all very -mysterious and not by any means comforting. - -Just before I was leaving, the old lady came up to my room and said in -a hysterical way: "Must you go? Oh! Young Herr, must you go?" She -was in such an excited state that she seemed to have lost her grip of -what German she knew, and mixed it all up with some other language -which I did not know at all. I was just able to follow her by asking -many questions. When I told her that I must go at once, and that I -was engaged on important business, she asked again: - -"Do you know what day it is?" I answered that it was the fourth of -May. She shook her head as she said again: - -"Oh, yes! I know that! I know that, but do you know what day it is?" - -On my saying that I did not understand, she went on: - -"It is the eve of St. George's Day. Do you not know that tonight, -when the clock strikes midnight, all the evil things in the world will -have full sway? Do you know where you are going, and what you are -going to?" She was in such evident distress that I tried to comfort -her, but without effect. Finally, she went down on her knees and -implored me not to go; at least to wait a day or two before starting. - -It was all very ridiculous but I did not feel comfortable. However, -there was business to be done, and I could allow nothing to interfere -with it. - -I tried to raise her up, and said, as gravely as I could, that I -thanked her, but my duty was imperative, and that I must go. - -She then rose and dried her eyes, and taking a crucifix from her neck -offered it to me. - -I did not know what to do, for, as an English Churchman, I have been -taught to regard such things as in some measure idolatrous, and yet it -seemed so ungracious to refuse an old lady meaning so well and in such -a state of mind. - -She saw, I suppose, the doubt in my face, for she put the rosary round -my neck and said, "For your mother's sake," and went out of the room. - -I am writing up this part of the diary whilst I am waiting for the -coach, which is, of course, late; and the crucifix is still round my -neck. - -Whether it is the old lady's fear, or the many ghostly traditions of -this place, or the crucifix itself, I do not know, but I am not -feeling nearly as easy in my mind as usual. - -If this book should ever reach Mina before I do, let it bring my -goodbye. Here comes the coach! - - -5 May. The Castle.--The gray of the morning has passed, and the sun -is high over the distant horizon, which seems jagged, whether with -trees or hills I know not, for it is so far off that big things and -little are mixed. - -I am not sleepy, and, as I am not to be called till I awake, naturally -I write till sleep comes. - -There are many odd things to put down, and, lest who reads them may -fancy that I dined too well before I left Bistritz, let me put down my -dinner exactly. - -I dined on what they called "robber steak"--bits of bacon, onion, and -beef, seasoned with red pepper, and strung on sticks, and roasted over -the fire, in simple style of the London cat's meat! - -The wine was Golden Mediasch, which produces a queer sting on the -tongue, which is, however, not disagreeable. - -I had only a couple of glasses of this, and nothing else. - -When I got on the coach, the driver had not taken his seat, and I saw -him talking to the landlady. - -They were evidently talking of me, for every now and then they looked -at me, and some of the people who were sitting on the bench outside -the door--came and listened, and then looked at me, most of them -pityingly. I could hear a lot of words often repeated, queer words, -for there were many nationalities in the crowd, so I quietly got my -polyglot dictionary from my bag and looked them out. - -I must say they were not cheering to me, for amongst them were -"Ordog"--Satan, "Pokol"--hell, "stregoica"--witch, "vrolok" and -"vlkoslak"--both mean the same thing, one being Slovak and the other -Servian for something that is either werewolf or vampire. (Mem., I -must ask the Count about these superstitions.) - -When we started, the crowd round the inn door, which had by this time -swelled to a considerable size, all made the sign of the cross and -pointed two fingers towards me. - -With some difficulty, I got a fellow passenger to tell me what they -meant. He would not answer at first, but on learning that I was -English, he explained that it was a charm or guard against the evil -eye. - -This was not very pleasant for me, just starting for an unknown place -to meet an unknown man. But everyone seemed so kind-hearted, and so -sorrowful, and so sympathetic that I could not but be touched. - -I shall never forget the last glimpse which I had of the inn yard and -its crowd of picturesque figures, all crossing themselves, as they -stood round the wide archway, with its background of rich foliage of -oleander and orange trees in green tubs clustered in the centre of the -yard. - -Then our driver, whose wide linen drawers covered the whole front of -the boxseat,--"gotza" they call them--cracked his big whip over his -four small horses, which ran abreast, and we set off on our journey. - -I soon lost sight and recollection of ghostly fears in the beauty of -the scene as we drove along, although had I known the language, or -rather languages, which my fellow-passengers were speaking, I might -not have been able to throw them off so easily. Before us lay a green -sloping land full of forests and woods, with here and there steep -hills, crowned with clumps of trees or with farmhouses, the blank -gable end to the road. There was everywhere a bewildering mass of -fruit blossom--apple, plum, pear, cherry. And as we drove by I could -see the green grass under the trees spangled with the fallen petals. -In and out amongst these green hills of what they call here the -"Mittel Land" ran the road, losing itself as it swept round the grassy -curve, or was shut out by the straggling ends of pine woods, which -here and there ran down the hillsides like tongues of flame. The road -was rugged, but still we seemed to fly over it with a feverish haste. -I could not understand then what the haste meant, but the driver was -evidently bent on losing no time in reaching Borgo Prund. I was told -that this road is in summertime excellent, but that it had not yet -been put in order after the winter snows. In this respect it is -different from the general run of roads in the Carpathians, for it is -an old tradition that they are not to be kept in too good order. Of -old the Hospadars would not repair them, lest the Turk should think -that they were preparing to bring in foreign troops, and so hasten the -war which was always really at loading point. - -Beyond the green swelling hills of the Mittel Land rose mighty slopes -of forest up to the lofty steeps of the Carpathians themselves. Right -and left of us they towered, with the afternoon sun falling full upon -them and bringing out all the glorious colours of this beautiful -range, deep blue and purple in the shadows of the peaks, green and -brown where grass and rock mingled, and an endless perspective of -jagged rock and pointed crags, till these were themselves lost in the -distance, where the snowy peaks rose grandly. Here and there seemed -mighty rifts in the mountains, through which, as the sun began to -sink, we saw now and again the white gleam of falling water. One of -my companions touched my arm as we swept round the base of a hill and -opened up the lofty, snow-covered peak of a mountain, which seemed, as -we wound on our serpentine way, to be right before us. - -"Look! Isten szek!"--"God's seat!"--and he crossed himself reverently. - -As we wound on our endless way, and the sun sank lower and lower -behind us, the shadows of the evening began to creep round us. This -was emphasized by the fact that the snowy mountain-top still held the -sunset, and seemed to glow out with a delicate cool pink. Here and -there we passed Cszeks and slovaks, all in picturesque attire, but I -noticed that goitre was painfully prevalent. By the roadside were -many crosses, and as we swept by, my companions all crossed -themselves. Here and there was a peasant man or woman kneeling before -a shrine, who did not even turn round as we approached, but seemed in -the self-surrender of devotion to have neither eyes nor ears for the -outer world. There were many things new to me. For instance, -hay-ricks in the trees, and here and there very beautiful masses of -weeping birch, their white stems shining like silver through the -delicate green of the leaves. - -Now and again we passed a leiter-wagon--the ordinary peasants's -cart--with its long, snakelike vertebra, calculated to suit the -inequalities of the road. On this were sure to be seated quite a -group of homecoming peasants, the Cszeks with their white, and the -Slovaks with their coloured sheepskins, the latter carrying -lance-fashion their long staves, with axe at end. As the evening fell -it began to get very cold, and the growing twilight seemed to merge -into one dark mistiness the gloom of the trees, oak, beech, and pine, -though in the valleys which ran deep between the spurs of the hills, -as we ascended through the Pass, the dark firs stood out here and -there against the background of late-lying snow. Sometimes, as the -road was cut through the pine woods that seemed in the darkness to be -closing down upon us, great masses of greyness which here and there -bestrewed the trees, produced a peculiarly weird and solemn effect, -which carried on the thoughts and grim fancies engendered earlier in -the evening, when the falling sunset threw into strange relief the -ghost-like clouds which amongst the Carpathians seem to wind -ceaselessly through the valleys. Sometimes the hills were so steep -that, despite our driver's haste, the horses could only go slowly. I -wished to get down and walk up them, as we do at home, but the driver -would not hear of it. "No, no," he said. "You must not walk here. -The dogs are too fierce." And then he added, with what he evidently -meant for grim pleasantry--for he looked round to catch the approving -smile of the rest--"And you may have enough of such matters before you -go to sleep." The only stop he would make was a moment's pause to -light his lamps. - -When it grew dark there seemed to be some excitement amongst the -passengers, and they kept speaking to him, one after the other, as -though urging him to further speed. He lashed the horses unmercifully -with his long whip, and with wild cries of encouragement urged them on -to further exertions. Then through the darkness I could see a sort of -patch of grey light ahead of us, as though there were a cleft in the -hills. The excitement of the passengers grew greater. The crazy -coach rocked on its great leather springs, and swayed like a boat -tossed on a stormy sea. I had to hold on. The road grew more level, -and we appeared to fly along. Then the mountains seemed to come -nearer to us on each side and to frown down upon us. We were entering -on the Borgo Pass. One by one several of the passengers offered me -gifts, which they pressed upon me with an earnestness which would take -no denial. These were certainly of an odd and varied kind, but each -was given in simple good faith, with a kindly word, and a blessing, -and that same strange mixture of fear-meaning movements which I had -seen outside the hotel at Bistritz--the sign of the cross and the -guard against the evil eye. Then, as we flew along, the driver leaned -forward, and on each side the passengers, craning over the edge of the -coach, peered eagerly into the darkness. It was evident that -something very exciting was either happening or expected, but though I -asked each passenger, no one would give me the slightest explanation. -This state of excitement kept on for some little time. And at last we -saw before us the Pass opening out on the eastern side. There were -dark, rolling clouds overhead, and in the air the heavy, oppressive -sense of thunder. It seemed as though the mountain range had -separated two atmospheres, and that now we had got into the thunderous -one. I was now myself looking out for the conveyance which was to -take me to the Count. Each moment I expected to see the glare of -lamps through the blackness, but all was dark. The only light was the -flickering rays of our own lamps, in which the steam from our -hard-driven horses rose in a white cloud. We could see now the sandy -road lying white before us, but there was on it no sign of a vehicle. -The passengers drew back with a sigh of gladness, which seemed to mock -my own disappointment. I was already thinking what I had best do, -when the driver, looking at his watch, said to the others something -which I could hardly hear, it was spoken so quietly and in so low a -tone, I thought it was "An hour less than the time." Then turning to -me, he spoke in German worse than my own. - -"There is no carriage here. The Herr is not expected after all. He -will now come on to Bukovina, and return tomorrow or the next day, -better the next day." Whilst he was speaking the horses began to -neigh and snort and plunge wildly, so that the driver had to hold them -up. Then, amongst a chorus of screams from the peasants and a -universal crossing of themselves, a caleche, with four horses, drove -up behind us, overtook us, and drew up beside the coach. I could see -from the flash of our lamps as the rays fell on them, that the horses -were coal-black and splendid animals. They were driven by a tall man, -with a long brown beard and a great black hat, which seemed to hide -his face from us. I could only see the gleam of a pair of very bright -eyes, which seemed red in the lamplight, as he turned to us. - -He said to the driver, "You are early tonight, my friend." - -The man stammered in reply, "The English Herr was in a hurry." - -To which the stranger replied, "That is why, I suppose, you wished him -to go on to Bukovina. You cannot deceive me, my friend. I know too -much, and my horses are swift." - -As he spoke he smiled, and the lamplight fell on a hard-looking mouth, -with very red lips and sharp-looking teeth, as white as ivory. One of -my companions whispered to another the line from Burger's "Lenore". - -"Denn die Todten reiten Schnell." ("For the dead travel fast.") - -The strange driver evidently heard the words, for he looked up with a -gleaming smile. The passenger turned his face away, at the same time -putting out his two fingers and crossing himself. "Give me the Herr's -luggage," said the driver, and with exceeding alacrity my bags were -handed out and put in the caleche. Then I descended from the side of -the coach, as the caleche was close alongside, the driver helping me -with a hand which caught my arm in a grip of steel. His strength must -have been prodigious. - -Without a word he shook his reins, the horses turned, and we swept -into the darkness of the pass. As I looked back I saw the steam from -the horses of the coach by the light of the lamps, and projected -against it the figures of my late companions crossing themselves. -Then the driver cracked his whip and called to his horses, and off -they swept on their way to Bukovina. As they sank into the darkness I -felt a strange chill, and a lonely feeling come over me. But a cloak -was thrown over my shoulders, and a rug across my knees, and the -driver said in excellent German--"The night is chill, mein Herr, and -my master the Count bade me take all care of you. There is a flask of -slivovitz (the plum brandy of the country) underneath the seat, if you -should require it." - -I did not take any, but it was a comfort to know it was there all the -same. I felt a little strangely, and not a little frightened. I -think had there been any alternative I should have taken it, instead -of prosecuting that unknown night journey. The carriage went at a -hard pace straight along, then we made a complete turn and went along -another straight road. It seemed to me that we were simply going over -and over the same ground again, and so I took note of some salient -point, and found that this was so. I would have liked to have asked -the driver what this all meant, but I really feared to do so, for I -thought that, placed as I was, any protest would have had no effect in -case there had been an intention to delay. - -By-and-by, however, as I was curious to know how time was passing, I -struck a match, and by its flame looked at my watch. It was within a -few minutes of midnight. This gave me a sort of shock, for I suppose -the general superstition about midnight was increased by my recent -experiences. I waited with a sick feeling of suspense. - -Then a dog began to howl somewhere in a farmhouse far down the road, a -long, agonized wailing, as if from fear. The sound was taken up by -another dog, and then another and another, till, borne on the wind -which now sighed softly through the Pass, a wild howling began, which -seemed to come from all over the country, as far as the imagination -could grasp it through the gloom of the night. - -At the first howl the horses began to strain and rear, but the driver -spoke to them soothingly, and they quieted down, but shivered and -sweated as though after a runaway from sudden fright. Then, far off -in the distance, from the mountains on each side of us began a louder -and a sharper howling, that of wolves, which affected both the horses -and myself in the same way. For I was minded to jump from the caleche -and run, whilst they reared again and plunged madly, so that the -driver had to use all his great strength to keep them from bolting. -In a few minutes, however, my own ears got accustomed to the sound, -and the horses so far became quiet that the driver was able to descend -and to stand before them. - -He petted and soothed them, and whispered something in their ears, as -I have heard of horse-tamers doing, and with extraordinary effect, for -under his caresses they became quite manageable again, though they -still trembled. The driver again took his seat, and shaking his -reins, started off at a great pace. This time, after going to the far -side of the Pass, he suddenly turned down a narrow roadway which ran -sharply to the right. - -Soon we were hemmed in with trees, which in places arched right over -the roadway till we passed as through a tunnel. And again great -frowning rocks guarded us boldly on either side. Though we were in -shelter, we could hear the rising wind, for it moaned and whistled -through the rocks, and the branches of the trees crashed together as -we swept along. It grew colder and colder still, and fine, powdery -snow began to fall, so that soon we and all around us were covered -with a white blanket. The keen wind still carried the howling of the -dogs, though this grew fainter as we went on our way. The baying of -the wolves sounded nearer and nearer, as though they were closing -round on us from every side. I grew dreadfully afraid, and the horses -shared my fear. The driver, however, was not in the least disturbed. -He kept turning his head to left and right, but I could not see -anything through the darkness. - -Suddenly, away on our left I saw a faint flickering blue flame. The -driver saw it at the same moment. He at once checked the horses, and, -jumping to the ground, disappeared into the darkness. I did not know -what to do, the less as the howling of the wolves grew closer. But -while I wondered, the driver suddenly appeared again, and without a -word took his seat, and we resumed our journey. I think I must have -fallen asleep and kept dreaming of the incident, for it seemed to be -repeated endlessly, and now looking back, it is like a sort of awful -nightmare. Once the flame appeared so near the road, that even in the -darkness around us I could watch the driver's motions. He went -rapidly to where the blue flame arose, it must have been very faint, -for it did not seem to illumine the place around it at all, and -gathering a few stones, formed them into some device. - -Once there appeared a strange optical effect. When he stood between -me and the flame he did not obstruct it, for I could see its ghostly -flicker all the same. This startled me, but as the effect was only -momentary, I took it that my eyes deceived me straining through the -darkness. Then for a time there were no blue flames, and we sped -onwards through the gloom, with the howling of the wolves around us, -as though they were following in a moving circle. - -At last there came a time when the driver went further afield than he -had yet gone, and during his absence, the horses began to tremble -worse than ever and to snort and scream with fright. I could not see -any cause for it, for the howling of the wolves had ceased altogether. -But just then the moon, sailing through the black clouds, appeared -behind the jagged crest of a beetling, pine-clad rock, and by its -light I saw around us a ring of wolves, with white teeth and lolling -red tongues, with long, sinewy limbs and shaggy hair. They were a -hundred times more terrible in the grim silence which held them than -even when they howled. For myself, I felt a sort of paralysis of -fear. It is only when a man feels himself face to face with such -horrors that he can understand their true import. - -All at once the wolves began to howl as though the moonlight had had -some peculiar effect on them. The horses jumped about and reared, and -looked helplessly round with eyes that rolled in a way painful to -see. But the living ring of terror encompassed them on every side, -and they had perforce to remain within it. I called to the coachman -to come, for it seemed to me that our only chance was to try to break -out through the ring and to aid his approach, I shouted and beat the -side of the caleche, hoping by the noise to scare the wolves from the -side, so as to give him a chance of reaching the trap. How he came -there, I know not, but I heard his voice raised in a tone of imperious -command, and looking towards the sound, saw him stand in the roadway. -As he swept his long arms, as though brushing aside some impalpable -obstacle, the wolves fell back and back further still. Just then a -heavy cloud passed across the face of the moon, so that we were again -in darkness. - -When I could see again the driver was climbing into the caleche, and -the wolves disappeared. This was all so strange and uncanny that a -dreadful fear came upon me, and I was afraid to speak or move. The -time seemed interminable as we swept on our way, now in almost -complete darkness, for the rolling clouds obscured the moon. - -We kept on ascending, with occasional periods of quick descent, but in -the main always ascending. Suddenly, I became conscious of the fact -that the driver was in the act of pulling up the horses in the -courtyard of a vast ruined castle, from whose tall black windows came -no ray of light, and whose broken battlements showed a jagged line -against the sky. - - - - -CHAPTER 2 - - -Jonathan Harker's Journal Continued - -5 May.--I must have been asleep, for certainly if I had been fully -awake I must have noticed the approach of such a remarkable place. In -the gloom the courtyard looked of considerable size, and as several -dark ways led from it under great round arches, it perhaps seemed -bigger than it really is. I have not yet been able to see it by -daylight. - -When the caleche stopped, the driver jumped down and held out his hand -to assist me to alight. Again I could not but notice his prodigious -strength. His hand actually seemed like a steel vice that could have -crushed mine if he had chosen. Then he took my traps, and placed them -on the ground beside me as I stood close to a great door, old and -studded with large iron nails, and set in a projecting doorway of -massive stone. I could see even in the dim light that the stone was -massively carved, but that the carving had been much worn by time and -weather. As I stood, the driver jumped again into his seat and shook -the reins. The horses started forward, and trap and all disappeared -down one of the dark openings. - -I stood in silence where I was, for I did not know what to do. Of -bell or knocker there was no sign. Through these frowning walls and -dark window openings it was not likely that my voice could penetrate. -The time I waited seemed endless, and I felt doubts and fears crowding -upon me. What sort of place had I come to, and among what kind of -people? What sort of grim adventure was it on which I had embarked? -Was this a customary incident in the life of a solicitor's clerk sent -out to explain the purchase of a London estate to a foreigner? -Solicitor's clerk! Mina would not like that. Solicitor, for just -before leaving London I got word that my examination was successful, -and I am now a full-blown solicitor! I began to rub my eyes and pinch -myself to see if I were awake. It all seemed like a horrible -nightmare to me, and I expected that I should suddenly awake, and find -myself at home, with the dawn struggling in through the windows, as I -had now and again felt in the morning after a day of overwork. But my -flesh answered the pinching test, and my eyes were not to be -deceived. I was indeed awake and among the Carpathians. All I could -do now was to be patient, and to wait the coming of morning. - -Just as I had come to this conclusion I heard a heavy step approaching -behind the great door, and saw through the chinks the gleam of a -coming light. Then there was the sound of rattling chains and the -clanking of massive bolts drawn back. A key was turned with the loud -grating noise of long disuse, and the great door swung back. - -Within, stood a tall old man, clean shaven save for a long white -moustache, and clad in black from head to foot, without a single speck -of colour about him anywhere. He held in his hand an antique silver -lamp, in which the flame burned without a chimney or globe of any -kind, throwing long quivering shadows as it flickered in the draught -of the open door. The old man motioned me in with his right hand with -a courtly gesture, saying in excellent English, but with a strange -intonation. - -"Welcome to my house! Enter freely and of your own free will!" He -made no motion of stepping to meet me, but stood like a statue, as -though his gesture of welcome had fixed him into stone. The instant, -however, that I had stepped over the threshold, he moved impulsively -forward, and holding out his hand grasped mine with a strength which -made me wince, an effect which was not lessened by the fact that it -seemed cold as ice, more like the hand of a dead than a living man. -Again he said, - -"Welcome to my house! Enter freely. Go safely, and leave something -of the happiness you bring!" The strength of the handshake was so -much akin to that which I had noticed in the driver, whose face I had -not seen, that for a moment I doubted if it were not the same person -to whom I was speaking. So to make sure, I said interrogatively, -"Count Dracula?" - -He bowed in a courtly way as he replied, "I am Dracula, and I bid you -welcome, Mr. Harker, to my house. Come in, the night air is chill, -and you must need to eat and rest." As he was speaking, he put the lamp -on a bracket on the wall, and stepping out, took my luggage. He had -carried it in before I could forestall him. I protested, but he -insisted. - -"Nay, sir, you are my guest. It is late, and my people are not -available. Let me see to your comfort myself." He insisted on carrying -my traps along the passage, and then up a great winding stair, and -along another great passage, on whose stone floor our steps rang -heavily. At the end of this he threw open a heavy door, and I -rejoiced to see within a well-lit room in which a table was spread for -supper, and on whose mighty hearth a great fire of logs, freshly -replenished, flamed and flared. - -The Count halted, putting down my bags, closed the door, and crossing -the room, opened another door, which led into a small octagonal room -lit by a single lamp, and seemingly without a window of any sort. -Passing through this, he opened another door, and motioned me to -enter. It was a welcome sight. For here was a great bedroom well -lighted and warmed with another log fire, also added to but lately, -for the top logs were fresh, which sent a hollow roar up the wide -chimney. The Count himself left my luggage inside and withdrew, -saying, before he closed the door. - -"You will need, after your journey, to refresh yourself by making your -toilet. I trust you will find all you wish. When you are ready, come -into the other room, where you will find your supper prepared." - -The light and warmth and the Count's courteous welcome seemed to have -dissipated all my doubts and fears. Having then reached my normal -state, I discovered that I was half famished with hunger. So making a -hasty toilet, I went into the other room. - -I found supper already laid out. My host, who stood on one side of -the great fireplace, leaning against the stonework, made a graceful -wave of his hand to the table, and said, - -"I pray you, be seated and sup how you please. You will I trust, -excuse me that I do not join you, but I have dined already, and I do -not sup." - -I handed to him the sealed letter which Mr. Hawkins had entrusted to -me. He opened it and read it gravely. Then, with a charming smile, -he handed it to me to read. One passage of it, at least, gave me a -thrill of pleasure. - -"I must regret that an attack of gout, from which malady I am a -constant sufferer, forbids absolutely any travelling on my part for -some time to come. But I am happy to say I can send a sufficient -substitute, one in whom I have every possible confidence. He is a -young man, full of energy and talent in his own way, and of a very -faithful disposition. He is discreet and silent, and has grown into -manhood in my service. He shall be ready to attend on you when you -will during his stay, and shall take your instructions in all -matters." - -The count himself came forward and took off the cover of a dish, and I -fell to at once on an excellent roast chicken. This, with some cheese -and a salad and a bottle of old tokay, of which I had two glasses, was -my supper. During the time I was eating it the Count asked me many -questions as to my journey, and I told him by degrees all I had -experienced. - -By this time I had finished my supper, and by my host's desire had -drawn up a chair by the fire and begun to smoke a cigar which he -offered me, at the same time excusing himself that he did not smoke. -I had now an opportunity of observing him, and found him of a very -marked physiognomy. - -His face was a strong, a very strong, aquiline, with high bridge of -the thin nose and peculiarly arched nostrils, with lofty domed -forehead, and hair growing scantily round the temples but profusely -elsewhere. His eyebrows were very massive, almost meeting over the -nose, and with bushy hair that seemed to curl in its own profusion. -The mouth, so far as I could see it under the heavy moustache, was -fixed and rather cruel-looking, with peculiarly sharp white teeth. -These protruded over the lips, whose remarkable ruddiness showed -astonishing vitality in a man of his years. For the rest, his ears -were pale, and at the tops extremely pointed. The chin was broad and -strong, and the cheeks firm though thin. The general effect was one -of extraordinary pallor. - -Hitherto I had noticed the backs of his hands as they lay on his knees -in the firelight, and they had seemed rather white and fine. But -seeing them now close to me, I could not but notice that they were -rather coarse, broad, with squat fingers. Strange to say, there were -hairs in the centre of the palm. The nails were long and fine, and -cut to a sharp point. As the Count leaned over me and his hands -touched me, I could not repress a shudder. It may have been that his -breath was rank, but a horrible feeling of nausea came over me, which, -do what I would, I could not conceal. - -The Count, evidently noticing it, drew back. And with a grim sort of -smile, which showed more than he had yet done his protruberant teeth, -sat himself down again on his own side of the fireplace. We were both -silent for a while, and as I looked towards the window I saw the first -dim streak of the coming dawn. There seemed a strange stillness over -everything. But as I listened, I heard as if from down below in the -valley the howling of many wolves. The Count's eyes gleamed, and he -said. - -"Listen to them, the children of the night. What music they make!" -Seeing, I suppose, some expression in my face strange to him, he -added, "Ah, sir, you dwellers in the city cannot enter into the -feelings of the hunter." Then he rose and said. - -"But you must be tired. Your bedroom is all ready, and tomorrow you -shall sleep as late as you will. I have to be away till the -afternoon, so sleep well and dream well!" With a courteous bow, he -opened for me himself the door to the octagonal room, and I entered my -bedroom. - -I am all in a sea of wonders. I doubt. I fear. I think strange -things, which I dare not confess to my own soul. God keep me, if only -for the sake of those dear to me! - - -7 May.--It is again early morning, but I have rested and enjoyed the -last twenty-four hours. I slept till late in the day, and awoke of my -own accord. When I had dressed myself I went into the room where we -had supped, and found a cold breakfast laid out, with coffee kept hot -by the pot being placed on the hearth. There was a card on the table, -on which was written--"I have to be absent for a while. Do not wait -for me. D." I set to and enjoyed a hearty meal. When I had done, I -looked for a bell, so that I might let the servants know I had -finished, but I could not find one. There are certainly odd -deficiencies in the house, considering the extraordinary evidences of -wealth which are round me. The table service is of gold, and so -beautifully wrought that it must be of immense value. The curtains -and upholstery of the chairs and sofas and the hangings of my bed are -of the costliest and most beautiful fabrics, and must have been of -fabulous value when they were made, for they are centuries old, though -in excellent order. I saw something like them in Hampton Court, but -they were worn and frayed and moth-eaten. But still in none of the -rooms is there a mirror. There is not even a toilet glass on my -table, and I had to get the little shaving glass from my bag before I -could either shave or brush my hair. I have not yet seen a servant -anywhere, or heard a sound near the castle except the howling of -wolves. Some time after I had finished my meal, I do not know whether -to call it breakfast or dinner, for it was between five and six -o'clock when I had it, I looked about for something to read, for I did -not like to go about the castle until I had asked the Count's -permission. There was absolutely nothing in the room, book, -newspaper, or even writing materials, so I opened another door in the -room and found a sort of library. The door opposite mine I tried, but -found locked. - -In the library I found, to my great delight, a vast number of English -books, whole shelves full of them, and bound volumes of magazines and -newspapers. A table in the centre was littered with English magazines -and newspapers, though none of them were of very recent date. The -books were of the most varied kind, history, geography, politics, -political economy, botany, geology, law, all relating to England and -English life and customs and manners. There were even such books of -reference as the London Directory, the "Red" and "Blue" books, -Whitaker's Almanac, the Army and Navy Lists, and it somehow gladdened -my heart to see it, the Law List. - -Whilst I was looking at the books, the door opened, and the Count -entered. He saluted me in a hearty way, and hoped that I had had a -good night's rest. Then he went on. - -"I am glad you found your way in here, for I am sure there is much -that will interest you. These companions," and he laid his hand on -some of the books, "have been good friends to me, and for some years -past, ever since I had the idea of going to London, have given me -many, many hours of pleasure. Through them I have come to know your -great England, and to know her is to love her. I long to go through -the crowded streets of your mighty London, to be in the midst of the -whirl and rush of humanity, to share its life, its change, its death, -and all that makes it what it is. But alas! As yet I only know your -tongue through books. To you, my friend, I look that I know it to -speak." - -"But, Count," I said, "You know and speak English thoroughly!" He -bowed gravely. - -"I thank you, my friend, for your all too-flattering estimate, but yet -I fear that I am but a little way on the road I would travel. True, I -know the grammar and the words, but yet I know not how to speak them." - -"Indeed," I said, "You speak excellently." - -"Not so," he answered. "Well, I know that, did I move and speak in -your London, none there are who would not know me for a stranger. That -is not enough for me. Here I am noble. I am a Boyar. The common -people know me, and I am master. But a stranger in a strange land, he -is no one. Men know him not, and to know not is to care not for. I -am content if I am like the rest, so that no man stops if he sees me, -or pauses in his speaking if he hears my words, 'Ha, ha! A stranger!' -I have been so long master that I would be master still, or at least -that none other should be master of me. You come to me not alone as -agent of my friend Peter Hawkins, of Exeter, to tell me all about my -new estate in London. You shall, I trust, rest here with me a while, -so that by our talking I may learn the English intonation. And I -would that you tell me when I make error, even of the smallest, in my -speaking. I am sorry that I had to be away so long today, but you -will, I know forgive one who has so many important affairs in hand." - -Of course I said all I could about being willing, and asked if I might -come into that room when I chose. He answered, "Yes, certainly," and -added. - -"You may go anywhere you wish in the castle, except where the doors -are locked, where of course you will not wish to go. There is reason -that all things are as they are, and did you see with my eyes and know -with my knowledge, you would perhaps better understand." I said I was -sure of this, and then he went on. - -"We are in Transylvania, and Transylvania is not England. Our ways -are not your ways, and there shall be to you many strange things. Nay, -from what you have told me of your experiences already, you know -something of what strange things there may be." - -This led to much conversation, and as it was evident that he wanted to -talk, if only for talking's sake, I asked him many questions regarding -things that had already happened to me or come within my notice. -Sometimes he sheered off the subject, or turned the conversation by -pretending not to understand, but generally he answered all I asked -most frankly. Then as time went on, and I had got somewhat bolder, I -asked him of some of the strange things of the preceding night, as for -instance, why the coachman went to the places where he had seen the -blue flames. He then explained to me that it was commonly believed -that on a certain night of the year, last night, in fact, when all -evil spirits are supposed to have unchecked sway, a blue flame is seen -over any place where treasure has been concealed. - -"That treasure has been hidden," he went on, "in the region through -which you came last night, there can be but little doubt. For it was -the ground fought over for centuries by the Wallachian, the Saxon, and -the Turk. Why, there is hardly a foot of soil in all this region that -has not been enriched by the blood of men, patriots or invaders. In -the old days there were stirring times, when the Austrian and the -Hungarian came up in hordes, and the patriots went out to meet them, -men and women, the aged and the children too, and waited their coming -on the rocks above the passes, that they might sweep destruction on -them with their artificial avalanches. When the invader was -triumphant he found but little, for whatever there was had been -sheltered in the friendly soil." - -"But how," said I, "can it have remained so long undiscovered, when -there is a sure index to it if men will but take the trouble to look?" -The Count smiled, and as his lips ran back over his gums, the long, -sharp, canine teeth showed out strangely. He answered: - -"Because your peasant is at heart a coward and a fool! Those flames -only appear on one night, and on that night no man of this land will, -if he can help it, stir without his doors. And, dear sir, even if he -did he would not know what to do. Why, even the peasant that you tell -me of who marked the place of the flame would not know where to look -in daylight even for his own work. Even you would not, I dare be -sworn, be able to find these places again?" - -"There you are right," I said. "I know no more than the dead where -even to look for them." Then we drifted into other matters. - -"Come," he said at last, "tell me of London and of the house which you -have procured for me." With an apology for my remissness, I went into -my own room to get the papers from my bag. Whilst I was placing them -in order I heard a rattling of china and silver in the next room, and -as I passed through, noticed that the table had been cleared and the -lamp lit, for it was by this time deep into the dark. The lamps were -also lit in the study or library, and I found the Count lying on the -sofa, reading, of all things in the world, an English Bradshaw's -Guide. When I came in he cleared the books and papers from the table, -and with him I went into plans and deeds and figures of all sorts. He -was interested in everything, and asked me a myriad questions about -the place and its surroundings. He clearly had studied beforehand all -he could get on the subject of the neighbourhood, for he evidently at -the end knew very much more than I did. When I remarked this, he -answered. - -"Well, but, my friend, is it not needful that I should? When I go -there I shall be all alone, and my friend Harker Jonathan, nay, pardon -me. I fall into my country's habit of putting your patronymic first, -my friend Jonathan Harker will not be by my side to correct and aid -me. He will be in Exeter, miles away, probably working at papers of -the law with my other friend, Peter Hawkins. So!" - -We went thoroughly into the business of the purchase of the estate at -Purfleet. When I had told him the facts and got his signature to the -necessary papers, and had written a letter with them ready to post to -Mr. Hawkins, he began to ask me how I had come across so suitable a -place. I read to him the notes which I had made at the time, and -which I inscribe here. - -"At Purfleet, on a byroad, I came across just such a place as seemed -to be required, and where was displayed a dilapidated notice that the -place was for sale. It was surrounded by a high wall, of ancient -structure, built of heavy stones, and has not been repaired for a -large number of years. The closed gates are of heavy old oak and -iron, all eaten with rust. - -"The estate is called Carfax, no doubt a corruption of the old Quatre -Face, as the house is four sided, agreeing with the cardinal points of -the compass. It contains in all some twenty acres, quite surrounded -by the solid stone wall above mentioned. There are many trees on it, -which make it in places gloomy, and there is a deep, dark-looking pond -or small lake, evidently fed by some springs, as the water is clear -and flows away in a fair-sized stream. The house is very large and of -all periods back, I should say, to mediaeval times, for one part is of -stone immensely thick, with only a few windows high up and heavily -barred with iron. It looks like part of a keep, and is close to an -old chapel or church. I could not enter it, as I had not the key of -the door leading to it from the house, but I have taken with my Kodak -views of it from various points. The house had been added to, but in -a very straggling way, and I can only guess at the amount of ground it -covers, which must be very great. There are but few houses close at -hand, one being a very large house only recently added to and formed -into a private lunatic asylum. It is not, however, visible from the -grounds." - -When I had finished, he said, "I am glad that it is old and big. I -myself am of an old family, and to live in a new house would kill me. -A house cannot be made habitable in a day, and after all, how few days -go to make up a century. I rejoice also that there is a chapel of old -times. We Transylvanian nobles love not to think that our bones may -lie amongst the common dead. I seek not gaiety nor mirth, not the -bright voluptuousness of much sunshine and sparkling waters which -please the young and gay. I am no longer young, and my heart, through -weary years of mourning over the dead, is not attuned to mirth. Moreover, -the walls of my castle are broken. The shadows are many, and the wind -breathes cold through the broken battlements and casements. I love -the shade and the shadow, and would be alone with my thoughts when I -may." Somehow his words and his look did not seem to accord, or else -it was that his cast of face made his smile look malignant and -saturnine. - -Presently, with an excuse, he left me, asking me to pull my papers -together. He was some little time away, and I began to look at some -of the books around me. One was an atlas, which I found opened -naturally to England, as if that map had been much used. On looking -at it I found in certain places little rings marked, and on examining -these I noticed that one was near London on the east side, manifestly -where his new estate was situated. The other two were Exeter, and -Whitby on the Yorkshire coast. - -It was the better part of an hour when the Count returned. "Aha!" he -said. "Still at your books? Good! But you must not work always. -Come! I am informed that your supper is ready." He took my arm, and -we went into the next room, where I found an excellent supper ready on -the table. The Count again excused himself, as he had dined out on -his being away from home. But he sat as on the previous night, and -chatted whilst I ate. After supper I smoked, as on the last evening, -and the Count stayed with me, chatting and asking questions on every -conceivable subject, hour after hour. I felt that it was getting very -late indeed, but I did not say anything, for I felt under obligation -to meet my host's wishes in every way. I was not sleepy, as the long -sleep yesterday had fortified me, but I could not help experiencing -that chill which comes over one at the coming of the dawn, which is -like, in its way, the turn of the tide. They say that people who are -near death die generally at the change to dawn or at the turn of the -tide. Anyone who has when tired, and tied as it were to his post, -experienced this change in the atmosphere can well believe it. All at -once we heard the crow of the cock coming up with preternatural -shrillness through the clear morning air. - -Count Dracula, jumping to his feet, said, "Why there is the morning -again! How remiss I am to let you stay up so long. You must make -your conversation regarding my dear new country of England less -interesting, so that I may not forget how time flies by us," and with -a courtly bow, he quickly left me. - -I went into my room and drew the curtains, but there was little to -notice. My window opened into the courtyard, all I could see was the -warm grey of quickening sky. So I pulled the curtains again, and have -written of this day. - - -8 May.--I began to fear as I wrote in this book that I was getting too -diffuse. But now I am glad that I went into detail from the first, -for there is something so strange about this place and all in it that -I cannot but feel uneasy. I wish I were safe out of it, or that I had -never come. It may be that this strange night existence is telling on -me, but would that that were all! If there were any one to talk to I -could bear it, but there is no one. I have only the Count to speak -with, and he--I fear I am myself the only living soul within the -place. Let me be prosaic so far as facts can be. It will help me to -bear up, and imagination must not run riot with me. If it does I am -lost. Let me say at once how I stand, or seem to. - -I only slept a few hours when I went to bed, and feeling that I could -not sleep any more, got up. I had hung my shaving glass by the -window, and was just beginning to shave. Suddenly I felt a hand on my -shoulder, and heard the Count's voice saying to me, "Good morning." I -started, for it amazed me that I had not seen him, since the -reflection of the glass covered the whole room behind me. In starting -I had cut myself slightly, but did not notice it at the moment. Having -answered the Count's salutation, I turned to the glass again to see -how I had been mistaken. This time there could be no error, for the -man was close to me, and I could see him over my shoulder. But there -was no reflection of him in the mirror! The whole room behind me was -displayed, but there was no sign of a man in it, except myself. - -This was startling, and coming on the top of so many strange things, -was beginning to increase that vague feeling of uneasiness which I -always have when the Count is near. But at the instant I saw that the -cut had bled a little, and the blood was trickling over my chin. I -laid down the razor, turning as I did so half round to look for some -sticking plaster. When the Count saw my face, his eyes blazed with a -sort of demoniac fury, and he suddenly made a grab at my throat. I -drew away and his hand touched the string of beads which held the -crucifix. It made an instant change in him, for the fury passed so -quickly that I could hardly believe that it was ever there. - -"Take care," he said, "take care how you cut yourself. It is more -dangerous that you think in this country." Then seizing the shaving -glass, he went on, "And this is the wretched thing that has done the -mischief. It is a foul bauble of man's vanity. Away with it!" And -opening the window with one wrench of his terrible hand, he flung out -the glass, which was shattered into a thousand pieces on the stones of -the courtyard far below. Then he withdrew without a word. It is very -annoying, for I do not see how I am to shave, unless in my watch-case -or the bottom of the shaving pot, which is fortunately of metal. - -When I went into the dining room, breakfast was prepared, but I could -not find the Count anywhere. So I breakfasted alone. It is strange -that as yet I have not seen the Count eat or drink. He must be a very -peculiar man! After breakfast I did a little exploring in the -castle. I went out on the stairs, and found a room looking towards -the South. - -The view was magnificent, and from where I stood there was every -opportunity of seeing it. The castle is on the very edge of a -terrific precipice. A stone falling from the window would fall a -thousand feet without touching anything! As far as the eye can reach -is a sea of green tree tops, with occasionally a deep rift where there -is a chasm. Here and there are silver threads where the rivers wind -in deep gorges through the forests. - -But I am not in heart to describe beauty, for when I had seen the view -I explored further. Doors, doors, doors everywhere, and all locked -and bolted. In no place save from the windows in the castle walls is -there an available exit. The castle is a veritable prison, and I am a -prisoner! - - - - -CHAPTER 3 - - -Jonathan Harker's Journal Continued - -When I found that I was a prisoner a sort of wild feeling came over -me. I rushed up and down the stairs, trying every door and peering -out of every window I could find, but after a little the conviction of -my helplessness overpowered all other feelings. When I look back -after a few hours I think I must have been mad for the time, for I -behaved much as a rat does in a trap. When, however, the conviction -had come to me that I was helpless I sat down quietly, as quietly as I -have ever done anything in my life, and began to think over what was -best to be done. I am thinking still, and as yet have come to no -definite conclusion. Of one thing only am I certain. That it is no -use making my ideas known to the Count. He knows well that I am -imprisoned, and as he has done it himself, and has doubtless his own -motives for it, he would only deceive me if I trusted him fully with -the facts. So far as I can see, my only plan will be to keep my -knowledge and my fears to myself, and my eyes open. I am, I know, -either being deceived, like a baby, by my own fears, or else I am in -desperate straits, and if the latter be so, I need, and shall need, -all my brains to get through. - -I had hardly come to this conclusion when I heard the great door below -shut, and knew that the Count had returned. He did not come at once -into the library, so I went cautiously to my own room and found him -making the bed. This was odd, but only confirmed what I had all along -thought, that there are no servants in the house. When later I saw -him through the chink of the hinges of the door laying the table in -the dining room, I was assured of it. For if he does himself all -these menial offices, surely it is proof that there is no one else in -the castle, it must have been the Count himself who was the driver of -the coach that brought me here. This is a terrible thought, for if -so, what does it mean that he could control the wolves, as he did, by -only holding up his hand for silence? How was it that all the people -at Bistritz and on the coach had some terrible fear for me? What -meant the giving of the crucifix, of the garlic, of the wild rose, of -the mountain ash? - -Bless that good, good woman who hung the crucifix round my neck! For -it is a comfort and a strength to me whenever I touch it. It is odd -that a thing which I have been taught to regard with disfavour and as -idolatrous should in a time of loneliness and trouble be of help. Is -it that there is something in the essence of the thing itself, or that -it is a medium, a tangible help, in conveying memories of sympathy and -comfort? Some time, if it may be, I must examine this matter and try -to make up my mind about it. In the meantime I must find out all I -can about Count Dracula, as it may help me to understand. Tonight he -may talk of himself, if I turn the conversation that way. I must be -very careful, however, not to awake his suspicion. - - -Midnight.--I have had a long talk with the Count. I asked him a few -questions on Transylvania history, and he warmed up to the subject -wonderfully. In his speaking of things and people, and especially of -battles, he spoke as if he had been present at them all. This he -afterwards explained by saying that to a Boyar the pride of his house -and name is his own pride, that their glory is his glory, that their -fate is his fate. Whenever he spoke of his house he always said "we", -and spoke almost in the plural, like a king speaking. I wish I could -put down all he said exactly as he said it, for to me it was most -fascinating. It seemed to have in it a whole history of the country. -He grew excited as he spoke, and walked about the room pulling his -great white moustache and grasping anything on which he laid his hands -as though he would crush it by main strength. One thing he said which -I shall put down as nearly as I can, for it tells in its way the story -of his race. - -"We Szekelys have a right to be proud, for in our veins flows the -blood of many brave races who fought as the lion fights, for lordship. -Here, in the whirlpool of European races, the Ugric tribe bore down -from Iceland the fighting spirit which Thor and Wodin gave them, which -their Berserkers displayed to such fell intent on the seaboards of -Europe, aye, and of Asia and Africa too, till the peoples thought that -the werewolves themselves had come. Here, too, when they came, they -found the Huns, whose warlike fury had swept the earth like a living -flame, till the dying peoples held that in their veins ran the blood -of those old witches, who, expelled from Scythia had mated with the -devils in the desert. Fools, fools! What devil or what witch was -ever so great as Attila, whose blood is in these veins?" He held up -his arms. "Is it a wonder that we were a conquering race, that we -were proud, that when the Magyar, the Lombard, the Avar, the Bulgar, -or the Turk poured his thousands on our frontiers, we drove them back? -Is it strange that when Arpad and his legions swept through the -Hungarian fatherland he found us here when he reached the frontier, -that the Honfoglalas was completed there? And when the Hungarian -flood swept eastward, the Szekelys were claimed as kindred by the -victorious Magyars, and to us for centuries was trusted the guarding -of the frontier of Turkeyland. Aye, and more than that, endless duty -of the frontier guard, for as the Turks say, 'water sleeps, and the -enemy is sleepless.' Who more gladly than we throughout the Four -Nations received the 'bloody sword,' or at its warlike call flocked -quicker to the standard of the King? When was redeemed that great -shame of my nation, the shame of Cassova, when the flags of the -Wallach and the Magyar went down beneath the Crescent? Who was it but -one of my own race who as Voivode crossed the Danube and beat the Turk -on his own ground? This was a Dracula indeed! Woe was it that his -own unworthy brother, when he had fallen, sold his people to the Turk -and brought the shame of slavery on them! Was it not this Dracula, -indeed, who inspired that other of his race who in a later age again -and again brought his forces over the great river into Turkeyland, -who, when he was beaten back, came again, and again, though he had to -come alone from the bloody field where his troops were being -slaughtered, since he knew that he alone could ultimately triumph! -They said that he thought only of himself. Bah! What good are -peasants without a leader? Where ends the war without a brain and -heart to conduct it? Again, when, after the battle of Mohacs, we -threw off the Hungarian yoke, we of the Dracula blood were amongst -their leaders, for our spirit would not brook that we were not free. -Ah, young sir, the Szekelys, and the Dracula as their heart's blood, -their brains, and their swords, can boast a record that mushroom -growths like the Hapsburgs and the Romanoffs can never reach. The -warlike days are over. Blood is too precious a thing in these days of -dishonourable peace, and the glories of the great races are as a tale -that is told." - -It was by this time close on morning, and we went to bed. (Mem., this -diary seems horribly like the beginning of the "Arabian Nights," for -everything has to break off at cockcrow, or like the ghost of Hamlet's -father.) - - -12 May.--Let me begin with facts, bare, meager facts, verified by -books and figures, and of which there can be no doubt. I must not -confuse them with experiences which will have to rest on my own -observation, or my memory of them. Last evening when the Count came -from his room he began by asking me questions on legal matters and on -the doing of certain kinds of business. I had spent the day wearily -over books, and, simply to keep my mind occupied, went over some of -the matters I had been examined in at Lincoln's Inn. There was a -certain method in the Count's inquiries, so I shall try to put them -down in sequence. The knowledge may somehow or some time be useful to -me. - -First, he asked if a man in England might have two solicitors or more. -I told him he might have a dozen if he wished, but that it would not -be wise to have more than one solicitor engaged in one transaction, as -only one could act at a time, and that to change would be certain to -militate against his interest. He seemed thoroughly to understand, -and went on to ask if there would be any practical difficulty in having -one man to attend, say, to banking, and another to look after -shipping, in case local help were needed in a place far from the home -of the banking solicitor. I asked to explain more fully, so that I -might not by any chance mislead him, so he said, - -"I shall illustrate. Your friend and mine, Mr. Peter Hawkins, from -under the shadow of your beautiful cathedral at Exeter, which is far -from London, buys for me through your good self my place at London. -Good! Now here let me say frankly, lest you should think it strange -that I have sought the services of one so far off from London instead -of some one resident there, that my motive was that no local interest -might be served save my wish only, and as one of London residence -might, perhaps, have some purpose of himself or friend to serve, I -went thus afield to seek my agent, whose labours should be only to my -interest. Now, suppose I, who have much of affairs, wish to ship -goods, say, to Newcastle, or Durham, or Harwich, or Dover, might it -not be that it could with more ease be done by consigning to one in -these ports?" - -I answered that certainly it would be most easy, but that we -solicitors had a system of agency one for the other, so that local -work could be done locally on instruction from any solicitor, so that -the client, simply placing himself in the hands of one man, could have -his wishes carried out by him without further trouble. - -"But," said he, "I could be at liberty to direct myself. Is it not -so?" - -"Of course," I replied, and "Such is often done by men of business, -who do not like the whole of their affairs to be known by any one -person." - -"Good!" he said, and then went on to ask about the means of making -consignments and the forms to be gone through, and of all sorts of -difficulties which might arise, but by forethought could be guarded -against. I explained all these things to him to the best of my -ability, and he certainly left me under the impression that he would -have made a wonderful solicitor, for there was nothing that he did not -think of or foresee. For a man who was never in the country, and who -did not evidently do much in the way of business, his knowledge and -acumen were wonderful. When he had satisfied himself on these points -of which he had spoken, and I had verified all as well as I could by -the books available, he suddenly stood up and said, "Have you written -since your first letter to our friend Mr. Peter Hawkins, or to any -other?" - -It was with some bitterness in my heart that I answered that I had -not, that as yet I had not seen any opportunity of sending letters to -anybody. - -"Then write now, my young friend," he said, laying a heavy hand on my -shoulder, "write to our friend and to any other, and say, if it will -please you, that you shall stay with me until a month from now." - -"Do you wish me to stay so long?" I asked, for my heart grew cold at -the thought. - -"I desire it much, nay I will take no refusal. When your master, -employer, what you will, engaged that someone should come on his -behalf, it was understood that my needs only were to be consulted. I -have not stinted. Is it not so?" - -What could I do but bow acceptance? It was Mr. Hawkins' interest, not -mine, and I had to think of him, not myself, and besides, while Count -Dracula was speaking, there was that in his eyes and in his bearing -which made me remember that I was a prisoner, and that if I wished it -I could have no choice. The Count saw his victory in my bow, and his -mastery in the trouble of my face, for he began at once to use them, -but in his own smooth, resistless way. - -"I pray you, my good young friend, that you will not discourse of -things other than business in your letters. It will doubtless please -your friends to know that you are well, and that you look forward to -getting home to them. Is it not so?" As he spoke he handed me three -sheets of note paper and three envelopes. They were all of the -thinnest foreign post, and looking at them, then at him, and noticing -his quiet smile, with the sharp, canine teeth lying over the red -underlip, I understood as well as if he had spoken that I should be -more careful what I wrote, for he would be able to read it. So I -determined to write only formal notes now, but to write fully to Mr. -Hawkins in secret, and also to Mina, for to her I could write -shorthand, which would puzzle the Count, if he did see it. When I had -written my two letters I sat quiet, reading a book whilst the Count -wrote several notes, referring as he wrote them to some books on his -table. Then he took up my two and placed them with his own, and put -by his writing materials, after which, the instant the door had closed -behind him, I leaned over and looked at the letters, which were face -down on the table. I felt no compunction in doing so for under the -circumstances I felt that I should protect myself in every way I -could. - -One of the letters was directed to Samuel F. Billington, No. 7, The -Crescent, Whitby, another to Herr Leutner, Varna. The third was to -Coutts & Co., London, and the fourth to Herren Klopstock & Billreuth, -bankers, Buda Pesth. The second and fourth were unsealed. I was just -about to look at them when I saw the door handle move. I sank back in -my seat, having just had time to resume my book before the Count, -holding still another letter in his hand, entered the room. He took -up the letters on the table and stamped them carefully, and then -turning to me, said, - -"I trust you will forgive me, but I have much work to do in private -this evening. You will, I hope, find all things as you wish." At the -door he turned, and after a moment's pause said, "Let me advise you, -my dear young friend. Nay, let me warn you with all seriousness, that -should you leave these rooms you will not by any chance go to sleep in -any other part of the castle. It is old, and has many memories, and -there are bad dreams for those who sleep unwisely. Be warned! Should -sleep now or ever overcome you, or be like to do, then haste to your -own chamber or to these rooms, for your rest will then be safe. But -if you be not careful in this respect, then," He finished his speech -in a gruesome way, for he motioned with his hands as if he were washing -them. I quite understood. My only doubt was as to whether any dream -could be more terrible than the unnatural, horrible net of gloom and -mystery which seemed closing around me. - - -Later.--I endorse the last words written, but this time there is no -doubt in question. I shall not fear to sleep in any place where he is -not. I have placed the crucifix over the head of my bed, I imagine -that my rest is thus freer from dreams, and there it shall remain. - -When he left me I went to my room. After a little while, not hearing -any sound, I came out and went up the stone stair to where I could -look out towards the South. There was some sense of freedom in the -vast expanse, inaccessible though it was to me, as compared with the -narrow darkness of the courtyard. Looking out on this, I felt that I -was indeed in prison, and I seemed to want a breath of fresh air, -though it were of the night. I am beginning to feel this nocturnal -existence tell on me. It is destroying my nerve. I start at my own -shadow, and am full of all sorts of horrible imaginings. God knows -that there is ground for my terrible fear in this accursed place! I -looked out over the beautiful expanse, bathed in soft yellow moonlight -till it was almost as light as day. In the soft light the distant -hills became melted, and the shadows in the valleys and gorges of -velvety blackness. The mere beauty seemed to cheer me. There was -peace and comfort in every breath I drew. As I leaned from the window -my eye was caught by something moving a storey below me, and somewhat -to my left, where I imagined, from the order of the rooms, that the -windows of the Count's own room would look out. The window at which I -stood was tall and deep, stone-mullioned, and though weatherworn, was -still complete. But it was evidently many a day since the case had -been there. I drew back behind the stonework, and looked carefully -out. - -What I saw was the Count's head coming out from the window. I did not -see the face, but I knew the man by the neck and the movement of his -back and arms. In any case I could not mistake the hands which I had -had some many opportunities of studying. I was at first interested -and somewhat amused, for it is wonderful how small a matter will -interest and amuse a man when he is a prisoner. But my very feelings -changed to repulsion and terror when I saw the whole man slowly emerge -from the window and begin to crawl down the castle wall over the -dreadful abyss, face down with his cloak spreading out around him like -great wings. At first I could not believe my eyes. I thought it was -some trick of the moonlight, some weird effect of shadow, but I kept -looking, and it could be no delusion. I saw the fingers and toes -grasp the corners of the stones, worn clear of the mortar by the -stress of years, and by thus using every projection and inequality -move downwards with considerable speed, just as a lizard moves along a -wall. - -What manner of man is this, or what manner of creature, is it in the -semblance of man? I feel the dread of this horrible place -overpowering me. I am in fear, in awful fear, and there is no escape -for me. I am encompassed about with terrors that I dare not think of. - - -15 May.--Once more I have seen the count go out in his lizard fashion. -He moved downwards in a sidelong way, some hundred feet down, and a -good deal to the left. He vanished into some hole or window. When -his head had disappeared, I leaned out to try and see more, but -without avail. The distance was too great to allow a proper angle of -sight. I knew he had left the castle now, and thought to use the -opportunity to explore more than I had dared to do as yet. I went -back to the room, and taking a lamp, tried all the doors. They were -all locked, as I had expected, and the locks were comparatively new. -But I went down the stone stairs to the hall where I had entered -originally. I found I could pull back the bolts easily enough and -unhook the great chains. But the door was locked, and the key was -gone! That key must be in the Count's room. I must watch should his -door be unlocked, so that I may get it and escape. I went on to make -a thorough examination of the various stairs and passages, and to try -the doors that opened from them. One or two small rooms near the hall -were open, but there was nothing to see in them except old furniture, -dusty with age and moth-eaten. At last, however, I found one door at -the top of the stairway which, though it seemed locked, gave a little -under pressure. I tried it harder, and found that it was not really -locked, but that the resistance came from the fact that the hinges had -fallen somewhat, and the heavy door rested on the floor. Here was an -opportunity which I might not have again, so I exerted myself, and -with many efforts forced it back so that I could enter. I was now in -a wing of the castle further to the right than the rooms I knew and a -storey lower down. From the windows I could see that the suite of -rooms lay along to the south of the castle, the windows of the end -room looking out both west and south. On the latter side, as well as -to the former, there was a great precipice. The castle was built on -the corner of a great rock, so that on three sides it was quite -impregnable, and great windows were placed here where sling, or bow, -or culverin could not reach, and consequently light and comfort, -impossible to a position which had to be guarded, were secured. To -the west was a great valley, and then, rising far away, great jagged -mountain fastnesses, rising peak on peak, the sheer rock studded with -mountain ash and thorn, whose roots clung in cracks and crevices and -crannies of the stone. This was evidently the portion of the castle -occupied by the ladies in bygone days, for the furniture had more an -air of comfort than any I had seen. - -The windows were curtainless, and the yellow moonlight, flooding in -through the diamond panes, enabled one to see even colours, whilst it -softened the wealth of dust which lay over all and disguised in some -measure the ravages of time and moth. My lamp seemed to be of little -effect in the brilliant moonlight, but I was glad to have it with me, -for there was a dread loneliness in the place which chilled my heart -and made my nerves tremble. Still, it was better than living alone in -the rooms which I had come to hate from the presence of the Count, and -after trying a little to school my nerves, I found a soft quietude -come over me. Here I am, sitting at a little oak table where in old -times possibly some fair lady sat to pen, with much thought and many -blushes, her ill-spelt love letter, and writing in my diary in -shorthand all that has happened since I closed it last. It is the -nineteenth century up-to-date with a vengeance. And yet, unless my -senses deceive me, the old centuries had, and have, powers of their -own which mere "modernity" cannot kill. - - -Later: The morning of 16 May.--God preserve my sanity, for to this I -am reduced. Safety and the assurance of safety are things of the -past. Whilst I live on here there is but one thing to hope for, that -I may not go mad, if, indeed, I be not mad already. If I be sane, -then surely it is maddening to think that of all the foul things that -lurk in this hateful place the Count is the least dreadful to me, that -to him alone I can look for safety, even though this be only whilst I -can serve his purpose. Great God! Merciful God, let me be calm, for -out of that way lies madness indeed. I begin to get new lights on -certain things which have puzzled me. Up to now I never quite knew -what Shakespeare meant when he made Hamlet say, "My tablets! Quick, -my tablets! 'tis meet that I put it down," etc., For now, feeling as -though my own brain were unhinged or as if the shock had come which -must end in its undoing, I turn to my diary for repose. The habit of -entering accurately must help to soothe me. - -The Count's mysterious warning frightened me at the time. It frightens -me more not when I think of it, for in the future he has a fearful -hold upon me. I shall fear to doubt what he may say! - -When I had written in my diary and had fortunately replaced the book -and pen in my pocket I felt sleepy. The Count's warning came into my -mind, but I took pleasure in disobeying it. The sense of sleep was -upon me, and with it the obstinacy which sleep brings as outrider. The -soft moonlight soothed, and the wide expanse without gave a sense of -freedom which refreshed me. I determined not to return tonight to the -gloom-haunted rooms, but to sleep here, where, of old, ladies had sat -and sung and lived sweet lives whilst their gentle breasts were sad -for their menfolk away in the midst of remorseless wars. I drew a -great couch out of its place near the corner, so that as I lay, I -could look at the lovely view to east and south, and unthinking of and -uncaring for the dust, composed myself for sleep. I suppose I must -have fallen asleep. I hope so, but I fear, for all that followed was -startlingly real, so real that now sitting here in the broad, full -sunlight of the morning, I cannot in the least believe that it was all -sleep. - -I was not alone. The room was the same, unchanged in any way since I -came into it. I could see along the floor, in the brilliant -moonlight, my own footsteps marked where I had disturbed the long -accumulation of dust. In the moonlight opposite me were three young -women, ladies by their dress and manner. I thought at the time that I -must be dreaming when I saw them, they threw no shadow on the floor. -They came close to me, and looked at me for some time, and then -whispered together. Two were dark, and had high aquiline noses, like -the Count, and great dark, piercing eyes, that seemed to be almost red -when contrasted with the pale yellow moon. The other was fair, as -fair as can be, with great masses of golden hair and eyes like pale -sapphires. I seemed somehow to know her face, and to know it in -connection with some dreamy fear, but I could not recollect at the -moment how or where. All three had brilliant white teeth that shone -like pearls against the ruby of their voluptuous lips. There was -something about them that made me uneasy, some longing and at the same -time some deadly fear. I felt in my heart a wicked, burning desire -that they would kiss me with those red lips. It is not good to note -this down, lest some day it should meet Mina's eyes and cause her -pain, but it is the truth. They whispered together, and then they all -three laughed, such a silvery, musical laugh, but as hard as though -the sound never could have come through the softness of human lips. -It was like the intolerable, tingling sweetness of waterglasses when -played on by a cunning hand. The fair girl shook her head -coquettishly, and the other two urged her on. - -One said, "Go on! You are first, and we shall follow. Yours is the -right to begin." - -The other added, "He is young and strong. There are kisses for us -all." - -I lay quiet, looking out from under my eyelashes in an agony of -delightful anticipation. The fair girl advanced and bent over me till -I could feel the movement of her breath upon me. Sweet it was in one -sense, honey-sweet, and sent the same tingling through the nerves as -her voice, but with a bitter underlying the sweet, a bitter -offensiveness, as one smells in blood. - -I was afraid to raise my eyelids, but looked out and saw perfectly -under the lashes. The girl went on her knees, and bent over me, -simply gloating. There was a deliberate voluptuousness which was both -thrilling and repulsive, and as she arched her neck she actually -licked her lips like an animal, till I could see in the moonlight the -moisture shining on the scarlet lips and on the red tongue as it -lapped the white sharp teeth. Lower and lower went her head as the -lips went below the range of my mouth and chin and seemed to fasten on -my throat. Then she paused, and I could hear the churning sound of -her tongue as it licked her teeth and lips, and I could feel the hot -breath on my neck. Then the skin of my throat began to tingle as -one's flesh does when the hand that is to tickle it approaches nearer, -nearer. I could feel the soft, shivering touch of the lips on the -super sensitive skin of my throat, and the hard dents of two sharp -teeth, just touching and pausing there. I closed my eyes in -languorous ecstasy and waited, waited with beating heart. - -But at that instant, another sensation swept through me as quick as -lightning. I was conscious of the presence of the Count, and of his -being as if lapped in a storm of fury. As my eyes opened -involuntarily I saw his strong hand grasp the slender neck of the fair -woman and with giant's power draw it back, the blue eyes transformed -with fury, the white teeth champing with rage, and the fair cheeks -blazing red with passion. But the Count! Never did I imagine such -wrath and fury, even to the demons of the pit. His eyes were -positively blazing. The red light in them was lurid, as if the flames -of hell fire blazed behind them. His face was deathly pale, and the -lines of it were hard like drawn wires. The thick eyebrows that met -over the nose now seemed like a heaving bar of white-hot metal. With -a fierce sweep of his arm, he hurled the woman from him, and then -motioned to the others, as though he were beating them back. It was -the same imperious gesture that I had seen used to the wolves. In a -voice which, though low and almost in a whisper seemed to cut through -the air and then ring in the room he said, - -"How dare you touch him, any of you? How dare you cast eyes on him -when I had forbidden it? Back, I tell you all! This man belongs to -me! Beware how you meddle with him, or you'll have to deal with me." - -The fair girl, with a laugh of ribald coquetry, turned to answer him. -"You yourself never loved. You never love!" On this the other women -joined, and such a mirthless, hard, soulless laughter rang through the -room that it almost made me faint to hear. It seemed like the -pleasure of fiends. - -Then the Count turned, after looking at my face attentively, and said -in a soft whisper, "Yes, I too can love. You yourselves can tell it -from the past. Is it not so? Well, now I promise you that when I am -done with him you shall kiss him at your will. Now go! Go! I must -awaken him, for there is work to be done." - -"Are we to have nothing tonight?" said one of them, with a low laugh, -as she pointed to the bag which he had thrown upon the floor, and -which moved as though there were some living thing within it. For -answer he nodded his head. One of the women jumped forward and opened -it. If my ears did not deceive me there was a gasp and a low wail, as -of a half smothered child. The women closed round, whilst I was -aghast with horror. But as I looked, they disappeared, and with them -the dreadful bag. There was no door near them, and they could not -have passed me without my noticing. They simply seemed to fade into -the rays of the moonlight and pass out through the window, for I could -see outside the dim, shadowy forms for a moment before they entirely -faded away. - -Then the horror overcame me, and I sank down unconscious. - - - - -CHAPTER 4 - - -Jonathan Harker's Journal Continued - -I awoke in my own bed. If it be that I had not dreamt, the Count must -have carried me here. I tried to satisfy myself on the subject, but -could not arrive at any unquestionable result. To be sure, there were -certain small evidences, such as that my clothes were folded and laid -by in a manner which was not my habit. My watch was still unwound, -and I am rigorously accustomed to wind it the last thing before going -to bed, and many such details. But these things are no proof, for -they may have been evidences that my mind was not as usual, and, for -some cause or another, I had certainly been much upset. I must watch -for proof. Of one thing I am glad. If it was that the Count carried -me here and undressed me, he must have been hurried in his task, for -my pockets are intact. I am sure this diary would have been a mystery -to him which he would not have brooked. He would have taken or -destroyed it. As I look round this room, although it has been to me -so full of fear, it is now a sort of sanctuary, for nothing can be -more dreadful than those awful women, who were, who are, waiting to -suck my blood. - - -18 May.--I have been down to look at that room again in daylight, for -I must know the truth. When I got to the doorway at the top of the -stairs I found it closed. It had been so forcibly driven against the -jamb that part of the woodwork was splintered. I could see that the -bolt of the lock had not been shot, but the door is fastened from the -inside. I fear it was no dream, and must act on this surmise. - - -19 May.--I am surely in the toils. Last night the Count asked me in -the suavest tones to write three letters, one saying that my work here -was nearly done, and that I should start for home within a few days, -another that I was starting on the next morning from the time of the -letter, and the third that I had left the castle and arrived at -Bistritz. I would fain have rebelled, but felt that in the present -state of things it would be madness to quarrel openly with the Count -whilst I am so absolutely in his power. And to refuse would be to -excite his suspicion and to arouse his anger. He knows that I know -too much, and that I must not live, lest I be dangerous to him. My -only chance is to prolong my opportunities. Something may occur which -will give me a chance to escape. I saw in his eyes something of that -gathering wrath which was manifest when he hurled that fair woman from -him. He explained to me that posts were few and uncertain, and that -my writing now would ensure ease of mind to my friends. And he -assured me with so much impressiveness that he would countermand the -later letters, which would be held over at Bistritz until due time in -case chance would admit of my prolonging my stay, that to oppose him -would have been to create new suspicion. I therefore pretended to -fall in with his views, and asked him what dates I should put on the -letters. - -He calculated a minute, and then said, "The first should be June 12, -the second June 19, and the third June 29." - -I know now the span of my life. God help me! - - -28 May.--There is a chance of escape, or at any rate of being able to -send word home. A band of Szgany have come to the castle, and are -encamped in the courtyard. These are gipsies. I have notes of them -in my book. They are peculiar to this part of the world, though -allied to the ordinary gipsies all the world over. There are -thousands of them in Hungary and Transylvania, who are almost outside -all law. They attach themselves as a rule to some great noble or -boyar, and call themselves by his name. They are fearless and without -religion, save superstition, and they talk only their own varieties of -the Romany tongue. - -I shall write some letters home, and shall try to get them to have -them posted. I have already spoken to them through my window to begin -acquaintanceship. They took their hats off and made obeisance and -many signs, which however, I could not understand any more than I -could their spoken language . . . - -I have written the letters. Mina's is in shorthand, and I simply ask -Mr. Hawkins to communicate with her. To her I have explained my -situation, but without the horrors which I may only surmise. It would -shock and frighten her to death were I to expose my heart to her. -Should the letters not carry, then the Count shall not yet know my -secret or the extent of my knowledge. . . . - - -I have given the letters. I threw them through the bars of my window -with a gold piece, and made what signs I could to have them posted. -The man who took them pressed them to his heart and bowed, and then -put them in his cap. I could do no more. I stole back to the study, -and began to read. As the Count did not come in, I have written -here . . . - - -The Count has come. He sat down beside me, and said in his smoothest -voice as he opened two letters, "The Szgany has given me these, of -which, though I know not whence they come, I shall, of course, take -care. See!"--He must have looked at it.--"One is from you, and to my -friend Peter Hawkins. The other,"--here he caught sight of the -strange symbols as he opened the envelope, and the dark look came into -his face, and his eyes blazed wickedly,--"The other is a vile thing, -an outrage upon friendship and hospitality! It is not signed. Well! -So it cannot matter to us." And he calmly held letter and envelope in -the flame of the lamp till they were consumed. - -Then he went on, "The letter to Hawkins, that I shall, of course send -on, since it is yours. Your letters are sacred to me. Your pardon, -my friend, that unknowingly I did break the seal. Will you not cover -it again?" He held out the letter to me, and with a courteous bow -handed me a clean envelope. - -I could only redirect it and hand it to him in silence. When he went -out of the room I could hear the key turn softly. A minute later I -went over and tried it, and the door was locked. - -When, an hour or two after, the Count came quietly into the room, his -coming awakened me, for I had gone to sleep on the sofa. He was very -courteous and very cheery in his manner, and seeing that I had been -sleeping, he said, "So, my friend, you are tired? Get to bed. There -is the surest rest. I may not have the pleasure of talk tonight, -since there are many labours to me, but you will sleep, I pray." - -I passed to my room and went to bed, and, strange to say, slept -without dreaming. Despair has its own calms. - -31 May.--This morning when I woke I thought I would provide myself -with some papers and envelopes from my bag and keep them in my pocket, -so that I might write in case I should get an opportunity, but again a -surprise, again a shock! - -Every scrap of paper was gone, and with it all my notes, my memoranda, -relating to railways and travel, my letter of credit, in fact all that -might be useful to me were I once outside the castle. I sat and -pondered awhile, and then some thought occurred to me, and I made -search of my portmanteau and in the wardrobe where I had placed my -clothes. - -The suit in which I had travelled was gone, and also my overcoat and -rug. I could find no trace of them anywhere. This looked like some -new scheme of villainy . . . - - -17 June.--This morning, as I was sitting on the edge of my bed -cudgelling my brains, I heard without a crackling of whips and -pounding and scraping of horses' feet up the rocky path beyond the -courtyard. With joy I hurried to the window, and saw drive into the -yard two great leiter-wagons, each drawn by eight sturdy horses, and -at the head of each pair a Slovak, with his wide hat, great -nail-studded belt, dirty sheepskin, and high boots. They had also -their long staves in hand. I ran to the door, intending to descend -and try and join them through the main hall, as I thought that way -might be opened for them. Again a shock, my door was fastened on the -outside. - -Then I ran to the window and cried to them. They looked up at me -stupidly and pointed, but just then the "hetman" of the Szgany came -out, and seeing them pointing to my window, said something, at which -they laughed. - -Henceforth no effort of mine, no piteous cry or agonized entreaty, -would make them even look at me. They resolutely turned away. The -leiter-wagons contained great, square boxes, with handles of thick -rope. These were evidently empty by the ease with which the Slovaks -handled them, and by their resonance as they were roughly moved. - -When they were all unloaded and packed in a great heap in one corner -of the yard, the Slovaks were given some money by the Szgany, and -spitting on it for luck, lazily went each to his horse's head. -Shortly afterwards, I heard the crackling of their whips die away in -the distance. - - -24 June.--Last night the Count left me early, and locked himself into -his own room. As soon as I dared I ran up the winding stair, and -looked out of the window, which opened South. I thought I would watch -for the Count, for there is something going on. The Szgany are -quartered somewhere in the castle and are doing work of some kind. I -know it, for now and then, I hear a far-away muffled sound as of -mattock and spade, and, whatever it is, it must be the end of some -ruthless villainy. - -I had been at the window somewhat less than half an hour, when I saw -something coming out of the Count's window. I drew back and watched -carefully, and saw the whole man emerge. It was a new shock to me to -find that he had on the suit of clothes which I had worn whilst -travelling here, and slung over his shoulder the terrible bag which I -had seen the women take away. There could be no doubt as to his -quest, and in my garb, too! This, then, is his new scheme of evil, -that he will allow others to see me, as they think, so that he may -both leave evidence that I have been seen in the towns or villages -posting my own letters, and that any wickedness which he may do shall -by the local people be attributed to me. - -It makes me rage to think that this can go on, and whilst I am shut up -here, a veritable prisoner, but without that protection of the law -which is even a criminal's right and consolation. - -I thought I would watch for the Count's return, and for a long time -sat doggedly at the window. Then I began to notice that there were -some quaint little specks floating in the rays of the moonlight. They -were like the tiniest grains of dust, and they whirled round and -gathered in clusters in a nebulous sort of way. I watched them with a -sense of soothing, and a sort of calm stole over me. I leaned back in -the embrasure in a more comfortable position, so that I could enjoy -more fully the aerial gambolling. - -Something made me start up, a low, piteous howling of dogs somewhere -far below in the valley, which was hidden from my sight. Louder it -seemed to ring in my ears, and the floating moats of dust to take new -shapes to the sound as they danced in the moonlight. I felt myself -struggling to awake to some call of my instincts. Nay, my very soul -was struggling, and my half-remembered sensibilities were striving to -answer the call. I was becoming hypnotised! - -Quicker and quicker danced the dust. The moonbeams seemed to quiver -as they went by me into the mass of gloom beyond. More and more they -gathered till they seemed to take dim phantom shapes. And then I -started, broad awake and in full possession of my senses, and ran -screaming from the place. - -The phantom shapes, which were becoming gradually materialised from -the moonbeams, were those three ghostly women to whom I was doomed. - -I fled, and felt somewhat safer in my own room, where there was no -moonlight, and where the lamp was burning brightly. - -When a couple of hours had passed I heard something stirring in the -Count's room, something like a sharp wail quickly suppressed. And -then there was silence, deep, awful silence, which chilled me. With a -beating heart, I tried the door, but I was locked in my prison, and -could do nothing. I sat down and simply cried. - -As I sat I heard a sound in the courtyard without, the agonised cry of -a woman. I rushed to the window, and throwing it up, peered between -the bars. - -There, indeed, was a woman with dishevelled hair, holding her hands -over her heart as one distressed with running. She was leaning -against the corner of the gateway. When she saw my face at the window -she threw herself forward, and shouted in a voice laden with menace, -"Monster, give me my child!" - -She threw herself on her knees, and raising up her hands, cried the -same words in tones which wrung my heart. Then she tore her hair and -beat her breast, and abandoned herself to all the violences of -extravagant emotion. Finally, she threw herself forward, and though I -could not see her, I could hear the beating of her naked hands against -the door. - -Somewhere high overhead, probably on the tower, I heard the voice of -the Count calling in his harsh, metallic whisper. His call seemed to -be answered from far and wide by the howling of wolves. Before many -minutes had passed a pack of them poured, like a pent-up dam when -liberated, through the wide entrance into the courtyard. - -There was no cry from the woman, and the howling of the wolves was but -short. Before long they streamed away singly, licking their lips. - -I could not pity her, for I knew now what had become of her child, and -she was better dead. - -What shall I do? What can I do? How can I escape from this dreadful -thing of night, gloom, and fear? - - -25 June.--No man knows till he has suffered from the night how sweet -and dear to his heart and eye the morning can be. When the sun grew -so high this morning that it struck the top of the great gateway -opposite my window, the high spot which it touched seemed to me as if -the dove from the ark had lighted there. My fear fell from me as if -it had been a vaporous garment which dissolved in the warmth. - -I must take action of some sort whilst the courage of the day is upon -me. Last night one of my post-dated letters went to post, the first -of that fatal series which is to blot out the very traces of my -existence from the earth. - -Let me not think of it. Action! - -It has always been at night-time that I have been molested or -threatened, or in some way in danger or in fear. I have not yet seen -the Count in the daylight. Can it be that he sleeps when others wake, -that he may be awake whilst they sleep? If I could only get into his -room! But there is no possible way. The door is always locked, no -way for me. - -Yes, there is a way, if one dares to take it. Where his body has gone -why may not another body go? I have seen him myself crawl from his -window. Why should not I imitate him, and go in by his window? The -chances are desperate, but my need is more desperate still. I shall -risk it. At the worst it can only be death, and a man's death is not -a calf's, and the dreaded Hereafter may still be open to me. God help -me in my task! Goodbye, Mina, if I fail. Goodbye, my faithful friend -and second father. Goodbye, all, and last of all Mina! - - -Same day, later.--I have made the effort, and God helping me, have -come safely back to this room. I must put down every detail in order. -I went whilst my courage was fresh straight to the window on the south -side, and at once got outside on this side. The stones are big and -roughly cut, and the mortar has by process of time been washed away -between them. I took off my boots, and ventured out on the desperate -way. I looked down once, so as to make sure that a sudden glimpse of -the awful depth would not overcome me, but after that kept my eyes -away from it. I know pretty well the direction and distance of the -Count's window, and made for it as well as I could, having regard to -the opportunities available. I did not feel dizzy, I suppose I was -too excited, and the time seemed ridiculously short till I found -myself standing on the window sill and trying to raise up the sash. I -was filled with agitation, however, when I bent down and slid feet -foremost in through the window. Then I looked around for the Count, -but with surprise and gladness, made a discovery. The room was -empty! It was barely furnished with odd things, which seemed to have -never been used. - -The furniture was something the same style as that in the south rooms, -and was covered with dust. I looked for the key, but it was not in -the lock, and I could not find it anywhere. The only thing I found -was a great heap of gold in one corner, gold of all kinds, Roman, and -British, and Austrian, and Hungarian, and Greek and Turkish money, -covered with a film of dust, as though it had lain long in the ground. -None of it that I noticed was less than three hundred years old. -There were also chains and ornaments, some jewelled, but all of them -old and stained. - -At one corner of the room was a heavy door. I tried it, for, since I -could not find the key of the room or the key of the outer door, which -was the main object of my search, I must make further examination, or -all my efforts would be in vain. It was open, and led through a stone -passage to a circular stairway, which went steeply down. - -I descended, minding carefully where I went for the stairs were dark, -being only lit by loopholes in the heavy masonry. At the bottom there -was a dark, tunnel-like passage, through which came a deathly, sickly -odour, the odour of old earth newly turned. As I went through the -passage the smell grew closer and heavier. At last I pulled open a -heavy door which stood ajar, and found myself in an old ruined chapel, -which had evidently been used as a graveyard. The roof was broken, -and in two places were steps leading to vaults, but the ground had -recently been dug over, and the earth placed in great wooden boxes, -manifestly those which had been brought by the Slovaks. - -There was nobody about, and I made a search over every inch of the -ground, so as not to lose a chance. I went down even into the vaults, -where the dim light struggled, although to do so was a dread to my -very soul. Into two of these I went, but saw nothing except fragments -of old coffins and piles of dust. In the third, however, I made a -discovery. - -There, in one of the great boxes, of which there were fifty in all, on -a pile of newly dug earth, lay the Count! He was either dead or -asleep. I could not say which, for eyes were open and stony, but -without the glassiness of death, and the cheeks had the warmth of life -through all their pallor. The lips were as red as ever. But there -was no sign of movement, no pulse, no breath, no beating of the heart. - -I bent over him, and tried to find any sign of life, but in vain. He -could not have lain there long, for the earthy smell would have passed -away in a few hours. By the side of the box was its cover, pierced -with holes here and there. I thought he might have the keys on him, -but when I went to search I saw the dead eyes, and in them dead though -they were, such a look of hate, though unconscious of me or my -presence, that I fled from the place, and leaving the Count's room by -the window, crawled again up the castle wall. Regaining my room, I -threw myself panting upon the bed and tried to think. - - -29 June.--Today is the date of my last letter, and the Count has taken -steps to prove that it was genuine, for again I saw him leave the -castle by the same window, and in my clothes. As he went down the -wall, lizard fashion, I wished I had a gun or some lethal weapon, that -I might destroy him. But I fear that no weapon wrought along by man's -hand would have any effect on him. I dared not wait to see him -return, for I feared to see those weird sisters. I came back to the -library, and read there till I fell asleep. - -I was awakened by the Count, who looked at me as grimly as a man could -look as he said, "Tomorrow, my friend, we must part. You return to -your beautiful England, I to some work which may have such an end that -we may never meet. Your letter home has been despatched. Tomorrow I -shall not be here, but all shall be ready for your journey. In the -morning come the Szgany, who have some labours of their own here, and -also come some Slovaks. When they have gone, my carriage shall come -for you, and shall bear you to the Borgo Pass to meet the diligence -from Bukovina to Bistritz. But I am in hopes that I shall see more of -you at Castle Dracula." - -I suspected him, and determined to test his sincerity. Sincerity! It -seems like a profanation of the word to write it in connection with -such a monster, so I asked him point-blank, "Why may I not go -tonight?" - -"Because, dear sir, my coachman and horses are away on a mission." - -"But I would walk with pleasure. I want to get away at once." - -He smiled, such a soft, smooth, diabolical smile that I knew there was -some trick behind his smoothness. He said, "And your baggage?" - -"I do not care about it. I can send for it some other time." - -The Count stood up, and said, with a sweet courtesy which made me rub -my eyes, it seemed so real, "You English have a saying which is close -to my heart, for its spirit is that which rules our boyars, 'Welcome -the coming, speed the parting guest.' Come with me, my dear young -friend. Not an hour shall you wait in my house against your will, -though sad am I at your going, and that you so suddenly desire it. -Come!" With a stately gravity, he, with the lamp, preceded me down -the stairs and along the hall. Suddenly he stopped. "Hark!" - -Close at hand came the howling of many wolves. It was almost as if -the sound sprang up at the rising of his hand, just as the music of a -great orchestra seems to leap under the baton of the conductor. After -a pause of a moment, he proceeded, in his stately way, to the door, -drew back the ponderous bolts, unhooked the heavy chains, and began to -draw it open. - -To my intense astonishment I saw that it was unlocked. Suspiciously, -I looked all round, but could see no key of any kind. - -As the door began to open, the howling of the wolves without grew -louder and angrier. Their red jaws, with champing teeth, and their -blunt-clawed feet as they leaped, came in through the opening door. I -knew than that to struggle at the moment against the Count was -useless. With such allies as these at his command, I could do -nothing. - -But still the door continued slowly to open, and only the Count's body -stood in the gap. Suddenly it struck me that this might be the moment -and means of my doom. I was to be given to the wolves, and at my own -instigation. There was a diabolical wickedness in the idea great -enough for the Count, and as the last chance I cried out, "Shut the -door! I shall wait till morning." And I covered my face with my -hands to hide my tears of bitter disappointment. - -With one sweep of his powerful arm, the Count threw the door shut, and -the great bolts clanged and echoed through the hall as they shot back -into their places. - -In silence we returned to the library, and after a minute or two I went -to my own room. The last I saw of Count Dracula was his kissing his -hand to me, with a red light of triumph in his eyes, and with a smile -that Judas in hell might be proud of. - -When I was in my room and about to lie down, I thought I heard a -whispering at my door. I went to it softly and listened. Unless my -ears deceived me, I heard the voice of the Count. - -"Back! Back to your own place! Your time is not yet come. Wait! -Have patience! Tonight is mine. Tomorrow night is yours!" - -There was a low, sweet ripple of laughter, and in a rage I threw open -the door, and saw without the three terrible women licking their lips. -As I appeared, they all joined in a horrible laugh, and ran away. - -I came back to my room and threw myself on my knees. It is then so -near the end? Tomorrow! Tomorrow! Lord, help me, and those to whom -I am dear! - - -30 June.--These may be the last words I ever write in this diary. I -slept till just before the dawn, and when I woke threw myself on my -knees, for I determined that if Death came he should find me ready. - -At last I felt that subtle change in the air, and knew that the -morning had come. Then came the welcome cockcrow, and I felt that I -was safe. With a glad heart, I opened the door and ran down the hall. -I had seen that the door was unlocked, and now escape was before me. -With hands that trembled with eagerness, I unhooked the chains and -threw back the massive bolts. - -But the door would not move. Despair seized me. I pulled and pulled -at the door, and shook it till, massive as it was, it rattled in its -casement. I could see the bolt shot. It had been locked after I left -the Count. - -Then a wild desire took me to obtain the key at any risk, and I -determined then and there to scale the wall again, and gain the -Count's room. He might kill me, but death now seemed the happier -choice of evils. Without a pause I rushed up to the east window, and -scrambled down the wall, as before, into the Count's room. It was -empty, but that was as I expected. I could not see a key anywhere, -but the heap of gold remained. I went through the door in the corner -and down the winding stair and along the dark passage to the old -chapel. I knew now well enough where to find the monster I sought. - -The great box was in the same place, close against the wall, but the -lid was laid on it, not fastened down, but with the nails ready in -their places to be hammered home. - -I knew I must reach the body for the key, so I raised the lid, and -laid it back against the wall. And then I saw something which filled -my very soul with horror. There lay the Count, but looking as if his -youth had been half restored. For the white hair and moustache were -changed to dark iron-grey. The cheeks were fuller, and the white skin -seemed ruby-red underneath. The mouth was redder than ever, for on -the lips were gouts of fresh blood, which trickled from the corners of -the mouth and ran down over the chin and neck. Even the deep, burning -eyes seemed set amongst swollen flesh, for the lids and pouches -underneath were bloated. It seemed as if the whole awful creature -were simply gorged with blood. He lay like a filthy leech, exhausted -with his repletion. - -I shuddered as I bent over to touch him, and every sense in me -revolted at the contact, but I had to search, or I was lost. The -coming night might see my own body a banquet in a similar war to those -horrid three. I felt all over the body, but no sign could I find of -the key. Then I stopped and looked at the Count. There was a mocking -smile on the bloated face which seemed to drive me mad. This was the -being I was helping to transfer to London, where, perhaps, for -centuries to come he might, amongst its teeming millions, satiate his -lust for blood, and create a new and ever-widening circle of -semi-demons to batten on the helpless. - -The very thought drove me mad. A terrible desire came upon me to rid -the world of such a monster. There was no lethal weapon at hand, but -I seized a shovel which the workmen had been using to fill the cases, -and lifting it high, struck, with the edge downward, at the hateful -face. But as I did so the head turned, and the eyes fell upon me, -with all their blaze of basilisk horror. The sight seemed to paralyze -me, and the shovel turned in my hand and glanced from the face, merely -making a deep gash above the forehead. The shovel fell from my hand -across the box, and as I pulled it away the flange of the blade caught -the edge of the lid which fell over again, and hid the horrid thing -from my sight. The last glimpse I had was of the bloated face, -blood-stained and fixed with a grin of malice which would have held -its own in the nethermost hell. - -I thought and thought what should be my next move, but my brain seemed -on fire, and I waited with a despairing feeling growing over me. As I -waited I heard in the distance a gipsy song sung by merry voices -coming closer, and through their song the rolling of heavy wheels and -the cracking of whips. The Szgany and the Slovaks of whom the Count -had spoken were coming. With a last look around and at the box which -contained the vile body, I ran from the place and gained the Count's -room, determined to rush out at the moment the door should be opened. -With strained ears, I listened, and heard downstairs the grinding of -the key in the great lock and the falling back of the heavy door. -There must have been some other means of entry, or some one had a key -for one of the locked doors. - -Then there came the sound of many feet tramping and dying away in some -passage which sent up a clanging echo. I turned to run down again -towards the vault, where I might find the new entrance, but at the -moment there seemed to come a violent puff of wind, and the door to -the winding stair blew to with a shock that set the dust from the -lintels flying. When I ran to push it open, I found that it was -hopelessly fast. I was again a prisoner, and the net of doom was -closing round me more closely. - -As I write there is in the passage below a sound of many tramping feet -and the crash of weights being set down heavily, doubtless the boxes, -with their freight of earth. There was a sound of hammering. It is -the box being nailed down. Now I can hear the heavy feet tramping -again along the hall, with many other idle feet coming behind them. - -The door is shut, the chains rattle. There is a grinding of the key -in the lock. I can hear the key withdrawn, then another door opens -and shuts. I hear the creaking of lock and bolt. - -Hark! In the courtyard and down the rocky way the roll of heavy -wheels, the crack of whips, and the chorus of the Szgany as they pass -into the distance. - -I am alone in the castle with those horrible women. Faugh! Mina is a -woman, and there is nought in common. They are devils of the Pit! - -I shall not remain alone with them. I shall try to scale the castle -wall farther than I have yet attempted. I shall take some of the gold -with me, lest I want it later. I may find a way from this dreadful -place. - -And then away for home! Away to the quickest and nearest train! Away -from the cursed spot, from this cursed land, where the devil and his -children still walk with earthly feet! - -At least God's mercy is better than that of those monsters, and the -precipice is steep and high. At its foot a man may sleep, as a man. -Goodbye, all. Mina! - - - - -CHAPTER 5 - - -LETTER FROM MISS MINA MURRAY TO MISS LUCY WESTENRA - -9 May. - -My dearest Lucy, - -Forgive my long delay in writing, but I have been simply overwhelmed -with work. The life of an assistant schoolmistress is sometimes -trying. I am longing to be with you, and by the sea, where we can -talk together freely and build our castles in the air. I have been -working very hard lately, because I want to keep up with Jonathan's -studies, and I have been practicing shorthand very assiduously. -When we are married I shall be able to be useful to Jonathan, and if -I can stenograph well enough I can take down what he wants to say in -this way and write it out for him on the typewriter, at which also I -am practicing very hard. - -He and I sometimes write letters in shorthand, and he is -keeping a stenographic journal of his travels abroad. When -I am with you I shall keep a diary in the same way. I don't -mean one of those two-pages-to-the-week-with-Sunday-squeezed- -in-a-corner diaries, but a sort of journal which I can write -in whenever I feel inclined. - -I do not suppose there will be much of interest to other people, but -it is not intended for them. I may show it to Jonathan some day if -there is in it anything worth sharing, but it is really an exercise -book. I shall try to do what I see lady journalists do, -interviewing and writing descriptions and trying to remember -conversations. I am told that, with a little practice, one can -remember all that goes on or that one hears said during a day. - -However, we shall see. I will tell you of my little plans when we -meet. I have just had a few hurried lines from Jonathan from -Transylvania. He is well, and will be returning in about a week. I -am longing to hear all his news. It must be nice to see strange -countries. I wonder if we, I mean Jonathan and I, shall ever see -them together. There is the ten o'clock bell ringing. Goodbye. - -Your loving - -Mina - - -Tell me all the news when you write. You have not told me -anything for a long time. I hear rumours, and especially -of a tall, handsome, curly-haired man??? - - - -LETTER, LUCY WESTENRA TO MINA MURRAY - - -17, Chatham Street - -Wednesday - -My dearest Mina, - - -I must say you tax me very unfairly with being a bad correspondent. -I wrote you twice since we parted, and your last letter was only -your second. Besides, I have nothing to tell you. There is really -nothing to interest you. - -Town is very pleasant just now, and we go a great deal to -picture-galleries and for walks and rides in the park. As -to the tall, curly-haired man, I suppose it was the one who -was with me at the last Pop. Someone has evidently been -telling tales. - -That was Mr. Holmwood. He often comes to see us, and he and -Mamma get on very well together, they have so many things -to talk about in common. - -We met some time ago a man that would just do for you, if you were -not already engaged to Jonathan. He is an excellent parti, being -handsome, well off, and of good birth. He is a doctor and really -clever. Just fancy! He is only nine-and twenty, and he has an -immense lunatic asylum all under his own care. Mr. Holmwood -introduced him to me, and he called here to see us, and often comes -now. I think he is one of the most resolute men I ever saw, and yet -the most calm. He seems absolutely imperturbable. I can fancy what -a wonderful power he must have over his patients. He has a curious -habit of looking one straight in the face, as if trying to read -one's thoughts. He tries this on very much with me, but I flatter -myself he has got a tough nut to crack. I know that from my glass. - -Do you ever try to read your own face? I do, and I can -tell you it is not a bad study, and gives you more trouble -than you can well fancy if you have never tried it. - -He says that I afford him a curious psychological study, and -I humbly think I do. I do not, as you know, take sufficient -interest in dress to be able to describe the new fashions. -Dress is a bore. That is slang again, but never mind. Arthur -says that every day. - -There, it is all out, Mina, we have told all our secrets to -each other since we were children. We have slept together -and eaten together, and laughed and cried together, and -now, though I have spoken, I would like to speak more. Oh, -Mina, couldn't you guess? I love him. I am blushing as I -write, for although I think he loves me, he has not told me -so in words. But, oh, Mina, I love him. I love him! There, -that does me good. - -I wish I were with you, dear, sitting by the fire undressing, as we -used to sit, and I would try to tell you what I feel. I do not know -how I am writing this even to you. I am afraid to stop, or I should -tear up the letter, and I don't want to stop, for I do so want to -tell you all. Let me hear from you at once, and tell me all that you -think about it. Mina, pray for my happiness. - -Lucy - - -P.S.--I need not tell you this is a secret. -Goodnight again. L. - - - - -LETTER, LUCY WESTENRA TO MINA MURRAY - -24 May - -My dearest Mina, - -Thanks, and thanks, and thanks again for your sweet letter. It -was so nice to be able to tell you and to have your sympathy. - -My dear, it never rains but it pours. How true the old proverbs -are. Here am I, who shall be twenty in September, and yet I never -had a proposal till today, not a real proposal, and today I had -three. Just fancy! Three proposals in one day! Isn't it awful! I -feel sorry, really and truly sorry, for two of the poor fellows. -Oh, Mina, I am so happy that I don't know what to do with myself. -And three proposals! But, for goodness' sake, don't tell any of the -girls, or they would be getting all sorts of extravagant ideas, and -imagining themselves injured and slighted if in their very first day -at home they did not get six at least. Some girls are so vain! You -and I, Mina dear, who are engaged and are going to settle down soon -soberly into old married women, can despise vanity. Well, I must -tell you about the three, but you must keep it a secret, dear, from -every one except, of course, Jonathan. You will tell him, because I -would, if I were in your place, certainly tell Arthur. A woman -ought to tell her husband everything. Don't you think so, dear? And -I must be fair. Men like women, certainly their wives, to be quite -as fair as they are. And women, I am afraid, are not always quite -as fair as they should be. - -Well, my dear, number One came just before lunch. I told you of -him, Dr. John Seward, the lunatic asylum man, with the strong jaw -and the good forehead. He was very cool outwardly, but was nervous -all the same. He had evidently been schooling himself as to all -sorts of little things, and remembered them, but he almost managed -to sit down on his silk hat, which men don't generally do when they -are cool, and then when he wanted to appear at ease he kept playing -with a lancet in a way that made me nearly scream. He spoke to me, -Mina, very straightforwardly. He told me how dear I was to him, -though he had known me so little, and what his life would be with me -to help and cheer him. He was going to tell me how unhappy he would -be if I did not care for him, but when he saw me cry he said he was -a brute and would not add to my present trouble. Then he broke off -and asked if I could love him in time, and when I shook my head his -hands trembled, and then with some hesitation he asked me if I cared -already for any one else. He put it very nicely, saying that he did -not want to wring my confidence from me, but only to know, because -if a woman's heart was free a man might have hope. And then, Mina, -I felt a sort of duty to tell him that there was some one. I only -told him that much, and then he stood up, and he looked very strong -and very grave as he took both my hands in his and said he hoped I -would be happy, and that If I ever wanted a friend I must count him -one of my best. - -Oh, Mina dear, I can't help crying, and you must excuse this letter -being all blotted. Being proposed to is all very nice and all that -sort of thing, but it isn't at all a happy thing when you have to -see a poor fellow, whom you know loves you honestly, going away and -looking all broken hearted, and to know that, no matter what he may -say at the moment, you are passing out of his life. My dear, I must -stop here at present, I feel so miserable, though I am so happy. - -Evening. - -Arthur has just gone, and I feel in better spirits than when I -left off, so I can go on telling you about the day. - -Well, my dear, number Two came after lunch. He is such a nice -fellow, an American from Texas, and he looks so young and so fresh -that it seems almost impossible that he has been to so many places -and has such adventures. I sympathize with poor Desdemona when she -had such a stream poured in her ear, even by a black man. I suppose -that we women are such cowards that we think a man will save us from -fears, and we marry him. I know now what I would do if I were a man -and wanted to make a girl love me. No, I don't, for there was Mr. -Morris telling us his stories, and Arthur never told any, and -yet . . . - -My dear, I am somewhat previous. Mr. Quincy P. Morris found me -alone. It seems that a man always does find a girl alone. No, he -doesn't, for Arthur tried twice to make a chance, and I helping him -all I could, I am not ashamed to say it now. I must tell you -beforehand that Mr. Morris doesn't always speak slang, that is to -say, he never does so to strangers or before them, for he is really -well educated and has exquisite manners, but he found out that it -amused me to hear him talk American slang, and whenever I was -present, and there was no one to be shocked, he said such funny -things. I am afraid, my dear, he has to invent it all, for it fits -exactly into whatever else he has to say. But this is a way slang -has. I do not know myself if I shall ever speak slang. I do not -know if Arthur likes it, as I have never heard him use any as yet. - -Well, Mr. Morris sat down beside me and looked as happy and jolly as -he could, but I could see all the same that he was very nervous. He -took my hand in his, and said ever so sweetly . . . - -"Miss Lucy, I know I ain't good enough to regulate the fixin's of -your little shoes, but I guess if you wait till you find a man that -is you will go join them seven young women with the lamps when you -quit. Won't you just hitch up alongside of me and let us go down -the long road together, driving in double harness?" - -Well, he did look so good humoured and so jolly that it didn't seem -half so hard to refuse him as it did poor Dr. Seward. So I said, as -lightly as I could, that I did not know anything of hitching, and -that I wasn't broken to harness at all yet. Then he said that he -had spoken in a light manner, and he hoped that if he had made a -mistake in doing so on so grave, so momentous, and occasion for him, -I would forgive him. He really did look serious when he was saying -it, and I couldn't help feeling a sort of exultation that he was -number Two in one day. And then, my dear, before I could say a word -he began pouring out a perfect torrent of love-making, laying his -very heart and soul at my feet. He looked so earnest over it that I -shall never again think that a man must be playful always, and never -earnest, because he is merry at times. I suppose he saw something -in my face which checked him, for he suddenly stopped, and said with -a sort of manly fervour that I could have loved him for if I had -been free . . . - -"Lucy, you are an honest hearted girl, I know. I should not be here -speaking to you as I am now if I did not believe you clean grit, -right through to the very depths of your soul. Tell me, like one -good fellow to another, is there any one else that you care for? -And if there is I'll never trouble you a hair's breadth again, but -will be, if you will let me, a very faithful friend." - -My dear Mina, why are men so noble when we women are so little -worthy of them? Here was I almost making fun of this great hearted, -true gentleman. I burst into tears, I am afraid, my dear, you will -think this a very sloppy letter in more ways than one, and I really -felt very badly. - -Why can't they let a girl marry three men, or as many as -want her, and save all this trouble? But this is heresy, -and I must not say it. I am glad to say that, though I was -crying, I was able to look into Mr. Morris' brave eyes, and -I told him out straight . . . - -"Yes, there is some one I love, though he has not told me -yet that he even loves me." I was right to speak to him so -frankly, for quite a light came into his face, and he put -out both his hands and took mine, I think I put them into -his, and said in a hearty way . . . - -"That's my brave girl. It's better worth being late for a chance of -winning you than being in time for any other girl in the world. -Don't cry, my dear. If it's for me, I'm a hard nut to crack, and I -take it standing up. If that other fellow doesn't know his -happiness, well, he'd better look for it soon, or he'll have to deal -with me. Little girl, your honesty and pluck have made me a friend, -and that's rarer than a lover, it's more selfish anyhow. My dear, -I'm going to have a pretty lonely walk between this and Kingdom -Come. Won't you give me one kiss? It'll be something to keep off -the darkness now and then. You can, you know, if you like, for that -other good fellow, or you could not love him, hasn't spoken yet." - -That quite won me, Mina, for it was brave and sweet of him, -and noble too, to a rival, wasn't it? And he so sad, so I -leant over and kissed him. - -He stood up with my two hands in his, and as he looked down into my -face, I am afraid I was blushing very much, he said, "Little girl, I -hold your hand, and you've kissed me, and if these things don't make -us friends nothing ever will. Thank you for your sweet honesty to -me, and goodbye." - -He wrung my hand, and taking up his hat, went straight out of the -room without looking back, without a tear or a quiver or a pause, -and I am crying like a baby. - -Oh, why must a man like that be made unhappy when there are lots of -girls about who would worship the very ground he trod on? I know I -would if I were free, only I don't want to be free. My dear, this -quite upset me, and I feel I cannot write of happiness just at once, -after telling you of it, and I don't wish to tell of the number -Three until it can be all happy. Ever your loving . . . - -Lucy - - -P.S.--Oh, about number Three, I needn't tell you of number -Three, need I? Besides, it was all so confused. It seemed -only a moment from his coming into the room till both his -arms were round me, and he was kissing me. I am very, very -happy, and I don't know what I have done to deserve it. I -must only try in the future to show that I am not ungrateful -to God for all His goodness to me in sending to me such a -lover, such a husband, and such a friend. - -Goodbye. - - - -DR. SEWARD'S DIARY (Kept in phonograph) - -25 May.--Ebb tide in appetite today. Cannot eat, cannot rest, so -diary instead. Since my rebuff of yesterday I have a sort of empty -feeling. Nothing in the world seems of sufficient importance to be -worth the doing. As I knew that the only cure for this sort of thing -was work, I went amongst the patients. I picked out one who has -afforded me a study of much interest. He is so quaint that I am -determined to understand him as well as I can. Today I seemed to get -nearer than ever before to the heart of his mystery. - -I questioned him more fully than I had ever done, with a view to -making myself master of the facts of his hallucination. In my manner -of doing it there was, I now see, something of cruelty. I seemed to -wish to keep him to the point of his madness, a thing which I avoid -with the patients as I would the mouth of hell. - -(Mem., Under what circumstances would I not avoid the pit of hell?) -Omnia Romae venalia sunt. Hell has its price! If there be anything -behind this instinct it will be valuable to trace it afterwards -accurately, so I had better commence to do so, therefore . . . - -R. M, Renfield, age 59. Sanguine temperament, great physical -strength, morbidly excitable, periods of gloom, ending in some fixed -idea which I cannot make out. I presume that the sanguine temperament -itself and the disturbing influence end in a mentally-accomplished -finish, a possibly dangerous man, probably dangerous if unselfish. In -selfish men caution is as secure an armour for their foes as for -themselves. What I think of on this point is, when self is the fixed -point the centripetal force is balanced with the centrifugal. When -duty, a cause, etc., is the fixed point, the latter force is -paramount, and only accident or a series of accidents can balance it. - - - -LETTER, QUINCEY P. MORRIS TO HON. ARTHUR HOLMOOD - -25 May. - -My dear Art, - -We've told yarns by the campfire in the prairies, and dressed one -another's wounds after trying a landing at the Marquesas, and drunk -healths on the shore of Titicaca. There are more yarns to be told, -and other wounds to be healed, and another health to be drunk. -Won't you let this be at my campfire tomorrow night? I have no -hesitation in asking you, as I know a certain lady is engaged to a -certain dinner party, and that you are free. There will only be one -other, our old pal at the Korea, Jack Seward. He's coming, too, and -we both want to mingle our weeps over the wine cup, and to drink a -health with all our hearts to the happiest man in all the wide -world, who has won the noblest heart that God has made and best -worth winning. We promise you a hearty welcome, and a loving -greeting, and a health as true as your own right hand. We shall -both swear to leave you at home if you drink too deep to a certain -pair of eyes. Come! - -Yours, as ever and always, - -Quincey P. Morris - - - - - -TELEGRAM FROM ARTHUR HOLMWOOD TO QUINCEY P. MORRIS - -26 May - - -Count me in every time. I bear messages which will make both -your ears tingle. - -Art - - - - -CHAPTER 6 - - -MINA MURRAY'S JOURNAL - -24 July. Whitby.--Lucy met me at the station, looking sweeter and -lovelier than ever, and we drove up to the house at the Crescent in -which they have rooms. This is a lovely place. The little river, the -Esk, runs through a deep valley, which broadens out as it comes near -the harbour. A great viaduct runs across, with high piers, through -which the view seems somehow further away than it really is. The -valley is beautifully green, and it is so steep that when you are on -the high land on either side you look right across it, unless you are -near enough to see down. The houses of the old town--the side away -from us, are all red-roofed, and seem piled up one over the other -anyhow, like the pictures we see of Nuremberg. Right over the town is -the ruin of Whitby Abbey, which was sacked by the Danes, and which is -the scene of part of "Marmion," where the girl was built up in the -wall. It is a most noble ruin, of immense size, and full of beautiful -and romantic bits. There is a legend that a white lady is seen in one -of the windows. Between it and the town there is another church, the -parish one, round which is a big graveyard, all full of tombstones. -This is to my mind the nicest spot in Whitby, for it lies right over -the town, and has a full view of the harbour and all up the bay to -where the headland called Kettleness stretches out into the sea. It -descends so steeply over the harbour that part of the bank has fallen -away, and some of the graves have been destroyed. - -In one place part of the stonework of the graves stretches out over -the sandy pathway far below. There are walks, with seats beside them, -through the churchyard, and people go and sit there all day long -looking at the beautiful view and enjoying the breeze. - -I shall come and sit here often myself and work. Indeed, I am writing -now, with my book on my knee, and listening to the talk of three old -men who are sitting beside me. They seem to do nothing all day but -sit here and talk. - -The harbour lies below me, with, on the far side, one long granite -wall stretching out into the sea, with a curve outwards at the end of -it, in the middle of which is a lighthouse. A heavy seawall runs -along outside of it. On the near side, the seawall makes an elbow -crooked inversely, and its end too has a lighthouse. Between the two -piers there is a narrow opening into the harbour, which then suddenly -widens. - -It is nice at high water, but when the tide is out it shoals away to -nothing, and there is merely the stream of the Esk, running between -banks of sand, with rocks here and there. Outside the harbour on this -side there rises for about half a mile a great reef, the sharp of -which runs straight out from behind the south lighthouse. At the end -of it is a buoy with a bell, which swings in bad weather, and sends in -a mournful sound on the wind. - -They have a legend here that when a ship is lost bells are heard out at -sea. I must ask the old man about this. He is coming this way . . . - -He is a funny old man. He must be awfully old, for his face is -gnarled and twisted like the bark of a tree. He tells me that he is -nearly a hundred, and that he was a sailor in the Greenland fishing -fleet when Waterloo was fought. He is, I am afraid, a very sceptical -person, for when I asked him about the bells at sea and the White Lady -at the abbey he said very brusquely, - -"I wouldn't fash masel' about them, miss. Them things be all wore -out. Mind, I don't say that they never was, but I do say that they -wasn't in my time. They be all very well for comers and trippers, an' -the like, but not for a nice young lady like you. Them feet-folks -from York and Leeds that be always eatin' cured herrin's and drinkin' -tea an' lookin' out to buy cheap jet would creed aught. I wonder -masel' who'd be bothered tellin' lies to them, even the newspapers, -which is full of fool-talk." - -I thought he would be a good person to learn interesting things from, -so I asked him if he would mind telling me something about the whale -fishing in the old days. He was just settling himself to begin when -the clock struck six, whereupon he laboured to get up, and said, - -"I must gang ageeanwards home now, miss. My grand-daughter doesn't -like to be kept waitin' when the tea is ready, for it takes me time to -crammle aboon the grees, for there be a many of 'em, and miss, I lack -belly-timber sairly by the clock." - -He hobbled away, and I could see him hurrying, as well as he could, -down the steps. The steps are a great feature on the place. They -lead from the town to the church, there are hundreds of them, I do not -know how many, and they wind up in a delicate curve. The slope is so -gentle that a horse could easily walk up and down them. - -I think they must originally have had something to do with the abbey. -I shall go home too. Lucy went out, visiting with her mother, and as -they were only duty calls, I did not go. - - -1 August.--I came up here an hour ago with Lucy, and we had a most -interesting talk with my old friend and the two others who always come -and join him. He is evidently the Sir Oracle of them, and I should -think must have been in his time a most dictatorial person. - -He will not admit anything, and down faces everybody. If he can't -out-argue them he bullies them, and then takes their silence for -agreement with his views. - -Lucy was looking sweetly pretty in her white lawn frock. She has got -a beautiful colour since she has been here. - -I noticed that the old men did not lose any time in coming and sitting -near her when we sat down. She is so sweet with old people, I think -they all fell in love with her on the spot. Even my old man succumbed -and did not contradict her, but gave me double share instead. I got -him on the subject of the legends, and he went off at once into a sort -of sermon. I must try to remember it and put it down. - -"It be all fool-talk, lock, stock, and barrel, that's what it be and -nowt else. These bans an' wafts an' boh-ghosts an' bar-guests an' -bogles an' all anent them is only fit to set bairns an' dizzy women -a'belderin'. They be nowt but air-blebs. They, an' all grims an' signs -an' warnin's, be all invented by parsons an' illsome berk-bodies an' -railway touters to skeer an' scunner hafflin's, an' to get folks to do -somethin' that they don't other incline to. It makes me ireful to -think o' them. Why, it's them that, not content with printin' lies on -paper an' preachin' them out of pulpits, does want to be cuttin' them -on the tombstones. Look here all around you in what airt ye will. All -them steans, holdin' up their heads as well as they can out of their -pride, is acant, simply tumblin' down with the weight o' the lies -wrote on them, 'Here lies the body' or 'Sacred to the memory' wrote on -all of them, an' yet in nigh half of them there bean't no bodies at -all, an' the memories of them bean't cared a pinch of snuff about, -much less sacred. Lies all of them, nothin' but lies of one kind or -another! My gog, but it'll be a quare scowderment at the Day of -Judgment when they come tumblin' up in their death-sarks, all jouped -together an' trying' to drag their tombsteans with them to prove how -good they was, some of them trimmlin' an' dithering, with their hands -that dozzened an' slippery from lyin' in the sea that they can't even -keep their gurp o' them." - -I could see from the old fellow's self-satisfied air and the way in -which he looked round for the approval of his cronies that he was -"showing off," so I put in a word to keep him going. - -"Oh, Mr. Swales, you can't be serious. Surely these tombstones are -not all wrong?" - -"Yabblins! There may be a poorish few not wrong, savin' where they -make out the people too good, for there be folk that do think a -balm-bowl be like the sea, if only it be their own. The whole thing -be only lies. Now look you here. You come here a stranger, an' you -see this kirkgarth." - -I nodded, for I thought it better to assent, though I did not quite -understand his dialect. I knew it had something to do with the -church. - -He went on, "And you consate that all these steans be aboon folk that -be haped here, snod an' snog?" I assented again. "Then that be just -where the lie comes in. Why, there be scores of these laybeds that be -toom as old Dun's 'baccabox on Friday night." - -He nudged one of his companions, and they all laughed. "And, my gog! -How could they be otherwise? Look at that one, the aftest abaft the -bier-bank, read it!" - -I went over and read, "Edward Spencelagh, master mariner, murdered by -pirates off the coast of Andres, April, 1854, age 30." When I came -back Mr. Swales went on, - -"Who brought him home, I wonder, to hap him here? Murdered off the -coast of Andres! An' you consated his body lay under! Why, I could -name ye a dozen whose bones lie in the Greenland seas above," he -pointed northwards, "or where the currants may have drifted them. -There be the steans around ye. Ye can, with your young eyes, read the -small print of the lies from here. This Braithwaite Lowery, I knew -his father, lost in the Lively off Greenland in '20, or Andrew -Woodhouse, drowned in the same seas in 1777, or John Paxton, drowned -off Cape Farewell a year later, or old John Rawlings, whose -grandfather sailed with me, drowned in the Gulf of Finland in '50. Do -ye think that all these men will have to make a rush to Whitby when -the trumpet sounds? I have me antherums aboot it! I tell ye that -when they got here they'd be jommlin' and jostlin' one another that -way that it 'ud be like a fight up on the ice in the old days, when -we'd be at one another from daylight to dark, an' tryin' to tie up our -cuts by the aurora borealis." This was evidently local pleasantry, for -the old man cackled over it, and his cronies joined in with gusto. - -"But," I said, "surely you are not quite correct, for you start on the -assumption that all the poor people, or their spirits, will have to -take their tombstones with them on the Day of Judgment. Do you think -that will be really necessary?" - -"Well, what else be they tombstones for? Answer me that, miss!" - -"To please their relatives, I suppose." - -"To please their relatives, you suppose!" This he said with intense -scorn. "How will it pleasure their relatives to know that lies is -wrote over them, and that everybody in the place knows that they be -lies?" - -He pointed to a stone at our feet which had been laid down as a slab, -on which the seat was rested, close to the edge of the cliff. "Read -the lies on that thruff-stone," he said. - -The letters were upside down to me from where I sat, but Lucy was more -opposite to them, so she leant over and read, "Sacred to the memory of -George Canon, who died, in the hope of a glorious resurrection, on -July 29, 1873, falling from the rocks at Kettleness. This tomb was -erected by his sorrowing mother to her dearly beloved son. 'He was the -only son of his mother, and she was a widow.' Really, Mr. Swales, I -don't see anything very funny in that!" She spoke her comment very -gravely and somewhat severely. - -"Ye don't see aught funny! Ha-ha! But that's because ye don't gawm -the sorrowin' mother was a hell-cat that hated him because he was -acrewk'd, a regular lamiter he was, an' he hated her so that he -committed suicide in order that she mightn't get an insurance she put -on his life. He blew nigh the top of his head off with an old musket -that they had for scarin' crows with. 'Twarn't for crows then, for it -brought the clegs and the dowps to him. That's the way he fell off -the rocks. And, as to hopes of a glorious resurrection, I've often -heard him say masel' that he hoped he'd go to hell, for his mother was -so pious that she'd be sure to go to heaven, an' he didn't want to -addle where she was. Now isn't that stean at any rate," he hammered -it with his stick as he spoke, "a pack of lies? And won't it make -Gabriel keckle when Geordie comes pantin' ut the grees with the -tompstean balanced on his hump, and asks to be took as evidence!" - -I did not know what to say, but Lucy turned the conversation as she -said, rising up, "Oh, why did you tell us of this? It is my favourite -seat, and I cannot leave it, and now I find I must go on sitting over -the grave of a suicide." - -"That won't harm ye, my pretty, an' it may make poor Geordie gladsome -to have so trim a lass sittin' on his lap. That won't hurt ye. Why, -I've sat here off an' on for nigh twenty years past, an' it hasn't -done me no harm. Don't ye fash about them as lies under ye, or that -doesn' lie there either! It'll be time for ye to be getting scart -when ye see the tombsteans all run away with, and the place as bare as -a stubble-field. There's the clock, and I must gang. My service to -ye, ladies!" And off he hobbled. - -Lucy and I sat awhile, and it was all so beautiful before us that we -took hands as we sat, and she told me all over again about Arthur and -their coming marriage. That made me just a little heart-sick, for I -haven't heard from Jonathan for a whole month. - - -The same day. I came up here alone, for I am very sad. There was no -letter for me. I hope there cannot be anything the matter with -Jonathan. The clock has just struck nine. I see the lights scattered -all over the town, sometimes in rows where the streets are, and -sometimes singly. They run right up the Esk and die away in the curve -of the valley. To my left the view is cut off by a black line of roof -of the old house next to the abbey. The sheep and lambs are bleating -in the fields away behind me, and there is a clatter of donkeys' hoofs -up the paved road below. The band on the pier is playing a harsh -waltz in good time, and further along the quay there is a Salvation -Army meeting in a back street. Neither of the bands hears the other, -but up here I hear and see them both. I wonder where Jonathan is and -if he is thinking of me! I wish he were here. - - - -DR. SEWARD'S DIARY - -5 June.--The case of Renfield grows more interesting the more I get to -understand the man. He has certain qualities very largely developed, -selfishness, secrecy, and purpose. - -I wish I could get at what is the object of the latter. He seems to -have some settled scheme of his own, but what it is I do not know. -His redeeming quality is a love of animals, though, indeed, he has -such curious turns in it that I sometimes imagine he is only -abnormally cruel. His pets are of odd sorts. - -Just now his hobby is catching flies. He has at present such a -quantity that I have had myself to expostulate. To my astonishment, -he did not break out into a fury, as I expected, but took the matter -in simple seriousness. He thought for a moment, and then said, "May I -have three days? I shall clear them away." Of course, I said that -would do. I must watch him. - - -18 June.--He has turned his mind now to spiders, and has got several -very big fellows in a box. He keeps feeding them his flies, and the -number of the latter is becoming sensibly diminished, although he has -used half his food in attracting more flies from outside to his room. - - -1 July.--His spiders are now becoming as great a nuisance as his -flies, and today I told him that he must get rid of them. - -He looked very sad at this, so I said that he must some of them, at -all events. He cheerfully acquiesced in this, and I gave him the same -time as before for reduction. - -He disgusted me much while with him, for when a horrid blowfly, -bloated with some carrion food, buzzed into the room, he caught it, -held it exultantly for a few moments between his finger and thumb, and -before I knew what he was going to do, put it in his mouth and ate it. - -I scolded him for it, but he argued quietly that it was very good and -very wholesome, that it was life, strong life, and gave life to him. -This gave me an idea, or the rudiment of one. I must watch how he -gets rid of his spiders. - -He has evidently some deep problem in his mind, for he keeps a little -notebook in which he is always jotting down something. Whole pages of -it are filled with masses of figures, generally single numbers added -up in batches, and then the totals added in batches again, as though -he were focussing some account, as the auditors put it. - - -8 July.--There is a method in his madness, and the rudimentary idea in -my mind is growing. It will be a whole idea soon, and then, oh, -unconscious cerebration, you will have to give the wall to your -conscious brother. - -I kept away from my friend for a few days, so that I might notice if -there were any change. Things remain as they were except that he has -parted with some of his pets and got a new one. - -He has managed to get a sparrow, and has already partially tamed it. -His means of taming is simple, for already the spiders have -diminished. Those that do remain, however, are well fed, for he still -brings in the flies by tempting them with his food. - -19 July--We are progressing. My friend has now a whole colony of -sparrows, and his flies and spiders are almost obliterated. When I -came in he ran to me and said he wanted to ask me a great favour, a -very, very great favour. And as he spoke, he fawned on me like a dog. - -I asked him what it was, and he said, with a sort of rapture in his -voice and bearing, "A kitten, a nice, little, sleek playful kitten, -that I can play with, and teach, and feed, and feed, and feed!" - -I was not unprepared for this request, for I had noticed how his pets -went on increasing in size and vivacity, but I did not care that his -pretty family of tame sparrows should be wiped out in the same manner -as the flies and spiders. So I said I would see about it, and asked -him if he would not rather have a cat than a kitten. - -His eagerness betrayed him as he answered, "Oh, yes, I would like a -cat! I only asked for a kitten lest you should refuse me a cat. No -one would refuse me a kitten, would they?" - -I shook my head, and said that at present I feared it would not be -possible, but that I would see about it. His face fell, and I could -see a warning of danger in it, for there was a sudden fierce, sidelong -look which meant killing. The man is an undeveloped homicidal -maniac. I shall test him with his present craving and see how it will -work out, then I shall know more. - - -10 pm.--I have visited him again and found him sitting in a corner -brooding. When I came in he threw himself on his knees before me and -implored me to let him have a cat, that his salvation depended upon -it. - -I was firm, however, and told him that he could not have it, whereupon -he went without a word, and sat down, gnawing his fingers, in the -corner where I had found him. I shall see him in the morning early. - - -20 July.--Visited Renfield very early, before attendant went his -rounds. Found him up and humming a tune. He was spreading out his -sugar, which he had saved, in the window, and was manifestly beginning -his fly catching again, and beginning it cheerfully and with a good -grace. - -I looked around for his birds, and not seeing them, asked him where -they were. He replied, without turning round, that they had all flown -away. There were a few feathers about the room and on his pillow a -drop of blood. I said nothing, but went and told the keeper to report -to me if there were anything odd about him during the day. - - -11 am.--The attendant has just been to see me to say that Renfield has -been very sick and has disgorged a whole lot of feathers. "My belief -is, doctor," he said, "that he has eaten his birds, and that he just -took and ate them raw!" - - -11 pm.--I gave Renfield a strong opiate tonight, enough to make even -him sleep, and took away his pocketbook to look at it. The thought -that has been buzzing about my brain lately is complete, and the -theory proved. - -My homicidal maniac is of a peculiar kind. I shall have to invent a -new classification for him, and call him a zoophagous (life-eating) -maniac. What he desires is to absorb as many lives as he can, and he -has laid himself out to achieve it in a cumulative way. He gave many -flies to one spider and many spiders to one bird, and then wanted a -cat to eat the many birds. What would have been his later steps? - -It would almost be worth while to complete the experiment. It might -be done if there were only a sufficient cause. Men sneered at -vivisection, and yet look at its results today! Why not advance -science in its most difficult and vital aspect, the knowledge of the -brain? - -Had I even the secret of one such mind, did I hold the key to the -fancy of even one lunatic, I might advance my own branch of science to -a pitch compared with which Burdon-Sanderson's physiology or Ferrier's -brain knowledge would be as nothing. If only there were a sufficient -cause! I must not think too much of this, or I may be tempted. A -good cause might turn the scale with me, for may not I too be of an -exceptional brain, congenitally? - -How well the man reasoned. Lunatics always do within their own scope. -I wonder at how many lives he values a man, or if at only one. He has -closed the account most accurately, and today begun a new record. How -many of us begin a new record with each day of our lives? - -To me it seems only yesterday that my whole life ended with my new -hope, and that truly I began a new record. So it shall be until the -Great Recorder sums me up and closes my ledger account with a balance -to profit or loss. - -Oh, Lucy, Lucy, I cannot be angry with you, nor can I be angry with my -friend whose happiness is yours, but I must only wait on hopeless and -work. Work! Work! - -If I could have as strong a cause as my poor mad friend there, a good, -unselfish cause to make me work, that would be indeed happiness. - - - -MINA MURRAY'S JOURNAL - -26 July.--I am anxious, and it soothes me to express myself here. It -is like whispering to one's self and listening at the same time. And -there is also something about the shorthand symbols that makes it -different from writing. I am unhappy about Lucy and about Jonathan. -I had not heard from Jonathan for some time, and was very concerned, -but yesterday dear Mr. Hawkins, who is always so kind, sent me a -letter from him. I had written asking him if he had heard, and he -said the enclosed had just been received. It is only a line dated -from Castle Dracula, and says that he is just starting for home. That -is not like Jonathan. I do not understand it, and it makes me uneasy. - -Then, too, Lucy, although she is so well, has lately taken to her old -habit of walking in her sleep. Her mother has spoken to me about it, -and we have decided that I am to lock the door of our room every -night. - -Mrs. Westenra has got an idea that sleep-walkers always go out on -roofs of houses and along the edges of cliffs and then get suddenly -wakened and fall over with a despairing cry that echoes all over the -place. - -Poor dear, she is naturally anxious about Lucy, and she tells me that -her husband, Lucy's father, had the same habit, that he would get up -in the night and dress himself and go out, if he were not stopped. - -Lucy is to be married in the autumn, and she is already planning out -her dresses and how her house is to be arranged. I sympathise with -her, for I do the same, only Jonathan and I will start in life in a -very simple way, and shall have to try to make both ends meet. - -Mr. Holmwood, he is the Hon. Arthur Holmwood, only son of Lord -Godalming, is coming up here very shortly, as soon as he can leave -town, for his father is not very well, and I think dear Lucy is -counting the moments till he comes. - -She wants to take him up in the seat on the churchyard cliff and show -him the beauty of Whitby. I daresay it is the waiting which disturbs -her. She will be all right when he arrives. - - -27 July.--No news from Jonathan. I am getting quite uneasy about him, -though why I should I do not know, but I do wish that he would write, -if it were only a single line. - -Lucy walks more than ever, and each night I am awakened by her moving -about the room. Fortunately, the weather is so hot that she cannot -get cold. But still, the anxiety and the perpetually being awakened -is beginning to tell on me, and I am getting nervous and wakeful -myself. Thank God, Lucy's health keeps up. Mr. Holmwood has been -suddenly called to Ring to see his father, who has been taken -seriously ill. Lucy frets at the postponement of seeing him, but it -does not touch her looks. She is a trifle stouter, and her cheeks are -a lovely rose-pink. She has lost the anemic look which she had. I -pray it will all last. - - -3 August.--Another week gone by, and no news from Jonathan, not even -to Mr. Hawkins, from whom I have heard. Oh, I do hope he is not ill. -He surely would have written. I look at that last letter of his, but -somehow it does not satisfy me. It does not read like him, and yet it -is his writing. There is no mistake of that. - -Lucy has not walked much in her sleep the last week, but there is an -odd concentration about her which I do not understand, even in her -sleep she seems to be watching me. She tries the door, and finding it -locked, goes about the room searching for the key. - - -6 August.--Another three days, and no news. This suspense is getting -dreadful. If I only knew where to write to or where to go to, I -should feel easier. But no one has heard a word of Jonathan since -that last letter. I must only pray to God for patience. - -Lucy is more excitable than ever, but is otherwise well. Last night -was very threatening, and the fishermen say that we are in for a -storm. I must try to watch it and learn the weather signs. - -Today is a gray day, and the sun as I write is hidden in thick clouds, -high over Kettleness. Everything is gray except the green grass, -which seems like emerald amongst it, gray earthy rock, gray clouds, -tinged with the sunburst at the far edge, hang over the gray sea, into -which the sandpoints stretch like gray figures. The sea is tumbling -in over the shallows and the sandy flats with a roar, muffled in the -sea-mists drifting inland. The horizon is lost in a gray mist. All -vastness, the clouds are piled up like giant rocks, and there is a -'brool' over the sea that sounds like some passage of doom. Dark -figures are on the beach here and there, sometimes half shrouded in -the mist, and seem 'men like trees walking'. The fishing boats are -racing for home, and rise and dip in the ground swell as they sweep -into the harbour, bending to the scuppers. Here comes old Mr. Swales. -He is making straight for me, and I can see, by the way he lifts his -hat, that he wants to talk. - -I have been quite touched by the change in the poor old man. When he -sat down beside me, he said in a very gentle way, "I want to say -something to you, miss." - -I could see he was not at ease, so I took his poor old wrinkled hand in -mine and asked him to speak fully. - -So he said, leaving his hand in mine, "I'm afraid, my deary, that I -must have shocked you by all the wicked things I've been sayin' about -the dead, and such like, for weeks past, but I didn't mean them, and I -want ye to remember that when I'm gone. We aud folks that be daffled, -and with one foot abaft the krok-hooal, don't altogether like to think -of it, and we don't want to feel scart of it, and that's why I've took -to makin' light of it, so that I'd cheer up my own heart a bit. But, -Lord love ye, miss, I ain't afraid of dyin', not a bit, only I don't -want to die if I can help it. My time must be nigh at hand now, for I -be aud, and a hundred years is too much for any man to expect. And -I'm so nigh it that the Aud Man is already whettin' his scythe. Ye -see, I can't get out o' the habit of caffin' about it all at once. -The chafts will wag as they be used to. Some day soon the Angel of -Death will sound his trumpet for me. But don't ye dooal an' greet, my -deary!"--for he saw that I was crying--"if he should come this very -night I'd not refuse to answer his call. For life be, after all, only -a waitin' for somethin' else than what we're doin', and death be all -that we can rightly depend on. But I'm content, for it's comin' to -me, my deary, and comin' quick. It may be comin' while we be lookin' -and wonderin'. Maybe it's in that wind out over the sea that's -bringin' with it loss and wreck, and sore distress, and sad hearts. -Look! Look!" he cried suddenly. "There's something in that wind and -in the hoast beyont that sounds, and looks, and tastes, and smells -like death. It's in the air. I feel it comin'. Lord, make me answer -cheerful, when my call comes!" He held up his arms devoutly, and -raised his hat. His mouth moved as though he were praying. After a -few minutes' silence, he got up, shook hands with me, and blessed me, -and said goodbye, and hobbled off. It all touched me, and upset me -very much. - -I was glad when the coastguard came along, with his spyglass under his -arm. He stopped to talk with me, as he always does, but all the time -kept looking at a strange ship. - -"I can't make her out," he said. "She's a Russian, by the look of -her. But she's knocking about in the queerest way. She doesn't know -her mind a bit. She seems to see the storm coming, but can't decide -whether to run up north in the open, or to put in here. Look there -again! She is steered mighty strangely, for she doesn't mind the hand -on the wheel, changes about with every puff of wind. We'll hear more -of her before this time tomorrow." - - - - -CHAPTER 7 - - -CUTTING FROM "THE DAILYGRAPH", 8 AUGUST - - -(PASTED IN MINA MURRAY'S JOURNAL) - - -From a correspondent. - -Whitby. - -One of the greatest and suddenest storms on record has just been -experienced here, with results both strange and unique. The weather -had been somewhat sultry, but not to any degree uncommon in the -month of August. Saturday evening was as fine as was ever known, -and the great body of holiday-makers laid out yesterday for visits -to Mulgrave Woods, Robin Hood's Bay, Rig Mill, Runswick, Staithes, -and the various trips in the neighborhood of Whitby. The steamers -Emma and Scarborough made trips up and down the coast, and there was -an unusual amount of 'tripping' both to and from Whitby. The day -was unusually fine till the afternoon, when some of the gossips who -frequent the East Cliff churchyard, and from the commanding eminence -watch the wide sweep of sea visible to the north and east, called -attention to a sudden show of 'mares tails' high in the sky to the -northwest. The wind was then blowing from the south-west in the -mild degree which in barometrical language is ranked 'No. 2, light -breeze.' - -The coastguard on duty at once made report, and one old fisherman, -who for more than half a century has kept watch on weather signs -from the East Cliff, foretold in an emphatic manner the coming of a -sudden storm. The approach of sunset was so very beautiful, so -grand in its masses of splendidly coloured clouds, that there was -quite an assemblage on the walk along the cliff in the old -churchyard to enjoy the beauty. Before the sun dipped below the -black mass of Kettleness, standing boldly athwart the western sky, -its downward way was marked by myriad clouds of every sunset colour, -flame, purple, pink, green, violet, and all the tints of gold, with -here and there masses not large, but of seemingly absolute -blackness, in all sorts of shapes, as well outlined as colossal -silhouettes. The experience was not lost on the painters, and -doubtless some of the sketches of the 'Prelude to the Great Storm' -will grace the R. A and R. I. walls in May next. - -More than one captain made up his mind then and there that his -'cobble' or his 'mule', as they term the different classes of boats, -would remain in the harbour till the storm had passed. The wind -fell away entirely during the evening, and at midnight there was a -dead calm, a sultry heat, and that prevailing intensity which, on -the approach of thunder, affects persons of a sensitive nature. - -There were but few lights in sight at sea, for even the coasting -steamers, which usually hug the shore so closely, kept well to -seaward, and but few fishing boats were in sight. The only sail -noticeable was a foreign schooner with all sails set, which was -seemingly going westwards. The foolhardiness or ignorance of her -officers was a prolific theme for comment whilst she remained in -sight, and efforts were made to signal her to reduce sail in the -face of her danger. Before the night shut down she was seen with -sails idly flapping as she gently rolled on the undulating swell of -the sea. - -"As idle as a painted ship upon a painted ocean." - -Shortly before ten o'clock the stillness of the air grew quite -oppressive, and the silence was so marked that the bleating of a -sheep inland or the barking of a dog in the town was distinctly -heard, and the band on the pier, with its lively French air, was -like a dischord in the great harmony of nature's silence. A little -after midnight came a strange sound from over the sea, and high -overhead the air began to carry a strange, faint, hollow booming. - -Then without warning the tempest broke. With a rapidity which, at -the time, seemed incredible, and even afterwards is impossible to -realize, the whole aspect of nature at once became convulsed. The -waves rose in growing fury, each over-topping its fellow, till in a -very few minutes the lately glassy sea was like a roaring and -devouring monster. White-crested waves beat madly on the level -sands and rushed up the shelving cliffs. Others broke over the -piers, and with their spume swept the lanthorns of the lighthouses -which rise from the end of either pier of Whitby Harbour. - -The wind roared like thunder, and blew with such force that it was -with difficulty that even strong men kept their feet, or clung with -grim clasp to the iron stanchions. It was found necessary to clear -the entire pier from the mass of onlookers, or else the fatalities -of the night would have increased manifold. To add to the -difficulties and dangers of the time, masses of sea-fog came -drifting inland. White, wet clouds, which swept by in ghostly -fashion, so dank and damp and cold that it needed but little effort -of imagination to think that the spirits of those lost at sea were -touching their living brethren with the clammy hands of death, and -many a one shuddered as the wreaths of sea-mist swept by. - -At times the mist cleared, and the sea for some distance could be -seen in the glare of the lightning, which came thick and fast, -followed by such peals of thunder that the whole sky overhead seemed -trembling under the shock of the footsteps of the storm. - -Some of the scenes thus revealed were of immeasurable grandeur and -of absorbing interest. The sea, running mountains high, threw -skywards with each wave mighty masses of white foam, which the -tempest seemed to snatch at and whirl away into space. Here and -there a fishing boat, with a rag of sail, running madly for shelter -before the blast, now and again the white wings of a storm-tossed -seabird. On the summit of the East Cliff the new searchlight was -ready for experiment, but had not yet been tried. The officers in -charge of it got it into working order, and in the pauses of -onrushing mist swept with it the surface of the sea. Once or twice -its service was most effective, as when a fishing boat, with gunwale -under water, rushed into the harbour, able, by the guidance of the -sheltering light, to avoid the danger of dashing against the piers. -As each boat achieved the safety of the port there was a shout of -joy from the mass of people on the shore, a shout which for a moment -seemed to cleave the gale and was then swept away in its rush. - -Before long the searchlight discovered some distance away a schooner -with all sails set, apparently the same vessel which had been -noticed earlier in the evening. The wind had by this time backed to -the east, and there was a shudder amongst the watchers on the cliff -as they realized the terrible danger in which she now was. - -Between her and the port lay the great flat reef on which so many -good ships have from time to time suffered, and, with the wind -blowing from its present quarter, it would be quite impossible that -she should fetch the entrance of the harbour. - -It was now nearly the hour of high tide, but the waves were so great -that in their troughs the shallows of the shore were almost visible, -and the schooner, with all sails set, was rushing with such speed -that, in the words of one old salt, "she must fetch up somewhere, if -it was only in hell". Then came another rush of sea-fog, greater -than any hitherto, a mass of dank mist, which seemed to close on all -things like a gray pall, and left available to men only the organ of -hearing, for the roar of the tempest, and the crash of the thunder, -and the booming of the mighty billows came through the damp oblivion -even louder than before. The rays of the searchlight were kept fixed -on the harbour mouth across the East Pier, where the shock was -expected, and men waited breathless. - -The wind suddenly shifted to the northeast, and the remnant of the -sea fog melted in the blast. And then, mirabile dictu, between the -piers, leaping from wave to wave as it rushed at headlong speed, -swept the strange schooner before the blast, with all sail set, and -gained the safety of the harbour. The searchlight followed her, and -a shudder ran through all who saw her, for lashed to the helm was a -corpse, with drooping head, which swung horribly to and fro at each -motion of the ship. No other form could be seen on the deck at all. - -A great awe came on all as they realised that the ship, as if by a -miracle, had found the harbour, unsteered save by the hand of a dead -man! However, all took place more quickly than it takes to write -these words. The schooner paused not, but rushing across the -harbour, pitched herself on that accumulation of sand and gravel -washed by many tides and many storms into the southeast corner of -the pier jutting under the East Cliff, known locally as Tate Hill -Pier. - -There was of course a considerable concussion as the vessel drove up -on the sand heap. Every spar, rope, and stay was strained, and some -of the 'top-hammer' came crashing down. But, strangest of all, the -very instant the shore was touched, an immense dog sprang up on deck -from below, as if shot up by the concussion, and running forward, -jumped from the bow on the sand. - -Making straight for the steep cliff, where the churchyard hangs over -the laneway to the East Pier so steeply that some of the flat -tombstones, thruffsteans or through-stones, as they call them in -Whitby vernacular, actually project over where the sustaining cliff -has fallen away, it disappeared in the darkness, which seemed -intensified just beyond the focus of the searchlight. - -It so happened that there was no one at the moment on Tate Hill -Pier, as all those whose houses are in close proximity were either -in bed or were out on the heights above. Thus the coastguard on -duty on the eastern side of the harbour, who at once ran down to the -little pier, was the first to climb aboard. The men working the -searchlight, after scouring the entrance of the harbour without -seeing anything, then turned the light on the derelict and kept it -there. The coastguard ran aft, and when he came beside the wheel, -bent over to examine it, and recoiled at once as though under some -sudden emotion. This seemed to pique general curiosity, and quite a -number of people began to run. - -It is a good way round from the West Cliff by the Draw-bridge to -Tate Hill Pier, but your correspondent is a fairly good runner, and -came well ahead of the crowd. When I arrived, however, I found -already assembled on the pier a crowd, whom the coastguard and -police refused to allow to come on board. By the courtesy of the -chief boatman, I was, as your correspondent, permitted to climb on -deck, and was one of a small group who saw the dead seaman whilst -actually lashed to the wheel. - -It was no wonder that the coastguard was surprised, or even awed, -for not often can such a sight have been seen. The man was simply -fastened by his hands, tied one over the other, to a spoke of the -wheel. Between the inner hand and the wood was a crucifix, the set -of beads on which it was fastened being around both wrists and -wheel, and all kept fast by the binding cords. The poor fellow may -have been seated at one time, but the flapping and buffeting of the -sails had worked through the rudder of the wheel and had dragged him -to and fro, so that the cords with which he was tied had cut the -flesh to the bone. - -Accurate note was made of the state of things, and a doctor, Surgeon -J. M. Caffyn, of 33, East Elliot Place, who came immediately after -me, declared, after making examination, that the man must have been -dead for quite two days. - -In his pocket was a bottle, carefully corked, empty save for -a little roll of paper, which proved to be the addendum to -the log. - -The coastguard said the man must have tied up his own hands, -fastening the knots with his teeth. The fact that a coastguard was -the first on board may save some complications later on, in the -Admiralty Court, for coastguards cannot claim the salvage which is -the right of the first civilian entering on a derelict. Already, -however, the legal tongues are wagging, and one young law student is -loudly asserting that the rights of the owner are already completely -sacrificed, his property being held in contravention of the statues -of mortmain, since the tiller, as emblemship, if not proof, of -delegated possession, is held in a dead hand. - -It is needless to say that the dead steersman has been reverently -removed from the place where he held his honourable watch and ward -till death, a steadfastness as noble as that of the young -Casabianca, and placed in the mortuary to await inquest. - -Already the sudden storm is passing, and its fierceness is -abating. Crowds are scattering backward, and the sky is -beginning to redden over the Yorkshire wolds. - -I shall send, in time for your next issue, further details -of the derelict ship which found her way so miraculously -into harbour in the storm. - - -9 August.--The sequel to the strange arrival of the derelict in the -storm last night is almost more startling than the thing itself. It -turns out that the schooner is Russian from Varna, and is called the -Demeter. She is almost entirely in ballast of silver sand, with -only a small amount of cargo, a number of great wooden boxes filled -with mould. - -This cargo was consigned to a Whitby solicitor, Mr. S.F. Billington, -of 7, The Crescent, who this morning went aboard and took formal -possession of the goods consigned to him. - -The Russian consul, too, acting for the charter-party, took formal -possession of the ship, and paid all harbour dues, etc. - -Nothing is talked about here today except the strange coincidence. -The officials of the Board of Trade have been most exacting in -seeing that every compliance has been made with existing -regulations. As the matter is to be a 'nine days wonder', they are -evidently determined that there shall be no cause of other -complaint. - -A good deal of interest was abroad concerning the dog which landed -when the ship struck, and more than a few of the members of the -S.P.C.A., which is very strong in Whitby, have tried to befriend the -animal. To the general disappointment, however, it was not to be -found. It seems to have disappeared entirely from the town. It may -be that it was frightened and made its way on to the moors, where it -is still hiding in terror. - -There are some who look with dread on such a possibility, lest later -on it should in itself become a danger, for it is evidently a fierce -brute. Early this morning a large dog, a half-bred mastiff -belonging to a coal merchant close to Tate Hill Pier, was found dead -in the roadway opposite its master's yard. It had been fighting, -and manifestly had had a savage opponent, for its throat was torn -away, and its belly was slit open as if with a savage claw. - -Later.--By the kindness of the Board of Trade inspector, I have been -permitted to look over the log book of the Demeter, which was in -order up to within three days, but contained nothing of special -interest except as to facts of missing men. The greatest interest, -however, is with regard to the paper found in the bottle, which was -today produced at the inquest. And a more strange narrative than -the two between them unfold it has not been my lot to come across. - -As there is no motive for concealment, I am permitted to use them, -and accordingly send you a transcript, simply omitting technical -details of seamanship and supercargo. It almost seems as though the -captain had been seized with some kind of mania before he had got -well into blue water, and that this had developed persistently -throughout the voyage. Of course my statement must be taken cum -grano, since I am writing from the dictation of a clerk of the -Russian consul, who kindly translated for me, time being short. - - - - LOG OF THE "DEMETER" Varna to Whitby - - - Written 18 July, things so strange happening, that I shall - keep accurate note henceforth till we land. - - - On 6 July we finished taking in cargo, silver sand and boxes - of earth. At noon set sail. East wind, fresh. Crew, five - hands . . . two mates, cook, and myself, (captain). - - - On 11 July at dawn entered Bosphorus. Boarded by Turkish - Customs officers. Backsheesh. All correct. Under way at - 4 p.m. - - - On 12 July through Dardanelles. More Customs officers and - flagboat of guarding squadron. Backsheesh again. Work of - officers thorough, but quick. Want us off soon. At dark - passed into Archipelago. - - - On 13 July passed Cape Matapan. Crew dissatisfied about - something. Seemed scared, but would not speak out. - - - On 14 July was somewhat anxious about crew. Men all steady - fellows, who sailed with me before. Mate could not make out what - was wrong. They only told him there was SOMETHING, and crossed - themselves. Mate lost temper with one of them that day and struck - him. Expected fierce quarrel, but all was quiet. - - - On 16 July mate reported in the morning that one of the - crew, Petrofsky, was missing. Could not account for it. - Took larboard watch eight bells last night, was relieved by - Amramoff, but did not go to bunk. Men more downcast than - ever. All said they expected something of the kind, but - would not say more than there was SOMETHING aboard. Mate - getting very impatient with them. Feared some trouble - ahead. - - - On 17 July, yesterday, one of the men, Olgaren, came to my cabin, - and in an awestruck way confided to me that he thought there was a - strange man aboard the ship. He said that in his watch he had - been sheltering behind the deckhouse, as there was a rain storm, - when he saw a tall, thin man, who was not like any of the crew, - come up the companionway, and go along the deck forward and - disappear. He followed cautiously, but when he got to bows found - no one, and the hatchways were all closed. He was in a panic of - superstitious fear, and I am afraid the panic may spread. To - allay it, I shall today search the entire ship carefully from stem - to stern. - - - Later in the day I got together the whole crew, and told them, as - they evidently thought there was some one in the ship, we would - search from stem to stern. First mate angry, said it was folly, - and to yield to such foolish ideas would demoralise the men, said - he would engage to keep them out of trouble with the handspike. I - let him take the helm, while the rest began a thorough search, all - keeping abreast, with lanterns. We left no corner unsearched. As - there were only the big wooden boxes, there were no odd corners - where a man could hide. Men much relieved when search over, and - went back to work cheerfully. First mate scowled, but said - nothing. - - - 22 July.--Rough weather last three days, and all hands busy - with sails, no time to be frightened. Men seem to have - forgotten their dread. Mate cheerful again, and all on - good terms. Praised men for work in bad weather. Passed - Gibraltar and out through Straits. All well. - - - 24 July.--There seems some doom over this ship. Already a hand - short, and entering the Bay of Biscay with wild weather ahead, and - yet last night another man lost, disappeared. Like the first, he - came off his watch and was not seen again. Men all in a panic of - fear, sent a round robin, asking to have double watch, as they - fear to be alone. Mate angry. Fear there will be some trouble, - as either he or the men will do some violence. - - - 28 July.--Four days in hell, knocking about in a sort of - maelstrom, and the wind a tempest. No sleep for any one. - Men all worn out. Hardly know how to set a watch, since no - one fit to go on. Second mate volunteered to steer and - watch, and let men snatch a few hours sleep. Wind abating, - seas still terrific, but feel them less, as ship is - steadier. - - - 29 July.--Another tragedy. Had single watch tonight, as crew too - tired to double. When morning watch came on deck could find no - one except steersman. Raised outcry, and all came on deck. - Thorough search, but no one found. Are now without second mate, - and crew in a panic. Mate and I agreed to go armed henceforth and - wait for any sign of cause. - - - 30 July.--Last night. Rejoiced we are nearing England. Weather - fine, all sails set. Retired worn out, slept soundly, awakened by - mate telling me that both man of watch and steersman missing. - Only self and mate and two hands left to work ship. - - 1 August.--Two days of fog, and not a sail sighted. Had hoped - when in the English Channel to be able to signal for help or get - in somewhere. Not having power to work sails, have to run before - wind. Dare not lower, as could not raise them again. We seem to - be drifting to some terrible doom. Mate now more demoralised than - either of men. His stronger nature seems to have worked inwardly - against himself. Men are beyond fear, working stolidly and - patiently, with minds made up to worst. They are Russian, he - Roumanian. - - 2 August, midnight.--Woke up from few minutes sleep by hearing a - cry, seemingly outside my port. Could see nothing in fog. Rushed - on deck, and ran against mate. Tells me he heard cry and ran, but - no sign of man on watch. One more gone. Lord, help us! Mate - says we must be past Straits of Dover, as in a moment of fog - lifting he saw North Foreland, just as he heard the man cry out. - If so we are now off in the North Sea, and only God can guide us - in the fog, which seems to move with us, and God seems to have - deserted us. - - - 3 August.--At midnight I went to relieve the man at the - wheel and when I got to it found no one there. The wind - was steady, and as we ran before it there was no yawing. I - dared not leave it, so shouted for the mate. After a few - seconds, he rushed up on deck in his flannels. He looked - wild-eyed and haggard, and I greatly fear his reason has - given way. He came close to me and whispered hoarsely, - with his mouth to my ear, as though fearing the very air - might hear. "It is here. I know it now. On the watch - last night I saw It, like a man, tall and thin, and ghastly - pale. It was in the bows, and looking out. I crept behind - It, and gave it my knife, but the knife went through It, - empty as the air." And as he spoke he took the knife and - drove it savagely into space. Then he went on, "But It is - here, and I'll find It. It is in the hold, perhaps in one - of those boxes. I'll unscrew them one by one and see. You - work the helm." And with a warning look and his finger on - his lip, he went below. There was springing up a choppy - wind, and I could not leave the helm. I saw him come out - on deck again with a tool chest and lantern, and go down - the forward hatchway. He is mad, stark, raving mad, and - it's no use my trying to stop him. He can't hurt those big - boxes, they are invoiced as clay, and to pull them about is - as harmless a thing as he can do. So here I stay and mind - the helm, and write these notes. I can only trust in God - and wait till the fog clears. Then, if I can't steer to - any harbour with the wind that is, I shall cut down sails, - and lie by, and signal for help . . . - - It is nearly all over now. Just as I was beginning to hope - that the mate would come out calmer, for I heard him - knocking away at something in the hold, and work is good - for him, there came up the hatchway a sudden, startled - scream, which made my blood run cold, and up on the deck he - came as if shot from a gun, a raging madman, with his eyes - rolling and his face convulsed with fear. "Save me! Save - me!" he cried, and then looked round on the blanket of fog. - His horror turned to despair, and in a steady voice he - said, "You had better come too, captain, before it is too - late. He is there! I know the secret now. The sea will - save me from Him, and it is all that is left!" Before I - could say a word, or move forward to seize him, he sprang - on the bulwark and deliberately threw himself into the sea. - I suppose I know the secret too, now. It was this madman - who had got rid of the men one by one, and now he has - followed them himself. God help me! How am I to account - for all these horrors when I get to port? When I get to - port! Will that ever be? - - - 4 August.--Still fog, which the sunrise cannot pierce, I - know there is sunrise because I am a sailor, why else I - know not. I dared not go below, I dared not leave the - helm, so here all night I stayed, and in the dimness of the - night I saw it, Him! God, forgive me, but the mate was - right to jump overboard. It was better to die like a man. - To die like a sailor in blue water, no man can object. But - I am captain, and I must not leave my ship. But I shall - baffle this fiend or monster, for I shall tie my hands to - the wheel when my strength begins to fail, and along with - them I shall tie that which He, It, dare not touch. And - then, come good wind or foul, I shall save my soul, and my - honour as a captain. I am growing weaker, and the night is - coming on. If He can look me in the face again, I may not - have time to act. . . If we are wrecked, mayhap this bottle - may be found, and those who find it may understand. If - not . . . well, then all men shall know that I have been - true to my trust. God and the Blessed Virgin and the - Saints help a poor ignorant soul trying to do his duty . . . - - -Of course the verdict was an open one. There is no evidence -to adduce, and whether or not the man himself committed the -murders there is now none to say. The folk here hold almost -universally that the captain is simply a hero, and he is to be -given a public funeral. Already it is arranged that his body -is to be taken with a train of boats up the Esk for a piece -and then brought back to Tate Hill Pier and up the abbey steps, -for he is to be buried in the churchyard on the cliff. The -owners of more than a hundred boats have already given in their -names as wishing to follow him to the grave. - -No trace has ever been found of the great dog, at which there is -much mourning, for, with public opinion in its present state, he -would, I believe, be adopted by the town. Tomorrow will see the -funeral, and so will end this one more 'mystery of the sea'. - - - -MINA MURRAY'S JOURNAL - -8 August.--Lucy was very restless all night, and I too, could not -sleep. The storm was fearful, and as it boomed loudly among the -chimney pots, it made me shudder. When a sharp puff came it seemed to -be like a distant gun. Strangely enough, Lucy did not wake, but she -got up twice and dressed herself. Fortunately, each time I awoke in -time and managed to undress her without waking her, and got her back to -bed. It is a very strange thing, this sleep-walking, for as soon as -her will is thwarted in any physical way, her intention, if there be -any, disappears, and she yields herself almost exactly to the routine -of her life. - -Early in the morning we both got up and went down to the harbour to see -if anything had happened in the night. There were very few people -about, and though the sun was bright, and the air clear and fresh, the -big, grim-looking waves, that seemed dark themselves because the foam -that topped them was like snow, forced themselves in through the mouth -of the harbour, like a bullying man going through a crowd. Somehow I -felt glad that Jonathan was not on the sea last night, but on land. -But, oh, is he on land or sea? Where is he, and how? I am getting -fearfully anxious about him. If I only knew what to do, and could do -anything! - - -10 August.--The funeral of the poor sea captain today was most -touching. Every boat in the harbour seemed to be there, and the coffin -was carried by captains all the way from Tate Hill Pier up to the -churchyard. Lucy came with me, and we went early to our old seat, -whilst the cortege of boats went up the river to the Viaduct and came -down again. We had a lovely view, and saw the procession nearly all -the way. The poor fellow was laid to rest near our seat so that we -stood on it, when the time came and saw everything. - -Poor Lucy seemed much upset. She was restless and uneasy all the time, -and I cannot but think that her dreaming at night is telling on her. -She is quite odd in one thing. She will not admit to me that there is -any cause for restlessness, or if there be, she does not understand it -herself. - -There is an additional cause in that poor Mr. Swales was found dead -this morning on our seat, his neck being broken. He had evidently, as -the doctor said, fallen back in the seat in some sort of fright, for -there was a look of fear and horror on his face that the men said made -them shudder. Poor dear old man! - -Lucy is so sweet and sensitive that she feels influences more acutely -than other people do. Just now she was quite upset by a little thing -which I did not much heed, though I am myself very fond of animals. - -One of the men who came up here often to look for the boats was -followed by his dog. The dog is always with him. They are both quiet -persons, and I never saw the man angry, nor heard the dog bark. During -the service the dog would not come to its master, who was on the seat -with us, but kept a few yards off, barking and howling. Its master -spoke to it gently, and then harshly, and then angrily. But it would -neither come nor cease to make a noise. It was in a fury, with its -eyes savage, and all its hair bristling out like a cat's tail when puss -is on the war path. - -Finally the man too got angry, and jumped down and kicked the dog, and -then took it by the scruff of the neck and half dragged and half threw -it on the tombstone on which the seat is fixed. The moment it touched -the stone the poor thing began to tremble. It did not try to get away, -but crouched down, quivering and cowering, and was in such a pitiable -state of terror that I tried, though without effect, to comfort it. - -Lucy was full of pity, too, but she did not attempt to touch the dog, -but looked at it in an agonised sort of way. I greatly fear that she -is of too super sensitive a nature to go through the world without -trouble. She will be dreaming of this tonight, I am sure. The whole -agglomeration of things, the ship steered into port by a dead man, his -attitude, tied to the wheel with a crucifix and beads, the touching -funeral, the dog, now furious and now in terror, will all afford -material for her dreams. - -I think it will be best for her to go to bed tired out physically, so I -shall take her for a long walk by the cliffs to Robin Hood's Bay and -back. She ought not to have much inclination for sleep-walking then. - - - - -CHAPTER 8 - - -MINA MURRAY'S JOURNAL - -Same day, 11 o'clock P.M.--Oh, but I am tired! If it were not that I -had made my diary a duty I should not open it tonight. We had a lovely -walk. Lucy, after a while, was in gay spirits, owing, I think, to some -dear cows who came nosing towards us in a field close to the -lighthouse, and frightened the wits out of us. I believe we forgot -everything, except of course, personal fear, and it seemed to wipe the -slate clean and give us a fresh start. We had a capital 'severe tea' -at Robin Hood's Bay in a sweet little old-fashioned inn, with a bow -window right over the seaweed-covered rocks of the strand. I believe -we should have shocked the 'New Woman' with our appetites. Men are -more tolerant, bless them! Then we walked home with some, or rather -many, stoppages to rest, and with our hearts full of a constant dread -of wild bulls. - -Lucy was really tired, and we intended to creep off to bed as soon as -we could. The young curate came in, however, and Mrs. Westenra asked -him to stay for supper. Lucy and I had both a fight for it with the -dusty miller. I know it was a hard fight on my part, and I am quite -heroic. I think that some day the bishops must get together and see -about breeding up a new class of curates, who don't take supper, no -matter how hard they may be pressed to, and who will know when girls -are tired. - -Lucy is asleep and breathing softly. She has more colour in her cheeks -than usual, and looks, oh so sweet. If Mr. Holmwood fell in love with -her seeing her only in the drawing room, I wonder what he would say if -he saw her now. Some of the 'New Women' writers will some day start an -idea that men and women should be allowed to see each other asleep -before proposing or accepting. But I suppose the 'New Woman' won't -condescend in future to accept. She will do the proposing herself. And -a nice job she will make of it too! There's some consolation in that. -I am so happy tonight, because dear Lucy seems better. I really -believe she has turned the corner, and that we are over her troubles -with dreaming. I should be quite happy if I only knew if Jonathan . . . -God bless and keep him. - - -11 August.--Diary again. No sleep now, so I may as well write. I am -too agitated to sleep. We have had such an adventure, such an -agonizing experience. I fell asleep as soon as I had closed my diary. -. . . Suddenly I became broad awake, and sat up, with a horrible sense -of fear upon me, and of some feeling of emptiness around me. The room -was dark, so I could not see Lucy's bed. I stole across and felt for -her. The bed was empty. I lit a match and found that she was not in -the room. The door was shut, but not locked, as I had left it. I feared -to wake her mother, who has been more than usually ill lately, so threw -on some clothes and got ready to look for her. As I was leaving the -room it struck me that the clothes she wore might give me some clue to -her dreaming intention. Dressing-gown would mean house, dress outside. -Dressing-gown and dress were both in their places. "Thank God," I said -to myself, "she cannot be far, as she is only in her nightdress." - -I ran downstairs and looked in the sitting room. Not there! Then I -looked in all the other rooms of the house, with an ever-growing fear -chilling my heart. Finally, I came to the hall door and found it open. -It was not wide open, but the catch of the lock had not caught. The -people of the house are careful to lock the door every night, so I -feared that Lucy must have gone out as she was. There was no time to -think of what might happen. A vague over-mastering fear obscured all -details. - -I took a big, heavy shawl and ran out. The clock was striking one as I -was in the Crescent, and there was not a soul in sight. I ran along -the North Terrace, but could see no sign of the white figure which I -expected. At the edge of the West Cliff above the pier I looked across -the harbour to the East Cliff, in the hope or fear, I don't know which, -of seeing Lucy in our favourite seat. - -There was a bright full moon, with heavy black, driving clouds, which -threw the whole scene into a fleeting diorama of light and shade as -they sailed across. For a moment or two I could see nothing, as the -shadow of a cloud obscured St. Mary's Church and all around it. Then -as the cloud passed I could see the ruins of the abbey coming into -view, and as the edge of a narrow band of light as sharp as a sword-cut -moved along, the church and churchyard became gradually visible. -Whatever my expectation was, it was not disappointed, for there, on our -favourite seat, the silver light of the moon struck a half-reclining -figure, snowy white. The coming of the cloud was too quick for me to -see much, for shadow shut down on light almost immediately, but it -seemed to me as though something dark stood behind the seat where the -white figure shone, and bent over it. What it was, whether man or -beast, I could not tell. - -I did not wait to catch another glance, but flew down the steep steps -to the pier and along by the fish-market to the bridge, which was the -only way to reach the East Cliff. The town seemed as dead, for not a -soul did I see. I rejoiced that it was so, for I wanted no witness of -poor Lucy's condition. The time and distance seemed endless, and my -knees trembled and my breath came laboured as I toiled up the endless -steps to the abbey. I must have gone fast, and yet it seemed to me as -if my feet were weighted with lead, and as though every joint in my -body were rusty. - -When I got almost to the top I could see the seat and the white figure, -for I was now close enough to distinguish it even through the spells of -shadow. There was undoubtedly something, long and black, bending over -the half-reclining white figure. I called in fright, "Lucy! Lucy!" -and something raised a head, and from where I was I could see a white -face and red, gleaming eyes. - -Lucy did not answer, and I ran on to the entrance of the churchyard. -As I entered, the church was between me and the seat, and for a minute -or so I lost sight of her. When I came in view again the cloud had -passed, and the moonlight struck so brilliantly that I could see Lucy -half reclining with her head lying over the back of the seat. She was -quite alone, and there was not a sign of any living thing about. - -When I bent over her I could see that she was still asleep. Her lips -were parted, and she was breathing, not softly as usual with her, but -in long, heavy gasps, as though striving to get her lungs full at every -breath. As I came close, she put up her hand in her sleep and pulled -the collar of her nightdress close around her, as though she felt the -cold. I flung the warm shawl over her, and drew the edges tight around -her neck, for I dreaded lest she should get some deadly chill from the -night air, unclad as she was. I feared to wake her all at once, so, in -order to have my hands free to help her, I fastened the shawl at her -throat with a big safety pin. But I must have been clumsy in my -anxiety and pinched or pricked her with it, for by-and-by, when her -breathing became quieter, she put her hand to her throat again and -moaned. When I had her carefully wrapped up I put my shoes on her -feet, and then began very gently to wake her. - -At first she did not respond, but gradually she became more and more -uneasy in her sleep, moaning and sighing occasionally. At last, as -time was passing fast, and for many other reasons, I wished to get her -home at once, I shook her forcibly, till finally she opened her eyes -and awoke. She did not seem surprised to see me, as, of course, she -did not realize all at once where she was. - -Lucy always wakes prettily, and even at such a time, when her body must -have been chilled with cold, and her mind somewhat appalled at waking -unclad in a churchyard at night, she did not lose her grace. She -trembled a little, and clung to me. When I told her to come at once -with me home, she rose without a word, with the obedience of a child. -As we passed along, the gravel hurt my feet, and Lucy noticed me wince. -She stopped and wanted to insist upon my taking my shoes, but I would -not. However, when we got to the pathway outside the chruchyard, where -there was a puddle of water, remaining from the storm, I daubed my feet -with mud, using each foot in turn on the other, so that as we went -home, no one, in case we should meet any one, should notice my bare -feet. - -Fortune favoured us, and we got home without meeting a soul. Once we -saw a man, who seemed not quite sober, passing along a street in front -of us. But we hid in a door till he had disappeared up an opening such -as there are here, steep little closes, or 'wynds', as they call them -in Scotland. My heart beat so loud all the time sometimes I thought I -should faint. I was filled with anxiety about Lucy, not only for her -health, lest she should suffer from the exposure, but for her -reputation in case the story should get wind. When we got in, and had -washed our feet, and had said a prayer of thankfulness together, I -tucked her into bed. Before falling asleep she asked, even implored, -me not to say a word to any one, even her mother, about her -sleep-walking adventure. - -I hesitated at first, to promise, but on thinking of the state of her -mother's health, and how the knowledge of such a thing would fret her, -and think too, of how such a story might become distorted, nay, -infallibly would, in case it should leak out, I thought it wiser to do -so. I hope I did right. I have locked the door, and the key is tied -to my wrist, so perhaps I shall not be again disturbed. Lucy is -sleeping soundly. The reflex of the dawn is high and far over the -sea . . . - - -Same day, noon.--All goes well. Lucy slept till I woke her and seemed -not to have even changed her side. The adventure of the night does not -seem to have harmed her, on the contrary, it has benefited her, for she -looks better this morning than she has done for weeks. I was sorry to -notice that my clumsiness with the safety-pin hurt her. Indeed, it -might have been serious, for the skin of her throat was pierced. I -must have pinched up a piece of loose skin and have transfixed it, for -there are two little red points like pin-pricks, and on the band of her -nightdress was a drop of blood. When I apologised and was concerned -about it, she laughed and petted me, and said she did not even feel it. -Fortunately it cannot leave a scar, as it is so tiny. - - -Same day, night.--We passed a happy day. The air was clear, and the -sun bright, and there was a cool breeze. We took our lunch to Mulgrave -Woods, Mrs. Westenra driving by the road and Lucy and I walking by the -cliff-path and joining her at the gate. I felt a little sad myself, -for I could not but feel how absolutely happy it would have been had -Jonathan been with me. But there! I must only be patient. In the -evening we strolled in the Casino Terrace, and heard some good music by -Spohr and Mackenzie, and went to bed early. Lucy seems more restful -than she has been for some time, and fell asleep at once. I shall lock -the door and secure the key the same as before, though I do not expect -any trouble tonight. - - -12 August.--My expectations were wrong, for twice during the night I -was wakened by Lucy trying to get out. She seemed, even in her sleep, -to be a little impatient at finding the door shut, and went back to bed -under a sort of protest. I woke with the dawn, and heard the birds -chirping outside of the window. Lucy woke, too, and I was glad to see, -was even better than on the previous morning. All her old gaiety of -manner seemed to have come back, and she came and snuggled in beside me -and told me all about Arthur. I told her how anxious I was about -Jonathan, and then she tried to comfort me. Well, she succeeded -somewhat, for, though sympathy can't alter facts, it can make them more -bearable. - - -13 August.--Another quiet day, and to bed with the key on my wrist as -before. Again I awoke in the night, and found Lucy sitting up in bed, -still asleep, pointing to the window. I got up quietly, and pulling -aside the blind, looked out. It was brilliant moonlight, and the soft -effect of the light over the sea and sky, merged together in one great -silent mystery, was beautiful beyond words. Between me and the -moonlight flitted a great bat, coming and going in great whirling -circles. Once or twice it came quite close, but was, I suppose, -frightened at seeing me, and flitted away across the harbour towards -the abbey. When I came back from the window Lucy had lain down again, -and was sleeping peacefully. She did not stir again all night. - - -14 August.--On the East Cliff, reading and writing all day. Lucy seems -to have become as much in love with the spot as I am, and it is hard to -get her away from it when it is time to come home for lunch or tea or -dinner. This afternoon she made a funny remark. We were coming home -for dinner, and had come to the top of the steps up from the West Pier -and stopped to look at the view, as we generally do. The setting sun, -low down in the sky, was just dropping behind Kettleness. The red -light was thrown over on the East Cliff and the old abbey, and seemed -to bathe everything in a beautiful rosy glow. We were silent for a -while, and suddenly Lucy murmured as if to herself . . . - -"His red eyes again! They are just the same." It was such an odd -expression, coming apropos of nothing, that it quite startled me. I -slewed round a little, so as to see Lucy well without seeming to stare -at her, and saw that she was in a half dreamy state, with an odd look -on her face that I could not quite make out, so I said nothing, but -followed her eyes. She appeared to be looking over at our own seat, -whereon was a dark figure seated alone. I was quite a little startled -myself, for it seemed for an instant as if the stranger had great eyes -like burning flames, but a second look dispelled the illusion. The red -sunlight was shining on the windows of St. Mary's Church behind our -seat, and as the sun dipped there was just sufficient change in the -refraction and reflection to make it appear as if the light moved. I -called Lucy's attention to the peculiar effect, and she became herself -with a start, but she looked sad all the same. It may have been that -she was thinking of that terrible night up there. We never refer to -it, so I said nothing, and we went home to dinner. Lucy had a headache -and went early to bed. I saw her asleep, and went out for a little -stroll myself. - -I walked along the cliffs to the westward, and was full of sweet -sadness, for I was thinking of Jonathan. When coming home, it was then -bright moonlight, so bright that, though the front of our part of the -Crescent was in shadow, everything could be well seen, I threw a glance -up at our window, and saw Lucy's head leaning out. I opened my -handkerchief and waved it. She did not notice or make any movement -whatever. Just then, the moonlight crept round an angle of the -building, and the light fell on the window. There distinctly was Lucy -with her head lying up against the side of the window sill and her eyes -shut. She was fast asleep, and by her, seated on the window sill, was -something that looked like a good-sized bird. I was afraid she might -get a chill, so I ran upstairs, but as I came into the room she was -moving back to her bed, fast asleep, and breathing heavily. She was -holding her hand to her throat, as though to protect if from the cold. - -I did not wake her, but tucked her up warmly. I have taken care that -the door is locked and the window securely fastened. - -She looks so sweet as she sleeps, but she is paler than is her wont, -and there is a drawn, haggard look under her eyes which I do not like. -I fear she is fretting about something. I wish I could find out what it -is. - - -15 August.--Rose later than usual. Lucy was languid and tired, and -slept on after we had been called. We had a happy surprise at -breakfast. Arthur's father is better, and wants the marriage to come -off soon. Lucy is full of quiet joy, and her mother is glad and sorry -at once. Later on in the day she told me the cause. She is grieved to -lose Lucy as her very own, but she is rejoiced that she is soon to have -some one to protect her. Poor dear, sweet lady! She confided to me -that she has got her death warrant. She has not told Lucy, and made me -promise secrecy. Her doctor told her that within a few months, at -most, she must die, for her heart is weakening. At any time, even now, -a sudden shock would be almost sure to kill her. Ah, we were wise to -keep from her the affair of the dreadful night of Lucy's sleep-walking. - - -17 August.--No diary for two whole days. I have not had the heart to -write. Some sort of shadowy pall seems to be coming over our -happiness. No news from Jonathan, and Lucy seems to be growing weaker, -whilst her mother's hours are numbering to a close. I do not -understand Lucy's fading away as she is doing. She eats well and -sleeps well, and enjoys the fresh air, but all the time the roses in -her cheeks are fading, and she gets weaker and more languid day by day. -At night I hear her gasping as if for air. - -I keep the key of our door always fastened to my wrist at night, but -she gets up and walks about the room, and sits at the open window. -Last night I found her leaning out when I woke up, and when I tried to -wake her I could not. - -She was in a faint. When I managed to restore her, she was weak as -water, and cried silently between long, painful struggles for breath. -When I asked her how she came to be at the window she shook her head -and turned away. - -I trust her feeling ill may not be from that unlucky prick of the -safety-pin. I looked at her throat just now as she lay asleep, and the -tiny wounds seem not to have healed. They are still open, and, if -anything, larger than before, and the edges of them are faintly white. -They are like little white dots with red centres. Unless they heal -within a day or two, I shall insist on the doctor seeing about them. - - - -LETTER, SAMUEL F. BILLINGTON & SON, SOLICITORS WHITBY, -TO MESSRS. CARTER, PATERSON & CO., LONDON. - -17 August - -"Dear Sirs,--Herewith please receive invoice of goods sent by Great -Northern Railway. Same are to be delivered at Carfax, near -Purfleet, immediately on receipt at goods station King's Cross. The -house is at present empty, but enclosed please find keys, all of -which are labelled. - -"You will please deposit the boxes, fifty in number, which form the -consignment, in the partially ruined building forming part of the -house and marked 'A' on rough diagrams enclosed. Your agent will -easily recognize the locality, as it is the ancient chapel of the -mansion. The goods leave by the train at 9:30 tonight, and will be -due at King's Cross at 4:30 tomorrow afternoon. As our client -wishes the delivery made as soon as possible, we shall be obliged by -your having teams ready at King's Cross at the time named and -forthwith conveying the goods to destination. In order to obviate -any delays possible through any routine requirements as to payment -in your departments, we enclose cheque herewith for ten pounds, -receipt of which please acknowledge. Should the charge be less than -this amount, you can return balance, if greater, we shall at once -send cheque for difference on hearing from you. You are to leave -the keys on coming away in the main hall of the house, where the -proprietor may get them on his entering the house by means of his -duplicate key. - -"Pray do not take us as exceeding the bounds of business courtesy -in pressing you in all ways to use the utmost expedition. - -"We are, dear Sirs, -Faithfully yours, -SAMUEL F. BILLINGTON & SON" - - - -LETTER, MESSRS. CARTER, PATERSON & CO., LONDON, -TO MESSRS. BILLINGTON & SON, WHITBY. - -21 August. - -"Dear Sirs,--We beg to acknowledge 10 pounds received and to return -cheque of 1 pound, 17s, 9d, amount of overplus, as shown in -receipted account herewith. Goods are delivered in exact accordance -with instructions, and keys left in parcel in main hall, as -directed. - -"We are, dear Sirs, -Yours respectfully, -Pro CARTER, PATERSON & CO." - - - -MINA MURRAY'S JOURNAL. - -18 August.--I am happy today, and write sitting on the seat in the -churchyard. Lucy is ever so much better. Last night she slept well -all night, and did not disturb me once. - -The roses seem coming back already to her cheeks, though she is still -sadly pale and wan-looking. If she were in any way anemic I could -understand it, but she is not. She is in gay spirits and full of life -and cheerfulness. All the morbid reticence seems to have passed from -her, and she has just reminded me, as if I needed any reminding, of -that night, and that it was here, on this very seat, I found her -asleep. - -As she told me she tapped playfully with the heel of her boot on the -stone slab and said, - -"My poor little feet didn't make much noise then! I daresay poor old -Mr. Swales would have told me that it was because I didn't want to wake -up Geordie." - -As she was in such a communicative humour, I asked her if she had -dreamed at all that night. - -Before she answered, that sweet, puckered look came into her forehead, -which Arthur, I call him Arthur from her habit, says he loves, and -indeed, I don't wonder that he does. Then she went on in a -half-dreaming kind of way, as if trying to recall it to herself. - -"I didn't quite dream, but it all seemed to be real. I only wanted to -be here in this spot. I don't know why, for I was afraid of something, -I don't know what. I remember, though I suppose I was asleep, passing -through the streets and over the bridge. A fish leaped as I went by, -and I leaned over to look at it, and I heard a lot of dogs howling. The -whole town seemed as if it must be full of dogs all howling at once, as -I went up the steps. Then I had a vague memory of something long and -dark with red eyes, just as we saw in the sunset, and something very -sweet and very bitter all around me at once. And then I seemed sinking -into deep green water, and there was a singing in my ears, as I have -heard there is to drowning men, and then everything seemed passing away -from me. My soul seemed to go out from my body and float about the -air. I seem to remember that once the West Lighthouse was right under -me, and then there was a sort of agonizing feeling, as if I were in an -earthquake, and I came back and found you shaking my body. I saw you -do it before I felt you." - -Then she began to laugh. It seemed a little uncanny to me, and I -listened to her breathlessly. I did not quite like it, and thought it -better not to keep her mind on the subject, so we drifted on to another -subject, and Lucy was like her old self again. When we got home the -fresh breeze had braced her up, and her pale cheeks were really more -rosy. Her mother rejoiced when she saw her, and we all spent a very -happy evening together. - - -19 August.--Joy, joy, joy! Although not all joy. At last, news of -Jonathan. The dear fellow has been ill, that is why he did not write. -I am not afraid to think it or to say it, now that I know. Mr. Hawkins -sent me on the letter, and wrote himself, oh so kindly. I am to leave -in the morning and go over to Jonathan, and to help to nurse him if -necessary, and to bring him home. Mr. Hawkins says it would not be a -bad thing if we were to be married out there. I have cried over the -good Sister's letter till I can feel it wet against my bosom, where it -lies. It is of Jonathan, and must be near my heart, for he is in my -heart. My journey is all mapped out, and my luggage ready. I am only -taking one change of dress. Lucy will bring my trunk to London and -keep it till I send for it, for it may be that . . . I must write no -more. I must keep it to say to Jonathan, my husband. The letter that -he has seen and touched must comfort me till we meet. - - - -LETTER, SISTER AGATHA, HOSPITAL OF ST. JOSEPH AND -STE. MARY BUDA-PESTH, TO MISS WILLHELMINA MURRAY - -12 August, - -"Dear Madam. - -"I write by desire of Mr. Jonathan Harker, who is himself not strong -enough to write, though progressing well, thanks to God and St. -Joseph and Ste. Mary. He has been under our care for nearly six -weeks, suffering from a violent brain fever. He wishes me to convey -his love, and to say that by this post I write for him to Mr. Peter -Hawkins, Exeter, to say, with his dutiful respects, that he is sorry -for his delay, and that all of his work is completed. He will -require some few weeks' rest in our sanatorium in the hills, but -will then return. He wishes me to say that he has not sufficient -money with him, and that he would like to pay for his staying here, -so that others who need shall not be wanting for help. - -"Believe me, - -"Yours, with sympathy -and all blessings. -Sister Agatha - -"P.S.--My patient being asleep, I open this to let you know -something more. He has told me all about you, and that you are -shortly to be his wife. All blessings to you both! He has had some -fearful shock, so says our doctor, and in his delirium his ravings -have been dreadful, of wolves and poison and blood, of ghosts and -demons, and I fear to say of what. Be careful of him always that -there may be nothing to excite him of this kind for a long time to -come. The traces of such an illness as his do not lightly die away. -We should have written long ago, but we knew nothing of his friends, -and there was nothing on him, nothing that anyone could understand. -He came in the train from Klausenburg, and the guard was told by the -station master there that he rushed into the station shouting for a -ticket for home. Seeing from his violent demeanour that he was -English, they gave him a ticket for the furthest station on the way -thither that the train reached. - -"Be assured that he is well cared for. He has won all hearts by his -sweetness and gentleness. He is truly getting on well, and I have -no doubt will in a few weeks be all himself. But be careful of him -for safety's sake. There are, I pray God and St. Joseph and Ste. -Mary, many, many, happy years for you both." - - - -DR. SEWARD'S DIARY - -19 August.--Strange and sudden change in Renfield last night. About -eight o'clock he began to get excited and sniff about as a dog does -when setting. The attendant was struck by his manner, and knowing my -interest in him, encouraged him to talk. He is usually respectful to -the attendant and at times servile, but tonight, the man tells me, he -was quite haughty. Would not condescend to talk with him at all. - -All he would say was, "I don't want to talk to you. You don't count -now. The master is at hand." - -The attendant thinks it is some sudden form of religious mania which -has seized him. If so, we must look out for squalls, for a strong man -with homicidal and religious mania at once might be dangerous. The -combination is a dreadful one. - -At nine o'clock I visited him myself. His attitude to me was the same -as that to the attendant. In his sublime self-feeling the difference -between myself and the attendant seemed to him as nothing. It looks -like religious mania, and he will soon think that he himself is God. - -These infinitesimal distinctions between man and man are too paltry for -an Omnipotent Being. How these madmen give themselves away! The real -God taketh heed lest a sparrow fall. But the God created from human -vanity sees no difference between an eagle and a sparrow. Oh, if men -only knew! - -For half an hour or more Renfield kept getting excited in greater and -greater degree. I did not pretend to be watching him, but I kept -strict observation all the same. All at once that shifty look came -into his eyes which we always see when a madman has seized an idea, and -with it the shifty movement of the head and back which asylum -attendants come to know so well. He became quite quiet, and went and -sat on the edge of his bed resignedly, and looked into space with -lack-luster eyes. - -I thought I would find out if his apathy were real or only assumed, and -tried to lead him to talk of his pets, a theme which had never failed -to excite his attention. - -At first he made no reply, but at length said testily, "Bother them -all! I don't care a pin about them." - -"What?" I said. "You don't mean to tell me you don't care about -spiders?" (Spiders at present are his hobby and the notebook is filling -up with columns of small figures.) - -To this he answered enigmatically, "The Bride maidens rejoice the eyes -that wait the coming of the bride. But when the bride draweth nigh, -then the maidens shine not to the eyes that are filled." - -He would not explain himself, but remained obstinately seated on his -bed all the time I remained with him. - -I am weary tonight and low in spirits. I cannot but think of Lucy, and -how different things might have been. If I don't sleep at once, -chloral, the modern Morpheus! I must be careful not to let it grow -into a habit. No, I shall take none tonight! I have thought of Lucy, -and I shall not dishonour her by mixing the two. If need be, tonight -shall be sleepless. - - -Later.--Glad I made the resolution, gladder that I kept to it. I had -lain tossing about, and had heard the clock strike only twice, when the -night watchman came to me, sent up from the ward, to say that Renfield -had escaped. I threw on my clothes and ran down at once. My patient -is too dangerous a person to be roaming about. Those ideas of his -might work out dangerously with strangers. - -The attendant was waiting for me. He said he had seen him not ten -minutes before, seemingly asleep in his bed, when he had looked through -the observation trap in the door. His attention was called by the -sound of the window being wrenched out. He ran back and saw his feet -disappear through the window, and had at once sent up for me. He was -only in his night gear, and cannot be far off. - -The attendant thought it would be more useful to watch where he should -go than to follow him, as he might lose sight of him whilst getting out -of the building by the door. He is a bulky man, and couldn't get -through the window. - -I am thin, so, with his aid, I got out, but feet foremost, and as we -were only a few feet above ground landed unhurt. - -The attendant told me the patient had gone to the left, and had taken a -straight line, so I ran as quickly as I could. As I got through the -belt of trees I saw a white figure scale the high wall which separates -our grounds from those of the deserted house. - -I ran back at once, told the watchman to get three or four men -immediately and follow me into the grounds of Carfax, in case our -friend might be dangerous. I got a ladder myself, and crossing the -wall, dropped down on the other side. I could see Renfield's figure -just disappearing behind the angle of the house, so I ran after him. On -the far side of the house I found him pressed close against the old -iron-bound oak door of the chapel. - -He was talking, apparently to some one, but I was afraid to go near -enough to hear what he was saying, lest I might frighten him, and he -should run off. - -Chasing an errant swarm of bees is nothing to following a naked -lunatic, when the fit of escaping is upon him! After a few minutes, -however, I could see that he did not take note of anything around him, -and so ventured to draw nearer to him, the more so as my men had now -crossed the wall and were closing him in. I heard him say . . . - -"I am here to do your bidding, Master. I am your slave, and you will -reward me, for I shall be faithful. I have worshipped you long and afar -off. Now that you are near, I await your commands, and you will not -pass me by, will you, dear Master, in your distribution of good -things?" - -He is a selfish old beggar anyhow. He thinks of the loaves and fishes -even when he believes his is in a real Presence. His manias make a -startling combination. When we closed in on him he fought like a -tiger. He is immensely strong, for he was more like a wild beast than -a man. - -I never saw a lunatic in such a paroxysm of rage before, and I hope I -shall not again. It is a mercy that we have found out his strength and -his danger in good time. With strength and determination like his, he -might have done wild work before he was caged. - -He is safe now, at any rate. Jack Sheppard himself couldn't get free -from the strait waistcoat that keeps him restrained, and he's chained -to the wall in the padded room. - -His cries are at times awful, but the silences that follow are more -deadly still, for he means murder in every turn and movement. - -Just now he spoke coherent words for the first time. "I shall be -patient, Master. It is coming, coming, coming!" - -So I took the hint, and came too. I was too excited to sleep, but this -diary has quieted me, and I feel I shall get some sleep tonight. - - - - -CHAPTER 9 - - -LETTER, MINA HARKER TO LUCY WESTENRA - - -Buda-Pesth, 24 August. - -"My dearest Lucy, - -"I know you will be anxious to hear all that has happened -since we parted at the railway station at Whitby. - -"Well, my dear, I got to Hull all right, and caught the boat to -Hamburg, and then the train on here. I feel that I can hardly -recall anything of the journey, except that I knew I was coming to -Jonathan, and that as I should have to do some nursing, I had better -get all the sleep I could. I found my dear one, oh, so thin and -pale and weak-looking. All the resolution has gone out of his dear -eyes, and that quiet dignity which I told you was in his face has -vanished. He is only a wreck of himself, and he does not remember -anything that has happened to him for a long time past. At least, -he wants me to believe so, and I shall never ask. - -"He has had some terrible shock, and I fear it might tax his poor -brain if he were to try to recall it. Sister Agatha, who is a good -creature and a born nurse, tells me that he wanted her to tell me -what they were, but she would only cross herself, and say she would -never tell. That the ravings of the sick were the secrets of God, -and that if a nurse through her vocation should hear them, she -should respect her trust. - -"She is a sweet, good soul, and the next day, when she saw I was -troubled, she opened up the subject my poor dear raved about, added, -'I can tell you this much, my dear. That it was not about anything -which he has done wrong himself, and you, as his wife to be, have no -cause to be concerned. He has not forgotten you or what he owes to -you. His fear was of great and terrible things, which no mortal can -treat of.' - -"I do believe the dear soul thought I might be jealous lest my poor -dear should have fallen in love with any other girl. The idea of my -being jealous about Jonathan! And yet, my dear, let me whisper, I -felt a thrill of joy through me when I knew that no other woman was -a cause for trouble. I am now sitting by his bedside, where I can -see his face while he sleeps. He is waking! - -"When he woke he asked me for his coat, as he wanted to get -something from the pocket. I asked Sister Agatha, and she brought -all his things. I saw amongst them was his notebook, and was -going to ask him to let me look at it, for I knew that I might find -some clue to his trouble, but I suppose he must have seen my wish in -my eyes, for he sent me over to the window, saying he wanted to be -quite alone for a moment. - -"Then he called me back, and he said to me very solemnly, -'Wilhelmina', I knew then that he was in deadly earnest, for he has -never called me by that name since he asked me to marry him, 'You -know, dear, my ideas of the trust between husband and wife. There -should be no secret, no concealment. I have had a great shock, and -when I try to think of what it is I feel my head spin round, and I -do not know if it was real of the dreaming of a madman. You know I -had brain fever, and that is to be mad. The secret is here, and I -do not want to know it. I want to take up my life here, with our -marriage.' For, my dear, we had decided to be married as soon as -the formalities are complete. 'Are you willing, Wilhelmina, to -share my ignorance? Here is the book. Take it and keep it, read it -if you will, but never let me know unless, indeed, some solemn duty -should come upon me to go back to the bitter hours, asleep or awake, -sane or mad, recorded here.' He fell back exhausted, and I put the -book under his pillow, and kissed him. I have asked Sister Agatha -to beg the Superior to let our wedding be this afternoon, and am -waiting her reply . . ." - - -"She has come and told me that the Chaplain of the English mission -church has been sent for. We are to be married in an hour, or as -soon after as Jonathan awakes." - -"Lucy, the time has come and gone. I feel very solemn, but very, -very happy. Jonathan woke a little after the hour, and all was -ready, and he sat up in bed, propped up with pillows. He answered -his 'I will' firmly and strong. I could hardly speak. My heart was -so full that even those words seemed to choke me. - -"The dear sisters were so kind. Please, God, I shall never, never -forget them, nor the grave and sweet responsibilities I have taken -upon me. I must tell you of my wedding present. When the chaplain -and the sisters had left me alone with my husband--oh, Lucy, it is -the first time I have written the words 'my husband'--left me alone -with my husband, I took the book from under his pillow, and wrapped -it up in white paper, and tied it with a little bit of pale blue -ribbon which was round my neck, and sealed it over the knot with -sealing wax, and for my seal I used my wedding ring. Then I kissed -it and showed it to my husband, and told him that I would keep it -so, and then it would be an outward and visible sign for us all our -lives that we trusted each other, that I would never open it unless -it were for his own dear sake or for the sake of some stern duty. -Then he took my hand in his, and oh, Lucy, it was the first time he -took his wife's hand, and said that it was the dearest thing in all -the wide world, and that he would go through all the past again to -win it, if need be. The poor dear meant to have said a part of the -past, but he cannot think of time yet, and I shall not wonder if at -first he mixes up not only the month, but the year. - -"Well, my dear, what could I say? I could only tell him that I was -the happiest woman in all the wide world, and that I had nothing to -give him except myself, my life, and my trust, and that with these -went my love and duty for all the days of my life. And, my dear, -when he kissed me, and drew me to him with his poor weak hands, it -was like a solemn pledge between us. - -"Lucy dear, do you know why I tell you all this? It is not only -because it is all sweet to me, but because you have been, and are, -very dear to me. It was my privilege to be your friend and guide -when you came from the schoolroom to prepare for the world of life. -I want you to see now, and with the eyes of a very happy wife, -whither duty has led me, so that in your own married life you too -may be all happy, as I am. My dear, please Almighty God, your life -may be all it promises, a long day of sunshine, with no harsh wind, -no forgetting duty, no distrust. I must not wish you no pain, for -that can never be, but I do hope you will be always as happy as I am -now. Goodbye, my dear. I shall post this at once, and perhaps, -write you very soon again. I must stop, for Jonathan is waking. I -must attend my husband! - -"Your ever-loving -Mina Harker." - - - -LETTER, LUCY WESTENRA TO MINA HARKER. - -Whitby, 30 August. - -"My dearest Mina, - -"Oceans of love and millions of kisses, and may you soon be in your -own home with your husband. I wish you were coming home soon enough -to stay with us here. The strong air would soon restore Jonathan. -It has quite restored me. I have an appetite like a cormorant, am -full of life, and sleep well. You will be glad to know that I have -quite given up walking in my sleep. I think I have not stirred out -of my bed for a week, that is when I once got into it at night. -Arthur says I am getting fat. By the way, I forgot to tell you that -Arthur is here. We have such walks and drives, and rides, and -rowing, and tennis, and fishing together, and I love him more than -ever. He tells me that he loves me more, but I doubt that, for at -first he told me that he couldn't love me more than he did then. -But this is nonsense. There he is, calling to me. So no more just -at present from your loving, - -"Lucy. - -"P.S.--Mother sends her love. She seems better, poor dear. - -"P.P.S.--We are to be married on 28 September." - - - -DR. SEWARDS DIARY - -20 August.--The case of Renfield grows even more interesting. He has -now so far quieted that there are spells of cessation from his -passion. For the first week after his attack he was perpetually -violent. Then one night, just as the moon rose, he grew quiet, and -kept murmuring to himself. "Now I can wait. Now I can wait." - -The attendant came to tell me, so I ran down at once to have a look at -him. He was still in the strait waistcoat and in the padded room, but -the suffused look had gone from his face, and his eyes had something -of their old pleading. I might almost say, cringing, softness. I was -satisfied with his present condition, and directed him to be relieved. -The attendants hesitated, but finally carried out my wishes without -protest. - -It was a strange thing that the patient had humour enough to see their -distrust, for, coming close to me, he said in a whisper, all the while -looking furtively at them, "They think I could hurt you! Fancy me -hurting you! The fools!" - -It was soothing, somehow, to the feelings to find myself disassociated -even in the mind of this poor madman from the others, but all the same -I do not follow his thought. Am I to take it that I have anything in -common with him, so that we are, as it were, to stand together. Or -has he to gain from me some good so stupendous that my well being is -needful to Him? I must find out later on. Tonight he will not speak. -Even the offer of a kitten or even a full-grown cat will not tempt -him. - -He will only say, "I don't take any stock in cats. I have more to -think of now, and I can wait. I can wait." - -After a while I left him. The attendant tells me that he was quiet -until just before dawn, and that then he began to get uneasy, and at -length violent, until at last he fell into a paroxysm which exhausted -him so that he swooned into a sort of coma. - - -. . . Three nights has the same thing happened, violent all day then -quiet from moonrise to sunrise. I wish I could get some clue to the -cause. It would almost seem as if there was some influence which came -and went. Happy thought! We shall tonight play sane wits against mad -ones. He escaped before without our help. Tonight he shall escape -with it. We shall give him a chance, and have the men ready to follow -in case they are required. - - -23 August.--"The expected always happens." How well Disraeli knew -life. Our bird when he found the cage open would not fly, so all our -subtle arrangements were for nought. At any rate, we have proved one -thing, that the spells of quietness last a reasonable time. We shall -in future be able to ease his bonds for a few hours each day. I have -given orders to the night attendant merely to shut him in the padded -room, when once he is quiet, until the hour before sunrise. The poor -soul's body will enjoy the relief even if his mind cannot appreciate -it. Hark! The unexpected again! I am called. The patient has once -more escaped. - - -Later.--Another night adventure. Renfield artfully waited until the -attendant was entering the room to inspect. Then he dashed out past -him and flew down the passage. I sent word for the attendants to -follow. Again he went into the grounds of the deserted house, and we -found him in the same place, pressed against the old chapel door. -When he saw me he became furious, and had not the attendants seized -him in time, he would have tried to kill me. As we were holding him a -strange thing happened. He suddenly redoubled his efforts, and then -as suddenly grew calm. I looked round instinctively, but could see -nothing. Then I caught the patient's eye and followed it, but could -trace nothing as it looked into the moonlight sky, except a big bat, -which was flapping its silent and ghostly way to the west. Bats -usually wheel about, but this one seemed to go straight on, as if it -knew where it was bound for or had some intention of its own. - -The patient grew calmer every instant, and presently said, "You -needn't tie me. I shall go quietly!" Without trouble, we came back -to the house. I feel there is something ominous in his calm, and -shall not forget this night. - - - -LUCY WESTENRA'S DIARY - -Hillingham, 24 August.--I must imitate Mina, and keep writing things -down. Then we can have long talks when we do meet. I wonder when it -will be. I wish she were with me again, for I feel so unhappy. Last -night I seemed to be dreaming again just as I was at Whitby. Perhaps -it is the change of air, or getting home again. It is all dark and -horrid to me, for I can remember nothing. But I am full of vague -fear, and I feel so weak and worn out. When Arthur came to lunch he -looked quite grieved when he saw me, and I hadn't the spirit to try to -be cheerful. I wonder if I could sleep in mother's room tonight. I -shall make an excuse to try. - - -25 August.--Another bad night. Mother did not seem to take to my -proposal. She seems not too well herself, and doubtless she fears to -worry me. I tried to keep awake, and succeeded for a while, but when -the clock struck twelve it waked me from a doze, so I must have been -falling asleep. There was a sort of scratching or flapping at the -window, but I did not mind it, and as I remember no more, I suppose I -must have fallen asleep. More bad dreams. I wish I could remember -them. This morning I am horribly weak. My face is ghastly pale, and -my throat pains me. It must be something wrong with my lungs, for I -don't seem to be getting air enough. I shall try to cheer up when -Arthur comes, or else I know he will be miserable to see me so. - - - -LETTER, ARTHUR TO DR. SEWARD - -"Albemarle Hotel, 31 August - -"My dear Jack, - -"I want you to do me a favour. Lucy is ill, that is she has no -special disease, but she looks awful, and is getting worse every -day. I have asked her if there is any cause, I not dare to ask her -mother, for to disturb the poor lady's mind about her daughter in -her present state of health would be fatal. Mrs. Westenra has -confided to me that her doom is spoken, disease of the heart, though -poor Lucy does not know it yet. I am sure that there is something -preying on my dear girl's mind. I am almost distracted when I think -of her. To look at her gives me a pang. I told her I should ask -you to see her, and though she demurred at first, I know why, old -fellow, she finally consented. It will be a painful task for you, I -know, old friend, but it is for her sake, and I must not hesitate to -ask, or you to act. You are to come to lunch at Hillingham -tomorrow, two o'clock, so as not to arouse any suspicion in Mrs. -Westenra, and after lunch Lucy will take an opportunity of being -alone with you. I am filled with anxiety, and want to consult with -you alone as soon as I can after you have seen her. Do not fail! - -"Arthur." - - - -TELEGRAM, ARTHUR HOLMWOOD TO SEWARD - -1 September - -"Am summoned to see my father, who is worse. Am writing. Write -me fully by tonight's post to Ring. Wire me if necessary." - - - -LETTER FROM DR. SEWARD TO ARTHUR HOLMWOOD - -2 September - -"My dear old fellow, - -"With regard to Miss Westenra's health I hasten to let you know at -once that in my opinion there is not any functional disturbance or -any malady that I know of. At the same time, I am not by any means -satisfied with her appearance. She is woefully different from what -she was when I saw her last. Of course you must bear in mind that I -did not have full opportunity of examination such as I should wish. -Our very friendship makes a little difficulty which not even medical -science or custom can bridge over. I had better tell you exactly -what happened, leaving you to draw, in a measure, your own -conclusions. I shall then say what I have done and propose doing. - -"I found Miss Westenra in seemingly gay spirits. Her mother was -present, and in a few seconds I made up my mind that she was trying -all she knew to mislead her mother and prevent her from being -anxious. I have no doubt she guesses, if she does not know, what -need of caution there is. - -"We lunched alone, and as we all exerted ourselves to be cheerful, -we got, as some kind of reward for our labours, some real -cheerfulness amongst us. Then Mrs. Westenra went to lie down, and -Lucy was left with me. We went into her boudoir, and till we got -there her gaiety remained, for the servants were coming and going. - -"As soon as the door was closed, however, the mask fell from her -face, and she sank down into a chair with a great sigh, and hid her -eyes with her hand. When I saw that her high spirits had failed, I -at once took advantage of her reaction to make a diagnosis. - -"She said to me very sweetly, 'I cannot tell you how I loathe -talking about myself.' I reminded her that a doctor's confidence -was sacred, but that you were grievously anxious about her. She -caught on to my meaning at once, and settled that matter in a word. -'Tell Arthur everything you choose. I do not care for myself, but -for him!' So I am quite free. - -"I could easily see that she was somewhat bloodless, but I could not -see the usual anemic signs, and by the chance, I was able to test -the actual quality of her blood, for in opening a window which was -stiff a cord gave way, and she cut her hand slightly with broken -glass. It was a slight matter in itself, but it gave me an evident -chance, and I secured a few drops of the blood and have analysed -them. - -"The qualitative analysis give a quite normal condition, and shows, -I should infer, in itself a vigorous state of health. In other -physical matters I was quite satisfied that there is no need for -anxiety, but as there must be a cause somewhere, I have come to the -conclusion that it must be something mental. - -"She complains of difficulty breathing satisfactorily at times, and -of heavy, lethargic sleep, with dreams that frighten her, but -regarding which she can remember nothing. She says that as a child, -she used to walk in her sleep, and that when in Whitby the habit -came back, and that once she walked out in the night and went to -East Cliff, where Miss Murray found her. But she assures me that of -late the habit has not returned. - -"I am in doubt, and so have done the best thing I know of. I have -written to my old friend and master, Professor Van Helsing, of -Amsterdam, who knows as much about obscure diseases as any one in -the world. I have asked him to come over, and as you told me that -all things were to be at your charge, I have mentioned to him who -you are and your relations to Miss Westenra. This, my dear fellow, -is in obedience to your wishes, for I am only too proud and happy to -do anything I can for her. - -"Van Helsing would, I know, do anything for me for a personal -reason, so no matter on what ground he comes, we must accept his -wishes. He is a seemingly arbitrary man, this is because he knows -what he is talking about better than any one else. He is a -philosopher and a metaphysician, and one of the most advanced -scientists of his day, and he has, I believe, an absolutely open -mind. This, with an iron nerve, a temper of the ice-brook, and -indomitable resolution, self-command, and toleration exalted from -virtues to blessings, and the kindliest and truest heart that beats, -these form his equipment for the noble work that he is doing for -mankind, work both in theory and practice, for his views are as wide -as his all-embracing sympathy. I tell you these facts that you may -know why I have such confidence in him. I have asked him to come at -once. I shall see Miss Westenra tomorrow again. She is to meet me -at the Stores, so that I may not alarm her mother by too early a -repetition of my call. - -"Yours always." - -John Seward - - - - -LETTER, ABRAHAM VAN HELSING, MD, DPh, D. Lit, ETC, ETC, TO DR. SEWARD - -2 September. - -"My good Friend, - -"When I received your letter I am already coming to you. By good -fortune I can leave just at once, without wrong to any of those who -have trusted me. Were fortune other, then it were bad for those who -have trusted, for I come to my friend when he call me to aid those -he holds dear. Tell your friend that when that time you suck from -my wound so swiftly the poison of the gangrene from that knife that -our other friend, too nervous, let slip, you did more for him when -he wants my aids and you call for them than all his great fortune -could do. But it is pleasure added to do for him, your friend, it -is to you that I come. Have near at hand, and please it so arrange -that we may see the young lady not too late on tomorrow, for it is -likely that I may have to return here that night. But if need be I -shall come again in three days, and stay longer if it must. Till -then goodbye, my friend John. - -"Van Helsing." - - - -LETTER, DR. SEWARD TO HON. ARTHUR HOLMWOOD - -3 September - -"My dear Art, - -"Van Helsing has come and gone. He came on with me to Hillingham, -and found that, by Lucy's discretion, her mother was lunching out, -so that we were alone with her. - -"Van Helsing made a very careful examination of the patient. He is -to report to me, and I shall advise you, for of course I was not -present all the time. He is, I fear, much concerned, but says he -must think. When I told him of our friendship and how you trust to -me in the matter, he said, 'You must tell him all you think. Tell -him what I think, if you can guess it, if you will. Nay, I am -not jesting. This is no jest, but life and death, perhaps more.' I -asked what he meant by that, for he was very serious. This was when -we had come back to town, and he was having a cup of tea before -starting on his return to Amsterdam. He would not give me any -further clue. You must not be angry with me, Art, because his very -reticence means that all his brains are working for her good. He -will speak plainly enough when the time comes, be sure. So I told -him I would simply write an account of our visit, just as if I were -doing a descriptive special article for THE DAILY TELEGRAPH. He -seemed not to notice, but remarked that the smuts of London were not -quite so bad as they used to be when he was a student here. I am to -get his report tomorrow if he can possibly make it. In any case I -am to have a letter. - -"Well, as to the visit, Lucy was more cheerful than on the day I -first saw her, and certainly looked better. She had lost something -of the ghastly look that so upset you, and her breathing was normal. -She was very sweet to the Professor (as she always is), and tried to -make him feel at ease, though I could see the poor girl was making a -hard struggle for it. - -"I believe Van Helsing saw it, too, for I saw the quick look -under his bushy brows that I knew of old. Then he began to -chat of all things except ourselves and diseases and with -such an infinite geniality that I could see poor Lucy's -pretense of animation merge into reality. Then, without -any seeming change, he brought the conversation gently round -to his visit, and suavely said, - -"'My dear young miss, I have the so great pleasure because you are -so much beloved. That is much, my dear, even were there that which -I do not see. They told me you were down in the spirit, and that -you were of a ghastly pale. To them I say "Pouf!"' And he snapped -his fingers at me and went on. 'But you and I shall show them how -wrong they are. How can he,' and he pointed at me with the same -look and gesture as that with which he pointed me out in his class, -on, or rather after, a particular occasion which he never fails to -remind me of, 'know anything of a young ladies? He has his madmen -to play with, and to bring them back to happiness, and to those that -love them. It is much to do, and, oh, but there are rewards in that -we can bestow such happiness. But the young ladies! He has no wife -nor daughter, and the young do not tell themselves to the young, but -to the old, like me, who have known so many sorrows and the causes -of them. So, my dear, we will send him away to smoke the cigarette -in the garden, whiles you and I have little talk all to ourselves.' -I took the hint, and strolled about, and presently the professor -came to the window and called me in. He looked grave, but said, 'I -have made careful examination, but there is no functional cause. -With you I agree that there has been much blood lost, it has been -but is not. But the conditions of her are in no way anemic. I have -asked her to send me her maid, that I may ask just one or two -questions, that so I may not chance to miss nothing. I know well -what she will say. And yet there is cause. There is always cause -for everything. I must go back home and think. You must send me -the telegram every day, and if there be cause I shall come again. -The disease, for not to be well is a disease, interest me, and the -sweet, young dear, she interest me too. She charm me, and for her, -if not for you or disease, I come.' - -"As I tell you, he would not say a word more, even when we were -alone. And so now, Art, you know all I know. I shall keep stern -watch. I trust your poor father is rallying. It must be a terrible -thing to you, my dear old fellow, to be placed in such a position -between two people who are both so dear to you. I know your idea of -duty to your father, and you are right to stick to it. But if need -be, I shall send you word to come at once to Lucy, so do not be -over-anxious unless you hear from me." - - - -DR. SEWARD'S DIARY - -4 September.--Zoophagous patient still keeps up our interest in him. -He had only one outburst and that was yesterday at an unusual time. -Just before the stroke of noon he began to grow restless. The -attendant knew the symptoms, and at once summoned aid. Fortunately -the men came at a run, and were just in time, for at the stroke of -noon he became so violent that it took all their strength to hold him. -In about five minutes, however, he began to get more quiet, and -finally sank into a sort of melancholy, in which state he has remained -up to now. The attendant tells me that his screams whilst in the -paroxysm were really appalling. I found my hands full when I got in, -attending to some of the other patients who were frightened by him. -Indeed, I can quite understand the effect, for the sounds disturbed -even me, though I was some distance away. It is now after the dinner -hour of the asylum, and as yet my patient sits in a corner brooding, -with a dull, sullen, woe-begone look in his face, which seems rather -to indicate than to show something directly. I cannot quite -understand it. - - -Later.--Another change in my patient. At five o'clock I looked in on -him, and found him seemingly as happy and contented as he used to be. -He was catching flies and eating them, and was keeping note of his -capture by making nailmarks on the edge of the door between the ridges -of padding. When he saw me, he came over and apologized for his bad -conduct, and asked me in a very humble, cringing way to be led back to -his own room, and to have his notebook again. I thought it well to -humour him, so he is back in his room with the window open. He has -the sugar of his tea spread out on the window sill, and is reaping -quite a harvest of flies. He is not now eating them, but putting them -into a box, as of old, and is already examining the corners of his -room to find a spider. I tried to get him to talk about the past few -days, for any clue to his thoughts would be of immense help to me, but -he would not rise. For a moment or two he looked very sad, and said -in a sort of far away voice, as though saying it rather to himself -than to me. - -"All over! All over! He has deserted me. No hope for me now unless -I do it myself!" Then suddenly turning to me in a resolute way, he -said, "Doctor, won't you be very good to me and let me have a little -more sugar? I think it would be very good for me." - -"And the flies?" I said. - -"Yes! The flies like it, too, and I like the flies, therefore I like -it." And there are people who know so little as to think that madmen do -not argue. I procured him a double supply, and left him as happy a -man as, I suppose, any in the world. I wish I could fathom his mind. - - -Midnight.--Another change in him. I had been to see Miss Westenra, -whom I found much better, and had just returned, and was standing at -our own gate looking at the sunset, when once more I heard him -yelling. As his room is on this side of the house, I could hear it -better than in the morning. It was a shock to me to turn from the -wonderful smoky beauty of a sunset over London, with its lurid lights -and inky shadows and all the marvellous tints that come on foul clouds -even as on foul water, and to realize all the grim sternness of my own -cold stone building, with its wealth of breathing misery, and my own -desolate heart to endure it all. I reached him just as the sun was -going down, and from his window saw the red disc sink. As it sank he -became less and less frenzied, and just as it dipped he slid from the -hands that held him, an inert mass, on the floor. It is wonderful, -however, what intellectual recuperative power lunatics have, for -within a few minutes he stood up quite calmly and looked around him. I -signalled to the attendants not to hold him, for I was anxious to see -what he would do. He went straight over to the window and brushed out -the crumbs of sugar. Then he took his fly box, and emptied it -outside, and threw away the box. Then he shut the window, and -crossing over, sat down on his bed. All this surprised me, so I asked -him, "Are you going to keep flies any more?" - -"No," said he. "I am sick of all that rubbish!" He certainly is a -wonderfully interesting study. I wish I could get some glimpse of his -mind or of the cause of his sudden passion. Stop. There may be a -clue after all, if we can find why today his paroxysms came on at high -noon and at sunset. Can it be that there is a malign influence of the -sun at periods which affects certain natures, as at times the moon -does others? We shall see. - - - -TELEGRAM. SEWARD, LONDON, TO VAN HELSING, AMSTERDAM - -"4 September.--Patient still better today." - - - -TELEGRAM, SEWARD, LONDON, TO VAN HELSING, AMSTERDAM - -"5 September.--Patient greatly improved. Good appetite, sleeps -naturally, good spirits, colour coming back." - - - -TELEGRAM, SEWARD, LONDON, TO VAN HELSING, AMSTERDAM - -"6 September.--Terrible change for the worse. Come at once. -Do not lose an hour. I hold over telegram to Holmwood till -have seen you." - - - - -CHAPTER 10 - - -LETTER, DR. SEWARD TO HON. ARTHUR HOLMWOOD - - -6 September - -"My dear Art, - -"My news today is not so good. Lucy this morning had gone back a -bit. There is, however, one good thing which has arisen from it. -Mrs. Westenra was naturally anxious concerning Lucy, and has -consulted me professionally about her. I took advantage of the -opportunity, and told her that my old master, Van Helsing, the great -specialist, was coming to stay with me, and that I would put her in -his charge conjointly with myself. So now we can come and go -without alarming her unduly, for a shock to her would mean sudden -death, and this, in Lucy's weak condition, might be disastrous to -her. We are hedged in with difficulties, all of us, my poor fellow, -but, please God, we shall come through them all right. If any need -I shall write, so that, if you do not hear from me, take it for -granted that I am simply waiting for news, In haste, - -"Yours ever," - -John Seward - - - -DR. SEWARD'S DIARY - -7 September.--The first thing Van Helsing said to me when we met at -Liverpool Street was, "Have you said anything to our young friend, to -lover of her?" - -"No," I said. "I waited till I had seen you, as I said in my -telegram. I wrote him a letter simply telling him that you were -coming, as Miss Westenra was not so well, and that I should let him -know if need be." - -"Right, my friend," he said. "Quite right! Better he not know as -yet. Perhaps he will never know. I pray so, but if it be needed, -then he shall know all. And, my good friend John, let me caution you. -You deal with the madmen. All men are mad in some way or the other, -and inasmuch as you deal discreetly with your madmen, so deal with -God's madmen too, the rest of the world. You tell not your madmen -what you do nor why you do it. You tell them not what you think. So -you shall keep knowledge in its place, where it may rest, where it may -gather its kind around it and breed. You and I shall keep as yet what -we know here, and here." He touched me on the heart and on the -forehead, and then touched himself the same way. "I have for myself -thoughts at the present. Later I shall unfold to you." - -"Why not now?" I asked. "It may do some good. We may arrive at some -decision." He looked at me and said, "My friend John, when the corn is -grown, even before it has ripened, while the milk of its mother earth -is in him, and the sunshine has not yet begun to paint him with his -gold, the husbandman he pull the ear and rub him between his rough -hands, and blow away the green chaff, and say to you, 'Look! He's -good corn, he will make a good crop when the time comes.'" - -I did not see the application and told him so. For reply he reached -over and took my ear in his hand and pulled it playfully, as he used -long ago to do at lectures, and said, "The good husbandman tell you so -then because he knows, but not till then. But you do not find the -good husbandman dig up his planted corn to see if he grow. That is -for the children who play at husbandry, and not for those who take it -as of the work of their life. See you now, friend John? I have sown -my corn, and Nature has her work to do in making it sprout, if he -sprout at all, there's some promise, and I wait till the ear begins to -swell." He broke off, for he evidently saw that I understood. Then he -went on gravely, "You were always a careful student, and your case -book was ever more full than the rest. And I trust that good habit -have not fail. Remember, my friend, that knowledge is stronger than -memory, and we should not trust the weaker. Even if you have not kept -the good practice, let me tell you that this case of our dear miss is -one that may be, mind, I say may be, of such interest to us and others -that all the rest may not make him kick the beam, as your people say. -Take then good note of it. Nothing is too small. I counsel you, put -down in record even your doubts and surmises. Hereafter it may be of -interest to you to see how true you guess. We learn from failure, not -from success!" - -When I described Lucy's symptoms, the same as before, but infinitely -more marked, he looked very grave, but said nothing. He took with him -a bag in which were many instruments and drugs, "the ghastly -paraphernalia of our beneficial trade," as he once called, in one of -his lectures, the equipment of a professor of the healing craft. - -When we were shown in, Mrs. Westenra met us. She was alarmed, but not -nearly so much as I expected to find her. Nature in one of her -beneficient moods has ordained that even death has some antidote to -its own terrors. Here, in a case where any shock may prove fatal, -matters are so ordered that, from some cause or other, the things not -personal, even the terrible change in her daughter to whom she is so -attached, do not seem to reach her. It is something like the way dame -Nature gathers round a foreign body an envelope of some insensitive -tissue which can protect from evil that which it would otherwise harm -by contact. If this be an ordered selfishness, then we should pause -before we condemn any one for the vice of egoism, for there may be -deeper root for its causes than we have knowledge of. - -I used my knowledge of this phase of spiritual pathology, and set down -a rule that she should not be present with Lucy, or think of her -illness more than was absolutely required. She assented readily, so -readily that I saw again the hand of Nature fighting for life. Van -Helsing and I were shown up to Lucy's room. If I was shocked when I -saw her yesterday, I was horrified when I saw her today. - -She was ghastly, chalkily pale. The red seemed to have gone even from -her lips and gums, and the bones of her face stood out prominently. -Her breathing was painful to see or hear. Van Helsing's face grew set -as marble, and his eyebrows converged till they almost touched over his -nose. Lucy lay motionless, and did not seem to have strength to -speak, so for a while we were all silent. Then Van Helsing beckoned -to me, and we went gently out of the room. The instant we had closed -the door he stepped quickly along the passage to the next door, which -was open. Then he pulled me quickly in with him and closed the door. -"My god!" he said. "This is dreadful. There is not time to be lost. -She will die for sheer want of blood to keep the heart's action as it -should be. There must be a transfusion of blood at once. Is it you -or me?" - -"I am younger and stronger, Professor. It must be me." - -"Then get ready at once. I will bring up my bag. I am prepared." - -I went downstairs with him, and as we were going there was a knock at -the hall door. When we reached the hall, the maid had just opened the -door, and Arthur was stepping quickly in. He rushed up to me, saying -in an eager whisper, - -"Jack, I was so anxious. I read between the lines of your letter, and -have been in an agony. The dad was better, so I ran down here to see -for myself. Is not that gentleman Dr. Van Helsing? I am so thankful -to you, sir, for coming." - -When first the Professor's eye had lit upon him, he had been angry at -his interruption at such a time, but now, as he took in his stalwart -proportions and recognized the strong young manhood which seemed to -emanate from him, his eyes gleamed. Without a pause he said to him as -he held out his hand, - -"Sir, you have come in time. You are the lover of our dear miss. She -is bad, very, very bad. Nay, my child, do not go like that." For he -suddenly grew pale and sat down in a chair almost fainting. "You are -to help her. You can do more than any that live, and your courage is -your best help." - -"What can I do?" asked Arthur hoarsely. "Tell me, and I shall do it. -My life is hers, and I would give the last drop of blood in my body for -her." - -The Professor has a strongly humorous side, and I could from old -knowledge detect a trace of its origin in his answer. - -"My young sir, I do not ask so much as that, not the last!" - -"What shall I do?" There was fire in his eyes, and his open nostrils -quivered with intent. Van Helsing slapped him on the shoulder. - -"Come!" he said. "You are a man, and it is a man we want. You are -better than me, better than my friend John." Arthur looked bewildered, -and the Professor went on by explaining in a kindly way. - -"Young miss is bad, very bad. She wants blood, and blood she must -have or die. My friend John and I have consulted, and we are about to -perform what we call transfusion of blood, to transfer from full veins -of one to the empty veins which pine for him. John was to give his -blood, as he is the more young and strong than me."--Here Arthur took -my hand and wrung it hard in silence.--"But now you are here, you are -more good than us, old or young, who toil much in the world of -thought. Our nerves are not so calm and our blood so bright than -yours!" - -Arthur turned to him and said, "If you only knew how gladly I would -die for her you would understand . . ." He stopped with a sort of -choke in his voice. - -"Good boy!" said Van Helsing. "In the not-so-far-off you will be -happy that you have done all for her you love. Come now and be -silent. You shall kiss her once before it is done, but then you must -go, and you must leave at my sign. Say no word to Madame. You know -how it is with her. There must be no shock, any knowledge of this -would be one. Come!" - -We all went up to Lucy's room. Arthur by direction remained outside. -Lucy turned her head and looked at us, but said nothing. She was not -asleep, but she was simply too weak to make the effort. Her eyes -spoke to us, that was all. - -Van Helsing took some things from his bag and laid them on a little -table out of sight. Then he mixed a narcotic, and coming over to the -bed, said cheerily, "Now, little miss, here is your medicine. Drink -it off, like a good child. See, I lift you so that to swallow is -easy. Yes." She had made the effort with success. - -It astonished me how long the drug took to act. This, in fact, marked -the extent of her weakness. The time seemed endless until sleep began -to flicker in her eyelids. At last, however, the narcotic began to -manifest its potency, and she fell into a deep sleep. When the -Professor was satisfied, he called Arthur into the room, and bade him -strip off his coat. Then he added, "You may take that one little kiss -whiles I bring over the table. Friend John, help to me!" So neither -of us looked whilst he bent over her. - -Van Helsing, turning to me, said, "He is so young and strong, and of -blood so pure that we need not defibrinate it." - -Then with swiftness, but with absolute method, Van Helsing performed -the operation. As the transfusion went on, something like life seemed -to come back to poor Lucy's cheeks, and through Arthur's growing -pallor the joy of his face seemed absolutely to shine. After a bit I -began to grow anxious, for the loss of blood was telling on Arthur, -strong man as he was. It gave me an idea of what a terrible strain -Lucy's system must have undergone that what weakened Arthur only -partially restored her. - -But the Professor's face was set, and he stood watch in hand, and with -his eyes fixed now on the patient and now on Arthur. I could hear my -own heart beat. Presently, he said in a soft voice, "Do not stir an -instant. It is enough. You attend him. I will look to her." - -When all was over, I could see how much Arthur was weakened. I -dressed the wound and took his arm to bring him away, when Van Helsing -spoke without turning round, the man seems to have eyes in the back of -his head, "The brave lover, I think, deserve another kiss, which he -shall have presently." And as he had now finished his operation, he -adjusted the pillow to the patient's head. As he did so the narrow -black velvet band which she seems always to wear round her throat, -buckled with an old diamond buckle which her lover had given her, was -dragged a little up, and showed a red mark on her throat. - -Arthur did not notice it, but I could hear the deep hiss of indrawn -breath which is one of Van Helsing's ways of betraying emotion. He -said nothing at the moment, but turned to me, saying, "Now take down -our brave young lover, give him of the port wine, and let him lie down -a while. He must then go home and rest, sleep much and eat much, that -he may be recruited of what he has so given to his love. He must not -stay here. Hold a moment! I may take it, sir, that you are anxious -of result. Then bring it with you, that in all ways the operation is -successful. You have saved her life this time, and you can go home -and rest easy in mind that all that can be is. I shall tell her all -when she is well. She shall love you none the less for what you have -done. Goodbye." - -When Arthur had gone I went back to the room. Lucy was sleeping -gently, but her breathing was stronger. I could see the counterpane -move as her breast heaved. By the bedside sat Van Helsing, looking at -her intently. The velvet band again covered the red mark. I asked -the Professor in a whisper, "What do you make of that mark on her -throat?" - -"What do you make of it?" - -"I have not examined it yet," I answered, and then and there proceeded -to loose the band. Just over the external jugular vein there were two -punctures, not large, but not wholesome looking. There was no sign of -disease, but the edges were white and worn looking, as if by some -trituration. It at once occurred to me that that this wound, or -whatever it was, might be the means of that manifest loss of blood. -But I abandoned the idea as soon as it formed, for such a thing could -not be. The whole bed would have been drenched to a scarlet with the -blood which the girl must have lost to leave such a pallor as she had -before the transfusion. - -"Well?" said Van Helsing. - -"Well," said I. "I can make nothing of it." - -The Professor stood up. "I must go back to Amsterdam tonight," he -said "There are books and things there which I want. You must remain -here all night, and you must not let your sight pass from her." - -"Shall I have a nurse?" I asked. - -"We are the best nurses, you and I. You keep watch all night. See -that she is well fed, and that nothing disturbs her. You must not -sleep all the night. Later on we can sleep, you and I. I shall be -back as soon as possible. And then we may begin." - -"May begin?" I said. "What on earth do you mean?" - -"We shall see!" he answered, as he hurried out. He came back a moment -later and put his head inside the door and said with a warning finger -held up, "Remember, she is your charge. If you leave her, and harm -befall, you shall not sleep easy hereafter!" - - - -DR. SEWARD'S DIARY--CONTINUED - -8 September.--I sat up all night with Lucy. The opiate worked itself -off towards dusk, and she waked naturally. She looked a different -being from what she had been before the operation. Her spirits even -were good, and she was full of a happy vivacity, but I could see -evidences of the absolute prostration which she had undergone. When I -told Mrs. Westenra that Dr. Van Helsing had directed that I should sit -up with her, she almost pooh-poohed the idea, pointing out her -daughter's renewed strength and excellent spirits. I was firm, -however, and made preparations for my long vigil. When her maid had -prepared her for the night I came in, having in the meantime had -supper, and took a seat by the bedside. - -She did not in any way make objection, but looked at me gratefully -whenever I caught her eye. After a long spell she seemed sinking off -to sleep, but with an effort seemed to pull herself together and shook -it off. It was apparent that she did not want to sleep, so I tackled -the subject at once. - -"You do not want to sleep?" - -"No. I am afraid." - -"Afraid to go to sleep! Why so? It is the boon we all crave for." - -"Ah, not if you were like me, if sleep was to you a presage of -horror!" - -"A presage of horror! What on earth do you mean?" - -"I don't know. Oh, I don't know. And that is what is so terrible. -All this weakness comes to me in sleep, until I dread the very -thought." - -"But, my dear girl, you may sleep tonight. I am here watching you, -and I can promise that nothing will happen." - -"Ah, I can trust you!" she said. - -I seized the opportunity, and said, "I promise that if I see any -evidence of bad dreams I will wake you at once." - -"You will? Oh, will you really? How good you are to me. Then I will -sleep!" And almost at the word she gave a deep sigh of relief, and -sank back, asleep. - -All night long I watched by her. She never stirred, but slept on and -on in a deep, tranquil, life-giving, health-giving sleep. Her lips -were slightly parted, and her breast rose and fell with the regularity -of a pendulum. There was a smile on her face, and it was evident that -no bad dreams had come to disturb her peace of mind. - -In the early morning her maid came, and I left her in her care and took -myself back home, for I was anxious about many things. I sent a short -wire to Van Helsing and to Arthur, telling them of the excellent -result of the operation. My own work, with its manifold arrears, took -me all day to clear off. It was dark when I was able to inquire about -my zoophagous patient. The report was good. He had been quite quiet -for the past day and night. A telegram came from Van Helsing at -Amsterdam whilst I was at dinner, suggesting that I should be at -Hillingham tonight, as it might be well to be at hand, and stating -that he was leaving by the night mail and would join me early in the -morning. - - -9 September.--I was pretty tired and worn out when I got to -Hillingham. For two nights I had hardly had a wink of sleep, and my -brain was beginning to feel that numbness which marks cerebral -exhaustion. Lucy was up and in cheerful spirits. When she shook -hands with me she looked sharply in my face and said, - -"No sitting up tonight for you. You are worn out. I am quite well -again. Indeed, I am, and if there is to be any sitting up, it is I -who will sit up with you." - -I would not argue the point, but went and had my supper. Lucy came -with me, and, enlivened by her charming presence, I made an excellent -meal, and had a couple of glasses of the more than excellent port. -Then Lucy took me upstairs, and showed me a room next her own, where a -cozy fire was burning. - -"Now," she said. "You must stay here. I shall leave this door open -and my door too. You can lie on the sofa for I know that nothing -would induce any of you doctors to go to bed whilst there is a patient -above the horizon. If I want anything I shall call out, and you can -come to me at once." - -I could not but acquiesce, for I was dog tired, and could not have sat -up had I tried. So, on her renewing her promise to call me if she -should want anything, I lay on the sofa, and forgot all about -everything. - - - -LUCY WESTENRA'S DIARY - -9 September.--I feel so happy tonight. I have been so miserably weak, -that to be able to think and move about is like feeling sunshine after -a long spell of east wind out of a steel sky. Somehow Arthur feels -very, very close to me. I seem to feel his presence warm about me. I -suppose it is that sickness and weakness are selfish things and turn -our inner eyes and sympathy on ourselves, whilst health and strength -give love rein, and in thought and feeling he can wander where he -wills. I know where my thoughts are. If only Arthur knew! My dear, -my dear, your ears must tingle as you sleep, as mine do waking. Oh, -the blissful rest of last night! How I slept, with that dear, good -Dr. Seward watching me. And tonight I shall not fear to sleep, since -he is close at hand and within call. Thank everybody for being so -good to me. Thank God! Goodnight Arthur. - - - -DR. SEWARD'S DIARY - -10 September.--I was conscious of the Professor's hand on my head, and -started awake all in a second. That is one of the things that we -learn in an asylum, at any rate. - -"And how is our patient?" - -"Well, when I left her, or rather when she left me," I answered. - -"Come, let us see," he said. And together we went into the room. - -The blind was down, and I went over to raise it gently, whilst Van -Helsing stepped, with his soft, cat-like tread, over to the bed. - -As I raised the blind, and the morning sunlight flooded the room, I -heard the Professor's low hiss of inspiration, and knowing its rarity, -a deadly fear shot through my heart. As I passed over he moved back, -and his exclamation of horror, "Gott in Himmel!" needed no enforcement -from his agonized face. He raised his hand and pointed to the bed, -and his iron face was drawn and ashen white. I felt my knees begin to -tremble. - -There on the bed, seemingly in a swoon, lay poor Lucy, more horribly -white and wan-looking than ever. Even the lips were white, and the -gums seemed to have shrunken back from the teeth, as we sometimes see -in a corpse after a prolonged illness. - -Van Helsing raised his foot to stamp in anger, but the instinct of his -life and all the long years of habit stood to him, and he put it down -again softly. - -"Quick!" he said. "Bring the brandy." - -I flew to the dining room, and returned with the decanter. He wetted -the poor white lips with it, and together we rubbed palm and wrist and -heart. He felt her heart, and after a few moments of agonizing -suspense said, - -"It is not too late. It beats, though but feebly. All our work is -undone. We must begin again. There is no young Arthur here now. I -have to call on you yourself this time, friend John." As he spoke, he -was dipping into his bag, and producing the instruments of -transfusion. I had taken off my coat and rolled up my shirt sleeve. -There was no possibility of an opiate just at present, and no need of -one; and so, without a moment's delay, we began the operation. - -After a time, it did not seem a short time either, for the draining -away of one's blood, no matter how willingly it be given, is a -terrible feeling, Van Helsing held up a warning finger. "Do not -stir," he said. "But I fear that with growing strength she may wake, -and that would make danger, oh, so much danger. But I shall -precaution take. I shall give hypodermic injection of morphia." He -proceeded then, swiftly and deftly, to carry out his intent. - -The effect on Lucy was not bad, for the faint seemed to merge subtly -into the narcotic sleep. It was with a feeling of personal pride that -I could see a faint tinge of colour steal back into the pallid cheeks -and lips. No man knows, till he experiences it, what it is to feel -his own lifeblood drawn away into the veins of the woman he loves. - -The Professor watched me critically. "That will do," he said. -"Already?" I remonstrated. "You took a great deal more from Art." To -which he smiled a sad sort of smile as he replied, - -"He is her lover, her fiance. You have work, much work to do for her -and for others, and the present will suffice." - -When we stopped the operation, he attended to Lucy, whilst I applied -digital pressure to my own incision. I laid down, while I waited his -leisure to attend to me, for I felt faint and a little sick. By and -by he bound up my wound, and sent me downstairs to get a glass of wine -for myself. As I was leaving the room, he came after me, and half -whispered. - -"Mind, nothing must be said of this. If our young lover should turn -up unexpected, as before, no word to him. It would at once frighten -him and enjealous him, too. There must be none. So!" - -When I came back he looked at me carefully, and then said, "You are -not much the worse. Go into the room, and lie on your sofa, and rest -awhile, then have much breakfast and come here to me." - -I followed out his orders, for I knew how right and wise they were. I -had done my part, and now my next duty was to keep up my strength. I -felt very weak, and in the weakness lost something of the amazement at -what had occurred. I fell asleep on the sofa, however, wondering over -and over again how Lucy had made such a retrograde movement, and how -she could have been drained of so much blood with no sign any where to -show for it. I think I must have continued my wonder in my dreams, -for, sleeping and waking my thoughts always came back to the little -punctures in her throat and the ragged, exhausted appearance of their -edges, tiny though they were. - -Lucy slept well into the day, and when she woke she was fairly well -and strong, though not nearly so much so as the day before. When Van -Helsing had seen her, he went out for a walk, leaving me in charge, -with strict injunctions that I was not to leave her for a moment. I -could hear his voice in the hall, asking the way to the nearest -telegraph office. - -Lucy chatted with me freely, and seemed quite unconscious that -anything had happened. I tried to keep her amused and interested. -When her mother came up to see her, she did not seem to notice any -change whatever, but said to me gratefully, - -"We owe you so much, Dr. Seward, for all you have done, but you really -must now take care not to overwork yourself. You are looking pale -yourself. You want a wife to nurse and look after you a bit, that you -do!" As she spoke, Lucy turned crimson, though it was only -momentarily, for her poor wasted veins could not stand for long an -unwonted drain to the head. The reaction came in excessive pallor as -she turned imploring eyes on me. I smiled and nodded, and laid my -finger on my lips. With a sigh, she sank back amid her pillows. - -Van Helsing returned in a couple of hours, and presently said to me: -"Now you go home, and eat much and drink enough. Make yourself -strong. I stay here tonight, and I shall sit up with little miss -myself. You and I must watch the case, and we must have none other to -know. I have grave reasons. No, do not ask me. Think what you will. -Do not fear to think even the most not-improbable. Goodnight." - -In the hall two of the maids came to me, and asked if they or either -of them might not sit up with Miss Lucy. They implored me to let -them, and when I said it was Dr. Van Helsing's wish that either he or -I should sit up, they asked me quite piteously to intercede with -the 'foreign gentleman'. I was much touched by their kindness. Perhaps -it is because I am weak at present, and perhaps because it was on -Lucy's account, that their devotion was manifested. For over and over -again have I seen similar instances of woman's kindness. I got back -here in time for a late dinner, went my rounds, all well, and set this -down whilst waiting for sleep. It is coming. - - -11 September.--This afternoon I went over to Hillingham. Found Van -Helsing in excellent spirits, and Lucy much better. Shortly after I -had arrived, a big parcel from abroad came for the Professor. He -opened it with much impressment, assumed, of course, and showed a -great bundle of white flowers. - -"These are for you, Miss Lucy," he said. - -"For me? Oh, Dr. Van Helsing!" - -"Yes, my dear, but not for you to play with. These are medicines." -Here Lucy made a wry face. "Nay, but they are not to take in a -decoction or in nauseous form, so you need not snub that so charming -nose, or I shall point out to my friend Arthur what woes he may have -to endure in seeing so much beauty that he so loves so much distort. -Aha, my pretty miss, that bring the so nice nose all straight again. -This is medicinal, but you do not know how. I put him in your window, -I make pretty wreath, and hang him round your neck, so you sleep well. -Oh, yes! They, like the lotus flower, make your trouble forgotten. -It smell so like the waters of Lethe, and of that fountain of youth -that the Conquistadores sought for in the Floridas, and find him all -too late." - -Whilst he was speaking, Lucy had been examining the flowers and -smelling them. Now she threw them down saying, with half laughter, -and half disgust, - -"Oh, Professor, I believe you are only putting up a joke on me. Why, -these flowers are only common garlic." - -To my surprise, Van Helsing rose up and said with all his sternness, -his iron jaw set and his bushy eyebrows meeting, - -"No trifling with me! I never jest! There is grim purpose in what I -do, and I warn you that you do not thwart me. Take care, for the sake -of others if not for your own." Then seeing poor Lucy scared, as she -might well be, he went on more gently, "Oh, little miss, my dear, do -not fear me. I only do for your good, but there is much virtue to you -in those so common flowers. See, I place them myself in your room. I -make myself the wreath that you are to wear. But hush! No telling to -others that make so inquisitive questions. We must obey, and silence -is a part of obedience, and obedience is to bring you strong and well -into loving arms that wait for you. Now sit still a while. Come with -me, friend John, and you shall help me deck the room with my garlic, -which is all the way from Haarlem, where my friend Vanderpool raise -herb in his glass houses all the year. I had to telegraph yesterday, -or they would not have been here." - -We went into the room, taking the flowers with us. The Professor's -actions were certainly odd and not to be found in any pharmacopeia -that I ever heard of. First he fastened up the windows and latched -them securely. Next, taking a handful of the flowers, he rubbed them -all over the sashes, as though to ensure that every whiff of air that -might get in would be laden with the garlic smell. Then with the wisp -he rubbed all over the jamb of the door, above, below, and at each -side, and round the fireplace in the same way. It all seemed -grotesque to me, and presently I said, "Well, Professor, I know you -always have a reason for what you do, but this certainly puzzles me. -It is well we have no sceptic here, or he would say that you were -working some spell to keep out an evil spirit." - -"Perhaps I am!" he answered quietly as he began to make the wreath -which Lucy was to wear round her neck. - -We then waited whilst Lucy made her toilet for the night, and when she -was in bed he came and himself fixed the wreath of garlic round her -neck. The last words he said to her were, - -"Take care you do not disturb it, and even if the room feel close, do -not tonight open the window or the door." - -"I promise," said Lucy. "And thank you both a thousand times for all -your kindness to me! Oh, what have I done to be blessed with such -friends?" - -As we left the house in my fly, which was waiting, Van Helsing said, -"Tonight I can sleep in peace, and sleep I want, two nights of travel, -much reading in the day between, and much anxiety on the day to -follow, and a night to sit up, without to wink. Tomorrow in the -morning early you call for me, and we come together to see our pretty -miss, so much more strong for my 'spell' which I have work. Ho, ho!" - -He seemed so confident that I, remembering my own confidence two -nights before and with the baneful result, felt awe and vague terror. -It must have been my weakness that made me hesitate to tell it to my -friend, but I felt it all the more, like unshed tears. - - - - -CHAPTER 11 - - -LUCY WESTENRA'S DIARY - -12 September.--How good they all are to me. I quite love that dear -Dr. Van Helsing. I wonder why he was so anxious about these flowers. -He positively frightened me, he was so fierce. And yet he must have -been right, for I feel comfort from them already. Somehow, I do not -dread being alone tonight, and I can go to sleep without fear. I -shall not mind any flapping outside the window. Oh, the terrible -struggle that I have had against sleep so often of late, the pain of -sleeplessness, or the pain of the fear of sleep, and with such unknown -horrors as it has for me! How blessed are some people, whose lives -have no fears, no dreads, to whom sleep is a blessing that comes -nightly, and brings nothing but sweet dreams. Well, here I am -tonight, hoping for sleep, and lying like Ophelia in the play, with -'virgin crants and maiden strewments.' I never liked garlic before, -but tonight it is delightful! There is peace in its smell. I feel -sleep coming already. Goodnight, everybody. - - - -DR. SEWARD'S DIARY - -13 September.--Called at the Berkeley and found Van Helsing, as usual, -up to time. The carriage ordered from the hotel was waiting. The -Professor took his bag, which he always brings with him now. - -Let all be put down exactly. Van Helsing and I arrived at Hillingham -at eight o'clock. It was a lovely morning. The bright sunshine and -all the fresh feeling of early autumn seemed like the completion of -nature's annual work. The leaves were turning to all kinds of -beautiful colours, but had not yet begun to drop from the trees. When -we entered we met Mrs. Westenra coming out of the morning room. She -is always an early riser. She greeted us warmly and said, - -"You will be glad to know that Lucy is better. The dear child is -still asleep. I looked into her room and saw her, but did not go in, -lest I should disturb her." The Professor smiled, and looked quite -jubilant. He rubbed his hands together, and said, "Aha! I thought I -had diagnosed the case. My treatment is working." - -To which she replied, "You must not take all the credit to yourself, -doctor. Lucy's state this morning is due in part to me." - -"How do you mean, ma'am?" asked the Professor. - -"Well, I was anxious about the dear child in the night, and went into -her room. She was sleeping soundly, so soundly that even my coming -did not wake her. But the room was awfully stuffy. There were a lot -of those horrible, strong-smelling flowers about everywhere, and she -had actually a bunch of them round her neck. I feared that the heavy -odour would be too much for the dear child in her weak state, so I took -them all away and opened a bit of the window to let in a little fresh -air. You will be pleased with her, I am sure." - -She moved off into her boudoir, where she usually breakfasted early. -As she had spoken, I watched the Professor's face, and saw it turn -ashen gray. He had been able to retain his self-command whilst the -poor lady was present, for he knew her state and how mischievous a -shock would be. He actually smiled on her as he held open the door -for her to pass into her room. But the instant she had disappeared he -pulled me, suddenly and forcibly, into the dining room and closed the -door. - -Then, for the first time in my life, I saw Van Helsing break down. He -raised his hands over his head in a sort of mute despair, and then -beat his palms together in a helpless way. Finally he sat down on a -chair, and putting his hands before his face, began to sob, with loud, -dry sobs that seemed to come from the very racking of his heart. - -Then he raised his arms again, as though appealing to the whole -universe. "God! God! God!" he said. "What have we done, what has -this poor thing done, that we are so sore beset? Is there fate -amongst us still, send down from the pagan world of old, that such -things must be, and in such way? This poor mother, all unknowing, and -all for the best as she think, does such thing as lose her daughter -body and soul, and we must not tell her, we must not even warn her, or -she die, then both die. Oh, how we are beset! How are all the powers -of the devils against us!" - -Suddenly he jumped to his feet. "Come," he said, "come, we must see and -act. Devils or no devils, or all the devils at once, it matters not. -We must fight him all the same." He went to the hall door for his -bag, and together we went up to Lucy's room. - -Once again I drew up the blind, whilst Van Helsing went towards the -bed. This time he did not start as he looked on the poor face with -the same awful, waxen pallor as before. He wore a look of stern -sadness and infinite pity. - -"As I expected," he murmured, with that hissing inspiration of his -which meant so much. Without a word he went and locked the door, and -then began to set out on the little table the instruments for yet -another operation of transfusion of blood. I had long ago recognized -the necessity, and begun to take off my coat, but he stopped me with a -warning hand. "No!" he said. "Today you must operate. I shall -provide. You are weakened already." As he spoke he took off his coat -and rolled up his shirtsleeve. - -Again the operation. Again the narcotic. Again some return of colour -to the ashy cheeks, and the regular breathing of healthy sleep. This -time I watched whilst Van Helsing recruited himself and rested. - -Presently he took an opportunity of telling Mrs. Westenra that she -must not remove anything from Lucy's room without consulting him. -That the flowers were of medicinal value, and that the breathing of -their odour was a part of the system of cure. Then he took over the -care of the case himself, saying that he would watch this night and -the next, and would send me word when to come. - -After another hour Lucy waked from her sleep, fresh and bright and -seemingly not much the worse for her terrible ordeal. - -What does it all mean? I am beginning to wonder if my long habit of -life amongst the insane is beginning to tell upon my own brain. - - - -LUCY WESTENRA'S DIARY - -17 September.--Four days and nights of peace. I am getting so strong -again that I hardly know myself. It is as if I had passed through -some long nightmare, and had just awakened to see the beautiful -sunshine and feel the fresh air of the morning around me. I have a -dim half remembrance of long, anxious times of waiting and fearing, -darkness in which there was not even the pain of hope to make present -distress more poignant. And then long spells of oblivion, and the -rising back to life as a diver coming up through a great press of -water. Since, however, Dr. Van Helsing has been with me, all this bad -dreaming seems to have passed away. The noises that used to frighten -me out of my wits, the flapping against the windows, the distant -voices which seemed so close to me, the harsh sounds that came from I -know not where and commanded me to do I know not what, have all -ceased. I go to bed now without any fear of sleep. I do not even try -to keep awake. I have grown quite fond of the garlic, and a boxful -arrives for me every day from Haarlem. Tonight Dr. Van Helsing is -going away, as he has to be for a day in Amsterdam. But I need not be -watched. I am well enough to be left alone. - -Thank God for Mother's sake, and dear Arthur's, and for all our -friends who have been so kind! I shall not even feel the change, for -last night Dr. Van Helsing slept in his chair a lot of the time. I -found him asleep twice when I awoke. But I did not fear to go to -sleep again, although the boughs or bats or something flapped almost -angrily against the window panes. - - - - -THE PALL MALL GAZETTE 18 September. - -THE ESCAPED WOLF PERILOUS ADVENTURE OF OUR INTERVIEWER - -INTERVIEW WITH THE KEEPER IN THE ZOOLOGICAL GARDENS - -After many inquiries and almost as many refusals, and perpetually -using the words 'PALL MALL GAZETTE' as a sort of talisman, I managed -to find the keeper of the section of the Zoological Gardens in which -the wolf department is included. Thomas Bilder lives in one of the -cottages in the enclosure behind the elephant house, and was just -sitting down to his tea when I found him. Thomas and his wife are -hospitable folk, elderly, and without children, and if the specimen -I enjoyed of their hospitality be of the average kind, their lives -must be pretty comfortable. The keeper would not enter on what he -called business until the supper was over, and we were all -satisfied. Then when the table was cleared, and he had lit his -pipe, he said, - -"Now, Sir, you can go on and arsk me what you want. You'll excoose -me refoosin' to talk of perfeshunal subjucts afore meals. I gives -the wolves and the jackals and the hyenas in all our section their -tea afore I begins to arsk them questions." - -"How do you mean, ask them questions?" I queried, wishful to get him -into a talkative humor. - -"'Ittin' of them over the 'ead with a pole is one way. Scratchin' of -their ears in another, when gents as is flush wants a bit of a show-orf -to their gals. I don't so much mind the fust, the 'ittin of the -pole part afore I chucks in their dinner, but I waits till they've -'ad their sherry and kawffee, so to speak, afore I tries on with the -ear scratchin'. Mind you," he added philosophically, "there's a -deal of the same nature in us as in them theer animiles. Here's you -a-comin' and arskin' of me questions about my business, and I that -grump-like that only for your bloomin' 'arf-quid I'd 'a' seen you -blowed fust 'fore I'd answer. Not even when you arsked me sarcastic -like if I'd like you to arsk the Superintendent if you might arsk me -questions. Without offence did I tell yer to go to 'ell?" - -"You did." - -"An' when you said you'd report me for usin' obscene language that -was 'ittin' me over the 'ead. But the 'arf-quid made that all -right. I weren't a-goin' to fight, so I waited for the food, and -did with my 'owl as the wolves and lions and tigers does. But, lor' -love yer 'art, now that the old 'ooman has stuck a chunk of her -tea-cake in me, an' rinsed me out with her bloomin' old teapot, and I've -lit hup, you may scratch my ears for all you're worth, and won't -even get a growl out of me. Drive along with your questions. I -know what yer a-comin' at, that 'ere escaped wolf." - -"Exactly. I want you to give me your view of it. Just tell me how -it happened, and when I know the facts I'll get you to say what you -consider was the cause of it, and how you think the whole affair -will end." - -"All right, guv'nor. This 'ere is about the 'ole story. -That 'ere wolf what we called Bersicker was one of three gray -ones that came from Norway to Jamrach's, which we bought -off him four years ago. He was a nice well-behaved wolf, -that never gave no trouble to talk of. I'm more surprised -at 'im for wantin' to get out nor any other animile in the -place. But, there, you can't trust wolves no more nor women." - -"Don't you mind him, Sir!" broke in Mrs. Tom, with a cheery -laugh. "'E's got mindin' the animiles so long that blest -if he ain't like a old wolf 'isself! But there ain't no -'arm in 'im." - -"Well, Sir, it was about two hours after feedin' yesterday when I -first hear my disturbance. I was makin' up a litter in the monkey -house for a young puma which is ill. But when I heard the yelpin' -and 'owlin' I kem away straight. There was Bersicker a-tearin' like -a mad thing at the bars as if he wanted to get out. There wasn't -much people about that day, and close at hand was only one man, a -tall, thin chap, with a 'ook nose and a pointed beard, with a few -white hairs runnin' through it. He had a 'ard, cold look and red -eyes, and I took a sort of mislike to him, for it seemed as if it -was 'im as they was hirritated at. He 'ad white kid gloves on 'is -'ands, and he pointed out the animiles to me and says, 'Keeper, -these wolves seem upset at something.' - -"'Maybe it's you,' says I, for I did not like the airs as he -give 'isself. He didn't get angry, as I 'oped he would, but -he smiled a kind of insolent smile, with a mouth full of white, -sharp teeth. 'Oh no, they wouldn't like me,' 'e says. - -"'Ow yes, they would,' says I, a-imitatin' of him. 'They -always like a bone or two to clean their teeth on about tea -time, which you 'as a bagful.' - -"Well, it was a odd thing, but when the animiles see us -a-talkin' they lay down, and when I went over to Bersicker -he let me stroke his ears same as ever. That there man kem -over, and blessed but if he didn't put in his hand and stroke -the old wolf's ears too! - -"'Tyke care,' says I. 'Bersicker is quick.' - -"'Never mind,' he says. I'm used to 'em!' - -"'Are you in the business yourself?' I says, tyking off my -'at, for a man what trades in wolves, anceterer, is a good -friend to keepers. - -"'Nom,' says he, 'not exactly in the business, but I 'ave made pets -of several.' And with that he lifts his 'at as perlite as a lord, -and walks away. Old Bersicker kep' a-lookin' arter 'im till 'e was -out of sight, and then went and lay down in a corner and wouldn't -come hout the 'ole hevening. Well, larst night, so soon as the moon -was hup, the wolves here all began a-'owling. There warn't nothing -for them to 'owl at. There warn't no one near, except some one that -was evidently a-callin' a dog somewheres out back of the gardings in -the Park road. Once or twice I went out to see that all was right, -and it was, and then the 'owling stopped. Just before twelve -o'clock I just took a look round afore turnin' in, an', bust me, but -when I kem opposite to old Bersicker's cage I see the rails broken -and twisted about and the cage empty. And that's all I know for -certing." - -"Did any one else see anything?" - -"One of our gard'ners was a-comin' 'ome about that time from a -'armony, when he sees a big gray dog comin' out through the garding -'edges. At least, so he says, but I don't give much for it myself, -for if he did 'e never said a word about it to his missis when 'e -got 'ome, and it was only after the escape of the wolf was made -known, and we had been up all night a-huntin' of the Park for -Bersicker, that he remembered seein' anything. My own belief was -that the 'armony 'ad got into his 'ead." - -"Now, Mr. Bilder, can you account in any way for the escape -of the wolf?" - -"Well, Sir," he said, with a suspicious sort of modesty, "I think I -can, but I don't know as 'ow you'd be satisfied with the theory." - -"Certainly I shall. If a man like you, who knows the animals from -experience, can't hazard a good guess at any rate, who is even to -try?" - -"Well then, Sir, I accounts for it this way. It seems to me that -'ere wolf escaped--simply because he wanted to get out." - -From the hearty way that both Thomas and his wife laughed at the -joke I could see that it had done service before, and that the whole -explanation was simply an elaborate sell. I couldn't cope in -badinage with the worthy Thomas, but I thought I knew a surer way to -his heart, so I said, "Now, Mr. Bilder, we'll consider that first -half-sovereign worked off, and this brother of his is waiting to be -claimed when you've told me what you think will happen." - -"Right y'are, Sir," he said briskly. "Ye'll excoose me, I -know, for a-chaffin' of ye, but the old woman here winked at -me, which was as much as telling me to go on." - -"Well, I never!" said the old lady. - -"My opinion is this: that 'ere wolf is a'idin' of, somewheres. The -gard'ner wot didn't remember said he was a-gallopin' northward -faster than a horse could go, but I don't believe him, for, yer see, -Sir, wolves don't gallop no more nor dogs does, they not bein' built -that way. Wolves is fine things in a storybook, and I dessay when -they gets in packs and does be chivyin' somethin' that's more -afeared than they is they can make a devil of a noise and chop it -up, whatever it is. But, Lor' bless you, in real life a wolf is -only a low creature, not half so clever or bold as a good dog, and -not half a quarter so much fight in 'im. This one ain't been used -to fightin' or even to providin' for hisself, and more like he's -somewhere round the Park a'hidin' an' a'shiverin' of, and if he -thinks at all, wonderin' where he is to get his breakfast from. Or -maybe he's got down some area and is in a coal cellar. My eye, -won't some cook get a rum start when she sees his green eyes -a-shinin' at her out of the dark! If he can't get food he's bound to -look for it, and mayhap he may chance to light on a butcher's shop -in time. If he doesn't, and some nursemaid goes out walkin' or orf -with a soldier, leavin' of the hinfant in the perambulator--well, -then I shouldn't be surprised if the census is one babby the less. -That's all." - -I was handing him the half-sovereign, when something came bobbing up -against the window, and Mr. Bilder's face doubled its natural length -with surprise. - -"God bless me!" he said. "If there ain't old Bersicker come back by -'isself!" - -He went to the door and opened it, a most unnecessary proceeding it -seemed to me. I have always thought that a wild animal never looks -so well as when some obstacle of pronounced durability is between -us. A personal experience has intensified rather than diminished -that idea. - -After all, however, there is nothing like custom, for neither Bilder -nor his wife thought any more of the wolf than I should of a dog. -The animal itself was a peaceful and well-behaved as that father of -all picture-wolves, Red Riding Hood's quondam friend, whilst moving -her confidence in masquerade. - -The whole scene was a unutterable mixture of comedy and -pathos. The wicked wolf that for a half a day had -paralyzed London and set all the children in town shivering -in their shoes, was there in a sort of penitent mood, and -was received and petted like a sort of vulpine prodigal -son. Old Bilder examined him all over with most tender -solicitude, and when he had finished with his penitent -said, - -"There, I knew the poor old chap would get into some kind of -trouble. Didn't I say it all along? Here's his head all -cut and full of broken glass. 'E's been a-gettin' over -some bloomin' wall or other. It's a shyme that people are -allowed to top their walls with broken bottles. This 'ere's -what comes of it. Come along, Bersicker." - -He took the wolf and locked him up in a cage, with a piece -of meat that satisfied, in quantity at any rate, the elementary -conditions of the fatted calf, and went off to report. - -I came off too, to report the only exclusive information -that is given today regarding the strange escapade at the -Zoo. - - - -DR. SEWARD'S DIARY - -17 September.--I was engaged after dinner in my study posting up my -books, which, through press of other work and the many visits to Lucy, -had fallen sadly into arrear. Suddenly the door was burst open, and -in rushed my patient, with his face distorted with passion. I was -thunderstruck, for such a thing as a patient getting of his own accord -into the Superintendent's study is almost unknown. - -Without an instant's notice he made straight at me. He had a dinner -knife in his hand, and as I saw he was dangerous, I tried to keep the -table between us. He was too quick and too strong for me, however, -for before I could get my balance he had struck at me and cut my left -wrist rather severely. - -Before he could strike again, however, I got in my right hand and he -was sprawling on his back on the floor. My wrist bled freely, and -quite a little pool trickled on to the carpet. I saw that my friend -was not intent on further effort, and occupied myself binding up my -wrist, keeping a wary eye on the prostrate figure all the time. When -the attendants rushed in, and we turned our attention to him, his -employment positively sickened me. He was lying on his belly on the -floor licking up, like a dog, the blood which had fallen from my -wounded wrist. He was easily secured, and to my surprise, went with -the attendants quite placidly, simply repeating over and over again, -"The blood is the life! The blood is the life!" - -I cannot afford to lose blood just at present. I have lost too much -of late for my physical good, and then the prolonged strain of Lucy's -illness and its horrible phases is telling on me. I am over excited -and weary, and I need rest, rest, rest. Happily Van Helsing has not -summoned me, so I need not forego my sleep. Tonight I could not well -do without it. - - - -TELEGRAM, VAN HELSING, ANTWERP, TO SEWARD, CARFAX - -(Sent to Carfax, Sussex, as no county given, delivered late -by twenty-two hours.) - -17 September.--Do not fail to be at Hilllingham tonight. -If not watching all the time, frequently visit and see that -flowers are as placed, very important, do not fail. Shall -be with you as soon as possible after arrival. - - - -DR. SEWARD'S DIARY - -18 September.--Just off train to London. The arrival of Van -Helsing's telegram filled me with dismay. A whole night lost, -and I know by bitter experience what may happen in a night. -Of course it is possible that all may be well, but what may -have happened? Surely there is some horrible doom hanging over us -that every possible accident should thwart us in all we try to do. -I shall take this cylinder with me, and then I can complete -my entry on Lucy's phonograph. - - - - -MEMORANDUM LEFT BY LUCY WESTENRA - -17 September, Night.--I write this and leave it to be seen, -so that no one may by any chance get into trouble through -me. This is an exact record of what took place tonight. I -feel I am dying of weakness, and have barely strength to -write, but it must be done if I die in the doing. - -I went to bed as usual, taking care that the flowers were -placed as Dr. Van Helsing directed, and soon fell asleep. - -I was waked by the flapping at the window, which had begun after -that sleep-walking on the cliff at Whitby when Mina saved me, and -which now I know so well. I was not afraid, but I did wish that -Dr. Seward was in the next room, as Dr. Van Helsing said he would -be, so that I might have called him. I tried to sleep, but I -could not. Then there came to me the old fear of sleep, and I -determined to keep awake. Perversely sleep would try to come then -when I did not want it. So, as I feared to be alone, I opened my -door and called out, "Is there anybody there?" There was no -answer. I was afraid to wake mother, and so closed my door -again. Then outside in the shrubbery I heard a sort of howl like -a dog's, but more fierce and deeper. I went to the window and -looked out, but could see nothing, except a big bat, which had -evidently been buffeting its wings against the window. So I went -back to bed again, but determined not to go to sleep. Presently -the door opened, and mother looked in. Seeing by my moving that -I was not asleep, she came in and sat by me. She said to me even -more sweetly and softly than her wont, - -"I was uneasy about you, darling, and came in to see that -you were all right." - -I feared she might catch cold sitting there, and asked her -to come in and sleep with me, so she came into bed, and lay -down beside me. She did not take off her dressing gown, -for she said she would only stay a while and then go back -to her own bed. As she lay there in my arms, and I in hers -the flapping and buffeting came to the window again. She -was startled and a little frightened, and cried out, "What -is that?" - -I tried to pacify her, and at last succeeded, and she lay -quiet. But I could hear her poor dear heart still beating -terribly. After a while there was the howl again out in -the shrubbery, and shortly after there was a crash at the -window, and a lot of broken glass was hurled on the floor. -The window blind blew back with the wind that rushed in, -and in the aperture of the broken panes there was the head -of a great, gaunt gray wolf. - -Mother cried out in a fright, and struggled up into a -sitting posture, and clutched wildly at anything that would -help her. Amongst other things, she clutched the wreath of -flowers that Dr. Van Helsing insisted on my wearing round -my neck, and tore it away from me. For a second or two she -sat up, pointing at the wolf, and there was a strange and -horrible gurgling in her throat. Then she fell over, as if -struck with lightning, and her head hit my forehead and -made me dizzy for a moment or two. - -The room and all round seemed to spin round. I kept my eyes -fixed on the window, but the wolf drew his head back, and a whole -myriad of little specks seems to come blowing in through the -broken window, and wheeling and circling round like the pillar of -dust that travellers describe when there is a simoon in the -desert. I tried to stir, but there was some spell upon me, and -dear Mother's poor body, which seemed to grow cold already, for -her dear heart had ceased to beat, weighed me down, and I -remembered no more for a while. - -The time did not seem long, but very, very awful, till I -recovered consciousness again. Somewhere near, a passing -bell was tolling. The dogs all round the neighbourhood were -howling, and in our shrubbery, seemingly just outside, a -nightingale was singing. I was dazed and stupid with pain -and terror and weakness, but the sound of the nightingale -seemed like the voice of my dead mother come back to comfort me. -The sounds seemed to have awakened the maids, too, for I could -hear their bare feet pattering outside my door. I called to -them, and they came in, and when they saw what had happened, and -what it was that lay over me on the bed, they screamed out. The -wind rushed in through the broken window, and the door slammed -to. They lifted off the body of my dear mother, and laid her, -covered up with a sheet, on the bed after I had got up. They -were all so frightened and nervous that I directed them to go to -the dining room and each have a glass of wine. The door flew -open for an instant and closed again. The maids shrieked, and -then went in a body to the dining room, and I laid what flowers I -had on my dear mother's breast. When they were there I -remembered what Dr. Van Helsing had told me, but I didn't like to -remove them, and besides, I would have some of the servants to -sit up with me now. I was surprised that the maids did not come -back. I called them, but got no answer, so I went to the dining -room to look for them. - -My heart sank when I saw what had happened. They all four -lay helpless on the floor, breathing heavily. The decanter -of sherry was on the table half full, but there was a queer, -acrid smell about. I was suspicious, and examined the decanter. -It smelt of laudanum, and looking on the sideboard, I found that -the bottle which Mother's doctor uses for her--oh! did use--was -empty. What am I to do? What am I to do? I am back in the room -with Mother. I cannot leave her, and I am alone, save for the -sleeping servants, whom some one has drugged. Alone with the -dead! I dare not go out, for I can hear the low howl of the wolf -through the broken window. - -The air seems full of specks, floating and circling in the -draught from the window, and the lights burn blue and dim. -What am I to do? God shield me from harm this night! I -shall hide this paper in my breast, where they shall find -it when they come to lay me out. My dear mother gone! It -is time that I go too. Goodbye, dear Arthur, if I should -not survive this night. God keep you, dear, and God help -me! - - - - -CHAPTER 12 - - -DR. SEWARD'S DIARY - -18 September.--I drove at once to Hillingham and arrived early. -Keeping my cab at the gate, I went up the avenue alone. I knocked -gently and rang as quietly as possible, for I feared to disturb Lucy -or her mother, and hoped to only bring a servant to the door. After a -while, finding no response, I knocked and rang again, still no -answer. I cursed the laziness of the servants that they should lie -abed at such an hour, for it was now ten o'clock, and so rang and -knocked again, but more impatiently, but still without response. -Hitherto I had blamed only the servants, but now a terrible fear began -to assail me. Was this desolation but another link in the chain of -doom which seemed drawing tight round us? Was it indeed a house of -death to which I had come, too late? I know that minutes, even -seconds of delay, might mean hours of danger to Lucy, if she had had -again one of those frightful relapses, and I went round the house to -try if I could find by chance an entry anywhere. - -I could find no means of ingress. Every window and door was fastened -and locked, and I returned baffled to the porch. As I did so, I heard -the rapid pit-pat of a swiftly driven horse's feet. They stopped at -the gate, and a few seconds later I met Van Helsing running up the -avenue. When he saw me, he gasped out, "Then it was you, and just -arrived. How is she? Are we too late? Did you not get my telegram?" - -I answered as quickly and coherently as I could that I had only got -his telegram early in the morning, and had not a minute in coming -here, and that I could not make any one in the house hear me. He -paused and raised his hat as he said solemnly, "Then I fear we are too -late. God's will be done!" - -With his usual recuperative energy, he went on, "Come. If there be no -way open to get in, we must make one. Time is all in all to us now." - -We went round to the back of the house, where there was a kitchen -window. The Professor took a small surgical saw from his case, and -handing it to me, pointed to the iron bars which guarded the window. -I attacked them at once and had very soon cut through three of them. -Then with a long, thin knife we pushed back the fastening of the -sashes and opened the window. I helped the Professor in, and followed -him. There was no one in the kitchen or in the servants' rooms, which -were close at hand. We tried all the rooms as we went along, and in -the dining room, dimly lit by rays of light through the shutters, -found four servant women lying on the floor. There was no need to -think them dead, for their stertorous breathing and the acrid smell of -laudanum in the room left no doubt as to their condition. - -Van Helsing and I looked at each other, and as we moved away he said, -"We can attend to them later." Then we ascended to Lucy's room. For an -instant or two we paused at the door to listen, but there was no sound -that we could hear. With white faces and trembling hands, we opened -the door gently, and entered the room. - -How shall I describe what we saw? On the bed lay two women, Lucy and -her mother. The latter lay farthest in, and she was covered with a -white sheet, the edge of which had been blown back by the drought -through the broken window, showing the drawn, white, face, with a look -of terror fixed upon it. By her side lay Lucy, with face white and -still more drawn. The flowers which had been round her neck we found -upon her mother's bosom, and her throat was bare, showing the two -little wounds which we had noticed before, but looking horribly white -and mangled. Without a word the Professor bent over the bed, his head -almost touching poor Lucy's breast. Then he gave a quick turn of his -head, as of one who listens, and leaping to his feet, he cried out to -me, "It is not yet too late! Quick! Quick! Bring the brandy!" - -I flew downstairs and returned with it, taking care to smell and taste -it, lest it, too, were drugged like the decanter of sherry which I -found on the table. The maids were still breathing, but more -restlessly, and I fancied that the narcotic was wearing off. I did -not stay to make sure, but returned to Van Helsing. He rubbed the -brandy, as on another occasion, on her lips and gums and on her wrists -and the palms of her hands. He said to me, "I can do this, all that -can be at the present. You go wake those maids. Flick them in the -face with a wet towel, and flick them hard. Make them get heat and -fire and a warm bath. This poor soul is nearly as cold as that beside -her. She will need be heated before we can do anything more." - -I went at once, and found little difficulty in waking three of the -women. The fourth was only a young girl, and the drug had evidently -affected her more strongly so I lifted her on the sofa and let her -sleep. - -The others were dazed at first, but as remembrance came back to them -they cried and sobbed in a hysterical manner. I was stern with them, -however, and would not let them talk. I told them that one life was -bad enough to lose, and if they delayed they would sacrifice Miss -Lucy. So, sobbing and crying they went about their way, half clad as -they were, and prepared fire and water. Fortunately, the kitchen and -boiler fires were still alive, and there was no lack of hot water. We -got a bath and carried Lucy out as she was and placed her in it. -Whilst we were busy chafing her limbs there was a knock at the hall -door. One of the maids ran off, hurried on some more clothes, and -opened it. Then she returned and whispered to us that there was a -gentleman who had come with a message from Mr. Holmwood. I bade her -simply tell him that he must wait, for we could see no one now. She -went away with the message, and, engrossed with our work, I clean -forgot all about him. - -I never saw in all my experience the Professor work in such deadly -earnest. I knew, as he knew, that it was a stand-up fight with death, -and in a pause told him so. He answered me in a way that I did not -understand, but with the sternest look that his face could wear. - -"If that were all, I would stop here where we are now, and let her -fade away into peace, for I see no light in life over her horizon." He -went on with his work with, if possible, renewed and more frenzied -vigour. - -Presently we both began to be conscious that the heat was beginning to -be of some effect. Lucy's heart beat a trifle more audibly to the -stethoscope, and her lungs had a perceptible movement. Van Helsing's -face almost beamed, and as we lifted her from the bath and rolled her -in a hot sheet to dry her he said to me, "The first gain is ours! -Check to the King!" - -We took Lucy into another room, which had by now been prepared, and -laid her in bed and forced a few drops of brandy down her throat. I -noticed that Van Helsing tied a soft silk handkerchief round her -throat. She was still unconscious, and was quite as bad as, if not -worse than, we had ever seen her. - -Van Helsing called in one of the women, and told her to stay with her -and not to take her eyes off her till we returned, and then beckoned -me out of the room. - -"We must consult as to what is to be done," he said as we descended -the stairs. In the hall he opened the dining room door, and we passed -in, he closing the door carefully behind him. The shutters had been -opened, but the blinds were already down, with that obedience to the -etiquette of death which the British woman of the lower classes always -rigidly observes. The room was, therefore, dimly dark. It was, -however, light enough for our purposes. Van Helsing's sternness was -somewhat relieved by a look of perplexity. He was evidently torturing -his mind about something, so I waited for an instant, and he spoke. - -"What are we to do now? Where are we to turn for help? We must have -another transfusion of blood, and that soon, or that poor girl's life -won't be worth an hour's purchase. You are exhausted already. I am -exhausted too. I fear to trust those women, even if they would have -courage to submit. What are we to do for some one who will open his -veins for her?" - -"What's the matter with me, anyhow?" - -The voice came from the sofa across the room, and its tones brought -relief and joy to my heart, for they were those of Quincey Morris. - -Van Helsing started angrily at the first sound, but his face softened -and a glad look came into his eyes as I cried out, "Quincey Morris!" -and rushed towards him with outstretched hands. - -"What brought you here?" I cried as our hands met. - -"I guess Art is the cause." - -He handed me a telegram.--'Have not heard from Seward for three days, -and am terribly anxious. Cannot leave. Father still in same -condition. Send me word how Lucy is. Do not delay.--Holmwood.' - -"I think I came just in the nick of time. You know you have only to -tell me what to do." - -Van Helsing strode forward, and took his hand, looking him straight in -the eyes as he said, "A brave man's blood is the best thing on this -earth when a woman is in trouble. You're a man and no mistake. Well, -the devil may work against us for all he's worth, but God sends us men -when we want them." - -Once again we went through that ghastly operation. I have not the -heart to go through with the details. Lucy had got a terrible shock -and it told on her more than before, for though plenty of blood went -into her veins, her body did not respond to the treatment as well as -on the other occasions. Her struggle back into life was something -frightful to see and hear. However, the action of both heart and -lungs improved, and Van Helsing made a sub-cutaneous injection of -morphia, as before, and with good effect. Her faint became a profound -slumber. The Professor watched whilst I went downstairs with Quincey -Morris, and sent one of the maids to pay off one of the cabmen who -were waiting. - -I left Quincey lying down after having a glass of wine, and told the -cook to get ready a good breakfast. Then a thought struck me, and I -went back to the room where Lucy now was. When I came softly in, I -found Van Helsing with a sheet or two of note paper in his hand. He -had evidently read it, and was thinking it over as he sat with his -hand to his brow. There was a look of grim satisfaction in his face, -as of one who has had a doubt solved. He handed me the paper saying -only, "It dropped from Lucy's breast when we carried her to the bath." - -When I had read it, I stood looking at the Professor, and after a -pause asked him, "In God's name, what does it all mean? Was she, or -is she, mad, or what sort of horrible danger is it?" I was so -bewildered that I did not know what to say more. Van Helsing put out -his hand and took the paper, saying, - -"Do not trouble about it now. Forget it for the present. You shall -know and understand it all in good time, but it will be later. And -now what is it that you came to me to say?" This brought me back to -fact, and I was all myself again. - -"I came to speak about the certificate of death. If we do not act -properly and wisely, there may be an inquest, and that paper would -have to be produced. I am in hopes that we need have no inquest, for -if we had it would surely kill poor Lucy, if nothing else did. I -know, and you know, and the other doctor who attended her knows, that -Mrs. Westenra had disease of the heart, and we can certify that she -died of it. Let us fill up the certificate at once, and I shall take -it myself to the registrar and go on to the undertaker." - -"Good, oh my friend John! Well thought of! Truly Miss Lucy, if she -be sad in the foes that beset her, is at least happy in the friends -that love her. One, two, three, all open their veins for her, besides -one old man. Ah, yes, I know, friend John. I am not blind! I love -you all the more for it! Now go." - -In the hall I met Quincey Morris, with a telegram for Arthur telling -him that Mrs. Westenra was dead, that Lucy also had been ill, but was -now going on better, and that Van Helsing and I were with her. I told -him where I was going, and he hurried me out, but as I was going said, - -"When you come back, Jack, may I have two words with you all to -ourselves?" I nodded in reply and went out. I found no difficulty -about the registration, and arranged with the local undertaker to come -up in the evening to measure for the coffin and to make arrangements. - -When I got back Quincey was waiting for me. I told him I would see -him as soon as I knew about Lucy, and went up to her room. She was -still sleeping, and the Professor seemingly had not moved from his -seat at her side. From his putting his finger to his lips, I gathered -that he expected her to wake before long and was afraid of -fore-stalling nature. So I went down to Quincey and took him into the -breakfast room, where the blinds were not drawn down, and which was a -little more cheerful, or rather less cheerless, than the other rooms. - -When we were alone, he said to me, "Jack Seward, I don't want to shove -myself in anywhere where I've no right to be, but this is no ordinary -case. You know I loved that girl and wanted to marry her, but -although that's all past and gone, I can't help feeling anxious about -her all the same. What is it that's wrong with her? The Dutchman, -and a fine old fellow he is, I can see that, said that time you two -came into the room, that you must have another transfusion of blood, -and that both you and he were exhausted. Now I know well that you -medical men speak in camera, and that a man must not expect to know -what they consult about in private. But this is no common matter, and -whatever it is, I have done my part. Is not that so?" - -"That's so," I said, and he went on. - -"I take it that both you and Van Helsing had done already what I did -today. Is not that so?" - -"That's so." - -"And I guess Art was in it too. When I saw him four days ago down at -his own place he looked queer. I have not seen anything pulled down -so quick since I was on the Pampas and had a mare that I was fond of -go to grass all in a night. One of those big bats that they call -vampires had got at her in the night, and what with his gorge and the -vein left open, there wasn't enough blood in her to let her stand up, -and I had to put a bullet through her as she lay. Jack, if you may -tell me without betraying confidence, Arthur was the first, is not -that so?" - -As he spoke the poor fellow looked terribly anxious. He was in a -torture of suspense regarding the woman he loved, and his utter -ignorance of the terrible mystery which seemed to surround her -intensified his pain. His very heart was bleeding, and it took all -the manhood of him, and there was a royal lot of it, too, to keep him -from breaking down. I paused before answering, for I felt that I must -not betray anything which the Professor wished kept secret, but -already he knew so much, and guessed so much, that there could be no -reason for not answering, so I answered in the same phrase. - -"That's so." - -"And how long has this been going on?" - -"About ten days." - -"Ten days! Then I guess, Jack Seward, that that poor pretty creature -that we all love has had put into her veins within that time the blood -of four strong men. Man alive, her whole body wouldn't hold it." Then -coming close to me, he spoke in a fierce half-whisper. "What took it -out?" - -I shook my head. "That," I said, "is the crux. Van Helsing is simply -frantic about it, and I am at my wits' end. I can't even hazard a -guess. There has been a series of little circumstances which have -thrown out all our calculations as to Lucy being properly watched. -But these shall not occur again. Here we stay until all be well, or -ill." - -Quincey held out his hand. "Count me in," he said. "You and the -Dutchman will tell me what to do, and I'll do it." - -When she woke late in the afternoon, Lucy's first movement was to feel -in her breast, and to my surprise, produced the paper which Van -Helsing had given me to read. The careful Professor had replaced it -where it had come from, lest on waking she should be alarmed. Her -eyes then lit on Van Helsing and on me too, and gladdened. Then she -looked round the room, and seeing where she was, shuddered. She gave -a loud cry, and put her poor thin hands before her pale face. - -We both understood what was meant, that she had realized to the full -her mother's death. So we tried what we could to comfort her. -Doubtless sympathy eased her somewhat, but she was very low in thought -and spirit, and wept silently and weakly for a long time. We told her -that either or both of us would now remain with her all the time, and -that seemed to comfort her. Towards dusk she fell into a doze. Here -a very odd thing occurred. Whilst still asleep she took the paper -from her breast and tore it in two. Van Helsing stepped over and took -the pieces from her. All the same, however, she went on with the -action of tearing, as though the material were still in her hands. -Finally she lifted her hands and opened them as though scattering the -fragments. Van Helsing seemed surprised, and his brows gathered as if -in thought, but he said nothing. - - -19 September.--All last night she slept fitfully, being always afraid -to sleep, and something weaker when she woke from it. The Professor -and I took in turns to watch, and we never left her for a moment -unattended. Quincey Morris said nothing about his intention, but I -knew that all night long he patrolled round and round the house. - -When the day came, its searching light showed the ravages in poor -Lucy's strength. She was hardly able to turn her head, and the little -nourishment which she could take seemed to do her no good. At times -she slept, and both Van Helsing and I noticed the difference in her, -between sleeping and waking. Whilst asleep she looked stronger, -although more haggard, and her breathing was softer. Her open mouth -showed the pale gums drawn back from the teeth, which looked -positively longer and sharper than usual. When she woke the softness -of her eyes evidently changed the expression, for she looked her own -self, although a dying one. In the afternoon she asked for Arthur, -and we telegraphed for him. Quincey went off to meet him at the -station. - -When he arrived it was nearly six o'clock, and the sun was setting -full and warm, and the red light streamed in through the window and -gave more colour to the pale cheeks. When he saw her, Arthur was -simply choking with emotion, and none of us could speak. In the hours -that had passed, the fits of sleep, or the comatose condition that -passed for it, had grown more frequent, so that the pauses when -conversation was possible were shortened. Arthur's presence, however, -seemed to act as a stimulant. She rallied a little, and spoke to him -more brightly than she had done since we arrived. He too pulled -himself together, and spoke as cheerily as he could, so that the best -was made of everything. - -It is now nearly one o'clock, and he and Van Helsing are sitting with -her. I am to relieve them in a quarter of an hour, and I am entering -this on Lucy's phonograph. Until six o'clock they are to try to rest. -I fear that tomorrow will end our watching, for the shock has been too -great. The poor child cannot rally. God help us all. - - - - -LETTER MINA HARKER TO LUCY WESTENRA - -(Unopened by her) - -17 September - -My dearest Lucy, - -"It seems an age since I heard from you, or indeed since I -wrote. You will pardon me, I know, for all my faults when -you have read all my budget of news. Well, I got my husband back -all right. When we arrived at Exeter there was a carriage -waiting for us, and in it, though he had an attack of gout, Mr. -Hawkins. He took us to his house, where there were rooms for us -all nice and comfortable, and we dined together. After dinner -Mr. Hawkins said, - -"'My dears, I want to drink your health and prosperity, and -may every blessing attend you both. I know you both from -children, and have, with love and pride, seen you grow up. -Now I want you to make your home here with me. I have left -to me neither chick nor child. All are gone, and in my -will I have left you everything.' I cried, Lucy dear, as -Jonathan and the old man clasped hands. Our evening was a -very, very happy one. - -"So here we are, installed in this beautiful old house, and -from both my bedroom and the drawing room I can see the -great elms of the cathedral close, with their great black -stems standing out against the old yellow stone of the cathedral, -and I can hear the rooks overhead cawing and cawing and -chattering and chattering and gossiping all day, after the manner -of rooks--and humans. I am busy, I need not tell you, arranging -things and housekeeping. Jonathan and Mr. Hawkins are busy all -day, for now that Jonathan is a partner, Mr. Hawkins wants to -tell him all about the clients. - -"How is your dear mother getting on? I wish I could run up -to town for a day or two to see you, dear, but I dare not -go yet, with so much on my shoulders, and Jonathan wants -looking after still. He is beginning to put some flesh on -his bones again, but he was terribly weakened by the long -illness. Even now he sometimes starts out of his sleep in -a sudden way and awakes all trembling until I can coax him -back to his usual placidity. However, thank God, these -occasions grow less frequent as the days go on, and they -will in time pass away altogether, I trust. And now I have -told you my news, let me ask yours. When are you to be -married, and where, and who is to perform the ceremony, and -what are you to wear, and is it to be a public or private -wedding? Tell me all about it, dear, tell me all about -everything, for there is nothing which interests you which -will not be dear to me. Jonathan asks me to send his 'respectful -duty', but I do not think that is good enough from the junior -partner of the important firm Hawkins & Harker. And so, as you -love me, and he loves me, and I love you with all the moods and -tenses of the verb, I send you simply his 'love' instead. -Goodbye, my dearest Lucy, and blessings on you. - -"Yours, - -"Mina Harker" - - - -REPORT FROM PATRICK HENNESSEY, MD, MRCSLK, QCPI, ETC, ETC, -TO JOHN SEWARD, MD - -20 September - -My dear Sir: - -"In accordance with your wishes, I enclose report of the -conditions of everything left in my charge. With regard to -patient, Renfield, there is more to say. He has had another -outbreak, which might have had a dreadful ending, but which, as -it fortunately happened, was unattended with any unhappy results. -This afternoon a carrier's cart with two men made a call at the -empty house whose grounds abut on ours, the house to which, you -will remember, the patient twice ran away. The men stopped at -our gate to ask the porter their way, as they were strangers. - -"I was myself looking out of the study window, having a -smoke after dinner, and saw one of them come up to the -house. As he passed the window of Renfield's room, the -patient began to rate him from within, and called him all -the foul names he could lay his tongue to. The man, who -seemed a decent fellow enough, contented himself by telling -him to 'shut up for a foul-mouthed beggar', whereon our man -accused him of robbing him and wanting to murder him and -said that he would hinder him if he were to swing for it. -I opened the window and signed to the man not to notice, so -he contented himself after looking the place over and making up -his mind as to what kind of place he had got to by saying, 'Lor' -bless yer, sir, I wouldn't mind what was said to me in a bloomin' -madhouse. I pity ye and the guv'nor for havin' to live in the -house with a wild beast like that.' - -"Then he asked his way civilly enough, and I told him where -the gate of the empty house was. He went away followed by -threats and curses and revilings from our man. I went down -to see if I could make out any cause for his anger, since -he is usually such a well-behaved man, and except his violent -fits nothing of the kind had ever occurred. I found him, to my -astonishment, quite composed and most genial in his manner. I -tried to get him to talk of the incident, but he blandly asked me -questions as to what I meant, and led me to believe that he was -completely oblivious of the affair. It was, I am sorry to say, -however, only another instance of his cunning, for within half an -hour I heard of him again. This time he had broken out through -the window of his room, and was running down the avenue. I -called to the attendants to follow me, and ran after him, for I -feared he was intent on some mischief. My fear was justified -when I saw the same cart which had passed before coming down the -road, having on it some great wooden boxes. The men were wiping -their foreheads, and were flushed in the face, as if with violent -exercise. Before I could get up to him, the patient rushed at -them, and pulling one of them off the cart, began to knock his -head against the ground. If I had not seized him just at the -moment, I believe he would have killed the man there and then. -The other fellow jumped down and struck him over the head with -the butt end of his heavy whip. It was a horrible blow, but he -did not seem to mind it, but seized him also, and struggled with -the three of us, pulling us to and fro as if we were kittens. -You know I am no lightweight, and the others were both burly men. -At first he was silent in his fighting, but as we began to master -him, and the attendants were putting a strait waistcoat on him, -he began to shout, 'I'll frustrate them! They shan't rob me! -They shan't murder me by inches! I'll fight for my Lord and -Master!' and all sorts of similar incoherent ravings. It was -with very considerable difficulty that they got him back to the -house and put him in the padded room. One of the attendants, -Hardy, had a finger broken. However, I set it all right, and he -is going on well. - -"The two carriers were at first loud in their threats of -actions for damages, and promised to rain all the penalties -of the law on us. Their threats were, however, mingled -with some sort of indirect apology for the defeat of the -two of them by a feeble madman. They said that if it had -not been for the way their strength had been spent in carrying -and raising the heavy boxes to the cart they would have made -short work of him. They gave as another reason for their defeat -the extraordinary state of drouth to which they had been reduced -by the dusty nature of their occupation and the reprehensible -distance from the scene of their labors of any place of public -entertainment. I quite understood their drift, and after a stiff -glass of strong grog, or rather more of the same, and with each a -sovereign in hand, they made light of the attack, and swore that -they would encounter a worse madman any day for the pleasure of -meeting so 'bloomin' good a bloke' as your correspondent. I took -their names and addresses, in case they might be needed. They -are as follows: Jack Smollet, of Dudding's Rents, King George's -Road, Great Walworth, and Thomas Snelling, Peter Farley's Row, -Guide Court, Bethnal Green. They are both in the employment of -Harris & Sons, Moving and Shipment Company, Orange Master's Yard, -Soho. - -"I shall report to you any matter of interest occurring here, and -shall wire you at once if there is anything of importance. - -"Believe me, dear Sir, - -"Yours faithfully, - -"Patrick Hennessey." - - - -LETTER, MINA HARKER TO LUCY WESTENRA (Unopened by her) - -18 September - -"My dearest Lucy, - -"Such a sad blow has befallen us. Mr. Hawkins has died very -suddenly. Some may not think it so sad for us, but we had -both come to so love him that it really seems as though we -had lost a father. I never knew either father or mother, -so that the dear old man's death is a real blow to me. Jonathan -is greatly distressed. It is not only that he feels sorrow, deep -sorrow, for the dear, good man who has befriended him all his -life, and now at the end has treated him like his own son and -left him a fortune which to people of our modest bringing up is -wealth beyond the dream of avarice, but Jonathan feels it on -another account. He says the amount of responsibility which it -puts upon him makes him nervous. He begins to doubt himself. I -try to cheer him up, and my belief in him helps him to have a -belief in himself. But it is here that the grave shock that he -experienced tells upon him the most. Oh, it is too hard that a -sweet, simple, noble, strong nature such as his, a nature which -enabled him by our dear, good friend's aid to rise from clerk to -master in a few years, should be so injured that the very essence -of its strength is gone. Forgive me, dear, if I worry you with my -troubles in the midst of your own happiness, but Lucy dear, I -must tell someone, for the strain of keeping up a brave and -cheerful appearance to Jonathan tries me, and I have no one here -that I can confide in. I dread coming up to London, as we must -do that day after tomorrow, for poor Mr. Hawkins left in his will -that he was to be buried in the grave with his father. As there -are no relations at all, Jonathan will have to be chief mourner. -I shall try to run over to see you, dearest, if only for a few -minutes. Forgive me for troubling you. With all blessings, - -"Your loving - -"Mina Harker" - - - -DR. SEWARD'S DIARY - -20 September.--Only resolution and habit can let me make an entry -tonight. I am too miserable, too low spirited, too sick of the world -and all in it, including life itself, that I would not care if I heard -this moment the flapping of the wings of the angel of death. And he -has been flapping those grim wings to some purpose of late, Lucy's -mother and Arthur's father, and now . . . Let me get on with my work. - -I duly relieved Van Helsing in his watch over Lucy. We wanted Arthur -to go to rest also, but he refused at first. It was only when I told -him that we should want him to help us during the day, and that we -must not all break down for want of rest, lest Lucy should suffer, -that he agreed to go. - -Van Helsing was very kind to him. "Come, my child," he said. "Come -with me. You are sick and weak, and have had much sorrow and much -mental pain, as well as that tax on your strength that we know of. -You must not be alone, for to be alone is to be full of fears and -alarms. Come to the drawing room, where there is a big fire, and -there are two sofas. You shall lie on one, and I on the other, and -our sympathy will be comfort to each other, even though we do not -speak, and even if we sleep." - -Arthur went off with him, casting back a longing look on Lucy's face, -which lay in her pillow, almost whiter than the lawn. She lay quite -still, and I looked around the room to see that all was as it should -be. I could see that the Professor had carried out in this room, as -in the other, his purpose of using the garlic. The whole of the -window sashes reeked with it, and round Lucy's neck, over the silk -handkerchief which Van Helsing made her keep on, was a rough chaplet -of the same odorous flowers. - -Lucy was breathing somewhat stertorously, and her face was at its -worst, for the open mouth showed the pale gums. Her teeth, in the -dim, uncertain light, seemed longer and sharper than they had been in -the morning. In particular, by some trick of the light, the canine -teeth looked longer and sharper than the rest. - -I sat down beside her, and presently she moved uneasily. At the same -moment there came a sort of dull flapping or buffeting at the window. -I went over to it softly, and peeped out by the corner of the blind. -There was a full moonlight, and I could see that the noise was made by -a great bat, which wheeled around, doubtless attracted by the light, -although so dim, and every now and again struck the window with its -wings. When I came back to my seat, I found that Lucy had moved -slightly, and had torn away the garlic flowers from her throat. I -replaced them as well as I could, and sat watching her. - -Presently she woke, and I gave her food, as Van Helsing had -prescribed. She took but a little, and that languidly. There did not -seem to be with her now the unconscious struggle for life and strength -that had hitherto so marked her illness. It struck me as curious that -the moment she became conscious she pressed the garlic flowers close -to her. It was certainly odd that whenever she got into that -lethargic state, with the stertorous breathing, she put the flowers -from her, but that when she waked she clutched them close. There was -no possibility of making any mistake about this, for in the long hours -that followed, she had many spells of sleeping and waking and repeated -both actions many times. - -At six o'clock Van Helsing came to relieve me. Arthur had then fallen -into a doze, and he mercifully let him sleep on. When he saw Lucy's -face I could hear the hissing indraw of breath, and he said to me in a -sharp whisper. "Draw up the blind. I want light!" Then he bent down, -and, with his face almost touching Lucy's, examined her carefully. He -removed the flowers and lifted the silk handkerchief from her throat. -As he did so he started back and I could hear his ejaculation, "Mein -Gott!" as it was smothered in his throat. I bent over and looked, -too, and as I noticed some queer chill came over me. The wounds on -the throat had absolutely disappeared. - -For fully five minutes Van Helsing stood looking at her, with his face -at its sternest. Then he turned to me and said calmly, "She is -dying. It will not be long now. It will be much difference, mark me, -whether she dies conscious or in her sleep. Wake that poor boy, and -let him come and see the last. He trusts us, and we have promised -him." - -I went to the dining room and waked him. He was dazed for a moment, -but when he saw the sunlight streaming in through the edges of the -shutters he thought he was late, and expressed his fear. I assured -him that Lucy was still asleep, but told him as gently as I could that -both Van Helsing and I feared that the end was near. He covered his -face with his hands, and slid down on his knees by the sofa, where he -remained, perhaps a minute, with his head buried, praying, whilst his -shoulders shook with grief. I took him by the hand and raised him up. -"Come," I said, "my dear old fellow, summon all your fortitude. It -will be best and easiest for her." - -When we came into Lucy's room I could see that Van Helsing had, with -his usual forethought, been putting matters straight and making -everything look as pleasing as possible. He had even brushed Lucy's -hair, so that it lay on the pillow in its usual sunny ripples. When -we came into the room she opened her eyes, and seeing him, whispered -softly, "Arthur! Oh, my love, I am so glad you have come!" - -He was stooping to kiss her, when Van Helsing motioned him back. -"No," he whispered, "not yet! Hold her hand, it will comfort her -more." - -So Arthur took her hand and knelt beside her, and she looked her best, -with all the soft lines matching the angelic beauty of her eyes. Then -gradually her eyes closed, and she sank to sleep. For a little bit -her breast heaved softly, and her breath came and went like a tired -child's. - -And then insensibly there came the strange change which I had noticed -in the night. Her breathing grew stertorous, the mouth opened, and -the pale gums, drawn back, made the teeth look longer and sharper than -ever. In a sort of sleep-waking, vague, unconscious way she opened -her eyes, which were now dull and hard at once, and said in a soft, -voluptuous voice, such as I had never heard from her lips, "Arthur! -Oh, my love, I am so glad you have come! Kiss me!" - -Arthur bent eagerly over to kiss her, but at that instant Van Helsing, -who, like me, had been startled by her voice, swooped upon him, and -catching him by the neck with both hands, dragged him back with a fury -of strength which I never thought he could have possessed, and -actually hurled him almost across the room. - -"Not on your life!" he said, "not for your living soul and hers!" And -he stood between them like a lion at bay. - -Arthur was so taken aback that he did not for a moment know what to do -or say, and before any impulse of violence could seize him he realized -the place and the occasion, and stood silent, waiting. - -I kept my eyes fixed on Lucy, as did Van Helsing, and we saw a spasm -as of rage flit like a shadow over her face. The sharp teeth clamped -together. Then her eyes closed, and she breathed heavily. - -Very shortly after she opened her eyes in all their softness, and -putting out her poor, pale, thin hand, took Van Helsing's great brown -one, drawing it close to her, she kissed it. "My true friend," she -said, in a faint voice, but with untellable pathos, "My true friend, -and his! Oh, guard him, and give me peace!" - -"I swear it!" he said solemnly, kneeling beside her and holding up his -hand, as one who registers an oath. Then he turned to Arthur, and -said to him, "Come, my child, take her hand in yours, and kiss her on -the forehead, and only once." - -Their eyes met instead of their lips, and so they parted. Lucy's eyes -closed, and Van Helsing, who had been watching closely, took Arthur's -arm, and drew him away. - -And then Lucy's breathing became stertorous again, and all at once it -ceased. - -"It is all over," said Van Helsing. "She is dead!" - -I took Arthur by the arm, and led him away to the drawing room, where -he sat down, and covered his face with his hands, sobbing in a way -that nearly broke me down to see. - -I went back to the room, and found Van Helsing looking at poor Lucy, -and his face was sterner than ever. Some change had come over her -body. Death had given back part of her beauty, for her brow and -cheeks had recovered some of their flowing lines. Even the lips had -lost their deadly pallor. It was as if the blood, no longer needed -for the working of the heart, had gone to make the harshness of death -as little rude as might be. - -"We thought her dying whilst she slept, and sleeping when she died." - - -I stood beside Van Helsing, and said, "Ah well, poor girl, there is -peace for her at last. It is the end!" - -He turned to me, and said with grave solemnity, "Not so, alas! Not -so. It is only the beginning!" - -When I asked him what he meant, he only shook his head and answered, -"We can do nothing as yet. Wait and see." - - - - -CHAPTER 13 - - -DR. SEWARD'S DIARY--cont. - -The funeral was arranged for the next succeeding day, so that Lucy and -her mother might be buried together. I attended to all the ghastly -formalities, and the urbane undertaker proved that his staff was -afflicted, or blessed, with something of his own obsequious suavity. -Even the woman who performed the last offices for the dead remarked to -me, in a confidential, brother-professional way, when she had come out -from the death chamber, - -"She makes a very beautiful corpse, sir. It's quite a privilege to -attend on her. It's not too much to say that she will do credit to -our establishment!" - -I noticed that Van Helsing never kept far away. This was possible -from the disordered state of things in the household. There were no -relatives at hand, and as Arthur had to be back the next day to attend -at his father's funeral, we were unable to notify any one who should -have been bidden. Under the circumstances, Van Helsing and I took it -upon ourselves to examine papers, etc. He insisted upon looking over -Lucy's papers himself. I asked him why, for I feared that he, being a -foreigner, might not be quite aware of English legal requirements, and -so might in ignorance make some unnecessary trouble. - -He answered me, "I know, I know. You forget that I am a lawyer as -well as a doctor. But this is not altogether for the law. You knew -that, when you avoided the coroner. I have more than him to avoid. -There may be papers more, such as this." - -As he spoke he took from his pocket book the memorandum which had been -in Lucy's breast, and which she had torn in her sleep. - -"When you find anything of the solicitor who is for the late Mrs. -Westenra, seal all her papers, and write him tonight. For me, I watch -here in the room and in Miss Lucy's old room all night, and I myself -search for what may be. It is not well that her very thoughts go into -the hands of strangers." - -I went on with my part of the work, and in another half hour had found -the name and address of Mrs. Westenra's solicitor and had written to -him. All the poor lady's papers were in order. Explicit directions -regarding the place of burial were given. I had hardly sealed the -letter, when, to my surprise, Van Helsing walked into the room, -saying, - -"Can I help you friend John? I am free, and if I may, my service is -to you." - -"Have you got what you looked for?" I asked. - -To which he replied, "I did not look for any specific thing. I only -hoped to find, and find I have, all that there was, only some letters -and a few memoranda, and a diary new begun. But I have them here, and -we shall for the present say nothing of them. I shall see that poor -lad tomorrow evening, and, with his sanction, I shall use some." - -When we had finished the work in hand, he said to me, "And now, friend -John, I think we may to bed. We want sleep, both you and I, and rest -to recuperate. Tomorrow we shall have much to do, but for the tonight -there is no need of us. Alas!" - -Before turning in we went to look at poor Lucy. The undertaker had -certainly done his work well, for the room was turned into a small -chapelle ardente. There was a wilderness of beautiful white flowers, -and death was made as little repulsive as might be. The end of the -winding sheet was laid over the face. When the Professor bent over -and turned it gently back, we both started at the beauty before us. -The tall wax candles showing a sufficient light to note it well. All -Lucy's loveliness had come back to her in death, and the hours that -had passed, instead of leaving traces of 'decay's effacing fingers', -had but restored the beauty of life, till positively I could not -believe my eyes that I was looking at a corpse. - -The Professor looked sternly grave. He had not loved her as I had, -and there was no need for tears in his eyes. He said to me, "Remain -till I return," and left the room. He came back with a handful of -wild garlic from the box waiting in the hall, but which had not been -opened, and placed the flowers amongst the others on and around the -bed. Then he took from his neck, inside his collar, a little gold -crucifix, and placed it over the mouth. He restored the sheet to its -place, and we came away. - -I was undressing in my own room, when, with a premonitory tap at the -door, he entered, and at once began to speak. - -"Tomorrow I want you to bring me, before night, a set of post-mortem -knives." - -"Must we make an autopsy?" I asked. - -"Yes and no. I want to operate, but not what you think. Let me tell -you now, but not a word to another. I want to cut off her head and -take out her heart. Ah! You a surgeon, and so shocked! You, whom I -have seen with no tremble of hand or heart, do operations of life and -death that make the rest shudder. Oh, but I must not forget, my dear -friend John, that you loved her, and I have not forgotten it for is I -that shall operate, and you must not help. I would like to do it -tonight, but for Arthur I must not. He will be free after his -father's funeral tomorrow, and he will want to see her, to see it. -Then, when she is coffined ready for the next day, you and I shall -come when all sleep. We shall unscrew the coffin lid, and shall do -our operation, and then replace all, so that none know, save we -alone." - -"But why do it at all? The girl is dead. Why mutilate her poor body -without need? And if there is no necessity for a post-mortem and -nothing to gain by it, no good to her, to us, to science, to human -knowledge, why do it? Without such it is monstrous." - -For answer he put his hand on my shoulder, and said, with infinite -tenderness, "Friend John, I pity your poor bleeding heart, and I love -you the more because it does so bleed. If I could, I would take on -myself the burden that you do bear. But there are things that you -know not, but that you shall know, and bless me for knowing, though -they are not pleasant things. John, my child, you have been my friend -now many years, and yet did you ever know me to do any without good -cause? I may err, I am but man, but I believe in all I do. Was it -not for these causes that you send for me when the great trouble -came? Yes! Were you not amazed, nay horrified, when I would not let -Arthur kiss his love, though she was dying, and snatched him away by -all my strength? Yes! And yet you saw how she thanked me, with her -so beautiful dying eyes, her voice, too, so weak, and she kiss my -rough old hand and bless me? Yes! And did you not hear me swear -promise to her, that so she closed her eyes grateful? Yes! - -"Well, I have good reason now for all I want to do. You have for many -years trust me. You have believe me weeks past, when there be things -so strange that you might have well doubt. Believe me yet a little, -friend John. If you trust me not, then I must tell what I think, and -that is not perhaps well. And if I work, as work I shall, no matter -trust or no trust, without my friend trust in me, I work with heavy -heart and feel oh so lonely when I want all help and courage that may -be!" He paused a moment and went on solemnly, "Friend John, there are -strange and terrible days before us. Let us not be two, but one, that -so we work to a good end. Will you not have faith in me?" - -I took his hand, and promised him. I held my door open as he went -away, and watched him go to his room and close the door. As I stood -without moving, I saw one of the maids pass silently along the -passage, she had her back to me, so did not see me, and go into the -room where Lucy lay. The sight touched me. Devotion is so rare, and -we are so grateful to those who show it unasked to those we love. Here -was a poor girl putting aside the terrors which she naturally had of -death to go watch alone by the bier of the mistress whom she loved, so -that the poor clay might not be lonely till laid to eternal rest. - -I must have slept long and soundly, for it was broad daylight when Van -Helsing waked me by coming into my room. He came over to my bedside -and said, "You need not trouble about the knives. We shall not do -it." - -"Why not?" I asked. For his solemnity of the night before had -greatly impressed me. - -"Because," he said sternly, "it is too late, or too early. See!" -Here he held up the little golden crucifix. - -"This was stolen in the night." - -"How stolen," I asked in wonder, "since you have it now?" - -"Because I get it back from the worthless wretch who stole it, from -the woman who robbed the dead and the living. Her punishment will -surely come, but not through me. She knew not altogether what she -did, and thus unknowing, she only stole. Now we must wait." He went -away on the word, leaving me with a new mystery to think of, a new -puzzle to grapple with. - -The forenoon was a dreary time, but at noon the solicitor came, Mr. -Marquand, of Wholeman, Sons, Marquand & Lidderdale. He was very -genial and very appreciative of what we had done, and took off our -hands all cares as to details. During lunch he told us that Mrs. -Westenra had for some time expected sudden death from her heart, and -had put her affairs in absolute order. He informed us that, with the -exception of a certain entailed property of Lucy's father which now, -in default of direct issue, went back to a distant branch of the -family, the whole estate, real and personal, was left absolutely to -Arthur Holmwood. When he had told us so much he went on, - -"Frankly we did our best to prevent such a testamentary disposition, -and pointed out certain contingencies that might leave her daughter -either penniless or not so free as she should be to act regarding a -matrimonial alliance. Indeed, we pressed the matter so far that we -almost came into collision, for she asked us if we were or were not -prepared to carry out her wishes. Of course, we had then no -alternative but to accept. We were right in principle, and -ninety-nine times out of a hundred we should have proved, by the logic -of events, the accuracy of our judgment. - -"Frankly, however, I must admit that in this case any other form of -disposition would have rendered impossible the carrying out of her -wishes. For by her predeceasing her daughter the latter would have -come into possession of the property, and, even had she only survived -her mother by five minutes, her property would, in case there were no -will, and a will was a practical impossibility in such a case, have -been treated at her decease as under intestacy. In which case Lord -Godalming, though so dear a friend, would have had no claim in the -world. And the inheritors, being remote, would not be likely to -abandon their just rights, for sentimental reasons regarding an entire -stranger. I assure you, my dear sirs, I am rejoiced at the result, -perfectly rejoiced." - -He was a good fellow, but his rejoicing at the one little part, in -which he was officially interested, of so great a tragedy, was an -object-lesson in the limitations of sympathetic understanding. - -He did not remain long, but said he would look in later in the day and -see Lord Godalming. His coming, however, had been a certain comfort -to us, since it assured us that we should not have to dread hostile -criticism as to any of our acts. Arthur was expected at five o'clock, -so a little before that time we visited the death chamber. It was so -in very truth, for now both mother and daughter lay in it. The -undertaker, true to his craft, had made the best display he could of -his goods, and there was a mortuary air about the place that lowered -our spirits at once. - -Van Helsing ordered the former arrangement to be adhered to, -explaining that, as Lord Godalming was coming very soon, it would be -less harrowing to his feelings to see all that was left of his fiancee -quite alone. - -The undertaker seemed shocked at his own stupidity and exerted himself -to restore things to the condition in which we left them the night -before, so that when Arthur came such shocks to his feelings as we -could avoid were saved. - -Poor fellow! He looked desperately sad and broken. Even his stalwart -manhood seemed to have shrunk somewhat under the strain of his -much-tried emotions. He had, I knew, been very genuinely and -devotedly attached to his father, and to lose him, and at such a time, -was a bitter blow to him. With me he was warm as ever, and to Van -Helsing he was sweetly courteous. But I could not help seeing that -there was some constraint with him. The professor noticed it too, and -motioned me to bring him upstairs. I did so, and left him at the door -of the room, as I felt he would like to be quite alone with her, but -he took my arm and led me in, saying huskily, - -"You loved her too, old fellow. She told me all about it, and there -was no friend had a closer place in her heart than you. I don't know -how to thank you for all you have done for her. I can't think -yet . . ." - -Here he suddenly broke down, and threw his arms round my shoulders and -laid his head on my breast, crying, "Oh, Jack! Jack! What shall I -do? The whole of life seems gone from me all at once, and there is -nothing in the wide world for me to live for." - -I comforted him as well as I could. In such cases men do not need -much expression. A grip of the hand, the tightening of an arm over -the shoulder, a sob in unison, are expressions of sympathy dear to a -man's heart. I stood still and silent till his sobs died away, and -then I said softly to him, "Come and look at her." - -Together we moved over to the bed, and I lifted the lawn from her -face. God! How beautiful she was. Every hour seemed to be enhancing -her loveliness. It frightened and amazed me somewhat. And as for -Arthur, he fell to trembling, and finally was shaken with doubt as -with an ague. At last, after a long pause, he said to me in a faint -whisper, "Jack, is she really dead?" - -I assured him sadly that it was so, and went on to suggest, for I felt -that such a horrible doubt should not have life for a moment longer -than I could help, that it often happened that after death faces -become softened and even resolved into their youthful beauty, that -this was especially so when death had been preceded by any acute or -prolonged suffering. I seemed to quite do away with any doubt, and -after kneeling beside the couch for a while and looking at her -lovingly and long, he turned aside. I told him that that must be -goodbye, as the coffin had to be prepared, so he went back and took -her dead hand in his and kissed it, and bent over and kissed her -forehead. He came away, fondly looking back over his shoulder at her -as he came. - -I left him in the drawing room, and told Van Helsing that he had said -goodbye, so the latter went to the kitchen to tell the undertaker's -men to proceed with the preparations and to screw up the coffin. When -he came out of the room again I told him of Arthur's question, and he -replied, "I am not surprised. Just now I doubted for a moment -myself!" - -We all dined together, and I could see that poor Art was trying to -make the best of things. Van Helsing had been silent all dinner time, -but when we had lit our cigars he said, "Lord . . ." but Arthur -interrupted him. - -"No, no, not that, for God's sake! Not yet at any rate. Forgive me, -sir. I did not mean to speak offensively. It is only because my loss -is so recent." - -The Professor answered very sweetly, "I only used that name because I -was in doubt. I must not call you 'Mr.' and I have grown to love you, -yes, my dear boy, to love you, as Arthur." - -Arthur held out his hand, and took the old man's warmly. "Call me -what you will," he said. "I hope I may always have the title of a -friend. And let me say that I am at a loss for words to thank you for -your goodness to my poor dear." He paused a moment, and went on, "I -know that she understood your goodness even better than I do. And if -I was rude or in any way wanting at that time you acted so, you -remember"--the Professor nodded--"you must forgive me." - -He answered with a grave kindness, "I know it was hard for you to -quite trust me then, for to trust such violence needs to understand, -and I take it that you do not, that you cannot, trust me now, for you -do not yet understand. And there may be more times when I shall want -you to trust when you cannot, and may not, and must not yet -understand. But the time will come when your trust shall be whole and -complete in me, and when you shall understand as though the sunlight -himself shone through. Then you shall bless me from first to last for -your own sake, and for the sake of others, and for her dear sake to -whom I swore to protect." - -"And indeed, indeed, sir," said Arthur warmly. "I shall in all ways -trust you. I know and believe you have a very noble heart, and you -are Jack's friend, and you were hers. You shall do what you like." - -The Professor cleared his throat a couple of times, as though about to -speak, and finally said, "May I ask you something now?" - -"Certainly." - -"You know that Mrs. Westenra left you all her property?" - -"No, poor dear. I never thought of it." - -"And as it is all yours, you have a right to deal with it as you will. -I want you to give me permission to read all Miss Lucy's papers and -letters. Believe me, it is no idle curiosity. I have a motive of -which, be sure, she would have approved. I have them all here. I -took them before we knew that all was yours, so that no strange hand -might touch them, no strange eye look through words into her soul. I -shall keep them, if I may. Even you may not see them yet, but I shall -keep them safe. No word shall be lost, and in the good time I shall -give them back to you. It is a hard thing that I ask, but you will do -it, will you not, for Lucy's sake?" - -Arthur spoke out heartily, like his old self, "Dr. Van Helsing, you -may do what you will. I feel that in saying this I am doing what my -dear one would have approved. I shall not trouble you with questions -till the time comes." - -The old Professor stood up as he said solemnly, "And you are right. -There will be pain for us all, but it will not be all pain, nor will -this pain be the last. We and you too, you most of all, dear boy, -will have to pass through the bitter water before we reach the sweet. -But we must be brave of heart and unselfish, and do our duty, and all -will be well!" - -I slept on a sofa in Arthur's room that night. Van Helsing did not go -to bed at all. He went to and fro, as if patroling the house, and was -never out of sight of the room where Lucy lay in her coffin, strewn -with the wild garlic flowers, which sent through the odour of lily and -rose, a heavy, overpowering smell into the night. - - - - -MINA HARKER'S JOURNAL - -22 September.--In the train to Exeter. Jonathan sleeping. It seems -only yesterday that the last entry was made, and yet how much between -then, in Whitby and all the world before me, Jonathan away and no news -of him, and now, married to Jonathan, Jonathan a solicitor, a partner, -rich, master of his business, Mr. Hawkins dead and buried, and -Jonathan with another attack that may harm him. Some day he may ask -me about it. Down it all goes. I am rusty in my shorthand, see what -unexpected prosperity does for us, so it may be as well to freshen it -up again with an exercise anyhow. - -The service was very simple and very solemn. There were only -ourselves and the servants there, one or two old friends of his from -Exeter, his London agent, and a gentleman representing Sir John -Paxton, the President of the Incorporated Law Society. Jonathan and I -stood hand in hand, and we felt that our best and dearest friend was -gone from us. - -We came back to town quietly, taking a bus to Hyde Park Corner. -Jonathan thought it would interest me to go into the Row for a while, -so we sat down. But there were very few people there, and it was -sad-looking and desolate to see so many empty chairs. It made us -think of the empty chair at home. So we got up and walked down -Piccadilly. Jonathan was holding me by the arm, the way he used to in -the old days before I went to school. I felt it very improper, for -you can't go on for some years teaching etiquette and decorum to other -girls without the pedantry of it biting into yourself a bit. But it -was Jonathan, and he was my husband, and we didn't know anybody who -saw us, and we didn't care if they did, so on we walked. I was -looking at a very beautiful girl, in a big cart-wheel hat, sitting in -a victoria outside Guiliano's, when I felt Jonathan clutch my arm so -tight that he hurt me, and he said under his breath, "My God!" - -I am always anxious about Jonathan, for I fear that some nervous fit -may upset him again. So I turned to him quickly, and asked him what -it was that disturbed him. - -He was very pale, and his eyes seemed bulging out as, half in terror -and half in amazement, he gazed at a tall, thin man, with a beaky nose -and black moustache and pointed beard, who was also observing the -pretty girl. He was looking at her so hard that he did not see either -of us, and so I had a good view of him. His face was not a good -face. It was hard, and cruel, and sensual, and big white teeth, that -looked all the whiter because his lips were so red, were pointed like -an animal's. Jonathan kept staring at him, till I was afraid he would -notice. I feared he might take it ill, he looked so fierce and nasty. -I asked Jonathan why he was disturbed, and he answered, evidently -thinking that I knew as much about it as he did, "Do you see who it -is?" - -"No, dear," I said. "I don't know him, who is it?" His answer seemed -to shock and thrill me, for it was said as if he did not know that it -was me, Mina, to whom he was speaking. "It is the man himself!" - -The poor dear was evidently terrified at something, very greatly -terrified. I do believe that if he had not had me to lean on and to -support him he would have sunk down. He kept staring. A man came out -of the shop with a small parcel, and gave it to the lady, who then -drove off. The dark man kept his eyes fixed on her, and when the -carriage moved up Piccadilly he followed in the same direction, and -hailed a hansom. Jonathan kept looking after him, and said, as if to -himself, - -"I believe it is the Count, but he has grown young. My God, if this -be so! Oh, my God! My God! If only I knew! If only I knew!" He was -distressing himself so much that I feared to keep his mind on the -subject by asking him any questions, so I remained silent. I drew -away quietly, and he, holding my arm, came easily. We walked a little -further, and then went in and sat for a while in the Green Park. It -was a hot day for autumn, and there was a comfortable seat in a shady -place. After a few minutes' staring at nothing, Jonathan's eyes -closed, and he went quickly into a sleep, with his head on my -shoulder. I thought it was the best thing for him, so did not disturb -him. In about twenty minutes he woke up, and said to me quite -cheerfully, - -"Why, Mina, have I been asleep! Oh, do forgive me for being so rude. -Come, and we'll have a cup of tea somewhere." - -He had evidently forgotten all about the dark stranger, as in his -illness he had forgotten all that this episode had reminded him of. I -don't like this lapsing into forgetfulness. It may make or continue -some injury to the brain. I must not ask him, for fear I shall do -more harm than good, but I must somehow learn the facts of his journey -abroad. The time is come, I fear, when I must open the parcel, and -know what is written. Oh, Jonathan, you will, I know, forgive me if I -do wrong, but it is for your own dear sake. - - -Later.--A sad homecoming in every way, the house empty of the dear -soul who was so good to us. Jonathan still pale and dizzy under a -slight relapse of his malady, and now a telegram from Van Helsing, -whoever he may be. "You will be grieved to hear that Mrs. Westenra -died five days ago, and that Lucy died the day before yesterday. They -were both buried today." - -Oh, what a wealth of sorrow in a few words! Poor Mrs. Westenra! Poor -Lucy! Gone, gone, never to return to us! And poor, poor Arthur, to -have lost such a sweetness out of his life! God help us all to bear -our troubles. - - - -DR. SEWARD'S DIARY-CONT. - -22 September.--It is all over. Arthur has gone back to Ring, and has -taken Quincey Morris with him. What a fine fellow is Quincey! I -believe in my heart of hearts that he suffered as much about Lucy's -death as any of us, but he bore himself through it like a moral -Viking. If America can go on breeding men like that, she will be a -power in the world indeed. Van Helsing is lying down, having a rest -preparatory to his journey. He goes to Amsterdam tonight, but says he -returns tomorrow night, that he only wants to make some arrangements -which can only be made personally. He is to stop with me then, if he -can. He says he has work to do in London which may take him some -time. Poor old fellow! I fear that the strain of the past week has -broken down even his iron strength. All the time of the burial he -was, I could see, putting some terrible restraint on himself. When it -was all over, we were standing beside Arthur, who, poor fellow, was -speaking of his part in the operation where his blood had been -transfused to his Lucy's veins. I could see Van Helsing's face grow -white and purple by turns. Arthur was saying that he felt since then -as if they two had been really married, and that she was his wife in -the sight of God. None of us said a word of the other operations, and -none of us ever shall. Arthur and Quincey went away together to the -station, and Van Helsing and I came on here. The moment we were alone -in the carriage he gave way to a regular fit of hysterics. He has -denied to me since that it was hysterics, and insisted that it was -only his sense of humor asserting itself under very terrible -conditions. He laughed till he cried, and I had to draw down the -blinds lest any one should see us and misjudge. And then he cried, -till he laughed again, and laughed and cried together, just as a woman -does. I tried to be stern with him, as one is to a woman under the -circumstances, but it had no effect. Men and women are so different -in manifestations of nervous strength or weakness! Then when his face -grew grave and stern again I asked him why his mirth, and why at such -a time. His reply was in a way characteristic of him, for it was -logical and forceful and mysterious. He said, - -"Ah, you don't comprehend, friend John. Do not think that I am not -sad, though I laugh. See, I have cried even when the laugh did choke -me. But no more think that I am all sorry when I cry, for the laugh -he come just the same. Keep it always with you that laughter who -knock at your door and say, 'May I come in?' is not true laughter. -No! He is a king, and he come when and how he like. He ask no -person, he choose no time of suitability. He say, 'I am here.' -Behold, in example I grieve my heart out for that so sweet young -girl. I give my blood for her, though I am old and worn. I give my -time, my skill, my sleep. I let my other sufferers want that she may -have all. And yet I can laugh at her very grave, laugh when the clay -from the spade of the sexton drop upon her coffin and say 'Thud, -thud!' to my heart, till it send back the blood from my cheek. My -heart bleed for that poor boy, that dear boy, so of the age of mine -own boy had I been so blessed that he live, and with his hair and eyes -the same. - -"There, you know now why I love him so. And yet when he say things -that touch my husband-heart to the quick, and make my father-heart -yearn to him as to no other man, not even you, friend John, for we are -more level in experiences than father and son, yet even at such a -moment King Laugh he come to me and shout and bellow in my ear, 'Here I -am! Here I am!' till the blood come dance back and bring some of the -sunshine that he carry with him to my cheek. Oh, friend John, it is a -strange world, a sad world, a world full of miseries, and woes, and -troubles. And yet when King Laugh come, he make them all dance to the -tune he play. Bleeding hearts, and dry bones of the churchyard, and -tears that burn as they fall, all dance together to the music that he -make with that smileless mouth of him. And believe me, friend John, -that he is good to come, and kind. Ah, we men and women are like -ropes drawn tight with strain that pull us different ways. Then tears -come, and like the rain on the ropes, they brace us up, until perhaps -the strain become too great, and we break. But King Laugh he come -like the sunshine, and he ease off the strain again, and we bear to go -on with our labor, what it may be." - -I did not like to wound him by pretending not to see his idea, but as -I did not yet understand the cause of his laughter, I asked him. As -he answered me his face grew stern, and he said in quite a different -tone, - -"Oh, it was the grim irony of it all, this so lovely lady garlanded -with flowers, that looked so fair as life, till one by one we wondered -if she were truly dead, she laid in that so fine marble house in that -lonely churchyard, where rest so many of her kin, laid there with the -mother who loved her, and whom she loved, and that sacred bell going -'Toll! Toll! Toll!' so sad and slow, and those holy men, with the -white garments of the angel, pretending to read books, and yet all the -time their eyes never on the page, and all of us with the bowed head. -And all for what? She is dead, so! Is it not?" - -"Well, for the life of me, Professor," I said, "I can't see anything -to laugh at in all that. Why, your expression makes it a harder -puzzle than before. But even if the burial service was comic, what -about poor Art and his trouble? Why his heart was simply breaking." - -"Just so. Said he not that the transfusion of his blood to her veins -had made her truly his bride?" - -"Yes, and it was a sweet and comforting idea for him." - -"Quite so. But there was a difficulty, friend John. If so that, then -what about the others? Ho, ho! Then this so sweet maid is a -polyandrist, and me, with my poor wife dead to me, but alive by -Church's law, though no wits, all gone, even I, who am faithful -husband to this now-no-wife, am bigamist." - -"I don't see where the joke comes in there either!" I said, and I did -not feel particularly pleased with him for saying such things. He -laid his hand on my arm, and said, - -"Friend John, forgive me if I pain. I showed not my feeling to others -when it would wound, but only to you, my old friend, whom I can trust. -If you could have looked into my heart then when I want to laugh, if -you could have done so when the laugh arrived, if you could do so now, -when King Laugh have pack up his crown, and all that is to him, for he -go far, far away from me, and for a long, long time, maybe you would -perhaps pity me the most of all." - -I was touched by the tenderness of his tone, and asked why. - -"Because I know!" - -And now we are all scattered, and for many a long day loneliness will -sit over our roofs with brooding wings. Lucy lies in the tomb of her -kin, a lordly death house in a lonely churchyard, away from teeming -London, where the air is fresh, and the sun rises over Hampstead Hill, -and where wild flowers grow of their own accord. - -So I can finish this diary, and God only knows if I shall ever begin -another. If I do, or if I even open this again, it will be to deal -with different people and different themes, for here at the end, where -the romance of my life is told, ere I go back to take up the thread of -my life-work, I say sadly and without hope, "FINIS". - - - - -THE WESTMINSTER GAZETTE, 25 SEPTEMBER A HAMPSTEAD MYSTERY - -The neighborhood of Hampstead is just at present exercised -with a series of events which seem to run on lines parallel -to those of what was known to the writers of headlines as -"The Kensington Horror," or "The Stabbing Woman," or "The -Woman in Black." During the past two or three days several -cases have occurred of young children straying from home or -neglecting to return from their playing on the Heath. In -all these cases the children were too young to give any -properly intelligible account of themselves, but the -consensus of their excuses is that they had been with a -"bloofer lady." It has always been late in the evening when -they have been missed, and on two occasions the children -have not been found until early in the following morning. -It is generally supposed in the neighborhood that, as the -first child missed gave as his reason for being away that a -"bloofer lady" had asked him to come for a walk, the others -had picked up the phrase and used it as occasion served. This -is the more natural as the favourite game of the little ones -at present is luring each other away by wiles. A correspondent -writes us that to see some of the tiny tots pretending to be the -"bloofer lady" is supremely funny. Some of our caricaturists -might, he says, take a lesson in the irony of grotesque by -comparing the reality and the picture. It is only in accordance -with general principles of human nature that the "bloofer lady" -should be the popular role at these al fresco performances. Our -correspondent naively says that even Ellen Terry could not be so -winningly attractive as some of these grubby-faced little -children pretend, and even imagine themselves, to be. - -There is, however, possibly a serious side to the question, -for some of the children, indeed all who have been missed -at night, have been slightly torn or wounded in the throat. -The wounds seem such as might be made by a rat or a small -dog, and although of not much importance individually, would tend -to show that whatever animal inflicts them has a system or method -of its own. The police of the division have been instructed to -keep a sharp lookout for straying children, especially when very -young, in and around Hampstead Heath, and for any stray dog which -may be about. - - - - -THE WESTMINSTER GAZETTE, 25 SEPTEMBER EXTRA SPECIAL - -THE HAMPSTEAD HORROR - - -ANOTHER CHILD INJURED - -THE "BLOOFER LADY" - -We have just received intelligence that another child, -missed last night, was only discovered late in the morning -under a furze bush at the Shooter's Hill side of Hampstead -Heath, which is perhaps, less frequented than the other -parts. It has the same tiny wound in the throat as has -been noticed in other cases. It was terribly weak, and -looked quite emaciated. It too, when partially restored, -had the common story to tell of being lured away by the -"bloofer lady". - - - - -CHAPTER 14 - - -MINA HARKER'S JOURNAL - -23 September.--Jonathan is better after a bad night. I am so glad -that he has plenty of work to do, for that keeps his mind off the -terrible things, and oh, I am rejoiced that he is not now weighed down -with the responsibility of his new position. I knew he would be true -to himself, and now how proud I am to see my Jonathan rising to the -height of his advancement and keeping pace in all ways with the duties -that come upon him. He will be away all day till late, for he said he -could not lunch at home. My household work is done, so I shall take -his foreign journal, and lock myself up in my room and read it. - - -24 September.--I hadn't the heart to write last night, that terrible -record of Jonathan's upset me so. Poor dear! How he must have -suffered, whether it be true or only imagination. I wonder if there -is any truth in it at all. Did he get his brain fever, and then write -all those terrible things, or had he some cause for it all? I suppose -I shall never know, for I dare not open the subject to him. And yet -that man we saw yesterday! He seemed quite certain of him, poor -fellow! I suppose it was the funeral upset him and sent his mind back -on some train of thought. - -He believes it all himself. I remember how on our wedding day he said -"Unless some solemn duty come upon me to go back to the bitter hours, -asleep or awake, mad or sane . . ." There seems to be through it all -some thread of continuity. That fearful Count was coming to London. -If it should be, and he came to London, with its teeming millions . . . -There may be a solemn duty, and if it come we must not shrink from -it. I shall be prepared. I shall get my typewriter this very hour -and begin transcribing. Then we shall be ready for other eyes if -required. And if it be wanted, then, perhaps, if I am ready, poor -Jonathan may not be upset, for I can speak for him and never let him -be troubled or worried with it at all. If ever Jonathan quite gets -over the nervousness he may want to tell me of it all, and I can ask -him questions and find out things, and see how I may comfort him. - - - - -LETTER, VAN HELSING TO MRS. HARKER - -24 September - -(Confidence) - -"Dear Madam, - -"I pray you to pardon my writing, in that I am so far -friend as that I sent to you sad news of Miss Lucy -Westenra's death. By the kindness of Lord Godalming, I am -empowered to read her letters and papers, for I am deeply -concerned about certain matters vitally important. In them -I find some letters from you, which show how great friends -you were and how you love her. Oh, Madam Mina, by that -love, I implore you, help me. It is for others' good that -I ask, to redress great wrong, and to lift much and terrible -troubles, that may be more great than you can know. May it be -that I see you? You can trust me. I am friend of Dr. John -Seward and of Lord Godalming (that was Arthur of Miss Lucy). I -must keep it private for the present from all. I should come to -Exeter to see you at once if you tell me I am privilege to come, -and where and when. I implore your pardon, Madam. I have read -your letters to poor Lucy, and know how good you are and how your -husband suffer. So I pray you, if it may be, enlighten him not, -least it may harm. Again your pardon, and forgive me. - -"VAN HELSING" - - - - -TELEGRAM, MRS. HARKER TO VAN HELSING - -25 September.--Come today by quarter past ten train if you -can catch it. Can see you any time you call. - -"WILHELMINA HARKER" - - - - -MINA HARKER'S JOURNAL - -25 September.--I cannot help feeling terribly excited as the time -draws near for the visit of Dr. Van Helsing, for somehow I expect that -it will throw some light upon Jonathan's sad experience, and as he -attended poor dear Lucy in her last illness, he can tell me all about -her. That is the reason of his coming. It is concerning Lucy and her -sleep-walking, and not about Jonathan. Then I shall never know the -real truth now! How silly I am. That awful journal gets hold of my -imagination and tinges everything with something of its own colour. Of -course it is about Lucy. That habit came back to the poor dear, and -that awful night on the cliff must have made her ill. I had almost -forgotten in my own affairs how ill she was afterwards. She must have -told him of her sleep-walking adventure on the cliff, and that I knew -all about it, and now he wants me to tell him what I know, so that he -may understand. I hope I did right in not saying anything of it to -Mrs. Westenra. I should never forgive myself if any act of mine, were -it even a negative one, brought harm on poor dear Lucy. I hope too, -Dr. Van Helsing will not blame me. I have had so much trouble and -anxiety of late that I feel I cannot bear more just at present. - -I suppose a cry does us all good at times, clears the air as other -rain does. Perhaps it was reading the journal yesterday that upset -me, and then Jonathan went away this morning to stay away from me a -whole day and night, the first time we have been parted since our -marriage. I do hope the dear fellow will take care of himself, and -that nothing will occur to upset him. It is two o'clock, and the -doctor will be here soon now. I shall say nothing of Jonathan's -journal unless he asks me. I am so glad I have typewritten out my own -journal, so that, in case he asks about Lucy, I can hand it to him. -It will save much questioning. - -Later.--He has come and gone. Oh, what a strange meeting, and how it -all makes my head whirl round. I feel like one in a dream. Can it be -all possible, or even a part of it? If I had not read Jonathan's -journal first, I should never have accepted even a possibility. Poor, -poor, dear Jonathan! How he must have suffered. Please the good God, -all this may not upset him again. I shall try to save him from it. -But it may be even a consolation and a help to him, terrible though it -be and awful in its consequences, to know for certain that his eyes -and ears and brain did not deceive him, and that it is all true. It -may be that it is the doubt which haunts him, that when the doubt is -removed, no matter which, waking or dreaming, may prove the truth, he -will be more satisfied and better able to bear the shock. Dr. Van -Helsing must be a good man as well as a clever one if he is Arthur's -friend and Dr. Seward's, and if they brought him all the way from -Holland to look after Lucy. I feel from having seen him that he is -good and kind and of a noble nature. When he comes tomorrow I shall -ask him about Jonathan. And then, please God, all this sorrow and -anxiety may lead to a good end. I used to think I would like to -practice interviewing. Jonathan's friend on "The Exeter News" told -him that memory is everything in such work, that you must be able to -put down exactly almost every word spoken, even if you had to refine -some of it afterwards. Here was a rare interview. I shall try to -record it verbatim. - -It was half-past two o'clock when the knock came. I took my courage a -deux mains and waited. In a few minutes Mary opened the door, and -announced "Dr. Van Helsing". - -I rose and bowed, and he came towards me, a man of medium weight, -strongly built, with his shoulders set back over a broad, deep chest -and a neck well balanced on the trunk as the head is on the neck. The -poise of the head strikes me at once as indicative of thought and -power. The head is noble, well-sized, broad, and large behind the -ears. The face, clean-shaven, shows a hard, square chin, a large -resolute, mobile mouth, a good-sized nose, rather straight, but with -quick, sensitive nostrils, that seem to broaden as the big bushy brows -come down and the mouth tightens. The forehead is broad and fine, -rising at first almost straight and then sloping back above two bumps -or ridges wide apart, such a forehead that the reddish hair cannot -possibly tumble over it, but falls naturally back and to the sides. -Big, dark blue eyes are set widely apart, and are quick and tender or -stern with the man's moods. He said to me, - -"Mrs. Harker, is it not?" I bowed assent. - -"That was Miss Mina Murray?" Again I assented. - -"It is Mina Murray that I came to see that was friend of that poor dear -child Lucy Westenra. Madam Mina, it is on account of the dead that I -come." - -"Sir," I said, "you could have no better claim on me than that you -were a friend and helper of Lucy Westenra." And I held out my hand. -He took it and said tenderly, - -"Oh, Madam Mina, I know that the friend of that poor little girl must -be good, but I had yet to learn . . ." He finished his speech with a -courtly bow. I asked him what it was that he wanted to see me about, -so he at once began. - -"I have read your letters to Miss Lucy. Forgive me, but I had to -begin to inquire somewhere, and there was none to ask. I know that -you were with her at Whitby. She sometimes kept a diary, you need not -look surprised, Madam Mina. It was begun after you had left, and was -an imitation of you, and in that diary she traces by inference certain -things to a sleep-walking in which she puts down that you saved her. -In great perplexity then I come to you, and ask you out of your so -much kindness to tell me all of it that you can remember." - -"I can tell you, I think, Dr. Van Helsing, all about it." - -"Ah, then you have good memory for facts, for details? It is not -always so with young ladies." - -"No, doctor, but I wrote it all down at the time. I can show it to -you if you like." - -"Oh, Madam Mina, I well be grateful. You will do me much favour." - -I could not resist the temptation of mystifying him a bit, I suppose -it is some taste of the original apple that remains still in our -mouths, so I handed him the shorthand diary. He took it with a -grateful bow, and said, "May I read it?" - -"If you wish," I answered as demurely as I could. He opened it, and -for an instant his face fell. Then he stood up and bowed. - -"Oh, you so clever woman!" he said. "I knew long that Mr. Jonathan -was a man of much thankfulness, but see, his wife have all the good -things. And will you not so much honour me and so help me as to read -it for me? Alas! I know not the shorthand." - -By this time my little joke was over, and I was almost ashamed. So I -took the typewritten copy from my work basket and handed it to him. - -"Forgive me," I said. "I could not help it, but I had been thinking -that it was of dear Lucy that you wished to ask, and so that you might -not have time to wait, not on my account, but because I know your time -must be precious, I have written it out on the typewriter for you." - -He took it and his eyes glistened. "You are so good," he said. "And -may I read it now? I may want to ask you some things when I have -read." - -"By all means," I said, "read it over whilst I order lunch, and then -you can ask me questions whilst we eat." - -He bowed and settled himself in a chair with his back to the light, -and became so absorbed in the papers, whilst I went to see after lunch -chiefly in order that he might not be disturbed. When I came back, I -found him walking hurriedly up and down the room, his face all ablaze -with excitement. He rushed up to me and took me by both hands. - -"Oh, Madam Mina," he said, "how can I say what I owe to you? This -paper is as sunshine. It opens the gate to me. I am dazed, I am -dazzled, with so much light, and yet clouds roll in behind the light -every time. But that you do not, cannot comprehend. Oh, but I am -grateful to you, you so clever woman. Madame," he said this very -solemnly, "if ever Abraham Van Helsing can do anything for you or -yours, I trust you will let me know. It will be pleasure and delight -if I may serve you as a friend, as a friend, but all I have ever -learned, all I can ever do, shall be for you and those you love. There -are darknesses in life, and there are lights. You are one of the -lights. You will have a happy life and a good life, and your husband -will be blessed in you." - -"But, doctor, you praise me too much, and you do not know me." - -"Not know you, I, who am old, and who have studied all my life men and -women, I who have made my specialty the brain and all that belongs to -him and all that follow from him! And I have read your diary that you -have so goodly written for me, and which breathes out truth in every -line. I, who have read your so sweet letter to poor Lucy of your -marriage and your trust, not know you! Oh, Madam Mina, good women -tell all their lives, and by day and by hour and by minute, such -things that angels can read. And we men who wish to know have in us -something of angels' eyes. Your husband is noble nature, and you are -noble too, for you trust, and trust cannot be where there is mean -nature. And your husband, tell me of him. Is he quite well? Is all -that fever gone, and is he strong and hearty?" - -I saw here an opening to ask him about Jonathan, so I said, "He was -almost recovered, but he has been greatly upset by Mr. Hawkins death." - -He interrupted, "Oh, yes. I know. I know. I have read your last two -letters." - -I went on, "I suppose this upset him, for when we were in town on -Thursday last he had a sort of shock." - -"A shock, and after brain fever so soon! That is not good. What kind -of shock was it?" - -"He thought he saw some one who recalled something terrible, something -which led to his brain fever." And here the whole thing seemed to -overwhelm me in a rush. The pity for Jonathan, the horror which he -experienced, the whole fearful mystery of his diary, and the fear that -has been brooding over me ever since, all came in a tumult. I suppose -I was hysterical, for I threw myself on my knees and held up my hands -to him, and implored him to make my husband well again. He took my -hands and raised me up, and made me sit on the sofa, and sat by me. He -held my hand in his, and said to me with, oh, such infinite sweetness, - -"My life is a barren and lonely one, and so full of work that I have -not had much time for friendships, but since I have been summoned to -here by my friend John Seward I have known so many good people and -seen such nobility that I feel more than ever, and it has grown with -my advancing years, the loneliness of my life. Believe me, then, that -I come here full of respect for you, and you have given me hope, hope, -not in what I am seeking of, but that there are good women still left -to make life happy, good women, whose lives and whose truths may make -good lesson for the children that are to be. I am glad, glad, that I -may here be of some use to you. For if your husband suffer, he suffer -within the range of my study and experience. I promise you that I -will gladly do all for him that I can, all to make his life strong and -manly, and your life a happy one. Now you must eat. You are -overwrought and perhaps over-anxious. Husband Jonathan would not like -to see you so pale, and what he like not where he love, is not to his -good. Therefore for his sake you must eat and smile. You have told -me about Lucy, and so now we shall not speak of it, lest it distress. -I shall stay in Exeter tonight, for I want to think much over what you -have told me, and when I have thought I will ask you questions, if I -may. And then too, you will tell me of husband Jonathan's trouble so -far as you can, but not yet. You must eat now, afterwards you shall -tell me all." - -After lunch, when we went back to the drawing room, he said to me, -"And now tell me all about him." - -When it came to speaking to this great learned man, I began to fear -that he would think me a weak fool, and Jonathan a madman, that -journal is all so strange, and I hesitated to go on. But he was so -sweet and kind, and he had promised to help, and I trusted him, so I -said, - -"Dr. Van Helsing, what I have to tell you is so queer that you must -not laugh at me or at my husband. I have been since yesterday in a -sort of fever of doubt. You must be kind to me, and not think me -foolish that I have even half believed some very strange things." - -He reassured me by his manner as well as his words when he said, "Oh, -my dear, if you only know how strange is the matter regarding which I -am here, it is you who would laugh. I have learned not to think -little of any one's belief, no matter how strange it may be. I have -tried to keep an open mind, and it is not the ordinary things of life -that could close it, but the strange things, the extraordinary things, -the things that make one doubt if they be mad or sane." - -"Thank you, thank you a thousand times! You have taken a weight off my -mind. If you will let me, I shall give you a paper to read. It is -long, but I have typewritten it out. It will tell you my trouble and -Jonathan's. It is the copy of his journal when abroad, and all that -happened. I dare not say anything of it. You will read for yourself -and judge. And then when I see you, perhaps, you will be very kind -and tell me what you think." - -"I promise," he said as I gave him the papers. "I shall in the -morning, as soon as I can, come to see you and your husband, if I -may." - -"Jonathan will be here at half-past eleven, and you must come to lunch -with us and see him then. You could catch the quick 3:34 train, which -will leave you at Paddington before eight." He was surprised at my -knowledge of the trains offhand, but he does not know that I have made -up all the trains to and from Exeter, so that I may help Jonathan in -case he is in a hurry. - -So he took the papers with him and went away, and I sit here thinking, -thinking I don't know what. - - - - -LETTER (by hand), VAN HELSING TO MRS. HARKER - -25 September, 6 o'clock - -"Dear Madam Mina, - -"I have read your husband's so wonderful diary. You may -sleep without doubt. Strange and terrible as it is, it is -true! I will pledge my life on it. It may be worse for -others, but for him and you there is no dread. He is a -noble fellow, and let me tell you from experience of men, -that one who would do as he did in going down that wall and -to that room, aye, and going a second time, is not one to -be injured in permanence by a shock. His brain and his -heart are all right, this I swear, before I have even seen -him, so be at rest. I shall have much to ask him of other -things. I am blessed that today I come to see you, for I -have learn all at once so much that again I am dazzled, -dazzled more than ever, and I must think. - -"Yours the most faithful, - -"Abraham Van Helsing." - - -LETTER, MRS. HARKER TO VAN HELSING - -25 September, 6:30 P.M. - -"My dear Dr. Van Helsing, - -"A thousand thanks for your kind letter, which has taken a -great weight off my mind. And yet, if it be true, what -terrible things there are in the world, and what an awful -thing if that man, that monster, be really in London! I -fear to think. I have this moment, whilst writing, had a -wire from Jonathan, saying that he leaves by the 6:25 tonight -from Launceston and will be here at 10:18, so that I shall have -no fear tonight. Will you, therefore, instead of lunching with -us, please come to breakfast at eight o'clock, if this be not too -early for you? You can get away, if you are in a hurry, by the -10:30 train, which will bring you to Paddington by 2:35. Do not -answer this, as I shall take it that, if I do not hear, you will -come to breakfast. - -"Believe me, - -"Your faithful and grateful friend, - -"Mina Harker." - - - - - -JONATHAN HARKER'S JOURNAL - -26 September.--I thought never to write in this diary again, but the -time has come. When I got home last night Mina had supper ready, and -when we had supped she told me of Van Helsing's visit, and of her -having given him the two diaries copied out, and of how anxious she -has been about me. She showed me in the doctor's letter that all I -wrote down was true. It seems to have made a new man of me. It was -the doubt as to the reality of the whole thing that knocked me over. -I felt impotent, and in the dark, and distrustful. But, now that I -know, I am not afraid, even of the Count. He has succeeded after all, -then, in his design in getting to London, and it was he I saw. He has -got younger, and how? Van Helsing is the man to unmask him and hunt -him out, if he is anything like what Mina says. We sat late, and -talked it over. Mina is dressing, and I shall call at the hotel in a -few minutes and bring him over. - - -He was, I think, surprised to see me. When I came into the room where -he was, and introduced myself, he took me by the shoulder, and turned -my face round to the light, and said, after a sharp scrutiny, - -"But Madam Mina told me you were ill, that you had had a shock." - -It was so funny to hear my wife called 'Madam Mina' by this kindly, -strong-faced old man. I smiled, and said, "I was ill, I have had a -shock, but you have cured me already." - -"And how?" - -"By your letter to Mina last night. I was in doubt, and then -everything took a hue of unreality, and I did not know what to trust, -even the evidence of my own senses. Not knowing what to trust, I did -not know what to do, and so had only to keep on working in what had -hitherto been the groove of my life. The groove ceased to avail me, -and I mistrusted myself. Doctor, you don't know what it is to doubt -everything, even yourself. No, you don't, you couldn't with eyebrows -like yours." - -He seemed pleased, and laughed as he said, "So! You are a -physiognomist. I learn more here with each hour. I am with so much -pleasure coming to you to breakfast, and, oh, sir, you will pardon -praise from an old man, but you are blessed in your wife." - -I would listen to him go on praising Mina for a day, so I simply -nodded and stood silent. - -"She is one of God's women, fashioned by His own hand to show us men -and other women that there is a heaven where we can enter, and that -its light can be here on earth. So true, so sweet, so noble, so -little an egoist, and that, let me tell you, is much in this age, so -sceptical and selfish. And you, sir . . . I have read all the letters -to poor Miss Lucy, and some of them speak of you, so I know you since -some days from the knowing of others, but I have seen your true self -since last night. You will give me your hand, will you not? And let -us be friends for all our lives." - -We shook hands, and he was so earnest and so kind that it made me -quite choky. - -"And now," he said, "may I ask you for some more help? I have a great -task to do, and at the beginning it is to know. You can help me -here. Can you tell me what went before your going to Transylvania? -Later on I may ask more help, and of a different kind, but at first -this will do." - -"Look here, Sir," I said, "does what you have to do concern the -Count?" - -"It does," he said solemnly. - -"Then I am with you heart and soul. As you go by the 10:30 train, you -will not have time to read them, but I shall get the bundle of papers. -You can take them with you and read them in the train." - -After breakfast I saw him to the station. When we were parting he -said, "Perhaps you will come to town if I send for you, and take Madam -Mina too." - -"We shall both come when you will," I said. - -I had got him the morning papers and the London papers of the previous -night, and while we were talking at the carriage window, waiting for -the train to start, he was turning them over. His eyes suddenly -seemed to catch something in one of them, "The Westminster Gazette", I -knew it by the colour, and he grew quite white. He read something -intently, groaning to himself, "Mein Gott! Mein Gott! So soon! So -soon!" I do not think he remembered me at the moment. Just then the -whistle blew, and the train moved off. This recalled him to himself, -and he leaned out of the window and waved his hand, calling out, "Love -to Madam Mina. I shall write so soon as ever I can." - - - - -DR. SEWARD'S DIARY - -26 September.--Truly there is no such thing as finality. Not a week -since I said "Finis," and yet here I am starting fresh again, or -rather going on with the record. Until this afternoon I had no cause -to think of what is done. Renfield had become, to all intents, as -sane as he ever was. He was already well ahead with his fly business, -and he had just started in the spider line also, so he had not been of -any trouble to me. I had a letter from Arthur, written on Sunday, and -from it I gather that he is bearing up wonderfully well. Quincey -Morris is with him, and that is much of a help, for he himself is a -bubbling well of good spirits. Quincey wrote me a line too, and from -him I hear that Arthur is beginning to recover something of his old -buoyancy, so as to them all my mind is at rest. As for myself, I was -settling down to my work with the enthusiasm which I used to have for -it, so that I might fairly have said that the wound which poor Lucy -left on me was becoming cicatrised. - -Everything is, however, now reopened, and what is to be the end God -only knows. I have an idea that Van Helsing thinks he knows, too, but -he will only let out enough at a time to whet curiosity. He went to -Exeter yesterday, and stayed there all night. Today he came back, and -almost bounded into the room at about half-past five o'clock, and -thrust last night's "Westminster Gazette" into my hand. - -"What do you think of that?" he asked as he stood back and folded his -arms. - -I looked over the paper, for I really did not know what he meant, but -he took it from me and pointed out a paragraph about children being -decoyed away at Hampstead. It did not convey much to me, until I -reached a passage where it described small puncture wounds on their -throats. An idea struck me, and I looked up. - -"Well?" he said. - -"It is like poor Lucy's." - -"And what do you make of it?" - -"Simply that there is some cause in common. Whatever it was that -injured her has injured them." I did not quite understand his answer. - -"That is true indirectly, but not directly." - -"How do you mean, Professor?" I asked. I was a little inclined to -take his seriousness lightly, for, after all, four days of rest and -freedom from burning, harrowing, anxiety does help to restore one's -spirits, but when I saw his face, it sobered me. Never, even in the -midst of our despair about poor Lucy, had he looked more stern. - -"Tell me!" I said. "I can hazard no opinion. I do not know what to -think, and I have no data on which to found a conjecture." - -"Do you mean to tell me, friend John, that you have no suspicion as to -what poor Lucy died of, not after all the hints given, not only by -events, but by me?" - -"Of nervous prostration following a great loss or waste of blood." - -"And how was the blood lost or wasted?" I shook my head. - -He stepped over and sat down beside me, and went on, "You are a clever -man, friend John. You reason well, and your wit is bold, but you are -too prejudiced. You do not let your eyes see nor your ears hear, and -that which is outside your daily life is not of account to you. Do -you not think that there are things which you cannot understand, and -yet which are, that some people see things that others cannot? But -there are things old and new which must not be contemplated by men's -eyes, because they know, or think they know, some things which other -men have told them. Ah, it is the fault of our science that it wants -to explain all, and if it explain not, then it says there is nothing -to explain. But yet we see around us every day the growth of new -beliefs, which think themselves new, and which are yet but the old, -which pretend to be young, like the fine ladies at the opera. I -suppose now you do not believe in corporeal transference. No? Nor in -materialization. No? Nor in astral bodies. No? Nor in the reading -of thought. No? Nor in hypnotism . . ." - -"Yes," I said. "Charcot has proved that pretty well." - -He smiled as he went on, "Then you are satisfied as to it. Yes? And -of course then you understand how it act, and can follow the mind of -the great Charcot, alas that he is no more, into the very soul of the -patient that he influence. No? Then, friend John, am I to take it -that you simply accept fact, and are satisfied to let from premise to -conclusion be a blank? No? Then tell me, for I am a student of the -brain, how you accept hypnotism and reject the thought reading. Let -me tell you, my friend, that there are things done today in electrical -science which would have been deemed unholy by the very man who -discovered electricity, who would themselves not so long before been -burned as wizards. There are always mysteries in life. Why was it -that Methuselah lived nine hundred years, and 'Old Parr' one hundred -and sixty-nine, and yet that poor Lucy, with four men's blood in her -poor veins, could not live even one day? For, had she live one more -day, we could save her. Do you know all the mystery of life and -death? Do you know the altogether of comparative anatomy and can say -wherefore the qualities of brutes are in some men, and not in others? -Can you tell me why, when other spiders die small and soon, that one -great spider lived for centuries in the tower of the old Spanish -church and grew and grew, till, on descending, he could drink the oil -of all the church lamps? Can you tell me why in the Pampas, ay and -elsewhere, there are bats that come out at night and open the veins of -cattle and horses and suck dry their veins, how in some islands of the -Western seas there are bats which hang on the trees all day, and those -who have seen describe as like giant nuts or pods, and that when the -sailors sleep on the deck, because that it is hot, flit down on them -and then, and then in the morning are found dead men, white as even -Miss Lucy was?" - -"Good God, Professor!" I said, starting up. "Do you mean to tell me -that Lucy was bitten by such a bat, and that such a thing is here in -London in the nineteenth century?" - -He waved his hand for silence, and went on, "Can you tell me why the -tortoise lives more long than generations of men, why the elephant -goes on and on till he have sees dynasties, and why the parrot never -die only of bite of cat of dog or other complaint? Can you tell me -why men believe in all ages and places that there are men and women -who cannot die? We all know, because science has vouched for the -fact, that there have been toads shut up in rocks for thousands of -years, shut in one so small hole that only hold him since the youth of -the world. Can you tell me how the Indian fakir can make himself to -die and have been buried, and his grave sealed and corn sowed on it, -and the corn reaped and be cut and sown and reaped and cut again, and -then men come and take away the unbroken seal and that there lie the -Indian fakir, not dead, but that rise up and walk amongst them as -before?" - -Here I interrupted him. I was getting bewildered. He so crowded on -my mind his list of nature's eccentricities and possible -impossibilities that my imagination was getting fired. I had a dim -idea that he was teaching me some lesson, as long ago he used to do in -his study at Amsterdam. But he used them to tell me the thing, so -that I could have the object of thought in mind all the time. But now -I was without his help, yet I wanted to follow him, so I said, - -"Professor, let me be your pet student again. Tell me the thesis, so -that I may apply your knowledge as you go on. At present I am going -in my mind from point to point as a madman, and not a sane one, -follows an idea. I feel like a novice lumbering through a bog in a -midst, jumping from one tussock to another in the mere blind effort to -move on without knowing where I am going." - -"That is a good image," he said. "Well, I shall tell you. My thesis -is this, I want you to believe." - -"To believe what?" - -"To believe in things that you cannot. Let me illustrate. I heard -once of an American who so defined faith, 'that faculty which enables -us to believe things which we know to be untrue.' For one, I follow -that man. He meant that we shall have an open mind, and not let a -little bit of truth check the rush of the big truth, like a small rock -does a railway truck. We get the small truth first. Good! We keep -him, and we value him, but all the same we must not let him think -himself all the truth in the universe." - -"Then you want me not to let some previous conviction inure the -receptivity of my mind with regard to some strange matter. Do I read -your lesson aright?" - -"Ah, you are my favourite pupil still. It is worth to teach you. Now -that you are willing to understand, you have taken the first step to -understand. You think then that those so small holes in the -children's throats were made by the same that made the holes in Miss -Lucy?" - -"I suppose so." - -He stood up and said solemnly, "Then you are wrong. Oh, would it were -so! But alas! No. It is worse, far, far worse." - -"In God's name, Professor Van Helsing, what do you mean?" I cried. - -He threw himself with a despairing gesture into a chair, and placed -his elbows on the table, covering his face with his hands as he spoke. - -"They were made by Miss Lucy!" - - - - -CHAPTER 15 - - -DR. SEWARD'S DIARY--cont. - -For a while sheer anger mastered me. It was as if he had during her -life struck Lucy on the face. I smote the table hard and rose up as I -said to him, "Dr. Van Helsing, are you mad?" - -He raised his head and looked at me, and somehow the tenderness of his -face calmed me at once. "Would I were!" he said. "Madness were easy -to bear compared with truth like this. Oh, my friend, why, think -you, did I go so far round, why take so long to tell so simple a -thing? Was it because I hate you and have hated you all my life? Was -it because I wished to give you pain? Was it that I wanted, now so -late, revenge for that time when you saved my life, and from a fearful -death? Ah no!" - -"Forgive me," said I. - -He went on, "My friend, it was because I wished to be gentle in the -breaking to you, for I know you have loved that so sweet lady. But -even yet I do not expect you to believe. It is so hard to accept at -once any abstract truth, that we may doubt such to be possible when we -have always believed the 'no' of it. It is more hard still to accept -so sad a concrete truth, and of such a one as Miss Lucy. Tonight I go -to prove it. Dare you come with me?" - -This staggered me. A man does not like to prove such a truth, Byron -excepted from the category, jealousy. - - "And prove the very truth he most abhorred." - -He saw my hesitation, and spoke, "The logic is simple, no madman's -logic this time, jumping from tussock to tussock in a misty bog. If -it not be true, then proof will be relief. At worst it will not harm. -If it be true! Ah, there is the dread. Yet every dread should help my -cause, for in it is some need of belief. Come, I tell you what I -propose. First, that we go off now and see that child in the -hospital. Dr. Vincent, of the North Hospital, where the papers say -the child is, is a friend of mine, and I think of yours since you were -in class at Amsterdam. He will let two scientists see his case, if he -will not let two friends. We shall tell him nothing, but only that we -wish to learn. And then . . ." - -"And then?" - -He took a key from his pocket and held it up. "And then we spend the -night, you and I, in the churchyard where Lucy lies. This is the key -that lock the tomb. I had it from the coffin man to give to Arthur." - -My heart sank within me, for I felt that there was some fearful ordeal -before us. I could do nothing, however, so I plucked up what heart I -could and said that we had better hasten, as the afternoon was -passing. - -We found the child awake. It had had a sleep and taken some food, and -altogether was going on well. Dr. Vincent took the bandage from its -throat, and showed us the punctures. There was no mistaking the -similarity to those which had been on Lucy's throat. They were -smaller, and the edges looked fresher, that was all. We asked Vincent -to what he attributed them, and he replied that it must have been a -bite of some animal, perhaps a rat, but for his own part, he was -inclined to think it was one of the bats which are so numerous on the -northern heights of London. "Out of so many harmless ones," he said, -"there may be some wild specimen from the South of a more malignant -species. Some sailor may have brought one home, and it managed to -escape, or even from the Zoological Gardens a young one may have got -loose, or one be bred there from a vampire. These things do occur, -you, know. Only ten days ago a wolf got out, and was, I believe, -traced up in this direction. For a week after, the children were -playing nothing but Red Riding Hood on the Heath and in every alley in -the place until this 'bloofer lady' scare came along, since then it -has been quite a gala time with them. Even this poor little mite, -when he woke up today, asked the nurse if he might go away. When she -asked him why he wanted to go, he said he wanted to play with the -'bloofer lady'." - -"I hope," said Van Helsing, "that when you are sending the child home -you will caution its parents to keep strict watch over it. These -fancies to stray are most dangerous, and if the child were to remain -out another night, it would probably be fatal. But in any case I -suppose you will not let it away for some days?" - -"Certainly not, not for a week at least, longer if the wound is not -healed." - -Our visit to the hospital took more time than we had reckoned on, and -the sun had dipped before we came out. When Van Helsing saw how dark -it was, he said, - -"There is not hurry. It is more late than I thought. Come, let us -seek somewhere that we may eat, and then we shall go on our way." - -We dined at 'Jack Straw's Castle' along with a little crowd of -bicyclists and others who were genially noisy. About ten o'clock we -started from the inn. It was then very dark, and the scattered lamps -made the darkness greater when we were once outside their individual -radius. The Professor had evidently noted the road we were to go, for -he went on unhesitatingly, but, as for me, I was in quite a mixup as -to locality. As we went further, we met fewer and fewer people, till -at last we were somewhat surprised when we met even the patrol of -horse police going their usual suburban round. At last we reached the -wall of the churchyard, which we climbed over. With some little -difficulty, for it was very dark, and the whole place seemed so -strange to us, we found the Westenra tomb. The Professor took the -key, opened the creaky door, and standing back, politely, but quite -unconsciously, motioned me to precede him. There was a delicious -irony in the offer, in the courtliness of giving preference on such a -ghastly occasion. My companion followed me quickly, and cautiously -drew the door to, after carefully ascertaining that the lock was a -falling, and not a spring one. In the latter case we should have been -in a bad plight. Then he fumbled in his bag, and taking out a -matchbox and a piece of candle, proceeded to make a light. The tomb -in the daytime, and when wreathed with fresh flowers, had looked grim -and gruesome enough, but now, some days afterwards, when the flowers -hung lank and dead, their whites turning to rust and their greens to -browns, when the spider and the beetle had resumed their accustomed -dominance, when the time-discoloured stone, and dust-encrusted mortar, -and rusty, dank iron, and tarnished brass, and clouded silver-plating -gave back the feeble glimmer of a candle, the effect was more -miserable and sordid than could have been imagined. It conveyed -irresistibly the idea that life, animal life, was not the only thing -which could pass away. - -Van Helsing went about his work systematically. Holding his candle so -that he could read the coffin plates, and so holding it that the sperm -dropped in white patches which congealed as they touched the metal, he -made assurance of Lucy's coffin. Another search in his bag, and he -took out a turnscrew. - -"What are you going to do?" I asked. - -"To open the coffin. You shall yet be convinced." - -Straightway he began taking out the screws, and finally lifted off the -lid, showing the casing of lead beneath. The sight was almost too -much for me. It seemed to be as much an affront to the dead as it -would have been to have stripped off her clothing in her sleep whilst -living. I actually took hold of his hand to stop him. - -He only said, "You shall see," and again fumbling in his bag took out -a tiny fret saw. Striking the turnscrew through the lead with a swift -downward stab, which made me wince, he made a small hole, which was, -however, big enough to admit the point of the saw. I had expected a -rush of gas from the week-old corpse. We doctors, who have had to -study our dangers, have to become accustomed to such things, and I -drew back towards the door. But the Professor never stopped for a -moment. He sawed down a couple of feet along one side of the lead -coffin, and then across, and down the other side. Taking the edge of -the loose flange, he bent it back towards the foot of the coffin, and -holding up the candle into the aperture, motioned to me to look. - -I drew near and looked. The coffin was empty. It was certainly a -surprise to me, and gave me a considerable shock, but Van Helsing was -unmoved. He was now more sure than ever of his ground, and so -emboldened to proceed in his task. "Are you satisfied now, friend -John?" he asked. - -I felt all the dogged argumentativeness of my nature awake within me as -I answered him, "I am satisfied that Lucy's body is not in that -coffin, but that only proves one thing." - -"And what is that, friend John?" - -"That it is not there." - -"That is good logic," he said, "so far as it goes. But how do you, -how can you, account for it not being there?" - -"Perhaps a body-snatcher," I suggested. "Some of the undertaker's -people may have stolen it." I felt that I was speaking folly, and yet -it was the only real cause which I could suggest. - -The Professor sighed. "Ah well!" he said, "we must have more proof. -Come with me." - -He put on the coffin lid again, gathered up all his things and placed -them in the bag, blew out the light, and placed the candle also in the -bag. We opened the door, and went out. Behind us he closed the door -and locked it. He handed me the key, saying, "Will you keep it? You -had better be assured." - -I laughed, it was not a very cheerful laugh, I am bound to say, as I -motioned him to keep it. "A key is nothing," I said, "there are many -duplicates, and anyhow it is not difficult to pick a lock of this -kind." - -He said nothing, but put the key in his pocket. Then he told me to -watch at one side of the churchyard whilst he would watch at the -other. - -I took up my place behind a yew tree, and I saw his dark figure move -until the intervening headstones and trees hid it from my sight. - -It was a lonely vigil. Just after I had taken my place I heard a -distant clock strike twelve, and in time came one and two. I was -chilled and unnerved, and angry with the Professor for taking me on -such an errand and with myself for coming. I was too cold and too -sleepy to be keenly observant, and not sleepy enough to betray my -trust, so altogether I had a dreary, miserable time. - -Suddenly, as I turned round, I thought I saw something like a white -streak, moving between two dark yew trees at the side of the -churchyard farthest from the tomb. At the same time a dark mass moved -from the Professor's side of the ground, and hurriedly went towards -it. Then I too moved, but I had to go round headstones and railed-off -tombs, and I stumbled over graves. The sky was overcast, and -somewhere far off an early cock crew. A little ways off, beyond a -line of scattered juniper trees, which marked the pathway to the -church, a white dim figure flitted in the direction of the tomb. The -tomb itself was hidden by trees, and I could not see where the figure -had disappeared. I heard the rustle of actual movement where I had -first seen the white figure, and coming over, found the Professor -holding in his arms a tiny child. When he saw me he held it out to -me, and said, "Are you satisfied now?" - -"No," I said, in a way that I felt was aggressive. - -"Do you not see the child?" - -"Yes, it is a child, but who brought it here? And is it wounded?" - -"We shall see," said the Professor, and with one impulse we took our -way out of the churchyard, he carrying the sleeping child. - -When we had got some little distance away, we went into a clump of -trees, and struck a match, and looked at the child's throat. It was -without a scratch or scar of any kind. - -"Was I right?" I asked triumphantly. - -"We were just in time," said the Professor thankfully. - -We had now to decide what we were to do with the child, and so -consulted about it. If we were to take it to a police station we -should have to give some account of our movements during the night. -At least, we should have had to make some statement as to how we had -come to find the child. So finally we decided that we would take it -to the Heath, and when we heard a policeman coming, would leave it -where he could not fail to find it. We would then seek our way home -as quickly as we could. All fell out well. At the edge of Hampstead -Heath we heard a policeman's heavy tramp, and laying the child on the -pathway, we waited and watched until he saw it as he flashed his -lantern to and fro. We heard his exclamation of astonishment, and -then we went away silently. By good chance we got a cab near the -'Spainiards,' and drove to town. - -I cannot sleep, so I make this entry. But I must try to get a few -hours' sleep, as Van Helsing is to call for me at noon. He insists -that I go with him on another expedition. - - -27 September.--It was two o'clock before we found a suitable -opportunity for our attempt. The funeral held at noon was all -completed, and the last stragglers of the mourners had taken -themselves lazily away, when, looking carefully from behind a clump of -alder trees, we saw the sexton lock the gate after him. We knew that -we were safe till morning did we desire it, but the Professor told me -that we should not want more than an hour at most. Again I felt that -horrid sense of the reality of things, in which any effort of -imagination seemed out of place, and I realized distinctly the perils -of the law which we were incurring in our unhallowed work. Besides, I -felt it was all so useless. Outrageous as it was to open a leaden -coffin, to see if a woman dead nearly a week were really dead, it now -seemed the height of folly to open the tomb again, when we knew, from -the evidence of our own eyesight, that the coffin was empty. I -shrugged my shoulders, however, and rested silent, for Van Helsing had -a way of going on his own road, no matter who remonstrated. He took -the key, opened the vault, and again courteously motioned me to -precede. The place was not so gruesome as last night, but oh, how -unutterably mean looking when the sunshine streamed in. Van Helsing -walked over to Lucy's coffin, and I followed. He bent over and again -forced back the leaden flange, and a shock of surprise and dismay shot -through me. - -There lay Lucy, seemingly just as we had seen her the night before her -funeral. She was, if possible, more radiantly beautiful than ever, -and I could not believe that she was dead. The lips were red, nay -redder than before, and on the cheeks was a delicate bloom. - -"Is this a juggle?" I said to him. - -"Are you convinced now?" said the Professor, in response, and as he -spoke he put over his hand, and in a way that made me shudder, pulled -back the dead lips and showed the white teeth. "See," he went on, -"they are even sharper than before. With this and this," and he -touched one of the canine teeth and that below it, "the little -children can be bitten. Are you of belief now, friend John?" - -Once more argumentative hostility woke within me. I could not accept -such an overwhelming idea as he suggested. So, with an attempt to -argue of which I was even at the moment ashamed, I said, "She may have -been placed here since last night." - -"Indeed? That is so, and by whom?" - -"I do not know. Someone has done it." - -"And yet she has been dead one week. Most peoples in that time would -not look so." - -I had no answer for this, so was silent. Van Helsing did not seem to -notice my silence. At any rate, he showed neither chagrin nor -triumph. He was looking intently at the face of the dead woman, -raising the eyelids and looking at the eyes, and once more opening the -lips and examining the teeth. Then he turned to me and said, - -"Here, there is one thing which is different from all recorded. Here -is some dual life that is not as the common. She was bitten by the -vampire when she was in a trance, sleep-walking, oh, you start. You -do not know that, friend John, but you shall know it later, and in -trance could he best come to take more blood. In trance she dies, and -in trance she is UnDead, too. So it is that she differ from all -other. Usually when the UnDead sleep at home," as he spoke he made a -comprehensive sweep of his arm to designate what to a vampire was -'home', "their face show what they are, but this so sweet that was -when she not UnDead she go back to the nothings of the common dead. -There is no malign there, see, and so it make hard that I must kill -her in her sleep." - -This turned my blood cold, and it began to dawn upon me that I was -accepting Van Helsing's theories. But if she were really dead, what -was there of terror in the idea of killing her? - -He looked up at me, and evidently saw the change in my face, for he -said almost joyously, "Ah, you believe now?" - -I answered, "Do not press me too hard all at once. I am willing to -accept. How will you do this bloody work?" - -"I shall cut off her head and fill her mouth with garlic, and I shall -drive a stake through her body." - -It made me shudder to think of so mutilating the body of the woman -whom I had loved. And yet the feeling was not so strong as I had -expected. I was, in fact, beginning to shudder at the presence of -this being, this UnDead, as Van Helsing called it, and to loathe it. -Is it possible that love is all subjective, or all objective? - -I waited a considerable time for Van Helsing to begin, but he stood as -if wrapped in thought. Presently he closed the catch of his bag with -a snap, and said, - -"I have been thinking, and have made up my mind as to what is best. -If I did simply follow my inclining I would do now, at this moment, -what is to be done. But there are other things to follow, and things -that are thousand times more difficult in that them we do not know. -This is simple. She have yet no life taken, though that is of time, -and to act now would be to take danger from her forever. But then we -may have to want Arthur, and how shall we tell him of this? If you, -who saw the wounds on Lucy's throat, and saw the wounds so similar on -the child's at the hospital, if you, who saw the coffin empty last -night and full today with a woman who have not change only to be more -rose and more beautiful in a whole week, after she die, if you know of -this and know of the white figure last night that brought the child to -the churchyard, and yet of your own senses you did not believe, how -then, can I expect Arthur, who know none of those things, to believe? - -"He doubted me when I took him from her kiss when she was dying. I -know he has forgiven me because in some mistaken idea I have done -things that prevent him say goodbye as he ought, and he may think that -in some more mistaken idea this woman was buried alive, and that in -most mistake of all we have killed her. He will then argue back that -it is we, mistaken ones, that have killed her by our ideas, and so he -will be much unhappy always. Yet he never can be sure, and that is -the worst of all. And he will sometimes think that she he loved was -buried alive, and that will paint his dreams with horrors of what she -must have suffered, and again, he will think that we may be right, and -that his so beloved was, after all, an UnDead. No! I told him once, -and since then I learn much. Now, since I know it is all true, a -hundred thousand times more do I know that he must pass through the -bitter waters to reach the sweet. He, poor fellow, must have one hour -that will make the very face of heaven grow black to him, then we can -act for good all round and send him peace. My mind is made up. Let -us go. You return home for tonight to your asylum, and see that all -be well. As for me, I shall spend the night here in this churchyard -in my own way. Tomorrow night you will come to me to the Berkeley -Hotel at ten of the clock. I shall send for Arthur to come too, and -also that so fine young man of America that gave his blood. Later we -shall all have work to do. I come with you so far as Piccadilly and -there dine, for I must be back here before the sun set." - -So we locked the tomb and came away, and got over the wall of the -churchyard, which was not much of a task, and drove back to -Piccadilly. - - - - -NOTE LEFT BY VAN HELSING IN HIS PORTMANTEAU, BERKELEY HOTEL DIRECTED TO -JOHN SEWARD, M. D. (Not Delivered) - -27 September - -"Friend John, - -"I write this in case anything should happen. I go alone to -watch in that churchyard. It pleases me that the UnDead, -Miss Lucy, shall not leave tonight, that so on the morrow -night she may be more eager. Therefore I shall fix some -things she like not, garlic and a crucifix, and so seal up -the door of the tomb. She is young as UnDead, and will -heed. Moreover, these are only to prevent her coming out. -They may not prevail on her wanting to get in, for then the -UnDead is desperate, and must find the line of least resistance, -whatsoever it may be. I shall be at hand all the night from -sunset till after sunrise, and if there be aught that may be -learned I shall learn it. For Miss Lucy or from her, I have no -fear, but that other to whom is there that she is UnDead, he have -not the power to seek her tomb and find shelter. He is cunning, -as I know from Mr. Jonathan and from the way that all along he -have fooled us when he played with us for Miss Lucy's life, and -we lost, and in many ways the UnDead are strong. He have always -the strength in his hand of twenty men, even we four who gave our -strength to Miss Lucy it also is all to him. Besides, he can -summon his wolf and I know not what. So if it be that he came -thither on this night he shall find me. But none other shall, -until it be too late. But it may be that he will not attempt the -place. There is no reason why he should. His hunting ground is -more full of game than the churchyard where the UnDead woman -sleeps, and the one old man watch. - -"Therefore I write this in case . . . Take the papers that -are with this, the diaries of Harker and the rest, and read -them, and then find this great UnDead, and cut off his head -and burn his heart or drive a stake through it, so that the -world may rest from him. - -"If it be so, farewell. - -"VAN HELSING." - - - - -DR. SEWARD'S DIARY - -28 September.--It is wonderful what a good night's sleep will do for -one. Yesterday I was almost willing to accept Van Helsing's monstrous -ideas, but now they seem to start out lurid before me as outrages on -common sense. I have no doubt that he believes it all. I wonder if -his mind can have become in any way unhinged. Surely there must be -some rational explanation of all these mysterious things. Is it -possible that the Professor can have done it himself? He is so -abnormally clever that if he went off his head he would carry out his -intent with regard to some fixed idea in a wonderful way. I am loathe -to think it, and indeed it would be almost as great a marvel as the -other to find that Van Helsing was mad, but anyhow I shall watch him -carefully. I may get some light on the mystery. - - -29 September.--Last night, at a little before ten o'clock, Arthur and -Quincey came into Van Helsing's room. He told us all what he wanted -us to do, but especially addressing himself to Arthur, as if all our -wills were centred in his. He began by saying that he hoped we would -all come with him too, "for," he said, "there is a grave duty to be -done there. You were doubtless surprised at my letter?" This query -was directly addressed to Lord Godalming. - -"I was. It rather upset me for a bit. There has been so much trouble -around my house of late that I could do without any more. I have been -curious, too, as to what you mean. - -"Quincey and I talked it over, but the more we talked, the more -puzzled we got, till now I can say for myself that I'm about up a tree -as to any meaning about anything." - -"Me too," said Quincey Morris laconically. - -"Oh," said the Professor, "then you are nearer the beginning, both of -you, than friend John here, who has to go a long way back before he -can even get so far as to begin." - -It was evident that he recognized my return to my old doubting frame -of mind without my saying a word. Then, turning to the other two, he -said with intense gravity, - -"I want your permission to do what I think good this night. It is, I -know, much to ask, and when you know what it is I propose to do you -will know, and only then how much. Therefore may I ask that you -promise me in the dark, so that afterwards, though you may be angry -with me for a time, I must not disguise from myself the possibility -that such may be, you shall not blame yourselves for anything." - -"That's frank anyhow," broke in Quincey. "I'll answer for the -Professor. I don't quite see his drift, but I swear he's honest, and -that's good enough for me." - -"I thank you, Sir," said Van Helsing proudly. "I have done myself the -honour of counting you one trusting friend, and such endorsement is -dear to me." He held out a hand, which Quincey took. - -Then Arthur spoke out, "Dr. Van Helsing, I don't quite like to 'buy a -pig in a poke', as they say in Scotland, and if it be anything in -which my honour as a gentleman or my faith as a Christian is -concerned, I cannot make such a promise. If you can assure me that -what you intend does not violate either of these two, then I give my -consent at once, though for the life of me, I cannot understand what -you are driving at." - -"I accept your limitation," said Van Helsing, "and all I ask of you is -that if you feel it necessary to condemn any act of mine, you will -first consider it well and be satisfied that it does not violate your -reservations." - -"Agreed!" said Arthur. "That is only fair. And now that the -pourparlers are over, may I ask what it is we are to do?" - -"I want you to come with me, and to come in secret, to the churchyard -at Kingstead." - -Arthur's face fell as he said in an amazed sort of way, - -"Where poor Lucy is buried?" - -The Professor bowed. - -Arthur went on, "And when there?" - -"To enter the tomb!" - -Arthur stood up. "Professor, are you in earnest, or is it some -monstrous joke? Pardon me, I see that you are in earnest." He sat -down again, but I could see that he sat firmly and proudly, as one who -is on his dignity. There was silence until he asked again, "And when -in the tomb?" - -"To open the coffin." - -"This is too much!" he said, angrily rising again. "I am willing to -be patient in all things that are reasonable, but in this, this -desecration of the grave, of one who . . ." He fairly choked with -indignation. - -The Professor looked pityingly at him. "If I could spare you one pang, -my poor friend," he said, "God knows I would. But this night our feet -must tread in thorny paths, or later, and for ever, the feet you love -must walk in paths of flame!" - -Arthur looked up with set white face and said, "Take care, sir, take -care!" - -"Would it not be well to hear what I have to say?" said Van Helsing. -"And then you will at least know the limit of my purpose. Shall I go -on?" - -"That's fair enough," broke in Morris. - -After a pause Van Helsing went on, evidently with an effort, "Miss -Lucy is dead, is it not so? Yes! Then there can be no wrong to her. -But if she be not dead . . ." - -Arthur jumped to his feet, "Good God!" he cried. "What do you mean? -Has there been any mistake, has she been buried alive?" He groaned in -anguish that not even hope could soften. - -"I did not say she was alive, my child. I did not think it. I go no -further than to say that she might be UnDead." - -"UnDead! Not alive! What do you mean? Is this all a nightmare, or -what is it?" - -"There are mysteries which men can only guess at, which age by age -they may solve only in part. Believe me, we are now on the verge of -one. But I have not done. May I cut off the head of dead Miss Lucy?" - -"Heavens and earth, no!" cried Arthur in a storm of passion. "Not for -the wide world will I consent to any mutilation of her dead body. Dr. -Van Helsing, you try me too far. What have I done to you that you -should torture me so? What did that poor, sweet girl do that you -should want to cast such dishonour on her grave? Are you mad, that you -speak of such things, or am I mad to listen to them? Don't dare think -more of such a desecration. I shall not give my consent to anything -you do. I have a duty to do in protecting her grave from outrage, and -by God, I shall do it!" - -Van Helsing rose up from where he had all the time been seated, and -said, gravely and sternly, "My Lord Godalming, I too, have a duty to -do, a duty to others, a duty to you, a duty to the dead, and by God, I -shall do it! All I ask you now is that you come with me, that you -look and listen, and if when later I make the same request you do not -be more eager for its fulfillment even than I am, then, I shall do my -duty, whatever it may seem to me. And then, to follow your Lordship's -wishes I shall hold myself at your disposal to render an account to -you, when and where you will." His voice broke a little, and he went -on with a voice full of pity. - -"But I beseech you, do not go forth in anger with me. In a long life -of acts which were often not pleasant to do, and which sometimes did -wring my heart, I have never had so heavy a task as now. Believe me -that if the time comes for you to change your mind towards me, one -look from you will wipe away all this so sad hour, for I would do what -a man can to save you from sorrow. Just think. For why should I give -myself so much labor and so much of sorrow? I have come here from my -own land to do what I can of good, at the first to please my friend -John, and then to help a sweet young lady, whom too, I come to love. -For her, I am ashamed to say so much, but I say it in kindness, I gave -what you gave, the blood of my veins. I gave it, I who was not, like -you, her lover, but only her physician and her friend. I gave her my -nights and days, before death, after death, and if my death can do her -good even now, when she is the dead UnDead, she shall have it freely." -He said this with a very grave, sweet pride, and Arthur was much -affected by it. - -He took the old man's hand and said in a broken voice, "Oh, it is hard -to think of it, and I cannot understand, but at least I shall go with -you and wait." - - - - -CHAPTER 16 - - -DR. SEWARD'S DIARY--cont. - -It was just a quarter before twelve o'clock when we got into the -churchyard over the low wall. The night was dark with occasional -gleams of moonlight between the dents of the heavy clouds that scudded -across the sky. We all kept somehow close together, with Van Helsing -slightly in front as he led the way. When we had come close to the -tomb I looked well at Arthur, for I feared the proximity to a place -laden with so sorrowful a memory would upset him, but he bore himself -well. I took it that the very mystery of the proceeding was in some -way a counteractant to his grief. The Professor unlocked the door, -and seeing a natural hesitation amongst us for various reasons, solved -the difficulty by entering first himself. The rest of us followed, -and he closed the door. He then lit a dark lantern and pointed to a -coffin. Arthur stepped forward hesitatingly. Van Helsing said to me, -"You were with me here yesterday. Was the body of Miss Lucy in that -coffin?" - -"It was." - -The Professor turned to the rest saying, "You hear, and yet there is -no one who does not believe with me." - -He took his screwdriver and again took off the lid of the coffin. -Arthur looked on, very pale but silent. When the lid was removed he -stepped forward. He evidently did not know that there was a leaden -coffin, or at any rate, had not thought of it. When he saw the rent -in the lead, the blood rushed to his face for an instant, but as -quickly fell away again, so that he remained of a ghastly whiteness. -He was still silent. Van Helsing forced back the leaden flange, and -we all looked in and recoiled. - -The coffin was empty! - -For several minutes no one spoke a word. The silence was broken by -Quincey Morris, "Professor, I answered for you. Your word is all I -want. I wouldn't ask such a thing ordinarily, I wouldn't so dishonour -you as to imply a doubt, but this is a mystery that goes beyond any -honour or dishonour. Is this your doing?" - -"I swear to you by all that I hold sacred that I have not removed or -touched her. What happened was this. Two nights ago my friend Seward -and I came here, with good purpose, believe me. I opened that coffin, -which was then sealed up, and we found it as now, empty. We then -waited, and saw something white come through the trees. The next day -we came here in daytime and she lay there. Did she not, friend John? - -"Yes." - -"That night we were just in time. One more so small child was -missing, and we find it, thank God, unharmed amongst the graves. -Yesterday I came here before sundown, for at sundown the UnDead can -move. I waited here all night till the sun rose, but I saw nothing. -It was most probable that it was because I had laid over the clamps of -those doors garlic, which the UnDead cannot bear, and other things -which they shun. Last night there was no exodus, so tonight before -the sundown I took away my garlic and other things. And so it is we -find this coffin empty. But bear with me. So far there is much that -is strange. Wait you with me outside, unseen and unheard, and things -much stranger are yet to be. So," here he shut the dark slide of his -lantern, "now to the outside." He opened the door, and we filed out, -he coming last and locking the door behind him. - -Oh! But it seemed fresh and pure in the night air after the terror of -that vault. How sweet it was to see the clouds race by, and the -passing gleams of the moonlight between the scudding clouds crossing -and passing, like the gladness and sorrow of a man's life. How sweet -it was to breathe the fresh air, that had no taint of death and decay. -How humanizing to see the red lighting of the sky beyond the hill, and -to hear far away the muffled roar that marks the life of a great -city. Each in his own way was solemn and overcome. Arthur was -silent, and was, I could see, striving to grasp the purpose and the -inner meaning of the mystery. I was myself tolerably patient, and -half inclined again to throw aside doubt and to accept Van Helsing's -conclusions. Quincey Morris was phlegmatic in the way of a man who -accepts all things, and accepts them in the spirit of cool bravery, -with hazard of all he has at stake. Not being able to smoke, he cut -himself a good-sized plug of tobacco and began to chew. As to Van -Helsing, he was employed in a definite way. First he took from his -bag a mass of what looked like thin, wafer-like biscuit, which was -carefully rolled up in a white napkin. Next he took out a double -handful of some whitish stuff, like dough or putty. He crumbled the -wafer up fine and worked it into the mass between his hands. This he -then took, and rolling it into thin strips, began to lay them into the -crevices between the door and its setting in the tomb. I was somewhat -puzzled at this, and being close, asked him what it was that he was -doing. Arthur and Quincey drew near also, as they too were curious. - -He answered, "I am closing the tomb so that the UnDead may not enter." - -"And is that stuff you have there going to do it?" - -"It is." - -"What is that which you are using?" This time the question was by -Arthur. Van Helsing reverently lifted his hat as he answered. - -"The Host. I brought it from Amsterdam. I have an Indulgence." - -It was an answer that appalled the most sceptical of us, and we felt -individually that in the presence of such earnest purpose as the -Professor's, a purpose which could thus use the to him most sacred of -things, it was impossible to distrust. In respectful silence we took -the places assigned to us close round the tomb, but hidden from the -sight of any one approaching. I pitied the others, especially Arthur. -I had myself been apprenticed by my former visits to this watching -horror, and yet I, who had up to an hour ago repudiated the proofs, -felt my heart sink within me. Never did tombs look so ghastly white. -Never did cypress, or yew, or juniper so seem the embodiment of -funeral gloom. Never did tree or grass wave or rustle so ominously. -Never did bough creak so mysteriously, and never did the far-away -howling of dogs send such a woeful presage through the night. - -There was a long spell of silence, big, aching, void, and then from -the Professor a keen "S-s-s-s!" He pointed, and far down the avenue of -yews we saw a white figure advance, a dim white figure, which held -something dark at its breast. The figure stopped, and at the moment a -ray of moonlight fell upon the masses of driving clouds, and showed in -startling prominence a dark-haired woman, dressed in the cerements of -the grave. We could not see the face, for it was bent down over what -we saw to be a fair-haired child. There was a pause and a sharp -little cry, such as a child gives in sleep, or a dog as it lies before -the fire and dreams. We were starting forward, but the Professor's -warning hand, seen by us as he stood behind a yew tree, kept us back. -And then as we looked the white figure moved forwards again. It was -now near enough for us to see clearly, and the moonlight still held. -My own heart grew cold as ice, and I could hear the gasp of Arthur, as -we recognized the features of Lucy Westenra. Lucy Westenra, but yet -how changed. The sweetness was turned to adamantine, heartless -cruelty, and the purity to voluptuous wantonness. - -Van Helsing stepped out, and obedient to his gesture, we all advanced -too. The four of us ranged in a line before the door of the tomb. Van -Helsing raised his lantern and drew the slide. By the concentrated -light that fell on Lucy's face we could see that the lips were crimson -with fresh blood, and that the stream had trickled over her chin and -stained the purity of her lawn death-robe. - -We shuddered with horror. I could see by the tremulous light that -even Van Helsing's iron nerve had failed. Arthur was next to me, and -if I had not seized his arm and held him up, he would have fallen. - -When Lucy, I call the thing that was before us Lucy because it bore -her shape, saw us she drew back with an angry snarl, such as a cat -gives when taken unawares, then her eyes ranged over us. Lucy's eyes -in form and colour, but Lucy's eyes unclean and full of hell fire, -instead of the pure, gentle orbs we knew. At that moment the remnant -of my love passed into hate and loathing. Had she then to be killed, -I could have done it with savage delight. As she looked, her eyes -blazed with unholy light, and the face became wreathed with a -voluptuous smile. Oh, God, how it made me shudder to see it! With a -careless motion, she flung to the ground, callous as a devil, the -child that up to now she had clutched strenuously to her breast, -growling over it as a dog growls over a bone. The child gave a sharp -cry, and lay there moaning. There was a cold-bloodedness in the act -which wrung a groan from Arthur. When she advanced to him with -outstretched arms and a wanton smile he fell back and hid his face in -his hands. - -She still advanced, however, and with a languorous, voluptuous grace, -said, "Come to me, Arthur. Leave these others and come to me. My -arms are hungry for you. Come, and we can rest together. Come, my -husband, come!" - -There was something diabolically sweet in her tones, something of the -tinkling of glass when struck, which rang through the brains even of -us who heard the words addressed to another. - -As for Arthur, he seemed under a spell, moving his hands from his -face, he opened wide his arms. She was leaping for them, when Van -Helsing sprang forward and held between them his little golden -crucifix. She recoiled from it, and, with a suddenly distorted face, -full of rage, dashed past him as if to enter the tomb. - -When within a foot or two of the door, however, she stopped, as if -arrested by some irresistible force. Then she turned, and her face -was shown in the clear burst of moonlight and by the lamp, which had -now no quiver from Van Helsing's nerves. Never did I see such baffled -malice on a face, and never, I trust, shall such ever be seen again by -mortal eyes. The beautiful colour became livid, the eyes seemed to -throw out sparks of hell fire, the brows were wrinkled as though the -folds of flesh were the coils of Medusa's snakes, and the lovely, -blood-stained mouth grew to an open square, as in the passion masks of -the Greeks and Japanese. If ever a face meant death, if looks could -kill, we saw it at that moment. - -And so for full half a minute, which seemed an eternity, she remained -between the lifted crucifix and the sacred closing of her means of -entry. - -Van Helsing broke the silence by asking Arthur, "Answer me, oh my -friend! Am I to proceed in my work?" - -"Do as you will, friend. Do as you will. There can be no horror like -this ever any more." And he groaned in spirit. - -Quincey and I simultaneously moved towards him, and took his arms. We -could hear the click of the closing lantern as Van Helsing held it -down. Coming close to the tomb, he began to remove from the chinks -some of the sacred emblem which he had placed there. We all looked on -with horrified amazement as we saw, when he stood back, the woman, -with a corporeal body as real at that moment as our own, pass through -the interstice where scarce a knife blade could have gone. We all -felt a glad sense of relief when we saw the Professor calmly restoring -the strings of putty to the edges of the door. - -When this was done, he lifted the child and said, "Come now, my -friends. We can do no more till tomorrow. There is a funeral at -noon, so here we shall all come before long after that. The friends -of the dead will all be gone by two, and when the sexton locks the -gate we shall remain. Then there is more to do, but not like this of -tonight. As for this little one, he is not much harmed, and by -tomorrow night he shall be well. We shall leave him where the police -will find him, as on the other night, and then to home." - -Coming close to Arthur, he said, "My friend Arthur, you have had a sore -trial, but after, when you look back, you will see how it was -necessary. You are now in the bitter waters, my child. By this time -tomorrow you will, please God, have passed them, and have drunk of the -sweet waters. So do not mourn over-much. Till then I shall not ask -you to forgive me." - -Arthur and Quincey came home with me, and we tried to cheer each other -on the way. We had left behind the child in safety, and were tired. -So we all slept with more or less reality of sleep. - - -29 September, night.--A little before twelve o'clock we three, Arthur, -Quincey Morris, and myself, called for the Professor. It was odd to -notice that by common consent we had all put on black clothes. Of -course, Arthur wore black, for he was in deep mourning, but the rest -of us wore it by instinct. We got to the graveyard by half-past one, -and strolled about, keeping out of official observation, so that when -the gravediggers had completed their task and the sexton, under the -belief that every one had gone, had locked the gate, we had the place -all to ourselves. Van Helsing, instead of his little black bag, had -with him a long leather one, something like a cricketing bag. It was -manifestly of fair weight. - -When we were alone and had heard the last of the footsteps die out up -the road, we silently, and as if by ordered intention, followed the -Professor to the tomb. He unlocked the door, and we entered, closing -it behind us. Then he took from his bag the lantern, which he lit, -and also two wax candles, which, when lighted, he stuck by melting -their own ends, on other coffins, so that they might give light -sufficient to work by. When he again lifted the lid off Lucy's coffin -we all looked, Arthur trembling like an aspen, and saw that the corpse -lay there in all its death beauty. But there was no love in my own -heart, nothing but loathing for the foul Thing which had taken Lucy's -shape without her soul. I could see even Arthur's face grow hard as -he looked. Presently he said to Van Helsing, "Is this really Lucy's -body, or only a demon in her shape?" - -"It is her body, and yet not it. But wait a while, and you shall see -her as she was, and is." - -She seemed like a nightmare of Lucy as she lay there, the pointed -teeth, the blood stained, voluptuous mouth, which made one shudder to -see, the whole carnal and unspirited appearance, seeming like a -devilish mockery of Lucy's sweet purity. Van Helsing, with his usual -methodicalness, began taking the various contents from his bag and -placing them ready for use. First he took out a soldering iron and -some plumbing solder, and then small oil lamp, which gave out, when -lit in a corner of the tomb, gas which burned at a fierce heat with a -blue flame, then his operating knives, which he placed to hand, and -last a round wooden stake, some two and a half or three inches thick -and about three feet long. One end of it was hardened by charring in -the fire, and was sharpened to a fine point. With this stake came a -heavy hammer, such as in households is used in the coal cellar for -breaking the lumps. To me, a doctor's preparations for work of any -kind are stimulating and bracing, but the effect of these things on -both Arthur and Quincey was to cause them a sort of consternation. -They both, however, kept their courage, and remained silent and quiet. - -When all was ready, Van Helsing said, "Before we do anything, let me -tell you this. It is out of the lore and experience of the ancients -and of all those who have studied the powers of the UnDead. When they -become such, there comes with the change the curse of immortality. -They cannot die, but must go on age after age adding new victims and -multiplying the evils of the world. For all that die from the preying -of the Undead become themselves Undead, and prey on their kind. And -so the circle goes on ever widening, like as the ripples from a stone -thrown in the water. Friend Arthur, if you had met that kiss which -you know of before poor Lucy die, or again, last night when you open -your arms to her, you would in time, when you had died, have become -nosferatu, as they call it in Eastern Europe, and would for all time -make more of those Un-Deads that so have filled us with horror. The -career of this so unhappy dear lady is but just begun. Those children -whose blood she sucked are not as yet so much the worse, but if she -lives on, UnDead, more and more they lose their blood and by her power -over them they come to her, and so she draw their blood with that so -wicked mouth. But if she die in truth, then all cease. The tiny -wounds of the throats disappear, and they go back to their play -unknowing ever of what has been. But of the most blessed of all, when -this now UnDead be made to rest as true dead, then the soul of the -poor lady whom we love shall again be free. Instead of working -wickedness by night and growing more debased in the assimilating of it -by day, she shall take her place with the other Angels. So that, my -friend, it will be a blessed hand for her that shall strike the blow -that sets her free. To this I am willing, but is there none amongst -us who has a better right? Will it be no joy to think of hereafter in -the silence of the night when sleep is not, 'It was my hand that sent -her to the stars. It was the hand of him that loved her best, the -hand that of all she would herself have chosen, had it been to her to -choose?' Tell me if there be such a one amongst us?" - -We all looked at Arthur. He saw too, what we all did, the infinite -kindness which suggested that his should be the hand which would -restore Lucy to us as a holy, and not an unholy, memory. He stepped -forward and said bravely, though his hand trembled, and his face was -as pale as snow, "My true friend, from the bottom of my broken heart I -thank you. Tell me what I am to do, and I shall not falter!" - -Van Helsing laid a hand on his shoulder, and said, "Brave lad! A -moment's courage, and it is done. This stake must be driven through -her. It well be a fearful ordeal, be not deceived in that, but it -will be only a short time, and you will then rejoice more than your -pain was great. From this grim tomb you will emerge as though you -tread on air. But you must not falter when once you have begun. Only -think that we, your true friends, are round you, and that we pray for -you all the time." - -"Go on," said Arthur hoarsely. "Tell me what I am to do." - -"Take this stake in your left hand, ready to place to the point over -the heart, and the hammer in your right. Then when we begin our -prayer for the dead, I shall read him, I have here the book, and the -others shall follow, strike in God's name, that so all may be well -with the dead that we love and that the UnDead pass away." - -Arthur took the stake and the hammer, and when once his mind was set -on action his hands never trembled nor even quivered. Van Helsing -opened his missal and began to read, and Quincey and I followed as -well as we could. - -Arthur placed the point over the heart, and as I looked I could see its -dint in the white flesh. Then he struck with all his might. - -The thing in the coffin writhed, and a hideous, blood-curdling screech -came from the opened red lips. The body shook and quivered and -twisted in wild contortions. The sharp white teeth champed together till -the lips were cut, and the mouth was smeared with a crimson foam. But -Arthur never faltered. He looked like a figure of Thor as his -untrembling arm rose and fell, driving deeper and deeper the -mercy-bearing stake, whilst the blood from the pierced heart welled -and spurted up around it. His face was set, and high duty seemed to -shine through it. The sight of it gave us courage so that our voices -seemed to ring through the little vault. - -And then the writhing and quivering of the body became less, and the -teeth seemed to champ, and the face to quiver. Finally it lay still. -The terrible task was over. - -The hammer fell from Arthur's hand. He reeled and would have fallen -had we not caught him. The great drops of sweat sprang from his -forehead, and his breath came in broken gasps. It had indeed been an -awful strain on him, and had he not been forced to his task by more -than human considerations he could never have gone through with it. -For a few minutes we were so taken up with him that we did not look -towards the coffin. When we did, however, a murmur of startled -surprise ran from one to the other of us. We gazed so eagerly that -Arthur rose, for he had been seated on the ground, and came and looked -too, and then a glad strange light broke over his face and dispelled -altogether the gloom of horror that lay upon it. - -There, in the coffin lay no longer the foul Thing that we had so -dreaded and grown to hate that the work of her destruction was yielded -as a privilege to the one best entitled to it, but Lucy as we had seen -her in life, with her face of unequalled sweetness and purity. True -that there were there, as we had seen them in life, the traces of care -and pain and waste. But these were all dear to us, for they marked -her truth to what we knew. One and all we felt that the holy calm -that lay like sunshine over the wasted face and form was only an -earthly token and symbol of the calm that was to reign for ever. - -Van Helsing came and laid his hand on Arthur's shoulder, and said to -him, "And now, Arthur my friend, dear lad, am I not forgiven?" - -The reaction of the terrible strain came as he took the old man's hand -in his, and raising it to his lips, pressed it, and said, "Forgiven! -God bless you that you have given my dear one her soul again, and me -peace." He put his hands on the Professor's shoulder, and laying his -head on his breast, cried for a while silently, whilst we stood -unmoving. - -When he raised his head Van Helsing said to him, "And now, my child, -you may kiss her. Kiss her dead lips if you will, as she would have -you to, if for her to choose. For she is not a grinning devil now, -not any more a foul Thing for all eternity. No longer she is the -devil's UnDead. She is God's true dead, whose soul is with Him!" - -Arthur bent and kissed her, and then we sent him and Quincey out of the -tomb. The Professor and I sawed the top off the stake, leaving the -point of it in the body. Then we cut off the head and filled the -mouth with garlic. We soldered up the leaden coffin, screwed on the -coffin lid, and gathering up our belongings, came away. When the -Professor locked the door he gave the key to Arthur. - -Outside the air was sweet, the sun shone, and the birds sang, and it -seemed as if all nature were tuned to a different pitch. There was -gladness and mirth and peace everywhere, for we were at rest ourselves -on one account, and we were glad, though it was with a tempered joy. - -Before we moved away Van Helsing said, "Now, my friends, one step of -our work is done, one the most harrowing to ourselves. But there -remains a greater task: to find out the author of all this our sorrow -and to stamp him out. I have clues which we can follow, but it is a -long task, and a difficult one, and there is danger in it, and pain. -Shall you not all help me? We have learned to believe, all of us, is -it not so? And since so, do we not see our duty? Yes! And do we not -promise to go on to the bitter end?" - -Each in turn, we took his hand, and the promise was made. Then said -the Professor as we moved off, "Two nights hence you shall meet with -me and dine together at seven of the clock with friend John. I shall -entreat two others, two that you know not as yet, and I shall be ready -to all our work show and our plans unfold. Friend John, you come with -me home, for I have much to consult you about, and you can help me. -Tonight I leave for Amsterdam, but shall return tomorrow night. And -then begins our great quest. But first I shall have much to say, so -that you may know what to do and to dread. Then our promise shall be -made to each other anew. For there is a terrible task before us, and -once our feet are on the ploughshare we must not draw back." - - - - -CHAPTER 17 - - -DR. SEWARD'S DIARY--cont. - -When we arrived at the Berkely Hotel, Van Helsing found a telegram -waiting for him. - -"Am coming up by train. Jonathan at Whitby. Important news. Mina -Harker." - - -The Professor was delighted. "Ah, that wonderful Madam Mina," he -said, "pearl among women! She arrive, but I cannot stay. She must go -to your house, friend John. You must meet her at the station. -Telegraph her en route so that she may be prepared." - -When the wire was dispatched he had a cup of tea. Over it he told me -of a diary kept by Jonathan Harker when abroad, and gave me a -typewritten copy of it, as also of Mrs. Harker's diary at Whitby. -"Take these," he said, "and study them well. When I have returned you -will be master of all the facts, and we can then better enter on our -inquisition. Keep them safe, for there is in them much of treasure. -You will need all your faith, even you who have had such an experience -as that of today. What is here told," he laid his hand heavily and -gravely on the packet of papers as he spoke, "may be the beginning of -the end to you and me and many another, or it may sound the knell of -the UnDead who walk the earth. Read all, I pray you, with the open -mind, and if you can add in any way to the story here told do so, for -it is all important. You have kept a diary of all these so strange -things, is it not so? Yes! Then we shall go through all these -together when we meet." He then made ready for his departure and -shortly drove off to Liverpool Street. I took my way to Paddington, -where I arrived about fifteen minutes before the train came in. - -The crowd melted away, after the bustling fashion common to arrival -platforms, and I was beginning to feel uneasy, lest I might miss my -guest, when a sweet-faced, dainty looking girl stepped up to me, and -after a quick glance said, "Dr. Seward, is it not?" - -"And you are Mrs. Harker!" I answered at once, whereupon she held out -her hand. - -"I knew you from the description of poor dear Lucy, but . . ." She -stopped suddenly, and a quick blush overspread her face. - -The blush that rose to my own cheeks somehow set us both at ease, for -it was a tacit answer to her own. I got her luggage, which included a -typewriter, and we took the Underground to Fenchurch Street, after I -had sent a wire to my housekeeper to have a sitting room and a bedroom -prepared at once for Mrs. Harker. - -In due time we arrived. She knew, of course, that the place was a -lunatic asylum, but I could see that she was unable to repress a -shudder when we entered. - -She told me that, if she might, she would come presently to my study, -as she had much to say. So here I am finishing my entry in my -phonograph diary whilst I await her. As yet I have not had the chance -of looking at the papers which Van Helsing left with me, though they -lie open before me. I must get her interested in something, so that I -may have an opportunity of reading them. She does not know how -precious time is, or what a task we have in hand. I must be careful -not to frighten her. Here she is! - - - - -MINA HARKER'S JOURNAL - -29 September.--After I had tidied myself, I went down to Dr. Seward's -study. At the door I paused a moment, for I thought I heard him -talking with some one. As, however, he had pressed me to be quick, I -knocked at the door, and on his calling out, "Come in," I entered. - -To my intense surprise, there was no one with him. He was quite -alone, and on the table opposite him was what I knew at once from the -description to be a phonograph. I had never seen one, and was much -interested. - -"I hope I did not keep you waiting," I said, "but I stayed at the door -as I heard you talking, and thought there was someone with you." - -"Oh," he replied with a smile, "I was only entering my diary." - -"Your diary?" I asked him in surprise. - -"Yes," he answered. "I keep it in this." As he spoke he laid his -hand on the phonograph. I felt quite excited over it, and blurted -out, "Why, this beats even shorthand! May I hear it say something?" - -"Certainly," he replied with alacrity, and stood up to put it in train -for speaking. Then he paused, and a troubled look overspread his -face. - -"The fact is," he began awkwardly, "I only keep my diary in it, and as -it is entirely, almost entirely, about my cases it may be awkward, -that is, I mean . . ." He stopped, and I tried to help him out of his -embarrassment. - -"You helped to attend dear Lucy at the end. Let me hear how she died, -for all that I know of her, I shall be very grateful. She was very, -very dear to me." - -To my surprise, he answered, with a horrorstruck look in his face, -"Tell you of her death? Not for the wide world!" - -"Why not?" I asked, for some grave, terrible feeling was coming over me. - -Again he paused, and I could see that he was trying to invent an -excuse. At length, he stammered out, "You see, I do not know how to -pick out any particular part of the diary." - -Even while he was speaking an idea dawned upon him, and he said with -unconscious simplicity, in a different voice, and with the naivete of -a child, "that's quite true, upon my honour. Honest Indian!" - -I could not but smile, at which he grimaced. "I gave myself away that -time!" he said. "But do you know that, although I have kept the diary -for months past, it never once struck me how I was going to find any -particular part of it in case I wanted to look it up?" - -By this time my mind was made up that the diary of a doctor who -attended Lucy might have something to add to the sum of our knowledge -of that terrible Being, and I said boldly, "Then, Dr. Seward, you had -better let me copy it out for you on my typewriter." - -He grew to a positively deathly pallor as he said, "No! No! No! For -all the world. I wouldn't let you know that terrible story!" - -Then it was terrible. My intuition was right! For a moment, I -thought, and as my eyes ranged the room, unconsciously looking for -something or some opportunity to aid me, they lit on a great batch of -typewriting on the table. His eyes caught the look in mine, and -without his thinking, followed their direction. As they saw the -parcel he realized my meaning. - -"You do not know me," I said. "When you have read those papers, my -own diary and my husband's also, which I have typed, you will know me -better. I have not faltered in giving every thought of my own heart -in this cause. But, of course, you do not know me, yet, and I must -not expect you to trust me so far." - -He is certainly a man of noble nature. Poor dear Lucy was right about -him. He stood up and opened a large drawer, in which were arranged in -order a number of hollow cylinders of metal covered with dark wax, and -said, - -"You are quite right. I did not trust you because I did not know -you. But I know you now, and let me say that I should have known you -long ago. I know that Lucy told you of me. She told me of you too. -May I make the only atonement in my power? Take the cylinders and -hear them. The first half-dozen of them are personal to me, and they -will not horrify you. Then you will know me better. Dinner will by -then be ready. In the meantime I shall read over some of these -documents, and shall be better able to understand certain things." - -He carried the phonograph himself up to my sitting room and adjusted -it for me. Now I shall learn something pleasant, I am sure. For it -will tell me the other side of a true love episode of which I know one -side already. - - - - -DR. SEWARD'S DIARY - -29 September.--I was so absorbed in that wonderful diary of Jonathan -Harker and that other of his wife that I let the time run on without -thinking. Mrs. Harker was not down when the maid came to announce -dinner, so I said, "She is possibly tired. Let dinner wait an hour," -and I went on with my work. I had just finished Mrs. Harker's diary, -when she came in. She looked sweetly pretty, but very sad, and her -eyes were flushed with crying. This somehow moved me much. Of late I -have had cause for tears, God knows! But the relief of them was -denied me, and now the sight of those sweet eyes, brightened by recent -tears, went straight to my heart. So I said as gently as I could, "I -greatly fear I have distressed you." - -"Oh, no, not distressed me," she replied. "But I have been more -touched than I can say by your grief. That is a wonderful machine, -but it is cruelly true. It told me, in its very tones, the anguish of -your heart. It was like a soul crying out to Almighty God. No one -must hear them spoken ever again! See, I have tried to be useful. I -have copied out the words on my typewriter, and none other need now -hear your heart beat, as I did." - -"No one need ever know, shall ever know," I said in a low voice. She -laid her hand on mine and said very gravely, "Ah, but they must!" - -"Must! But why?" I asked. - -"Because it is a part of the terrible story, a part of poor Lucy's -death and all that led to it. Because in the struggle which we have -before us to rid the earth of this terrible monster we must have all -the knowledge and all the help which we can get. I think that the -cylinders which you gave me contained more than you intended me to -know. But I can see that there are in your record many lights to this -dark mystery. You will let me help, will you not? I know all up to a -certain point, and I see already, though your diary only took me to 7 -September, how poor Lucy was beset, and how her terrible doom was -being wrought out. Jonathan and I have been working day and night -since Professor Van Helsing saw us. He is gone to Whitby to get more -information, and he will be here tomorrow to help us. We need have no -secrets amongst us. Working together and with absolute trust, we can -surely be stronger than if some of us were in the dark." - -She looked at me so appealingly, and at the same time manifested such -courage and resolution in her bearing, that I gave in at once to her -wishes. "You shall," I said, "do as you like in the matter. God -forgive me if I do wrong! There are terrible things yet to learn of, -but if you have so far traveled on the road to poor Lucy's death, you -will not be content, I know, to remain in the dark. Nay, the end, the -very end, may give you a gleam of peace. Come, there is dinner. We -must keep one another strong for what is before us. We have a cruel -and dreadful task. When you have eaten you shall learn the rest, and -I shall answer any questions you ask, if there be anything which you -do not understand, though it was apparent to us who were present." - - - -MINA HARKER'S JOURNAL - -29 September.--After dinner I came with Dr. Seward to his study. He -brought back the phonograph from my room, and I took a chair, and -arranged the phonograph so that I could touch it without getting up, -and showed me how to stop it in case I should want to pause. Then he -very thoughtfully took a chair, with his back to me, so that I might -be as free as possible, and began to read. I put the forked metal to -my ears and listened. - -When the terrible story of Lucy's death, and all that followed, was -done, I lay back in my chair powerless. Fortunately I am not of a -fainting disposition. When Dr. Seward saw me he jumped up with a -horrified exclamation, and hurriedly taking a case bottle from the -cupboard, gave me some brandy, which in a few minutes somewhat -restored me. My brain was all in a whirl, and only that there came -through all the multitude of horrors, the holy ray of light that my -dear Lucy was at last at peace, I do not think I could have borne it -without making a scene. It is all so wild and mysterious, and strange -that if I had not known Jonathan's experience in Transylvania I could -not have believed. As it was, I didn't know what to believe, and so -got out of my difficulty by attending to something else. I took the -cover off my typewriter, and said to Dr. Seward, - -"Let me write this all out now. We must be ready for Dr. Van Helsing -when he comes. I have sent a telegram to Jonathan to come on here -when he arrives in London from Whitby. In this matter dates are -everything, and I think that if we get all of our material ready, and -have every item put in chronological order, we shall have done much. - -"You tell me that Lord Godalming and Mr. Morris are coming too. Let -us be able to tell them when they come." - -He accordingly set the phonograph at a slow pace, and I began to -typewrite from the beginning of the seventeenth cylinder. I used -manifold, and so took three copies of the diary, just as I had done -with the rest. It was late when I got through, but Dr. Seward went -about his work of going his round of the patients. When he had -finished he came back and sat near me, reading, so that I did not feel -too lonely whilst I worked. How good and thoughtful he is. The world -seems full of good men, even if there are monsters in it. - -Before I left him I remembered what Jonathan put in his diary of the -Professor's perturbation at reading something in an evening paper at -the station at Exeter, so, seeing that Dr. Seward keeps his -newspapers, I borrowed the files of 'The Westminster Gazette' and 'The -Pall Mall Gazette' and took them to my room. I remember how much the -'Dailygraph' and 'The Whitby Gazette', of which I had made cuttings, -had helped us to understand the terrible events at Whitby when Count -Dracula landed, so I shall look through the evening papers since then, -and perhaps I shall get some new light. I am not sleepy, and the work -will help to keep me quiet. - - - - -DR. SEWARD'S DIARY - -30 September.--Mr. Harker arrived at nine o'clock. He got his wife's -wire just before starting. He is uncommonly clever, if one can judge -from his face, and full of energy. If this journal be true, and -judging by one's own wonderful experiences, it must be, he is also a -man of great nerve. That going down to the vault a second time was a -remarkable piece of daring. After reading his account of it I was -prepared to meet a good specimen of manhood, but hardly the quiet, -businesslike gentleman who came here today. - - -LATER.--After lunch Harker and his wife went back to their own room, -and as I passed a while ago I heard the click of the typewriter. They -are hard at it. Mrs. Harker says that they are knitting together in -chronological order every scrap of evidence they have. Harker has got -the letters between the consignee of the boxes at Whitby and the -carriers in London who took charge of them. He is now reading his -wife's transcript of my diary. I wonder what they make out of it. -Here it is . . . - -Strange that it never struck me that the very next house might be the -Count's hiding place! Goodness knows that we had enough clues from -the conduct of the patient Renfield! The bundle of letters relating -to the purchase of the house were with the transcript. Oh, if we had -only had them earlier we might have saved poor Lucy! Stop! That way -madness lies! Harker has gone back, and is again collecting material. -He says that by dinner time they will be able to show a whole -connected narrative. He thinks that in the meantime I should see -Renfield, as hitherto he has been a sort of index to the coming and -going of the Count. I hardly see this yet, but when I get at the -dates I suppose I shall. What a good thing that Mrs. Harker put my -cylinders into type! We never could have found the dates otherwise. - -I found Renfield sitting placidly in his room with his hands folded, -smiling benignly. At the moment he seemed as sane as any one I ever -saw. I sat down and talked with him on a lot of subjects, all of -which he treated naturally. He then, of his own accord, spoke of -going home, a subject he has never mentioned to my knowledge during -his sojourn here. In fact, he spoke quite confidently of getting his -discharge at once. I believe that, had I not had the chat with Harker -and read the letters and the dates of his outbursts, I should have -been prepared to sign for him after a brief time of observation. As -it is, I am darkly suspicious. All those out-breaks were in some way -linked with the proximity of the Count. What then does this absolute -content mean? Can it be that his instinct is satisfied as to the -vampire's ultimate triumph? Stay. He is himself zoophagous, and in -his wild ravings outside the chapel door of the deserted house he -always spoke of 'master'. This all seems confirmation of our idea. -However, after a while I came away. My friend is just a little too -sane at present to make it safe to probe him too deep with questions. -He might begin to think, and then . . . So I came away. I mistrust -these quiet moods of his, so I have given the attendant a hint to -look closely after him, and to have a strait waistcoat ready in case -of need. - - - - - -JOHNATHAN HARKER'S JOURNAL - -29 September, in train to London.--When I received Mr. Billington's -courteous message that he would give me any information in his power I -thought it best to go down to Whitby and make, on the spot, such -inquiries as I wanted. It was now my object to trace that horrid -cargo of the Count's to its place in London. Later, we may be able to -deal with it. Billington junior, a nice lad, met me at the station, -and brought me to his father's house, where they had decided that I -must spend the night. They are hospitable, with true Yorkshire -hospitality, give a guest everything and leave him to do as he likes. -They all knew that I was busy, and that my stay was short, and Mr. -Billington had ready in his office all the papers concerning the -consignment of boxes. It gave me almost a turn to see again one of -the letters which I had seen on the Count's table before I knew of his -diabolical plans. Everything had been carefully thought out, and done -systematically and with precision. He seemed to have been prepared -for every obstacle which might be placed by accident in the way of his -intentions being carried out. To use an Americanism, he had 'taken no -chances', and the absolute accuracy with which his instructions were -fulfilled was simply the logical result of his care. I saw the -invoice, and took note of it. 'Fifty cases of common earth, to be used -for experimental purposes'. Also the copy of the letter to Carter -Paterson, and their reply. Of both these I got copies. This was all -the information Mr. Billington could give me, so I went down to the -port and saw the coastguards, the Customs Officers and the harbour -master, who kindly put me in communication with the men who had -actually received the boxes. Their tally was exact with the list, and -they had nothing to add to the simple description 'fifty cases of -common earth', except that the boxes were 'main and mortal heavy', and -that shifting them was dry work. One of them added that it was hard -lines that there wasn't any gentleman 'such like as like yourself, -squire', to show some sort of appreciation of their efforts in a -liquid form. Another put in a rider that the thirst then generated -was such that even the time which had elapsed had not completely -allayed it. Needless to add, I took care before leaving to lift, -forever and adequately, this source of reproach. - -30 September.--The station master was good enough to give me a line to -his old companion the station master at King's Cross, so that when I -arrived there in the morning I was able to ask him about the arrival -of the boxes. He, too put me at once in communication with the proper -officials, and I saw that their tally was correct with the original -invoice. The opportunities of acquiring an abnormal thirst had been -here limited. A noble use of them had, however, been made, and again -I was compelled to deal with the result in ex post facto manner. - -From thence I went to Carter Paterson's central office, where I met -with the utmost courtesy. They looked up the transaction in their day -book and letter book, and at once telephoned to their King's Cross -office for more details. By good fortune, the men who did the teaming -were waiting for work, and the official at once sent them over, -sending also by one of them the way-bill and all the papers connected -with the delivery of the boxes at Carfax. Here again I found the -tally agreeing exactly. The carriers' men were able to supplement the -paucity of the written words with a few more details. These were, I -shortly found, connected almost solely with the dusty nature of the -job, and the consequent thirst engendered in the operators. On my -affording an opportunity, through the medium of the currency of the -realm, of the allaying, at a later period, this beneficial evil, one -of the men remarked, - -"That 'ere 'ouse, guv'nor, is the rummiest I ever was in. Blyme! But -it ain't been touched sence a hundred years. There was dust that -thick in the place that you might have slep' on it without 'urtin' of -yer bones. An' the place was that neglected that yer might 'ave -smelled ole Jerusalem in it. But the old chapel, that took the cike, -that did! Me and my mate, we thort we wouldn't never git out quick -enough. Lor', I wouldn't take less nor a quid a moment to stay there -arter dark." - -Having been in the house, I could well believe him, but if he knew -what I know, he would, I think have raised his terms. - -Of one thing I am now satisfied. That all those boxes which arrived at -Whitby from Varna in the Demeter were safely deposited in the old -chapel at Carfax. There should be fifty of them there, unless any -have since been removed, as from Dr. Seward's diary I fear. - - -Later.--Mina and I have worked all day, and we have put all the papers -into order. - - - - -MINA HARKER'S JOURNAL - -30 September.--I am so glad that I hardly know how to contain myself. -It is, I suppose, the reaction from the haunting fear which I have -had, that this terrible affair and the reopening of his old wound -might act detrimentally on Jonathan. I saw him leave for Whitby with -as brave a face as could, but I was sick with apprehension. The -effort has, however, done him good. He was never so resolute, never -so strong, never so full of volcanic energy, as at present. It is -just as that dear, good Professor Van Helsing said, he is true grit, -and he improves under strain that would kill a weaker nature. He came -back full of life and hope and determination. We have got everything -in order for tonight. I feel myself quite wild with excitement. I -suppose one ought to pity anything so hunted as the Count. That is -just it. This thing is not human, not even a beast. To read Dr. -Seward's account of poor Lucy's death, and what followed, is enough to -dry up the springs of pity in one's heart. - - -Later.--Lord Godalming and Mr. Morris arrived earlier than we -expected. Dr. Seward was out on business, and had taken Jonathan with -him, so I had to see them. It was to me a painful meeting, for it -brought back all poor dear Lucy's hopes of only a few months ago. Of -course they had heard Lucy speak of me, and it seemed that Dr. Van -Helsing, too, had been quite 'blowing my trumpet', as Mr. Morris -expressed it. Poor fellows, neither of them is aware that I know all -about the proposals they made to Lucy. They did not quite know what -to say or do, as they were ignorant of the amount of my knowledge. So -they had to keep on neutral subjects. However, I thought the matter -over, and came to the conclusion that the best thing I could do would -be to post them on affairs right up to date. I knew from Dr. Seward's -diary that they had been at Lucy's death, her real death, and that I -need not fear to betray any secret before the time. So I told them, -as well as I could, that I had read all the papers and diaries, and -that my husband and I, having typewritten them, had just finished -putting them in order. I gave them each a copy to read in the -library. When Lord Godalming got his and turned it over, it does make -a pretty good pile, he said, "Did you write all this, Mrs. Harker?" - -I nodded, and he went on. - -"I don't quite see the drift of it, but you people are all so good and -kind, and have been working so earnestly and so energetically, that -all I can do is to accept your ideas blindfold and try to help you. I -have had one lesson already in accepting facts that should make a man -humble to the last hour of his life. Besides, I know you loved my -Lucy . . ." - -Here he turned away and covered his face with his hands. I could hear -the tears in his voice. Mr. Morris, with instinctive delicacy, just -laid a hand for a moment on his shoulder, and then walked quietly out -of the room. I suppose there is something in a woman's nature that -makes a man free to break down before her and express his feelings on -the tender or emotional side without feeling it derogatory to his -manhood. For when Lord Godalming found himself alone with me he sat -down on the sofa and gave way utterly and openly. I sat down beside -him and took his hand. I hope he didn't think it forward of me, and -that if he ever thinks of it afterwards he never will have such a -thought. There I wrong him. I know he never will. He is too true a -gentleman. I said to him, for I could see that his heart was -breaking, "I loved dear Lucy, and I know what she was to you, and what -you were to her. She and I were like sisters, and now she is gone, -will you not let me be like a sister to you in your trouble? I know -what sorrows you have had, though I cannot measure the depth of them. -If sympathy and pity can help in your affliction, won't you let me be -of some little service, for Lucy's sake?" - -In an instant the poor dear fellow was overwhelmed with grief. It -seemed to me that all that he had of late been suffering in silence -found a vent at once. He grew quite hysterical, and raising his open -hands, beat his palms together in a perfect agony of grief. He stood -up and then sat down again, and the tears rained down his cheeks. I -felt an infinite pity for him, and opened my arms unthinkingly. With -a sob he laid his head on my shoulder and cried like a wearied child, -whilst he shook with emotion. - -We women have something of the mother in us that makes us rise above -smaller matters when the mother spirit is invoked. I felt this big -sorrowing man's head resting on me, as though it were that of a baby -that some day may lie on my bosom, and I stroked his hair as though he -were my own child. I never thought at the time how strange it all -was. - -After a little bit his sobs ceased, and he raised himself with an -apology, though he made no disguise of his emotion. He told me that -for days and nights past, weary days and sleepless nights, he had been -unable to speak with any one, as a man must speak in his time of -sorrow. There was no woman whose sympathy could be given to him, or -with whom, owing to the terrible circumstance with which his sorrow -was surrounded, he could speak freely. - -"I know now how I suffered," he said, as he dried his eyes, "but I do -not know even yet, and none other can ever know, how much your sweet -sympathy has been to me today. I shall know better in time, and -believe me that, though I am not ungrateful now, my gratitude will -grow with my understanding. You will let me be like a brother, will -you not, for all our lives, for dear Lucy's sake?" - -"For dear Lucy's sake," I said as we clasped hands. "Ay, and for your -own sake," he added, "for if a man's esteem and gratitude are ever -worth the winning, you have won mine today. If ever the future should -bring to you a time when you need a man's help, believe me, you will -not call in vain. God grant that no such time may ever come to you to -break the sunshine of your life, but if it should ever come, promise -me that you will let me know." - -He was so earnest, and his sorrow was so fresh, that I felt it would -comfort him, so I said, "I promise." - -As I came along the corridor I saw Mr. Morris looking out of a window. -He turned as he heard my footsteps. "How is Art?" he said. Then -noticing my red eyes, he went on, "Ah, I see you have been comforting -him. Poor old fellow! He needs it. No one but a woman can help a -man when he is in trouble of the heart, and he had no one to comfort -him." - -He bore his own trouble so bravely that my heart bled for him. I saw -the manuscript in his hand, and I knew that when he read it he would -realize how much I knew, so I said to him, "I wish I could comfort all -who suffer from the heart. Will you let me be your friend, and will -you come to me for comfort if you need it? You will know later why I -speak." - -He saw that I was in earnest, and stooping, took my hand, and raising -it to his lips, kissed it. It seemed but poor comfort to so brave and -unselfish a soul, and impulsively I bent over and kissed him. The -tears rose in his eyes, and there was a momentary choking in his -throat. He said quite calmly, "Little girl, you will never forget -that true hearted kindness, so long as ever you live!" Then he went -into the study to his friend. - -"Little girl!" The very words he had used to Lucy, and, oh, but he -proved himself a friend. - - - - -CHAPTER 18 - - -DR. SEWARD'S DIARY - -30 September.--I got home at five o'clock, and found that Godalming -and Morris had not only arrived, but had already studied the -transcript of the various diaries and letters which Harker had not yet -returned from his visit to the carriers' men, of whom Dr. Hennessey -had written to me. Mrs. Harker gave us a cup of tea, and I can -honestly say that, for the first time since I have lived in it, this -old house seemed like home. When we had finished, Mrs. Harker said, - -"Dr. Seward, may I ask a favour? I want to see your patient, Mr. -Renfield. Do let me see him. What you have said of him in your diary -interests me so much!" - -She looked so appealing and so pretty that I could not refuse her, and -there was no possible reason why I should, so I took her with me. -When I went into the room, I told the man that a lady would like to see -him, to which he simply answered, "Why?" - -"She is going through the house, and wants to see every one in it," I -answered. - -"Oh, very well," he said, "let her come in, by all means, but just -wait a minute till I tidy up the place." - -His method of tidying was peculiar, he simply swallowed all the flies -and spiders in the boxes before I could stop him. It was quite -evident that he feared, or was jealous of, some interference. When he -had got through his disgusting task, he said cheerfully, "Let the lady -come in," and sat down on the edge of his bed with his head down, but -with his eyelids raised so that he could see her as she entered. For -a moment I thought that he might have some homicidal intent. I -remembered how quiet he had been just before he attacked me in my own -study, and I took care to stand where I could seize him at once if he -attempted to make a spring at her. - -She came into the room with an easy gracefulness which would at once -command the respect of any lunatic, for easiness is one of the -qualities mad people most respect. She walked over to him, smiling -pleasantly, and held out her hand. - -"Good evening, Mr. Renfield," said she. "You see, I know you, for Dr. -Seward has told me of you." He made no immediate reply, but eyed her -all over intently with a set frown on his face. This look gave way to -one of wonder, which merged in doubt, then to my intense astonishment -he said, "You're not the girl the doctor wanted to marry, are you? You -can't be, you know, for she's dead." - -Mrs. Harker smiled sweetly as she replied, "Oh no! I have a husband -of my own, to whom I was married before I ever saw Dr. Seward, or he -me. I am Mrs. Harker." - -"Then what are you doing here?" - -"My husband and I are staying on a visit with Dr. Seward." - -"Then don't stay." - -"But why not?" - -I thought that this style of conversation might not be pleasant to -Mrs. Harker, any more than it was to me, so I joined in, "How did you -know I wanted to marry anyone?" - -His reply was simply contemptuous, given in a pause in which he turned -his eyes from Mrs. Harker to me, instantly turning them back again, -"What an asinine question!" - -"I don't see that at all, Mr. Renfield," said Mrs. Harker, at once -championing me. - -He replied to her with as much courtesy and respect as he had shown -contempt to me, "You will, of course, understand, Mrs. Harker, that -when a man is so loved and honoured as our host is, everything -regarding him is of interest in our little community. Dr. Seward is -loved not only by his household and his friends, but even by his -patients, who, being some of them hardly in mental equilibrium, are -apt to distort causes and effects. Since I myself have been an inmate -of a lunatic asylum, I cannot but notice that the sophistic tendencies -of some of its inmates lean towards the errors of non causa and -ignoratio elenche." - -I positively opened my eyes at this new development. Here was my own -pet lunatic, the most pronounced of his type that I had ever met with, -talking elemental philosophy, and with the manner of a polished -gentleman. I wonder if it was Mrs. Harker's presence which had -touched some chord in his memory. If this new phase was spontaneous, -or in any way due to her unconscious influence, she must have some -rare gift or power. - -We continued to talk for some time, and seeing that he was seemingly -quite reasonable, she ventured, looking at me questioningly as she -began, to lead him to his favourite topic. I was again astonished, -for he addressed himself to the question with the impartiality of -the completest sanity. He even took himself as an example when he -mentioned certain things. - -"Why, I myself am an instance of a man who had a strange belief. -Indeed, it was no wonder that my friends were alarmed, and insisted on -my being put under control. I used to fancy that life was a positive -and perpetual entity, and that by consuming a multitude of live -things, no matter how low in the scale of creation, one might -indefinitely prolong life. At times I held the belief so strongly -that I actually tried to take human life. The doctor here will bear -me out that on one occasion I tried to kill him for the purpose of -strengthening my vital powers by the assimilation with my own body of -his life through the medium of his blood, relying of course, upon the -Scriptural phrase, 'For the blood is the life.' Though, indeed, the -vendor of a certain nostrum has vulgarized the truism to the very -point of contempt. Isn't that true, doctor?" - -I nodded assent, for I was so amazed that I hardly knew what to either -think or say, it was hard to imagine that I had seen him eat up his -spiders and flies not five minutes before. Looking at my watch, I saw -that I should go to the station to meet Van Helsing, so I told Mrs. -Harker that it was time to leave. - -She came at once, after saying pleasantly to Mr. Renfield, "Goodbye, -and I hope I may see you often, under auspices pleasanter to -yourself." - -To which, to my astonishment, he replied, "Goodbye, my dear. I pray -God I may never see your sweet face again. May He bless and keep -you!" - -When I went to the station to meet Van Helsing I left the boys behind -me. Poor Art seemed more cheerful than he has been since Lucy first -took ill, and Quincey is more like his own bright self than he has -been for many a long day. - -Van Helsing stepped from the carriage with the eager nimbleness of a -boy. He saw me at once, and rushed up to me, saying, "Ah, friend -John, how goes all? Well? So! I have been busy, for I come here to -stay if need be. All affairs are settled with me, and I have much to -tell. Madam Mina is with you? Yes. And her so fine husband? And -Arthur and my friend Quincey, they are with you, too? Good!" - -As I drove to the house I told him of what had passed, and of how my -own diary had come to be of some use through Mrs. Harker's suggestion, -at which the Professor interrupted me. - -"Ah, that wonderful Madam Mina! She has man's brain, a brain that a -man should have were he much gifted, and a woman's heart. The good -God fashioned her for a purpose, believe me, when He made that so good -combination. Friend John, up to now fortune has made that woman of -help to us, after tonight she must not have to do with this so -terrible affair. It is not good that she run a risk so great. We men -are determined, nay, are we not pledged, to destroy this monster? But -it is no part for a woman. Even if she be not harmed, her heart may -fail her in so much and so many horrors and hereafter she may suffer, -both in waking, from her nerves, and in sleep, from her dreams. And, -besides, she is young woman and not so long married, there may be -other things to think of some time, if not now. You tell me she has -wrote all, then she must consult with us, but tomorrow she say goodbye -to this work, and we go alone." - -I agreed heartily with him, and then I told him what we had found in -his absence, that the house which Dracula had bought was the very next -one to my own. He was amazed, and a great concern seemed to come on -him. - -"Oh that we had known it before!" he said, "for then we might have -reached him in time to save poor Lucy. However, 'the milk that is -spilt cries not out afterwards,' as you say. We shall not think of -that, but go on our way to the end." Then he fell into a silence that -lasted till we entered my own gateway. Before we went to prepare for -dinner he said to Mrs. Harker, "I am told, Madam Mina, by my friend -John that you and your husband have put up in exact order all things -that have been, up to this moment." - -"Not up to this moment, Professor," she said impulsively, "but up to -this morning." - -"But why not up to now? We have seen hitherto how good light all the -little things have made. We have told our secrets, and yet no one who -has told is the worse for it." - -Mrs. Harker began to blush, and taking a paper from her pockets, she -said, "Dr. Van Helsing, will you read this, and tell me if it must go -in. It is my record of today. I too have seen the need of putting -down at present everything, however trivial, but there is little in -this except what is personal. Must it go in?" - -The Professor read it over gravely, and handed it back, saying, "It -need not go in if you do not wish it, but I pray that it may. It can -but make your husband love you the more, and all us, your friends, -more honour you, as well as more esteem and love." She took it back -with another blush and a bright smile. - -And so now, up to this very hour, all the records we have are complete -and in order. The Professor took away one copy to study after dinner, -and before our meeting, which is fixed for nine o'clock. The rest of -us have already read everything, so when we meet in the study we shall -all be informed as to facts, and can arrange our plan of battle with -this terrible and mysterious enemy. - - - - - -MINA HARKER'S JOURNAL - -30 September.--When we met in Dr. Seward's study two hours after -dinner, which had been at six o'clock, we unconsciously formed a sort -of board or committee. Professor Van Helsing took the head of the -table, to which Dr. Seward motioned him as he came into the room. He -made me sit next to him on his right, and asked me to act as -secretary. Jonathan sat next to me. Opposite us were Lord Godalming, -Dr. Seward, and Mr. Morris, Lord Godalming being next the Professor, -and Dr. Seward in the centre. - -The Professor said, "I may, I suppose, take it that we are all -acquainted with the facts that are in these papers." We all expressed -assent, and he went on, "Then it were, I think, good that I tell you -something of the kind of enemy with which we have to deal. I shall -then make known to you something of the history of this man, which has -been ascertained for me. So we then can discuss how we shall act, and -can take our measure according. - -"There are such beings as vampires, some of us have evidence that they -exist. Even had we not the proof of our own unhappy experience, the -teachings and the records of the past give proof enough for sane -peoples. I admit that at the first I was sceptic. Were it not that -through long years I have trained myself to keep an open mind, I could -not have believed until such time as that fact thunder on my ear. 'See! -See! I prove, I prove.' Alas! Had I known at first what now I know, -nay, had I even guess at him, one so precious life had been spared to -many of us who did love her. But that is gone, and we must so work, -that other poor souls perish not, whilst we can save. The nosferatu -do not die like the bee when he sting once. He is only stronger, and -being stronger, have yet more power to work evil. This vampire which -is amongst us is of himself so strong in person as twenty men, he is -of cunning more than mortal, for his cunning be the growth of ages, he -have still the aids of necromancy, which is, as his etymology imply, -the divination by the dead, and all the dead that he can come nigh to -are for him at command; he is brute, and more than brute; he is devil -in callous, and the heart of him is not; he can, within his range, -direct the elements, the storm, the fog, the thunder; he can command -all the meaner things, the rat, and the owl, and the bat, the moth, -and the fox, and the wolf, he can grow and become small; and he can at -times vanish and come unknown. How then are we to begin our strike to -destroy him? How shall we find his where, and having found it, how -can we destroy? My friends, this is much, it is a terrible task that -we undertake, and there may be consequence to make the brave shudder. -For if we fail in this our fight he must surely win, and then where -end we? Life is nothings, I heed him not. But to fail here, is not -mere life or death. It is that we become as him, that we henceforward -become foul things of the night like him, without heart or conscience, -preying on the bodies and the souls of those we love best. To us -forever are the gates of heaven shut, for who shall open them to us -again? We go on for all time abhorred by all, a blot on the face of -God's sunshine, an arrow in the side of Him who died for man. But we -are face to face with duty, and in such case must we shrink? For me, -I say no, but then I am old, and life, with his sunshine, his fair -places, his song of birds, his music and his love, lie far behind. You -others are young. Some have seen sorrow, but there are fair days yet -in store. What say you?" - -Whilst he was speaking, Jonathan had taken my hand. I feared, oh so -much, that the appalling nature of our danger was overcoming him when -I saw his hand stretch out, but it was life to me to feel its touch, -so strong, so self reliant, so resolute. A brave man's hand can speak -for itself, it does not even need a woman's love to hear its music. - -When the Professor had done speaking my husband looked in my eyes, and -I in his, there was no need for speaking between us. - -"I answer for Mina and myself," he said. - -"Count me in, Professor," said Mr. Quincey Morris, laconically as -usual. - -"I am with you," said Lord Godalming, "for Lucy's sake, if for no -other reason." - -Dr. Seward simply nodded. - -The Professor stood up and, after laying his golden crucifix on the -table, held out his hand on either side. I took his right hand, and -Lord Godalming his left, Jonathan held my right with his left and -stretched across to Mr. Morris. So as we all took hands our solemn -compact was made. I felt my heart icy cold, but it did not even occur -to me to draw back. We resumed our places, and Dr. Van Helsing went -on with a sort of cheerfulness which showed that the serious work had -begun. It was to be taken as gravely, and in as businesslike a way, -as any other transaction of life. - -"Well, you know what we have to contend against, but we too, are not -without strength. We have on our side power of combination, a power -denied to the vampire kind, we have sources of science, we are free to -act and think, and the hours of the day and the night are ours -equally. In fact, so far as our powers extend, they are unfettered, -and we are free to use them. We have self devotion in a cause and an -end to achieve which is not a selfish one. These things are much. - -"Now let us see how far the general powers arrayed against us are -restrict, and how the individual cannot. In fine, let us consider the -limitations of the vampire in general, and of this one in particular. - -"All we have to go upon are traditions and superstitions. These do -not at the first appear much, when the matter is one of life and -death, nay of more than either life or death. Yet must we be -satisfied, in the first place because we have to be, no other means is -at our control, and secondly, because, after all these things, -tradition and superstition, are everything. Does not the belief in -vampires rest for others, though not, alas! for us, on them? A year -ago which of us would have received such a possibility, in the midst -of our scientific, sceptical, matter-of-fact nineteenth century? We -even scouted a belief that we saw justified under our very eyes. Take -it, then, that the vampire, and the belief in his limitations and his -cure, rest for the moment on the same base. For, let me tell you, he -is known everywhere that men have been. In old Greece, in old Rome, -he flourish in Germany all over, in France, in India, even in the -Chermosese, and in China, so far from us in all ways, there even is -he, and the peoples for him at this day. He have follow the wake of -the berserker Icelander, the devil-begotten Hun, the Slav, the Saxon, -the Magyar. - -"So far, then, we have all we may act upon, and let me tell you that -very much of the beliefs are justified by what we have seen in our own -so unhappy experience. The vampire live on, and cannot die by mere -passing of the time, he can flourish when that he can fatten on the -blood of the living. Even more, we have seen amongst us that he can -even grow younger, that his vital faculties grow strenuous, and seem -as though they refresh themselves when his special pabulum is plenty. - -"But he cannot flourish without this diet, he eat not as others. Even -friend Jonathan, who lived with him for weeks, did never see him eat, -never! He throws no shadow, he make in the mirror no reflect, as -again Jonathan observe. He has the strength of many of his hand, -witness again Jonathan when he shut the door against the wolves, and -when he help him from the diligence too. He can transform himself to -wolf, as we gather from the ship arrival in Whitby, when he tear open -the dog, he can be as bat, as Madam Mina saw him on the window at -Whitby, and as friend John saw him fly from this so near house, and as -my friend Quincey saw him at the window of Miss Lucy. - -"He can come in mist which he create, that noble ship's captain proved -him of this, but, from what we know, the distance he can make this -mist is limited, and it can only be round himself. - -"He come on moonlight rays as elemental dust, as again Jonathan saw -those sisters in the castle of Dracula. He become so small, we -ourselves saw Miss Lucy, ere she was at peace, slip through a -hairbreadth space at the tomb door. He can, when once he find his -way, come out from anything or into anything, no matter how close it -be bound or even fused up with fire, solder you call it. He can see -in the dark, no small power this, in a world which is one half shut -from the light. Ah, but hear me through. - -"He can do all these things, yet he is not free. Nay, he is even more -prisoner than the slave of the galley, than the madman in his cell. -He cannot go where he lists, he who is not of nature has yet to obey -some of nature's laws, why we know not. He may not enter anywhere at -the first, unless there be some one of the household who bid him to -come, though afterwards he can come as he please. His power ceases, -as does that of all evil things, at the coming of the day. - -"Only at certain times can he have limited freedom. If he be not at -the place whither he is bound, he can only change himself at noon or -at exact sunrise or sunset. These things we are told, and in this -record of ours we have proof by inference. Thus, whereas he can do as -he will within his limit, when he have his earth-home, his -coffin-home, his hell-home, the place unhallowed, as we saw when he -went to the grave of the suicide at Whitby, still at other time he can -only change when the time come. It is said, too, that he can only -pass running water at the slack or the flood of the tide. Then there -are things which so afflict him that he has no power, as the garlic -that we know of, and as for things sacred, as this symbol, my -crucifix, that was amongst us even now when we resolve, to them he is -nothing, but in their presence he take his place far off and silent -with respect. There are others, too, which I shall tell you of, lest -in our seeking we may need them. - -"The branch of wild rose on his coffin keep him that he move not from -it, a sacred bullet fired into the coffin kill him so that he be true -dead, and as for the stake through him, we know already of its peace, -or the cut off head that giveth rest. We have seen it with our eyes. - -"Thus when we find the habitation of this man-that-was, we can confine -him to his coffin and destroy him, if we obey what we know. But he is -clever. I have asked my friend Arminius, of Buda-Pesth University, to -make his record, and from all the means that are, he tell me of what -he has been. He must, indeed, have been that Voivode Dracula who won -his name against the Turk, over the great river on the very frontier -of Turkeyland. If it be so, then was he no common man, for in that -time, and for centuries after, he was spoken of as the cleverest and -the most cunning, as well as the bravest of the sons of the 'land -beyond the forest.' That mighty brain and that iron resolution went -with him to his grave, and are even now arrayed against us. The -Draculas were, says Arminius, a great and noble race, though now and -again were scions who were held by their coevals to have had dealings -with the Evil One. They learned his secrets in the Scholomance, -amongst the mountains over Lake Hermanstadt, where the devil claims -the tenth scholar as his due. In the records are such words as -'stregoica' witch, 'ordog' and 'pokol' Satan and hell, and in one -manuscript this very Dracula is spoken of as 'wampyr,' which we all -understand too well. There have been from the loins of this very one -great men and good women, and their graves make sacred the earth where -alone this foulness can dwell. For it is not the least of its terrors -that this evil thing is rooted deep in all good, in soil barren of -holy memories it cannot rest." - -Whilst they were talking Mr. Morris was looking steadily at the -window, and he now got up quietly, and went out of the room. There -was a little pause, and then the Professor went on. - -"And now we must settle what we do. We have here much data, and we -must proceed to lay out our campaign. We know from the inquiry of -Jonathan that from the castle to Whitby came fifty boxes of earth, all -of which were delivered at Carfax, we also know that at least some of -these boxes have been removed. It seems to me, that our first step -should be to ascertain whether all the rest remain in the house beyond -that wall where we look today, or whether any more have been removed. -If the latter, we must trace . . ." - -Here we were interrupted in a very startling way. Outside the house -came the sound of a pistol shot, the glass of the window was shattered -with a bullet, which ricochetting from the top of the embrasure, -struck the far wall of the room. I am afraid I am at heart a coward, -for I shrieked out. The men all jumped to their feet, Lord Godalming -flew over to the window and threw up the sash. As he did so we heard -Mr. Morris' voice without, "Sorry! I fear I have alarmed you. I -shall come in and tell you about it." - -A minute later he came in and said, "It was an idiotic thing of me to -do, and I ask your pardon, Mrs. Harker, most sincerely, I fear I must -have frightened you terribly. But the fact is that whilst the -Professor was talking there came a big bat and sat on the window sill. -I have got such a horror of the damned brutes from recent events that -I cannot stand them, and I went out to have a shot, as I have been -doing of late of evenings, whenever I have seen one. You used to -laugh at me for it then, Art." - -"Did you hit it?" asked Dr. Van Helsing. - -"I don't know, I fancy not, for it flew away into the wood." Without -saying any more he took his seat, and the Professor began to resume -his statement. - -"We must trace each of these boxes, and when we are ready, we must -either capture or kill this monster in his lair, or we must, so to -speak, sterilize the earth, so that no more he can seek safety in it. -Thus in the end we may find him in his form of man between the hours -of noon and sunset, and so engage with him when he is at his most -weak. - -"And now for you, Madam Mina, this night is the end until all be well. -You are too precious to us to have such risk. When we part tonight, -you no more must question. We shall tell you all in good time. We -are men and are able to bear, but you must be our star and our hope, -and we shall act all the more free that you are not in the danger, -such as we are." - -All the men, even Jonathan, seemed relieved, but it did not seem to me -good that they should brave danger and, perhaps lessen their safety, -strength being the best safety, through care of me, but their minds -were made up, and though it was a bitter pill for me to swallow, I -could say nothing, save to accept their chivalrous care of me. - -Mr. Morris resumed the discussion, "As there is no time to lose, I -vote we have a look at his house right now. Time is everything with -him, and swift action on our part may save another victim." - -I own that my heart began to fail me when the time for action came so -close, but I did not say anything, for I had a greater fear that if I -appeared as a drag or a hindrance to their work, they might even leave -me out of their counsels altogether. They have now gone off to -Carfax, with means to get into the house. - -Manlike, they had told me to go to bed and sleep, as if a woman can -sleep when those she loves are in danger! I shall lie down, and -pretend to sleep, lest Jonathan have added anxiety about me when he -returns. - - - - -DR. SEWARD'S DIARY - -1 October, 4 A.M.--Just as we were about to leave the house, an urgent -message was brought to me from Renfield to know if I would see him at -once, as he had something of the utmost importance to say to me. I -told the messenger to say that I would attend to his wishes in the -morning, I was busy just at the moment. - -The attendant added, "He seems very importunate, sir. I have never -seen him so eager. I don't know but what, if you don't see him soon, -he will have one of his violent fits." I knew the man would not have -said this without some cause, so I said, "All right, I'll go now," and -I asked the others to wait a few minutes for me, as I had to go and -see my patient. - -"Take me with you, friend John," said the Professor. "His case in your -diary interest me much, and it had bearing, too, now and again on our -case. I should much like to see him, and especial when his mind is -disturbed." - -"May I come also?" asked Lord Godalming. - -"Me too?" said Quincey Morris. "May I come?" said Harker. I nodded, -and we all went down the passage together. - -We found him in a state of considerable excitement, but far more -rational in his speech and manner than I had ever seen him. There was -an unusual understanding of himself, which was unlike anything I had -ever met with in a lunatic, and he took it for granted that his -reasons would prevail with others entirely sane. We all five went -into the room, but none of the others at first said anything. His -request was that I would at once release him from the asylum and send -him home. This he backed up with arguments regarding his complete -recovery, and adduced his own existing sanity. - -"I appeal to your friends," he said, "they will, perhaps, not mind -sitting in judgement on my case. By the way, you have not introduced -me." - -I was so much astonished, that the oddness of introducing a madman in -an asylum did not strike me at the moment, and besides, there was a -certain dignity in the man's manner, so much of the habit of equality, -that I at once made the introduction, "Lord Godalming, Professor Van -Helsing, Mr. Quincey Morris, of Texas, Mr. Jonathan Harker, Mr. -Renfield." - -He shook hands with each of them, saying in turn, "Lord Godalming, I -had the honour of seconding your father at the Windham; I grieve to -know, by your holding the title, that he is no more. He was a man -loved and honoured by all who knew him, and in his youth was, I have -heard, the inventor of a burnt rum punch, much patronized on Derby -night. Mr. Morris, you should be proud of your great state. Its -reception into the Union was a precedent which may have far-reaching -effects hereafter, when the Pole and the Tropics may hold alliance to -the Stars and Stripes. The power of Treaty may yet prove a vast -engine of enlargement, when the Monroe doctrine takes its true place -as a political fable. What shall any man say of his pleasure at -meeting Van Helsing? Sir, I make no apology for dropping all forms of -conventional prefix. When an individual has revolutionized -therapeutics by his discovery of the continuous evolution of brain -matter, conventional forms are unfitting, since they would seem to -limit him to one of a class. You, gentlemen, who by nationality, by -heredity, or by the possession of natural gifts, are fitted to hold -your respective places in the moving world, I take to witness that I -am as sane as at least the majority of men who are in full possession -of their liberties. And I am sure that you, Dr. Seward, humanitarian -and medico-jurist as well as scientist, will deem it a moral duty to -deal with me as one to be considered as under exceptional -circumstances." He made this last appeal with a courtly air of -conviction which was not without its own charm. - -I think we were all staggered. For my own part, I was under the -conviction, despite my knowledge of the man's character and history, -that his reason had been restored, and I felt under a strong impulse -to tell him that I was satisfied as to his sanity, and would see about -the necessary formalities for his release in the morning. I thought -it better to wait, however, before making so grave a statement, for of -old I knew the sudden changes to which this particular patient was -liable. So I contented myself with making a general statement that he -appeared to be improving very rapidly, that I would have a longer chat -with him in the morning, and would then see what I could do in the -direction of meeting his wishes. - -This did not at all satisfy him, for he said quickly, "But I fear, Dr. -Seward, that you hardly apprehend my wish. I desire to go at once, -here, now, this very hour, this very moment, if I may. Time presses, -and in our implied agreement with the old scytheman it is of the -essence of the contract. I am sure it is only necessary to put before -so admirable a practitioner as Dr. Seward so simple, yet so momentous -a wish, to ensure its fulfilment." - -He looked at me keenly, and seeing the negative in my face, turned to -the others, and scrutinized them closely. Not meeting any sufficient -response, he went on, "Is it possible that I have erred in my -supposition?" - -"You have," I said frankly, but at the same time, as I felt, brutally. - -There was a considerable pause, and then he said slowly, "Then I -suppose I must only shift my ground of request. Let me ask for this -concession, boon, privilege, what you will. I am content to implore -in such a case, not on personal grounds, but for the sake of others. I -am not at liberty to give you the whole of my reasons, but you may, I -assure you, take it from me that they are good ones, sound and -unselfish, and spring from the highest sense of duty. - -"Could you look, sir, into my heart, you would approve to the full the -sentiments which animate me. Nay, more, you would count me amongst -the best and truest of your friends." - -Again he looked at us all keenly. I had a growing conviction that -this sudden change of his entire intellectual method was but yet -another phase of his madness, and so determined to let him go on a -little longer, knowing from experience that he would, like all -lunatics, give himself away in the end. Van Helsing was gazing at him -with a look of utmost intensity, his bushy eyebrows almost meeting -with the fixed concentration of his look. He said to Renfield in a -tone which did not surprise me at the time, but only when I thought of -it afterwards, for it was as of one addressing an equal, "Can you not -tell frankly your real reason for wishing to be free tonight? I will -undertake that if you will satisfy even me, a stranger, without -prejudice, and with the habit of keeping an open mind, Dr. Seward will -give you, at his own risk and on his own responsibility, the privilege -you seek." - -He shook his head sadly, and with a look of poignant regret on his -face. The Professor went on, "Come, sir, bethink yourself. You claim -the privilege of reason in the highest degree, since you seek to -impress us with your complete reasonableness. You do this, whose -sanity we have reason to doubt, since you are not yet released from -medical treatment for this very defect. If you will not help us in -our effort to choose the wisest course, how can we perform the duty -which you yourself put upon us? Be wise, and help us, and if we can -we shall aid you to achieve your wish." - -He still shook his head as he said, "Dr. Van Helsing, I have nothing to -say. Your argument is complete, and if I were free to speak I should -not hesitate a moment, but I am not my own master in the matter. I -can only ask you to trust me. If I am refused, the responsibility -does not rest with me." - -I thought it was now time to end the scene, which was becoming too -comically grave, so I went towards the door, simply saying, "Come, my -friends, we have work to do. Goodnight." - -As, however, I got near the door, a new change came over the patient. -He moved towards me so quickly that for the moment I feared that he -was about to make another homicidal attack. My fears, however, were -groundless, for he held up his two hands imploringly, and made his -petition in a moving manner. As he saw that the very excess of his -emotion was militating against him, by restoring us more to our old -relations, he became still more demonstrative. I glanced at Van -Helsing, and saw my conviction reflected in his eyes, so I became a -little more fixed in my manner, if not more stern, and motioned to him -that his efforts were unavailing. I had previously seen something of -the same constantly growing excitement in him when he had to make some -request of which at the time he had thought much, such for instance, -as when he wanted a cat, and I was prepared to see the collapse into -the same sullen acquiescence on this occasion. - -My expectation was not realized, for when he found that his appeal -would not be successful, he got into quite a frantic condition. He -threw himself on his knees, and held up his hands, wringing them in -plaintive supplication, and poured forth a torrent of entreaty, with -the tears rolling down his cheeks, and his whole face and form -expressive of the deepest emotion. - -"Let me entreat you, Dr. Seward, oh, let me implore you, to let me out -of this house at once. Send me away how you will and where you will, -send keepers with me with whips and chains, let them take me in a -strait waistcoat, manacled and leg-ironed, even to gaol, but let me go -out of this. You don't know what you do by keeping me here. I am -speaking from the depths of my heart, of my very soul. You don't know -whom you wrong, or how, and I may not tell. Woe is me! I may not -tell. By all you hold sacred, by all you hold dear, by your love that -is lost, by your hope that lives, for the sake of the Almighty, take -me out of this and save my soul from guilt! Can't you hear me, man? -Can't you understand? Will you never learn? Don't you know that I am -sane and earnest now, that I am no lunatic in a mad fit, but a sane -man fighting for his soul? Oh, hear me! Hear me! Let me go, let me -go, let me go!" - -I thought that the longer this went on the wilder he would get, and so -would bring on a fit, so I took him by the hand and raised him up. - -"Come," I said sternly, "no more of this, we have had quite enough -already. Get to your bed and try to behave more discreetly." - -He suddenly stopped and looked at me intently for several moments. -Then, without a word, he rose and moving over, sat down on the side of -the bed. The collapse had come, as on former occasions, just as I had -expected. - -When I was leaving the room, last of our party, he said to me in a -quiet, well-bred voice, "You will, I trust, Dr. Seward, do me the -justice to bear in mind, later on, that I did what I could to convince -you tonight." - - - - -CHAPTER 19 - - -JONATHAN HARKER'S JOURNAL - -1 October, 5 A.M.--I went with the party to the search with an easy -mind, for I think I never saw Mina so absolutely strong and well. I -am so glad that she consented to hold back and let us men do the work. -Somehow, it was a dread to me that she was in this fearful business at -all, but now that her work is done, and that it is due to her energy -and brains and foresight that the whole story is put together in such -a way that every point tells, she may well feel that her part is -finished, and that she can henceforth leave the rest to us. We were, -I think, all a little upset by the scene with Mr. Renfield. When we -came away from his room we were silent till we got back to the study. - -Then Mr. Morris said to Dr. Seward, "Say, Jack, if that man wasn't -attempting a bluff, he is about the sanest lunatic I ever saw. I'm -not sure, but I believe that he had some serious purpose, and if he -had, it was pretty rough on him not to get a chance." - -Lord Godalming and I were silent, but Dr. Van Helsing added, "Friend -John, you know more lunatics than I do, and I'm glad of it, for I fear -that if it had been to me to decide I would before that last -hysterical outburst have given him free. But we live and learn, and -in our present task we must take no chance, as my friend Quincey would -say. All is best as they are." - -Dr. Seward seemed to answer them both in a dreamy kind of way, "I -don't know but that I agree with you. If that man had been an -ordinary lunatic I would have taken my chance of trusting him, but he -seems so mixed up with the Count in an indexy kind of way that I am -afraid of doing anything wrong by helping his fads. I can't forget -how he prayed with almost equal fervor for a cat, and then tried to -tear my throat out with his teeth. Besides, he called the Count 'lord -and master', and he may want to get out to help him in some diabolical -way. That horrid thing has the wolves and the rats and his own kind -to help him, so I suppose he isn't above trying to use a respectable -lunatic. He certainly did seem earnest, though. I only hope we have -done what is best. These things, in conjunction with the wild work we -have in hand, help to unnerve a man." - -The Professor stepped over, and laying his hand on his shoulder, said -in his grave, kindly way, "Friend John, have no fear. We are trying -to do our duty in a very sad and terrible case, we can only do as we -deem best. What else have we to hope for, except the pity of the good -God?" - -Lord Godalming had slipped away for a few minutes, but now he -returned. He held up a little silver whistle as he remarked, "That -old place may be full of rats, and if so, I've got an antidote on -call." - -Having passed the wall, we took our way to the house, taking care to -keep in the shadows of the trees on the lawn when the moonlight shone -out. When we got to the porch the Professor opened his bag and took -out a lot of things, which he laid on the step, sorting them into four -little groups, evidently one for each. Then he spoke. - -"My friends, we are going into a terrible danger, and we need arms of -many kinds. Our enemy is not merely spiritual. Remember that he has -the strength of twenty men, and that, though our necks or our -windpipes are of the common kind, and therefore breakable or -crushable, his are not amenable to mere strength. A stronger man, or -a body of men more strong in all than him, can at certain times hold -him, but they cannot hurt him as we can be hurt by him. We must, -therefore, guard ourselves from his touch. Keep this near your -heart." As he spoke he lifted a little silver crucifix and held it -out to me, I being nearest to him, "put these flowers round your -neck," here he handed to me a wreath of withered garlic blossoms, "for -other enemies more mundane, this revolver and this knife, and for aid -in all, these so small electric lamps, which you can fasten to your -breast, and for all, and above all at the last, this, which we must -not desecrate needless." - -This was a portion of Sacred Wafer, which he put in an envelope and -handed to me. Each of the others was similarly equipped. - -"Now," he said, "friend John, where are the skeleton keys? If so that -we can open the door, we need not break house by the window, as before -at Miss Lucy's." - -Dr. Seward tried one or two skeleton keys, his mechanical dexterity as -a surgeon standing him in good stead. Presently he got one to suit, -after a little play back and forward the bolt yielded, and with a -rusty clang, shot back. We pressed on the door, the rusty hinges -creaked, and it slowly opened. It was startlingly like the image -conveyed to me in Dr. Seward's diary of the opening of Miss Westenra's -tomb, I fancy that the same idea seemed to strike the others, for with -one accord they shrank back. The Professor was the first to move -forward, and stepped into the open door. - -"In manus tuas, Domine!" he said, crossing himself as he passed over -the threshold. We closed the door behind us, lest when we should have -lit our lamps we should possibly attract attention from the road. The -Professor carefully tried the lock, lest we might not be able to open -it from within should we be in a hurry making our exit. Then we all -lit our lamps and proceeded on our search. - -The light from the tiny lamps fell in all sorts of odd forms, as the -rays crossed each other, or the opacity of our bodies threw great -shadows. I could not for my life get away from the feeling that there -was someone else amongst us. I suppose it was the recollection, so -powerfully brought home to me by the grim surroundings, of that -terrible experience in Transylvania. I think the feeling was common -to us all, for I noticed that the others kept looking over their -shoulders at every sound and every new shadow, just as I felt myself -doing. - -The whole place was thick with dust. The floor was seemingly inches -deep, except where there were recent footsteps, in which on holding -down my lamp I could see marks of hobnails where the dust was cracked. -The walls were fluffy and heavy with dust, and in the corners were -masses of spider's webs, whereon the dust had gathered till they -looked like old tattered rags as the weight had torn them partly down. -On a table in the hall was a great bunch of keys, with a time-yellowed -label on each. They had been used several times, for on the table -were several similar rents in the blanket of dust, similar to that -exposed when the Professor lifted them. - -He turned to me and said, "You know this place, Jonathan. You have -copied maps of it, and you know it at least more than we do. Which is -the way to the chapel?" - -I had an idea of its direction, though on my former visit I had not -been able to get admission to it, so I led the way, and after a few -wrong turnings found myself opposite a low, arched oaken door, ribbed -with iron bands. - -"This is the spot," said the Professor as he turned his lamp on a -small map of the house, copied from the file of my original -correspondence regarding the purchase. With a little trouble we found -the key on the bunch and opened the door. We were prepared for some -unpleasantness, for as we were opening the door a faint, malodorous -air seemed to exhale through the gaps, but none of us ever expected -such an odour as we encountered. None of the others had met the Count -at all at close quarters, and when I had seen him he was either in the -fasting stage of his existence in his rooms or, when he was bloated -with fresh blood, in a ruined building open to the air, but here the -place was small and close, and the long disuse had made the air -stagnant and foul. There was an earthy smell, as of some dry miasma, -which came through the fouler air. But as to the odour itself, how -shall I describe it? It was not alone that it was composed of all the -ills of mortality and with the pungent, acrid smell of blood, but it -seemed as though corruption had become itself corrupt. Faugh! It -sickens me to think of it. Every breath exhaled by that monster -seemed to have clung to the place and intensified its loathsomeness. - -Under ordinary circumstances such a stench would have brought our -enterprise to an end, but this was no ordinary case, and the high and -terrible purpose in which we were involved gave us a strength which -rose above merely physical considerations. After the involuntary -shrinking consequent on the first nauseous whiff, we one and all set -about our work as though that loathsome place were a garden of roses. - -We made an accurate examination of the place, the Professor saying as -we began, "The first thing is to see how many of the boxes are left, -we must then examine every hole and corner and cranny and see if we -cannot get some clue as to what has become of the rest." - -A glance was sufficient to show how many remained, for the great earth -chests were bulky, and there was no mistaking them. - -There were only twenty-nine left out of the fifty! Once I got a -fright, for, seeing Lord Godalming suddenly turn and look out of the -vaulted door into the dark passage beyond, I looked too, and for an -instant my heart stood still. Somewhere, looking out from the shadow, -I seemed to see the high lights of the Count's evil face, the ridge of -the nose, the red eyes, the red lips, the awful pallor. It was only -for a moment, for, as Lord Godalming said, "I thought I saw a face, -but it was only the shadows," and resumed his inquiry, I turned my -lamp in the direction, and stepped into the passage. There was no -sign of anyone, and as there were no corners, no doors, no aperture of -any kind, but only the solid walls of the passage, there could be no -hiding place even for him. I took it that fear had helped -imagination, and said nothing. - -A few minutes later I saw Morris step suddenly back from a corner, -which he was examining. We all followed his movements with our eyes, -for undoubtedly some nervousness was growing on us, and we saw a whole -mass of phosphorescence, which twinkled like stars. We all -instinctively drew back. The whole place was becoming alive with -rats. - -For a moment or two we stood appalled, all save Lord Godalming, who -was seemingly prepared for such an emergency. Rushing over to the -great iron-bound oaken door, which Dr. Seward had described from the -outside, and which I had seen myself, he turned the key in the lock, -drew the huge bolts, and swung the door open. Then, taking his little -silver whistle from his pocket, he blew a low, shrill call. It was -answered from behind Dr. Seward's house by the yelping of dogs, and -after about a minute three terriers came dashing round the corner of -the house. Unconsciously we had all moved towards the door, and as we -moved I noticed that the dust had been much disturbed. The boxes -which had been taken out had been brought this way. But even in the -minute that had elapsed the number of the rats had vastly increased. -They seemed to swarm over the place all at once, till the lamplight, -shining on their moving dark bodies and glittering, baleful eyes, made -the place look like a bank of earth set with fireflies. The dogs -dashed on, but at the threshold suddenly stopped and snarled, and -then, simultaneously lifting their noses, began to howl in most -lugubrious fashion. The rats were multiplying in thousands, and we -moved out. - -Lord Godalming lifted one of the dogs, and carrying him in, placed him -on the floor. The instant his feet touched the ground he seemed to -recover his courage, and rushed at his natural enemies. They fled -before him so fast that before he had shaken the life out of a score, -the other dogs, who had by now been lifted in the same manner, had but -small prey ere the whole mass had vanished. - -With their going it seemed as if some evil presence had departed, for -the dogs frisked about and barked merrily as they made sudden darts at -their prostrate foes, and turned them over and over and tossed them in -the air with vicious shakes. We all seemed to find our spirits rise. -Whether it was the purifying of the deadly atmosphere by the opening -of the chapel door, or the relief which we experienced by finding -ourselves in the open I know not, but most certainly the shadow of -dread seemed to slip from us like a robe, and the occasion of our -coming lost something of its grim significance, though we did not -slacken a whit in our resolution. We closed the outer door and barred -and locked it, and bringing the dogs with us, began our search of the -house. We found nothing throughout except dust in extraordinary -proportions, and all untouched save for my own footsteps when I had -made my first visit. Never once did the dogs exhibit any symptom of -uneasiness, and even when we returned to the chapel they frisked about -as though they had been rabbit hunting in a summer wood. - -The morning was quickening in the east when we emerged from the front. -Dr. Van Helsing had taken the key of the hall door from the bunch, and -locked the door in orthodox fashion, putting the key into his pocket -when he had done. - -"So far," he said, "our night has been eminently successful. No harm -has come to us such as I feared might be and yet we have ascertained -how many boxes are missing. More than all do I rejoice that this, our -first, and perhaps our most difficult and dangerous, step has been -accomplished without the bringing thereinto our most sweet Madam Mina -or troubling her waking or sleeping thoughts with sights and sounds -and smells of horror which she might never forget. One lesson, too, -we have learned, if it be allowable to argue a particulari, that the -brute beasts which are to the Count's command are yet themselves not -amenable to his spiritual power, for look, these rats that would come -to his call, just as from his castle top he summon the wolves to your -going and to that poor mother's cry, though they come to him, they run -pell-mell from the so little dogs of my friend Arthur. We have other -matters before us, other dangers, other fears, and that monster . . . -He has not used his power over the brute world for the only or the -last time tonight. So be it that he has gone elsewhere. Good! It -has given us opportunity to cry 'check' in some ways in this chess -game, which we play for the stake of human souls. And now let us go -home. The dawn is close at hand, and we have reason to be content -with our first night's work. It may be ordained that we have many -nights and days to follow, if full of peril, but we must go on, and -from no danger shall we shrink." - -The house was silent when we got back, save for some poor creature who -was screaming away in one of the distant wards, and a low, moaning -sound from Renfield's room. The poor wretch was doubtless torturing -himself, after the manner of the insane, with needless thoughts of -pain. - -I came tiptoe into our own room, and found Mina asleep, breathing so -softly that I had to put my ear down to hear it. She looks paler than -usual. I hope the meeting tonight has not upset her. I am truly -thankful that she is to be left out of our future work, and even of -our deliberations. It is too great a strain for a woman to bear. I -did not think so at first, but I know better now. Therefore I am glad -that it is settled. There may be things which would frighten her to -hear, and yet to conceal them from her might be worse than to tell her -if once she suspected that there was any concealment. Henceforth our -work is to be a sealed book to her, till at least such time as we can -tell her that all is finished, and the earth free from a monster of -the nether world. I daresay it will be difficult to begin to keep -silence after such confidence as ours, but I must be resolute, and -tomorrow I shall keep dark over tonight's doings, and shall refuse to -speak of anything that has happened. I rest on the sofa, so as not to -disturb her. - - -1 October, later.--I suppose it was natural that we should have all -overslept ourselves, for the day was a busy one, and the night had no -rest at all. Even Mina must have felt its exhaustion, for though I -slept till the sun was high, I was awake before her, and had to call -two or three times before she awoke. Indeed, she was so sound asleep -that for a few seconds she did not recognize me, but looked at me with -a sort of blank terror, as one looks who has been waked out of a bad -dream. She complained a little of being tired, and I let her rest -till later in the day. We now know of twenty-one boxes having been -removed, and if it be that several were taken in any of these removals -we may be able to trace them all. Such will, of course, immensely -simplify our labor, and the sooner the matter is attended to the -better. I shall look up Thomas Snelling today. - - - -DR. SEWARD'S DIARY - -1 October.--It was towards noon when I was awakened by the Professor -walking into my room. He was more jolly and cheerful than usual, and -it is quite evident that last night's work has helped to take some of -the brooding weight off his mind. - -After going over the adventure of the night he suddenly said, "Your -patient interests me much. May it be that with you I visit him this -morning? Or if that you are too occupy, I can go alone if it may be. -It is a new experience to me to find a lunatic who talk philosophy, -and reason so sound." - -I had some work to do which pressed, so I told him that if he would go -alone I would be glad, as then I should not have to keep him waiting, -so I called an attendant and gave him the necessary instructions. -Before the Professor left the room I cautioned him against getting any -false impression from my patient. - -"But," he answered, "I want him to talk of himself and of his delusion -as to consuming live things. He said to Madam Mina, as I see in your -diary of yesterday, that he had once had such a belief. Why do you -smile, friend John?" - -"Excuse me," I said, "but the answer is here." I laid my hand on the -typewritten matter. "When our sane and learned lunatic made that very -statement of how he used to consume life, his mouth was actually -nauseous with the flies and spiders which he had eaten just before -Mrs. Harker entered the room." - -Van Helsing smiled in turn. "Good!" he said. "Your memory is true, -friend John. I should have remembered. And yet it is this very -obliquity of thought and memory which makes mental disease such a -fascinating study. Perhaps I may gain more knowledge out of the folly -of this madman than I shall from the teaching of the most wise. Who -knows?" - -I went on with my work, and before long was through that in hand. It -seemed that the time had been very short indeed, but there was Van -Helsing back in the study. - -"Do I interrupt?" he asked politely as he stood at the door. - -"Not at all," I answered. "Come in. My work is finished, and I am -free. I can go with you now, if you like." - -"It is needless, I have seen him!" - -"Well?" - -"I fear that he does not appraise me at much. Our interview was -short. When I entered his room he was sitting on a stool in the -centre, with his elbows on his knees, and his face was the picture of -sullen discontent. I spoke to him as cheerfully as I could, and with -such a measure of respect as I could assume. He made no reply -whatever. 'Don't you know me?' I asked. His answer was not -reassuring: 'I know you well enough; you are the old fool Van -Helsing. I wish you would take yourself and your idiotic brain -theories somewhere else. Damn all thick-headed Dutchmen!' Not a word -more would he say, but sat in his implacable sullenness as indifferent -to me as though I had not been in the room at all. Thus departed for -this time my chance of much learning from this so clever lunatic, so I -shall go, if I may, and cheer myself with a few happy words with that -sweet soul Madam Mina. Friend John, it does rejoice me unspeakable -that she is no more to be pained, no more to be worried with our -terrible things. Though we shall much miss her help, it is better -so." - -"I agree with you with all my heart," I answered earnestly, for I did -not want him to weaken in this matter. "Mrs. Harker is better out of -it. Things are quite bad enough for us, all men of the world, and who -have been in many tight places in our time, but it is no place for a -woman, and if she had remained in touch with the affair, it would in -time infallibly have wrecked her." - -So Van Helsing has gone to confer with Mrs. Harker and Harker, Quincey -and Art are all out following up the clues as to the earth boxes. I -shall finish my round of work and we shall meet tonight. - - - - - -MINA HARKER'S JOURNAL - -1 October.--It is strange to me to be kept in the dark as I am today, -after Jonathan's full confidence for so many years, to see him -manifestly avoid certain matters, and those the most vital of all. -This morning I slept late after the fatigues of yesterday, and though -Jonathan was late too, he was the earlier. He spoke to me before he -went out, never more sweetly or tenderly, but he never mentioned a -word of what had happened in the visit to the Count's house. And yet -he must have known how terribly anxious I was. Poor dear fellow! I -suppose it must have distressed him even more than it did me. They -all agreed that it was best that I should not be drawn further into -this awful work, and I acquiesced. But to think that he keeps -anything from me! And now I am crying like a silly fool, when I know -it comes from my husband's great love and from the good, good wishes -of those other strong men. - -That has done me good. Well, some day Jonathan will tell me all. And -lest it should ever be that he should think for a moment that I kept -anything from him, I still keep my journal as usual. Then if he has -feared of my trust I shall show it to him, with every thought of my -heart put down for his dear eyes to read. I feel strangely sad and -low-spirited today. I suppose it is the reaction from the terrible -excitement. - -Last night I went to bed when the men had gone, simply because they -told me to. I didn't feel sleepy, and I did feel full of devouring -anxiety. I kept thinking over everything that has been ever since -Jonathan came to see me in London, and it all seems like a horrible -tragedy, with fate pressing on relentlessly to some destined end. -Everything that one does seems, no matter how right it may be, to bring -on the very thing which is most to be deplored. If I hadn't gone to -Whitby, perhaps poor dear Lucy would be with us now. She hadn't taken -to visiting the churchyard till I came, and if she hadn't come there -in the day time with me she wouldn't have walked in her sleep. And if -she hadn't gone there at night and asleep, that monster couldn't have -destroyed her as he did. Oh, why did I ever go to Whitby? There now, -crying again! I wonder what has come over me today. I must hide it -from Jonathan, for if he knew that I had been crying twice in one -morning . . . I, who never cried on my own account, and whom he has -never caused to shed a tear, the dear fellow would fret his heart out. -I shall put a bold face on, and if I do feel weepy, he shall never see -it. I suppose it is just one of the lessons that we poor women have -to learn . . . - -I can't quite remember how I fell asleep last night. I remember -hearing the sudden barking of the dogs and a lot of queer sounds, like -praying on a very tumultuous scale, from Mr. Renfield's room, which is -somewhere under this. And then there was silence over everything, -silence so profound that it startled me, and I got up and looked out -of the window. All was dark and silent, the black shadows thrown by -the moonlight seeming full of a silent mystery of their own. Not a -thing seemed to be stirring, but all to be grim and fixed as death or -fate, so that a thin streak of white mist, that crept with almost -imperceptible slowness across the grass towards the house, seemed to -have a sentience and a vitality of its own. I think that the -digression of my thoughts must have done me good, for when I got back -to bed I found a lethargy creeping over me. I lay a while, but could -not quite sleep, so I got out and looked out of the window again. The -mist was spreading, and was now close up to the house, so that I could -see it lying thick against the wall, as though it were stealing up to -the windows. The poor man was more loud than ever, and though I could -not distinguish a word he said, I could in some way recognize in his -tones some passionate entreaty on his part. Then there was the sound -of a struggle, and I knew that the attendants were dealing with him. -I was so frightened that I crept into bed, and pulled the clothes over -my head, putting my fingers in my ears. I was not then a bit sleepy, -at least so I thought, but I must have fallen asleep, for except -dreams, I do not remember anything until the morning, when Jonathan -woke me. I think that it took me an effort and a little time to -realize where I was, and that it was Jonathan who was bending over me. -My dream was very peculiar, and was almost typical of the way that -waking thoughts become merged in, or continued in, dreams. - -I thought that I was asleep, and waiting for Jonathan to come back. I -was very anxious about him, and I was powerless to act, my feet, and -my hands, and my brain were weighted, so that nothing could proceed at -the usual pace. And so I slept uneasily and thought. Then it began -to dawn upon me that the air was heavy, and dank, and cold. I put -back the clothes from my face, and found, to my surprise, that all was -dim around. The gaslight which I had left lit for Jonathan, but -turned down, came only like a tiny red spark through the fog, which -had evidently grown thicker and poured into the room. Then it -occurred to me that I had shut the window before I had come to bed. I -would have got out to make certain on the point, but some leaden -lethargy seemed to chain my limbs and even my will. I lay still and -endured, that was all. I closed my eyes, but could still see through -my eyelids. (It is wonderful what tricks our dreams play us, and how -conveniently we can imagine.) The mist grew thicker and thicker and I -could see now how it came in, for I could see it like smoke, or with -the white energy of boiling water, pouring in, not through the window, -but through the joinings of the door. It got thicker and thicker, -till it seemed as if it became concentrated into a sort of pillar of -cloud in the room, through the top of which I could see the light of -the gas shining like a red eye. Things began to whirl through my -brain just as the cloudy column was now whirling in the room, and -through it all came the scriptural words "a pillar of cloud by day and -of fire by night." Was it indeed such spiritual guidance that was -coming to me in my sleep? But the pillar was composed of both the day -and the night guiding, for the fire was in the red eye, which at the -thought got a new fascination for me, till, as I looked, the fire -divided, and seemed to shine on me through the fog like two red eyes, -such as Lucy told me of in her momentary mental wandering when, on the -cliff, the dying sunlight struck the windows of St. Mary's Church. -Suddenly the horror burst upon me that it was thus that Jonathan had -seen those awful women growing into reality through the whirling mist -in the moonlight, and in my dream I must have fainted, for all became -black darkness. The last conscious effort which imagination made was -to show me a livid white face bending over me out of the mist. - -I must be careful of such dreams, for they would unseat one's reason if -there were too much of them. I would get Dr. Van Helsing or Dr. -Seward to prescribe something for me which would make me sleep, only -that I fear to alarm them. Such a dream at the present time would -become woven into their fears for me. Tonight I shall strive hard to -sleep naturally. If I do not, I shall tomorrow night get them to give -me a dose of chloral, that cannot hurt me for once, and it will give -me a good night's sleep. Last night tired me more than if I had not -slept at all. - - -2 October 10 P.M.--Last night I slept, but did not dream. I must have -slept soundly, for I was not waked by Jonathan coming to bed, but the -sleep has not refreshed me, for today I feel terribly weak and -spiritless. I spent all yesterday trying to read, or lying down -dozing. In the afternoon, Mr. Renfield asked if he might see me. Poor -man, he was very gentle, and when I came away he kissed my hand and -bade God bless me. Some way it affected me much. I am crying when I -think of him. This is a new weakness, of which I must be careful. -Jonathan would be miserable if he knew I had been crying. He and the -others were out till dinner time, and they all came in tired. I did -what I could to brighten them up, and I suppose that the effort did me -good, for I forgot how tired I was. After dinner they sent me to bed, -and all went off to smoke together, as they said, but I knew that they -wanted to tell each other of what had occurred to each during the day. -I could see from Jonathan's manner that he had something important to -communicate. I was not so sleepy as I should have been, so before -they went I asked Dr. Seward to give me a little opiate of some kind, -as I had not slept well the night before. He very kindly made me up a -sleeping draught, which he gave to me, telling me that it would do me -no harm, as it was very mild . . . I have taken it, and am waiting for -sleep, which still keeps aloof. I hope I have not done wrong, for as -sleep begins to flirt with me, a new fear comes: that I may have been -foolish in thus depriving myself of the power of waking. I might want -it. Here comes sleep. Goodnight. - - - - -CHAPTER 20 - - -JONATHAN HARKER'S JOURNAL - -1 October, evening.--I found Thomas Snelling in his house at Bethnal -Green, but unhappily he was not in a condition to remember anything. -The very prospect of beer which my expected coming had opened to him -had proved too much, and he had begun too early on his expected -debauch. I learned, however, from his wife, who seemed a decent, poor -soul, that he was only the assistant of Smollet, who of the two mates -was the responsible person. So off I drove to Walworth, and found Mr. -Joseph Smollet at home and in his shirtsleeves, taking a late tea out -of a saucer. He is a decent, intelligent fellow, distinctly a good, -reliable type of workman, and with a headpiece of his own. He -remembered all about the incident of the boxes, and from a wonderful -dog-eared notebook, which he produced from some mysterious receptacle -about the seat of his trousers, and which had hieroglyphical entries -in thick, half-obliterated pencil, he gave me the destinations of the -boxes. There were, he said, six in the cartload which he took from -Carfax and left at 197 Chicksand Street, Mile End New Town, and -another six which he deposited at Jamaica Lane, Bermondsey. If then -the Count meant to scatter these ghastly refuges of his over London, -these places were chosen as the first of delivery, so that later he -might distribute more fully. The systematic manner in which this was -done made me think that he could not mean to confine himself to two -sides of London. He was now fixed on the far east on the northern -shore, on the east of the southern shore, and on the south. The north -and west were surely never meant to be left out of his diabolical -scheme, let alone the City itself and the very heart of fashionable -London in the south-west and west. I went back to Smollet, and asked -him if he could tell us if any other boxes had been taken from Carfax. - -He replied, "Well guv'nor, you've treated me very 'an'some", I had -given him half a sovereign, "an I'll tell yer all I know. I heard a -man by the name of Bloxam say four nights ago in the 'Are an' 'Ounds, -in Pincher's Alley, as 'ow he an' his mate 'ad 'ad a rare dusty job in -a old 'ouse at Purfleet. There ain't a many such jobs as this 'ere, -an' I'm thinkin' that maybe Sam Bloxam could tell ye summut." - -I asked if he could tell me where to find him. I told him that if he -could get me the address it would be worth another half sovereign to -him. So he gulped down the rest of his tea and stood up, saying that -he was going to begin the search then and there. - -At the door he stopped, and said, "Look 'ere, guv'nor, there ain't no -sense in me a keepin' you 'ere. I may find Sam soon, or I mayn't, but -anyhow he ain't like to be in a way to tell ye much tonight. Sam is a -rare one when he starts on the booze. If you can give me a envelope -with a stamp on it, and put yer address on it, I'll find out where Sam -is to be found and post it ye tonight. But ye'd better be up arter -'im soon in the mornin', never mind the booze the night afore." - -This was all practical, so one of the children went off with a penny -to buy an envelope and a sheet of paper, and to keep the change. When -she came back, I addressed the envelope and stamped it, and when -Smollet had again faithfully promised to post the address when found, -I took my way to home. We're on the track anyhow. I am tired -tonight, and I want to sleep. Mina is fast asleep, and looks a little -too pale. Her eyes look as though she had been crying. Poor dear, -I've no doubt it frets her to be kept in the dark, and it may make her -doubly anxious about me and the others. But it is best as it is. It -is better to be disappointed and worried in such a way now than to -have her nerve broken. The doctors were quite right to insist on her -being kept out of this dreadful business. I must be firm, for on me -this particular burden of silence must rest. I shall not ever enter -on the subject with her under any circumstances. Indeed, It may not -be a hard task, after all, for she herself has become reticent on the -subject, and has not spoken of the Count or his doings ever since we -told her of our decision. - - -2 October, evening--A long and trying and exciting day. By the first -post I got my directed envelope with a dirty scrap of paper enclosed, -on which was written with a carpenter's pencil in a sprawling hand, -"Sam Bloxam, Korkrans, 4 Poters Cort, Bartel Street, Walworth. Arsk -for the depite." - -I got the letter in bed, and rose without waking Mina. She looked -heavy and sleepy and pale, and far from well. I determined not to -wake her, but that when I should return from this new search, I would -arrange for her going back to Exeter. I think she would be happier in -our own home, with her daily tasks to interest her, than in being here -amongst us and in ignorance. I only saw Dr. Seward for a moment, and -told him where I was off to, promising to come back and tell the rest -so soon as I should have found out anything. I drove to Walworth and -found, with some difficulty, Potter's Court. Mr. Smollet's spelling -misled me, as I asked for Poter's Court instead of Potter's Court. -However, when I had found the court, I had no difficulty in -discovering Corcoran's lodging house. - -When I asked the man who came to the door for the "depite," he shook -his head, and said, "I dunno 'im. There ain't no such a person 'ere. -I never 'eard of 'im in all my bloomin' days. Don't believe there -ain't nobody of that kind livin' 'ere or anywheres." - -I took out Smollet's letter, and as I read it it seemed to me that the -lesson of the spelling of the name of the court might guide me. "What -are you?" I asked. - -"I'm the depity," he answered. - -I saw at once that I was on the right track. Phonetic spelling had -again misled me. A half crown tip put the deputy's knowledge at my -disposal, and I learned that Mr. Bloxam, who had slept off the remains -of his beer on the previous night at Corcoran's, had left for his work -at Poplar at five o'clock that morning. He could not tell me where -the place of work was situated, but he had a vague idea that it was -some kind of a "new-fangled ware'us," and with this slender clue I had -to start for Poplar. It was twelve o'clock before I got any -satisfactory hint of such a building, and this I got at a coffee shop, -where some workmen were having their dinner. One of them suggested -that there was being erected at Cross Angel Street a new "cold -storage" building, and as this suited the condition of a "new-fangled -ware'us," I at once drove to it. An interview with a surly gatekeeper -and a surlier foreman, both of whom were appeased with the coin of the -realm, put me on the track of Bloxam. He was sent for on my -suggestion that I was willing to pay his days wages to his foreman for -the privilege of asking him a few questions on a private matter. He -was a smart enough fellow, though rough of speech and bearing. When I -had promised to pay for his information and given him an earnest, he -told me that he had made two journeys between Carfax and a house in -Piccadilly, and had taken from this house to the latter nine great -boxes, "main heavy ones," with a horse and cart hired by him for this -purpose. - -I asked him if he could tell me the number of the house in Piccadilly, -to which he replied, "Well, guv'nor, I forgits the number, but it was -only a few door from a big white church, or somethink of the kind, not -long built. It was a dusty old 'ouse, too, though nothin' to the -dustiness of the 'ouse we tooked the bloomin' boxes from." - -"How did you get in if both houses were empty?" - -"There was the old party what engaged me a waitin' in the 'ouse at -Purfleet. He 'elped me to lift the boxes and put them in the dray. -Curse me, but he was the strongest chap I ever struck, an' him a old -feller, with a white moustache, one that thin you would think he -couldn't throw a shadder." - -How this phrase thrilled through me! - -"Why, 'e took up 'is end o' the boxes like they was pounds of tea, and -me a puffin' an' a blowin' afore I could upend mine anyhow, an' I'm no -chicken, neither." - -"How did you get into the house in Piccadilly?" I asked. - -"He was there too. He must 'a started off and got there afore me, for -when I rung of the bell he kem an' opened the door 'isself an' 'elped -me carry the boxes into the 'all." - -"The whole nine?" I asked. - -"Yus, there was five in the first load an' four in the second. It was -main dry work, an' I don't so well remember 'ow I got 'ome." - -I interrupted him, "Were the boxes left in the hall?" - -"Yus, it was a big 'all, an' there was nothin' else in it." - -I made one more attempt to further matters. "You didn't have any -key?" - -"Never used no key nor nothink. The old gent, he opened the door -'isself an' shut it again when I druv off. I don't remember the last -time, but that was the beer." - -"And you can't remember the number of the house?" - -"No, sir. But ye needn't have no difficulty about that. It's a 'igh -'un with a stone front with a bow on it, an' 'igh steps up to the -door. I know them steps, 'avin' 'ad to carry the boxes up with three -loafers what come round to earn a copper. The old gent give them -shillin's, an' they seein' they got so much, they wanted more. But 'e -took one of them by the shoulder and was like to throw 'im down the -steps, till the lot of them went away cussin'." - -I thought that with this description I could find the house, so having -paid my friend for his information, I started off for Piccadilly. I -had gained a new painful experience. The Count could, it was evident, -handle the earth boxes himself. If so, time was precious, for now -that he had achieved a certain amount of distribution, he could, by -choosing his own time, complete the task unobserved. At Piccadilly -Circus I discharged my cab, and walked westward. Beyond the Junior -Constitutional I came across the house described and was satisfied -that this was the next of the lairs arranged by Dracula. The house -looked as though it had been long untenanted. The windows were -encrusted with dust, and the shutters were up. All the framework was -black with time, and from the iron the paint had mostly scaled away. -It was evident that up to lately there had been a large notice board -in front of the balcony. It had, however, been roughly torn away, the -uprights which had supported it still remaining. Behind the rails of -the balcony I saw there were some loose boards, whose raw edges looked -white. I would have given a good deal to have been able to see the -notice board intact, as it would, perhaps, have given some clue to the -ownership of the house. I remembered my experience of the investigation -and purchase of Carfax, and I could not but feel that if I could find -the former owner there might be some means discovered of gaining access -to the house. - -There was at present nothing to be learned from the Piccadilly side, -and nothing could be done, so I went around to the back to see if -anything could be gathered from this quarter. The mews were active, -the Piccadilly houses being mostly in occupation. I asked one or two -of the grooms and helpers whom I saw around if they could tell me -anything about the empty house. One of them said that he heard it had -lately been taken, but he couldn't say from whom. He told me, -however, that up to very lately there had been a notice board of "For -Sale" up, and that perhaps Mitchell, Sons, & Candy the house agents -could tell me something, as he thought he remembered seeing the name -of that firm on the board. I did not wish to seem too eager, or to -let my informant know or guess too much, so thanking him in the usual -manner, I strolled away. It was now growing dusk, and the autumn -night was closing in, so I did not lose any time. Having learned the -address of Mitchell, Sons, & Candy from a directory at the Berkeley, I -was soon at their office in Sackville Street. - -The gentleman who saw me was particularly suave in manner, but -uncommunicative in equal proportion. Having once told me that the -Piccadilly house, which throughout our interview he called a -"mansion," was sold, he considered my business as concluded. When I -asked who had purchased it, he opened his eyes a thought wider, and -paused a few seconds before replying, "It is sold, sir." - -"Pardon me," I said, with equal politeness, "but I have a special -reason for wishing to know who purchased it." - -Again he paused longer, and raised his eyebrows still more. "It is -sold, sir," was again his laconic reply. - -"Surely," I said, "you do not mind letting me know so much." - -"But I do mind," he answered. "The affairs of their clients are -absolutely safe in the hands of Mitchell, Sons, & Candy." - -This was manifestly a prig of the first water, and there was no use -arguing with him. I thought I had best meet him on his own ground, so -I said, "Your clients, sir, are happy in having so resolute a guardian -of their confidence. I am myself a professional man." - -Here I handed him my card. "In this instance I am not prompted by -curiosity, I act on the part of Lord Godalming, who wishes to know -something of the property which was, he understood, lately for sale." - -These words put a different complexion on affairs. He said, "I would -like to oblige you if I could, Mr. Harker, and especially would I like -to oblige his lordship. We once carried out a small matter of renting -some chambers for him when he was the honourable Arthur Holmwood. If -you will let me have his lordship's address I will consult the House -on the subject, and will, in any case, communicate with his lordship -by tonight's post. It will be a pleasure if we can so far deviate -from our rules as to give the required information to his lordship." - -I wanted to secure a friend, and not to make an enemy, so I thanked -him, gave the address at Dr. Seward's and came away. It was now dark, -and I was tired and hungry. I got a cup of tea at the Aerated Bread -Company and came down to Purfleet by the next train. - -I found all the others at home. Mina was looking tired and pale, but -she made a gallant effort to be bright and cheerful. It wrung my -heart to think that I had had to keep anything from her and so caused -her inquietude. Thank God, this will be the last night of her looking -on at our conferences, and feeling the sting of our not showing our -confidence. It took all my courage to hold to the wise resolution of -keeping her out of our grim task. She seems somehow more reconciled, -or else the very subject seems to have become repugnant to her, for -when any accidental allusion is made she actually shudders. I am glad -we made our resolution in time, as with such a feeling as this, our -growing knowledge would be torture to her. - -I could not tell the others of the day's discovery till we were alone, -so after dinner, followed by a little music to save appearances even -amongst ourselves, I took Mina to her room and left her to go to bed. -The dear girl was more affectionate with me than ever, and clung to me -as though she would detain me, but there was much to be talked of and -I came away. Thank God, the ceasing of telling things has made no -difference between us. - -When I came down again I found the others all gathered round the fire -in the study. In the train I had written my diary so far, and simply -read it off to them as the best means of letting them get abreast of -my own information. - -When I had finished Van Helsing said, "This has been a great day's -work, friend Jonathan. Doubtless we are on the track of the missing -boxes. If we find them all in that house, then our work is near the -end. But if there be some missing, we must search until we find them. -Then shall we make our final coup, and hunt the wretch to his real -death." - -We all sat silent awhile and all at once Mr. Morris spoke, "Say! How -are we going to get into that house?" - -"We got into the other," answered Lord Godalming quickly. - -"But, Art, this is different. We broke house at Carfax, but we had -night and a walled park to protect us. It will be a mighty different -thing to commit burglary in Piccadilly, either by day or night. I -confess I don't see how we are going to get in unless that agency duck -can find us a key of some sort." - -Lord Godalming's brows contracted, and he stood up and walked about the -room. By-and-by he stopped and said, turning from one to another of -us, "Quincey's head is level. This burglary business is getting -serious. We got off once all right, but we have now a rare job on -hand. Unless we can find the Count's key basket." - -As nothing could well be done before morning, and as it would be at -least advisable to wait till Lord Godalming should hear from -Mitchell's, we decided not to take any active step before breakfast -time. For a good while we sat and smoked, discussing the matter in -its various lights and bearings. I took the opportunity of bringing -this diary right up to the moment. I am very sleepy and shall go to -bed . . . - -Just a line. Mina sleeps soundly and her breathing is regular. Her -forehead is puckered up into little wrinkles, as though she thinks -even in her sleep. She is still too pale, but does not look so -haggard as she did this morning. Tomorrow will, I hope, mend all -this. She will be herself at home in Exeter. Oh, but I am sleepy! - - - - -DR. SEWARD'S DIARY - -1 October.--I am puzzled afresh about Renfield. His moods change so -rapidly that I find it difficult to keep touch of them, and as they -always mean something more than his own well-being, they form a more -than interesting study. This morning, when I went to see him after -his repulse of Van Helsing, his manner was that of a man commanding -destiny. He was, in fact, commanding destiny, subjectively. He did -not really care for any of the things of mere earth, he was in the -clouds and looked down on all the weaknesses and wants of us poor -mortals. - -I thought I would improve the occasion and learn something, so I asked -him, "What about the flies these times?" - -He smiled on me in quite a superior sort of way, such a smile as would -have become the face of Malvolio, as he answered me, "The fly, my dear -sir, has one striking feature. It's wings are typical of the aerial -powers of the psychic faculties. The ancients did well when they -typified the soul as a butterfly!" - -I thought I would push his analogy to its utmost logically, so I said -quickly, "Oh, it is a soul you are after now, is it?" - -His madness foiled his reason, and a puzzled look spread over his face -as, shaking his head with a decision which I had but seldom seen in -him. - -He said, "Oh, no, oh no! I want no souls. Life is all I want." Here -he brightened up. "I am pretty indifferent about it at present. Life -is all right. I have all I want. You must get a new patient, doctor, -if you wish to study zoophagy!" - -This puzzled me a little, so I drew him on. "Then you command life. -You are a god, I suppose?" - -He smiled with an ineffably benign superiority. "Oh no! Far be it -from me to arrogate to myself the attributes of the Deity. I am not -even concerned in His especially spiritual doings. If I may state my -intellectual position I am, so far as concerns things purely -terrestrial, somewhat in the position which Enoch occupied -spiritually!" - -This was a poser to me. I could not at the moment recall Enoch's -appositeness, so I had to ask a simple question, though I felt that by -so doing I was lowering myself in the eyes of the lunatic. "And why -with Enoch?" - -"Because he walked with God." - -I could not see the analogy, but did not like to admit it, so I harked -back to what he had denied. "So you don't care about life and you -don't want souls. Why not?" I put my question quickly and somewhat -sternly, on purpose to disconcert him. - -The effort succeeded, for an instant he unconsciously relapsed into -his old servile manner, bent low before me, and actually fawned upon -me as he replied. "I don't want any souls, indeed, indeed! I don't. -I couldn't use them if I had them. They would be no manner of use to -me. I couldn't eat them or . . ." - -He suddenly stopped and the old cunning look spread over his face, -like a wind sweep on the surface of the water. - -"And doctor, as to life, what is it after all? When you've got all -you require, and you know that you will never want, that is all. I -have friends, good friends, like you, Dr. Seward." This was said with -a leer of inexpressible cunning. "I know that I shall never lack the -means of life!" - -I think that through the cloudiness of his insanity he saw some -antagonism in me, for he at once fell back on the last refuge of such -as he, a dogged silence. After a short time I saw that for the -present it was useless to speak to him. He was sulky, and so I came -away. - -Later in the day he sent for me. Ordinarily I would not have come -without special reason, but just at present I am so interested in him -that I would gladly make an effort. Besides, I am glad to have -anything to help pass the time. Harker is out, following up clues, -and so are Lord Godalming and Quincey. Van Helsing sits in my study -poring over the record prepared by the Harkers. He seems to think -that by accurate knowledge of all details he will light up on some -clue. He does not wish to be disturbed in the work, without cause. I -would have taken him with me to see the patient, only I thought that -after his last repulse he might not care to go again. There was also -another reason. Renfield might not speak so freely before a third -person as when he and I were alone. - -I found him sitting in the middle of the floor on his stool, a pose -which is generally indicative of some mental energy on his part. When -I came in, he said at once, as though the question had been waiting on -his lips. "What about souls?" - -It was evident then that my surmise had been correct. Unconscious -cerebration was doing its work, even with the lunatic. I determined -to have the matter out. - -"What about them yourself?" I asked. - -He did not reply for a moment but looked all around him, and up and -down, as though he expected to find some inspiration for an answer. - -"I don't want any souls!" he said in a feeble, apologetic way. The -matter seemed preying on his mind, and so I determined to use it, to -"be cruel only to be kind." So I said, "You like life, and you want -life?" - -"Oh yes! But that is all right. You needn't worry about that!" - -"But," I asked, "how are we to get the life without getting the soul -also?" - -This seemed to puzzle him, so I followed it up, "A nice time you'll -have some time when you're flying out here, with the souls of -thousands of flies and spiders and birds and cats buzzing and -twittering and moaning all around you. You've got their lives, you -know, and you must put up with their souls!" - -Something seemed to affect his imagination, for he put his fingers to -his ears and shut his eyes, screwing them up tightly just as a small -boy does when his face is being soaped. There was something pathetic -in it that touched me. It also gave me a lesson, for it seemed that -before me was a child, only a child, though the features were worn, -and the stubble on the jaws was white. It was evident that he was -undergoing some process of mental disturbance, and knowing how his -past moods had interpreted things seemingly foreign to himself, I -thought I would enter into his mind as well as I could and go with him. - -The first step was to restore confidence, so I asked him, speaking -pretty loud so that he would hear me through his closed ears, "Would -you like some sugar to get your flies around again?" - -He seemed to wake up all at once, and shook his head. With a laugh he -replied, "Not much! Flies are poor things, after all!" After a pause -he added, "But I don't want their souls buzzing round me, all the -same." - -"Or spiders?" I went on. - -"Blow spiders! What's the use of spiders? There isn't anything in -them to eat or . . ." He stopped suddenly as though reminded of a -forbidden topic. - -"So, so!" I thought to myself, "this is the second time he has -suddenly stopped at the word 'drink'. What does it mean?" - -Renfield seemed himself aware of having made a lapse, for he hurried -on, as though to distract my attention from it, "I don't take any -stock at all in such matters. 'Rats and mice and such small deer,' as -Shakespeare has it, 'chicken feed of the larder' they might be called. -I'm past all that sort of nonsense. You might as well ask a man to -eat molecules with a pair of chopsticks, as to try to interest me -about the less carnivora, when I know of what is before me." - -"I see," I said. "You want big things that you can make your teeth -meet in? How would you like to breakfast on an elephant?" - -"What ridiculous nonsense you are talking?" He was getting too wide -awake, so I thought I would press him hard. - -"I wonder," I said reflectively, "what an elephant's soul is like!" - -The effect I desired was obtained, for he at once fell from his -high-horse and became a child again. - -"I don't want an elephant's soul, or any soul at all!" he said. For a -few moments he sat despondently. Suddenly he jumped to his feet, with -his eyes blazing and all the signs of intense cerebral excitement. -"To hell with you and your souls!" he shouted. "Why do you plague me -about souls? Haven't I got enough to worry, and pain, to distract me -already, without thinking of souls?" - -He looked so hostile that I thought he was in for another homicidal -fit, so I blew my whistle. - -The instant, however, that I did so he became calm, and said -apologetically, "Forgive me, Doctor. I forgot myself. You do not -need any help. I am so worried in my mind that I am apt to be -irritable. If you only knew the problem I have to face, and that I am -working out, you would pity, and tolerate, and pardon me. Pray do not -put me in a strait waistcoat. I want to think and I cannot think -freely when my body is confined. I am sure you will understand!" - -He had evidently self-control, so when the attendants came I told them -not to mind, and they withdrew. Renfield watched them go. When the -door was closed he said with considerable dignity and sweetness, "Dr. -Seward, you have been very considerate towards me. Believe me that I -am very, very grateful to you!" - -I thought it well to leave him in this mood, and so I came away. -There is certainly something to ponder over in this man's state. -Several points seem to make what the American interviewer calls "a -story," if one could only get them in proper order. Here they are: - - Will not mention "drinking." - - Fears the thought of being burdened with the "soul" of anything. - - Has no dread of wanting "life" in the future. - - Despises the meaner forms of life altogether, though he dreads - being haunted by their souls. - - Logically all these things point one way! He has assurance of - some kind that he will acquire some higher life. - - He dreads the consequence, the burden of a soul. Then it is a - human life he looks to! - - And the assurance . . .? - -Merciful God! The Count has been to him, and there is some new scheme -of terror afoot! - - -Later.--I went after my round to Van Helsing and told him my -suspicion. He grew very grave, and after thinking the matter over for -a while asked me to take him to Renfield. I did so. As we came to -the door we heard the lunatic within singing gaily, as he used to do -in the time which now seems so long ago. - -When we entered we saw with amazement that he had spread out his sugar -as of old. The flies, lethargic with the autumn, were beginning to -buzz into the room. We tried to make him talk of the subject of our -previous conversation, but he would not attend. He went on with his -singing, just as though we had not been present. He had got a scrap -of paper and was folding it into a notebook. We had to come away as -ignorant as we went in. - -His is a curious case indeed. We must watch him tonight. - - - - - -LETTER, MITCHELL, SONS & CANDY TO LORD GODALMING. - -"1 October. - -"My Lord, - -"We are at all times only too happy to meet your wishes. We beg, -with regard to the desire of your Lordship, expressed by Mr. -Harker on your behalf, to supply the following information -concerning the sale and purchase of No. 347, Piccadilly. The -original vendors are the executors of the late Mr. Archibald -Winter-Suffield. The purchaser is a foreign nobleman, Count de -Ville, who effected the purchase himself paying the purchase -money in notes 'over the counter,' if your Lordship will pardon -us using so vulgar an expression. Beyond this we know nothing -whatever of him. - -"We are, my Lord, - -"Your Lordship's humble servants, - -"MITCHELL, SONS & CANDY." - - - - -DR. SEWARD'S DIARY - -2 October.--I placed a man in the corridor last night, and told him to -make an accurate note of any sound he might hear from Renfield's room, -and gave him instructions that if there should be anything strange he -was to call me. After dinner, when we had all gathered round the fire -in the study, Mrs. Harker having gone to bed, we discussed the -attempts and discoveries of the day. Harker was the only one who had -any result, and we are in great hopes that his clue may be an -important one. - -Before going to bed I went round to the patient's room and looked in -through the observation trap. He was sleeping soundly, his heart rose -and fell with regular respiration. - -This morning the man on duty reported to me that a little after -midnight he was restless and kept saying his prayers somewhat loudly. -I asked him if that was all. He replied that it was all he heard. -There was something about his manner, so suspicious that I asked him -point blank if he had been asleep. He denied sleep, but admitted to -having "dozed" for a while. It is too bad that men cannot be trusted -unless they are watched. - -Today Harker is out following up his clue, and Art and Quincey are -looking after horses. Godalming thinks that it will be well to have -horses always in readiness, for when we get the information which we -seek there will be no time to lose. We must sterilize all the -imported earth between sunrise and sunset. We shall thus catch the -Count at his weakest, and without a refuge to fly to. Van Helsing is -off to the British Museum looking up some authorities on ancient -medicine. The old physicians took account of things which their -followers do not accept, and the Professor is searching for witch and -demon cures which may be useful to us later. - -I sometimes think we must be all mad and that we shall wake to sanity -in strait waistcoats. - -Later.--We have met again. We seem at last to be on the track, and -our work of tomorrow may be the beginning of the end. I wonder if -Renfield's quiet has anything to do with this. His moods have so -followed the doings of the Count, that the coming destruction of the -monster may be carried to him some subtle way. If we could only get -some hint as to what passed in his mind, between the time of my -argument with him today and his resumption of fly-catching, it might -afford us a valuable clue. He is now seemingly quiet for a spell . . . -Is he? That wild yell seemed to come from his room . . . - -The attendant came bursting into my room and told me that Renfield had -somehow met with some accident. He had heard him yell, and when he -went to him found him lying on his face on the floor, all covered with -blood. I must go at once . . . - - - - -CHAPTER 21 - - -DR. SEWARD'S DIARY - -3 October.--Let me put down with exactness all that happened, as well -as I can remember, since last I made an entry. Not a detail that I -can recall must be forgotten. In all calmness I must proceed. - -When I came to Renfield's room I found him lying on the floor on his -left side in a glittering pool of blood. When I went to move him, it -became at once apparent that he had received some terrible injuries. -There seemed none of the unity of purpose between the parts of the -body which marks even lethargic sanity. As the face was exposed I -could see that it was horribly bruised, as though it had been beaten -against the floor. Indeed it was from the face wounds that the pool -of blood originated. - -The attendant who was kneeling beside the body said to me as we turned -him over, "I think, sir, his back is broken. See, both his right arm -and leg and the whole side of his face are paralysed." How such a -thing could have happened puzzled the attendant beyond measure. He -seemed quite bewildered, and his brows were gathered in as he said, "I -can't understand the two things. He could mark his face like that by -beating his own head on the floor. I saw a young woman do it once at -the Eversfield Asylum before anyone could lay hands on her. And I -suppose he might have broken his neck by falling out of bed, if he got -in an awkward kink. But for the life of me I can't imagine how the -two things occurred. If his back was broke, he couldn't beat his -head, and if his face was like that before the fall out of bed, there -would be marks of it." - -I said to him, "Go to Dr. Van Helsing, and ask him to kindly come here -at once. I want him without an instant's delay." - -The man ran off, and within a few minutes the Professor, in his -dressing gown and slippers, appeared. When he saw Renfield on the -ground, he looked keenly at him a moment, and then turned to me. I -think he recognized my thought in my eyes, for he said very quietly, -manifestly for the ears of the attendant, "Ah, a sad accident! He -will need very careful watching, and much attention. I shall stay -with you myself, but I shall first dress myself. If you will remain I -shall in a few minutes join you." - -The patient was now breathing stertorously and it was easy to see that -he had suffered some terrible injury. - -Van Helsing returned with extraordinary celerity, bearing with him a -surgical case. He had evidently been thinking and had his mind made -up, for almost before he looked at the patient, he whispered to me, -"Send the attendant away. We must be alone with him when he becomes -conscious, after the operation." - -I said, "I think that will do now, Simmons. We have done all that we -can at present. You had better go your round, and Dr. Van Helsing -will operate. Let me know instantly if there be anything unusual -anywhere." - -The man withdrew, and we went into a strict examination of the -patient. The wounds of the face were superficial. The real injury -was a depressed fracture of the skull, extending right up through the -motor area. - -The Professor thought a moment and said, "We must reduce the pressure -and get back to normal conditions, as far as can be. The rapidity of -the suffusion shows the terrible nature of his injury. The whole -motor area seems affected. The suffusion of the brain will increase -quickly, so we must trephine at once or it may be too late." - -As he was speaking there was a soft tapping at the door. I went over -and opened it and found in the corridor without, Arthur and Quincey in -pajamas and slippers; the former spoke, "I heard your man call up Dr. -Van Helsing and tell him of an accident. So I woke Quincey or rather -called for him as he was not asleep. Things are moving too quickly -and too strangely for sound sleep for any of us these times. I've -been thinking that tomorrow night will not see things as they have -been. We'll have to look back, and forward a little more than we have -done. May we come in?" - -I nodded, and held the door open till they had entered, then I closed -it again. When Quincey saw the attitude and state of the patient, and -noted the horrible pool on the floor, he said softly, "My God! What -has happened to him? Poor, poor devil!" - -I told him briefly, and added that we expected he would recover -consciousness after the operation, for a short time, at all events. -He went at once and sat down on the edge of the bed, with Godalming -beside him. We all watched in patience. - -"We shall wait," said Van Helsing, "just long enough to fix the best -spot for trephining, so that we may most quickly and perfectly remove -the blood clot, for it is evident that the haemorrhage is increasing." - -The minutes during which we waited passed with fearful slowness. I -had a horrible sinking in my heart, and from Van Helsing's face I -gathered that he felt some fear or apprehension as to what was to -come. I dreaded the words Renfield might speak. I was positively -afraid to think. But the conviction of what was coming was on me, as -I have read of men who have heard the death watch. The poor man's -breathing came in uncertain gasps. Each instant he seemed as though -he would open his eyes and speak, but then would follow a prolonged -stertorous breath, and he would relapse into a more fixed -insensibility. Inured as I was to sick beds and death, this suspense -grew and grew upon me. I could almost hear the beating of my own -heart, and the blood surging through my temples sounded like blows -from a hammer. The silence finally became agonizing. I looked at my -companions, one after another, and saw from their flushed faces and -damp brows that they were enduring equal torture. There was a nervous -suspense over us all, as though overhead some dread bell would peal -out powerfully when we should least expect it. - -At last there came a time when it was evident that the patient was -sinking fast. He might die at any moment. I looked up at the -Professor and caught his eyes fixed on mine. His face was sternly set -as he spoke, "There is no time to lose. His words may be worth many -lives. I have been thinking so, as I stood here. It may be there is -a soul at stake! We shall operate just above the ear." - -Without another word he made the operation. For a few moments the -breathing continued to be stertorous. Then there came a breath so -prolonged that it seemed as though it would tear open his chest. -Suddenly his eyes opened, and became fixed in a wild, helpless stare. -This was continued for a few moments, then it was softened into a glad -surprise, and from his lips came a sigh of relief. He moved -convulsively, and as he did so, said, "I'll be quiet, Doctor. Tell -them to take off the strait waistcoat. I have had a terrible dream, -and it has left me so weak that I cannot move. What's wrong with my -face? It feels all swollen, and it smarts dreadfully." - -He tried to turn his head, but even with the effort his eyes seemed to -grow glassy again so I gently put it back. Then Van Helsing said in a -quiet grave tone, "Tell us your dream, Mr. Renfield." - -As he heard the voice his face brightened, through its mutilation, and -he said, "That is Dr. Van Helsing. How good it is of you to be here. -Give me some water, my lips are dry, and I shall try to tell you. I -dreamed . . ." - -He stopped and seemed fainting. I called quietly to Quincey, "The -brandy, it is in my study, quick!" He flew and returned with a glass, -the decanter of brandy and a carafe of water. We moistened the -parched lips, and the patient quickly revived. - -It seemed, however, that his poor injured brain had been working in -the interval, for when he was quite conscious, he looked at me -piercingly with an agonized confusion which I shall never forget, and -said, "I must not deceive myself. It was no dream, but all a grim -reality." Then his eyes roved round the room. As they caught sight -of the two figures sitting patiently on the edge of the bed he went -on, "If I were not sure already, I would know from them." - -For an instant his eyes closed, not with pain or sleep but -voluntarily, as though he were bringing all his faculties to bear. -When he opened them he said, hurriedly, and with more energy than he -had yet displayed, "Quick, Doctor, quick, I am dying! I feel that I -have but a few minutes, and then I must go back to death, or worse! -Wet my lips with brandy again. I have something that I must say -before I die. Or before my poor crushed brain dies anyhow. Thank -you! It was that night after you left me, when I implored you to let -me go away. I couldn't speak then, for I felt my tongue was tied. -But I was as sane then, except in that way, as I am now. I was in an -agony of despair for a long time after you left me, it seemed hours. -Then there came a sudden peace to me. My brain seemed to become cool -again, and I realized where I was. I heard the dogs bark behind our -house, but not where He was!" - -As he spoke, Van Helsing's eyes never blinked, but his hand came out -and met mine and gripped it hard. He did not, however, betray -himself. He nodded slightly and said, "Go on," in a low voice. - -Renfield proceeded. "He came up to the window in the mist, as I had -seen him often before, but he was solid then, not a ghost, and his -eyes were fierce like a man's when angry. He was laughing with his -red mouth, the sharp white teeth glinted in the moonlight when he -turned to look back over the belt of trees, to where the dogs were -barking. I wouldn't ask him to come in at first, though I knew he -wanted to, just as he had wanted all along. Then he began promising -me things, not in words but by doing them." - -He was interrupted by a word from the Professor, "How?" - -"By making them happen. Just as he used to send in the flies when the -sun was shining. Great big fat ones with steel and sapphire on their -wings. And big moths, in the night, with skull and cross-bones on -their backs." - -Van Helsing nodded to him as he whispered to me unconsciously, "The -Acherontia Atropos of the Sphinges, what you call the 'Death's-head -Moth'?" - -The patient went on without stopping, "Then he began to whisper. 'Rats, -rats, rats! Hundreds, thousands, millions of them, and every one a -life. And dogs to eat them, and cats too. All lives! All red blood, -with years of life in it, and not merely buzzing flies!' I laughed at -him, for I wanted to see what he could do. Then the dogs howled, away -beyond the dark trees in His house. He beckoned me to the window. I -got up and looked out, and He raised his hands, and seemed to call out -without using any words. A dark mass spread over the grass, coming on -like the shape of a flame of fire. And then He moved the mist to the -right and left, and I could see that there were thousands of rats with -their eyes blazing red, like His only smaller. He held up his hand, -and they all stopped, and I thought he seemed to be saying, 'All these -lives will I give you, ay, and many more and greater, through -countless ages, if you will fall down and worship me!' And then a red -cloud, like the colour of blood, seemed to close over my eyes, and -before I knew what I was doing, I found myself opening the sash and -saying to Him, 'Come in, Lord and Master!' The rats were all gone, but -He slid into the room through the sash, though it was only open an -inch wide, just as the Moon herself has often come in through the -tiniest crack and has stood before me in all her size and splendour." - -His voice was weaker, so I moistened his lips with the brandy again, -and he continued, but it seemed as though his memory had gone on -working in the interval for his story was further advanced. I was -about to call him back to the point, but Van Helsing whispered to me, -"Let him go on. Do not interrupt him. He cannot go back, and maybe -could not proceed at all if once he lost the thread of his thought." - -He proceeded, "All day I waited to hear from him, but he did not send -me anything, not even a blowfly, and when the moon got up I was pretty -angry with him. When he did slide in through the window, though it -was shut, and did not even knock, I got mad with him. He sneered at -me, and his white face looked out of the mist with his red eyes -gleaming, and he went on as though he owned the whole place, and I was -no one. He didn't even smell the same as he went by me. I couldn't -hold him. I thought that, somehow, Mrs. Harker had come into the -room." - -The two men sitting on the bed stood up and came over, standing behind -him so that he could not see them, but where they could hear better. -They were both silent, but the Professor started and quivered. His -face, however, grew grimmer and sterner still. Renfield went on -without noticing, "When Mrs. Harker came in to see me this afternoon -she wasn't the same. It was like tea after the teapot has been -watered." Here we all moved, but no one said a word. - -He went on, "I didn't know that she was here till she spoke, and she -didn't look the same. I don't care for the pale people. I like them -with lots of blood in them, and hers all seemed to have run out. I -didn't think of it at the time, but when she went away I began to -think, and it made me mad to know that He had been taking the life out -of her." I could feel that the rest quivered, as I did; but we -remained otherwise still. "So when He came tonight I was ready for -Him. I saw the mist stealing in, and I grabbed it tight. I had heard -that madmen have unnatural strength. And as I knew I was a madman, at -times anyhow, I resolved to use my power. Ay, and He felt it too, for -He had to come out of the mist to struggle with me. I held tight, and -I thought I was going to win, for I didn't mean Him to take any more -of her life, till I saw His eyes. They burned into me, and my -strength became like water. He slipped through it, and when I tried -to cling to Him, He raised me up and flung me down. There was a red -cloud before me, and a noise like thunder, and the mist seemed to -steal away under the door." - -His voice was becoming fainter and his breath more stertorous. Van -Helsing stood up instinctively. - -"We know the worst now," he said. "He is here, and we know his -purpose. It may not be too late. Let us be armed, the same as we -were the other night, but lose no time, there is not an instant to -spare." - -There was no need to put our fear, nay our conviction, into words, we -shared them in common. We all hurried and took from our rooms the -same things that we had when we entered the Count's house. The -Professor had his ready, and as we met in the corridor he pointed to -them significantly as he said, "They never leave me, and they shall -not till this unhappy business is over. Be wise also, my friends. It -is no common enemy that we deal with Alas! Alas! That dear Madam -Mina should suffer!" He stopped, his voice was breaking, and I do not -know if rage or terror predominated in my own heart. - -Outside the Harkers' door we paused. Art and Quincey held back, and -the latter said, "Should we disturb her?" - -"We must," said Van Helsing grimly. "If the door be locked, I shall -break it in." - -"May it not frighten her terribly? It is unusual to break into a -lady's room!" - -Van Helsing said solemnly, "You are always right. But this is life -and death. All chambers are alike to the doctor. And even were they -not they are all as one to me tonight. Friend John, when I turn the -handle, if the door does not open, do you put your shoulder down and -shove; and you too, my friends. Now!" - -He turned the handle as he spoke, but the door did not yield. We -threw ourselves against it. With a crash it burst open, and we almost -fell headlong into the room. The Professor did actually fall, and I -saw across him as he gathered himself up from hands and knees. What I -saw appalled me. I felt my hair rise like bristles on the back of my -neck, and my heart seemed to stand still. - -The moonlight was so bright that through the thick yellow blind the -room was light enough to see. On the bed beside the window lay -Jonathan Harker, his face flushed and breathing heavily as though in a -stupor. Kneeling on the near edge of the bed facing outwards was the -white-clad figure of his wife. By her side stood a tall, thin man, -clad in black. His face was turned from us, but the instant we saw we -all recognized the Count, in every way, even to the scar on his -forehead. With his left hand he held both Mrs. Harker's hands, -keeping them away with her arms at full tension. His right hand -gripped her by the back of the neck, forcing her face down on his -bosom. Her white nightdress was smeared with blood, and a thin stream -trickled down the man's bare chest which was shown by his torn-open -dress. The attitude of the two had a terrible resemblance to a child -forcing a kitten's nose into a saucer of milk to compel it to drink. -As we burst into the room, the Count turned his face, and the hellish -look that I had heard described seemed to leap into it. His eyes -flamed red with devilish passion. The great nostrils of the white -aquiline nose opened wide and quivered at the edge, and the white -sharp teeth, behind the full lips of the blood dripping mouth, clamped -together like those of a wild beast. With a wrench, which threw his -victim back upon the bed as though hurled from a height, he turned and -sprang at us. But by this time the Professor had gained his feet, and -was holding towards him the envelope which contained the Sacred Wafer. -The Count suddenly stopped, just as poor Lucy had done outside the -tomb, and cowered back. Further and further back he cowered, as we, -lifting our crucifixes, advanced. The moonlight suddenly failed, as a -great black cloud sailed across the sky. And when the gaslight sprang -up under Quincey's match, we saw nothing but a faint vapour. This, as -we looked, trailed under the door, which with the recoil from its -bursting open, had swung back to its old position. Van Helsing, Art, -and I moved forward to Mrs. Harker, who by this time had drawn her -breath and with it had given a scream so wild, so ear-piercing, so -despairing that it seems to me now that it will ring in my ears till -my dying day. For a few seconds she lay in her helpless attitude and -disarray. Her face was ghastly, with a pallor which was accentuated -by the blood which smeared her lips and cheeks and chin. From her -throat trickled a thin stream of blood. Her eyes were mad with -terror. Then she put before her face her poor crushed hands, which -bore on their whiteness the red mark of the Count's terrible grip, and -from behind them came a low desolate wail which made the terrible -scream seem only the quick expression of an endless grief. Van -Helsing stepped forward and drew the coverlet gently over her body, -whilst Art, after looking at her face for an instant despairingly, ran -out of the room. - -Van Helsing whispered to me, "Jonathan is in a stupor such as we know -the Vampire can produce. We can do nothing with poor Madam Mina for a -few moments till she recovers herself. I must wake him!" - -He dipped the end of a towel in cold water and with it began to flick -him on the face, his wife all the while holding her face between her -hands and sobbing in a way that was heart breaking to hear. I raised -the blind, and looked out of the window. There was much moonshine, -and as I looked I could see Quincey Morris run across the lawn and -hide himself in the shadow of a great yew tree. It puzzled me to -think why he was doing this. But at the instant I heard Harker's -quick exclamation as he woke to partial consciousness, and turned to -the bed. On his face, as there might well be, was a look of wild -amazement. He seemed dazed for a few seconds, and then full -consciousness seemed to burst upon him all at once, and he started up. - -His wife was aroused by the quick movement, and turned to him with her -arms stretched out, as though to embrace him. Instantly, however, she -drew them in again, and putting her elbows together, held her hands -before her face, and shuddered till the bed beneath her shook. - -"In God's name what does this mean?" Harker cried out. "Dr. Seward, -Dr. Van Helsing, what is it? What has happened? What is wrong? Mina, -dear what is it? What does that blood mean? My God, my God! Has it -come to this!" And, raising himself to his knees, he beat his hands -wildly together. "Good God help us! Help her! Oh, help her!" - -With a quick movement he jumped from bed, and began to pull on his -clothes, all the man in him awake at the need for instant exertion. -"What has happened? Tell me all about it!" he cried without pausing. -"Dr. Van Helsing, you love Mina, I know. Oh, do something to save her. -It cannot have gone too far yet. Guard her while I look for him!" - -His wife, through her terror and horror and distress, saw some sure -danger to him. Instantly forgetting her own grief, she seized hold of -him and cried out. - -"No! No! Jonathan, you must not leave me. I have suffered enough -tonight, God knows, without the dread of his harming you. You must -stay with me. Stay with these friends who will watch over you!" Her -expression became frantic as she spoke. And, he yielding to her, she -pulled him down sitting on the bedside, and clung to him fiercely. - -Van Helsing and I tried to calm them both. The Professor held up his -golden crucifix, and said with wonderful calmness, "Do not fear, my -dear. We are here, and whilst this is close to you no foul thing can -approach. You are safe for tonight, and we must be calm and take -counsel together." - -She shuddered and was silent, holding down her head on her husband's -breast. When she raised it, his white nightrobe was stained with -blood where her lips had touched, and where the thin open wound in the -neck had sent forth drops. The instant she saw it she drew back, with -a low wail, and whispered, amidst choking sobs. - -"Unclean, unclean! I must touch him or kiss him no more. Oh, that it -should be that it is I who am now his worst enemy, and whom he may -have most cause to fear." - -To this he spoke out resolutely, "Nonsense, Mina. It is a shame to me -to hear such a word. I would not hear it of you. And I shall not -hear it from you. May God judge me by my deserts, and punish me with -more bitter suffering than even this hour, if by any act or will of -mine anything ever come between us!" - -He put out his arms and folded her to his breast. And for a while she -lay there sobbing. He looked at us over her bowed head, with eyes -that blinked damply above his quivering nostrils. His mouth was set -as steel. - -After a while her sobs became less frequent and more faint, and then -he said to me, speaking with a studied calmness which I felt tried his -nervous power to the utmost. - -"And now, Dr. Seward, tell me all about it. Too well I know the broad -fact. Tell me all that has been." - -I told him exactly what had happened and he listened with seeming -impassiveness, but his nostrils twitched and his eyes blazed as I told -how the ruthless hands of the Count had held his wife in that terrible -and horrid position, with her mouth to the open wound in his breast. -It interested me, even at that moment, to see that whilst the face of -white set passion worked convulsively over the bowed head, the hands -tenderly and lovingly stroked the ruffled hair. Just as I had -finished, Quincey and Godalming knocked at the door. They entered in -obedience to our summons. Van Helsing looked at me questioningly. I -understood him to mean if we were to take advantage of their coming to -divert if possible the thoughts of the unhappy husband and wife from -each other and from themselves. So on nodding acquiescence to him he -asked them what they had seen or done. To which Lord Godalming -answered. - -"I could not see him anywhere in the passage, or in any of our rooms. -I looked in the study but, though he had been there, he had gone. He -had, however . . ." He stopped suddenly, looking at the poor drooping -figure on the bed. - -Van Helsing said gravely, "Go on, friend Arthur. We want here no more -concealments. Our hope now is in knowing all. Tell freely!" - -So Art went on, "He had been there, and though it could only have been -for a few seconds, he made rare hay of the place. All the manuscript -had been burned, and the blue flames were flickering amongst the white -ashes. The cylinders of your phonograph too were thrown on the fire, -and the wax had helped the flames." - -Here I interrupted. "Thank God there is the other copy in the safe!" - -His face lit for a moment, but fell again as he went on. "I ran -downstairs then, but could see no sign of him. I looked into -Renfield's room, but there was no trace there except . . ." Again he -paused. - -"Go on," said Harker hoarsely. So he bowed his head and moistening his -lips with his tongue, added, "except that the poor fellow is dead." - -Mrs. Harker raised her head, looking from one to the other of us she -said solemnly, "God's will be done!" - -I could not but feel that Art was keeping back something. But, as I -took it that it was with a purpose, I said nothing. - -Van Helsing turned to Morris and asked, "And you, friend Quincey, have -you any to tell?" - -"A little," he answered. "It may be much eventually, but at present I -can't say. I thought it well to know if possible where the Count -would go when he left the house. I did not see him, but I saw a bat -rise from Renfield's window, and flap westward. I expected to see him -in some shape go back to Carfax, but he evidently sought some other -lair. He will not be back tonight, for the sky is reddening in the -east, and the dawn is close. We must work tomorrow!" - -He said the latter words through his shut teeth. For a space of -perhaps a couple of minutes there was silence, and I could fancy that -I could hear the sound of our hearts beating. - -Then Van Helsing said, placing his hand tenderly on Mrs. Harker's -head, "And now, Madam Mina, poor dear, dear, Madam Mina, tell us -exactly what happened. God knows that I do not want that you be -pained, but it is need that we know all. For now more than ever has -all work to be done quick and sharp, and in deadly earnest. The day -is close to us that must end all, if it may be so, and now is the -chance that we may live and learn." - -The poor dear lady shivered, and I could see the tension of her nerves -as she clasped her husband closer to her and bent her head lower and -lower still on his breast. Then she raised her head proudly, and held -out one hand to Van Helsing who took it in his, and after stooping and -kissing it reverently, held it fast. The other hand was locked in -that of her husband, who held his other arm thrown round her -protectingly. After a pause in which she was evidently ordering her -thoughts, she began. - -"I took the sleeping draught which you had so kindly given me, but for -a long time it did not act. I seemed to become more wakeful, and -myriads of horrible fancies began to crowd in upon my mind. All of -them connected with death, and vampires, with blood, and pain, and -trouble." Her husband involuntarily groaned as she turned to him and -said lovingly, "Do not fret, dear. You must be brave and strong, and -help me through the horrible task. If you only knew what an effort it -is to me to tell of this fearful thing at all, you would understand -how much I need your help. Well, I saw I must try to help the -medicine to its work with my will, if it was to do me any good, so I -resolutely set myself to sleep. Sure enough sleep must soon have come -to me, for I remember no more. Jonathan coming in had not waked me, -for he lay by my side when next I remember. There was in the room the -same thin white mist that I had before noticed. But I forget now if -you know of this. You will find it in my diary which I shall show you -later. I felt the same vague terror which had come to me before and -the same sense of some presence. I turned to wake Jonathan, but found -that he slept so soundly that it seemed as if it was he who had taken -the sleeping draught, and not I. I tried, but I could not wake him. -This caused me a great fear, and I looked around terrified. Then -indeed, my heart sank within me. Beside the bed, as if he had stepped -out of the mist, or rather as if the mist had turned into his figure, -for it had entirely disappeared, stood a tall, thin man, all in -black. I knew him at once from the description of the others. The -waxen face, the high aquiline nose, on which the light fell in a thin -white line, the parted red lips, with the sharp white teeth showing -between, and the red eyes that I had seemed to see in the sunset on -the windows of St. Mary's Church at Whitby. I knew, too, the red scar -on his forehead where Jonathan had struck him. For an instant my -heart stood still, and I would have screamed out, only that I was -paralyzed. In the pause he spoke in a sort of keen, cutting whisper, -pointing as he spoke to Jonathan. - -"'Silence! If you make a sound I shall take him and dash his brains -out before your very eyes.' I was appalled and was too bewildered to -do or say anything. With a mocking smile, he placed one hand upon my -shoulder and, holding me tight, bared my throat with the other, saying -as he did so, 'First, a little refreshment to reward my exertions. -You may as well be quiet. It is not the first time, or the second, -that your veins have appeased my thirst!' I was bewildered, and -strangely enough, I did not want to hinder him. I suppose it is a -part of the horrible curse that such is, when his touch is on his -victim. And oh, my God, my God, pity me! He placed his reeking lips -upon my throat!" Her husband groaned again. She clasped his hand -harder, and looked at him pityingly, as if he were the injured one, -and went on. - -"I felt my strength fading away, and I was in a half swoon. How long -this horrible thing lasted I know not, but it seemed that a long time -must have passed before he took his foul, awful, sneering mouth away. -I saw it drip with the fresh blood!" The remembrance seemed for a while -to overpower her, and she drooped and would have sunk down but for her -husband's sustaining arm. With a great effort she recovered herself -and went on. - -"Then he spoke to me mockingly, 'And so you, like the others, would -play your brains against mine. You would help these men to hunt me -and frustrate me in my design! You know now, and they know in part -already, and will know in full before long, what it is to cross my -path. They should have kept their energies for use closer to home. -Whilst they played wits against me, against me who commanded nations, -and intrigued for them, and fought for them, hundreds of years before -they were born, I was countermining them. And you, their best beloved -one, are now to me, flesh of my flesh, blood of my blood, kin of my -kin, my bountiful wine-press for a while, and shall be later on my -companion and my helper. You shall be avenged in turn, for not one of -them but shall minister to your needs. But as yet you are to be -punished for what you have done. You have aided in thwarting me. Now -you shall come to my call. When my brain says "Come!" to you, you -shall cross land or sea to do my bidding. And to that end this!' - -"With that he pulled open his shirt, and with his long sharp nails -opened a vein in his breast. When the blood began to spurt out, he -took my hands in one of his, holding them tight, and with the other -seized my neck and pressed my mouth to the wound, so that I must -either suffocate or swallow some to the . . . Oh, my God! My God! -What have I done? What have I done to deserve such a fate, I who have -tried to walk in meekness and righteousness all my days. God pity -me! Look down on a poor soul in worse than mortal peril. And in -mercy pity those to whom she is dear!" Then she began to rub her lips -as though to cleanse them from pollution. - -As she was telling her terrible story, the eastern sky began to -quicken, and everything became more and more clear. Harker was still -and quiet; but over his face, as the awful narrative went on, came a -grey look which deepened and deepened in the morning light, till when -the first red streak of the coming dawn shot up, the flesh stood -darkly out against the whitening hair. - -We have arranged that one of us is to stay within call of the unhappy -pair till we can meet together and arrange about taking action. - -Of this I am sure. The sun rises today on no more miserable house in -all the great round of its daily course. - - - - -CHAPTER 22 - - -JONATHAN HARKER'S JOURNAL - -3 October.--As I must do something or go mad, I write this diary. It -is now six o'clock, and we are to meet in the study in half an hour -and take something to eat, for Dr. Van Helsing and Dr. Seward are -agreed that if we do not eat we cannot work our best. Our best will -be, God knows, required today. I must keep writing at every chance, -for I dare not stop to think. All, big and little, must go down. -Perhaps at the end the little things may teach us most. The teaching, -big or little, could not have landed Mina or me anywhere worse than we -are today. However, we must trust and hope. Poor Mina told me just -now, with the tears running down her dear cheeks, that it is in -trouble and trial that our faith is tested. That we must keep on -trusting, and that God will aid us up to the end. The end! Oh my -God! What end? . . . To work! To work! - -When Dr. Van Helsing and Dr. Seward had come back from seeing poor -Renfield, we went gravely into what was to be done. First, Dr. Seward -told us that when he and Dr. Van Helsing had gone down to the room -below they had found Renfield lying on the floor, all in a heap. His -face was all bruised and crushed in, and the bones of the neck were -broken. - -Dr. Seward asked the attendant who was on duty in the passage if he -had heard anything. He said that he had been sitting down, he -confessed to half dozing, when he heard loud voices in the room, and -then Renfield had called out loudly several times, "God! God! God!" -After that there was a sound of falling, and when he entered the room -he found him lying on the floor, face down, just as the doctors had -seen him. Van Helsing asked if he had heard "voices" or "a voice," -and he said he could not say. That at first it had seemed to him as -if there were two, but as there was no one in the room it could have -been only one. He could swear to it, if required, that the word "God" -was spoken by the patient. - -Dr. Seward said to us, when we were alone, that he did not wish to go -into the matter. The question of an inquest had to be considered, and -it would never do to put forward the truth, as no one would believe -it. As it was, he thought that on the attendant's evidence he could -give a certificate of death by misadventure in falling from bed. In -case the coroner should demand it, there would be a formal inquest, -necessarily to the same result. - -When the question began to be discussed as to what should be our next -step, the very first thing we decided was that Mina should be in full -confidence. That nothing of any sort, no matter how painful, should -be kept from her. She herself agreed as to its wisdom, and it was -pitiful to see her so brave and yet so sorrowful, and in such a depth -of despair. - -"There must be no concealment," she said. "Alas! We have had too -much already. And besides there is nothing in all the world that can -give me more pain than I have already endured, than I suffer now! -Whatever may happen, it must be of new hope or of new courage to me!" - -Van Helsing was looking at her fixedly as she spoke, and said, -suddenly but quietly, "But dear Madam Mina, are you not afraid. Not -for yourself, but for others from yourself, after what has happened?" - -Her face grew set in its lines, but her eyes shone with the devotion -of a martyr as she answered, "Ah no! For my mind is made up!" - -"To what?" he asked gently, whilst we were all very still, for each in -our own way we had a sort of vague idea of what she meant. - -Her answer came with direct simplicity, as though she was simply -stating a fact, "Because if I find in myself, and I shall watch keenly -for it, a sign of harm to any that I love, I shall die!" - -"You would not kill yourself?" he asked, hoarsely. - -"I would. If there were no friend who loved me, who would save me -such a pain, and so desperate an effort!" She looked at him meaningly -as she spoke. - -He was sitting down, but now he rose and came close to her and put his -hand on her head as he said solemnly. "My child, there is such an one -if it were for your good. For myself I could hold it in my account -with God to find such an euthanasia for you, even at this moment if it -were best. Nay, were it safe! But my child . . ." - -For a moment he seemed choked, and a great sob rose in his throat. He -gulped it down and went on, "There are here some who would stand -between you and death. You must not die. You must not die by any -hand, but least of all your own. Until the other, who has fouled your -sweet life, is true dead you must not die. For if he is still with -the quick Undead, your death would make you even as he is. No, you -must live! You must struggle and strive to live, though death would -seem a boon unspeakable. You must fight Death himself, though he come -to you in pain or in joy. By the day, or the night, in safety or in -peril! On your living soul I charge you that you do not die. Nay, -nor think of death, till this great evil be past." - -The poor dear grew white as death, and shook and shivered, as I have -seen a quicksand shake and shiver at the incoming of the tide. We -were all silent. We could do nothing. At length she grew more calm -and turning to him said sweetly, but oh so sorrowfully, as she held -out her hand, "I promise you, my dear friend, that if God will let me -live, I shall strive to do so. Till, if it may be in His good time, -this horror may have passed away from me." - -She was so good and brave that we all felt that our hearts were -strengthened to work and endure for her, and we began to discuss what -we were to do. I told her that she was to have all the papers in the -safe, and all the papers or diaries and phonographs we might hereafter -use, and was to keep the record as she had done before. She was -pleased with the prospect of anything to do, if "pleased" could be -used in connection with so grim an interest. - -As usual Van Helsing had thought ahead of everyone else, and was -prepared with an exact ordering of our work. - -"It is perhaps well," he said, "that at our meeting after our visit to -Carfax we decided not to do anything with the earth boxes that lay -there. Had we done so, the Count must have guessed our purpose, and -would doubtless have taken measures in advance to frustrate such an -effort with regard to the others. But now he does not know our -intentions. Nay, more, in all probability, he does not know that such -a power exists to us as can sterilize his lairs, so that he cannot use -them as of old. - -"We are now so much further advanced in our knowledge as to their -disposition that, when we have examined the house in Piccadilly, we may -track the very last of them. Today then, is ours, and in it rests our -hope. The sun that rose on our sorrow this morning guards us in its -course. Until it sets tonight, that monster must retain whatever form -he now has. He is confined within the limitations of his earthly -envelope. He cannot melt into thin air nor disappear through cracks -or chinks or crannies. If he go through a doorway, he must open the -door like a mortal. And so we have this day to hunt out all his lairs -and sterilize them. So we shall, if we have not yet catch him and -destroy him, drive him to bay in some place where the catching and the -destroying shall be, in time, sure." - -Here I started up for I could not contain myself at the thought that -the minutes and seconds so preciously laden with Mina's life and -happiness were flying from us, since whilst we talked action was -impossible. But Van Helsing held up his hand warningly. - -"Nay, friend Jonathan," he said, "in this, the quickest way home is -the longest way, so your proverb say. We shall all act and act with -desperate quick, when the time has come. But think, in all probable -the key of the situation is in that house in Piccadilly. The Count -may have many houses which he has bought. Of them he will have deeds -of purchase, keys and other things. He will have paper that he write -on. He will have his book of cheques. There are many belongings that -he must have somewhere. Why not in this place so central, so quiet, -where he come and go by the front or the back at all hours, when in -the very vast of the traffic there is none to notice. We shall go -there and search that house. And when we learn what it holds, then we -do what our friend Arthur call, in his phrases of hunt 'stop the -earths' and so we run down our old fox, so? Is it not?" - -"Then let us come at once," I cried, "we are wasting the precious, -precious time!" - -The Professor did not move, but simply said, "And how are we to get -into that house in Piccadilly?" - -"Any way!" I cried. "We shall break in if need be." - -"And your police? Where will they be, and what will they say?" - -I was staggered, but I knew that if he wished to delay he had a good -reason for it. So I said, as quietly as I could, "Don't wait more -than need be. You know, I am sure, what torture I am in." - -"Ah, my child, that I do. And indeed there is no wish of me to add to -your anguish. But just think, what can we do, until all the world be -at movement. Then will come our time. I have thought and thought, -and it seems to me that the simplest way is the best of all. Now we -wish to get into the house, but we have no key. Is it not so?" I -nodded. - -"Now suppose that you were, in truth, the owner of that house, and -could not still get in. And think there was to you no conscience of -the housebreaker, what would you do?" - -"I should get a respectable locksmith, and set him to work to pick the -lock for me." - -"And your police, they would interfere, would they not?" - -"Oh no! Not if they knew the man was properly employed." - -"Then," he looked at me as keenly as he spoke, "all that is in doubt -is the conscience of the employer, and the belief of your policemen as -to whether or not that employer has a good conscience or a bad one. -Your police must indeed be zealous men and clever, oh so clever, in -reading the heart, that they trouble themselves in such matter. No, -no, my friend Jonathan, you go take the lock off a hundred empty -houses in this your London, or of any city in the world, and if you do -it as such things are rightly done, and at the time such things are -rightly done, no one will interfere. I have read of a gentleman who -owned a so fine house in London, and when he went for months of summer -to Switzerland and lock up his house, some burglar come and broke -window at back and got in. Then he went and made open the shutters in -front and walk out and in through the door, before the very eyes of -the police. Then he have an auction in that house, and advertise it, -and put up big notice. And when the day come he sell off by a great -auctioneer all the goods of that other man who own them. Then he go -to a builder, and he sell him that house, making an agreement that he -pull it down and take all away within a certain time. And your police -and other authority help him all they can. And when that owner come -back from his holiday in Switzerland he find only an empty hole where -his house had been. This was all done en regle, and in our work we -shall be en regle too. We shall not go so early that the policemen -who have then little to think of, shall deem it strange. But we shall -go after ten o'clock, when there are many about, and such things would -be done were we indeed owners of the house." - -I could not but see how right he was and the terrible despair of -Mina's face became relaxed in thought. There was hope in such good -counsel. - -Van Helsing went on, "When once within that house we may find more -clues. At any rate some of us can remain there whilst the rest find -the other places where there be more earth boxes, at Bermondsey and -Mile End." - -Lord Godalming stood up. "I can be of some use here," he said. "I -shall wire to my people to have horses and carriages where they will -be most convenient." - -"Look here, old fellow," said Morris, "it is a capital idea to have -all ready in case we want to go horse backing, but don't you think -that one of your snappy carriages with its heraldic adornments in a -byway of Walworth or Mile End would attract too much attention for our -purpose? It seems to me that we ought to take cabs when we go south -or east. And even leave them somewhere near the neighbourhood we are -going to." - -"Friend Quincey is right!" said the Professor. "His head is what you -call in plane with the horizon. It is a difficult thing that we go to -do, and we do not want no peoples to watch us if so it may." - -Mina took a growing interest in everything and I was rejoiced to see -that the exigency of affairs was helping her to forget for a time the -terrible experience of the night. She was very, very pale, almost -ghastly, and so thin that her lips were drawn away, showing her teeth -in somewhat of prominence. I did not mention this last, lest it -should give her needless pain, but it made my blood run cold in my -veins to think of what had occurred with poor Lucy when the Count had -sucked her blood. As yet there was no sign of the teeth growing -sharper, but the time as yet was short, and there was time for fear. - -When we came to the discussion of the sequence of our efforts and of -the disposition of our forces, there were new sources of doubt. It -was finally agreed that before starting for Piccadilly we should -destroy the Count's lair close at hand. In case he should find it out -too soon, we should thus be still ahead of him in our work of -destruction. And his presence in his purely material shape, and at -his weakest, might give us some new clue. - -As to the disposal of forces, it was suggested by the Professor that, -after our visit to Carfax, we should all enter the house in -Piccadilly. That the two doctors and I should remain there, whilst -Lord Godalming and Quincey found the lairs at Walworth and Mile End -and destroyed them. It was possible, if not likely, the Professor -urged, that the Count might appear in Piccadilly during the day, and -that if so we might be able to cope with him then and there. At any -rate, we might be able to follow him in force. To this plan I -strenuously objected, and so far as my going was concerned, for I said -that I intended to stay and protect Mina. I thought that my mind was -made up on the subject, but Mina would not listen to my objection. She -said that there might be some law matter in which I could be useful. -That amongst the Count's papers might be some clue which I could -understand out of my experience in Transylvania. And that, as it was, -all the strength we could muster was required to cope with the Count's -extraordinary power. I had to give in, for Mina's resolution was -fixed. She said that it was the last hope for her that we should all -work together. - -"As for me," she said, "I have no fear. Things have been as bad as -they can be. And whatever may happen must have in it some element of -hope or comfort. Go, my husband! God can, if He wishes it, guard me -as well alone as with any one present." - -So I started up crying out, "Then in God's name let us come at once, -for we are losing time. The Count may come to Piccadilly earlier than -we think." - -"Not so!" said Van Helsing, holding up his hand. - -"But why?" I asked. - -"Do you forget," he said, with actually a smile, "that last night he -banqueted heavily, and will sleep late?" - -Did I forget! Shall I ever . . . can I ever! Can any of us ever -forget that terrible scene! Mina struggled hard to keep her brave -countenance, but the pain overmastered her and she put her hands -before her face, and shuddered whilst she moaned. Van Helsing had not -intended to recall her frightful experience. He had simply lost sight -of her and her part in the affair in his intellectual effort. - -When it struck him what he said, he was horrified at his -thoughtlessness and tried to comfort her. - -"Oh, Madam Mina," he said, "dear, dear, Madam Mina, alas! That I of -all who so reverence you should have said anything so forgetful. These -stupid old lips of mine and this stupid old head do not deserve so, -but you will forget it, will you not?" He bent low beside her as he -spoke. - -She took his hand, and looking at him through her tears, said -hoarsely, "No, I shall not forget, for it is well that I remember. -And with it I have so much in memory of you that is sweet, that I take -it all together. Now, you must all be going soon. Breakfast is -ready, and we must all eat that we may be strong." - -Breakfast was a strange meal to us all. We tried to be cheerful and -encourage each other, and Mina was the brightest and most cheerful of -us. When it was over, Van Helsing stood up and said, "Now, my dear -friends, we go forth to our terrible enterprise. Are we all armed, as -we were on that night when first we visited our enemy's lair. Armed -against ghostly as well as carnal attack?" - -We all assured him. - -"Then it is well. Now, Madam Mina, you are in any case quite safe -here until the sunset. And before then we shall return . . . if . . . -We shall return! But before we go let me see you armed against personal -attack. I have myself, since you came down, prepared your chamber by -the placing of things of which we know, so that He may not enter. Now -let me guard yourself. On your forehead I touch this piece of Sacred -Wafer in the name of the Father, the Son, and . . ." - -There was a fearful scream which almost froze our hearts to hear. As -he had placed the Wafer on Mina's forehead, it had seared it . . . had -burned into the flesh as though it had been a piece of white-hot metal. -My poor darling's brain had told her the significance of the fact as -quickly as her nerves received the pain of it, and the two so -overwhelmed her that her overwrought nature had its voice in that -dreadful scream. - -But the words to her thought came quickly. The echo of the scream had -not ceased to ring on the air when there came the reaction, and she -sank on her knees on the floor in an agony of abasement. Pulling her -beautiful hair over her face, as the leper of old his mantle, she -wailed out. - -"Unclean! Unclean! Even the Almighty shuns my polluted flesh! I -must bear this mark of shame upon my forehead until the Judgement -Day." - -They all paused. I had thrown myself beside her in an agony of -helpless grief, and putting my arms around held her tight. For a few -minutes our sorrowful hearts beat together, whilst the friends around -us turned away their eyes that ran tears silently. Then Van Helsing -turned and said gravely. So gravely that I could not help feeling -that he was in some way inspired, and was stating things outside -himself. - -"It may be that you may have to bear that mark till God himself see -fit, as He most surely shall, on the Judgement Day, to redress all -wrongs of the earth and of His children that He has placed thereon. -And oh, Madam Mina, my dear, my dear, may we who love you be there to -see, when that red scar, the sign of God's knowledge of what has been, -shall pass away, and leave your forehead as pure as the heart we know. -For so surely as we live, that scar shall pass away when God sees -right to lift the burden that is hard upon us. Till then we bear our -Cross, as His Son did in obedience to His Will. It may be that we are -chosen instruments of His good pleasure, and that we ascend to His -bidding as that other through stripes and shame. Through tears and -blood. Through doubts and fear, and all that makes the difference -between God and man." - -There was hope in his words, and comfort. And they made for -resignation. Mina and I both felt so, and simultaneously we each took -one of the old man's hands and bent over and kissed it. Then without -a word we all knelt down together, and all holding hands, swore to be -true to each other. We men pledged ourselves to raise the veil of -sorrow from the head of her whom, each in his own way, we loved. And -we prayed for help and guidance in the terrible task which lay before -us. It was then time to start. So I said farewell to Mina, a parting -which neither of us shall forget to our dying day, and we set out. - -To one thing I have made up my mind. If we find out that Mina must be -a vampire in the end, then she shall not go into that unknown and -terrible land alone. I suppose it is thus that in old times one -vampire meant many. Just as their hideous bodies could only rest in -sacred earth, so the holiest love was the recruiting sergeant for -their ghastly ranks. - -We entered Carfax without trouble and found all things the same as on -the first occasion. It was hard to believe that amongst so prosaic -surroundings of neglect and dust and decay there was any ground for -such fear as already we knew. Had not our minds been made up, and had -there not been terrible memories to spur us on, we could hardly have -proceeded with our task. We found no papers, or any sign of use in -the house. And in the old chapel the great boxes looked just as we -had seen them last. - -Dr. Van Helsing said to us solemnly as we stood before him, "And now, -my friends, we have a duty here to do. We must sterilize this earth, -so sacred of holy memories, that he has brought from a far distant -land for such fell use. He has chosen this earth because it has been -holy. Thus we defeat him with his own weapon, for we make it more -holy still. It was sanctified to such use of man, now we sanctify it -to God." - -As he spoke he took from his bag a screwdriver and a wrench, and very -soon the top of one of the cases was thrown open. The earth smelled -musty and close, but we did not somehow seem to mind, for our -attention was concentrated on the Professor. Taking from his box a -piece of the Sacred Wafer he laid it reverently on the earth, and then -shutting down the lid began to screw it home, we aiding him as he -worked. - -One by one we treated in the same way each of the great boxes, and -left them as we had found them to all appearance. But in each was a -portion of the Host. When we closed the door behind us, the Professor -said solemnly, "So much is already done. It may be that with all the -others we can be so successful, then the sunset of this evening may -shine of Madam Mina's forehead all white as ivory and with no stain!" - -As we passed across the lawn on our way to the station to catch our -train we could see the front of the asylum. I looked eagerly, and in -the window of my own room saw Mina. I waved my hand to her, and -nodded to tell that our work there was successfully accomplished. She -nodded in reply to show that she understood. The last I saw, she was -waving her hand in farewell. It was with a heavy heart that we sought -the station and just caught the train, which was steaming in as we -reached the platform. I have written this in the train. - - -Piccadilly, 12:30 o'clock.--Just before we reached Fenchurch Street -Lord Godalming said to me, "Quincey and I will find a locksmith. You -had better not come with us in case there should be any difficulty. -For under the circumstances it wouldn't seem so bad for us to break -into an empty house. But you are a solicitor and the Incorporated Law -Society might tell you that you should have known better." - -I demurred as to my not sharing any danger even of odium, but he went -on, "Besides, it will attract less attention if there are not too many -of us. My title will make it all right with the locksmith, and with -any policeman that may come along. You had better go with Jack and -the Professor and stay in the Green Park. Somewhere in sight of the -house, and when you see the door opened and the smith has gone away, -do you all come across. We shall be on the lookout for you, and shall -let you in." - -"The advice is good!" said Van Helsing, so we said no more. Godalming -and Morris hurried off in a cab, we following in another. At the -corner of Arlington Street our contingent got out and strolled into -the Green Park. My heart beat as I saw the house on which so much of -our hope was centred, looming up grim and silent in its deserted -condition amongst its more lively and spruce-looking neighbours. We -sat down on a bench within good view, and began to smoke cigars so as -to attract as little attention as possible. The minutes seemed to -pass with leaden feet as we waited for the coming of the others. - -At length we saw a four-wheeler drive up. Out of it, in leisurely -fashion, got Lord Godalming and Morris. And down from the box -descended a thick-set working man with his rush-woven basket of tools. -Morris paid the cabman, who touched his hat and drove away. Together -the two ascended the steps, and Lord Godalming pointed out what he -wanted done. The workman took off his coat leisurely and hung it on -one of the spikes of the rail, saying something to a policeman who -just then sauntered along. The policeman nodded acquiescence, and the -man kneeling down placed his bag beside him. After searching through -it, he took out a selection of tools which he proceeded to lay beside -him in orderly fashion. Then he stood up, looked in the keyhole, blew -into it, and turning to his employers, made some remark. Lord -Godalming smiled, and the man lifted a good sized bunch of keys. -Selecting one of them, he began to probe the lock, as if feeling his -way with it. After fumbling about for a bit he tried a second, and -then a third. All at once the door opened under a slight push from -him, and he and the two others entered the hall. We sat still. My -own cigar burnt furiously, but Van Helsing's went cold altogether. We -waited patiently as we saw the workman come out and bring his bag. -Then he held the door partly open, steadying it with his knees, whilst -he fitted a key to the lock. This he finally handed to Lord -Godalming, who took out his purse and gave him something. The man -touched his hat, took his bag, put on his coat and departed. Not a -soul took the slightest notice of the whole transaction. - -When the man had fairly gone, we three crossed the street and knocked -at the door. It was immediately opened by Quincey Morris, beside whom -stood Lord Godalming lighting a cigar. - -"The place smells so vilely," said the latter as we came in. It did -indeed smell vilely. Like the old chapel at Carfax. And with our -previous experience it was plain to us that the Count had been using -the place pretty freely. We moved to explore the house, all keeping -together in case of attack, for we knew we had a strong and wily enemy -to deal with, and as yet we did not know whether the Count might not -be in the house. - -In the dining room, which lay at the back of the hall, we found eight -boxes of earth. Eight boxes only out of the nine which we sought! -Our work was not over, and would never be until we should have found -the missing box. - -First we opened the shutters of the window which looked out across a -narrow stone flagged yard at the blank face of a stable, pointed to -look like the front of a miniature house. There were no windows in -it, so we were not afraid of being overlooked. We did not lose any -time in examining the chests. With the tools which we had brought -with us we opened them, one by one, and treated them as we had treated -those others in the old chapel. It was evident to us that the Count -was not at present in the house, and we proceeded to search for any of -his effects. - -After a cursory glance at the rest of the rooms, from basement to -attic, we came to the conclusion that the dining room contained any -effects which might belong to the Count. And so we proceeded to -minutely examine them. They lay in a sort of orderly disorder on the -great dining room table. - -There were title deeds of the Piccadilly house in a great bundle, -deeds of the purchase of the houses at Mile End and Bermondsey, -notepaper, envelopes, and pens and ink. All were covered up in thin -wrapping paper to keep them from the dust. There were also a clothes -brush, a brush and comb, and a jug and basin. The latter containing -dirty water which was reddened as if with blood. Last of all was a -little heap of keys of all sorts and sizes, probably those belonging -to the other houses. - -When we had examined this last find, Lord Godalming and Quincey Morris -taking accurate notes of the various addresses of the houses in the -East and the South, took with them the keys in a great bunch, and set -out to destroy the boxes in these places. The rest of us are, with -what patience we can, waiting their return, or the coming of the -Count. - - - - -CHAPTER 23 - - -DR. SEWARD'S DIARY - -3 October.--The time seemed terribly long whilst we were waiting for -the coming of Godalming and Quincey Morris. The Professor tried to -keep our minds active by using them all the time. I could see his -beneficent purpose, by the side glances which he threw from time to -time at Harker. The poor fellow is overwhelmed in a misery that is -appalling to see. Last night he was a frank, happy-looking man, with -strong, youthful face, full of energy, and with dark brown hair. -Today he is a drawn, haggard old man, whose white hair matches well -with the hollow burning eyes and grief-written lines of his face. His -energy is still intact. In fact, he is like a living flame. This may -yet be his salvation, for if all go well, it will tide him over the -despairing period. He will then, in a kind of way, wake again to the -realities of life. Poor fellow, I thought my own trouble was bad -enough, but his . . . ! - -The Professor knows this well enough, and is doing his best to keep -his mind active. What he has been saying was, under the -circumstances, of absorbing interest. So well as I can remember, here -it is: - -"I have studied, over and over again since they came into my hands, -all the papers relating to this monster, and the more I have studied, -the greater seems the necessity to utterly stamp him out. All through -there are signs of his advance. Not only of his power, but of his -knowledge of it. As I learned from the researches of my friend -Arminius of Buda-Pesth, he was in life a most wonderful man. Soldier, -statesman, and alchemist--which latter was the highest development of -the science knowledge of his time. He had a mighty brain, a learning -beyond compare, and a heart that knew no fear and no remorse. He -dared even to attend the Scholomance, and there was no branch of -knowledge of his time that he did not essay. - -"Well, in him the brain powers survived the physical death. Though it -would seem that memory was not all complete. In some faculties of -mind he has been, and is, only a child. But he is growing, and some -things that were childish at the first are now of man's stature. He -is experimenting, and doing it well. And if it had not been that we -have crossed his path he would be yet, he may be yet if we fail, the -father or furtherer of a new order of beings, whose road must lead -through Death, not Life." - -Harker groaned and said, "And this is all arrayed against my darling! -But how is he experimenting? The knowledge may help us to defeat -him!" - -"He has all along, since his coming, been trying his power, slowly but -surely. That big child-brain of his is working. Well for us, it is -as yet a child-brain. For had he dared, at the first, to attempt -certain things he would long ago have been beyond our power. However, -he means to succeed, and a man who has centuries before him can afford -to wait and to go slow. Festina lente may well be his motto." - -"I fail to understand," said Harker wearily. "Oh, do be more plain to -me! Perhaps grief and trouble are dulling my brain." - -The Professor laid his hand tenderly on his shoulder as he spoke, "Ah, -my child, I will be plain. Do you not see how, of late, this monster -has been creeping into knowledge experimentally. How he has been -making use of the zoophagous patient to effect his entry into friend -John's home. For your Vampire, though in all afterwards he can come -when and how he will, must at the first make entry only when asked -thereto by an inmate. But these are not his most important -experiments. Do we not see how at the first all these so great boxes -were moved by others. He knew not then but that must be so. But all -the time that so great child-brain of his was growing, and he began to -consider whether he might not himself move the box. So he began to -help. And then, when he found that this be all right, he try to move -them all alone. And so he progress, and he scatter these graves of -him. And none but he know where they are hidden. - -"He may have intend to bury them deep in the ground. So that only he -use them in the night, or at such time as he can change his form, they -do him equal well, and none may know these are his hiding place! But, -my child, do not despair, this knowledge came to him just too late! -Already all of his lairs but one be sterilize as for him. And before -the sunset this shall be so. Then he have no place where he can move -and hide. I delayed this morning that so we might be sure. Is there -not more at stake for us than for him? Then why not be more careful -than him? By my clock it is one hour and already, if all be well, -friend Arthur and Quincey are on their way to us. Today is our day, -and we must go sure, if slow, and lose no chance. See! There are -five of us when those absent ones return." - -Whilst we were speaking we were startled by a knock at the hall door, -the double postman's knock of the telegraph boy. We all moved out to -the hall with one impulse, and Van Helsing, holding up his hand to us -to keep silence, stepped to the door and opened it. The boy handed in -a dispatch. The Professor closed the door again, and after looking at -the direction, opened it and read aloud. - -"Look out for D. He has just now, 12:45, come from Carfax -hurriedly and hastened towards the South. He seems to be -going the round and may want to see you: Mina." - -There was a pause, broken by Jonathan Harker's voice, "Now, God be -thanked, we shall soon meet!" - -Van Helsing turned to him quickly and said, "God will act in His own -way and time. Do not fear, and do not rejoice as yet. For what we -wish for at the moment may be our own undoings." - -"I care for nothing now," he answered hotly, "except to wipe out this -brute from the face of creation. I would sell my soul to do it!" - -"Oh, hush, hush, my child!" said Van Helsing. "God does not purchase -souls in this wise, and the Devil, though he may purchase, does not -keep faith. But God is merciful and just, and knows your pain and -your devotion to that dear Madam Mina. Think you, how her pain would -be doubled, did she but hear your wild words. Do not fear any of us, -we are all devoted to this cause, and today shall see the end. The -time is coming for action. Today this Vampire is limit to the powers -of man, and till sunset he may not change. It will take him time to -arrive here, see it is twenty minutes past one, and there are yet some -times before he can hither come, be he never so quick. What we must -hope for is that my Lord Arthur and Quincey arrive first." - -About half an hour after we had received Mrs. Harker's telegram, there -came a quiet, resolute knock at the hall door. It was just an -ordinary knock, such as is given hourly by thousands of gentlemen, but -it made the Professor's heart and mine beat loudly. We looked at each -other, and together moved out into the hall. We each held ready to -use our various armaments, the spiritual in the left hand, the mortal -in the right. Van Helsing pulled back the latch, and holding the door -half open, stood back, having both hands ready for action. The -gladness of our hearts must have shown upon our faces when on the -step, close to the door, we saw Lord Godalming and Quincey Morris. -They came quickly in and closed the door behind them, the former -saying, as they moved along the hall: - -"It is all right. We found both places. Six boxes in each and we -destroyed them all." - -"Destroyed?" asked the Professor. - -"For him!" We were silent for a minute, and then Quincey said, -"There's nothing to do but to wait here. If, however, he doesn't turn -up by five o'clock, we must start off. For it won't do to leave Mrs. -Harker alone after sunset." - -"He will be here before long now," said Van Helsing, who had been -consulting his pocketbook. "Nota bene, in Madam's telegram he went -south from Carfax. That means he went to cross the river, and he -could only do so at slack of tide, which should be something before -one o'clock. That he went south has a meaning for us. He is as yet -only suspicious, and he went from Carfax first to the place where he -would suspect interference least. You must have been at Bermondsey -only a short time before him. That he is not here already shows that -he went to Mile End next. This took him some time, for he would then -have to be carried over the river in some way. Believe me, my -friends, we shall not have long to wait now. We should have ready -some plan of attack, so that we may throw away no chance. Hush, there -is no time now. Have all your arms! Be ready!" He held up a warning -hand as he spoke, for we all could hear a key softly inserted in the -lock of the hall door. - -I could not but admire, even at such a moment, the way in which a -dominant spirit asserted itself. In all our hunting parties and -adventures in different parts of the world, Quincey Morris had always -been the one to arrange the plan of action, and Arthur and I had been -accustomed to obey him implicitly. Now, the old habit seemed to be -renewed instinctively. With a swift glance around the room, he at -once laid out our plan of attack, and without speaking a word, with a -gesture, placed us each in position. Van Helsing, Harker, and I were -just behind the door, so that when it was opened the Professor could -guard it whilst we two stepped between the incomer and the door. -Godalming behind and Quincey in front stood just out of sight ready to -move in front of the window. We waited in a suspense that made the -seconds pass with nightmare slowness. The slow, careful steps came -along the hall. The Count was evidently prepared for some surprise, -at least he feared it. - -Suddenly with a single bound he leaped into the room. Winning a way -past us before any of us could raise a hand to stay him. There was -something so pantherlike in the movement, something so unhuman, that -it seemed to sober us all from the shock of his coming. The first to -act was Harker, who with a quick movement, threw himself before the -door leading into the room in the front of the house. As the Count -saw us, a horrible sort of snarl passed over his face, showing the -eyeteeth long and pointed. But the evil smile as quickly passed into -a cold stare of lion-like disdain. His expression again changed as, -with a single impulse, we all advanced upon him. It was a pity that -we had not some better organized plan of attack, for even at the -moment I wondered what we were to do. I did not myself know whether -our lethal weapons would avail us anything. - -Harker evidently meant to try the matter, for he had ready his great -Kukri knife and made a fierce and sudden cut at him. The blow was a -powerful one; only the diabolical quickness of the Count's leap back -saved him. A second less and the trenchant blade had shorn through -his heart. As it was, the point just cut the cloth of his coat, -making a wide gap whence a bundle of bank notes and a stream -of gold fell out. The expression of the Count's face was so hellish, -that for a moment I feared for Harker, though I saw him throw the -terrible knife aloft again for another stroke. Instinctively I moved -forward with a protective impulse, holding the Crucifix and Wafer in -my left hand. I felt a mighty power fly along my arm, and it was -without surprise that I saw the monster cower back before a similar -movement made spontaneously by each one of us. It would be impossible -to describe the expression of hate and baffled malignity, of anger and -hellish rage, which came over the Count's face. His waxen hue became -greenish-yellow by the contrast of his burning eyes, and the red scar -on the forehead showed on the pallid skin like a palpitating wound. -The next instant, with a sinuous dive he swept under Harker's arm, ere -his blow could fall, and grasping a handful of the money from the -floor, dashed across the room, threw himself at the window. Amid the -crash and glitter of the falling glass, he tumbled into the flagged -area below. Through the sound of the shivering glass I could hear the -"ting" of the gold, as some of the sovereigns fell on the flagging. - -We ran over and saw him spring unhurt from the ground. He, rushing up -the steps, crossed the flagged yard, and pushed open the stable door. -There he turned and spoke to us. - -"You think to baffle me, you with your pale faces all in a row, like -sheep in a butcher's. You shall be sorry yet, each one of you! You -think you have left me without a place to rest, but I have more. My -revenge is just begun! I spread it over centuries, and time is on my -side. Your girls that you all love are mine already. And through -them you and others shall yet be mine, my creatures, to do my bidding -and to be my jackals when I want to feed. Bah!" - -With a contemptuous sneer, he passed quickly through the door, and we -heard the rusty bolt creak as he fastened it behind him. A door -beyond opened and shut. The first of us to speak was the Professor. -Realizing the difficulty of following him through the stable, we moved -toward the hall. - -"We have learnt something . . . much! Notwithstanding his brave words, -he fears us. He fears time, he fears want! For if not, why he hurry -so? His very tone betray him, or my ears deceive. Why take that -money? You follow quick. You are hunters of the wild beast, and -understand it so. For me, I make sure that nothing here may be of use -to him, if so that he returns." - -As he spoke he put the money remaining in his pocket, took the title -deeds in the bundle as Harker had left them, and swept the remaining -things into the open fireplace, where he set fire to them with a -match. - -Godalming and Morris had rushed out into the yard, and Harker had -lowered himself from the window to follow the Count. He had, however, -bolted the stable door, and by the time they had forced it open there -was no sign of him. Van Helsing and I tried to make inquiry at the -back of the house. But the mews was deserted and no one had seen him -depart. - -It was now late in the afternoon, and sunset was not far off. We had -to recognize that our game was up. With heavy hearts we agreed with -the Professor when he said, "Let us go back to Madam Mina. Poor, poor -dear Madam Mina. All we can do just now is done, and we can there, at -least, protect her. But we need not despair. There is but one more -earth box, and we must try to find it. When that is done all may yet -be well." - -I could see that he spoke as bravely as he could to comfort Harker. -The poor fellow was quite broken down, now and again he gave a low -groan which he could not suppress. He was thinking of his wife. - -With sad hearts we came back to my house, where we found Mrs. Harker -waiting us, with an appearance of cheerfulness which did honour to her -bravery and unselfishness. When she saw our faces, her own became as -pale as death. For a second or two her eyes were closed as if she -were in secret prayer. - -And then she said cheerfully, "I can never thank you all enough. Oh, -my poor darling!" - -As she spoke, she took her husband's grey head in her hands and kissed -it. - -"Lay your poor head here and rest it. All will yet be well, dear! God -will protect us if He so will it in His good intent." The poor fellow -groaned. There was no place for words in his sublime misery. - -We had a sort of perfunctory supper together, and I think it cheered -us all up somewhat. It was, perhaps, the mere animal heat of food to -hungry people, for none of us had eaten anything since breakfast, or -the sense of companionship may have helped us, but anyhow we were all -less miserable, and saw the morrow as not altogether without hope. - -True to our promise, we told Mrs. Harker everything which had passed. -And although she grew snowy white at times when danger had seemed to -threaten her husband, and red at others when his devotion to her was -manifested, she listened bravely and with calmness. When we came to -the part where Harker had rushed at the Count so recklessly, she clung -to her husband's arm, and held it tight as though her clinging could -protect him from any harm that might come. She said nothing, however, -till the narration was all done, and matters had been brought up to -the present time. - -Then without letting go her husband's hand she stood up amongst us and -spoke. Oh, that I could give any idea of the scene. Of that sweet, -sweet, good, good woman in all the radiant beauty of her youth and -animation, with the red scar on her forehead, of which she was -conscious, and which we saw with grinding of our teeth, remembering -whence and how it came. Her loving kindness against our grim hate. -Her tender faith against all our fears and doubting. And we, knowing -that so far as symbols went, she with all her goodness and purity and -faith, was outcast from God. - -"Jonathan," she said, and the word sounded like music on her lips it -was so full of love and tenderness, "Jonathan dear, and you all my -true, true friends, I want you to bear something in mind through all -this dreadful time. I know that you must fight. That you must -destroy even as you destroyed the false Lucy so that the true Lucy -might live hereafter. But it is not a work of hate. That poor soul -who has wrought all this misery is the saddest case of all. Just -think what will be his joy when he, too, is destroyed in his worser -part that his better part may have spiritual immortality. You must be -pitiful to him, too, though it may not hold your hands from his -destruction." - -As she spoke I could see her husband's face darken and draw together, -as though the passion in him were shriveling his being to its core. -Instinctively the clasp on his wife's hand grew closer, till his -knuckles looked white. She did not flinch from the pain which I knew -she must have suffered, but looked at him with eyes that were more -appealing than ever. - -As she stopped speaking he leaped to his feet, almost tearing his hand -from hers as he spoke. - -"May God give him into my hand just for long enough to destroy that -earthly life of him which we are aiming at. If beyond it I could send -his soul forever and ever to burning hell I would do it!" - -"Oh, hush! Oh, hush in the name of the good God. Don't say such -things, Jonathan, my husband, or you will crush me with fear and -horror. Just think, my dear . . . I have been thinking all this long, -long day of it . . . that . . . perhaps . . . some day . . . I, too, may -need such pity, and that some other like you, and with equal cause for -anger, may deny it to me! Oh, my husband! My husband, indeed I would -have spared you such a thought had there been another way. But I pray -that God may not have treasured your wild words, except as the -heart-broken wail of a very loving and sorely stricken man. Oh, God, -let these poor white hairs go in evidence of what he has suffered, who -all his life has done no wrong, and on whom so many sorrows have -come." - -We men were all in tears now. There was no resisting them, and we -wept openly. She wept, too, to see that her sweeter counsels had -prevailed. Her husband flung himself on his knees beside her, and -putting his arms round her, hid his face in the folds of her dress. -Van Helsing beckoned to us and we stole out of the room, leaving the -two loving hearts alone with their God. - -Before they retired the Professor fixed up the room against any coming -of the Vampire, and assured Mrs. Harker that she might rest in peace. -She tried to school herself to the belief, and manifestly for her -husband's sake, tried to seem content. It was a brave struggle, and -was, I think and believe, not without its reward. Van Helsing had -placed at hand a bell which either of them was to sound in case of any -emergency. When they had retired, Quincey, Godalming, and I arranged -that we should sit up, dividing the night between us, and watch over -the safety of the poor stricken lady. The first watch falls to -Quincey, so the rest of us shall be off to bed as soon as we can. - -Godalming has already turned in, for his is the second watch. Now -that my work is done I, too, shall go to bed. - - - -JONATHAN HARKER'S JOURNAL - -3-4 October, close to midnight.--I thought yesterday would never end. -There was over me a yearning for sleep, in some sort of blind belief -that to wake would be to find things changed, and that any change must -now be for the better. Before we parted, we discussed what our next -step was to be, but we could arrive at no result. All we knew was -that one earth box remained, and that the Count alone knew where it -was. If he chooses to lie hidden, he may baffle us for years. And in -the meantime, the thought is too horrible, I dare not think of it even -now. This I know, that if ever there was a woman who was all -perfection, that one is my poor wronged darling. I loved her a -thousand times more for her sweet pity of last night, a pity that made -my own hate of the monster seem despicable. Surely God will not -permit the world to be the poorer by the loss of such a creature. This -is hope to me. We are all drifting reefwards now, and faith is our -only anchor. Thank God! Mina is sleeping, and sleeping without -dreams. I fear what her dreams might be like, with such terrible -memories to ground them in. She has not been so calm, within my -seeing, since the sunset. Then, for a while, there came over her face -a repose which was like spring after the blasts of March. I thought -at the time that it was the softness of the red sunset on her face, -but somehow now I think it has a deeper meaning. I am not sleepy -myself, though I am weary . . . weary to death. However, I must try -to sleep. For there is tomorrow to think of, and there is no rest for -me until . . . - - -Later--I must have fallen asleep, for I was awakened by Mina, who was -sitting up in bed, with a startled look on her face. I could see -easily, for we did not leave the room in darkness. She had placed a -warning hand over my mouth, and now she whispered in my ear, "Hush! -There is someone in the corridor!" I got up softly, and crossing the -room, gently opened the door. - -Just outside, stretched on a mattress, lay Mr. Morris, wide awake. He -raised a warning hand for silence as he whispered to me, "Hush! Go -back to bed. It is all right. One of us will be here all night. We -don't mean to take any chances!" - -His look and gesture forbade discussion, so I came back and told Mina. -She sighed and positively a shadow of a smile stole over her poor, -pale face as she put her arms round me and said softly, "Oh, thank God -for good brave men!" With a sigh she sank back again to sleep. I -write this now as I am not sleepy, though I must try again. - - -4 October, morning.--Once again during the night I was wakened by -Mina. This time we had all had a good sleep, for the grey of the -coming dawn was making the windows into sharp oblongs, and the gas -flame was like a speck rather than a disc of light. - -She said to me hurriedly, "Go, call the Professor. I want to see him -at once." - -"Why?" I asked. - -"I have an idea. I suppose it must have come in the night, and -matured without my knowing it. He must hypnotize me before the dawn, -and then I shall be able to speak. Go quick, dearest, the time is -getting close." - -I went to the door. Dr. Seward was resting on the mattress, and -seeing me, he sprang to his feet. - -"Is anything wrong?" he asked, in alarm. - -"No," I replied. "But Mina wants to see Dr. Van Helsing at once." - -"I will go," he said, and hurried into the Professor's room. - -Two or three minutes later Van Helsing was in the room in his dressing -gown, and Mr. Morris and Lord Godalming were with Dr. Seward at the -door asking questions. When the Professor saw Mina a smile, a -positive smile ousted the anxiety of his face. - -He rubbed his hands as he said, "Oh, my dear Madam Mina, this is -indeed a change. See! Friend Jonathan, we have got our dear Madam -Mina, as of old, back to us today!" Then turning to her, he said -cheerfully, "And what am I to do for you? For at this hour you do not -want me for nothing." - -"I want you to hypnotize me!" she said. "Do it before the dawn, for I -feel that then I can speak, and speak freely. Be quick, for the time -is short!" Without a word he motioned her to sit up in bed. - -Looking fixedly at her, he commenced to make passes in front of her, -from over the top of her head downward, with each hand in turn. Mina -gazed at him fixedly for a few minutes, during which my own heart beat -like a trip hammer, for I felt that some crisis was at hand. -Gradually her eyes closed, and she sat, stock still. Only by the -gentle heaving of her bosom could one know that she was alive. The -Professor made a few more passes and then stopped, and I could see -that his forehead was covered with great beads of perspiration. Mina -opened her eyes, but she did not seem the same woman. There was a -far-away look in her eyes, and her voice had a sad dreaminess which -was new to me. Raising his hand to impose silence, the Professor -motioned to me to bring the others in. They came on tiptoe, closing -the door behind them, and stood at the foot of the bed, looking on. -Mina appeared not to see them. The stillness was broken by Van -Helsing's voice speaking in a low level tone which would not break the -current of her thoughts. - -"Where are you?" The answer came in a neutral way. - -"I do not know. Sleep has no place it can call its own." For several -minutes there was silence. Mina sat rigid, and the Professor stood -staring at her fixedly. - -The rest of us hardly dared to breathe. The room was growing lighter. -Without taking his eyes from Mina's face, Dr. Van Helsing motioned me -to pull up the blind. I did so, and the day seemed just upon us. A -red streak shot up, and a rosy light seemed to diffuse itself through -the room. On the instant the Professor spoke again. - -"Where are you now?" - -The answer came dreamily, but with intention. It were as though she -were interpreting something. I have heard her use the same tone when -reading her shorthand notes. - -"I do not know. It is all strange to me!" - -"What do you see?" - -"I can see nothing. It is all dark." - -"What do you hear?" I could detect the strain in the Professor's -patient voice. - -"The lapping of water. It is gurgling by, and little waves leap. I -can hear them on the outside." - -"Then you are on a ship?'" - -We all looked at each other, trying to glean something each from the -other. We were afraid to think. - -The answer came quick, "Oh, yes!" - -"What else do you hear?" - -"The sound of men stamping overhead as they run about. There is the -creaking of a chain, and the loud tinkle as the check of the capstan -falls into the ratchet." - -"What are you doing?" - -"I am still, oh so still. It is like death!" The voice faded away -into a deep breath as of one sleeping, and the open eyes closed again. - -By this time the sun had risen, and we were all in the full light of -day. Dr. Van Helsing placed his hands on Mina's shoulders, and laid -her head down softly on her pillow. She lay like a sleeping child for -a few moments, and then, with a long sigh, awoke and stared in wonder -to see us all around her. - -"Have I been talking in my sleep?" was all she said. She seemed, -however, to know the situation without telling, though she was eager -to know what she had told. The Professor repeated the conversation, -and she said, "Then there is not a moment to lose. It may not be yet -too late!" - -Mr. Morris and Lord Godalming started for the door but the Professor's -calm voice called them back. - -"Stay, my friends. That ship, wherever it was, was weighing anchor at -the moment in your so great Port of London. Which of them is it that -you seek? God be thanked that we have once again a clue, though -whither it may lead us we know not. We have been blind somewhat. -Blind after the manner of men, since we can look back we see what we -might have seen looking forward if we had been able to see what we -might have seen! Alas, but that sentence is a puddle, is it not? We -can know now what was in the Count's mind, when he seize that money, -though Jonathan's so fierce knife put him in the danger that even he -dread. He meant escape. Hear me, ESCAPE! He saw that with but one -earth box left, and a pack of men following like dogs after a fox, -this London was no place for him. He have take his last earth box on -board a ship, and he leave the land. He think to escape, but no! We -follow him. Tally Ho! As friend Arthur would say when he put on his -red frock! Our old fox is wily. Oh! So wily, and we must follow -with wile. I, too, am wily and I think his mind in a little while. -In meantime we may rest and in peace, for there are between us which -he do not want to pass, and which he could not if he would. Unless -the ship were to touch the land, and then only at full or slack tide. -See, and the sun is just rose, and all day to sunset is us. Let us -take bath, and dress, and have breakfast which we all need, and which -we can eat comfortably since he be not in the same land with us." - -Mina looked at him appealingly as she asked, "But why need we seek him -further, when he is gone away from us?" - -He took her hand and patted it as he replied, "Ask me nothing as yet. -When we have breakfast, then I answer all questions." He would say no -more, and we separated to dress. - -After breakfast Mina repeated her question. He looked at her gravely -for a minute and then said sorrowfully, "Because my dear, dear Madam -Mina, now more than ever must we find him even if we have to follow -him to the jaws of Hell!" - -She grew paler as she asked faintly, "Why?" - -"Because," he answered solemnly, "he can live for centuries, and you -are but mortal woman. Time is now to be dreaded, since once he put -that mark upon your throat." - -I was just in time to catch her as she fell forward in a faint. - - - - -CHAPTER 24 - - -DR. SEWARD'S PHONOGRAPH DIARY - -SPOKEN BY VAN HELSING - -This to Jonathan Harker. - -You are to stay with your dear Madam Mina. We shall go to make our -search, if I can call it so, for it is not search but knowing, and we -seek confirmation only. But do you stay and take care of her today. -This is your best and most holiest office. This day nothing can find -him here. - -Let me tell you that so you will know what we four know already, for I -have tell them. He, our enemy, have gone away. He have gone back to -his Castle in Transylvania. I know it so well, as if a great hand of -fire wrote it on the wall. He have prepare for this in some way, and -that last earth box was ready to ship somewheres. For this he took -the money. For this he hurry at the last, lest we catch him before -the sun go down. It was his last hope, save that he might hide in the -tomb that he think poor Miss Lucy, being as he thought like him, keep -open to him. But there was not of time. When that fail he make -straight for his last resource, his last earth-work I might say did I -wish double entente. He is clever, oh so clever! He know that his -game here was finish. And so he decide he go back home. He find ship -going by the route he came, and he go in it. - -We go off now to find what ship, and whither bound. When we have -discover that, we come back and tell you all. Then we will comfort -you and poor Madam Mina with new hope. For it will be hope when you -think it over, that all is not lost. This very creature that we -pursue, he take hundreds of years to get so far as London. And yet in -one day, when we know of the disposal of him we drive him out. He is -finite, though he is powerful to do much harm and suffers not as we -do. But we are strong, each in our purpose, and we are all more -strong together. Take heart afresh, dear husband of Madam Mina. This -battle is but begun and in the end we shall win. So sure as that God -sits on high to watch over His children. Therefore be of much comfort -till we return. - -VAN HELSING. - - - - - -JONATHAN HARKER'S JOURNAL - -4 October.--When I read to Mina, Van Helsing's message in the -phonograph, the poor girl brightened up considerably. Already the -certainty that the Count is out of the country has given her comfort. -And comfort is strength to her. For my own part, now that his -horrible danger is not face to face with us, it seems almost -impossible to believe in it. Even my own terrible experiences in -Castle Dracula seem like a long forgotten dream. Here in the crisp -autumn air in the bright sunlight. - -Alas! How can I disbelieve! In the midst of my thought my eye fell -on the red scar on my poor darling's white forehead. Whilst that -lasts, there can be no disbelief. Mina and I fear to be idle, so we -have been over all the diaries again and again. Somehow, although the -reality seem greater each time, the pain and the fear seem less. There -is something of a guiding purpose manifest throughout, which is -comforting. Mina says that perhaps we are the instruments of ultimate -good. It may be! I shall try to think as she does. We have never -spoken to each other yet of the future. It is better to wait till we -see the Professor and the others after their investigations. - -The day is running by more quickly than I ever thought a day could run -for me again. It is now three o'clock. - - - - - -MINA HARKER'S JOURNAL - -5 October, 5 P.M.--Our meeting for report. Present: Professor Van -Helsing, Lord Godalming, Dr. Seward, Mr. Quincey Morris, Jonathan -Harker, Mina Harker. - -Dr. Van Helsing described what steps were taken during the day to -discover on what boat and whither bound Count Dracula made his escape. - -"As I knew that he wanted to get back to Transylvania, I felt sure -that he must go by the Danube mouth, or by somewhere in the Black Sea, -since by that way he come. It was a dreary blank that was before us. -Omme ignotum pro magnifico, and so with heavy hearts we start to find -what ships leave for the Black Sea last night. He was in sailing -ship, since Madam Mina tell of sails being set. These not so -important as to go in your list of the shipping in the Times, and so -we go, by suggestion of Lord Godalming, to your Lloyd's, where are -note of all ships that sail, however so small. There we find that -only one Black Sea bound ship go out with the tide. She is the -Czarina Catherine, and she sail from Doolittle's Wharf for Varna, and -thence to other ports and up the Danube. 'So!' said I, 'this is the -ship whereon is the Count.' So off we go to Doolittle's Wharf, and -there we find a man in an office. From him we inquire of the goings -of the Czarina Catherine. He swear much, and he red face and loud of -voice, but he good fellow all the same. And when Quincey give him -something from his pocket which crackle as he roll it up, and put it -in a so small bag which he have hid deep in his clothing, he still -better fellow and humble servant to us. He come with us, and ask many -men who are rough and hot. These be better fellows too when they have -been no more thirsty. They say much of blood and bloom, and of others -which I comprehend not, though I guess what they mean. But -nevertheless they tell us all things which we want to know. - -"They make known to us among them, how last afternoon at about five -o'clock comes a man so hurry. A tall man, thin and pale, with high -nose and teeth so white, and eyes that seem to be burning. That he be -all in black, except that he have a hat of straw which suit not him or -the time. That he scatter his money in making quick inquiry as to -what ship sails for the Black Sea and for where. Some took him to the -office and then to the ship, where he will not go aboard but halt at -shore end of gangplank, and ask that the captain come to him. The -captain come, when told that he will be pay well, and though he swear -much at the first he agree to term. Then the thin man go and some one -tell him where horse and cart can be hired. He go there and soon he -come again, himself driving cart on which a great box. This he -himself lift down, though it take several to put it on truck for the -ship. He give much talk to captain as to how and where his box is to -be place. But the captain like it not and swear at him in many -tongues, and tell him that if he like he can come and see where it -shall be. But he say 'no,' that he come not yet, for that he have -much to do. Whereupon the captain tell him that he had better be -quick, with blood, for that his ship will leave the place, of blood, -before the turn of the tide, with blood. Then the thin man smile and -say that of course he must go when he think fit, but he will be -surprise if he go quite so soon. The captain swear again, polyglot, -and the thin man make him bow, and thank him, and say that he will so -far intrude on his kindness as to come aboard before the sailing. -Final the captain, more red than ever, and in more tongues, tell him -that he doesn't want no Frenchmen, with bloom upon them and also with -blood, in his ship, with blood on her also. And so, after asking -where he might purchase ship forms, he departed. - -"No one knew where he went 'or bloomin' well cared' as they said, for -they had something else to think of, well with blood again. For it -soon became apparent to all that the Czarina Catherine would not sail -as was expected. A thin mist began to creep up from the river, and it -grew, and grew. Till soon a dense fog enveloped the ship and all -around her. The captain swore polyglot, very polyglot, polyglot with -bloom and blood, but he could do nothing. The water rose and rose, -and he began to fear that he would lose the tide altogether. He was -in no friendly mood, when just at full tide, the thin man came up the -gangplank again and asked to see where his box had been stowed. Then -the captain replied that he wished that he and his box, old and with -much bloom and blood, were in hell. But the thin man did not be -offend, and went down with the mate and saw where it was place, and -came up and stood awhile on deck in fog. He must have come off by -himself, for none notice him. Indeed they thought not of him, for -soon the fog begin to melt away, and all was clear again. My friends -of the thirst and the language that was of bloom and blood laughed, as -they told how the captain's swears exceeded even his usual polyglot, -and was more than ever full of picturesque, when on questioning other -mariners who were on movement up and down the river that hour, he -found that few of them had seen any of fog at all, except where it lay -round the wharf. However, the ship went out on the ebb tide, and was -doubtless by morning far down the river mouth. She was then, when -they told us, well out to sea. - -"And so, my dear Madam Mina, it is that we have to rest for a time, -for our enemy is on the sea, with the fog at his command, on his way -to the Danube mouth. To sail a ship takes time, go she never so -quick. And when we start to go on land more quick, and we meet him -there. Our best hope is to come on him when in the box between -sunrise and sunset. For then he can make no struggle, and we may deal -with him as we should. There are days for us, in which we can make -ready our plan. We know all about where he go. For we have seen the -owner of the ship, who have shown us invoices and all papers that can -be. The box we seek is to be landed in Varna, and to be given to an -agent, one Ristics who will there present his credentials. And so our -merchant friend will have done his part. When he ask if there be any -wrong, for that so, he can telegraph and have inquiry made at Varna, -we say 'no,' for what is to be done is not for police or of the -customs. It must be done by us alone and in our own way." - -When Dr. Van Helsing had done speaking, I asked him if he were certain -that the Count had remained on board the ship. He replied, "We have -the best proof of that, your own evidence, when in the hypnotic trance -this morning." - -I asked him again if it were really necessary that they should pursue -the Count, for oh! I dread Jonathan leaving me, and I know that he -would surely go if the others went. He answered in growing passion, -at first quietly. As he went on, however, he grew more angry and more -forceful, till in the end we could not but see wherein was at least -some of that personal dominance which made him so long a master -amongst men. - -"Yes, it is necessary, necessary, necessary! For your sake in the -first, and then for the sake of humanity. This monster has done much -harm already, in the narrow scope where he find himself, and in the -short time when as yet he was only as a body groping his so small -measure in darkness and not knowing. All this have I told these -others. You, my dear Madam Mina, will learn it in the phonograph of -my friend John, or in that of your husband. I have told them how the -measure of leaving his own barren land, barren of peoples, and coming -to a new land where life of man teems till they are like the multitude -of standing corn, was the work of centuries. Were another of the -Undead, like him, to try to do what he has done, perhaps not all the -centuries of the world that have been, or that will be, could aid him. -With this one, all the forces of nature that are occult and deep and -strong must have worked together in some wonderous way. The very -place, where he have been alive, Undead for all these centuries, is -full of strangeness of the geologic and chemical world. There are -deep caverns and fissures that reach none know whither. There have -been volcanoes, some of whose openings still send out waters of -strange properties, and gases that kill or make to vivify. Doubtless, -there is something magnetic or electric in some of these combinations -of occult forces which work for physical life in strange way, and in -himself were from the first some great qualities. In a hard and -warlike time he was celebrate that he have more iron nerve, more -subtle brain, more braver heart, than any man. In him some vital -principle have in strange way found their utmost. And as his body -keep strong and grow and thrive, so his brain grow too. All this -without that diabolic aid which is surely to him. For it have to -yield to the powers that come from, and are, symbolic of good. And -now this is what he is to us. He have infect you, oh forgive me, my -dear, that I must say such, but it is for good of you that I speak. He -infect you in such wise, that even if he do no more, you have only to -live, to live in your own old, sweet way, and so in time, death, which -is of man's common lot and with God's sanction, shall make you like to -him. This must not be! We have sworn together that it must not. -Thus are we ministers of God's own wish. That the world, and men for -whom His Son die, will not be given over to monsters, whose very -existence would defame Him. He have allowed us to redeem one soul -already, and we go out as the old knights of the Cross to redeem -more. Like them we shall travel towards the sunrise. And like them, -if we fall, we fall in good cause." - -He paused and I said, "But will not the Count take his rebuff wisely? -Since he has been driven from England, will he not avoid it, as a -tiger does the village from which he has been hunted?" - -"Aha!" he said, "your simile of the tiger good, for me, and I shall -adopt him. Your maneater, as they of India call the tiger who has -once tasted blood of the human, care no more for the other prey, but -prowl unceasing till he get him. This that we hunt from our village -is a tiger, too, a maneater, and he never cease to prowl. Nay, in -himself he is not one to retire and stay afar. In his life, his -living life, he go over the Turkey frontier and attack his enemy on -his own ground. He be beaten back, but did he stay? No! He come -again, and again, and again. Look at his persistence and endurance. -With the child-brain that was to him he have long since conceive the -idea of coming to a great city. What does he do? He find out the -place of all the world most of promise for him. Then he deliberately -set himself down to prepare for the task. He find in patience just -how is his strength, and what are his powers. He study new tongues. -He learn new social life, new environment of old ways, the politics, -the law, the finance, the science, the habit of a new land and a new -people who have come to be since he was. His glimpse that he have -had, whet his appetite only and enkeen his desire. Nay, it help him -to grow as to his brain. For it all prove to him how right he was at -the first in his surmises. He have done this alone, all alone! From -a ruin tomb in a forgotten land. What more may he not do when the -greater world of thought is open to him. He that can smile at death, -as we know him. Who can flourish in the midst of diseases that kill -off whole peoples. Oh! If such an one was to come from God, and not -the Devil, what a force for good might he not be in this old world of -ours. But we are pledged to set the world free. Our toil must be in -silence, and our efforts all in secret. For in this enlightened age, -when men believe not even what they see, the doubting of wise men -would be his greatest strength. It would be at once his sheath and -his armor, and his weapons to destroy us, his enemies, who are willing -to peril even our own souls for the safety of one we love. For the -good of mankind, and for the honour and glory of God." - -After a general discussion it was determined that for tonight nothing -be definitely settled. That we should all sleep on the facts, and try -to think out the proper conclusions. Tomorrow, at breakfast, we are -to meet again, and after making our conclusions known to one another, -we shall decide on some definite cause of action . . . - -I feel a wonderful peace and rest tonight. It is as if some haunting -presence were removed from me. Perhaps . . . - -My surmise was not finished, could not be, for I caught sight in the -mirror of the red mark upon my forehead, and I knew that I was still -unclean. - - - - -DR. SEWARD'S DIARY - -5 October.--We all arose early, and I think that sleep did much for -each and all of us. When we met at early breakfast there was more -general cheerfulness than any of us had ever expected to experience -again. - -It is really wonderful how much resilience there is in human nature. -Let any obstructing cause, no matter what, be removed in any way, even -by death, and we fly back to first principles of hope and enjoyment. -More than once as we sat around the table, my eyes opened in wonder -whether the whole of the past days had not been a dream. It was only -when I caught sight of the red blotch on Mrs. Harker's forehead that I -was brought back to reality. Even now, when I am gravely revolving -the matter, it is almost impossible to realize that the cause of all -our trouble is still existent. Even Mrs. Harker seems to lose sight -of her trouble for whole spells. It is only now and again, when -something recalls it to her mind, that she thinks of her terrible -scar. We are to meet here in my study in half an hour and decide on -our course of action. I see only one immediate difficulty, I know it -by instinct rather than reason. We shall all have to speak frankly. -And yet I fear that in some mysterious way poor Mrs. Harker's tongue -is tied. I know that she forms conclusions of her own, and from all -that has been I can guess how brilliant and how true they must be. -But she will not, or cannot, give them utterance. I have mentioned -this to Van Helsing, and he and I are to talk it over when we are -alone. I suppose it is some of that horrid poison which has got into -her veins beginning to work. The Count had his own purposes when he -gave her what Van Helsing called "the Vampire's baptism of blood." -Well, there may be a poison that distills itself out of good things. -In an age when the existence of ptomaines is a mystery we should not -wonder at anything! One thing I know, that if my instinct be true -regarding poor Mrs. Harker's silences, then there is a terrible -difficulty, an unknown danger, in the work before us. The same power -that compels her silence may compel her speech. I dare not think -further, for so I should in my thoughts dishonour a noble woman! - - -Later.--When the Professor came in, we talked over the state of -things. I could see that he had something on his mind, which he -wanted to say, but felt some hesitancy about broaching the subject. -After beating about the bush a little, he said, "Friend John, there is -something that you and I must talk of alone, just at the first at any -rate. Later, we may have to take the others into our confidence." - -Then he stopped, so I waited. He went on, "Madam Mina, our poor, dear -Madam Mina is changing." - -A cold shiver ran through me to find my worst fears thus endorsed. -Van Helsing continued. - -"With the sad experience of Miss Lucy, we must this time be warned -before things go too far. Our task is now in reality more difficult -than ever, and this new trouble makes every hour of the direst -importance. I can see the characteristics of the vampire coming in -her face. It is now but very, very slight. But it is to be seen if -we have eyes to notice without prejudge. Her teeth are sharper, and -at times her eyes are more hard. But these are not all, there is to -her the silence now often, as so it was with Miss Lucy. She did not -speak, even when she wrote that which she wished to be known later. -Now my fear is this. If it be that she can, by our hypnotic trance, -tell what the Count see and hear, is it not more true that he who have -hypnotize her first, and who have drink of her very blood and make her -drink of his, should if he will, compel her mind to disclose to him -that which she know?" - -I nodded acquiescence. He went on, "Then, what we must do is to -prevent this. We must keep her ignorant of our intent, and so she -cannot tell what she know not. This is a painful task! Oh, so -painful that it heartbreak me to think of it, but it must be. When -today we meet, I must tell her that for reason which we will not to -speak she must not more be of our council, but be simply guarded by -us." - -He wiped his forehead, which had broken out in profuse perspiration at -the thought of the pain which he might have to inflict upon the poor -soul already so tortured. I knew that it would be some sort of -comfort to him if I told him that I also had come to the same -conclusion. For at any rate it would take away the pain of doubt. I -told him, and the effect was as I expected. - -It is now close to the time of our general gathering. Van Helsing has -gone away to prepare for the meeting, and his painful part of it. I -really believe his purpose is to be able to pray alone. - - -Later.--At the very outset of our meeting a great personal relief was -experienced by both Van Helsing and myself. Mrs. Harker had sent a -message by her husband to say that she would not join us at present, -as she thought it better that we should be free to discuss our -movements without her presence to embarrass us. The Professor and I -looked at each other for an instant, and somehow we both seemed -relieved. For my own part, I thought that if Mrs. Harker realized the -danger herself, it was much pain as well as much danger averted. -Under the circumstances we agreed, by a questioning look and answer, -with finger on lip, to preserve silence in our suspicions, until we -should have been able to confer alone again. We went at once into our -Plan of Campaign. - -Van Helsing roughly put the facts before us first, "The Czarina -Catherine left the Thames yesterday morning. It will take her at the -quickest speed she has ever made at least three weeks to reach Varna. -But we can travel overland to the same place in three days. Now, if -we allow for two days less for the ship's voyage, owing to such -weather influences as we know that the Count can bring to bear, and if -we allow a whole day and night for any delays which may occur to us, -then we have a margin of nearly two weeks. - -"Thus, in order to be quite safe, we must leave here on 17th at -latest. Then we shall at any rate be in Varna a day before the ship -arrives, and able to make such preparations as may be necessary. Of -course we shall all go armed, armed against evil things, spiritual as -well as physical." - -Here Quincey Morris added, "I understand that the Count comes from a -wolf country, and it may be that he shall get there before us. I -propose that we add Winchesters to our armament. I have a kind of -belief in a Winchester when there is any trouble of that sort around. -Do you remember, Art, when we had the pack after us at Tobolsk? What -wouldn't we have given then for a repeater apiece!" - -"Good!" said Van Helsing, "Winchesters it shall be. Quincey's head is -level at times, but most so when there is to hunt, metaphor be more -dishonour to science than wolves be of danger to man. In the meantime -we can do nothing here. And as I think that Varna is not familiar to -any of us, why not go there more soon? It is as long to wait here as -there. Tonight and tomorrow we can get ready, and then if all be -well, we four can set out on our journey." - -"We four?" said Harker interrogatively, looking from one to another of -us. - -"Of course!" answered the Professor quickly. "You must remain to take -care of your so sweet wife!" - -Harker was silent for awhile and then said in a hollow voice, "Let us -talk of that part of it in the morning. I want to consult with Mina." - -I thought that now was the time for Van Helsing to warn him not to -disclose our plan to her, but he took no notice. I looked at him -significantly and coughed. For answer he put his finger to his lips -and turned away. - - - -JONATHAN HARKER'S JOURNAL - -5 October, afternoon.--For some time after our meeting this morning I -could not think. The new phases of things leave my mind in a state of -wonder which allows no room for active thought. Mina's determination -not to take any part in the discussion set me thinking. And as I -could not argue the matter with her, I could only guess. I am as far -as ever from a solution now. The way the others received it, too -puzzled me. The last time we talked of the subject we agreed that -there was to be no more concealment of anything amongst us. Mina is -sleeping now, calmly and sweetly like a little child. Her lips are -curved and her face beams with happiness. Thank God, there are such -moments still for her. - - -Later.--How strange it all is. I sat watching Mina's happy sleep, and -I came as near to being happy myself as I suppose I shall ever be. As -the evening drew on, and the earth took its shadows from the sun -sinking lower, the silence of the room grew more and more solemn to -me. - -All at once Mina opened her eyes, and looking at me tenderly said, -"Jonathan, I want you to promise me something on your word of honour. -A promise made to me, but made holily in God's hearing, and not to be -broken though I should go down on my knees and implore you with bitter -tears. Quick, you must make it to me at once." - -"Mina," I said, "a promise like that, I cannot make at once. I may -have no right to make it." - -"But, dear one," she said, with such spiritual intensity that her eyes -were like pole stars, "it is I who wish it. And it is not for myself. -You can ask Dr. Van Helsing if I am not right. If he disagrees you -may do as you will. Nay, more if you all agree, later you are -absolved from the promise." - -"I promise!" I said, and for a moment she looked supremely happy. -Though to me all happiness for her was denied by the red scar on her -forehead. - -She said, "Promise me that you will not tell me anything of the plans -formed for the campaign against the Count. Not by word, or inference, -or implication, not at any time whilst this remains to me!" And she -solemnly pointed to the scar. I saw that she was in earnest, and said -solemnly, "I promise!" and as I said it I felt that from that instant -a door had been shut between us. - - -Later, midnight.--Mina has been bright and cheerful all the evening. -So much so that all the rest seemed to take courage, as if infected -somewhat with her gaiety. As a result even I myself felt as if the -pall of gloom which weighs us down were somewhat lifted. We all -retired early. Mina is now sleeping like a little child. It is -wonderful thing that her faculty of sleep remains to her in the midst -of her terrible trouble. Thank God for it, for then at least she can -forget her care. Perhaps her example may affect me as her gaiety did -tonight. I shall try it. Oh! For a dreamless sleep. - -6 October, morning.--Another surprise. Mina woke me early, about the -same time as yesterday, and asked me to bring Dr. Van Helsing. I -thought that it was another occasion for hypnotism, and without -question went for the Professor. He had evidently expected some such -call, for I found him dressed in his room. His door was ajar, so that -he could hear the opening of the door of our room. He came at once. -As he passed into the room, he asked Mina if the others might come, -too. - -"No," she said quite simply, "it will not be necessary. You can tell -them just as well. I must go with you on your journey." - -Dr. Van Helsing was as startled as I was. After a moment's pause he -asked, "But why?" - -"You must take me with you. I am safer with you, and you shall be -safer, too." - -"But why, dear Madam Mina? You know that your safety is our solemnest -duty. We go into danger, to which you are, or may be, more liable -than any of us from . . . from circumstances . . . things that have -been." He paused embarrassed. - -As she replied, she raised her finger and pointed to her forehead. "I -know. That is why I must go. I can tell you now, whilst the sun is -coming up. I may not be able again. I know that when the Count wills -me I must go. I know that if he tells me to come in secret, I must by -wile. By any device to hoodwink, even Jonathan." God saw the look -that she turned on me as she spoke, and if there be indeed a Recording -Angel that look is noted to her ever-lasting honour. I could only -clasp her hand. I could not speak. My emotion was too great for even -the relief of tears. - -She went on. "You men are brave and strong. You are strong in your -numbers, for you can defy that which would break down the human -endurance of one who had to guard alone. Besides, I may be of -service, since you can hypnotize me and so learn that which even I -myself do not know." - -Dr. Van Helsing said gravely, "Madam Mina, you are, as always, most -wise. You shall with us come. And together we shall do that which we -go forth to achieve." - -When he had spoken, Mina's long spell of silence made me look at her. -She had fallen back on her pillow asleep. She did not even wake when -I had pulled up the blind and let in the sunlight which flooded the -room. Van Helsing motioned to me to come with him quietly. We went -to his room, and within a minute Lord Godalming, Dr. Seward, and Mr. -Morris were with us also. - -He told them what Mina had said, and went on. "In the morning we -shall leave for Varna. We have now to deal with a new factor, Madam -Mina. Oh, but her soul is true. It is to her an agony to tell us so -much as she has done. But it is most right, and we are warned in -time. There must be no chance lost, and in Varna we must be ready to -act the instant when that ship arrives." - -"What shall we do exactly?" asked Mr. Morris laconically. - -The Professor paused before replying, "We shall at the first board -that ship. Then, when we have identified the box, we shall place a -branch of the wild rose on it. This we shall fasten, for when it is -there none can emerge, so that at least says the superstition. And to -superstition must we trust at the first. It was man's faith in the -early, and it have its root in faith still. Then, when we get the -opportunity that we seek, when none are near to see, we shall open the -box, and . . . and all will be well." - -"I shall not wait for any opportunity," said Morris. "When I see the -box I shall open it and destroy the monster, though there were a -thousand men looking on, and if I am to be wiped out for it the next -moment!" I grasped his hand instinctively and found it as firm as a -piece of steel. I think he understood my look. I hope he did. - -"Good boy," said Dr. Van Helsing. "Brave boy. Quincey is all man. -God bless him for it. My child, believe me none of us shall lag -behind or pause from any fear. I do but say what we may do . . . what -we must do. But, indeed, indeed we cannot say what we may do. There -are so many things which may happen, and their ways and their ends are -so various that until the moment we may not say. We shall all be -armed, in all ways. And when the time for the end has come, our -effort shall not be lack. Now let us today put all our affairs in -order. Let all things which touch on others dear to us, and who on us -depend, be complete. For none of us can tell what, or when, or how, -the end may be. As for me, my own affairs are regulate, and as I have -nothing else to do, I shall go make arrangements for the travel. I -shall have all tickets and so forth for our journey." - -There was nothing further to be said, and we parted. I shall now -settle up all my affairs of earth, and be ready for whatever may come. - - -Later.--It is done. My will is made, and all complete. Mina if she -survive is my sole heir. If it should not be so, then the others who -have been so good to us shall have remainder. - -It is now drawing towards the sunset. Mina's uneasiness calls my -attention to it. I am sure that there is something on her mind which -the time of exact sunset will reveal. These occasions are becoming -harrowing times for us all. For each sunrise and sunset opens up some -new danger, some new pain, which however, may in God's will be means -to a good end. I write all these things in the diary since my darling -must not hear them now. But if it may be that she can see them again, -they shall be ready. She is calling to me. - - - - -CHAPTER 25 - - -DR. SEWARD'S DIARY - -11 October, Evening.--Jonathan Harker has asked me to note this, as he -says he is hardly equal to the task, and he wants an exact record -kept. - -I think that none of us were surprised when we were asked to see Mrs. -Harker a little before the time of sunset. We have of late come to -understand that sunrise and sunset are to her times of peculiar -freedom. When her old self can be manifest without any controlling -force subduing or restraining her, or inciting her to action. This -mood or condition begins some half hour or more before actual sunrise -or sunset, and lasts till either the sun is high, or whilst the clouds -are still aglow with the rays streaming above the horizon. At first -there is a sort of negative condition, as if some tie were loosened, -and then the absolute freedom quickly follows. When, however, the -freedom ceases the change back or relapse comes quickly, preceded -only by a spell of warning silence. - -Tonight, when we met, she was somewhat constrained, and bore all the -signs of an internal struggle. I put it down myself to her making a -violent effort at the earliest instant she could do so. - -A very few minutes, however, gave her complete control of herself. -Then, motioning her husband to sit beside her on the sofa where she -was half reclining, she made the rest of us bring chairs up close. - -Taking her husband's hand in hers, she began, "We are all here -together in freedom, for perhaps the last time! I know that you will -always be with me to the end." This was to her husband whose hand had, -as we could see, tightened upon her. "In the morning we go out upon -our task, and God alone knows what may be in store for any of us. You -are going to be so good to me to take me with you. I know that all -that brave earnest men can do for a poor weak woman, whose soul -perhaps is lost, no, no, not yet, but is at any rate at stake, you -will do. But you must remember that I am not as you are. There is a -poison in my blood, in my soul, which may destroy me, which must -destroy me, unless some relief comes to us. Oh, my friends, you know -as well as I do, that my soul is at stake. And though I know there is -one way out for me, you must not and I must not take it!" She looked -appealingly to us all in turn, beginning and ending with her husband. - -"What is that way?" asked Van Helsing in a hoarse voice. "What is -that way, which we must not, may not, take?" - -"That I may die now, either by my own hand or that of another, before -the greater evil is entirely wrought. I know, and you know, that were -I once dead you could and would set free my immortal spirit, even as -you did my poor Lucy's. Were death, or the fear of death, the only -thing that stood in the way I would not shrink to die here now, amidst -the friends who love me. But death is not all. I cannot believe that -to die in such a case, when there is hope before us and a bitter task -to be done, is God's will. Therefore, I on my part, give up here the -certainty of eternal rest, and go out into the dark where may be the -blackest things that the world or the nether world holds!" - -We were all silent, for we knew instinctively that this was only a -prelude. The faces of the others were set, and Harker's grew ashen -grey. Perhaps, he guessed better than any of us what was coming. - -She continued, "This is what I can give into the hotch-pot." I could -not but note the quaint legal phrase which she used in such a place, -and with all seriousness. "What will each of you give? Your lives I -know," she went on quickly, "that is easy for brave men. Your lives -are God's, and you can give them back to Him, but what will you give -to me?" She looked again questioningly, but this time avoided her -husband's face. Quincey seemed to understand, he nodded, and her face -lit up. "Then I shall tell you plainly what I want, for there must be -no doubtful matter in this connection between us now. You must -promise me, one and all, even you, my beloved husband, that should the -time come, you will kill me." - -"What is that time?" The voice was Quincey's, but it was low and -strained. - -"When you shall be convinced that I am so changed that it is better -that I die that I may live. When I am thus dead in the flesh, then -you will, without a moment's delay, drive a stake through me and cut -off my head, or do whatever else may be wanting to give me rest!" - -Quincey was the first to rise after the pause. He knelt down before -her and taking her hand in his said solemnly, "I'm only a rough -fellow, who hasn't, perhaps, lived as a man should to win such a -distinction, but I swear to you by all that I hold sacred and dear -that, should the time ever come, I shall not flinch from the duty that -you have set us. And I promise you, too, that I shall make all -certain, for if I am only doubtful I shall take it that the time has -come!" - -"My true friend!" was all she could say amid her fast-falling tears, -as bending over, she kissed his hand. - -"I swear the same, my dear Madam Mina!" said Van Helsing. "And I!" -said Lord Godalming, each of them in turn kneeling to her to take the -oath. I followed, myself. - -Then her husband turned to her wan-eyed and with a greenish pallor -which subdued the snowy whiteness of his hair, and asked, "And must I, -too, make such a promise, oh, my wife?" - -"You too, my dearest," she said, with infinite yearning of pity in her -voice and eyes. "You must not shrink. You are nearest and dearest -and all the world to me. Our souls are knit into one, for all life -and all time. Think, dear, that there have been times when brave men -have killed their wives and their womenkind, to keep them from falling -into the hands of the enemy. Their hands did not falter any the more -because those that they loved implored them to slay them. It is men's -duty towards those whom they love, in such times of sore trial! And -oh, my dear, if it is to be that I must meet death at any hand, let it -be at the hand of him that loves me best. Dr. Van Helsing, I have not -forgotten your mercy in poor Lucy's case to him who loved." She -stopped with a flying blush, and changed her phrase, "to him who had -best right to give her peace. If that time shall come again, I look -to you to make it a happy memory of my husband's life that it was his -loving hand which set me free from the awful thrall upon me." - -"Again I swear!" came the Professor's resonant voice. - -Mrs. Harker smiled, positively smiled, as with a sigh of relief she -leaned back and said, "And now one word of warning, a warning which -you must never forget. This time, if it ever come, may come quickly -and unexpectedly, and in such case you must lose no time in using your -opportunity. At such a time I myself might be . . . nay! If the time -ever come, shall be, leagued with your enemy against you. - -"One more request," she became very solemn as she said this, "it is -not vital and necessary like the other, but I want you to do one thing -for me, if you will." - -We all acquiesced, but no one spoke. There was no need to speak. - -"I want you to read the Burial Service." She was interrupted by a -deep groan from her husband. Taking his hand in hers, she held it -over her heart, and continued. "You must read it over me some day. -Whatever may be the issue of all this fearful state of things, it will -be a sweet thought to all or some of us. You, my dearest, will I hope -read it, for then it will be in your voice in my memory forever, come -what may!" - -"But oh, my dear one," he pleaded, "death is afar off from you." - -"Nay," she said, holding up a warning hand. "I am deeper in death at -this moment than if the weight of an earthly grave lay heavy upon me!" - -"Oh, my wife, must I read it?" he said, before he began. - -"It would comfort me, my husband!" was all she said, and he began to -read when she had got the book ready. - -How can I, how could anyone, tell of that strange scene, its -solemnity, its gloom, its sadness, its horror, and withal, its -sweetness. Even a sceptic, who can see nothing but a travesty of -bitter truth in anything holy or emotional, would have been melted to -the heart had he seen that little group of loving and devoted friends -kneeling round that stricken and sorrowing lady; or heard the tender -passion of her husband's voice, as in tones so broken and emotional -that often he had to pause, he read the simple and beautiful service -from the Burial of the Dead. I cannot go on . . . words . . . and -v-voices . . . f-fail m-me! - -She was right in her instinct. Strange as it was, bizarre as it may -hereafter seem even to us who felt its potent influence at the time, -it comforted us much. And the silence, which showed Mrs. Harker's -coming relapse from her freedom of soul, did not seem so full of -despair to any of us as we had dreaded. - - - - - -JONATHAN HARKER'S JOURNAL - -15 October, Varna.--We left Charing Cross on the morning of the 12th, -got to Paris the same night, and took the places secured for us in the -Orient Express. We traveled night and day, arriving here at about -five o'clock. Lord Godalming went to the Consulate to see if any -telegram had arrived for him, whilst the rest of us came on to this -hotel, "the Odessus." The journey may have had incidents. I was, -however, too eager to get on, to care for them. Until the Czarina -Catherine comes into port there will be no interest for me in anything -in the wide world. Thank God! Mina is well, and looks to be getting -stronger. Her colour is coming back. She sleeps a great deal. -Throughout the journey she slept nearly all the time. Before sunrise -and sunset, however, she is very wakeful and alert. And it has become -a habit for Van Helsing to hypnotize her at such times. At first, -some effort was needed, and he had to make many passes. But now, she -seems to yield at once, as if by habit, and scarcely any action is -needed. He seems to have power at these particular moments to simply -will, and her thoughts obey him. He always asks her what she can see -and hear. - -She answers to the first, "Nothing, all is dark." - -And to the second, "I can hear the waves lapping against the ship, and -the water rushing by. Canvas and cordage strain and masts and yards -creak. The wind is high . . . I can hear it in the shrouds, and the -bow throws back the foam." - -It is evident that the Czarina Catherine is still at sea, hastening on -her way to Varna. Lord Godalming has just returned. He had four -telegrams, one each day since we started, and all to the same effect. -That the Czarina Catherine had not been reported to Lloyd's from -anywhere. He had arranged before leaving London that his agent should -send him every day a telegram saying if the ship had been reported. -He was to have a message even if she were not reported, so that he -might be sure that there was a watch being kept at the other end of -the wire. - -We had dinner and went to bed early. Tomorrow we are to see the Vice -Consul, and to arrange, if we can, about getting on board the ship as -soon as she arrives. Van Helsing says that our chance will be to get -on the boat between sunrise and sunset. The Count, even if he takes -the form of a bat, cannot cross the running water of his own volition, -and so cannot leave the ship. As he dare not change to man's form -without suspicion, which he evidently wishes to avoid, he must remain -in the box. If, then, we can come on board after sunrise, he is at -our mercy, for we can open the box and make sure of him, as we did of -poor Lucy, before he wakes. What mercy he shall get from us all will -not count for much. We think that we shall not have much trouble with -officials or the seamen. Thank God! This is the country where -bribery can do anything, and we are well supplied with money. We have -only to make sure that the ship cannot come into port between sunset -and sunrise without our being warned, and we shall be safe. Judge -Moneybag will settle this case, I think! - - -16 October.--Mina's report still the same. Lapping waves and rushing -water, darkness and favouring winds. We are evidently in good time, -and when we hear of the Czarina Catherine we shall be ready. As she -must pass the Dardanelles we are sure to have some report. - - -17 October.--Everything is pretty well fixed now, I think, to welcome -the Count on his return from his tour. Godalming told the shippers -that he fancied that the box sent aboard might contain something -stolen from a friend of his, and got a half consent that he might open -it at his own risk. The owner gave him a paper telling the Captain to -give him every facility in doing whatever he chose on board the ship, -and also a similar authorization to his agent at Varna. We have seen -the agent, who was much impressed with Godalming's kindly manner to -him, and we are all satisfied that whatever he can do to aid our -wishes will be done. - -We have already arranged what to do in case we get the box open. If -the Count is there, Van Helsing and Seward will cut off his head at -once and drive a stake through his heart. Morris and Godalming and I -shall prevent interference, even if we have to use the arms which we -shall have ready. The Professor says that if we can so treat the -Count's body, it will soon after fall into dust. In such case there -would be no evidence against us, in case any suspicion of murder were -aroused. But even if it were not, we should stand or fall by our act, -and perhaps some day this very script may be evidence to come between -some of us and a rope. For myself, I should take the chance only too -thankfully if it were to come. We mean to leave no stone unturned to -carry out our intent. We have arranged with certain officials that -the instant the Czarina Catherine is seen, we are to be informed by a -special messenger. - - -24 October.--A whole week of waiting. Daily telegrams to Godalming, -but only the same story. "Not yet reported." Mina's morning and -evening hypnotic answer is unvaried. Lapping waves, rushing water, -and creaking masts. - - - - -TELEGRAM, OCTOBER 24TH RUFUS SMITH, LLOYD'S, LONDON, -TO LORD GODALMING, CARE OF H. B. M. VICE CONSUL, VARNA - -"Czarina Catherine reported this morning from Dardanelles." - - - -DR. SEWARD'S DIARY - -25 October.--How I miss my phonograph! To write a diary with a pen is -irksome to me! But Van Helsing says I must. We were all wild with -excitement yesterday when Godalming got his telegram from Lloyd's. I -know now what men feel in battle when the call to action is heard. -Mrs. Harker, alone of our party, did not show any signs of emotion. -After all, it is not strange that she did not, for we took special -care not to let her know anything about it, and we all tried not to -show any excitement when we were in her presence. In old days she -would, I am sure, have noticed, no matter how we might have tried to -conceal it. But in this way she is greatly changed during the past -three weeks. The lethargy grows upon her, and though she seems strong -and well, and is getting back some of her colour, Van Helsing and I are -not satisfied. We talk of her often. We have not, however, said a -word to the others. It would break poor Harker's heart, certainly his -nerve, if he knew that we had even a suspicion on the subject. Van -Helsing examines, he tells me, her teeth very carefully, whilst she is -in the hypnotic condition, for he says that so long as they do not -begin to sharpen there is no active danger of a change in her. If -this change should come, it would be necessary to take steps! We both -know what those steps would have to be, though we do not mention our -thoughts to each other. We should neither of us shrink from the task, -awful though it be to contemplate. "Euthanasia" is an excellent and a -comforting word! I am grateful to whoever invented it. - -It is only about 24 hours' sail from the Dardanelles to here, at the -rate the Czarina Catherine has come from London. She should therefore -arrive some time in the morning, but as she cannot possibly get in -before noon, we are all about to retire early. We shall get up at one -o'clock, so as to be ready. - - -25 October, Noon.--No news yet of the ship's arrival. Mrs. Harker's -hypnotic report this morning was the same as usual, so it is possible -that we may get news at any moment. We men are all in a fever of -excitement, except Harker, who is calm. His hands are cold as ice, -and an hour ago I found him whetting the edge of the great Ghoorka -knife which he now always carries with him. It will be a bad lookout -for the Count if the edge of that "Kukri" ever touches his throat, -driven by that stern, ice-cold hand! - -Van Helsing and I were a little alarmed about Mrs. Harker today. -About noon she got into a sort of lethargy which we did not like. -Although we kept silence to the others, we were neither of us happy -about it. She had been restless all the morning, so that we were at -first glad to know that she was sleeping. When, however, her husband -mentioned casually that she was sleeping so soundly that he could not -wake her, we went to her room to see for ourselves. She was breathing -naturally and looked so well and peaceful that we agreed that the -sleep was better for her than anything else. Poor girl, she has so -much to forget that it is no wonder that sleep, if it brings oblivion -to her, does her good. - - -Later.--Our opinion was justified, for when after a refreshing sleep -of some hours she woke up, she seemed brighter and better than she had -been for days. At sunset she made the usual hypnotic report. -Wherever he may be in the Black Sea, the Count is hurrying to his -destination. To his doom, I trust! - - - -26 October.--Another day and no tidings of the Czarina Catherine. She -ought to be here by now. That she is still journeying somewhere is -apparent, for Mrs. Harker's hypnotic report at sunrise was still the -same. It is possible that the vessel may be lying by, at times, for -fog. Some of the steamers which came in last evening reported patches -of fog both to north and south of the port. We must continue our -watching, as the ship may now be signalled any moment. - - -27 October, Noon.--Most strange. No news yet of the ship we wait for. -Mrs. Harker reported last night and this morning as usual. "Lapping -waves and rushing water," though she added that "the waves were very -faint." The telegrams from London have been the same, "no further -report." Van Helsing is terribly anxious, and told me just now that he -fears the Count is escaping us. - -He added significantly, "I did not like that lethargy of Madam Mina's. -Souls and memories can do strange things during trance." I was about -to ask him more, but Harker just then came in, and he held up a -warning hand. We must try tonight at sunset to make her speak more -fully when in her hypnotic state. - - -28 October.--Telegram. Rufus Smith, London, to Lord Godalming, care -H. B. M. Vice Consul, Varna - -"Czarina Catherine reported entering Galatz at one o'clock today." - - - - -DR. SEWARD'S DIARY - -28 October.--When the telegram came announcing the arrival in Galatz I -do not think it was such a shock to any of us as might have been -expected. True, we did not know whence, or how, or when, the bolt -would come. But I think we all expected that something strange would -happen. The day of arrival at Varna made us individually satisfied -that things would not be just as we had expected. We only waited to -learn where the change would occur. None the less, however, it was a -surprise. I suppose that nature works on such a hopeful basis that we -believe against ourselves that things will be as they ought to be, not -as we should know that they will be. Transcendentalism is a beacon to -the angels, even if it be a will-o'-the-wisp to man. Van Helsing -raised his hand over his head for a moment, as though in remonstrance -with the Almighty. But he said not a word, and in a few seconds stood -up with his face sternly set. - -Lord Godalming grew very pale, and sat breathing heavily. I was -myself half stunned and looked in wonder at one after another. -Quincey Morris tightened his belt with that quick movement which I -knew so well. In our old wandering days it meant "action." Mrs. -Harker grew ghastly white, so that the scar on her forehead seemed to -burn, but she folded her hands meekly and looked up in prayer. Harker -smiled, actually smiled, the dark, bitter smile of one who is without -hope, but at the same time his action belied his words, for his hands -instinctively sought the hilt of the great Kukri knife and rested -there. - -"When does the next train start for Galatz?" said Van Helsing to us -generally. - -"At 6:30 tomorrow morning!" We all started, for the answer came from -Mrs. Harker. - -"How on earth do you know?" said Art. - -"You forget, or perhaps you do not know, though Jonathan does and so -does Dr. Van Helsing, that I am the train fiend. At home in Exeter I -always used to make up the time tables, so as to be helpful to my -husband. I found it so useful sometimes, that I always make a study -of the time tables now. I knew that if anything were to take us to -Castle Dracula we should go by Galatz, or at any rate through -Bucharest, so I learned the times very carefully. Unhappily there are -not many to learn, as the only train tomorrow leaves as I say." - -"Wonderful woman!" murmured the Professor. - -"Can't we get a special?" asked Lord Godalming. - -Van Helsing shook his head, "I fear not. This land is very different -from yours or mine. Even if we did have a special, it would probably -not arrive as soon as our regular train. Moreover, we have something -to prepare. We must think. Now let us organize. You, friend Arthur, -go to the train and get the tickets and arrange that all be ready for -us to go in the morning. Do you, friend Jonathan, go to the agent of -the ship and get from him letters to the agent in Galatz, with -authority to make a search of the ship just as it was here. Quincey -Morris, you see the Vice Consul, and get his aid with his fellow in -Galatz and all he can do to make our way smooth, so that no times be -lost when over the Danube. John will stay with Madam Mina and me, and -we shall consult. For so if time be long you may be delayed. And it -will not matter when the sun set, since I am here with Madam to make -report." - -"And I," said Mrs. Harker brightly, and more like her old self than -she had been for many a long day, "shall try to be of use in all ways, -and shall think and write for you as I used to do. Something is -shifting from me in some strange way, and I feel freer than I have -been of late!" - -The three younger men looked happier at the moment as they seemed to -realize the significance of her words. But Van Helsing and I, turning -to each other, met each a grave and troubled glance. We said nothing -at the time, however. - -When the three men had gone out to their tasks Van Helsing asked Mrs. -Harker to look up the copy of the diaries and find him the part of -Harker's journal at the Castle. She went away to get it. - -When the door was shut upon her he said to me, "We mean the same! -Speak out!" - -"Here is some change. It is a hope that makes me sick, for it may -deceive us." - -"Quite so. Do you know why I asked her to get the manuscript?" - -"No!" said I, "unless it was to get an opportunity of seeing me -alone." - -"You are in part right, friend John, but only in part. I want to tell -you something. And oh, my friend, I am taking a great, a terrible, -risk. But I believe it is right. In the moment when Madam Mina said -those words that arrest both our understanding, an inspiration came to -me. In the trance of three days ago the Count sent her his spirit to -read her mind. Or more like he took her to see him in his earth box -in the ship with water rushing, just as it go free at rise and set of -sun. He learn then that we are here, for she have more to tell in her -open life with eyes to see ears to hear than he, shut as he is, in his -coffin box. Now he make his most effort to escape us. At present he -want her not. - -"He is sure with his so great knowledge that she will come at his -call. But he cut her off, take her, as he can do, out of his own -power, that so she come not to him. Ah! There I have hope that our -man brains that have been of man so long and that have not lost the -grace of God, will come higher than his child-brain that lie in his -tomb for centuries, that grow not yet to our stature, and that do only -work selfish and therefore small. Here comes Madam Mina. Not a word -to her of her trance! She knows it not, and it would overwhelm her -and make despair just when we want all her hope, all her courage, when -most we want all her great brain which is trained like man's brain, -but is of sweet woman and have a special power which the Count give -her, and which he may not take away altogether, though he think not -so. Hush! Let me speak, and you shall learn. Oh, John, my friend, -we are in awful straits. I fear, as I never feared before. We can -only trust the good God. Silence! Here she comes!" - -I thought that the Professor was going to break down and have -hysterics, just as he had when Lucy died, but with a great effort he -controlled himself and was at perfect nervous poise when Mrs. Harker -tripped into the room, bright and happy looking and, in the doing of -work, seemingly forgetful of her misery. As she came in, she handed a -number of sheets of typewriting to Van Helsing. He looked over them -gravely, his face brightening up as he read. - -Then holding the pages between his finger and thumb he said, "Friend -John, to you with so much experience already, and you too, dear Madam -Mina, that are young, here is a lesson. Do not fear ever to think. A -half thought has been buzzing often in my brain, but I fear to let him -loose his wings. Here now, with more knowledge, I go back to where -that half thought come from and I find that he be no half thought at -all. That be a whole thought, though so young that he is not yet -strong to use his little wings. Nay, like the 'Ugly Duck' of my -friend Hans Andersen, he be no duck thought at all, but a big swan -thought that sail nobly on big wings, when the time come for him to -try them. See I read here what Jonathan have written. - -"That other of his race who, in a later age, again and again, brought -his forces over The Great River into Turkey Land, who when he was -beaten back, came again, and again, and again, though he had to come -alone from the bloody field where his troops were being slaughtered, -since he knew that he alone could ultimately triumph. - -"What does this tell us? Not much? No! The Count's child thought -see nothing, therefore he speak so free. Your man thought see -nothing. My man thought see nothing, till just now. No! But there -comes another word from some one who speak without thought because -she, too, know not what it mean, what it might mean. Just as there -are elements which rest, yet when in nature's course they move on -their way and they touch, the pouf! And there comes a flash of light, -heaven wide, that blind and kill and destroy some. But that show up -all earth below for leagues and leagues. Is it not so? Well, I shall -explain. To begin, have you ever study the philosophy of crime? -'Yes' and 'No.' You, John, yes, for it is a study of insanity. You, -no, Madam Mina, for crime touch you not, not but once. Still, your -mind works true, and argues not a particulari ad universale. There is -this peculiarity in criminals. It is so constant, in all countries -and at all times, that even police, who know not much from philosophy, -come to know it empirically, that it is. That is to be empiric. The -criminal always work at one crime, that is the true criminal who seems -predestinate to crime, and who will of none other. This criminal has -not full man brain. He is clever and cunning and resourceful, but he -be not of man stature as to brain. He be of child brain in much. Now -this criminal of ours is predestinate to crime also. He, too, have -child brain, and it is of the child to do what he have done. The -little bird, the little fish, the little animal learn not by -principle, but empirically. And when he learn to do, then there is to -him the ground to start from to do more. 'Dos pou sto,' said -Archimedes. 'Give me a fulcrum, and I shall move the world!' To do -once, is the fulcrum whereby child brain become man brain. And until -he have the purpose to do more, he continue to do the same again every -time, just as he have done before! Oh, my dear, I see that your eyes -are opened, and that to you the lightning flash show all the leagues," -for Mrs. Harker began to clap her hands and her eyes sparkled. - -He went on, "Now you shall speak. Tell us two dry men of science what -you see with those so bright eyes." He took her hand and held it -whilst he spoke. His finger and thumb closed on her pulse, as I -thought instinctively and unconsciously, as she spoke. - -"The Count is a criminal and of criminal type. Nordau and Lombroso -would so classify him, and qua criminal he is of an imperfectly formed -mind. Thus, in a difficulty he has to seek resource in habit. His -past is a clue, and the one page of it that we know, and that from his -own lips, tells that once before, when in what Mr. Morris would call -a 'tight place,' he went back to his own country from the land he had -tried to invade, and thence, without losing purpose, prepared himself -for a new effort. He came again better equipped for his work, and -won. So he came to London to invade a new land. He was beaten, and -when all hope of success was lost, and his existence in danger, he -fled back over the sea to his home. Just as formerly he had fled back -over the Danube from Turkey Land." - -"Good, good! Oh, you so clever lady!" said Van Helsing, -enthusiastically, as he stooped and kissed her hand. A moment later -he said to me, as calmly as though we had been having a sick room -consultation, "Seventy-two only, and in all this excitement. I have -hope." - -Turning to her again, he said with keen expectation, "But go on. Go -on! There is more to tell if you will. Be not afraid. John and I -know. I do in any case, and shall tell you if you are right. Speak, -without fear!" - -"I will try to. But you will forgive me if I seem too egotistical." - -"Nay! Fear not, you must be egotist, for it is of you that we think." - -"Then, as he is criminal he is selfish. And as his intellect is small -and his action is based on selfishness, he confines himself to one -purpose. That purpose is remorseless. As he fled back over the -Danube, leaving his forces to be cut to pieces, so now he is intent on -being safe, careless of all. So his own selfishness frees my soul -somewhat from the terrible power which he acquired over me on that -dreadful night. I felt it! Oh, I felt it! Thank God, for His great -mercy! My soul is freer than it has been since that awful hour. And -all that haunts me is a fear lest in some trance or dream he may have -used my knowledge for his ends." - -The Professor stood up, "He has so used your mind, and by it he has -left us here in Varna, whilst the ship that carried him rushed through -enveloping fog up to Galatz, where, doubtless, he had made preparation -for escaping from us. But his child mind only saw so far. And it may -be that as ever is in God's Providence, the very thing that the evil -doer most reckoned on for his selfish good, turns out to be his -chiefest harm. The hunter is taken in his own snare, as the great -Psalmist says. For now that he think he is free from every trace of -us all, and that he has escaped us with so many hours to him, then his -selfish child brain will whisper him to sleep. He think, too, that as -he cut himself off from knowing your mind, there can be no knowledge -of him to you. There is where he fail! That terrible baptism of -blood which he give you makes you free to go to him in spirit, as you -have as yet done in your times of freedom, when the sun rise and set. -At such times you go by my volition and not by his. And this power to -good of you and others, you have won from your suffering at his hands. -This is now all more precious that he know it not, and to guard -himself have even cut himself off from his knowledge of our where. -We, however, are not selfish, and we believe that God is with us -through all this blackness, and these many dark hours. We shall -follow him, and we shall not flinch, even if we peril ourselves that -we become like him. Friend John, this has been a great hour, and it -have done much to advance us on our way. You must be scribe and write -him all down, so that when the others return from their work you can -give it to them, then they shall know as we do." - -And so I have written it whilst we wait their return, and Mrs. Harker -has written with the typewriter all since she brought the MS to us. - - - - -CHAPTER 26 - - -DR. SEWARD'S DIARY - -29 October.--This is written in the train from Varna to Galatz. Last -night we all assembled a little before the time of sunset. Each of us -had done his work as well as he could, so far as thought, and -endeavour, and opportunity go, we are prepared for the whole of our -journey, and for our work when we get to Galatz. When the usual time -came round Mrs. Harker prepared herself for her hypnotic effort, and -after a longer and more serious effort on the part of Van Helsing than -has been usually necessary, she sank into the trance. Usually she -speaks on a hint, but this time the Professor had to ask her -questions, and to ask them pretty resolutely, before we could learn -anything. At last her answer came. - -"I can see nothing. We are still. There are no waves lapping, but -only a steady swirl of water softly running against the hawser. I can -hear men's voices calling, near and far, and the roll and creak of -oars in the rowlocks. A gun is fired somewhere, the echo of it seems -far away. There is tramping of feet overhead, and ropes and chains -are dragged along. What is this? There is a gleam of light. I can -feel the air blowing upon me." - -Here she stopped. She had risen, as if impulsively, from where she -lay on the sofa, and raised both her hands, palms upwards, as if -lifting a weight. Van Helsing and I looked at each other with -understanding. Quincey raised his eyebrows slightly and looked at her -intently, whilst Harker's hand instinctively closed round the hilt of -his Kukri. There was a long pause. We all knew that the time when -she could speak was passing, but we felt that it was useless to say -anything. - -Suddenly she sat up, and as she opened her eyes said sweetly, "Would -none of you like a cup of tea? You must all be so tired!" - -We could only make her happy, and so acqueisced. She bustled off to -get tea. When she had gone Van Helsing said, "You see, my friends. He -is close to land. He has left his earth chest. But he has yet to get -on shore. In the night he may lie hidden somewhere, but if he be not -carried on shore, or if the ship do not touch it, he cannot achieve -the land. In such case he can, if it be in the night, change his form -and jump or fly on shore, then, unless he be carried he cannot escape. -And if he be carried, then the customs men may discover what the box -contain. Thus, in fine, if he escape not on shore tonight, or before -dawn, there will be the whole day lost to him. We may then arrive in -time. For if he escape not at night we shall come on him in daytime, -boxed up and at our mercy. For he dare not be his true self, awake -and visible, lest he be discovered." - -There was no more to be said, so we waited in patience until the dawn, -at which time we might learn more from Mrs. Harker. - -Early this morning we listened, with breathless anxiety, for her -response in her trance. The hypnotic stage was even longer in coming -than before, and when it came the time remaining until full sunrise -was so short that we began to despair. Van Helsing seemed to throw -his whole soul into the effort. At last, in obedience to his will she -made reply. - -"All is dark. I hear lapping water, level with me, and some creaking -as of wood on wood." She paused, and the red sun shot up. We must -wait till tonight. - -And so it is that we are travelling towards Galatz in an agony of -expectation. We are due to arrive between two and three in the -morning. But already, at Bucharest, we are three hours late, so we -cannot possibly get in till well after sunup. Thus we shall have two -more hypnotic messages from Mrs. Harker! Either or both may possibly -throw more light on what is happening. - - -Later.--Sunset has come and gone. Fortunately it came at a time when -there was no distraction. For had it occurred whilst we were at a -station, we might not have secured the necessary calm and isolation. -Mrs. Harker yielded to the hypnotic influence even less readily than -this morning. I am in fear that her power of reading the Count's -sensations may die away, just when we want it most. It seems to me -that her imagination is beginning to work. Whilst she has been in the -trance hitherto she has confined herself to the simplest of facts. If -this goes on it may ultimately mislead us. If I thought that the -Count's power over her would die away equally with her power of -knowledge it would be a happy thought. But I am afraid that it may -not be so. - -When she did speak, her words were enigmatical, "Something is going -out. I can feel it pass me like a cold wind. I can hear, far off, -confused sounds, as of men talking in strange tongues, fierce falling -water, and the howling of wolves." She stopped and a shudder ran -through her, increasing in intensity for a few seconds, till at the -end, she shook as though in a palsy. She said no more, even in answer -to the Professor's imperative questioning. When she woke from the -trance, she was cold, and exhausted, and languid, but her mind was all -alert. She could not remember anything, but asked what she had said. -When she was told, she pondered over it deeply for a long time and in -silence. - - -30 October, 7 A.M.--We are near Galatz now, and I may not have time to -write later. Sunrise this morning was anxiously looked for by us all. -Knowing of the increasing difficulty of procuring the hypnotic trance, -Van Helsing began his passes earlier than usual. They produced no -effect, however, until the regular time, when she yielded with a still -greater difficulty, only a minute before the sun rose. The Professor -lost no time in his questioning. - -Her answer came with equal quickness, "All is dark. I hear water -swirling by, level with my ears, and the creaking of wood on wood. -Cattle low far off. There is another sound, a queer one like . . ." -She stopped and grew white, and whiter still. - -"Go on, go on! Speak, I command you!" said Van Helsing in an agonized -voice. At the same time there was despair in his eyes, for the risen -sun was reddening even Mrs. Harker's pale face. She opened her eyes, -and we all started as she said, sweetly and seemingly with the utmost -unconcern. - -"Oh, Professor, why ask me to do what you know I can't? I don't -remember anything." Then, seeing the look of amazement on our faces, -she said, turning from one to the other with a troubled look, "What -have I said? What have I done? I know nothing, only that I was lying -here, half asleep, and heard you say 'go on! speak, I command you!' It -seemed so funny to hear you order me about, as if I were a bad child!" - -"Oh, Madam Mina," he said, sadly, "it is proof, if proof be needed, of -how I love and honour you, when a word for your good, spoken more -earnest than ever, can seem so strange because it is to order her whom -I am proud to obey!" - -The whistles are sounding. We are nearing Galatz. We are on fire -with anxiety and eagerness. - - - -MINA HARKER'S JOURNAL - -30 October.--Mr. Morris took me to the hotel where our rooms had been -ordered by telegraph, he being the one who could best be spared, since -he does not speak any foreign language. The forces were distributed -much as they had been at Varna, except that Lord Godalming went to the -Vice Consul, as his rank might serve as an immediate guarantee of some -sort to the official, we being in extreme hurry. Jonathan and the two -doctors went to the shipping agent to learn particulars of the arrival -of the Czarina Catherine. - - -Later.--Lord Godalming has returned. The Consul is away, and the Vice -Consul sick. So the routine work has been attended to by a clerk. He -was very obliging, and offered to do anything in his power. - - - -JONATHAN HARKER'S JOURNAL - -30 October.--At nine o'clock Dr. Van Helsing, Dr. Seward, and I called -on Messrs. Mackenzie & Steinkoff, the agents of the London firm of -Hapgood. They had received a wire from London, in answer to Lord -Godalming's telegraphed request, asking them to show us any civility -in their power. They were more than kind and courteous, and took us -at once on board the Czarina Catherine, which lay at anchor out in the -river harbor. There we saw the Captain, Donelson by name, who told us -of his voyage. He said that in all his life he had never had so -favourable a run. - -"Man!" he said, "but it made us afeard, for we expect it that we -should have to pay for it wi' some rare piece o' ill luck, so as to -keep up the average. It's no canny to run frae London to the Black -Sea wi' a wind ahint ye, as though the Deil himself were blawin' on -yer sail for his ain purpose. An' a' the time we could no speer a -thing. Gin we were nigh a ship, or a port, or a headland, a fog fell -on us and travelled wi' us, till when after it had lifted and we -looked out, the deil a thing could we see. We ran by Gibraltar wi' -oot bein' able to signal. An' til we came to the Dardanelles and had -to wait to get our permit to pass, we never were within hail o' -aught. At first I inclined to slack off sail and beat about till the -fog was lifted. But whiles, I thocht that if the Deil was minded to -get us into the Black Sea quick, he was like to do it whether we would -or no. If we had a quick voyage it would be no to our miscredit -wi' the owners, or no hurt to our traffic, an' the Old Mon who had -served his ain purpose wad be decently grateful to us for no hinderin' -him." - -This mixture of simplicity and cunning, of superstition and commercial -reasoning, aroused Van Helsing, who said, "Mine friend, that Devil is -more clever than he is thought by some, and he know when he meet his -match!" - -The skipper was not displeased with the compliment, and went on, "When -we got past the Bosphorus the men began to grumble. Some o' them, the -Roumanians, came and asked me to heave overboard a big box which had -been put on board by a queer lookin' old man just before we had -started frae London. I had seen them speer at the fellow, and put out -their twa fingers when they saw him, to guard them against the evil -eye. Man! but the supersteetion of foreigners is pairfectly -rideeculous! I sent them aboot their business pretty quick, but as -just after a fog closed in on us I felt a wee bit as they did anent -something, though I wouldn't say it was again the big box. Well, on -we went, and as the fog didn't let up for five days I joost let the -wind carry us, for if the Deil wanted to get somewheres, well, he -would fetch it up a'reet. An' if he didn't, well, we'd keep a sharp -lookout anyhow. Sure eneuch, we had a fair way and deep water all the -time. And two days ago, when the mornin' sun came through the fog, we -found ourselves just in the river opposite Galatz. The Roumanians -were wild, and wanted me right or wrong to take out the box and fling -it in the river. I had to argy wi' them aboot it wi' a handspike. An' -when the last o' them rose off the deck wi' his head in his hand, I -had convinced them that, evil eye or no evil eye, the property and the -trust of my owners were better in my hands than in the river Danube. -They had, mind ye, taken the box on the deck ready to fling in, and as -it was marked Galatz via Varna, I thocht I'd let it lie till we -discharged in the port an' get rid o't althegither. We didn't do much -clearin' that day, an' had to remain the nicht at anchor. But in the -mornin', braw an' airly, an hour before sunup, a man came aboard wi' -an order, written to him from England, to receive a box marked for one -Count Dracula. Sure eneuch the matter was one ready to his hand. He -had his papers a' reet, an' glad I was to be rid o' the dam' thing, -for I was beginnin' masel' to feel uneasy at it. If the Deil did have -any luggage aboord the ship, I'm thinkin' it was nane ither than that -same!" - -"What was the name of the man who took it?" asked Dr. Van Helsing with -restrained eagerness. - -"I'll be tellin' ye quick!" he answered, and stepping down to his -cabin, produced a receipt signed "Immanuel Hildesheim." Burgen-strasse -16 was the address. We found out that this was all the Captain knew, -so with thanks we came away. - -We found Hildesheim in his office, a Hebrew of rather the Adelphi -Theatre type, with a nose like a sheep, and a fez. His arguments were -pointed with specie, we doing the punctuation, and with a little -bargaining he told us what he knew. This turned out to be simple but -important. He had received a letter from Mr. de Ville of London, -telling him to receive, if possible before sunrise so as to avoid -customs, a box which would arrive at Galatz in the Czarina Catherine. -This he was to give in charge to a certain Petrof Skinsky, who dealt -with the Slovaks who traded down the river to the port. He had been -paid for his work by an English bank note, which had been duly cashed -for gold at the Danube International Bank. When Skinsky had come to -him, he had taken him to the ship and handed over the box, so as to -save porterage. That was all he knew. - -We then sought for Skinsky, but were unable to find him. One of his -neighbors, who did not seem to bear him any affection, said that he -had gone away two days before, no one knew whither. This was -corroborated by his landlord, who had received by messenger the key of -the house together with the rent due, in English money. This had been -between ten and eleven o'clock last night. We were at a standstill -again. - -Whilst we were talking one came running and breathlessly gasped out -that the body of Skinsky had been found inside the wall of the -churchyard of St. Peter, and that the throat had been torn open as if -by some wild animal. Those we had been speaking with ran off to see -the horror, the women crying out. "This is the work of a Slovak!" We -hurried away lest we should have been in some way drawn into the -affair, and so detained. - -As we came home we could arrive at no definite conclusion. We were -all convinced that the box was on its way, by water, to somewhere, but -where that might be we would have to discover. With heavy hearts we -came home to the hotel to Mina. - -When we met together, the first thing was to consult as to taking Mina -again into our confidence. Things are getting desperate, and it is at -least a chance, though a hazardous one. As a preliminary step, I was -released from my promise to her. - - - - - -MINA HARKER'S JOURNAL - -30 October, evening.--They were so tired and worn out and dispirited -that there was nothing to be done till they had some rest, so I asked -them all to lie down for half an hour whilst I should enter everything -up to the moment. I feel so grateful to the man who invented the -"Traveller's" typewriter, and to Mr. Morris for getting this one for -me. I should have felt quite astray doing the work if I had to write -with a pen . . . - -It is all done. Poor dear, dear Jonathan, what he must have suffered, -what he must be suffering now. He lies on the sofa hardly seeming to -breathe, and his whole body appears in collapse. His brows are knit. -His face is drawn with pain. Poor fellow, maybe he is thinking, and I -can see his face all wrinkled up with the concentration of his -thoughts. Oh! if I could only help at all. I shall do what I can. - -I have asked Dr. Van Helsing, and he has got me all the papers that I -have not yet seen. Whilst they are resting, I shall go over all -carefully, and perhaps I may arrive at some conclusion. I shall try -to follow the Professor's example, and think without prejudice on the -facts before me . . . - -I do believe that under God's providence I have made a discovery. I -shall get the maps and look over them. - -I am more than ever sure that I am right. My new conclusion is ready, -so I shall get our party together and read it. They can judge it. It -is well to be accurate, and every minute is precious. - - - -MINA HARKER'S MEMORANDUM - -(ENTERED IN HER JOURNAL) - - -Ground of inquiry.--Count Dracula's problem is to get back -to his own place. - -(a) He must be brought back by some one. This is evident; -for had he power to move himself as he wished he could go -either as man, or wolf, or bat, or in some other way. He -evidently fears discovery or interference, in the state of -helplessness in which he must be, confined as he is between -dawn and sunset in his wooden box. - -(b) How is he to be taken?--Here a process of exclusions may -help us. By road, by rail, by water? - -1. By Road.--There are endless difficulties, especially in -leaving the city. - -(x) There are people. And people are curious, and -investigate. A hint, a surmise, a doubt as to what might -be in the box, would destroy him. - -(y) There are, or there may be, customs and octroi officers -to pass. - -(z) His pursuers might follow. This is his highest fear. -And in order to prevent his being betrayed he has repelled, -so far as he can, even his victim, me! - -2. By Rail.--There is no one in charge of the box. It -would have to take its chance of being delayed, and delay -would be fatal, with enemies on the track. True, he might -escape at night. But what would he be, if left in a strange -place with no refuge that he could fly to? This is not what he -intends, and he does not mean to risk it. - -3. By Water.--Here is the safest way, in one respect, but -with most danger in another. On the water he is powerless -except at night. Even then he can only summon fog and storm and -snow and his wolves. But were he wrecked, the living water would -engulf him, helpless, and he would indeed be lost. He could have -the vessel drive to land, but if it were unfriendly land, wherein -he was not free to move, his position would still be desperate. - -We know from the record that he was on the water, so what -we have to do is to ascertain what water. - -The first thing is to realize exactly what he has done as -yet. We may, then, get a light on what his task is to be. - -Firstly.--We must differentiate between what he did in -London as part of his general plan of action, when he was -pressed for moments and had to arrange as best he could. - -Secondly.--We must see, as well as we can surmise it from the -facts we know of, what he has done here. - -As to the first, he evidently intended to arrive at Galatz, -and sent invoice to Varna to deceive us lest we should ascertain -his means of exit from England. His immediate and sole purpose -then was to escape. The proof of this, is the letter of -instructions sent to Immanuel Hildesheim to clear and take away -the box before sunrise. There is also the instruction to Petrof -Skinsky. These we must only guess at, but there must have been -some letter or message, since Skinsky came to Hildesheim. - -That, so far, his plans were successful we know. The Czarina -Catherine made a phenomenally quick journey. So much so that -Captain Donelson's suspicions were aroused. But his superstition -united with his canniness played the Count's game for him, and he -ran with his favouring wind through fogs and all till he brought -up blindfold at Galatz. That the Count's arrangements were well -made, has been proved. Hildesheim cleared the box, took it off, -and gave it to Skinsky. Skinsky took it, and here we lose the -trail. We only know that the box is somewhere on the water, -moving along. The customs and the octroi, if there be any, have -been avoided. - -Now we come to what the Count must have done after his -arrival, on land, at Galatz. - -The box was given to Skinsky before sunrise. At sunrise -the Count could appear in his own form. Here, we ask why -Skinsky was chosen at all to aid in the work? In my husband's -diary, Skinsky is mentioned as dealing with the Slovaks who trade -down the river to the port. And the man's remark, that the -murder was the work of a Slovak, showed the general feeling -against his class. The Count wanted isolation. - -My surmise is this, that in London the Count decided to get -back to his castle by water, as the most safe and secret -way. He was brought from the castle by Szgany, and probably they -delivered their cargo to Slovaks who took the boxes to Varna, for -there they were shipped to London. Thus the Count had knowledge -of the persons who could arrange this service. When the box was -on land, before sunrise or after sunset, he came out from his -box, met Skinsky and instructed him what to do as to arranging -the carriage of the box up some river. When this was done, and -he knew that all was in train, he blotted out his traces, as he -thought, by murdering his agent. - -I have examined the map and find that the river most -suitable for the Slovaks to have ascended is either the -Pruth or the Sereth. I read in the typescript that in my -trance I heard cows low and water swirling level with my -ears and the creaking of wood. The Count in his box, then, -was on a river in an open boat, propelled probably either -by oars or poles, for the banks are near and it is working -against stream. There would be no such if floating down -stream. - -Of course it may not be either the Sereth or the Pruth, but -we may possibly investigate further. Now of these two, the -Pruth is the more easily navigated, but the Sereth is, at -Fundu, joined by the Bistritza which runs up round the Borgo -Pass. The loop it makes is manifestly as close to Dracula's -castle as can be got by water. - - - -MINA HARKER'S JOURNAL--CONTINUED - -When I had done reading, Jonathan took me in his arms and kissed me. -The others kept shaking me by both hands, and Dr. Van Helsing said, -"Our dear Madam Mina is once more our teacher. Her eyes have been -where we were blinded. Now we are on the track once again, and this -time we may succeed. Our enemy is at his most helpless. And if we -can come on him by day, on the water, our task will be over. He has a -start, but he is powerless to hasten, as he may not leave this box -lest those who carry him may suspect. For them to suspect would be to -prompt them to throw him in the stream where he perish. This he -knows, and will not. Now men, to our Council of War, for here and -now, we must plan what each and all shall do." - -"I shall get a steam launch and follow him," said Lord Godalming. - -"And I, horses to follow on the bank lest by chance he land," said Mr. -Morris. - -"Good!" said the Professor, "both good. But neither must go alone. -There must be force to overcome force if need be. The Slovak is -strong and rough, and he carries rude arms." All the men smiled, for -amongst them they carried a small arsenal. - -Said Mr. Morris, "I have brought some Winchesters. They are pretty -handy in a crowd, and there may be wolves. The Count, if you -remember, took some other precautions. He made some requisitions on -others that Mrs. Harker could not quite hear or understand. We must -be ready at all points." - -Dr. Seward said, "I think I had better go with Quincey. We have been -accustomed to hunt together, and we two, well armed, will be a match -for whatever may come along. You must not be alone, Art. It may be -necessary to fight the Slovaks, and a chance thrust, for I don't -suppose these fellows carry guns, would undo all our plans. There -must be no chances, this time. We shall not rest until the Count's -head and body have been separated, and we are sure that he cannot -reincarnate." - -He looked at Jonathan as he spoke, and Jonathan looked at me. I could -see that the poor dear was torn about in his mind. Of course he -wanted to be with me. But then the boat service would, most likely, -be the one which would destroy the . . . the . . . Vampire. (Why did -I hesitate to write the word?) - -He was silent awhile, and during his silence Dr. Van Helsing spoke, -"Friend Jonathan, this is to you for twice reasons. First, because -you are young and brave and can fight, and all energies may be needed -at the last. And again that it is your right to destroy him. That, -which has wrought such woe to you and yours. Be not afraid for Madam -Mina. She will be my care, if I may. I am old. My legs are not so -quick to run as once. And I am not used to ride so long or to pursue -as need be, or to fight with lethal weapons. But I can be of other -service. I can fight in other way. And I can die, if need be, as -well as younger men. Now let me say that what I would is this. While -you, my Lord Godalming and friend Jonathan go in your so swift little -steamboat up the river, and whilst John and Quincey guard the bank -where perchance he might be landed, I will take Madam Mina right into -the heart of the enemy's country. Whilst the old fox is tied in his -box, floating on the running stream whence he cannot escape to land, -where he dares not raise the lid of his coffin box lest his Slovak -carriers should in fear leave him to perish, we shall go in the track -where Jonathan went, from Bistritz over the Borgo, and find our way to -the Castle of Dracula. Here, Madam Mina's hypnotic power will surely -help, and we shall find our way, all dark and unknown otherwise, after -the first sunrise when we are near that fateful place. There is much -to be done, and other places to be made sanctify, so that that nest of -vipers be obliterated." - -Here Jonathan interrupted him hotly, "Do you mean to say, Professor -Van Helsing, that you would bring Mina, in her sad case and tainted as -she is with that devil's illness, right into the jaws of his -deathtrap? Not for the world! Not for Heaven or Hell!" - -He became almost speechless for a minute, and then went on, "Do you -know what the place is? Have you seen that awful den of hellish -infamy, with the very moonlight alive with grisly shapes, and every -speck of dust that whirls in the wind a devouring monster in embryo? -Have you felt the Vampire's lips upon your throat?" - -Here he turned to me, and as his eyes lit on my forehead he threw up -his arms with a cry, "Oh, my God, what have we done to have this -terror upon us?" and he sank down on the sofa in a collapse of misery. - -The Professor's voice, as he spoke in clear, sweet tones, which seemed -to vibrate in the air, calmed us all. - -"Oh, my friend, it is because I would save Madam Mina from that awful -place that I would go. God forbid that I should take her into that -place. There is work, wild work, to be done before that place can be -purify. Remember that we are in terrible straits. If the Count -escape us this time, and he is strong and subtle and cunning, he may -choose to sleep him for a century, and then in time our dear one," he -took my hand, "would come to him to keep him company, and would be as -those others that you, Jonathan, saw. You have told us of their -gloating lips. You heard their ribald laugh as they clutched the -moving bag that the Count threw to them. You shudder, and well may it -be. Forgive me that I make you so much pain, but it is necessary. My -friend, is it not a dire need for that which I am giving, possibly my -life? If it were that any one went into that place to stay, it is I -who would have to go to keep them company." - -"Do as you will," said Jonathan, with a sob that shook him all over, -"we are in the hands of God!" - - -Later.--Oh, it did me good to see the way that these brave men worked. -How can women help loving men when they are so earnest, and so true, -and so brave! And, too, it made me think of the wonderful power of -money! What can it not do when basely used. I felt so thankful that -Lord Godalming is rich, and both he and Mr. Morris, who also has -plenty of money, are willing to spend it so freely. For if they did -not, our little expedition could not start, either so promptly or so -well equipped, as it will within another hour. It is not three hours -since it was arranged what part each of us was to do. And now Lord -Godalming and Jonathan have a lovely steam launch, with steam up ready -to start at a moment's notice. Dr. Seward and Mr. Morris have half a -dozen good horses, well appointed. We have all the maps and -appliances of various kinds that can be had. Professor Van Helsing -and I are to leave by the 11:40 train tonight for Veresti, where we -are to get a carriage to drive to the Borgo Pass. We are bringing a -good deal of ready money, as we are to buy a carriage and horses. We -shall drive ourselves, for we have no one whom we can trust in the -matter. The Professor knows something of a great many languages, so -we shall get on all right. We have all got arms, even for me a large -bore revolver. Jonathan would not be happy unless I was armed like -the rest. Alas! I cannot carry one arm that the rest do, the scar on -my forehead forbids that. Dear Dr. Van Helsing comforts me by telling -me that I am fully armed as there may be wolves. The weather is -getting colder every hour, and there are snow flurries which come and -go as warnings. - - -Later.--It took all my courage to say goodbye to my darling. We may -never meet again. Courage, Mina! The Professor is looking at you -keenly. His look is a warning. There must be no tears now, unless it -may be that God will let them fall in gladness. - - - -JONATHAN HARKER'S JOURNAL - -30 October, night.--I am writing this in the light from the furnace -door of the steam launch. Lord Godalming is firing up. He is an -experienced hand at the work, as he has had for years a launch of his -own on the Thames, and another on the Norfolk Broads. Regarding our -plans, we finally decided that Mina's guess was correct, and that if -any waterway was chosen for the Count's escape back to his Castle, the -Sereth and then the Bistritza at its junction, would be the one. We -took it, that somewhere about the 47th degree, north latitude, would -be the place chosen for crossing the country between the river and the -Carpathians. We have no fear in running at good speed up the river at -night. There is plenty of water, and the banks are wide enough apart -to make steaming, even in the dark, easy enough. Lord Godalming tells -me to sleep for a while, as it is enough for the present for one to be -on watch. But I cannot sleep, how can I with the terrible danger -hanging over my darling, and her going out into that awful place . . . - -My only comfort is that we are in the hands of God. Only for that -faith it would be easier to die than to live, and so be quit of all -the trouble. Mr. Morris and Dr. Seward were off on their long ride -before we started. They are to keep up the right bank, far enough off -to get on higher lands where they can see a good stretch of river and -avoid the following of its curves. They have, for the first stages, -two men to ride and lead their spare horses, four in all, so as not to -excite curiosity. When they dismiss the men, which shall be shortly, -they shall themselves look after the horses. It may be necessary for -us to join forces. If so they can mount our whole party. One of the -saddles has a moveable horn, and can be easily adapted for Mina, if -required. - -It is a wild adventure we are on. Here, as we are rushing along -through the darkness, with the cold from the river seeming to rise up -and strike us, with all the mysterious voices of the night around us, -it all comes home. We seem to be drifting into unknown places and -unknown ways. Into a whole world of dark and dreadful things. -Godalming is shutting the furnace door . . . - - -31 October.--Still hurrying along. The day has come, and Godalming is -sleeping. I am on watch. The morning is bitterly cold, the furnace -heat is grateful, though we have heavy fur coats. As yet we have -passed only a few open boats, but none of them had on board any box or -package of anything like the size of the one we seek. The men were -scared every time we turned our electric lamp on them, and fell on -their knees and prayed. - - -1 November, evening.--No news all day. We have found nothing of the -kind we seek. We have now passed into the Bistritza, and if we are -wrong in our surmise our chance is gone. We have overhauled every -boat, big and little. Early this morning, one crew took us for a -Government boat, and treated us accordingly. We saw in this a way of -smoothing matters, so at Fundu, where the Bistritza runs into the -Sereth, we got a Roumanian flag which we now fly conspicuously. With -every boat which we have overhauled since then this trick has -succeeded. We have had every deference shown to us, and not once any -objection to whatever we chose to ask or do. Some of the Slovaks tell -us that a big boat passed them, going at more than usual speed as she -had a double crew on board. This was before they came to Fundu, so -they could not tell us whether the boat turned into the Bistritza or -continued on up the Sereth. At Fundu we could not hear of any such -boat, so she must have passed there in the night. I am feeling very -sleepy. The cold is perhaps beginning to tell upon me, and nature -must have rest some time. Godalming insists that he shall keep the -first watch. God bless him for all his goodness to poor dear Mina and -me. - - -2 November, morning.--It is broad daylight. That good fellow would -not wake me. He says it would have been a sin to, for I slept -peacefully and was forgetting my trouble. It seems brutally selfish -to me to have slept so long, and let him watch all night, but he was -quite right. I am a new man this morning. And, as I sit here and -watch him sleeping, I can do all that is necessary both as to minding -the engine, steering, and keeping watch. I can feel that my strength -and energy are coming back to me. I wonder where Mina is now, and Van -Helsing. They should have got to Veresti about noon on Wednesday. It -would take them some time to get the carriage and horses. So if they -had started and travelled hard, they would be about now at the Borgo -Pass. God guide and help them! I am afraid to think what may -happen. If we could only go faster. But we cannot. The engines are -throbbing and doing their utmost. I wonder how Dr. Seward and Mr. -Morris are getting on. There seem to be endless streams running down -the mountains into this river, but as none of them are very large, at -present, at all events, though they are doubtless terrible in winter -and when the snow melts, the horsemen may not have met much -obstruction. I hope that before we get to Strasba we may see them. -For if by that time we have not overtaken the Count, it may be -necessary to take counsel together what to do next. - - - - - -DR. SEWARD'S DIARY - -2 November.--Three days on the road. No news, and no time to write it -if there had been, for every moment is precious. We have had only the -rest needful for the horses. But we are both bearing it wonderfully. -Those adventurous days of ours are turning up useful. We must push -on. We shall never feel happy till we get the launch in sight again. - - -3 November.--We heard at Fundu that the launch had gone up the -Bistritza. I wish it wasn't so cold. There are signs of snow coming. -And if it falls heavy it will stop us. In such case we must get a -sledge and go on, Russian fashion. - -4 November.--Today we heard of the launch having been detained by an -accident when trying to force a way up the rapids. The Slovak boats -get up all right, by aid of a rope and steering with knowledge. Some -went up only a few hours before. Godalming is an amateur fitter -himself, and evidently it was he who put the launch in trim again. - -Finally, they got up the rapids all right, with local help, and are off -on the chase afresh. I fear that the boat is not any better for the -accident, the peasantry tell us that after she got upon smooth water -again, she kept stopping every now and again so long as she was in -sight. We must push on harder than ever. Our help may be wanted -soon. - - - - - -MINA HARKER'S JOURNAL - -31 October.--Arrived at Veresti at noon. The Professor tells me that -this morning at dawn he could hardly hypnotize me at all, and that all -I could say was, "dark and quiet." He is off now buying a carriage -and horses. He says that he will later on try to buy additional -horses, so that we may be able to change them on the way. We have -something more than 70 miles before us. The country is lovely, and -most interesting. If only we were under different conditions, how -delightful it would be to see it all. If Jonathan and I were driving -through it alone what a pleasure it would be. To stop and see people, -and learn something of their life, and to fill our minds and memories -with all the colour and picturesqueness of the whole wild, beautiful -country and the quaint people! But, alas! - - -Later.--Dr. Van Helsing has returned. He has got the carriage and -horses. We are to have some dinner, and to start in an hour. The -landlady is putting us up a huge basket of provisions. It seems -enough for a company of soldiers. The Professor encourages her, and -whispers to me that it may be a week before we can get any food again. -He has been shopping too, and has sent home such a wonderful lot of -fur coats and wraps, and all sorts of warm things. There will not be -any chance of our being cold. - -We shall soon be off. I am afraid to think what may happen to us. We -are truly in the hands of God. He alone knows what may be, and I pray -Him, with all the strength of my sad and humble soul, that He will -watch over my beloved husband. That whatever may happen, Jonathan may -know that I loved him and honoured him more than I can say, and that my -latest and truest thought will be always for him. - - - - -CHAPTER 27 - - -MINA HARKER'S JOURNAL - -1 November.--All day long we have travelled, and at a good speed. The -horses seem to know that they are being kindly treated, for they go -willingly their full stage at best speed. We have now had so many -changes and find the same thing so constantly that we are encouraged -to think that the journey will be an easy one. Dr. Van Helsing is -laconic, he tells the farmers that he is hurrying to Bistritz, and -pays them well to make the exchange of horses. We get hot soup, or -coffee, or tea, and off we go. It is a lovely country. Full of -beauties of all imaginable kinds, and the people are brave, and -strong, and simple, and seem full of nice qualities. They are very, -very superstitious. In the first house where we stopped, when the -woman who served us saw the scar on my forehead, she crossed herself -and put out two fingers towards me, to keep off the evil eye. I -believe they went to the trouble of putting an extra amount of garlic -into our food, and I can't abide garlic. Ever since then I have taken -care not to take off my hat or veil, and so have escaped their -suspicions. We are travelling fast, and as we have no driver with us -to carry tales, we go ahead of scandal. But I daresay that fear of -the evil eye will follow hard behind us all the way. The Professor -seems tireless. All day he would not take any rest, though he made me -sleep for a long spell. At sunset time he hypnotized me, and he says -I answered as usual, "darkness, lapping water and creaking wood." So -our enemy is still on the river. I am afraid to think of Jonathan, -but somehow I have now no fear for him, or for myself. I write this -whilst we wait in a farmhouse for the horses to be ready. Dr. Van -Helsing is sleeping. Poor dear, he looks very tired and old and grey, -but his mouth is set as firmly as a conqueror's. Even in his sleep he -is intense with resolution. When we have well started I must make him -rest whilst I drive. I shall tell him that we have days before us, -and he must not break down when most of all his strength will be -needed . . . All is ready. We are off shortly. - - -2 November, morning.--I was successful, and we took turns driving all -night. Now the day is on us, bright though cold. There is a strange -heaviness in the air. I say heaviness for want of a better word. I -mean that it oppresses us both. It is very cold, and only our warm -furs keep us comfortable. At dawn Van Helsing hypnotized me. He says -I answered "darkness, creaking wood and roaring water," so the river -is changing as they ascend. I do hope that my darling will not run -any chance of danger, more than need be, but we are in God's hands. - - -2 November, night.--All day long driving. The country gets wilder as -we go, and the great spurs of the Carpathians, which at Veresti seemed -so far from us and so low on the horizon, now seem to gather round us -and tower in front. We both seem in good spirits. I think we make an -effort each to cheer the other, in the doing so we cheer ourselves. -Dr. Van Helsing says that by morning we shall reach the Borgo Pass. -The houses are very few here now, and the Professor says that the last -horse we got will have to go on with us, as we may not be able to -change. He got two in addition to the two we changed, so that now we -have a rude four-in-hand. The dear horses are patient and good, and -they give us no trouble. We are not worried with other travellers, -and so even I can drive. We shall get to the Pass in daylight. We do -not want to arrive before. So we take it easy, and have each a long -rest in turn. Oh, what will tomorrow bring to us? We go to seek the -place where my poor darling suffered so much. God grant that we may -be guided aright, and that He will deign to watch over my husband and -those dear to us both, and who are in such deadly peril. As for me, I -am not worthy in His sight. Alas! I am unclean to His eyes, and -shall be until He may deign to let me stand forth in His sight as one -of those who have not incurred His wrath. - - - - - -MEMORANDUM BY ABRAHAM VAN HELSING - -4 November.--This to my old and true friend John Seward, M.D., -of Purfleet, London, in case I may not see him. It may -explain. It is morning, and I write by a fire which all -the night I have kept alive, Madam Mina aiding me. It is -cold, cold. So cold that the grey heavy sky is full of -snow, which when it falls will settle for all winter as the -ground is hardening to receive it. It seems to have affected -Madam Mina. She has been so heavy of head all day that she was -not like herself. She sleeps, and sleeps, and sleeps! She who -is usual so alert, have done literally nothing all the day. She -even have lost her appetite. She make no entry into her little -diary, she who write so faithful at every pause. Something -whisper to me that all is not well. However, tonight she is more -_vif_. Her long sleep all day have refresh and restore her, for -now she is all sweet and bright as ever. At sunset I try to -hypnotize her, but alas! with no effect. The power has grown -less and less with each day, and tonight it fail me altogether. -Well, God's will be done, whatever it may be, and whithersoever -it may lead! - -Now to the historical, for as Madam Mina write not in her -stenography, I must, in my cumbrous old fashion, that so -each day of us may not go unrecorded. - -We got to the Borgo Pass just after sunrise yesterday -morning. When I saw the signs of the dawn I got ready for -the hypnotism. We stopped our carriage, and got down so -that there might be no disturbance. I made a couch with -furs, and Madam Mina, lying down, yield herself as usual, -but more slow and more short time than ever, to the hypnotic -sleep. As before, came the answer, "darkness and the swirling of -water." Then she woke, bright and radiant and we go on our way -and soon reach the Pass. At this time and place, she become all -on fire with zeal. Some new guiding power be in her manifested, -for she point to a road and say, "This is the way." - -"How know you it?" I ask. - -"Of course I know it," she answer, and with a pause, add, -"Have not my Jonathan travelled it and wrote of his travel?" - -At first I think somewhat strange, but soon I see that there be -only one such byroad. It is used but little, and very different -from the coach road from the Bukovina to Bistritz, which is more -wide and hard, and more of use. - -So we came down this road. When we meet other ways, not -always were we sure that they were roads at all, for they -be neglect and light snow have fallen, the horses know and -they only. I give rein to them, and they go on so patient. By -and by we find all the things which Jonathan have note in that -wonderful diary of him. Then we go on for long, long hours and -hours. At the first, I tell Madam Mina to sleep. She try, and -she succeed. She sleep all the time, till at the last, I feel -myself to suspicious grow, and attempt to wake her. But she -sleep on, and I may not wake her though I try. I do not wish to -try too hard lest I harm her. For I know that she have suffer -much, and sleep at times be all-in-all to her. I think I drowse -myself, for all of sudden I feel guilt, as though I have done -something. I find myself bolt up, with the reins in my hand, and -the good horses go along jog, jog, just as ever. I look down and -find Madam Mina still asleep. It is now not far off sunset time, -and over the snow the light of the sun flow in big yellow flood, -so that we throw great long shadow on where the mountain rise so -steep. For we are going up, and up, and all is oh so wild and -rocky, as though it were the end of the world. - -Then I arouse Madam Mina. This time she wake with not much -trouble, and then I try to put her to hypnotic sleep. But -she sleep not, being as though I were not. Still I try and -try, till all at once I find her and myself in dark, so I -look round, and find that the sun have gone down. Madam -Mina laugh, and I turn and look at her. She is now quite -awake, and look so well as I never saw her since that night -at Carfax when we first enter the Count's house. I am amaze, and -not at ease then. But she is so bright and tender and thoughtful -for me that I forget all fear. I light a fire, for we have -brought supply of wood with us, and she prepare food while I undo -the horses and set them, tethered in shelter, to feed. Then when -I return to the fire she have my supper ready. I go to help her, -but she smile, and tell me that she have eat already. That she -was so hungry that she would not wait. I like it not, and I have -grave doubts. But I fear to affright her, and so I am silent of -it. She help me and I eat alone, and then we wrap in fur and lie -beside the fire, and I tell her to sleep while I watch. But -presently I forget all of watching. And when I sudden remember -that I watch, I find her lying quiet, but awake, and looking at -me with so bright eyes. Once, twice more the same occur, and I -get much sleep till before morning. When I wake I try to -hypnotize her, but alas! though she shut her eyes obedient, she -may not sleep. The sun rise up, and up, and up, and then sleep -come to her too late, but so heavy that she will not wake. I -have to lift her up, and place her sleeping in the carriage when -I have harnessed the horses and made all ready. Madam still -sleep, and she look in her sleep more healthy and more redder -than before. And I like it not. And I am afraid, afraid, -afraid! I am afraid of all things, even to think but I must go -on my way. The stake we play for is life and death, or more than -these, and we must not flinch. - - -5 November, morning.--Let me be accurate in everything, for -though you and I have seen some strange things together, -you may at the first think that I, Van Helsing, am mad. -That the many horrors and the so long strain on nerves has -at the last turn my brain. - -All yesterday we travel, always getting closer to the -mountains, and moving into a more and more wild and desert -land. There are great, frowning precipices and much falling -water, and Nature seem to have held sometime her carnival. Madam -Mina still sleep and sleep. And though I did have hunger and -appeased it, I could not waken her, even for food. I began to -fear that the fatal spell of the place was upon her, tainted as -she is with that Vampire baptism. "Well," said I to myself, "if -it be that she sleep all the day, it shall also be that I do not -sleep at night." As we travel on the rough road, for a road of -an ancient and imperfect kind there was, I held down my head and -slept. - -Again I waked with a sense of guilt and of time passed, and -found Madam Mina still sleeping, and the sun low down. But -all was indeed changed. The frowning mountains seemed further -away, and we were near the top of a steep rising hill, on summit -of which was such a castle as Jonathan tell of in his diary. At -once I exulted and feared. For now, for good or ill, the end was -near. - -I woke Madam Mina, and again tried to hypnotize her, but -alas! unavailing till too late. Then, ere the great dark -came upon us, for even after down sun the heavens reflected -the gone sun on the snow, and all was for a time in a great -twilight. I took out the horses and fed them in what shelter I -could. Then I make a fire, and near it I make Madam Mina, now -awake and more charming than ever, sit comfortable amid her rugs. -I got ready food, but she would not eat, simply saying that she -had not hunger. I did not press her, knowing her unavailingness. -But I myself eat, for I must needs now be strong for all. Then, -with the fear on me of what might be, I drew a ring so big for -her comfort, round where Madam Mina sat. And over the ring I -passed some of the wafer, and I broke it fine so that all was -well guarded. She sat still all the time, so still as one dead. -And she grew whiter and even whiter till the snow was not more -pale, and no word she said. But when I drew near, she clung to -me, and I could know that the poor soul shook her from head to -feet with a tremor that was pain to feel. - -I said to her presently, when she had grown more quiet, -"Will you not come over to the fire?" for I wished to make -a test of what she could. She rose obedient, but when she -have made a step she stopped, and stood as one stricken. - -"Why not go on?" I asked. She shook her head, and coming -back, sat down in her place. Then, looking at me with open -eyes, as of one waked from sleep, she said simply, "I cannot!" -and remained silent. I rejoiced, for I knew that what she could -not, none of those that we dreaded could. Though there might be -danger to her body, yet her soul was safe! - -Presently the horses began to scream, and tore at their -tethers till I came to them and quieted them. When they -did feel my hands on them, they whinnied low as in joy, and -licked at my hands and were quiet for a time. Many times -through the night did I come to them, till it arrive to the -cold hour when all nature is at lowest, and every time my -coming was with quiet of them. In the cold hour the fire -began to die, and I was about stepping forth to replenish -it, for now the snow came in flying sweeps and with it a -chill mist. Even in the dark there was a light of some -kind, as there ever is over snow, and it seemed as though -the snow flurries and the wreaths of mist took shape as of -women with trailing garments. All was in dead, grim silence only -that the horses whinnied and cowered, as if in terror of the -worst. I began to fear, horrible fears. But then came to me the -sense of safety in that ring wherein I stood. I began too, to -think that my imaginings were of the night, and the gloom, and -the unrest that I have gone through, and all the terrible -anxiety. It was as though my memories of all Jonathan's horrid -experience were befooling me. For the snow flakes and the mist -began to wheel and circle round, till I could get as though a -shadowy glimpse of those women that would have kissed him. And -then the horses cowered lower and lower, and moaned in terror as -men do in pain. Even the madness of fright was not to them, so -that they could break away. I feared for my dear Madam Mina when -these weird figures drew near and circled round. I looked at her, -but she sat calm, and smiled at me. When I would have stepped to -the fire to replenish it, she caught me and held me back, and -whispered, like a voice that one hears in a dream, so low it was. - -"No! No! Do not go without. Here you are safe!" - -I turned to her, and looking in her eyes said, "But you? -It is for you that I fear!" - -Whereat she laughed, a laugh low and unreal, and said, "Fear -for me! Why fear for me? None safer in all the world from -them than I am," and as I wondered at the meaning of her -words, a puff of wind made the flame leap up, and I see the -red scar on her forehead. Then, alas! I knew. Did I not, -I would soon have learned, for the wheeling figures of mist -and snow came closer, but keeping ever without the Holy -circle. Then they began to materialize till, if God have -not taken away my reason, for I saw it through my eyes. -There were before me in actual flesh the same three women -that Jonathan saw in the room, when they would have kissed -his throat. I knew the swaying round forms, the bright -hard eyes, the white teeth, the ruddy colour, the voluptuous -lips. They smiled ever at poor dear Madam Mina. And as -their laugh came through the silence of the night, they -twined their arms and pointed to her, and said in those so -sweet tingling tones that Jonathan said were of the intolerable -sweetness of the water glasses, "Come, sister. Come to us. -Come!" - -In fear I turned to my poor Madam Mina, and my heart with -gladness leapt like flame. For oh! the terror in her sweet -eyes, the repulsion, the horror, told a story to my heart -that was all of hope. God be thanked she was not, yet, of -them. I seized some of the firewood which was by me, and -holding out some of the Wafer, advanced on them towards the -fire. They drew back before me, and laughed their low horrid -laugh. I fed the fire, and feared them not. For I knew that we -were safe within the ring, which she could not leave no more than -they could enter. The horses had ceased to moan, and lay still -on the ground. The snow fell on them softly, and they grew -whiter. I knew that there was for the poor beasts no more of -terror. - -And so we remained till the red of the dawn began to fall -through the snow gloom. I was desolate and afraid, and -full of woe and terror. But when that beautiful sun began -to climb the horizon life was to me again. At the first -coming of the dawn the horrid figures melted in the whirling -mist and snow. The wreaths of transparent gloom moved away -towards the castle, and were lost. - -Instinctively, with the dawn coming, I turned to Madam Mina, -intending to hypnotize her. But she lay in a deep and sudden -sleep, from which I could not wake her. I tried to hypnotize -through her sleep, but she made no response, none at all, and the -day broke. I fear yet to stir. I have made my fire and have -seen the horses, they are all dead. Today I have much to do here, -and I keep waiting till the sun is up high. For there may be -places where I must go, where that sunlight, though snow and mist -obscure it, will be to me a safety. - -I will strengthen me with breakfast, and then I will do my -terrible work. Madam Mina still sleeps, and God be thanked! She -is calm in her sleep . . . - - - -JONATHAN HARKER'S JOURNAL - -4 November, evening.--The accident to the launch has been a terrible -thing for us. Only for it we should have overtaken the boat long ago, -and by now my dear Mina would have been free. I fear to think of her, -off on the wolds near that horrid place. We have got horses, and we -follow on the track. I note this whilst Godalming is getting ready. -We have our arms. The Szgany must look out if they mean to fight. Oh, -if only Morris and Seward were with us. We must only hope! If I -write no more Goodby Mina! God bless and keep you. - - - -DR. SEWARD'S DIARY - -5 November.--With the dawn we saw the body of Szgany before us dashing -away from the river with their leiter wagon. They surrounded it in a -cluster, and hurried along as though beset. The snow is falling -lightly and there is a strange excitement in the air. It may be our -own feelings, but the depression is strange. Far off I hear the -howling of wolves. The snow brings them down from the mountains, and -there are dangers to all of us, and from all sides. The horses are -nearly ready, and we are soon off. We ride to death of some one. God -alone knows who, or where, or what, or when, or how it may be . . . - - - - - -DR. VAN HELSING'S MEMORANDUM - -5 November, afternoon.--I am at least sane. Thank God for -that mercy at all events, though the proving it has been -dreadful. When I left Madam Mina sleeping within the Holy -circle, I took my way to the castle. The blacksmith hammer -which I took in the carriage from Veresti was useful, though the -doors were all open I broke them off the rusty hinges, lest some -ill intent or ill chance should close them, so that being entered -I might not get out. Jonathan's bitter experience served me -here. By memory of his diary I found my way to the old chapel, -for I knew that here my work lay. The air was oppressive. It -seemed as if there was some sulphurous fume, which at times made -me dizzy. Either there was a roaring in my ears or I heard afar -off the howl of wolves. Then I bethought me of my dear Madam -Mina, and I was in terrible plight. The dilemma had me between -his horns. - -Her, I had not dare to take into this place, but left safe -from the Vampire in that Holy circle. And yet even there -would be the wolf! I resolve me that my work lay here, and -that as to the wolves we must submit, if it were God's will. At -any rate it was only death and freedom beyond. So did I choose -for her. Had it but been for myself the choice had been easy, -the maw of the wolf were better to rest in than the grave of the -Vampire! So I make my choice to go on with my work. - -I knew that there were at least three graves to find, graves -that are inhabit. So I search, and search, and I find one -of them. She lay in her Vampire sleep, so full of life and -voluptuous beauty that I shudder as though I have come to -do murder. Ah, I doubt not that in the old time, when such -things were, many a man who set forth to do such a task as -mine, found at the last his heart fail him, and then his -nerve. So he delay, and delay, and delay, till the mere -beauty and the fascination of the wanton Undead have hypnotize -him. And he remain on and on, till sunset come, and the Vampire -sleep be over. Then the beautiful eyes of the fair woman open -and look love, and the voluptuous mouth present to a kiss, and -the man is weak. And there remain one more victim in the -Vampire fold. One more to swell the grim and grisly ranks -of the Undead! . . . - -There is some fascination, surely, when I am moved by the -mere presence of such an one, even lying as she lay in a -tomb fretted with age and heavy with the dust of centuries, -though there be that horrid odour such as the lairs of the -Count have had. Yes, I was moved. I, Van Helsing, with -all my purpose and with my motive for hate. I was moved to -a yearning for delay which seemed to paralyze my faculties -and to clog my very soul. It may have been that the need -of natural sleep, and the strange oppression of the air -were beginning to overcome me. Certain it was that I was -lapsing into sleep, the open eyed sleep of one who yields -to a sweet fascination, when there came through the snow-stilled -air a long, low wail, so full of woe and pity that it woke me -like the sound of a clarion. For it was the voice of my dear -Madam Mina that I heard. - -Then I braced myself again to my horrid task, and found by -wrenching away tomb tops one other of the sisters, the other dark -one. I dared not pause to look on her as I had on her sister, -lest once more I should begin to be enthrall. But I go on -searching until, presently, I find in a high great tomb as if -made to one much beloved that other fair sister which, like -Jonathan I had seen to gather herself out of the atoms of the -mist. She was so fair to look on, so radiantly beautiful, so -exquisitely voluptuous, that the very instinct of man in me, -which calls some of my sex to love and to protect one of hers, -made my head whirl with new emotion. But God be thanked, that -soul wail of my dear Madam Mina had not died out of my ears. -And, before the spell could be wrought further upon me, I had -nerved myself to my wild work. By this time I had searched all -the tombs in the chapel, so far as I could tell. And as there -had been only three of these Undead phantoms around us in the -night, I took it that there were no more of active Undead -existent. There was one great tomb more lordly than all the -rest. Huge it was, and nobly proportioned. On it was but one -word. - - - DRACULA - - -This then was the Undead home of the King Vampire, to whom -so many more were due. Its emptiness spoke eloquent to -make certain what I knew. Before I began to restore these -women to their dead selves through my awful work, I laid in -Dracula's tomb some of the Wafer, and so banished him from -it, Undead, for ever. - -Then began my terrible task, and I dreaded it. Had it been -but one, it had been easy, comparative. But three! To -begin twice more after I had been through a deed of horror. -For it was terrible with the sweet Miss Lucy, what would it -not be with these strange ones who had survived through -centuries, and who had been strengthened by the passing of -the years. Who would, if they could, have fought for their -foul lives . . . - -Oh, my friend John, but it was butcher work. Had I not -been nerved by thoughts of other dead, and of the living -over whom hung such a pall of fear, I could not have gone -on. I tremble and tremble even yet, though till all was -over, God be thanked, my nerve did stand. Had I not seen -the repose in the first place, and the gladness that stole -over it just ere the final dissolution came, as realization -that the soul had been won, I could not have gone further -with my butchery. I could not have endured the horrid screeching -as the stake drove home, the plunging of writhing form, and lips -of bloody foam. I should have fled in terror and left my work -undone. But it is over! And the poor souls, I can pity them now -and weep, as I think of them placid each in her full sleep of -death for a short moment ere fading. For, friend John, hardly -had my knife severed the head of each, before the whole body -began to melt away and crumble into its native dust, as though -the death that should have come centuries ago had at last assert -himself and say at once and loud, "I am here!" - -Before I left the castle I so fixed its entrances that never -more can the Count enter there Undead. - -When I stepped into the circle where Madam Mina slept, she -woke from her sleep and, seeing me, cried out in pain that -I had endured too much. - -"Come!" she said, "come away from this awful place! Let us -go to meet my husband who is, I know, coming towards us." -She was looking thin and pale and weak. But her eyes were -pure and glowed with fervour. I was glad to see her paleness and -her illness, for my mind was full of the fresh horror of that -ruddy vampire sleep. - -And so with trust and hope, and yet full of fear, we go -eastward to meet our friends, and him, whom Madam Mina tell -me that she know are coming to meet us. - - - - - -MINA HARKER'S JOURNAL - -6 November.--It was late in the afternoon when the Professor and I -took our way towards the east whence I knew Jonathan was coming. We -did not go fast, though the way was steeply downhill, for we had to -take heavy rugs and wraps with us. We dared not face the possibility -of being left without warmth in the cold and the snow. We had to take -some of our provisions too, for we were in a perfect desolation, and -so far as we could see through the snowfall, there was not even the -sign of habitation. When we had gone about a mile, I was tired with -the heavy walking and sat down to rest. Then we looked back and saw -where the clear line of Dracula's castle cut the sky. For we were so -deep under the hill whereon it was set that the angle of perspective -of the Carpathian mountains was far below it. We saw it in all its -grandeur, perched a thousand feet on the summit of a sheer precipice, -and with seemingly a great gap between it and the steep of the -adjacent mountain on any side. There was something wild and uncanny -about the place. We could hear the distant howling of wolves. They -were far off, but the sound, even though coming muffled through the -deadening snowfall, was full of terror. I knew from the way Dr. Van -Helsing was searching about that he was trying to seek some strategic -point, where we would be less exposed in case of attack. The rough -roadway still led downwards. We could trace it through the drifted -snow. - -In a little while the Professor signalled to me, so I got up and -joined him. He had found a wonderful spot, a sort of natural hollow -in a rock, with an entrance like a doorway between two boulders. He -took me by the hand and drew me in. - -"See!" he said, "here you will be in shelter. And if the wolves do -come I can meet them one by one." - -He brought in our furs, and made a snug nest for me, and got out some -provisions and forced them upon me. But I could not eat, to even try -to do so was repulsive to me, and much as I would have liked to please -him, I could not bring myself to the attempt. He looked very sad, but -did not reproach me. Taking his field glasses from the case, he stood -on the top of the rock, and began to search the horizon. - -Suddenly he called out, "Look! Madam Mina, look! Look!" - -I sprang up and stood beside him on the rock. He handed me his -glasses and pointed. The snow was now falling more heavily, and -swirled about fiercely, for a high wind was beginning to blow. -However, there were times when there were pauses between the snow -flurries and I could see a long way round. From the height where we -were it was possible to see a great distance. And far off, beyond the -white waste of snow, I could see the river lying like a black ribbon -in kinks and curls as it wound its way. Straight in front of us and -not far off, in fact so near that I wondered we had not noticed -before, came a group of mounted men hurrying along. In the midst of -them was a cart, a long leiter wagon which swept from side to side, -like a dog's tail wagging, with each stern inequality of the road. -Outlined against the snow as they were, I could see from the men's -clothes that they were peasants or gypsies of some kind. - -On the cart was a great square chest. My heart leaped as I saw it, for -I felt that the end was coming. The evening was now drawing close, -and well I knew that at sunset the Thing, which was till then -imprisoned there, would take new freedom and could in any of many -forms elude pursuit. In fear I turned to the Professor. To my -consternation, however, he was not there. An instant later, I saw him -below me. Round the rock he had drawn a circle, such as we had found -shelter in last night. - -When he had completed it he stood beside me again saying, "At least -you shall be safe here from him!" He took the glasses from me, and at -the next lull of the snow swept the whole space below us. "See," he -said, "they come quickly. They are flogging the horses, and galloping -as hard as they can." - -He paused and went on in a hollow voice, "They are racing for the -sunset. We may be too late. God's will be done!" Down came another -blinding rush of driving snow, and the whole landscape was blotted -out. It soon passed, however, and once more his glasses were fixed on -the plain. - -Then came a sudden cry, "Look! Look! Look! See, two horsemen follow -fast, coming up from the south. It must be Quincey and John. Take -the glass. Look before the snow blots it all out!" I took it and -looked. The two men might be Dr. Seward and Mr. Morris. I knew at -all events that neither of them was Jonathan. At the same time I knew -that Jonathan was not far off. Looking around I saw on the north side -of the coming party two other men, riding at breakneck speed. One of -them I knew was Jonathan, and the other I took, of course, to be Lord -Godalming. They too, were pursuing the party with the cart. When I -told the Professor he shouted in glee like a schoolboy, and after -looking intently till a snow fall made sight impossible, he laid his -Winchester rifle ready for use against the boulder at the opening of -our shelter. - -"They are all converging," he said. "When the time comes we shall have -gypsies on all sides." I got out my revolver ready to hand, for -whilst we were speaking the howling of wolves came louder and closer. -When the snow storm abated a moment we looked again. It was strange -to see the snow falling in such heavy flakes close to us, and beyond, -the sun shining more and more brightly as it sank down towards the far -mountain tops. Sweeping the glass all around us I could see here and -there dots moving singly and in twos and threes and larger numbers. -The wolves were gathering for their prey. - -Every instant seemed an age whilst we waited. The wind came now in -fierce bursts, and the snow was driven with fury as it swept upon us -in circling eddies. At times we could not see an arm's length before -us. But at others, as the hollow sounding wind swept by us, it seemed -to clear the air space around us so that we could see afar off. We -had of late been so accustomed to watch for sunrise and sunset, that -we knew with fair accuracy when it would be. And we knew that before -long the sun would set. It was hard to believe that by our watches it -was less than an hour that we waited in that rocky shelter before the -various bodies began to converge close upon us. The wind came now -with fiercer and more bitter sweeps, and more steadily from the -north. It seemingly had driven the snow clouds from us, for with only -occasional bursts, the snow fell. We could distinguish clearly the -individuals of each party, the pursued and the pursuers. Strangely -enough those pursued did not seem to realize, or at least to care, -that they were pursued. They seemed, however, to hasten with -redoubled speed as the sun dropped lower and lower on the mountain -tops. - -Closer and closer they drew. The Professor and I crouched down behind -our rock, and held our weapons ready. I could see that he was -determined that they should not pass. One and all were quite unaware -of our presence. - -All at once two voices shouted out to "Halt!" One was my Jonathan's, -raised in a high key of passion. The other Mr. Morris' strong -resolute tone of quiet command. The gypsies may not have known the -language, but there was no mistaking the tone, in whatever tongue the -words were spoken. Instinctively they reined in, and at the instant -Lord Godalming and Jonathan dashed up at one side and Dr. Seward and -Mr. Morris on the other. The leader of the gypsies, a splendid -looking fellow who sat his horse like a centaur, waved them back, and -in a fierce voice gave to his companions some word to proceed. They -lashed the horses which sprang forward. But the four men raised their -Winchester rifles, and in an unmistakable way commanded them to stop. -At the same moment Dr. Van Helsing and I rose behind the rock and -pointed our weapons at them. Seeing that they were surrounded the men -tightened their reins and drew up. The leader turned to them and gave -a word at which every man of the gypsy party drew what weapon he -carried, knife or pistol, and held himself in readiness to attack. -Issue was joined in an instant. - -The leader, with a quick movement of his rein, threw his horse out in -front, and pointed first to the sun, now close down on the hill tops, -and then to the castle, said something which I did not understand. -For answer, all four men of our party threw themselves from their -horses and dashed towards the cart. I should have felt terrible fear -at seeing Jonathan in such danger, but that the ardor of battle must -have been upon me as well as the rest of them. I felt no fear, but -only a wild, surging desire to do something. Seeing the quick -movement of our parties, the leader of the gypsies gave a command. His -men instantly formed round the cart in a sort of undisciplined -endeavour, each one shouldering and pushing the other in his eagerness -to carry out the order. - -In the midst of this I could see that Jonathan on one side of the ring -of men, and Quincey on the other, were forcing a way to the cart. It -was evident that they were bent on finishing their task before the sun -should set. Nothing seemed to stop or even to hinder them. Neither -the levelled weapons nor the flashing knives of the gypsies in front, -nor the howling of the wolves behind, appeared to even attract their -attention. Jonathan's impetuosity, and the manifest singleness of his -purpose, seemed to overawe those in front of him. Instinctively they -cowered aside and let him pass. In an instant he had jumped upon the -cart, and with a strength which seemed incredible, raised the great -box, and flung it over the wheel to the ground. In the meantime, Mr. -Morris had had to use force to pass through his side of the ring of -Szgany. All the time I had been breathlessly watching Jonathan I had, -with the tail of my eye, seen him pressing desperately forward, and -had seen the knives of the gypsies flash as he won a way through them, -and they cut at him. He had parried with his great bowie knife, and -at first I thought that he too had come through in safety. But as he -sprang beside Jonathan, who had by now jumped from the cart, I could -see that with his left hand he was clutching at his side, and that the -blood was spurting through his fingers. He did not delay -notwithstanding this, for as Jonathan, with desperate energy, attacked -one end of the chest, attempting to prize off the lid with his great -Kukri knife, he attacked the other frantically with his bowie. Under -the efforts of both men the lid began to yield. The nails drew with a -screeching sound, and the top of the box was thrown back. - -By this time the gypsies, seeing themselves covered by the -Winchesters, and at the mercy of Lord Godalming and Dr. Seward, had -given in and made no further resistance. The sun was almost down on -the mountain tops, and the shadows of the whole group fell upon the -snow. I saw the Count lying within the box upon the earth, some of -which the rude falling from the cart had scattered over him. He was -deathly pale, just like a waxen image, and the red eyes glared with -the horrible vindictive look which I knew so well. - -As I looked, the eyes saw the sinking sun, and the look of hate in -them turned to triumph. - -But, on the instant, came the sweep and flash of Jonathan's great -knife. I shrieked as I saw it shear through the throat. Whilst at -the same moment Mr. Morris's bowie knife plunged into the heart. - -It was like a miracle, but before our very eyes, and almost in the -drawing of a breath, the whole body crumbled into dust and passed from -our sight. - -I shall be glad as long as I live that even in that moment of final -dissolution, there was in the face a look of peace, such as I never -could have imagined might have rested there. - -The Castle of Dracula now stood out against the red sky, and every -stone of its broken battlements was articulated against the light of -the setting sun. - -The gypsies, taking us as in some way the cause of the extraordinary -disappearance of the dead man, turned, without a word, and rode away -as if for their lives. Those who were unmounted jumped upon the -leiter wagon and shouted to the horsemen not to desert them. The -wolves, which had withdrawn to a safe distance, followed in their -wake, leaving us alone. - -Mr. Morris, who had sunk to the ground, leaned on his elbow, holding -his hand pressed to his side. The blood still gushed through his -fingers. I flew to him, for the Holy circle did not now keep me back; -so did the two doctors. Jonathan knelt behind him and the wounded man -laid back his head on his shoulder. With a sigh he took, with a -feeble effort, my hand in that of his own which was unstained. - -He must have seen the anguish of my heart in my face, for he smiled at -me and said, "I am only too happy to have been of service! Oh, God!" -he cried suddenly, struggling to a sitting posture and pointing to me. -"It was worth for this to die! Look! Look!" - -The sun was now right down upon the mountain top, and the red gleams -fell upon my face, so that it was bathed in rosy light. With one -impulse the men sank on their knees and a deep and earnest "Amen" -broke from all as their eyes followed the pointing of his finger. - -The dying man spoke, "Now God be thanked that all has not been in -vain! See! The snow is not more stainless than her forehead! The -curse has passed away!" - -And, to our bitter grief, with a smile and in silence, he died, a -gallant gentleman. - - - - - -NOTE - - -Seven years ago we all went through the flames. And the happiness of -some of us since then is, we think, well worth the pain we endured. -It is an added joy to Mina and to me that our boy's birthday is the -same day as that on which Quincey Morris died. His mother holds, I -know, the secret belief that some of our brave friend's spirit has -passed into him. His bundle of names links all our little band of men -together. But we call him Quincey. - -In the summer of this year we made a journey to Transylvania, and went -over the old ground which was, and is, to us so full of vivid and -terrible memories. It was almost impossible to believe that the -things which we had seen with our own eyes and heard with our own ears -were living truths. Every trace of all that had been was blotted -out. The castle stood as before, reared high above a waste of -desolation. - -When we got home we were talking of the old time, which we could all -look back on without despair, for Godalming and Seward are both -happily married. I took the papers from the safe where they had been -ever since our return so long ago. We were struck with the fact, that -in all the mass of material of which the record is composed, there is -hardly one authentic document. Nothing but a mass of typewriting, -except the later notebooks of Mina and Seward and myself, and Van -Helsing's memorandum. We could hardly ask any one, even did we wish -to, to accept these as proofs of so wild a story. Van Helsing summed -it all up as he said, with our boy on his knee. - -"We want no proofs. We ask none to believe us! This boy will some -day know what a brave and gallant woman his mother is. Already he -knows her sweetness and loving care. Later on he will understand how -some men so loved her, that they did dare much for her sake." - -JONATHAN HARKER - - - - - - - - - -End of the Project Gutenberg EBook of Dracula, by Bram Stoker - -*** END OF THIS PROJECT GUTENBERG EBOOK DRACULA *** - -***** This file should be named 345.txt or 345.zip ***** -This and all associated files of various formats will be found in: - http://www.gutenberg.org/3/4/345/ - - - -Updated editions will replace the previous one--the old editions -will be renamed. - -Creating the works from public domain print editions means that no -one owns a United States copyright in these works, so the Foundation -(and you!) can copy and distribute it in the United States without -permission and without paying copyright royalties. Special rules, -set forth in the General Terms of Use part of this license, apply to -copying and distributing Project Gutenberg-tm electronic works to -protect the PROJECT GUTENBERG-tm concept and trademark. Project -Gutenberg is a registered trademark, and may not be used if you -charge for the eBooks, unless you receive specific permission. If you -do not charge anything for copies of this eBook, complying with the -rules is very easy. You may use this eBook for nearly any purpose -such as creation of derivative works, reports, performances and -research. They may be modified and printed and given away--you may do -practically ANYTHING with public domain eBooks. Redistribution is -subject to the trademark license, especially commercial -redistribution. - - - -*** START: FULL LICENSE *** - -THE FULL PROJECT GUTENBERG LICENSE -PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK - -To protect the Project Gutenberg-tm mission of promoting the free -distribution of electronic works, by using or distributing this work -(or any other work associated in any way with the phrase "Project -Gutenberg"), you agree to comply with all the terms of the Full Project -Gutenberg-tm License (available with this file or online at -http://gutenberg.net/license). - - -Section 1. General Terms of Use and Redistributing Project Gutenberg-tm -electronic works - -1.A. By reading or using any part of this Project Gutenberg-tm -electronic work, you indicate that you have read, understand, agree to -and accept all the terms of this license and intellectual property -(trademark/copyright) agreement. If you do not agree to abide by all -the terms of this agreement, you must cease using and return or destroy -all copies of Project Gutenberg-tm electronic works in your possession. -If you paid a fee for obtaining a copy of or access to a Project -Gutenberg-tm electronic work and you do not agree to be bound by the -terms of this agreement, you may obtain a refund from the person or -entity to whom you paid the fee as set forth in paragraph 1.E.8. - -1.B. "Project Gutenberg" is a registered trademark. It may only be -used on or associated in any way with an electronic work by people who -agree to be bound by the terms of this agreement. There are a few -things that you can do with most Project Gutenberg-tm electronic works -even without complying with the full terms of this agreement. See -paragraph 1.C below. There are a lot of things you can do with Project -Gutenberg-tm electronic works if you follow the terms of this agreement -and help preserve free future access to Project Gutenberg-tm electronic -works. See paragraph 1.E below. - -1.C. The Project Gutenberg Literary Archive Foundation ("the Foundation" -or PGLAF), owns a compilation copyright in the collection of Project -Gutenberg-tm electronic works. Nearly all the individual works in the -collection are in the public domain in the United States. If an -individual work is in the public domain in the United States and you are -located in the United States, we do not claim a right to prevent you from -copying, distributing, performing, displaying or creating derivative -works based on the work as long as all references to Project Gutenberg -are removed. Of course, we hope that you will support the Project -Gutenberg-tm mission of promoting free access to electronic works by -freely sharing Project Gutenberg-tm works in compliance with the terms of -this agreement for keeping the Project Gutenberg-tm name associated with -the work. You can easily comply with the terms of this agreement by -keeping this work in the same format with its attached full Project -Gutenberg-tm License when you share it without charge with others. - -1.D. The copyright laws of the place where you are located also govern -what you can do with this work. Copyright laws in most countries are in -a constant state of change. If you are outside the United States, check -the laws of your country in addition to the terms of this agreement -before downloading, copying, displaying, performing, distributing or -creating derivative works based on this work or any other Project -Gutenberg-tm work. The Foundation makes no representations concerning -the copyright status of any work in any country outside the United -States. - -1.E. Unless you have removed all references to Project Gutenberg: - -1.E.1. The following sentence, with active links to, or other immediate -access to, the full Project Gutenberg-tm License must appear prominently -whenever any copy of a Project Gutenberg-tm work (any work on which the -phrase "Project Gutenberg" appears, or with which the phrase "Project -Gutenberg" is associated) is accessed, displayed, performed, viewed, -copied or distributed: - -This eBook is for the use of anyone anywhere at no cost and with -almost no restrictions whatsoever. You may copy it, give it away or -re-use it under the terms of the Project Gutenberg License included -with this eBook or online at www.gutenberg.net - -1.E.2. If an individual Project Gutenberg-tm electronic work is derived -from the public domain (does not contain a notice indicating that it is -posted with permission of the copyright holder), the work can be copied -and distributed to anyone in the United States without paying any fees -or charges. If you are redistributing or providing access to a work -with the phrase "Project Gutenberg" associated with or appearing on the -work, you must comply either with the requirements of paragraphs 1.E.1 -through 1.E.7 or obtain permission for the use of the work and the -Project Gutenberg-tm trademark as set forth in paragraphs 1.E.8 or -1.E.9. - -1.E.3. If an individual Project Gutenberg-tm electronic work is posted -with the permission of the copyright holder, your use and distribution -must comply with both paragraphs 1.E.1 through 1.E.7 and any additional -terms imposed by the copyright holder. Additional terms will be linked -to the Project Gutenberg-tm License for all works posted with the -permission of the copyright holder found at the beginning of this work. - -1.E.4. Do not unlink or detach or remove the full Project Gutenberg-tm -License terms from this work, or any files containing a part of this -work or any other work associated with Project Gutenberg-tm. - -1.E.5. Do not copy, display, perform, distribute or redistribute this -electronic work, or any part of this electronic work, without -prominently displaying the sentence set forth in paragraph 1.E.1 with -active links or immediate access to the full terms of the Project -Gutenberg-tm License. - -1.E.6. You may convert to and distribute this work in any binary, -compressed, marked up, nonproprietary or proprietary form, including any -word processing or hypertext form. However, if you provide access to or -distribute copies of a Project Gutenberg-tm work in a format other than -"Plain Vanilla ASCII" or other format used in the official version -posted on the official Project Gutenberg-tm web site (www.gutenberg.net), -you must, at no additional cost, fee or expense to the user, provide a -copy, a means of exporting a copy, or a means of obtaining a copy upon -request, of the work in its original "Plain Vanilla ASCII" or other -form. Any alternate format must include the full Project Gutenberg-tm -License as specified in paragraph 1.E.1. - -1.E.7. Do not charge a fee for access to, viewing, displaying, -performing, copying or distributing any Project Gutenberg-tm works -unless you comply with paragraph 1.E.8 or 1.E.9. - -1.E.8. You may charge a reasonable fee for copies of or providing -access to or distributing Project Gutenberg-tm electronic works provided -that - -- You pay a royalty fee of 20% of the gross profits you derive from - the use of Project Gutenberg-tm works calculated using the method - you already use to calculate your applicable taxes. The fee is - owed to the owner of the Project Gutenberg-tm trademark, but he - has agreed to donate royalties under this paragraph to the - Project Gutenberg Literary Archive Foundation. Royalty payments - must be paid within 60 days following each date on which you - prepare (or are legally required to prepare) your periodic tax - returns. Royalty payments should be clearly marked as such and - sent to the Project Gutenberg Literary Archive Foundation at the - address specified in Section 4, "Information about donations to - the Project Gutenberg Literary Archive Foundation." - -- You provide a full refund of any money paid by a user who notifies - you in writing (or by e-mail) within 30 days of receipt that s/he - does not agree to the terms of the full Project Gutenberg-tm - License. You must require such a user to return or - destroy all copies of the works possessed in a physical medium - and discontinue all use of and all access to other copies of - Project Gutenberg-tm works. - -- You provide, in accordance with paragraph 1.F.3, a full refund of any - money paid for a work or a replacement copy, if a defect in the - electronic work is discovered and reported to you within 90 days - of receipt of the work. - -- You comply with all other terms of this agreement for free - distribution of Project Gutenberg-tm works. - -1.E.9. If you wish to charge a fee or distribute a Project Gutenberg-tm -electronic work or group of works on different terms than are set -forth in this agreement, you must obtain permission in writing from -both the Project Gutenberg Literary Archive Foundation and Michael -Hart, the owner of the Project Gutenberg-tm trademark. Contact the -Foundation as set forth in Section 3 below. - -1.F. - -1.F.1. Project Gutenberg volunteers and employees expend considerable -effort to identify, do copyright research on, transcribe and proofread -public domain works in creating the Project Gutenberg-tm -collection. Despite these efforts, Project Gutenberg-tm electronic -works, and the medium on which they may be stored, may contain -"Defects," such as, but not limited to, incomplete, inaccurate or -corrupt data, transcription errors, a copyright or other intellectual -property infringement, a defective or damaged disk or other medium, a -computer virus, or computer codes that damage or cannot be read by -your equipment. - -1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for the "Right -of Replacement or Refund" described in paragraph 1.F.3, the Project -Gutenberg Literary Archive Foundation, the owner of the Project -Gutenberg-tm trademark, and any other party distributing a Project -Gutenberg-tm electronic work under this agreement, disclaim all -liability to you for damages, costs and expenses, including legal -fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT -LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE -PROVIDED IN PARAGRAPH F3. YOU AGREE THAT THE FOUNDATION, THE -TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE -LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE OR -INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH -DAMAGE. - -1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you discover a -defect in this electronic work within 90 days of receiving it, you can -receive a refund of the money (if any) you paid for it by sending a -written explanation to the person you received the work from. If you -received the work on a physical medium, you must return the medium with -your written explanation. The person or entity that provided you with -the defective work may elect to provide a replacement copy in lieu of a -refund. If you received the work electronically, the person or entity -providing it to you may choose to give you a second opportunity to -receive the work electronically in lieu of a refund. If the second copy -is also defective, you may demand a refund in writing without further -opportunities to fix the problem. - -1.F.4. Except for the limited right of replacement or refund set forth -in paragraph 1.F.3, this work is provided to you 'AS-IS' WITH NO OTHER -WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO -WARRANTIES OF MERCHANTIBILITY OR FITNESS FOR ANY PURPOSE. - -1.F.5. Some states do not allow disclaimers of certain implied -warranties or the exclusion or limitation of certain types of damages. -If any disclaimer or limitation set forth in this agreement violates the -law of the state applicable to this agreement, the agreement shall be -interpreted to make the maximum disclaimer or limitation permitted by -the applicable state law. The invalidity or unenforceability of any -provision of this agreement shall not void the remaining provisions. - -1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation, the -trademark owner, any agent or employee of the Foundation, anyone -providing copies of Project Gutenberg-tm electronic works in accordance -with this agreement, and any volunteers associated with the production, -promotion and distribution of Project Gutenberg-tm electronic works, -harmless from all liability, costs and expenses, including legal fees, -that arise directly or indirectly from any of the following which you do -or cause to occur: (a) distribution of this or any Project Gutenberg-tm -work, (b) alteration, modification, or additions or deletions to any -Project Gutenberg-tm work, and (c) any Defect you cause. - - -Section 2. Information about the Mission of Project Gutenberg-tm - -Project Gutenberg-tm is synonymous with the free distribution of -electronic works in formats readable by the widest variety of computers -including obsolete, old, middle-aged and new computers. It exists -because of the efforts of hundreds of volunteers and donations from -people in all walks of life. - -Volunteers and financial support to provide volunteers with the -assistance they need, is critical to reaching Project Gutenberg-tm's -goals and ensuring that the Project Gutenberg-tm collection will -remain freely available for generations to come. In 2001, the Project -Gutenberg Literary Archive Foundation was created to provide a secure -and permanent future for Project Gutenberg-tm and future generations. -To learn more about the Project Gutenberg Literary Archive Foundation -and how your efforts and donations can help, see Sections 3 and 4 -and the Foundation web page at http://www.pglaf.org. - - -Section 3. Information about the Project Gutenberg Literary Archive -Foundation - -The Project Gutenberg Literary Archive Foundation is a non profit -501(c)(3) educational corporation organized under the laws of the -state of Mississippi and granted tax exempt status by the Internal -Revenue Service. The Foundation's EIN or federal tax identification -number is 64-6221541. Its 501(c)(3) letter is posted at -http://pglaf.org/fundraising. Contributions to the Project Gutenberg -Literary Archive Foundation are tax deductible to the full extent -permitted by U.S. federal laws and your state's laws. - -The Foundation's principal office is located at 4557 Melan Dr. S. -Fairbanks, AK, 99712., but its volunteers and employees are scattered -throughout numerous locations. Its business office is located at -809 North 1500 West, Salt Lake City, UT 84116, (801) 596-1887, email -business@pglaf.org. Email contact links and up to date contact -information can be found at the Foundation's web site and official -page at http://pglaf.org - -For additional contact information: - Dr. Gregory B. Newby - Chief Executive and Director - gbnewby@pglaf.org - - -Section 4. Information about Donations to the Project Gutenberg -Literary Archive Foundation - -Project Gutenberg-tm depends upon and cannot survive without wide -spread public support and donations to carry out its mission of -increasing the number of public domain and licensed works that can be -freely distributed in machine readable form accessible by the widest -array of equipment including outdated equipment. Many small donations -($1 to $5,000) are particularly important to maintaining tax exempt -status with the IRS. - -The Foundation is committed to complying with the laws regulating -charities and charitable donations in all 50 states of the United -States. Compliance requirements are not uniform and it takes a -considerable effort, much paperwork and many fees to meet and keep up -with these requirements. We do not solicit donations in locations -where we have not received written confirmation of compliance. To -SEND DONATIONS or determine the status of compliance for any -particular state visit http://pglaf.org - -While we cannot and do not solicit contributions from states where we -have not met the solicitation requirements, we know of no prohibition -against accepting unsolicited donations from donors in such states who -approach us with offers to donate. - -International donations are gratefully accepted, but we cannot make -any statements concerning tax treatment of donations received from -outside the United States. U.S. laws alone swamp our small staff. - -Please check the Project Gutenberg Web pages for current donation -methods and addresses. Donations are accepted in a number of other -ways including including checks, online payments and credit card -donations. To donate, please visit: http://pglaf.org/donate - - -Section 5. General Information About Project Gutenberg-tm electronic -works. - -Professor Michael S. Hart is the originator of the Project Gutenberg-tm -concept of a library of electronic works that could be freely shared -with anyone. For thirty years, he produced and distributed Project -Gutenberg-tm eBooks with only a loose network of volunteer support. - - -Project Gutenberg-tm eBooks are often created from several printed -editions, all of which are confirmed as Public Domain in the U.S. -unless a copyright notice is included. Thus, we do not necessarily -keep eBooks in compliance with any particular paper edition. - - -Most people start at our Web site which has the main PG search facility: - - http://www.gutenberg.net - -This Web site includes information about Project Gutenberg-tm, -including how to make donations to the Project Gutenberg Literary -Archive Foundation, how to help produce our new eBooks, and how to -subscribe to our email newsletter to hear about new eBooks. diff --git a/java/examples/Topics/Advanced Data/HashMapClass/HashMapClass.pde b/java/examples/Topics/Advanced Data/HashMapClass/HashMapClass.pde deleted file mode 100644 index bf8959bc2..000000000 --- a/java/examples/Topics/Advanced Data/HashMapClass/HashMapClass.pde +++ /dev/null @@ -1,86 +0,0 @@ -/** - * HashMap example - * by Daniel Shiffman. - * - * This example demonstrates how to use a HashMap to store - * a collection of objects referenced by a key. This is much like an array, - * only instead of accessing elements with a numeric index, we use a String. - * If you are familiar with associative arrays from other languages, - * this is the same idea. - * - * A simpler example is CountingStrings which uses IntDict instead of - * HashMap. The Processing classes IntDict, FloatDict, and StringDict - * offer a simpler way of pairing Strings with numbers or other Strings. - * Here we use a HashMap because we want to pair a String with a custom - * object, in this case a "Word" object that stores two numbers. - * - * In this example, words that appear in one book (Dracula) only are colored white - * while words the other (Frankenstein) are colored black. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs font="Georgia.ttf"; */ - -HashMap words; // HashMap object - -void setup() { - size(640, 360); - - // Create the HashMap - words = new HashMap(); - - // Load two files - loadFile("dracula.txt"); - loadFile("frankenstein.txt"); - - // Create the font - textFont(createFont("Georgia", 24)); -} - -void draw() { - background(126); - - // Show words - for (Word w : words.values()) { - if (w.qualify()) { - w.display(); - w.move(); - } - } -} - -// Load a file -void loadFile(String filename) { - String[] lines = loadStrings(filename); - String allText = join(lines, " ").toLowerCase(); - String[] tokens = splitTokens(allText, " ,.?!:;[]-\"'"); - - for (String s : tokens) { - // Is the word in the HashMap - if (words.containsKey(s)) { - // Get the word object and increase the count - // We access objects from a HashMap via its key, the String - Word w = words.get(s); - // Which book am I loading? - if (filename.contains("dracula")) { - w.incrementDracula(); - } - else if (filename.contains("frankenstein")) { - w.incrementFranken(); - } - } - else { - // Otherwise make a new word - Word w = new Word(s); - // And add to the HashMap put() takes two arguments, "key" and "value" - // The key for us is the String and the value is the Word object - words.put(s, w); - if (filename.contains("dracula")) { - w.incrementDracula(); - } else if (filename.contains("frankenstein")) { - w.incrementFranken(); - } - } - } -} - diff --git a/java/examples/Topics/Advanced Data/HashMapClass/Word.pde b/java/examples/Topics/Advanced Data/HashMapClass/Word.pde deleted file mode 100755 index ed4302c88..000000000 --- a/java/examples/Topics/Advanced Data/HashMapClass/Word.pde +++ /dev/null @@ -1,72 +0,0 @@ -class Word { - - // Store a count for occurences in two different books - int countDracula; - int countFranken; - // Also the total count - int totalCount; - - // What is the String - String word; - - // Where is it on the screen - PVector position; - - Word(String s) { - position = new PVector(random(width), random(-height, height*2)); - word = s; - } - - // We will display a word if it appears at least 5 times - // and only in one of the books - boolean qualify() { - if ((countDracula == totalCount || countFranken == totalCount) && totalCount > 5) { - return true; - } - else { - return false; - } - } - - // Increment the count for Dracula - void incrementDracula() { - countDracula++; - totalCount++; - } - - - // Increment the count for Frankenstein - void incrementFranken() { - countFranken++; - totalCount++; - } - - // The more often it appears, the faster it falls - void move() { - float speed = map(totalCount, 5, 25, 0.1, 0.4); - speed = constrain(speed,0,10); - position.y += speed; - - if (position.y > height*2) { - position.y = -height; - } - } - - - // Depending on which book it gets a color - void display() { - if (countDracula > 0) { - fill(255); - } - else if (countFranken > 0) { - fill(0); - } - // Its size is also tied to number of occurences - float fs = map(totalCount,5,25,2,24); - fs = constrain(fs,2,48); - textSize(fs); - textAlign(CENTER); - text(word, position.x, position.y); - } -} - diff --git a/java/examples/Topics/Advanced Data/HashMapClass/data/Georgia.ttf b/java/examples/Topics/Advanced Data/HashMapClass/data/Georgia.ttf deleted file mode 100755 index 27d1c1951..000000000 Binary files a/java/examples/Topics/Advanced Data/HashMapClass/data/Georgia.ttf and /dev/null differ diff --git a/java/examples/Topics/Advanced Data/HashMapClass/data/dracula.txt b/java/examples/Topics/Advanced Data/HashMapClass/data/dracula.txt deleted file mode 100755 index 7fb73f568..000000000 --- a/java/examples/Topics/Advanced Data/HashMapClass/data/dracula.txt +++ /dev/null @@ -1,16624 +0,0 @@ -The Project Gutenberg EBook of Dracula, by Bram Stoker - -This eBook is for the use of anyone anywhere at no cost and with -almost no restrictions whatsoever. You may copy it, give it away or -re-use it under the terms of the Project Gutenberg License included -with this eBook or online at www.gutenberg.net - - -Title: Dracula - -Author: Bram Stoker - -Release Date: May 9, 2008 [EBook #345] - -Language: English - -Character set encoding: ASCII - -*** START OF THIS PROJECT GUTENBERG EBOOK DRACULA *** - - - - - - - - - - - - - - -DRACULA - -by - -Bram Stoker - - -1897 edition - - - - -TABLE OF CONTENTS - - -CHAPTER - - 1 Jonathan Harker's Journal - 2 Jonathan Harker's Journal - 3 Jonathan Harker's Journal - 4 Jonathan Harker's Journal - 5 Letter From Miss Mina Murray To Miss Lucy Westenra - 6 Mina Murray's Journal - 7 Cutting From "The Dailygraph", 8 August - 8 Mina Murray's Journal - 9 Letter, Mina Harker To Lucy Westenra - 10 Letter, Dr. Seward To Hon. Arthur Holmwood - 11 Lucy Westenra's Diary - 12 Dr. Seward's Diary - 13 Dr. Seward's Diary - 14 Mina Harker's Journal - 15 Dr. Seward's Diary - 16 Dr. Seward's Diary - 17 Dr. Seward's Diary - 18 Dr. Seward's Diary - 19 Jonathan Harker's Journal - 20 Jonathan Harker's Journal - 21 Dr. Seward's Diary - 22 Jonathan Harker's Journal - 23 Dr. Seward's Diary - 24 Dr. Seward's Phonograph Diary - 25 Dr. Seward's Diary - 26 Dr. Seward's Diary - 27 Mina Harker's Journal - - - - -CHAPTER 1 - - -Jonathan Harker's Journal - -3 May. Bistritz.--Left Munich at 8:35 P.M., on 1st May, arriving at -Vienna early next morning; should have arrived at 6:46, but train was -an hour late. Buda-Pesth seems a wonderful place, from the glimpse -which I got of it from the train and the little I could walk through -the streets. I feared to go very far from the station, as we had -arrived late and would start as near the correct time as possible. - -The impression I had was that we were leaving the West and entering the -East; the most western of splendid bridges over the Danube, which is -here of noble width and depth, took us among the traditions of Turkish -rule. - -We left in pretty good time, and came after nightfall to Klausenburgh. -Here I stopped for the night at the Hotel Royale. I had for dinner, -or rather supper, a chicken done up some way with red pepper, which -was very good but thirsty. (Mem. get recipe for Mina.) I asked the -waiter, and he said it was called "paprika hendl," and that, as it was -a national dish, I should be able to get it anywhere along the -Carpathians. - -I found my smattering of German very useful here, indeed, I don't know -how I should be able to get on without it. - -Having had some time at my disposal when in London, I had visited the -British Museum, and made search among the books and maps in the -library regarding Transylvania; it had struck me that some -foreknowledge of the country could hardly fail to have some importance -in dealing with a nobleman of that country. - - -I find that the district he named is in the extreme east of the -country, just on the borders of three states, Transylvania, Moldavia, -and Bukovina, in the midst of the Carpathian mountains; one of the -wildest and least known portions of Europe. - -I was not able to light on any map or work giving the exact locality -of the Castle Dracula, as there are no maps of this country as yet to -compare with our own Ordance Survey Maps; but I found that Bistritz, -the post town named by Count Dracula, is a fairly well-known place. I -shall enter here some of my notes, as they may refresh my memory when -I talk over my travels with Mina. - -In the population of Transylvania there are four distinct -nationalities: Saxons in the South, and mixed with them the Wallachs, -who are the descendants of the Dacians; Magyars in the West, and -Szekelys in the East and North. I am going among the latter, who -claim to be descended from Attila and the Huns. This may be so, for -when the Magyars conquered the country in the eleventh century they -found the Huns settled in it. - -I read that every known superstition in the world is gathered into the -horseshoe of the Carpathians, as if it were the centre of some sort of -imaginative whirlpool; if so my stay may be very interesting. (Mem., -I must ask the Count all about them.) - -I did not sleep well, though my bed was comfortable enough, for I had -all sorts of queer dreams. There was a dog howling all night under my -window, which may have had something to do with it; or it may have -been the paprika, for I had to drink up all the water in my carafe, -and was still thirsty. Towards morning I slept and was wakened by the -continuous knocking at my door, so I guess I must have been sleeping -soundly then. - -I had for breakfast more paprika, and a sort of porridge of maize -flour which they said was "mamaliga", and egg-plant stuffed with -forcemeat, a very excellent dish, which they call "impletata". (Mem., -get recipe for this also.) - -I had to hurry breakfast, for the train started a little before eight, -or rather it ought to have done so, for after rushing to the station -at 7:30 I had to sit in the carriage for more than an hour before we -began to move. - -It seems to me that the further east you go the more unpunctual are -the trains. What ought they to be in China? - -All day long we seemed to dawdle through a country which was full of -beauty of every kind. Sometimes we saw little towns or castles on the -top of steep hills such as we see in old missals; sometimes we ran by -rivers and streams which seemed from the wide stony margin on each -side of them to be subject to great floods. It takes a lot of water, -and running strong, to sweep the outside edge of a river clear. - -At every station there were groups of people, sometimes crowds, and in -all sorts of attire. Some of them were just like the peasants at home -or those I saw coming through France and Germany, with short jackets, -and round hats, and home-made trousers; but others were very -picturesque. - -The women looked pretty, except when you got near them, but they were -very clumsy about the waist. They had all full white sleeves of some -kind or other, and most of them had big belts with a lot of strips of -something fluttering from them like the dresses in a ballet, but of -course there were petticoats under them. - -The strangest figures we saw were the Slovaks, who were more barbarian -than the rest, with their big cow-boy hats, great baggy dirty-white -trousers, white linen shirts, and enormous heavy leather belts, nearly -a foot wide, all studded over with brass nails. They wore high boots, -with their trousers tucked into them, and had long black hair and -heavy black moustaches. They are very picturesque, but do not look -prepossessing. On the stage they would be set down at once as some -old Oriental band of brigands. They are, however, I am told, very -harmless and rather wanting in natural self-assertion. - -It was on the dark side of twilight when we got to Bistritz, which is -a very interesting old place. Being practically on the frontier--for -the Borgo Pass leads from it into Bukovina--it has had a very stormy -existence, and it certainly shows marks of it. Fifty years ago a -series of great fires took place, which made terrible havoc on five -separate occasions. At the very beginning of the seventeenth century -it underwent a siege of three weeks and lost 13,000 people, the -casualties of war proper being assisted by famine and disease. - -Count Dracula had directed me to go to the Golden Krone Hotel, which I -found, to my great delight, to be thoroughly old-fashioned, for of -course I wanted to see all I could of the ways of the country. - -I was evidently expected, for when I got near the door I faced a -cheery-looking elderly woman in the usual peasant dress--white -undergarment with a long double apron, front, and back, of coloured -stuff fitting almost too tight for modesty. When I came close she -bowed and said, "The Herr Englishman?" - -"Yes," I said, "Jonathan Harker." - -She smiled, and gave some message to an elderly man in white -shirtsleeves, who had followed her to the door. - -He went, but immediately returned with a letter: - -"My friend.--Welcome to the Carpathians. I am anxiously expecting -you. Sleep well tonight. At three tomorrow the diligence will -start for Bukovina; a place on it is kept for you. At the Borgo -Pass my carriage will await you and will bring you to me. I trust -that your journey from London has been a happy one, and that you -will enjoy your stay in my beautiful land.--Your friend, Dracula." - - -4 May--I found that my landlord had got a letter from the Count, -directing him to secure the best place on the coach for me; but on -making inquiries as to details he seemed somewhat reticent, and -pretended that he could not understand my German. - -This could not be true, because up to then he had understood it -perfectly; at least, he answered my questions exactly as if he did. - -He and his wife, the old lady who had received me, looked at each -other in a frightened sort of way. He mumbled out that the money had -been sent in a letter, and that was all he knew. When I asked him if -he knew Count Dracula, and could tell me anything of his castle, both -he and his wife crossed themselves, and, saying that they knew nothing -at all, simply refused to speak further. It was so near the time of -starting that I had no time to ask anyone else, for it was all very -mysterious and not by any means comforting. - -Just before I was leaving, the old lady came up to my room and said in -a hysterical way: "Must you go? Oh! Young Herr, must you go?" She -was in such an excited state that she seemed to have lost her grip of -what German she knew, and mixed it all up with some other language -which I did not know at all. I was just able to follow her by asking -many questions. When I told her that I must go at once, and that I -was engaged on important business, she asked again: - -"Do you know what day it is?" I answered that it was the fourth of -May. She shook her head as she said again: - -"Oh, yes! I know that! I know that, but do you know what day it is?" - -On my saying that I did not understand, she went on: - -"It is the eve of St. George's Day. Do you not know that tonight, -when the clock strikes midnight, all the evil things in the world will -have full sway? Do you know where you are going, and what you are -going to?" She was in such evident distress that I tried to comfort -her, but without effect. Finally, she went down on her knees and -implored me not to go; at least to wait a day or two before starting. - -It was all very ridiculous but I did not feel comfortable. However, -there was business to be done, and I could allow nothing to interfere -with it. - -I tried to raise her up, and said, as gravely as I could, that I -thanked her, but my duty was imperative, and that I must go. - -She then rose and dried her eyes, and taking a crucifix from her neck -offered it to me. - -I did not know what to do, for, as an English Churchman, I have been -taught to regard such things as in some measure idolatrous, and yet it -seemed so ungracious to refuse an old lady meaning so well and in such -a state of mind. - -She saw, I suppose, the doubt in my face, for she put the rosary round -my neck and said, "For your mother's sake," and went out of the room. - -I am writing up this part of the diary whilst I am waiting for the -coach, which is, of course, late; and the crucifix is still round my -neck. - -Whether it is the old lady's fear, or the many ghostly traditions of -this place, or the crucifix itself, I do not know, but I am not -feeling nearly as easy in my mind as usual. - -If this book should ever reach Mina before I do, let it bring my -goodbye. Here comes the coach! - - -5 May. The Castle.--The gray of the morning has passed, and the sun -is high over the distant horizon, which seems jagged, whether with -trees or hills I know not, for it is so far off that big things and -little are mixed. - -I am not sleepy, and, as I am not to be called till I awake, naturally -I write till sleep comes. - -There are many odd things to put down, and, lest who reads them may -fancy that I dined too well before I left Bistritz, let me put down my -dinner exactly. - -I dined on what they called "robber steak"--bits of bacon, onion, and -beef, seasoned with red pepper, and strung on sticks, and roasted over -the fire, in simple style of the London cat's meat! - -The wine was Golden Mediasch, which produces a queer sting on the -tongue, which is, however, not disagreeable. - -I had only a couple of glasses of this, and nothing else. - -When I got on the coach, the driver had not taken his seat, and I saw -him talking to the landlady. - -They were evidently talking of me, for every now and then they looked -at me, and some of the people who were sitting on the bench outside -the door--came and listened, and then looked at me, most of them -pityingly. I could hear a lot of words often repeated, queer words, -for there were many nationalities in the crowd, so I quietly got my -polyglot dictionary from my bag and looked them out. - -I must say they were not cheering to me, for amongst them were -"Ordog"--Satan, "Pokol"--hell, "stregoica"--witch, "vrolok" and -"vlkoslak"--both mean the same thing, one being Slovak and the other -Servian for something that is either werewolf or vampire. (Mem., I -must ask the Count about these superstitions.) - -When we started, the crowd round the inn door, which had by this time -swelled to a considerable size, all made the sign of the cross and -pointed two fingers towards me. - -With some difficulty, I got a fellow passenger to tell me what they -meant. He would not answer at first, but on learning that I was -English, he explained that it was a charm or guard against the evil -eye. - -This was not very pleasant for me, just starting for an unknown place -to meet an unknown man. But everyone seemed so kind-hearted, and so -sorrowful, and so sympathetic that I could not but be touched. - -I shall never forget the last glimpse which I had of the inn yard and -its crowd of picturesque figures, all crossing themselves, as they -stood round the wide archway, with its background of rich foliage of -oleander and orange trees in green tubs clustered in the centre of the -yard. - -Then our driver, whose wide linen drawers covered the whole front of -the boxseat,--"gotza" they call them--cracked his big whip over his -four small horses, which ran abreast, and we set off on our journey. - -I soon lost sight and recollection of ghostly fears in the beauty of -the scene as we drove along, although had I known the language, or -rather languages, which my fellow-passengers were speaking, I might -not have been able to throw them off so easily. Before us lay a green -sloping land full of forests and woods, with here and there steep -hills, crowned with clumps of trees or with farmhouses, the blank -gable end to the road. There was everywhere a bewildering mass of -fruit blossom--apple, plum, pear, cherry. And as we drove by I could -see the green grass under the trees spangled with the fallen petals. -In and out amongst these green hills of what they call here the -"Mittel Land" ran the road, losing itself as it swept round the grassy -curve, or was shut out by the straggling ends of pine woods, which -here and there ran down the hillsides like tongues of flame. The road -was rugged, but still we seemed to fly over it with a feverish haste. -I could not understand then what the haste meant, but the driver was -evidently bent on losing no time in reaching Borgo Prund. I was told -that this road is in summertime excellent, but that it had not yet -been put in order after the winter snows. In this respect it is -different from the general run of roads in the Carpathians, for it is -an old tradition that they are not to be kept in too good order. Of -old the Hospadars would not repair them, lest the Turk should think -that they were preparing to bring in foreign troops, and so hasten the -war which was always really at loading point. - -Beyond the green swelling hills of the Mittel Land rose mighty slopes -of forest up to the lofty steeps of the Carpathians themselves. Right -and left of us they towered, with the afternoon sun falling full upon -them and bringing out all the glorious colours of this beautiful -range, deep blue and purple in the shadows of the peaks, green and -brown where grass and rock mingled, and an endless perspective of -jagged rock and pointed crags, till these were themselves lost in the -distance, where the snowy peaks rose grandly. Here and there seemed -mighty rifts in the mountains, through which, as the sun began to -sink, we saw now and again the white gleam of falling water. One of -my companions touched my arm as we swept round the base of a hill and -opened up the lofty, snow-covered peak of a mountain, which seemed, as -we wound on our serpentine way, to be right before us. - -"Look! Isten szek!"--"God's seat!"--and he crossed himself reverently. - -As we wound on our endless way, and the sun sank lower and lower -behind us, the shadows of the evening began to creep round us. This -was emphasized by the fact that the snowy mountain-top still held the -sunset, and seemed to glow out with a delicate cool pink. Here and -there we passed Cszeks and slovaks, all in picturesque attire, but I -noticed that goitre was painfully prevalent. By the roadside were -many crosses, and as we swept by, my companions all crossed -themselves. Here and there was a peasant man or woman kneeling before -a shrine, who did not even turn round as we approached, but seemed in -the self-surrender of devotion to have neither eyes nor ears for the -outer world. There were many things new to me. For instance, -hay-ricks in the trees, and here and there very beautiful masses of -weeping birch, their white stems shining like silver through the -delicate green of the leaves. - -Now and again we passed a leiter-wagon--the ordinary peasants's -cart--with its long, snakelike vertebra, calculated to suit the -inequalities of the road. On this were sure to be seated quite a -group of homecoming peasants, the Cszeks with their white, and the -Slovaks with their coloured sheepskins, the latter carrying -lance-fashion their long staves, with axe at end. As the evening fell -it began to get very cold, and the growing twilight seemed to merge -into one dark mistiness the gloom of the trees, oak, beech, and pine, -though in the valleys which ran deep between the spurs of the hills, -as we ascended through the Pass, the dark firs stood out here and -there against the background of late-lying snow. Sometimes, as the -road was cut through the pine woods that seemed in the darkness to be -closing down upon us, great masses of greyness which here and there -bestrewed the trees, produced a peculiarly weird and solemn effect, -which carried on the thoughts and grim fancies engendered earlier in -the evening, when the falling sunset threw into strange relief the -ghost-like clouds which amongst the Carpathians seem to wind -ceaselessly through the valleys. Sometimes the hills were so steep -that, despite our driver's haste, the horses could only go slowly. I -wished to get down and walk up them, as we do at home, but the driver -would not hear of it. "No, no," he said. "You must not walk here. -The dogs are too fierce." And then he added, with what he evidently -meant for grim pleasantry--for he looked round to catch the approving -smile of the rest--"And you may have enough of such matters before you -go to sleep." The only stop he would make was a moment's pause to -light his lamps. - -When it grew dark there seemed to be some excitement amongst the -passengers, and they kept speaking to him, one after the other, as -though urging him to further speed. He lashed the horses unmercifully -with his long whip, and with wild cries of encouragement urged them on -to further exertions. Then through the darkness I could see a sort of -patch of grey light ahead of us, as though there were a cleft in the -hills. The excitement of the passengers grew greater. The crazy -coach rocked on its great leather springs, and swayed like a boat -tossed on a stormy sea. I had to hold on. The road grew more level, -and we appeared to fly along. Then the mountains seemed to come -nearer to us on each side and to frown down upon us. We were entering -on the Borgo Pass. One by one several of the passengers offered me -gifts, which they pressed upon me with an earnestness which would take -no denial. These were certainly of an odd and varied kind, but each -was given in simple good faith, with a kindly word, and a blessing, -and that same strange mixture of fear-meaning movements which I had -seen outside the hotel at Bistritz--the sign of the cross and the -guard against the evil eye. Then, as we flew along, the driver leaned -forward, and on each side the passengers, craning over the edge of the -coach, peered eagerly into the darkness. It was evident that -something very exciting was either happening or expected, but though I -asked each passenger, no one would give me the slightest explanation. -This state of excitement kept on for some little time. And at last we -saw before us the Pass opening out on the eastern side. There were -dark, rolling clouds overhead, and in the air the heavy, oppressive -sense of thunder. It seemed as though the mountain range had -separated two atmospheres, and that now we had got into the thunderous -one. I was now myself looking out for the conveyance which was to -take me to the Count. Each moment I expected to see the glare of -lamps through the blackness, but all was dark. The only light was the -flickering rays of our own lamps, in which the steam from our -hard-driven horses rose in a white cloud. We could see now the sandy -road lying white before us, but there was on it no sign of a vehicle. -The passengers drew back with a sigh of gladness, which seemed to mock -my own disappointment. I was already thinking what I had best do, -when the driver, looking at his watch, said to the others something -which I could hardly hear, it was spoken so quietly and in so low a -tone, I thought it was "An hour less than the time." Then turning to -me, he spoke in German worse than my own. - -"There is no carriage here. The Herr is not expected after all. He -will now come on to Bukovina, and return tomorrow or the next day, -better the next day." Whilst he was speaking the horses began to -neigh and snort and plunge wildly, so that the driver had to hold them -up. Then, amongst a chorus of screams from the peasants and a -universal crossing of themselves, a caleche, with four horses, drove -up behind us, overtook us, and drew up beside the coach. I could see -from the flash of our lamps as the rays fell on them, that the horses -were coal-black and splendid animals. They were driven by a tall man, -with a long brown beard and a great black hat, which seemed to hide -his face from us. I could only see the gleam of a pair of very bright -eyes, which seemed red in the lamplight, as he turned to us. - -He said to the driver, "You are early tonight, my friend." - -The man stammered in reply, "The English Herr was in a hurry." - -To which the stranger replied, "That is why, I suppose, you wished him -to go on to Bukovina. You cannot deceive me, my friend. I know too -much, and my horses are swift." - -As he spoke he smiled, and the lamplight fell on a hard-looking mouth, -with very red lips and sharp-looking teeth, as white as ivory. One of -my companions whispered to another the line from Burger's "Lenore". - -"Denn die Todten reiten Schnell." ("For the dead travel fast.") - -The strange driver evidently heard the words, for he looked up with a -gleaming smile. The passenger turned his face away, at the same time -putting out his two fingers and crossing himself. "Give me the Herr's -luggage," said the driver, and with exceeding alacrity my bags were -handed out and put in the caleche. Then I descended from the side of -the coach, as the caleche was close alongside, the driver helping me -with a hand which caught my arm in a grip of steel. His strength must -have been prodigious. - -Without a word he shook his reins, the horses turned, and we swept -into the darkness of the pass. As I looked back I saw the steam from -the horses of the coach by the light of the lamps, and projected -against it the figures of my late companions crossing themselves. -Then the driver cracked his whip and called to his horses, and off -they swept on their way to Bukovina. As they sank into the darkness I -felt a strange chill, and a lonely feeling come over me. But a cloak -was thrown over my shoulders, and a rug across my knees, and the -driver said in excellent German--"The night is chill, mein Herr, and -my master the Count bade me take all care of you. There is a flask of -slivovitz (the plum brandy of the country) underneath the seat, if you -should require it." - -I did not take any, but it was a comfort to know it was there all the -same. I felt a little strangely, and not a little frightened. I -think had there been any alternative I should have taken it, instead -of prosecuting that unknown night journey. The carriage went at a -hard pace straight along, then we made a complete turn and went along -another straight road. It seemed to me that we were simply going over -and over the same ground again, and so I took note of some salient -point, and found that this was so. I would have liked to have asked -the driver what this all meant, but I really feared to do so, for I -thought that, placed as I was, any protest would have had no effect in -case there had been an intention to delay. - -By-and-by, however, as I was curious to know how time was passing, I -struck a match, and by its flame looked at my watch. It was within a -few minutes of midnight. This gave me a sort of shock, for I suppose -the general superstition about midnight was increased by my recent -experiences. I waited with a sick feeling of suspense. - -Then a dog began to howl somewhere in a farmhouse far down the road, a -long, agonized wailing, as if from fear. The sound was taken up by -another dog, and then another and another, till, borne on the wind -which now sighed softly through the Pass, a wild howling began, which -seemed to come from all over the country, as far as the imagination -could grasp it through the gloom of the night. - -At the first howl the horses began to strain and rear, but the driver -spoke to them soothingly, and they quieted down, but shivered and -sweated as though after a runaway from sudden fright. Then, far off -in the distance, from the mountains on each side of us began a louder -and a sharper howling, that of wolves, which affected both the horses -and myself in the same way. For I was minded to jump from the caleche -and run, whilst they reared again and plunged madly, so that the -driver had to use all his great strength to keep them from bolting. -In a few minutes, however, my own ears got accustomed to the sound, -and the horses so far became quiet that the driver was able to descend -and to stand before them. - -He petted and soothed them, and whispered something in their ears, as -I have heard of horse-tamers doing, and with extraordinary effect, for -under his caresses they became quite manageable again, though they -still trembled. The driver again took his seat, and shaking his -reins, started off at a great pace. This time, after going to the far -side of the Pass, he suddenly turned down a narrow roadway which ran -sharply to the right. - -Soon we were hemmed in with trees, which in places arched right over -the roadway till we passed as through a tunnel. And again great -frowning rocks guarded us boldly on either side. Though we were in -shelter, we could hear the rising wind, for it moaned and whistled -through the rocks, and the branches of the trees crashed together as -we swept along. It grew colder and colder still, and fine, powdery -snow began to fall, so that soon we and all around us were covered -with a white blanket. The keen wind still carried the howling of the -dogs, though this grew fainter as we went on our way. The baying of -the wolves sounded nearer and nearer, as though they were closing -round on us from every side. I grew dreadfully afraid, and the horses -shared my fear. The driver, however, was not in the least disturbed. -He kept turning his head to left and right, but I could not see -anything through the darkness. - -Suddenly, away on our left I saw a faint flickering blue flame. The -driver saw it at the same moment. He at once checked the horses, and, -jumping to the ground, disappeared into the darkness. I did not know -what to do, the less as the howling of the wolves grew closer. But -while I wondered, the driver suddenly appeared again, and without a -word took his seat, and we resumed our journey. I think I must have -fallen asleep and kept dreaming of the incident, for it seemed to be -repeated endlessly, and now looking back, it is like a sort of awful -nightmare. Once the flame appeared so near the road, that even in the -darkness around us I could watch the driver's motions. He went -rapidly to where the blue flame arose, it must have been very faint, -for it did not seem to illumine the place around it at all, and -gathering a few stones, formed them into some device. - -Once there appeared a strange optical effect. When he stood between -me and the flame he did not obstruct it, for I could see its ghostly -flicker all the same. This startled me, but as the effect was only -momentary, I took it that my eyes deceived me straining through the -darkness. Then for a time there were no blue flames, and we sped -onwards through the gloom, with the howling of the wolves around us, -as though they were following in a moving circle. - -At last there came a time when the driver went further afield than he -had yet gone, and during his absence, the horses began to tremble -worse than ever and to snort and scream with fright. I could not see -any cause for it, for the howling of the wolves had ceased altogether. -But just then the moon, sailing through the black clouds, appeared -behind the jagged crest of a beetling, pine-clad rock, and by its -light I saw around us a ring of wolves, with white teeth and lolling -red tongues, with long, sinewy limbs and shaggy hair. They were a -hundred times more terrible in the grim silence which held them than -even when they howled. For myself, I felt a sort of paralysis of -fear. It is only when a man feels himself face to face with such -horrors that he can understand their true import. - -All at once the wolves began to howl as though the moonlight had had -some peculiar effect on them. The horses jumped about and reared, and -looked helplessly round with eyes that rolled in a way painful to -see. But the living ring of terror encompassed them on every side, -and they had perforce to remain within it. I called to the coachman -to come, for it seemed to me that our only chance was to try to break -out through the ring and to aid his approach, I shouted and beat the -side of the caleche, hoping by the noise to scare the wolves from the -side, so as to give him a chance of reaching the trap. How he came -there, I know not, but I heard his voice raised in a tone of imperious -command, and looking towards the sound, saw him stand in the roadway. -As he swept his long arms, as though brushing aside some impalpable -obstacle, the wolves fell back and back further still. Just then a -heavy cloud passed across the face of the moon, so that we were again -in darkness. - -When I could see again the driver was climbing into the caleche, and -the wolves disappeared. This was all so strange and uncanny that a -dreadful fear came upon me, and I was afraid to speak or move. The -time seemed interminable as we swept on our way, now in almost -complete darkness, for the rolling clouds obscured the moon. - -We kept on ascending, with occasional periods of quick descent, but in -the main always ascending. Suddenly, I became conscious of the fact -that the driver was in the act of pulling up the horses in the -courtyard of a vast ruined castle, from whose tall black windows came -no ray of light, and whose broken battlements showed a jagged line -against the sky. - - - - -CHAPTER 2 - - -Jonathan Harker's Journal Continued - -5 May.--I must have been asleep, for certainly if I had been fully -awake I must have noticed the approach of such a remarkable place. In -the gloom the courtyard looked of considerable size, and as several -dark ways led from it under great round arches, it perhaps seemed -bigger than it really is. I have not yet been able to see it by -daylight. - -When the caleche stopped, the driver jumped down and held out his hand -to assist me to alight. Again I could not but notice his prodigious -strength. His hand actually seemed like a steel vice that could have -crushed mine if he had chosen. Then he took my traps, and placed them -on the ground beside me as I stood close to a great door, old and -studded with large iron nails, and set in a projecting doorway of -massive stone. I could see even in the dim light that the stone was -massively carved, but that the carving had been much worn by time and -weather. As I stood, the driver jumped again into his seat and shook -the reins. The horses started forward, and trap and all disappeared -down one of the dark openings. - -I stood in silence where I was, for I did not know what to do. Of -bell or knocker there was no sign. Through these frowning walls and -dark window openings it was not likely that my voice could penetrate. -The time I waited seemed endless, and I felt doubts and fears crowding -upon me. What sort of place had I come to, and among what kind of -people? What sort of grim adventure was it on which I had embarked? -Was this a customary incident in the life of a solicitor's clerk sent -out to explain the purchase of a London estate to a foreigner? -Solicitor's clerk! Mina would not like that. Solicitor, for just -before leaving London I got word that my examination was successful, -and I am now a full-blown solicitor! I began to rub my eyes and pinch -myself to see if I were awake. It all seemed like a horrible -nightmare to me, and I expected that I should suddenly awake, and find -myself at home, with the dawn struggling in through the windows, as I -had now and again felt in the morning after a day of overwork. But my -flesh answered the pinching test, and my eyes were not to be -deceived. I was indeed awake and among the Carpathians. All I could -do now was to be patient, and to wait the coming of morning. - -Just as I had come to this conclusion I heard a heavy step approaching -behind the great door, and saw through the chinks the gleam of a -coming light. Then there was the sound of rattling chains and the -clanking of massive bolts drawn back. A key was turned with the loud -grating noise of long disuse, and the great door swung back. - -Within, stood a tall old man, clean shaven save for a long white -moustache, and clad in black from head to foot, without a single speck -of colour about him anywhere. He held in his hand an antique silver -lamp, in which the flame burned without a chimney or globe of any -kind, throwing long quivering shadows as it flickered in the draught -of the open door. The old man motioned me in with his right hand with -a courtly gesture, saying in excellent English, but with a strange -intonation. - -"Welcome to my house! Enter freely and of your own free will!" He -made no motion of stepping to meet me, but stood like a statue, as -though his gesture of welcome had fixed him into stone. The instant, -however, that I had stepped over the threshold, he moved impulsively -forward, and holding out his hand grasped mine with a strength which -made me wince, an effect which was not lessened by the fact that it -seemed cold as ice, more like the hand of a dead than a living man. -Again he said, - -"Welcome to my house! Enter freely. Go safely, and leave something -of the happiness you bring!" The strength of the handshake was so -much akin to that which I had noticed in the driver, whose face I had -not seen, that for a moment I doubted if it were not the same person -to whom I was speaking. So to make sure, I said interrogatively, -"Count Dracula?" - -He bowed in a courtly way as he replied, "I am Dracula, and I bid you -welcome, Mr. Harker, to my house. Come in, the night air is chill, -and you must need to eat and rest." As he was speaking, he put the lamp -on a bracket on the wall, and stepping out, took my luggage. He had -carried it in before I could forestall him. I protested, but he -insisted. - -"Nay, sir, you are my guest. It is late, and my people are not -available. Let me see to your comfort myself." He insisted on carrying -my traps along the passage, and then up a great winding stair, and -along another great passage, on whose stone floor our steps rang -heavily. At the end of this he threw open a heavy door, and I -rejoiced to see within a well-lit room in which a table was spread for -supper, and on whose mighty hearth a great fire of logs, freshly -replenished, flamed and flared. - -The Count halted, putting down my bags, closed the door, and crossing -the room, opened another door, which led into a small octagonal room -lit by a single lamp, and seemingly without a window of any sort. -Passing through this, he opened another door, and motioned me to -enter. It was a welcome sight. For here was a great bedroom well -lighted and warmed with another log fire, also added to but lately, -for the top logs were fresh, which sent a hollow roar up the wide -chimney. The Count himself left my luggage inside and withdrew, -saying, before he closed the door. - -"You will need, after your journey, to refresh yourself by making your -toilet. I trust you will find all you wish. When you are ready, come -into the other room, where you will find your supper prepared." - -The light and warmth and the Count's courteous welcome seemed to have -dissipated all my doubts and fears. Having then reached my normal -state, I discovered that I was half famished with hunger. So making a -hasty toilet, I went into the other room. - -I found supper already laid out. My host, who stood on one side of -the great fireplace, leaning against the stonework, made a graceful -wave of his hand to the table, and said, - -"I pray you, be seated and sup how you please. You will I trust, -excuse me that I do not join you, but I have dined already, and I do -not sup." - -I handed to him the sealed letter which Mr. Hawkins had entrusted to -me. He opened it and read it gravely. Then, with a charming smile, -he handed it to me to read. One passage of it, at least, gave me a -thrill of pleasure. - -"I must regret that an attack of gout, from which malady I am a -constant sufferer, forbids absolutely any travelling on my part for -some time to come. But I am happy to say I can send a sufficient -substitute, one in whom I have every possible confidence. He is a -young man, full of energy and talent in his own way, and of a very -faithful disposition. He is discreet and silent, and has grown into -manhood in my service. He shall be ready to attend on you when you -will during his stay, and shall take your instructions in all -matters." - -The count himself came forward and took off the cover of a dish, and I -fell to at once on an excellent roast chicken. This, with some cheese -and a salad and a bottle of old tokay, of which I had two glasses, was -my supper. During the time I was eating it the Count asked me many -questions as to my journey, and I told him by degrees all I had -experienced. - -By this time I had finished my supper, and by my host's desire had -drawn up a chair by the fire and begun to smoke a cigar which he -offered me, at the same time excusing himself that he did not smoke. -I had now an opportunity of observing him, and found him of a very -marked physiognomy. - -His face was a strong, a very strong, aquiline, with high bridge of -the thin nose and peculiarly arched nostrils, with lofty domed -forehead, and hair growing scantily round the temples but profusely -elsewhere. His eyebrows were very massive, almost meeting over the -nose, and with bushy hair that seemed to curl in its own profusion. -The mouth, so far as I could see it under the heavy moustache, was -fixed and rather cruel-looking, with peculiarly sharp white teeth. -These protruded over the lips, whose remarkable ruddiness showed -astonishing vitality in a man of his years. For the rest, his ears -were pale, and at the tops extremely pointed. The chin was broad and -strong, and the cheeks firm though thin. The general effect was one -of extraordinary pallor. - -Hitherto I had noticed the backs of his hands as they lay on his knees -in the firelight, and they had seemed rather white and fine. But -seeing them now close to me, I could not but notice that they were -rather coarse, broad, with squat fingers. Strange to say, there were -hairs in the centre of the palm. The nails were long and fine, and -cut to a sharp point. As the Count leaned over me and his hands -touched me, I could not repress a shudder. It may have been that his -breath was rank, but a horrible feeling of nausea came over me, which, -do what I would, I could not conceal. - -The Count, evidently noticing it, drew back. And with a grim sort of -smile, which showed more than he had yet done his protruberant teeth, -sat himself down again on his own side of the fireplace. We were both -silent for a while, and as I looked towards the window I saw the first -dim streak of the coming dawn. There seemed a strange stillness over -everything. But as I listened, I heard as if from down below in the -valley the howling of many wolves. The Count's eyes gleamed, and he -said. - -"Listen to them, the children of the night. What music they make!" -Seeing, I suppose, some expression in my face strange to him, he -added, "Ah, sir, you dwellers in the city cannot enter into the -feelings of the hunter." Then he rose and said. - -"But you must be tired. Your bedroom is all ready, and tomorrow you -shall sleep as late as you will. I have to be away till the -afternoon, so sleep well and dream well!" With a courteous bow, he -opened for me himself the door to the octagonal room, and I entered my -bedroom. - -I am all in a sea of wonders. I doubt. I fear. I think strange -things, which I dare not confess to my own soul. God keep me, if only -for the sake of those dear to me! - - -7 May.--It is again early morning, but I have rested and enjoyed the -last twenty-four hours. I slept till late in the day, and awoke of my -own accord. When I had dressed myself I went into the room where we -had supped, and found a cold breakfast laid out, with coffee kept hot -by the pot being placed on the hearth. There was a card on the table, -on which was written--"I have to be absent for a while. Do not wait -for me. D." I set to and enjoyed a hearty meal. When I had done, I -looked for a bell, so that I might let the servants know I had -finished, but I could not find one. There are certainly odd -deficiencies in the house, considering the extraordinary evidences of -wealth which are round me. The table service is of gold, and so -beautifully wrought that it must be of immense value. The curtains -and upholstery of the chairs and sofas and the hangings of my bed are -of the costliest and most beautiful fabrics, and must have been of -fabulous value when they were made, for they are centuries old, though -in excellent order. I saw something like them in Hampton Court, but -they were worn and frayed and moth-eaten. But still in none of the -rooms is there a mirror. There is not even a toilet glass on my -table, and I had to get the little shaving glass from my bag before I -could either shave or brush my hair. I have not yet seen a servant -anywhere, or heard a sound near the castle except the howling of -wolves. Some time after I had finished my meal, I do not know whether -to call it breakfast or dinner, for it was between five and six -o'clock when I had it, I looked about for something to read, for I did -not like to go about the castle until I had asked the Count's -permission. There was absolutely nothing in the room, book, -newspaper, or even writing materials, so I opened another door in the -room and found a sort of library. The door opposite mine I tried, but -found locked. - -In the library I found, to my great delight, a vast number of English -books, whole shelves full of them, and bound volumes of magazines and -newspapers. A table in the centre was littered with English magazines -and newspapers, though none of them were of very recent date. The -books were of the most varied kind, history, geography, politics, -political economy, botany, geology, law, all relating to England and -English life and customs and manners. There were even such books of -reference as the London Directory, the "Red" and "Blue" books, -Whitaker's Almanac, the Army and Navy Lists, and it somehow gladdened -my heart to see it, the Law List. - -Whilst I was looking at the books, the door opened, and the Count -entered. He saluted me in a hearty way, and hoped that I had had a -good night's rest. Then he went on. - -"I am glad you found your way in here, for I am sure there is much -that will interest you. These companions," and he laid his hand on -some of the books, "have been good friends to me, and for some years -past, ever since I had the idea of going to London, have given me -many, many hours of pleasure. Through them I have come to know your -great England, and to know her is to love her. I long to go through -the crowded streets of your mighty London, to be in the midst of the -whirl and rush of humanity, to share its life, its change, its death, -and all that makes it what it is. But alas! As yet I only know your -tongue through books. To you, my friend, I look that I know it to -speak." - -"But, Count," I said, "You know and speak English thoroughly!" He -bowed gravely. - -"I thank you, my friend, for your all too-flattering estimate, but yet -I fear that I am but a little way on the road I would travel. True, I -know the grammar and the words, but yet I know not how to speak them." - -"Indeed," I said, "You speak excellently." - -"Not so," he answered. "Well, I know that, did I move and speak in -your London, none there are who would not know me for a stranger. That -is not enough for me. Here I am noble. I am a Boyar. The common -people know me, and I am master. But a stranger in a strange land, he -is no one. Men know him not, and to know not is to care not for. I -am content if I am like the rest, so that no man stops if he sees me, -or pauses in his speaking if he hears my words, 'Ha, ha! A stranger!' -I have been so long master that I would be master still, or at least -that none other should be master of me. You come to me not alone as -agent of my friend Peter Hawkins, of Exeter, to tell me all about my -new estate in London. You shall, I trust, rest here with me a while, -so that by our talking I may learn the English intonation. And I -would that you tell me when I make error, even of the smallest, in my -speaking. I am sorry that I had to be away so long today, but you -will, I know forgive one who has so many important affairs in hand." - -Of course I said all I could about being willing, and asked if I might -come into that room when I chose. He answered, "Yes, certainly," and -added. - -"You may go anywhere you wish in the castle, except where the doors -are locked, where of course you will not wish to go. There is reason -that all things are as they are, and did you see with my eyes and know -with my knowledge, you would perhaps better understand." I said I was -sure of this, and then he went on. - -"We are in Transylvania, and Transylvania is not England. Our ways -are not your ways, and there shall be to you many strange things. Nay, -from what you have told me of your experiences already, you know -something of what strange things there may be." - -This led to much conversation, and as it was evident that he wanted to -talk, if only for talking's sake, I asked him many questions regarding -things that had already happened to me or come within my notice. -Sometimes he sheered off the subject, or turned the conversation by -pretending not to understand, but generally he answered all I asked -most frankly. Then as time went on, and I had got somewhat bolder, I -asked him of some of the strange things of the preceding night, as for -instance, why the coachman went to the places where he had seen the -blue flames. He then explained to me that it was commonly believed -that on a certain night of the year, last night, in fact, when all -evil spirits are supposed to have unchecked sway, a blue flame is seen -over any place where treasure has been concealed. - -"That treasure has been hidden," he went on, "in the region through -which you came last night, there can be but little doubt. For it was -the ground fought over for centuries by the Wallachian, the Saxon, and -the Turk. Why, there is hardly a foot of soil in all this region that -has not been enriched by the blood of men, patriots or invaders. In -the old days there were stirring times, when the Austrian and the -Hungarian came up in hordes, and the patriots went out to meet them, -men and women, the aged and the children too, and waited their coming -on the rocks above the passes, that they might sweep destruction on -them with their artificial avalanches. When the invader was -triumphant he found but little, for whatever there was had been -sheltered in the friendly soil." - -"But how," said I, "can it have remained so long undiscovered, when -there is a sure index to it if men will but take the trouble to look?" -The Count smiled, and as his lips ran back over his gums, the long, -sharp, canine teeth showed out strangely. He answered: - -"Because your peasant is at heart a coward and a fool! Those flames -only appear on one night, and on that night no man of this land will, -if he can help it, stir without his doors. And, dear sir, even if he -did he would not know what to do. Why, even the peasant that you tell -me of who marked the place of the flame would not know where to look -in daylight even for his own work. Even you would not, I dare be -sworn, be able to find these places again?" - -"There you are right," I said. "I know no more than the dead where -even to look for them." Then we drifted into other matters. - -"Come," he said at last, "tell me of London and of the house which you -have procured for me." With an apology for my remissness, I went into -my own room to get the papers from my bag. Whilst I was placing them -in order I heard a rattling of china and silver in the next room, and -as I passed through, noticed that the table had been cleared and the -lamp lit, for it was by this time deep into the dark. The lamps were -also lit in the study or library, and I found the Count lying on the -sofa, reading, of all things in the world, an English Bradshaw's -Guide. When I came in he cleared the books and papers from the table, -and with him I went into plans and deeds and figures of all sorts. He -was interested in everything, and asked me a myriad questions about -the place and its surroundings. He clearly had studied beforehand all -he could get on the subject of the neighbourhood, for he evidently at -the end knew very much more than I did. When I remarked this, he -answered. - -"Well, but, my friend, is it not needful that I should? When I go -there I shall be all alone, and my friend Harker Jonathan, nay, pardon -me. I fall into my country's habit of putting your patronymic first, -my friend Jonathan Harker will not be by my side to correct and aid -me. He will be in Exeter, miles away, probably working at papers of -the law with my other friend, Peter Hawkins. So!" - -We went thoroughly into the business of the purchase of the estate at -Purfleet. When I had told him the facts and got his signature to the -necessary papers, and had written a letter with them ready to post to -Mr. Hawkins, he began to ask me how I had come across so suitable a -place. I read to him the notes which I had made at the time, and -which I inscribe here. - -"At Purfleet, on a byroad, I came across just such a place as seemed -to be required, and where was displayed a dilapidated notice that the -place was for sale. It was surrounded by a high wall, of ancient -structure, built of heavy stones, and has not been repaired for a -large number of years. The closed gates are of heavy old oak and -iron, all eaten with rust. - -"The estate is called Carfax, no doubt a corruption of the old Quatre -Face, as the house is four sided, agreeing with the cardinal points of -the compass. It contains in all some twenty acres, quite surrounded -by the solid stone wall above mentioned. There are many trees on it, -which make it in places gloomy, and there is a deep, dark-looking pond -or small lake, evidently fed by some springs, as the water is clear -and flows away in a fair-sized stream. The house is very large and of -all periods back, I should say, to mediaeval times, for one part is of -stone immensely thick, with only a few windows high up and heavily -barred with iron. It looks like part of a keep, and is close to an -old chapel or church. I could not enter it, as I had not the key of -the door leading to it from the house, but I have taken with my Kodak -views of it from various points. The house had been added to, but in -a very straggling way, and I can only guess at the amount of ground it -covers, which must be very great. There are but few houses close at -hand, one being a very large house only recently added to and formed -into a private lunatic asylum. It is not, however, visible from the -grounds." - -When I had finished, he said, "I am glad that it is old and big. I -myself am of an old family, and to live in a new house would kill me. -A house cannot be made habitable in a day, and after all, how few days -go to make up a century. I rejoice also that there is a chapel of old -times. We Transylvanian nobles love not to think that our bones may -lie amongst the common dead. I seek not gaiety nor mirth, not the -bright voluptuousness of much sunshine and sparkling waters which -please the young and gay. I am no longer young, and my heart, through -weary years of mourning over the dead, is not attuned to mirth. Moreover, -the walls of my castle are broken. The shadows are many, and the wind -breathes cold through the broken battlements and casements. I love -the shade and the shadow, and would be alone with my thoughts when I -may." Somehow his words and his look did not seem to accord, or else -it was that his cast of face made his smile look malignant and -saturnine. - -Presently, with an excuse, he left me, asking me to pull my papers -together. He was some little time away, and I began to look at some -of the books around me. One was an atlas, which I found opened -naturally to England, as if that map had been much used. On looking -at it I found in certain places little rings marked, and on examining -these I noticed that one was near London on the east side, manifestly -where his new estate was situated. The other two were Exeter, and -Whitby on the Yorkshire coast. - -It was the better part of an hour when the Count returned. "Aha!" he -said. "Still at your books? Good! But you must not work always. -Come! I am informed that your supper is ready." He took my arm, and -we went into the next room, where I found an excellent supper ready on -the table. The Count again excused himself, as he had dined out on -his being away from home. But he sat as on the previous night, and -chatted whilst I ate. After supper I smoked, as on the last evening, -and the Count stayed with me, chatting and asking questions on every -conceivable subject, hour after hour. I felt that it was getting very -late indeed, but I did not say anything, for I felt under obligation -to meet my host's wishes in every way. I was not sleepy, as the long -sleep yesterday had fortified me, but I could not help experiencing -that chill which comes over one at the coming of the dawn, which is -like, in its way, the turn of the tide. They say that people who are -near death die generally at the change to dawn or at the turn of the -tide. Anyone who has when tired, and tied as it were to his post, -experienced this change in the atmosphere can well believe it. All at -once we heard the crow of the cock coming up with preternatural -shrillness through the clear morning air. - -Count Dracula, jumping to his feet, said, "Why there is the morning -again! How remiss I am to let you stay up so long. You must make -your conversation regarding my dear new country of England less -interesting, so that I may not forget how time flies by us," and with -a courtly bow, he quickly left me. - -I went into my room and drew the curtains, but there was little to -notice. My window opened into the courtyard, all I could see was the -warm grey of quickening sky. So I pulled the curtains again, and have -written of this day. - - -8 May.--I began to fear as I wrote in this book that I was getting too -diffuse. But now I am glad that I went into detail from the first, -for there is something so strange about this place and all in it that -I cannot but feel uneasy. I wish I were safe out of it, or that I had -never come. It may be that this strange night existence is telling on -me, but would that that were all! If there were any one to talk to I -could bear it, but there is no one. I have only the Count to speak -with, and he--I fear I am myself the only living soul within the -place. Let me be prosaic so far as facts can be. It will help me to -bear up, and imagination must not run riot with me. If it does I am -lost. Let me say at once how I stand, or seem to. - -I only slept a few hours when I went to bed, and feeling that I could -not sleep any more, got up. I had hung my shaving glass by the -window, and was just beginning to shave. Suddenly I felt a hand on my -shoulder, and heard the Count's voice saying to me, "Good morning." I -started, for it amazed me that I had not seen him, since the -reflection of the glass covered the whole room behind me. In starting -I had cut myself slightly, but did not notice it at the moment. Having -answered the Count's salutation, I turned to the glass again to see -how I had been mistaken. This time there could be no error, for the -man was close to me, and I could see him over my shoulder. But there -was no reflection of him in the mirror! The whole room behind me was -displayed, but there was no sign of a man in it, except myself. - -This was startling, and coming on the top of so many strange things, -was beginning to increase that vague feeling of uneasiness which I -always have when the Count is near. But at the instant I saw that the -cut had bled a little, and the blood was trickling over my chin. I -laid down the razor, turning as I did so half round to look for some -sticking plaster. When the Count saw my face, his eyes blazed with a -sort of demoniac fury, and he suddenly made a grab at my throat. I -drew away and his hand touched the string of beads which held the -crucifix. It made an instant change in him, for the fury passed so -quickly that I could hardly believe that it was ever there. - -"Take care," he said, "take care how you cut yourself. It is more -dangerous that you think in this country." Then seizing the shaving -glass, he went on, "And this is the wretched thing that has done the -mischief. It is a foul bauble of man's vanity. Away with it!" And -opening the window with one wrench of his terrible hand, he flung out -the glass, which was shattered into a thousand pieces on the stones of -the courtyard far below. Then he withdrew without a word. It is very -annoying, for I do not see how I am to shave, unless in my watch-case -or the bottom of the shaving pot, which is fortunately of metal. - -When I went into the dining room, breakfast was prepared, but I could -not find the Count anywhere. So I breakfasted alone. It is strange -that as yet I have not seen the Count eat or drink. He must be a very -peculiar man! After breakfast I did a little exploring in the -castle. I went out on the stairs, and found a room looking towards -the South. - -The view was magnificent, and from where I stood there was every -opportunity of seeing it. The castle is on the very edge of a -terrific precipice. A stone falling from the window would fall a -thousand feet without touching anything! As far as the eye can reach -is a sea of green tree tops, with occasionally a deep rift where there -is a chasm. Here and there are silver threads where the rivers wind -in deep gorges through the forests. - -But I am not in heart to describe beauty, for when I had seen the view -I explored further. Doors, doors, doors everywhere, and all locked -and bolted. In no place save from the windows in the castle walls is -there an available exit. The castle is a veritable prison, and I am a -prisoner! - - - - -CHAPTER 3 - - -Jonathan Harker's Journal Continued - -When I found that I was a prisoner a sort of wild feeling came over -me. I rushed up and down the stairs, trying every door and peering -out of every window I could find, but after a little the conviction of -my helplessness overpowered all other feelings. When I look back -after a few hours I think I must have been mad for the time, for I -behaved much as a rat does in a trap. When, however, the conviction -had come to me that I was helpless I sat down quietly, as quietly as I -have ever done anything in my life, and began to think over what was -best to be done. I am thinking still, and as yet have come to no -definite conclusion. Of one thing only am I certain. That it is no -use making my ideas known to the Count. He knows well that I am -imprisoned, and as he has done it himself, and has doubtless his own -motives for it, he would only deceive me if I trusted him fully with -the facts. So far as I can see, my only plan will be to keep my -knowledge and my fears to myself, and my eyes open. I am, I know, -either being deceived, like a baby, by my own fears, or else I am in -desperate straits, and if the latter be so, I need, and shall need, -all my brains to get through. - -I had hardly come to this conclusion when I heard the great door below -shut, and knew that the Count had returned. He did not come at once -into the library, so I went cautiously to my own room and found him -making the bed. This was odd, but only confirmed what I had all along -thought, that there are no servants in the house. When later I saw -him through the chink of the hinges of the door laying the table in -the dining room, I was assured of it. For if he does himself all -these menial offices, surely it is proof that there is no one else in -the castle, it must have been the Count himself who was the driver of -the coach that brought me here. This is a terrible thought, for if -so, what does it mean that he could control the wolves, as he did, by -only holding up his hand for silence? How was it that all the people -at Bistritz and on the coach had some terrible fear for me? What -meant the giving of the crucifix, of the garlic, of the wild rose, of -the mountain ash? - -Bless that good, good woman who hung the crucifix round my neck! For -it is a comfort and a strength to me whenever I touch it. It is odd -that a thing which I have been taught to regard with disfavour and as -idolatrous should in a time of loneliness and trouble be of help. Is -it that there is something in the essence of the thing itself, or that -it is a medium, a tangible help, in conveying memories of sympathy and -comfort? Some time, if it may be, I must examine this matter and try -to make up my mind about it. In the meantime I must find out all I -can about Count Dracula, as it may help me to understand. Tonight he -may talk of himself, if I turn the conversation that way. I must be -very careful, however, not to awake his suspicion. - - -Midnight.--I have had a long talk with the Count. I asked him a few -questions on Transylvania history, and he warmed up to the subject -wonderfully. In his speaking of things and people, and especially of -battles, he spoke as if he had been present at them all. This he -afterwards explained by saying that to a Boyar the pride of his house -and name is his own pride, that their glory is his glory, that their -fate is his fate. Whenever he spoke of his house he always said "we", -and spoke almost in the plural, like a king speaking. I wish I could -put down all he said exactly as he said it, for to me it was most -fascinating. It seemed to have in it a whole history of the country. -He grew excited as he spoke, and walked about the room pulling his -great white moustache and grasping anything on which he laid his hands -as though he would crush it by main strength. One thing he said which -I shall put down as nearly as I can, for it tells in its way the story -of his race. - -"We Szekelys have a right to be proud, for in our veins flows the -blood of many brave races who fought as the lion fights, for lordship. -Here, in the whirlpool of European races, the Ugric tribe bore down -from Iceland the fighting spirit which Thor and Wodin gave them, which -their Berserkers displayed to such fell intent on the seaboards of -Europe, aye, and of Asia and Africa too, till the peoples thought that -the werewolves themselves had come. Here, too, when they came, they -found the Huns, whose warlike fury had swept the earth like a living -flame, till the dying peoples held that in their veins ran the blood -of those old witches, who, expelled from Scythia had mated with the -devils in the desert. Fools, fools! What devil or what witch was -ever so great as Attila, whose blood is in these veins?" He held up -his arms. "Is it a wonder that we were a conquering race, that we -were proud, that when the Magyar, the Lombard, the Avar, the Bulgar, -or the Turk poured his thousands on our frontiers, we drove them back? -Is it strange that when Arpad and his legions swept through the -Hungarian fatherland he found us here when he reached the frontier, -that the Honfoglalas was completed there? And when the Hungarian -flood swept eastward, the Szekelys were claimed as kindred by the -victorious Magyars, and to us for centuries was trusted the guarding -of the frontier of Turkeyland. Aye, and more than that, endless duty -of the frontier guard, for as the Turks say, 'water sleeps, and the -enemy is sleepless.' Who more gladly than we throughout the Four -Nations received the 'bloody sword,' or at its warlike call flocked -quicker to the standard of the King? When was redeemed that great -shame of my nation, the shame of Cassova, when the flags of the -Wallach and the Magyar went down beneath the Crescent? Who was it but -one of my own race who as Voivode crossed the Danube and beat the Turk -on his own ground? This was a Dracula indeed! Woe was it that his -own unworthy brother, when he had fallen, sold his people to the Turk -and brought the shame of slavery on them! Was it not this Dracula, -indeed, who inspired that other of his race who in a later age again -and again brought his forces over the great river into Turkeyland, -who, when he was beaten back, came again, and again, though he had to -come alone from the bloody field where his troops were being -slaughtered, since he knew that he alone could ultimately triumph! -They said that he thought only of himself. Bah! What good are -peasants without a leader? Where ends the war without a brain and -heart to conduct it? Again, when, after the battle of Mohacs, we -threw off the Hungarian yoke, we of the Dracula blood were amongst -their leaders, for our spirit would not brook that we were not free. -Ah, young sir, the Szekelys, and the Dracula as their heart's blood, -their brains, and their swords, can boast a record that mushroom -growths like the Hapsburgs and the Romanoffs can never reach. The -warlike days are over. Blood is too precious a thing in these days of -dishonourable peace, and the glories of the great races are as a tale -that is told." - -It was by this time close on morning, and we went to bed. (Mem., this -diary seems horribly like the beginning of the "Arabian Nights," for -everything has to break off at cockcrow, or like the ghost of Hamlet's -father.) - - -12 May.--Let me begin with facts, bare, meager facts, verified by -books and figures, and of which there can be no doubt. I must not -confuse them with experiences which will have to rest on my own -observation, or my memory of them. Last evening when the Count came -from his room he began by asking me questions on legal matters and on -the doing of certain kinds of business. I had spent the day wearily -over books, and, simply to keep my mind occupied, went over some of -the matters I had been examined in at Lincoln's Inn. There was a -certain method in the Count's inquiries, so I shall try to put them -down in sequence. The knowledge may somehow or some time be useful to -me. - -First, he asked if a man in England might have two solicitors or more. -I told him he might have a dozen if he wished, but that it would not -be wise to have more than one solicitor engaged in one transaction, as -only one could act at a time, and that to change would be certain to -militate against his interest. He seemed thoroughly to understand, -and went on to ask if there would be any practical difficulty in having -one man to attend, say, to banking, and another to look after -shipping, in case local help were needed in a place far from the home -of the banking solicitor. I asked to explain more fully, so that I -might not by any chance mislead him, so he said, - -"I shall illustrate. Your friend and mine, Mr. Peter Hawkins, from -under the shadow of your beautiful cathedral at Exeter, which is far -from London, buys for me through your good self my place at London. -Good! Now here let me say frankly, lest you should think it strange -that I have sought the services of one so far off from London instead -of some one resident there, that my motive was that no local interest -might be served save my wish only, and as one of London residence -might, perhaps, have some purpose of himself or friend to serve, I -went thus afield to seek my agent, whose labours should be only to my -interest. Now, suppose I, who have much of affairs, wish to ship -goods, say, to Newcastle, or Durham, or Harwich, or Dover, might it -not be that it could with more ease be done by consigning to one in -these ports?" - -I answered that certainly it would be most easy, but that we -solicitors had a system of agency one for the other, so that local -work could be done locally on instruction from any solicitor, so that -the client, simply placing himself in the hands of one man, could have -his wishes carried out by him without further trouble. - -"But," said he, "I could be at liberty to direct myself. Is it not -so?" - -"Of course," I replied, and "Such is often done by men of business, -who do not like the whole of their affairs to be known by any one -person." - -"Good!" he said, and then went on to ask about the means of making -consignments and the forms to be gone through, and of all sorts of -difficulties which might arise, but by forethought could be guarded -against. I explained all these things to him to the best of my -ability, and he certainly left me under the impression that he would -have made a wonderful solicitor, for there was nothing that he did not -think of or foresee. For a man who was never in the country, and who -did not evidently do much in the way of business, his knowledge and -acumen were wonderful. When he had satisfied himself on these points -of which he had spoken, and I had verified all as well as I could by -the books available, he suddenly stood up and said, "Have you written -since your first letter to our friend Mr. Peter Hawkins, or to any -other?" - -It was with some bitterness in my heart that I answered that I had -not, that as yet I had not seen any opportunity of sending letters to -anybody. - -"Then write now, my young friend," he said, laying a heavy hand on my -shoulder, "write to our friend and to any other, and say, if it will -please you, that you shall stay with me until a month from now." - -"Do you wish me to stay so long?" I asked, for my heart grew cold at -the thought. - -"I desire it much, nay I will take no refusal. When your master, -employer, what you will, engaged that someone should come on his -behalf, it was understood that my needs only were to be consulted. I -have not stinted. Is it not so?" - -What could I do but bow acceptance? It was Mr. Hawkins' interest, not -mine, and I had to think of him, not myself, and besides, while Count -Dracula was speaking, there was that in his eyes and in his bearing -which made me remember that I was a prisoner, and that if I wished it -I could have no choice. The Count saw his victory in my bow, and his -mastery in the trouble of my face, for he began at once to use them, -but in his own smooth, resistless way. - -"I pray you, my good young friend, that you will not discourse of -things other than business in your letters. It will doubtless please -your friends to know that you are well, and that you look forward to -getting home to them. Is it not so?" As he spoke he handed me three -sheets of note paper and three envelopes. They were all of the -thinnest foreign post, and looking at them, then at him, and noticing -his quiet smile, with the sharp, canine teeth lying over the red -underlip, I understood as well as if he had spoken that I should be -more careful what I wrote, for he would be able to read it. So I -determined to write only formal notes now, but to write fully to Mr. -Hawkins in secret, and also to Mina, for to her I could write -shorthand, which would puzzle the Count, if he did see it. When I had -written my two letters I sat quiet, reading a book whilst the Count -wrote several notes, referring as he wrote them to some books on his -table. Then he took up my two and placed them with his own, and put -by his writing materials, after which, the instant the door had closed -behind him, I leaned over and looked at the letters, which were face -down on the table. I felt no compunction in doing so for under the -circumstances I felt that I should protect myself in every way I -could. - -One of the letters was directed to Samuel F. Billington, No. 7, The -Crescent, Whitby, another to Herr Leutner, Varna. The third was to -Coutts & Co., London, and the fourth to Herren Klopstock & Billreuth, -bankers, Buda Pesth. The second and fourth were unsealed. I was just -about to look at them when I saw the door handle move. I sank back in -my seat, having just had time to resume my book before the Count, -holding still another letter in his hand, entered the room. He took -up the letters on the table and stamped them carefully, and then -turning to me, said, - -"I trust you will forgive me, but I have much work to do in private -this evening. You will, I hope, find all things as you wish." At the -door he turned, and after a moment's pause said, "Let me advise you, -my dear young friend. Nay, let me warn you with all seriousness, that -should you leave these rooms you will not by any chance go to sleep in -any other part of the castle. It is old, and has many memories, and -there are bad dreams for those who sleep unwisely. Be warned! Should -sleep now or ever overcome you, or be like to do, then haste to your -own chamber or to these rooms, for your rest will then be safe. But -if you be not careful in this respect, then," He finished his speech -in a gruesome way, for he motioned with his hands as if he were washing -them. I quite understood. My only doubt was as to whether any dream -could be more terrible than the unnatural, horrible net of gloom and -mystery which seemed closing around me. - - -Later.--I endorse the last words written, but this time there is no -doubt in question. I shall not fear to sleep in any place where he is -not. I have placed the crucifix over the head of my bed, I imagine -that my rest is thus freer from dreams, and there it shall remain. - -When he left me I went to my room. After a little while, not hearing -any sound, I came out and went up the stone stair to where I could -look out towards the South. There was some sense of freedom in the -vast expanse, inaccessible though it was to me, as compared with the -narrow darkness of the courtyard. Looking out on this, I felt that I -was indeed in prison, and I seemed to want a breath of fresh air, -though it were of the night. I am beginning to feel this nocturnal -existence tell on me. It is destroying my nerve. I start at my own -shadow, and am full of all sorts of horrible imaginings. God knows -that there is ground for my terrible fear in this accursed place! I -looked out over the beautiful expanse, bathed in soft yellow moonlight -till it was almost as light as day. In the soft light the distant -hills became melted, and the shadows in the valleys and gorges of -velvety blackness. The mere beauty seemed to cheer me. There was -peace and comfort in every breath I drew. As I leaned from the window -my eye was caught by something moving a storey below me, and somewhat -to my left, where I imagined, from the order of the rooms, that the -windows of the Count's own room would look out. The window at which I -stood was tall and deep, stone-mullioned, and though weatherworn, was -still complete. But it was evidently many a day since the case had -been there. I drew back behind the stonework, and looked carefully -out. - -What I saw was the Count's head coming out from the window. I did not -see the face, but I knew the man by the neck and the movement of his -back and arms. In any case I could not mistake the hands which I had -had some many opportunities of studying. I was at first interested -and somewhat amused, for it is wonderful how small a matter will -interest and amuse a man when he is a prisoner. But my very feelings -changed to repulsion and terror when I saw the whole man slowly emerge -from the window and begin to crawl down the castle wall over the -dreadful abyss, face down with his cloak spreading out around him like -great wings. At first I could not believe my eyes. I thought it was -some trick of the moonlight, some weird effect of shadow, but I kept -looking, and it could be no delusion. I saw the fingers and toes -grasp the corners of the stones, worn clear of the mortar by the -stress of years, and by thus using every projection and inequality -move downwards with considerable speed, just as a lizard moves along a -wall. - -What manner of man is this, or what manner of creature, is it in the -semblance of man? I feel the dread of this horrible place -overpowering me. I am in fear, in awful fear, and there is no escape -for me. I am encompassed about with terrors that I dare not think of. - - -15 May.--Once more I have seen the count go out in his lizard fashion. -He moved downwards in a sidelong way, some hundred feet down, and a -good deal to the left. He vanished into some hole or window. When -his head had disappeared, I leaned out to try and see more, but -without avail. The distance was too great to allow a proper angle of -sight. I knew he had left the castle now, and thought to use the -opportunity to explore more than I had dared to do as yet. I went -back to the room, and taking a lamp, tried all the doors. They were -all locked, as I had expected, and the locks were comparatively new. -But I went down the stone stairs to the hall where I had entered -originally. I found I could pull back the bolts easily enough and -unhook the great chains. But the door was locked, and the key was -gone! That key must be in the Count's room. I must watch should his -door be unlocked, so that I may get it and escape. I went on to make -a thorough examination of the various stairs and passages, and to try -the doors that opened from them. One or two small rooms near the hall -were open, but there was nothing to see in them except old furniture, -dusty with age and moth-eaten. At last, however, I found one door at -the top of the stairway which, though it seemed locked, gave a little -under pressure. I tried it harder, and found that it was not really -locked, but that the resistance came from the fact that the hinges had -fallen somewhat, and the heavy door rested on the floor. Here was an -opportunity which I might not have again, so I exerted myself, and -with many efforts forced it back so that I could enter. I was now in -a wing of the castle further to the right than the rooms I knew and a -storey lower down. From the windows I could see that the suite of -rooms lay along to the south of the castle, the windows of the end -room looking out both west and south. On the latter side, as well as -to the former, there was a great precipice. The castle was built on -the corner of a great rock, so that on three sides it was quite -impregnable, and great windows were placed here where sling, or bow, -or culverin could not reach, and consequently light and comfort, -impossible to a position which had to be guarded, were secured. To -the west was a great valley, and then, rising far away, great jagged -mountain fastnesses, rising peak on peak, the sheer rock studded with -mountain ash and thorn, whose roots clung in cracks and crevices and -crannies of the stone. This was evidently the portion of the castle -occupied by the ladies in bygone days, for the furniture had more an -air of comfort than any I had seen. - -The windows were curtainless, and the yellow moonlight, flooding in -through the diamond panes, enabled one to see even colours, whilst it -softened the wealth of dust which lay over all and disguised in some -measure the ravages of time and moth. My lamp seemed to be of little -effect in the brilliant moonlight, but I was glad to have it with me, -for there was a dread loneliness in the place which chilled my heart -and made my nerves tremble. Still, it was better than living alone in -the rooms which I had come to hate from the presence of the Count, and -after trying a little to school my nerves, I found a soft quietude -come over me. Here I am, sitting at a little oak table where in old -times possibly some fair lady sat to pen, with much thought and many -blushes, her ill-spelt love letter, and writing in my diary in -shorthand all that has happened since I closed it last. It is the -nineteenth century up-to-date with a vengeance. And yet, unless my -senses deceive me, the old centuries had, and have, powers of their -own which mere "modernity" cannot kill. - - -Later: The morning of 16 May.--God preserve my sanity, for to this I -am reduced. Safety and the assurance of safety are things of the -past. Whilst I live on here there is but one thing to hope for, that -I may not go mad, if, indeed, I be not mad already. If I be sane, -then surely it is maddening to think that of all the foul things that -lurk in this hateful place the Count is the least dreadful to me, that -to him alone I can look for safety, even though this be only whilst I -can serve his purpose. Great God! Merciful God, let me be calm, for -out of that way lies madness indeed. I begin to get new lights on -certain things which have puzzled me. Up to now I never quite knew -what Shakespeare meant when he made Hamlet say, "My tablets! Quick, -my tablets! 'tis meet that I put it down," etc., For now, feeling as -though my own brain were unhinged or as if the shock had come which -must end in its undoing, I turn to my diary for repose. The habit of -entering accurately must help to soothe me. - -The Count's mysterious warning frightened me at the time. It frightens -me more not when I think of it, for in the future he has a fearful -hold upon me. I shall fear to doubt what he may say! - -When I had written in my diary and had fortunately replaced the book -and pen in my pocket I felt sleepy. The Count's warning came into my -mind, but I took pleasure in disobeying it. The sense of sleep was -upon me, and with it the obstinacy which sleep brings as outrider. The -soft moonlight soothed, and the wide expanse without gave a sense of -freedom which refreshed me. I determined not to return tonight to the -gloom-haunted rooms, but to sleep here, where, of old, ladies had sat -and sung and lived sweet lives whilst their gentle breasts were sad -for their menfolk away in the midst of remorseless wars. I drew a -great couch out of its place near the corner, so that as I lay, I -could look at the lovely view to east and south, and unthinking of and -uncaring for the dust, composed myself for sleep. I suppose I must -have fallen asleep. I hope so, but I fear, for all that followed was -startlingly real, so real that now sitting here in the broad, full -sunlight of the morning, I cannot in the least believe that it was all -sleep. - -I was not alone. The room was the same, unchanged in any way since I -came into it. I could see along the floor, in the brilliant -moonlight, my own footsteps marked where I had disturbed the long -accumulation of dust. In the moonlight opposite me were three young -women, ladies by their dress and manner. I thought at the time that I -must be dreaming when I saw them, they threw no shadow on the floor. -They came close to me, and looked at me for some time, and then -whispered together. Two were dark, and had high aquiline noses, like -the Count, and great dark, piercing eyes, that seemed to be almost red -when contrasted with the pale yellow moon. The other was fair, as -fair as can be, with great masses of golden hair and eyes like pale -sapphires. I seemed somehow to know her face, and to know it in -connection with some dreamy fear, but I could not recollect at the -moment how or where. All three had brilliant white teeth that shone -like pearls against the ruby of their voluptuous lips. There was -something about them that made me uneasy, some longing and at the same -time some deadly fear. I felt in my heart a wicked, burning desire -that they would kiss me with those red lips. It is not good to note -this down, lest some day it should meet Mina's eyes and cause her -pain, but it is the truth. They whispered together, and then they all -three laughed, such a silvery, musical laugh, but as hard as though -the sound never could have come through the softness of human lips. -It was like the intolerable, tingling sweetness of waterglasses when -played on by a cunning hand. The fair girl shook her head -coquettishly, and the other two urged her on. - -One said, "Go on! You are first, and we shall follow. Yours is the -right to begin." - -The other added, "He is young and strong. There are kisses for us -all." - -I lay quiet, looking out from under my eyelashes in an agony of -delightful anticipation. The fair girl advanced and bent over me till -I could feel the movement of her breath upon me. Sweet it was in one -sense, honey-sweet, and sent the same tingling through the nerves as -her voice, but with a bitter underlying the sweet, a bitter -offensiveness, as one smells in blood. - -I was afraid to raise my eyelids, but looked out and saw perfectly -under the lashes. The girl went on her knees, and bent over me, -simply gloating. There was a deliberate voluptuousness which was both -thrilling and repulsive, and as she arched her neck she actually -licked her lips like an animal, till I could see in the moonlight the -moisture shining on the scarlet lips and on the red tongue as it -lapped the white sharp teeth. Lower and lower went her head as the -lips went below the range of my mouth and chin and seemed to fasten on -my throat. Then she paused, and I could hear the churning sound of -her tongue as it licked her teeth and lips, and I could feel the hot -breath on my neck. Then the skin of my throat began to tingle as -one's flesh does when the hand that is to tickle it approaches nearer, -nearer. I could feel the soft, shivering touch of the lips on the -super sensitive skin of my throat, and the hard dents of two sharp -teeth, just touching and pausing there. I closed my eyes in -languorous ecstasy and waited, waited with beating heart. - -But at that instant, another sensation swept through me as quick as -lightning. I was conscious of the presence of the Count, and of his -being as if lapped in a storm of fury. As my eyes opened -involuntarily I saw his strong hand grasp the slender neck of the fair -woman and with giant's power draw it back, the blue eyes transformed -with fury, the white teeth champing with rage, and the fair cheeks -blazing red with passion. But the Count! Never did I imagine such -wrath and fury, even to the demons of the pit. His eyes were -positively blazing. The red light in them was lurid, as if the flames -of hell fire blazed behind them. His face was deathly pale, and the -lines of it were hard like drawn wires. The thick eyebrows that met -over the nose now seemed like a heaving bar of white-hot metal. With -a fierce sweep of his arm, he hurled the woman from him, and then -motioned to the others, as though he were beating them back. It was -the same imperious gesture that I had seen used to the wolves. In a -voice which, though low and almost in a whisper seemed to cut through -the air and then ring in the room he said, - -"How dare you touch him, any of you? How dare you cast eyes on him -when I had forbidden it? Back, I tell you all! This man belongs to -me! Beware how you meddle with him, or you'll have to deal with me." - -The fair girl, with a laugh of ribald coquetry, turned to answer him. -"You yourself never loved. You never love!" On this the other women -joined, and such a mirthless, hard, soulless laughter rang through the -room that it almost made me faint to hear. It seemed like the -pleasure of fiends. - -Then the Count turned, after looking at my face attentively, and said -in a soft whisper, "Yes, I too can love. You yourselves can tell it -from the past. Is it not so? Well, now I promise you that when I am -done with him you shall kiss him at your will. Now go! Go! I must -awaken him, for there is work to be done." - -"Are we to have nothing tonight?" said one of them, with a low laugh, -as she pointed to the bag which he had thrown upon the floor, and -which moved as though there were some living thing within it. For -answer he nodded his head. One of the women jumped forward and opened -it. If my ears did not deceive me there was a gasp and a low wail, as -of a half smothered child. The women closed round, whilst I was -aghast with horror. But as I looked, they disappeared, and with them -the dreadful bag. There was no door near them, and they could not -have passed me without my noticing. They simply seemed to fade into -the rays of the moonlight and pass out through the window, for I could -see outside the dim, shadowy forms for a moment before they entirely -faded away. - -Then the horror overcame me, and I sank down unconscious. - - - - -CHAPTER 4 - - -Jonathan Harker's Journal Continued - -I awoke in my own bed. If it be that I had not dreamt, the Count must -have carried me here. I tried to satisfy myself on the subject, but -could not arrive at any unquestionable result. To be sure, there were -certain small evidences, such as that my clothes were folded and laid -by in a manner which was not my habit. My watch was still unwound, -and I am rigorously accustomed to wind it the last thing before going -to bed, and many such details. But these things are no proof, for -they may have been evidences that my mind was not as usual, and, for -some cause or another, I had certainly been much upset. I must watch -for proof. Of one thing I am glad. If it was that the Count carried -me here and undressed me, he must have been hurried in his task, for -my pockets are intact. I am sure this diary would have been a mystery -to him which he would not have brooked. He would have taken or -destroyed it. As I look round this room, although it has been to me -so full of fear, it is now a sort of sanctuary, for nothing can be -more dreadful than those awful women, who were, who are, waiting to -suck my blood. - - -18 May.--I have been down to look at that room again in daylight, for -I must know the truth. When I got to the doorway at the top of the -stairs I found it closed. It had been so forcibly driven against the -jamb that part of the woodwork was splintered. I could see that the -bolt of the lock had not been shot, but the door is fastened from the -inside. I fear it was no dream, and must act on this surmise. - - -19 May.--I am surely in the toils. Last night the Count asked me in -the suavest tones to write three letters, one saying that my work here -was nearly done, and that I should start for home within a few days, -another that I was starting on the next morning from the time of the -letter, and the third that I had left the castle and arrived at -Bistritz. I would fain have rebelled, but felt that in the present -state of things it would be madness to quarrel openly with the Count -whilst I am so absolutely in his power. And to refuse would be to -excite his suspicion and to arouse his anger. He knows that I know -too much, and that I must not live, lest I be dangerous to him. My -only chance is to prolong my opportunities. Something may occur which -will give me a chance to escape. I saw in his eyes something of that -gathering wrath which was manifest when he hurled that fair woman from -him. He explained to me that posts were few and uncertain, and that -my writing now would ensure ease of mind to my friends. And he -assured me with so much impressiveness that he would countermand the -later letters, which would be held over at Bistritz until due time in -case chance would admit of my prolonging my stay, that to oppose him -would have been to create new suspicion. I therefore pretended to -fall in with his views, and asked him what dates I should put on the -letters. - -He calculated a minute, and then said, "The first should be June 12, -the second June 19, and the third June 29." - -I know now the span of my life. God help me! - - -28 May.--There is a chance of escape, or at any rate of being able to -send word home. A band of Szgany have come to the castle, and are -encamped in the courtyard. These are gipsies. I have notes of them -in my book. They are peculiar to this part of the world, though -allied to the ordinary gipsies all the world over. There are -thousands of them in Hungary and Transylvania, who are almost outside -all law. They attach themselves as a rule to some great noble or -boyar, and call themselves by his name. They are fearless and without -religion, save superstition, and they talk only their own varieties of -the Romany tongue. - -I shall write some letters home, and shall try to get them to have -them posted. I have already spoken to them through my window to begin -acquaintanceship. They took their hats off and made obeisance and -many signs, which however, I could not understand any more than I -could their spoken language . . . - -I have written the letters. Mina's is in shorthand, and I simply ask -Mr. Hawkins to communicate with her. To her I have explained my -situation, but without the horrors which I may only surmise. It would -shock and frighten her to death were I to expose my heart to her. -Should the letters not carry, then the Count shall not yet know my -secret or the extent of my knowledge. . . . - - -I have given the letters. I threw them through the bars of my window -with a gold piece, and made what signs I could to have them posted. -The man who took them pressed them to his heart and bowed, and then -put them in his cap. I could do no more. I stole back to the study, -and began to read. As the Count did not come in, I have written -here . . . - - -The Count has come. He sat down beside me, and said in his smoothest -voice as he opened two letters, "The Szgany has given me these, of -which, though I know not whence they come, I shall, of course, take -care. See!"--He must have looked at it.--"One is from you, and to my -friend Peter Hawkins. The other,"--here he caught sight of the -strange symbols as he opened the envelope, and the dark look came into -his face, and his eyes blazed wickedly,--"The other is a vile thing, -an outrage upon friendship and hospitality! It is not signed. Well! -So it cannot matter to us." And he calmly held letter and envelope in -the flame of the lamp till they were consumed. - -Then he went on, "The letter to Hawkins, that I shall, of course send -on, since it is yours. Your letters are sacred to me. Your pardon, -my friend, that unknowingly I did break the seal. Will you not cover -it again?" He held out the letter to me, and with a courteous bow -handed me a clean envelope. - -I could only redirect it and hand it to him in silence. When he went -out of the room I could hear the key turn softly. A minute later I -went over and tried it, and the door was locked. - -When, an hour or two after, the Count came quietly into the room, his -coming awakened me, for I had gone to sleep on the sofa. He was very -courteous and very cheery in his manner, and seeing that I had been -sleeping, he said, "So, my friend, you are tired? Get to bed. There -is the surest rest. I may not have the pleasure of talk tonight, -since there are many labours to me, but you will sleep, I pray." - -I passed to my room and went to bed, and, strange to say, slept -without dreaming. Despair has its own calms. - -31 May.--This morning when I woke I thought I would provide myself -with some papers and envelopes from my bag and keep them in my pocket, -so that I might write in case I should get an opportunity, but again a -surprise, again a shock! - -Every scrap of paper was gone, and with it all my notes, my memoranda, -relating to railways and travel, my letter of credit, in fact all that -might be useful to me were I once outside the castle. I sat and -pondered awhile, and then some thought occurred to me, and I made -search of my portmanteau and in the wardrobe where I had placed my -clothes. - -The suit in which I had travelled was gone, and also my overcoat and -rug. I could find no trace of them anywhere. This looked like some -new scheme of villainy . . . - - -17 June.--This morning, as I was sitting on the edge of my bed -cudgelling my brains, I heard without a crackling of whips and -pounding and scraping of horses' feet up the rocky path beyond the -courtyard. With joy I hurried to the window, and saw drive into the -yard two great leiter-wagons, each drawn by eight sturdy horses, and -at the head of each pair a Slovak, with his wide hat, great -nail-studded belt, dirty sheepskin, and high boots. They had also -their long staves in hand. I ran to the door, intending to descend -and try and join them through the main hall, as I thought that way -might be opened for them. Again a shock, my door was fastened on the -outside. - -Then I ran to the window and cried to them. They looked up at me -stupidly and pointed, but just then the "hetman" of the Szgany came -out, and seeing them pointing to my window, said something, at which -they laughed. - -Henceforth no effort of mine, no piteous cry or agonized entreaty, -would make them even look at me. They resolutely turned away. The -leiter-wagons contained great, square boxes, with handles of thick -rope. These were evidently empty by the ease with which the Slovaks -handled them, and by their resonance as they were roughly moved. - -When they were all unloaded and packed in a great heap in one corner -of the yard, the Slovaks were given some money by the Szgany, and -spitting on it for luck, lazily went each to his horse's head. -Shortly afterwards, I heard the crackling of their whips die away in -the distance. - - -24 June.--Last night the Count left me early, and locked himself into -his own room. As soon as I dared I ran up the winding stair, and -looked out of the window, which opened South. I thought I would watch -for the Count, for there is something going on. The Szgany are -quartered somewhere in the castle and are doing work of some kind. I -know it, for now and then, I hear a far-away muffled sound as of -mattock and spade, and, whatever it is, it must be the end of some -ruthless villainy. - -I had been at the window somewhat less than half an hour, when I saw -something coming out of the Count's window. I drew back and watched -carefully, and saw the whole man emerge. It was a new shock to me to -find that he had on the suit of clothes which I had worn whilst -travelling here, and slung over his shoulder the terrible bag which I -had seen the women take away. There could be no doubt as to his -quest, and in my garb, too! This, then, is his new scheme of evil, -that he will allow others to see me, as they think, so that he may -both leave evidence that I have been seen in the towns or villages -posting my own letters, and that any wickedness which he may do shall -by the local people be attributed to me. - -It makes me rage to think that this can go on, and whilst I am shut up -here, a veritable prisoner, but without that protection of the law -which is even a criminal's right and consolation. - -I thought I would watch for the Count's return, and for a long time -sat doggedly at the window. Then I began to notice that there were -some quaint little specks floating in the rays of the moonlight. They -were like the tiniest grains of dust, and they whirled round and -gathered in clusters in a nebulous sort of way. I watched them with a -sense of soothing, and a sort of calm stole over me. I leaned back in -the embrasure in a more comfortable position, so that I could enjoy -more fully the aerial gambolling. - -Something made me start up, a low, piteous howling of dogs somewhere -far below in the valley, which was hidden from my sight. Louder it -seemed to ring in my ears, and the floating moats of dust to take new -shapes to the sound as they danced in the moonlight. I felt myself -struggling to awake to some call of my instincts. Nay, my very soul -was struggling, and my half-remembered sensibilities were striving to -answer the call. I was becoming hypnotised! - -Quicker and quicker danced the dust. The moonbeams seemed to quiver -as they went by me into the mass of gloom beyond. More and more they -gathered till they seemed to take dim phantom shapes. And then I -started, broad awake and in full possession of my senses, and ran -screaming from the place. - -The phantom shapes, which were becoming gradually materialised from -the moonbeams, were those three ghostly women to whom I was doomed. - -I fled, and felt somewhat safer in my own room, where there was no -moonlight, and where the lamp was burning brightly. - -When a couple of hours had passed I heard something stirring in the -Count's room, something like a sharp wail quickly suppressed. And -then there was silence, deep, awful silence, which chilled me. With a -beating heart, I tried the door, but I was locked in my prison, and -could do nothing. I sat down and simply cried. - -As I sat I heard a sound in the courtyard without, the agonised cry of -a woman. I rushed to the window, and throwing it up, peered between -the bars. - -There, indeed, was a woman with dishevelled hair, holding her hands -over her heart as one distressed with running. She was leaning -against the corner of the gateway. When she saw my face at the window -she threw herself forward, and shouted in a voice laden with menace, -"Monster, give me my child!" - -She threw herself on her knees, and raising up her hands, cried the -same words in tones which wrung my heart. Then she tore her hair and -beat her breast, and abandoned herself to all the violences of -extravagant emotion. Finally, she threw herself forward, and though I -could not see her, I could hear the beating of her naked hands against -the door. - -Somewhere high overhead, probably on the tower, I heard the voice of -the Count calling in his harsh, metallic whisper. His call seemed to -be answered from far and wide by the howling of wolves. Before many -minutes had passed a pack of them poured, like a pent-up dam when -liberated, through the wide entrance into the courtyard. - -There was no cry from the woman, and the howling of the wolves was but -short. Before long they streamed away singly, licking their lips. - -I could not pity her, for I knew now what had become of her child, and -she was better dead. - -What shall I do? What can I do? How can I escape from this dreadful -thing of night, gloom, and fear? - - -25 June.--No man knows till he has suffered from the night how sweet -and dear to his heart and eye the morning can be. When the sun grew -so high this morning that it struck the top of the great gateway -opposite my window, the high spot which it touched seemed to me as if -the dove from the ark had lighted there. My fear fell from me as if -it had been a vaporous garment which dissolved in the warmth. - -I must take action of some sort whilst the courage of the day is upon -me. Last night one of my post-dated letters went to post, the first -of that fatal series which is to blot out the very traces of my -existence from the earth. - -Let me not think of it. Action! - -It has always been at night-time that I have been molested or -threatened, or in some way in danger or in fear. I have not yet seen -the Count in the daylight. Can it be that he sleeps when others wake, -that he may be awake whilst they sleep? If I could only get into his -room! But there is no possible way. The door is always locked, no -way for me. - -Yes, there is a way, if one dares to take it. Where his body has gone -why may not another body go? I have seen him myself crawl from his -window. Why should not I imitate him, and go in by his window? The -chances are desperate, but my need is more desperate still. I shall -risk it. At the worst it can only be death, and a man's death is not -a calf's, and the dreaded Hereafter may still be open to me. God help -me in my task! Goodbye, Mina, if I fail. Goodbye, my faithful friend -and second father. Goodbye, all, and last of all Mina! - - -Same day, later.--I have made the effort, and God helping me, have -come safely back to this room. I must put down every detail in order. -I went whilst my courage was fresh straight to the window on the south -side, and at once got outside on this side. The stones are big and -roughly cut, and the mortar has by process of time been washed away -between them. I took off my boots, and ventured out on the desperate -way. I looked down once, so as to make sure that a sudden glimpse of -the awful depth would not overcome me, but after that kept my eyes -away from it. I know pretty well the direction and distance of the -Count's window, and made for it as well as I could, having regard to -the opportunities available. I did not feel dizzy, I suppose I was -too excited, and the time seemed ridiculously short till I found -myself standing on the window sill and trying to raise up the sash. I -was filled with agitation, however, when I bent down and slid feet -foremost in through the window. Then I looked around for the Count, -but with surprise and gladness, made a discovery. The room was -empty! It was barely furnished with odd things, which seemed to have -never been used. - -The furniture was something the same style as that in the south rooms, -and was covered with dust. I looked for the key, but it was not in -the lock, and I could not find it anywhere. The only thing I found -was a great heap of gold in one corner, gold of all kinds, Roman, and -British, and Austrian, and Hungarian, and Greek and Turkish money, -covered with a film of dust, as though it had lain long in the ground. -None of it that I noticed was less than three hundred years old. -There were also chains and ornaments, some jewelled, but all of them -old and stained. - -At one corner of the room was a heavy door. I tried it, for, since I -could not find the key of the room or the key of the outer door, which -was the main object of my search, I must make further examination, or -all my efforts would be in vain. It was open, and led through a stone -passage to a circular stairway, which went steeply down. - -I descended, minding carefully where I went for the stairs were dark, -being only lit by loopholes in the heavy masonry. At the bottom there -was a dark, tunnel-like passage, through which came a deathly, sickly -odour, the odour of old earth newly turned. As I went through the -passage the smell grew closer and heavier. At last I pulled open a -heavy door which stood ajar, and found myself in an old ruined chapel, -which had evidently been used as a graveyard. The roof was broken, -and in two places were steps leading to vaults, but the ground had -recently been dug over, and the earth placed in great wooden boxes, -manifestly those which had been brought by the Slovaks. - -There was nobody about, and I made a search over every inch of the -ground, so as not to lose a chance. I went down even into the vaults, -where the dim light struggled, although to do so was a dread to my -very soul. Into two of these I went, but saw nothing except fragments -of old coffins and piles of dust. In the third, however, I made a -discovery. - -There, in one of the great boxes, of which there were fifty in all, on -a pile of newly dug earth, lay the Count! He was either dead or -asleep. I could not say which, for eyes were open and stony, but -without the glassiness of death, and the cheeks had the warmth of life -through all their pallor. The lips were as red as ever. But there -was no sign of movement, no pulse, no breath, no beating of the heart. - -I bent over him, and tried to find any sign of life, but in vain. He -could not have lain there long, for the earthy smell would have passed -away in a few hours. By the side of the box was its cover, pierced -with holes here and there. I thought he might have the keys on him, -but when I went to search I saw the dead eyes, and in them dead though -they were, such a look of hate, though unconscious of me or my -presence, that I fled from the place, and leaving the Count's room by -the window, crawled again up the castle wall. Regaining my room, I -threw myself panting upon the bed and tried to think. - - -29 June.--Today is the date of my last letter, and the Count has taken -steps to prove that it was genuine, for again I saw him leave the -castle by the same window, and in my clothes. As he went down the -wall, lizard fashion, I wished I had a gun or some lethal weapon, that -I might destroy him. But I fear that no weapon wrought along by man's -hand would have any effect on him. I dared not wait to see him -return, for I feared to see those weird sisters. I came back to the -library, and read there till I fell asleep. - -I was awakened by the Count, who looked at me as grimly as a man could -look as he said, "Tomorrow, my friend, we must part. You return to -your beautiful England, I to some work which may have such an end that -we may never meet. Your letter home has been despatched. Tomorrow I -shall not be here, but all shall be ready for your journey. In the -morning come the Szgany, who have some labours of their own here, and -also come some Slovaks. When they have gone, my carriage shall come -for you, and shall bear you to the Borgo Pass to meet the diligence -from Bukovina to Bistritz. But I am in hopes that I shall see more of -you at Castle Dracula." - -I suspected him, and determined to test his sincerity. Sincerity! It -seems like a profanation of the word to write it in connection with -such a monster, so I asked him point-blank, "Why may I not go -tonight?" - -"Because, dear sir, my coachman and horses are away on a mission." - -"But I would walk with pleasure. I want to get away at once." - -He smiled, such a soft, smooth, diabolical smile that I knew there was -some trick behind his smoothness. He said, "And your baggage?" - -"I do not care about it. I can send for it some other time." - -The Count stood up, and said, with a sweet courtesy which made me rub -my eyes, it seemed so real, "You English have a saying which is close -to my heart, for its spirit is that which rules our boyars, 'Welcome -the coming, speed the parting guest.' Come with me, my dear young -friend. Not an hour shall you wait in my house against your will, -though sad am I at your going, and that you so suddenly desire it. -Come!" With a stately gravity, he, with the lamp, preceded me down -the stairs and along the hall. Suddenly he stopped. "Hark!" - -Close at hand came the howling of many wolves. It was almost as if -the sound sprang up at the rising of his hand, just as the music of a -great orchestra seems to leap under the baton of the conductor. After -a pause of a moment, he proceeded, in his stately way, to the door, -drew back the ponderous bolts, unhooked the heavy chains, and began to -draw it open. - -To my intense astonishment I saw that it was unlocked. Suspiciously, -I looked all round, but could see no key of any kind. - -As the door began to open, the howling of the wolves without grew -louder and angrier. Their red jaws, with champing teeth, and their -blunt-clawed feet as they leaped, came in through the opening door. I -knew than that to struggle at the moment against the Count was -useless. With such allies as these at his command, I could do -nothing. - -But still the door continued slowly to open, and only the Count's body -stood in the gap. Suddenly it struck me that this might be the moment -and means of my doom. I was to be given to the wolves, and at my own -instigation. There was a diabolical wickedness in the idea great -enough for the Count, and as the last chance I cried out, "Shut the -door! I shall wait till morning." And I covered my face with my -hands to hide my tears of bitter disappointment. - -With one sweep of his powerful arm, the Count threw the door shut, and -the great bolts clanged and echoed through the hall as they shot back -into their places. - -In silence we returned to the library, and after a minute or two I went -to my own room. The last I saw of Count Dracula was his kissing his -hand to me, with a red light of triumph in his eyes, and with a smile -that Judas in hell might be proud of. - -When I was in my room and about to lie down, I thought I heard a -whispering at my door. I went to it softly and listened. Unless my -ears deceived me, I heard the voice of the Count. - -"Back! Back to your own place! Your time is not yet come. Wait! -Have patience! Tonight is mine. Tomorrow night is yours!" - -There was a low, sweet ripple of laughter, and in a rage I threw open -the door, and saw without the three terrible women licking their lips. -As I appeared, they all joined in a horrible laugh, and ran away. - -I came back to my room and threw myself on my knees. It is then so -near the end? Tomorrow! Tomorrow! Lord, help me, and those to whom -I am dear! - - -30 June.--These may be the last words I ever write in this diary. I -slept till just before the dawn, and when I woke threw myself on my -knees, for I determined that if Death came he should find me ready. - -At last I felt that subtle change in the air, and knew that the -morning had come. Then came the welcome cockcrow, and I felt that I -was safe. With a glad heart, I opened the door and ran down the hall. -I had seen that the door was unlocked, and now escape was before me. -With hands that trembled with eagerness, I unhooked the chains and -threw back the massive bolts. - -But the door would not move. Despair seized me. I pulled and pulled -at the door, and shook it till, massive as it was, it rattled in its -casement. I could see the bolt shot. It had been locked after I left -the Count. - -Then a wild desire took me to obtain the key at any risk, and I -determined then and there to scale the wall again, and gain the -Count's room. He might kill me, but death now seemed the happier -choice of evils. Without a pause I rushed up to the east window, and -scrambled down the wall, as before, into the Count's room. It was -empty, but that was as I expected. I could not see a key anywhere, -but the heap of gold remained. I went through the door in the corner -and down the winding stair and along the dark passage to the old -chapel. I knew now well enough where to find the monster I sought. - -The great box was in the same place, close against the wall, but the -lid was laid on it, not fastened down, but with the nails ready in -their places to be hammered home. - -I knew I must reach the body for the key, so I raised the lid, and -laid it back against the wall. And then I saw something which filled -my very soul with horror. There lay the Count, but looking as if his -youth had been half restored. For the white hair and moustache were -changed to dark iron-grey. The cheeks were fuller, and the white skin -seemed ruby-red underneath. The mouth was redder than ever, for on -the lips were gouts of fresh blood, which trickled from the corners of -the mouth and ran down over the chin and neck. Even the deep, burning -eyes seemed set amongst swollen flesh, for the lids and pouches -underneath were bloated. It seemed as if the whole awful creature -were simply gorged with blood. He lay like a filthy leech, exhausted -with his repletion. - -I shuddered as I bent over to touch him, and every sense in me -revolted at the contact, but I had to search, or I was lost. The -coming night might see my own body a banquet in a similar war to those -horrid three. I felt all over the body, but no sign could I find of -the key. Then I stopped and looked at the Count. There was a mocking -smile on the bloated face which seemed to drive me mad. This was the -being I was helping to transfer to London, where, perhaps, for -centuries to come he might, amongst its teeming millions, satiate his -lust for blood, and create a new and ever-widening circle of -semi-demons to batten on the helpless. - -The very thought drove me mad. A terrible desire came upon me to rid -the world of such a monster. There was no lethal weapon at hand, but -I seized a shovel which the workmen had been using to fill the cases, -and lifting it high, struck, with the edge downward, at the hateful -face. But as I did so the head turned, and the eyes fell upon me, -with all their blaze of basilisk horror. The sight seemed to paralyze -me, and the shovel turned in my hand and glanced from the face, merely -making a deep gash above the forehead. The shovel fell from my hand -across the box, and as I pulled it away the flange of the blade caught -the edge of the lid which fell over again, and hid the horrid thing -from my sight. The last glimpse I had was of the bloated face, -blood-stained and fixed with a grin of malice which would have held -its own in the nethermost hell. - -I thought and thought what should be my next move, but my brain seemed -on fire, and I waited with a despairing feeling growing over me. As I -waited I heard in the distance a gipsy song sung by merry voices -coming closer, and through their song the rolling of heavy wheels and -the cracking of whips. The Szgany and the Slovaks of whom the Count -had spoken were coming. With a last look around and at the box which -contained the vile body, I ran from the place and gained the Count's -room, determined to rush out at the moment the door should be opened. -With strained ears, I listened, and heard downstairs the grinding of -the key in the great lock and the falling back of the heavy door. -There must have been some other means of entry, or some one had a key -for one of the locked doors. - -Then there came the sound of many feet tramping and dying away in some -passage which sent up a clanging echo. I turned to run down again -towards the vault, where I might find the new entrance, but at the -moment there seemed to come a violent puff of wind, and the door to -the winding stair blew to with a shock that set the dust from the -lintels flying. When I ran to push it open, I found that it was -hopelessly fast. I was again a prisoner, and the net of doom was -closing round me more closely. - -As I write there is in the passage below a sound of many tramping feet -and the crash of weights being set down heavily, doubtless the boxes, -with their freight of earth. There was a sound of hammering. It is -the box being nailed down. Now I can hear the heavy feet tramping -again along the hall, with many other idle feet coming behind them. - -The door is shut, the chains rattle. There is a grinding of the key -in the lock. I can hear the key withdrawn, then another door opens -and shuts. I hear the creaking of lock and bolt. - -Hark! In the courtyard and down the rocky way the roll of heavy -wheels, the crack of whips, and the chorus of the Szgany as they pass -into the distance. - -I am alone in the castle with those horrible women. Faugh! Mina is a -woman, and there is nought in common. They are devils of the Pit! - -I shall not remain alone with them. I shall try to scale the castle -wall farther than I have yet attempted. I shall take some of the gold -with me, lest I want it later. I may find a way from this dreadful -place. - -And then away for home! Away to the quickest and nearest train! Away -from the cursed spot, from this cursed land, where the devil and his -children still walk with earthly feet! - -At least God's mercy is better than that of those monsters, and the -precipice is steep and high. At its foot a man may sleep, as a man. -Goodbye, all. Mina! - - - - -CHAPTER 5 - - -LETTER FROM MISS MINA MURRAY TO MISS LUCY WESTENRA - -9 May. - -My dearest Lucy, - -Forgive my long delay in writing, but I have been simply overwhelmed -with work. The life of an assistant schoolmistress is sometimes -trying. I am longing to be with you, and by the sea, where we can -talk together freely and build our castles in the air. I have been -working very hard lately, because I want to keep up with Jonathan's -studies, and I have been practicing shorthand very assiduously. -When we are married I shall be able to be useful to Jonathan, and if -I can stenograph well enough I can take down what he wants to say in -this way and write it out for him on the typewriter, at which also I -am practicing very hard. - -He and I sometimes write letters in shorthand, and he is -keeping a stenographic journal of his travels abroad. When -I am with you I shall keep a diary in the same way. I don't -mean one of those two-pages-to-the-week-with-Sunday-squeezed- -in-a-corner diaries, but a sort of journal which I can write -in whenever I feel inclined. - -I do not suppose there will be much of interest to other people, but -it is not intended for them. I may show it to Jonathan some day if -there is in it anything worth sharing, but it is really an exercise -book. I shall try to do what I see lady journalists do, -interviewing and writing descriptions and trying to remember -conversations. I am told that, with a little practice, one can -remember all that goes on or that one hears said during a day. - -However, we shall see. I will tell you of my little plans when we -meet. I have just had a few hurried lines from Jonathan from -Transylvania. He is well, and will be returning in about a week. I -am longing to hear all his news. It must be nice to see strange -countries. I wonder if we, I mean Jonathan and I, shall ever see -them together. There is the ten o'clock bell ringing. Goodbye. - -Your loving - -Mina - - -Tell me all the news when you write. You have not told me -anything for a long time. I hear rumours, and especially -of a tall, handsome, curly-haired man??? - - - -LETTER, LUCY WESTENRA TO MINA MURRAY - - -17, Chatham Street - -Wednesday - -My dearest Mina, - - -I must say you tax me very unfairly with being a bad correspondent. -I wrote you twice since we parted, and your last letter was only -your second. Besides, I have nothing to tell you. There is really -nothing to interest you. - -Town is very pleasant just now, and we go a great deal to -picture-galleries and for walks and rides in the park. As -to the tall, curly-haired man, I suppose it was the one who -was with me at the last Pop. Someone has evidently been -telling tales. - -That was Mr. Holmwood. He often comes to see us, and he and -Mamma get on very well together, they have so many things -to talk about in common. - -We met some time ago a man that would just do for you, if you were -not already engaged to Jonathan. He is an excellent parti, being -handsome, well off, and of good birth. He is a doctor and really -clever. Just fancy! He is only nine-and twenty, and he has an -immense lunatic asylum all under his own care. Mr. Holmwood -introduced him to me, and he called here to see us, and often comes -now. I think he is one of the most resolute men I ever saw, and yet -the most calm. He seems absolutely imperturbable. I can fancy what -a wonderful power he must have over his patients. He has a curious -habit of looking one straight in the face, as if trying to read -one's thoughts. He tries this on very much with me, but I flatter -myself he has got a tough nut to crack. I know that from my glass. - -Do you ever try to read your own face? I do, and I can -tell you it is not a bad study, and gives you more trouble -than you can well fancy if you have never tried it. - -He says that I afford him a curious psychological study, and -I humbly think I do. I do not, as you know, take sufficient -interest in dress to be able to describe the new fashions. -Dress is a bore. That is slang again, but never mind. Arthur -says that every day. - -There, it is all out, Mina, we have told all our secrets to -each other since we were children. We have slept together -and eaten together, and laughed and cried together, and -now, though I have spoken, I would like to speak more. Oh, -Mina, couldn't you guess? I love him. I am blushing as I -write, for although I think he loves me, he has not told me -so in words. But, oh, Mina, I love him. I love him! There, -that does me good. - -I wish I were with you, dear, sitting by the fire undressing, as we -used to sit, and I would try to tell you what I feel. I do not know -how I am writing this even to you. I am afraid to stop, or I should -tear up the letter, and I don't want to stop, for I do so want to -tell you all. Let me hear from you at once, and tell me all that you -think about it. Mina, pray for my happiness. - -Lucy - - -P.S.--I need not tell you this is a secret. -Goodnight again. L. - - - - -LETTER, LUCY WESTENRA TO MINA MURRAY - -24 May - -My dearest Mina, - -Thanks, and thanks, and thanks again for your sweet letter. It -was so nice to be able to tell you and to have your sympathy. - -My dear, it never rains but it pours. How true the old proverbs -are. Here am I, who shall be twenty in September, and yet I never -had a proposal till today, not a real proposal, and today I had -three. Just fancy! Three proposals in one day! Isn't it awful! I -feel sorry, really and truly sorry, for two of the poor fellows. -Oh, Mina, I am so happy that I don't know what to do with myself. -And three proposals! But, for goodness' sake, don't tell any of the -girls, or they would be getting all sorts of extravagant ideas, and -imagining themselves injured and slighted if in their very first day -at home they did not get six at least. Some girls are so vain! You -and I, Mina dear, who are engaged and are going to settle down soon -soberly into old married women, can despise vanity. Well, I must -tell you about the three, but you must keep it a secret, dear, from -every one except, of course, Jonathan. You will tell him, because I -would, if I were in your place, certainly tell Arthur. A woman -ought to tell her husband everything. Don't you think so, dear? And -I must be fair. Men like women, certainly their wives, to be quite -as fair as they are. And women, I am afraid, are not always quite -as fair as they should be. - -Well, my dear, number One came just before lunch. I told you of -him, Dr. John Seward, the lunatic asylum man, with the strong jaw -and the good forehead. He was very cool outwardly, but was nervous -all the same. He had evidently been schooling himself as to all -sorts of little things, and remembered them, but he almost managed -to sit down on his silk hat, which men don't generally do when they -are cool, and then when he wanted to appear at ease he kept playing -with a lancet in a way that made me nearly scream. He spoke to me, -Mina, very straightforwardly. He told me how dear I was to him, -though he had known me so little, and what his life would be with me -to help and cheer him. He was going to tell me how unhappy he would -be if I did not care for him, but when he saw me cry he said he was -a brute and would not add to my present trouble. Then he broke off -and asked if I could love him in time, and when I shook my head his -hands trembled, and then with some hesitation he asked me if I cared -already for any one else. He put it very nicely, saying that he did -not want to wring my confidence from me, but only to know, because -if a woman's heart was free a man might have hope. And then, Mina, -I felt a sort of duty to tell him that there was some one. I only -told him that much, and then he stood up, and he looked very strong -and very grave as he took both my hands in his and said he hoped I -would be happy, and that If I ever wanted a friend I must count him -one of my best. - -Oh, Mina dear, I can't help crying, and you must excuse this letter -being all blotted. Being proposed to is all very nice and all that -sort of thing, but it isn't at all a happy thing when you have to -see a poor fellow, whom you know loves you honestly, going away and -looking all broken hearted, and to know that, no matter what he may -say at the moment, you are passing out of his life. My dear, I must -stop here at present, I feel so miserable, though I am so happy. - -Evening. - -Arthur has just gone, and I feel in better spirits than when I -left off, so I can go on telling you about the day. - -Well, my dear, number Two came after lunch. He is such a nice -fellow, an American from Texas, and he looks so young and so fresh -that it seems almost impossible that he has been to so many places -and has such adventures. I sympathize with poor Desdemona when she -had such a stream poured in her ear, even by a black man. I suppose -that we women are such cowards that we think a man will save us from -fears, and we marry him. I know now what I would do if I were a man -and wanted to make a girl love me. No, I don't, for there was Mr. -Morris telling us his stories, and Arthur never told any, and -yet . . . - -My dear, I am somewhat previous. Mr. Quincy P. Morris found me -alone. It seems that a man always does find a girl alone. No, he -doesn't, for Arthur tried twice to make a chance, and I helping him -all I could, I am not ashamed to say it now. I must tell you -beforehand that Mr. Morris doesn't always speak slang, that is to -say, he never does so to strangers or before them, for he is really -well educated and has exquisite manners, but he found out that it -amused me to hear him talk American slang, and whenever I was -present, and there was no one to be shocked, he said such funny -things. I am afraid, my dear, he has to invent it all, for it fits -exactly into whatever else he has to say. But this is a way slang -has. I do not know myself if I shall ever speak slang. I do not -know if Arthur likes it, as I have never heard him use any as yet. - -Well, Mr. Morris sat down beside me and looked as happy and jolly as -he could, but I could see all the same that he was very nervous. He -took my hand in his, and said ever so sweetly . . . - -"Miss Lucy, I know I ain't good enough to regulate the fixin's of -your little shoes, but I guess if you wait till you find a man that -is you will go join them seven young women with the lamps when you -quit. Won't you just hitch up alongside of me and let us go down -the long road together, driving in double harness?" - -Well, he did look so good humoured and so jolly that it didn't seem -half so hard to refuse him as it did poor Dr. Seward. So I said, as -lightly as I could, that I did not know anything of hitching, and -that I wasn't broken to harness at all yet. Then he said that he -had spoken in a light manner, and he hoped that if he had made a -mistake in doing so on so grave, so momentous, and occasion for him, -I would forgive him. He really did look serious when he was saying -it, and I couldn't help feeling a sort of exultation that he was -number Two in one day. And then, my dear, before I could say a word -he began pouring out a perfect torrent of love-making, laying his -very heart and soul at my feet. He looked so earnest over it that I -shall never again think that a man must be playful always, and never -earnest, because he is merry at times. I suppose he saw something -in my face which checked him, for he suddenly stopped, and said with -a sort of manly fervour that I could have loved him for if I had -been free . . . - -"Lucy, you are an honest hearted girl, I know. I should not be here -speaking to you as I am now if I did not believe you clean grit, -right through to the very depths of your soul. Tell me, like one -good fellow to another, is there any one else that you care for? -And if there is I'll never trouble you a hair's breadth again, but -will be, if you will let me, a very faithful friend." - -My dear Mina, why are men so noble when we women are so little -worthy of them? Here was I almost making fun of this great hearted, -true gentleman. I burst into tears, I am afraid, my dear, you will -think this a very sloppy letter in more ways than one, and I really -felt very badly. - -Why can't they let a girl marry three men, or as many as -want her, and save all this trouble? But this is heresy, -and I must not say it. I am glad to say that, though I was -crying, I was able to look into Mr. Morris' brave eyes, and -I told him out straight . . . - -"Yes, there is some one I love, though he has not told me -yet that he even loves me." I was right to speak to him so -frankly, for quite a light came into his face, and he put -out both his hands and took mine, I think I put them into -his, and said in a hearty way . . . - -"That's my brave girl. It's better worth being late for a chance of -winning you than being in time for any other girl in the world. -Don't cry, my dear. If it's for me, I'm a hard nut to crack, and I -take it standing up. If that other fellow doesn't know his -happiness, well, he'd better look for it soon, or he'll have to deal -with me. Little girl, your honesty and pluck have made me a friend, -and that's rarer than a lover, it's more selfish anyhow. My dear, -I'm going to have a pretty lonely walk between this and Kingdom -Come. Won't you give me one kiss? It'll be something to keep off -the darkness now and then. You can, you know, if you like, for that -other good fellow, or you could not love him, hasn't spoken yet." - -That quite won me, Mina, for it was brave and sweet of him, -and noble too, to a rival, wasn't it? And he so sad, so I -leant over and kissed him. - -He stood up with my two hands in his, and as he looked down into my -face, I am afraid I was blushing very much, he said, "Little girl, I -hold your hand, and you've kissed me, and if these things don't make -us friends nothing ever will. Thank you for your sweet honesty to -me, and goodbye." - -He wrung my hand, and taking up his hat, went straight out of the -room without looking back, without a tear or a quiver or a pause, -and I am crying like a baby. - -Oh, why must a man like that be made unhappy when there are lots of -girls about who would worship the very ground he trod on? I know I -would if I were free, only I don't want to be free. My dear, this -quite upset me, and I feel I cannot write of happiness just at once, -after telling you of it, and I don't wish to tell of the number -Three until it can be all happy. Ever your loving . . . - -Lucy - - -P.S.--Oh, about number Three, I needn't tell you of number -Three, need I? Besides, it was all so confused. It seemed -only a moment from his coming into the room till both his -arms were round me, and he was kissing me. I am very, very -happy, and I don't know what I have done to deserve it. I -must only try in the future to show that I am not ungrateful -to God for all His goodness to me in sending to me such a -lover, such a husband, and such a friend. - -Goodbye. - - - -DR. SEWARD'S DIARY (Kept in phonograph) - -25 May.--Ebb tide in appetite today. Cannot eat, cannot rest, so -diary instead. Since my rebuff of yesterday I have a sort of empty -feeling. Nothing in the world seems of sufficient importance to be -worth the doing. As I knew that the only cure for this sort of thing -was work, I went amongst the patients. I picked out one who has -afforded me a study of much interest. He is so quaint that I am -determined to understand him as well as I can. Today I seemed to get -nearer than ever before to the heart of his mystery. - -I questioned him more fully than I had ever done, with a view to -making myself master of the facts of his hallucination. In my manner -of doing it there was, I now see, something of cruelty. I seemed to -wish to keep him to the point of his madness, a thing which I avoid -with the patients as I would the mouth of hell. - -(Mem., Under what circumstances would I not avoid the pit of hell?) -Omnia Romae venalia sunt. Hell has its price! If there be anything -behind this instinct it will be valuable to trace it afterwards -accurately, so I had better commence to do so, therefore . . . - -R. M, Renfield, age 59. Sanguine temperament, great physical -strength, morbidly excitable, periods of gloom, ending in some fixed -idea which I cannot make out. I presume that the sanguine temperament -itself and the disturbing influence end in a mentally-accomplished -finish, a possibly dangerous man, probably dangerous if unselfish. In -selfish men caution is as secure an armour for their foes as for -themselves. What I think of on this point is, when self is the fixed -point the centripetal force is balanced with the centrifugal. When -duty, a cause, etc., is the fixed point, the latter force is -paramount, and only accident or a series of accidents can balance it. - - - -LETTER, QUINCEY P. MORRIS TO HON. ARTHUR HOLMOOD - -25 May. - -My dear Art, - -We've told yarns by the campfire in the prairies, and dressed one -another's wounds after trying a landing at the Marquesas, and drunk -healths on the shore of Titicaca. There are more yarns to be told, -and other wounds to be healed, and another health to be drunk. -Won't you let this be at my campfire tomorrow night? I have no -hesitation in asking you, as I know a certain lady is engaged to a -certain dinner party, and that you are free. There will only be one -other, our old pal at the Korea, Jack Seward. He's coming, too, and -we both want to mingle our weeps over the wine cup, and to drink a -health with all our hearts to the happiest man in all the wide -world, who has won the noblest heart that God has made and best -worth winning. We promise you a hearty welcome, and a loving -greeting, and a health as true as your own right hand. We shall -both swear to leave you at home if you drink too deep to a certain -pair of eyes. Come! - -Yours, as ever and always, - -Quincey P. Morris - - - - - -TELEGRAM FROM ARTHUR HOLMWOOD TO QUINCEY P. MORRIS - -26 May - - -Count me in every time. I bear messages which will make both -your ears tingle. - -Art - - - - -CHAPTER 6 - - -MINA MURRAY'S JOURNAL - -24 July. Whitby.--Lucy met me at the station, looking sweeter and -lovelier than ever, and we drove up to the house at the Crescent in -which they have rooms. This is a lovely place. The little river, the -Esk, runs through a deep valley, which broadens out as it comes near -the harbour. A great viaduct runs across, with high piers, through -which the view seems somehow further away than it really is. The -valley is beautifully green, and it is so steep that when you are on -the high land on either side you look right across it, unless you are -near enough to see down. The houses of the old town--the side away -from us, are all red-roofed, and seem piled up one over the other -anyhow, like the pictures we see of Nuremberg. Right over the town is -the ruin of Whitby Abbey, which was sacked by the Danes, and which is -the scene of part of "Marmion," where the girl was built up in the -wall. It is a most noble ruin, of immense size, and full of beautiful -and romantic bits. There is a legend that a white lady is seen in one -of the windows. Between it and the town there is another church, the -parish one, round which is a big graveyard, all full of tombstones. -This is to my mind the nicest spot in Whitby, for it lies right over -the town, and has a full view of the harbour and all up the bay to -where the headland called Kettleness stretches out into the sea. It -descends so steeply over the harbour that part of the bank has fallen -away, and some of the graves have been destroyed. - -In one place part of the stonework of the graves stretches out over -the sandy pathway far below. There are walks, with seats beside them, -through the churchyard, and people go and sit there all day long -looking at the beautiful view and enjoying the breeze. - -I shall come and sit here often myself and work. Indeed, I am writing -now, with my book on my knee, and listening to the talk of three old -men who are sitting beside me. They seem to do nothing all day but -sit here and talk. - -The harbour lies below me, with, on the far side, one long granite -wall stretching out into the sea, with a curve outwards at the end of -it, in the middle of which is a lighthouse. A heavy seawall runs -along outside of it. On the near side, the seawall makes an elbow -crooked inversely, and its end too has a lighthouse. Between the two -piers there is a narrow opening into the harbour, which then suddenly -widens. - -It is nice at high water, but when the tide is out it shoals away to -nothing, and there is merely the stream of the Esk, running between -banks of sand, with rocks here and there. Outside the harbour on this -side there rises for about half a mile a great reef, the sharp of -which runs straight out from behind the south lighthouse. At the end -of it is a buoy with a bell, which swings in bad weather, and sends in -a mournful sound on the wind. - -They have a legend here that when a ship is lost bells are heard out at -sea. I must ask the old man about this. He is coming this way . . . - -He is a funny old man. He must be awfully old, for his face is -gnarled and twisted like the bark of a tree. He tells me that he is -nearly a hundred, and that he was a sailor in the Greenland fishing -fleet when Waterloo was fought. He is, I am afraid, a very sceptical -person, for when I asked him about the bells at sea and the White Lady -at the abbey he said very brusquely, - -"I wouldn't fash masel' about them, miss. Them things be all wore -out. Mind, I don't say that they never was, but I do say that they -wasn't in my time. They be all very well for comers and trippers, an' -the like, but not for a nice young lady like you. Them feet-folks -from York and Leeds that be always eatin' cured herrin's and drinkin' -tea an' lookin' out to buy cheap jet would creed aught. I wonder -masel' who'd be bothered tellin' lies to them, even the newspapers, -which is full of fool-talk." - -I thought he would be a good person to learn interesting things from, -so I asked him if he would mind telling me something about the whale -fishing in the old days. He was just settling himself to begin when -the clock struck six, whereupon he laboured to get up, and said, - -"I must gang ageeanwards home now, miss. My grand-daughter doesn't -like to be kept waitin' when the tea is ready, for it takes me time to -crammle aboon the grees, for there be a many of 'em, and miss, I lack -belly-timber sairly by the clock." - -He hobbled away, and I could see him hurrying, as well as he could, -down the steps. The steps are a great feature on the place. They -lead from the town to the church, there are hundreds of them, I do not -know how many, and they wind up in a delicate curve. The slope is so -gentle that a horse could easily walk up and down them. - -I think they must originally have had something to do with the abbey. -I shall go home too. Lucy went out, visiting with her mother, and as -they were only duty calls, I did not go. - - -1 August.--I came up here an hour ago with Lucy, and we had a most -interesting talk with my old friend and the two others who always come -and join him. He is evidently the Sir Oracle of them, and I should -think must have been in his time a most dictatorial person. - -He will not admit anything, and down faces everybody. If he can't -out-argue them he bullies them, and then takes their silence for -agreement with his views. - -Lucy was looking sweetly pretty in her white lawn frock. She has got -a beautiful colour since she has been here. - -I noticed that the old men did not lose any time in coming and sitting -near her when we sat down. She is so sweet with old people, I think -they all fell in love with her on the spot. Even my old man succumbed -and did not contradict her, but gave me double share instead. I got -him on the subject of the legends, and he went off at once into a sort -of sermon. I must try to remember it and put it down. - -"It be all fool-talk, lock, stock, and barrel, that's what it be and -nowt else. These bans an' wafts an' boh-ghosts an' bar-guests an' -bogles an' all anent them is only fit to set bairns an' dizzy women -a'belderin'. They be nowt but air-blebs. They, an' all grims an' signs -an' warnin's, be all invented by parsons an' illsome berk-bodies an' -railway touters to skeer an' scunner hafflin's, an' to get folks to do -somethin' that they don't other incline to. It makes me ireful to -think o' them. Why, it's them that, not content with printin' lies on -paper an' preachin' them out of pulpits, does want to be cuttin' them -on the tombstones. Look here all around you in what airt ye will. All -them steans, holdin' up their heads as well as they can out of their -pride, is acant, simply tumblin' down with the weight o' the lies -wrote on them, 'Here lies the body' or 'Sacred to the memory' wrote on -all of them, an' yet in nigh half of them there bean't no bodies at -all, an' the memories of them bean't cared a pinch of snuff about, -much less sacred. Lies all of them, nothin' but lies of one kind or -another! My gog, but it'll be a quare scowderment at the Day of -Judgment when they come tumblin' up in their death-sarks, all jouped -together an' trying' to drag their tombsteans with them to prove how -good they was, some of them trimmlin' an' dithering, with their hands -that dozzened an' slippery from lyin' in the sea that they can't even -keep their gurp o' them." - -I could see from the old fellow's self-satisfied air and the way in -which he looked round for the approval of his cronies that he was -"showing off," so I put in a word to keep him going. - -"Oh, Mr. Swales, you can't be serious. Surely these tombstones are -not all wrong?" - -"Yabblins! There may be a poorish few not wrong, savin' where they -make out the people too good, for there be folk that do think a -balm-bowl be like the sea, if only it be their own. The whole thing -be only lies. Now look you here. You come here a stranger, an' you -see this kirkgarth." - -I nodded, for I thought it better to assent, though I did not quite -understand his dialect. I knew it had something to do with the -church. - -He went on, "And you consate that all these steans be aboon folk that -be haped here, snod an' snog?" I assented again. "Then that be just -where the lie comes in. Why, there be scores of these laybeds that be -toom as old Dun's 'baccabox on Friday night." - -He nudged one of his companions, and they all laughed. "And, my gog! -How could they be otherwise? Look at that one, the aftest abaft the -bier-bank, read it!" - -I went over and read, "Edward Spencelagh, master mariner, murdered by -pirates off the coast of Andres, April, 1854, age 30." When I came -back Mr. Swales went on, - -"Who brought him home, I wonder, to hap him here? Murdered off the -coast of Andres! An' you consated his body lay under! Why, I could -name ye a dozen whose bones lie in the Greenland seas above," he -pointed northwards, "or where the currants may have drifted them. -There be the steans around ye. Ye can, with your young eyes, read the -small print of the lies from here. This Braithwaite Lowery, I knew -his father, lost in the Lively off Greenland in '20, or Andrew -Woodhouse, drowned in the same seas in 1777, or John Paxton, drowned -off Cape Farewell a year later, or old John Rawlings, whose -grandfather sailed with me, drowned in the Gulf of Finland in '50. Do -ye think that all these men will have to make a rush to Whitby when -the trumpet sounds? I have me antherums aboot it! I tell ye that -when they got here they'd be jommlin' and jostlin' one another that -way that it 'ud be like a fight up on the ice in the old days, when -we'd be at one another from daylight to dark, an' tryin' to tie up our -cuts by the aurora borealis." This was evidently local pleasantry, for -the old man cackled over it, and his cronies joined in with gusto. - -"But," I said, "surely you are not quite correct, for you start on the -assumption that all the poor people, or their spirits, will have to -take their tombstones with them on the Day of Judgment. Do you think -that will be really necessary?" - -"Well, what else be they tombstones for? Answer me that, miss!" - -"To please their relatives, I suppose." - -"To please their relatives, you suppose!" This he said with intense -scorn. "How will it pleasure their relatives to know that lies is -wrote over them, and that everybody in the place knows that they be -lies?" - -He pointed to a stone at our feet which had been laid down as a slab, -on which the seat was rested, close to the edge of the cliff. "Read -the lies on that thruff-stone," he said. - -The letters were upside down to me from where I sat, but Lucy was more -opposite to them, so she leant over and read, "Sacred to the memory of -George Canon, who died, in the hope of a glorious resurrection, on -July 29, 1873, falling from the rocks at Kettleness. This tomb was -erected by his sorrowing mother to her dearly beloved son. 'He was the -only son of his mother, and she was a widow.' Really, Mr. Swales, I -don't see anything very funny in that!" She spoke her comment very -gravely and somewhat severely. - -"Ye don't see aught funny! Ha-ha! But that's because ye don't gawm -the sorrowin' mother was a hell-cat that hated him because he was -acrewk'd, a regular lamiter he was, an' he hated her so that he -committed suicide in order that she mightn't get an insurance she put -on his life. He blew nigh the top of his head off with an old musket -that they had for scarin' crows with. 'Twarn't for crows then, for it -brought the clegs and the dowps to him. That's the way he fell off -the rocks. And, as to hopes of a glorious resurrection, I've often -heard him say masel' that he hoped he'd go to hell, for his mother was -so pious that she'd be sure to go to heaven, an' he didn't want to -addle where she was. Now isn't that stean at any rate," he hammered -it with his stick as he spoke, "a pack of lies? And won't it make -Gabriel keckle when Geordie comes pantin' ut the grees with the -tompstean balanced on his hump, and asks to be took as evidence!" - -I did not know what to say, but Lucy turned the conversation as she -said, rising up, "Oh, why did you tell us of this? It is my favourite -seat, and I cannot leave it, and now I find I must go on sitting over -the grave of a suicide." - -"That won't harm ye, my pretty, an' it may make poor Geordie gladsome -to have so trim a lass sittin' on his lap. That won't hurt ye. Why, -I've sat here off an' on for nigh twenty years past, an' it hasn't -done me no harm. Don't ye fash about them as lies under ye, or that -doesn' lie there either! It'll be time for ye to be getting scart -when ye see the tombsteans all run away with, and the place as bare as -a stubble-field. There's the clock, and I must gang. My service to -ye, ladies!" And off he hobbled. - -Lucy and I sat awhile, and it was all so beautiful before us that we -took hands as we sat, and she told me all over again about Arthur and -their coming marriage. That made me just a little heart-sick, for I -haven't heard from Jonathan for a whole month. - - -The same day. I came up here alone, for I am very sad. There was no -letter for me. I hope there cannot be anything the matter with -Jonathan. The clock has just struck nine. I see the lights scattered -all over the town, sometimes in rows where the streets are, and -sometimes singly. They run right up the Esk and die away in the curve -of the valley. To my left the view is cut off by a black line of roof -of the old house next to the abbey. The sheep and lambs are bleating -in the fields away behind me, and there is a clatter of donkeys' hoofs -up the paved road below. The band on the pier is playing a harsh -waltz in good time, and further along the quay there is a Salvation -Army meeting in a back street. Neither of the bands hears the other, -but up here I hear and see them both. I wonder where Jonathan is and -if he is thinking of me! I wish he were here. - - - -DR. SEWARD'S DIARY - -5 June.--The case of Renfield grows more interesting the more I get to -understand the man. He has certain qualities very largely developed, -selfishness, secrecy, and purpose. - -I wish I could get at what is the object of the latter. He seems to -have some settled scheme of his own, but what it is I do not know. -His redeeming quality is a love of animals, though, indeed, he has -such curious turns in it that I sometimes imagine he is only -abnormally cruel. His pets are of odd sorts. - -Just now his hobby is catching flies. He has at present such a -quantity that I have had myself to expostulate. To my astonishment, -he did not break out into a fury, as I expected, but took the matter -in simple seriousness. He thought for a moment, and then said, "May I -have three days? I shall clear them away." Of course, I said that -would do. I must watch him. - - -18 June.--He has turned his mind now to spiders, and has got several -very big fellows in a box. He keeps feeding them his flies, and the -number of the latter is becoming sensibly diminished, although he has -used half his food in attracting more flies from outside to his room. - - -1 July.--His spiders are now becoming as great a nuisance as his -flies, and today I told him that he must get rid of them. - -He looked very sad at this, so I said that he must some of them, at -all events. He cheerfully acquiesced in this, and I gave him the same -time as before for reduction. - -He disgusted me much while with him, for when a horrid blowfly, -bloated with some carrion food, buzzed into the room, he caught it, -held it exultantly for a few moments between his finger and thumb, and -before I knew what he was going to do, put it in his mouth and ate it. - -I scolded him for it, but he argued quietly that it was very good and -very wholesome, that it was life, strong life, and gave life to him. -This gave me an idea, or the rudiment of one. I must watch how he -gets rid of his spiders. - -He has evidently some deep problem in his mind, for he keeps a little -notebook in which he is always jotting down something. Whole pages of -it are filled with masses of figures, generally single numbers added -up in batches, and then the totals added in batches again, as though -he were focussing some account, as the auditors put it. - - -8 July.--There is a method in his madness, and the rudimentary idea in -my mind is growing. It will be a whole idea soon, and then, oh, -unconscious cerebration, you will have to give the wall to your -conscious brother. - -I kept away from my friend for a few days, so that I might notice if -there were any change. Things remain as they were except that he has -parted with some of his pets and got a new one. - -He has managed to get a sparrow, and has already partially tamed it. -His means of taming is simple, for already the spiders have -diminished. Those that do remain, however, are well fed, for he still -brings in the flies by tempting them with his food. - -19 July--We are progressing. My friend has now a whole colony of -sparrows, and his flies and spiders are almost obliterated. When I -came in he ran to me and said he wanted to ask me a great favour, a -very, very great favour. And as he spoke, he fawned on me like a dog. - -I asked him what it was, and he said, with a sort of rapture in his -voice and bearing, "A kitten, a nice, little, sleek playful kitten, -that I can play with, and teach, and feed, and feed, and feed!" - -I was not unprepared for this request, for I had noticed how his pets -went on increasing in size and vivacity, but I did not care that his -pretty family of tame sparrows should be wiped out in the same manner -as the flies and spiders. So I said I would see about it, and asked -him if he would not rather have a cat than a kitten. - -His eagerness betrayed him as he answered, "Oh, yes, I would like a -cat! I only asked for a kitten lest you should refuse me a cat. No -one would refuse me a kitten, would they?" - -I shook my head, and said that at present I feared it would not be -possible, but that I would see about it. His face fell, and I could -see a warning of danger in it, for there was a sudden fierce, sidelong -look which meant killing. The man is an undeveloped homicidal -maniac. I shall test him with his present craving and see how it will -work out, then I shall know more. - - -10 pm.--I have visited him again and found him sitting in a corner -brooding. When I came in he threw himself on his knees before me and -implored me to let him have a cat, that his salvation depended upon -it. - -I was firm, however, and told him that he could not have it, whereupon -he went without a word, and sat down, gnawing his fingers, in the -corner where I had found him. I shall see him in the morning early. - - -20 July.--Visited Renfield very early, before attendant went his -rounds. Found him up and humming a tune. He was spreading out his -sugar, which he had saved, in the window, and was manifestly beginning -his fly catching again, and beginning it cheerfully and with a good -grace. - -I looked around for his birds, and not seeing them, asked him where -they were. He replied, without turning round, that they had all flown -away. There were a few feathers about the room and on his pillow a -drop of blood. I said nothing, but went and told the keeper to report -to me if there were anything odd about him during the day. - - -11 am.--The attendant has just been to see me to say that Renfield has -been very sick and has disgorged a whole lot of feathers. "My belief -is, doctor," he said, "that he has eaten his birds, and that he just -took and ate them raw!" - - -11 pm.--I gave Renfield a strong opiate tonight, enough to make even -him sleep, and took away his pocketbook to look at it. The thought -that has been buzzing about my brain lately is complete, and the -theory proved. - -My homicidal maniac is of a peculiar kind. I shall have to invent a -new classification for him, and call him a zoophagous (life-eating) -maniac. What he desires is to absorb as many lives as he can, and he -has laid himself out to achieve it in a cumulative way. He gave many -flies to one spider and many spiders to one bird, and then wanted a -cat to eat the many birds. What would have been his later steps? - -It would almost be worth while to complete the experiment. It might -be done if there were only a sufficient cause. Men sneered at -vivisection, and yet look at its results today! Why not advance -science in its most difficult and vital aspect, the knowledge of the -brain? - -Had I even the secret of one such mind, did I hold the key to the -fancy of even one lunatic, I might advance my own branch of science to -a pitch compared with which Burdon-Sanderson's physiology or Ferrier's -brain knowledge would be as nothing. If only there were a sufficient -cause! I must not think too much of this, or I may be tempted. A -good cause might turn the scale with me, for may not I too be of an -exceptional brain, congenitally? - -How well the man reasoned. Lunatics always do within their own scope. -I wonder at how many lives he values a man, or if at only one. He has -closed the account most accurately, and today begun a new record. How -many of us begin a new record with each day of our lives? - -To me it seems only yesterday that my whole life ended with my new -hope, and that truly I began a new record. So it shall be until the -Great Recorder sums me up and closes my ledger account with a balance -to profit or loss. - -Oh, Lucy, Lucy, I cannot be angry with you, nor can I be angry with my -friend whose happiness is yours, but I must only wait on hopeless and -work. Work! Work! - -If I could have as strong a cause as my poor mad friend there, a good, -unselfish cause to make me work, that would be indeed happiness. - - - -MINA MURRAY'S JOURNAL - -26 July.--I am anxious, and it soothes me to express myself here. It -is like whispering to one's self and listening at the same time. And -there is also something about the shorthand symbols that makes it -different from writing. I am unhappy about Lucy and about Jonathan. -I had not heard from Jonathan for some time, and was very concerned, -but yesterday dear Mr. Hawkins, who is always so kind, sent me a -letter from him. I had written asking him if he had heard, and he -said the enclosed had just been received. It is only a line dated -from Castle Dracula, and says that he is just starting for home. That -is not like Jonathan. I do not understand it, and it makes me uneasy. - -Then, too, Lucy, although she is so well, has lately taken to her old -habit of walking in her sleep. Her mother has spoken to me about it, -and we have decided that I am to lock the door of our room every -night. - -Mrs. Westenra has got an idea that sleep-walkers always go out on -roofs of houses and along the edges of cliffs and then get suddenly -wakened and fall over with a despairing cry that echoes all over the -place. - -Poor dear, she is naturally anxious about Lucy, and she tells me that -her husband, Lucy's father, had the same habit, that he would get up -in the night and dress himself and go out, if he were not stopped. - -Lucy is to be married in the autumn, and she is already planning out -her dresses and how her house is to be arranged. I sympathise with -her, for I do the same, only Jonathan and I will start in life in a -very simple way, and shall have to try to make both ends meet. - -Mr. Holmwood, he is the Hon. Arthur Holmwood, only son of Lord -Godalming, is coming up here very shortly, as soon as he can leave -town, for his father is not very well, and I think dear Lucy is -counting the moments till he comes. - -She wants to take him up in the seat on the churchyard cliff and show -him the beauty of Whitby. I daresay it is the waiting which disturbs -her. She will be all right when he arrives. - - -27 July.--No news from Jonathan. I am getting quite uneasy about him, -though why I should I do not know, but I do wish that he would write, -if it were only a single line. - -Lucy walks more than ever, and each night I am awakened by her moving -about the room. Fortunately, the weather is so hot that she cannot -get cold. But still, the anxiety and the perpetually being awakened -is beginning to tell on me, and I am getting nervous and wakeful -myself. Thank God, Lucy's health keeps up. Mr. Holmwood has been -suddenly called to Ring to see his father, who has been taken -seriously ill. Lucy frets at the postponement of seeing him, but it -does not touch her looks. She is a trifle stouter, and her cheeks are -a lovely rose-pink. She has lost the anemic look which she had. I -pray it will all last. - - -3 August.--Another week gone by, and no news from Jonathan, not even -to Mr. Hawkins, from whom I have heard. Oh, I do hope he is not ill. -He surely would have written. I look at that last letter of his, but -somehow it does not satisfy me. It does not read like him, and yet it -is his writing. There is no mistake of that. - -Lucy has not walked much in her sleep the last week, but there is an -odd concentration about her which I do not understand, even in her -sleep she seems to be watching me. She tries the door, and finding it -locked, goes about the room searching for the key. - - -6 August.--Another three days, and no news. This suspense is getting -dreadful. If I only knew where to write to or where to go to, I -should feel easier. But no one has heard a word of Jonathan since -that last letter. I must only pray to God for patience. - -Lucy is more excitable than ever, but is otherwise well. Last night -was very threatening, and the fishermen say that we are in for a -storm. I must try to watch it and learn the weather signs. - -Today is a gray day, and the sun as I write is hidden in thick clouds, -high over Kettleness. Everything is gray except the green grass, -which seems like emerald amongst it, gray earthy rock, gray clouds, -tinged with the sunburst at the far edge, hang over the gray sea, into -which the sandpoints stretch like gray figures. The sea is tumbling -in over the shallows and the sandy flats with a roar, muffled in the -sea-mists drifting inland. The horizon is lost in a gray mist. All -vastness, the clouds are piled up like giant rocks, and there is a -'brool' over the sea that sounds like some passage of doom. Dark -figures are on the beach here and there, sometimes half shrouded in -the mist, and seem 'men like trees walking'. The fishing boats are -racing for home, and rise and dip in the ground swell as they sweep -into the harbour, bending to the scuppers. Here comes old Mr. Swales. -He is making straight for me, and I can see, by the way he lifts his -hat, that he wants to talk. - -I have been quite touched by the change in the poor old man. When he -sat down beside me, he said in a very gentle way, "I want to say -something to you, miss." - -I could see he was not at ease, so I took his poor old wrinkled hand in -mine and asked him to speak fully. - -So he said, leaving his hand in mine, "I'm afraid, my deary, that I -must have shocked you by all the wicked things I've been sayin' about -the dead, and such like, for weeks past, but I didn't mean them, and I -want ye to remember that when I'm gone. We aud folks that be daffled, -and with one foot abaft the krok-hooal, don't altogether like to think -of it, and we don't want to feel scart of it, and that's why I've took -to makin' light of it, so that I'd cheer up my own heart a bit. But, -Lord love ye, miss, I ain't afraid of dyin', not a bit, only I don't -want to die if I can help it. My time must be nigh at hand now, for I -be aud, and a hundred years is too much for any man to expect. And -I'm so nigh it that the Aud Man is already whettin' his scythe. Ye -see, I can't get out o' the habit of caffin' about it all at once. -The chafts will wag as they be used to. Some day soon the Angel of -Death will sound his trumpet for me. But don't ye dooal an' greet, my -deary!"--for he saw that I was crying--"if he should come this very -night I'd not refuse to answer his call. For life be, after all, only -a waitin' for somethin' else than what we're doin', and death be all -that we can rightly depend on. But I'm content, for it's comin' to -me, my deary, and comin' quick. It may be comin' while we be lookin' -and wonderin'. Maybe it's in that wind out over the sea that's -bringin' with it loss and wreck, and sore distress, and sad hearts. -Look! Look!" he cried suddenly. "There's something in that wind and -in the hoast beyont that sounds, and looks, and tastes, and smells -like death. It's in the air. I feel it comin'. Lord, make me answer -cheerful, when my call comes!" He held up his arms devoutly, and -raised his hat. His mouth moved as though he were praying. After a -few minutes' silence, he got up, shook hands with me, and blessed me, -and said goodbye, and hobbled off. It all touched me, and upset me -very much. - -I was glad when the coastguard came along, with his spyglass under his -arm. He stopped to talk with me, as he always does, but all the time -kept looking at a strange ship. - -"I can't make her out," he said. "She's a Russian, by the look of -her. But she's knocking about in the queerest way. She doesn't know -her mind a bit. She seems to see the storm coming, but can't decide -whether to run up north in the open, or to put in here. Look there -again! She is steered mighty strangely, for she doesn't mind the hand -on the wheel, changes about with every puff of wind. We'll hear more -of her before this time tomorrow." - - - - -CHAPTER 7 - - -CUTTING FROM "THE DAILYGRAPH", 8 AUGUST - - -(PASTED IN MINA MURRAY'S JOURNAL) - - -From a correspondent. - -Whitby. - -One of the greatest and suddenest storms on record has just been -experienced here, with results both strange and unique. The weather -had been somewhat sultry, but not to any degree uncommon in the -month of August. Saturday evening was as fine as was ever known, -and the great body of holiday-makers laid out yesterday for visits -to Mulgrave Woods, Robin Hood's Bay, Rig Mill, Runswick, Staithes, -and the various trips in the neighborhood of Whitby. The steamers -Emma and Scarborough made trips up and down the coast, and there was -an unusual amount of 'tripping' both to and from Whitby. The day -was unusually fine till the afternoon, when some of the gossips who -frequent the East Cliff churchyard, and from the commanding eminence -watch the wide sweep of sea visible to the north and east, called -attention to a sudden show of 'mares tails' high in the sky to the -northwest. The wind was then blowing from the south-west in the -mild degree which in barometrical language is ranked 'No. 2, light -breeze.' - -The coastguard on duty at once made report, and one old fisherman, -who for more than half a century has kept watch on weather signs -from the East Cliff, foretold in an emphatic manner the coming of a -sudden storm. The approach of sunset was so very beautiful, so -grand in its masses of splendidly coloured clouds, that there was -quite an assemblage on the walk along the cliff in the old -churchyard to enjoy the beauty. Before the sun dipped below the -black mass of Kettleness, standing boldly athwart the western sky, -its downward way was marked by myriad clouds of every sunset colour, -flame, purple, pink, green, violet, and all the tints of gold, with -here and there masses not large, but of seemingly absolute -blackness, in all sorts of shapes, as well outlined as colossal -silhouettes. The experience was not lost on the painters, and -doubtless some of the sketches of the 'Prelude to the Great Storm' -will grace the R. A and R. I. walls in May next. - -More than one captain made up his mind then and there that his -'cobble' or his 'mule', as they term the different classes of boats, -would remain in the harbour till the storm had passed. The wind -fell away entirely during the evening, and at midnight there was a -dead calm, a sultry heat, and that prevailing intensity which, on -the approach of thunder, affects persons of a sensitive nature. - -There were but few lights in sight at sea, for even the coasting -steamers, which usually hug the shore so closely, kept well to -seaward, and but few fishing boats were in sight. The only sail -noticeable was a foreign schooner with all sails set, which was -seemingly going westwards. The foolhardiness or ignorance of her -officers was a prolific theme for comment whilst she remained in -sight, and efforts were made to signal her to reduce sail in the -face of her danger. Before the night shut down she was seen with -sails idly flapping as she gently rolled on the undulating swell of -the sea. - -"As idle as a painted ship upon a painted ocean." - -Shortly before ten o'clock the stillness of the air grew quite -oppressive, and the silence was so marked that the bleating of a -sheep inland or the barking of a dog in the town was distinctly -heard, and the band on the pier, with its lively French air, was -like a dischord in the great harmony of nature's silence. A little -after midnight came a strange sound from over the sea, and high -overhead the air began to carry a strange, faint, hollow booming. - -Then without warning the tempest broke. With a rapidity which, at -the time, seemed incredible, and even afterwards is impossible to -realize, the whole aspect of nature at once became convulsed. The -waves rose in growing fury, each over-topping its fellow, till in a -very few minutes the lately glassy sea was like a roaring and -devouring monster. White-crested waves beat madly on the level -sands and rushed up the shelving cliffs. Others broke over the -piers, and with their spume swept the lanthorns of the lighthouses -which rise from the end of either pier of Whitby Harbour. - -The wind roared like thunder, and blew with such force that it was -with difficulty that even strong men kept their feet, or clung with -grim clasp to the iron stanchions. It was found necessary to clear -the entire pier from the mass of onlookers, or else the fatalities -of the night would have increased manifold. To add to the -difficulties and dangers of the time, masses of sea-fog came -drifting inland. White, wet clouds, which swept by in ghostly -fashion, so dank and damp and cold that it needed but little effort -of imagination to think that the spirits of those lost at sea were -touching their living brethren with the clammy hands of death, and -many a one shuddered as the wreaths of sea-mist swept by. - -At times the mist cleared, and the sea for some distance could be -seen in the glare of the lightning, which came thick and fast, -followed by such peals of thunder that the whole sky overhead seemed -trembling under the shock of the footsteps of the storm. - -Some of the scenes thus revealed were of immeasurable grandeur and -of absorbing interest. The sea, running mountains high, threw -skywards with each wave mighty masses of white foam, which the -tempest seemed to snatch at and whirl away into space. Here and -there a fishing boat, with a rag of sail, running madly for shelter -before the blast, now and again the white wings of a storm-tossed -seabird. On the summit of the East Cliff the new searchlight was -ready for experiment, but had not yet been tried. The officers in -charge of it got it into working order, and in the pauses of -onrushing mist swept with it the surface of the sea. Once or twice -its service was most effective, as when a fishing boat, with gunwale -under water, rushed into the harbour, able, by the guidance of the -sheltering light, to avoid the danger of dashing against the piers. -As each boat achieved the safety of the port there was a shout of -joy from the mass of people on the shore, a shout which for a moment -seemed to cleave the gale and was then swept away in its rush. - -Before long the searchlight discovered some distance away a schooner -with all sails set, apparently the same vessel which had been -noticed earlier in the evening. The wind had by this time backed to -the east, and there was a shudder amongst the watchers on the cliff -as they realized the terrible danger in which she now was. - -Between her and the port lay the great flat reef on which so many -good ships have from time to time suffered, and, with the wind -blowing from its present quarter, it would be quite impossible that -she should fetch the entrance of the harbour. - -It was now nearly the hour of high tide, but the waves were so great -that in their troughs the shallows of the shore were almost visible, -and the schooner, with all sails set, was rushing with such speed -that, in the words of one old salt, "she must fetch up somewhere, if -it was only in hell". Then came another rush of sea-fog, greater -than any hitherto, a mass of dank mist, which seemed to close on all -things like a gray pall, and left available to men only the organ of -hearing, for the roar of the tempest, and the crash of the thunder, -and the booming of the mighty billows came through the damp oblivion -even louder than before. The rays of the searchlight were kept fixed -on the harbour mouth across the East Pier, where the shock was -expected, and men waited breathless. - -The wind suddenly shifted to the northeast, and the remnant of the -sea fog melted in the blast. And then, mirabile dictu, between the -piers, leaping from wave to wave as it rushed at headlong speed, -swept the strange schooner before the blast, with all sail set, and -gained the safety of the harbour. The searchlight followed her, and -a shudder ran through all who saw her, for lashed to the helm was a -corpse, with drooping head, which swung horribly to and fro at each -motion of the ship. No other form could be seen on the deck at all. - -A great awe came on all as they realised that the ship, as if by a -miracle, had found the harbour, unsteered save by the hand of a dead -man! However, all took place more quickly than it takes to write -these words. The schooner paused not, but rushing across the -harbour, pitched herself on that accumulation of sand and gravel -washed by many tides and many storms into the southeast corner of -the pier jutting under the East Cliff, known locally as Tate Hill -Pier. - -There was of course a considerable concussion as the vessel drove up -on the sand heap. Every spar, rope, and stay was strained, and some -of the 'top-hammer' came crashing down. But, strangest of all, the -very instant the shore was touched, an immense dog sprang up on deck -from below, as if shot up by the concussion, and running forward, -jumped from the bow on the sand. - -Making straight for the steep cliff, where the churchyard hangs over -the laneway to the East Pier so steeply that some of the flat -tombstones, thruffsteans or through-stones, as they call them in -Whitby vernacular, actually project over where the sustaining cliff -has fallen away, it disappeared in the darkness, which seemed -intensified just beyond the focus of the searchlight. - -It so happened that there was no one at the moment on Tate Hill -Pier, as all those whose houses are in close proximity were either -in bed or were out on the heights above. Thus the coastguard on -duty on the eastern side of the harbour, who at once ran down to the -little pier, was the first to climb aboard. The men working the -searchlight, after scouring the entrance of the harbour without -seeing anything, then turned the light on the derelict and kept it -there. The coastguard ran aft, and when he came beside the wheel, -bent over to examine it, and recoiled at once as though under some -sudden emotion. This seemed to pique general curiosity, and quite a -number of people began to run. - -It is a good way round from the West Cliff by the Draw-bridge to -Tate Hill Pier, but your correspondent is a fairly good runner, and -came well ahead of the crowd. When I arrived, however, I found -already assembled on the pier a crowd, whom the coastguard and -police refused to allow to come on board. By the courtesy of the -chief boatman, I was, as your correspondent, permitted to climb on -deck, and was one of a small group who saw the dead seaman whilst -actually lashed to the wheel. - -It was no wonder that the coastguard was surprised, or even awed, -for not often can such a sight have been seen. The man was simply -fastened by his hands, tied one over the other, to a spoke of the -wheel. Between the inner hand and the wood was a crucifix, the set -of beads on which it was fastened being around both wrists and -wheel, and all kept fast by the binding cords. The poor fellow may -have been seated at one time, but the flapping and buffeting of the -sails had worked through the rudder of the wheel and had dragged him -to and fro, so that the cords with which he was tied had cut the -flesh to the bone. - -Accurate note was made of the state of things, and a doctor, Surgeon -J. M. Caffyn, of 33, East Elliot Place, who came immediately after -me, declared, after making examination, that the man must have been -dead for quite two days. - -In his pocket was a bottle, carefully corked, empty save for -a little roll of paper, which proved to be the addendum to -the log. - -The coastguard said the man must have tied up his own hands, -fastening the knots with his teeth. The fact that a coastguard was -the first on board may save some complications later on, in the -Admiralty Court, for coastguards cannot claim the salvage which is -the right of the first civilian entering on a derelict. Already, -however, the legal tongues are wagging, and one young law student is -loudly asserting that the rights of the owner are already completely -sacrificed, his property being held in contravention of the statues -of mortmain, since the tiller, as emblemship, if not proof, of -delegated possession, is held in a dead hand. - -It is needless to say that the dead steersman has been reverently -removed from the place where he held his honourable watch and ward -till death, a steadfastness as noble as that of the young -Casabianca, and placed in the mortuary to await inquest. - -Already the sudden storm is passing, and its fierceness is -abating. Crowds are scattering backward, and the sky is -beginning to redden over the Yorkshire wolds. - -I shall send, in time for your next issue, further details -of the derelict ship which found her way so miraculously -into harbour in the storm. - - -9 August.--The sequel to the strange arrival of the derelict in the -storm last night is almost more startling than the thing itself. It -turns out that the schooner is Russian from Varna, and is called the -Demeter. She is almost entirely in ballast of silver sand, with -only a small amount of cargo, a number of great wooden boxes filled -with mould. - -This cargo was consigned to a Whitby solicitor, Mr. S.F. Billington, -of 7, The Crescent, who this morning went aboard and took formal -possession of the goods consigned to him. - -The Russian consul, too, acting for the charter-party, took formal -possession of the ship, and paid all harbour dues, etc. - -Nothing is talked about here today except the strange coincidence. -The officials of the Board of Trade have been most exacting in -seeing that every compliance has been made with existing -regulations. As the matter is to be a 'nine days wonder', they are -evidently determined that there shall be no cause of other -complaint. - -A good deal of interest was abroad concerning the dog which landed -when the ship struck, and more than a few of the members of the -S.P.C.A., which is very strong in Whitby, have tried to befriend the -animal. To the general disappointment, however, it was not to be -found. It seems to have disappeared entirely from the town. It may -be that it was frightened and made its way on to the moors, where it -is still hiding in terror. - -There are some who look with dread on such a possibility, lest later -on it should in itself become a danger, for it is evidently a fierce -brute. Early this morning a large dog, a half-bred mastiff -belonging to a coal merchant close to Tate Hill Pier, was found dead -in the roadway opposite its master's yard. It had been fighting, -and manifestly had had a savage opponent, for its throat was torn -away, and its belly was slit open as if with a savage claw. - -Later.--By the kindness of the Board of Trade inspector, I have been -permitted to look over the log book of the Demeter, which was in -order up to within three days, but contained nothing of special -interest except as to facts of missing men. The greatest interest, -however, is with regard to the paper found in the bottle, which was -today produced at the inquest. And a more strange narrative than -the two between them unfold it has not been my lot to come across. - -As there is no motive for concealment, I am permitted to use them, -and accordingly send you a transcript, simply omitting technical -details of seamanship and supercargo. It almost seems as though the -captain had been seized with some kind of mania before he had got -well into blue water, and that this had developed persistently -throughout the voyage. Of course my statement must be taken cum -grano, since I am writing from the dictation of a clerk of the -Russian consul, who kindly translated for me, time being short. - - - - LOG OF THE "DEMETER" Varna to Whitby - - - Written 18 July, things so strange happening, that I shall - keep accurate note henceforth till we land. - - - On 6 July we finished taking in cargo, silver sand and boxes - of earth. At noon set sail. East wind, fresh. Crew, five - hands . . . two mates, cook, and myself, (captain). - - - On 11 July at dawn entered Bosphorus. Boarded by Turkish - Customs officers. Backsheesh. All correct. Under way at - 4 p.m. - - - On 12 July through Dardanelles. More Customs officers and - flagboat of guarding squadron. Backsheesh again. Work of - officers thorough, but quick. Want us off soon. At dark - passed into Archipelago. - - - On 13 July passed Cape Matapan. Crew dissatisfied about - something. Seemed scared, but would not speak out. - - - On 14 July was somewhat anxious about crew. Men all steady - fellows, who sailed with me before. Mate could not make out what - was wrong. They only told him there was SOMETHING, and crossed - themselves. Mate lost temper with one of them that day and struck - him. Expected fierce quarrel, but all was quiet. - - - On 16 July mate reported in the morning that one of the - crew, Petrofsky, was missing. Could not account for it. - Took larboard watch eight bells last night, was relieved by - Amramoff, but did not go to bunk. Men more downcast than - ever. All said they expected something of the kind, but - would not say more than there was SOMETHING aboard. Mate - getting very impatient with them. Feared some trouble - ahead. - - - On 17 July, yesterday, one of the men, Olgaren, came to my cabin, - and in an awestruck way confided to me that he thought there was a - strange man aboard the ship. He said that in his watch he had - been sheltering behind the deckhouse, as there was a rain storm, - when he saw a tall, thin man, who was not like any of the crew, - come up the companionway, and go along the deck forward and - disappear. He followed cautiously, but when he got to bows found - no one, and the hatchways were all closed. He was in a panic of - superstitious fear, and I am afraid the panic may spread. To - allay it, I shall today search the entire ship carefully from stem - to stern. - - - Later in the day I got together the whole crew, and told them, as - they evidently thought there was some one in the ship, we would - search from stem to stern. First mate angry, said it was folly, - and to yield to such foolish ideas would demoralise the men, said - he would engage to keep them out of trouble with the handspike. I - let him take the helm, while the rest began a thorough search, all - keeping abreast, with lanterns. We left no corner unsearched. As - there were only the big wooden boxes, there were no odd corners - where a man could hide. Men much relieved when search over, and - went back to work cheerfully. First mate scowled, but said - nothing. - - - 22 July.--Rough weather last three days, and all hands busy - with sails, no time to be frightened. Men seem to have - forgotten their dread. Mate cheerful again, and all on - good terms. Praised men for work in bad weather. Passed - Gibraltar and out through Straits. All well. - - - 24 July.--There seems some doom over this ship. Already a hand - short, and entering the Bay of Biscay with wild weather ahead, and - yet last night another man lost, disappeared. Like the first, he - came off his watch and was not seen again. Men all in a panic of - fear, sent a round robin, asking to have double watch, as they - fear to be alone. Mate angry. Fear there will be some trouble, - as either he or the men will do some violence. - - - 28 July.--Four days in hell, knocking about in a sort of - maelstrom, and the wind a tempest. No sleep for any one. - Men all worn out. Hardly know how to set a watch, since no - one fit to go on. Second mate volunteered to steer and - watch, and let men snatch a few hours sleep. Wind abating, - seas still terrific, but feel them less, as ship is - steadier. - - - 29 July.--Another tragedy. Had single watch tonight, as crew too - tired to double. When morning watch came on deck could find no - one except steersman. Raised outcry, and all came on deck. - Thorough search, but no one found. Are now without second mate, - and crew in a panic. Mate and I agreed to go armed henceforth and - wait for any sign of cause. - - - 30 July.--Last night. Rejoiced we are nearing England. Weather - fine, all sails set. Retired worn out, slept soundly, awakened by - mate telling me that both man of watch and steersman missing. - Only self and mate and two hands left to work ship. - - 1 August.--Two days of fog, and not a sail sighted. Had hoped - when in the English Channel to be able to signal for help or get - in somewhere. Not having power to work sails, have to run before - wind. Dare not lower, as could not raise them again. We seem to - be drifting to some terrible doom. Mate now more demoralised than - either of men. His stronger nature seems to have worked inwardly - against himself. Men are beyond fear, working stolidly and - patiently, with minds made up to worst. They are Russian, he - Roumanian. - - 2 August, midnight.--Woke up from few minutes sleep by hearing a - cry, seemingly outside my port. Could see nothing in fog. Rushed - on deck, and ran against mate. Tells me he heard cry and ran, but - no sign of man on watch. One more gone. Lord, help us! Mate - says we must be past Straits of Dover, as in a moment of fog - lifting he saw North Foreland, just as he heard the man cry out. - If so we are now off in the North Sea, and only God can guide us - in the fog, which seems to move with us, and God seems to have - deserted us. - - - 3 August.--At midnight I went to relieve the man at the - wheel and when I got to it found no one there. The wind - was steady, and as we ran before it there was no yawing. I - dared not leave it, so shouted for the mate. After a few - seconds, he rushed up on deck in his flannels. He looked - wild-eyed and haggard, and I greatly fear his reason has - given way. He came close to me and whispered hoarsely, - with his mouth to my ear, as though fearing the very air - might hear. "It is here. I know it now. On the watch - last night I saw It, like a man, tall and thin, and ghastly - pale. It was in the bows, and looking out. I crept behind - It, and gave it my knife, but the knife went through It, - empty as the air." And as he spoke he took the knife and - drove it savagely into space. Then he went on, "But It is - here, and I'll find It. It is in the hold, perhaps in one - of those boxes. I'll unscrew them one by one and see. You - work the helm." And with a warning look and his finger on - his lip, he went below. There was springing up a choppy - wind, and I could not leave the helm. I saw him come out - on deck again with a tool chest and lantern, and go down - the forward hatchway. He is mad, stark, raving mad, and - it's no use my trying to stop him. He can't hurt those big - boxes, they are invoiced as clay, and to pull them about is - as harmless a thing as he can do. So here I stay and mind - the helm, and write these notes. I can only trust in God - and wait till the fog clears. Then, if I can't steer to - any harbour with the wind that is, I shall cut down sails, - and lie by, and signal for help . . . - - It is nearly all over now. Just as I was beginning to hope - that the mate would come out calmer, for I heard him - knocking away at something in the hold, and work is good - for him, there came up the hatchway a sudden, startled - scream, which made my blood run cold, and up on the deck he - came as if shot from a gun, a raging madman, with his eyes - rolling and his face convulsed with fear. "Save me! Save - me!" he cried, and then looked round on the blanket of fog. - His horror turned to despair, and in a steady voice he - said, "You had better come too, captain, before it is too - late. He is there! I know the secret now. The sea will - save me from Him, and it is all that is left!" Before I - could say a word, or move forward to seize him, he sprang - on the bulwark and deliberately threw himself into the sea. - I suppose I know the secret too, now. It was this madman - who had got rid of the men one by one, and now he has - followed them himself. God help me! How am I to account - for all these horrors when I get to port? When I get to - port! Will that ever be? - - - 4 August.--Still fog, which the sunrise cannot pierce, I - know there is sunrise because I am a sailor, why else I - know not. I dared not go below, I dared not leave the - helm, so here all night I stayed, and in the dimness of the - night I saw it, Him! God, forgive me, but the mate was - right to jump overboard. It was better to die like a man. - To die like a sailor in blue water, no man can object. But - I am captain, and I must not leave my ship. But I shall - baffle this fiend or monster, for I shall tie my hands to - the wheel when my strength begins to fail, and along with - them I shall tie that which He, It, dare not touch. And - then, come good wind or foul, I shall save my soul, and my - honour as a captain. I am growing weaker, and the night is - coming on. If He can look me in the face again, I may not - have time to act. . . If we are wrecked, mayhap this bottle - may be found, and those who find it may understand. If - not . . . well, then all men shall know that I have been - true to my trust. God and the Blessed Virgin and the - Saints help a poor ignorant soul trying to do his duty . . . - - -Of course the verdict was an open one. There is no evidence -to adduce, and whether or not the man himself committed the -murders there is now none to say. The folk here hold almost -universally that the captain is simply a hero, and he is to be -given a public funeral. Already it is arranged that his body -is to be taken with a train of boats up the Esk for a piece -and then brought back to Tate Hill Pier and up the abbey steps, -for he is to be buried in the churchyard on the cliff. The -owners of more than a hundred boats have already given in their -names as wishing to follow him to the grave. - -No trace has ever been found of the great dog, at which there is -much mourning, for, with public opinion in its present state, he -would, I believe, be adopted by the town. Tomorrow will see the -funeral, and so will end this one more 'mystery of the sea'. - - - -MINA MURRAY'S JOURNAL - -8 August.--Lucy was very restless all night, and I too, could not -sleep. The storm was fearful, and as it boomed loudly among the -chimney pots, it made me shudder. When a sharp puff came it seemed to -be like a distant gun. Strangely enough, Lucy did not wake, but she -got up twice and dressed herself. Fortunately, each time I awoke in -time and managed to undress her without waking her, and got her back to -bed. It is a very strange thing, this sleep-walking, for as soon as -her will is thwarted in any physical way, her intention, if there be -any, disappears, and she yields herself almost exactly to the routine -of her life. - -Early in the morning we both got up and went down to the harbour to see -if anything had happened in the night. There were very few people -about, and though the sun was bright, and the air clear and fresh, the -big, grim-looking waves, that seemed dark themselves because the foam -that topped them was like snow, forced themselves in through the mouth -of the harbour, like a bullying man going through a crowd. Somehow I -felt glad that Jonathan was not on the sea last night, but on land. -But, oh, is he on land or sea? Where is he, and how? I am getting -fearfully anxious about him. If I only knew what to do, and could do -anything! - - -10 August.--The funeral of the poor sea captain today was most -touching. Every boat in the harbour seemed to be there, and the coffin -was carried by captains all the way from Tate Hill Pier up to the -churchyard. Lucy came with me, and we went early to our old seat, -whilst the cortege of boats went up the river to the Viaduct and came -down again. We had a lovely view, and saw the procession nearly all -the way. The poor fellow was laid to rest near our seat so that we -stood on it, when the time came and saw everything. - -Poor Lucy seemed much upset. She was restless and uneasy all the time, -and I cannot but think that her dreaming at night is telling on her. -She is quite odd in one thing. She will not admit to me that there is -any cause for restlessness, or if there be, she does not understand it -herself. - -There is an additional cause in that poor Mr. Swales was found dead -this morning on our seat, his neck being broken. He had evidently, as -the doctor said, fallen back in the seat in some sort of fright, for -there was a look of fear and horror on his face that the men said made -them shudder. Poor dear old man! - -Lucy is so sweet and sensitive that she feels influences more acutely -than other people do. Just now she was quite upset by a little thing -which I did not much heed, though I am myself very fond of animals. - -One of the men who came up here often to look for the boats was -followed by his dog. The dog is always with him. They are both quiet -persons, and I never saw the man angry, nor heard the dog bark. During -the service the dog would not come to its master, who was on the seat -with us, but kept a few yards off, barking and howling. Its master -spoke to it gently, and then harshly, and then angrily. But it would -neither come nor cease to make a noise. It was in a fury, with its -eyes savage, and all its hair bristling out like a cat's tail when puss -is on the war path. - -Finally the man too got angry, and jumped down and kicked the dog, and -then took it by the scruff of the neck and half dragged and half threw -it on the tombstone on which the seat is fixed. The moment it touched -the stone the poor thing began to tremble. It did not try to get away, -but crouched down, quivering and cowering, and was in such a pitiable -state of terror that I tried, though without effect, to comfort it. - -Lucy was full of pity, too, but she did not attempt to touch the dog, -but looked at it in an agonised sort of way. I greatly fear that she -is of too super sensitive a nature to go through the world without -trouble. She will be dreaming of this tonight, I am sure. The whole -agglomeration of things, the ship steered into port by a dead man, his -attitude, tied to the wheel with a crucifix and beads, the touching -funeral, the dog, now furious and now in terror, will all afford -material for her dreams. - -I think it will be best for her to go to bed tired out physically, so I -shall take her for a long walk by the cliffs to Robin Hood's Bay and -back. She ought not to have much inclination for sleep-walking then. - - - - -CHAPTER 8 - - -MINA MURRAY'S JOURNAL - -Same day, 11 o'clock P.M.--Oh, but I am tired! If it were not that I -had made my diary a duty I should not open it tonight. We had a lovely -walk. Lucy, after a while, was in gay spirits, owing, I think, to some -dear cows who came nosing towards us in a field close to the -lighthouse, and frightened the wits out of us. I believe we forgot -everything, except of course, personal fear, and it seemed to wipe the -slate clean and give us a fresh start. We had a capital 'severe tea' -at Robin Hood's Bay in a sweet little old-fashioned inn, with a bow -window right over the seaweed-covered rocks of the strand. I believe -we should have shocked the 'New Woman' with our appetites. Men are -more tolerant, bless them! Then we walked home with some, or rather -many, stoppages to rest, and with our hearts full of a constant dread -of wild bulls. - -Lucy was really tired, and we intended to creep off to bed as soon as -we could. The young curate came in, however, and Mrs. Westenra asked -him to stay for supper. Lucy and I had both a fight for it with the -dusty miller. I know it was a hard fight on my part, and I am quite -heroic. I think that some day the bishops must get together and see -about breeding up a new class of curates, who don't take supper, no -matter how hard they may be pressed to, and who will know when girls -are tired. - -Lucy is asleep and breathing softly. She has more colour in her cheeks -than usual, and looks, oh so sweet. If Mr. Holmwood fell in love with -her seeing her only in the drawing room, I wonder what he would say if -he saw her now. Some of the 'New Women' writers will some day start an -idea that men and women should be allowed to see each other asleep -before proposing or accepting. But I suppose the 'New Woman' won't -condescend in future to accept. She will do the proposing herself. And -a nice job she will make of it too! There's some consolation in that. -I am so happy tonight, because dear Lucy seems better. I really -believe she has turned the corner, and that we are over her troubles -with dreaming. I should be quite happy if I only knew if Jonathan . . . -God bless and keep him. - - -11 August.--Diary again. No sleep now, so I may as well write. I am -too agitated to sleep. We have had such an adventure, such an -agonizing experience. I fell asleep as soon as I had closed my diary. -. . . Suddenly I became broad awake, and sat up, with a horrible sense -of fear upon me, and of some feeling of emptiness around me. The room -was dark, so I could not see Lucy's bed. I stole across and felt for -her. The bed was empty. I lit a match and found that she was not in -the room. The door was shut, but not locked, as I had left it. I feared -to wake her mother, who has been more than usually ill lately, so threw -on some clothes and got ready to look for her. As I was leaving the -room it struck me that the clothes she wore might give me some clue to -her dreaming intention. Dressing-gown would mean house, dress outside. -Dressing-gown and dress were both in their places. "Thank God," I said -to myself, "she cannot be far, as she is only in her nightdress." - -I ran downstairs and looked in the sitting room. Not there! Then I -looked in all the other rooms of the house, with an ever-growing fear -chilling my heart. Finally, I came to the hall door and found it open. -It was not wide open, but the catch of the lock had not caught. The -people of the house are careful to lock the door every night, so I -feared that Lucy must have gone out as she was. There was no time to -think of what might happen. A vague over-mastering fear obscured all -details. - -I took a big, heavy shawl and ran out. The clock was striking one as I -was in the Crescent, and there was not a soul in sight. I ran along -the North Terrace, but could see no sign of the white figure which I -expected. At the edge of the West Cliff above the pier I looked across -the harbour to the East Cliff, in the hope or fear, I don't know which, -of seeing Lucy in our favourite seat. - -There was a bright full moon, with heavy black, driving clouds, which -threw the whole scene into a fleeting diorama of light and shade as -they sailed across. For a moment or two I could see nothing, as the -shadow of a cloud obscured St. Mary's Church and all around it. Then -as the cloud passed I could see the ruins of the abbey coming into -view, and as the edge of a narrow band of light as sharp as a sword-cut -moved along, the church and churchyard became gradually visible. -Whatever my expectation was, it was not disappointed, for there, on our -favourite seat, the silver light of the moon struck a half-reclining -figure, snowy white. The coming of the cloud was too quick for me to -see much, for shadow shut down on light almost immediately, but it -seemed to me as though something dark stood behind the seat where the -white figure shone, and bent over it. What it was, whether man or -beast, I could not tell. - -I did not wait to catch another glance, but flew down the steep steps -to the pier and along by the fish-market to the bridge, which was the -only way to reach the East Cliff. The town seemed as dead, for not a -soul did I see. I rejoiced that it was so, for I wanted no witness of -poor Lucy's condition. The time and distance seemed endless, and my -knees trembled and my breath came laboured as I toiled up the endless -steps to the abbey. I must have gone fast, and yet it seemed to me as -if my feet were weighted with lead, and as though every joint in my -body were rusty. - -When I got almost to the top I could see the seat and the white figure, -for I was now close enough to distinguish it even through the spells of -shadow. There was undoubtedly something, long and black, bending over -the half-reclining white figure. I called in fright, "Lucy! Lucy!" -and something raised a head, and from where I was I could see a white -face and red, gleaming eyes. - -Lucy did not answer, and I ran on to the entrance of the churchyard. -As I entered, the church was between me and the seat, and for a minute -or so I lost sight of her. When I came in view again the cloud had -passed, and the moonlight struck so brilliantly that I could see Lucy -half reclining with her head lying over the back of the seat. She was -quite alone, and there was not a sign of any living thing about. - -When I bent over her I could see that she was still asleep. Her lips -were parted, and she was breathing, not softly as usual with her, but -in long, heavy gasps, as though striving to get her lungs full at every -breath. As I came close, she put up her hand in her sleep and pulled -the collar of her nightdress close around her, as though she felt the -cold. I flung the warm shawl over her, and drew the edges tight around -her neck, for I dreaded lest she should get some deadly chill from the -night air, unclad as she was. I feared to wake her all at once, so, in -order to have my hands free to help her, I fastened the shawl at her -throat with a big safety pin. But I must have been clumsy in my -anxiety and pinched or pricked her with it, for by-and-by, when her -breathing became quieter, she put her hand to her throat again and -moaned. When I had her carefully wrapped up I put my shoes on her -feet, and then began very gently to wake her. - -At first she did not respond, but gradually she became more and more -uneasy in her sleep, moaning and sighing occasionally. At last, as -time was passing fast, and for many other reasons, I wished to get her -home at once, I shook her forcibly, till finally she opened her eyes -and awoke. She did not seem surprised to see me, as, of course, she -did not realize all at once where she was. - -Lucy always wakes prettily, and even at such a time, when her body must -have been chilled with cold, and her mind somewhat appalled at waking -unclad in a churchyard at night, she did not lose her grace. She -trembled a little, and clung to me. When I told her to come at once -with me home, she rose without a word, with the obedience of a child. -As we passed along, the gravel hurt my feet, and Lucy noticed me wince. -She stopped and wanted to insist upon my taking my shoes, but I would -not. However, when we got to the pathway outside the chruchyard, where -there was a puddle of water, remaining from the storm, I daubed my feet -with mud, using each foot in turn on the other, so that as we went -home, no one, in case we should meet any one, should notice my bare -feet. - -Fortune favoured us, and we got home without meeting a soul. Once we -saw a man, who seemed not quite sober, passing along a street in front -of us. But we hid in a door till he had disappeared up an opening such -as there are here, steep little closes, or 'wynds', as they call them -in Scotland. My heart beat so loud all the time sometimes I thought I -should faint. I was filled with anxiety about Lucy, not only for her -health, lest she should suffer from the exposure, but for her -reputation in case the story should get wind. When we got in, and had -washed our feet, and had said a prayer of thankfulness together, I -tucked her into bed. Before falling asleep she asked, even implored, -me not to say a word to any one, even her mother, about her -sleep-walking adventure. - -I hesitated at first, to promise, but on thinking of the state of her -mother's health, and how the knowledge of such a thing would fret her, -and think too, of how such a story might become distorted, nay, -infallibly would, in case it should leak out, I thought it wiser to do -so. I hope I did right. I have locked the door, and the key is tied -to my wrist, so perhaps I shall not be again disturbed. Lucy is -sleeping soundly. The reflex of the dawn is high and far over the -sea . . . - - -Same day, noon.--All goes well. Lucy slept till I woke her and seemed -not to have even changed her side. The adventure of the night does not -seem to have harmed her, on the contrary, it has benefited her, for she -looks better this morning than she has done for weeks. I was sorry to -notice that my clumsiness with the safety-pin hurt her. Indeed, it -might have been serious, for the skin of her throat was pierced. I -must have pinched up a piece of loose skin and have transfixed it, for -there are two little red points like pin-pricks, and on the band of her -nightdress was a drop of blood. When I apologised and was concerned -about it, she laughed and petted me, and said she did not even feel it. -Fortunately it cannot leave a scar, as it is so tiny. - - -Same day, night.--We passed a happy day. The air was clear, and the -sun bright, and there was a cool breeze. We took our lunch to Mulgrave -Woods, Mrs. Westenra driving by the road and Lucy and I walking by the -cliff-path and joining her at the gate. I felt a little sad myself, -for I could not but feel how absolutely happy it would have been had -Jonathan been with me. But there! I must only be patient. In the -evening we strolled in the Casino Terrace, and heard some good music by -Spohr and Mackenzie, and went to bed early. Lucy seems more restful -than she has been for some time, and fell asleep at once. I shall lock -the door and secure the key the same as before, though I do not expect -any trouble tonight. - - -12 August.--My expectations were wrong, for twice during the night I -was wakened by Lucy trying to get out. She seemed, even in her sleep, -to be a little impatient at finding the door shut, and went back to bed -under a sort of protest. I woke with the dawn, and heard the birds -chirping outside of the window. Lucy woke, too, and I was glad to see, -was even better than on the previous morning. All her old gaiety of -manner seemed to have come back, and she came and snuggled in beside me -and told me all about Arthur. I told her how anxious I was about -Jonathan, and then she tried to comfort me. Well, she succeeded -somewhat, for, though sympathy can't alter facts, it can make them more -bearable. - - -13 August.--Another quiet day, and to bed with the key on my wrist as -before. Again I awoke in the night, and found Lucy sitting up in bed, -still asleep, pointing to the window. I got up quietly, and pulling -aside the blind, looked out. It was brilliant moonlight, and the soft -effect of the light over the sea and sky, merged together in one great -silent mystery, was beautiful beyond words. Between me and the -moonlight flitted a great bat, coming and going in great whirling -circles. Once or twice it came quite close, but was, I suppose, -frightened at seeing me, and flitted away across the harbour towards -the abbey. When I came back from the window Lucy had lain down again, -and was sleeping peacefully. She did not stir again all night. - - -14 August.--On the East Cliff, reading and writing all day. Lucy seems -to have become as much in love with the spot as I am, and it is hard to -get her away from it when it is time to come home for lunch or tea or -dinner. This afternoon she made a funny remark. We were coming home -for dinner, and had come to the top of the steps up from the West Pier -and stopped to look at the view, as we generally do. The setting sun, -low down in the sky, was just dropping behind Kettleness. The red -light was thrown over on the East Cliff and the old abbey, and seemed -to bathe everything in a beautiful rosy glow. We were silent for a -while, and suddenly Lucy murmured as if to herself . . . - -"His red eyes again! They are just the same." It was such an odd -expression, coming apropos of nothing, that it quite startled me. I -slewed round a little, so as to see Lucy well without seeming to stare -at her, and saw that she was in a half dreamy state, with an odd look -on her face that I could not quite make out, so I said nothing, but -followed her eyes. She appeared to be looking over at our own seat, -whereon was a dark figure seated alone. I was quite a little startled -myself, for it seemed for an instant as if the stranger had great eyes -like burning flames, but a second look dispelled the illusion. The red -sunlight was shining on the windows of St. Mary's Church behind our -seat, and as the sun dipped there was just sufficient change in the -refraction and reflection to make it appear as if the light moved. I -called Lucy's attention to the peculiar effect, and she became herself -with a start, but she looked sad all the same. It may have been that -she was thinking of that terrible night up there. We never refer to -it, so I said nothing, and we went home to dinner. Lucy had a headache -and went early to bed. I saw her asleep, and went out for a little -stroll myself. - -I walked along the cliffs to the westward, and was full of sweet -sadness, for I was thinking of Jonathan. When coming home, it was then -bright moonlight, so bright that, though the front of our part of the -Crescent was in shadow, everything could be well seen, I threw a glance -up at our window, and saw Lucy's head leaning out. I opened my -handkerchief and waved it. She did not notice or make any movement -whatever. Just then, the moonlight crept round an angle of the -building, and the light fell on the window. There distinctly was Lucy -with her head lying up against the side of the window sill and her eyes -shut. She was fast asleep, and by her, seated on the window sill, was -something that looked like a good-sized bird. I was afraid she might -get a chill, so I ran upstairs, but as I came into the room she was -moving back to her bed, fast asleep, and breathing heavily. She was -holding her hand to her throat, as though to protect if from the cold. - -I did not wake her, but tucked her up warmly. I have taken care that -the door is locked and the window securely fastened. - -She looks so sweet as she sleeps, but she is paler than is her wont, -and there is a drawn, haggard look under her eyes which I do not like. -I fear she is fretting about something. I wish I could find out what it -is. - - -15 August.--Rose later than usual. Lucy was languid and tired, and -slept on after we had been called. We had a happy surprise at -breakfast. Arthur's father is better, and wants the marriage to come -off soon. Lucy is full of quiet joy, and her mother is glad and sorry -at once. Later on in the day she told me the cause. She is grieved to -lose Lucy as her very own, but she is rejoiced that she is soon to have -some one to protect her. Poor dear, sweet lady! She confided to me -that she has got her death warrant. She has not told Lucy, and made me -promise secrecy. Her doctor told her that within a few months, at -most, she must die, for her heart is weakening. At any time, even now, -a sudden shock would be almost sure to kill her. Ah, we were wise to -keep from her the affair of the dreadful night of Lucy's sleep-walking. - - -17 August.--No diary for two whole days. I have not had the heart to -write. Some sort of shadowy pall seems to be coming over our -happiness. No news from Jonathan, and Lucy seems to be growing weaker, -whilst her mother's hours are numbering to a close. I do not -understand Lucy's fading away as she is doing. She eats well and -sleeps well, and enjoys the fresh air, but all the time the roses in -her cheeks are fading, and she gets weaker and more languid day by day. -At night I hear her gasping as if for air. - -I keep the key of our door always fastened to my wrist at night, but -she gets up and walks about the room, and sits at the open window. -Last night I found her leaning out when I woke up, and when I tried to -wake her I could not. - -She was in a faint. When I managed to restore her, she was weak as -water, and cried silently between long, painful struggles for breath. -When I asked her how she came to be at the window she shook her head -and turned away. - -I trust her feeling ill may not be from that unlucky prick of the -safety-pin. I looked at her throat just now as she lay asleep, and the -tiny wounds seem not to have healed. They are still open, and, if -anything, larger than before, and the edges of them are faintly white. -They are like little white dots with red centres. Unless they heal -within a day or two, I shall insist on the doctor seeing about them. - - - -LETTER, SAMUEL F. BILLINGTON & SON, SOLICITORS WHITBY, -TO MESSRS. CARTER, PATERSON & CO., LONDON. - -17 August - -"Dear Sirs,--Herewith please receive invoice of goods sent by Great -Northern Railway. Same are to be delivered at Carfax, near -Purfleet, immediately on receipt at goods station King's Cross. The -house is at present empty, but enclosed please find keys, all of -which are labelled. - -"You will please deposit the boxes, fifty in number, which form the -consignment, in the partially ruined building forming part of the -house and marked 'A' on rough diagrams enclosed. Your agent will -easily recognize the locality, as it is the ancient chapel of the -mansion. The goods leave by the train at 9:30 tonight, and will be -due at King's Cross at 4:30 tomorrow afternoon. As our client -wishes the delivery made as soon as possible, we shall be obliged by -your having teams ready at King's Cross at the time named and -forthwith conveying the goods to destination. In order to obviate -any delays possible through any routine requirements as to payment -in your departments, we enclose cheque herewith for ten pounds, -receipt of which please acknowledge. Should the charge be less than -this amount, you can return balance, if greater, we shall at once -send cheque for difference on hearing from you. You are to leave -the keys on coming away in the main hall of the house, where the -proprietor may get them on his entering the house by means of his -duplicate key. - -"Pray do not take us as exceeding the bounds of business courtesy -in pressing you in all ways to use the utmost expedition. - -"We are, dear Sirs, -Faithfully yours, -SAMUEL F. BILLINGTON & SON" - - - -LETTER, MESSRS. CARTER, PATERSON & CO., LONDON, -TO MESSRS. BILLINGTON & SON, WHITBY. - -21 August. - -"Dear Sirs,--We beg to acknowledge 10 pounds received and to return -cheque of 1 pound, 17s, 9d, amount of overplus, as shown in -receipted account herewith. Goods are delivered in exact accordance -with instructions, and keys left in parcel in main hall, as -directed. - -"We are, dear Sirs, -Yours respectfully, -Pro CARTER, PATERSON & CO." - - - -MINA MURRAY'S JOURNAL. - -18 August.--I am happy today, and write sitting on the seat in the -churchyard. Lucy is ever so much better. Last night she slept well -all night, and did not disturb me once. - -The roses seem coming back already to her cheeks, though she is still -sadly pale and wan-looking. If she were in any way anemic I could -understand it, but she is not. She is in gay spirits and full of life -and cheerfulness. All the morbid reticence seems to have passed from -her, and she has just reminded me, as if I needed any reminding, of -that night, and that it was here, on this very seat, I found her -asleep. - -As she told me she tapped playfully with the heel of her boot on the -stone slab and said, - -"My poor little feet didn't make much noise then! I daresay poor old -Mr. Swales would have told me that it was because I didn't want to wake -up Geordie." - -As she was in such a communicative humour, I asked her if she had -dreamed at all that night. - -Before she answered, that sweet, puckered look came into her forehead, -which Arthur, I call him Arthur from her habit, says he loves, and -indeed, I don't wonder that he does. Then she went on in a -half-dreaming kind of way, as if trying to recall it to herself. - -"I didn't quite dream, but it all seemed to be real. I only wanted to -be here in this spot. I don't know why, for I was afraid of something, -I don't know what. I remember, though I suppose I was asleep, passing -through the streets and over the bridge. A fish leaped as I went by, -and I leaned over to look at it, and I heard a lot of dogs howling. The -whole town seemed as if it must be full of dogs all howling at once, as -I went up the steps. Then I had a vague memory of something long and -dark with red eyes, just as we saw in the sunset, and something very -sweet and very bitter all around me at once. And then I seemed sinking -into deep green water, and there was a singing in my ears, as I have -heard there is to drowning men, and then everything seemed passing away -from me. My soul seemed to go out from my body and float about the -air. I seem to remember that once the West Lighthouse was right under -me, and then there was a sort of agonizing feeling, as if I were in an -earthquake, and I came back and found you shaking my body. I saw you -do it before I felt you." - -Then she began to laugh. It seemed a little uncanny to me, and I -listened to her breathlessly. I did not quite like it, and thought it -better not to keep her mind on the subject, so we drifted on to another -subject, and Lucy was like her old self again. When we got home the -fresh breeze had braced her up, and her pale cheeks were really more -rosy. Her mother rejoiced when she saw her, and we all spent a very -happy evening together. - - -19 August.--Joy, joy, joy! Although not all joy. At last, news of -Jonathan. The dear fellow has been ill, that is why he did not write. -I am not afraid to think it or to say it, now that I know. Mr. Hawkins -sent me on the letter, and wrote himself, oh so kindly. I am to leave -in the morning and go over to Jonathan, and to help to nurse him if -necessary, and to bring him home. Mr. Hawkins says it would not be a -bad thing if we were to be married out there. I have cried over the -good Sister's letter till I can feel it wet against my bosom, where it -lies. It is of Jonathan, and must be near my heart, for he is in my -heart. My journey is all mapped out, and my luggage ready. I am only -taking one change of dress. Lucy will bring my trunk to London and -keep it till I send for it, for it may be that . . . I must write no -more. I must keep it to say to Jonathan, my husband. The letter that -he has seen and touched must comfort me till we meet. - - - -LETTER, SISTER AGATHA, HOSPITAL OF ST. JOSEPH AND -STE. MARY BUDA-PESTH, TO MISS WILLHELMINA MURRAY - -12 August, - -"Dear Madam. - -"I write by desire of Mr. Jonathan Harker, who is himself not strong -enough to write, though progressing well, thanks to God and St. -Joseph and Ste. Mary. He has been under our care for nearly six -weeks, suffering from a violent brain fever. He wishes me to convey -his love, and to say that by this post I write for him to Mr. Peter -Hawkins, Exeter, to say, with his dutiful respects, that he is sorry -for his delay, and that all of his work is completed. He will -require some few weeks' rest in our sanatorium in the hills, but -will then return. He wishes me to say that he has not sufficient -money with him, and that he would like to pay for his staying here, -so that others who need shall not be wanting for help. - -"Believe me, - -"Yours, with sympathy -and all blessings. -Sister Agatha - -"P.S.--My patient being asleep, I open this to let you know -something more. He has told me all about you, and that you are -shortly to be his wife. All blessings to you both! He has had some -fearful shock, so says our doctor, and in his delirium his ravings -have been dreadful, of wolves and poison and blood, of ghosts and -demons, and I fear to say of what. Be careful of him always that -there may be nothing to excite him of this kind for a long time to -come. The traces of such an illness as his do not lightly die away. -We should have written long ago, but we knew nothing of his friends, -and there was nothing on him, nothing that anyone could understand. -He came in the train from Klausenburg, and the guard was told by the -station master there that he rushed into the station shouting for a -ticket for home. Seeing from his violent demeanour that he was -English, they gave him a ticket for the furthest station on the way -thither that the train reached. - -"Be assured that he is well cared for. He has won all hearts by his -sweetness and gentleness. He is truly getting on well, and I have -no doubt will in a few weeks be all himself. But be careful of him -for safety's sake. There are, I pray God and St. Joseph and Ste. -Mary, many, many, happy years for you both." - - - -DR. SEWARD'S DIARY - -19 August.--Strange and sudden change in Renfield last night. About -eight o'clock he began to get excited and sniff about as a dog does -when setting. The attendant was struck by his manner, and knowing my -interest in him, encouraged him to talk. He is usually respectful to -the attendant and at times servile, but tonight, the man tells me, he -was quite haughty. Would not condescend to talk with him at all. - -All he would say was, "I don't want to talk to you. You don't count -now. The master is at hand." - -The attendant thinks it is some sudden form of religious mania which -has seized him. If so, we must look out for squalls, for a strong man -with homicidal and religious mania at once might be dangerous. The -combination is a dreadful one. - -At nine o'clock I visited him myself. His attitude to me was the same -as that to the attendant. In his sublime self-feeling the difference -between myself and the attendant seemed to him as nothing. It looks -like religious mania, and he will soon think that he himself is God. - -These infinitesimal distinctions between man and man are too paltry for -an Omnipotent Being. How these madmen give themselves away! The real -God taketh heed lest a sparrow fall. But the God created from human -vanity sees no difference between an eagle and a sparrow. Oh, if men -only knew! - -For half an hour or more Renfield kept getting excited in greater and -greater degree. I did not pretend to be watching him, but I kept -strict observation all the same. All at once that shifty look came -into his eyes which we always see when a madman has seized an idea, and -with it the shifty movement of the head and back which asylum -attendants come to know so well. He became quite quiet, and went and -sat on the edge of his bed resignedly, and looked into space with -lack-luster eyes. - -I thought I would find out if his apathy were real or only assumed, and -tried to lead him to talk of his pets, a theme which had never failed -to excite his attention. - -At first he made no reply, but at length said testily, "Bother them -all! I don't care a pin about them." - -"What?" I said. "You don't mean to tell me you don't care about -spiders?" (Spiders at present are his hobby and the notebook is filling -up with columns of small figures.) - -To this he answered enigmatically, "The Bride maidens rejoice the eyes -that wait the coming of the bride. But when the bride draweth nigh, -then the maidens shine not to the eyes that are filled." - -He would not explain himself, but remained obstinately seated on his -bed all the time I remained with him. - -I am weary tonight and low in spirits. I cannot but think of Lucy, and -how different things might have been. If I don't sleep at once, -chloral, the modern Morpheus! I must be careful not to let it grow -into a habit. No, I shall take none tonight! I have thought of Lucy, -and I shall not dishonour her by mixing the two. If need be, tonight -shall be sleepless. - - -Later.--Glad I made the resolution, gladder that I kept to it. I had -lain tossing about, and had heard the clock strike only twice, when the -night watchman came to me, sent up from the ward, to say that Renfield -had escaped. I threw on my clothes and ran down at once. My patient -is too dangerous a person to be roaming about. Those ideas of his -might work out dangerously with strangers. - -The attendant was waiting for me. He said he had seen him not ten -minutes before, seemingly asleep in his bed, when he had looked through -the observation trap in the door. His attention was called by the -sound of the window being wrenched out. He ran back and saw his feet -disappear through the window, and had at once sent up for me. He was -only in his night gear, and cannot be far off. - -The attendant thought it would be more useful to watch where he should -go than to follow him, as he might lose sight of him whilst getting out -of the building by the door. He is a bulky man, and couldn't get -through the window. - -I am thin, so, with his aid, I got out, but feet foremost, and as we -were only a few feet above ground landed unhurt. - -The attendant told me the patient had gone to the left, and had taken a -straight line, so I ran as quickly as I could. As I got through the -belt of trees I saw a white figure scale the high wall which separates -our grounds from those of the deserted house. - -I ran back at once, told the watchman to get three or four men -immediately and follow me into the grounds of Carfax, in case our -friend might be dangerous. I got a ladder myself, and crossing the -wall, dropped down on the other side. I could see Renfield's figure -just disappearing behind the angle of the house, so I ran after him. On -the far side of the house I found him pressed close against the old -iron-bound oak door of the chapel. - -He was talking, apparently to some one, but I was afraid to go near -enough to hear what he was saying, lest I might frighten him, and he -should run off. - -Chasing an errant swarm of bees is nothing to following a naked -lunatic, when the fit of escaping is upon him! After a few minutes, -however, I could see that he did not take note of anything around him, -and so ventured to draw nearer to him, the more so as my men had now -crossed the wall and were closing him in. I heard him say . . . - -"I am here to do your bidding, Master. I am your slave, and you will -reward me, for I shall be faithful. I have worshipped you long and afar -off. Now that you are near, I await your commands, and you will not -pass me by, will you, dear Master, in your distribution of good -things?" - -He is a selfish old beggar anyhow. He thinks of the loaves and fishes -even when he believes his is in a real Presence. His manias make a -startling combination. When we closed in on him he fought like a -tiger. He is immensely strong, for he was more like a wild beast than -a man. - -I never saw a lunatic in such a paroxysm of rage before, and I hope I -shall not again. It is a mercy that we have found out his strength and -his danger in good time. With strength and determination like his, he -might have done wild work before he was caged. - -He is safe now, at any rate. Jack Sheppard himself couldn't get free -from the strait waistcoat that keeps him restrained, and he's chained -to the wall in the padded room. - -His cries are at times awful, but the silences that follow are more -deadly still, for he means murder in every turn and movement. - -Just now he spoke coherent words for the first time. "I shall be -patient, Master. It is coming, coming, coming!" - -So I took the hint, and came too. I was too excited to sleep, but this -diary has quieted me, and I feel I shall get some sleep tonight. - - - - -CHAPTER 9 - - -LETTER, MINA HARKER TO LUCY WESTENRA - - -Buda-Pesth, 24 August. - -"My dearest Lucy, - -"I know you will be anxious to hear all that has happened -since we parted at the railway station at Whitby. - -"Well, my dear, I got to Hull all right, and caught the boat to -Hamburg, and then the train on here. I feel that I can hardly -recall anything of the journey, except that I knew I was coming to -Jonathan, and that as I should have to do some nursing, I had better -get all the sleep I could. I found my dear one, oh, so thin and -pale and weak-looking. All the resolution has gone out of his dear -eyes, and that quiet dignity which I told you was in his face has -vanished. He is only a wreck of himself, and he does not remember -anything that has happened to him for a long time past. At least, -he wants me to believe so, and I shall never ask. - -"He has had some terrible shock, and I fear it might tax his poor -brain if he were to try to recall it. Sister Agatha, who is a good -creature and a born nurse, tells me that he wanted her to tell me -what they were, but she would only cross herself, and say she would -never tell. That the ravings of the sick were the secrets of God, -and that if a nurse through her vocation should hear them, she -should respect her trust. - -"She is a sweet, good soul, and the next day, when she saw I was -troubled, she opened up the subject my poor dear raved about, added, -'I can tell you this much, my dear. That it was not about anything -which he has done wrong himself, and you, as his wife to be, have no -cause to be concerned. He has not forgotten you or what he owes to -you. His fear was of great and terrible things, which no mortal can -treat of.' - -"I do believe the dear soul thought I might be jealous lest my poor -dear should have fallen in love with any other girl. The idea of my -being jealous about Jonathan! And yet, my dear, let me whisper, I -felt a thrill of joy through me when I knew that no other woman was -a cause for trouble. I am now sitting by his bedside, where I can -see his face while he sleeps. He is waking! - -"When he woke he asked me for his coat, as he wanted to get -something from the pocket. I asked Sister Agatha, and she brought -all his things. I saw amongst them was his notebook, and was -going to ask him to let me look at it, for I knew that I might find -some clue to his trouble, but I suppose he must have seen my wish in -my eyes, for he sent me over to the window, saying he wanted to be -quite alone for a moment. - -"Then he called me back, and he said to me very solemnly, -'Wilhelmina', I knew then that he was in deadly earnest, for he has -never called me by that name since he asked me to marry him, 'You -know, dear, my ideas of the trust between husband and wife. There -should be no secret, no concealment. I have had a great shock, and -when I try to think of what it is I feel my head spin round, and I -do not know if it was real of the dreaming of a madman. You know I -had brain fever, and that is to be mad. The secret is here, and I -do not want to know it. I want to take up my life here, with our -marriage.' For, my dear, we had decided to be married as soon as -the formalities are complete. 'Are you willing, Wilhelmina, to -share my ignorance? Here is the book. Take it and keep it, read it -if you will, but never let me know unless, indeed, some solemn duty -should come upon me to go back to the bitter hours, asleep or awake, -sane or mad, recorded here.' He fell back exhausted, and I put the -book under his pillow, and kissed him. I have asked Sister Agatha -to beg the Superior to let our wedding be this afternoon, and am -waiting her reply . . ." - - -"She has come and told me that the Chaplain of the English mission -church has been sent for. We are to be married in an hour, or as -soon after as Jonathan awakes." - -"Lucy, the time has come and gone. I feel very solemn, but very, -very happy. Jonathan woke a little after the hour, and all was -ready, and he sat up in bed, propped up with pillows. He answered -his 'I will' firmly and strong. I could hardly speak. My heart was -so full that even those words seemed to choke me. - -"The dear sisters were so kind. Please, God, I shall never, never -forget them, nor the grave and sweet responsibilities I have taken -upon me. I must tell you of my wedding present. When the chaplain -and the sisters had left me alone with my husband--oh, Lucy, it is -the first time I have written the words 'my husband'--left me alone -with my husband, I took the book from under his pillow, and wrapped -it up in white paper, and tied it with a little bit of pale blue -ribbon which was round my neck, and sealed it over the knot with -sealing wax, and for my seal I used my wedding ring. Then I kissed -it and showed it to my husband, and told him that I would keep it -so, and then it would be an outward and visible sign for us all our -lives that we trusted each other, that I would never open it unless -it were for his own dear sake or for the sake of some stern duty. -Then he took my hand in his, and oh, Lucy, it was the first time he -took his wife's hand, and said that it was the dearest thing in all -the wide world, and that he would go through all the past again to -win it, if need be. The poor dear meant to have said a part of the -past, but he cannot think of time yet, and I shall not wonder if at -first he mixes up not only the month, but the year. - -"Well, my dear, what could I say? I could only tell him that I was -the happiest woman in all the wide world, and that I had nothing to -give him except myself, my life, and my trust, and that with these -went my love and duty for all the days of my life. And, my dear, -when he kissed me, and drew me to him with his poor weak hands, it -was like a solemn pledge between us. - -"Lucy dear, do you know why I tell you all this? It is not only -because it is all sweet to me, but because you have been, and are, -very dear to me. It was my privilege to be your friend and guide -when you came from the schoolroom to prepare for the world of life. -I want you to see now, and with the eyes of a very happy wife, -whither duty has led me, so that in your own married life you too -may be all happy, as I am. My dear, please Almighty God, your life -may be all it promises, a long day of sunshine, with no harsh wind, -no forgetting duty, no distrust. I must not wish you no pain, for -that can never be, but I do hope you will be always as happy as I am -now. Goodbye, my dear. I shall post this at once, and perhaps, -write you very soon again. I must stop, for Jonathan is waking. I -must attend my husband! - -"Your ever-loving -Mina Harker." - - - -LETTER, LUCY WESTENRA TO MINA HARKER. - -Whitby, 30 August. - -"My dearest Mina, - -"Oceans of love and millions of kisses, and may you soon be in your -own home with your husband. I wish you were coming home soon enough -to stay with us here. The strong air would soon restore Jonathan. -It has quite restored me. I have an appetite like a cormorant, am -full of life, and sleep well. You will be glad to know that I have -quite given up walking in my sleep. I think I have not stirred out -of my bed for a week, that is when I once got into it at night. -Arthur says I am getting fat. By the way, I forgot to tell you that -Arthur is here. We have such walks and drives, and rides, and -rowing, and tennis, and fishing together, and I love him more than -ever. He tells me that he loves me more, but I doubt that, for at -first he told me that he couldn't love me more than he did then. -But this is nonsense. There he is, calling to me. So no more just -at present from your loving, - -"Lucy. - -"P.S.--Mother sends her love. She seems better, poor dear. - -"P.P.S.--We are to be married on 28 September." - - - -DR. SEWARDS DIARY - -20 August.--The case of Renfield grows even more interesting. He has -now so far quieted that there are spells of cessation from his -passion. For the first week after his attack he was perpetually -violent. Then one night, just as the moon rose, he grew quiet, and -kept murmuring to himself. "Now I can wait. Now I can wait." - -The attendant came to tell me, so I ran down at once to have a look at -him. He was still in the strait waistcoat and in the padded room, but -the suffused look had gone from his face, and his eyes had something -of their old pleading. I might almost say, cringing, softness. I was -satisfied with his present condition, and directed him to be relieved. -The attendants hesitated, but finally carried out my wishes without -protest. - -It was a strange thing that the patient had humour enough to see their -distrust, for, coming close to me, he said in a whisper, all the while -looking furtively at them, "They think I could hurt you! Fancy me -hurting you! The fools!" - -It was soothing, somehow, to the feelings to find myself disassociated -even in the mind of this poor madman from the others, but all the same -I do not follow his thought. Am I to take it that I have anything in -common with him, so that we are, as it were, to stand together. Or -has he to gain from me some good so stupendous that my well being is -needful to Him? I must find out later on. Tonight he will not speak. -Even the offer of a kitten or even a full-grown cat will not tempt -him. - -He will only say, "I don't take any stock in cats. I have more to -think of now, and I can wait. I can wait." - -After a while I left him. The attendant tells me that he was quiet -until just before dawn, and that then he began to get uneasy, and at -length violent, until at last he fell into a paroxysm which exhausted -him so that he swooned into a sort of coma. - - -. . . Three nights has the same thing happened, violent all day then -quiet from moonrise to sunrise. I wish I could get some clue to the -cause. It would almost seem as if there was some influence which came -and went. Happy thought! We shall tonight play sane wits against mad -ones. He escaped before without our help. Tonight he shall escape -with it. We shall give him a chance, and have the men ready to follow -in case they are required. - - -23 August.--"The expected always happens." How well Disraeli knew -life. Our bird when he found the cage open would not fly, so all our -subtle arrangements were for nought. At any rate, we have proved one -thing, that the spells of quietness last a reasonable time. We shall -in future be able to ease his bonds for a few hours each day. I have -given orders to the night attendant merely to shut him in the padded -room, when once he is quiet, until the hour before sunrise. The poor -soul's body will enjoy the relief even if his mind cannot appreciate -it. Hark! The unexpected again! I am called. The patient has once -more escaped. - - -Later.--Another night adventure. Renfield artfully waited until the -attendant was entering the room to inspect. Then he dashed out past -him and flew down the passage. I sent word for the attendants to -follow. Again he went into the grounds of the deserted house, and we -found him in the same place, pressed against the old chapel door. -When he saw me he became furious, and had not the attendants seized -him in time, he would have tried to kill me. As we were holding him a -strange thing happened. He suddenly redoubled his efforts, and then -as suddenly grew calm. I looked round instinctively, but could see -nothing. Then I caught the patient's eye and followed it, but could -trace nothing as it looked into the moonlight sky, except a big bat, -which was flapping its silent and ghostly way to the west. Bats -usually wheel about, but this one seemed to go straight on, as if it -knew where it was bound for or had some intention of its own. - -The patient grew calmer every instant, and presently said, "You -needn't tie me. I shall go quietly!" Without trouble, we came back -to the house. I feel there is something ominous in his calm, and -shall not forget this night. - - - -LUCY WESTENRA'S DIARY - -Hillingham, 24 August.--I must imitate Mina, and keep writing things -down. Then we can have long talks when we do meet. I wonder when it -will be. I wish she were with me again, for I feel so unhappy. Last -night I seemed to be dreaming again just as I was at Whitby. Perhaps -it is the change of air, or getting home again. It is all dark and -horrid to me, for I can remember nothing. But I am full of vague -fear, and I feel so weak and worn out. When Arthur came to lunch he -looked quite grieved when he saw me, and I hadn't the spirit to try to -be cheerful. I wonder if I could sleep in mother's room tonight. I -shall make an excuse to try. - - -25 August.--Another bad night. Mother did not seem to take to my -proposal. She seems not too well herself, and doubtless she fears to -worry me. I tried to keep awake, and succeeded for a while, but when -the clock struck twelve it waked me from a doze, so I must have been -falling asleep. There was a sort of scratching or flapping at the -window, but I did not mind it, and as I remember no more, I suppose I -must have fallen asleep. More bad dreams. I wish I could remember -them. This morning I am horribly weak. My face is ghastly pale, and -my throat pains me. It must be something wrong with my lungs, for I -don't seem to be getting air enough. I shall try to cheer up when -Arthur comes, or else I know he will be miserable to see me so. - - - -LETTER, ARTHUR TO DR. SEWARD - -"Albemarle Hotel, 31 August - -"My dear Jack, - -"I want you to do me a favour. Lucy is ill, that is she has no -special disease, but she looks awful, and is getting worse every -day. I have asked her if there is any cause, I not dare to ask her -mother, for to disturb the poor lady's mind about her daughter in -her present state of health would be fatal. Mrs. Westenra has -confided to me that her doom is spoken, disease of the heart, though -poor Lucy does not know it yet. I am sure that there is something -preying on my dear girl's mind. I am almost distracted when I think -of her. To look at her gives me a pang. I told her I should ask -you to see her, and though she demurred at first, I know why, old -fellow, she finally consented. It will be a painful task for you, I -know, old friend, but it is for her sake, and I must not hesitate to -ask, or you to act. You are to come to lunch at Hillingham -tomorrow, two o'clock, so as not to arouse any suspicion in Mrs. -Westenra, and after lunch Lucy will take an opportunity of being -alone with you. I am filled with anxiety, and want to consult with -you alone as soon as I can after you have seen her. Do not fail! - -"Arthur." - - - -TELEGRAM, ARTHUR HOLMWOOD TO SEWARD - -1 September - -"Am summoned to see my father, who is worse. Am writing. Write -me fully by tonight's post to Ring. Wire me if necessary." - - - -LETTER FROM DR. SEWARD TO ARTHUR HOLMWOOD - -2 September - -"My dear old fellow, - -"With regard to Miss Westenra's health I hasten to let you know at -once that in my opinion there is not any functional disturbance or -any malady that I know of. At the same time, I am not by any means -satisfied with her appearance. She is woefully different from what -she was when I saw her last. Of course you must bear in mind that I -did not have full opportunity of examination such as I should wish. -Our very friendship makes a little difficulty which not even medical -science or custom can bridge over. I had better tell you exactly -what happened, leaving you to draw, in a measure, your own -conclusions. I shall then say what I have done and propose doing. - -"I found Miss Westenra in seemingly gay spirits. Her mother was -present, and in a few seconds I made up my mind that she was trying -all she knew to mislead her mother and prevent her from being -anxious. I have no doubt she guesses, if she does not know, what -need of caution there is. - -"We lunched alone, and as we all exerted ourselves to be cheerful, -we got, as some kind of reward for our labours, some real -cheerfulness amongst us. Then Mrs. Westenra went to lie down, and -Lucy was left with me. We went into her boudoir, and till we got -there her gaiety remained, for the servants were coming and going. - -"As soon as the door was closed, however, the mask fell from her -face, and she sank down into a chair with a great sigh, and hid her -eyes with her hand. When I saw that her high spirits had failed, I -at once took advantage of her reaction to make a diagnosis. - -"She said to me very sweetly, 'I cannot tell you how I loathe -talking about myself.' I reminded her that a doctor's confidence -was sacred, but that you were grievously anxious about her. She -caught on to my meaning at once, and settled that matter in a word. -'Tell Arthur everything you choose. I do not care for myself, but -for him!' So I am quite free. - -"I could easily see that she was somewhat bloodless, but I could not -see the usual anemic signs, and by the chance, I was able to test -the actual quality of her blood, for in opening a window which was -stiff a cord gave way, and she cut her hand slightly with broken -glass. It was a slight matter in itself, but it gave me an evident -chance, and I secured a few drops of the blood and have analysed -them. - -"The qualitative analysis give a quite normal condition, and shows, -I should infer, in itself a vigorous state of health. In other -physical matters I was quite satisfied that there is no need for -anxiety, but as there must be a cause somewhere, I have come to the -conclusion that it must be something mental. - -"She complains of difficulty breathing satisfactorily at times, and -of heavy, lethargic sleep, with dreams that frighten her, but -regarding which she can remember nothing. She says that as a child, -she used to walk in her sleep, and that when in Whitby the habit -came back, and that once she walked out in the night and went to -East Cliff, where Miss Murray found her. But she assures me that of -late the habit has not returned. - -"I am in doubt, and so have done the best thing I know of. I have -written to my old friend and master, Professor Van Helsing, of -Amsterdam, who knows as much about obscure diseases as any one in -the world. I have asked him to come over, and as you told me that -all things were to be at your charge, I have mentioned to him who -you are and your relations to Miss Westenra. This, my dear fellow, -is in obedience to your wishes, for I am only too proud and happy to -do anything I can for her. - -"Van Helsing would, I know, do anything for me for a personal -reason, so no matter on what ground he comes, we must accept his -wishes. He is a seemingly arbitrary man, this is because he knows -what he is talking about better than any one else. He is a -philosopher and a metaphysician, and one of the most advanced -scientists of his day, and he has, I believe, an absolutely open -mind. This, with an iron nerve, a temper of the ice-brook, and -indomitable resolution, self-command, and toleration exalted from -virtues to blessings, and the kindliest and truest heart that beats, -these form his equipment for the noble work that he is doing for -mankind, work both in theory and practice, for his views are as wide -as his all-embracing sympathy. I tell you these facts that you may -know why I have such confidence in him. I have asked him to come at -once. I shall see Miss Westenra tomorrow again. She is to meet me -at the Stores, so that I may not alarm her mother by too early a -repetition of my call. - -"Yours always." - -John Seward - - - - -LETTER, ABRAHAM VAN HELSING, MD, DPh, D. Lit, ETC, ETC, TO DR. SEWARD - -2 September. - -"My good Friend, - -"When I received your letter I am already coming to you. By good -fortune I can leave just at once, without wrong to any of those who -have trusted me. Were fortune other, then it were bad for those who -have trusted, for I come to my friend when he call me to aid those -he holds dear. Tell your friend that when that time you suck from -my wound so swiftly the poison of the gangrene from that knife that -our other friend, too nervous, let slip, you did more for him when -he wants my aids and you call for them than all his great fortune -could do. But it is pleasure added to do for him, your friend, it -is to you that I come. Have near at hand, and please it so arrange -that we may see the young lady not too late on tomorrow, for it is -likely that I may have to return here that night. But if need be I -shall come again in three days, and stay longer if it must. Till -then goodbye, my friend John. - -"Van Helsing." - - - -LETTER, DR. SEWARD TO HON. ARTHUR HOLMWOOD - -3 September - -"My dear Art, - -"Van Helsing has come and gone. He came on with me to Hillingham, -and found that, by Lucy's discretion, her mother was lunching out, -so that we were alone with her. - -"Van Helsing made a very careful examination of the patient. He is -to report to me, and I shall advise you, for of course I was not -present all the time. He is, I fear, much concerned, but says he -must think. When I told him of our friendship and how you trust to -me in the matter, he said, 'You must tell him all you think. Tell -him what I think, if you can guess it, if you will. Nay, I am -not jesting. This is no jest, but life and death, perhaps more.' I -asked what he meant by that, for he was very serious. This was when -we had come back to town, and he was having a cup of tea before -starting on his return to Amsterdam. He would not give me any -further clue. You must not be angry with me, Art, because his very -reticence means that all his brains are working for her good. He -will speak plainly enough when the time comes, be sure. So I told -him I would simply write an account of our visit, just as if I were -doing a descriptive special article for THE DAILY TELEGRAPH. He -seemed not to notice, but remarked that the smuts of London were not -quite so bad as they used to be when he was a student here. I am to -get his report tomorrow if he can possibly make it. In any case I -am to have a letter. - -"Well, as to the visit, Lucy was more cheerful than on the day I -first saw her, and certainly looked better. She had lost something -of the ghastly look that so upset you, and her breathing was normal. -She was very sweet to the Professor (as she always is), and tried to -make him feel at ease, though I could see the poor girl was making a -hard struggle for it. - -"I believe Van Helsing saw it, too, for I saw the quick look -under his bushy brows that I knew of old. Then he began to -chat of all things except ourselves and diseases and with -such an infinite geniality that I could see poor Lucy's -pretense of animation merge into reality. Then, without -any seeming change, he brought the conversation gently round -to his visit, and suavely said, - -"'My dear young miss, I have the so great pleasure because you are -so much beloved. That is much, my dear, even were there that which -I do not see. They told me you were down in the spirit, and that -you were of a ghastly pale. To them I say "Pouf!"' And he snapped -his fingers at me and went on. 'But you and I shall show them how -wrong they are. How can he,' and he pointed at me with the same -look and gesture as that with which he pointed me out in his class, -on, or rather after, a particular occasion which he never fails to -remind me of, 'know anything of a young ladies? He has his madmen -to play with, and to bring them back to happiness, and to those that -love them. It is much to do, and, oh, but there are rewards in that -we can bestow such happiness. But the young ladies! He has no wife -nor daughter, and the young do not tell themselves to the young, but -to the old, like me, who have known so many sorrows and the causes -of them. So, my dear, we will send him away to smoke the cigarette -in the garden, whiles you and I have little talk all to ourselves.' -I took the hint, and strolled about, and presently the professor -came to the window and called me in. He looked grave, but said, 'I -have made careful examination, but there is no functional cause. -With you I agree that there has been much blood lost, it has been -but is not. But the conditions of her are in no way anemic. I have -asked her to send me her maid, that I may ask just one or two -questions, that so I may not chance to miss nothing. I know well -what she will say. And yet there is cause. There is always cause -for everything. I must go back home and think. You must send me -the telegram every day, and if there be cause I shall come again. -The disease, for not to be well is a disease, interest me, and the -sweet, young dear, she interest me too. She charm me, and for her, -if not for you or disease, I come.' - -"As I tell you, he would not say a word more, even when we were -alone. And so now, Art, you know all I know. I shall keep stern -watch. I trust your poor father is rallying. It must be a terrible -thing to you, my dear old fellow, to be placed in such a position -between two people who are both so dear to you. I know your idea of -duty to your father, and you are right to stick to it. But if need -be, I shall send you word to come at once to Lucy, so do not be -over-anxious unless you hear from me." - - - -DR. SEWARD'S DIARY - -4 September.--Zoophagous patient still keeps up our interest in him. -He had only one outburst and that was yesterday at an unusual time. -Just before the stroke of noon he began to grow restless. The -attendant knew the symptoms, and at once summoned aid. Fortunately -the men came at a run, and were just in time, for at the stroke of -noon he became so violent that it took all their strength to hold him. -In about five minutes, however, he began to get more quiet, and -finally sank into a sort of melancholy, in which state he has remained -up to now. The attendant tells me that his screams whilst in the -paroxysm were really appalling. I found my hands full when I got in, -attending to some of the other patients who were frightened by him. -Indeed, I can quite understand the effect, for the sounds disturbed -even me, though I was some distance away. It is now after the dinner -hour of the asylum, and as yet my patient sits in a corner brooding, -with a dull, sullen, woe-begone look in his face, which seems rather -to indicate than to show something directly. I cannot quite -understand it. - - -Later.--Another change in my patient. At five o'clock I looked in on -him, and found him seemingly as happy and contented as he used to be. -He was catching flies and eating them, and was keeping note of his -capture by making nailmarks on the edge of the door between the ridges -of padding. When he saw me, he came over and apologized for his bad -conduct, and asked me in a very humble, cringing way to be led back to -his own room, and to have his notebook again. I thought it well to -humour him, so he is back in his room with the window open. He has -the sugar of his tea spread out on the window sill, and is reaping -quite a harvest of flies. He is not now eating them, but putting them -into a box, as of old, and is already examining the corners of his -room to find a spider. I tried to get him to talk about the past few -days, for any clue to his thoughts would be of immense help to me, but -he would not rise. For a moment or two he looked very sad, and said -in a sort of far away voice, as though saying it rather to himself -than to me. - -"All over! All over! He has deserted me. No hope for me now unless -I do it myself!" Then suddenly turning to me in a resolute way, he -said, "Doctor, won't you be very good to me and let me have a little -more sugar? I think it would be very good for me." - -"And the flies?" I said. - -"Yes! The flies like it, too, and I like the flies, therefore I like -it." And there are people who know so little as to think that madmen do -not argue. I procured him a double supply, and left him as happy a -man as, I suppose, any in the world. I wish I could fathom his mind. - - -Midnight.--Another change in him. I had been to see Miss Westenra, -whom I found much better, and had just returned, and was standing at -our own gate looking at the sunset, when once more I heard him -yelling. As his room is on this side of the house, I could hear it -better than in the morning. It was a shock to me to turn from the -wonderful smoky beauty of a sunset over London, with its lurid lights -and inky shadows and all the marvellous tints that come on foul clouds -even as on foul water, and to realize all the grim sternness of my own -cold stone building, with its wealth of breathing misery, and my own -desolate heart to endure it all. I reached him just as the sun was -going down, and from his window saw the red disc sink. As it sank he -became less and less frenzied, and just as it dipped he slid from the -hands that held him, an inert mass, on the floor. It is wonderful, -however, what intellectual recuperative power lunatics have, for -within a few minutes he stood up quite calmly and looked around him. I -signalled to the attendants not to hold him, for I was anxious to see -what he would do. He went straight over to the window and brushed out -the crumbs of sugar. Then he took his fly box, and emptied it -outside, and threw away the box. Then he shut the window, and -crossing over, sat down on his bed. All this surprised me, so I asked -him, "Are you going to keep flies any more?" - -"No," said he. "I am sick of all that rubbish!" He certainly is a -wonderfully interesting study. I wish I could get some glimpse of his -mind or of the cause of his sudden passion. Stop. There may be a -clue after all, if we can find why today his paroxysms came on at high -noon and at sunset. Can it be that there is a malign influence of the -sun at periods which affects certain natures, as at times the moon -does others? We shall see. - - - -TELEGRAM. SEWARD, LONDON, TO VAN HELSING, AMSTERDAM - -"4 September.--Patient still better today." - - - -TELEGRAM, SEWARD, LONDON, TO VAN HELSING, AMSTERDAM - -"5 September.--Patient greatly improved. Good appetite, sleeps -naturally, good spirits, colour coming back." - - - -TELEGRAM, SEWARD, LONDON, TO VAN HELSING, AMSTERDAM - -"6 September.--Terrible change for the worse. Come at once. -Do not lose an hour. I hold over telegram to Holmwood till -have seen you." - - - - -CHAPTER 10 - - -LETTER, DR. SEWARD TO HON. ARTHUR HOLMWOOD - - -6 September - -"My dear Art, - -"My news today is not so good. Lucy this morning had gone back a -bit. There is, however, one good thing which has arisen from it. -Mrs. Westenra was naturally anxious concerning Lucy, and has -consulted me professionally about her. I took advantage of the -opportunity, and told her that my old master, Van Helsing, the great -specialist, was coming to stay with me, and that I would put her in -his charge conjointly with myself. So now we can come and go -without alarming her unduly, for a shock to her would mean sudden -death, and this, in Lucy's weak condition, might be disastrous to -her. We are hedged in with difficulties, all of us, my poor fellow, -but, please God, we shall come through them all right. If any need -I shall write, so that, if you do not hear from me, take it for -granted that I am simply waiting for news, In haste, - -"Yours ever," - -John Seward - - - -DR. SEWARD'S DIARY - -7 September.--The first thing Van Helsing said to me when we met at -Liverpool Street was, "Have you said anything to our young friend, to -lover of her?" - -"No," I said. "I waited till I had seen you, as I said in my -telegram. I wrote him a letter simply telling him that you were -coming, as Miss Westenra was not so well, and that I should let him -know if need be." - -"Right, my friend," he said. "Quite right! Better he not know as -yet. Perhaps he will never know. I pray so, but if it be needed, -then he shall know all. And, my good friend John, let me caution you. -You deal with the madmen. All men are mad in some way or the other, -and inasmuch as you deal discreetly with your madmen, so deal with -God's madmen too, the rest of the world. You tell not your madmen -what you do nor why you do it. You tell them not what you think. So -you shall keep knowledge in its place, where it may rest, where it may -gather its kind around it and breed. You and I shall keep as yet what -we know here, and here." He touched me on the heart and on the -forehead, and then touched himself the same way. "I have for myself -thoughts at the present. Later I shall unfold to you." - -"Why not now?" I asked. "It may do some good. We may arrive at some -decision." He looked at me and said, "My friend John, when the corn is -grown, even before it has ripened, while the milk of its mother earth -is in him, and the sunshine has not yet begun to paint him with his -gold, the husbandman he pull the ear and rub him between his rough -hands, and blow away the green chaff, and say to you, 'Look! He's -good corn, he will make a good crop when the time comes.'" - -I did not see the application and told him so. For reply he reached -over and took my ear in his hand and pulled it playfully, as he used -long ago to do at lectures, and said, "The good husbandman tell you so -then because he knows, but not till then. But you do not find the -good husbandman dig up his planted corn to see if he grow. That is -for the children who play at husbandry, and not for those who take it -as of the work of their life. See you now, friend John? I have sown -my corn, and Nature has her work to do in making it sprout, if he -sprout at all, there's some promise, and I wait till the ear begins to -swell." He broke off, for he evidently saw that I understood. Then he -went on gravely, "You were always a careful student, and your case -book was ever more full than the rest. And I trust that good habit -have not fail. Remember, my friend, that knowledge is stronger than -memory, and we should not trust the weaker. Even if you have not kept -the good practice, let me tell you that this case of our dear miss is -one that may be, mind, I say may be, of such interest to us and others -that all the rest may not make him kick the beam, as your people say. -Take then good note of it. Nothing is too small. I counsel you, put -down in record even your doubts and surmises. Hereafter it may be of -interest to you to see how true you guess. We learn from failure, not -from success!" - -When I described Lucy's symptoms, the same as before, but infinitely -more marked, he looked very grave, but said nothing. He took with him -a bag in which were many instruments and drugs, "the ghastly -paraphernalia of our beneficial trade," as he once called, in one of -his lectures, the equipment of a professor of the healing craft. - -When we were shown in, Mrs. Westenra met us. She was alarmed, but not -nearly so much as I expected to find her. Nature in one of her -beneficient moods has ordained that even death has some antidote to -its own terrors. Here, in a case where any shock may prove fatal, -matters are so ordered that, from some cause or other, the things not -personal, even the terrible change in her daughter to whom she is so -attached, do not seem to reach her. It is something like the way dame -Nature gathers round a foreign body an envelope of some insensitive -tissue which can protect from evil that which it would otherwise harm -by contact. If this be an ordered selfishness, then we should pause -before we condemn any one for the vice of egoism, for there may be -deeper root for its causes than we have knowledge of. - -I used my knowledge of this phase of spiritual pathology, and set down -a rule that she should not be present with Lucy, or think of her -illness more than was absolutely required. She assented readily, so -readily that I saw again the hand of Nature fighting for life. Van -Helsing and I were shown up to Lucy's room. If I was shocked when I -saw her yesterday, I was horrified when I saw her today. - -She was ghastly, chalkily pale. The red seemed to have gone even from -her lips and gums, and the bones of her face stood out prominently. -Her breathing was painful to see or hear. Van Helsing's face grew set -as marble, and his eyebrows converged till they almost touched over his -nose. Lucy lay motionless, and did not seem to have strength to -speak, so for a while we were all silent. Then Van Helsing beckoned -to me, and we went gently out of the room. The instant we had closed -the door he stepped quickly along the passage to the next door, which -was open. Then he pulled me quickly in with him and closed the door. -"My god!" he said. "This is dreadful. There is not time to be lost. -She will die for sheer want of blood to keep the heart's action as it -should be. There must be a transfusion of blood at once. Is it you -or me?" - -"I am younger and stronger, Professor. It must be me." - -"Then get ready at once. I will bring up my bag. I am prepared." - -I went downstairs with him, and as we were going there was a knock at -the hall door. When we reached the hall, the maid had just opened the -door, and Arthur was stepping quickly in. He rushed up to me, saying -in an eager whisper, - -"Jack, I was so anxious. I read between the lines of your letter, and -have been in an agony. The dad was better, so I ran down here to see -for myself. Is not that gentleman Dr. Van Helsing? I am so thankful -to you, sir, for coming." - -When first the Professor's eye had lit upon him, he had been angry at -his interruption at such a time, but now, as he took in his stalwart -proportions and recognized the strong young manhood which seemed to -emanate from him, his eyes gleamed. Without a pause he said to him as -he held out his hand, - -"Sir, you have come in time. You are the lover of our dear miss. She -is bad, very, very bad. Nay, my child, do not go like that." For he -suddenly grew pale and sat down in a chair almost fainting. "You are -to help her. You can do more than any that live, and your courage is -your best help." - -"What can I do?" asked Arthur hoarsely. "Tell me, and I shall do it. -My life is hers, and I would give the last drop of blood in my body for -her." - -The Professor has a strongly humorous side, and I could from old -knowledge detect a trace of its origin in his answer. - -"My young sir, I do not ask so much as that, not the last!" - -"What shall I do?" There was fire in his eyes, and his open nostrils -quivered with intent. Van Helsing slapped him on the shoulder. - -"Come!" he said. "You are a man, and it is a man we want. You are -better than me, better than my friend John." Arthur looked bewildered, -and the Professor went on by explaining in a kindly way. - -"Young miss is bad, very bad. She wants blood, and blood she must -have or die. My friend John and I have consulted, and we are about to -perform what we call transfusion of blood, to transfer from full veins -of one to the empty veins which pine for him. John was to give his -blood, as he is the more young and strong than me."--Here Arthur took -my hand and wrung it hard in silence.--"But now you are here, you are -more good than us, old or young, who toil much in the world of -thought. Our nerves are not so calm and our blood so bright than -yours!" - -Arthur turned to him and said, "If you only knew how gladly I would -die for her you would understand . . ." He stopped with a sort of -choke in his voice. - -"Good boy!" said Van Helsing. "In the not-so-far-off you will be -happy that you have done all for her you love. Come now and be -silent. You shall kiss her once before it is done, but then you must -go, and you must leave at my sign. Say no word to Madame. You know -how it is with her. There must be no shock, any knowledge of this -would be one. Come!" - -We all went up to Lucy's room. Arthur by direction remained outside. -Lucy turned her head and looked at us, but said nothing. She was not -asleep, but she was simply too weak to make the effort. Her eyes -spoke to us, that was all. - -Van Helsing took some things from his bag and laid them on a little -table out of sight. Then he mixed a narcotic, and coming over to the -bed, said cheerily, "Now, little miss, here is your medicine. Drink -it off, like a good child. See, I lift you so that to swallow is -easy. Yes." She had made the effort with success. - -It astonished me how long the drug took to act. This, in fact, marked -the extent of her weakness. The time seemed endless until sleep began -to flicker in her eyelids. At last, however, the narcotic began to -manifest its potency, and she fell into a deep sleep. When the -Professor was satisfied, he called Arthur into the room, and bade him -strip off his coat. Then he added, "You may take that one little kiss -whiles I bring over the table. Friend John, help to me!" So neither -of us looked whilst he bent over her. - -Van Helsing, turning to me, said, "He is so young and strong, and of -blood so pure that we need not defibrinate it." - -Then with swiftness, but with absolute method, Van Helsing performed -the operation. As the transfusion went on, something like life seemed -to come back to poor Lucy's cheeks, and through Arthur's growing -pallor the joy of his face seemed absolutely to shine. After a bit I -began to grow anxious, for the loss of blood was telling on Arthur, -strong man as he was. It gave me an idea of what a terrible strain -Lucy's system must have undergone that what weakened Arthur only -partially restored her. - -But the Professor's face was set, and he stood watch in hand, and with -his eyes fixed now on the patient and now on Arthur. I could hear my -own heart beat. Presently, he said in a soft voice, "Do not stir an -instant. It is enough. You attend him. I will look to her." - -When all was over, I could see how much Arthur was weakened. I -dressed the wound and took his arm to bring him away, when Van Helsing -spoke without turning round, the man seems to have eyes in the back of -his head, "The brave lover, I think, deserve another kiss, which he -shall have presently." And as he had now finished his operation, he -adjusted the pillow to the patient's head. As he did so the narrow -black velvet band which she seems always to wear round her throat, -buckled with an old diamond buckle which her lover had given her, was -dragged a little up, and showed a red mark on her throat. - -Arthur did not notice it, but I could hear the deep hiss of indrawn -breath which is one of Van Helsing's ways of betraying emotion. He -said nothing at the moment, but turned to me, saying, "Now take down -our brave young lover, give him of the port wine, and let him lie down -a while. He must then go home and rest, sleep much and eat much, that -he may be recruited of what he has so given to his love. He must not -stay here. Hold a moment! I may take it, sir, that you are anxious -of result. Then bring it with you, that in all ways the operation is -successful. You have saved her life this time, and you can go home -and rest easy in mind that all that can be is. I shall tell her all -when she is well. She shall love you none the less for what you have -done. Goodbye." - -When Arthur had gone I went back to the room. Lucy was sleeping -gently, but her breathing was stronger. I could see the counterpane -move as her breast heaved. By the bedside sat Van Helsing, looking at -her intently. The velvet band again covered the red mark. I asked -the Professor in a whisper, "What do you make of that mark on her -throat?" - -"What do you make of it?" - -"I have not examined it yet," I answered, and then and there proceeded -to loose the band. Just over the external jugular vein there were two -punctures, not large, but not wholesome looking. There was no sign of -disease, but the edges were white and worn looking, as if by some -trituration. It at once occurred to me that that this wound, or -whatever it was, might be the means of that manifest loss of blood. -But I abandoned the idea as soon as it formed, for such a thing could -not be. The whole bed would have been drenched to a scarlet with the -blood which the girl must have lost to leave such a pallor as she had -before the transfusion. - -"Well?" said Van Helsing. - -"Well," said I. "I can make nothing of it." - -The Professor stood up. "I must go back to Amsterdam tonight," he -said "There are books and things there which I want. You must remain -here all night, and you must not let your sight pass from her." - -"Shall I have a nurse?" I asked. - -"We are the best nurses, you and I. You keep watch all night. See -that she is well fed, and that nothing disturbs her. You must not -sleep all the night. Later on we can sleep, you and I. I shall be -back as soon as possible. And then we may begin." - -"May begin?" I said. "What on earth do you mean?" - -"We shall see!" he answered, as he hurried out. He came back a moment -later and put his head inside the door and said with a warning finger -held up, "Remember, she is your charge. If you leave her, and harm -befall, you shall not sleep easy hereafter!" - - - -DR. SEWARD'S DIARY--CONTINUED - -8 September.--I sat up all night with Lucy. The opiate worked itself -off towards dusk, and she waked naturally. She looked a different -being from what she had been before the operation. Her spirits even -were good, and she was full of a happy vivacity, but I could see -evidences of the absolute prostration which she had undergone. When I -told Mrs. Westenra that Dr. Van Helsing had directed that I should sit -up with her, she almost pooh-poohed the idea, pointing out her -daughter's renewed strength and excellent spirits. I was firm, -however, and made preparations for my long vigil. When her maid had -prepared her for the night I came in, having in the meantime had -supper, and took a seat by the bedside. - -She did not in any way make objection, but looked at me gratefully -whenever I caught her eye. After a long spell she seemed sinking off -to sleep, but with an effort seemed to pull herself together and shook -it off. It was apparent that she did not want to sleep, so I tackled -the subject at once. - -"You do not want to sleep?" - -"No. I am afraid." - -"Afraid to go to sleep! Why so? It is the boon we all crave for." - -"Ah, not if you were like me, if sleep was to you a presage of -horror!" - -"A presage of horror! What on earth do you mean?" - -"I don't know. Oh, I don't know. And that is what is so terrible. -All this weakness comes to me in sleep, until I dread the very -thought." - -"But, my dear girl, you may sleep tonight. I am here watching you, -and I can promise that nothing will happen." - -"Ah, I can trust you!" she said. - -I seized the opportunity, and said, "I promise that if I see any -evidence of bad dreams I will wake you at once." - -"You will? Oh, will you really? How good you are to me. Then I will -sleep!" And almost at the word she gave a deep sigh of relief, and -sank back, asleep. - -All night long I watched by her. She never stirred, but slept on and -on in a deep, tranquil, life-giving, health-giving sleep. Her lips -were slightly parted, and her breast rose and fell with the regularity -of a pendulum. There was a smile on her face, and it was evident that -no bad dreams had come to disturb her peace of mind. - -In the early morning her maid came, and I left her in her care and took -myself back home, for I was anxious about many things. I sent a short -wire to Van Helsing and to Arthur, telling them of the excellent -result of the operation. My own work, with its manifold arrears, took -me all day to clear off. It was dark when I was able to inquire about -my zoophagous patient. The report was good. He had been quite quiet -for the past day and night. A telegram came from Van Helsing at -Amsterdam whilst I was at dinner, suggesting that I should be at -Hillingham tonight, as it might be well to be at hand, and stating -that he was leaving by the night mail and would join me early in the -morning. - - -9 September.--I was pretty tired and worn out when I got to -Hillingham. For two nights I had hardly had a wink of sleep, and my -brain was beginning to feel that numbness which marks cerebral -exhaustion. Lucy was up and in cheerful spirits. When she shook -hands with me she looked sharply in my face and said, - -"No sitting up tonight for you. You are worn out. I am quite well -again. Indeed, I am, and if there is to be any sitting up, it is I -who will sit up with you." - -I would not argue the point, but went and had my supper. Lucy came -with me, and, enlivened by her charming presence, I made an excellent -meal, and had a couple of glasses of the more than excellent port. -Then Lucy took me upstairs, and showed me a room next her own, where a -cozy fire was burning. - -"Now," she said. "You must stay here. I shall leave this door open -and my door too. You can lie on the sofa for I know that nothing -would induce any of you doctors to go to bed whilst there is a patient -above the horizon. If I want anything I shall call out, and you can -come to me at once." - -I could not but acquiesce, for I was dog tired, and could not have sat -up had I tried. So, on her renewing her promise to call me if she -should want anything, I lay on the sofa, and forgot all about -everything. - - - -LUCY WESTENRA'S DIARY - -9 September.--I feel so happy tonight. I have been so miserably weak, -that to be able to think and move about is like feeling sunshine after -a long spell of east wind out of a steel sky. Somehow Arthur feels -very, very close to me. I seem to feel his presence warm about me. I -suppose it is that sickness and weakness are selfish things and turn -our inner eyes and sympathy on ourselves, whilst health and strength -give love rein, and in thought and feeling he can wander where he -wills. I know where my thoughts are. If only Arthur knew! My dear, -my dear, your ears must tingle as you sleep, as mine do waking. Oh, -the blissful rest of last night! How I slept, with that dear, good -Dr. Seward watching me. And tonight I shall not fear to sleep, since -he is close at hand and within call. Thank everybody for being so -good to me. Thank God! Goodnight Arthur. - - - -DR. SEWARD'S DIARY - -10 September.--I was conscious of the Professor's hand on my head, and -started awake all in a second. That is one of the things that we -learn in an asylum, at any rate. - -"And how is our patient?" - -"Well, when I left her, or rather when she left me," I answered. - -"Come, let us see," he said. And together we went into the room. - -The blind was down, and I went over to raise it gently, whilst Van -Helsing stepped, with his soft, cat-like tread, over to the bed. - -As I raised the blind, and the morning sunlight flooded the room, I -heard the Professor's low hiss of inspiration, and knowing its rarity, -a deadly fear shot through my heart. As I passed over he moved back, -and his exclamation of horror, "Gott in Himmel!" needed no enforcement -from his agonized face. He raised his hand and pointed to the bed, -and his iron face was drawn and ashen white. I felt my knees begin to -tremble. - -There on the bed, seemingly in a swoon, lay poor Lucy, more horribly -white and wan-looking than ever. Even the lips were white, and the -gums seemed to have shrunken back from the teeth, as we sometimes see -in a corpse after a prolonged illness. - -Van Helsing raised his foot to stamp in anger, but the instinct of his -life and all the long years of habit stood to him, and he put it down -again softly. - -"Quick!" he said. "Bring the brandy." - -I flew to the dining room, and returned with the decanter. He wetted -the poor white lips with it, and together we rubbed palm and wrist and -heart. He felt her heart, and after a few moments of agonizing -suspense said, - -"It is not too late. It beats, though but feebly. All our work is -undone. We must begin again. There is no young Arthur here now. I -have to call on you yourself this time, friend John." As he spoke, he -was dipping into his bag, and producing the instruments of -transfusion. I had taken off my coat and rolled up my shirt sleeve. -There was no possibility of an opiate just at present, and no need of -one; and so, without a moment's delay, we began the operation. - -After a time, it did not seem a short time either, for the draining -away of one's blood, no matter how willingly it be given, is a -terrible feeling, Van Helsing held up a warning finger. "Do not -stir," he said. "But I fear that with growing strength she may wake, -and that would make danger, oh, so much danger. But I shall -precaution take. I shall give hypodermic injection of morphia." He -proceeded then, swiftly and deftly, to carry out his intent. - -The effect on Lucy was not bad, for the faint seemed to merge subtly -into the narcotic sleep. It was with a feeling of personal pride that -I could see a faint tinge of colour steal back into the pallid cheeks -and lips. No man knows, till he experiences it, what it is to feel -his own lifeblood drawn away into the veins of the woman he loves. - -The Professor watched me critically. "That will do," he said. -"Already?" I remonstrated. "You took a great deal more from Art." To -which he smiled a sad sort of smile as he replied, - -"He is her lover, her fiance. You have work, much work to do for her -and for others, and the present will suffice." - -When we stopped the operation, he attended to Lucy, whilst I applied -digital pressure to my own incision. I laid down, while I waited his -leisure to attend to me, for I felt faint and a little sick. By and -by he bound up my wound, and sent me downstairs to get a glass of wine -for myself. As I was leaving the room, he came after me, and half -whispered. - -"Mind, nothing must be said of this. If our young lover should turn -up unexpected, as before, no word to him. It would at once frighten -him and enjealous him, too. There must be none. So!" - -When I came back he looked at me carefully, and then said, "You are -not much the worse. Go into the room, and lie on your sofa, and rest -awhile, then have much breakfast and come here to me." - -I followed out his orders, for I knew how right and wise they were. I -had done my part, and now my next duty was to keep up my strength. I -felt very weak, and in the weakness lost something of the amazement at -what had occurred. I fell asleep on the sofa, however, wondering over -and over again how Lucy had made such a retrograde movement, and how -she could have been drained of so much blood with no sign any where to -show for it. I think I must have continued my wonder in my dreams, -for, sleeping and waking my thoughts always came back to the little -punctures in her throat and the ragged, exhausted appearance of their -edges, tiny though they were. - -Lucy slept well into the day, and when she woke she was fairly well -and strong, though not nearly so much so as the day before. When Van -Helsing had seen her, he went out for a walk, leaving me in charge, -with strict injunctions that I was not to leave her for a moment. I -could hear his voice in the hall, asking the way to the nearest -telegraph office. - -Lucy chatted with me freely, and seemed quite unconscious that -anything had happened. I tried to keep her amused and interested. -When her mother came up to see her, she did not seem to notice any -change whatever, but said to me gratefully, - -"We owe you so much, Dr. Seward, for all you have done, but you really -must now take care not to overwork yourself. You are looking pale -yourself. You want a wife to nurse and look after you a bit, that you -do!" As she spoke, Lucy turned crimson, though it was only -momentarily, for her poor wasted veins could not stand for long an -unwonted drain to the head. The reaction came in excessive pallor as -she turned imploring eyes on me. I smiled and nodded, and laid my -finger on my lips. With a sigh, she sank back amid her pillows. - -Van Helsing returned in a couple of hours, and presently said to me: -"Now you go home, and eat much and drink enough. Make yourself -strong. I stay here tonight, and I shall sit up with little miss -myself. You and I must watch the case, and we must have none other to -know. I have grave reasons. No, do not ask me. Think what you will. -Do not fear to think even the most not-improbable. Goodnight." - -In the hall two of the maids came to me, and asked if they or either -of them might not sit up with Miss Lucy. They implored me to let -them, and when I said it was Dr. Van Helsing's wish that either he or -I should sit up, they asked me quite piteously to intercede with -the 'foreign gentleman'. I was much touched by their kindness. Perhaps -it is because I am weak at present, and perhaps because it was on -Lucy's account, that their devotion was manifested. For over and over -again have I seen similar instances of woman's kindness. I got back -here in time for a late dinner, went my rounds, all well, and set this -down whilst waiting for sleep. It is coming. - - -11 September.--This afternoon I went over to Hillingham. Found Van -Helsing in excellent spirits, and Lucy much better. Shortly after I -had arrived, a big parcel from abroad came for the Professor. He -opened it with much impressment, assumed, of course, and showed a -great bundle of white flowers. - -"These are for you, Miss Lucy," he said. - -"For me? Oh, Dr. Van Helsing!" - -"Yes, my dear, but not for you to play with. These are medicines." -Here Lucy made a wry face. "Nay, but they are not to take in a -decoction or in nauseous form, so you need not snub that so charming -nose, or I shall point out to my friend Arthur what woes he may have -to endure in seeing so much beauty that he so loves so much distort. -Aha, my pretty miss, that bring the so nice nose all straight again. -This is medicinal, but you do not know how. I put him in your window, -I make pretty wreath, and hang him round your neck, so you sleep well. -Oh, yes! They, like the lotus flower, make your trouble forgotten. -It smell so like the waters of Lethe, and of that fountain of youth -that the Conquistadores sought for in the Floridas, and find him all -too late." - -Whilst he was speaking, Lucy had been examining the flowers and -smelling them. Now she threw them down saying, with half laughter, -and half disgust, - -"Oh, Professor, I believe you are only putting up a joke on me. Why, -these flowers are only common garlic." - -To my surprise, Van Helsing rose up and said with all his sternness, -his iron jaw set and his bushy eyebrows meeting, - -"No trifling with me! I never jest! There is grim purpose in what I -do, and I warn you that you do not thwart me. Take care, for the sake -of others if not for your own." Then seeing poor Lucy scared, as she -might well be, he went on more gently, "Oh, little miss, my dear, do -not fear me. I only do for your good, but there is much virtue to you -in those so common flowers. See, I place them myself in your room. I -make myself the wreath that you are to wear. But hush! No telling to -others that make so inquisitive questions. We must obey, and silence -is a part of obedience, and obedience is to bring you strong and well -into loving arms that wait for you. Now sit still a while. Come with -me, friend John, and you shall help me deck the room with my garlic, -which is all the way from Haarlem, where my friend Vanderpool raise -herb in his glass houses all the year. I had to telegraph yesterday, -or they would not have been here." - -We went into the room, taking the flowers with us. The Professor's -actions were certainly odd and not to be found in any pharmacopeia -that I ever heard of. First he fastened up the windows and latched -them securely. Next, taking a handful of the flowers, he rubbed them -all over the sashes, as though to ensure that every whiff of air that -might get in would be laden with the garlic smell. Then with the wisp -he rubbed all over the jamb of the door, above, below, and at each -side, and round the fireplace in the same way. It all seemed -grotesque to me, and presently I said, "Well, Professor, I know you -always have a reason for what you do, but this certainly puzzles me. -It is well we have no sceptic here, or he would say that you were -working some spell to keep out an evil spirit." - -"Perhaps I am!" he answered quietly as he began to make the wreath -which Lucy was to wear round her neck. - -We then waited whilst Lucy made her toilet for the night, and when she -was in bed he came and himself fixed the wreath of garlic round her -neck. The last words he said to her were, - -"Take care you do not disturb it, and even if the room feel close, do -not tonight open the window or the door." - -"I promise," said Lucy. "And thank you both a thousand times for all -your kindness to me! Oh, what have I done to be blessed with such -friends?" - -As we left the house in my fly, which was waiting, Van Helsing said, -"Tonight I can sleep in peace, and sleep I want, two nights of travel, -much reading in the day between, and much anxiety on the day to -follow, and a night to sit up, without to wink. Tomorrow in the -morning early you call for me, and we come together to see our pretty -miss, so much more strong for my 'spell' which I have work. Ho, ho!" - -He seemed so confident that I, remembering my own confidence two -nights before and with the baneful result, felt awe and vague terror. -It must have been my weakness that made me hesitate to tell it to my -friend, but I felt it all the more, like unshed tears. - - - - -CHAPTER 11 - - -LUCY WESTENRA'S DIARY - -12 September.--How good they all are to me. I quite love that dear -Dr. Van Helsing. I wonder why he was so anxious about these flowers. -He positively frightened me, he was so fierce. And yet he must have -been right, for I feel comfort from them already. Somehow, I do not -dread being alone tonight, and I can go to sleep without fear. I -shall not mind any flapping outside the window. Oh, the terrible -struggle that I have had against sleep so often of late, the pain of -sleeplessness, or the pain of the fear of sleep, and with such unknown -horrors as it has for me! How blessed are some people, whose lives -have no fears, no dreads, to whom sleep is a blessing that comes -nightly, and brings nothing but sweet dreams. Well, here I am -tonight, hoping for sleep, and lying like Ophelia in the play, with -'virgin crants and maiden strewments.' I never liked garlic before, -but tonight it is delightful! There is peace in its smell. I feel -sleep coming already. Goodnight, everybody. - - - -DR. SEWARD'S DIARY - -13 September.--Called at the Berkeley and found Van Helsing, as usual, -up to time. The carriage ordered from the hotel was waiting. The -Professor took his bag, which he always brings with him now. - -Let all be put down exactly. Van Helsing and I arrived at Hillingham -at eight o'clock. It was a lovely morning. The bright sunshine and -all the fresh feeling of early autumn seemed like the completion of -nature's annual work. The leaves were turning to all kinds of -beautiful colours, but had not yet begun to drop from the trees. When -we entered we met Mrs. Westenra coming out of the morning room. She -is always an early riser. She greeted us warmly and said, - -"You will be glad to know that Lucy is better. The dear child is -still asleep. I looked into her room and saw her, but did not go in, -lest I should disturb her." The Professor smiled, and looked quite -jubilant. He rubbed his hands together, and said, "Aha! I thought I -had diagnosed the case. My treatment is working." - -To which she replied, "You must not take all the credit to yourself, -doctor. Lucy's state this morning is due in part to me." - -"How do you mean, ma'am?" asked the Professor. - -"Well, I was anxious about the dear child in the night, and went into -her room. She was sleeping soundly, so soundly that even my coming -did not wake her. But the room was awfully stuffy. There were a lot -of those horrible, strong-smelling flowers about everywhere, and she -had actually a bunch of them round her neck. I feared that the heavy -odour would be too much for the dear child in her weak state, so I took -them all away and opened a bit of the window to let in a little fresh -air. You will be pleased with her, I am sure." - -She moved off into her boudoir, where she usually breakfasted early. -As she had spoken, I watched the Professor's face, and saw it turn -ashen gray. He had been able to retain his self-command whilst the -poor lady was present, for he knew her state and how mischievous a -shock would be. He actually smiled on her as he held open the door -for her to pass into her room. But the instant she had disappeared he -pulled me, suddenly and forcibly, into the dining room and closed the -door. - -Then, for the first time in my life, I saw Van Helsing break down. He -raised his hands over his head in a sort of mute despair, and then -beat his palms together in a helpless way. Finally he sat down on a -chair, and putting his hands before his face, began to sob, with loud, -dry sobs that seemed to come from the very racking of his heart. - -Then he raised his arms again, as though appealing to the whole -universe. "God! God! God!" he said. "What have we done, what has -this poor thing done, that we are so sore beset? Is there fate -amongst us still, send down from the pagan world of old, that such -things must be, and in such way? This poor mother, all unknowing, and -all for the best as she think, does such thing as lose her daughter -body and soul, and we must not tell her, we must not even warn her, or -she die, then both die. Oh, how we are beset! How are all the powers -of the devils against us!" - -Suddenly he jumped to his feet. "Come," he said, "come, we must see and -act. Devils or no devils, or all the devils at once, it matters not. -We must fight him all the same." He went to the hall door for his -bag, and together we went up to Lucy's room. - -Once again I drew up the blind, whilst Van Helsing went towards the -bed. This time he did not start as he looked on the poor face with -the same awful, waxen pallor as before. He wore a look of stern -sadness and infinite pity. - -"As I expected," he murmured, with that hissing inspiration of his -which meant so much. Without a word he went and locked the door, and -then began to set out on the little table the instruments for yet -another operation of transfusion of blood. I had long ago recognized -the necessity, and begun to take off my coat, but he stopped me with a -warning hand. "No!" he said. "Today you must operate. I shall -provide. You are weakened already." As he spoke he took off his coat -and rolled up his shirtsleeve. - -Again the operation. Again the narcotic. Again some return of colour -to the ashy cheeks, and the regular breathing of healthy sleep. This -time I watched whilst Van Helsing recruited himself and rested. - -Presently he took an opportunity of telling Mrs. Westenra that she -must not remove anything from Lucy's room without consulting him. -That the flowers were of medicinal value, and that the breathing of -their odour was a part of the system of cure. Then he took over the -care of the case himself, saying that he would watch this night and -the next, and would send me word when to come. - -After another hour Lucy waked from her sleep, fresh and bright and -seemingly not much the worse for her terrible ordeal. - -What does it all mean? I am beginning to wonder if my long habit of -life amongst the insane is beginning to tell upon my own brain. - - - -LUCY WESTENRA'S DIARY - -17 September.--Four days and nights of peace. I am getting so strong -again that I hardly know myself. It is as if I had passed through -some long nightmare, and had just awakened to see the beautiful -sunshine and feel the fresh air of the morning around me. I have a -dim half remembrance of long, anxious times of waiting and fearing, -darkness in which there was not even the pain of hope to make present -distress more poignant. And then long spells of oblivion, and the -rising back to life as a diver coming up through a great press of -water. Since, however, Dr. Van Helsing has been with me, all this bad -dreaming seems to have passed away. The noises that used to frighten -me out of my wits, the flapping against the windows, the distant -voices which seemed so close to me, the harsh sounds that came from I -know not where and commanded me to do I know not what, have all -ceased. I go to bed now without any fear of sleep. I do not even try -to keep awake. I have grown quite fond of the garlic, and a boxful -arrives for me every day from Haarlem. Tonight Dr. Van Helsing is -going away, as he has to be for a day in Amsterdam. But I need not be -watched. I am well enough to be left alone. - -Thank God for Mother's sake, and dear Arthur's, and for all our -friends who have been so kind! I shall not even feel the change, for -last night Dr. Van Helsing slept in his chair a lot of the time. I -found him asleep twice when I awoke. But I did not fear to go to -sleep again, although the boughs or bats or something flapped almost -angrily against the window panes. - - - - -THE PALL MALL GAZETTE 18 September. - -THE ESCAPED WOLF PERILOUS ADVENTURE OF OUR INTERVIEWER - -INTERVIEW WITH THE KEEPER IN THE ZOOLOGICAL GARDENS - -After many inquiries and almost as many refusals, and perpetually -using the words 'PALL MALL GAZETTE' as a sort of talisman, I managed -to find the keeper of the section of the Zoological Gardens in which -the wolf department is included. Thomas Bilder lives in one of the -cottages in the enclosure behind the elephant house, and was just -sitting down to his tea when I found him. Thomas and his wife are -hospitable folk, elderly, and without children, and if the specimen -I enjoyed of their hospitality be of the average kind, their lives -must be pretty comfortable. The keeper would not enter on what he -called business until the supper was over, and we were all -satisfied. Then when the table was cleared, and he had lit his -pipe, he said, - -"Now, Sir, you can go on and arsk me what you want. You'll excoose -me refoosin' to talk of perfeshunal subjucts afore meals. I gives -the wolves and the jackals and the hyenas in all our section their -tea afore I begins to arsk them questions." - -"How do you mean, ask them questions?" I queried, wishful to get him -into a talkative humor. - -"'Ittin' of them over the 'ead with a pole is one way. Scratchin' of -their ears in another, when gents as is flush wants a bit of a show-orf -to their gals. I don't so much mind the fust, the 'ittin of the -pole part afore I chucks in their dinner, but I waits till they've -'ad their sherry and kawffee, so to speak, afore I tries on with the -ear scratchin'. Mind you," he added philosophically, "there's a -deal of the same nature in us as in them theer animiles. Here's you -a-comin' and arskin' of me questions about my business, and I that -grump-like that only for your bloomin' 'arf-quid I'd 'a' seen you -blowed fust 'fore I'd answer. Not even when you arsked me sarcastic -like if I'd like you to arsk the Superintendent if you might arsk me -questions. Without offence did I tell yer to go to 'ell?" - -"You did." - -"An' when you said you'd report me for usin' obscene language that -was 'ittin' me over the 'ead. But the 'arf-quid made that all -right. I weren't a-goin' to fight, so I waited for the food, and -did with my 'owl as the wolves and lions and tigers does. But, lor' -love yer 'art, now that the old 'ooman has stuck a chunk of her -tea-cake in me, an' rinsed me out with her bloomin' old teapot, and I've -lit hup, you may scratch my ears for all you're worth, and won't -even get a growl out of me. Drive along with your questions. I -know what yer a-comin' at, that 'ere escaped wolf." - -"Exactly. I want you to give me your view of it. Just tell me how -it happened, and when I know the facts I'll get you to say what you -consider was the cause of it, and how you think the whole affair -will end." - -"All right, guv'nor. This 'ere is about the 'ole story. -That 'ere wolf what we called Bersicker was one of three gray -ones that came from Norway to Jamrach's, which we bought -off him four years ago. He was a nice well-behaved wolf, -that never gave no trouble to talk of. I'm more surprised -at 'im for wantin' to get out nor any other animile in the -place. But, there, you can't trust wolves no more nor women." - -"Don't you mind him, Sir!" broke in Mrs. Tom, with a cheery -laugh. "'E's got mindin' the animiles so long that blest -if he ain't like a old wolf 'isself! But there ain't no -'arm in 'im." - -"Well, Sir, it was about two hours after feedin' yesterday when I -first hear my disturbance. I was makin' up a litter in the monkey -house for a young puma which is ill. But when I heard the yelpin' -and 'owlin' I kem away straight. There was Bersicker a-tearin' like -a mad thing at the bars as if he wanted to get out. There wasn't -much people about that day, and close at hand was only one man, a -tall, thin chap, with a 'ook nose and a pointed beard, with a few -white hairs runnin' through it. He had a 'ard, cold look and red -eyes, and I took a sort of mislike to him, for it seemed as if it -was 'im as they was hirritated at. He 'ad white kid gloves on 'is -'ands, and he pointed out the animiles to me and says, 'Keeper, -these wolves seem upset at something.' - -"'Maybe it's you,' says I, for I did not like the airs as he -give 'isself. He didn't get angry, as I 'oped he would, but -he smiled a kind of insolent smile, with a mouth full of white, -sharp teeth. 'Oh no, they wouldn't like me,' 'e says. - -"'Ow yes, they would,' says I, a-imitatin' of him. 'They -always like a bone or two to clean their teeth on about tea -time, which you 'as a bagful.' - -"Well, it was a odd thing, but when the animiles see us -a-talkin' they lay down, and when I went over to Bersicker -he let me stroke his ears same as ever. That there man kem -over, and blessed but if he didn't put in his hand and stroke -the old wolf's ears too! - -"'Tyke care,' says I. 'Bersicker is quick.' - -"'Never mind,' he says. I'm used to 'em!' - -"'Are you in the business yourself?' I says, tyking off my -'at, for a man what trades in wolves, anceterer, is a good -friend to keepers. - -"'Nom,' says he, 'not exactly in the business, but I 'ave made pets -of several.' And with that he lifts his 'at as perlite as a lord, -and walks away. Old Bersicker kep' a-lookin' arter 'im till 'e was -out of sight, and then went and lay down in a corner and wouldn't -come hout the 'ole hevening. Well, larst night, so soon as the moon -was hup, the wolves here all began a-'owling. There warn't nothing -for them to 'owl at. There warn't no one near, except some one that -was evidently a-callin' a dog somewheres out back of the gardings in -the Park road. Once or twice I went out to see that all was right, -and it was, and then the 'owling stopped. Just before twelve -o'clock I just took a look round afore turnin' in, an', bust me, but -when I kem opposite to old Bersicker's cage I see the rails broken -and twisted about and the cage empty. And that's all I know for -certing." - -"Did any one else see anything?" - -"One of our gard'ners was a-comin' 'ome about that time from a -'armony, when he sees a big gray dog comin' out through the garding -'edges. At least, so he says, but I don't give much for it myself, -for if he did 'e never said a word about it to his missis when 'e -got 'ome, and it was only after the escape of the wolf was made -known, and we had been up all night a-huntin' of the Park for -Bersicker, that he remembered seein' anything. My own belief was -that the 'armony 'ad got into his 'ead." - -"Now, Mr. Bilder, can you account in any way for the escape -of the wolf?" - -"Well, Sir," he said, with a suspicious sort of modesty, "I think I -can, but I don't know as 'ow you'd be satisfied with the theory." - -"Certainly I shall. If a man like you, who knows the animals from -experience, can't hazard a good guess at any rate, who is even to -try?" - -"Well then, Sir, I accounts for it this way. It seems to me that -'ere wolf escaped--simply because he wanted to get out." - -From the hearty way that both Thomas and his wife laughed at the -joke I could see that it had done service before, and that the whole -explanation was simply an elaborate sell. I couldn't cope in -badinage with the worthy Thomas, but I thought I knew a surer way to -his heart, so I said, "Now, Mr. Bilder, we'll consider that first -half-sovereign worked off, and this brother of his is waiting to be -claimed when you've told me what you think will happen." - -"Right y'are, Sir," he said briskly. "Ye'll excoose me, I -know, for a-chaffin' of ye, but the old woman here winked at -me, which was as much as telling me to go on." - -"Well, I never!" said the old lady. - -"My opinion is this: that 'ere wolf is a'idin' of, somewheres. The -gard'ner wot didn't remember said he was a-gallopin' northward -faster than a horse could go, but I don't believe him, for, yer see, -Sir, wolves don't gallop no more nor dogs does, they not bein' built -that way. Wolves is fine things in a storybook, and I dessay when -they gets in packs and does be chivyin' somethin' that's more -afeared than they is they can make a devil of a noise and chop it -up, whatever it is. But, Lor' bless you, in real life a wolf is -only a low creature, not half so clever or bold as a good dog, and -not half a quarter so much fight in 'im. This one ain't been used -to fightin' or even to providin' for hisself, and more like he's -somewhere round the Park a'hidin' an' a'shiverin' of, and if he -thinks at all, wonderin' where he is to get his breakfast from. Or -maybe he's got down some area and is in a coal cellar. My eye, -won't some cook get a rum start when she sees his green eyes -a-shinin' at her out of the dark! If he can't get food he's bound to -look for it, and mayhap he may chance to light on a butcher's shop -in time. If he doesn't, and some nursemaid goes out walkin' or orf -with a soldier, leavin' of the hinfant in the perambulator--well, -then I shouldn't be surprised if the census is one babby the less. -That's all." - -I was handing him the half-sovereign, when something came bobbing up -against the window, and Mr. Bilder's face doubled its natural length -with surprise. - -"God bless me!" he said. "If there ain't old Bersicker come back by -'isself!" - -He went to the door and opened it, a most unnecessary proceeding it -seemed to me. I have always thought that a wild animal never looks -so well as when some obstacle of pronounced durability is between -us. A personal experience has intensified rather than diminished -that idea. - -After all, however, there is nothing like custom, for neither Bilder -nor his wife thought any more of the wolf than I should of a dog. -The animal itself was a peaceful and well-behaved as that father of -all picture-wolves, Red Riding Hood's quondam friend, whilst moving -her confidence in masquerade. - -The whole scene was a unutterable mixture of comedy and -pathos. The wicked wolf that for a half a day had -paralyzed London and set all the children in town shivering -in their shoes, was there in a sort of penitent mood, and -was received and petted like a sort of vulpine prodigal -son. Old Bilder examined him all over with most tender -solicitude, and when he had finished with his penitent -said, - -"There, I knew the poor old chap would get into some kind of -trouble. Didn't I say it all along? Here's his head all -cut and full of broken glass. 'E's been a-gettin' over -some bloomin' wall or other. It's a shyme that people are -allowed to top their walls with broken bottles. This 'ere's -what comes of it. Come along, Bersicker." - -He took the wolf and locked him up in a cage, with a piece -of meat that satisfied, in quantity at any rate, the elementary -conditions of the fatted calf, and went off to report. - -I came off too, to report the only exclusive information -that is given today regarding the strange escapade at the -Zoo. - - - -DR. SEWARD'S DIARY - -17 September.--I was engaged after dinner in my study posting up my -books, which, through press of other work and the many visits to Lucy, -had fallen sadly into arrear. Suddenly the door was burst open, and -in rushed my patient, with his face distorted with passion. I was -thunderstruck, for such a thing as a patient getting of his own accord -into the Superintendent's study is almost unknown. - -Without an instant's notice he made straight at me. He had a dinner -knife in his hand, and as I saw he was dangerous, I tried to keep the -table between us. He was too quick and too strong for me, however, -for before I could get my balance he had struck at me and cut my left -wrist rather severely. - -Before he could strike again, however, I got in my right hand and he -was sprawling on his back on the floor. My wrist bled freely, and -quite a little pool trickled on to the carpet. I saw that my friend -was not intent on further effort, and occupied myself binding up my -wrist, keeping a wary eye on the prostrate figure all the time. When -the attendants rushed in, and we turned our attention to him, his -employment positively sickened me. He was lying on his belly on the -floor licking up, like a dog, the blood which had fallen from my -wounded wrist. He was easily secured, and to my surprise, went with -the attendants quite placidly, simply repeating over and over again, -"The blood is the life! The blood is the life!" - -I cannot afford to lose blood just at present. I have lost too much -of late for my physical good, and then the prolonged strain of Lucy's -illness and its horrible phases is telling on me. I am over excited -and weary, and I need rest, rest, rest. Happily Van Helsing has not -summoned me, so I need not forego my sleep. Tonight I could not well -do without it. - - - -TELEGRAM, VAN HELSING, ANTWERP, TO SEWARD, CARFAX - -(Sent to Carfax, Sussex, as no county given, delivered late -by twenty-two hours.) - -17 September.--Do not fail to be at Hilllingham tonight. -If not watching all the time, frequently visit and see that -flowers are as placed, very important, do not fail. Shall -be with you as soon as possible after arrival. - - - -DR. SEWARD'S DIARY - -18 September.--Just off train to London. The arrival of Van -Helsing's telegram filled me with dismay. A whole night lost, -and I know by bitter experience what may happen in a night. -Of course it is possible that all may be well, but what may -have happened? Surely there is some horrible doom hanging over us -that every possible accident should thwart us in all we try to do. -I shall take this cylinder with me, and then I can complete -my entry on Lucy's phonograph. - - - - -MEMORANDUM LEFT BY LUCY WESTENRA - -17 September, Night.--I write this and leave it to be seen, -so that no one may by any chance get into trouble through -me. This is an exact record of what took place tonight. I -feel I am dying of weakness, and have barely strength to -write, but it must be done if I die in the doing. - -I went to bed as usual, taking care that the flowers were -placed as Dr. Van Helsing directed, and soon fell asleep. - -I was waked by the flapping at the window, which had begun after -that sleep-walking on the cliff at Whitby when Mina saved me, and -which now I know so well. I was not afraid, but I did wish that -Dr. Seward was in the next room, as Dr. Van Helsing said he would -be, so that I might have called him. I tried to sleep, but I -could not. Then there came to me the old fear of sleep, and I -determined to keep awake. Perversely sleep would try to come then -when I did not want it. So, as I feared to be alone, I opened my -door and called out, "Is there anybody there?" There was no -answer. I was afraid to wake mother, and so closed my door -again. Then outside in the shrubbery I heard a sort of howl like -a dog's, but more fierce and deeper. I went to the window and -looked out, but could see nothing, except a big bat, which had -evidently been buffeting its wings against the window. So I went -back to bed again, but determined not to go to sleep. Presently -the door opened, and mother looked in. Seeing by my moving that -I was not asleep, she came in and sat by me. She said to me even -more sweetly and softly than her wont, - -"I was uneasy about you, darling, and came in to see that -you were all right." - -I feared she might catch cold sitting there, and asked her -to come in and sleep with me, so she came into bed, and lay -down beside me. She did not take off her dressing gown, -for she said she would only stay a while and then go back -to her own bed. As she lay there in my arms, and I in hers -the flapping and buffeting came to the window again. She -was startled and a little frightened, and cried out, "What -is that?" - -I tried to pacify her, and at last succeeded, and she lay -quiet. But I could hear her poor dear heart still beating -terribly. After a while there was the howl again out in -the shrubbery, and shortly after there was a crash at the -window, and a lot of broken glass was hurled on the floor. -The window blind blew back with the wind that rushed in, -and in the aperture of the broken panes there was the head -of a great, gaunt gray wolf. - -Mother cried out in a fright, and struggled up into a -sitting posture, and clutched wildly at anything that would -help her. Amongst other things, she clutched the wreath of -flowers that Dr. Van Helsing insisted on my wearing round -my neck, and tore it away from me. For a second or two she -sat up, pointing at the wolf, and there was a strange and -horrible gurgling in her throat. Then she fell over, as if -struck with lightning, and her head hit my forehead and -made me dizzy for a moment or two. - -The room and all round seemed to spin round. I kept my eyes -fixed on the window, but the wolf drew his head back, and a whole -myriad of little specks seems to come blowing in through the -broken window, and wheeling and circling round like the pillar of -dust that travellers describe when there is a simoon in the -desert. I tried to stir, but there was some spell upon me, and -dear Mother's poor body, which seemed to grow cold already, for -her dear heart had ceased to beat, weighed me down, and I -remembered no more for a while. - -The time did not seem long, but very, very awful, till I -recovered consciousness again. Somewhere near, a passing -bell was tolling. The dogs all round the neighbourhood were -howling, and in our shrubbery, seemingly just outside, a -nightingale was singing. I was dazed and stupid with pain -and terror and weakness, but the sound of the nightingale -seemed like the voice of my dead mother come back to comfort me. -The sounds seemed to have awakened the maids, too, for I could -hear their bare feet pattering outside my door. I called to -them, and they came in, and when they saw what had happened, and -what it was that lay over me on the bed, they screamed out. The -wind rushed in through the broken window, and the door slammed -to. They lifted off the body of my dear mother, and laid her, -covered up with a sheet, on the bed after I had got up. They -were all so frightened and nervous that I directed them to go to -the dining room and each have a glass of wine. The door flew -open for an instant and closed again. The maids shrieked, and -then went in a body to the dining room, and I laid what flowers I -had on my dear mother's breast. When they were there I -remembered what Dr. Van Helsing had told me, but I didn't like to -remove them, and besides, I would have some of the servants to -sit up with me now. I was surprised that the maids did not come -back. I called them, but got no answer, so I went to the dining -room to look for them. - -My heart sank when I saw what had happened. They all four -lay helpless on the floor, breathing heavily. The decanter -of sherry was on the table half full, but there was a queer, -acrid smell about. I was suspicious, and examined the decanter. -It smelt of laudanum, and looking on the sideboard, I found that -the bottle which Mother's doctor uses for her--oh! did use--was -empty. What am I to do? What am I to do? I am back in the room -with Mother. I cannot leave her, and I am alone, save for the -sleeping servants, whom some one has drugged. Alone with the -dead! I dare not go out, for I can hear the low howl of the wolf -through the broken window. - -The air seems full of specks, floating and circling in the -draught from the window, and the lights burn blue and dim. -What am I to do? God shield me from harm this night! I -shall hide this paper in my breast, where they shall find -it when they come to lay me out. My dear mother gone! It -is time that I go too. Goodbye, dear Arthur, if I should -not survive this night. God keep you, dear, and God help -me! - - - - -CHAPTER 12 - - -DR. SEWARD'S DIARY - -18 September.--I drove at once to Hillingham and arrived early. -Keeping my cab at the gate, I went up the avenue alone. I knocked -gently and rang as quietly as possible, for I feared to disturb Lucy -or her mother, and hoped to only bring a servant to the door. After a -while, finding no response, I knocked and rang again, still no -answer. I cursed the laziness of the servants that they should lie -abed at such an hour, for it was now ten o'clock, and so rang and -knocked again, but more impatiently, but still without response. -Hitherto I had blamed only the servants, but now a terrible fear began -to assail me. Was this desolation but another link in the chain of -doom which seemed drawing tight round us? Was it indeed a house of -death to which I had come, too late? I know that minutes, even -seconds of delay, might mean hours of danger to Lucy, if she had had -again one of those frightful relapses, and I went round the house to -try if I could find by chance an entry anywhere. - -I could find no means of ingress. Every window and door was fastened -and locked, and I returned baffled to the porch. As I did so, I heard -the rapid pit-pat of a swiftly driven horse's feet. They stopped at -the gate, and a few seconds later I met Van Helsing running up the -avenue. When he saw me, he gasped out, "Then it was you, and just -arrived. How is she? Are we too late? Did you not get my telegram?" - -I answered as quickly and coherently as I could that I had only got -his telegram early in the morning, and had not a minute in coming -here, and that I could not make any one in the house hear me. He -paused and raised his hat as he said solemnly, "Then I fear we are too -late. God's will be done!" - -With his usual recuperative energy, he went on, "Come. If there be no -way open to get in, we must make one. Time is all in all to us now." - -We went round to the back of the house, where there was a kitchen -window. The Professor took a small surgical saw from his case, and -handing it to me, pointed to the iron bars which guarded the window. -I attacked them at once and had very soon cut through three of them. -Then with a long, thin knife we pushed back the fastening of the -sashes and opened the window. I helped the Professor in, and followed -him. There was no one in the kitchen or in the servants' rooms, which -were close at hand. We tried all the rooms as we went along, and in -the dining room, dimly lit by rays of light through the shutters, -found four servant women lying on the floor. There was no need to -think them dead, for their stertorous breathing and the acrid smell of -laudanum in the room left no doubt as to their condition. - -Van Helsing and I looked at each other, and as we moved away he said, -"We can attend to them later." Then we ascended to Lucy's room. For an -instant or two we paused at the door to listen, but there was no sound -that we could hear. With white faces and trembling hands, we opened -the door gently, and entered the room. - -How shall I describe what we saw? On the bed lay two women, Lucy and -her mother. The latter lay farthest in, and she was covered with a -white sheet, the edge of which had been blown back by the drought -through the broken window, showing the drawn, white, face, with a look -of terror fixed upon it. By her side lay Lucy, with face white and -still more drawn. The flowers which had been round her neck we found -upon her mother's bosom, and her throat was bare, showing the two -little wounds which we had noticed before, but looking horribly white -and mangled. Without a word the Professor bent over the bed, his head -almost touching poor Lucy's breast. Then he gave a quick turn of his -head, as of one who listens, and leaping to his feet, he cried out to -me, "It is not yet too late! Quick! Quick! Bring the brandy!" - -I flew downstairs and returned with it, taking care to smell and taste -it, lest it, too, were drugged like the decanter of sherry which I -found on the table. The maids were still breathing, but more -restlessly, and I fancied that the narcotic was wearing off. I did -not stay to make sure, but returned to Van Helsing. He rubbed the -brandy, as on another occasion, on her lips and gums and on her wrists -and the palms of her hands. He said to me, "I can do this, all that -can be at the present. You go wake those maids. Flick them in the -face with a wet towel, and flick them hard. Make them get heat and -fire and a warm bath. This poor soul is nearly as cold as that beside -her. She will need be heated before we can do anything more." - -I went at once, and found little difficulty in waking three of the -women. The fourth was only a young girl, and the drug had evidently -affected her more strongly so I lifted her on the sofa and let her -sleep. - -The others were dazed at first, but as remembrance came back to them -they cried and sobbed in a hysterical manner. I was stern with them, -however, and would not let them talk. I told them that one life was -bad enough to lose, and if they delayed they would sacrifice Miss -Lucy. So, sobbing and crying they went about their way, half clad as -they were, and prepared fire and water. Fortunately, the kitchen and -boiler fires were still alive, and there was no lack of hot water. We -got a bath and carried Lucy out as she was and placed her in it. -Whilst we were busy chafing her limbs there was a knock at the hall -door. One of the maids ran off, hurried on some more clothes, and -opened it. Then she returned and whispered to us that there was a -gentleman who had come with a message from Mr. Holmwood. I bade her -simply tell him that he must wait, for we could see no one now. She -went away with the message, and, engrossed with our work, I clean -forgot all about him. - -I never saw in all my experience the Professor work in such deadly -earnest. I knew, as he knew, that it was a stand-up fight with death, -and in a pause told him so. He answered me in a way that I did not -understand, but with the sternest look that his face could wear. - -"If that were all, I would stop here where we are now, and let her -fade away into peace, for I see no light in life over her horizon." He -went on with his work with, if possible, renewed and more frenzied -vigour. - -Presently we both began to be conscious that the heat was beginning to -be of some effect. Lucy's heart beat a trifle more audibly to the -stethoscope, and her lungs had a perceptible movement. Van Helsing's -face almost beamed, and as we lifted her from the bath and rolled her -in a hot sheet to dry her he said to me, "The first gain is ours! -Check to the King!" - -We took Lucy into another room, which had by now been prepared, and -laid her in bed and forced a few drops of brandy down her throat. I -noticed that Van Helsing tied a soft silk handkerchief round her -throat. She was still unconscious, and was quite as bad as, if not -worse than, we had ever seen her. - -Van Helsing called in one of the women, and told her to stay with her -and not to take her eyes off her till we returned, and then beckoned -me out of the room. - -"We must consult as to what is to be done," he said as we descended -the stairs. In the hall he opened the dining room door, and we passed -in, he closing the door carefully behind him. The shutters had been -opened, but the blinds were already down, with that obedience to the -etiquette of death which the British woman of the lower classes always -rigidly observes. The room was, therefore, dimly dark. It was, -however, light enough for our purposes. Van Helsing's sternness was -somewhat relieved by a look of perplexity. He was evidently torturing -his mind about something, so I waited for an instant, and he spoke. - -"What are we to do now? Where are we to turn for help? We must have -another transfusion of blood, and that soon, or that poor girl's life -won't be worth an hour's purchase. You are exhausted already. I am -exhausted too. I fear to trust those women, even if they would have -courage to submit. What are we to do for some one who will open his -veins for her?" - -"What's the matter with me, anyhow?" - -The voice came from the sofa across the room, and its tones brought -relief and joy to my heart, for they were those of Quincey Morris. - -Van Helsing started angrily at the first sound, but his face softened -and a glad look came into his eyes as I cried out, "Quincey Morris!" -and rushed towards him with outstretched hands. - -"What brought you here?" I cried as our hands met. - -"I guess Art is the cause." - -He handed me a telegram.--'Have not heard from Seward for three days, -and am terribly anxious. Cannot leave. Father still in same -condition. Send me word how Lucy is. Do not delay.--Holmwood.' - -"I think I came just in the nick of time. You know you have only to -tell me what to do." - -Van Helsing strode forward, and took his hand, looking him straight in -the eyes as he said, "A brave man's blood is the best thing on this -earth when a woman is in trouble. You're a man and no mistake. Well, -the devil may work against us for all he's worth, but God sends us men -when we want them." - -Once again we went through that ghastly operation. I have not the -heart to go through with the details. Lucy had got a terrible shock -and it told on her more than before, for though plenty of blood went -into her veins, her body did not respond to the treatment as well as -on the other occasions. Her struggle back into life was something -frightful to see and hear. However, the action of both heart and -lungs improved, and Van Helsing made a sub-cutaneous injection of -morphia, as before, and with good effect. Her faint became a profound -slumber. The Professor watched whilst I went downstairs with Quincey -Morris, and sent one of the maids to pay off one of the cabmen who -were waiting. - -I left Quincey lying down after having a glass of wine, and told the -cook to get ready a good breakfast. Then a thought struck me, and I -went back to the room where Lucy now was. When I came softly in, I -found Van Helsing with a sheet or two of note paper in his hand. He -had evidently read it, and was thinking it over as he sat with his -hand to his brow. There was a look of grim satisfaction in his face, -as of one who has had a doubt solved. He handed me the paper saying -only, "It dropped from Lucy's breast when we carried her to the bath." - -When I had read it, I stood looking at the Professor, and after a -pause asked him, "In God's name, what does it all mean? Was she, or -is she, mad, or what sort of horrible danger is it?" I was so -bewildered that I did not know what to say more. Van Helsing put out -his hand and took the paper, saying, - -"Do not trouble about it now. Forget it for the present. You shall -know and understand it all in good time, but it will be later. And -now what is it that you came to me to say?" This brought me back to -fact, and I was all myself again. - -"I came to speak about the certificate of death. If we do not act -properly and wisely, there may be an inquest, and that paper would -have to be produced. I am in hopes that we need have no inquest, for -if we had it would surely kill poor Lucy, if nothing else did. I -know, and you know, and the other doctor who attended her knows, that -Mrs. Westenra had disease of the heart, and we can certify that she -died of it. Let us fill up the certificate at once, and I shall take -it myself to the registrar and go on to the undertaker." - -"Good, oh my friend John! Well thought of! Truly Miss Lucy, if she -be sad in the foes that beset her, is at least happy in the friends -that love her. One, two, three, all open their veins for her, besides -one old man. Ah, yes, I know, friend John. I am not blind! I love -you all the more for it! Now go." - -In the hall I met Quincey Morris, with a telegram for Arthur telling -him that Mrs. Westenra was dead, that Lucy also had been ill, but was -now going on better, and that Van Helsing and I were with her. I told -him where I was going, and he hurried me out, but as I was going said, - -"When you come back, Jack, may I have two words with you all to -ourselves?" I nodded in reply and went out. I found no difficulty -about the registration, and arranged with the local undertaker to come -up in the evening to measure for the coffin and to make arrangements. - -When I got back Quincey was waiting for me. I told him I would see -him as soon as I knew about Lucy, and went up to her room. She was -still sleeping, and the Professor seemingly had not moved from his -seat at her side. From his putting his finger to his lips, I gathered -that he expected her to wake before long and was afraid of -fore-stalling nature. So I went down to Quincey and took him into the -breakfast room, where the blinds were not drawn down, and which was a -little more cheerful, or rather less cheerless, than the other rooms. - -When we were alone, he said to me, "Jack Seward, I don't want to shove -myself in anywhere where I've no right to be, but this is no ordinary -case. You know I loved that girl and wanted to marry her, but -although that's all past and gone, I can't help feeling anxious about -her all the same. What is it that's wrong with her? The Dutchman, -and a fine old fellow he is, I can see that, said that time you two -came into the room, that you must have another transfusion of blood, -and that both you and he were exhausted. Now I know well that you -medical men speak in camera, and that a man must not expect to know -what they consult about in private. But this is no common matter, and -whatever it is, I have done my part. Is not that so?" - -"That's so," I said, and he went on. - -"I take it that both you and Van Helsing had done already what I did -today. Is not that so?" - -"That's so." - -"And I guess Art was in it too. When I saw him four days ago down at -his own place he looked queer. I have not seen anything pulled down -so quick since I was on the Pampas and had a mare that I was fond of -go to grass all in a night. One of those big bats that they call -vampires had got at her in the night, and what with his gorge and the -vein left open, there wasn't enough blood in her to let her stand up, -and I had to put a bullet through her as she lay. Jack, if you may -tell me without betraying confidence, Arthur was the first, is not -that so?" - -As he spoke the poor fellow looked terribly anxious. He was in a -torture of suspense regarding the woman he loved, and his utter -ignorance of the terrible mystery which seemed to surround her -intensified his pain. His very heart was bleeding, and it took all -the manhood of him, and there was a royal lot of it, too, to keep him -from breaking down. I paused before answering, for I felt that I must -not betray anything which the Professor wished kept secret, but -already he knew so much, and guessed so much, that there could be no -reason for not answering, so I answered in the same phrase. - -"That's so." - -"And how long has this been going on?" - -"About ten days." - -"Ten days! Then I guess, Jack Seward, that that poor pretty creature -that we all love has had put into her veins within that time the blood -of four strong men. Man alive, her whole body wouldn't hold it." Then -coming close to me, he spoke in a fierce half-whisper. "What took it -out?" - -I shook my head. "That," I said, "is the crux. Van Helsing is simply -frantic about it, and I am at my wits' end. I can't even hazard a -guess. There has been a series of little circumstances which have -thrown out all our calculations as to Lucy being properly watched. -But these shall not occur again. Here we stay until all be well, or -ill." - -Quincey held out his hand. "Count me in," he said. "You and the -Dutchman will tell me what to do, and I'll do it." - -When she woke late in the afternoon, Lucy's first movement was to feel -in her breast, and to my surprise, produced the paper which Van -Helsing had given me to read. The careful Professor had replaced it -where it had come from, lest on waking she should be alarmed. Her -eyes then lit on Van Helsing and on me too, and gladdened. Then she -looked round the room, and seeing where she was, shuddered. She gave -a loud cry, and put her poor thin hands before her pale face. - -We both understood what was meant, that she had realized to the full -her mother's death. So we tried what we could to comfort her. -Doubtless sympathy eased her somewhat, but she was very low in thought -and spirit, and wept silently and weakly for a long time. We told her -that either or both of us would now remain with her all the time, and -that seemed to comfort her. Towards dusk she fell into a doze. Here -a very odd thing occurred. Whilst still asleep she took the paper -from her breast and tore it in two. Van Helsing stepped over and took -the pieces from her. All the same, however, she went on with the -action of tearing, as though the material were still in her hands. -Finally she lifted her hands and opened them as though scattering the -fragments. Van Helsing seemed surprised, and his brows gathered as if -in thought, but he said nothing. - - -19 September.--All last night she slept fitfully, being always afraid -to sleep, and something weaker when she woke from it. The Professor -and I took in turns to watch, and we never left her for a moment -unattended. Quincey Morris said nothing about his intention, but I -knew that all night long he patrolled round and round the house. - -When the day came, its searching light showed the ravages in poor -Lucy's strength. She was hardly able to turn her head, and the little -nourishment which she could take seemed to do her no good. At times -she slept, and both Van Helsing and I noticed the difference in her, -between sleeping and waking. Whilst asleep she looked stronger, -although more haggard, and her breathing was softer. Her open mouth -showed the pale gums drawn back from the teeth, which looked -positively longer and sharper than usual. When she woke the softness -of her eyes evidently changed the expression, for she looked her own -self, although a dying one. In the afternoon she asked for Arthur, -and we telegraphed for him. Quincey went off to meet him at the -station. - -When he arrived it was nearly six o'clock, and the sun was setting -full and warm, and the red light streamed in through the window and -gave more colour to the pale cheeks. When he saw her, Arthur was -simply choking with emotion, and none of us could speak. In the hours -that had passed, the fits of sleep, or the comatose condition that -passed for it, had grown more frequent, so that the pauses when -conversation was possible were shortened. Arthur's presence, however, -seemed to act as a stimulant. She rallied a little, and spoke to him -more brightly than she had done since we arrived. He too pulled -himself together, and spoke as cheerily as he could, so that the best -was made of everything. - -It is now nearly one o'clock, and he and Van Helsing are sitting with -her. I am to relieve them in a quarter of an hour, and I am entering -this on Lucy's phonograph. Until six o'clock they are to try to rest. -I fear that tomorrow will end our watching, for the shock has been too -great. The poor child cannot rally. God help us all. - - - - -LETTER MINA HARKER TO LUCY WESTENRA - -(Unopened by her) - -17 September - -My dearest Lucy, - -"It seems an age since I heard from you, or indeed since I -wrote. You will pardon me, I know, for all my faults when -you have read all my budget of news. Well, I got my husband back -all right. When we arrived at Exeter there was a carriage -waiting for us, and in it, though he had an attack of gout, Mr. -Hawkins. He took us to his house, where there were rooms for us -all nice and comfortable, and we dined together. After dinner -Mr. Hawkins said, - -"'My dears, I want to drink your health and prosperity, and -may every blessing attend you both. I know you both from -children, and have, with love and pride, seen you grow up. -Now I want you to make your home here with me. I have left -to me neither chick nor child. All are gone, and in my -will I have left you everything.' I cried, Lucy dear, as -Jonathan and the old man clasped hands. Our evening was a -very, very happy one. - -"So here we are, installed in this beautiful old house, and -from both my bedroom and the drawing room I can see the -great elms of the cathedral close, with their great black -stems standing out against the old yellow stone of the cathedral, -and I can hear the rooks overhead cawing and cawing and -chattering and chattering and gossiping all day, after the manner -of rooks--and humans. I am busy, I need not tell you, arranging -things and housekeeping. Jonathan and Mr. Hawkins are busy all -day, for now that Jonathan is a partner, Mr. Hawkins wants to -tell him all about the clients. - -"How is your dear mother getting on? I wish I could run up -to town for a day or two to see you, dear, but I dare not -go yet, with so much on my shoulders, and Jonathan wants -looking after still. He is beginning to put some flesh on -his bones again, but he was terribly weakened by the long -illness. Even now he sometimes starts out of his sleep in -a sudden way and awakes all trembling until I can coax him -back to his usual placidity. However, thank God, these -occasions grow less frequent as the days go on, and they -will in time pass away altogether, I trust. And now I have -told you my news, let me ask yours. When are you to be -married, and where, and who is to perform the ceremony, and -what are you to wear, and is it to be a public or private -wedding? Tell me all about it, dear, tell me all about -everything, for there is nothing which interests you which -will not be dear to me. Jonathan asks me to send his 'respectful -duty', but I do not think that is good enough from the junior -partner of the important firm Hawkins & Harker. And so, as you -love me, and he loves me, and I love you with all the moods and -tenses of the verb, I send you simply his 'love' instead. -Goodbye, my dearest Lucy, and blessings on you. - -"Yours, - -"Mina Harker" - - - -REPORT FROM PATRICK HENNESSEY, MD, MRCSLK, QCPI, ETC, ETC, -TO JOHN SEWARD, MD - -20 September - -My dear Sir: - -"In accordance with your wishes, I enclose report of the -conditions of everything left in my charge. With regard to -patient, Renfield, there is more to say. He has had another -outbreak, which might have had a dreadful ending, but which, as -it fortunately happened, was unattended with any unhappy results. -This afternoon a carrier's cart with two men made a call at the -empty house whose grounds abut on ours, the house to which, you -will remember, the patient twice ran away. The men stopped at -our gate to ask the porter their way, as they were strangers. - -"I was myself looking out of the study window, having a -smoke after dinner, and saw one of them come up to the -house. As he passed the window of Renfield's room, the -patient began to rate him from within, and called him all -the foul names he could lay his tongue to. The man, who -seemed a decent fellow enough, contented himself by telling -him to 'shut up for a foul-mouthed beggar', whereon our man -accused him of robbing him and wanting to murder him and -said that he would hinder him if he were to swing for it. -I opened the window and signed to the man not to notice, so -he contented himself after looking the place over and making up -his mind as to what kind of place he had got to by saying, 'Lor' -bless yer, sir, I wouldn't mind what was said to me in a bloomin' -madhouse. I pity ye and the guv'nor for havin' to live in the -house with a wild beast like that.' - -"Then he asked his way civilly enough, and I told him where -the gate of the empty house was. He went away followed by -threats and curses and revilings from our man. I went down -to see if I could make out any cause for his anger, since -he is usually such a well-behaved man, and except his violent -fits nothing of the kind had ever occurred. I found him, to my -astonishment, quite composed and most genial in his manner. I -tried to get him to talk of the incident, but he blandly asked me -questions as to what I meant, and led me to believe that he was -completely oblivious of the affair. It was, I am sorry to say, -however, only another instance of his cunning, for within half an -hour I heard of him again. This time he had broken out through -the window of his room, and was running down the avenue. I -called to the attendants to follow me, and ran after him, for I -feared he was intent on some mischief. My fear was justified -when I saw the same cart which had passed before coming down the -road, having on it some great wooden boxes. The men were wiping -their foreheads, and were flushed in the face, as if with violent -exercise. Before I could get up to him, the patient rushed at -them, and pulling one of them off the cart, began to knock his -head against the ground. If I had not seized him just at the -moment, I believe he would have killed the man there and then. -The other fellow jumped down and struck him over the head with -the butt end of his heavy whip. It was a horrible blow, but he -did not seem to mind it, but seized him also, and struggled with -the three of us, pulling us to and fro as if we were kittens. -You know I am no lightweight, and the others were both burly men. -At first he was silent in his fighting, but as we began to master -him, and the attendants were putting a strait waistcoat on him, -he began to shout, 'I'll frustrate them! They shan't rob me! -They shan't murder me by inches! I'll fight for my Lord and -Master!' and all sorts of similar incoherent ravings. It was -with very considerable difficulty that they got him back to the -house and put him in the padded room. One of the attendants, -Hardy, had a finger broken. However, I set it all right, and he -is going on well. - -"The two carriers were at first loud in their threats of -actions for damages, and promised to rain all the penalties -of the law on us. Their threats were, however, mingled -with some sort of indirect apology for the defeat of the -two of them by a feeble madman. They said that if it had -not been for the way their strength had been spent in carrying -and raising the heavy boxes to the cart they would have made -short work of him. They gave as another reason for their defeat -the extraordinary state of drouth to which they had been reduced -by the dusty nature of their occupation and the reprehensible -distance from the scene of their labors of any place of public -entertainment. I quite understood their drift, and after a stiff -glass of strong grog, or rather more of the same, and with each a -sovereign in hand, they made light of the attack, and swore that -they would encounter a worse madman any day for the pleasure of -meeting so 'bloomin' good a bloke' as your correspondent. I took -their names and addresses, in case they might be needed. They -are as follows: Jack Smollet, of Dudding's Rents, King George's -Road, Great Walworth, and Thomas Snelling, Peter Farley's Row, -Guide Court, Bethnal Green. They are both in the employment of -Harris & Sons, Moving and Shipment Company, Orange Master's Yard, -Soho. - -"I shall report to you any matter of interest occurring here, and -shall wire you at once if there is anything of importance. - -"Believe me, dear Sir, - -"Yours faithfully, - -"Patrick Hennessey." - - - -LETTER, MINA HARKER TO LUCY WESTENRA (Unopened by her) - -18 September - -"My dearest Lucy, - -"Such a sad blow has befallen us. Mr. Hawkins has died very -suddenly. Some may not think it so sad for us, but we had -both come to so love him that it really seems as though we -had lost a father. I never knew either father or mother, -so that the dear old man's death is a real blow to me. Jonathan -is greatly distressed. It is not only that he feels sorrow, deep -sorrow, for the dear, good man who has befriended him all his -life, and now at the end has treated him like his own son and -left him a fortune which to people of our modest bringing up is -wealth beyond the dream of avarice, but Jonathan feels it on -another account. He says the amount of responsibility which it -puts upon him makes him nervous. He begins to doubt himself. I -try to cheer him up, and my belief in him helps him to have a -belief in himself. But it is here that the grave shock that he -experienced tells upon him the most. Oh, it is too hard that a -sweet, simple, noble, strong nature such as his, a nature which -enabled him by our dear, good friend's aid to rise from clerk to -master in a few years, should be so injured that the very essence -of its strength is gone. Forgive me, dear, if I worry you with my -troubles in the midst of your own happiness, but Lucy dear, I -must tell someone, for the strain of keeping up a brave and -cheerful appearance to Jonathan tries me, and I have no one here -that I can confide in. I dread coming up to London, as we must -do that day after tomorrow, for poor Mr. Hawkins left in his will -that he was to be buried in the grave with his father. As there -are no relations at all, Jonathan will have to be chief mourner. -I shall try to run over to see you, dearest, if only for a few -minutes. Forgive me for troubling you. With all blessings, - -"Your loving - -"Mina Harker" - - - -DR. SEWARD'S DIARY - -20 September.--Only resolution and habit can let me make an entry -tonight. I am too miserable, too low spirited, too sick of the world -and all in it, including life itself, that I would not care if I heard -this moment the flapping of the wings of the angel of death. And he -has been flapping those grim wings to some purpose of late, Lucy's -mother and Arthur's father, and now . . . Let me get on with my work. - -I duly relieved Van Helsing in his watch over Lucy. We wanted Arthur -to go to rest also, but he refused at first. It was only when I told -him that we should want him to help us during the day, and that we -must not all break down for want of rest, lest Lucy should suffer, -that he agreed to go. - -Van Helsing was very kind to him. "Come, my child," he said. "Come -with me. You are sick and weak, and have had much sorrow and much -mental pain, as well as that tax on your strength that we know of. -You must not be alone, for to be alone is to be full of fears and -alarms. Come to the drawing room, where there is a big fire, and -there are two sofas. You shall lie on one, and I on the other, and -our sympathy will be comfort to each other, even though we do not -speak, and even if we sleep." - -Arthur went off with him, casting back a longing look on Lucy's face, -which lay in her pillow, almost whiter than the lawn. She lay quite -still, and I looked around the room to see that all was as it should -be. I could see that the Professor had carried out in this room, as -in the other, his purpose of using the garlic. The whole of the -window sashes reeked with it, and round Lucy's neck, over the silk -handkerchief which Van Helsing made her keep on, was a rough chaplet -of the same odorous flowers. - -Lucy was breathing somewhat stertorously, and her face was at its -worst, for the open mouth showed the pale gums. Her teeth, in the -dim, uncertain light, seemed longer and sharper than they had been in -the morning. In particular, by some trick of the light, the canine -teeth looked longer and sharper than the rest. - -I sat down beside her, and presently she moved uneasily. At the same -moment there came a sort of dull flapping or buffeting at the window. -I went over to it softly, and peeped out by the corner of the blind. -There was a full moonlight, and I could see that the noise was made by -a great bat, which wheeled around, doubtless attracted by the light, -although so dim, and every now and again struck the window with its -wings. When I came back to my seat, I found that Lucy had moved -slightly, and had torn away the garlic flowers from her throat. I -replaced them as well as I could, and sat watching her. - -Presently she woke, and I gave her food, as Van Helsing had -prescribed. She took but a little, and that languidly. There did not -seem to be with her now the unconscious struggle for life and strength -that had hitherto so marked her illness. It struck me as curious that -the moment she became conscious she pressed the garlic flowers close -to her. It was certainly odd that whenever she got into that -lethargic state, with the stertorous breathing, she put the flowers -from her, but that when she waked she clutched them close. There was -no possibility of making any mistake about this, for in the long hours -that followed, she had many spells of sleeping and waking and repeated -both actions many times. - -At six o'clock Van Helsing came to relieve me. Arthur had then fallen -into a doze, and he mercifully let him sleep on. When he saw Lucy's -face I could hear the hissing indraw of breath, and he said to me in a -sharp whisper. "Draw up the blind. I want light!" Then he bent down, -and, with his face almost touching Lucy's, examined her carefully. He -removed the flowers and lifted the silk handkerchief from her throat. -As he did so he started back and I could hear his ejaculation, "Mein -Gott!" as it was smothered in his throat. I bent over and looked, -too, and as I noticed some queer chill came over me. The wounds on -the throat had absolutely disappeared. - -For fully five minutes Van Helsing stood looking at her, with his face -at its sternest. Then he turned to me and said calmly, "She is -dying. It will not be long now. It will be much difference, mark me, -whether she dies conscious or in her sleep. Wake that poor boy, and -let him come and see the last. He trusts us, and we have promised -him." - -I went to the dining room and waked him. He was dazed for a moment, -but when he saw the sunlight streaming in through the edges of the -shutters he thought he was late, and expressed his fear. I assured -him that Lucy was still asleep, but told him as gently as I could that -both Van Helsing and I feared that the end was near. He covered his -face with his hands, and slid down on his knees by the sofa, where he -remained, perhaps a minute, with his head buried, praying, whilst his -shoulders shook with grief. I took him by the hand and raised him up. -"Come," I said, "my dear old fellow, summon all your fortitude. It -will be best and easiest for her." - -When we came into Lucy's room I could see that Van Helsing had, with -his usual forethought, been putting matters straight and making -everything look as pleasing as possible. He had even brushed Lucy's -hair, so that it lay on the pillow in its usual sunny ripples. When -we came into the room she opened her eyes, and seeing him, whispered -softly, "Arthur! Oh, my love, I am so glad you have come!" - -He was stooping to kiss her, when Van Helsing motioned him back. -"No," he whispered, "not yet! Hold her hand, it will comfort her -more." - -So Arthur took her hand and knelt beside her, and she looked her best, -with all the soft lines matching the angelic beauty of her eyes. Then -gradually her eyes closed, and she sank to sleep. For a little bit -her breast heaved softly, and her breath came and went like a tired -child's. - -And then insensibly there came the strange change which I had noticed -in the night. Her breathing grew stertorous, the mouth opened, and -the pale gums, drawn back, made the teeth look longer and sharper than -ever. In a sort of sleep-waking, vague, unconscious way she opened -her eyes, which were now dull and hard at once, and said in a soft, -voluptuous voice, such as I had never heard from her lips, "Arthur! -Oh, my love, I am so glad you have come! Kiss me!" - -Arthur bent eagerly over to kiss her, but at that instant Van Helsing, -who, like me, had been startled by her voice, swooped upon him, and -catching him by the neck with both hands, dragged him back with a fury -of strength which I never thought he could have possessed, and -actually hurled him almost across the room. - -"Not on your life!" he said, "not for your living soul and hers!" And -he stood between them like a lion at bay. - -Arthur was so taken aback that he did not for a moment know what to do -or say, and before any impulse of violence could seize him he realized -the place and the occasion, and stood silent, waiting. - -I kept my eyes fixed on Lucy, as did Van Helsing, and we saw a spasm -as of rage flit like a shadow over her face. The sharp teeth clamped -together. Then her eyes closed, and she breathed heavily. - -Very shortly after she opened her eyes in all their softness, and -putting out her poor, pale, thin hand, took Van Helsing's great brown -one, drawing it close to her, she kissed it. "My true friend," she -said, in a faint voice, but with untellable pathos, "My true friend, -and his! Oh, guard him, and give me peace!" - -"I swear it!" he said solemnly, kneeling beside her and holding up his -hand, as one who registers an oath. Then he turned to Arthur, and -said to him, "Come, my child, take her hand in yours, and kiss her on -the forehead, and only once." - -Their eyes met instead of their lips, and so they parted. Lucy's eyes -closed, and Van Helsing, who had been watching closely, took Arthur's -arm, and drew him away. - -And then Lucy's breathing became stertorous again, and all at once it -ceased. - -"It is all over," said Van Helsing. "She is dead!" - -I took Arthur by the arm, and led him away to the drawing room, where -he sat down, and covered his face with his hands, sobbing in a way -that nearly broke me down to see. - -I went back to the room, and found Van Helsing looking at poor Lucy, -and his face was sterner than ever. Some change had come over her -body. Death had given back part of her beauty, for her brow and -cheeks had recovered some of their flowing lines. Even the lips had -lost their deadly pallor. It was as if the blood, no longer needed -for the working of the heart, had gone to make the harshness of death -as little rude as might be. - -"We thought her dying whilst she slept, and sleeping when she died." - - -I stood beside Van Helsing, and said, "Ah well, poor girl, there is -peace for her at last. It is the end!" - -He turned to me, and said with grave solemnity, "Not so, alas! Not -so. It is only the beginning!" - -When I asked him what he meant, he only shook his head and answered, -"We can do nothing as yet. Wait and see." - - - - -CHAPTER 13 - - -DR. SEWARD'S DIARY--cont. - -The funeral was arranged for the next succeeding day, so that Lucy and -her mother might be buried together. I attended to all the ghastly -formalities, and the urbane undertaker proved that his staff was -afflicted, or blessed, with something of his own obsequious suavity. -Even the woman who performed the last offices for the dead remarked to -me, in a confidential, brother-professional way, when she had come out -from the death chamber, - -"She makes a very beautiful corpse, sir. It's quite a privilege to -attend on her. It's not too much to say that she will do credit to -our establishment!" - -I noticed that Van Helsing never kept far away. This was possible -from the disordered state of things in the household. There were no -relatives at hand, and as Arthur had to be back the next day to attend -at his father's funeral, we were unable to notify any one who should -have been bidden. Under the circumstances, Van Helsing and I took it -upon ourselves to examine papers, etc. He insisted upon looking over -Lucy's papers himself. I asked him why, for I feared that he, being a -foreigner, might not be quite aware of English legal requirements, and -so might in ignorance make some unnecessary trouble. - -He answered me, "I know, I know. You forget that I am a lawyer as -well as a doctor. But this is not altogether for the law. You knew -that, when you avoided the coroner. I have more than him to avoid. -There may be papers more, such as this." - -As he spoke he took from his pocket book the memorandum which had been -in Lucy's breast, and which she had torn in her sleep. - -"When you find anything of the solicitor who is for the late Mrs. -Westenra, seal all her papers, and write him tonight. For me, I watch -here in the room and in Miss Lucy's old room all night, and I myself -search for what may be. It is not well that her very thoughts go into -the hands of strangers." - -I went on with my part of the work, and in another half hour had found -the name and address of Mrs. Westenra's solicitor and had written to -him. All the poor lady's papers were in order. Explicit directions -regarding the place of burial were given. I had hardly sealed the -letter, when, to my surprise, Van Helsing walked into the room, -saying, - -"Can I help you friend John? I am free, and if I may, my service is -to you." - -"Have you got what you looked for?" I asked. - -To which he replied, "I did not look for any specific thing. I only -hoped to find, and find I have, all that there was, only some letters -and a few memoranda, and a diary new begun. But I have them here, and -we shall for the present say nothing of them. I shall see that poor -lad tomorrow evening, and, with his sanction, I shall use some." - -When we had finished the work in hand, he said to me, "And now, friend -John, I think we may to bed. We want sleep, both you and I, and rest -to recuperate. Tomorrow we shall have much to do, but for the tonight -there is no need of us. Alas!" - -Before turning in we went to look at poor Lucy. The undertaker had -certainly done his work well, for the room was turned into a small -chapelle ardente. There was a wilderness of beautiful white flowers, -and death was made as little repulsive as might be. The end of the -winding sheet was laid over the face. When the Professor bent over -and turned it gently back, we both started at the beauty before us. -The tall wax candles showing a sufficient light to note it well. All -Lucy's loveliness had come back to her in death, and the hours that -had passed, instead of leaving traces of 'decay's effacing fingers', -had but restored the beauty of life, till positively I could not -believe my eyes that I was looking at a corpse. - -The Professor looked sternly grave. He had not loved her as I had, -and there was no need for tears in his eyes. He said to me, "Remain -till I return," and left the room. He came back with a handful of -wild garlic from the box waiting in the hall, but which had not been -opened, and placed the flowers amongst the others on and around the -bed. Then he took from his neck, inside his collar, a little gold -crucifix, and placed it over the mouth. He restored the sheet to its -place, and we came away. - -I was undressing in my own room, when, with a premonitory tap at the -door, he entered, and at once began to speak. - -"Tomorrow I want you to bring me, before night, a set of post-mortem -knives." - -"Must we make an autopsy?" I asked. - -"Yes and no. I want to operate, but not what you think. Let me tell -you now, but not a word to another. I want to cut off her head and -take out her heart. Ah! You a surgeon, and so shocked! You, whom I -have seen with no tremble of hand or heart, do operations of life and -death that make the rest shudder. Oh, but I must not forget, my dear -friend John, that you loved her, and I have not forgotten it for is I -that shall operate, and you must not help. I would like to do it -tonight, but for Arthur I must not. He will be free after his -father's funeral tomorrow, and he will want to see her, to see it. -Then, when she is coffined ready for the next day, you and I shall -come when all sleep. We shall unscrew the coffin lid, and shall do -our operation, and then replace all, so that none know, save we -alone." - -"But why do it at all? The girl is dead. Why mutilate her poor body -without need? And if there is no necessity for a post-mortem and -nothing to gain by it, no good to her, to us, to science, to human -knowledge, why do it? Without such it is monstrous." - -For answer he put his hand on my shoulder, and said, with infinite -tenderness, "Friend John, I pity your poor bleeding heart, and I love -you the more because it does so bleed. If I could, I would take on -myself the burden that you do bear. But there are things that you -know not, but that you shall know, and bless me for knowing, though -they are not pleasant things. John, my child, you have been my friend -now many years, and yet did you ever know me to do any without good -cause? I may err, I am but man, but I believe in all I do. Was it -not for these causes that you send for me when the great trouble -came? Yes! Were you not amazed, nay horrified, when I would not let -Arthur kiss his love, though she was dying, and snatched him away by -all my strength? Yes! And yet you saw how she thanked me, with her -so beautiful dying eyes, her voice, too, so weak, and she kiss my -rough old hand and bless me? Yes! And did you not hear me swear -promise to her, that so she closed her eyes grateful? Yes! - -"Well, I have good reason now for all I want to do. You have for many -years trust me. You have believe me weeks past, when there be things -so strange that you might have well doubt. Believe me yet a little, -friend John. If you trust me not, then I must tell what I think, and -that is not perhaps well. And if I work, as work I shall, no matter -trust or no trust, without my friend trust in me, I work with heavy -heart and feel oh so lonely when I want all help and courage that may -be!" He paused a moment and went on solemnly, "Friend John, there are -strange and terrible days before us. Let us not be two, but one, that -so we work to a good end. Will you not have faith in me?" - -I took his hand, and promised him. I held my door open as he went -away, and watched him go to his room and close the door. As I stood -without moving, I saw one of the maids pass silently along the -passage, she had her back to me, so did not see me, and go into the -room where Lucy lay. The sight touched me. Devotion is so rare, and -we are so grateful to those who show it unasked to those we love. Here -was a poor girl putting aside the terrors which she naturally had of -death to go watch alone by the bier of the mistress whom she loved, so -that the poor clay might not be lonely till laid to eternal rest. - -I must have slept long and soundly, for it was broad daylight when Van -Helsing waked me by coming into my room. He came over to my bedside -and said, "You need not trouble about the knives. We shall not do -it." - -"Why not?" I asked. For his solemnity of the night before had -greatly impressed me. - -"Because," he said sternly, "it is too late, or too early. See!" -Here he held up the little golden crucifix. - -"This was stolen in the night." - -"How stolen," I asked in wonder, "since you have it now?" - -"Because I get it back from the worthless wretch who stole it, from -the woman who robbed the dead and the living. Her punishment will -surely come, but not through me. She knew not altogether what she -did, and thus unknowing, she only stole. Now we must wait." He went -away on the word, leaving me with a new mystery to think of, a new -puzzle to grapple with. - -The forenoon was a dreary time, but at noon the solicitor came, Mr. -Marquand, of Wholeman, Sons, Marquand & Lidderdale. He was very -genial and very appreciative of what we had done, and took off our -hands all cares as to details. During lunch he told us that Mrs. -Westenra had for some time expected sudden death from her heart, and -had put her affairs in absolute order. He informed us that, with the -exception of a certain entailed property of Lucy's father which now, -in default of direct issue, went back to a distant branch of the -family, the whole estate, real and personal, was left absolutely to -Arthur Holmwood. When he had told us so much he went on, - -"Frankly we did our best to prevent such a testamentary disposition, -and pointed out certain contingencies that might leave her daughter -either penniless or not so free as she should be to act regarding a -matrimonial alliance. Indeed, we pressed the matter so far that we -almost came into collision, for she asked us if we were or were not -prepared to carry out her wishes. Of course, we had then no -alternative but to accept. We were right in principle, and -ninety-nine times out of a hundred we should have proved, by the logic -of events, the accuracy of our judgment. - -"Frankly, however, I must admit that in this case any other form of -disposition would have rendered impossible the carrying out of her -wishes. For by her predeceasing her daughter the latter would have -come into possession of the property, and, even had she only survived -her mother by five minutes, her property would, in case there were no -will, and a will was a practical impossibility in such a case, have -been treated at her decease as under intestacy. In which case Lord -Godalming, though so dear a friend, would have had no claim in the -world. And the inheritors, being remote, would not be likely to -abandon their just rights, for sentimental reasons regarding an entire -stranger. I assure you, my dear sirs, I am rejoiced at the result, -perfectly rejoiced." - -He was a good fellow, but his rejoicing at the one little part, in -which he was officially interested, of so great a tragedy, was an -object-lesson in the limitations of sympathetic understanding. - -He did not remain long, but said he would look in later in the day and -see Lord Godalming. His coming, however, had been a certain comfort -to us, since it assured us that we should not have to dread hostile -criticism as to any of our acts. Arthur was expected at five o'clock, -so a little before that time we visited the death chamber. It was so -in very truth, for now both mother and daughter lay in it. The -undertaker, true to his craft, had made the best display he could of -his goods, and there was a mortuary air about the place that lowered -our spirits at once. - -Van Helsing ordered the former arrangement to be adhered to, -explaining that, as Lord Godalming was coming very soon, it would be -less harrowing to his feelings to see all that was left of his fiancee -quite alone. - -The undertaker seemed shocked at his own stupidity and exerted himself -to restore things to the condition in which we left them the night -before, so that when Arthur came such shocks to his feelings as we -could avoid were saved. - -Poor fellow! He looked desperately sad and broken. Even his stalwart -manhood seemed to have shrunk somewhat under the strain of his -much-tried emotions. He had, I knew, been very genuinely and -devotedly attached to his father, and to lose him, and at such a time, -was a bitter blow to him. With me he was warm as ever, and to Van -Helsing he was sweetly courteous. But I could not help seeing that -there was some constraint with him. The professor noticed it too, and -motioned me to bring him upstairs. I did so, and left him at the door -of the room, as I felt he would like to be quite alone with her, but -he took my arm and led me in, saying huskily, - -"You loved her too, old fellow. She told me all about it, and there -was no friend had a closer place in her heart than you. I don't know -how to thank you for all you have done for her. I can't think -yet . . ." - -Here he suddenly broke down, and threw his arms round my shoulders and -laid his head on my breast, crying, "Oh, Jack! Jack! What shall I -do? The whole of life seems gone from me all at once, and there is -nothing in the wide world for me to live for." - -I comforted him as well as I could. In such cases men do not need -much expression. A grip of the hand, the tightening of an arm over -the shoulder, a sob in unison, are expressions of sympathy dear to a -man's heart. I stood still and silent till his sobs died away, and -then I said softly to him, "Come and look at her." - -Together we moved over to the bed, and I lifted the lawn from her -face. God! How beautiful she was. Every hour seemed to be enhancing -her loveliness. It frightened and amazed me somewhat. And as for -Arthur, he fell to trembling, and finally was shaken with doubt as -with an ague. At last, after a long pause, he said to me in a faint -whisper, "Jack, is she really dead?" - -I assured him sadly that it was so, and went on to suggest, for I felt -that such a horrible doubt should not have life for a moment longer -than I could help, that it often happened that after death faces -become softened and even resolved into their youthful beauty, that -this was especially so when death had been preceded by any acute or -prolonged suffering. I seemed to quite do away with any doubt, and -after kneeling beside the couch for a while and looking at her -lovingly and long, he turned aside. I told him that that must be -goodbye, as the coffin had to be prepared, so he went back and took -her dead hand in his and kissed it, and bent over and kissed her -forehead. He came away, fondly looking back over his shoulder at her -as he came. - -I left him in the drawing room, and told Van Helsing that he had said -goodbye, so the latter went to the kitchen to tell the undertaker's -men to proceed with the preparations and to screw up the coffin. When -he came out of the room again I told him of Arthur's question, and he -replied, "I am not surprised. Just now I doubted for a moment -myself!" - -We all dined together, and I could see that poor Art was trying to -make the best of things. Van Helsing had been silent all dinner time, -but when we had lit our cigars he said, "Lord . . ." but Arthur -interrupted him. - -"No, no, not that, for God's sake! Not yet at any rate. Forgive me, -sir. I did not mean to speak offensively. It is only because my loss -is so recent." - -The Professor answered very sweetly, "I only used that name because I -was in doubt. I must not call you 'Mr.' and I have grown to love you, -yes, my dear boy, to love you, as Arthur." - -Arthur held out his hand, and took the old man's warmly. "Call me -what you will," he said. "I hope I may always have the title of a -friend. And let me say that I am at a loss for words to thank you for -your goodness to my poor dear." He paused a moment, and went on, "I -know that she understood your goodness even better than I do. And if -I was rude or in any way wanting at that time you acted so, you -remember"--the Professor nodded--"you must forgive me." - -He answered with a grave kindness, "I know it was hard for you to -quite trust me then, for to trust such violence needs to understand, -and I take it that you do not, that you cannot, trust me now, for you -do not yet understand. And there may be more times when I shall want -you to trust when you cannot, and may not, and must not yet -understand. But the time will come when your trust shall be whole and -complete in me, and when you shall understand as though the sunlight -himself shone through. Then you shall bless me from first to last for -your own sake, and for the sake of others, and for her dear sake to -whom I swore to protect." - -"And indeed, indeed, sir," said Arthur warmly. "I shall in all ways -trust you. I know and believe you have a very noble heart, and you -are Jack's friend, and you were hers. You shall do what you like." - -The Professor cleared his throat a couple of times, as though about to -speak, and finally said, "May I ask you something now?" - -"Certainly." - -"You know that Mrs. Westenra left you all her property?" - -"No, poor dear. I never thought of it." - -"And as it is all yours, you have a right to deal with it as you will. -I want you to give me permission to read all Miss Lucy's papers and -letters. Believe me, it is no idle curiosity. I have a motive of -which, be sure, she would have approved. I have them all here. I -took them before we knew that all was yours, so that no strange hand -might touch them, no strange eye look through words into her soul. I -shall keep them, if I may. Even you may not see them yet, but I shall -keep them safe. No word shall be lost, and in the good time I shall -give them back to you. It is a hard thing that I ask, but you will do -it, will you not, for Lucy's sake?" - -Arthur spoke out heartily, like his old self, "Dr. Van Helsing, you -may do what you will. I feel that in saying this I am doing what my -dear one would have approved. I shall not trouble you with questions -till the time comes." - -The old Professor stood up as he said solemnly, "And you are right. -There will be pain for us all, but it will not be all pain, nor will -this pain be the last. We and you too, you most of all, dear boy, -will have to pass through the bitter water before we reach the sweet. -But we must be brave of heart and unselfish, and do our duty, and all -will be well!" - -I slept on a sofa in Arthur's room that night. Van Helsing did not go -to bed at all. He went to and fro, as if patroling the house, and was -never out of sight of the room where Lucy lay in her coffin, strewn -with the wild garlic flowers, which sent through the odour of lily and -rose, a heavy, overpowering smell into the night. - - - - -MINA HARKER'S JOURNAL - -22 September.--In the train to Exeter. Jonathan sleeping. It seems -only yesterday that the last entry was made, and yet how much between -then, in Whitby and all the world before me, Jonathan away and no news -of him, and now, married to Jonathan, Jonathan a solicitor, a partner, -rich, master of his business, Mr. Hawkins dead and buried, and -Jonathan with another attack that may harm him. Some day he may ask -me about it. Down it all goes. I am rusty in my shorthand, see what -unexpected prosperity does for us, so it may be as well to freshen it -up again with an exercise anyhow. - -The service was very simple and very solemn. There were only -ourselves and the servants there, one or two old friends of his from -Exeter, his London agent, and a gentleman representing Sir John -Paxton, the President of the Incorporated Law Society. Jonathan and I -stood hand in hand, and we felt that our best and dearest friend was -gone from us. - -We came back to town quietly, taking a bus to Hyde Park Corner. -Jonathan thought it would interest me to go into the Row for a while, -so we sat down. But there were very few people there, and it was -sad-looking and desolate to see so many empty chairs. It made us -think of the empty chair at home. So we got up and walked down -Piccadilly. Jonathan was holding me by the arm, the way he used to in -the old days before I went to school. I felt it very improper, for -you can't go on for some years teaching etiquette and decorum to other -girls without the pedantry of it biting into yourself a bit. But it -was Jonathan, and he was my husband, and we didn't know anybody who -saw us, and we didn't care if they did, so on we walked. I was -looking at a very beautiful girl, in a big cart-wheel hat, sitting in -a victoria outside Guiliano's, when I felt Jonathan clutch my arm so -tight that he hurt me, and he said under his breath, "My God!" - -I am always anxious about Jonathan, for I fear that some nervous fit -may upset him again. So I turned to him quickly, and asked him what -it was that disturbed him. - -He was very pale, and his eyes seemed bulging out as, half in terror -and half in amazement, he gazed at a tall, thin man, with a beaky nose -and black moustache and pointed beard, who was also observing the -pretty girl. He was looking at her so hard that he did not see either -of us, and so I had a good view of him. His face was not a good -face. It was hard, and cruel, and sensual, and big white teeth, that -looked all the whiter because his lips were so red, were pointed like -an animal's. Jonathan kept staring at him, till I was afraid he would -notice. I feared he might take it ill, he looked so fierce and nasty. -I asked Jonathan why he was disturbed, and he answered, evidently -thinking that I knew as much about it as he did, "Do you see who it -is?" - -"No, dear," I said. "I don't know him, who is it?" His answer seemed -to shock and thrill me, for it was said as if he did not know that it -was me, Mina, to whom he was speaking. "It is the man himself!" - -The poor dear was evidently terrified at something, very greatly -terrified. I do believe that if he had not had me to lean on and to -support him he would have sunk down. He kept staring. A man came out -of the shop with a small parcel, and gave it to the lady, who then -drove off. The dark man kept his eyes fixed on her, and when the -carriage moved up Piccadilly he followed in the same direction, and -hailed a hansom. Jonathan kept looking after him, and said, as if to -himself, - -"I believe it is the Count, but he has grown young. My God, if this -be so! Oh, my God! My God! If only I knew! If only I knew!" He was -distressing himself so much that I feared to keep his mind on the -subject by asking him any questions, so I remained silent. I drew -away quietly, and he, holding my arm, came easily. We walked a little -further, and then went in and sat for a while in the Green Park. It -was a hot day for autumn, and there was a comfortable seat in a shady -place. After a few minutes' staring at nothing, Jonathan's eyes -closed, and he went quickly into a sleep, with his head on my -shoulder. I thought it was the best thing for him, so did not disturb -him. In about twenty minutes he woke up, and said to me quite -cheerfully, - -"Why, Mina, have I been asleep! Oh, do forgive me for being so rude. -Come, and we'll have a cup of tea somewhere." - -He had evidently forgotten all about the dark stranger, as in his -illness he had forgotten all that this episode had reminded him of. I -don't like this lapsing into forgetfulness. It may make or continue -some injury to the brain. I must not ask him, for fear I shall do -more harm than good, but I must somehow learn the facts of his journey -abroad. The time is come, I fear, when I must open the parcel, and -know what is written. Oh, Jonathan, you will, I know, forgive me if I -do wrong, but it is for your own dear sake. - - -Later.--A sad homecoming in every way, the house empty of the dear -soul who was so good to us. Jonathan still pale and dizzy under a -slight relapse of his malady, and now a telegram from Van Helsing, -whoever he may be. "You will be grieved to hear that Mrs. Westenra -died five days ago, and that Lucy died the day before yesterday. They -were both buried today." - -Oh, what a wealth of sorrow in a few words! Poor Mrs. Westenra! Poor -Lucy! Gone, gone, never to return to us! And poor, poor Arthur, to -have lost such a sweetness out of his life! God help us all to bear -our troubles. - - - -DR. SEWARD'S DIARY-CONT. - -22 September.--It is all over. Arthur has gone back to Ring, and has -taken Quincey Morris with him. What a fine fellow is Quincey! I -believe in my heart of hearts that he suffered as much about Lucy's -death as any of us, but he bore himself through it like a moral -Viking. If America can go on breeding men like that, she will be a -power in the world indeed. Van Helsing is lying down, having a rest -preparatory to his journey. He goes to Amsterdam tonight, but says he -returns tomorrow night, that he only wants to make some arrangements -which can only be made personally. He is to stop with me then, if he -can. He says he has work to do in London which may take him some -time. Poor old fellow! I fear that the strain of the past week has -broken down even his iron strength. All the time of the burial he -was, I could see, putting some terrible restraint on himself. When it -was all over, we were standing beside Arthur, who, poor fellow, was -speaking of his part in the operation where his blood had been -transfused to his Lucy's veins. I could see Van Helsing's face grow -white and purple by turns. Arthur was saying that he felt since then -as if they two had been really married, and that she was his wife in -the sight of God. None of us said a word of the other operations, and -none of us ever shall. Arthur and Quincey went away together to the -station, and Van Helsing and I came on here. The moment we were alone -in the carriage he gave way to a regular fit of hysterics. He has -denied to me since that it was hysterics, and insisted that it was -only his sense of humor asserting itself under very terrible -conditions. He laughed till he cried, and I had to draw down the -blinds lest any one should see us and misjudge. And then he cried, -till he laughed again, and laughed and cried together, just as a woman -does. I tried to be stern with him, as one is to a woman under the -circumstances, but it had no effect. Men and women are so different -in manifestations of nervous strength or weakness! Then when his face -grew grave and stern again I asked him why his mirth, and why at such -a time. His reply was in a way characteristic of him, for it was -logical and forceful and mysterious. He said, - -"Ah, you don't comprehend, friend John. Do not think that I am not -sad, though I laugh. See, I have cried even when the laugh did choke -me. But no more think that I am all sorry when I cry, for the laugh -he come just the same. Keep it always with you that laughter who -knock at your door and say, 'May I come in?' is not true laughter. -No! He is a king, and he come when and how he like. He ask no -person, he choose no time of suitability. He say, 'I am here.' -Behold, in example I grieve my heart out for that so sweet young -girl. I give my blood for her, though I am old and worn. I give my -time, my skill, my sleep. I let my other sufferers want that she may -have all. And yet I can laugh at her very grave, laugh when the clay -from the spade of the sexton drop upon her coffin and say 'Thud, -thud!' to my heart, till it send back the blood from my cheek. My -heart bleed for that poor boy, that dear boy, so of the age of mine -own boy had I been so blessed that he live, and with his hair and eyes -the same. - -"There, you know now why I love him so. And yet when he say things -that touch my husband-heart to the quick, and make my father-heart -yearn to him as to no other man, not even you, friend John, for we are -more level in experiences than father and son, yet even at such a -moment King Laugh he come to me and shout and bellow in my ear, 'Here I -am! Here I am!' till the blood come dance back and bring some of the -sunshine that he carry with him to my cheek. Oh, friend John, it is a -strange world, a sad world, a world full of miseries, and woes, and -troubles. And yet when King Laugh come, he make them all dance to the -tune he play. Bleeding hearts, and dry bones of the churchyard, and -tears that burn as they fall, all dance together to the music that he -make with that smileless mouth of him. And believe me, friend John, -that he is good to come, and kind. Ah, we men and women are like -ropes drawn tight with strain that pull us different ways. Then tears -come, and like the rain on the ropes, they brace us up, until perhaps -the strain become too great, and we break. But King Laugh he come -like the sunshine, and he ease off the strain again, and we bear to go -on with our labor, what it may be." - -I did not like to wound him by pretending not to see his idea, but as -I did not yet understand the cause of his laughter, I asked him. As -he answered me his face grew stern, and he said in quite a different -tone, - -"Oh, it was the grim irony of it all, this so lovely lady garlanded -with flowers, that looked so fair as life, till one by one we wondered -if she were truly dead, she laid in that so fine marble house in that -lonely churchyard, where rest so many of her kin, laid there with the -mother who loved her, and whom she loved, and that sacred bell going -'Toll! Toll! Toll!' so sad and slow, and those holy men, with the -white garments of the angel, pretending to read books, and yet all the -time their eyes never on the page, and all of us with the bowed head. -And all for what? She is dead, so! Is it not?" - -"Well, for the life of me, Professor," I said, "I can't see anything -to laugh at in all that. Why, your expression makes it a harder -puzzle than before. But even if the burial service was comic, what -about poor Art and his trouble? Why his heart was simply breaking." - -"Just so. Said he not that the transfusion of his blood to her veins -had made her truly his bride?" - -"Yes, and it was a sweet and comforting idea for him." - -"Quite so. But there was a difficulty, friend John. If so that, then -what about the others? Ho, ho! Then this so sweet maid is a -polyandrist, and me, with my poor wife dead to me, but alive by -Church's law, though no wits, all gone, even I, who am faithful -husband to this now-no-wife, am bigamist." - -"I don't see where the joke comes in there either!" I said, and I did -not feel particularly pleased with him for saying such things. He -laid his hand on my arm, and said, - -"Friend John, forgive me if I pain. I showed not my feeling to others -when it would wound, but only to you, my old friend, whom I can trust. -If you could have looked into my heart then when I want to laugh, if -you could have done so when the laugh arrived, if you could do so now, -when King Laugh have pack up his crown, and all that is to him, for he -go far, far away from me, and for a long, long time, maybe you would -perhaps pity me the most of all." - -I was touched by the tenderness of his tone, and asked why. - -"Because I know!" - -And now we are all scattered, and for many a long day loneliness will -sit over our roofs with brooding wings. Lucy lies in the tomb of her -kin, a lordly death house in a lonely churchyard, away from teeming -London, where the air is fresh, and the sun rises over Hampstead Hill, -and where wild flowers grow of their own accord. - -So I can finish this diary, and God only knows if I shall ever begin -another. If I do, or if I even open this again, it will be to deal -with different people and different themes, for here at the end, where -the romance of my life is told, ere I go back to take up the thread of -my life-work, I say sadly and without hope, "FINIS". - - - - -THE WESTMINSTER GAZETTE, 25 SEPTEMBER A HAMPSTEAD MYSTERY - -The neighborhood of Hampstead is just at present exercised -with a series of events which seem to run on lines parallel -to those of what was known to the writers of headlines as -"The Kensington Horror," or "The Stabbing Woman," or "The -Woman in Black." During the past two or three days several -cases have occurred of young children straying from home or -neglecting to return from their playing on the Heath. In -all these cases the children were too young to give any -properly intelligible account of themselves, but the -consensus of their excuses is that they had been with a -"bloofer lady." It has always been late in the evening when -they have been missed, and on two occasions the children -have not been found until early in the following morning. -It is generally supposed in the neighborhood that, as the -first child missed gave as his reason for being away that a -"bloofer lady" had asked him to come for a walk, the others -had picked up the phrase and used it as occasion served. This -is the more natural as the favourite game of the little ones -at present is luring each other away by wiles. A correspondent -writes us that to see some of the tiny tots pretending to be the -"bloofer lady" is supremely funny. Some of our caricaturists -might, he says, take a lesson in the irony of grotesque by -comparing the reality and the picture. It is only in accordance -with general principles of human nature that the "bloofer lady" -should be the popular role at these al fresco performances. Our -correspondent naively says that even Ellen Terry could not be so -winningly attractive as some of these grubby-faced little -children pretend, and even imagine themselves, to be. - -There is, however, possibly a serious side to the question, -for some of the children, indeed all who have been missed -at night, have been slightly torn or wounded in the throat. -The wounds seem such as might be made by a rat or a small -dog, and although of not much importance individually, would tend -to show that whatever animal inflicts them has a system or method -of its own. The police of the division have been instructed to -keep a sharp lookout for straying children, especially when very -young, in and around Hampstead Heath, and for any stray dog which -may be about. - - - - -THE WESTMINSTER GAZETTE, 25 SEPTEMBER EXTRA SPECIAL - -THE HAMPSTEAD HORROR - - -ANOTHER CHILD INJURED - -THE "BLOOFER LADY" - -We have just received intelligence that another child, -missed last night, was only discovered late in the morning -under a furze bush at the Shooter's Hill side of Hampstead -Heath, which is perhaps, less frequented than the other -parts. It has the same tiny wound in the throat as has -been noticed in other cases. It was terribly weak, and -looked quite emaciated. It too, when partially restored, -had the common story to tell of being lured away by the -"bloofer lady". - - - - -CHAPTER 14 - - -MINA HARKER'S JOURNAL - -23 September.--Jonathan is better after a bad night. I am so glad -that he has plenty of work to do, for that keeps his mind off the -terrible things, and oh, I am rejoiced that he is not now weighed down -with the responsibility of his new position. I knew he would be true -to himself, and now how proud I am to see my Jonathan rising to the -height of his advancement and keeping pace in all ways with the duties -that come upon him. He will be away all day till late, for he said he -could not lunch at home. My household work is done, so I shall take -his foreign journal, and lock myself up in my room and read it. - - -24 September.--I hadn't the heart to write last night, that terrible -record of Jonathan's upset me so. Poor dear! How he must have -suffered, whether it be true or only imagination. I wonder if there -is any truth in it at all. Did he get his brain fever, and then write -all those terrible things, or had he some cause for it all? I suppose -I shall never know, for I dare not open the subject to him. And yet -that man we saw yesterday! He seemed quite certain of him, poor -fellow! I suppose it was the funeral upset him and sent his mind back -on some train of thought. - -He believes it all himself. I remember how on our wedding day he said -"Unless some solemn duty come upon me to go back to the bitter hours, -asleep or awake, mad or sane . . ." There seems to be through it all -some thread of continuity. That fearful Count was coming to London. -If it should be, and he came to London, with its teeming millions . . . -There may be a solemn duty, and if it come we must not shrink from -it. I shall be prepared. I shall get my typewriter this very hour -and begin transcribing. Then we shall be ready for other eyes if -required. And if it be wanted, then, perhaps, if I am ready, poor -Jonathan may not be upset, for I can speak for him and never let him -be troubled or worried with it at all. If ever Jonathan quite gets -over the nervousness he may want to tell me of it all, and I can ask -him questions and find out things, and see how I may comfort him. - - - - -LETTER, VAN HELSING TO MRS. HARKER - -24 September - -(Confidence) - -"Dear Madam, - -"I pray you to pardon my writing, in that I am so far -friend as that I sent to you sad news of Miss Lucy -Westenra's death. By the kindness of Lord Godalming, I am -empowered to read her letters and papers, for I am deeply -concerned about certain matters vitally important. In them -I find some letters from you, which show how great friends -you were and how you love her. Oh, Madam Mina, by that -love, I implore you, help me. It is for others' good that -I ask, to redress great wrong, and to lift much and terrible -troubles, that may be more great than you can know. May it be -that I see you? You can trust me. I am friend of Dr. John -Seward and of Lord Godalming (that was Arthur of Miss Lucy). I -must keep it private for the present from all. I should come to -Exeter to see you at once if you tell me I am privilege to come, -and where and when. I implore your pardon, Madam. I have read -your letters to poor Lucy, and know how good you are and how your -husband suffer. So I pray you, if it may be, enlighten him not, -least it may harm. Again your pardon, and forgive me. - -"VAN HELSING" - - - - -TELEGRAM, MRS. HARKER TO VAN HELSING - -25 September.--Come today by quarter past ten train if you -can catch it. Can see you any time you call. - -"WILHELMINA HARKER" - - - - -MINA HARKER'S JOURNAL - -25 September.--I cannot help feeling terribly excited as the time -draws near for the visit of Dr. Van Helsing, for somehow I expect that -it will throw some light upon Jonathan's sad experience, and as he -attended poor dear Lucy in her last illness, he can tell me all about -her. That is the reason of his coming. It is concerning Lucy and her -sleep-walking, and not about Jonathan. Then I shall never know the -real truth now! How silly I am. That awful journal gets hold of my -imagination and tinges everything with something of its own colour. Of -course it is about Lucy. That habit came back to the poor dear, and -that awful night on the cliff must have made her ill. I had almost -forgotten in my own affairs how ill she was afterwards. She must have -told him of her sleep-walking adventure on the cliff, and that I knew -all about it, and now he wants me to tell him what I know, so that he -may understand. I hope I did right in not saying anything of it to -Mrs. Westenra. I should never forgive myself if any act of mine, were -it even a negative one, brought harm on poor dear Lucy. I hope too, -Dr. Van Helsing will not blame me. I have had so much trouble and -anxiety of late that I feel I cannot bear more just at present. - -I suppose a cry does us all good at times, clears the air as other -rain does. Perhaps it was reading the journal yesterday that upset -me, and then Jonathan went away this morning to stay away from me a -whole day and night, the first time we have been parted since our -marriage. I do hope the dear fellow will take care of himself, and -that nothing will occur to upset him. It is two o'clock, and the -doctor will be here soon now. I shall say nothing of Jonathan's -journal unless he asks me. I am so glad I have typewritten out my own -journal, so that, in case he asks about Lucy, I can hand it to him. -It will save much questioning. - -Later.--He has come and gone. Oh, what a strange meeting, and how it -all makes my head whirl round. I feel like one in a dream. Can it be -all possible, or even a part of it? If I had not read Jonathan's -journal first, I should never have accepted even a possibility. Poor, -poor, dear Jonathan! How he must have suffered. Please the good God, -all this may not upset him again. I shall try to save him from it. -But it may be even a consolation and a help to him, terrible though it -be and awful in its consequences, to know for certain that his eyes -and ears and brain did not deceive him, and that it is all true. It -may be that it is the doubt which haunts him, that when the doubt is -removed, no matter which, waking or dreaming, may prove the truth, he -will be more satisfied and better able to bear the shock. Dr. Van -Helsing must be a good man as well as a clever one if he is Arthur's -friend and Dr. Seward's, and if they brought him all the way from -Holland to look after Lucy. I feel from having seen him that he is -good and kind and of a noble nature. When he comes tomorrow I shall -ask him about Jonathan. And then, please God, all this sorrow and -anxiety may lead to a good end. I used to think I would like to -practice interviewing. Jonathan's friend on "The Exeter News" told -him that memory is everything in such work, that you must be able to -put down exactly almost every word spoken, even if you had to refine -some of it afterwards. Here was a rare interview. I shall try to -record it verbatim. - -It was half-past two o'clock when the knock came. I took my courage a -deux mains and waited. In a few minutes Mary opened the door, and -announced "Dr. Van Helsing". - -I rose and bowed, and he came towards me, a man of medium weight, -strongly built, with his shoulders set back over a broad, deep chest -and a neck well balanced on the trunk as the head is on the neck. The -poise of the head strikes me at once as indicative of thought and -power. The head is noble, well-sized, broad, and large behind the -ears. The face, clean-shaven, shows a hard, square chin, a large -resolute, mobile mouth, a good-sized nose, rather straight, but with -quick, sensitive nostrils, that seem to broaden as the big bushy brows -come down and the mouth tightens. The forehead is broad and fine, -rising at first almost straight and then sloping back above two bumps -or ridges wide apart, such a forehead that the reddish hair cannot -possibly tumble over it, but falls naturally back and to the sides. -Big, dark blue eyes are set widely apart, and are quick and tender or -stern with the man's moods. He said to me, - -"Mrs. Harker, is it not?" I bowed assent. - -"That was Miss Mina Murray?" Again I assented. - -"It is Mina Murray that I came to see that was friend of that poor dear -child Lucy Westenra. Madam Mina, it is on account of the dead that I -come." - -"Sir," I said, "you could have no better claim on me than that you -were a friend and helper of Lucy Westenra." And I held out my hand. -He took it and said tenderly, - -"Oh, Madam Mina, I know that the friend of that poor little girl must -be good, but I had yet to learn . . ." He finished his speech with a -courtly bow. I asked him what it was that he wanted to see me about, -so he at once began. - -"I have read your letters to Miss Lucy. Forgive me, but I had to -begin to inquire somewhere, and there was none to ask. I know that -you were with her at Whitby. She sometimes kept a diary, you need not -look surprised, Madam Mina. It was begun after you had left, and was -an imitation of you, and in that diary she traces by inference certain -things to a sleep-walking in which she puts down that you saved her. -In great perplexity then I come to you, and ask you out of your so -much kindness to tell me all of it that you can remember." - -"I can tell you, I think, Dr. Van Helsing, all about it." - -"Ah, then you have good memory for facts, for details? It is not -always so with young ladies." - -"No, doctor, but I wrote it all down at the time. I can show it to -you if you like." - -"Oh, Madam Mina, I well be grateful. You will do me much favour." - -I could not resist the temptation of mystifying him a bit, I suppose -it is some taste of the original apple that remains still in our -mouths, so I handed him the shorthand diary. He took it with a -grateful bow, and said, "May I read it?" - -"If you wish," I answered as demurely as I could. He opened it, and -for an instant his face fell. Then he stood up and bowed. - -"Oh, you so clever woman!" he said. "I knew long that Mr. Jonathan -was a man of much thankfulness, but see, his wife have all the good -things. And will you not so much honour me and so help me as to read -it for me? Alas! I know not the shorthand." - -By this time my little joke was over, and I was almost ashamed. So I -took the typewritten copy from my work basket and handed it to him. - -"Forgive me," I said. "I could not help it, but I had been thinking -that it was of dear Lucy that you wished to ask, and so that you might -not have time to wait, not on my account, but because I know your time -must be precious, I have written it out on the typewriter for you." - -He took it and his eyes glistened. "You are so good," he said. "And -may I read it now? I may want to ask you some things when I have -read." - -"By all means," I said, "read it over whilst I order lunch, and then -you can ask me questions whilst we eat." - -He bowed and settled himself in a chair with his back to the light, -and became so absorbed in the papers, whilst I went to see after lunch -chiefly in order that he might not be disturbed. When I came back, I -found him walking hurriedly up and down the room, his face all ablaze -with excitement. He rushed up to me and took me by both hands. - -"Oh, Madam Mina," he said, "how can I say what I owe to you? This -paper is as sunshine. It opens the gate to me. I am dazed, I am -dazzled, with so much light, and yet clouds roll in behind the light -every time. But that you do not, cannot comprehend. Oh, but I am -grateful to you, you so clever woman. Madame," he said this very -solemnly, "if ever Abraham Van Helsing can do anything for you or -yours, I trust you will let me know. It will be pleasure and delight -if I may serve you as a friend, as a friend, but all I have ever -learned, all I can ever do, shall be for you and those you love. There -are darknesses in life, and there are lights. You are one of the -lights. You will have a happy life and a good life, and your husband -will be blessed in you." - -"But, doctor, you praise me too much, and you do not know me." - -"Not know you, I, who am old, and who have studied all my life men and -women, I who have made my specialty the brain and all that belongs to -him and all that follow from him! And I have read your diary that you -have so goodly written for me, and which breathes out truth in every -line. I, who have read your so sweet letter to poor Lucy of your -marriage and your trust, not know you! Oh, Madam Mina, good women -tell all their lives, and by day and by hour and by minute, such -things that angels can read. And we men who wish to know have in us -something of angels' eyes. Your husband is noble nature, and you are -noble too, for you trust, and trust cannot be where there is mean -nature. And your husband, tell me of him. Is he quite well? Is all -that fever gone, and is he strong and hearty?" - -I saw here an opening to ask him about Jonathan, so I said, "He was -almost recovered, but he has been greatly upset by Mr. Hawkins death." - -He interrupted, "Oh, yes. I know. I know. I have read your last two -letters." - -I went on, "I suppose this upset him, for when we were in town on -Thursday last he had a sort of shock." - -"A shock, and after brain fever so soon! That is not good. What kind -of shock was it?" - -"He thought he saw some one who recalled something terrible, something -which led to his brain fever." And here the whole thing seemed to -overwhelm me in a rush. The pity for Jonathan, the horror which he -experienced, the whole fearful mystery of his diary, and the fear that -has been brooding over me ever since, all came in a tumult. I suppose -I was hysterical, for I threw myself on my knees and held up my hands -to him, and implored him to make my husband well again. He took my -hands and raised me up, and made me sit on the sofa, and sat by me. He -held my hand in his, and said to me with, oh, such infinite sweetness, - -"My life is a barren and lonely one, and so full of work that I have -not had much time for friendships, but since I have been summoned to -here by my friend John Seward I have known so many good people and -seen such nobility that I feel more than ever, and it has grown with -my advancing years, the loneliness of my life. Believe me, then, that -I come here full of respect for you, and you have given me hope, hope, -not in what I am seeking of, but that there are good women still left -to make life happy, good women, whose lives and whose truths may make -good lesson for the children that are to be. I am glad, glad, that I -may here be of some use to you. For if your husband suffer, he suffer -within the range of my study and experience. I promise you that I -will gladly do all for him that I can, all to make his life strong and -manly, and your life a happy one. Now you must eat. You are -overwrought and perhaps over-anxious. Husband Jonathan would not like -to see you so pale, and what he like not where he love, is not to his -good. Therefore for his sake you must eat and smile. You have told -me about Lucy, and so now we shall not speak of it, lest it distress. -I shall stay in Exeter tonight, for I want to think much over what you -have told me, and when I have thought I will ask you questions, if I -may. And then too, you will tell me of husband Jonathan's trouble so -far as you can, but not yet. You must eat now, afterwards you shall -tell me all." - -After lunch, when we went back to the drawing room, he said to me, -"And now tell me all about him." - -When it came to speaking to this great learned man, I began to fear -that he would think me a weak fool, and Jonathan a madman, that -journal is all so strange, and I hesitated to go on. But he was so -sweet and kind, and he had promised to help, and I trusted him, so I -said, - -"Dr. Van Helsing, what I have to tell you is so queer that you must -not laugh at me or at my husband. I have been since yesterday in a -sort of fever of doubt. You must be kind to me, and not think me -foolish that I have even half believed some very strange things." - -He reassured me by his manner as well as his words when he said, "Oh, -my dear, if you only know how strange is the matter regarding which I -am here, it is you who would laugh. I have learned not to think -little of any one's belief, no matter how strange it may be. I have -tried to keep an open mind, and it is not the ordinary things of life -that could close it, but the strange things, the extraordinary things, -the things that make one doubt if they be mad or sane." - -"Thank you, thank you a thousand times! You have taken a weight off my -mind. If you will let me, I shall give you a paper to read. It is -long, but I have typewritten it out. It will tell you my trouble and -Jonathan's. It is the copy of his journal when abroad, and all that -happened. I dare not say anything of it. You will read for yourself -and judge. And then when I see you, perhaps, you will be very kind -and tell me what you think." - -"I promise," he said as I gave him the papers. "I shall in the -morning, as soon as I can, come to see you and your husband, if I -may." - -"Jonathan will be here at half-past eleven, and you must come to lunch -with us and see him then. You could catch the quick 3:34 train, which -will leave you at Paddington before eight." He was surprised at my -knowledge of the trains offhand, but he does not know that I have made -up all the trains to and from Exeter, so that I may help Jonathan in -case he is in a hurry. - -So he took the papers with him and went away, and I sit here thinking, -thinking I don't know what. - - - - -LETTER (by hand), VAN HELSING TO MRS. HARKER - -25 September, 6 o'clock - -"Dear Madam Mina, - -"I have read your husband's so wonderful diary. You may -sleep without doubt. Strange and terrible as it is, it is -true! I will pledge my life on it. It may be worse for -others, but for him and you there is no dread. He is a -noble fellow, and let me tell you from experience of men, -that one who would do as he did in going down that wall and -to that room, aye, and going a second time, is not one to -be injured in permanence by a shock. His brain and his -heart are all right, this I swear, before I have even seen -him, so be at rest. I shall have much to ask him of other -things. I am blessed that today I come to see you, for I -have learn all at once so much that again I am dazzled, -dazzled more than ever, and I must think. - -"Yours the most faithful, - -"Abraham Van Helsing." - - -LETTER, MRS. HARKER TO VAN HELSING - -25 September, 6:30 P.M. - -"My dear Dr. Van Helsing, - -"A thousand thanks for your kind letter, which has taken a -great weight off my mind. And yet, if it be true, what -terrible things there are in the world, and what an awful -thing if that man, that monster, be really in London! I -fear to think. I have this moment, whilst writing, had a -wire from Jonathan, saying that he leaves by the 6:25 tonight -from Launceston and will be here at 10:18, so that I shall have -no fear tonight. Will you, therefore, instead of lunching with -us, please come to breakfast at eight o'clock, if this be not too -early for you? You can get away, if you are in a hurry, by the -10:30 train, which will bring you to Paddington by 2:35. Do not -answer this, as I shall take it that, if I do not hear, you will -come to breakfast. - -"Believe me, - -"Your faithful and grateful friend, - -"Mina Harker." - - - - - -JONATHAN HARKER'S JOURNAL - -26 September.--I thought never to write in this diary again, but the -time has come. When I got home last night Mina had supper ready, and -when we had supped she told me of Van Helsing's visit, and of her -having given him the two diaries copied out, and of how anxious she -has been about me. She showed me in the doctor's letter that all I -wrote down was true. It seems to have made a new man of me. It was -the doubt as to the reality of the whole thing that knocked me over. -I felt impotent, and in the dark, and distrustful. But, now that I -know, I am not afraid, even of the Count. He has succeeded after all, -then, in his design in getting to London, and it was he I saw. He has -got younger, and how? Van Helsing is the man to unmask him and hunt -him out, if he is anything like what Mina says. We sat late, and -talked it over. Mina is dressing, and I shall call at the hotel in a -few minutes and bring him over. - - -He was, I think, surprised to see me. When I came into the room where -he was, and introduced myself, he took me by the shoulder, and turned -my face round to the light, and said, after a sharp scrutiny, - -"But Madam Mina told me you were ill, that you had had a shock." - -It was so funny to hear my wife called 'Madam Mina' by this kindly, -strong-faced old man. I smiled, and said, "I was ill, I have had a -shock, but you have cured me already." - -"And how?" - -"By your letter to Mina last night. I was in doubt, and then -everything took a hue of unreality, and I did not know what to trust, -even the evidence of my own senses. Not knowing what to trust, I did -not know what to do, and so had only to keep on working in what had -hitherto been the groove of my life. The groove ceased to avail me, -and I mistrusted myself. Doctor, you don't know what it is to doubt -everything, even yourself. No, you don't, you couldn't with eyebrows -like yours." - -He seemed pleased, and laughed as he said, "So! You are a -physiognomist. I learn more here with each hour. I am with so much -pleasure coming to you to breakfast, and, oh, sir, you will pardon -praise from an old man, but you are blessed in your wife." - -I would listen to him go on praising Mina for a day, so I simply -nodded and stood silent. - -"She is one of God's women, fashioned by His own hand to show us men -and other women that there is a heaven where we can enter, and that -its light can be here on earth. So true, so sweet, so noble, so -little an egoist, and that, let me tell you, is much in this age, so -sceptical and selfish. And you, sir . . . I have read all the letters -to poor Miss Lucy, and some of them speak of you, so I know you since -some days from the knowing of others, but I have seen your true self -since last night. You will give me your hand, will you not? And let -us be friends for all our lives." - -We shook hands, and he was so earnest and so kind that it made me -quite choky. - -"And now," he said, "may I ask you for some more help? I have a great -task to do, and at the beginning it is to know. You can help me -here. Can you tell me what went before your going to Transylvania? -Later on I may ask more help, and of a different kind, but at first -this will do." - -"Look here, Sir," I said, "does what you have to do concern the -Count?" - -"It does," he said solemnly. - -"Then I am with you heart and soul. As you go by the 10:30 train, you -will not have time to read them, but I shall get the bundle of papers. -You can take them with you and read them in the train." - -After breakfast I saw him to the station. When we were parting he -said, "Perhaps you will come to town if I send for you, and take Madam -Mina too." - -"We shall both come when you will," I said. - -I had got him the morning papers and the London papers of the previous -night, and while we were talking at the carriage window, waiting for -the train to start, he was turning them over. His eyes suddenly -seemed to catch something in one of them, "The Westminster Gazette", I -knew it by the colour, and he grew quite white. He read something -intently, groaning to himself, "Mein Gott! Mein Gott! So soon! So -soon!" I do not think he remembered me at the moment. Just then the -whistle blew, and the train moved off. This recalled him to himself, -and he leaned out of the window and waved his hand, calling out, "Love -to Madam Mina. I shall write so soon as ever I can." - - - - -DR. SEWARD'S DIARY - -26 September.--Truly there is no such thing as finality. Not a week -since I said "Finis," and yet here I am starting fresh again, or -rather going on with the record. Until this afternoon I had no cause -to think of what is done. Renfield had become, to all intents, as -sane as he ever was. He was already well ahead with his fly business, -and he had just started in the spider line also, so he had not been of -any trouble to me. I had a letter from Arthur, written on Sunday, and -from it I gather that he is bearing up wonderfully well. Quincey -Morris is with him, and that is much of a help, for he himself is a -bubbling well of good spirits. Quincey wrote me a line too, and from -him I hear that Arthur is beginning to recover something of his old -buoyancy, so as to them all my mind is at rest. As for myself, I was -settling down to my work with the enthusiasm which I used to have for -it, so that I might fairly have said that the wound which poor Lucy -left on me was becoming cicatrised. - -Everything is, however, now reopened, and what is to be the end God -only knows. I have an idea that Van Helsing thinks he knows, too, but -he will only let out enough at a time to whet curiosity. He went to -Exeter yesterday, and stayed there all night. Today he came back, and -almost bounded into the room at about half-past five o'clock, and -thrust last night's "Westminster Gazette" into my hand. - -"What do you think of that?" he asked as he stood back and folded his -arms. - -I looked over the paper, for I really did not know what he meant, but -he took it from me and pointed out a paragraph about children being -decoyed away at Hampstead. It did not convey much to me, until I -reached a passage where it described small puncture wounds on their -throats. An idea struck me, and I looked up. - -"Well?" he said. - -"It is like poor Lucy's." - -"And what do you make of it?" - -"Simply that there is some cause in common. Whatever it was that -injured her has injured them." I did not quite understand his answer. - -"That is true indirectly, but not directly." - -"How do you mean, Professor?" I asked. I was a little inclined to -take his seriousness lightly, for, after all, four days of rest and -freedom from burning, harrowing, anxiety does help to restore one's -spirits, but when I saw his face, it sobered me. Never, even in the -midst of our despair about poor Lucy, had he looked more stern. - -"Tell me!" I said. "I can hazard no opinion. I do not know what to -think, and I have no data on which to found a conjecture." - -"Do you mean to tell me, friend John, that you have no suspicion as to -what poor Lucy died of, not after all the hints given, not only by -events, but by me?" - -"Of nervous prostration following a great loss or waste of blood." - -"And how was the blood lost or wasted?" I shook my head. - -He stepped over and sat down beside me, and went on, "You are a clever -man, friend John. You reason well, and your wit is bold, but you are -too prejudiced. You do not let your eyes see nor your ears hear, and -that which is outside your daily life is not of account to you. Do -you not think that there are things which you cannot understand, and -yet which are, that some people see things that others cannot? But -there are things old and new which must not be contemplated by men's -eyes, because they know, or think they know, some things which other -men have told them. Ah, it is the fault of our science that it wants -to explain all, and if it explain not, then it says there is nothing -to explain. But yet we see around us every day the growth of new -beliefs, which think themselves new, and which are yet but the old, -which pretend to be young, like the fine ladies at the opera. I -suppose now you do not believe in corporeal transference. No? Nor in -materialization. No? Nor in astral bodies. No? Nor in the reading -of thought. No? Nor in hypnotism . . ." - -"Yes," I said. "Charcot has proved that pretty well." - -He smiled as he went on, "Then you are satisfied as to it. Yes? And -of course then you understand how it act, and can follow the mind of -the great Charcot, alas that he is no more, into the very soul of the -patient that he influence. No? Then, friend John, am I to take it -that you simply accept fact, and are satisfied to let from premise to -conclusion be a blank? No? Then tell me, for I am a student of the -brain, how you accept hypnotism and reject the thought reading. Let -me tell you, my friend, that there are things done today in electrical -science which would have been deemed unholy by the very man who -discovered electricity, who would themselves not so long before been -burned as wizards. There are always mysteries in life. Why was it -that Methuselah lived nine hundred years, and 'Old Parr' one hundred -and sixty-nine, and yet that poor Lucy, with four men's blood in her -poor veins, could not live even one day? For, had she live one more -day, we could save her. Do you know all the mystery of life and -death? Do you know the altogether of comparative anatomy and can say -wherefore the qualities of brutes are in some men, and not in others? -Can you tell me why, when other spiders die small and soon, that one -great spider lived for centuries in the tower of the old Spanish -church and grew and grew, till, on descending, he could drink the oil -of all the church lamps? Can you tell me why in the Pampas, ay and -elsewhere, there are bats that come out at night and open the veins of -cattle and horses and suck dry their veins, how in some islands of the -Western seas there are bats which hang on the trees all day, and those -who have seen describe as like giant nuts or pods, and that when the -sailors sleep on the deck, because that it is hot, flit down on them -and then, and then in the morning are found dead men, white as even -Miss Lucy was?" - -"Good God, Professor!" I said, starting up. "Do you mean to tell me -that Lucy was bitten by such a bat, and that such a thing is here in -London in the nineteenth century?" - -He waved his hand for silence, and went on, "Can you tell me why the -tortoise lives more long than generations of men, why the elephant -goes on and on till he have sees dynasties, and why the parrot never -die only of bite of cat of dog or other complaint? Can you tell me -why men believe in all ages and places that there are men and women -who cannot die? We all know, because science has vouched for the -fact, that there have been toads shut up in rocks for thousands of -years, shut in one so small hole that only hold him since the youth of -the world. Can you tell me how the Indian fakir can make himself to -die and have been buried, and his grave sealed and corn sowed on it, -and the corn reaped and be cut and sown and reaped and cut again, and -then men come and take away the unbroken seal and that there lie the -Indian fakir, not dead, but that rise up and walk amongst them as -before?" - -Here I interrupted him. I was getting bewildered. He so crowded on -my mind his list of nature's eccentricities and possible -impossibilities that my imagination was getting fired. I had a dim -idea that he was teaching me some lesson, as long ago he used to do in -his study at Amsterdam. But he used them to tell me the thing, so -that I could have the object of thought in mind all the time. But now -I was without his help, yet I wanted to follow him, so I said, - -"Professor, let me be your pet student again. Tell me the thesis, so -that I may apply your knowledge as you go on. At present I am going -in my mind from point to point as a madman, and not a sane one, -follows an idea. I feel like a novice lumbering through a bog in a -midst, jumping from one tussock to another in the mere blind effort to -move on without knowing where I am going." - -"That is a good image," he said. "Well, I shall tell you. My thesis -is this, I want you to believe." - -"To believe what?" - -"To believe in things that you cannot. Let me illustrate. I heard -once of an American who so defined faith, 'that faculty which enables -us to believe things which we know to be untrue.' For one, I follow -that man. He meant that we shall have an open mind, and not let a -little bit of truth check the rush of the big truth, like a small rock -does a railway truck. We get the small truth first. Good! We keep -him, and we value him, but all the same we must not let him think -himself all the truth in the universe." - -"Then you want me not to let some previous conviction inure the -receptivity of my mind with regard to some strange matter. Do I read -your lesson aright?" - -"Ah, you are my favourite pupil still. It is worth to teach you. Now -that you are willing to understand, you have taken the first step to -understand. You think then that those so small holes in the -children's throats were made by the same that made the holes in Miss -Lucy?" - -"I suppose so." - -He stood up and said solemnly, "Then you are wrong. Oh, would it were -so! But alas! No. It is worse, far, far worse." - -"In God's name, Professor Van Helsing, what do you mean?" I cried. - -He threw himself with a despairing gesture into a chair, and placed -his elbows on the table, covering his face with his hands as he spoke. - -"They were made by Miss Lucy!" - - - - -CHAPTER 15 - - -DR. SEWARD'S DIARY--cont. - -For a while sheer anger mastered me. It was as if he had during her -life struck Lucy on the face. I smote the table hard and rose up as I -said to him, "Dr. Van Helsing, are you mad?" - -He raised his head and looked at me, and somehow the tenderness of his -face calmed me at once. "Would I were!" he said. "Madness were easy -to bear compared with truth like this. Oh, my friend, why, think -you, did I go so far round, why take so long to tell so simple a -thing? Was it because I hate you and have hated you all my life? Was -it because I wished to give you pain? Was it that I wanted, now so -late, revenge for that time when you saved my life, and from a fearful -death? Ah no!" - -"Forgive me," said I. - -He went on, "My friend, it was because I wished to be gentle in the -breaking to you, for I know you have loved that so sweet lady. But -even yet I do not expect you to believe. It is so hard to accept at -once any abstract truth, that we may doubt such to be possible when we -have always believed the 'no' of it. It is more hard still to accept -so sad a concrete truth, and of such a one as Miss Lucy. Tonight I go -to prove it. Dare you come with me?" - -This staggered me. A man does not like to prove such a truth, Byron -excepted from the category, jealousy. - - "And prove the very truth he most abhorred." - -He saw my hesitation, and spoke, "The logic is simple, no madman's -logic this time, jumping from tussock to tussock in a misty bog. If -it not be true, then proof will be relief. At worst it will not harm. -If it be true! Ah, there is the dread. Yet every dread should help my -cause, for in it is some need of belief. Come, I tell you what I -propose. First, that we go off now and see that child in the -hospital. Dr. Vincent, of the North Hospital, where the papers say -the child is, is a friend of mine, and I think of yours since you were -in class at Amsterdam. He will let two scientists see his case, if he -will not let two friends. We shall tell him nothing, but only that we -wish to learn. And then . . ." - -"And then?" - -He took a key from his pocket and held it up. "And then we spend the -night, you and I, in the churchyard where Lucy lies. This is the key -that lock the tomb. I had it from the coffin man to give to Arthur." - -My heart sank within me, for I felt that there was some fearful ordeal -before us. I could do nothing, however, so I plucked up what heart I -could and said that we had better hasten, as the afternoon was -passing. - -We found the child awake. It had had a sleep and taken some food, and -altogether was going on well. Dr. Vincent took the bandage from its -throat, and showed us the punctures. There was no mistaking the -similarity to those which had been on Lucy's throat. They were -smaller, and the edges looked fresher, that was all. We asked Vincent -to what he attributed them, and he replied that it must have been a -bite of some animal, perhaps a rat, but for his own part, he was -inclined to think it was one of the bats which are so numerous on the -northern heights of London. "Out of so many harmless ones," he said, -"there may be some wild specimen from the South of a more malignant -species. Some sailor may have brought one home, and it managed to -escape, or even from the Zoological Gardens a young one may have got -loose, or one be bred there from a vampire. These things do occur, -you, know. Only ten days ago a wolf got out, and was, I believe, -traced up in this direction. For a week after, the children were -playing nothing but Red Riding Hood on the Heath and in every alley in -the place until this 'bloofer lady' scare came along, since then it -has been quite a gala time with them. Even this poor little mite, -when he woke up today, asked the nurse if he might go away. When she -asked him why he wanted to go, he said he wanted to play with the -'bloofer lady'." - -"I hope," said Van Helsing, "that when you are sending the child home -you will caution its parents to keep strict watch over it. These -fancies to stray are most dangerous, and if the child were to remain -out another night, it would probably be fatal. But in any case I -suppose you will not let it away for some days?" - -"Certainly not, not for a week at least, longer if the wound is not -healed." - -Our visit to the hospital took more time than we had reckoned on, and -the sun had dipped before we came out. When Van Helsing saw how dark -it was, he said, - -"There is not hurry. It is more late than I thought. Come, let us -seek somewhere that we may eat, and then we shall go on our way." - -We dined at 'Jack Straw's Castle' along with a little crowd of -bicyclists and others who were genially noisy. About ten o'clock we -started from the inn. It was then very dark, and the scattered lamps -made the darkness greater when we were once outside their individual -radius. The Professor had evidently noted the road we were to go, for -he went on unhesitatingly, but, as for me, I was in quite a mixup as -to locality. As we went further, we met fewer and fewer people, till -at last we were somewhat surprised when we met even the patrol of -horse police going their usual suburban round. At last we reached the -wall of the churchyard, which we climbed over. With some little -difficulty, for it was very dark, and the whole place seemed so -strange to us, we found the Westenra tomb. The Professor took the -key, opened the creaky door, and standing back, politely, but quite -unconsciously, motioned me to precede him. There was a delicious -irony in the offer, in the courtliness of giving preference on such a -ghastly occasion. My companion followed me quickly, and cautiously -drew the door to, after carefully ascertaining that the lock was a -falling, and not a spring one. In the latter case we should have been -in a bad plight. Then he fumbled in his bag, and taking out a -matchbox and a piece of candle, proceeded to make a light. The tomb -in the daytime, and when wreathed with fresh flowers, had looked grim -and gruesome enough, but now, some days afterwards, when the flowers -hung lank and dead, their whites turning to rust and their greens to -browns, when the spider and the beetle had resumed their accustomed -dominance, when the time-discoloured stone, and dust-encrusted mortar, -and rusty, dank iron, and tarnished brass, and clouded silver-plating -gave back the feeble glimmer of a candle, the effect was more -miserable and sordid than could have been imagined. It conveyed -irresistibly the idea that life, animal life, was not the only thing -which could pass away. - -Van Helsing went about his work systematically. Holding his candle so -that he could read the coffin plates, and so holding it that the sperm -dropped in white patches which congealed as they touched the metal, he -made assurance of Lucy's coffin. Another search in his bag, and he -took out a turnscrew. - -"What are you going to do?" I asked. - -"To open the coffin. You shall yet be convinced." - -Straightway he began taking out the screws, and finally lifted off the -lid, showing the casing of lead beneath. The sight was almost too -much for me. It seemed to be as much an affront to the dead as it -would have been to have stripped off her clothing in her sleep whilst -living. I actually took hold of his hand to stop him. - -He only said, "You shall see," and again fumbling in his bag took out -a tiny fret saw. Striking the turnscrew through the lead with a swift -downward stab, which made me wince, he made a small hole, which was, -however, big enough to admit the point of the saw. I had expected a -rush of gas from the week-old corpse. We doctors, who have had to -study our dangers, have to become accustomed to such things, and I -drew back towards the door. But the Professor never stopped for a -moment. He sawed down a couple of feet along one side of the lead -coffin, and then across, and down the other side. Taking the edge of -the loose flange, he bent it back towards the foot of the coffin, and -holding up the candle into the aperture, motioned to me to look. - -I drew near and looked. The coffin was empty. It was certainly a -surprise to me, and gave me a considerable shock, but Van Helsing was -unmoved. He was now more sure than ever of his ground, and so -emboldened to proceed in his task. "Are you satisfied now, friend -John?" he asked. - -I felt all the dogged argumentativeness of my nature awake within me as -I answered him, "I am satisfied that Lucy's body is not in that -coffin, but that only proves one thing." - -"And what is that, friend John?" - -"That it is not there." - -"That is good logic," he said, "so far as it goes. But how do you, -how can you, account for it not being there?" - -"Perhaps a body-snatcher," I suggested. "Some of the undertaker's -people may have stolen it." I felt that I was speaking folly, and yet -it was the only real cause which I could suggest. - -The Professor sighed. "Ah well!" he said, "we must have more proof. -Come with me." - -He put on the coffin lid again, gathered up all his things and placed -them in the bag, blew out the light, and placed the candle also in the -bag. We opened the door, and went out. Behind us he closed the door -and locked it. He handed me the key, saying, "Will you keep it? You -had better be assured." - -I laughed, it was not a very cheerful laugh, I am bound to say, as I -motioned him to keep it. "A key is nothing," I said, "there are many -duplicates, and anyhow it is not difficult to pick a lock of this -kind." - -He said nothing, but put the key in his pocket. Then he told me to -watch at one side of the churchyard whilst he would watch at the -other. - -I took up my place behind a yew tree, and I saw his dark figure move -until the intervening headstones and trees hid it from my sight. - -It was a lonely vigil. Just after I had taken my place I heard a -distant clock strike twelve, and in time came one and two. I was -chilled and unnerved, and angry with the Professor for taking me on -such an errand and with myself for coming. I was too cold and too -sleepy to be keenly observant, and not sleepy enough to betray my -trust, so altogether I had a dreary, miserable time. - -Suddenly, as I turned round, I thought I saw something like a white -streak, moving between two dark yew trees at the side of the -churchyard farthest from the tomb. At the same time a dark mass moved -from the Professor's side of the ground, and hurriedly went towards -it. Then I too moved, but I had to go round headstones and railed-off -tombs, and I stumbled over graves. The sky was overcast, and -somewhere far off an early cock crew. A little ways off, beyond a -line of scattered juniper trees, which marked the pathway to the -church, a white dim figure flitted in the direction of the tomb. The -tomb itself was hidden by trees, and I could not see where the figure -had disappeared. I heard the rustle of actual movement where I had -first seen the white figure, and coming over, found the Professor -holding in his arms a tiny child. When he saw me he held it out to -me, and said, "Are you satisfied now?" - -"No," I said, in a way that I felt was aggressive. - -"Do you not see the child?" - -"Yes, it is a child, but who brought it here? And is it wounded?" - -"We shall see," said the Professor, and with one impulse we took our -way out of the churchyard, he carrying the sleeping child. - -When we had got some little distance away, we went into a clump of -trees, and struck a match, and looked at the child's throat. It was -without a scratch or scar of any kind. - -"Was I right?" I asked triumphantly. - -"We were just in time," said the Professor thankfully. - -We had now to decide what we were to do with the child, and so -consulted about it. If we were to take it to a police station we -should have to give some account of our movements during the night. -At least, we should have had to make some statement as to how we had -come to find the child. So finally we decided that we would take it -to the Heath, and when we heard a policeman coming, would leave it -where he could not fail to find it. We would then seek our way home -as quickly as we could. All fell out well. At the edge of Hampstead -Heath we heard a policeman's heavy tramp, and laying the child on the -pathway, we waited and watched until he saw it as he flashed his -lantern to and fro. We heard his exclamation of astonishment, and -then we went away silently. By good chance we got a cab near the -'Spainiards,' and drove to town. - -I cannot sleep, so I make this entry. But I must try to get a few -hours' sleep, as Van Helsing is to call for me at noon. He insists -that I go with him on another expedition. - - -27 September.--It was two o'clock before we found a suitable -opportunity for our attempt. The funeral held at noon was all -completed, and the last stragglers of the mourners had taken -themselves lazily away, when, looking carefully from behind a clump of -alder trees, we saw the sexton lock the gate after him. We knew that -we were safe till morning did we desire it, but the Professor told me -that we should not want more than an hour at most. Again I felt that -horrid sense of the reality of things, in which any effort of -imagination seemed out of place, and I realized distinctly the perils -of the law which we were incurring in our unhallowed work. Besides, I -felt it was all so useless. Outrageous as it was to open a leaden -coffin, to see if a woman dead nearly a week were really dead, it now -seemed the height of folly to open the tomb again, when we knew, from -the evidence of our own eyesight, that the coffin was empty. I -shrugged my shoulders, however, and rested silent, for Van Helsing had -a way of going on his own road, no matter who remonstrated. He took -the key, opened the vault, and again courteously motioned me to -precede. The place was not so gruesome as last night, but oh, how -unutterably mean looking when the sunshine streamed in. Van Helsing -walked over to Lucy's coffin, and I followed. He bent over and again -forced back the leaden flange, and a shock of surprise and dismay shot -through me. - -There lay Lucy, seemingly just as we had seen her the night before her -funeral. She was, if possible, more radiantly beautiful than ever, -and I could not believe that she was dead. The lips were red, nay -redder than before, and on the cheeks was a delicate bloom. - -"Is this a juggle?" I said to him. - -"Are you convinced now?" said the Professor, in response, and as he -spoke he put over his hand, and in a way that made me shudder, pulled -back the dead lips and showed the white teeth. "See," he went on, -"they are even sharper than before. With this and this," and he -touched one of the canine teeth and that below it, "the little -children can be bitten. Are you of belief now, friend John?" - -Once more argumentative hostility woke within me. I could not accept -such an overwhelming idea as he suggested. So, with an attempt to -argue of which I was even at the moment ashamed, I said, "She may have -been placed here since last night." - -"Indeed? That is so, and by whom?" - -"I do not know. Someone has done it." - -"And yet she has been dead one week. Most peoples in that time would -not look so." - -I had no answer for this, so was silent. Van Helsing did not seem to -notice my silence. At any rate, he showed neither chagrin nor -triumph. He was looking intently at the face of the dead woman, -raising the eyelids and looking at the eyes, and once more opening the -lips and examining the teeth. Then he turned to me and said, - -"Here, there is one thing which is different from all recorded. Here -is some dual life that is not as the common. She was bitten by the -vampire when she was in a trance, sleep-walking, oh, you start. You -do not know that, friend John, but you shall know it later, and in -trance could he best come to take more blood. In trance she dies, and -in trance she is UnDead, too. So it is that she differ from all -other. Usually when the UnDead sleep at home," as he spoke he made a -comprehensive sweep of his arm to designate what to a vampire was -'home', "their face show what they are, but this so sweet that was -when she not UnDead she go back to the nothings of the common dead. -There is no malign there, see, and so it make hard that I must kill -her in her sleep." - -This turned my blood cold, and it began to dawn upon me that I was -accepting Van Helsing's theories. But if she were really dead, what -was there of terror in the idea of killing her? - -He looked up at me, and evidently saw the change in my face, for he -said almost joyously, "Ah, you believe now?" - -I answered, "Do not press me too hard all at once. I am willing to -accept. How will you do this bloody work?" - -"I shall cut off her head and fill her mouth with garlic, and I shall -drive a stake through her body." - -It made me shudder to think of so mutilating the body of the woman -whom I had loved. And yet the feeling was not so strong as I had -expected. I was, in fact, beginning to shudder at the presence of -this being, this UnDead, as Van Helsing called it, and to loathe it. -Is it possible that love is all subjective, or all objective? - -I waited a considerable time for Van Helsing to begin, but he stood as -if wrapped in thought. Presently he closed the catch of his bag with -a snap, and said, - -"I have been thinking, and have made up my mind as to what is best. -If I did simply follow my inclining I would do now, at this moment, -what is to be done. But there are other things to follow, and things -that are thousand times more difficult in that them we do not know. -This is simple. She have yet no life taken, though that is of time, -and to act now would be to take danger from her forever. But then we -may have to want Arthur, and how shall we tell him of this? If you, -who saw the wounds on Lucy's throat, and saw the wounds so similar on -the child's at the hospital, if you, who saw the coffin empty last -night and full today with a woman who have not change only to be more -rose and more beautiful in a whole week, after she die, if you know of -this and know of the white figure last night that brought the child to -the churchyard, and yet of your own senses you did not believe, how -then, can I expect Arthur, who know none of those things, to believe? - -"He doubted me when I took him from her kiss when she was dying. I -know he has forgiven me because in some mistaken idea I have done -things that prevent him say goodbye as he ought, and he may think that -in some more mistaken idea this woman was buried alive, and that in -most mistake of all we have killed her. He will then argue back that -it is we, mistaken ones, that have killed her by our ideas, and so he -will be much unhappy always. Yet he never can be sure, and that is -the worst of all. And he will sometimes think that she he loved was -buried alive, and that will paint his dreams with horrors of what she -must have suffered, and again, he will think that we may be right, and -that his so beloved was, after all, an UnDead. No! I told him once, -and since then I learn much. Now, since I know it is all true, a -hundred thousand times more do I know that he must pass through the -bitter waters to reach the sweet. He, poor fellow, must have one hour -that will make the very face of heaven grow black to him, then we can -act for good all round and send him peace. My mind is made up. Let -us go. You return home for tonight to your asylum, and see that all -be well. As for me, I shall spend the night here in this churchyard -in my own way. Tomorrow night you will come to me to the Berkeley -Hotel at ten of the clock. I shall send for Arthur to come too, and -also that so fine young man of America that gave his blood. Later we -shall all have work to do. I come with you so far as Piccadilly and -there dine, for I must be back here before the sun set." - -So we locked the tomb and came away, and got over the wall of the -churchyard, which was not much of a task, and drove back to -Piccadilly. - - - - -NOTE LEFT BY VAN HELSING IN HIS PORTMANTEAU, BERKELEY HOTEL DIRECTED TO -JOHN SEWARD, M. D. (Not Delivered) - -27 September - -"Friend John, - -"I write this in case anything should happen. I go alone to -watch in that churchyard. It pleases me that the UnDead, -Miss Lucy, shall not leave tonight, that so on the morrow -night she may be more eager. Therefore I shall fix some -things she like not, garlic and a crucifix, and so seal up -the door of the tomb. She is young as UnDead, and will -heed. Moreover, these are only to prevent her coming out. -They may not prevail on her wanting to get in, for then the -UnDead is desperate, and must find the line of least resistance, -whatsoever it may be. I shall be at hand all the night from -sunset till after sunrise, and if there be aught that may be -learned I shall learn it. For Miss Lucy or from her, I have no -fear, but that other to whom is there that she is UnDead, he have -not the power to seek her tomb and find shelter. He is cunning, -as I know from Mr. Jonathan and from the way that all along he -have fooled us when he played with us for Miss Lucy's life, and -we lost, and in many ways the UnDead are strong. He have always -the strength in his hand of twenty men, even we four who gave our -strength to Miss Lucy it also is all to him. Besides, he can -summon his wolf and I know not what. So if it be that he came -thither on this night he shall find me. But none other shall, -until it be too late. But it may be that he will not attempt the -place. There is no reason why he should. His hunting ground is -more full of game than the churchyard where the UnDead woman -sleeps, and the one old man watch. - -"Therefore I write this in case . . . Take the papers that -are with this, the diaries of Harker and the rest, and read -them, and then find this great UnDead, and cut off his head -and burn his heart or drive a stake through it, so that the -world may rest from him. - -"If it be so, farewell. - -"VAN HELSING." - - - - -DR. SEWARD'S DIARY - -28 September.--It is wonderful what a good night's sleep will do for -one. Yesterday I was almost willing to accept Van Helsing's monstrous -ideas, but now they seem to start out lurid before me as outrages on -common sense. I have no doubt that he believes it all. I wonder if -his mind can have become in any way unhinged. Surely there must be -some rational explanation of all these mysterious things. Is it -possible that the Professor can have done it himself? He is so -abnormally clever that if he went off his head he would carry out his -intent with regard to some fixed idea in a wonderful way. I am loathe -to think it, and indeed it would be almost as great a marvel as the -other to find that Van Helsing was mad, but anyhow I shall watch him -carefully. I may get some light on the mystery. - - -29 September.--Last night, at a little before ten o'clock, Arthur and -Quincey came into Van Helsing's room. He told us all what he wanted -us to do, but especially addressing himself to Arthur, as if all our -wills were centred in his. He began by saying that he hoped we would -all come with him too, "for," he said, "there is a grave duty to be -done there. You were doubtless surprised at my letter?" This query -was directly addressed to Lord Godalming. - -"I was. It rather upset me for a bit. There has been so much trouble -around my house of late that I could do without any more. I have been -curious, too, as to what you mean. - -"Quincey and I talked it over, but the more we talked, the more -puzzled we got, till now I can say for myself that I'm about up a tree -as to any meaning about anything." - -"Me too," said Quincey Morris laconically. - -"Oh," said the Professor, "then you are nearer the beginning, both of -you, than friend John here, who has to go a long way back before he -can even get so far as to begin." - -It was evident that he recognized my return to my old doubting frame -of mind without my saying a word. Then, turning to the other two, he -said with intense gravity, - -"I want your permission to do what I think good this night. It is, I -know, much to ask, and when you know what it is I propose to do you -will know, and only then how much. Therefore may I ask that you -promise me in the dark, so that afterwards, though you may be angry -with me for a time, I must not disguise from myself the possibility -that such may be, you shall not blame yourselves for anything." - -"That's frank anyhow," broke in Quincey. "I'll answer for the -Professor. I don't quite see his drift, but I swear he's honest, and -that's good enough for me." - -"I thank you, Sir," said Van Helsing proudly. "I have done myself the -honour of counting you one trusting friend, and such endorsement is -dear to me." He held out a hand, which Quincey took. - -Then Arthur spoke out, "Dr. Van Helsing, I don't quite like to 'buy a -pig in a poke', as they say in Scotland, and if it be anything in -which my honour as a gentleman or my faith as a Christian is -concerned, I cannot make such a promise. If you can assure me that -what you intend does not violate either of these two, then I give my -consent at once, though for the life of me, I cannot understand what -you are driving at." - -"I accept your limitation," said Van Helsing, "and all I ask of you is -that if you feel it necessary to condemn any act of mine, you will -first consider it well and be satisfied that it does not violate your -reservations." - -"Agreed!" said Arthur. "That is only fair. And now that the -pourparlers are over, may I ask what it is we are to do?" - -"I want you to come with me, and to come in secret, to the churchyard -at Kingstead." - -Arthur's face fell as he said in an amazed sort of way, - -"Where poor Lucy is buried?" - -The Professor bowed. - -Arthur went on, "And when there?" - -"To enter the tomb!" - -Arthur stood up. "Professor, are you in earnest, or is it some -monstrous joke? Pardon me, I see that you are in earnest." He sat -down again, but I could see that he sat firmly and proudly, as one who -is on his dignity. There was silence until he asked again, "And when -in the tomb?" - -"To open the coffin." - -"This is too much!" he said, angrily rising again. "I am willing to -be patient in all things that are reasonable, but in this, this -desecration of the grave, of one who . . ." He fairly choked with -indignation. - -The Professor looked pityingly at him. "If I could spare you one pang, -my poor friend," he said, "God knows I would. But this night our feet -must tread in thorny paths, or later, and for ever, the feet you love -must walk in paths of flame!" - -Arthur looked up with set white face and said, "Take care, sir, take -care!" - -"Would it not be well to hear what I have to say?" said Van Helsing. -"And then you will at least know the limit of my purpose. Shall I go -on?" - -"That's fair enough," broke in Morris. - -After a pause Van Helsing went on, evidently with an effort, "Miss -Lucy is dead, is it not so? Yes! Then there can be no wrong to her. -But if she be not dead . . ." - -Arthur jumped to his feet, "Good God!" he cried. "What do you mean? -Has there been any mistake, has she been buried alive?" He groaned in -anguish that not even hope could soften. - -"I did not say she was alive, my child. I did not think it. I go no -further than to say that she might be UnDead." - -"UnDead! Not alive! What do you mean? Is this all a nightmare, or -what is it?" - -"There are mysteries which men can only guess at, which age by age -they may solve only in part. Believe me, we are now on the verge of -one. But I have not done. May I cut off the head of dead Miss Lucy?" - -"Heavens and earth, no!" cried Arthur in a storm of passion. "Not for -the wide world will I consent to any mutilation of her dead body. Dr. -Van Helsing, you try me too far. What have I done to you that you -should torture me so? What did that poor, sweet girl do that you -should want to cast such dishonour on her grave? Are you mad, that you -speak of such things, or am I mad to listen to them? Don't dare think -more of such a desecration. I shall not give my consent to anything -you do. I have a duty to do in protecting her grave from outrage, and -by God, I shall do it!" - -Van Helsing rose up from where he had all the time been seated, and -said, gravely and sternly, "My Lord Godalming, I too, have a duty to -do, a duty to others, a duty to you, a duty to the dead, and by God, I -shall do it! All I ask you now is that you come with me, that you -look and listen, and if when later I make the same request you do not -be more eager for its fulfillment even than I am, then, I shall do my -duty, whatever it may seem to me. And then, to follow your Lordship's -wishes I shall hold myself at your disposal to render an account to -you, when and where you will." His voice broke a little, and he went -on with a voice full of pity. - -"But I beseech you, do not go forth in anger with me. In a long life -of acts which were often not pleasant to do, and which sometimes did -wring my heart, I have never had so heavy a task as now. Believe me -that if the time comes for you to change your mind towards me, one -look from you will wipe away all this so sad hour, for I would do what -a man can to save you from sorrow. Just think. For why should I give -myself so much labor and so much of sorrow? I have come here from my -own land to do what I can of good, at the first to please my friend -John, and then to help a sweet young lady, whom too, I come to love. -For her, I am ashamed to say so much, but I say it in kindness, I gave -what you gave, the blood of my veins. I gave it, I who was not, like -you, her lover, but only her physician and her friend. I gave her my -nights and days, before death, after death, and if my death can do her -good even now, when she is the dead UnDead, she shall have it freely." -He said this with a very grave, sweet pride, and Arthur was much -affected by it. - -He took the old man's hand and said in a broken voice, "Oh, it is hard -to think of it, and I cannot understand, but at least I shall go with -you and wait." - - - - -CHAPTER 16 - - -DR. SEWARD'S DIARY--cont. - -It was just a quarter before twelve o'clock when we got into the -churchyard over the low wall. The night was dark with occasional -gleams of moonlight between the dents of the heavy clouds that scudded -across the sky. We all kept somehow close together, with Van Helsing -slightly in front as he led the way. When we had come close to the -tomb I looked well at Arthur, for I feared the proximity to a place -laden with so sorrowful a memory would upset him, but he bore himself -well. I took it that the very mystery of the proceeding was in some -way a counteractant to his grief. The Professor unlocked the door, -and seeing a natural hesitation amongst us for various reasons, solved -the difficulty by entering first himself. The rest of us followed, -and he closed the door. He then lit a dark lantern and pointed to a -coffin. Arthur stepped forward hesitatingly. Van Helsing said to me, -"You were with me here yesterday. Was the body of Miss Lucy in that -coffin?" - -"It was." - -The Professor turned to the rest saying, "You hear, and yet there is -no one who does not believe with me." - -He took his screwdriver and again took off the lid of the coffin. -Arthur looked on, very pale but silent. When the lid was removed he -stepped forward. He evidently did not know that there was a leaden -coffin, or at any rate, had not thought of it. When he saw the rent -in the lead, the blood rushed to his face for an instant, but as -quickly fell away again, so that he remained of a ghastly whiteness. -He was still silent. Van Helsing forced back the leaden flange, and -we all looked in and recoiled. - -The coffin was empty! - -For several minutes no one spoke a word. The silence was broken by -Quincey Morris, "Professor, I answered for you. Your word is all I -want. I wouldn't ask such a thing ordinarily, I wouldn't so dishonour -you as to imply a doubt, but this is a mystery that goes beyond any -honour or dishonour. Is this your doing?" - -"I swear to you by all that I hold sacred that I have not removed or -touched her. What happened was this. Two nights ago my friend Seward -and I came here, with good purpose, believe me. I opened that coffin, -which was then sealed up, and we found it as now, empty. We then -waited, and saw something white come through the trees. The next day -we came here in daytime and she lay there. Did she not, friend John? - -"Yes." - -"That night we were just in time. One more so small child was -missing, and we find it, thank God, unharmed amongst the graves. -Yesterday I came here before sundown, for at sundown the UnDead can -move. I waited here all night till the sun rose, but I saw nothing. -It was most probable that it was because I had laid over the clamps of -those doors garlic, which the UnDead cannot bear, and other things -which they shun. Last night there was no exodus, so tonight before -the sundown I took away my garlic and other things. And so it is we -find this coffin empty. But bear with me. So far there is much that -is strange. Wait you with me outside, unseen and unheard, and things -much stranger are yet to be. So," here he shut the dark slide of his -lantern, "now to the outside." He opened the door, and we filed out, -he coming last and locking the door behind him. - -Oh! But it seemed fresh and pure in the night air after the terror of -that vault. How sweet it was to see the clouds race by, and the -passing gleams of the moonlight between the scudding clouds crossing -and passing, like the gladness and sorrow of a man's life. How sweet -it was to breathe the fresh air, that had no taint of death and decay. -How humanizing to see the red lighting of the sky beyond the hill, and -to hear far away the muffled roar that marks the life of a great -city. Each in his own way was solemn and overcome. Arthur was -silent, and was, I could see, striving to grasp the purpose and the -inner meaning of the mystery. I was myself tolerably patient, and -half inclined again to throw aside doubt and to accept Van Helsing's -conclusions. Quincey Morris was phlegmatic in the way of a man who -accepts all things, and accepts them in the spirit of cool bravery, -with hazard of all he has at stake. Not being able to smoke, he cut -himself a good-sized plug of tobacco and began to chew. As to Van -Helsing, he was employed in a definite way. First he took from his -bag a mass of what looked like thin, wafer-like biscuit, which was -carefully rolled up in a white napkin. Next he took out a double -handful of some whitish stuff, like dough or putty. He crumbled the -wafer up fine and worked it into the mass between his hands. This he -then took, and rolling it into thin strips, began to lay them into the -crevices between the door and its setting in the tomb. I was somewhat -puzzled at this, and being close, asked him what it was that he was -doing. Arthur and Quincey drew near also, as they too were curious. - -He answered, "I am closing the tomb so that the UnDead may not enter." - -"And is that stuff you have there going to do it?" - -"It is." - -"What is that which you are using?" This time the question was by -Arthur. Van Helsing reverently lifted his hat as he answered. - -"The Host. I brought it from Amsterdam. I have an Indulgence." - -It was an answer that appalled the most sceptical of us, and we felt -individually that in the presence of such earnest purpose as the -Professor's, a purpose which could thus use the to him most sacred of -things, it was impossible to distrust. In respectful silence we took -the places assigned to us close round the tomb, but hidden from the -sight of any one approaching. I pitied the others, especially Arthur. -I had myself been apprenticed by my former visits to this watching -horror, and yet I, who had up to an hour ago repudiated the proofs, -felt my heart sink within me. Never did tombs look so ghastly white. -Never did cypress, or yew, or juniper so seem the embodiment of -funeral gloom. Never did tree or grass wave or rustle so ominously. -Never did bough creak so mysteriously, and never did the far-away -howling of dogs send such a woeful presage through the night. - -There was a long spell of silence, big, aching, void, and then from -the Professor a keen "S-s-s-s!" He pointed, and far down the avenue of -yews we saw a white figure advance, a dim white figure, which held -something dark at its breast. The figure stopped, and at the moment a -ray of moonlight fell upon the masses of driving clouds, and showed in -startling prominence a dark-haired woman, dressed in the cerements of -the grave. We could not see the face, for it was bent down over what -we saw to be a fair-haired child. There was a pause and a sharp -little cry, such as a child gives in sleep, or a dog as it lies before -the fire and dreams. We were starting forward, but the Professor's -warning hand, seen by us as he stood behind a yew tree, kept us back. -And then as we looked the white figure moved forwards again. It was -now near enough for us to see clearly, and the moonlight still held. -My own heart grew cold as ice, and I could hear the gasp of Arthur, as -we recognized the features of Lucy Westenra. Lucy Westenra, but yet -how changed. The sweetness was turned to adamantine, heartless -cruelty, and the purity to voluptuous wantonness. - -Van Helsing stepped out, and obedient to his gesture, we all advanced -too. The four of us ranged in a line before the door of the tomb. Van -Helsing raised his lantern and drew the slide. By the concentrated -light that fell on Lucy's face we could see that the lips were crimson -with fresh blood, and that the stream had trickled over her chin and -stained the purity of her lawn death-robe. - -We shuddered with horror. I could see by the tremulous light that -even Van Helsing's iron nerve had failed. Arthur was next to me, and -if I had not seized his arm and held him up, he would have fallen. - -When Lucy, I call the thing that was before us Lucy because it bore -her shape, saw us she drew back with an angry snarl, such as a cat -gives when taken unawares, then her eyes ranged over us. Lucy's eyes -in form and colour, but Lucy's eyes unclean and full of hell fire, -instead of the pure, gentle orbs we knew. At that moment the remnant -of my love passed into hate and loathing. Had she then to be killed, -I could have done it with savage delight. As she looked, her eyes -blazed with unholy light, and the face became wreathed with a -voluptuous smile. Oh, God, how it made me shudder to see it! With a -careless motion, she flung to the ground, callous as a devil, the -child that up to now she had clutched strenuously to her breast, -growling over it as a dog growls over a bone. The child gave a sharp -cry, and lay there moaning. There was a cold-bloodedness in the act -which wrung a groan from Arthur. When she advanced to him with -outstretched arms and a wanton smile he fell back and hid his face in -his hands. - -She still advanced, however, and with a languorous, voluptuous grace, -said, "Come to me, Arthur. Leave these others and come to me. My -arms are hungry for you. Come, and we can rest together. Come, my -husband, come!" - -There was something diabolically sweet in her tones, something of the -tinkling of glass when struck, which rang through the brains even of -us who heard the words addressed to another. - -As for Arthur, he seemed under a spell, moving his hands from his -face, he opened wide his arms. She was leaping for them, when Van -Helsing sprang forward and held between them his little golden -crucifix. She recoiled from it, and, with a suddenly distorted face, -full of rage, dashed past him as if to enter the tomb. - -When within a foot or two of the door, however, she stopped, as if -arrested by some irresistible force. Then she turned, and her face -was shown in the clear burst of moonlight and by the lamp, which had -now no quiver from Van Helsing's nerves. Never did I see such baffled -malice on a face, and never, I trust, shall such ever be seen again by -mortal eyes. The beautiful colour became livid, the eyes seemed to -throw out sparks of hell fire, the brows were wrinkled as though the -folds of flesh were the coils of Medusa's snakes, and the lovely, -blood-stained mouth grew to an open square, as in the passion masks of -the Greeks and Japanese. If ever a face meant death, if looks could -kill, we saw it at that moment. - -And so for full half a minute, which seemed an eternity, she remained -between the lifted crucifix and the sacred closing of her means of -entry. - -Van Helsing broke the silence by asking Arthur, "Answer me, oh my -friend! Am I to proceed in my work?" - -"Do as you will, friend. Do as you will. There can be no horror like -this ever any more." And he groaned in spirit. - -Quincey and I simultaneously moved towards him, and took his arms. We -could hear the click of the closing lantern as Van Helsing held it -down. Coming close to the tomb, he began to remove from the chinks -some of the sacred emblem which he had placed there. We all looked on -with horrified amazement as we saw, when he stood back, the woman, -with a corporeal body as real at that moment as our own, pass through -the interstice where scarce a knife blade could have gone. We all -felt a glad sense of relief when we saw the Professor calmly restoring -the strings of putty to the edges of the door. - -When this was done, he lifted the child and said, "Come now, my -friends. We can do no more till tomorrow. There is a funeral at -noon, so here we shall all come before long after that. The friends -of the dead will all be gone by two, and when the sexton locks the -gate we shall remain. Then there is more to do, but not like this of -tonight. As for this little one, he is not much harmed, and by -tomorrow night he shall be well. We shall leave him where the police -will find him, as on the other night, and then to home." - -Coming close to Arthur, he said, "My friend Arthur, you have had a sore -trial, but after, when you look back, you will see how it was -necessary. You are now in the bitter waters, my child. By this time -tomorrow you will, please God, have passed them, and have drunk of the -sweet waters. So do not mourn over-much. Till then I shall not ask -you to forgive me." - -Arthur and Quincey came home with me, and we tried to cheer each other -on the way. We had left behind the child in safety, and were tired. -So we all slept with more or less reality of sleep. - - -29 September, night.--A little before twelve o'clock we three, Arthur, -Quincey Morris, and myself, called for the Professor. It was odd to -notice that by common consent we had all put on black clothes. Of -course, Arthur wore black, for he was in deep mourning, but the rest -of us wore it by instinct. We got to the graveyard by half-past one, -and strolled about, keeping out of official observation, so that when -the gravediggers had completed their task and the sexton, under the -belief that every one had gone, had locked the gate, we had the place -all to ourselves. Van Helsing, instead of his little black bag, had -with him a long leather one, something like a cricketing bag. It was -manifestly of fair weight. - -When we were alone and had heard the last of the footsteps die out up -the road, we silently, and as if by ordered intention, followed the -Professor to the tomb. He unlocked the door, and we entered, closing -it behind us. Then he took from his bag the lantern, which he lit, -and also two wax candles, which, when lighted, he stuck by melting -their own ends, on other coffins, so that they might give light -sufficient to work by. When he again lifted the lid off Lucy's coffin -we all looked, Arthur trembling like an aspen, and saw that the corpse -lay there in all its death beauty. But there was no love in my own -heart, nothing but loathing for the foul Thing which had taken Lucy's -shape without her soul. I could see even Arthur's face grow hard as -he looked. Presently he said to Van Helsing, "Is this really Lucy's -body, or only a demon in her shape?" - -"It is her body, and yet not it. But wait a while, and you shall see -her as she was, and is." - -She seemed like a nightmare of Lucy as she lay there, the pointed -teeth, the blood stained, voluptuous mouth, which made one shudder to -see, the whole carnal and unspirited appearance, seeming like a -devilish mockery of Lucy's sweet purity. Van Helsing, with his usual -methodicalness, began taking the various contents from his bag and -placing them ready for use. First he took out a soldering iron and -some plumbing solder, and then small oil lamp, which gave out, when -lit in a corner of the tomb, gas which burned at a fierce heat with a -blue flame, then his operating knives, which he placed to hand, and -last a round wooden stake, some two and a half or three inches thick -and about three feet long. One end of it was hardened by charring in -the fire, and was sharpened to a fine point. With this stake came a -heavy hammer, such as in households is used in the coal cellar for -breaking the lumps. To me, a doctor's preparations for work of any -kind are stimulating and bracing, but the effect of these things on -both Arthur and Quincey was to cause them a sort of consternation. -They both, however, kept their courage, and remained silent and quiet. - -When all was ready, Van Helsing said, "Before we do anything, let me -tell you this. It is out of the lore and experience of the ancients -and of all those who have studied the powers of the UnDead. When they -become such, there comes with the change the curse of immortality. -They cannot die, but must go on age after age adding new victims and -multiplying the evils of the world. For all that die from the preying -of the Undead become themselves Undead, and prey on their kind. And -so the circle goes on ever widening, like as the ripples from a stone -thrown in the water. Friend Arthur, if you had met that kiss which -you know of before poor Lucy die, or again, last night when you open -your arms to her, you would in time, when you had died, have become -nosferatu, as they call it in Eastern Europe, and would for all time -make more of those Un-Deads that so have filled us with horror. The -career of this so unhappy dear lady is but just begun. Those children -whose blood she sucked are not as yet so much the worse, but if she -lives on, UnDead, more and more they lose their blood and by her power -over them they come to her, and so she draw their blood with that so -wicked mouth. But if she die in truth, then all cease. The tiny -wounds of the throats disappear, and they go back to their play -unknowing ever of what has been. But of the most blessed of all, when -this now UnDead be made to rest as true dead, then the soul of the -poor lady whom we love shall again be free. Instead of working -wickedness by night and growing more debased in the assimilating of it -by day, she shall take her place with the other Angels. So that, my -friend, it will be a blessed hand for her that shall strike the blow -that sets her free. To this I am willing, but is there none amongst -us who has a better right? Will it be no joy to think of hereafter in -the silence of the night when sleep is not, 'It was my hand that sent -her to the stars. It was the hand of him that loved her best, the -hand that of all she would herself have chosen, had it been to her to -choose?' Tell me if there be such a one amongst us?" - -We all looked at Arthur. He saw too, what we all did, the infinite -kindness which suggested that his should be the hand which would -restore Lucy to us as a holy, and not an unholy, memory. He stepped -forward and said bravely, though his hand trembled, and his face was -as pale as snow, "My true friend, from the bottom of my broken heart I -thank you. Tell me what I am to do, and I shall not falter!" - -Van Helsing laid a hand on his shoulder, and said, "Brave lad! A -moment's courage, and it is done. This stake must be driven through -her. It well be a fearful ordeal, be not deceived in that, but it -will be only a short time, and you will then rejoice more than your -pain was great. From this grim tomb you will emerge as though you -tread on air. But you must not falter when once you have begun. Only -think that we, your true friends, are round you, and that we pray for -you all the time." - -"Go on," said Arthur hoarsely. "Tell me what I am to do." - -"Take this stake in your left hand, ready to place to the point over -the heart, and the hammer in your right. Then when we begin our -prayer for the dead, I shall read him, I have here the book, and the -others shall follow, strike in God's name, that so all may be well -with the dead that we love and that the UnDead pass away." - -Arthur took the stake and the hammer, and when once his mind was set -on action his hands never trembled nor even quivered. Van Helsing -opened his missal and began to read, and Quincey and I followed as -well as we could. - -Arthur placed the point over the heart, and as I looked I could see its -dint in the white flesh. Then he struck with all his might. - -The thing in the coffin writhed, and a hideous, blood-curdling screech -came from the opened red lips. The body shook and quivered and -twisted in wild contortions. The sharp white teeth champed together till -the lips were cut, and the mouth was smeared with a crimson foam. But -Arthur never faltered. He looked like a figure of Thor as his -untrembling arm rose and fell, driving deeper and deeper the -mercy-bearing stake, whilst the blood from the pierced heart welled -and spurted up around it. His face was set, and high duty seemed to -shine through it. The sight of it gave us courage so that our voices -seemed to ring through the little vault. - -And then the writhing and quivering of the body became less, and the -teeth seemed to champ, and the face to quiver. Finally it lay still. -The terrible task was over. - -The hammer fell from Arthur's hand. He reeled and would have fallen -had we not caught him. The great drops of sweat sprang from his -forehead, and his breath came in broken gasps. It had indeed been an -awful strain on him, and had he not been forced to his task by more -than human considerations he could never have gone through with it. -For a few minutes we were so taken up with him that we did not look -towards the coffin. When we did, however, a murmur of startled -surprise ran from one to the other of us. We gazed so eagerly that -Arthur rose, for he had been seated on the ground, and came and looked -too, and then a glad strange light broke over his face and dispelled -altogether the gloom of horror that lay upon it. - -There, in the coffin lay no longer the foul Thing that we had so -dreaded and grown to hate that the work of her destruction was yielded -as a privilege to the one best entitled to it, but Lucy as we had seen -her in life, with her face of unequalled sweetness and purity. True -that there were there, as we had seen them in life, the traces of care -and pain and waste. But these were all dear to us, for they marked -her truth to what we knew. One and all we felt that the holy calm -that lay like sunshine over the wasted face and form was only an -earthly token and symbol of the calm that was to reign for ever. - -Van Helsing came and laid his hand on Arthur's shoulder, and said to -him, "And now, Arthur my friend, dear lad, am I not forgiven?" - -The reaction of the terrible strain came as he took the old man's hand -in his, and raising it to his lips, pressed it, and said, "Forgiven! -God bless you that you have given my dear one her soul again, and me -peace." He put his hands on the Professor's shoulder, and laying his -head on his breast, cried for a while silently, whilst we stood -unmoving. - -When he raised his head Van Helsing said to him, "And now, my child, -you may kiss her. Kiss her dead lips if you will, as she would have -you to, if for her to choose. For she is not a grinning devil now, -not any more a foul Thing for all eternity. No longer she is the -devil's UnDead. She is God's true dead, whose soul is with Him!" - -Arthur bent and kissed her, and then we sent him and Quincey out of the -tomb. The Professor and I sawed the top off the stake, leaving the -point of it in the body. Then we cut off the head and filled the -mouth with garlic. We soldered up the leaden coffin, screwed on the -coffin lid, and gathering up our belongings, came away. When the -Professor locked the door he gave the key to Arthur. - -Outside the air was sweet, the sun shone, and the birds sang, and it -seemed as if all nature were tuned to a different pitch. There was -gladness and mirth and peace everywhere, for we were at rest ourselves -on one account, and we were glad, though it was with a tempered joy. - -Before we moved away Van Helsing said, "Now, my friends, one step of -our work is done, one the most harrowing to ourselves. But there -remains a greater task: to find out the author of all this our sorrow -and to stamp him out. I have clues which we can follow, but it is a -long task, and a difficult one, and there is danger in it, and pain. -Shall you not all help me? We have learned to believe, all of us, is -it not so? And since so, do we not see our duty? Yes! And do we not -promise to go on to the bitter end?" - -Each in turn, we took his hand, and the promise was made. Then said -the Professor as we moved off, "Two nights hence you shall meet with -me and dine together at seven of the clock with friend John. I shall -entreat two others, two that you know not as yet, and I shall be ready -to all our work show and our plans unfold. Friend John, you come with -me home, for I have much to consult you about, and you can help me. -Tonight I leave for Amsterdam, but shall return tomorrow night. And -then begins our great quest. But first I shall have much to say, so -that you may know what to do and to dread. Then our promise shall be -made to each other anew. For there is a terrible task before us, and -once our feet are on the ploughshare we must not draw back." - - - - -CHAPTER 17 - - -DR. SEWARD'S DIARY--cont. - -When we arrived at the Berkely Hotel, Van Helsing found a telegram -waiting for him. - -"Am coming up by train. Jonathan at Whitby. Important news. Mina -Harker." - - -The Professor was delighted. "Ah, that wonderful Madam Mina," he -said, "pearl among women! She arrive, but I cannot stay. She must go -to your house, friend John. You must meet her at the station. -Telegraph her en route so that she may be prepared." - -When the wire was dispatched he had a cup of tea. Over it he told me -of a diary kept by Jonathan Harker when abroad, and gave me a -typewritten copy of it, as also of Mrs. Harker's diary at Whitby. -"Take these," he said, "and study them well. When I have returned you -will be master of all the facts, and we can then better enter on our -inquisition. Keep them safe, for there is in them much of treasure. -You will need all your faith, even you who have had such an experience -as that of today. What is here told," he laid his hand heavily and -gravely on the packet of papers as he spoke, "may be the beginning of -the end to you and me and many another, or it may sound the knell of -the UnDead who walk the earth. Read all, I pray you, with the open -mind, and if you can add in any way to the story here told do so, for -it is all important. You have kept a diary of all these so strange -things, is it not so? Yes! Then we shall go through all these -together when we meet." He then made ready for his departure and -shortly drove off to Liverpool Street. I took my way to Paddington, -where I arrived about fifteen minutes before the train came in. - -The crowd melted away, after the bustling fashion common to arrival -platforms, and I was beginning to feel uneasy, lest I might miss my -guest, when a sweet-faced, dainty looking girl stepped up to me, and -after a quick glance said, "Dr. Seward, is it not?" - -"And you are Mrs. Harker!" I answered at once, whereupon she held out -her hand. - -"I knew you from the description of poor dear Lucy, but . . ." She -stopped suddenly, and a quick blush overspread her face. - -The blush that rose to my own cheeks somehow set us both at ease, for -it was a tacit answer to her own. I got her luggage, which included a -typewriter, and we took the Underground to Fenchurch Street, after I -had sent a wire to my housekeeper to have a sitting room and a bedroom -prepared at once for Mrs. Harker. - -In due time we arrived. She knew, of course, that the place was a -lunatic asylum, but I could see that she was unable to repress a -shudder when we entered. - -She told me that, if she might, she would come presently to my study, -as she had much to say. So here I am finishing my entry in my -phonograph diary whilst I await her. As yet I have not had the chance -of looking at the papers which Van Helsing left with me, though they -lie open before me. I must get her interested in something, so that I -may have an opportunity of reading them. She does not know how -precious time is, or what a task we have in hand. I must be careful -not to frighten her. Here she is! - - - - -MINA HARKER'S JOURNAL - -29 September.--After I had tidied myself, I went down to Dr. Seward's -study. At the door I paused a moment, for I thought I heard him -talking with some one. As, however, he had pressed me to be quick, I -knocked at the door, and on his calling out, "Come in," I entered. - -To my intense surprise, there was no one with him. He was quite -alone, and on the table opposite him was what I knew at once from the -description to be a phonograph. I had never seen one, and was much -interested. - -"I hope I did not keep you waiting," I said, "but I stayed at the door -as I heard you talking, and thought there was someone with you." - -"Oh," he replied with a smile, "I was only entering my diary." - -"Your diary?" I asked him in surprise. - -"Yes," he answered. "I keep it in this." As he spoke he laid his -hand on the phonograph. I felt quite excited over it, and blurted -out, "Why, this beats even shorthand! May I hear it say something?" - -"Certainly," he replied with alacrity, and stood up to put it in train -for speaking. Then he paused, and a troubled look overspread his -face. - -"The fact is," he began awkwardly, "I only keep my diary in it, and as -it is entirely, almost entirely, about my cases it may be awkward, -that is, I mean . . ." He stopped, and I tried to help him out of his -embarrassment. - -"You helped to attend dear Lucy at the end. Let me hear how she died, -for all that I know of her, I shall be very grateful. She was very, -very dear to me." - -To my surprise, he answered, with a horrorstruck look in his face, -"Tell you of her death? Not for the wide world!" - -"Why not?" I asked, for some grave, terrible feeling was coming over me. - -Again he paused, and I could see that he was trying to invent an -excuse. At length, he stammered out, "You see, I do not know how to -pick out any particular part of the diary." - -Even while he was speaking an idea dawned upon him, and he said with -unconscious simplicity, in a different voice, and with the naivete of -a child, "that's quite true, upon my honour. Honest Indian!" - -I could not but smile, at which he grimaced. "I gave myself away that -time!" he said. "But do you know that, although I have kept the diary -for months past, it never once struck me how I was going to find any -particular part of it in case I wanted to look it up?" - -By this time my mind was made up that the diary of a doctor who -attended Lucy might have something to add to the sum of our knowledge -of that terrible Being, and I said boldly, "Then, Dr. Seward, you had -better let me copy it out for you on my typewriter." - -He grew to a positively deathly pallor as he said, "No! No! No! For -all the world. I wouldn't let you know that terrible story!" - -Then it was terrible. My intuition was right! For a moment, I -thought, and as my eyes ranged the room, unconsciously looking for -something or some opportunity to aid me, they lit on a great batch of -typewriting on the table. His eyes caught the look in mine, and -without his thinking, followed their direction. As they saw the -parcel he realized my meaning. - -"You do not know me," I said. "When you have read those papers, my -own diary and my husband's also, which I have typed, you will know me -better. I have not faltered in giving every thought of my own heart -in this cause. But, of course, you do not know me, yet, and I must -not expect you to trust me so far." - -He is certainly a man of noble nature. Poor dear Lucy was right about -him. He stood up and opened a large drawer, in which were arranged in -order a number of hollow cylinders of metal covered with dark wax, and -said, - -"You are quite right. I did not trust you because I did not know -you. But I know you now, and let me say that I should have known you -long ago. I know that Lucy told you of me. She told me of you too. -May I make the only atonement in my power? Take the cylinders and -hear them. The first half-dozen of them are personal to me, and they -will not horrify you. Then you will know me better. Dinner will by -then be ready. In the meantime I shall read over some of these -documents, and shall be better able to understand certain things." - -He carried the phonograph himself up to my sitting room and adjusted -it for me. Now I shall learn something pleasant, I am sure. For it -will tell me the other side of a true love episode of which I know one -side already. - - - - -DR. SEWARD'S DIARY - -29 September.--I was so absorbed in that wonderful diary of Jonathan -Harker and that other of his wife that I let the time run on without -thinking. Mrs. Harker was not down when the maid came to announce -dinner, so I said, "She is possibly tired. Let dinner wait an hour," -and I went on with my work. I had just finished Mrs. Harker's diary, -when she came in. She looked sweetly pretty, but very sad, and her -eyes were flushed with crying. This somehow moved me much. Of late I -have had cause for tears, God knows! But the relief of them was -denied me, and now the sight of those sweet eyes, brightened by recent -tears, went straight to my heart. So I said as gently as I could, "I -greatly fear I have distressed you." - -"Oh, no, not distressed me," she replied. "But I have been more -touched than I can say by your grief. That is a wonderful machine, -but it is cruelly true. It told me, in its very tones, the anguish of -your heart. It was like a soul crying out to Almighty God. No one -must hear them spoken ever again! See, I have tried to be useful. I -have copied out the words on my typewriter, and none other need now -hear your heart beat, as I did." - -"No one need ever know, shall ever know," I said in a low voice. She -laid her hand on mine and said very gravely, "Ah, but they must!" - -"Must! But why?" I asked. - -"Because it is a part of the terrible story, a part of poor Lucy's -death and all that led to it. Because in the struggle which we have -before us to rid the earth of this terrible monster we must have all -the knowledge and all the help which we can get. I think that the -cylinders which you gave me contained more than you intended me to -know. But I can see that there are in your record many lights to this -dark mystery. You will let me help, will you not? I know all up to a -certain point, and I see already, though your diary only took me to 7 -September, how poor Lucy was beset, and how her terrible doom was -being wrought out. Jonathan and I have been working day and night -since Professor Van Helsing saw us. He is gone to Whitby to get more -information, and he will be here tomorrow to help us. We need have no -secrets amongst us. Working together and with absolute trust, we can -surely be stronger than if some of us were in the dark." - -She looked at me so appealingly, and at the same time manifested such -courage and resolution in her bearing, that I gave in at once to her -wishes. "You shall," I said, "do as you like in the matter. God -forgive me if I do wrong! There are terrible things yet to learn of, -but if you have so far traveled on the road to poor Lucy's death, you -will not be content, I know, to remain in the dark. Nay, the end, the -very end, may give you a gleam of peace. Come, there is dinner. We -must keep one another strong for what is before us. We have a cruel -and dreadful task. When you have eaten you shall learn the rest, and -I shall answer any questions you ask, if there be anything which you -do not understand, though it was apparent to us who were present." - - - -MINA HARKER'S JOURNAL - -29 September.--After dinner I came with Dr. Seward to his study. He -brought back the phonograph from my room, and I took a chair, and -arranged the phonograph so that I could touch it without getting up, -and showed me how to stop it in case I should want to pause. Then he -very thoughtfully took a chair, with his back to me, so that I might -be as free as possible, and began to read. I put the forked metal to -my ears and listened. - -When the terrible story of Lucy's death, and all that followed, was -done, I lay back in my chair powerless. Fortunately I am not of a -fainting disposition. When Dr. Seward saw me he jumped up with a -horrified exclamation, and hurriedly taking a case bottle from the -cupboard, gave me some brandy, which in a few minutes somewhat -restored me. My brain was all in a whirl, and only that there came -through all the multitude of horrors, the holy ray of light that my -dear Lucy was at last at peace, I do not think I could have borne it -without making a scene. It is all so wild and mysterious, and strange -that if I had not known Jonathan's experience in Transylvania I could -not have believed. As it was, I didn't know what to believe, and so -got out of my difficulty by attending to something else. I took the -cover off my typewriter, and said to Dr. Seward, - -"Let me write this all out now. We must be ready for Dr. Van Helsing -when he comes. I have sent a telegram to Jonathan to come on here -when he arrives in London from Whitby. In this matter dates are -everything, and I think that if we get all of our material ready, and -have every item put in chronological order, we shall have done much. - -"You tell me that Lord Godalming and Mr. Morris are coming too. Let -us be able to tell them when they come." - -He accordingly set the phonograph at a slow pace, and I began to -typewrite from the beginning of the seventeenth cylinder. I used -manifold, and so took three copies of the diary, just as I had done -with the rest. It was late when I got through, but Dr. Seward went -about his work of going his round of the patients. When he had -finished he came back and sat near me, reading, so that I did not feel -too lonely whilst I worked. How good and thoughtful he is. The world -seems full of good men, even if there are monsters in it. - -Before I left him I remembered what Jonathan put in his diary of the -Professor's perturbation at reading something in an evening paper at -the station at Exeter, so, seeing that Dr. Seward keeps his -newspapers, I borrowed the files of 'The Westminster Gazette' and 'The -Pall Mall Gazette' and took them to my room. I remember how much the -'Dailygraph' and 'The Whitby Gazette', of which I had made cuttings, -had helped us to understand the terrible events at Whitby when Count -Dracula landed, so I shall look through the evening papers since then, -and perhaps I shall get some new light. I am not sleepy, and the work -will help to keep me quiet. - - - - -DR. SEWARD'S DIARY - -30 September.--Mr. Harker arrived at nine o'clock. He got his wife's -wire just before starting. He is uncommonly clever, if one can judge -from his face, and full of energy. If this journal be true, and -judging by one's own wonderful experiences, it must be, he is also a -man of great nerve. That going down to the vault a second time was a -remarkable piece of daring. After reading his account of it I was -prepared to meet a good specimen of manhood, but hardly the quiet, -businesslike gentleman who came here today. - - -LATER.--After lunch Harker and his wife went back to their own room, -and as I passed a while ago I heard the click of the typewriter. They -are hard at it. Mrs. Harker says that they are knitting together in -chronological order every scrap of evidence they have. Harker has got -the letters between the consignee of the boxes at Whitby and the -carriers in London who took charge of them. He is now reading his -wife's transcript of my diary. I wonder what they make out of it. -Here it is . . . - -Strange that it never struck me that the very next house might be the -Count's hiding place! Goodness knows that we had enough clues from -the conduct of the patient Renfield! The bundle of letters relating -to the purchase of the house were with the transcript. Oh, if we had -only had them earlier we might have saved poor Lucy! Stop! That way -madness lies! Harker has gone back, and is again collecting material. -He says that by dinner time they will be able to show a whole -connected narrative. He thinks that in the meantime I should see -Renfield, as hitherto he has been a sort of index to the coming and -going of the Count. I hardly see this yet, but when I get at the -dates I suppose I shall. What a good thing that Mrs. Harker put my -cylinders into type! We never could have found the dates otherwise. - -I found Renfield sitting placidly in his room with his hands folded, -smiling benignly. At the moment he seemed as sane as any one I ever -saw. I sat down and talked with him on a lot of subjects, all of -which he treated naturally. He then, of his own accord, spoke of -going home, a subject he has never mentioned to my knowledge during -his sojourn here. In fact, he spoke quite confidently of getting his -discharge at once. I believe that, had I not had the chat with Harker -and read the letters and the dates of his outbursts, I should have -been prepared to sign for him after a brief time of observation. As -it is, I am darkly suspicious. All those out-breaks were in some way -linked with the proximity of the Count. What then does this absolute -content mean? Can it be that his instinct is satisfied as to the -vampire's ultimate triumph? Stay. He is himself zoophagous, and in -his wild ravings outside the chapel door of the deserted house he -always spoke of 'master'. This all seems confirmation of our idea. -However, after a while I came away. My friend is just a little too -sane at present to make it safe to probe him too deep with questions. -He might begin to think, and then . . . So I came away. I mistrust -these quiet moods of his, so I have given the attendant a hint to -look closely after him, and to have a strait waistcoat ready in case -of need. - - - - - -JOHNATHAN HARKER'S JOURNAL - -29 September, in train to London.--When I received Mr. Billington's -courteous message that he would give me any information in his power I -thought it best to go down to Whitby and make, on the spot, such -inquiries as I wanted. It was now my object to trace that horrid -cargo of the Count's to its place in London. Later, we may be able to -deal with it. Billington junior, a nice lad, met me at the station, -and brought me to his father's house, where they had decided that I -must spend the night. They are hospitable, with true Yorkshire -hospitality, give a guest everything and leave him to do as he likes. -They all knew that I was busy, and that my stay was short, and Mr. -Billington had ready in his office all the papers concerning the -consignment of boxes. It gave me almost a turn to see again one of -the letters which I had seen on the Count's table before I knew of his -diabolical plans. Everything had been carefully thought out, and done -systematically and with precision. He seemed to have been prepared -for every obstacle which might be placed by accident in the way of his -intentions being carried out. To use an Americanism, he had 'taken no -chances', and the absolute accuracy with which his instructions were -fulfilled was simply the logical result of his care. I saw the -invoice, and took note of it. 'Fifty cases of common earth, to be used -for experimental purposes'. Also the copy of the letter to Carter -Paterson, and their reply. Of both these I got copies. This was all -the information Mr. Billington could give me, so I went down to the -port and saw the coastguards, the Customs Officers and the harbour -master, who kindly put me in communication with the men who had -actually received the boxes. Their tally was exact with the list, and -they had nothing to add to the simple description 'fifty cases of -common earth', except that the boxes were 'main and mortal heavy', and -that shifting them was dry work. One of them added that it was hard -lines that there wasn't any gentleman 'such like as like yourself, -squire', to show some sort of appreciation of their efforts in a -liquid form. Another put in a rider that the thirst then generated -was such that even the time which had elapsed had not completely -allayed it. Needless to add, I took care before leaving to lift, -forever and adequately, this source of reproach. - -30 September.--The station master was good enough to give me a line to -his old companion the station master at King's Cross, so that when I -arrived there in the morning I was able to ask him about the arrival -of the boxes. He, too put me at once in communication with the proper -officials, and I saw that their tally was correct with the original -invoice. The opportunities of acquiring an abnormal thirst had been -here limited. A noble use of them had, however, been made, and again -I was compelled to deal with the result in ex post facto manner. - -From thence I went to Carter Paterson's central office, where I met -with the utmost courtesy. They looked up the transaction in their day -book and letter book, and at once telephoned to their King's Cross -office for more details. By good fortune, the men who did the teaming -were waiting for work, and the official at once sent them over, -sending also by one of them the way-bill and all the papers connected -with the delivery of the boxes at Carfax. Here again I found the -tally agreeing exactly. The carriers' men were able to supplement the -paucity of the written words with a few more details. These were, I -shortly found, connected almost solely with the dusty nature of the -job, and the consequent thirst engendered in the operators. On my -affording an opportunity, through the medium of the currency of the -realm, of the allaying, at a later period, this beneficial evil, one -of the men remarked, - -"That 'ere 'ouse, guv'nor, is the rummiest I ever was in. Blyme! But -it ain't been touched sence a hundred years. There was dust that -thick in the place that you might have slep' on it without 'urtin' of -yer bones. An' the place was that neglected that yer might 'ave -smelled ole Jerusalem in it. But the old chapel, that took the cike, -that did! Me and my mate, we thort we wouldn't never git out quick -enough. Lor', I wouldn't take less nor a quid a moment to stay there -arter dark." - -Having been in the house, I could well believe him, but if he knew -what I know, he would, I think have raised his terms. - -Of one thing I am now satisfied. That all those boxes which arrived at -Whitby from Varna in the Demeter were safely deposited in the old -chapel at Carfax. There should be fifty of them there, unless any -have since been removed, as from Dr. Seward's diary I fear. - - -Later.--Mina and I have worked all day, and we have put all the papers -into order. - - - - -MINA HARKER'S JOURNAL - -30 September.--I am so glad that I hardly know how to contain myself. -It is, I suppose, the reaction from the haunting fear which I have -had, that this terrible affair and the reopening of his old wound -might act detrimentally on Jonathan. I saw him leave for Whitby with -as brave a face as could, but I was sick with apprehension. The -effort has, however, done him good. He was never so resolute, never -so strong, never so full of volcanic energy, as at present. It is -just as that dear, good Professor Van Helsing said, he is true grit, -and he improves under strain that would kill a weaker nature. He came -back full of life and hope and determination. We have got everything -in order for tonight. I feel myself quite wild with excitement. I -suppose one ought to pity anything so hunted as the Count. That is -just it. This thing is not human, not even a beast. To read Dr. -Seward's account of poor Lucy's death, and what followed, is enough to -dry up the springs of pity in one's heart. - - -Later.--Lord Godalming and Mr. Morris arrived earlier than we -expected. Dr. Seward was out on business, and had taken Jonathan with -him, so I had to see them. It was to me a painful meeting, for it -brought back all poor dear Lucy's hopes of only a few months ago. Of -course they had heard Lucy speak of me, and it seemed that Dr. Van -Helsing, too, had been quite 'blowing my trumpet', as Mr. Morris -expressed it. Poor fellows, neither of them is aware that I know all -about the proposals they made to Lucy. They did not quite know what -to say or do, as they were ignorant of the amount of my knowledge. So -they had to keep on neutral subjects. However, I thought the matter -over, and came to the conclusion that the best thing I could do would -be to post them on affairs right up to date. I knew from Dr. Seward's -diary that they had been at Lucy's death, her real death, and that I -need not fear to betray any secret before the time. So I told them, -as well as I could, that I had read all the papers and diaries, and -that my husband and I, having typewritten them, had just finished -putting them in order. I gave them each a copy to read in the -library. When Lord Godalming got his and turned it over, it does make -a pretty good pile, he said, "Did you write all this, Mrs. Harker?" - -I nodded, and he went on. - -"I don't quite see the drift of it, but you people are all so good and -kind, and have been working so earnestly and so energetically, that -all I can do is to accept your ideas blindfold and try to help you. I -have had one lesson already in accepting facts that should make a man -humble to the last hour of his life. Besides, I know you loved my -Lucy . . ." - -Here he turned away and covered his face with his hands. I could hear -the tears in his voice. Mr. Morris, with instinctive delicacy, just -laid a hand for a moment on his shoulder, and then walked quietly out -of the room. I suppose there is something in a woman's nature that -makes a man free to break down before her and express his feelings on -the tender or emotional side without feeling it derogatory to his -manhood. For when Lord Godalming found himself alone with me he sat -down on the sofa and gave way utterly and openly. I sat down beside -him and took his hand. I hope he didn't think it forward of me, and -that if he ever thinks of it afterwards he never will have such a -thought. There I wrong him. I know he never will. He is too true a -gentleman. I said to him, for I could see that his heart was -breaking, "I loved dear Lucy, and I know what she was to you, and what -you were to her. She and I were like sisters, and now she is gone, -will you not let me be like a sister to you in your trouble? I know -what sorrows you have had, though I cannot measure the depth of them. -If sympathy and pity can help in your affliction, won't you let me be -of some little service, for Lucy's sake?" - -In an instant the poor dear fellow was overwhelmed with grief. It -seemed to me that all that he had of late been suffering in silence -found a vent at once. He grew quite hysterical, and raising his open -hands, beat his palms together in a perfect agony of grief. He stood -up and then sat down again, and the tears rained down his cheeks. I -felt an infinite pity for him, and opened my arms unthinkingly. With -a sob he laid his head on my shoulder and cried like a wearied child, -whilst he shook with emotion. - -We women have something of the mother in us that makes us rise above -smaller matters when the mother spirit is invoked. I felt this big -sorrowing man's head resting on me, as though it were that of a baby -that some day may lie on my bosom, and I stroked his hair as though he -were my own child. I never thought at the time how strange it all -was. - -After a little bit his sobs ceased, and he raised himself with an -apology, though he made no disguise of his emotion. He told me that -for days and nights past, weary days and sleepless nights, he had been -unable to speak with any one, as a man must speak in his time of -sorrow. There was no woman whose sympathy could be given to him, or -with whom, owing to the terrible circumstance with which his sorrow -was surrounded, he could speak freely. - -"I know now how I suffered," he said, as he dried his eyes, "but I do -not know even yet, and none other can ever know, how much your sweet -sympathy has been to me today. I shall know better in time, and -believe me that, though I am not ungrateful now, my gratitude will -grow with my understanding. You will let me be like a brother, will -you not, for all our lives, for dear Lucy's sake?" - -"For dear Lucy's sake," I said as we clasped hands. "Ay, and for your -own sake," he added, "for if a man's esteem and gratitude are ever -worth the winning, you have won mine today. If ever the future should -bring to you a time when you need a man's help, believe me, you will -not call in vain. God grant that no such time may ever come to you to -break the sunshine of your life, but if it should ever come, promise -me that you will let me know." - -He was so earnest, and his sorrow was so fresh, that I felt it would -comfort him, so I said, "I promise." - -As I came along the corridor I saw Mr. Morris looking out of a window. -He turned as he heard my footsteps. "How is Art?" he said. Then -noticing my red eyes, he went on, "Ah, I see you have been comforting -him. Poor old fellow! He needs it. No one but a woman can help a -man when he is in trouble of the heart, and he had no one to comfort -him." - -He bore his own trouble so bravely that my heart bled for him. I saw -the manuscript in his hand, and I knew that when he read it he would -realize how much I knew, so I said to him, "I wish I could comfort all -who suffer from the heart. Will you let me be your friend, and will -you come to me for comfort if you need it? You will know later why I -speak." - -He saw that I was in earnest, and stooping, took my hand, and raising -it to his lips, kissed it. It seemed but poor comfort to so brave and -unselfish a soul, and impulsively I bent over and kissed him. The -tears rose in his eyes, and there was a momentary choking in his -throat. He said quite calmly, "Little girl, you will never forget -that true hearted kindness, so long as ever you live!" Then he went -into the study to his friend. - -"Little girl!" The very words he had used to Lucy, and, oh, but he -proved himself a friend. - - - - -CHAPTER 18 - - -DR. SEWARD'S DIARY - -30 September.--I got home at five o'clock, and found that Godalming -and Morris had not only arrived, but had already studied the -transcript of the various diaries and letters which Harker had not yet -returned from his visit to the carriers' men, of whom Dr. Hennessey -had written to me. Mrs. Harker gave us a cup of tea, and I can -honestly say that, for the first time since I have lived in it, this -old house seemed like home. When we had finished, Mrs. Harker said, - -"Dr. Seward, may I ask a favour? I want to see your patient, Mr. -Renfield. Do let me see him. What you have said of him in your diary -interests me so much!" - -She looked so appealing and so pretty that I could not refuse her, and -there was no possible reason why I should, so I took her with me. -When I went into the room, I told the man that a lady would like to see -him, to which he simply answered, "Why?" - -"She is going through the house, and wants to see every one in it," I -answered. - -"Oh, very well," he said, "let her come in, by all means, but just -wait a minute till I tidy up the place." - -His method of tidying was peculiar, he simply swallowed all the flies -and spiders in the boxes before I could stop him. It was quite -evident that he feared, or was jealous of, some interference. When he -had got through his disgusting task, he said cheerfully, "Let the lady -come in," and sat down on the edge of his bed with his head down, but -with his eyelids raised so that he could see her as she entered. For -a moment I thought that he might have some homicidal intent. I -remembered how quiet he had been just before he attacked me in my own -study, and I took care to stand where I could seize him at once if he -attempted to make a spring at her. - -She came into the room with an easy gracefulness which would at once -command the respect of any lunatic, for easiness is one of the -qualities mad people most respect. She walked over to him, smiling -pleasantly, and held out her hand. - -"Good evening, Mr. Renfield," said she. "You see, I know you, for Dr. -Seward has told me of you." He made no immediate reply, but eyed her -all over intently with a set frown on his face. This look gave way to -one of wonder, which merged in doubt, then to my intense astonishment -he said, "You're not the girl the doctor wanted to marry, are you? You -can't be, you know, for she's dead." - -Mrs. Harker smiled sweetly as she replied, "Oh no! I have a husband -of my own, to whom I was married before I ever saw Dr. Seward, or he -me. I am Mrs. Harker." - -"Then what are you doing here?" - -"My husband and I are staying on a visit with Dr. Seward." - -"Then don't stay." - -"But why not?" - -I thought that this style of conversation might not be pleasant to -Mrs. Harker, any more than it was to me, so I joined in, "How did you -know I wanted to marry anyone?" - -His reply was simply contemptuous, given in a pause in which he turned -his eyes from Mrs. Harker to me, instantly turning them back again, -"What an asinine question!" - -"I don't see that at all, Mr. Renfield," said Mrs. Harker, at once -championing me. - -He replied to her with as much courtesy and respect as he had shown -contempt to me, "You will, of course, understand, Mrs. Harker, that -when a man is so loved and honoured as our host is, everything -regarding him is of interest in our little community. Dr. Seward is -loved not only by his household and his friends, but even by his -patients, who, being some of them hardly in mental equilibrium, are -apt to distort causes and effects. Since I myself have been an inmate -of a lunatic asylum, I cannot but notice that the sophistic tendencies -of some of its inmates lean towards the errors of non causa and -ignoratio elenche." - -I positively opened my eyes at this new development. Here was my own -pet lunatic, the most pronounced of his type that I had ever met with, -talking elemental philosophy, and with the manner of a polished -gentleman. I wonder if it was Mrs. Harker's presence which had -touched some chord in his memory. If this new phase was spontaneous, -or in any way due to her unconscious influence, she must have some -rare gift or power. - -We continued to talk for some time, and seeing that he was seemingly -quite reasonable, she ventured, looking at me questioningly as she -began, to lead him to his favourite topic. I was again astonished, -for he addressed himself to the question with the impartiality of -the completest sanity. He even took himself as an example when he -mentioned certain things. - -"Why, I myself am an instance of a man who had a strange belief. -Indeed, it was no wonder that my friends were alarmed, and insisted on -my being put under control. I used to fancy that life was a positive -and perpetual entity, and that by consuming a multitude of live -things, no matter how low in the scale of creation, one might -indefinitely prolong life. At times I held the belief so strongly -that I actually tried to take human life. The doctor here will bear -me out that on one occasion I tried to kill him for the purpose of -strengthening my vital powers by the assimilation with my own body of -his life through the medium of his blood, relying of course, upon the -Scriptural phrase, 'For the blood is the life.' Though, indeed, the -vendor of a certain nostrum has vulgarized the truism to the very -point of contempt. Isn't that true, doctor?" - -I nodded assent, for I was so amazed that I hardly knew what to either -think or say, it was hard to imagine that I had seen him eat up his -spiders and flies not five minutes before. Looking at my watch, I saw -that I should go to the station to meet Van Helsing, so I told Mrs. -Harker that it was time to leave. - -She came at once, after saying pleasantly to Mr. Renfield, "Goodbye, -and I hope I may see you often, under auspices pleasanter to -yourself." - -To which, to my astonishment, he replied, "Goodbye, my dear. I pray -God I may never see your sweet face again. May He bless and keep -you!" - -When I went to the station to meet Van Helsing I left the boys behind -me. Poor Art seemed more cheerful than he has been since Lucy first -took ill, and Quincey is more like his own bright self than he has -been for many a long day. - -Van Helsing stepped from the carriage with the eager nimbleness of a -boy. He saw me at once, and rushed up to me, saying, "Ah, friend -John, how goes all? Well? So! I have been busy, for I come here to -stay if need be. All affairs are settled with me, and I have much to -tell. Madam Mina is with you? Yes. And her so fine husband? And -Arthur and my friend Quincey, they are with you, too? Good!" - -As I drove to the house I told him of what had passed, and of how my -own diary had come to be of some use through Mrs. Harker's suggestion, -at which the Professor interrupted me. - -"Ah, that wonderful Madam Mina! She has man's brain, a brain that a -man should have were he much gifted, and a woman's heart. The good -God fashioned her for a purpose, believe me, when He made that so good -combination. Friend John, up to now fortune has made that woman of -help to us, after tonight she must not have to do with this so -terrible affair. It is not good that she run a risk so great. We men -are determined, nay, are we not pledged, to destroy this monster? But -it is no part for a woman. Even if she be not harmed, her heart may -fail her in so much and so many horrors and hereafter she may suffer, -both in waking, from her nerves, and in sleep, from her dreams. And, -besides, she is young woman and not so long married, there may be -other things to think of some time, if not now. You tell me she has -wrote all, then she must consult with us, but tomorrow she say goodbye -to this work, and we go alone." - -I agreed heartily with him, and then I told him what we had found in -his absence, that the house which Dracula had bought was the very next -one to my own. He was amazed, and a great concern seemed to come on -him. - -"Oh that we had known it before!" he said, "for then we might have -reached him in time to save poor Lucy. However, 'the milk that is -spilt cries not out afterwards,' as you say. We shall not think of -that, but go on our way to the end." Then he fell into a silence that -lasted till we entered my own gateway. Before we went to prepare for -dinner he said to Mrs. Harker, "I am told, Madam Mina, by my friend -John that you and your husband have put up in exact order all things -that have been, up to this moment." - -"Not up to this moment, Professor," she said impulsively, "but up to -this morning." - -"But why not up to now? We have seen hitherto how good light all the -little things have made. We have told our secrets, and yet no one who -has told is the worse for it." - -Mrs. Harker began to blush, and taking a paper from her pockets, she -said, "Dr. Van Helsing, will you read this, and tell me if it must go -in. It is my record of today. I too have seen the need of putting -down at present everything, however trivial, but there is little in -this except what is personal. Must it go in?" - -The Professor read it over gravely, and handed it back, saying, "It -need not go in if you do not wish it, but I pray that it may. It can -but make your husband love you the more, and all us, your friends, -more honour you, as well as more esteem and love." She took it back -with another blush and a bright smile. - -And so now, up to this very hour, all the records we have are complete -and in order. The Professor took away one copy to study after dinner, -and before our meeting, which is fixed for nine o'clock. The rest of -us have already read everything, so when we meet in the study we shall -all be informed as to facts, and can arrange our plan of battle with -this terrible and mysterious enemy. - - - - - -MINA HARKER'S JOURNAL - -30 September.--When we met in Dr. Seward's study two hours after -dinner, which had been at six o'clock, we unconsciously formed a sort -of board or committee. Professor Van Helsing took the head of the -table, to which Dr. Seward motioned him as he came into the room. He -made me sit next to him on his right, and asked me to act as -secretary. Jonathan sat next to me. Opposite us were Lord Godalming, -Dr. Seward, and Mr. Morris, Lord Godalming being next the Professor, -and Dr. Seward in the centre. - -The Professor said, "I may, I suppose, take it that we are all -acquainted with the facts that are in these papers." We all expressed -assent, and he went on, "Then it were, I think, good that I tell you -something of the kind of enemy with which we have to deal. I shall -then make known to you something of the history of this man, which has -been ascertained for me. So we then can discuss how we shall act, and -can take our measure according. - -"There are such beings as vampires, some of us have evidence that they -exist. Even had we not the proof of our own unhappy experience, the -teachings and the records of the past give proof enough for sane -peoples. I admit that at the first I was sceptic. Were it not that -through long years I have trained myself to keep an open mind, I could -not have believed until such time as that fact thunder on my ear. 'See! -See! I prove, I prove.' Alas! Had I known at first what now I know, -nay, had I even guess at him, one so precious life had been spared to -many of us who did love her. But that is gone, and we must so work, -that other poor souls perish not, whilst we can save. The nosferatu -do not die like the bee when he sting once. He is only stronger, and -being stronger, have yet more power to work evil. This vampire which -is amongst us is of himself so strong in person as twenty men, he is -of cunning more than mortal, for his cunning be the growth of ages, he -have still the aids of necromancy, which is, as his etymology imply, -the divination by the dead, and all the dead that he can come nigh to -are for him at command; he is brute, and more than brute; he is devil -in callous, and the heart of him is not; he can, within his range, -direct the elements, the storm, the fog, the thunder; he can command -all the meaner things, the rat, and the owl, and the bat, the moth, -and the fox, and the wolf, he can grow and become small; and he can at -times vanish and come unknown. How then are we to begin our strike to -destroy him? How shall we find his where, and having found it, how -can we destroy? My friends, this is much, it is a terrible task that -we undertake, and there may be consequence to make the brave shudder. -For if we fail in this our fight he must surely win, and then where -end we? Life is nothings, I heed him not. But to fail here, is not -mere life or death. It is that we become as him, that we henceforward -become foul things of the night like him, without heart or conscience, -preying on the bodies and the souls of those we love best. To us -forever are the gates of heaven shut, for who shall open them to us -again? We go on for all time abhorred by all, a blot on the face of -God's sunshine, an arrow in the side of Him who died for man. But we -are face to face with duty, and in such case must we shrink? For me, -I say no, but then I am old, and life, with his sunshine, his fair -places, his song of birds, his music and his love, lie far behind. You -others are young. Some have seen sorrow, but there are fair days yet -in store. What say you?" - -Whilst he was speaking, Jonathan had taken my hand. I feared, oh so -much, that the appalling nature of our danger was overcoming him when -I saw his hand stretch out, but it was life to me to feel its touch, -so strong, so self reliant, so resolute. A brave man's hand can speak -for itself, it does not even need a woman's love to hear its music. - -When the Professor had done speaking my husband looked in my eyes, and -I in his, there was no need for speaking between us. - -"I answer for Mina and myself," he said. - -"Count me in, Professor," said Mr. Quincey Morris, laconically as -usual. - -"I am with you," said Lord Godalming, "for Lucy's sake, if for no -other reason." - -Dr. Seward simply nodded. - -The Professor stood up and, after laying his golden crucifix on the -table, held out his hand on either side. I took his right hand, and -Lord Godalming his left, Jonathan held my right with his left and -stretched across to Mr. Morris. So as we all took hands our solemn -compact was made. I felt my heart icy cold, but it did not even occur -to me to draw back. We resumed our places, and Dr. Van Helsing went -on with a sort of cheerfulness which showed that the serious work had -begun. It was to be taken as gravely, and in as businesslike a way, -as any other transaction of life. - -"Well, you know what we have to contend against, but we too, are not -without strength. We have on our side power of combination, a power -denied to the vampire kind, we have sources of science, we are free to -act and think, and the hours of the day and the night are ours -equally. In fact, so far as our powers extend, they are unfettered, -and we are free to use them. We have self devotion in a cause and an -end to achieve which is not a selfish one. These things are much. - -"Now let us see how far the general powers arrayed against us are -restrict, and how the individual cannot. In fine, let us consider the -limitations of the vampire in general, and of this one in particular. - -"All we have to go upon are traditions and superstitions. These do -not at the first appear much, when the matter is one of life and -death, nay of more than either life or death. Yet must we be -satisfied, in the first place because we have to be, no other means is -at our control, and secondly, because, after all these things, -tradition and superstition, are everything. Does not the belief in -vampires rest for others, though not, alas! for us, on them? A year -ago which of us would have received such a possibility, in the midst -of our scientific, sceptical, matter-of-fact nineteenth century? We -even scouted a belief that we saw justified under our very eyes. Take -it, then, that the vampire, and the belief in his limitations and his -cure, rest for the moment on the same base. For, let me tell you, he -is known everywhere that men have been. In old Greece, in old Rome, -he flourish in Germany all over, in France, in India, even in the -Chermosese, and in China, so far from us in all ways, there even is -he, and the peoples for him at this day. He have follow the wake of -the berserker Icelander, the devil-begotten Hun, the Slav, the Saxon, -the Magyar. - -"So far, then, we have all we may act upon, and let me tell you that -very much of the beliefs are justified by what we have seen in our own -so unhappy experience. The vampire live on, and cannot die by mere -passing of the time, he can flourish when that he can fatten on the -blood of the living. Even more, we have seen amongst us that he can -even grow younger, that his vital faculties grow strenuous, and seem -as though they refresh themselves when his special pabulum is plenty. - -"But he cannot flourish without this diet, he eat not as others. Even -friend Jonathan, who lived with him for weeks, did never see him eat, -never! He throws no shadow, he make in the mirror no reflect, as -again Jonathan observe. He has the strength of many of his hand, -witness again Jonathan when he shut the door against the wolves, and -when he help him from the diligence too. He can transform himself to -wolf, as we gather from the ship arrival in Whitby, when he tear open -the dog, he can be as bat, as Madam Mina saw him on the window at -Whitby, and as friend John saw him fly from this so near house, and as -my friend Quincey saw him at the window of Miss Lucy. - -"He can come in mist which he create, that noble ship's captain proved -him of this, but, from what we know, the distance he can make this -mist is limited, and it can only be round himself. - -"He come on moonlight rays as elemental dust, as again Jonathan saw -those sisters in the castle of Dracula. He become so small, we -ourselves saw Miss Lucy, ere she was at peace, slip through a -hairbreadth space at the tomb door. He can, when once he find his -way, come out from anything or into anything, no matter how close it -be bound or even fused up with fire, solder you call it. He can see -in the dark, no small power this, in a world which is one half shut -from the light. Ah, but hear me through. - -"He can do all these things, yet he is not free. Nay, he is even more -prisoner than the slave of the galley, than the madman in his cell. -He cannot go where he lists, he who is not of nature has yet to obey -some of nature's laws, why we know not. He may not enter anywhere at -the first, unless there be some one of the household who bid him to -come, though afterwards he can come as he please. His power ceases, -as does that of all evil things, at the coming of the day. - -"Only at certain times can he have limited freedom. If he be not at -the place whither he is bound, he can only change himself at noon or -at exact sunrise or sunset. These things we are told, and in this -record of ours we have proof by inference. Thus, whereas he can do as -he will within his limit, when he have his earth-home, his -coffin-home, his hell-home, the place unhallowed, as we saw when he -went to the grave of the suicide at Whitby, still at other time he can -only change when the time come. It is said, too, that he can only -pass running water at the slack or the flood of the tide. Then there -are things which so afflict him that he has no power, as the garlic -that we know of, and as for things sacred, as this symbol, my -crucifix, that was amongst us even now when we resolve, to them he is -nothing, but in their presence he take his place far off and silent -with respect. There are others, too, which I shall tell you of, lest -in our seeking we may need them. - -"The branch of wild rose on his coffin keep him that he move not from -it, a sacred bullet fired into the coffin kill him so that he be true -dead, and as for the stake through him, we know already of its peace, -or the cut off head that giveth rest. We have seen it with our eyes. - -"Thus when we find the habitation of this man-that-was, we can confine -him to his coffin and destroy him, if we obey what we know. But he is -clever. I have asked my friend Arminius, of Buda-Pesth University, to -make his record, and from all the means that are, he tell me of what -he has been. He must, indeed, have been that Voivode Dracula who won -his name against the Turk, over the great river on the very frontier -of Turkeyland. If it be so, then was he no common man, for in that -time, and for centuries after, he was spoken of as the cleverest and -the most cunning, as well as the bravest of the sons of the 'land -beyond the forest.' That mighty brain and that iron resolution went -with him to his grave, and are even now arrayed against us. The -Draculas were, says Arminius, a great and noble race, though now and -again were scions who were held by their coevals to have had dealings -with the Evil One. They learned his secrets in the Scholomance, -amongst the mountains over Lake Hermanstadt, where the devil claims -the tenth scholar as his due. In the records are such words as -'stregoica' witch, 'ordog' and 'pokol' Satan and hell, and in one -manuscript this very Dracula is spoken of as 'wampyr,' which we all -understand too well. There have been from the loins of this very one -great men and good women, and their graves make sacred the earth where -alone this foulness can dwell. For it is not the least of its terrors -that this evil thing is rooted deep in all good, in soil barren of -holy memories it cannot rest." - -Whilst they were talking Mr. Morris was looking steadily at the -window, and he now got up quietly, and went out of the room. There -was a little pause, and then the Professor went on. - -"And now we must settle what we do. We have here much data, and we -must proceed to lay out our campaign. We know from the inquiry of -Jonathan that from the castle to Whitby came fifty boxes of earth, all -of which were delivered at Carfax, we also know that at least some of -these boxes have been removed. It seems to me, that our first step -should be to ascertain whether all the rest remain in the house beyond -that wall where we look today, or whether any more have been removed. -If the latter, we must trace . . ." - -Here we were interrupted in a very startling way. Outside the house -came the sound of a pistol shot, the glass of the window was shattered -with a bullet, which ricochetting from the top of the embrasure, -struck the far wall of the room. I am afraid I am at heart a coward, -for I shrieked out. The men all jumped to their feet, Lord Godalming -flew over to the window and threw up the sash. As he did so we heard -Mr. Morris' voice without, "Sorry! I fear I have alarmed you. I -shall come in and tell you about it." - -A minute later he came in and said, "It was an idiotic thing of me to -do, and I ask your pardon, Mrs. Harker, most sincerely, I fear I must -have frightened you terribly. But the fact is that whilst the -Professor was talking there came a big bat and sat on the window sill. -I have got such a horror of the damned brutes from recent events that -I cannot stand them, and I went out to have a shot, as I have been -doing of late of evenings, whenever I have seen one. You used to -laugh at me for it then, Art." - -"Did you hit it?" asked Dr. Van Helsing. - -"I don't know, I fancy not, for it flew away into the wood." Without -saying any more he took his seat, and the Professor began to resume -his statement. - -"We must trace each of these boxes, and when we are ready, we must -either capture or kill this monster in his lair, or we must, so to -speak, sterilize the earth, so that no more he can seek safety in it. -Thus in the end we may find him in his form of man between the hours -of noon and sunset, and so engage with him when he is at his most -weak. - -"And now for you, Madam Mina, this night is the end until all be well. -You are too precious to us to have such risk. When we part tonight, -you no more must question. We shall tell you all in good time. We -are men and are able to bear, but you must be our star and our hope, -and we shall act all the more free that you are not in the danger, -such as we are." - -All the men, even Jonathan, seemed relieved, but it did not seem to me -good that they should brave danger and, perhaps lessen their safety, -strength being the best safety, through care of me, but their minds -were made up, and though it was a bitter pill for me to swallow, I -could say nothing, save to accept their chivalrous care of me. - -Mr. Morris resumed the discussion, "As there is no time to lose, I -vote we have a look at his house right now. Time is everything with -him, and swift action on our part may save another victim." - -I own that my heart began to fail me when the time for action came so -close, but I did not say anything, for I had a greater fear that if I -appeared as a drag or a hindrance to their work, they might even leave -me out of their counsels altogether. They have now gone off to -Carfax, with means to get into the house. - -Manlike, they had told me to go to bed and sleep, as if a woman can -sleep when those she loves are in danger! I shall lie down, and -pretend to sleep, lest Jonathan have added anxiety about me when he -returns. - - - - -DR. SEWARD'S DIARY - -1 October, 4 A.M.--Just as we were about to leave the house, an urgent -message was brought to me from Renfield to know if I would see him at -once, as he had something of the utmost importance to say to me. I -told the messenger to say that I would attend to his wishes in the -morning, I was busy just at the moment. - -The attendant added, "He seems very importunate, sir. I have never -seen him so eager. I don't know but what, if you don't see him soon, -he will have one of his violent fits." I knew the man would not have -said this without some cause, so I said, "All right, I'll go now," and -I asked the others to wait a few minutes for me, as I had to go and -see my patient. - -"Take me with you, friend John," said the Professor. "His case in your -diary interest me much, and it had bearing, too, now and again on our -case. I should much like to see him, and especial when his mind is -disturbed." - -"May I come also?" asked Lord Godalming. - -"Me too?" said Quincey Morris. "May I come?" said Harker. I nodded, -and we all went down the passage together. - -We found him in a state of considerable excitement, but far more -rational in his speech and manner than I had ever seen him. There was -an unusual understanding of himself, which was unlike anything I had -ever met with in a lunatic, and he took it for granted that his -reasons would prevail with others entirely sane. We all five went -into the room, but none of the others at first said anything. His -request was that I would at once release him from the asylum and send -him home. This he backed up with arguments regarding his complete -recovery, and adduced his own existing sanity. - -"I appeal to your friends," he said, "they will, perhaps, not mind -sitting in judgement on my case. By the way, you have not introduced -me." - -I was so much astonished, that the oddness of introducing a madman in -an asylum did not strike me at the moment, and besides, there was a -certain dignity in the man's manner, so much of the habit of equality, -that I at once made the introduction, "Lord Godalming, Professor Van -Helsing, Mr. Quincey Morris, of Texas, Mr. Jonathan Harker, Mr. -Renfield." - -He shook hands with each of them, saying in turn, "Lord Godalming, I -had the honour of seconding your father at the Windham; I grieve to -know, by your holding the title, that he is no more. He was a man -loved and honoured by all who knew him, and in his youth was, I have -heard, the inventor of a burnt rum punch, much patronized on Derby -night. Mr. Morris, you should be proud of your great state. Its -reception into the Union was a precedent which may have far-reaching -effects hereafter, when the Pole and the Tropics may hold alliance to -the Stars and Stripes. The power of Treaty may yet prove a vast -engine of enlargement, when the Monroe doctrine takes its true place -as a political fable. What shall any man say of his pleasure at -meeting Van Helsing? Sir, I make no apology for dropping all forms of -conventional prefix. When an individual has revolutionized -therapeutics by his discovery of the continuous evolution of brain -matter, conventional forms are unfitting, since they would seem to -limit him to one of a class. You, gentlemen, who by nationality, by -heredity, or by the possession of natural gifts, are fitted to hold -your respective places in the moving world, I take to witness that I -am as sane as at least the majority of men who are in full possession -of their liberties. And I am sure that you, Dr. Seward, humanitarian -and medico-jurist as well as scientist, will deem it a moral duty to -deal with me as one to be considered as under exceptional -circumstances." He made this last appeal with a courtly air of -conviction which was not without its own charm. - -I think we were all staggered. For my own part, I was under the -conviction, despite my knowledge of the man's character and history, -that his reason had been restored, and I felt under a strong impulse -to tell him that I was satisfied as to his sanity, and would see about -the necessary formalities for his release in the morning. I thought -it better to wait, however, before making so grave a statement, for of -old I knew the sudden changes to which this particular patient was -liable. So I contented myself with making a general statement that he -appeared to be improving very rapidly, that I would have a longer chat -with him in the morning, and would then see what I could do in the -direction of meeting his wishes. - -This did not at all satisfy him, for he said quickly, "But I fear, Dr. -Seward, that you hardly apprehend my wish. I desire to go at once, -here, now, this very hour, this very moment, if I may. Time presses, -and in our implied agreement with the old scytheman it is of the -essence of the contract. I am sure it is only necessary to put before -so admirable a practitioner as Dr. Seward so simple, yet so momentous -a wish, to ensure its fulfilment." - -He looked at me keenly, and seeing the negative in my face, turned to -the others, and scrutinized them closely. Not meeting any sufficient -response, he went on, "Is it possible that I have erred in my -supposition?" - -"You have," I said frankly, but at the same time, as I felt, brutally. - -There was a considerable pause, and then he said slowly, "Then I -suppose I must only shift my ground of request. Let me ask for this -concession, boon, privilege, what you will. I am content to implore -in such a case, not on personal grounds, but for the sake of others. I -am not at liberty to give you the whole of my reasons, but you may, I -assure you, take it from me that they are good ones, sound and -unselfish, and spring from the highest sense of duty. - -"Could you look, sir, into my heart, you would approve to the full the -sentiments which animate me. Nay, more, you would count me amongst -the best and truest of your friends." - -Again he looked at us all keenly. I had a growing conviction that -this sudden change of his entire intellectual method was but yet -another phase of his madness, and so determined to let him go on a -little longer, knowing from experience that he would, like all -lunatics, give himself away in the end. Van Helsing was gazing at him -with a look of utmost intensity, his bushy eyebrows almost meeting -with the fixed concentration of his look. He said to Renfield in a -tone which did not surprise me at the time, but only when I thought of -it afterwards, for it was as of one addressing an equal, "Can you not -tell frankly your real reason for wishing to be free tonight? I will -undertake that if you will satisfy even me, a stranger, without -prejudice, and with the habit of keeping an open mind, Dr. Seward will -give you, at his own risk and on his own responsibility, the privilege -you seek." - -He shook his head sadly, and with a look of poignant regret on his -face. The Professor went on, "Come, sir, bethink yourself. You claim -the privilege of reason in the highest degree, since you seek to -impress us with your complete reasonableness. You do this, whose -sanity we have reason to doubt, since you are not yet released from -medical treatment for this very defect. If you will not help us in -our effort to choose the wisest course, how can we perform the duty -which you yourself put upon us? Be wise, and help us, and if we can -we shall aid you to achieve your wish." - -He still shook his head as he said, "Dr. Van Helsing, I have nothing to -say. Your argument is complete, and if I were free to speak I should -not hesitate a moment, but I am not my own master in the matter. I -can only ask you to trust me. If I am refused, the responsibility -does not rest with me." - -I thought it was now time to end the scene, which was becoming too -comically grave, so I went towards the door, simply saying, "Come, my -friends, we have work to do. Goodnight." - -As, however, I got near the door, a new change came over the patient. -He moved towards me so quickly that for the moment I feared that he -was about to make another homicidal attack. My fears, however, were -groundless, for he held up his two hands imploringly, and made his -petition in a moving manner. As he saw that the very excess of his -emotion was militating against him, by restoring us more to our old -relations, he became still more demonstrative. I glanced at Van -Helsing, and saw my conviction reflected in his eyes, so I became a -little more fixed in my manner, if not more stern, and motioned to him -that his efforts were unavailing. I had previously seen something of -the same constantly growing excitement in him when he had to make some -request of which at the time he had thought much, such for instance, -as when he wanted a cat, and I was prepared to see the collapse into -the same sullen acquiescence on this occasion. - -My expectation was not realized, for when he found that his appeal -would not be successful, he got into quite a frantic condition. He -threw himself on his knees, and held up his hands, wringing them in -plaintive supplication, and poured forth a torrent of entreaty, with -the tears rolling down his cheeks, and his whole face and form -expressive of the deepest emotion. - -"Let me entreat you, Dr. Seward, oh, let me implore you, to let me out -of this house at once. Send me away how you will and where you will, -send keepers with me with whips and chains, let them take me in a -strait waistcoat, manacled and leg-ironed, even to gaol, but let me go -out of this. You don't know what you do by keeping me here. I am -speaking from the depths of my heart, of my very soul. You don't know -whom you wrong, or how, and I may not tell. Woe is me! I may not -tell. By all you hold sacred, by all you hold dear, by your love that -is lost, by your hope that lives, for the sake of the Almighty, take -me out of this and save my soul from guilt! Can't you hear me, man? -Can't you understand? Will you never learn? Don't you know that I am -sane and earnest now, that I am no lunatic in a mad fit, but a sane -man fighting for his soul? Oh, hear me! Hear me! Let me go, let me -go, let me go!" - -I thought that the longer this went on the wilder he would get, and so -would bring on a fit, so I took him by the hand and raised him up. - -"Come," I said sternly, "no more of this, we have had quite enough -already. Get to your bed and try to behave more discreetly." - -He suddenly stopped and looked at me intently for several moments. -Then, without a word, he rose and moving over, sat down on the side of -the bed. The collapse had come, as on former occasions, just as I had -expected. - -When I was leaving the room, last of our party, he said to me in a -quiet, well-bred voice, "You will, I trust, Dr. Seward, do me the -justice to bear in mind, later on, that I did what I could to convince -you tonight." - - - - -CHAPTER 19 - - -JONATHAN HARKER'S JOURNAL - -1 October, 5 A.M.--I went with the party to the search with an easy -mind, for I think I never saw Mina so absolutely strong and well. I -am so glad that she consented to hold back and let us men do the work. -Somehow, it was a dread to me that she was in this fearful business at -all, but now that her work is done, and that it is due to her energy -and brains and foresight that the whole story is put together in such -a way that every point tells, she may well feel that her part is -finished, and that she can henceforth leave the rest to us. We were, -I think, all a little upset by the scene with Mr. Renfield. When we -came away from his room we were silent till we got back to the study. - -Then Mr. Morris said to Dr. Seward, "Say, Jack, if that man wasn't -attempting a bluff, he is about the sanest lunatic I ever saw. I'm -not sure, but I believe that he had some serious purpose, and if he -had, it was pretty rough on him not to get a chance." - -Lord Godalming and I were silent, but Dr. Van Helsing added, "Friend -John, you know more lunatics than I do, and I'm glad of it, for I fear -that if it had been to me to decide I would before that last -hysterical outburst have given him free. But we live and learn, and -in our present task we must take no chance, as my friend Quincey would -say. All is best as they are." - -Dr. Seward seemed to answer them both in a dreamy kind of way, "I -don't know but that I agree with you. If that man had been an -ordinary lunatic I would have taken my chance of trusting him, but he -seems so mixed up with the Count in an indexy kind of way that I am -afraid of doing anything wrong by helping his fads. I can't forget -how he prayed with almost equal fervor for a cat, and then tried to -tear my throat out with his teeth. Besides, he called the Count 'lord -and master', and he may want to get out to help him in some diabolical -way. That horrid thing has the wolves and the rats and his own kind -to help him, so I suppose he isn't above trying to use a respectable -lunatic. He certainly did seem earnest, though. I only hope we have -done what is best. These things, in conjunction with the wild work we -have in hand, help to unnerve a man." - -The Professor stepped over, and laying his hand on his shoulder, said -in his grave, kindly way, "Friend John, have no fear. We are trying -to do our duty in a very sad and terrible case, we can only do as we -deem best. What else have we to hope for, except the pity of the good -God?" - -Lord Godalming had slipped away for a few minutes, but now he -returned. He held up a little silver whistle as he remarked, "That -old place may be full of rats, and if so, I've got an antidote on -call." - -Having passed the wall, we took our way to the house, taking care to -keep in the shadows of the trees on the lawn when the moonlight shone -out. When we got to the porch the Professor opened his bag and took -out a lot of things, which he laid on the step, sorting them into four -little groups, evidently one for each. Then he spoke. - -"My friends, we are going into a terrible danger, and we need arms of -many kinds. Our enemy is not merely spiritual. Remember that he has -the strength of twenty men, and that, though our necks or our -windpipes are of the common kind, and therefore breakable or -crushable, his are not amenable to mere strength. A stronger man, or -a body of men more strong in all than him, can at certain times hold -him, but they cannot hurt him as we can be hurt by him. We must, -therefore, guard ourselves from his touch. Keep this near your -heart." As he spoke he lifted a little silver crucifix and held it -out to me, I being nearest to him, "put these flowers round your -neck," here he handed to me a wreath of withered garlic blossoms, "for -other enemies more mundane, this revolver and this knife, and for aid -in all, these so small electric lamps, which you can fasten to your -breast, and for all, and above all at the last, this, which we must -not desecrate needless." - -This was a portion of Sacred Wafer, which he put in an envelope and -handed to me. Each of the others was similarly equipped. - -"Now," he said, "friend John, where are the skeleton keys? If so that -we can open the door, we need not break house by the window, as before -at Miss Lucy's." - -Dr. Seward tried one or two skeleton keys, his mechanical dexterity as -a surgeon standing him in good stead. Presently he got one to suit, -after a little play back and forward the bolt yielded, and with a -rusty clang, shot back. We pressed on the door, the rusty hinges -creaked, and it slowly opened. It was startlingly like the image -conveyed to me in Dr. Seward's diary of the opening of Miss Westenra's -tomb, I fancy that the same idea seemed to strike the others, for with -one accord they shrank back. The Professor was the first to move -forward, and stepped into the open door. - -"In manus tuas, Domine!" he said, crossing himself as he passed over -the threshold. We closed the door behind us, lest when we should have -lit our lamps we should possibly attract attention from the road. The -Professor carefully tried the lock, lest we might not be able to open -it from within should we be in a hurry making our exit. Then we all -lit our lamps and proceeded on our search. - -The light from the tiny lamps fell in all sorts of odd forms, as the -rays crossed each other, or the opacity of our bodies threw great -shadows. I could not for my life get away from the feeling that there -was someone else amongst us. I suppose it was the recollection, so -powerfully brought home to me by the grim surroundings, of that -terrible experience in Transylvania. I think the feeling was common -to us all, for I noticed that the others kept looking over their -shoulders at every sound and every new shadow, just as I felt myself -doing. - -The whole place was thick with dust. The floor was seemingly inches -deep, except where there were recent footsteps, in which on holding -down my lamp I could see marks of hobnails where the dust was cracked. -The walls were fluffy and heavy with dust, and in the corners were -masses of spider's webs, whereon the dust had gathered till they -looked like old tattered rags as the weight had torn them partly down. -On a table in the hall was a great bunch of keys, with a time-yellowed -label on each. They had been used several times, for on the table -were several similar rents in the blanket of dust, similar to that -exposed when the Professor lifted them. - -He turned to me and said, "You know this place, Jonathan. You have -copied maps of it, and you know it at least more than we do. Which is -the way to the chapel?" - -I had an idea of its direction, though on my former visit I had not -been able to get admission to it, so I led the way, and after a few -wrong turnings found myself opposite a low, arched oaken door, ribbed -with iron bands. - -"This is the spot," said the Professor as he turned his lamp on a -small map of the house, copied from the file of my original -correspondence regarding the purchase. With a little trouble we found -the key on the bunch and opened the door. We were prepared for some -unpleasantness, for as we were opening the door a faint, malodorous -air seemed to exhale through the gaps, but none of us ever expected -such an odour as we encountered. None of the others had met the Count -at all at close quarters, and when I had seen him he was either in the -fasting stage of his existence in his rooms or, when he was bloated -with fresh blood, in a ruined building open to the air, but here the -place was small and close, and the long disuse had made the air -stagnant and foul. There was an earthy smell, as of some dry miasma, -which came through the fouler air. But as to the odour itself, how -shall I describe it? It was not alone that it was composed of all the -ills of mortality and with the pungent, acrid smell of blood, but it -seemed as though corruption had become itself corrupt. Faugh! It -sickens me to think of it. Every breath exhaled by that monster -seemed to have clung to the place and intensified its loathsomeness. - -Under ordinary circumstances such a stench would have brought our -enterprise to an end, but this was no ordinary case, and the high and -terrible purpose in which we were involved gave us a strength which -rose above merely physical considerations. After the involuntary -shrinking consequent on the first nauseous whiff, we one and all set -about our work as though that loathsome place were a garden of roses. - -We made an accurate examination of the place, the Professor saying as -we began, "The first thing is to see how many of the boxes are left, -we must then examine every hole and corner and cranny and see if we -cannot get some clue as to what has become of the rest." - -A glance was sufficient to show how many remained, for the great earth -chests were bulky, and there was no mistaking them. - -There were only twenty-nine left out of the fifty! Once I got a -fright, for, seeing Lord Godalming suddenly turn and look out of the -vaulted door into the dark passage beyond, I looked too, and for an -instant my heart stood still. Somewhere, looking out from the shadow, -I seemed to see the high lights of the Count's evil face, the ridge of -the nose, the red eyes, the red lips, the awful pallor. It was only -for a moment, for, as Lord Godalming said, "I thought I saw a face, -but it was only the shadows," and resumed his inquiry, I turned my -lamp in the direction, and stepped into the passage. There was no -sign of anyone, and as there were no corners, no doors, no aperture of -any kind, but only the solid walls of the passage, there could be no -hiding place even for him. I took it that fear had helped -imagination, and said nothing. - -A few minutes later I saw Morris step suddenly back from a corner, -which he was examining. We all followed his movements with our eyes, -for undoubtedly some nervousness was growing on us, and we saw a whole -mass of phosphorescence, which twinkled like stars. We all -instinctively drew back. The whole place was becoming alive with -rats. - -For a moment or two we stood appalled, all save Lord Godalming, who -was seemingly prepared for such an emergency. Rushing over to the -great iron-bound oaken door, which Dr. Seward had described from the -outside, and which I had seen myself, he turned the key in the lock, -drew the huge bolts, and swung the door open. Then, taking his little -silver whistle from his pocket, he blew a low, shrill call. It was -answered from behind Dr. Seward's house by the yelping of dogs, and -after about a minute three terriers came dashing round the corner of -the house. Unconsciously we had all moved towards the door, and as we -moved I noticed that the dust had been much disturbed. The boxes -which had been taken out had been brought this way. But even in the -minute that had elapsed the number of the rats had vastly increased. -They seemed to swarm over the place all at once, till the lamplight, -shining on their moving dark bodies and glittering, baleful eyes, made -the place look like a bank of earth set with fireflies. The dogs -dashed on, but at the threshold suddenly stopped and snarled, and -then, simultaneously lifting their noses, began to howl in most -lugubrious fashion. The rats were multiplying in thousands, and we -moved out. - -Lord Godalming lifted one of the dogs, and carrying him in, placed him -on the floor. The instant his feet touched the ground he seemed to -recover his courage, and rushed at his natural enemies. They fled -before him so fast that before he had shaken the life out of a score, -the other dogs, who had by now been lifted in the same manner, had but -small prey ere the whole mass had vanished. - -With their going it seemed as if some evil presence had departed, for -the dogs frisked about and barked merrily as they made sudden darts at -their prostrate foes, and turned them over and over and tossed them in -the air with vicious shakes. We all seemed to find our spirits rise. -Whether it was the purifying of the deadly atmosphere by the opening -of the chapel door, or the relief which we experienced by finding -ourselves in the open I know not, but most certainly the shadow of -dread seemed to slip from us like a robe, and the occasion of our -coming lost something of its grim significance, though we did not -slacken a whit in our resolution. We closed the outer door and barred -and locked it, and bringing the dogs with us, began our search of the -house. We found nothing throughout except dust in extraordinary -proportions, and all untouched save for my own footsteps when I had -made my first visit. Never once did the dogs exhibit any symptom of -uneasiness, and even when we returned to the chapel they frisked about -as though they had been rabbit hunting in a summer wood. - -The morning was quickening in the east when we emerged from the front. -Dr. Van Helsing had taken the key of the hall door from the bunch, and -locked the door in orthodox fashion, putting the key into his pocket -when he had done. - -"So far," he said, "our night has been eminently successful. No harm -has come to us such as I feared might be and yet we have ascertained -how many boxes are missing. More than all do I rejoice that this, our -first, and perhaps our most difficult and dangerous, step has been -accomplished without the bringing thereinto our most sweet Madam Mina -or troubling her waking or sleeping thoughts with sights and sounds -and smells of horror which she might never forget. One lesson, too, -we have learned, if it be allowable to argue a particulari, that the -brute beasts which are to the Count's command are yet themselves not -amenable to his spiritual power, for look, these rats that would come -to his call, just as from his castle top he summon the wolves to your -going and to that poor mother's cry, though they come to him, they run -pell-mell from the so little dogs of my friend Arthur. We have other -matters before us, other dangers, other fears, and that monster . . . -He has not used his power over the brute world for the only or the -last time tonight. So be it that he has gone elsewhere. Good! It -has given us opportunity to cry 'check' in some ways in this chess -game, which we play for the stake of human souls. And now let us go -home. The dawn is close at hand, and we have reason to be content -with our first night's work. It may be ordained that we have many -nights and days to follow, if full of peril, but we must go on, and -from no danger shall we shrink." - -The house was silent when we got back, save for some poor creature who -was screaming away in one of the distant wards, and a low, moaning -sound from Renfield's room. The poor wretch was doubtless torturing -himself, after the manner of the insane, with needless thoughts of -pain. - -I came tiptoe into our own room, and found Mina asleep, breathing so -softly that I had to put my ear down to hear it. She looks paler than -usual. I hope the meeting tonight has not upset her. I am truly -thankful that she is to be left out of our future work, and even of -our deliberations. It is too great a strain for a woman to bear. I -did not think so at first, but I know better now. Therefore I am glad -that it is settled. There may be things which would frighten her to -hear, and yet to conceal them from her might be worse than to tell her -if once she suspected that there was any concealment. Henceforth our -work is to be a sealed book to her, till at least such time as we can -tell her that all is finished, and the earth free from a monster of -the nether world. I daresay it will be difficult to begin to keep -silence after such confidence as ours, but I must be resolute, and -tomorrow I shall keep dark over tonight's doings, and shall refuse to -speak of anything that has happened. I rest on the sofa, so as not to -disturb her. - - -1 October, later.--I suppose it was natural that we should have all -overslept ourselves, for the day was a busy one, and the night had no -rest at all. Even Mina must have felt its exhaustion, for though I -slept till the sun was high, I was awake before her, and had to call -two or three times before she awoke. Indeed, she was so sound asleep -that for a few seconds she did not recognize me, but looked at me with -a sort of blank terror, as one looks who has been waked out of a bad -dream. She complained a little of being tired, and I let her rest -till later in the day. We now know of twenty-one boxes having been -removed, and if it be that several were taken in any of these removals -we may be able to trace them all. Such will, of course, immensely -simplify our labor, and the sooner the matter is attended to the -better. I shall look up Thomas Snelling today. - - - -DR. SEWARD'S DIARY - -1 October.--It was towards noon when I was awakened by the Professor -walking into my room. He was more jolly and cheerful than usual, and -it is quite evident that last night's work has helped to take some of -the brooding weight off his mind. - -After going over the adventure of the night he suddenly said, "Your -patient interests me much. May it be that with you I visit him this -morning? Or if that you are too occupy, I can go alone if it may be. -It is a new experience to me to find a lunatic who talk philosophy, -and reason so sound." - -I had some work to do which pressed, so I told him that if he would go -alone I would be glad, as then I should not have to keep him waiting, -so I called an attendant and gave him the necessary instructions. -Before the Professor left the room I cautioned him against getting any -false impression from my patient. - -"But," he answered, "I want him to talk of himself and of his delusion -as to consuming live things. He said to Madam Mina, as I see in your -diary of yesterday, that he had once had such a belief. Why do you -smile, friend John?" - -"Excuse me," I said, "but the answer is here." I laid my hand on the -typewritten matter. "When our sane and learned lunatic made that very -statement of how he used to consume life, his mouth was actually -nauseous with the flies and spiders which he had eaten just before -Mrs. Harker entered the room." - -Van Helsing smiled in turn. "Good!" he said. "Your memory is true, -friend John. I should have remembered. And yet it is this very -obliquity of thought and memory which makes mental disease such a -fascinating study. Perhaps I may gain more knowledge out of the folly -of this madman than I shall from the teaching of the most wise. Who -knows?" - -I went on with my work, and before long was through that in hand. It -seemed that the time had been very short indeed, but there was Van -Helsing back in the study. - -"Do I interrupt?" he asked politely as he stood at the door. - -"Not at all," I answered. "Come in. My work is finished, and I am -free. I can go with you now, if you like." - -"It is needless, I have seen him!" - -"Well?" - -"I fear that he does not appraise me at much. Our interview was -short. When I entered his room he was sitting on a stool in the -centre, with his elbows on his knees, and his face was the picture of -sullen discontent. I spoke to him as cheerfully as I could, and with -such a measure of respect as I could assume. He made no reply -whatever. 'Don't you know me?' I asked. His answer was not -reassuring: 'I know you well enough; you are the old fool Van -Helsing. I wish you would take yourself and your idiotic brain -theories somewhere else. Damn all thick-headed Dutchmen!' Not a word -more would he say, but sat in his implacable sullenness as indifferent -to me as though I had not been in the room at all. Thus departed for -this time my chance of much learning from this so clever lunatic, so I -shall go, if I may, and cheer myself with a few happy words with that -sweet soul Madam Mina. Friend John, it does rejoice me unspeakable -that she is no more to be pained, no more to be worried with our -terrible things. Though we shall much miss her help, it is better -so." - -"I agree with you with all my heart," I answered earnestly, for I did -not want him to weaken in this matter. "Mrs. Harker is better out of -it. Things are quite bad enough for us, all men of the world, and who -have been in many tight places in our time, but it is no place for a -woman, and if she had remained in touch with the affair, it would in -time infallibly have wrecked her." - -So Van Helsing has gone to confer with Mrs. Harker and Harker, Quincey -and Art are all out following up the clues as to the earth boxes. I -shall finish my round of work and we shall meet tonight. - - - - - -MINA HARKER'S JOURNAL - -1 October.--It is strange to me to be kept in the dark as I am today, -after Jonathan's full confidence for so many years, to see him -manifestly avoid certain matters, and those the most vital of all. -This morning I slept late after the fatigues of yesterday, and though -Jonathan was late too, he was the earlier. He spoke to me before he -went out, never more sweetly or tenderly, but he never mentioned a -word of what had happened in the visit to the Count's house. And yet -he must have known how terribly anxious I was. Poor dear fellow! I -suppose it must have distressed him even more than it did me. They -all agreed that it was best that I should not be drawn further into -this awful work, and I acquiesced. But to think that he keeps -anything from me! And now I am crying like a silly fool, when I know -it comes from my husband's great love and from the good, good wishes -of those other strong men. - -That has done me good. Well, some day Jonathan will tell me all. And -lest it should ever be that he should think for a moment that I kept -anything from him, I still keep my journal as usual. Then if he has -feared of my trust I shall show it to him, with every thought of my -heart put down for his dear eyes to read. I feel strangely sad and -low-spirited today. I suppose it is the reaction from the terrible -excitement. - -Last night I went to bed when the men had gone, simply because they -told me to. I didn't feel sleepy, and I did feel full of devouring -anxiety. I kept thinking over everything that has been ever since -Jonathan came to see me in London, and it all seems like a horrible -tragedy, with fate pressing on relentlessly to some destined end. -Everything that one does seems, no matter how right it may be, to bring -on the very thing which is most to be deplored. If I hadn't gone to -Whitby, perhaps poor dear Lucy would be with us now. She hadn't taken -to visiting the churchyard till I came, and if she hadn't come there -in the day time with me she wouldn't have walked in her sleep. And if -she hadn't gone there at night and asleep, that monster couldn't have -destroyed her as he did. Oh, why did I ever go to Whitby? There now, -crying again! I wonder what has come over me today. I must hide it -from Jonathan, for if he knew that I had been crying twice in one -morning . . . I, who never cried on my own account, and whom he has -never caused to shed a tear, the dear fellow would fret his heart out. -I shall put a bold face on, and if I do feel weepy, he shall never see -it. I suppose it is just one of the lessons that we poor women have -to learn . . . - -I can't quite remember how I fell asleep last night. I remember -hearing the sudden barking of the dogs and a lot of queer sounds, like -praying on a very tumultuous scale, from Mr. Renfield's room, which is -somewhere under this. And then there was silence over everything, -silence so profound that it startled me, and I got up and looked out -of the window. All was dark and silent, the black shadows thrown by -the moonlight seeming full of a silent mystery of their own. Not a -thing seemed to be stirring, but all to be grim and fixed as death or -fate, so that a thin streak of white mist, that crept with almost -imperceptible slowness across the grass towards the house, seemed to -have a sentience and a vitality of its own. I think that the -digression of my thoughts must have done me good, for when I got back -to bed I found a lethargy creeping over me. I lay a while, but could -not quite sleep, so I got out and looked out of the window again. The -mist was spreading, and was now close up to the house, so that I could -see it lying thick against the wall, as though it were stealing up to -the windows. The poor man was more loud than ever, and though I could -not distinguish a word he said, I could in some way recognize in his -tones some passionate entreaty on his part. Then there was the sound -of a struggle, and I knew that the attendants were dealing with him. -I was so frightened that I crept into bed, and pulled the clothes over -my head, putting my fingers in my ears. I was not then a bit sleepy, -at least so I thought, but I must have fallen asleep, for except -dreams, I do not remember anything until the morning, when Jonathan -woke me. I think that it took me an effort and a little time to -realize where I was, and that it was Jonathan who was bending over me. -My dream was very peculiar, and was almost typical of the way that -waking thoughts become merged in, or continued in, dreams. - -I thought that I was asleep, and waiting for Jonathan to come back. I -was very anxious about him, and I was powerless to act, my feet, and -my hands, and my brain were weighted, so that nothing could proceed at -the usual pace. And so I slept uneasily and thought. Then it began -to dawn upon me that the air was heavy, and dank, and cold. I put -back the clothes from my face, and found, to my surprise, that all was -dim around. The gaslight which I had left lit for Jonathan, but -turned down, came only like a tiny red spark through the fog, which -had evidently grown thicker and poured into the room. Then it -occurred to me that I had shut the window before I had come to bed. I -would have got out to make certain on the point, but some leaden -lethargy seemed to chain my limbs and even my will. I lay still and -endured, that was all. I closed my eyes, but could still see through -my eyelids. (It is wonderful what tricks our dreams play us, and how -conveniently we can imagine.) The mist grew thicker and thicker and I -could see now how it came in, for I could see it like smoke, or with -the white energy of boiling water, pouring in, not through the window, -but through the joinings of the door. It got thicker and thicker, -till it seemed as if it became concentrated into a sort of pillar of -cloud in the room, through the top of which I could see the light of -the gas shining like a red eye. Things began to whirl through my -brain just as the cloudy column was now whirling in the room, and -through it all came the scriptural words "a pillar of cloud by day and -of fire by night." Was it indeed such spiritual guidance that was -coming to me in my sleep? But the pillar was composed of both the day -and the night guiding, for the fire was in the red eye, which at the -thought got a new fascination for me, till, as I looked, the fire -divided, and seemed to shine on me through the fog like two red eyes, -such as Lucy told me of in her momentary mental wandering when, on the -cliff, the dying sunlight struck the windows of St. Mary's Church. -Suddenly the horror burst upon me that it was thus that Jonathan had -seen those awful women growing into reality through the whirling mist -in the moonlight, and in my dream I must have fainted, for all became -black darkness. The last conscious effort which imagination made was -to show me a livid white face bending over me out of the mist. - -I must be careful of such dreams, for they would unseat one's reason if -there were too much of them. I would get Dr. Van Helsing or Dr. -Seward to prescribe something for me which would make me sleep, only -that I fear to alarm them. Such a dream at the present time would -become woven into their fears for me. Tonight I shall strive hard to -sleep naturally. If I do not, I shall tomorrow night get them to give -me a dose of chloral, that cannot hurt me for once, and it will give -me a good night's sleep. Last night tired me more than if I had not -slept at all. - - -2 October 10 P.M.--Last night I slept, but did not dream. I must have -slept soundly, for I was not waked by Jonathan coming to bed, but the -sleep has not refreshed me, for today I feel terribly weak and -spiritless. I spent all yesterday trying to read, or lying down -dozing. In the afternoon, Mr. Renfield asked if he might see me. Poor -man, he was very gentle, and when I came away he kissed my hand and -bade God bless me. Some way it affected me much. I am crying when I -think of him. This is a new weakness, of which I must be careful. -Jonathan would be miserable if he knew I had been crying. He and the -others were out till dinner time, and they all came in tired. I did -what I could to brighten them up, and I suppose that the effort did me -good, for I forgot how tired I was. After dinner they sent me to bed, -and all went off to smoke together, as they said, but I knew that they -wanted to tell each other of what had occurred to each during the day. -I could see from Jonathan's manner that he had something important to -communicate. I was not so sleepy as I should have been, so before -they went I asked Dr. Seward to give me a little opiate of some kind, -as I had not slept well the night before. He very kindly made me up a -sleeping draught, which he gave to me, telling me that it would do me -no harm, as it was very mild . . . I have taken it, and am waiting for -sleep, which still keeps aloof. I hope I have not done wrong, for as -sleep begins to flirt with me, a new fear comes: that I may have been -foolish in thus depriving myself of the power of waking. I might want -it. Here comes sleep. Goodnight. - - - - -CHAPTER 20 - - -JONATHAN HARKER'S JOURNAL - -1 October, evening.--I found Thomas Snelling in his house at Bethnal -Green, but unhappily he was not in a condition to remember anything. -The very prospect of beer which my expected coming had opened to him -had proved too much, and he had begun too early on his expected -debauch. I learned, however, from his wife, who seemed a decent, poor -soul, that he was only the assistant of Smollet, who of the two mates -was the responsible person. So off I drove to Walworth, and found Mr. -Joseph Smollet at home and in his shirtsleeves, taking a late tea out -of a saucer. He is a decent, intelligent fellow, distinctly a good, -reliable type of workman, and with a headpiece of his own. He -remembered all about the incident of the boxes, and from a wonderful -dog-eared notebook, which he produced from some mysterious receptacle -about the seat of his trousers, and which had hieroglyphical entries -in thick, half-obliterated pencil, he gave me the destinations of the -boxes. There were, he said, six in the cartload which he took from -Carfax and left at 197 Chicksand Street, Mile End New Town, and -another six which he deposited at Jamaica Lane, Bermondsey. If then -the Count meant to scatter these ghastly refuges of his over London, -these places were chosen as the first of delivery, so that later he -might distribute more fully. The systematic manner in which this was -done made me think that he could not mean to confine himself to two -sides of London. He was now fixed on the far east on the northern -shore, on the east of the southern shore, and on the south. The north -and west were surely never meant to be left out of his diabolical -scheme, let alone the City itself and the very heart of fashionable -London in the south-west and west. I went back to Smollet, and asked -him if he could tell us if any other boxes had been taken from Carfax. - -He replied, "Well guv'nor, you've treated me very 'an'some", I had -given him half a sovereign, "an I'll tell yer all I know. I heard a -man by the name of Bloxam say four nights ago in the 'Are an' 'Ounds, -in Pincher's Alley, as 'ow he an' his mate 'ad 'ad a rare dusty job in -a old 'ouse at Purfleet. There ain't a many such jobs as this 'ere, -an' I'm thinkin' that maybe Sam Bloxam could tell ye summut." - -I asked if he could tell me where to find him. I told him that if he -could get me the address it would be worth another half sovereign to -him. So he gulped down the rest of his tea and stood up, saying that -he was going to begin the search then and there. - -At the door he stopped, and said, "Look 'ere, guv'nor, there ain't no -sense in me a keepin' you 'ere. I may find Sam soon, or I mayn't, but -anyhow he ain't like to be in a way to tell ye much tonight. Sam is a -rare one when he starts on the booze. If you can give me a envelope -with a stamp on it, and put yer address on it, I'll find out where Sam -is to be found and post it ye tonight. But ye'd better be up arter -'im soon in the mornin', never mind the booze the night afore." - -This was all practical, so one of the children went off with a penny -to buy an envelope and a sheet of paper, and to keep the change. When -she came back, I addressed the envelope and stamped it, and when -Smollet had again faithfully promised to post the address when found, -I took my way to home. We're on the track anyhow. I am tired -tonight, and I want to sleep. Mina is fast asleep, and looks a little -too pale. Her eyes look as though she had been crying. Poor dear, -I've no doubt it frets her to be kept in the dark, and it may make her -doubly anxious about me and the others. But it is best as it is. It -is better to be disappointed and worried in such a way now than to -have her nerve broken. The doctors were quite right to insist on her -being kept out of this dreadful business. I must be firm, for on me -this particular burden of silence must rest. I shall not ever enter -on the subject with her under any circumstances. Indeed, It may not -be a hard task, after all, for she herself has become reticent on the -subject, and has not spoken of the Count or his doings ever since we -told her of our decision. - - -2 October, evening--A long and trying and exciting day. By the first -post I got my directed envelope with a dirty scrap of paper enclosed, -on which was written with a carpenter's pencil in a sprawling hand, -"Sam Bloxam, Korkrans, 4 Poters Cort, Bartel Street, Walworth. Arsk -for the depite." - -I got the letter in bed, and rose without waking Mina. She looked -heavy and sleepy and pale, and far from well. I determined not to -wake her, but that when I should return from this new search, I would -arrange for her going back to Exeter. I think she would be happier in -our own home, with her daily tasks to interest her, than in being here -amongst us and in ignorance. I only saw Dr. Seward for a moment, and -told him where I was off to, promising to come back and tell the rest -so soon as I should have found out anything. I drove to Walworth and -found, with some difficulty, Potter's Court. Mr. Smollet's spelling -misled me, as I asked for Poter's Court instead of Potter's Court. -However, when I had found the court, I had no difficulty in -discovering Corcoran's lodging house. - -When I asked the man who came to the door for the "depite," he shook -his head, and said, "I dunno 'im. There ain't no such a person 'ere. -I never 'eard of 'im in all my bloomin' days. Don't believe there -ain't nobody of that kind livin' 'ere or anywheres." - -I took out Smollet's letter, and as I read it it seemed to me that the -lesson of the spelling of the name of the court might guide me. "What -are you?" I asked. - -"I'm the depity," he answered. - -I saw at once that I was on the right track. Phonetic spelling had -again misled me. A half crown tip put the deputy's knowledge at my -disposal, and I learned that Mr. Bloxam, who had slept off the remains -of his beer on the previous night at Corcoran's, had left for his work -at Poplar at five o'clock that morning. He could not tell me where -the place of work was situated, but he had a vague idea that it was -some kind of a "new-fangled ware'us," and with this slender clue I had -to start for Poplar. It was twelve o'clock before I got any -satisfactory hint of such a building, and this I got at a coffee shop, -where some workmen were having their dinner. One of them suggested -that there was being erected at Cross Angel Street a new "cold -storage" building, and as this suited the condition of a "new-fangled -ware'us," I at once drove to it. An interview with a surly gatekeeper -and a surlier foreman, both of whom were appeased with the coin of the -realm, put me on the track of Bloxam. He was sent for on my -suggestion that I was willing to pay his days wages to his foreman for -the privilege of asking him a few questions on a private matter. He -was a smart enough fellow, though rough of speech and bearing. When I -had promised to pay for his information and given him an earnest, he -told me that he had made two journeys between Carfax and a house in -Piccadilly, and had taken from this house to the latter nine great -boxes, "main heavy ones," with a horse and cart hired by him for this -purpose. - -I asked him if he could tell me the number of the house in Piccadilly, -to which he replied, "Well, guv'nor, I forgits the number, but it was -only a few door from a big white church, or somethink of the kind, not -long built. It was a dusty old 'ouse, too, though nothin' to the -dustiness of the 'ouse we tooked the bloomin' boxes from." - -"How did you get in if both houses were empty?" - -"There was the old party what engaged me a waitin' in the 'ouse at -Purfleet. He 'elped me to lift the boxes and put them in the dray. -Curse me, but he was the strongest chap I ever struck, an' him a old -feller, with a white moustache, one that thin you would think he -couldn't throw a shadder." - -How this phrase thrilled through me! - -"Why, 'e took up 'is end o' the boxes like they was pounds of tea, and -me a puffin' an' a blowin' afore I could upend mine anyhow, an' I'm no -chicken, neither." - -"How did you get into the house in Piccadilly?" I asked. - -"He was there too. He must 'a started off and got there afore me, for -when I rung of the bell he kem an' opened the door 'isself an' 'elped -me carry the boxes into the 'all." - -"The whole nine?" I asked. - -"Yus, there was five in the first load an' four in the second. It was -main dry work, an' I don't so well remember 'ow I got 'ome." - -I interrupted him, "Were the boxes left in the hall?" - -"Yus, it was a big 'all, an' there was nothin' else in it." - -I made one more attempt to further matters. "You didn't have any -key?" - -"Never used no key nor nothink. The old gent, he opened the door -'isself an' shut it again when I druv off. I don't remember the last -time, but that was the beer." - -"And you can't remember the number of the house?" - -"No, sir. But ye needn't have no difficulty about that. It's a 'igh -'un with a stone front with a bow on it, an' 'igh steps up to the -door. I know them steps, 'avin' 'ad to carry the boxes up with three -loafers what come round to earn a copper. The old gent give them -shillin's, an' they seein' they got so much, they wanted more. But 'e -took one of them by the shoulder and was like to throw 'im down the -steps, till the lot of them went away cussin'." - -I thought that with this description I could find the house, so having -paid my friend for his information, I started off for Piccadilly. I -had gained a new painful experience. The Count could, it was evident, -handle the earth boxes himself. If so, time was precious, for now -that he had achieved a certain amount of distribution, he could, by -choosing his own time, complete the task unobserved. At Piccadilly -Circus I discharged my cab, and walked westward. Beyond the Junior -Constitutional I came across the house described and was satisfied -that this was the next of the lairs arranged by Dracula. The house -looked as though it had been long untenanted. The windows were -encrusted with dust, and the shutters were up. All the framework was -black with time, and from the iron the paint had mostly scaled away. -It was evident that up to lately there had been a large notice board -in front of the balcony. It had, however, been roughly torn away, the -uprights which had supported it still remaining. Behind the rails of -the balcony I saw there were some loose boards, whose raw edges looked -white. I would have given a good deal to have been able to see the -notice board intact, as it would, perhaps, have given some clue to the -ownership of the house. I remembered my experience of the investigation -and purchase of Carfax, and I could not but feel that if I could find -the former owner there might be some means discovered of gaining access -to the house. - -There was at present nothing to be learned from the Piccadilly side, -and nothing could be done, so I went around to the back to see if -anything could be gathered from this quarter. The mews were active, -the Piccadilly houses being mostly in occupation. I asked one or two -of the grooms and helpers whom I saw around if they could tell me -anything about the empty house. One of them said that he heard it had -lately been taken, but he couldn't say from whom. He told me, -however, that up to very lately there had been a notice board of "For -Sale" up, and that perhaps Mitchell, Sons, & Candy the house agents -could tell me something, as he thought he remembered seeing the name -of that firm on the board. I did not wish to seem too eager, or to -let my informant know or guess too much, so thanking him in the usual -manner, I strolled away. It was now growing dusk, and the autumn -night was closing in, so I did not lose any time. Having learned the -address of Mitchell, Sons, & Candy from a directory at the Berkeley, I -was soon at their office in Sackville Street. - -The gentleman who saw me was particularly suave in manner, but -uncommunicative in equal proportion. Having once told me that the -Piccadilly house, which throughout our interview he called a -"mansion," was sold, he considered my business as concluded. When I -asked who had purchased it, he opened his eyes a thought wider, and -paused a few seconds before replying, "It is sold, sir." - -"Pardon me," I said, with equal politeness, "but I have a special -reason for wishing to know who purchased it." - -Again he paused longer, and raised his eyebrows still more. "It is -sold, sir," was again his laconic reply. - -"Surely," I said, "you do not mind letting me know so much." - -"But I do mind," he answered. "The affairs of their clients are -absolutely safe in the hands of Mitchell, Sons, & Candy." - -This was manifestly a prig of the first water, and there was no use -arguing with him. I thought I had best meet him on his own ground, so -I said, "Your clients, sir, are happy in having so resolute a guardian -of their confidence. I am myself a professional man." - -Here I handed him my card. "In this instance I am not prompted by -curiosity, I act on the part of Lord Godalming, who wishes to know -something of the property which was, he understood, lately for sale." - -These words put a different complexion on affairs. He said, "I would -like to oblige you if I could, Mr. Harker, and especially would I like -to oblige his lordship. We once carried out a small matter of renting -some chambers for him when he was the honourable Arthur Holmwood. If -you will let me have his lordship's address I will consult the House -on the subject, and will, in any case, communicate with his lordship -by tonight's post. It will be a pleasure if we can so far deviate -from our rules as to give the required information to his lordship." - -I wanted to secure a friend, and not to make an enemy, so I thanked -him, gave the address at Dr. Seward's and came away. It was now dark, -and I was tired and hungry. I got a cup of tea at the Aerated Bread -Company and came down to Purfleet by the next train. - -I found all the others at home. Mina was looking tired and pale, but -she made a gallant effort to be bright and cheerful. It wrung my -heart to think that I had had to keep anything from her and so caused -her inquietude. Thank God, this will be the last night of her looking -on at our conferences, and feeling the sting of our not showing our -confidence. It took all my courage to hold to the wise resolution of -keeping her out of our grim task. She seems somehow more reconciled, -or else the very subject seems to have become repugnant to her, for -when any accidental allusion is made she actually shudders. I am glad -we made our resolution in time, as with such a feeling as this, our -growing knowledge would be torture to her. - -I could not tell the others of the day's discovery till we were alone, -so after dinner, followed by a little music to save appearances even -amongst ourselves, I took Mina to her room and left her to go to bed. -The dear girl was more affectionate with me than ever, and clung to me -as though she would detain me, but there was much to be talked of and -I came away. Thank God, the ceasing of telling things has made no -difference between us. - -When I came down again I found the others all gathered round the fire -in the study. In the train I had written my diary so far, and simply -read it off to them as the best means of letting them get abreast of -my own information. - -When I had finished Van Helsing said, "This has been a great day's -work, friend Jonathan. Doubtless we are on the track of the missing -boxes. If we find them all in that house, then our work is near the -end. But if there be some missing, we must search until we find them. -Then shall we make our final coup, and hunt the wretch to his real -death." - -We all sat silent awhile and all at once Mr. Morris spoke, "Say! How -are we going to get into that house?" - -"We got into the other," answered Lord Godalming quickly. - -"But, Art, this is different. We broke house at Carfax, but we had -night and a walled park to protect us. It will be a mighty different -thing to commit burglary in Piccadilly, either by day or night. I -confess I don't see how we are going to get in unless that agency duck -can find us a key of some sort." - -Lord Godalming's brows contracted, and he stood up and walked about the -room. By-and-by he stopped and said, turning from one to another of -us, "Quincey's head is level. This burglary business is getting -serious. We got off once all right, but we have now a rare job on -hand. Unless we can find the Count's key basket." - -As nothing could well be done before morning, and as it would be at -least advisable to wait till Lord Godalming should hear from -Mitchell's, we decided not to take any active step before breakfast -time. For a good while we sat and smoked, discussing the matter in -its various lights and bearings. I took the opportunity of bringing -this diary right up to the moment. I am very sleepy and shall go to -bed . . . - -Just a line. Mina sleeps soundly and her breathing is regular. Her -forehead is puckered up into little wrinkles, as though she thinks -even in her sleep. She is still too pale, but does not look so -haggard as she did this morning. Tomorrow will, I hope, mend all -this. She will be herself at home in Exeter. Oh, but I am sleepy! - - - - -DR. SEWARD'S DIARY - -1 October.--I am puzzled afresh about Renfield. His moods change so -rapidly that I find it difficult to keep touch of them, and as they -always mean something more than his own well-being, they form a more -than interesting study. This morning, when I went to see him after -his repulse of Van Helsing, his manner was that of a man commanding -destiny. He was, in fact, commanding destiny, subjectively. He did -not really care for any of the things of mere earth, he was in the -clouds and looked down on all the weaknesses and wants of us poor -mortals. - -I thought I would improve the occasion and learn something, so I asked -him, "What about the flies these times?" - -He smiled on me in quite a superior sort of way, such a smile as would -have become the face of Malvolio, as he answered me, "The fly, my dear -sir, has one striking feature. It's wings are typical of the aerial -powers of the psychic faculties. The ancients did well when they -typified the soul as a butterfly!" - -I thought I would push his analogy to its utmost logically, so I said -quickly, "Oh, it is a soul you are after now, is it?" - -His madness foiled his reason, and a puzzled look spread over his face -as, shaking his head with a decision which I had but seldom seen in -him. - -He said, "Oh, no, oh no! I want no souls. Life is all I want." Here -he brightened up. "I am pretty indifferent about it at present. Life -is all right. I have all I want. You must get a new patient, doctor, -if you wish to study zoophagy!" - -This puzzled me a little, so I drew him on. "Then you command life. -You are a god, I suppose?" - -He smiled with an ineffably benign superiority. "Oh no! Far be it -from me to arrogate to myself the attributes of the Deity. I am not -even concerned in His especially spiritual doings. If I may state my -intellectual position I am, so far as concerns things purely -terrestrial, somewhat in the position which Enoch occupied -spiritually!" - -This was a poser to me. I could not at the moment recall Enoch's -appositeness, so I had to ask a simple question, though I felt that by -so doing I was lowering myself in the eyes of the lunatic. "And why -with Enoch?" - -"Because he walked with God." - -I could not see the analogy, but did not like to admit it, so I harked -back to what he had denied. "So you don't care about life and you -don't want souls. Why not?" I put my question quickly and somewhat -sternly, on purpose to disconcert him. - -The effort succeeded, for an instant he unconsciously relapsed into -his old servile manner, bent low before me, and actually fawned upon -me as he replied. "I don't want any souls, indeed, indeed! I don't. -I couldn't use them if I had them. They would be no manner of use to -me. I couldn't eat them or . . ." - -He suddenly stopped and the old cunning look spread over his face, -like a wind sweep on the surface of the water. - -"And doctor, as to life, what is it after all? When you've got all -you require, and you know that you will never want, that is all. I -have friends, good friends, like you, Dr. Seward." This was said with -a leer of inexpressible cunning. "I know that I shall never lack the -means of life!" - -I think that through the cloudiness of his insanity he saw some -antagonism in me, for he at once fell back on the last refuge of such -as he, a dogged silence. After a short time I saw that for the -present it was useless to speak to him. He was sulky, and so I came -away. - -Later in the day he sent for me. Ordinarily I would not have come -without special reason, but just at present I am so interested in him -that I would gladly make an effort. Besides, I am glad to have -anything to help pass the time. Harker is out, following up clues, -and so are Lord Godalming and Quincey. Van Helsing sits in my study -poring over the record prepared by the Harkers. He seems to think -that by accurate knowledge of all details he will light up on some -clue. He does not wish to be disturbed in the work, without cause. I -would have taken him with me to see the patient, only I thought that -after his last repulse he might not care to go again. There was also -another reason. Renfield might not speak so freely before a third -person as when he and I were alone. - -I found him sitting in the middle of the floor on his stool, a pose -which is generally indicative of some mental energy on his part. When -I came in, he said at once, as though the question had been waiting on -his lips. "What about souls?" - -It was evident then that my surmise had been correct. Unconscious -cerebration was doing its work, even with the lunatic. I determined -to have the matter out. - -"What about them yourself?" I asked. - -He did not reply for a moment but looked all around him, and up and -down, as though he expected to find some inspiration for an answer. - -"I don't want any souls!" he said in a feeble, apologetic way. The -matter seemed preying on his mind, and so I determined to use it, to -"be cruel only to be kind." So I said, "You like life, and you want -life?" - -"Oh yes! But that is all right. You needn't worry about that!" - -"But," I asked, "how are we to get the life without getting the soul -also?" - -This seemed to puzzle him, so I followed it up, "A nice time you'll -have some time when you're flying out here, with the souls of -thousands of flies and spiders and birds and cats buzzing and -twittering and moaning all around you. You've got their lives, you -know, and you must put up with their souls!" - -Something seemed to affect his imagination, for he put his fingers to -his ears and shut his eyes, screwing them up tightly just as a small -boy does when his face is being soaped. There was something pathetic -in it that touched me. It also gave me a lesson, for it seemed that -before me was a child, only a child, though the features were worn, -and the stubble on the jaws was white. It was evident that he was -undergoing some process of mental disturbance, and knowing how his -past moods had interpreted things seemingly foreign to himself, I -thought I would enter into his mind as well as I could and go with him. - -The first step was to restore confidence, so I asked him, speaking -pretty loud so that he would hear me through his closed ears, "Would -you like some sugar to get your flies around again?" - -He seemed to wake up all at once, and shook his head. With a laugh he -replied, "Not much! Flies are poor things, after all!" After a pause -he added, "But I don't want their souls buzzing round me, all the -same." - -"Or spiders?" I went on. - -"Blow spiders! What's the use of spiders? There isn't anything in -them to eat or . . ." He stopped suddenly as though reminded of a -forbidden topic. - -"So, so!" I thought to myself, "this is the second time he has -suddenly stopped at the word 'drink'. What does it mean?" - -Renfield seemed himself aware of having made a lapse, for he hurried -on, as though to distract my attention from it, "I don't take any -stock at all in such matters. 'Rats and mice and such small deer,' as -Shakespeare has it, 'chicken feed of the larder' they might be called. -I'm past all that sort of nonsense. You might as well ask a man to -eat molecules with a pair of chopsticks, as to try to interest me -about the less carnivora, when I know of what is before me." - -"I see," I said. "You want big things that you can make your teeth -meet in? How would you like to breakfast on an elephant?" - -"What ridiculous nonsense you are talking?" He was getting too wide -awake, so I thought I would press him hard. - -"I wonder," I said reflectively, "what an elephant's soul is like!" - -The effect I desired was obtained, for he at once fell from his -high-horse and became a child again. - -"I don't want an elephant's soul, or any soul at all!" he said. For a -few moments he sat despondently. Suddenly he jumped to his feet, with -his eyes blazing and all the signs of intense cerebral excitement. -"To hell with you and your souls!" he shouted. "Why do you plague me -about souls? Haven't I got enough to worry, and pain, to distract me -already, without thinking of souls?" - -He looked so hostile that I thought he was in for another homicidal -fit, so I blew my whistle. - -The instant, however, that I did so he became calm, and said -apologetically, "Forgive me, Doctor. I forgot myself. You do not -need any help. I am so worried in my mind that I am apt to be -irritable. If you only knew the problem I have to face, and that I am -working out, you would pity, and tolerate, and pardon me. Pray do not -put me in a strait waistcoat. I want to think and I cannot think -freely when my body is confined. I am sure you will understand!" - -He had evidently self-control, so when the attendants came I told them -not to mind, and they withdrew. Renfield watched them go. When the -door was closed he said with considerable dignity and sweetness, "Dr. -Seward, you have been very considerate towards me. Believe me that I -am very, very grateful to you!" - -I thought it well to leave him in this mood, and so I came away. -There is certainly something to ponder over in this man's state. -Several points seem to make what the American interviewer calls "a -story," if one could only get them in proper order. Here they are: - - Will not mention "drinking." - - Fears the thought of being burdened with the "soul" of anything. - - Has no dread of wanting "life" in the future. - - Despises the meaner forms of life altogether, though he dreads - being haunted by their souls. - - Logically all these things point one way! He has assurance of - some kind that he will acquire some higher life. - - He dreads the consequence, the burden of a soul. Then it is a - human life he looks to! - - And the assurance . . .? - -Merciful God! The Count has been to him, and there is some new scheme -of terror afoot! - - -Later.--I went after my round to Van Helsing and told him my -suspicion. He grew very grave, and after thinking the matter over for -a while asked me to take him to Renfield. I did so. As we came to -the door we heard the lunatic within singing gaily, as he used to do -in the time which now seems so long ago. - -When we entered we saw with amazement that he had spread out his sugar -as of old. The flies, lethargic with the autumn, were beginning to -buzz into the room. We tried to make him talk of the subject of our -previous conversation, but he would not attend. He went on with his -singing, just as though we had not been present. He had got a scrap -of paper and was folding it into a notebook. We had to come away as -ignorant as we went in. - -His is a curious case indeed. We must watch him tonight. - - - - - -LETTER, MITCHELL, SONS & CANDY TO LORD GODALMING. - -"1 October. - -"My Lord, - -"We are at all times only too happy to meet your wishes. We beg, -with regard to the desire of your Lordship, expressed by Mr. -Harker on your behalf, to supply the following information -concerning the sale and purchase of No. 347, Piccadilly. The -original vendors are the executors of the late Mr. Archibald -Winter-Suffield. The purchaser is a foreign nobleman, Count de -Ville, who effected the purchase himself paying the purchase -money in notes 'over the counter,' if your Lordship will pardon -us using so vulgar an expression. Beyond this we know nothing -whatever of him. - -"We are, my Lord, - -"Your Lordship's humble servants, - -"MITCHELL, SONS & CANDY." - - - - -DR. SEWARD'S DIARY - -2 October.--I placed a man in the corridor last night, and told him to -make an accurate note of any sound he might hear from Renfield's room, -and gave him instructions that if there should be anything strange he -was to call me. After dinner, when we had all gathered round the fire -in the study, Mrs. Harker having gone to bed, we discussed the -attempts and discoveries of the day. Harker was the only one who had -any result, and we are in great hopes that his clue may be an -important one. - -Before going to bed I went round to the patient's room and looked in -through the observation trap. He was sleeping soundly, his heart rose -and fell with regular respiration. - -This morning the man on duty reported to me that a little after -midnight he was restless and kept saying his prayers somewhat loudly. -I asked him if that was all. He replied that it was all he heard. -There was something about his manner, so suspicious that I asked him -point blank if he had been asleep. He denied sleep, but admitted to -having "dozed" for a while. It is too bad that men cannot be trusted -unless they are watched. - -Today Harker is out following up his clue, and Art and Quincey are -looking after horses. Godalming thinks that it will be well to have -horses always in readiness, for when we get the information which we -seek there will be no time to lose. We must sterilize all the -imported earth between sunrise and sunset. We shall thus catch the -Count at his weakest, and without a refuge to fly to. Van Helsing is -off to the British Museum looking up some authorities on ancient -medicine. The old physicians took account of things which their -followers do not accept, and the Professor is searching for witch and -demon cures which may be useful to us later. - -I sometimes think we must be all mad and that we shall wake to sanity -in strait waistcoats. - -Later.--We have met again. We seem at last to be on the track, and -our work of tomorrow may be the beginning of the end. I wonder if -Renfield's quiet has anything to do with this. His moods have so -followed the doings of the Count, that the coming destruction of the -monster may be carried to him some subtle way. If we could only get -some hint as to what passed in his mind, between the time of my -argument with him today and his resumption of fly-catching, it might -afford us a valuable clue. He is now seemingly quiet for a spell . . . -Is he? That wild yell seemed to come from his room . . . - -The attendant came bursting into my room and told me that Renfield had -somehow met with some accident. He had heard him yell, and when he -went to him found him lying on his face on the floor, all covered with -blood. I must go at once . . . - - - - -CHAPTER 21 - - -DR. SEWARD'S DIARY - -3 October.--Let me put down with exactness all that happened, as well -as I can remember, since last I made an entry. Not a detail that I -can recall must be forgotten. In all calmness I must proceed. - -When I came to Renfield's room I found him lying on the floor on his -left side in a glittering pool of blood. When I went to move him, it -became at once apparent that he had received some terrible injuries. -There seemed none of the unity of purpose between the parts of the -body which marks even lethargic sanity. As the face was exposed I -could see that it was horribly bruised, as though it had been beaten -against the floor. Indeed it was from the face wounds that the pool -of blood originated. - -The attendant who was kneeling beside the body said to me as we turned -him over, "I think, sir, his back is broken. See, both his right arm -and leg and the whole side of his face are paralysed." How such a -thing could have happened puzzled the attendant beyond measure. He -seemed quite bewildered, and his brows were gathered in as he said, "I -can't understand the two things. He could mark his face like that by -beating his own head on the floor. I saw a young woman do it once at -the Eversfield Asylum before anyone could lay hands on her. And I -suppose he might have broken his neck by falling out of bed, if he got -in an awkward kink. But for the life of me I can't imagine how the -two things occurred. If his back was broke, he couldn't beat his -head, and if his face was like that before the fall out of bed, there -would be marks of it." - -I said to him, "Go to Dr. Van Helsing, and ask him to kindly come here -at once. I want him without an instant's delay." - -The man ran off, and within a few minutes the Professor, in his -dressing gown and slippers, appeared. When he saw Renfield on the -ground, he looked keenly at him a moment, and then turned to me. I -think he recognized my thought in my eyes, for he said very quietly, -manifestly for the ears of the attendant, "Ah, a sad accident! He -will need very careful watching, and much attention. I shall stay -with you myself, but I shall first dress myself. If you will remain I -shall in a few minutes join you." - -The patient was now breathing stertorously and it was easy to see that -he had suffered some terrible injury. - -Van Helsing returned with extraordinary celerity, bearing with him a -surgical case. He had evidently been thinking and had his mind made -up, for almost before he looked at the patient, he whispered to me, -"Send the attendant away. We must be alone with him when he becomes -conscious, after the operation." - -I said, "I think that will do now, Simmons. We have done all that we -can at present. You had better go your round, and Dr. Van Helsing -will operate. Let me know instantly if there be anything unusual -anywhere." - -The man withdrew, and we went into a strict examination of the -patient. The wounds of the face were superficial. The real injury -was a depressed fracture of the skull, extending right up through the -motor area. - -The Professor thought a moment and said, "We must reduce the pressure -and get back to normal conditions, as far as can be. The rapidity of -the suffusion shows the terrible nature of his injury. The whole -motor area seems affected. The suffusion of the brain will increase -quickly, so we must trephine at once or it may be too late." - -As he was speaking there was a soft tapping at the door. I went over -and opened it and found in the corridor without, Arthur and Quincey in -pajamas and slippers; the former spoke, "I heard your man call up Dr. -Van Helsing and tell him of an accident. So I woke Quincey or rather -called for him as he was not asleep. Things are moving too quickly -and too strangely for sound sleep for any of us these times. I've -been thinking that tomorrow night will not see things as they have -been. We'll have to look back, and forward a little more than we have -done. May we come in?" - -I nodded, and held the door open till they had entered, then I closed -it again. When Quincey saw the attitude and state of the patient, and -noted the horrible pool on the floor, he said softly, "My God! What -has happened to him? Poor, poor devil!" - -I told him briefly, and added that we expected he would recover -consciousness after the operation, for a short time, at all events. -He went at once and sat down on the edge of the bed, with Godalming -beside him. We all watched in patience. - -"We shall wait," said Van Helsing, "just long enough to fix the best -spot for trephining, so that we may most quickly and perfectly remove -the blood clot, for it is evident that the haemorrhage is increasing." - -The minutes during which we waited passed with fearful slowness. I -had a horrible sinking in my heart, and from Van Helsing's face I -gathered that he felt some fear or apprehension as to what was to -come. I dreaded the words Renfield might speak. I was positively -afraid to think. But the conviction of what was coming was on me, as -I have read of men who have heard the death watch. The poor man's -breathing came in uncertain gasps. Each instant he seemed as though -he would open his eyes and speak, but then would follow a prolonged -stertorous breath, and he would relapse into a more fixed -insensibility. Inured as I was to sick beds and death, this suspense -grew and grew upon me. I could almost hear the beating of my own -heart, and the blood surging through my temples sounded like blows -from a hammer. The silence finally became agonizing. I looked at my -companions, one after another, and saw from their flushed faces and -damp brows that they were enduring equal torture. There was a nervous -suspense over us all, as though overhead some dread bell would peal -out powerfully when we should least expect it. - -At last there came a time when it was evident that the patient was -sinking fast. He might die at any moment. I looked up at the -Professor and caught his eyes fixed on mine. His face was sternly set -as he spoke, "There is no time to lose. His words may be worth many -lives. I have been thinking so, as I stood here. It may be there is -a soul at stake! We shall operate just above the ear." - -Without another word he made the operation. For a few moments the -breathing continued to be stertorous. Then there came a breath so -prolonged that it seemed as though it would tear open his chest. -Suddenly his eyes opened, and became fixed in a wild, helpless stare. -This was continued for a few moments, then it was softened into a glad -surprise, and from his lips came a sigh of relief. He moved -convulsively, and as he did so, said, "I'll be quiet, Doctor. Tell -them to take off the strait waistcoat. I have had a terrible dream, -and it has left me so weak that I cannot move. What's wrong with my -face? It feels all swollen, and it smarts dreadfully." - -He tried to turn his head, but even with the effort his eyes seemed to -grow glassy again so I gently put it back. Then Van Helsing said in a -quiet grave tone, "Tell us your dream, Mr. Renfield." - -As he heard the voice his face brightened, through its mutilation, and -he said, "That is Dr. Van Helsing. How good it is of you to be here. -Give me some water, my lips are dry, and I shall try to tell you. I -dreamed . . ." - -He stopped and seemed fainting. I called quietly to Quincey, "The -brandy, it is in my study, quick!" He flew and returned with a glass, -the decanter of brandy and a carafe of water. We moistened the -parched lips, and the patient quickly revived. - -It seemed, however, that his poor injured brain had been working in -the interval, for when he was quite conscious, he looked at me -piercingly with an agonized confusion which I shall never forget, and -said, "I must not deceive myself. It was no dream, but all a grim -reality." Then his eyes roved round the room. As they caught sight -of the two figures sitting patiently on the edge of the bed he went -on, "If I were not sure already, I would know from them." - -For an instant his eyes closed, not with pain or sleep but -voluntarily, as though he were bringing all his faculties to bear. -When he opened them he said, hurriedly, and with more energy than he -had yet displayed, "Quick, Doctor, quick, I am dying! I feel that I -have but a few minutes, and then I must go back to death, or worse! -Wet my lips with brandy again. I have something that I must say -before I die. Or before my poor crushed brain dies anyhow. Thank -you! It was that night after you left me, when I implored you to let -me go away. I couldn't speak then, for I felt my tongue was tied. -But I was as sane then, except in that way, as I am now. I was in an -agony of despair for a long time after you left me, it seemed hours. -Then there came a sudden peace to me. My brain seemed to become cool -again, and I realized where I was. I heard the dogs bark behind our -house, but not where He was!" - -As he spoke, Van Helsing's eyes never blinked, but his hand came out -and met mine and gripped it hard. He did not, however, betray -himself. He nodded slightly and said, "Go on," in a low voice. - -Renfield proceeded. "He came up to the window in the mist, as I had -seen him often before, but he was solid then, not a ghost, and his -eyes were fierce like a man's when angry. He was laughing with his -red mouth, the sharp white teeth glinted in the moonlight when he -turned to look back over the belt of trees, to where the dogs were -barking. I wouldn't ask him to come in at first, though I knew he -wanted to, just as he had wanted all along. Then he began promising -me things, not in words but by doing them." - -He was interrupted by a word from the Professor, "How?" - -"By making them happen. Just as he used to send in the flies when the -sun was shining. Great big fat ones with steel and sapphire on their -wings. And big moths, in the night, with skull and cross-bones on -their backs." - -Van Helsing nodded to him as he whispered to me unconsciously, "The -Acherontia Atropos of the Sphinges, what you call the 'Death's-head -Moth'?" - -The patient went on without stopping, "Then he began to whisper. 'Rats, -rats, rats! Hundreds, thousands, millions of them, and every one a -life. And dogs to eat them, and cats too. All lives! All red blood, -with years of life in it, and not merely buzzing flies!' I laughed at -him, for I wanted to see what he could do. Then the dogs howled, away -beyond the dark trees in His house. He beckoned me to the window. I -got up and looked out, and He raised his hands, and seemed to call out -without using any words. A dark mass spread over the grass, coming on -like the shape of a flame of fire. And then He moved the mist to the -right and left, and I could see that there were thousands of rats with -their eyes blazing red, like His only smaller. He held up his hand, -and they all stopped, and I thought he seemed to be saying, 'All these -lives will I give you, ay, and many more and greater, through -countless ages, if you will fall down and worship me!' And then a red -cloud, like the colour of blood, seemed to close over my eyes, and -before I knew what I was doing, I found myself opening the sash and -saying to Him, 'Come in, Lord and Master!' The rats were all gone, but -He slid into the room through the sash, though it was only open an -inch wide, just as the Moon herself has often come in through the -tiniest crack and has stood before me in all her size and splendour." - -His voice was weaker, so I moistened his lips with the brandy again, -and he continued, but it seemed as though his memory had gone on -working in the interval for his story was further advanced. I was -about to call him back to the point, but Van Helsing whispered to me, -"Let him go on. Do not interrupt him. He cannot go back, and maybe -could not proceed at all if once he lost the thread of his thought." - -He proceeded, "All day I waited to hear from him, but he did not send -me anything, not even a blowfly, and when the moon got up I was pretty -angry with him. When he did slide in through the window, though it -was shut, and did not even knock, I got mad with him. He sneered at -me, and his white face looked out of the mist with his red eyes -gleaming, and he went on as though he owned the whole place, and I was -no one. He didn't even smell the same as he went by me. I couldn't -hold him. I thought that, somehow, Mrs. Harker had come into the -room." - -The two men sitting on the bed stood up and came over, standing behind -him so that he could not see them, but where they could hear better. -They were both silent, but the Professor started and quivered. His -face, however, grew grimmer and sterner still. Renfield went on -without noticing, "When Mrs. Harker came in to see me this afternoon -she wasn't the same. It was like tea after the teapot has been -watered." Here we all moved, but no one said a word. - -He went on, "I didn't know that she was here till she spoke, and she -didn't look the same. I don't care for the pale people. I like them -with lots of blood in them, and hers all seemed to have run out. I -didn't think of it at the time, but when she went away I began to -think, and it made me mad to know that He had been taking the life out -of her." I could feel that the rest quivered, as I did; but we -remained otherwise still. "So when He came tonight I was ready for -Him. I saw the mist stealing in, and I grabbed it tight. I had heard -that madmen have unnatural strength. And as I knew I was a madman, at -times anyhow, I resolved to use my power. Ay, and He felt it too, for -He had to come out of the mist to struggle with me. I held tight, and -I thought I was going to win, for I didn't mean Him to take any more -of her life, till I saw His eyes. They burned into me, and my -strength became like water. He slipped through it, and when I tried -to cling to Him, He raised me up and flung me down. There was a red -cloud before me, and a noise like thunder, and the mist seemed to -steal away under the door." - -His voice was becoming fainter and his breath more stertorous. Van -Helsing stood up instinctively. - -"We know the worst now," he said. "He is here, and we know his -purpose. It may not be too late. Let us be armed, the same as we -were the other night, but lose no time, there is not an instant to -spare." - -There was no need to put our fear, nay our conviction, into words, we -shared them in common. We all hurried and took from our rooms the -same things that we had when we entered the Count's house. The -Professor had his ready, and as we met in the corridor he pointed to -them significantly as he said, "They never leave me, and they shall -not till this unhappy business is over. Be wise also, my friends. It -is no common enemy that we deal with Alas! Alas! That dear Madam -Mina should suffer!" He stopped, his voice was breaking, and I do not -know if rage or terror predominated in my own heart. - -Outside the Harkers' door we paused. Art and Quincey held back, and -the latter said, "Should we disturb her?" - -"We must," said Van Helsing grimly. "If the door be locked, I shall -break it in." - -"May it not frighten her terribly? It is unusual to break into a -lady's room!" - -Van Helsing said solemnly, "You are always right. But this is life -and death. All chambers are alike to the doctor. And even were they -not they are all as one to me tonight. Friend John, when I turn the -handle, if the door does not open, do you put your shoulder down and -shove; and you too, my friends. Now!" - -He turned the handle as he spoke, but the door did not yield. We -threw ourselves against it. With a crash it burst open, and we almost -fell headlong into the room. The Professor did actually fall, and I -saw across him as he gathered himself up from hands and knees. What I -saw appalled me. I felt my hair rise like bristles on the back of my -neck, and my heart seemed to stand still. - -The moonlight was so bright that through the thick yellow blind the -room was light enough to see. On the bed beside the window lay -Jonathan Harker, his face flushed and breathing heavily as though in a -stupor. Kneeling on the near edge of the bed facing outwards was the -white-clad figure of his wife. By her side stood a tall, thin man, -clad in black. His face was turned from us, but the instant we saw we -all recognized the Count, in every way, even to the scar on his -forehead. With his left hand he held both Mrs. Harker's hands, -keeping them away with her arms at full tension. His right hand -gripped her by the back of the neck, forcing her face down on his -bosom. Her white nightdress was smeared with blood, and a thin stream -trickled down the man's bare chest which was shown by his torn-open -dress. The attitude of the two had a terrible resemblance to a child -forcing a kitten's nose into a saucer of milk to compel it to drink. -As we burst into the room, the Count turned his face, and the hellish -look that I had heard described seemed to leap into it. His eyes -flamed red with devilish passion. The great nostrils of the white -aquiline nose opened wide and quivered at the edge, and the white -sharp teeth, behind the full lips of the blood dripping mouth, clamped -together like those of a wild beast. With a wrench, which threw his -victim back upon the bed as though hurled from a height, he turned and -sprang at us. But by this time the Professor had gained his feet, and -was holding towards him the envelope which contained the Sacred Wafer. -The Count suddenly stopped, just as poor Lucy had done outside the -tomb, and cowered back. Further and further back he cowered, as we, -lifting our crucifixes, advanced. The moonlight suddenly failed, as a -great black cloud sailed across the sky. And when the gaslight sprang -up under Quincey's match, we saw nothing but a faint vapour. This, as -we looked, trailed under the door, which with the recoil from its -bursting open, had swung back to its old position. Van Helsing, Art, -and I moved forward to Mrs. Harker, who by this time had drawn her -breath and with it had given a scream so wild, so ear-piercing, so -despairing that it seems to me now that it will ring in my ears till -my dying day. For a few seconds she lay in her helpless attitude and -disarray. Her face was ghastly, with a pallor which was accentuated -by the blood which smeared her lips and cheeks and chin. From her -throat trickled a thin stream of blood. Her eyes were mad with -terror. Then she put before her face her poor crushed hands, which -bore on their whiteness the red mark of the Count's terrible grip, and -from behind them came a low desolate wail which made the terrible -scream seem only the quick expression of an endless grief. Van -Helsing stepped forward and drew the coverlet gently over her body, -whilst Art, after looking at her face for an instant despairingly, ran -out of the room. - -Van Helsing whispered to me, "Jonathan is in a stupor such as we know -the Vampire can produce. We can do nothing with poor Madam Mina for a -few moments till she recovers herself. I must wake him!" - -He dipped the end of a towel in cold water and with it began to flick -him on the face, his wife all the while holding her face between her -hands and sobbing in a way that was heart breaking to hear. I raised -the blind, and looked out of the window. There was much moonshine, -and as I looked I could see Quincey Morris run across the lawn and -hide himself in the shadow of a great yew tree. It puzzled me to -think why he was doing this. But at the instant I heard Harker's -quick exclamation as he woke to partial consciousness, and turned to -the bed. On his face, as there might well be, was a look of wild -amazement. He seemed dazed for a few seconds, and then full -consciousness seemed to burst upon him all at once, and he started up. - -His wife was aroused by the quick movement, and turned to him with her -arms stretched out, as though to embrace him. Instantly, however, she -drew them in again, and putting her elbows together, held her hands -before her face, and shuddered till the bed beneath her shook. - -"In God's name what does this mean?" Harker cried out. "Dr. Seward, -Dr. Van Helsing, what is it? What has happened? What is wrong? Mina, -dear what is it? What does that blood mean? My God, my God! Has it -come to this!" And, raising himself to his knees, he beat his hands -wildly together. "Good God help us! Help her! Oh, help her!" - -With a quick movement he jumped from bed, and began to pull on his -clothes, all the man in him awake at the need for instant exertion. -"What has happened? Tell me all about it!" he cried without pausing. -"Dr. Van Helsing, you love Mina, I know. Oh, do something to save her. -It cannot have gone too far yet. Guard her while I look for him!" - -His wife, through her terror and horror and distress, saw some sure -danger to him. Instantly forgetting her own grief, she seized hold of -him and cried out. - -"No! No! Jonathan, you must not leave me. I have suffered enough -tonight, God knows, without the dread of his harming you. You must -stay with me. Stay with these friends who will watch over you!" Her -expression became frantic as she spoke. And, he yielding to her, she -pulled him down sitting on the bedside, and clung to him fiercely. - -Van Helsing and I tried to calm them both. The Professor held up his -golden crucifix, and said with wonderful calmness, "Do not fear, my -dear. We are here, and whilst this is close to you no foul thing can -approach. You are safe for tonight, and we must be calm and take -counsel together." - -She shuddered and was silent, holding down her head on her husband's -breast. When she raised it, his white nightrobe was stained with -blood where her lips had touched, and where the thin open wound in the -neck had sent forth drops. The instant she saw it she drew back, with -a low wail, and whispered, amidst choking sobs. - -"Unclean, unclean! I must touch him or kiss him no more. Oh, that it -should be that it is I who am now his worst enemy, and whom he may -have most cause to fear." - -To this he spoke out resolutely, "Nonsense, Mina. It is a shame to me -to hear such a word. I would not hear it of you. And I shall not -hear it from you. May God judge me by my deserts, and punish me with -more bitter suffering than even this hour, if by any act or will of -mine anything ever come between us!" - -He put out his arms and folded her to his breast. And for a while she -lay there sobbing. He looked at us over her bowed head, with eyes -that blinked damply above his quivering nostrils. His mouth was set -as steel. - -After a while her sobs became less frequent and more faint, and then -he said to me, speaking with a studied calmness which I felt tried his -nervous power to the utmost. - -"And now, Dr. Seward, tell me all about it. Too well I know the broad -fact. Tell me all that has been." - -I told him exactly what had happened and he listened with seeming -impassiveness, but his nostrils twitched and his eyes blazed as I told -how the ruthless hands of the Count had held his wife in that terrible -and horrid position, with her mouth to the open wound in his breast. -It interested me, even at that moment, to see that whilst the face of -white set passion worked convulsively over the bowed head, the hands -tenderly and lovingly stroked the ruffled hair. Just as I had -finished, Quincey and Godalming knocked at the door. They entered in -obedience to our summons. Van Helsing looked at me questioningly. I -understood him to mean if we were to take advantage of their coming to -divert if possible the thoughts of the unhappy husband and wife from -each other and from themselves. So on nodding acquiescence to him he -asked them what they had seen or done. To which Lord Godalming -answered. - -"I could not see him anywhere in the passage, or in any of our rooms. -I looked in the study but, though he had been there, he had gone. He -had, however . . ." He stopped suddenly, looking at the poor drooping -figure on the bed. - -Van Helsing said gravely, "Go on, friend Arthur. We want here no more -concealments. Our hope now is in knowing all. Tell freely!" - -So Art went on, "He had been there, and though it could only have been -for a few seconds, he made rare hay of the place. All the manuscript -had been burned, and the blue flames were flickering amongst the white -ashes. The cylinders of your phonograph too were thrown on the fire, -and the wax had helped the flames." - -Here I interrupted. "Thank God there is the other copy in the safe!" - -His face lit for a moment, but fell again as he went on. "I ran -downstairs then, but could see no sign of him. I looked into -Renfield's room, but there was no trace there except . . ." Again he -paused. - -"Go on," said Harker hoarsely. So he bowed his head and moistening his -lips with his tongue, added, "except that the poor fellow is dead." - -Mrs. Harker raised her head, looking from one to the other of us she -said solemnly, "God's will be done!" - -I could not but feel that Art was keeping back something. But, as I -took it that it was with a purpose, I said nothing. - -Van Helsing turned to Morris and asked, "And you, friend Quincey, have -you any to tell?" - -"A little," he answered. "It may be much eventually, but at present I -can't say. I thought it well to know if possible where the Count -would go when he left the house. I did not see him, but I saw a bat -rise from Renfield's window, and flap westward. I expected to see him -in some shape go back to Carfax, but he evidently sought some other -lair. He will not be back tonight, for the sky is reddening in the -east, and the dawn is close. We must work tomorrow!" - -He said the latter words through his shut teeth. For a space of -perhaps a couple of minutes there was silence, and I could fancy that -I could hear the sound of our hearts beating. - -Then Van Helsing said, placing his hand tenderly on Mrs. Harker's -head, "And now, Madam Mina, poor dear, dear, Madam Mina, tell us -exactly what happened. God knows that I do not want that you be -pained, but it is need that we know all. For now more than ever has -all work to be done quick and sharp, and in deadly earnest. The day -is close to us that must end all, if it may be so, and now is the -chance that we may live and learn." - -The poor dear lady shivered, and I could see the tension of her nerves -as she clasped her husband closer to her and bent her head lower and -lower still on his breast. Then she raised her head proudly, and held -out one hand to Van Helsing who took it in his, and after stooping and -kissing it reverently, held it fast. The other hand was locked in -that of her husband, who held his other arm thrown round her -protectingly. After a pause in which she was evidently ordering her -thoughts, she began. - -"I took the sleeping draught which you had so kindly given me, but for -a long time it did not act. I seemed to become more wakeful, and -myriads of horrible fancies began to crowd in upon my mind. All of -them connected with death, and vampires, with blood, and pain, and -trouble." Her husband involuntarily groaned as she turned to him and -said lovingly, "Do not fret, dear. You must be brave and strong, and -help me through the horrible task. If you only knew what an effort it -is to me to tell of this fearful thing at all, you would understand -how much I need your help. Well, I saw I must try to help the -medicine to its work with my will, if it was to do me any good, so I -resolutely set myself to sleep. Sure enough sleep must soon have come -to me, for I remember no more. Jonathan coming in had not waked me, -for he lay by my side when next I remember. There was in the room the -same thin white mist that I had before noticed. But I forget now if -you know of this. You will find it in my diary which I shall show you -later. I felt the same vague terror which had come to me before and -the same sense of some presence. I turned to wake Jonathan, but found -that he slept so soundly that it seemed as if it was he who had taken -the sleeping draught, and not I. I tried, but I could not wake him. -This caused me a great fear, and I looked around terrified. Then -indeed, my heart sank within me. Beside the bed, as if he had stepped -out of the mist, or rather as if the mist had turned into his figure, -for it had entirely disappeared, stood a tall, thin man, all in -black. I knew him at once from the description of the others. The -waxen face, the high aquiline nose, on which the light fell in a thin -white line, the parted red lips, with the sharp white teeth showing -between, and the red eyes that I had seemed to see in the sunset on -the windows of St. Mary's Church at Whitby. I knew, too, the red scar -on his forehead where Jonathan had struck him. For an instant my -heart stood still, and I would have screamed out, only that I was -paralyzed. In the pause he spoke in a sort of keen, cutting whisper, -pointing as he spoke to Jonathan. - -"'Silence! If you make a sound I shall take him and dash his brains -out before your very eyes.' I was appalled and was too bewildered to -do or say anything. With a mocking smile, he placed one hand upon my -shoulder and, holding me tight, bared my throat with the other, saying -as he did so, 'First, a little refreshment to reward my exertions. -You may as well be quiet. It is not the first time, or the second, -that your veins have appeased my thirst!' I was bewildered, and -strangely enough, I did not want to hinder him. I suppose it is a -part of the horrible curse that such is, when his touch is on his -victim. And oh, my God, my God, pity me! He placed his reeking lips -upon my throat!" Her husband groaned again. She clasped his hand -harder, and looked at him pityingly, as if he were the injured one, -and went on. - -"I felt my strength fading away, and I was in a half swoon. How long -this horrible thing lasted I know not, but it seemed that a long time -must have passed before he took his foul, awful, sneering mouth away. -I saw it drip with the fresh blood!" The remembrance seemed for a while -to overpower her, and she drooped and would have sunk down but for her -husband's sustaining arm. With a great effort she recovered herself -and went on. - -"Then he spoke to me mockingly, 'And so you, like the others, would -play your brains against mine. You would help these men to hunt me -and frustrate me in my design! You know now, and they know in part -already, and will know in full before long, what it is to cross my -path. They should have kept their energies for use closer to home. -Whilst they played wits against me, against me who commanded nations, -and intrigued for them, and fought for them, hundreds of years before -they were born, I was countermining them. And you, their best beloved -one, are now to me, flesh of my flesh, blood of my blood, kin of my -kin, my bountiful wine-press for a while, and shall be later on my -companion and my helper. You shall be avenged in turn, for not one of -them but shall minister to your needs. But as yet you are to be -punished for what you have done. You have aided in thwarting me. Now -you shall come to my call. When my brain says "Come!" to you, you -shall cross land or sea to do my bidding. And to that end this!' - -"With that he pulled open his shirt, and with his long sharp nails -opened a vein in his breast. When the blood began to spurt out, he -took my hands in one of his, holding them tight, and with the other -seized my neck and pressed my mouth to the wound, so that I must -either suffocate or swallow some to the . . . Oh, my God! My God! -What have I done? What have I done to deserve such a fate, I who have -tried to walk in meekness and righteousness all my days. God pity -me! Look down on a poor soul in worse than mortal peril. And in -mercy pity those to whom she is dear!" Then she began to rub her lips -as though to cleanse them from pollution. - -As she was telling her terrible story, the eastern sky began to -quicken, and everything became more and more clear. Harker was still -and quiet; but over his face, as the awful narrative went on, came a -grey look which deepened and deepened in the morning light, till when -the first red streak of the coming dawn shot up, the flesh stood -darkly out against the whitening hair. - -We have arranged that one of us is to stay within call of the unhappy -pair till we can meet together and arrange about taking action. - -Of this I am sure. The sun rises today on no more miserable house in -all the great round of its daily course. - - - - -CHAPTER 22 - - -JONATHAN HARKER'S JOURNAL - -3 October.--As I must do something or go mad, I write this diary. It -is now six o'clock, and we are to meet in the study in half an hour -and take something to eat, for Dr. Van Helsing and Dr. Seward are -agreed that if we do not eat we cannot work our best. Our best will -be, God knows, required today. I must keep writing at every chance, -for I dare not stop to think. All, big and little, must go down. -Perhaps at the end the little things may teach us most. The teaching, -big or little, could not have landed Mina or me anywhere worse than we -are today. However, we must trust and hope. Poor Mina told me just -now, with the tears running down her dear cheeks, that it is in -trouble and trial that our faith is tested. That we must keep on -trusting, and that God will aid us up to the end. The end! Oh my -God! What end? . . . To work! To work! - -When Dr. Van Helsing and Dr. Seward had come back from seeing poor -Renfield, we went gravely into what was to be done. First, Dr. Seward -told us that when he and Dr. Van Helsing had gone down to the room -below they had found Renfield lying on the floor, all in a heap. His -face was all bruised and crushed in, and the bones of the neck were -broken. - -Dr. Seward asked the attendant who was on duty in the passage if he -had heard anything. He said that he had been sitting down, he -confessed to half dozing, when he heard loud voices in the room, and -then Renfield had called out loudly several times, "God! God! God!" -After that there was a sound of falling, and when he entered the room -he found him lying on the floor, face down, just as the doctors had -seen him. Van Helsing asked if he had heard "voices" or "a voice," -and he said he could not say. That at first it had seemed to him as -if there were two, but as there was no one in the room it could have -been only one. He could swear to it, if required, that the word "God" -was spoken by the patient. - -Dr. Seward said to us, when we were alone, that he did not wish to go -into the matter. The question of an inquest had to be considered, and -it would never do to put forward the truth, as no one would believe -it. As it was, he thought that on the attendant's evidence he could -give a certificate of death by misadventure in falling from bed. In -case the coroner should demand it, there would be a formal inquest, -necessarily to the same result. - -When the question began to be discussed as to what should be our next -step, the very first thing we decided was that Mina should be in full -confidence. That nothing of any sort, no matter how painful, should -be kept from her. She herself agreed as to its wisdom, and it was -pitiful to see her so brave and yet so sorrowful, and in such a depth -of despair. - -"There must be no concealment," she said. "Alas! We have had too -much already. And besides there is nothing in all the world that can -give me more pain than I have already endured, than I suffer now! -Whatever may happen, it must be of new hope or of new courage to me!" - -Van Helsing was looking at her fixedly as she spoke, and said, -suddenly but quietly, "But dear Madam Mina, are you not afraid. Not -for yourself, but for others from yourself, after what has happened?" - -Her face grew set in its lines, but her eyes shone with the devotion -of a martyr as she answered, "Ah no! For my mind is made up!" - -"To what?" he asked gently, whilst we were all very still, for each in -our own way we had a sort of vague idea of what she meant. - -Her answer came with direct simplicity, as though she was simply -stating a fact, "Because if I find in myself, and I shall watch keenly -for it, a sign of harm to any that I love, I shall die!" - -"You would not kill yourself?" he asked, hoarsely. - -"I would. If there were no friend who loved me, who would save me -such a pain, and so desperate an effort!" She looked at him meaningly -as she spoke. - -He was sitting down, but now he rose and came close to her and put his -hand on her head as he said solemnly. "My child, there is such an one -if it were for your good. For myself I could hold it in my account -with God to find such an euthanasia for you, even at this moment if it -were best. Nay, were it safe! But my child . . ." - -For a moment he seemed choked, and a great sob rose in his throat. He -gulped it down and went on, "There are here some who would stand -between you and death. You must not die. You must not die by any -hand, but least of all your own. Until the other, who has fouled your -sweet life, is true dead you must not die. For if he is still with -the quick Undead, your death would make you even as he is. No, you -must live! You must struggle and strive to live, though death would -seem a boon unspeakable. You must fight Death himself, though he come -to you in pain or in joy. By the day, or the night, in safety or in -peril! On your living soul I charge you that you do not die. Nay, -nor think of death, till this great evil be past." - -The poor dear grew white as death, and shook and shivered, as I have -seen a quicksand shake and shiver at the incoming of the tide. We -were all silent. We could do nothing. At length she grew more calm -and turning to him said sweetly, but oh so sorrowfully, as she held -out her hand, "I promise you, my dear friend, that if God will let me -live, I shall strive to do so. Till, if it may be in His good time, -this horror may have passed away from me." - -She was so good and brave that we all felt that our hearts were -strengthened to work and endure for her, and we began to discuss what -we were to do. I told her that she was to have all the papers in the -safe, and all the papers or diaries and phonographs we might hereafter -use, and was to keep the record as she had done before. She was -pleased with the prospect of anything to do, if "pleased" could be -used in connection with so grim an interest. - -As usual Van Helsing had thought ahead of everyone else, and was -prepared with an exact ordering of our work. - -"It is perhaps well," he said, "that at our meeting after our visit to -Carfax we decided not to do anything with the earth boxes that lay -there. Had we done so, the Count must have guessed our purpose, and -would doubtless have taken measures in advance to frustrate such an -effort with regard to the others. But now he does not know our -intentions. Nay, more, in all probability, he does not know that such -a power exists to us as can sterilize his lairs, so that he cannot use -them as of old. - -"We are now so much further advanced in our knowledge as to their -disposition that, when we have examined the house in Piccadilly, we may -track the very last of them. Today then, is ours, and in it rests our -hope. The sun that rose on our sorrow this morning guards us in its -course. Until it sets tonight, that monster must retain whatever form -he now has. He is confined within the limitations of his earthly -envelope. He cannot melt into thin air nor disappear through cracks -or chinks or crannies. If he go through a doorway, he must open the -door like a mortal. And so we have this day to hunt out all his lairs -and sterilize them. So we shall, if we have not yet catch him and -destroy him, drive him to bay in some place where the catching and the -destroying shall be, in time, sure." - -Here I started up for I could not contain myself at the thought that -the minutes and seconds so preciously laden with Mina's life and -happiness were flying from us, since whilst we talked action was -impossible. But Van Helsing held up his hand warningly. - -"Nay, friend Jonathan," he said, "in this, the quickest way home is -the longest way, so your proverb say. We shall all act and act with -desperate quick, when the time has come. But think, in all probable -the key of the situation is in that house in Piccadilly. The Count -may have many houses which he has bought. Of them he will have deeds -of purchase, keys and other things. He will have paper that he write -on. He will have his book of cheques. There are many belongings that -he must have somewhere. Why not in this place so central, so quiet, -where he come and go by the front or the back at all hours, when in -the very vast of the traffic there is none to notice. We shall go -there and search that house. And when we learn what it holds, then we -do what our friend Arthur call, in his phrases of hunt 'stop the -earths' and so we run down our old fox, so? Is it not?" - -"Then let us come at once," I cried, "we are wasting the precious, -precious time!" - -The Professor did not move, but simply said, "And how are we to get -into that house in Piccadilly?" - -"Any way!" I cried. "We shall break in if need be." - -"And your police? Where will they be, and what will they say?" - -I was staggered, but I knew that if he wished to delay he had a good -reason for it. So I said, as quietly as I could, "Don't wait more -than need be. You know, I am sure, what torture I am in." - -"Ah, my child, that I do. And indeed there is no wish of me to add to -your anguish. But just think, what can we do, until all the world be -at movement. Then will come our time. I have thought and thought, -and it seems to me that the simplest way is the best of all. Now we -wish to get into the house, but we have no key. Is it not so?" I -nodded. - -"Now suppose that you were, in truth, the owner of that house, and -could not still get in. And think there was to you no conscience of -the housebreaker, what would you do?" - -"I should get a respectable locksmith, and set him to work to pick the -lock for me." - -"And your police, they would interfere, would they not?" - -"Oh no! Not if they knew the man was properly employed." - -"Then," he looked at me as keenly as he spoke, "all that is in doubt -is the conscience of the employer, and the belief of your policemen as -to whether or not that employer has a good conscience or a bad one. -Your police must indeed be zealous men and clever, oh so clever, in -reading the heart, that they trouble themselves in such matter. No, -no, my friend Jonathan, you go take the lock off a hundred empty -houses in this your London, or of any city in the world, and if you do -it as such things are rightly done, and at the time such things are -rightly done, no one will interfere. I have read of a gentleman who -owned a so fine house in London, and when he went for months of summer -to Switzerland and lock up his house, some burglar come and broke -window at back and got in. Then he went and made open the shutters in -front and walk out and in through the door, before the very eyes of -the police. Then he have an auction in that house, and advertise it, -and put up big notice. And when the day come he sell off by a great -auctioneer all the goods of that other man who own them. Then he go -to a builder, and he sell him that house, making an agreement that he -pull it down and take all away within a certain time. And your police -and other authority help him all they can. And when that owner come -back from his holiday in Switzerland he find only an empty hole where -his house had been. This was all done en regle, and in our work we -shall be en regle too. We shall not go so early that the policemen -who have then little to think of, shall deem it strange. But we shall -go after ten o'clock, when there are many about, and such things would -be done were we indeed owners of the house." - -I could not but see how right he was and the terrible despair of -Mina's face became relaxed in thought. There was hope in such good -counsel. - -Van Helsing went on, "When once within that house we may find more -clues. At any rate some of us can remain there whilst the rest find -the other places where there be more earth boxes, at Bermondsey and -Mile End." - -Lord Godalming stood up. "I can be of some use here," he said. "I -shall wire to my people to have horses and carriages where they will -be most convenient." - -"Look here, old fellow," said Morris, "it is a capital idea to have -all ready in case we want to go horse backing, but don't you think -that one of your snappy carriages with its heraldic adornments in a -byway of Walworth or Mile End would attract too much attention for our -purpose? It seems to me that we ought to take cabs when we go south -or east. And even leave them somewhere near the neighbourhood we are -going to." - -"Friend Quincey is right!" said the Professor. "His head is what you -call in plane with the horizon. It is a difficult thing that we go to -do, and we do not want no peoples to watch us if so it may." - -Mina took a growing interest in everything and I was rejoiced to see -that the exigency of affairs was helping her to forget for a time the -terrible experience of the night. She was very, very pale, almost -ghastly, and so thin that her lips were drawn away, showing her teeth -in somewhat of prominence. I did not mention this last, lest it -should give her needless pain, but it made my blood run cold in my -veins to think of what had occurred with poor Lucy when the Count had -sucked her blood. As yet there was no sign of the teeth growing -sharper, but the time as yet was short, and there was time for fear. - -When we came to the discussion of the sequence of our efforts and of -the disposition of our forces, there were new sources of doubt. It -was finally agreed that before starting for Piccadilly we should -destroy the Count's lair close at hand. In case he should find it out -too soon, we should thus be still ahead of him in our work of -destruction. And his presence in his purely material shape, and at -his weakest, might give us some new clue. - -As to the disposal of forces, it was suggested by the Professor that, -after our visit to Carfax, we should all enter the house in -Piccadilly. That the two doctors and I should remain there, whilst -Lord Godalming and Quincey found the lairs at Walworth and Mile End -and destroyed them. It was possible, if not likely, the Professor -urged, that the Count might appear in Piccadilly during the day, and -that if so we might be able to cope with him then and there. At any -rate, we might be able to follow him in force. To this plan I -strenuously objected, and so far as my going was concerned, for I said -that I intended to stay and protect Mina. I thought that my mind was -made up on the subject, but Mina would not listen to my objection. She -said that there might be some law matter in which I could be useful. -That amongst the Count's papers might be some clue which I could -understand out of my experience in Transylvania. And that, as it was, -all the strength we could muster was required to cope with the Count's -extraordinary power. I had to give in, for Mina's resolution was -fixed. She said that it was the last hope for her that we should all -work together. - -"As for me," she said, "I have no fear. Things have been as bad as -they can be. And whatever may happen must have in it some element of -hope or comfort. Go, my husband! God can, if He wishes it, guard me -as well alone as with any one present." - -So I started up crying out, "Then in God's name let us come at once, -for we are losing time. The Count may come to Piccadilly earlier than -we think." - -"Not so!" said Van Helsing, holding up his hand. - -"But why?" I asked. - -"Do you forget," he said, with actually a smile, "that last night he -banqueted heavily, and will sleep late?" - -Did I forget! Shall I ever . . . can I ever! Can any of us ever -forget that terrible scene! Mina struggled hard to keep her brave -countenance, but the pain overmastered her and she put her hands -before her face, and shuddered whilst she moaned. Van Helsing had not -intended to recall her frightful experience. He had simply lost sight -of her and her part in the affair in his intellectual effort. - -When it struck him what he said, he was horrified at his -thoughtlessness and tried to comfort her. - -"Oh, Madam Mina," he said, "dear, dear, Madam Mina, alas! That I of -all who so reverence you should have said anything so forgetful. These -stupid old lips of mine and this stupid old head do not deserve so, -but you will forget it, will you not?" He bent low beside her as he -spoke. - -She took his hand, and looking at him through her tears, said -hoarsely, "No, I shall not forget, for it is well that I remember. -And with it I have so much in memory of you that is sweet, that I take -it all together. Now, you must all be going soon. Breakfast is -ready, and we must all eat that we may be strong." - -Breakfast was a strange meal to us all. We tried to be cheerful and -encourage each other, and Mina was the brightest and most cheerful of -us. When it was over, Van Helsing stood up and said, "Now, my dear -friends, we go forth to our terrible enterprise. Are we all armed, as -we were on that night when first we visited our enemy's lair. Armed -against ghostly as well as carnal attack?" - -We all assured him. - -"Then it is well. Now, Madam Mina, you are in any case quite safe -here until the sunset. And before then we shall return . . . if . . . -We shall return! But before we go let me see you armed against personal -attack. I have myself, since you came down, prepared your chamber by -the placing of things of which we know, so that He may not enter. Now -let me guard yourself. On your forehead I touch this piece of Sacred -Wafer in the name of the Father, the Son, and . . ." - -There was a fearful scream which almost froze our hearts to hear. As -he had placed the Wafer on Mina's forehead, it had seared it . . . had -burned into the flesh as though it had been a piece of white-hot metal. -My poor darling's brain had told her the significance of the fact as -quickly as her nerves received the pain of it, and the two so -overwhelmed her that her overwrought nature had its voice in that -dreadful scream. - -But the words to her thought came quickly. The echo of the scream had -not ceased to ring on the air when there came the reaction, and she -sank on her knees on the floor in an agony of abasement. Pulling her -beautiful hair over her face, as the leper of old his mantle, she -wailed out. - -"Unclean! Unclean! Even the Almighty shuns my polluted flesh! I -must bear this mark of shame upon my forehead until the Judgement -Day." - -They all paused. I had thrown myself beside her in an agony of -helpless grief, and putting my arms around held her tight. For a few -minutes our sorrowful hearts beat together, whilst the friends around -us turned away their eyes that ran tears silently. Then Van Helsing -turned and said gravely. So gravely that I could not help feeling -that he was in some way inspired, and was stating things outside -himself. - -"It may be that you may have to bear that mark till God himself see -fit, as He most surely shall, on the Judgement Day, to redress all -wrongs of the earth and of His children that He has placed thereon. -And oh, Madam Mina, my dear, my dear, may we who love you be there to -see, when that red scar, the sign of God's knowledge of what has been, -shall pass away, and leave your forehead as pure as the heart we know. -For so surely as we live, that scar shall pass away when God sees -right to lift the burden that is hard upon us. Till then we bear our -Cross, as His Son did in obedience to His Will. It may be that we are -chosen instruments of His good pleasure, and that we ascend to His -bidding as that other through stripes and shame. Through tears and -blood. Through doubts and fear, and all that makes the difference -between God and man." - -There was hope in his words, and comfort. And they made for -resignation. Mina and I both felt so, and simultaneously we each took -one of the old man's hands and bent over and kissed it. Then without -a word we all knelt down together, and all holding hands, swore to be -true to each other. We men pledged ourselves to raise the veil of -sorrow from the head of her whom, each in his own way, we loved. And -we prayed for help and guidance in the terrible task which lay before -us. It was then time to start. So I said farewell to Mina, a parting -which neither of us shall forget to our dying day, and we set out. - -To one thing I have made up my mind. If we find out that Mina must be -a vampire in the end, then she shall not go into that unknown and -terrible land alone. I suppose it is thus that in old times one -vampire meant many. Just as their hideous bodies could only rest in -sacred earth, so the holiest love was the recruiting sergeant for -their ghastly ranks. - -We entered Carfax without trouble and found all things the same as on -the first occasion. It was hard to believe that amongst so prosaic -surroundings of neglect and dust and decay there was any ground for -such fear as already we knew. Had not our minds been made up, and had -there not been terrible memories to spur us on, we could hardly have -proceeded with our task. We found no papers, or any sign of use in -the house. And in the old chapel the great boxes looked just as we -had seen them last. - -Dr. Van Helsing said to us solemnly as we stood before him, "And now, -my friends, we have a duty here to do. We must sterilize this earth, -so sacred of holy memories, that he has brought from a far distant -land for such fell use. He has chosen this earth because it has been -holy. Thus we defeat him with his own weapon, for we make it more -holy still. It was sanctified to such use of man, now we sanctify it -to God." - -As he spoke he took from his bag a screwdriver and a wrench, and very -soon the top of one of the cases was thrown open. The earth smelled -musty and close, but we did not somehow seem to mind, for our -attention was concentrated on the Professor. Taking from his box a -piece of the Sacred Wafer he laid it reverently on the earth, and then -shutting down the lid began to screw it home, we aiding him as he -worked. - -One by one we treated in the same way each of the great boxes, and -left them as we had found them to all appearance. But in each was a -portion of the Host. When we closed the door behind us, the Professor -said solemnly, "So much is already done. It may be that with all the -others we can be so successful, then the sunset of this evening may -shine of Madam Mina's forehead all white as ivory and with no stain!" - -As we passed across the lawn on our way to the station to catch our -train we could see the front of the asylum. I looked eagerly, and in -the window of my own room saw Mina. I waved my hand to her, and -nodded to tell that our work there was successfully accomplished. She -nodded in reply to show that she understood. The last I saw, she was -waving her hand in farewell. It was with a heavy heart that we sought -the station and just caught the train, which was steaming in as we -reached the platform. I have written this in the train. - - -Piccadilly, 12:30 o'clock.--Just before we reached Fenchurch Street -Lord Godalming said to me, "Quincey and I will find a locksmith. You -had better not come with us in case there should be any difficulty. -For under the circumstances it wouldn't seem so bad for us to break -into an empty house. But you are a solicitor and the Incorporated Law -Society might tell you that you should have known better." - -I demurred as to my not sharing any danger even of odium, but he went -on, "Besides, it will attract less attention if there are not too many -of us. My title will make it all right with the locksmith, and with -any policeman that may come along. You had better go with Jack and -the Professor and stay in the Green Park. Somewhere in sight of the -house, and when you see the door opened and the smith has gone away, -do you all come across. We shall be on the lookout for you, and shall -let you in." - -"The advice is good!" said Van Helsing, so we said no more. Godalming -and Morris hurried off in a cab, we following in another. At the -corner of Arlington Street our contingent got out and strolled into -the Green Park. My heart beat as I saw the house on which so much of -our hope was centred, looming up grim and silent in its deserted -condition amongst its more lively and spruce-looking neighbours. We -sat down on a bench within good view, and began to smoke cigars so as -to attract as little attention as possible. The minutes seemed to -pass with leaden feet as we waited for the coming of the others. - -At length we saw a four-wheeler drive up. Out of it, in leisurely -fashion, got Lord Godalming and Morris. And down from the box -descended a thick-set working man with his rush-woven basket of tools. -Morris paid the cabman, who touched his hat and drove away. Together -the two ascended the steps, and Lord Godalming pointed out what he -wanted done. The workman took off his coat leisurely and hung it on -one of the spikes of the rail, saying something to a policeman who -just then sauntered along. The policeman nodded acquiescence, and the -man kneeling down placed his bag beside him. After searching through -it, he took out a selection of tools which he proceeded to lay beside -him in orderly fashion. Then he stood up, looked in the keyhole, blew -into it, and turning to his employers, made some remark. Lord -Godalming smiled, and the man lifted a good sized bunch of keys. -Selecting one of them, he began to probe the lock, as if feeling his -way with it. After fumbling about for a bit he tried a second, and -then a third. All at once the door opened under a slight push from -him, and he and the two others entered the hall. We sat still. My -own cigar burnt furiously, but Van Helsing's went cold altogether. We -waited patiently as we saw the workman come out and bring his bag. -Then he held the door partly open, steadying it with his knees, whilst -he fitted a key to the lock. This he finally handed to Lord -Godalming, who took out his purse and gave him something. The man -touched his hat, took his bag, put on his coat and departed. Not a -soul took the slightest notice of the whole transaction. - -When the man had fairly gone, we three crossed the street and knocked -at the door. It was immediately opened by Quincey Morris, beside whom -stood Lord Godalming lighting a cigar. - -"The place smells so vilely," said the latter as we came in. It did -indeed smell vilely. Like the old chapel at Carfax. And with our -previous experience it was plain to us that the Count had been using -the place pretty freely. We moved to explore the house, all keeping -together in case of attack, for we knew we had a strong and wily enemy -to deal with, and as yet we did not know whether the Count might not -be in the house. - -In the dining room, which lay at the back of the hall, we found eight -boxes of earth. Eight boxes only out of the nine which we sought! -Our work was not over, and would never be until we should have found -the missing box. - -First we opened the shutters of the window which looked out across a -narrow stone flagged yard at the blank face of a stable, pointed to -look like the front of a miniature house. There were no windows in -it, so we were not afraid of being overlooked. We did not lose any -time in examining the chests. With the tools which we had brought -with us we opened them, one by one, and treated them as we had treated -those others in the old chapel. It was evident to us that the Count -was not at present in the house, and we proceeded to search for any of -his effects. - -After a cursory glance at the rest of the rooms, from basement to -attic, we came to the conclusion that the dining room contained any -effects which might belong to the Count. And so we proceeded to -minutely examine them. They lay in a sort of orderly disorder on the -great dining room table. - -There were title deeds of the Piccadilly house in a great bundle, -deeds of the purchase of the houses at Mile End and Bermondsey, -notepaper, envelopes, and pens and ink. All were covered up in thin -wrapping paper to keep them from the dust. There were also a clothes -brush, a brush and comb, and a jug and basin. The latter containing -dirty water which was reddened as if with blood. Last of all was a -little heap of keys of all sorts and sizes, probably those belonging -to the other houses. - -When we had examined this last find, Lord Godalming and Quincey Morris -taking accurate notes of the various addresses of the houses in the -East and the South, took with them the keys in a great bunch, and set -out to destroy the boxes in these places. The rest of us are, with -what patience we can, waiting their return, or the coming of the -Count. - - - - -CHAPTER 23 - - -DR. SEWARD'S DIARY - -3 October.--The time seemed terribly long whilst we were waiting for -the coming of Godalming and Quincey Morris. The Professor tried to -keep our minds active by using them all the time. I could see his -beneficent purpose, by the side glances which he threw from time to -time at Harker. The poor fellow is overwhelmed in a misery that is -appalling to see. Last night he was a frank, happy-looking man, with -strong, youthful face, full of energy, and with dark brown hair. -Today he is a drawn, haggard old man, whose white hair matches well -with the hollow burning eyes and grief-written lines of his face. His -energy is still intact. In fact, he is like a living flame. This may -yet be his salvation, for if all go well, it will tide him over the -despairing period. He will then, in a kind of way, wake again to the -realities of life. Poor fellow, I thought my own trouble was bad -enough, but his . . . ! - -The Professor knows this well enough, and is doing his best to keep -his mind active. What he has been saying was, under the -circumstances, of absorbing interest. So well as I can remember, here -it is: - -"I have studied, over and over again since they came into my hands, -all the papers relating to this monster, and the more I have studied, -the greater seems the necessity to utterly stamp him out. All through -there are signs of his advance. Not only of his power, but of his -knowledge of it. As I learned from the researches of my friend -Arminius of Buda-Pesth, he was in life a most wonderful man. Soldier, -statesman, and alchemist--which latter was the highest development of -the science knowledge of his time. He had a mighty brain, a learning -beyond compare, and a heart that knew no fear and no remorse. He -dared even to attend the Scholomance, and there was no branch of -knowledge of his time that he did not essay. - -"Well, in him the brain powers survived the physical death. Though it -would seem that memory was not all complete. In some faculties of -mind he has been, and is, only a child. But he is growing, and some -things that were childish at the first are now of man's stature. He -is experimenting, and doing it well. And if it had not been that we -have crossed his path he would be yet, he may be yet if we fail, the -father or furtherer of a new order of beings, whose road must lead -through Death, not Life." - -Harker groaned and said, "And this is all arrayed against my darling! -But how is he experimenting? The knowledge may help us to defeat -him!" - -"He has all along, since his coming, been trying his power, slowly but -surely. That big child-brain of his is working. Well for us, it is -as yet a child-brain. For had he dared, at the first, to attempt -certain things he would long ago have been beyond our power. However, -he means to succeed, and a man who has centuries before him can afford -to wait and to go slow. Festina lente may well be his motto." - -"I fail to understand," said Harker wearily. "Oh, do be more plain to -me! Perhaps grief and trouble are dulling my brain." - -The Professor laid his hand tenderly on his shoulder as he spoke, "Ah, -my child, I will be plain. Do you not see how, of late, this monster -has been creeping into knowledge experimentally. How he has been -making use of the zoophagous patient to effect his entry into friend -John's home. For your Vampire, though in all afterwards he can come -when and how he will, must at the first make entry only when asked -thereto by an inmate. But these are not his most important -experiments. Do we not see how at the first all these so great boxes -were moved by others. He knew not then but that must be so. But all -the time that so great child-brain of his was growing, and he began to -consider whether he might not himself move the box. So he began to -help. And then, when he found that this be all right, he try to move -them all alone. And so he progress, and he scatter these graves of -him. And none but he know where they are hidden. - -"He may have intend to bury them deep in the ground. So that only he -use them in the night, or at such time as he can change his form, they -do him equal well, and none may know these are his hiding place! But, -my child, do not despair, this knowledge came to him just too late! -Already all of his lairs but one be sterilize as for him. And before -the sunset this shall be so. Then he have no place where he can move -and hide. I delayed this morning that so we might be sure. Is there -not more at stake for us than for him? Then why not be more careful -than him? By my clock it is one hour and already, if all be well, -friend Arthur and Quincey are on their way to us. Today is our day, -and we must go sure, if slow, and lose no chance. See! There are -five of us when those absent ones return." - -Whilst we were speaking we were startled by a knock at the hall door, -the double postman's knock of the telegraph boy. We all moved out to -the hall with one impulse, and Van Helsing, holding up his hand to us -to keep silence, stepped to the door and opened it. The boy handed in -a dispatch. The Professor closed the door again, and after looking at -the direction, opened it and read aloud. - -"Look out for D. He has just now, 12:45, come from Carfax -hurriedly and hastened towards the South. He seems to be -going the round and may want to see you: Mina." - -There was a pause, broken by Jonathan Harker's voice, "Now, God be -thanked, we shall soon meet!" - -Van Helsing turned to him quickly and said, "God will act in His own -way and time. Do not fear, and do not rejoice as yet. For what we -wish for at the moment may be our own undoings." - -"I care for nothing now," he answered hotly, "except to wipe out this -brute from the face of creation. I would sell my soul to do it!" - -"Oh, hush, hush, my child!" said Van Helsing. "God does not purchase -souls in this wise, and the Devil, though he may purchase, does not -keep faith. But God is merciful and just, and knows your pain and -your devotion to that dear Madam Mina. Think you, how her pain would -be doubled, did she but hear your wild words. Do not fear any of us, -we are all devoted to this cause, and today shall see the end. The -time is coming for action. Today this Vampire is limit to the powers -of man, and till sunset he may not change. It will take him time to -arrive here, see it is twenty minutes past one, and there are yet some -times before he can hither come, be he never so quick. What we must -hope for is that my Lord Arthur and Quincey arrive first." - -About half an hour after we had received Mrs. Harker's telegram, there -came a quiet, resolute knock at the hall door. It was just an -ordinary knock, such as is given hourly by thousands of gentlemen, but -it made the Professor's heart and mine beat loudly. We looked at each -other, and together moved out into the hall. We each held ready to -use our various armaments, the spiritual in the left hand, the mortal -in the right. Van Helsing pulled back the latch, and holding the door -half open, stood back, having both hands ready for action. The -gladness of our hearts must have shown upon our faces when on the -step, close to the door, we saw Lord Godalming and Quincey Morris. -They came quickly in and closed the door behind them, the former -saying, as they moved along the hall: - -"It is all right. We found both places. Six boxes in each and we -destroyed them all." - -"Destroyed?" asked the Professor. - -"For him!" We were silent for a minute, and then Quincey said, -"There's nothing to do but to wait here. If, however, he doesn't turn -up by five o'clock, we must start off. For it won't do to leave Mrs. -Harker alone after sunset." - -"He will be here before long now," said Van Helsing, who had been -consulting his pocketbook. "Nota bene, in Madam's telegram he went -south from Carfax. That means he went to cross the river, and he -could only do so at slack of tide, which should be something before -one o'clock. That he went south has a meaning for us. He is as yet -only suspicious, and he went from Carfax first to the place where he -would suspect interference least. You must have been at Bermondsey -only a short time before him. That he is not here already shows that -he went to Mile End next. This took him some time, for he would then -have to be carried over the river in some way. Believe me, my -friends, we shall not have long to wait now. We should have ready -some plan of attack, so that we may throw away no chance. Hush, there -is no time now. Have all your arms! Be ready!" He held up a warning -hand as he spoke, for we all could hear a key softly inserted in the -lock of the hall door. - -I could not but admire, even at such a moment, the way in which a -dominant spirit asserted itself. In all our hunting parties and -adventures in different parts of the world, Quincey Morris had always -been the one to arrange the plan of action, and Arthur and I had been -accustomed to obey him implicitly. Now, the old habit seemed to be -renewed instinctively. With a swift glance around the room, he at -once laid out our plan of attack, and without speaking a word, with a -gesture, placed us each in position. Van Helsing, Harker, and I were -just behind the door, so that when it was opened the Professor could -guard it whilst we two stepped between the incomer and the door. -Godalming behind and Quincey in front stood just out of sight ready to -move in front of the window. We waited in a suspense that made the -seconds pass with nightmare slowness. The slow, careful steps came -along the hall. The Count was evidently prepared for some surprise, -at least he feared it. - -Suddenly with a single bound he leaped into the room. Winning a way -past us before any of us could raise a hand to stay him. There was -something so pantherlike in the movement, something so unhuman, that -it seemed to sober us all from the shock of his coming. The first to -act was Harker, who with a quick movement, threw himself before the -door leading into the room in the front of the house. As the Count -saw us, a horrible sort of snarl passed over his face, showing the -eyeteeth long and pointed. But the evil smile as quickly passed into -a cold stare of lion-like disdain. His expression again changed as, -with a single impulse, we all advanced upon him. It was a pity that -we had not some better organized plan of attack, for even at the -moment I wondered what we were to do. I did not myself know whether -our lethal weapons would avail us anything. - -Harker evidently meant to try the matter, for he had ready his great -Kukri knife and made a fierce and sudden cut at him. The blow was a -powerful one; only the diabolical quickness of the Count's leap back -saved him. A second less and the trenchant blade had shorn through -his heart. As it was, the point just cut the cloth of his coat, -making a wide gap whence a bundle of bank notes and a stream -of gold fell out. The expression of the Count's face was so hellish, -that for a moment I feared for Harker, though I saw him throw the -terrible knife aloft again for another stroke. Instinctively I moved -forward with a protective impulse, holding the Crucifix and Wafer in -my left hand. I felt a mighty power fly along my arm, and it was -without surprise that I saw the monster cower back before a similar -movement made spontaneously by each one of us. It would be impossible -to describe the expression of hate and baffled malignity, of anger and -hellish rage, which came over the Count's face. His waxen hue became -greenish-yellow by the contrast of his burning eyes, and the red scar -on the forehead showed on the pallid skin like a palpitating wound. -The next instant, with a sinuous dive he swept under Harker's arm, ere -his blow could fall, and grasping a handful of the money from the -floor, dashed across the room, threw himself at the window. Amid the -crash and glitter of the falling glass, he tumbled into the flagged -area below. Through the sound of the shivering glass I could hear the -"ting" of the gold, as some of the sovereigns fell on the flagging. - -We ran over and saw him spring unhurt from the ground. He, rushing up -the steps, crossed the flagged yard, and pushed open the stable door. -There he turned and spoke to us. - -"You think to baffle me, you with your pale faces all in a row, like -sheep in a butcher's. You shall be sorry yet, each one of you! You -think you have left me without a place to rest, but I have more. My -revenge is just begun! I spread it over centuries, and time is on my -side. Your girls that you all love are mine already. And through -them you and others shall yet be mine, my creatures, to do my bidding -and to be my jackals when I want to feed. Bah!" - -With a contemptuous sneer, he passed quickly through the door, and we -heard the rusty bolt creak as he fastened it behind him. A door -beyond opened and shut. The first of us to speak was the Professor. -Realizing the difficulty of following him through the stable, we moved -toward the hall. - -"We have learnt something . . . much! Notwithstanding his brave words, -he fears us. He fears time, he fears want! For if not, why he hurry -so? His very tone betray him, or my ears deceive. Why take that -money? You follow quick. You are hunters of the wild beast, and -understand it so. For me, I make sure that nothing here may be of use -to him, if so that he returns." - -As he spoke he put the money remaining in his pocket, took the title -deeds in the bundle as Harker had left them, and swept the remaining -things into the open fireplace, where he set fire to them with a -match. - -Godalming and Morris had rushed out into the yard, and Harker had -lowered himself from the window to follow the Count. He had, however, -bolted the stable door, and by the time they had forced it open there -was no sign of him. Van Helsing and I tried to make inquiry at the -back of the house. But the mews was deserted and no one had seen him -depart. - -It was now late in the afternoon, and sunset was not far off. We had -to recognize that our game was up. With heavy hearts we agreed with -the Professor when he said, "Let us go back to Madam Mina. Poor, poor -dear Madam Mina. All we can do just now is done, and we can there, at -least, protect her. But we need not despair. There is but one more -earth box, and we must try to find it. When that is done all may yet -be well." - -I could see that he spoke as bravely as he could to comfort Harker. -The poor fellow was quite broken down, now and again he gave a low -groan which he could not suppress. He was thinking of his wife. - -With sad hearts we came back to my house, where we found Mrs. Harker -waiting us, with an appearance of cheerfulness which did honour to her -bravery and unselfishness. When she saw our faces, her own became as -pale as death. For a second or two her eyes were closed as if she -were in secret prayer. - -And then she said cheerfully, "I can never thank you all enough. Oh, -my poor darling!" - -As she spoke, she took her husband's grey head in her hands and kissed -it. - -"Lay your poor head here and rest it. All will yet be well, dear! God -will protect us if He so will it in His good intent." The poor fellow -groaned. There was no place for words in his sublime misery. - -We had a sort of perfunctory supper together, and I think it cheered -us all up somewhat. It was, perhaps, the mere animal heat of food to -hungry people, for none of us had eaten anything since breakfast, or -the sense of companionship may have helped us, but anyhow we were all -less miserable, and saw the morrow as not altogether without hope. - -True to our promise, we told Mrs. Harker everything which had passed. -And although she grew snowy white at times when danger had seemed to -threaten her husband, and red at others when his devotion to her was -manifested, she listened bravely and with calmness. When we came to -the part where Harker had rushed at the Count so recklessly, she clung -to her husband's arm, and held it tight as though her clinging could -protect him from any harm that might come. She said nothing, however, -till the narration was all done, and matters had been brought up to -the present time. - -Then without letting go her husband's hand she stood up amongst us and -spoke. Oh, that I could give any idea of the scene. Of that sweet, -sweet, good, good woman in all the radiant beauty of her youth and -animation, with the red scar on her forehead, of which she was -conscious, and which we saw with grinding of our teeth, remembering -whence and how it came. Her loving kindness against our grim hate. -Her tender faith against all our fears and doubting. And we, knowing -that so far as symbols went, she with all her goodness and purity and -faith, was outcast from God. - -"Jonathan," she said, and the word sounded like music on her lips it -was so full of love and tenderness, "Jonathan dear, and you all my -true, true friends, I want you to bear something in mind through all -this dreadful time. I know that you must fight. That you must -destroy even as you destroyed the false Lucy so that the true Lucy -might live hereafter. But it is not a work of hate. That poor soul -who has wrought all this misery is the saddest case of all. Just -think what will be his joy when he, too, is destroyed in his worser -part that his better part may have spiritual immortality. You must be -pitiful to him, too, though it may not hold your hands from his -destruction." - -As she spoke I could see her husband's face darken and draw together, -as though the passion in him were shriveling his being to its core. -Instinctively the clasp on his wife's hand grew closer, till his -knuckles looked white. She did not flinch from the pain which I knew -she must have suffered, but looked at him with eyes that were more -appealing than ever. - -As she stopped speaking he leaped to his feet, almost tearing his hand -from hers as he spoke. - -"May God give him into my hand just for long enough to destroy that -earthly life of him which we are aiming at. If beyond it I could send -his soul forever and ever to burning hell I would do it!" - -"Oh, hush! Oh, hush in the name of the good God. Don't say such -things, Jonathan, my husband, or you will crush me with fear and -horror. Just think, my dear . . . I have been thinking all this long, -long day of it . . . that . . . perhaps . . . some day . . . I, too, may -need such pity, and that some other like you, and with equal cause for -anger, may deny it to me! Oh, my husband! My husband, indeed I would -have spared you such a thought had there been another way. But I pray -that God may not have treasured your wild words, except as the -heart-broken wail of a very loving and sorely stricken man. Oh, God, -let these poor white hairs go in evidence of what he has suffered, who -all his life has done no wrong, and on whom so many sorrows have -come." - -We men were all in tears now. There was no resisting them, and we -wept openly. She wept, too, to see that her sweeter counsels had -prevailed. Her husband flung himself on his knees beside her, and -putting his arms round her, hid his face in the folds of her dress. -Van Helsing beckoned to us and we stole out of the room, leaving the -two loving hearts alone with their God. - -Before they retired the Professor fixed up the room against any coming -of the Vampire, and assured Mrs. Harker that she might rest in peace. -She tried to school herself to the belief, and manifestly for her -husband's sake, tried to seem content. It was a brave struggle, and -was, I think and believe, not without its reward. Van Helsing had -placed at hand a bell which either of them was to sound in case of any -emergency. When they had retired, Quincey, Godalming, and I arranged -that we should sit up, dividing the night between us, and watch over -the safety of the poor stricken lady. The first watch falls to -Quincey, so the rest of us shall be off to bed as soon as we can. - -Godalming has already turned in, for his is the second watch. Now -that my work is done I, too, shall go to bed. - - - -JONATHAN HARKER'S JOURNAL - -3-4 October, close to midnight.--I thought yesterday would never end. -There was over me a yearning for sleep, in some sort of blind belief -that to wake would be to find things changed, and that any change must -now be for the better. Before we parted, we discussed what our next -step was to be, but we could arrive at no result. All we knew was -that one earth box remained, and that the Count alone knew where it -was. If he chooses to lie hidden, he may baffle us for years. And in -the meantime, the thought is too horrible, I dare not think of it even -now. This I know, that if ever there was a woman who was all -perfection, that one is my poor wronged darling. I loved her a -thousand times more for her sweet pity of last night, a pity that made -my own hate of the monster seem despicable. Surely God will not -permit the world to be the poorer by the loss of such a creature. This -is hope to me. We are all drifting reefwards now, and faith is our -only anchor. Thank God! Mina is sleeping, and sleeping without -dreams. I fear what her dreams might be like, with such terrible -memories to ground them in. She has not been so calm, within my -seeing, since the sunset. Then, for a while, there came over her face -a repose which was like spring after the blasts of March. I thought -at the time that it was the softness of the red sunset on her face, -but somehow now I think it has a deeper meaning. I am not sleepy -myself, though I am weary . . . weary to death. However, I must try -to sleep. For there is tomorrow to think of, and there is no rest for -me until . . . - - -Later--I must have fallen asleep, for I was awakened by Mina, who was -sitting up in bed, with a startled look on her face. I could see -easily, for we did not leave the room in darkness. She had placed a -warning hand over my mouth, and now she whispered in my ear, "Hush! -There is someone in the corridor!" I got up softly, and crossing the -room, gently opened the door. - -Just outside, stretched on a mattress, lay Mr. Morris, wide awake. He -raised a warning hand for silence as he whispered to me, "Hush! Go -back to bed. It is all right. One of us will be here all night. We -don't mean to take any chances!" - -His look and gesture forbade discussion, so I came back and told Mina. -She sighed and positively a shadow of a smile stole over her poor, -pale face as she put her arms round me and said softly, "Oh, thank God -for good brave men!" With a sigh she sank back again to sleep. I -write this now as I am not sleepy, though I must try again. - - -4 October, morning.--Once again during the night I was wakened by -Mina. This time we had all had a good sleep, for the grey of the -coming dawn was making the windows into sharp oblongs, and the gas -flame was like a speck rather than a disc of light. - -She said to me hurriedly, "Go, call the Professor. I want to see him -at once." - -"Why?" I asked. - -"I have an idea. I suppose it must have come in the night, and -matured without my knowing it. He must hypnotize me before the dawn, -and then I shall be able to speak. Go quick, dearest, the time is -getting close." - -I went to the door. Dr. Seward was resting on the mattress, and -seeing me, he sprang to his feet. - -"Is anything wrong?" he asked, in alarm. - -"No," I replied. "But Mina wants to see Dr. Van Helsing at once." - -"I will go," he said, and hurried into the Professor's room. - -Two or three minutes later Van Helsing was in the room in his dressing -gown, and Mr. Morris and Lord Godalming were with Dr. Seward at the -door asking questions. When the Professor saw Mina a smile, a -positive smile ousted the anxiety of his face. - -He rubbed his hands as he said, "Oh, my dear Madam Mina, this is -indeed a change. See! Friend Jonathan, we have got our dear Madam -Mina, as of old, back to us today!" Then turning to her, he said -cheerfully, "And what am I to do for you? For at this hour you do not -want me for nothing." - -"I want you to hypnotize me!" she said. "Do it before the dawn, for I -feel that then I can speak, and speak freely. Be quick, for the time -is short!" Without a word he motioned her to sit up in bed. - -Looking fixedly at her, he commenced to make passes in front of her, -from over the top of her head downward, with each hand in turn. Mina -gazed at him fixedly for a few minutes, during which my own heart beat -like a trip hammer, for I felt that some crisis was at hand. -Gradually her eyes closed, and she sat, stock still. Only by the -gentle heaving of her bosom could one know that she was alive. The -Professor made a few more passes and then stopped, and I could see -that his forehead was covered with great beads of perspiration. Mina -opened her eyes, but she did not seem the same woman. There was a -far-away look in her eyes, and her voice had a sad dreaminess which -was new to me. Raising his hand to impose silence, the Professor -motioned to me to bring the others in. They came on tiptoe, closing -the door behind them, and stood at the foot of the bed, looking on. -Mina appeared not to see them. The stillness was broken by Van -Helsing's voice speaking in a low level tone which would not break the -current of her thoughts. - -"Where are you?" The answer came in a neutral way. - -"I do not know. Sleep has no place it can call its own." For several -minutes there was silence. Mina sat rigid, and the Professor stood -staring at her fixedly. - -The rest of us hardly dared to breathe. The room was growing lighter. -Without taking his eyes from Mina's face, Dr. Van Helsing motioned me -to pull up the blind. I did so, and the day seemed just upon us. A -red streak shot up, and a rosy light seemed to diffuse itself through -the room. On the instant the Professor spoke again. - -"Where are you now?" - -The answer came dreamily, but with intention. It were as though she -were interpreting something. I have heard her use the same tone when -reading her shorthand notes. - -"I do not know. It is all strange to me!" - -"What do you see?" - -"I can see nothing. It is all dark." - -"What do you hear?" I could detect the strain in the Professor's -patient voice. - -"The lapping of water. It is gurgling by, and little waves leap. I -can hear them on the outside." - -"Then you are on a ship?'" - -We all looked at each other, trying to glean something each from the -other. We were afraid to think. - -The answer came quick, "Oh, yes!" - -"What else do you hear?" - -"The sound of men stamping overhead as they run about. There is the -creaking of a chain, and the loud tinkle as the check of the capstan -falls into the ratchet." - -"What are you doing?" - -"I am still, oh so still. It is like death!" The voice faded away -into a deep breath as of one sleeping, and the open eyes closed again. - -By this time the sun had risen, and we were all in the full light of -day. Dr. Van Helsing placed his hands on Mina's shoulders, and laid -her head down softly on her pillow. She lay like a sleeping child for -a few moments, and then, with a long sigh, awoke and stared in wonder -to see us all around her. - -"Have I been talking in my sleep?" was all she said. She seemed, -however, to know the situation without telling, though she was eager -to know what she had told. The Professor repeated the conversation, -and she said, "Then there is not a moment to lose. It may not be yet -too late!" - -Mr. Morris and Lord Godalming started for the door but the Professor's -calm voice called them back. - -"Stay, my friends. That ship, wherever it was, was weighing anchor at -the moment in your so great Port of London. Which of them is it that -you seek? God be thanked that we have once again a clue, though -whither it may lead us we know not. We have been blind somewhat. -Blind after the manner of men, since we can look back we see what we -might have seen looking forward if we had been able to see what we -might have seen! Alas, but that sentence is a puddle, is it not? We -can know now what was in the Count's mind, when he seize that money, -though Jonathan's so fierce knife put him in the danger that even he -dread. He meant escape. Hear me, ESCAPE! He saw that with but one -earth box left, and a pack of men following like dogs after a fox, -this London was no place for him. He have take his last earth box on -board a ship, and he leave the land. He think to escape, but no! We -follow him. Tally Ho! As friend Arthur would say when he put on his -red frock! Our old fox is wily. Oh! So wily, and we must follow -with wile. I, too, am wily and I think his mind in a little while. -In meantime we may rest and in peace, for there are between us which -he do not want to pass, and which he could not if he would. Unless -the ship were to touch the land, and then only at full or slack tide. -See, and the sun is just rose, and all day to sunset is us. Let us -take bath, and dress, and have breakfast which we all need, and which -we can eat comfortably since he be not in the same land with us." - -Mina looked at him appealingly as she asked, "But why need we seek him -further, when he is gone away from us?" - -He took her hand and patted it as he replied, "Ask me nothing as yet. -When we have breakfast, then I answer all questions." He would say no -more, and we separated to dress. - -After breakfast Mina repeated her question. He looked at her gravely -for a minute and then said sorrowfully, "Because my dear, dear Madam -Mina, now more than ever must we find him even if we have to follow -him to the jaws of Hell!" - -She grew paler as she asked faintly, "Why?" - -"Because," he answered solemnly, "he can live for centuries, and you -are but mortal woman. Time is now to be dreaded, since once he put -that mark upon your throat." - -I was just in time to catch her as she fell forward in a faint. - - - - -CHAPTER 24 - - -DR. SEWARD'S PHONOGRAPH DIARY - -SPOKEN BY VAN HELSING - -This to Jonathan Harker. - -You are to stay with your dear Madam Mina. We shall go to make our -search, if I can call it so, for it is not search but knowing, and we -seek confirmation only. But do you stay and take care of her today. -This is your best and most holiest office. This day nothing can find -him here. - -Let me tell you that so you will know what we four know already, for I -have tell them. He, our enemy, have gone away. He have gone back to -his Castle in Transylvania. I know it so well, as if a great hand of -fire wrote it on the wall. He have prepare for this in some way, and -that last earth box was ready to ship somewheres. For this he took -the money. For this he hurry at the last, lest we catch him before -the sun go down. It was his last hope, save that he might hide in the -tomb that he think poor Miss Lucy, being as he thought like him, keep -open to him. But there was not of time. When that fail he make -straight for his last resource, his last earth-work I might say did I -wish double entente. He is clever, oh so clever! He know that his -game here was finish. And so he decide he go back home. He find ship -going by the route he came, and he go in it. - -We go off now to find what ship, and whither bound. When we have -discover that, we come back and tell you all. Then we will comfort -you and poor Madam Mina with new hope. For it will be hope when you -think it over, that all is not lost. This very creature that we -pursue, he take hundreds of years to get so far as London. And yet in -one day, when we know of the disposal of him we drive him out. He is -finite, though he is powerful to do much harm and suffers not as we -do. But we are strong, each in our purpose, and we are all more -strong together. Take heart afresh, dear husband of Madam Mina. This -battle is but begun and in the end we shall win. So sure as that God -sits on high to watch over His children. Therefore be of much comfort -till we return. - -VAN HELSING. - - - - - -JONATHAN HARKER'S JOURNAL - -4 October.--When I read to Mina, Van Helsing's message in the -phonograph, the poor girl brightened up considerably. Already the -certainty that the Count is out of the country has given her comfort. -And comfort is strength to her. For my own part, now that his -horrible danger is not face to face with us, it seems almost -impossible to believe in it. Even my own terrible experiences in -Castle Dracula seem like a long forgotten dream. Here in the crisp -autumn air in the bright sunlight. - -Alas! How can I disbelieve! In the midst of my thought my eye fell -on the red scar on my poor darling's white forehead. Whilst that -lasts, there can be no disbelief. Mina and I fear to be idle, so we -have been over all the diaries again and again. Somehow, although the -reality seem greater each time, the pain and the fear seem less. There -is something of a guiding purpose manifest throughout, which is -comforting. Mina says that perhaps we are the instruments of ultimate -good. It may be! I shall try to think as she does. We have never -spoken to each other yet of the future. It is better to wait till we -see the Professor and the others after their investigations. - -The day is running by more quickly than I ever thought a day could run -for me again. It is now three o'clock. - - - - - -MINA HARKER'S JOURNAL - -5 October, 5 P.M.--Our meeting for report. Present: Professor Van -Helsing, Lord Godalming, Dr. Seward, Mr. Quincey Morris, Jonathan -Harker, Mina Harker. - -Dr. Van Helsing described what steps were taken during the day to -discover on what boat and whither bound Count Dracula made his escape. - -"As I knew that he wanted to get back to Transylvania, I felt sure -that he must go by the Danube mouth, or by somewhere in the Black Sea, -since by that way he come. It was a dreary blank that was before us. -Omme ignotum pro magnifico, and so with heavy hearts we start to find -what ships leave for the Black Sea last night. He was in sailing -ship, since Madam Mina tell of sails being set. These not so -important as to go in your list of the shipping in the Times, and so -we go, by suggestion of Lord Godalming, to your Lloyd's, where are -note of all ships that sail, however so small. There we find that -only one Black Sea bound ship go out with the tide. She is the -Czarina Catherine, and she sail from Doolittle's Wharf for Varna, and -thence to other ports and up the Danube. 'So!' said I, 'this is the -ship whereon is the Count.' So off we go to Doolittle's Wharf, and -there we find a man in an office. From him we inquire of the goings -of the Czarina Catherine. He swear much, and he red face and loud of -voice, but he good fellow all the same. And when Quincey give him -something from his pocket which crackle as he roll it up, and put it -in a so small bag which he have hid deep in his clothing, he still -better fellow and humble servant to us. He come with us, and ask many -men who are rough and hot. These be better fellows too when they have -been no more thirsty. They say much of blood and bloom, and of others -which I comprehend not, though I guess what they mean. But -nevertheless they tell us all things which we want to know. - -"They make known to us among them, how last afternoon at about five -o'clock comes a man so hurry. A tall man, thin and pale, with high -nose and teeth so white, and eyes that seem to be burning. That he be -all in black, except that he have a hat of straw which suit not him or -the time. That he scatter his money in making quick inquiry as to -what ship sails for the Black Sea and for where. Some took him to the -office and then to the ship, where he will not go aboard but halt at -shore end of gangplank, and ask that the captain come to him. The -captain come, when told that he will be pay well, and though he swear -much at the first he agree to term. Then the thin man go and some one -tell him where horse and cart can be hired. He go there and soon he -come again, himself driving cart on which a great box. This he -himself lift down, though it take several to put it on truck for the -ship. He give much talk to captain as to how and where his box is to -be place. But the captain like it not and swear at him in many -tongues, and tell him that if he like he can come and see where it -shall be. But he say 'no,' that he come not yet, for that he have -much to do. Whereupon the captain tell him that he had better be -quick, with blood, for that his ship will leave the place, of blood, -before the turn of the tide, with blood. Then the thin man smile and -say that of course he must go when he think fit, but he will be -surprise if he go quite so soon. The captain swear again, polyglot, -and the thin man make him bow, and thank him, and say that he will so -far intrude on his kindness as to come aboard before the sailing. -Final the captain, more red than ever, and in more tongues, tell him -that he doesn't want no Frenchmen, with bloom upon them and also with -blood, in his ship, with blood on her also. And so, after asking -where he might purchase ship forms, he departed. - -"No one knew where he went 'or bloomin' well cared' as they said, for -they had something else to think of, well with blood again. For it -soon became apparent to all that the Czarina Catherine would not sail -as was expected. A thin mist began to creep up from the river, and it -grew, and grew. Till soon a dense fog enveloped the ship and all -around her. The captain swore polyglot, very polyglot, polyglot with -bloom and blood, but he could do nothing. The water rose and rose, -and he began to fear that he would lose the tide altogether. He was -in no friendly mood, when just at full tide, the thin man came up the -gangplank again and asked to see where his box had been stowed. Then -the captain replied that he wished that he and his box, old and with -much bloom and blood, were in hell. But the thin man did not be -offend, and went down with the mate and saw where it was place, and -came up and stood awhile on deck in fog. He must have come off by -himself, for none notice him. Indeed they thought not of him, for -soon the fog begin to melt away, and all was clear again. My friends -of the thirst and the language that was of bloom and blood laughed, as -they told how the captain's swears exceeded even his usual polyglot, -and was more than ever full of picturesque, when on questioning other -mariners who were on movement up and down the river that hour, he -found that few of them had seen any of fog at all, except where it lay -round the wharf. However, the ship went out on the ebb tide, and was -doubtless by morning far down the river mouth. She was then, when -they told us, well out to sea. - -"And so, my dear Madam Mina, it is that we have to rest for a time, -for our enemy is on the sea, with the fog at his command, on his way -to the Danube mouth. To sail a ship takes time, go she never so -quick. And when we start to go on land more quick, and we meet him -there. Our best hope is to come on him when in the box between -sunrise and sunset. For then he can make no struggle, and we may deal -with him as we should. There are days for us, in which we can make -ready our plan. We know all about where he go. For we have seen the -owner of the ship, who have shown us invoices and all papers that can -be. The box we seek is to be landed in Varna, and to be given to an -agent, one Ristics who will there present his credentials. And so our -merchant friend will have done his part. When he ask if there be any -wrong, for that so, he can telegraph and have inquiry made at Varna, -we say 'no,' for what is to be done is not for police or of the -customs. It must be done by us alone and in our own way." - -When Dr. Van Helsing had done speaking, I asked him if he were certain -that the Count had remained on board the ship. He replied, "We have -the best proof of that, your own evidence, when in the hypnotic trance -this morning." - -I asked him again if it were really necessary that they should pursue -the Count, for oh! I dread Jonathan leaving me, and I know that he -would surely go if the others went. He answered in growing passion, -at first quietly. As he went on, however, he grew more angry and more -forceful, till in the end we could not but see wherein was at least -some of that personal dominance which made him so long a master -amongst men. - -"Yes, it is necessary, necessary, necessary! For your sake in the -first, and then for the sake of humanity. This monster has done much -harm already, in the narrow scope where he find himself, and in the -short time when as yet he was only as a body groping his so small -measure in darkness and not knowing. All this have I told these -others. You, my dear Madam Mina, will learn it in the phonograph of -my friend John, or in that of your husband. I have told them how the -measure of leaving his own barren land, barren of peoples, and coming -to a new land where life of man teems till they are like the multitude -of standing corn, was the work of centuries. Were another of the -Undead, like him, to try to do what he has done, perhaps not all the -centuries of the world that have been, or that will be, could aid him. -With this one, all the forces of nature that are occult and deep and -strong must have worked together in some wonderous way. The very -place, where he have been alive, Undead for all these centuries, is -full of strangeness of the geologic and chemical world. There are -deep caverns and fissures that reach none know whither. There have -been volcanoes, some of whose openings still send out waters of -strange properties, and gases that kill or make to vivify. Doubtless, -there is something magnetic or electric in some of these combinations -of occult forces which work for physical life in strange way, and in -himself were from the first some great qualities. In a hard and -warlike time he was celebrate that he have more iron nerve, more -subtle brain, more braver heart, than any man. In him some vital -principle have in strange way found their utmost. And as his body -keep strong and grow and thrive, so his brain grow too. All this -without that diabolic aid which is surely to him. For it have to -yield to the powers that come from, and are, symbolic of good. And -now this is what he is to us. He have infect you, oh forgive me, my -dear, that I must say such, but it is for good of you that I speak. He -infect you in such wise, that even if he do no more, you have only to -live, to live in your own old, sweet way, and so in time, death, which -is of man's common lot and with God's sanction, shall make you like to -him. This must not be! We have sworn together that it must not. -Thus are we ministers of God's own wish. That the world, and men for -whom His Son die, will not be given over to monsters, whose very -existence would defame Him. He have allowed us to redeem one soul -already, and we go out as the old knights of the Cross to redeem -more. Like them we shall travel towards the sunrise. And like them, -if we fall, we fall in good cause." - -He paused and I said, "But will not the Count take his rebuff wisely? -Since he has been driven from England, will he not avoid it, as a -tiger does the village from which he has been hunted?" - -"Aha!" he said, "your simile of the tiger good, for me, and I shall -adopt him. Your maneater, as they of India call the tiger who has -once tasted blood of the human, care no more for the other prey, but -prowl unceasing till he get him. This that we hunt from our village -is a tiger, too, a maneater, and he never cease to prowl. Nay, in -himself he is not one to retire and stay afar. In his life, his -living life, he go over the Turkey frontier and attack his enemy on -his own ground. He be beaten back, but did he stay? No! He come -again, and again, and again. Look at his persistence and endurance. -With the child-brain that was to him he have long since conceive the -idea of coming to a great city. What does he do? He find out the -place of all the world most of promise for him. Then he deliberately -set himself down to prepare for the task. He find in patience just -how is his strength, and what are his powers. He study new tongues. -He learn new social life, new environment of old ways, the politics, -the law, the finance, the science, the habit of a new land and a new -people who have come to be since he was. His glimpse that he have -had, whet his appetite only and enkeen his desire. Nay, it help him -to grow as to his brain. For it all prove to him how right he was at -the first in his surmises. He have done this alone, all alone! From -a ruin tomb in a forgotten land. What more may he not do when the -greater world of thought is open to him. He that can smile at death, -as we know him. Who can flourish in the midst of diseases that kill -off whole peoples. Oh! If such an one was to come from God, and not -the Devil, what a force for good might he not be in this old world of -ours. But we are pledged to set the world free. Our toil must be in -silence, and our efforts all in secret. For in this enlightened age, -when men believe not even what they see, the doubting of wise men -would be his greatest strength. It would be at once his sheath and -his armor, and his weapons to destroy us, his enemies, who are willing -to peril even our own souls for the safety of one we love. For the -good of mankind, and for the honour and glory of God." - -After a general discussion it was determined that for tonight nothing -be definitely settled. That we should all sleep on the facts, and try -to think out the proper conclusions. Tomorrow, at breakfast, we are -to meet again, and after making our conclusions known to one another, -we shall decide on some definite cause of action . . . - -I feel a wonderful peace and rest tonight. It is as if some haunting -presence were removed from me. Perhaps . . . - -My surmise was not finished, could not be, for I caught sight in the -mirror of the red mark upon my forehead, and I knew that I was still -unclean. - - - - -DR. SEWARD'S DIARY - -5 October.--We all arose early, and I think that sleep did much for -each and all of us. When we met at early breakfast there was more -general cheerfulness than any of us had ever expected to experience -again. - -It is really wonderful how much resilience there is in human nature. -Let any obstructing cause, no matter what, be removed in any way, even -by death, and we fly back to first principles of hope and enjoyment. -More than once as we sat around the table, my eyes opened in wonder -whether the whole of the past days had not been a dream. It was only -when I caught sight of the red blotch on Mrs. Harker's forehead that I -was brought back to reality. Even now, when I am gravely revolving -the matter, it is almost impossible to realize that the cause of all -our trouble is still existent. Even Mrs. Harker seems to lose sight -of her trouble for whole spells. It is only now and again, when -something recalls it to her mind, that she thinks of her terrible -scar. We are to meet here in my study in half an hour and decide on -our course of action. I see only one immediate difficulty, I know it -by instinct rather than reason. We shall all have to speak frankly. -And yet I fear that in some mysterious way poor Mrs. Harker's tongue -is tied. I know that she forms conclusions of her own, and from all -that has been I can guess how brilliant and how true they must be. -But she will not, or cannot, give them utterance. I have mentioned -this to Van Helsing, and he and I are to talk it over when we are -alone. I suppose it is some of that horrid poison which has got into -her veins beginning to work. The Count had his own purposes when he -gave her what Van Helsing called "the Vampire's baptism of blood." -Well, there may be a poison that distills itself out of good things. -In an age when the existence of ptomaines is a mystery we should not -wonder at anything! One thing I know, that if my instinct be true -regarding poor Mrs. Harker's silences, then there is a terrible -difficulty, an unknown danger, in the work before us. The same power -that compels her silence may compel her speech. I dare not think -further, for so I should in my thoughts dishonour a noble woman! - - -Later.--When the Professor came in, we talked over the state of -things. I could see that he had something on his mind, which he -wanted to say, but felt some hesitancy about broaching the subject. -After beating about the bush a little, he said, "Friend John, there is -something that you and I must talk of alone, just at the first at any -rate. Later, we may have to take the others into our confidence." - -Then he stopped, so I waited. He went on, "Madam Mina, our poor, dear -Madam Mina is changing." - -A cold shiver ran through me to find my worst fears thus endorsed. -Van Helsing continued. - -"With the sad experience of Miss Lucy, we must this time be warned -before things go too far. Our task is now in reality more difficult -than ever, and this new trouble makes every hour of the direst -importance. I can see the characteristics of the vampire coming in -her face. It is now but very, very slight. But it is to be seen if -we have eyes to notice without prejudge. Her teeth are sharper, and -at times her eyes are more hard. But these are not all, there is to -her the silence now often, as so it was with Miss Lucy. She did not -speak, even when she wrote that which she wished to be known later. -Now my fear is this. If it be that she can, by our hypnotic trance, -tell what the Count see and hear, is it not more true that he who have -hypnotize her first, and who have drink of her very blood and make her -drink of his, should if he will, compel her mind to disclose to him -that which she know?" - -I nodded acquiescence. He went on, "Then, what we must do is to -prevent this. We must keep her ignorant of our intent, and so she -cannot tell what she know not. This is a painful task! Oh, so -painful that it heartbreak me to think of it, but it must be. When -today we meet, I must tell her that for reason which we will not to -speak she must not more be of our council, but be simply guarded by -us." - -He wiped his forehead, which had broken out in profuse perspiration at -the thought of the pain which he might have to inflict upon the poor -soul already so tortured. I knew that it would be some sort of -comfort to him if I told him that I also had come to the same -conclusion. For at any rate it would take away the pain of doubt. I -told him, and the effect was as I expected. - -It is now close to the time of our general gathering. Van Helsing has -gone away to prepare for the meeting, and his painful part of it. I -really believe his purpose is to be able to pray alone. - - -Later.--At the very outset of our meeting a great personal relief was -experienced by both Van Helsing and myself. Mrs. Harker had sent a -message by her husband to say that she would not join us at present, -as she thought it better that we should be free to discuss our -movements without her presence to embarrass us. The Professor and I -looked at each other for an instant, and somehow we both seemed -relieved. For my own part, I thought that if Mrs. Harker realized the -danger herself, it was much pain as well as much danger averted. -Under the circumstances we agreed, by a questioning look and answer, -with finger on lip, to preserve silence in our suspicions, until we -should have been able to confer alone again. We went at once into our -Plan of Campaign. - -Van Helsing roughly put the facts before us first, "The Czarina -Catherine left the Thames yesterday morning. It will take her at the -quickest speed she has ever made at least three weeks to reach Varna. -But we can travel overland to the same place in three days. Now, if -we allow for two days less for the ship's voyage, owing to such -weather influences as we know that the Count can bring to bear, and if -we allow a whole day and night for any delays which may occur to us, -then we have a margin of nearly two weeks. - -"Thus, in order to be quite safe, we must leave here on 17th at -latest. Then we shall at any rate be in Varna a day before the ship -arrives, and able to make such preparations as may be necessary. Of -course we shall all go armed, armed against evil things, spiritual as -well as physical." - -Here Quincey Morris added, "I understand that the Count comes from a -wolf country, and it may be that he shall get there before us. I -propose that we add Winchesters to our armament. I have a kind of -belief in a Winchester when there is any trouble of that sort around. -Do you remember, Art, when we had the pack after us at Tobolsk? What -wouldn't we have given then for a repeater apiece!" - -"Good!" said Van Helsing, "Winchesters it shall be. Quincey's head is -level at times, but most so when there is to hunt, metaphor be more -dishonour to science than wolves be of danger to man. In the meantime -we can do nothing here. And as I think that Varna is not familiar to -any of us, why not go there more soon? It is as long to wait here as -there. Tonight and tomorrow we can get ready, and then if all be -well, we four can set out on our journey." - -"We four?" said Harker interrogatively, looking from one to another of -us. - -"Of course!" answered the Professor quickly. "You must remain to take -care of your so sweet wife!" - -Harker was silent for awhile and then said in a hollow voice, "Let us -talk of that part of it in the morning. I want to consult with Mina." - -I thought that now was the time for Van Helsing to warn him not to -disclose our plan to her, but he took no notice. I looked at him -significantly and coughed. For answer he put his finger to his lips -and turned away. - - - -JONATHAN HARKER'S JOURNAL - -5 October, afternoon.--For some time after our meeting this morning I -could not think. The new phases of things leave my mind in a state of -wonder which allows no room for active thought. Mina's determination -not to take any part in the discussion set me thinking. And as I -could not argue the matter with her, I could only guess. I am as far -as ever from a solution now. The way the others received it, too -puzzled me. The last time we talked of the subject we agreed that -there was to be no more concealment of anything amongst us. Mina is -sleeping now, calmly and sweetly like a little child. Her lips are -curved and her face beams with happiness. Thank God, there are such -moments still for her. - - -Later.--How strange it all is. I sat watching Mina's happy sleep, and -I came as near to being happy myself as I suppose I shall ever be. As -the evening drew on, and the earth took its shadows from the sun -sinking lower, the silence of the room grew more and more solemn to -me. - -All at once Mina opened her eyes, and looking at me tenderly said, -"Jonathan, I want you to promise me something on your word of honour. -A promise made to me, but made holily in God's hearing, and not to be -broken though I should go down on my knees and implore you with bitter -tears. Quick, you must make it to me at once." - -"Mina," I said, "a promise like that, I cannot make at once. I may -have no right to make it." - -"But, dear one," she said, with such spiritual intensity that her eyes -were like pole stars, "it is I who wish it. And it is not for myself. -You can ask Dr. Van Helsing if I am not right. If he disagrees you -may do as you will. Nay, more if you all agree, later you are -absolved from the promise." - -"I promise!" I said, and for a moment she looked supremely happy. -Though to me all happiness for her was denied by the red scar on her -forehead. - -She said, "Promise me that you will not tell me anything of the plans -formed for the campaign against the Count. Not by word, or inference, -or implication, not at any time whilst this remains to me!" And she -solemnly pointed to the scar. I saw that she was in earnest, and said -solemnly, "I promise!" and as I said it I felt that from that instant -a door had been shut between us. - - -Later, midnight.--Mina has been bright and cheerful all the evening. -So much so that all the rest seemed to take courage, as if infected -somewhat with her gaiety. As a result even I myself felt as if the -pall of gloom which weighs us down were somewhat lifted. We all -retired early. Mina is now sleeping like a little child. It is -wonderful thing that her faculty of sleep remains to her in the midst -of her terrible trouble. Thank God for it, for then at least she can -forget her care. Perhaps her example may affect me as her gaiety did -tonight. I shall try it. Oh! For a dreamless sleep. - -6 October, morning.--Another surprise. Mina woke me early, about the -same time as yesterday, and asked me to bring Dr. Van Helsing. I -thought that it was another occasion for hypnotism, and without -question went for the Professor. He had evidently expected some such -call, for I found him dressed in his room. His door was ajar, so that -he could hear the opening of the door of our room. He came at once. -As he passed into the room, he asked Mina if the others might come, -too. - -"No," she said quite simply, "it will not be necessary. You can tell -them just as well. I must go with you on your journey." - -Dr. Van Helsing was as startled as I was. After a moment's pause he -asked, "But why?" - -"You must take me with you. I am safer with you, and you shall be -safer, too." - -"But why, dear Madam Mina? You know that your safety is our solemnest -duty. We go into danger, to which you are, or may be, more liable -than any of us from . . . from circumstances . . . things that have -been." He paused embarrassed. - -As she replied, she raised her finger and pointed to her forehead. "I -know. That is why I must go. I can tell you now, whilst the sun is -coming up. I may not be able again. I know that when the Count wills -me I must go. I know that if he tells me to come in secret, I must by -wile. By any device to hoodwink, even Jonathan." God saw the look -that she turned on me as she spoke, and if there be indeed a Recording -Angel that look is noted to her ever-lasting honour. I could only -clasp her hand. I could not speak. My emotion was too great for even -the relief of tears. - -She went on. "You men are brave and strong. You are strong in your -numbers, for you can defy that which would break down the human -endurance of one who had to guard alone. Besides, I may be of -service, since you can hypnotize me and so learn that which even I -myself do not know." - -Dr. Van Helsing said gravely, "Madam Mina, you are, as always, most -wise. You shall with us come. And together we shall do that which we -go forth to achieve." - -When he had spoken, Mina's long spell of silence made me look at her. -She had fallen back on her pillow asleep. She did not even wake when -I had pulled up the blind and let in the sunlight which flooded the -room. Van Helsing motioned to me to come with him quietly. We went -to his room, and within a minute Lord Godalming, Dr. Seward, and Mr. -Morris were with us also. - -He told them what Mina had said, and went on. "In the morning we -shall leave for Varna. We have now to deal with a new factor, Madam -Mina. Oh, but her soul is true. It is to her an agony to tell us so -much as she has done. But it is most right, and we are warned in -time. There must be no chance lost, and in Varna we must be ready to -act the instant when that ship arrives." - -"What shall we do exactly?" asked Mr. Morris laconically. - -The Professor paused before replying, "We shall at the first board -that ship. Then, when we have identified the box, we shall place a -branch of the wild rose on it. This we shall fasten, for when it is -there none can emerge, so that at least says the superstition. And to -superstition must we trust at the first. It was man's faith in the -early, and it have its root in faith still. Then, when we get the -opportunity that we seek, when none are near to see, we shall open the -box, and . . . and all will be well." - -"I shall not wait for any opportunity," said Morris. "When I see the -box I shall open it and destroy the monster, though there were a -thousand men looking on, and if I am to be wiped out for it the next -moment!" I grasped his hand instinctively and found it as firm as a -piece of steel. I think he understood my look. I hope he did. - -"Good boy," said Dr. Van Helsing. "Brave boy. Quincey is all man. -God bless him for it. My child, believe me none of us shall lag -behind or pause from any fear. I do but say what we may do . . . what -we must do. But, indeed, indeed we cannot say what we may do. There -are so many things which may happen, and their ways and their ends are -so various that until the moment we may not say. We shall all be -armed, in all ways. And when the time for the end has come, our -effort shall not be lack. Now let us today put all our affairs in -order. Let all things which touch on others dear to us, and who on us -depend, be complete. For none of us can tell what, or when, or how, -the end may be. As for me, my own affairs are regulate, and as I have -nothing else to do, I shall go make arrangements for the travel. I -shall have all tickets and so forth for our journey." - -There was nothing further to be said, and we parted. I shall now -settle up all my affairs of earth, and be ready for whatever may come. - - -Later.--It is done. My will is made, and all complete. Mina if she -survive is my sole heir. If it should not be so, then the others who -have been so good to us shall have remainder. - -It is now drawing towards the sunset. Mina's uneasiness calls my -attention to it. I am sure that there is something on her mind which -the time of exact sunset will reveal. These occasions are becoming -harrowing times for us all. For each sunrise and sunset opens up some -new danger, some new pain, which however, may in God's will be means -to a good end. I write all these things in the diary since my darling -must not hear them now. But if it may be that she can see them again, -they shall be ready. She is calling to me. - - - - -CHAPTER 25 - - -DR. SEWARD'S DIARY - -11 October, Evening.--Jonathan Harker has asked me to note this, as he -says he is hardly equal to the task, and he wants an exact record -kept. - -I think that none of us were surprised when we were asked to see Mrs. -Harker a little before the time of sunset. We have of late come to -understand that sunrise and sunset are to her times of peculiar -freedom. When her old self can be manifest without any controlling -force subduing or restraining her, or inciting her to action. This -mood or condition begins some half hour or more before actual sunrise -or sunset, and lasts till either the sun is high, or whilst the clouds -are still aglow with the rays streaming above the horizon. At first -there is a sort of negative condition, as if some tie were loosened, -and then the absolute freedom quickly follows. When, however, the -freedom ceases the change back or relapse comes quickly, preceded -only by a spell of warning silence. - -Tonight, when we met, she was somewhat constrained, and bore all the -signs of an internal struggle. I put it down myself to her making a -violent effort at the earliest instant she could do so. - -A very few minutes, however, gave her complete control of herself. -Then, motioning her husband to sit beside her on the sofa where she -was half reclining, she made the rest of us bring chairs up close. - -Taking her husband's hand in hers, she began, "We are all here -together in freedom, for perhaps the last time! I know that you will -always be with me to the end." This was to her husband whose hand had, -as we could see, tightened upon her. "In the morning we go out upon -our task, and God alone knows what may be in store for any of us. You -are going to be so good to me to take me with you. I know that all -that brave earnest men can do for a poor weak woman, whose soul -perhaps is lost, no, no, not yet, but is at any rate at stake, you -will do. But you must remember that I am not as you are. There is a -poison in my blood, in my soul, which may destroy me, which must -destroy me, unless some relief comes to us. Oh, my friends, you know -as well as I do, that my soul is at stake. And though I know there is -one way out for me, you must not and I must not take it!" She looked -appealingly to us all in turn, beginning and ending with her husband. - -"What is that way?" asked Van Helsing in a hoarse voice. "What is -that way, which we must not, may not, take?" - -"That I may die now, either by my own hand or that of another, before -the greater evil is entirely wrought. I know, and you know, that were -I once dead you could and would set free my immortal spirit, even as -you did my poor Lucy's. Were death, or the fear of death, the only -thing that stood in the way I would not shrink to die here now, amidst -the friends who love me. But death is not all. I cannot believe that -to die in such a case, when there is hope before us and a bitter task -to be done, is God's will. Therefore, I on my part, give up here the -certainty of eternal rest, and go out into the dark where may be the -blackest things that the world or the nether world holds!" - -We were all silent, for we knew instinctively that this was only a -prelude. The faces of the others were set, and Harker's grew ashen -grey. Perhaps, he guessed better than any of us what was coming. - -She continued, "This is what I can give into the hotch-pot." I could -not but note the quaint legal phrase which she used in such a place, -and with all seriousness. "What will each of you give? Your lives I -know," she went on quickly, "that is easy for brave men. Your lives -are God's, and you can give them back to Him, but what will you give -to me?" She looked again questioningly, but this time avoided her -husband's face. Quincey seemed to understand, he nodded, and her face -lit up. "Then I shall tell you plainly what I want, for there must be -no doubtful matter in this connection between us now. You must -promise me, one and all, even you, my beloved husband, that should the -time come, you will kill me." - -"What is that time?" The voice was Quincey's, but it was low and -strained. - -"When you shall be convinced that I am so changed that it is better -that I die that I may live. When I am thus dead in the flesh, then -you will, without a moment's delay, drive a stake through me and cut -off my head, or do whatever else may be wanting to give me rest!" - -Quincey was the first to rise after the pause. He knelt down before -her and taking her hand in his said solemnly, "I'm only a rough -fellow, who hasn't, perhaps, lived as a man should to win such a -distinction, but I swear to you by all that I hold sacred and dear -that, should the time ever come, I shall not flinch from the duty that -you have set us. And I promise you, too, that I shall make all -certain, for if I am only doubtful I shall take it that the time has -come!" - -"My true friend!" was all she could say amid her fast-falling tears, -as bending over, she kissed his hand. - -"I swear the same, my dear Madam Mina!" said Van Helsing. "And I!" -said Lord Godalming, each of them in turn kneeling to her to take the -oath. I followed, myself. - -Then her husband turned to her wan-eyed and with a greenish pallor -which subdued the snowy whiteness of his hair, and asked, "And must I, -too, make such a promise, oh, my wife?" - -"You too, my dearest," she said, with infinite yearning of pity in her -voice and eyes. "You must not shrink. You are nearest and dearest -and all the world to me. Our souls are knit into one, for all life -and all time. Think, dear, that there have been times when brave men -have killed their wives and their womenkind, to keep them from falling -into the hands of the enemy. Their hands did not falter any the more -because those that they loved implored them to slay them. It is men's -duty towards those whom they love, in such times of sore trial! And -oh, my dear, if it is to be that I must meet death at any hand, let it -be at the hand of him that loves me best. Dr. Van Helsing, I have not -forgotten your mercy in poor Lucy's case to him who loved." She -stopped with a flying blush, and changed her phrase, "to him who had -best right to give her peace. If that time shall come again, I look -to you to make it a happy memory of my husband's life that it was his -loving hand which set me free from the awful thrall upon me." - -"Again I swear!" came the Professor's resonant voice. - -Mrs. Harker smiled, positively smiled, as with a sigh of relief she -leaned back and said, "And now one word of warning, a warning which -you must never forget. This time, if it ever come, may come quickly -and unexpectedly, and in such case you must lose no time in using your -opportunity. At such a time I myself might be . . . nay! If the time -ever come, shall be, leagued with your enemy against you. - -"One more request," she became very solemn as she said this, "it is -not vital and necessary like the other, but I want you to do one thing -for me, if you will." - -We all acquiesced, but no one spoke. There was no need to speak. - -"I want you to read the Burial Service." She was interrupted by a -deep groan from her husband. Taking his hand in hers, she held it -over her heart, and continued. "You must read it over me some day. -Whatever may be the issue of all this fearful state of things, it will -be a sweet thought to all or some of us. You, my dearest, will I hope -read it, for then it will be in your voice in my memory forever, come -what may!" - -"But oh, my dear one," he pleaded, "death is afar off from you." - -"Nay," she said, holding up a warning hand. "I am deeper in death at -this moment than if the weight of an earthly grave lay heavy upon me!" - -"Oh, my wife, must I read it?" he said, before he began. - -"It would comfort me, my husband!" was all she said, and he began to -read when she had got the book ready. - -How can I, how could anyone, tell of that strange scene, its -solemnity, its gloom, its sadness, its horror, and withal, its -sweetness. Even a sceptic, who can see nothing but a travesty of -bitter truth in anything holy or emotional, would have been melted to -the heart had he seen that little group of loving and devoted friends -kneeling round that stricken and sorrowing lady; or heard the tender -passion of her husband's voice, as in tones so broken and emotional -that often he had to pause, he read the simple and beautiful service -from the Burial of the Dead. I cannot go on . . . words . . . and -v-voices . . . f-fail m-me! - -She was right in her instinct. Strange as it was, bizarre as it may -hereafter seem even to us who felt its potent influence at the time, -it comforted us much. And the silence, which showed Mrs. Harker's -coming relapse from her freedom of soul, did not seem so full of -despair to any of us as we had dreaded. - - - - - -JONATHAN HARKER'S JOURNAL - -15 October, Varna.--We left Charing Cross on the morning of the 12th, -got to Paris the same night, and took the places secured for us in the -Orient Express. We traveled night and day, arriving here at about -five o'clock. Lord Godalming went to the Consulate to see if any -telegram had arrived for him, whilst the rest of us came on to this -hotel, "the Odessus." The journey may have had incidents. I was, -however, too eager to get on, to care for them. Until the Czarina -Catherine comes into port there will be no interest for me in anything -in the wide world. Thank God! Mina is well, and looks to be getting -stronger. Her colour is coming back. She sleeps a great deal. -Throughout the journey she slept nearly all the time. Before sunrise -and sunset, however, she is very wakeful and alert. And it has become -a habit for Van Helsing to hypnotize her at such times. At first, -some effort was needed, and he had to make many passes. But now, she -seems to yield at once, as if by habit, and scarcely any action is -needed. He seems to have power at these particular moments to simply -will, and her thoughts obey him. He always asks her what she can see -and hear. - -She answers to the first, "Nothing, all is dark." - -And to the second, "I can hear the waves lapping against the ship, and -the water rushing by. Canvas and cordage strain and masts and yards -creak. The wind is high . . . I can hear it in the shrouds, and the -bow throws back the foam." - -It is evident that the Czarina Catherine is still at sea, hastening on -her way to Varna. Lord Godalming has just returned. He had four -telegrams, one each day since we started, and all to the same effect. -That the Czarina Catherine had not been reported to Lloyd's from -anywhere. He had arranged before leaving London that his agent should -send him every day a telegram saying if the ship had been reported. -He was to have a message even if she were not reported, so that he -might be sure that there was a watch being kept at the other end of -the wire. - -We had dinner and went to bed early. Tomorrow we are to see the Vice -Consul, and to arrange, if we can, about getting on board the ship as -soon as she arrives. Van Helsing says that our chance will be to get -on the boat between sunrise and sunset. The Count, even if he takes -the form of a bat, cannot cross the running water of his own volition, -and so cannot leave the ship. As he dare not change to man's form -without suspicion, which he evidently wishes to avoid, he must remain -in the box. If, then, we can come on board after sunrise, he is at -our mercy, for we can open the box and make sure of him, as we did of -poor Lucy, before he wakes. What mercy he shall get from us all will -not count for much. We think that we shall not have much trouble with -officials or the seamen. Thank God! This is the country where -bribery can do anything, and we are well supplied with money. We have -only to make sure that the ship cannot come into port between sunset -and sunrise without our being warned, and we shall be safe. Judge -Moneybag will settle this case, I think! - - -16 October.--Mina's report still the same. Lapping waves and rushing -water, darkness and favouring winds. We are evidently in good time, -and when we hear of the Czarina Catherine we shall be ready. As she -must pass the Dardanelles we are sure to have some report. - - -17 October.--Everything is pretty well fixed now, I think, to welcome -the Count on his return from his tour. Godalming told the shippers -that he fancied that the box sent aboard might contain something -stolen from a friend of his, and got a half consent that he might open -it at his own risk. The owner gave him a paper telling the Captain to -give him every facility in doing whatever he chose on board the ship, -and also a similar authorization to his agent at Varna. We have seen -the agent, who was much impressed with Godalming's kindly manner to -him, and we are all satisfied that whatever he can do to aid our -wishes will be done. - -We have already arranged what to do in case we get the box open. If -the Count is there, Van Helsing and Seward will cut off his head at -once and drive a stake through his heart. Morris and Godalming and I -shall prevent interference, even if we have to use the arms which we -shall have ready. The Professor says that if we can so treat the -Count's body, it will soon after fall into dust. In such case there -would be no evidence against us, in case any suspicion of murder were -aroused. But even if it were not, we should stand or fall by our act, -and perhaps some day this very script may be evidence to come between -some of us and a rope. For myself, I should take the chance only too -thankfully if it were to come. We mean to leave no stone unturned to -carry out our intent. We have arranged with certain officials that -the instant the Czarina Catherine is seen, we are to be informed by a -special messenger. - - -24 October.--A whole week of waiting. Daily telegrams to Godalming, -but only the same story. "Not yet reported." Mina's morning and -evening hypnotic answer is unvaried. Lapping waves, rushing water, -and creaking masts. - - - - -TELEGRAM, OCTOBER 24TH RUFUS SMITH, LLOYD'S, LONDON, -TO LORD GODALMING, CARE OF H. B. M. VICE CONSUL, VARNA - -"Czarina Catherine reported this morning from Dardanelles." - - - -DR. SEWARD'S DIARY - -25 October.--How I miss my phonograph! To write a diary with a pen is -irksome to me! But Van Helsing says I must. We were all wild with -excitement yesterday when Godalming got his telegram from Lloyd's. I -know now what men feel in battle when the call to action is heard. -Mrs. Harker, alone of our party, did not show any signs of emotion. -After all, it is not strange that she did not, for we took special -care not to let her know anything about it, and we all tried not to -show any excitement when we were in her presence. In old days she -would, I am sure, have noticed, no matter how we might have tried to -conceal it. But in this way she is greatly changed during the past -three weeks. The lethargy grows upon her, and though she seems strong -and well, and is getting back some of her colour, Van Helsing and I are -not satisfied. We talk of her often. We have not, however, said a -word to the others. It would break poor Harker's heart, certainly his -nerve, if he knew that we had even a suspicion on the subject. Van -Helsing examines, he tells me, her teeth very carefully, whilst she is -in the hypnotic condition, for he says that so long as they do not -begin to sharpen there is no active danger of a change in her. If -this change should come, it would be necessary to take steps! We both -know what those steps would have to be, though we do not mention our -thoughts to each other. We should neither of us shrink from the task, -awful though it be to contemplate. "Euthanasia" is an excellent and a -comforting word! I am grateful to whoever invented it. - -It is only about 24 hours' sail from the Dardanelles to here, at the -rate the Czarina Catherine has come from London. She should therefore -arrive some time in the morning, but as she cannot possibly get in -before noon, we are all about to retire early. We shall get up at one -o'clock, so as to be ready. - - -25 October, Noon.--No news yet of the ship's arrival. Mrs. Harker's -hypnotic report this morning was the same as usual, so it is possible -that we may get news at any moment. We men are all in a fever of -excitement, except Harker, who is calm. His hands are cold as ice, -and an hour ago I found him whetting the edge of the great Ghoorka -knife which he now always carries with him. It will be a bad lookout -for the Count if the edge of that "Kukri" ever touches his throat, -driven by that stern, ice-cold hand! - -Van Helsing and I were a little alarmed about Mrs. Harker today. -About noon she got into a sort of lethargy which we did not like. -Although we kept silence to the others, we were neither of us happy -about it. She had been restless all the morning, so that we were at -first glad to know that she was sleeping. When, however, her husband -mentioned casually that she was sleeping so soundly that he could not -wake her, we went to her room to see for ourselves. She was breathing -naturally and looked so well and peaceful that we agreed that the -sleep was better for her than anything else. Poor girl, she has so -much to forget that it is no wonder that sleep, if it brings oblivion -to her, does her good. - - -Later.--Our opinion was justified, for when after a refreshing sleep -of some hours she woke up, she seemed brighter and better than she had -been for days. At sunset she made the usual hypnotic report. -Wherever he may be in the Black Sea, the Count is hurrying to his -destination. To his doom, I trust! - - - -26 October.--Another day and no tidings of the Czarina Catherine. She -ought to be here by now. That she is still journeying somewhere is -apparent, for Mrs. Harker's hypnotic report at sunrise was still the -same. It is possible that the vessel may be lying by, at times, for -fog. Some of the steamers which came in last evening reported patches -of fog both to north and south of the port. We must continue our -watching, as the ship may now be signalled any moment. - - -27 October, Noon.--Most strange. No news yet of the ship we wait for. -Mrs. Harker reported last night and this morning as usual. "Lapping -waves and rushing water," though she added that "the waves were very -faint." The telegrams from London have been the same, "no further -report." Van Helsing is terribly anxious, and told me just now that he -fears the Count is escaping us. - -He added significantly, "I did not like that lethargy of Madam Mina's. -Souls and memories can do strange things during trance." I was about -to ask him more, but Harker just then came in, and he held up a -warning hand. We must try tonight at sunset to make her speak more -fully when in her hypnotic state. - - -28 October.--Telegram. Rufus Smith, London, to Lord Godalming, care -H. B. M. Vice Consul, Varna - -"Czarina Catherine reported entering Galatz at one o'clock today." - - - - -DR. SEWARD'S DIARY - -28 October.--When the telegram came announcing the arrival in Galatz I -do not think it was such a shock to any of us as might have been -expected. True, we did not know whence, or how, or when, the bolt -would come. But I think we all expected that something strange would -happen. The day of arrival at Varna made us individually satisfied -that things would not be just as we had expected. We only waited to -learn where the change would occur. None the less, however, it was a -surprise. I suppose that nature works on such a hopeful basis that we -believe against ourselves that things will be as they ought to be, not -as we should know that they will be. Transcendentalism is a beacon to -the angels, even if it be a will-o'-the-wisp to man. Van Helsing -raised his hand over his head for a moment, as though in remonstrance -with the Almighty. But he said not a word, and in a few seconds stood -up with his face sternly set. - -Lord Godalming grew very pale, and sat breathing heavily. I was -myself half stunned and looked in wonder at one after another. -Quincey Morris tightened his belt with that quick movement which I -knew so well. In our old wandering days it meant "action." Mrs. -Harker grew ghastly white, so that the scar on her forehead seemed to -burn, but she folded her hands meekly and looked up in prayer. Harker -smiled, actually smiled, the dark, bitter smile of one who is without -hope, but at the same time his action belied his words, for his hands -instinctively sought the hilt of the great Kukri knife and rested -there. - -"When does the next train start for Galatz?" said Van Helsing to us -generally. - -"At 6:30 tomorrow morning!" We all started, for the answer came from -Mrs. Harker. - -"How on earth do you know?" said Art. - -"You forget, or perhaps you do not know, though Jonathan does and so -does Dr. Van Helsing, that I am the train fiend. At home in Exeter I -always used to make up the time tables, so as to be helpful to my -husband. I found it so useful sometimes, that I always make a study -of the time tables now. I knew that if anything were to take us to -Castle Dracula we should go by Galatz, or at any rate through -Bucharest, so I learned the times very carefully. Unhappily there are -not many to learn, as the only train tomorrow leaves as I say." - -"Wonderful woman!" murmured the Professor. - -"Can't we get a special?" asked Lord Godalming. - -Van Helsing shook his head, "I fear not. This land is very different -from yours or mine. Even if we did have a special, it would probably -not arrive as soon as our regular train. Moreover, we have something -to prepare. We must think. Now let us organize. You, friend Arthur, -go to the train and get the tickets and arrange that all be ready for -us to go in the morning. Do you, friend Jonathan, go to the agent of -the ship and get from him letters to the agent in Galatz, with -authority to make a search of the ship just as it was here. Quincey -Morris, you see the Vice Consul, and get his aid with his fellow in -Galatz and all he can do to make our way smooth, so that no times be -lost when over the Danube. John will stay with Madam Mina and me, and -we shall consult. For so if time be long you may be delayed. And it -will not matter when the sun set, since I am here with Madam to make -report." - -"And I," said Mrs. Harker brightly, and more like her old self than -she had been for many a long day, "shall try to be of use in all ways, -and shall think and write for you as I used to do. Something is -shifting from me in some strange way, and I feel freer than I have -been of late!" - -The three younger men looked happier at the moment as they seemed to -realize the significance of her words. But Van Helsing and I, turning -to each other, met each a grave and troubled glance. We said nothing -at the time, however. - -When the three men had gone out to their tasks Van Helsing asked Mrs. -Harker to look up the copy of the diaries and find him the part of -Harker's journal at the Castle. She went away to get it. - -When the door was shut upon her he said to me, "We mean the same! -Speak out!" - -"Here is some change. It is a hope that makes me sick, for it may -deceive us." - -"Quite so. Do you know why I asked her to get the manuscript?" - -"No!" said I, "unless it was to get an opportunity of seeing me -alone." - -"You are in part right, friend John, but only in part. I want to tell -you something. And oh, my friend, I am taking a great, a terrible, -risk. But I believe it is right. In the moment when Madam Mina said -those words that arrest both our understanding, an inspiration came to -me. In the trance of three days ago the Count sent her his spirit to -read her mind. Or more like he took her to see him in his earth box -in the ship with water rushing, just as it go free at rise and set of -sun. He learn then that we are here, for she have more to tell in her -open life with eyes to see ears to hear than he, shut as he is, in his -coffin box. Now he make his most effort to escape us. At present he -want her not. - -"He is sure with his so great knowledge that she will come at his -call. But he cut her off, take her, as he can do, out of his own -power, that so she come not to him. Ah! There I have hope that our -man brains that have been of man so long and that have not lost the -grace of God, will come higher than his child-brain that lie in his -tomb for centuries, that grow not yet to our stature, and that do only -work selfish and therefore small. Here comes Madam Mina. Not a word -to her of her trance! She knows it not, and it would overwhelm her -and make despair just when we want all her hope, all her courage, when -most we want all her great brain which is trained like man's brain, -but is of sweet woman and have a special power which the Count give -her, and which he may not take away altogether, though he think not -so. Hush! Let me speak, and you shall learn. Oh, John, my friend, -we are in awful straits. I fear, as I never feared before. We can -only trust the good God. Silence! Here she comes!" - -I thought that the Professor was going to break down and have -hysterics, just as he had when Lucy died, but with a great effort he -controlled himself and was at perfect nervous poise when Mrs. Harker -tripped into the room, bright and happy looking and, in the doing of -work, seemingly forgetful of her misery. As she came in, she handed a -number of sheets of typewriting to Van Helsing. He looked over them -gravely, his face brightening up as he read. - -Then holding the pages between his finger and thumb he said, "Friend -John, to you with so much experience already, and you too, dear Madam -Mina, that are young, here is a lesson. Do not fear ever to think. A -half thought has been buzzing often in my brain, but I fear to let him -loose his wings. Here now, with more knowledge, I go back to where -that half thought come from and I find that he be no half thought at -all. That be a whole thought, though so young that he is not yet -strong to use his little wings. Nay, like the 'Ugly Duck' of my -friend Hans Andersen, he be no duck thought at all, but a big swan -thought that sail nobly on big wings, when the time come for him to -try them. See I read here what Jonathan have written. - -"That other of his race who, in a later age, again and again, brought -his forces over The Great River into Turkey Land, who when he was -beaten back, came again, and again, and again, though he had to come -alone from the bloody field where his troops were being slaughtered, -since he knew that he alone could ultimately triumph. - -"What does this tell us? Not much? No! The Count's child thought -see nothing, therefore he speak so free. Your man thought see -nothing. My man thought see nothing, till just now. No! But there -comes another word from some one who speak without thought because -she, too, know not what it mean, what it might mean. Just as there -are elements which rest, yet when in nature's course they move on -their way and they touch, the pouf! And there comes a flash of light, -heaven wide, that blind and kill and destroy some. But that show up -all earth below for leagues and leagues. Is it not so? Well, I shall -explain. To begin, have you ever study the philosophy of crime? -'Yes' and 'No.' You, John, yes, for it is a study of insanity. You, -no, Madam Mina, for crime touch you not, not but once. Still, your -mind works true, and argues not a particulari ad universale. There is -this peculiarity in criminals. It is so constant, in all countries -and at all times, that even police, who know not much from philosophy, -come to know it empirically, that it is. That is to be empiric. The -criminal always work at one crime, that is the true criminal who seems -predestinate to crime, and who will of none other. This criminal has -not full man brain. He is clever and cunning and resourceful, but he -be not of man stature as to brain. He be of child brain in much. Now -this criminal of ours is predestinate to crime also. He, too, have -child brain, and it is of the child to do what he have done. The -little bird, the little fish, the little animal learn not by -principle, but empirically. And when he learn to do, then there is to -him the ground to start from to do more. 'Dos pou sto,' said -Archimedes. 'Give me a fulcrum, and I shall move the world!' To do -once, is the fulcrum whereby child brain become man brain. And until -he have the purpose to do more, he continue to do the same again every -time, just as he have done before! Oh, my dear, I see that your eyes -are opened, and that to you the lightning flash show all the leagues," -for Mrs. Harker began to clap her hands and her eyes sparkled. - -He went on, "Now you shall speak. Tell us two dry men of science what -you see with those so bright eyes." He took her hand and held it -whilst he spoke. His finger and thumb closed on her pulse, as I -thought instinctively and unconsciously, as she spoke. - -"The Count is a criminal and of criminal type. Nordau and Lombroso -would so classify him, and qua criminal he is of an imperfectly formed -mind. Thus, in a difficulty he has to seek resource in habit. His -past is a clue, and the one page of it that we know, and that from his -own lips, tells that once before, when in what Mr. Morris would call -a 'tight place,' he went back to his own country from the land he had -tried to invade, and thence, without losing purpose, prepared himself -for a new effort. He came again better equipped for his work, and -won. So he came to London to invade a new land. He was beaten, and -when all hope of success was lost, and his existence in danger, he -fled back over the sea to his home. Just as formerly he had fled back -over the Danube from Turkey Land." - -"Good, good! Oh, you so clever lady!" said Van Helsing, -enthusiastically, as he stooped and kissed her hand. A moment later -he said to me, as calmly as though we had been having a sick room -consultation, "Seventy-two only, and in all this excitement. I have -hope." - -Turning to her again, he said with keen expectation, "But go on. Go -on! There is more to tell if you will. Be not afraid. John and I -know. I do in any case, and shall tell you if you are right. Speak, -without fear!" - -"I will try to. But you will forgive me if I seem too egotistical." - -"Nay! Fear not, you must be egotist, for it is of you that we think." - -"Then, as he is criminal he is selfish. And as his intellect is small -and his action is based on selfishness, he confines himself to one -purpose. That purpose is remorseless. As he fled back over the -Danube, leaving his forces to be cut to pieces, so now he is intent on -being safe, careless of all. So his own selfishness frees my soul -somewhat from the terrible power which he acquired over me on that -dreadful night. I felt it! Oh, I felt it! Thank God, for His great -mercy! My soul is freer than it has been since that awful hour. And -all that haunts me is a fear lest in some trance or dream he may have -used my knowledge for his ends." - -The Professor stood up, "He has so used your mind, and by it he has -left us here in Varna, whilst the ship that carried him rushed through -enveloping fog up to Galatz, where, doubtless, he had made preparation -for escaping from us. But his child mind only saw so far. And it may -be that as ever is in God's Providence, the very thing that the evil -doer most reckoned on for his selfish good, turns out to be his -chiefest harm. The hunter is taken in his own snare, as the great -Psalmist says. For now that he think he is free from every trace of -us all, and that he has escaped us with so many hours to him, then his -selfish child brain will whisper him to sleep. He think, too, that as -he cut himself off from knowing your mind, there can be no knowledge -of him to you. There is where he fail! That terrible baptism of -blood which he give you makes you free to go to him in spirit, as you -have as yet done in your times of freedom, when the sun rise and set. -At such times you go by my volition and not by his. And this power to -good of you and others, you have won from your suffering at his hands. -This is now all more precious that he know it not, and to guard -himself have even cut himself off from his knowledge of our where. -We, however, are not selfish, and we believe that God is with us -through all this blackness, and these many dark hours. We shall -follow him, and we shall not flinch, even if we peril ourselves that -we become like him. Friend John, this has been a great hour, and it -have done much to advance us on our way. You must be scribe and write -him all down, so that when the others return from their work you can -give it to them, then they shall know as we do." - -And so I have written it whilst we wait their return, and Mrs. Harker -has written with the typewriter all since she brought the MS to us. - - - - -CHAPTER 26 - - -DR. SEWARD'S DIARY - -29 October.--This is written in the train from Varna to Galatz. Last -night we all assembled a little before the time of sunset. Each of us -had done his work as well as he could, so far as thought, and -endeavour, and opportunity go, we are prepared for the whole of our -journey, and for our work when we get to Galatz. When the usual time -came round Mrs. Harker prepared herself for her hypnotic effort, and -after a longer and more serious effort on the part of Van Helsing than -has been usually necessary, she sank into the trance. Usually she -speaks on a hint, but this time the Professor had to ask her -questions, and to ask them pretty resolutely, before we could learn -anything. At last her answer came. - -"I can see nothing. We are still. There are no waves lapping, but -only a steady swirl of water softly running against the hawser. I can -hear men's voices calling, near and far, and the roll and creak of -oars in the rowlocks. A gun is fired somewhere, the echo of it seems -far away. There is tramping of feet overhead, and ropes and chains -are dragged along. What is this? There is a gleam of light. I can -feel the air blowing upon me." - -Here she stopped. She had risen, as if impulsively, from where she -lay on the sofa, and raised both her hands, palms upwards, as if -lifting a weight. Van Helsing and I looked at each other with -understanding. Quincey raised his eyebrows slightly and looked at her -intently, whilst Harker's hand instinctively closed round the hilt of -his Kukri. There was a long pause. We all knew that the time when -she could speak was passing, but we felt that it was useless to say -anything. - -Suddenly she sat up, and as she opened her eyes said sweetly, "Would -none of you like a cup of tea? You must all be so tired!" - -We could only make her happy, and so acqueisced. She bustled off to -get tea. When she had gone Van Helsing said, "You see, my friends. He -is close to land. He has left his earth chest. But he has yet to get -on shore. In the night he may lie hidden somewhere, but if he be not -carried on shore, or if the ship do not touch it, he cannot achieve -the land. In such case he can, if it be in the night, change his form -and jump or fly on shore, then, unless he be carried he cannot escape. -And if he be carried, then the customs men may discover what the box -contain. Thus, in fine, if he escape not on shore tonight, or before -dawn, there will be the whole day lost to him. We may then arrive in -time. For if he escape not at night we shall come on him in daytime, -boxed up and at our mercy. For he dare not be his true self, awake -and visible, lest he be discovered." - -There was no more to be said, so we waited in patience until the dawn, -at which time we might learn more from Mrs. Harker. - -Early this morning we listened, with breathless anxiety, for her -response in her trance. The hypnotic stage was even longer in coming -than before, and when it came the time remaining until full sunrise -was so short that we began to despair. Van Helsing seemed to throw -his whole soul into the effort. At last, in obedience to his will she -made reply. - -"All is dark. I hear lapping water, level with me, and some creaking -as of wood on wood." She paused, and the red sun shot up. We must -wait till tonight. - -And so it is that we are travelling towards Galatz in an agony of -expectation. We are due to arrive between two and three in the -morning. But already, at Bucharest, we are three hours late, so we -cannot possibly get in till well after sunup. Thus we shall have two -more hypnotic messages from Mrs. Harker! Either or both may possibly -throw more light on what is happening. - - -Later.--Sunset has come and gone. Fortunately it came at a time when -there was no distraction. For had it occurred whilst we were at a -station, we might not have secured the necessary calm and isolation. -Mrs. Harker yielded to the hypnotic influence even less readily than -this morning. I am in fear that her power of reading the Count's -sensations may die away, just when we want it most. It seems to me -that her imagination is beginning to work. Whilst she has been in the -trance hitherto she has confined herself to the simplest of facts. If -this goes on it may ultimately mislead us. If I thought that the -Count's power over her would die away equally with her power of -knowledge it would be a happy thought. But I am afraid that it may -not be so. - -When she did speak, her words were enigmatical, "Something is going -out. I can feel it pass me like a cold wind. I can hear, far off, -confused sounds, as of men talking in strange tongues, fierce falling -water, and the howling of wolves." She stopped and a shudder ran -through her, increasing in intensity for a few seconds, till at the -end, she shook as though in a palsy. She said no more, even in answer -to the Professor's imperative questioning. When she woke from the -trance, she was cold, and exhausted, and languid, but her mind was all -alert. She could not remember anything, but asked what she had said. -When she was told, she pondered over it deeply for a long time and in -silence. - - -30 October, 7 A.M.--We are near Galatz now, and I may not have time to -write later. Sunrise this morning was anxiously looked for by us all. -Knowing of the increasing difficulty of procuring the hypnotic trance, -Van Helsing began his passes earlier than usual. They produced no -effect, however, until the regular time, when she yielded with a still -greater difficulty, only a minute before the sun rose. The Professor -lost no time in his questioning. - -Her answer came with equal quickness, "All is dark. I hear water -swirling by, level with my ears, and the creaking of wood on wood. -Cattle low far off. There is another sound, a queer one like . . ." -She stopped and grew white, and whiter still. - -"Go on, go on! Speak, I command you!" said Van Helsing in an agonized -voice. At the same time there was despair in his eyes, for the risen -sun was reddening even Mrs. Harker's pale face. She opened her eyes, -and we all started as she said, sweetly and seemingly with the utmost -unconcern. - -"Oh, Professor, why ask me to do what you know I can't? I don't -remember anything." Then, seeing the look of amazement on our faces, -she said, turning from one to the other with a troubled look, "What -have I said? What have I done? I know nothing, only that I was lying -here, half asleep, and heard you say 'go on! speak, I command you!' It -seemed so funny to hear you order me about, as if I were a bad child!" - -"Oh, Madam Mina," he said, sadly, "it is proof, if proof be needed, of -how I love and honour you, when a word for your good, spoken more -earnest than ever, can seem so strange because it is to order her whom -I am proud to obey!" - -The whistles are sounding. We are nearing Galatz. We are on fire -with anxiety and eagerness. - - - -MINA HARKER'S JOURNAL - -30 October.--Mr. Morris took me to the hotel where our rooms had been -ordered by telegraph, he being the one who could best be spared, since -he does not speak any foreign language. The forces were distributed -much as they had been at Varna, except that Lord Godalming went to the -Vice Consul, as his rank might serve as an immediate guarantee of some -sort to the official, we being in extreme hurry. Jonathan and the two -doctors went to the shipping agent to learn particulars of the arrival -of the Czarina Catherine. - - -Later.--Lord Godalming has returned. The Consul is away, and the Vice -Consul sick. So the routine work has been attended to by a clerk. He -was very obliging, and offered to do anything in his power. - - - -JONATHAN HARKER'S JOURNAL - -30 October.--At nine o'clock Dr. Van Helsing, Dr. Seward, and I called -on Messrs. Mackenzie & Steinkoff, the agents of the London firm of -Hapgood. They had received a wire from London, in answer to Lord -Godalming's telegraphed request, asking them to show us any civility -in their power. They were more than kind and courteous, and took us -at once on board the Czarina Catherine, which lay at anchor out in the -river harbor. There we saw the Captain, Donelson by name, who told us -of his voyage. He said that in all his life he had never had so -favourable a run. - -"Man!" he said, "but it made us afeard, for we expect it that we -should have to pay for it wi' some rare piece o' ill luck, so as to -keep up the average. It's no canny to run frae London to the Black -Sea wi' a wind ahint ye, as though the Deil himself were blawin' on -yer sail for his ain purpose. An' a' the time we could no speer a -thing. Gin we were nigh a ship, or a port, or a headland, a fog fell -on us and travelled wi' us, till when after it had lifted and we -looked out, the deil a thing could we see. We ran by Gibraltar wi' -oot bein' able to signal. An' til we came to the Dardanelles and had -to wait to get our permit to pass, we never were within hail o' -aught. At first I inclined to slack off sail and beat about till the -fog was lifted. But whiles, I thocht that if the Deil was minded to -get us into the Black Sea quick, he was like to do it whether we would -or no. If we had a quick voyage it would be no to our miscredit -wi' the owners, or no hurt to our traffic, an' the Old Mon who had -served his ain purpose wad be decently grateful to us for no hinderin' -him." - -This mixture of simplicity and cunning, of superstition and commercial -reasoning, aroused Van Helsing, who said, "Mine friend, that Devil is -more clever than he is thought by some, and he know when he meet his -match!" - -The skipper was not displeased with the compliment, and went on, "When -we got past the Bosphorus the men began to grumble. Some o' them, the -Roumanians, came and asked me to heave overboard a big box which had -been put on board by a queer lookin' old man just before we had -started frae London. I had seen them speer at the fellow, and put out -their twa fingers when they saw him, to guard them against the evil -eye. Man! but the supersteetion of foreigners is pairfectly -rideeculous! I sent them aboot their business pretty quick, but as -just after a fog closed in on us I felt a wee bit as they did anent -something, though I wouldn't say it was again the big box. Well, on -we went, and as the fog didn't let up for five days I joost let the -wind carry us, for if the Deil wanted to get somewheres, well, he -would fetch it up a'reet. An' if he didn't, well, we'd keep a sharp -lookout anyhow. Sure eneuch, we had a fair way and deep water all the -time. And two days ago, when the mornin' sun came through the fog, we -found ourselves just in the river opposite Galatz. The Roumanians -were wild, and wanted me right or wrong to take out the box and fling -it in the river. I had to argy wi' them aboot it wi' a handspike. An' -when the last o' them rose off the deck wi' his head in his hand, I -had convinced them that, evil eye or no evil eye, the property and the -trust of my owners were better in my hands than in the river Danube. -They had, mind ye, taken the box on the deck ready to fling in, and as -it was marked Galatz via Varna, I thocht I'd let it lie till we -discharged in the port an' get rid o't althegither. We didn't do much -clearin' that day, an' had to remain the nicht at anchor. But in the -mornin', braw an' airly, an hour before sunup, a man came aboard wi' -an order, written to him from England, to receive a box marked for one -Count Dracula. Sure eneuch the matter was one ready to his hand. He -had his papers a' reet, an' glad I was to be rid o' the dam' thing, -for I was beginnin' masel' to feel uneasy at it. If the Deil did have -any luggage aboord the ship, I'm thinkin' it was nane ither than that -same!" - -"What was the name of the man who took it?" asked Dr. Van Helsing with -restrained eagerness. - -"I'll be tellin' ye quick!" he answered, and stepping down to his -cabin, produced a receipt signed "Immanuel Hildesheim." Burgen-strasse -16 was the address. We found out that this was all the Captain knew, -so with thanks we came away. - -We found Hildesheim in his office, a Hebrew of rather the Adelphi -Theatre type, with a nose like a sheep, and a fez. His arguments were -pointed with specie, we doing the punctuation, and with a little -bargaining he told us what he knew. This turned out to be simple but -important. He had received a letter from Mr. de Ville of London, -telling him to receive, if possible before sunrise so as to avoid -customs, a box which would arrive at Galatz in the Czarina Catherine. -This he was to give in charge to a certain Petrof Skinsky, who dealt -with the Slovaks who traded down the river to the port. He had been -paid for his work by an English bank note, which had been duly cashed -for gold at the Danube International Bank. When Skinsky had come to -him, he had taken him to the ship and handed over the box, so as to -save porterage. That was all he knew. - -We then sought for Skinsky, but were unable to find him. One of his -neighbors, who did not seem to bear him any affection, said that he -had gone away two days before, no one knew whither. This was -corroborated by his landlord, who had received by messenger the key of -the house together with the rent due, in English money. This had been -between ten and eleven o'clock last night. We were at a standstill -again. - -Whilst we were talking one came running and breathlessly gasped out -that the body of Skinsky had been found inside the wall of the -churchyard of St. Peter, and that the throat had been torn open as if -by some wild animal. Those we had been speaking with ran off to see -the horror, the women crying out. "This is the work of a Slovak!" We -hurried away lest we should have been in some way drawn into the -affair, and so detained. - -As we came home we could arrive at no definite conclusion. We were -all convinced that the box was on its way, by water, to somewhere, but -where that might be we would have to discover. With heavy hearts we -came home to the hotel to Mina. - -When we met together, the first thing was to consult as to taking Mina -again into our confidence. Things are getting desperate, and it is at -least a chance, though a hazardous one. As a preliminary step, I was -released from my promise to her. - - - - - -MINA HARKER'S JOURNAL - -30 October, evening.--They were so tired and worn out and dispirited -that there was nothing to be done till they had some rest, so I asked -them all to lie down for half an hour whilst I should enter everything -up to the moment. I feel so grateful to the man who invented the -"Traveller's" typewriter, and to Mr. Morris for getting this one for -me. I should have felt quite astray doing the work if I had to write -with a pen . . . - -It is all done. Poor dear, dear Jonathan, what he must have suffered, -what he must be suffering now. He lies on the sofa hardly seeming to -breathe, and his whole body appears in collapse. His brows are knit. -His face is drawn with pain. Poor fellow, maybe he is thinking, and I -can see his face all wrinkled up with the concentration of his -thoughts. Oh! if I could only help at all. I shall do what I can. - -I have asked Dr. Van Helsing, and he has got me all the papers that I -have not yet seen. Whilst they are resting, I shall go over all -carefully, and perhaps I may arrive at some conclusion. I shall try -to follow the Professor's example, and think without prejudice on the -facts before me . . . - -I do believe that under God's providence I have made a discovery. I -shall get the maps and look over them. - -I am more than ever sure that I am right. My new conclusion is ready, -so I shall get our party together and read it. They can judge it. It -is well to be accurate, and every minute is precious. - - - -MINA HARKER'S MEMORANDUM - -(ENTERED IN HER JOURNAL) - - -Ground of inquiry.--Count Dracula's problem is to get back -to his own place. - -(a) He must be brought back by some one. This is evident; -for had he power to move himself as he wished he could go -either as man, or wolf, or bat, or in some other way. He -evidently fears discovery or interference, in the state of -helplessness in which he must be, confined as he is between -dawn and sunset in his wooden box. - -(b) How is he to be taken?--Here a process of exclusions may -help us. By road, by rail, by water? - -1. By Road.--There are endless difficulties, especially in -leaving the city. - -(x) There are people. And people are curious, and -investigate. A hint, a surmise, a doubt as to what might -be in the box, would destroy him. - -(y) There are, or there may be, customs and octroi officers -to pass. - -(z) His pursuers might follow. This is his highest fear. -And in order to prevent his being betrayed he has repelled, -so far as he can, even his victim, me! - -2. By Rail.--There is no one in charge of the box. It -would have to take its chance of being delayed, and delay -would be fatal, with enemies on the track. True, he might -escape at night. But what would he be, if left in a strange -place with no refuge that he could fly to? This is not what he -intends, and he does not mean to risk it. - -3. By Water.--Here is the safest way, in one respect, but -with most danger in another. On the water he is powerless -except at night. Even then he can only summon fog and storm and -snow and his wolves. But were he wrecked, the living water would -engulf him, helpless, and he would indeed be lost. He could have -the vessel drive to land, but if it were unfriendly land, wherein -he was not free to move, his position would still be desperate. - -We know from the record that he was on the water, so what -we have to do is to ascertain what water. - -The first thing is to realize exactly what he has done as -yet. We may, then, get a light on what his task is to be. - -Firstly.--We must differentiate between what he did in -London as part of his general plan of action, when he was -pressed for moments and had to arrange as best he could. - -Secondly.--We must see, as well as we can surmise it from the -facts we know of, what he has done here. - -As to the first, he evidently intended to arrive at Galatz, -and sent invoice to Varna to deceive us lest we should ascertain -his means of exit from England. His immediate and sole purpose -then was to escape. The proof of this, is the letter of -instructions sent to Immanuel Hildesheim to clear and take away -the box before sunrise. There is also the instruction to Petrof -Skinsky. These we must only guess at, but there must have been -some letter or message, since Skinsky came to Hildesheim. - -That, so far, his plans were successful we know. The Czarina -Catherine made a phenomenally quick journey. So much so that -Captain Donelson's suspicions were aroused. But his superstition -united with his canniness played the Count's game for him, and he -ran with his favouring wind through fogs and all till he brought -up blindfold at Galatz. That the Count's arrangements were well -made, has been proved. Hildesheim cleared the box, took it off, -and gave it to Skinsky. Skinsky took it, and here we lose the -trail. We only know that the box is somewhere on the water, -moving along. The customs and the octroi, if there be any, have -been avoided. - -Now we come to what the Count must have done after his -arrival, on land, at Galatz. - -The box was given to Skinsky before sunrise. At sunrise -the Count could appear in his own form. Here, we ask why -Skinsky was chosen at all to aid in the work? In my husband's -diary, Skinsky is mentioned as dealing with the Slovaks who trade -down the river to the port. And the man's remark, that the -murder was the work of a Slovak, showed the general feeling -against his class. The Count wanted isolation. - -My surmise is this, that in London the Count decided to get -back to his castle by water, as the most safe and secret -way. He was brought from the castle by Szgany, and probably they -delivered their cargo to Slovaks who took the boxes to Varna, for -there they were shipped to London. Thus the Count had knowledge -of the persons who could arrange this service. When the box was -on land, before sunrise or after sunset, he came out from his -box, met Skinsky and instructed him what to do as to arranging -the carriage of the box up some river. When this was done, and -he knew that all was in train, he blotted out his traces, as he -thought, by murdering his agent. - -I have examined the map and find that the river most -suitable for the Slovaks to have ascended is either the -Pruth or the Sereth. I read in the typescript that in my -trance I heard cows low and water swirling level with my -ears and the creaking of wood. The Count in his box, then, -was on a river in an open boat, propelled probably either -by oars or poles, for the banks are near and it is working -against stream. There would be no such if floating down -stream. - -Of course it may not be either the Sereth or the Pruth, but -we may possibly investigate further. Now of these two, the -Pruth is the more easily navigated, but the Sereth is, at -Fundu, joined by the Bistritza which runs up round the Borgo -Pass. The loop it makes is manifestly as close to Dracula's -castle as can be got by water. - - - -MINA HARKER'S JOURNAL--CONTINUED - -When I had done reading, Jonathan took me in his arms and kissed me. -The others kept shaking me by both hands, and Dr. Van Helsing said, -"Our dear Madam Mina is once more our teacher. Her eyes have been -where we were blinded. Now we are on the track once again, and this -time we may succeed. Our enemy is at his most helpless. And if we -can come on him by day, on the water, our task will be over. He has a -start, but he is powerless to hasten, as he may not leave this box -lest those who carry him may suspect. For them to suspect would be to -prompt them to throw him in the stream where he perish. This he -knows, and will not. Now men, to our Council of War, for here and -now, we must plan what each and all shall do." - -"I shall get a steam launch and follow him," said Lord Godalming. - -"And I, horses to follow on the bank lest by chance he land," said Mr. -Morris. - -"Good!" said the Professor, "both good. But neither must go alone. -There must be force to overcome force if need be. The Slovak is -strong and rough, and he carries rude arms." All the men smiled, for -amongst them they carried a small arsenal. - -Said Mr. Morris, "I have brought some Winchesters. They are pretty -handy in a crowd, and there may be wolves. The Count, if you -remember, took some other precautions. He made some requisitions on -others that Mrs. Harker could not quite hear or understand. We must -be ready at all points." - -Dr. Seward said, "I think I had better go with Quincey. We have been -accustomed to hunt together, and we two, well armed, will be a match -for whatever may come along. You must not be alone, Art. It may be -necessary to fight the Slovaks, and a chance thrust, for I don't -suppose these fellows carry guns, would undo all our plans. There -must be no chances, this time. We shall not rest until the Count's -head and body have been separated, and we are sure that he cannot -reincarnate." - -He looked at Jonathan as he spoke, and Jonathan looked at me. I could -see that the poor dear was torn about in his mind. Of course he -wanted to be with me. But then the boat service would, most likely, -be the one which would destroy the . . . the . . . Vampire. (Why did -I hesitate to write the word?) - -He was silent awhile, and during his silence Dr. Van Helsing spoke, -"Friend Jonathan, this is to you for twice reasons. First, because -you are young and brave and can fight, and all energies may be needed -at the last. And again that it is your right to destroy him. That, -which has wrought such woe to you and yours. Be not afraid for Madam -Mina. She will be my care, if I may. I am old. My legs are not so -quick to run as once. And I am not used to ride so long or to pursue -as need be, or to fight with lethal weapons. But I can be of other -service. I can fight in other way. And I can die, if need be, as -well as younger men. Now let me say that what I would is this. While -you, my Lord Godalming and friend Jonathan go in your so swift little -steamboat up the river, and whilst John and Quincey guard the bank -where perchance he might be landed, I will take Madam Mina right into -the heart of the enemy's country. Whilst the old fox is tied in his -box, floating on the running stream whence he cannot escape to land, -where he dares not raise the lid of his coffin box lest his Slovak -carriers should in fear leave him to perish, we shall go in the track -where Jonathan went, from Bistritz over the Borgo, and find our way to -the Castle of Dracula. Here, Madam Mina's hypnotic power will surely -help, and we shall find our way, all dark and unknown otherwise, after -the first sunrise when we are near that fateful place. There is much -to be done, and other places to be made sanctify, so that that nest of -vipers be obliterated." - -Here Jonathan interrupted him hotly, "Do you mean to say, Professor -Van Helsing, that you would bring Mina, in her sad case and tainted as -she is with that devil's illness, right into the jaws of his -deathtrap? Not for the world! Not for Heaven or Hell!" - -He became almost speechless for a minute, and then went on, "Do you -know what the place is? Have you seen that awful den of hellish -infamy, with the very moonlight alive with grisly shapes, and every -speck of dust that whirls in the wind a devouring monster in embryo? -Have you felt the Vampire's lips upon your throat?" - -Here he turned to me, and as his eyes lit on my forehead he threw up -his arms with a cry, "Oh, my God, what have we done to have this -terror upon us?" and he sank down on the sofa in a collapse of misery. - -The Professor's voice, as he spoke in clear, sweet tones, which seemed -to vibrate in the air, calmed us all. - -"Oh, my friend, it is because I would save Madam Mina from that awful -place that I would go. God forbid that I should take her into that -place. There is work, wild work, to be done before that place can be -purify. Remember that we are in terrible straits. If the Count -escape us this time, and he is strong and subtle and cunning, he may -choose to sleep him for a century, and then in time our dear one," he -took my hand, "would come to him to keep him company, and would be as -those others that you, Jonathan, saw. You have told us of their -gloating lips. You heard their ribald laugh as they clutched the -moving bag that the Count threw to them. You shudder, and well may it -be. Forgive me that I make you so much pain, but it is necessary. My -friend, is it not a dire need for that which I am giving, possibly my -life? If it were that any one went into that place to stay, it is I -who would have to go to keep them company." - -"Do as you will," said Jonathan, with a sob that shook him all over, -"we are in the hands of God!" - - -Later.--Oh, it did me good to see the way that these brave men worked. -How can women help loving men when they are so earnest, and so true, -and so brave! And, too, it made me think of the wonderful power of -money! What can it not do when basely used. I felt so thankful that -Lord Godalming is rich, and both he and Mr. Morris, who also has -plenty of money, are willing to spend it so freely. For if they did -not, our little expedition could not start, either so promptly or so -well equipped, as it will within another hour. It is not three hours -since it was arranged what part each of us was to do. And now Lord -Godalming and Jonathan have a lovely steam launch, with steam up ready -to start at a moment's notice. Dr. Seward and Mr. Morris have half a -dozen good horses, well appointed. We have all the maps and -appliances of various kinds that can be had. Professor Van Helsing -and I are to leave by the 11:40 train tonight for Veresti, where we -are to get a carriage to drive to the Borgo Pass. We are bringing a -good deal of ready money, as we are to buy a carriage and horses. We -shall drive ourselves, for we have no one whom we can trust in the -matter. The Professor knows something of a great many languages, so -we shall get on all right. We have all got arms, even for me a large -bore revolver. Jonathan would not be happy unless I was armed like -the rest. Alas! I cannot carry one arm that the rest do, the scar on -my forehead forbids that. Dear Dr. Van Helsing comforts me by telling -me that I am fully armed as there may be wolves. The weather is -getting colder every hour, and there are snow flurries which come and -go as warnings. - - -Later.--It took all my courage to say goodbye to my darling. We may -never meet again. Courage, Mina! The Professor is looking at you -keenly. His look is a warning. There must be no tears now, unless it -may be that God will let them fall in gladness. - - - -JONATHAN HARKER'S JOURNAL - -30 October, night.--I am writing this in the light from the furnace -door of the steam launch. Lord Godalming is firing up. He is an -experienced hand at the work, as he has had for years a launch of his -own on the Thames, and another on the Norfolk Broads. Regarding our -plans, we finally decided that Mina's guess was correct, and that if -any waterway was chosen for the Count's escape back to his Castle, the -Sereth and then the Bistritza at its junction, would be the one. We -took it, that somewhere about the 47th degree, north latitude, would -be the place chosen for crossing the country between the river and the -Carpathians. We have no fear in running at good speed up the river at -night. There is plenty of water, and the banks are wide enough apart -to make steaming, even in the dark, easy enough. Lord Godalming tells -me to sleep for a while, as it is enough for the present for one to be -on watch. But I cannot sleep, how can I with the terrible danger -hanging over my darling, and her going out into that awful place . . . - -My only comfort is that we are in the hands of God. Only for that -faith it would be easier to die than to live, and so be quit of all -the trouble. Mr. Morris and Dr. Seward were off on their long ride -before we started. They are to keep up the right bank, far enough off -to get on higher lands where they can see a good stretch of river and -avoid the following of its curves. They have, for the first stages, -two men to ride and lead their spare horses, four in all, so as not to -excite curiosity. When they dismiss the men, which shall be shortly, -they shall themselves look after the horses. It may be necessary for -us to join forces. If so they can mount our whole party. One of the -saddles has a moveable horn, and can be easily adapted for Mina, if -required. - -It is a wild adventure we are on. Here, as we are rushing along -through the darkness, with the cold from the river seeming to rise up -and strike us, with all the mysterious voices of the night around us, -it all comes home. We seem to be drifting into unknown places and -unknown ways. Into a whole world of dark and dreadful things. -Godalming is shutting the furnace door . . . - - -31 October.--Still hurrying along. The day has come, and Godalming is -sleeping. I am on watch. The morning is bitterly cold, the furnace -heat is grateful, though we have heavy fur coats. As yet we have -passed only a few open boats, but none of them had on board any box or -package of anything like the size of the one we seek. The men were -scared every time we turned our electric lamp on them, and fell on -their knees and prayed. - - -1 November, evening.--No news all day. We have found nothing of the -kind we seek. We have now passed into the Bistritza, and if we are -wrong in our surmise our chance is gone. We have overhauled every -boat, big and little. Early this morning, one crew took us for a -Government boat, and treated us accordingly. We saw in this a way of -smoothing matters, so at Fundu, where the Bistritza runs into the -Sereth, we got a Roumanian flag which we now fly conspicuously. With -every boat which we have overhauled since then this trick has -succeeded. We have had every deference shown to us, and not once any -objection to whatever we chose to ask or do. Some of the Slovaks tell -us that a big boat passed them, going at more than usual speed as she -had a double crew on board. This was before they came to Fundu, so -they could not tell us whether the boat turned into the Bistritza or -continued on up the Sereth. At Fundu we could not hear of any such -boat, so she must have passed there in the night. I am feeling very -sleepy. The cold is perhaps beginning to tell upon me, and nature -must have rest some time. Godalming insists that he shall keep the -first watch. God bless him for all his goodness to poor dear Mina and -me. - - -2 November, morning.--It is broad daylight. That good fellow would -not wake me. He says it would have been a sin to, for I slept -peacefully and was forgetting my trouble. It seems brutally selfish -to me to have slept so long, and let him watch all night, but he was -quite right. I am a new man this morning. And, as I sit here and -watch him sleeping, I can do all that is necessary both as to minding -the engine, steering, and keeping watch. I can feel that my strength -and energy are coming back to me. I wonder where Mina is now, and Van -Helsing. They should have got to Veresti about noon on Wednesday. It -would take them some time to get the carriage and horses. So if they -had started and travelled hard, they would be about now at the Borgo -Pass. God guide and help them! I am afraid to think what may -happen. If we could only go faster. But we cannot. The engines are -throbbing and doing their utmost. I wonder how Dr. Seward and Mr. -Morris are getting on. There seem to be endless streams running down -the mountains into this river, but as none of them are very large, at -present, at all events, though they are doubtless terrible in winter -and when the snow melts, the horsemen may not have met much -obstruction. I hope that before we get to Strasba we may see them. -For if by that time we have not overtaken the Count, it may be -necessary to take counsel together what to do next. - - - - - -DR. SEWARD'S DIARY - -2 November.--Three days on the road. No news, and no time to write it -if there had been, for every moment is precious. We have had only the -rest needful for the horses. But we are both bearing it wonderfully. -Those adventurous days of ours are turning up useful. We must push -on. We shall never feel happy till we get the launch in sight again. - - -3 November.--We heard at Fundu that the launch had gone up the -Bistritza. I wish it wasn't so cold. There are signs of snow coming. -And if it falls heavy it will stop us. In such case we must get a -sledge and go on, Russian fashion. - -4 November.--Today we heard of the launch having been detained by an -accident when trying to force a way up the rapids. The Slovak boats -get up all right, by aid of a rope and steering with knowledge. Some -went up only a few hours before. Godalming is an amateur fitter -himself, and evidently it was he who put the launch in trim again. - -Finally, they got up the rapids all right, with local help, and are off -on the chase afresh. I fear that the boat is not any better for the -accident, the peasantry tell us that after she got upon smooth water -again, she kept stopping every now and again so long as she was in -sight. We must push on harder than ever. Our help may be wanted -soon. - - - - - -MINA HARKER'S JOURNAL - -31 October.--Arrived at Veresti at noon. The Professor tells me that -this morning at dawn he could hardly hypnotize me at all, and that all -I could say was, "dark and quiet." He is off now buying a carriage -and horses. He says that he will later on try to buy additional -horses, so that we may be able to change them on the way. We have -something more than 70 miles before us. The country is lovely, and -most interesting. If only we were under different conditions, how -delightful it would be to see it all. If Jonathan and I were driving -through it alone what a pleasure it would be. To stop and see people, -and learn something of their life, and to fill our minds and memories -with all the colour and picturesqueness of the whole wild, beautiful -country and the quaint people! But, alas! - - -Later.--Dr. Van Helsing has returned. He has got the carriage and -horses. We are to have some dinner, and to start in an hour. The -landlady is putting us up a huge basket of provisions. It seems -enough for a company of soldiers. The Professor encourages her, and -whispers to me that it may be a week before we can get any food again. -He has been shopping too, and has sent home such a wonderful lot of -fur coats and wraps, and all sorts of warm things. There will not be -any chance of our being cold. - -We shall soon be off. I am afraid to think what may happen to us. We -are truly in the hands of God. He alone knows what may be, and I pray -Him, with all the strength of my sad and humble soul, that He will -watch over my beloved husband. That whatever may happen, Jonathan may -know that I loved him and honoured him more than I can say, and that my -latest and truest thought will be always for him. - - - - -CHAPTER 27 - - -MINA HARKER'S JOURNAL - -1 November.--All day long we have travelled, and at a good speed. The -horses seem to know that they are being kindly treated, for they go -willingly their full stage at best speed. We have now had so many -changes and find the same thing so constantly that we are encouraged -to think that the journey will be an easy one. Dr. Van Helsing is -laconic, he tells the farmers that he is hurrying to Bistritz, and -pays them well to make the exchange of horses. We get hot soup, or -coffee, or tea, and off we go. It is a lovely country. Full of -beauties of all imaginable kinds, and the people are brave, and -strong, and simple, and seem full of nice qualities. They are very, -very superstitious. In the first house where we stopped, when the -woman who served us saw the scar on my forehead, she crossed herself -and put out two fingers towards me, to keep off the evil eye. I -believe they went to the trouble of putting an extra amount of garlic -into our food, and I can't abide garlic. Ever since then I have taken -care not to take off my hat or veil, and so have escaped their -suspicions. We are travelling fast, and as we have no driver with us -to carry tales, we go ahead of scandal. But I daresay that fear of -the evil eye will follow hard behind us all the way. The Professor -seems tireless. All day he would not take any rest, though he made me -sleep for a long spell. At sunset time he hypnotized me, and he says -I answered as usual, "darkness, lapping water and creaking wood." So -our enemy is still on the river. I am afraid to think of Jonathan, -but somehow I have now no fear for him, or for myself. I write this -whilst we wait in a farmhouse for the horses to be ready. Dr. Van -Helsing is sleeping. Poor dear, he looks very tired and old and grey, -but his mouth is set as firmly as a conqueror's. Even in his sleep he -is intense with resolution. When we have well started I must make him -rest whilst I drive. I shall tell him that we have days before us, -and he must not break down when most of all his strength will be -needed . . . All is ready. We are off shortly. - - -2 November, morning.--I was successful, and we took turns driving all -night. Now the day is on us, bright though cold. There is a strange -heaviness in the air. I say heaviness for want of a better word. I -mean that it oppresses us both. It is very cold, and only our warm -furs keep us comfortable. At dawn Van Helsing hypnotized me. He says -I answered "darkness, creaking wood and roaring water," so the river -is changing as they ascend. I do hope that my darling will not run -any chance of danger, more than need be, but we are in God's hands. - - -2 November, night.--All day long driving. The country gets wilder as -we go, and the great spurs of the Carpathians, which at Veresti seemed -so far from us and so low on the horizon, now seem to gather round us -and tower in front. We both seem in good spirits. I think we make an -effort each to cheer the other, in the doing so we cheer ourselves. -Dr. Van Helsing says that by morning we shall reach the Borgo Pass. -The houses are very few here now, and the Professor says that the last -horse we got will have to go on with us, as we may not be able to -change. He got two in addition to the two we changed, so that now we -have a rude four-in-hand. The dear horses are patient and good, and -they give us no trouble. We are not worried with other travellers, -and so even I can drive. We shall get to the Pass in daylight. We do -not want to arrive before. So we take it easy, and have each a long -rest in turn. Oh, what will tomorrow bring to us? We go to seek the -place where my poor darling suffered so much. God grant that we may -be guided aright, and that He will deign to watch over my husband and -those dear to us both, and who are in such deadly peril. As for me, I -am not worthy in His sight. Alas! I am unclean to His eyes, and -shall be until He may deign to let me stand forth in His sight as one -of those who have not incurred His wrath. - - - - - -MEMORANDUM BY ABRAHAM VAN HELSING - -4 November.--This to my old and true friend John Seward, M.D., -of Purfleet, London, in case I may not see him. It may -explain. It is morning, and I write by a fire which all -the night I have kept alive, Madam Mina aiding me. It is -cold, cold. So cold that the grey heavy sky is full of -snow, which when it falls will settle for all winter as the -ground is hardening to receive it. It seems to have affected -Madam Mina. She has been so heavy of head all day that she was -not like herself. She sleeps, and sleeps, and sleeps! She who -is usual so alert, have done literally nothing all the day. She -even have lost her appetite. She make no entry into her little -diary, she who write so faithful at every pause. Something -whisper to me that all is not well. However, tonight she is more -_vif_. Her long sleep all day have refresh and restore her, for -now she is all sweet and bright as ever. At sunset I try to -hypnotize her, but alas! with no effect. The power has grown -less and less with each day, and tonight it fail me altogether. -Well, God's will be done, whatever it may be, and whithersoever -it may lead! - -Now to the historical, for as Madam Mina write not in her -stenography, I must, in my cumbrous old fashion, that so -each day of us may not go unrecorded. - -We got to the Borgo Pass just after sunrise yesterday -morning. When I saw the signs of the dawn I got ready for -the hypnotism. We stopped our carriage, and got down so -that there might be no disturbance. I made a couch with -furs, and Madam Mina, lying down, yield herself as usual, -but more slow and more short time than ever, to the hypnotic -sleep. As before, came the answer, "darkness and the swirling of -water." Then she woke, bright and radiant and we go on our way -and soon reach the Pass. At this time and place, she become all -on fire with zeal. Some new guiding power be in her manifested, -for she point to a road and say, "This is the way." - -"How know you it?" I ask. - -"Of course I know it," she answer, and with a pause, add, -"Have not my Jonathan travelled it and wrote of his travel?" - -At first I think somewhat strange, but soon I see that there be -only one such byroad. It is used but little, and very different -from the coach road from the Bukovina to Bistritz, which is more -wide and hard, and more of use. - -So we came down this road. When we meet other ways, not -always were we sure that they were roads at all, for they -be neglect and light snow have fallen, the horses know and -they only. I give rein to them, and they go on so patient. By -and by we find all the things which Jonathan have note in that -wonderful diary of him. Then we go on for long, long hours and -hours. At the first, I tell Madam Mina to sleep. She try, and -she succeed. She sleep all the time, till at the last, I feel -myself to suspicious grow, and attempt to wake her. But she -sleep on, and I may not wake her though I try. I do not wish to -try too hard lest I harm her. For I know that she have suffer -much, and sleep at times be all-in-all to her. I think I drowse -myself, for all of sudden I feel guilt, as though I have done -something. I find myself bolt up, with the reins in my hand, and -the good horses go along jog, jog, just as ever. I look down and -find Madam Mina still asleep. It is now not far off sunset time, -and over the snow the light of the sun flow in big yellow flood, -so that we throw great long shadow on where the mountain rise so -steep. For we are going up, and up, and all is oh so wild and -rocky, as though it were the end of the world. - -Then I arouse Madam Mina. This time she wake with not much -trouble, and then I try to put her to hypnotic sleep. But -she sleep not, being as though I were not. Still I try and -try, till all at once I find her and myself in dark, so I -look round, and find that the sun have gone down. Madam -Mina laugh, and I turn and look at her. She is now quite -awake, and look so well as I never saw her since that night -at Carfax when we first enter the Count's house. I am amaze, and -not at ease then. But she is so bright and tender and thoughtful -for me that I forget all fear. I light a fire, for we have -brought supply of wood with us, and she prepare food while I undo -the horses and set them, tethered in shelter, to feed. Then when -I return to the fire she have my supper ready. I go to help her, -but she smile, and tell me that she have eat already. That she -was so hungry that she would not wait. I like it not, and I have -grave doubts. But I fear to affright her, and so I am silent of -it. She help me and I eat alone, and then we wrap in fur and lie -beside the fire, and I tell her to sleep while I watch. But -presently I forget all of watching. And when I sudden remember -that I watch, I find her lying quiet, but awake, and looking at -me with so bright eyes. Once, twice more the same occur, and I -get much sleep till before morning. When I wake I try to -hypnotize her, but alas! though she shut her eyes obedient, she -may not sleep. The sun rise up, and up, and up, and then sleep -come to her too late, but so heavy that she will not wake. I -have to lift her up, and place her sleeping in the carriage when -I have harnessed the horses and made all ready. Madam still -sleep, and she look in her sleep more healthy and more redder -than before. And I like it not. And I am afraid, afraid, -afraid! I am afraid of all things, even to think but I must go -on my way. The stake we play for is life and death, or more than -these, and we must not flinch. - - -5 November, morning.--Let me be accurate in everything, for -though you and I have seen some strange things together, -you may at the first think that I, Van Helsing, am mad. -That the many horrors and the so long strain on nerves has -at the last turn my brain. - -All yesterday we travel, always getting closer to the -mountains, and moving into a more and more wild and desert -land. There are great, frowning precipices and much falling -water, and Nature seem to have held sometime her carnival. Madam -Mina still sleep and sleep. And though I did have hunger and -appeased it, I could not waken her, even for food. I began to -fear that the fatal spell of the place was upon her, tainted as -she is with that Vampire baptism. "Well," said I to myself, "if -it be that she sleep all the day, it shall also be that I do not -sleep at night." As we travel on the rough road, for a road of -an ancient and imperfect kind there was, I held down my head and -slept. - -Again I waked with a sense of guilt and of time passed, and -found Madam Mina still sleeping, and the sun low down. But -all was indeed changed. The frowning mountains seemed further -away, and we were near the top of a steep rising hill, on summit -of which was such a castle as Jonathan tell of in his diary. At -once I exulted and feared. For now, for good or ill, the end was -near. - -I woke Madam Mina, and again tried to hypnotize her, but -alas! unavailing till too late. Then, ere the great dark -came upon us, for even after down sun the heavens reflected -the gone sun on the snow, and all was for a time in a great -twilight. I took out the horses and fed them in what shelter I -could. Then I make a fire, and near it I make Madam Mina, now -awake and more charming than ever, sit comfortable amid her rugs. -I got ready food, but she would not eat, simply saying that she -had not hunger. I did not press her, knowing her unavailingness. -But I myself eat, for I must needs now be strong for all. Then, -with the fear on me of what might be, I drew a ring so big for -her comfort, round where Madam Mina sat. And over the ring I -passed some of the wafer, and I broke it fine so that all was -well guarded. She sat still all the time, so still as one dead. -And she grew whiter and even whiter till the snow was not more -pale, and no word she said. But when I drew near, she clung to -me, and I could know that the poor soul shook her from head to -feet with a tremor that was pain to feel. - -I said to her presently, when she had grown more quiet, -"Will you not come over to the fire?" for I wished to make -a test of what she could. She rose obedient, but when she -have made a step she stopped, and stood as one stricken. - -"Why not go on?" I asked. She shook her head, and coming -back, sat down in her place. Then, looking at me with open -eyes, as of one waked from sleep, she said simply, "I cannot!" -and remained silent. I rejoiced, for I knew that what she could -not, none of those that we dreaded could. Though there might be -danger to her body, yet her soul was safe! - -Presently the horses began to scream, and tore at their -tethers till I came to them and quieted them. When they -did feel my hands on them, they whinnied low as in joy, and -licked at my hands and were quiet for a time. Many times -through the night did I come to them, till it arrive to the -cold hour when all nature is at lowest, and every time my -coming was with quiet of them. In the cold hour the fire -began to die, and I was about stepping forth to replenish -it, for now the snow came in flying sweeps and with it a -chill mist. Even in the dark there was a light of some -kind, as there ever is over snow, and it seemed as though -the snow flurries and the wreaths of mist took shape as of -women with trailing garments. All was in dead, grim silence only -that the horses whinnied and cowered, as if in terror of the -worst. I began to fear, horrible fears. But then came to me the -sense of safety in that ring wherein I stood. I began too, to -think that my imaginings were of the night, and the gloom, and -the unrest that I have gone through, and all the terrible -anxiety. It was as though my memories of all Jonathan's horrid -experience were befooling me. For the snow flakes and the mist -began to wheel and circle round, till I could get as though a -shadowy glimpse of those women that would have kissed him. And -then the horses cowered lower and lower, and moaned in terror as -men do in pain. Even the madness of fright was not to them, so -that they could break away. I feared for my dear Madam Mina when -these weird figures drew near and circled round. I looked at her, -but she sat calm, and smiled at me. When I would have stepped to -the fire to replenish it, she caught me and held me back, and -whispered, like a voice that one hears in a dream, so low it was. - -"No! No! Do not go without. Here you are safe!" - -I turned to her, and looking in her eyes said, "But you? -It is for you that I fear!" - -Whereat she laughed, a laugh low and unreal, and said, "Fear -for me! Why fear for me? None safer in all the world from -them than I am," and as I wondered at the meaning of her -words, a puff of wind made the flame leap up, and I see the -red scar on her forehead. Then, alas! I knew. Did I not, -I would soon have learned, for the wheeling figures of mist -and snow came closer, but keeping ever without the Holy -circle. Then they began to materialize till, if God have -not taken away my reason, for I saw it through my eyes. -There were before me in actual flesh the same three women -that Jonathan saw in the room, when they would have kissed -his throat. I knew the swaying round forms, the bright -hard eyes, the white teeth, the ruddy colour, the voluptuous -lips. They smiled ever at poor dear Madam Mina. And as -their laugh came through the silence of the night, they -twined their arms and pointed to her, and said in those so -sweet tingling tones that Jonathan said were of the intolerable -sweetness of the water glasses, "Come, sister. Come to us. -Come!" - -In fear I turned to my poor Madam Mina, and my heart with -gladness leapt like flame. For oh! the terror in her sweet -eyes, the repulsion, the horror, told a story to my heart -that was all of hope. God be thanked she was not, yet, of -them. I seized some of the firewood which was by me, and -holding out some of the Wafer, advanced on them towards the -fire. They drew back before me, and laughed their low horrid -laugh. I fed the fire, and feared them not. For I knew that we -were safe within the ring, which she could not leave no more than -they could enter. The horses had ceased to moan, and lay still -on the ground. The snow fell on them softly, and they grew -whiter. I knew that there was for the poor beasts no more of -terror. - -And so we remained till the red of the dawn began to fall -through the snow gloom. I was desolate and afraid, and -full of woe and terror. But when that beautiful sun began -to climb the horizon life was to me again. At the first -coming of the dawn the horrid figures melted in the whirling -mist and snow. The wreaths of transparent gloom moved away -towards the castle, and were lost. - -Instinctively, with the dawn coming, I turned to Madam Mina, -intending to hypnotize her. But she lay in a deep and sudden -sleep, from which I could not wake her. I tried to hypnotize -through her sleep, but she made no response, none at all, and the -day broke. I fear yet to stir. I have made my fire and have -seen the horses, they are all dead. Today I have much to do here, -and I keep waiting till the sun is up high. For there may be -places where I must go, where that sunlight, though snow and mist -obscure it, will be to me a safety. - -I will strengthen me with breakfast, and then I will do my -terrible work. Madam Mina still sleeps, and God be thanked! She -is calm in her sleep . . . - - - -JONATHAN HARKER'S JOURNAL - -4 November, evening.--The accident to the launch has been a terrible -thing for us. Only for it we should have overtaken the boat long ago, -and by now my dear Mina would have been free. I fear to think of her, -off on the wolds near that horrid place. We have got horses, and we -follow on the track. I note this whilst Godalming is getting ready. -We have our arms. The Szgany must look out if they mean to fight. Oh, -if only Morris and Seward were with us. We must only hope! If I -write no more Goodby Mina! God bless and keep you. - - - -DR. SEWARD'S DIARY - -5 November.--With the dawn we saw the body of Szgany before us dashing -away from the river with their leiter wagon. They surrounded it in a -cluster, and hurried along as though beset. The snow is falling -lightly and there is a strange excitement in the air. It may be our -own feelings, but the depression is strange. Far off I hear the -howling of wolves. The snow brings them down from the mountains, and -there are dangers to all of us, and from all sides. The horses are -nearly ready, and we are soon off. We ride to death of some one. God -alone knows who, or where, or what, or when, or how it may be . . . - - - - - -DR. VAN HELSING'S MEMORANDUM - -5 November, afternoon.--I am at least sane. Thank God for -that mercy at all events, though the proving it has been -dreadful. When I left Madam Mina sleeping within the Holy -circle, I took my way to the castle. The blacksmith hammer -which I took in the carriage from Veresti was useful, though the -doors were all open I broke them off the rusty hinges, lest some -ill intent or ill chance should close them, so that being entered -I might not get out. Jonathan's bitter experience served me -here. By memory of his diary I found my way to the old chapel, -for I knew that here my work lay. The air was oppressive. It -seemed as if there was some sulphurous fume, which at times made -me dizzy. Either there was a roaring in my ears or I heard afar -off the howl of wolves. Then I bethought me of my dear Madam -Mina, and I was in terrible plight. The dilemma had me between -his horns. - -Her, I had not dare to take into this place, but left safe -from the Vampire in that Holy circle. And yet even there -would be the wolf! I resolve me that my work lay here, and -that as to the wolves we must submit, if it were God's will. At -any rate it was only death and freedom beyond. So did I choose -for her. Had it but been for myself the choice had been easy, -the maw of the wolf were better to rest in than the grave of the -Vampire! So I make my choice to go on with my work. - -I knew that there were at least three graves to find, graves -that are inhabit. So I search, and search, and I find one -of them. She lay in her Vampire sleep, so full of life and -voluptuous beauty that I shudder as though I have come to -do murder. Ah, I doubt not that in the old time, when such -things were, many a man who set forth to do such a task as -mine, found at the last his heart fail him, and then his -nerve. So he delay, and delay, and delay, till the mere -beauty and the fascination of the wanton Undead have hypnotize -him. And he remain on and on, till sunset come, and the Vampire -sleep be over. Then the beautiful eyes of the fair woman open -and look love, and the voluptuous mouth present to a kiss, and -the man is weak. And there remain one more victim in the -Vampire fold. One more to swell the grim and grisly ranks -of the Undead! . . . - -There is some fascination, surely, when I am moved by the -mere presence of such an one, even lying as she lay in a -tomb fretted with age and heavy with the dust of centuries, -though there be that horrid odour such as the lairs of the -Count have had. Yes, I was moved. I, Van Helsing, with -all my purpose and with my motive for hate. I was moved to -a yearning for delay which seemed to paralyze my faculties -and to clog my very soul. It may have been that the need -of natural sleep, and the strange oppression of the air -were beginning to overcome me. Certain it was that I was -lapsing into sleep, the open eyed sleep of one who yields -to a sweet fascination, when there came through the snow-stilled -air a long, low wail, so full of woe and pity that it woke me -like the sound of a clarion. For it was the voice of my dear -Madam Mina that I heard. - -Then I braced myself again to my horrid task, and found by -wrenching away tomb tops one other of the sisters, the other dark -one. I dared not pause to look on her as I had on her sister, -lest once more I should begin to be enthrall. But I go on -searching until, presently, I find in a high great tomb as if -made to one much beloved that other fair sister which, like -Jonathan I had seen to gather herself out of the atoms of the -mist. She was so fair to look on, so radiantly beautiful, so -exquisitely voluptuous, that the very instinct of man in me, -which calls some of my sex to love and to protect one of hers, -made my head whirl with new emotion. But God be thanked, that -soul wail of my dear Madam Mina had not died out of my ears. -And, before the spell could be wrought further upon me, I had -nerved myself to my wild work. By this time I had searched all -the tombs in the chapel, so far as I could tell. And as there -had been only three of these Undead phantoms around us in the -night, I took it that there were no more of active Undead -existent. There was one great tomb more lordly than all the -rest. Huge it was, and nobly proportioned. On it was but one -word. - - - DRACULA - - -This then was the Undead home of the King Vampire, to whom -so many more were due. Its emptiness spoke eloquent to -make certain what I knew. Before I began to restore these -women to their dead selves through my awful work, I laid in -Dracula's tomb some of the Wafer, and so banished him from -it, Undead, for ever. - -Then began my terrible task, and I dreaded it. Had it been -but one, it had been easy, comparative. But three! To -begin twice more after I had been through a deed of horror. -For it was terrible with the sweet Miss Lucy, what would it -not be with these strange ones who had survived through -centuries, and who had been strengthened by the passing of -the years. Who would, if they could, have fought for their -foul lives . . . - -Oh, my friend John, but it was butcher work. Had I not -been nerved by thoughts of other dead, and of the living -over whom hung such a pall of fear, I could not have gone -on. I tremble and tremble even yet, though till all was -over, God be thanked, my nerve did stand. Had I not seen -the repose in the first place, and the gladness that stole -over it just ere the final dissolution came, as realization -that the soul had been won, I could not have gone further -with my butchery. I could not have endured the horrid screeching -as the stake drove home, the plunging of writhing form, and lips -of bloody foam. I should have fled in terror and left my work -undone. But it is over! And the poor souls, I can pity them now -and weep, as I think of them placid each in her full sleep of -death for a short moment ere fading. For, friend John, hardly -had my knife severed the head of each, before the whole body -began to melt away and crumble into its native dust, as though -the death that should have come centuries ago had at last assert -himself and say at once and loud, "I am here!" - -Before I left the castle I so fixed its entrances that never -more can the Count enter there Undead. - -When I stepped into the circle where Madam Mina slept, she -woke from her sleep and, seeing me, cried out in pain that -I had endured too much. - -"Come!" she said, "come away from this awful place! Let us -go to meet my husband who is, I know, coming towards us." -She was looking thin and pale and weak. But her eyes were -pure and glowed with fervour. I was glad to see her paleness and -her illness, for my mind was full of the fresh horror of that -ruddy vampire sleep. - -And so with trust and hope, and yet full of fear, we go -eastward to meet our friends, and him, whom Madam Mina tell -me that she know are coming to meet us. - - - - - -MINA HARKER'S JOURNAL - -6 November.--It was late in the afternoon when the Professor and I -took our way towards the east whence I knew Jonathan was coming. We -did not go fast, though the way was steeply downhill, for we had to -take heavy rugs and wraps with us. We dared not face the possibility -of being left without warmth in the cold and the snow. We had to take -some of our provisions too, for we were in a perfect desolation, and -so far as we could see through the snowfall, there was not even the -sign of habitation. When we had gone about a mile, I was tired with -the heavy walking and sat down to rest. Then we looked back and saw -where the clear line of Dracula's castle cut the sky. For we were so -deep under the hill whereon it was set that the angle of perspective -of the Carpathian mountains was far below it. We saw it in all its -grandeur, perched a thousand feet on the summit of a sheer precipice, -and with seemingly a great gap between it and the steep of the -adjacent mountain on any side. There was something wild and uncanny -about the place. We could hear the distant howling of wolves. They -were far off, but the sound, even though coming muffled through the -deadening snowfall, was full of terror. I knew from the way Dr. Van -Helsing was searching about that he was trying to seek some strategic -point, where we would be less exposed in case of attack. The rough -roadway still led downwards. We could trace it through the drifted -snow. - -In a little while the Professor signalled to me, so I got up and -joined him. He had found a wonderful spot, a sort of natural hollow -in a rock, with an entrance like a doorway between two boulders. He -took me by the hand and drew me in. - -"See!" he said, "here you will be in shelter. And if the wolves do -come I can meet them one by one." - -He brought in our furs, and made a snug nest for me, and got out some -provisions and forced them upon me. But I could not eat, to even try -to do so was repulsive to me, and much as I would have liked to please -him, I could not bring myself to the attempt. He looked very sad, but -did not reproach me. Taking his field glasses from the case, he stood -on the top of the rock, and began to search the horizon. - -Suddenly he called out, "Look! Madam Mina, look! Look!" - -I sprang up and stood beside him on the rock. He handed me his -glasses and pointed. The snow was now falling more heavily, and -swirled about fiercely, for a high wind was beginning to blow. -However, there were times when there were pauses between the snow -flurries and I could see a long way round. From the height where we -were it was possible to see a great distance. And far off, beyond the -white waste of snow, I could see the river lying like a black ribbon -in kinks and curls as it wound its way. Straight in front of us and -not far off, in fact so near that I wondered we had not noticed -before, came a group of mounted men hurrying along. In the midst of -them was a cart, a long leiter wagon which swept from side to side, -like a dog's tail wagging, with each stern inequality of the road. -Outlined against the snow as they were, I could see from the men's -clothes that they were peasants or gypsies of some kind. - -On the cart was a great square chest. My heart leaped as I saw it, for -I felt that the end was coming. The evening was now drawing close, -and well I knew that at sunset the Thing, which was till then -imprisoned there, would take new freedom and could in any of many -forms elude pursuit. In fear I turned to the Professor. To my -consternation, however, he was not there. An instant later, I saw him -below me. Round the rock he had drawn a circle, such as we had found -shelter in last night. - -When he had completed it he stood beside me again saying, "At least -you shall be safe here from him!" He took the glasses from me, and at -the next lull of the snow swept the whole space below us. "See," he -said, "they come quickly. They are flogging the horses, and galloping -as hard as they can." - -He paused and went on in a hollow voice, "They are racing for the -sunset. We may be too late. God's will be done!" Down came another -blinding rush of driving snow, and the whole landscape was blotted -out. It soon passed, however, and once more his glasses were fixed on -the plain. - -Then came a sudden cry, "Look! Look! Look! See, two horsemen follow -fast, coming up from the south. It must be Quincey and John. Take -the glass. Look before the snow blots it all out!" I took it and -looked. The two men might be Dr. Seward and Mr. Morris. I knew at -all events that neither of them was Jonathan. At the same time I knew -that Jonathan was not far off. Looking around I saw on the north side -of the coming party two other men, riding at breakneck speed. One of -them I knew was Jonathan, and the other I took, of course, to be Lord -Godalming. They too, were pursuing the party with the cart. When I -told the Professor he shouted in glee like a schoolboy, and after -looking intently till a snow fall made sight impossible, he laid his -Winchester rifle ready for use against the boulder at the opening of -our shelter. - -"They are all converging," he said. "When the time comes we shall have -gypsies on all sides." I got out my revolver ready to hand, for -whilst we were speaking the howling of wolves came louder and closer. -When the snow storm abated a moment we looked again. It was strange -to see the snow falling in such heavy flakes close to us, and beyond, -the sun shining more and more brightly as it sank down towards the far -mountain tops. Sweeping the glass all around us I could see here and -there dots moving singly and in twos and threes and larger numbers. -The wolves were gathering for their prey. - -Every instant seemed an age whilst we waited. The wind came now in -fierce bursts, and the snow was driven with fury as it swept upon us -in circling eddies. At times we could not see an arm's length before -us. But at others, as the hollow sounding wind swept by us, it seemed -to clear the air space around us so that we could see afar off. We -had of late been so accustomed to watch for sunrise and sunset, that -we knew with fair accuracy when it would be. And we knew that before -long the sun would set. It was hard to believe that by our watches it -was less than an hour that we waited in that rocky shelter before the -various bodies began to converge close upon us. The wind came now -with fiercer and more bitter sweeps, and more steadily from the -north. It seemingly had driven the snow clouds from us, for with only -occasional bursts, the snow fell. We could distinguish clearly the -individuals of each party, the pursued and the pursuers. Strangely -enough those pursued did not seem to realize, or at least to care, -that they were pursued. They seemed, however, to hasten with -redoubled speed as the sun dropped lower and lower on the mountain -tops. - -Closer and closer they drew. The Professor and I crouched down behind -our rock, and held our weapons ready. I could see that he was -determined that they should not pass. One and all were quite unaware -of our presence. - -All at once two voices shouted out to "Halt!" One was my Jonathan's, -raised in a high key of passion. The other Mr. Morris' strong -resolute tone of quiet command. The gypsies may not have known the -language, but there was no mistaking the tone, in whatever tongue the -words were spoken. Instinctively they reined in, and at the instant -Lord Godalming and Jonathan dashed up at one side and Dr. Seward and -Mr. Morris on the other. The leader of the gypsies, a splendid -looking fellow who sat his horse like a centaur, waved them back, and -in a fierce voice gave to his companions some word to proceed. They -lashed the horses which sprang forward. But the four men raised their -Winchester rifles, and in an unmistakable way commanded them to stop. -At the same moment Dr. Van Helsing and I rose behind the rock and -pointed our weapons at them. Seeing that they were surrounded the men -tightened their reins and drew up. The leader turned to them and gave -a word at which every man of the gypsy party drew what weapon he -carried, knife or pistol, and held himself in readiness to attack. -Issue was joined in an instant. - -The leader, with a quick movement of his rein, threw his horse out in -front, and pointed first to the sun, now close down on the hill tops, -and then to the castle, said something which I did not understand. -For answer, all four men of our party threw themselves from their -horses and dashed towards the cart. I should have felt terrible fear -at seeing Jonathan in such danger, but that the ardor of battle must -have been upon me as well as the rest of them. I felt no fear, but -only a wild, surging desire to do something. Seeing the quick -movement of our parties, the leader of the gypsies gave a command. His -men instantly formed round the cart in a sort of undisciplined -endeavour, each one shouldering and pushing the other in his eagerness -to carry out the order. - -In the midst of this I could see that Jonathan on one side of the ring -of men, and Quincey on the other, were forcing a way to the cart. It -was evident that they were bent on finishing their task before the sun -should set. Nothing seemed to stop or even to hinder them. Neither -the levelled weapons nor the flashing knives of the gypsies in front, -nor the howling of the wolves behind, appeared to even attract their -attention. Jonathan's impetuosity, and the manifest singleness of his -purpose, seemed to overawe those in front of him. Instinctively they -cowered aside and let him pass. In an instant he had jumped upon the -cart, and with a strength which seemed incredible, raised the great -box, and flung it over the wheel to the ground. In the meantime, Mr. -Morris had had to use force to pass through his side of the ring of -Szgany. All the time I had been breathlessly watching Jonathan I had, -with the tail of my eye, seen him pressing desperately forward, and -had seen the knives of the gypsies flash as he won a way through them, -and they cut at him. He had parried with his great bowie knife, and -at first I thought that he too had come through in safety. But as he -sprang beside Jonathan, who had by now jumped from the cart, I could -see that with his left hand he was clutching at his side, and that the -blood was spurting through his fingers. He did not delay -notwithstanding this, for as Jonathan, with desperate energy, attacked -one end of the chest, attempting to prize off the lid with his great -Kukri knife, he attacked the other frantically with his bowie. Under -the efforts of both men the lid began to yield. The nails drew with a -screeching sound, and the top of the box was thrown back. - -By this time the gypsies, seeing themselves covered by the -Winchesters, and at the mercy of Lord Godalming and Dr. Seward, had -given in and made no further resistance. The sun was almost down on -the mountain tops, and the shadows of the whole group fell upon the -snow. I saw the Count lying within the box upon the earth, some of -which the rude falling from the cart had scattered over him. He was -deathly pale, just like a waxen image, and the red eyes glared with -the horrible vindictive look which I knew so well. - -As I looked, the eyes saw the sinking sun, and the look of hate in -them turned to triumph. - -But, on the instant, came the sweep and flash of Jonathan's great -knife. I shrieked as I saw it shear through the throat. Whilst at -the same moment Mr. Morris's bowie knife plunged into the heart. - -It was like a miracle, but before our very eyes, and almost in the -drawing of a breath, the whole body crumbled into dust and passed from -our sight. - -I shall be glad as long as I live that even in that moment of final -dissolution, there was in the face a look of peace, such as I never -could have imagined might have rested there. - -The Castle of Dracula now stood out against the red sky, and every -stone of its broken battlements was articulated against the light of -the setting sun. - -The gypsies, taking us as in some way the cause of the extraordinary -disappearance of the dead man, turned, without a word, and rode away -as if for their lives. Those who were unmounted jumped upon the -leiter wagon and shouted to the horsemen not to desert them. The -wolves, which had withdrawn to a safe distance, followed in their -wake, leaving us alone. - -Mr. Morris, who had sunk to the ground, leaned on his elbow, holding -his hand pressed to his side. The blood still gushed through his -fingers. I flew to him, for the Holy circle did not now keep me back; -so did the two doctors. Jonathan knelt behind him and the wounded man -laid back his head on his shoulder. With a sigh he took, with a -feeble effort, my hand in that of his own which was unstained. - -He must have seen the anguish of my heart in my face, for he smiled at -me and said, "I am only too happy to have been of service! Oh, God!" -he cried suddenly, struggling to a sitting posture and pointing to me. -"It was worth for this to die! Look! Look!" - -The sun was now right down upon the mountain top, and the red gleams -fell upon my face, so that it was bathed in rosy light. With one -impulse the men sank on their knees and a deep and earnest "Amen" -broke from all as their eyes followed the pointing of his finger. - -The dying man spoke, "Now God be thanked that all has not been in -vain! See! The snow is not more stainless than her forehead! The -curse has passed away!" - -And, to our bitter grief, with a smile and in silence, he died, a -gallant gentleman. - - - - - -NOTE - - -Seven years ago we all went through the flames. And the happiness of -some of us since then is, we think, well worth the pain we endured. -It is an added joy to Mina and to me that our boy's birthday is the -same day as that on which Quincey Morris died. His mother holds, I -know, the secret belief that some of our brave friend's spirit has -passed into him. His bundle of names links all our little band of men -together. But we call him Quincey. - -In the summer of this year we made a journey to Transylvania, and went -over the old ground which was, and is, to us so full of vivid and -terrible memories. It was almost impossible to believe that the -things which we had seen with our own eyes and heard with our own ears -were living truths. Every trace of all that had been was blotted -out. The castle stood as before, reared high above a waste of -desolation. - -When we got home we were talking of the old time, which we could all -look back on without despair, for Godalming and Seward are both -happily married. I took the papers from the safe where they had been -ever since our return so long ago. We were struck with the fact, that -in all the mass of material of which the record is composed, there is -hardly one authentic document. Nothing but a mass of typewriting, -except the later notebooks of Mina and Seward and myself, and Van -Helsing's memorandum. We could hardly ask any one, even did we wish -to, to accept these as proofs of so wild a story. Van Helsing summed -it all up as he said, with our boy on his knee. - -"We want no proofs. We ask none to believe us! This boy will some -day know what a brave and gallant woman his mother is. Already he -knows her sweetness and loving care. Later on he will understand how -some men so loved her, that they did dare much for her sake." - -JONATHAN HARKER - - - - - - - - - -End of the Project Gutenberg EBook of Dracula, by Bram Stoker - -*** END OF THIS PROJECT GUTENBERG EBOOK DRACULA *** - -***** This file should be named 345.txt or 345.zip ***** -This and all associated files of various formats will be found in: - http://www.gutenberg.org/3/4/345/ - - - -Updated editions will replace the previous one--the old editions -will be renamed. - -Creating the works from public domain print editions means that no -one owns a United States copyright in these works, so the Foundation -(and you!) can copy and distribute it in the United States without -permission and without paying copyright royalties. Special rules, -set forth in the General Terms of Use part of this license, apply to -copying and distributing Project Gutenberg-tm electronic works to -protect the PROJECT GUTENBERG-tm concept and trademark. Project -Gutenberg is a registered trademark, and may not be used if you -charge for the eBooks, unless you receive specific permission. If you -do not charge anything for copies of this eBook, complying with the -rules is very easy. You may use this eBook for nearly any purpose -such as creation of derivative works, reports, performances and -research. They may be modified and printed and given away--you may do -practically ANYTHING with public domain eBooks. Redistribution is -subject to the trademark license, especially commercial -redistribution. - - - -*** START: FULL LICENSE *** - -THE FULL PROJECT GUTENBERG LICENSE -PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK - -To protect the Project Gutenberg-tm mission of promoting the free -distribution of electronic works, by using or distributing this work -(or any other work associated in any way with the phrase "Project -Gutenberg"), you agree to comply with all the terms of the Full Project -Gutenberg-tm License (available with this file or online at -http://gutenberg.net/license). - - -Section 1. General Terms of Use and Redistributing Project Gutenberg-tm -electronic works - -1.A. By reading or using any part of this Project Gutenberg-tm -electronic work, you indicate that you have read, understand, agree to -and accept all the terms of this license and intellectual property -(trademark/copyright) agreement. If you do not agree to abide by all -the terms of this agreement, you must cease using and return or destroy -all copies of Project Gutenberg-tm electronic works in your possession. -If you paid a fee for obtaining a copy of or access to a Project -Gutenberg-tm electronic work and you do not agree to be bound by the -terms of this agreement, you may obtain a refund from the person or -entity to whom you paid the fee as set forth in paragraph 1.E.8. - -1.B. "Project Gutenberg" is a registered trademark. It may only be -used on or associated in any way with an electronic work by people who -agree to be bound by the terms of this agreement. There are a few -things that you can do with most Project Gutenberg-tm electronic works -even without complying with the full terms of this agreement. See -paragraph 1.C below. There are a lot of things you can do with Project -Gutenberg-tm electronic works if you follow the terms of this agreement -and help preserve free future access to Project Gutenberg-tm electronic -works. See paragraph 1.E below. - -1.C. The Project Gutenberg Literary Archive Foundation ("the Foundation" -or PGLAF), owns a compilation copyright in the collection of Project -Gutenberg-tm electronic works. Nearly all the individual works in the -collection are in the public domain in the United States. If an -individual work is in the public domain in the United States and you are -located in the United States, we do not claim a right to prevent you from -copying, distributing, performing, displaying or creating derivative -works based on the work as long as all references to Project Gutenberg -are removed. Of course, we hope that you will support the Project -Gutenberg-tm mission of promoting free access to electronic works by -freely sharing Project Gutenberg-tm works in compliance with the terms of -this agreement for keeping the Project Gutenberg-tm name associated with -the work. You can easily comply with the terms of this agreement by -keeping this work in the same format with its attached full Project -Gutenberg-tm License when you share it without charge with others. - -1.D. The copyright laws of the place where you are located also govern -what you can do with this work. Copyright laws in most countries are in -a constant state of change. If you are outside the United States, check -the laws of your country in addition to the terms of this agreement -before downloading, copying, displaying, performing, distributing or -creating derivative works based on this work or any other Project -Gutenberg-tm work. The Foundation makes no representations concerning -the copyright status of any work in any country outside the United -States. - -1.E. Unless you have removed all references to Project Gutenberg: - -1.E.1. The following sentence, with active links to, or other immediate -access to, the full Project Gutenberg-tm License must appear prominently -whenever any copy of a Project Gutenberg-tm work (any work on which the -phrase "Project Gutenberg" appears, or with which the phrase "Project -Gutenberg" is associated) is accessed, displayed, performed, viewed, -copied or distributed: - -This eBook is for the use of anyone anywhere at no cost and with -almost no restrictions whatsoever. You may copy it, give it away or -re-use it under the terms of the Project Gutenberg License included -with this eBook or online at www.gutenberg.net - -1.E.2. If an individual Project Gutenberg-tm electronic work is derived -from the public domain (does not contain a notice indicating that it is -posted with permission of the copyright holder), the work can be copied -and distributed to anyone in the United States without paying any fees -or charges. If you are redistributing or providing access to a work -with the phrase "Project Gutenberg" associated with or appearing on the -work, you must comply either with the requirements of paragraphs 1.E.1 -through 1.E.7 or obtain permission for the use of the work and the -Project Gutenberg-tm trademark as set forth in paragraphs 1.E.8 or -1.E.9. - -1.E.3. If an individual Project Gutenberg-tm electronic work is posted -with the permission of the copyright holder, your use and distribution -must comply with both paragraphs 1.E.1 through 1.E.7 and any additional -terms imposed by the copyright holder. Additional terms will be linked -to the Project Gutenberg-tm License for all works posted with the -permission of the copyright holder found at the beginning of this work. - -1.E.4. Do not unlink or detach or remove the full Project Gutenberg-tm -License terms from this work, or any files containing a part of this -work or any other work associated with Project Gutenberg-tm. - -1.E.5. Do not copy, display, perform, distribute or redistribute this -electronic work, or any part of this electronic work, without -prominently displaying the sentence set forth in paragraph 1.E.1 with -active links or immediate access to the full terms of the Project -Gutenberg-tm License. - -1.E.6. You may convert to and distribute this work in any binary, -compressed, marked up, nonproprietary or proprietary form, including any -word processing or hypertext form. However, if you provide access to or -distribute copies of a Project Gutenberg-tm work in a format other than -"Plain Vanilla ASCII" or other format used in the official version -posted on the official Project Gutenberg-tm web site (www.gutenberg.net), -you must, at no additional cost, fee or expense to the user, provide a -copy, a means of exporting a copy, or a means of obtaining a copy upon -request, of the work in its original "Plain Vanilla ASCII" or other -form. Any alternate format must include the full Project Gutenberg-tm -License as specified in paragraph 1.E.1. - -1.E.7. Do not charge a fee for access to, viewing, displaying, -performing, copying or distributing any Project Gutenberg-tm works -unless you comply with paragraph 1.E.8 or 1.E.9. - -1.E.8. You may charge a reasonable fee for copies of or providing -access to or distributing Project Gutenberg-tm electronic works provided -that - -- You pay a royalty fee of 20% of the gross profits you derive from - the use of Project Gutenberg-tm works calculated using the method - you already use to calculate your applicable taxes. The fee is - owed to the owner of the Project Gutenberg-tm trademark, but he - has agreed to donate royalties under this paragraph to the - Project Gutenberg Literary Archive Foundation. Royalty payments - must be paid within 60 days following each date on which you - prepare (or are legally required to prepare) your periodic tax - returns. Royalty payments should be clearly marked as such and - sent to the Project Gutenberg Literary Archive Foundation at the - address specified in Section 4, "Information about donations to - the Project Gutenberg Literary Archive Foundation." - -- You provide a full refund of any money paid by a user who notifies - you in writing (or by e-mail) within 30 days of receipt that s/he - does not agree to the terms of the full Project Gutenberg-tm - License. You must require such a user to return or - destroy all copies of the works possessed in a physical medium - and discontinue all use of and all access to other copies of - Project Gutenberg-tm works. - -- You provide, in accordance with paragraph 1.F.3, a full refund of any - money paid for a work or a replacement copy, if a defect in the - electronic work is discovered and reported to you within 90 days - of receipt of the work. - -- You comply with all other terms of this agreement for free - distribution of Project Gutenberg-tm works. - -1.E.9. If you wish to charge a fee or distribute a Project Gutenberg-tm -electronic work or group of works on different terms than are set -forth in this agreement, you must obtain permission in writing from -both the Project Gutenberg Literary Archive Foundation and Michael -Hart, the owner of the Project Gutenberg-tm trademark. Contact the -Foundation as set forth in Section 3 below. - -1.F. - -1.F.1. Project Gutenberg volunteers and employees expend considerable -effort to identify, do copyright research on, transcribe and proofread -public domain works in creating the Project Gutenberg-tm -collection. Despite these efforts, Project Gutenberg-tm electronic -works, and the medium on which they may be stored, may contain -"Defects," such as, but not limited to, incomplete, inaccurate or -corrupt data, transcription errors, a copyright or other intellectual -property infringement, a defective or damaged disk or other medium, a -computer virus, or computer codes that damage or cannot be read by -your equipment. - -1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for the "Right -of Replacement or Refund" described in paragraph 1.F.3, the Project -Gutenberg Literary Archive Foundation, the owner of the Project -Gutenberg-tm trademark, and any other party distributing a Project -Gutenberg-tm electronic work under this agreement, disclaim all -liability to you for damages, costs and expenses, including legal -fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT -LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE -PROVIDED IN PARAGRAPH F3. YOU AGREE THAT THE FOUNDATION, THE -TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE -LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE OR -INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH -DAMAGE. - -1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you discover a -defect in this electronic work within 90 days of receiving it, you can -receive a refund of the money (if any) you paid for it by sending a -written explanation to the person you received the work from. If you -received the work on a physical medium, you must return the medium with -your written explanation. The person or entity that provided you with -the defective work may elect to provide a replacement copy in lieu of a -refund. If you received the work electronically, the person or entity -providing it to you may choose to give you a second opportunity to -receive the work electronically in lieu of a refund. If the second copy -is also defective, you may demand a refund in writing without further -opportunities to fix the problem. - -1.F.4. Except for the limited right of replacement or refund set forth -in paragraph 1.F.3, this work is provided to you 'AS-IS' WITH NO OTHER -WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO -WARRANTIES OF MERCHANTIBILITY OR FITNESS FOR ANY PURPOSE. - -1.F.5. Some states do not allow disclaimers of certain implied -warranties or the exclusion or limitation of certain types of damages. -If any disclaimer or limitation set forth in this agreement violates the -law of the state applicable to this agreement, the agreement shall be -interpreted to make the maximum disclaimer or limitation permitted by -the applicable state law. The invalidity or unenforceability of any -provision of this agreement shall not void the remaining provisions. - -1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation, the -trademark owner, any agent or employee of the Foundation, anyone -providing copies of Project Gutenberg-tm electronic works in accordance -with this agreement, and any volunteers associated with the production, -promotion and distribution of Project Gutenberg-tm electronic works, -harmless from all liability, costs and expenses, including legal fees, -that arise directly or indirectly from any of the following which you do -or cause to occur: (a) distribution of this or any Project Gutenberg-tm -work, (b) alteration, modification, or additions or deletions to any -Project Gutenberg-tm work, and (c) any Defect you cause. - - -Section 2. Information about the Mission of Project Gutenberg-tm - -Project Gutenberg-tm is synonymous with the free distribution of -electronic works in formats readable by the widest variety of computers -including obsolete, old, middle-aged and new computers. It exists -because of the efforts of hundreds of volunteers and donations from -people in all walks of life. - -Volunteers and financial support to provide volunteers with the -assistance they need, is critical to reaching Project Gutenberg-tm's -goals and ensuring that the Project Gutenberg-tm collection will -remain freely available for generations to come. In 2001, the Project -Gutenberg Literary Archive Foundation was created to provide a secure -and permanent future for Project Gutenberg-tm and future generations. -To learn more about the Project Gutenberg Literary Archive Foundation -and how your efforts and donations can help, see Sections 3 and 4 -and the Foundation web page at http://www.pglaf.org. - - -Section 3. Information about the Project Gutenberg Literary Archive -Foundation - -The Project Gutenberg Literary Archive Foundation is a non profit -501(c)(3) educational corporation organized under the laws of the -state of Mississippi and granted tax exempt status by the Internal -Revenue Service. The Foundation's EIN or federal tax identification -number is 64-6221541. Its 501(c)(3) letter is posted at -http://pglaf.org/fundraising. Contributions to the Project Gutenberg -Literary Archive Foundation are tax deductible to the full extent -permitted by U.S. federal laws and your state's laws. - -The Foundation's principal office is located at 4557 Melan Dr. S. -Fairbanks, AK, 99712., but its volunteers and employees are scattered -throughout numerous locations. Its business office is located at -809 North 1500 West, Salt Lake City, UT 84116, (801) 596-1887, email -business@pglaf.org. Email contact links and up to date contact -information can be found at the Foundation's web site and official -page at http://pglaf.org - -For additional contact information: - Dr. Gregory B. Newby - Chief Executive and Director - gbnewby@pglaf.org - - -Section 4. Information about Donations to the Project Gutenberg -Literary Archive Foundation - -Project Gutenberg-tm depends upon and cannot survive without wide -spread public support and donations to carry out its mission of -increasing the number of public domain and licensed works that can be -freely distributed in machine readable form accessible by the widest -array of equipment including outdated equipment. Many small donations -($1 to $5,000) are particularly important to maintaining tax exempt -status with the IRS. - -The Foundation is committed to complying with the laws regulating -charities and charitable donations in all 50 states of the United -States. Compliance requirements are not uniform and it takes a -considerable effort, much paperwork and many fees to meet and keep up -with these requirements. We do not solicit donations in locations -where we have not received written confirmation of compliance. To -SEND DONATIONS or determine the status of compliance for any -particular state visit http://pglaf.org - -While we cannot and do not solicit contributions from states where we -have not met the solicitation requirements, we know of no prohibition -against accepting unsolicited donations from donors in such states who -approach us with offers to donate. - -International donations are gratefully accepted, but we cannot make -any statements concerning tax treatment of donations received from -outside the United States. U.S. laws alone swamp our small staff. - -Please check the Project Gutenberg Web pages for current donation -methods and addresses. Donations are accepted in a number of other -ways including including checks, online payments and credit card -donations. To donate, please visit: http://pglaf.org/donate - - -Section 5. General Information About Project Gutenberg-tm electronic -works. - -Professor Michael S. Hart is the originator of the Project Gutenberg-tm -concept of a library of electronic works that could be freely shared -with anyone. For thirty years, he produced and distributed Project -Gutenberg-tm eBooks with only a loose network of volunteer support. - - -Project Gutenberg-tm eBooks are often created from several printed -editions, all of which are confirmed as Public Domain in the U.S. -unless a copyright notice is included. Thus, we do not necessarily -keep eBooks in compliance with any particular paper edition. - - -Most people start at our Web site which has the main PG search facility: - - http://www.gutenberg.net - -This Web site includes information about Project Gutenberg-tm, -including how to make donations to the Project Gutenberg Literary -Archive Foundation, how to help produce our new eBooks, and how to -subscribe to our email newsletter to hear about new eBooks. diff --git a/java/examples/Topics/Advanced Data/HashMapClass/data/frankenstein.txt b/java/examples/Topics/Advanced Data/HashMapClass/data/frankenstein.txt deleted file mode 100755 index ef9971b17..000000000 --- a/java/examples/Topics/Advanced Data/HashMapClass/data/frankenstein.txt +++ /dev/null @@ -1,7652 +0,0 @@ -Project Gutenberg's Frankenstein, by Mary Wollstonecraft (Godwin) Shelley - -This eBook is for the use of anyone anywhere at no cost and with -almost no restrictions whatsoever. You may copy it, give it away or -re-use it under the terms of the Project Gutenberg License included -with this eBook or online at www.gutenberg.net - - -Title: Frankenstein - or The Modern Prometheus - -Author: Mary Wollstonecraft (Godwin) Shelley - -Release Date: June 17, 2008 [EBook #84] - -Language: English - - -*** START OF THIS PROJECT GUTENBERG EBOOK FRANKENSTEIN *** - - - - -Produced by Judith Boss, Christy Phillips, Lynn Hanninen, -and David Meltzer. HTML version by Al Haines. - - - - - - - - - - -Frankenstein, - -or the Modern Prometheus - - -by - -Mary Wollstonecraft (Godwin) Shelley - - - - -Letter 1 - - -St. Petersburgh, Dec. 11th, 17-- - -TO Mrs. Saville, England - -You will rejoice to hear that no disaster has accompanied the -commencement of an enterprise which you have regarded with such evil -forebodings. I arrived here yesterday, and my first task is to assure -my dear sister of my welfare and increasing confidence in the success -of my undertaking. - -I am already far north of London, and as I walk in the streets of -Petersburgh, I feel a cold northern breeze play upon my cheeks, which -braces my nerves and fills me with delight. Do you understand this -feeling? This breeze, which has travelled from the regions towards -which I am advancing, gives me a foretaste of those icy climes. -Inspirited by this wind of promise, my daydreams become more fervent -and vivid. I try in vain to be persuaded that the pole is the seat of -frost and desolation; it ever presents itself to my imagination as the -region of beauty and delight. There, Margaret, the sun is forever -visible, its broad disk just skirting the horizon and diffusing a -perpetual splendour. There--for with your leave, my sister, I will put -some trust in preceding navigators--there snow and frost are banished; -and, sailing over a calm sea, we may be wafted to a land surpassing in -wonders and in beauty every region hitherto discovered on the habitable -globe. Its productions and features may be without example, as the -phenomena of the heavenly bodies undoubtedly are in those undiscovered -solitudes. What may not be expected in a country of eternal light? I -may there discover the wondrous power which attracts the needle and may -regulate a thousand celestial observations that require only this -voyage to render their seeming eccentricities consistent forever. I -shall satiate my ardent curiosity with the sight of a part of the world -never before visited, and may tread a land never before imprinted by -the foot of man. These are my enticements, and they are sufficient to -conquer all fear of danger or death and to induce me to commence this -laborious voyage with the joy a child feels when he embarks in a little -boat, with his holiday mates, on an expedition of discovery up his -native river. But supposing all these conjectures to be false, you -cannot contest the inestimable benefit which I shall confer on all -mankind, to the last generation, by discovering a passage near the pole -to those countries, to reach which at present so many months are -requisite; or by ascertaining the secret of the magnet, which, if at -all possible, can only be effected by an undertaking such as mine. - -These reflections have dispelled the agitation with which I began my -letter, and I feel my heart glow with an enthusiasm which elevates me -to heaven, for nothing contributes so much to tranquillize the mind as -a steady purpose--a point on which the soul may fix its intellectual -eye. This expedition has been the favourite dream of my early years. I -have read with ardour the accounts of the various voyages which have -been made in the prospect of arriving at the North Pacific Ocean -through the seas which surround the pole. You may remember that a -history of all the voyages made for purposes of discovery composed the -whole of our good Uncle Thomas' library. My education was neglected, -yet I was passionately fond of reading. These volumes were my study -day and night, and my familiarity with them increased that regret which -I had felt, as a child, on learning that my father's dying injunction -had forbidden my uncle to allow me to embark in a seafaring life. - -These visions faded when I perused, for the first time, those poets -whose effusions entranced my soul and lifted it to heaven. I also -became a poet and for one year lived in a paradise of my own creation; -I imagined that I also might obtain a niche in the temple where the -names of Homer and Shakespeare are consecrated. You are well -acquainted with my failure and how heavily I bore the disappointment. -But just at that time I inherited the fortune of my cousin, and my -thoughts were turned into the channel of their earlier bent. - -Six years have passed since I resolved on my present undertaking. I -can, even now, remember the hour from which I dedicated myself to this -great enterprise. I commenced by inuring my body to hardship. I -accompanied the whale-fishers on several expeditions to the North Sea; -I voluntarily endured cold, famine, thirst, and want of sleep; I often -worked harder than the common sailors during the day and devoted my -nights to the study of mathematics, the theory of medicine, and those -branches of physical science from which a naval adventurer might derive -the greatest practical advantage. Twice I actually hired myself as an -under-mate in a Greenland whaler, and acquitted myself to admiration. I -must own I felt a little proud when my captain offered me the second -dignity in the vessel and entreated me to remain with the greatest -earnestness, so valuable did he consider my services. And now, dear -Margaret, do I not deserve to accomplish some great purpose? My life -might have been passed in ease and luxury, but I preferred glory to -every enticement that wealth placed in my path. Oh, that some -encouraging voice would answer in the affirmative! My courage and my -resolution is firm; but my hopes fluctuate, and my spirits are often -depressed. I am about to proceed on a long and difficult voyage, the -emergencies of which will demand all my fortitude: I am required not -only to raise the spirits of others, but sometimes to sustain my own, -when theirs are failing. - -This is the most favourable period for travelling in Russia. They fly -quickly over the snow in their sledges; the motion is pleasant, and, in -my opinion, far more agreeable than that of an English stagecoach. The -cold is not excessive, if you are wrapped in furs--a dress which I have -already adopted, for there is a great difference between walking the -deck and remaining seated motionless for hours, when no exercise -prevents the blood from actually freezing in your veins. I have no -ambition to lose my life on the post-road between St. Petersburgh and -Archangel. I shall depart for the latter town in a fortnight or three -weeks; and my intention is to hire a ship there, which can easily be -done by paying the insurance for the owner, and to engage as many -sailors as I think necessary among those who are accustomed to the -whale-fishing. I do not intend to sail until the month of June; and -when shall I return? Ah, dear sister, how can I answer this question? -If I succeed, many, many months, perhaps years, will pass before you -and I may meet. If I fail, you will see me again soon, or never. -Farewell, my dear, excellent Margaret. Heaven shower down blessings on -you, and save me, that I may again and again testify my gratitude for -all your love and kindness. - -Your affectionate brother, - R. Walton - - - -Letter 2 - - -Archangel, 28th March, 17-- - -To Mrs. Saville, England - -How slowly the time passes here, encompassed as I am by frost and snow! -Yet a second step is taken towards my enterprise. I have hired a -vessel and am occupied in collecting my sailors; those whom I have -already engaged appear to be men on whom I can depend and are certainly -possessed of dauntless courage. - -But I have one want which I have never yet been able to satisfy, and -the absence of the object of which I now feel as a most severe evil, I -have no friend, Margaret: when I am glowing with the enthusiasm of -success, there will be none to participate my joy; if I am assailed by -disappointment, no one will endeavour to sustain me in dejection. I -shall commit my thoughts to paper, it is true; but that is a poor -medium for the communication of feeling. I desire the company of a man -who could sympathize with me, whose eyes would reply to mine. You may -deem me romantic, my dear sister, but I bitterly feel the want of a -friend. I have no one near me, gentle yet courageous, possessed of a -cultivated as well as of a capacious mind, whose tastes are like my -own, to approve or amend my plans. How would such a friend repair the -faults of your poor brother! I am too ardent in execution and too -impatient of difficulties. But it is a still greater evil to me that I -am self-educated: for the first fourteen years of my life I ran wild -on a common and read nothing but our Uncle Thomas' books of voyages. At -that age I became acquainted with the celebrated poets of our own -country; but it was only when it had ceased to be in my power to derive -its most important benefits from such a conviction that I perceived the -necessity of becoming acquainted with more languages than that of my -native country. Now I am twenty-eight and am in reality more -illiterate than many schoolboys of fifteen. It is true that I have -thought more and that my daydreams are more extended and magnificent, -but they want (as the painters call it) KEEPING; and I greatly need a -friend who would have sense enough not to despise me as romantic, and -affection enough for me to endeavour to regulate my mind. Well, these -are useless complaints; I shall certainly find no friend on the wide -ocean, nor even here in Archangel, among merchants and seamen. Yet -some feelings, unallied to the dross of human nature, beat even in -these rugged bosoms. My lieutenant, for instance, is a man of -wonderful courage and enterprise; he is madly desirous of glory, or -rather, to word my phrase more characteristically, of advancement in -his profession. He is an Englishman, and in the midst of national and -professional prejudices, unsoftened by cultivation, retains some of the -noblest endowments of humanity. I first became acquainted with him on -board a whale vessel; finding that he was unemployed in this city, I -easily engaged him to assist in my enterprise. The master is a person -of an excellent disposition and is remarkable in the ship for his -gentleness and the mildness of his discipline. This circumstance, -added to his well-known integrity and dauntless courage, made me very -desirous to engage him. A youth passed in solitude, my best years -spent under your gentle and feminine fosterage, has so refined the -groundwork of my character that I cannot overcome an intense distaste -to the usual brutality exercised on board ship: I have never believed -it to be necessary, and when I heard of a mariner equally noted for his -kindliness of heart and the respect and obedience paid to him by his -crew, I felt myself peculiarly fortunate in being able to secure his -services. I heard of him first in rather a romantic manner, from a -lady who owes to him the happiness of her life. This, briefly, is his -story. Some years ago he loved a young Russian lady of moderate -fortune, and having amassed a considerable sum in prize-money, the -father of the girl consented to the match. He saw his mistress once -before the destined ceremony; but she was bathed in tears, and throwing -herself at his feet, entreated him to spare her, confessing at the same -time that she loved another, but that he was poor, and that her father -would never consent to the union. My generous friend reassured the -suppliant, and on being informed of the name of her lover, instantly -abandoned his pursuit. He had already bought a farm with his money, on -which he had designed to pass the remainder of his life; but he -bestowed the whole on his rival, together with the remains of his -prize-money to purchase stock, and then himself solicited the young -woman's father to consent to her marriage with her lover. But the old -man decidedly refused, thinking himself bound in honour to my friend, -who, when he found the father inexorable, quitted his country, nor -returned until he heard that his former mistress was married according -to her inclinations. "What a noble fellow!" you will exclaim. He is -so; but then he is wholly uneducated: he is as silent as a Turk, and a -kind of ignorant carelessness attends him, which, while it renders his -conduct the more astonishing, detracts from the interest and sympathy -which otherwise he would command. - -Yet do not suppose, because I complain a little or because I can -conceive a consolation for my toils which I may never know, that I am -wavering in my resolutions. Those are as fixed as fate, and my voyage -is only now delayed until the weather shall permit my embarkation. The -winter has been dreadfully severe, but the spring promises well, and it -is considered as a remarkably early season, so that perhaps I may sail -sooner than I expected. I shall do nothing rashly: you know me -sufficiently to confide in my prudence and considerateness whenever the -safety of others is committed to my care. - -I cannot describe to you my sensations on the near prospect of my -undertaking. It is impossible to communicate to you a conception of -the trembling sensation, half pleasurable and half fearful, with which -I am preparing to depart. I am going to unexplored regions, to "the -land of mist and snow," but I shall kill no albatross; therefore do not -be alarmed for my safety or if I should come back to you as worn and -woeful as the "Ancient Mariner." You will smile at my allusion, but I -will disclose a secret. I have often attributed my attachment to, my -passionate enthusiasm for, the dangerous mysteries of ocean to that -production of the most imaginative of modern poets. There is something -at work in my soul which I do not understand. I am practically -industrious--painstaking, a workman to execute with perseverance and -labour--but besides this there is a love for the marvellous, a belief -in the marvellous, intertwined in all my projects, which hurries me out -of the common pathways of men, even to the wild sea and unvisited -regions I am about to explore. But to return to dearer considerations. -Shall I meet you again, after having traversed immense seas, and -returned by the most southern cape of Africa or America? I dare not -expect such success, yet I cannot bear to look on the reverse of the -picture. Continue for the present to write to me by every opportunity: -I may receive your letters on some occasions when I need them most to -support my spirits. I love you very tenderly. Remember me with -affection, should you never hear from me again. - -Your affectionate brother, - Robert Walton - - - -Letter 3 - - - -July 7th, 17-- - -To Mrs. Saville, England - -My dear Sister, - -I write a few lines in haste to say that I am safe--and well advanced -on my voyage. This letter will reach England by a merchantman now on -its homeward voyage from Archangel; more fortunate than I, who may not -see my native land, perhaps, for many years. I am, however, in good -spirits: my men are bold and apparently firm of purpose, nor do the -floating sheets of ice that continually pass us, indicating the dangers -of the region towards which we are advancing, appear to dismay them. We -have already reached a very high latitude; but it is the height of -summer, and although not so warm as in England, the southern gales, -which blow us speedily towards those shores which I so ardently desire -to attain, breathe a degree of renovating warmth which I had not -expected. - -No incidents have hitherto befallen us that would make a figure in a -letter. One or two stiff gales and the springing of a leak are -accidents which experienced navigators scarcely remember to record, and -I shall be well content if nothing worse happen to us during our voyage. - -Adieu, my dear Margaret. Be assured that for my own sake, as well as -yours, I will not rashly encounter danger. I will be cool, -persevering, and prudent. - -But success SHALL crown my endeavours. Wherefore not? Thus far I have -gone, tracing a secure way over the pathless seas, the very stars -themselves being witnesses and testimonies of my triumph. Why not -still proceed over the untamed yet obedient element? What can stop the -determined heart and resolved will of man? - -My swelling heart involuntarily pours itself out thus. But I must -finish. Heaven bless my beloved sister! - -R.W. - - - -Letter 4 - - - -August 5th, 17-- - -To Mrs. Saville, England - -So strange an accident has happened to us that I cannot forbear -recording it, although it is very probable that you will see me before -these papers can come into your possession. - -Last Monday (July 31st) we were nearly surrounded by ice, which closed -in the ship on all sides, scarcely leaving her the sea-room in which -she floated. Our situation was somewhat dangerous, especially as we -were compassed round by a very thick fog. We accordingly lay to, -hoping that some change would take place in the atmosphere and weather. - -About two o'clock the mist cleared away, and we beheld, stretched out -in every direction, vast and irregular plains of ice, which seemed to -have no end. Some of my comrades groaned, and my own mind began to -grow watchful with anxious thoughts, when a strange sight suddenly -attracted our attention and diverted our solicitude from our own -situation. We perceived a low carriage, fixed on a sledge and drawn by -dogs, pass on towards the north, at the distance of half a mile; a -being which had the shape of a man, but apparently of gigantic stature, -sat in the sledge and guided the dogs. We watched the rapid progress -of the traveller with our telescopes until he was lost among the -distant inequalities of the ice. This appearance excited our -unqualified wonder. We were, as we believed, many hundred miles from -any land; but this apparition seemed to denote that it was not, in -reality, so distant as we had supposed. Shut in, however, by ice, it -was impossible to follow his track, which we had observed with the -greatest attention. About two hours after this occurrence we heard the -ground sea, and before night the ice broke and freed our ship. We, -however, lay to until the morning, fearing to encounter in the dark -those large loose masses which float about after the breaking up of the -ice. I profited of this time to rest for a few hours. - -In the morning, however, as soon as it was light, I went upon deck and -found all the sailors busy on one side of the vessel, apparently -talking to someone in the sea. It was, in fact, a sledge, like that we -had seen before, which had drifted towards us in the night on a large -fragment of ice. Only one dog remained alive; but there was a human -being within it whom the sailors were persuading to enter the vessel. -He was not, as the other traveller seemed to be, a savage inhabitant of -some undiscovered island, but a European. When I appeared on deck the -master said, "Here is our captain, and he will not allow you to perish -on the open sea." - -On perceiving me, the stranger addressed me in English, although with a -foreign accent. "Before I come on board your vessel," said he, "will -you have the kindness to inform me whither you are bound?" - -You may conceive my astonishment on hearing such a question addressed -to me from a man on the brink of destruction and to whom I should have -supposed that my vessel would have been a resource which he would not -have exchanged for the most precious wealth the earth can afford. I -replied, however, that we were on a voyage of discovery towards the -northern pole. - -Upon hearing this he appeared satisfied and consented to come on board. -Good God! Margaret, if you had seen the man who thus capitulated for -his safety, your surprise would have been boundless. His limbs were -nearly frozen, and his body dreadfully emaciated by fatigue and -suffering. I never saw a man in so wretched a condition. We attempted -to carry him into the cabin, but as soon as he had quitted the fresh -air he fainted. We accordingly brought him back to the deck and -restored him to animation by rubbing him with brandy and forcing him to -swallow a small quantity. As soon as he showed signs of life we -wrapped him up in blankets and placed him near the chimney of the -kitchen stove. By slow degrees he recovered and ate a little soup, -which restored him wonderfully. - -Two days passed in this manner before he was able to speak, and I often -feared that his sufferings had deprived him of understanding. When he -had in some measure recovered, I removed him to my own cabin and -attended on him as much as my duty would permit. I never saw a more -interesting creature: his eyes have generally an expression of -wildness, and even madness, but there are moments when, if anyone -performs an act of kindness towards him or does him any the most -trifling service, his whole countenance is lighted up, as it were, with -a beam of benevolence and sweetness that I never saw equalled. But he -is generally melancholy and despairing, and sometimes he gnashes his -teeth, as if impatient of the weight of woes that oppresses him. - -When my guest was a little recovered I had great trouble to keep off -the men, who wished to ask him a thousand questions; but I would not -allow him to be tormented by their idle curiosity, in a state of body -and mind whose restoration evidently depended upon entire repose. -Once, however, the lieutenant asked why he had come so far upon the ice -in so strange a vehicle. - -His countenance instantly assumed an aspect of the deepest gloom, and -he replied, "To seek one who fled from me." - -"And did the man whom you pursued travel in the same fashion?" - -"Yes." - -"Then I fancy we have seen him, for the day before we picked you up we -saw some dogs drawing a sledge, with a man in it, across the ice." - -This aroused the stranger's attention, and he asked a multitude of -questions concerning the route which the demon, as he called him, had -pursued. Soon after, when he was alone with me, he said, "I have, -doubtless, excited your curiosity, as well as that of these good -people; but you are too considerate to make inquiries." - -"Certainly; it would indeed be very impertinent and inhuman in me to -trouble you with any inquisitiveness of mine." - -"And yet you rescued me from a strange and perilous situation; you have -benevolently restored me to life." - -Soon after this he inquired if I thought that the breaking up of the -ice had destroyed the other sledge. I replied that I could not answer -with any degree of certainty, for the ice had not broken until near -midnight, and the traveller might have arrived at a place of safety -before that time; but of this I could not judge. From this time a new -spirit of life animated the decaying frame of the stranger. He -manifested the greatest eagerness to be upon deck to watch for the -sledge which had before appeared; but I have persuaded him to remain in -the cabin, for he is far too weak to sustain the rawness of the -atmosphere. I have promised that someone should watch for him and give -him instant notice if any new object should appear in sight. - -Such is my journal of what relates to this strange occurrence up to the -present day. The stranger has gradually improved in health but is very -silent and appears uneasy when anyone except myself enters his cabin. -Yet his manners are so conciliating and gentle that the sailors are all -interested in him, although they have had very little communication -with him. For my own part, I begin to love him as a brother, and his -constant and deep grief fills me with sympathy and compassion. He must -have been a noble creature in his better days, being even now in wreck -so attractive and amiable. I said in one of my letters, my dear -Margaret, that I should find no friend on the wide ocean; yet I have -found a man who, before his spirit had been broken by misery, I should -have been happy to have possessed as the brother of my heart. - -I shall continue my journal concerning the stranger at intervals, -should I have any fresh incidents to record. - - -August 13th, 17-- - -My affection for my guest increases every day. He excites at once my -admiration and my pity to an astonishing degree. How can I see so -noble a creature destroyed by misery without feeling the most poignant -grief? He is so gentle, yet so wise; his mind is so cultivated, and -when he speaks, although his words are culled with the choicest art, -yet they flow with rapidity and unparalleled eloquence. He is now much -recovered from his illness and is continually on the deck, apparently -watching for the sledge that preceded his own. Yet, although unhappy, -he is not so utterly occupied by his own misery but that he interests -himself deeply in the projects of others. He has frequently conversed -with me on mine, which I have communicated to him without disguise. He -entered attentively into all my arguments in favour of my eventual -success and into every minute detail of the measures I had taken to -secure it. I was easily led by the sympathy which he evinced to use -the language of my heart, to give utterance to the burning ardour of my -soul and to say, with all the fervour that warmed me, how gladly I -would sacrifice my fortune, my existence, my every hope, to the -furtherance of my enterprise. One man's life or death were but a small -price to pay for the acquirement of the knowledge which I sought, for -the dominion I should acquire and transmit over the elemental foes of -our race. As I spoke, a dark gloom spread over my listener's -countenance. At first I perceived that he tried to suppress his -emotion; he placed his hands before his eyes, and my voice quivered and -failed me as I beheld tears trickle fast from between his fingers; a -groan burst from his heaving breast. I paused; at length he spoke, in -broken accents: "Unhappy man! Do you share my madness? Have you -drunk also of the intoxicating draught? Hear me; let me reveal my -tale, and you will dash the cup from your lips!" - -Such words, you may imagine, strongly excited my curiosity; but the -paroxysm of grief that had seized the stranger overcame his weakened -powers, and many hours of repose and tranquil conversation were -necessary to restore his composure. Having conquered the violence of -his feelings, he appeared to despise himself for being the slave of -passion; and quelling the dark tyranny of despair, he led me again to -converse concerning myself personally. He asked me the history of my -earlier years. The tale was quickly told, but it awakened various -trains of reflection. I spoke of my desire of finding a friend, of my -thirst for a more intimate sympathy with a fellow mind than had ever -fallen to my lot, and expressed my conviction that a man could boast of -little happiness who did not enjoy this blessing. "I agree with you," -replied the stranger; "we are unfashioned creatures, but half made up, -if one wiser, better, dearer than ourselves--such a friend ought to -be--do not lend his aid to perfectionate our weak and faulty natures. I -once had a friend, the most noble of human creatures, and am entitled, -therefore, to judge respecting friendship. You have hope, and the -world before you, and have no cause for despair. But I--I have lost -everything and cannot begin life anew." - -As he said this his countenance became expressive of a calm, settled -grief that touched me to the heart. But he was silent and presently -retired to his cabin. - -Even broken in spirit as he is, no one can feel more deeply than he -does the beauties of nature. The starry sky, the sea, and every sight -afforded by these wonderful regions seem still to have the power of -elevating his soul from earth. Such a man has a double existence: he -may suffer misery and be overwhelmed by disappointments, yet when he -has retired into himself, he will be like a celestial spirit that has a -halo around him, within whose circle no grief or folly ventures. - -Will you smile at the enthusiasm I express concerning this divine -wanderer? You would not if you saw him. You have been tutored and -refined by books and retirement from the world, and you are therefore -somewhat fastidious; but this only renders you the more fit to -appreciate the extraordinary merits of this wonderful man. Sometimes I -have endeavoured to discover what quality it is which he possesses that -elevates him so immeasurably above any other person I ever knew. I -believe it to be an intuitive discernment, a quick but never-failing -power of judgment, a penetration into the causes of things, unequalled -for clearness and precision; add to this a facility of expression and a -voice whose varied intonations are soul-subduing music. - - -August 19, 17-- - -Yesterday the stranger said to me, "You may easily perceive, Captain -Walton, that I have suffered great and unparalleled misfortunes. I had -determined at one time that the memory of these evils should die with -me, but you have won me to alter my determination. You seek for -knowledge and wisdom, as I once did; and I ardently hope that the -gratification of your wishes may not be a serpent to sting you, as mine -has been. I do not know that the relation of my disasters will be -useful to you; yet, when I reflect that you are pursuing the same -course, exposing yourself to the same dangers which have rendered me -what I am, I imagine that you may deduce an apt moral from my tale, one -that may direct you if you succeed in your undertaking and console you -in case of failure. Prepare to hear of occurrences which are usually -deemed marvellous. Were we among the tamer scenes of nature I might -fear to encounter your unbelief, perhaps your ridicule; but many things -will appear possible in these wild and mysterious regions which would -provoke the laughter of those unacquainted with the ever-varied powers -of nature; nor can I doubt but that my tale conveys in its series -internal evidence of the truth of the events of which it is composed." - -You may easily imagine that I was much gratified by the offered -communication, yet I could not endure that he should renew his grief by -a recital of his misfortunes. I felt the greatest eagerness to hear -the promised narrative, partly from curiosity and partly from a strong -desire to ameliorate his fate if it were in my power. I expressed -these feelings in my answer. - -"I thank you," he replied, "for your sympathy, but it is useless; my -fate is nearly fulfilled. I wait but for one event, and then I shall -repose in peace. I understand your feeling," continued he, perceiving -that I wished to interrupt him; "but you are mistaken, my friend, if -thus you will allow me to name you; nothing can alter my destiny; -listen to my history, and you will perceive how irrevocably it is -determined." - -He then told me that he would commence his narrative the next day when -I should be at leisure. This promise drew from me the warmest thanks. -I have resolved every night, when I am not imperatively occupied by my -duties, to record, as nearly as possible in his own words, what he has -related during the day. If I should be engaged, I will at least make -notes. This manuscript will doubtless afford you the greatest -pleasure; but to me, who know him, and who hear it from his own -lips--with what interest and sympathy shall I read it in some future -day! Even now, as I commence my task, his full-toned voice swells in -my ears; his lustrous eyes dwell on me with all their melancholy -sweetness; I see his thin hand raised in animation, while the -lineaments of his face are irradiated by the soul within. - -Strange and harrowing must be his story, frightful the storm which -embraced the gallant vessel on its course and wrecked it--thus! - - - -Chapter 1 - -I am by birth a Genevese, and my family is one of the most -distinguished of that republic. My ancestors had been for many years -counsellors and syndics, and my father had filled several public -situations with honour and reputation. He was respected by all who -knew him for his integrity and indefatigable attention to public -business. He passed his younger days perpetually occupied by the -affairs of his country; a variety of circumstances had prevented his -marrying early, nor was it until the decline of life that he became a -husband and the father of a family. - -As the circumstances of his marriage illustrate his character, I cannot -refrain from relating them. One of his most intimate friends was a -merchant who, from a flourishing state, fell, through numerous -mischances, into poverty. This man, whose name was Beaufort, was of a -proud and unbending disposition and could not bear to live in poverty -and oblivion in the same country where he had formerly been -distinguished for his rank and magnificence. Having paid his debts, -therefore, in the most honourable manner, he retreated with his -daughter to the town of Lucerne, where he lived unknown and in -wretchedness. My father loved Beaufort with the truest friendship and -was deeply grieved by his retreat in these unfortunate circumstances. -He bitterly deplored the false pride which led his friend to a conduct -so little worthy of the affection that united them. He lost no time in -endeavouring to seek him out, with the hope of persuading him to begin -the world again through his credit and assistance. Beaufort had taken -effectual measures to conceal himself, and it was ten months before my -father discovered his abode. Overjoyed at this discovery, he hastened -to the house, which was situated in a mean street near the Reuss. But -when he entered, misery and despair alone welcomed him. Beaufort had -saved but a very small sum of money from the wreck of his fortunes, but -it was sufficient to provide him with sustenance for some months, and -in the meantime he hoped to procure some respectable employment in a -merchant's house. The interval was, consequently, spent in inaction; -his grief only became more deep and rankling when he had leisure for -reflection, and at length it took so fast hold of his mind that at the -end of three months he lay on a bed of sickness, incapable of any -exertion. - -His daughter attended him with the greatest tenderness, but she saw -with despair that their little fund was rapidly decreasing and that -there was no other prospect of support. But Caroline Beaufort -possessed a mind of an uncommon mould, and her courage rose to support -her in her adversity. She procured plain work; she plaited straw and -by various means contrived to earn a pittance scarcely sufficient to -support life. - -Several months passed in this manner. Her father grew worse; her time -was more entirely occupied in attending him; her means of subsistence -decreased; and in the tenth month her father died in her arms, leaving -her an orphan and a beggar. This last blow overcame her, and she knelt -by Beaufort's coffin weeping bitterly, when my father entered the -chamber. He came like a protecting spirit to the poor girl, who -committed herself to his care; and after the interment of his friend he -conducted her to Geneva and placed her under the protection of a -relation. Two years after this event Caroline became his wife. - -There was a considerable difference between the ages of my parents, but -this circumstance seemed to unite them only closer in bonds of devoted -affection. There was a sense of justice in my father's upright mind -which rendered it necessary that he should approve highly to love -strongly. Perhaps during former years he had suffered from the -late-discovered unworthiness of one beloved and so was disposed to set -a greater value on tried worth. There was a show of gratitude and -worship in his attachment to my mother, differing wholly from the -doting fondness of age, for it was inspired by reverence for her -virtues and a desire to be the means of, in some degree, recompensing -her for the sorrows she had endured, but which gave inexpressible grace -to his behaviour to her. Everything was made to yield to her wishes -and her convenience. He strove to shelter her, as a fair exotic is -sheltered by the gardener, from every rougher wind and to surround her -with all that could tend to excite pleasurable emotion in her soft and -benevolent mind. Her health, and even the tranquillity of her hitherto -constant spirit, had been shaken by what she had gone through. During -the two years that had elapsed previous to their marriage my father had -gradually relinquished all his public functions; and immediately after -their union they sought the pleasant climate of Italy, and the change -of scene and interest attendant on a tour through that land of wonders, -as a restorative for her weakened frame. - -From Italy they visited Germany and France. I, their eldest child, was -born at Naples, and as an infant accompanied them in their rambles. I -remained for several years their only child. Much as they were -attached to each other, they seemed to draw inexhaustible stores of -affection from a very mine of love to bestow them upon me. My mother's -tender caresses and my father's smile of benevolent pleasure while -regarding me are my first recollections. I was their plaything and -their idol, and something better--their child, the innocent and -helpless creature bestowed on them by heaven, whom to bring up to good, -and whose future lot it was in their hands to direct to happiness or -misery, according as they fulfilled their duties towards me. With this -deep consciousness of what they owed towards the being to which they -had given life, added to the active spirit of tenderness that animated -both, it may be imagined that while during every hour of my infant life -I received a lesson of patience, of charity, and of self-control, I was -so guided by a silken cord that all seemed but one train of enjoyment -to me. For a long time I was their only care. My mother had much -desired to have a daughter, but I continued their single offspring. -When I was about five years old, while making an excursion beyond the -frontiers of Italy, they passed a week on the shores of the Lake of -Como. Their benevolent disposition often made them enter the cottages -of the poor. This, to my mother, was more than a duty; it was a -necessity, a passion--remembering what she had suffered, and how she -had been relieved--for her to act in her turn the guardian angel to the -afflicted. During one of their walks a poor cot in the foldings of a -vale attracted their notice as being singularly disconsolate, while the -number of half-clothed children gathered about it spoke of penury in -its worst shape. One day, when my father had gone by himself to Milan, -my mother, accompanied by me, visited this abode. She found a peasant -and his wife, hard working, bent down by care and labour, distributing -a scanty meal to five hungry babes. Among these there was one which -attracted my mother far above all the rest. She appeared of a -different stock. The four others were dark-eyed, hardy little -vagrants; this child was thin and very fair. Her hair was the -brightest living gold, and despite the poverty of her clothing, seemed -to set a crown of distinction on her head. Her brow was clear and -ample, her blue eyes cloudless, and her lips and the moulding of her -face so expressive of sensibility and sweetness that none could behold -her without looking on her as of a distinct species, a being -heaven-sent, and bearing a celestial stamp in all her features. The -peasant woman, perceiving that my mother fixed eyes of wonder and -admiration on this lovely girl, eagerly communicated her history. She -was not her child, but the daughter of a Milanese nobleman. Her mother -was a German and had died on giving her birth. The infant had been -placed with these good people to nurse: they were better off then. -They had not been long married, and their eldest child was but just -born. The father of their charge was one of those Italians nursed in -the memory of the antique glory of Italy--one among the schiavi ognor -frementi, who exerted himself to obtain the liberty of his country. He -became the victim of its weakness. Whether he had died or still -lingered in the dungeons of Austria was not known. His property was -confiscated; his child became an orphan and a beggar. She continued -with her foster parents and bloomed in their rude abode, fairer than a -garden rose among dark-leaved brambles. When my father returned from -Milan, he found playing with me in the hall of our villa a child fairer -than pictured cherub--a creature who seemed to shed radiance from her -looks and whose form and motions were lighter than the chamois of the -hills. The apparition was soon explained. With his permission my -mother prevailed on her rustic guardians to yield their charge to her. -They were fond of the sweet orphan. Her presence had seemed a blessing -to them, but it would be unfair to her to keep her in poverty and want -when Providence afforded her such powerful protection. They consulted -their village priest, and the result was that Elizabeth Lavenza became -the inmate of my parents' house--my more than sister--the beautiful and -adored companion of all my occupations and my pleasures. - -Everyone loved Elizabeth. The passionate and almost reverential -attachment with which all regarded her became, while I shared it, my -pride and my delight. On the evening previous to her being brought to -my home, my mother had said playfully, "I have a pretty present for my -Victor--tomorrow he shall have it." And when, on the morrow, she -presented Elizabeth to me as her promised gift, I, with childish -seriousness, interpreted her words literally and looked upon Elizabeth -as mine--mine to protect, love, and cherish. All praises bestowed on -her I received as made to a possession of my own. We called each other -familiarly by the name of cousin. No word, no expression could body -forth the kind of relation in which she stood to me--my more than -sister, since till death she was to be mine only. - - - -Chapter 2 - -We were brought up together; there was not quite a year difference in -our ages. I need not say that we were strangers to any species of -disunion or dispute. Harmony was the soul of our companionship, and -the diversity and contrast that subsisted in our characters drew us -nearer together. Elizabeth was of a calmer and more concentrated -disposition; but, with all my ardour, I was capable of a more intense -application and was more deeply smitten with the thirst for knowledge. -She busied herself with following the aerial creations of the poets; -and in the majestic and wondrous scenes which surrounded our Swiss home ---the sublime shapes of the mountains, the changes of the seasons, -tempest and calm, the silence of winter, and the life and turbulence of -our Alpine summers--she found ample scope for admiration and delight. -While my companion contemplated with a serious and satisfied spirit the -magnificent appearances of things, I delighted in investigating their -causes. The world was to me a secret which I desired to divine. -Curiosity, earnest research to learn the hidden laws of nature, -gladness akin to rapture, as they were unfolded to me, are among the -earliest sensations I can remember. - -On the birth of a second son, my junior by seven years, my parents gave -up entirely their wandering life and fixed themselves in their native -country. We possessed a house in Geneva, and a campagne on Belrive, -the eastern shore of the lake, at the distance of rather more than a -league from the city. We resided principally in the latter, and the -lives of my parents were passed in considerable seclusion. It was my -temper to avoid a crowd and to attach myself fervently to a few. I was -indifferent, therefore, to my school-fellows in general; but I united -myself in the bonds of the closest friendship to one among them. Henry -Clerval was the son of a merchant of Geneva. He was a boy of singular -talent and fancy. He loved enterprise, hardship, and even danger for -its own sake. He was deeply read in books of chivalry and romance. He -composed heroic songs and began to write many a tale of enchantment and -knightly adventure. He tried to make us act plays and to enter into -masquerades, in which the characters were drawn from the heroes of -Roncesvalles, of the Round Table of King Arthur, and the chivalrous -train who shed their blood to redeem the holy sepulchre from the hands -of the infidels. - -No human being could have passed a happier childhood than myself. My -parents were possessed by the very spirit of kindness and indulgence. -We felt that they were not the tyrants to rule our lot according to -their caprice, but the agents and creators of all the many delights -which we enjoyed. When I mingled with other families I distinctly -discerned how peculiarly fortunate my lot was, and gratitude assisted -the development of filial love. - -My temper was sometimes violent, and my passions vehement; but by some -law in my temperature they were turned not towards childish pursuits -but to an eager desire to learn, and not to learn all things -indiscriminately. I confess that neither the structure of languages, -nor the code of governments, nor the politics of various states -possessed attractions for me. It was the secrets of heaven and earth -that I desired to learn; and whether it was the outward substance of -things or the inner spirit of nature and the mysterious soul of man -that occupied me, still my inquiries were directed to the metaphysical, -or in its highest sense, the physical secrets of the world. - -Meanwhile Clerval occupied himself, so to speak, with the moral -relations of things. The busy stage of life, the virtues of heroes, -and the actions of men were his theme; and his hope and his dream was -to become one among those whose names are recorded in story as the -gallant and adventurous benefactors of our species. The saintly soul -of Elizabeth shone like a shrine-dedicated lamp in our peaceful home. -Her sympathy was ours; her smile, her soft voice, the sweet glance of -her celestial eyes, were ever there to bless and animate us. She was -the living spirit of love to soften and attract; I might have become -sullen in my study, rought through the ardour of my nature, but that -she was there to subdue me to a semblance of her own gentleness. And -Clerval--could aught ill entrench on the noble spirit of Clerval? Yet -he might not have been so perfectly humane, so thoughtful in his -generosity, so full of kindness and tenderness amidst his passion for -adventurous exploit, had she not unfolded to him the real loveliness of -beneficence and made the doing good the end and aim of his soaring -ambition. - -I feel exquisite pleasure in dwelling on the recollections of -childhood, before misfortune had tainted my mind and changed its bright -visions of extensive usefulness into gloomy and narrow reflections upon -self. Besides, in drawing the picture of my early days, I also record -those events which led, by insensible steps, to my after tale of -misery, for when I would account to myself for the birth of that -passion which afterwards ruled my destiny I find it arise, like a -mountain river, from ignoble and almost forgotten sources; but, -swelling as it proceeded, it became the torrent which, in its course, -has swept away all my hopes and joys. Natural philosophy is the genius -that has regulated my fate; I desire, therefore, in this narration, to -state those facts which led to my predilection for that science. When -I was thirteen years of age we all went on a party of pleasure to the -baths near Thonon; the inclemency of the weather obliged us to remain a -day confined to the inn. In this house I chanced to find a volume of -the works of Cornelius Agrippa. I opened it with apathy; the theory -which he attempts to demonstrate and the wonderful facts which he -relates soon changed this feeling into enthusiasm. A new light seemed -to dawn upon my mind, and bounding with joy, I communicated my -discovery to my father. My father looked carelessly at the title page -of my book and said, "Ah! Cornelius Agrippa! My dear Victor, do not -waste your time upon this; it is sad trash." - -If, instead of this remark, my father had taken the pains to explain to -me that the principles of Agrippa had been entirely exploded and that a -modern system of science had been introduced which possessed much -greater powers than the ancient, because the powers of the latter were -chimerical, while those of the former were real and practical, under -such circumstances I should certainly have thrown Agrippa aside and -have contented my imagination, warmed as it was, by returning with -greater ardour to my former studies. It is even possible that the -train of my ideas would never have received the fatal impulse that led -to my ruin. But the cursory glance my father had taken of my volume by -no means assured me that he was acquainted with its contents, and I -continued to read with the greatest avidity. When I returned home my -first care was to procure the whole works of this author, and -afterwards of Paracelsus and Albertus Magnus. I read and studied the -wild fancies of these writers with delight; they appeared to me -treasures known to few besides myself. I have described myself as -always having been imbued with a fervent longing to penetrate the -secrets of nature. In spite of the intense labour and wonderful -discoveries of modern philosophers, I always came from my studies -discontented and unsatisfied. Sir Isaac Newton is said to have avowed -that he felt like a child picking up shells beside the great and -unexplored ocean of truth. Those of his successors in each branch of -natural philosophy with whom I was acquainted appeared even to my boy's -apprehensions as tyros engaged in the same pursuit. - -The untaught peasant beheld the elements around him and was acquainted -with their practical uses. The most learned philosopher knew little -more. He had partially unveiled the face of Nature, but her immortal -lineaments were still a wonder and a mystery. He might dissect, -anatomize, and give names; but, not to speak of a final cause, causes -in their secondary and tertiary grades were utterly unknown to him. I -had gazed upon the fortifications and impediments that seemed to keep -human beings from entering the citadel of nature, and rashly and -ignorantly I had repined. - -But here were books, and here were men who had penetrated deeper and -knew more. I took their word for all that they averred, and I became -their disciple. It may appear strange that such should arise in the -eighteenth century; but while I followed the routine of education in -the schools of Geneva, I was, to a great degree, self-taught with -regard to my favourite studies. My father was not scientific, and I -was left to struggle with a child's blindness, added to a student's -thirst for knowledge. Under the guidance of my new preceptors I -entered with the greatest diligence into the search of the -philosopher's stone and the elixir of life; but the latter soon -obtained my undivided attention. Wealth was an inferior object, but -what glory would attend the discovery if I could banish disease from -the human frame and render man invulnerable to any but a violent death! -Nor were these my only visions. The raising of ghosts or devils was a -promise liberally accorded by my favourite authors, the fulfilment of -which I most eagerly sought; and if my incantations were always -unsuccessful, I attributed the failure rather to my own inexperience -and mistake than to a want of skill or fidelity in my instructors. And -thus for a time I was occupied by exploded systems, mingling, like an -unadept, a thousand contradictory theories and floundering desperately -in a very slough of multifarious knowledge, guided by an ardent -imagination and childish reasoning, till an accident again changed the -current of my ideas. When I was about fifteen years old we had retired -to our house near Belrive, when we witnessed a most violent and -terrible thunderstorm. It advanced from behind the mountains of Jura, -and the thunder burst at once with frightful loudness from various -quarters of the heavens. I remained, while the storm lasted, watching -its progress with curiosity and delight. As I stood at the door, on a -sudden I beheld a stream of fire issue from an old and beautiful oak -which stood about twenty yards from our house; and so soon as the -dazzling light vanished, the oak had disappeared, and nothing remained -but a blasted stump. When we visited it the next morning, we found the -tree shattered in a singular manner. It was not splintered by the -shock, but entirely reduced to thin ribbons of wood. I never beheld -anything so utterly destroyed. - -Before this I was not unacquainted with the more obvious laws of -electricity. On this occasion a man of great research in natural -philosophy was with us, and excited by this catastrophe, he entered on -the explanation of a theory which he had formed on the subject of -electricity and galvanism, which was at once new and astonishing to me. -All that he said threw greatly into the shade Cornelius Agrippa, -Albertus Magnus, and Paracelsus, the lords of my imagination; but by -some fatality the overthrow of these men disinclined me to pursue my -accustomed studies. It seemed to me as if nothing would or could ever -be known. All that had so long engaged my attention suddenly grew -despicable. By one of those caprices of the mind which we are perhaps -most subject to in early youth, I at once gave up my former -occupations, set down natural history and all its progeny as a deformed -and abortive creation, and entertained the greatest disdain for a -would-be science which could never even step within the threshold of -real knowledge. In this mood of mind I betook myself to the -mathematics and the branches of study appertaining to that science as -being built upon secure foundations, and so worthy of my consideration. - -Thus strangely are our souls constructed, and by such slight ligaments -are we bound to prosperity or ruin. When I look back, it seems to me -as if this almost miraculous change of inclination and will was the -immediate suggestion of the guardian angel of my life--the last effort -made by the spirit of preservation to avert the storm that was even -then hanging in the stars and ready to envelop me. Her victory was -announced by an unusual tranquillity and gladness of soul which -followed the relinquishing of my ancient and latterly tormenting -studies. It was thus that I was to be taught to associate evil with -their prosecution, happiness with their disregard. - -It was a strong effort of the spirit of good, but it was ineffectual. -Destiny was too potent, and her immutable laws had decreed my utter and -terrible destruction. - - - -Chapter 3 - -When I had attained the age of seventeen my parents resolved that I -should become a student at the university of Ingolstadt. I had -hitherto attended the schools of Geneva, but my father thought it -necessary for the completion of my education that I should be made -acquainted with other customs than those of my native country. My -departure was therefore fixed at an early date, but before the day -resolved upon could arrive, the first misfortune of my life -occurred--an omen, as it were, of my future misery. Elizabeth had -caught the scarlet fever; her illness was severe, and she was in the -greatest danger. During her illness many arguments had been urged to -persuade my mother to refrain from attending upon her. She had at -first yielded to our entreaties, but when she heard that the life of -her favourite was menaced, she could no longer control her anxiety. She -attended her sickbed; her watchful attentions triumphed over the -malignity of the distemper--Elizabeth was saved, but the consequences -of this imprudence were fatal to her preserver. On the third day my -mother sickened; her fever was accompanied by the most alarming -symptoms, and the looks of her medical attendants prognosticated the -worst event. On her deathbed the fortitude and benignity of this best -of women did not desert her. She joined the hands of Elizabeth and -myself. "My children," she said, "my firmest hopes of future happiness -were placed on the prospect of your union. This expectation will now -be the consolation of your father. Elizabeth, my love, you must supply -my place to my younger children. Alas! I regret that I am taken from -you; and, happy and beloved as I have been, is it not hard to quit you -all? But these are not thoughts befitting me; I will endeavour to -resign myself cheerfully to death and will indulge a hope of meeting -you in another world." - -She died calmly, and her countenance expressed affection even in death. -I need not describe the feelings of those whose dearest ties are rent -by that most irreparable evil, the void that presents itself to the -soul, and the despair that is exhibited on the countenance. It is so -long before the mind can persuade itself that she whom we saw every day -and whose very existence appeared a part of our own can have departed -forever--that the brightness of a beloved eye can have been -extinguished and the sound of a voice so familiar and dear to the ear -can be hushed, never more to be heard. These are the reflections of -the first days; but when the lapse of time proves the reality of the -evil, then the actual bitterness of grief commences. Yet from whom has -not that rude hand rent away some dear connection? And why should I -describe a sorrow which all have felt, and must feel? The time at -length arrives when grief is rather an indulgence than a necessity; and -the smile that plays upon the lips, although it may be deemed a -sacrilege, is not banished. My mother was dead, but we had still -duties which we ought to perform; we must continue our course with the -rest and learn to think ourselves fortunate whilst one remains whom the -spoiler has not seized. - -My departure for Ingolstadt, which had been deferred by these events, -was now again determined upon. I obtained from my father a respite of -some weeks. It appeared to me sacrilege so soon to leave the repose, -akin to death, of the house of mourning and to rush into the thick of -life. I was new to sorrow, but it did not the less alarm me. I was -unwilling to quit the sight of those that remained to me, and above -all, I desired to see my sweet Elizabeth in some degree consoled. - -She indeed veiled her grief and strove to act the comforter to us all. -She looked steadily on life and assumed its duties with courage and -zeal. She devoted herself to those whom she had been taught to call -her uncle and cousins. Never was she so enchanting as at this time, -when she recalled the sunshine of her smiles and spent them upon us. -She forgot even her own regret in her endeavours to make us forget. - -The day of my departure at length arrived. Clerval spent the last -evening with us. He had endeavoured to persuade his father to permit -him to accompany me and to become my fellow student, but in vain. His -father was a narrow-minded trader and saw idleness and ruin in the -aspirations and ambition of his son. Henry deeply felt the misfortune -of being debarred from a liberal education. He said little, but when -he spoke I read in his kindling eye and in his animated glance a -restrained but firm resolve not to be chained to the miserable details -of commerce. - -We sat late. We could not tear ourselves away from each other nor -persuade ourselves to say the word "Farewell!" It was said, and we -retired under the pretence of seeking repose, each fancying that the -other was deceived; but when at morning's dawn I descended to the -carriage which was to convey me away, they were all there--my father -again to bless me, Clerval to press my hand once more, my Elizabeth to -renew her entreaties that I would write often and to bestow the last -feminine attentions on her playmate and friend. - -I threw myself into the chaise that was to convey me away and indulged -in the most melancholy reflections. I, who had ever been surrounded by -amiable companions, continually engaged in endeavouring to bestow -mutual pleasure--I was now alone. In the university whither I was -going I must form my own friends and be my own protector. My life had -hitherto been remarkably secluded and domestic, and this had given me -invincible repugnance to new countenances. I loved my brothers, -Elizabeth, and Clerval; these were "old familiar faces," but I believed -myself totally unfitted for the company of strangers. Such were my -reflections as I commenced my journey; but as I proceeded, my spirits -and hopes rose. I ardently desired the acquisition of knowledge. I -had often, when at home, thought it hard to remain during my youth -cooped up in one place and had longed to enter the world and take my -station among other human beings. Now my desires were complied with, -and it would, indeed, have been folly to repent. - -I had sufficient leisure for these and many other reflections during my -journey to Ingolstadt, which was long and fatiguing. At length the -high white steeple of the town met my eyes. I alighted and was -conducted to my solitary apartment to spend the evening as I pleased. - -The next morning I delivered my letters of introduction and paid a -visit to some of the principal professors. Chance--or rather the evil -influence, the Angel of Destruction, which asserted omnipotent sway -over me from the moment I turned my reluctant steps from my father's -door--led me first to M. Krempe, professor of natural philosophy. He -was an uncouth man, but deeply imbued in the secrets of his science. He -asked me several questions concerning my progress in the different -branches of science appertaining to natural philosophy. I replied -carelessly, and partly in contempt, mentioned the names of my -alchemists as the principal authors I had studied. The professor -stared. "Have you," he said, "really spent your time in studying such -nonsense?" - -I replied in the affirmative. "Every minute," continued M. Krempe with -warmth, "every instant that you have wasted on those books is utterly -and entirely lost. You have burdened your memory with exploded systems -and useless names. Good God! In what desert land have you lived, -where no one was kind enough to inform you that these fancies which you -have so greedily imbibed are a thousand years old and as musty as they -are ancient? I little expected, in this enlightened and scientific -age, to find a disciple of Albertus Magnus and Paracelsus. My dear -sir, you must begin your studies entirely anew." - -So saying, he stepped aside and wrote down a list of several books -treating of natural philosophy which he desired me to procure, and -dismissed me after mentioning that in the beginning of the following -week he intended to commence a course of lectures upon natural -philosophy in its general relations, and that M. Waldman, a fellow -professor, would lecture upon chemistry the alternate days that he -omitted. - -I returned home not disappointed, for I have said that I had long -considered those authors useless whom the professor reprobated; but I -returned not at all the more inclined to recur to these studies in any -shape. M. Krempe was a little squat man with a gruff voice and a -repulsive countenance; the teacher, therefore, did not prepossess me in -favour of his pursuits. In rather a too philosophical and connected a -strain, perhaps, I have given an account of the conclusions I had come -to concerning them in my early years. As a child I had not been -content with the results promised by the modern professors of natural -science. With a confusion of ideas only to be accounted for by my -extreme youth and my want of a guide on such matters, I had retrod the -steps of knowledge along the paths of time and exchanged the -discoveries of recent inquirers for the dreams of forgotten alchemists. -Besides, I had a contempt for the uses of modern natural philosophy. -It was very different when the masters of the science sought -immortality and power; such views, although futile, were grand; but now -the scene was changed. The ambition of the inquirer seemed to limit -itself to the annihilation of those visions on which my interest in -science was chiefly founded. I was required to exchange chimeras of -boundless grandeur for realities of little worth. - -Such were my reflections during the first two or three days of my -residence at Ingolstadt, which were chiefly spent in becoming -acquainted with the localities and the principal residents in my new -abode. But as the ensuing week commenced, I thought of the information -which M. Krempe had given me concerning the lectures. And although I -could not consent to go and hear that little conceited fellow deliver -sentences out of a pulpit, I recollected what he had said of M. -Waldman, whom I had never seen, as he had hitherto been out of town. - -Partly from curiosity and partly from idleness, I went into the -lecturing room, which M. Waldman entered shortly after. This professor -was very unlike his colleague. He appeared about fifty years of age, -but with an aspect expressive of the greatest benevolence; a few grey -hairs covered his temples, but those at the back of his head were -nearly black. His person was short but remarkably erect and his voice -the sweetest I had ever heard. He began his lecture by a -recapitulation of the history of chemistry and the various improvements -made by different men of learning, pronouncing with fervour the names -of the most distinguished discoverers. He then took a cursory view of -the present state of the science and explained many of its elementary -terms. After having made a few preparatory experiments, he concluded -with a panegyric upon modern chemistry, the terms of which I shall -never forget: "The ancient teachers of this science," said he, -"promised impossibilities and performed nothing. The modern masters -promise very little; they know that metals cannot be transmuted and -that the elixir of life is a chimera but these philosophers, whose -hands seem only made to dabble in dirt, and their eyes to pore over the -microscope or crucible, have indeed performed miracles. They penetrate -into the recesses of nature and show how she works in her -hiding-places. They ascend into the heavens; they have discovered how -the blood circulates, and the nature of the air we breathe. They have -acquired new and almost unlimited powers; they can command the thunders -of heaven, mimic the earthquake, and even mock the invisible world with -its own shadows." - -Such were the professor's words--rather let me say such the words of -the fate--enounced to destroy me. As he went on I felt as if my soul -were grappling with a palpable enemy; one by one the various keys were -touched which formed the mechanism of my being; chord after chord was -sounded, and soon my mind was filled with one thought, one conception, -one purpose. So much has been done, exclaimed the soul of -Frankenstein--more, far more, will I achieve; treading in the steps -already marked, I will pioneer a new way, explore unknown powers, and -unfold to the world the deepest mysteries of creation. - -I closed not my eyes that night. My internal being was in a state of -insurrection and turmoil; I felt that order would thence arise, but I -had no power to produce it. By degrees, after the morning's dawn, -sleep came. I awoke, and my yesternight's thoughts were as a dream. -There only remained a resolution to return to my ancient studies and to -devote myself to a science for which I believed myself to possess a -natural talent. On the same day I paid M. Waldman a visit. His -manners in private were even more mild and attractive than in public, -for there was a certain dignity in his mien during his lecture which in -his own house was replaced by the greatest affability and kindness. I -gave him pretty nearly the same account of my former pursuits as I had -given to his fellow professor. He heard with attention the little -narration concerning my studies and smiled at the names of Cornelius -Agrippa and Paracelsus, but without the contempt that M. Krempe had -exhibited. He said that "These were men to whose indefatigable zeal -modern philosophers were indebted for most of the foundations of their -knowledge. They had left to us, as an easier task, to give new names -and arrange in connected classifications the facts which they in a -great degree had been the instruments of bringing to light. The -labours of men of genius, however erroneously directed, scarcely ever -fail in ultimately turning to the solid advantage of mankind." I -listened to his statement, which was delivered without any presumption -or affectation, and then added that his lecture had removed my -prejudices against modern chemists; I expressed myself in measured -terms, with the modesty and deference due from a youth to his -instructor, without letting escape (inexperience in life would have -made me ashamed) any of the enthusiasm which stimulated my intended -labours. I requested his advice concerning the books I ought to -procure. - -"I am happy," said M. Waldman, "to have gained a disciple; and if your -application equals your ability, I have no doubt of your success. -Chemistry is that branch of natural philosophy in which the greatest -improvements have been and may be made; it is on that account that I -have made it my peculiar study; but at the same time, I have not -neglected the other branches of science. A man would make but a very -sorry chemist if he attended to that department of human knowledge -alone. If your wish is to become really a man of science and not -merely a petty experimentalist, I should advise you to apply to every -branch of natural philosophy, including mathematics." He then took me -into his laboratory and explained to me the uses of his various -machines, instructing me as to what I ought to procure and promising me -the use of his own when I should have advanced far enough in the -science not to derange their mechanism. He also gave me the list of -books which I had requested, and I took my leave. - -Thus ended a day memorable to me; it decided my future destiny. - - - -Chapter 4 - -From this day natural philosophy, and particularly chemistry, in the -most comprehensive sense of the term, became nearly my sole occupation. -I read with ardour those works, so full of genius and discrimination, -which modern inquirers have written on these subjects. I attended the -lectures and cultivated the acquaintance of the men of science of the -university, and I found even in M. Krempe a great deal of sound sense -and real information, combined, it is true, with a repulsive -physiognomy and manners, but not on that account the less valuable. In -M. Waldman I found a true friend. His gentleness was never tinged by -dogmatism, and his instructions were given with an air of frankness and -good nature that banished every idea of pedantry. In a thousand ways -he smoothed for me the path of knowledge and made the most abstruse -inquiries clear and facile to my apprehension. My application was at -first fluctuating and uncertain; it gained strength as I proceeded and -soon became so ardent and eager that the stars often disappeared in the -light of morning whilst I was yet engaged in my laboratory. - -As I applied so closely, it may be easily conceived that my progress -was rapid. My ardour was indeed the astonishment of the students, and -my proficiency that of the masters. Professor Krempe often asked me, -with a sly smile, how Cornelius Agrippa went on, whilst M. Waldman -expressed the most heartfelt exultation in my progress. Two years -passed in this manner, during which I paid no visit to Geneva, but was -engaged, heart and soul, in the pursuit of some discoveries which I -hoped to make. None but those who have experienced them can conceive -of the enticements of science. In other studies you go as far as -others have gone before you, and there is nothing more to know; but in -a scientific pursuit there is continual food for discovery and wonder. -A mind of moderate capacity which closely pursues one study must -infallibly arrive at great proficiency in that study; and I, who -continually sought the attainment of one object of pursuit and was -solely wrapped up in this, improved so rapidly that at the end of two -years I made some discoveries in the improvement of some chemical -instruments, which procured me great esteem and admiration at the -university. When I had arrived at this point and had become as well -acquainted with the theory and practice of natural philosophy as -depended on the lessons of any of the professors at Ingolstadt, my -residence there being no longer conducive to my improvements, I thought -of returning to my friends and my native town, when an incident -happened that protracted my stay. - -One of the phenomena which had peculiarly attracted my attention was -the structure of the human frame, and, indeed, any animal endued with -life. Whence, I often asked myself, did the principle of life proceed? -It was a bold question, and one which has ever been considered as a -mystery; yet with how many things are we upon the brink of becoming -acquainted, if cowardice or carelessness did not restrain our -inquiries. I revolved these circumstances in my mind and determined -thenceforth to apply myself more particularly to those branches of -natural philosophy which relate to physiology. Unless I had been -animated by an almost supernatural enthusiasm, my application to this -study would have been irksome and almost intolerable. To examine the -causes of life, we must first have recourse to death. I became -acquainted with the science of anatomy, but this was not sufficient; I -must also observe the natural decay and corruption of the human body. -In my education my father had taken the greatest precautions that my -mind should be impressed with no supernatural horrors. I do not ever -remember to have trembled at a tale of superstition or to have feared -the apparition of a spirit. Darkness had no effect upon my fancy, and -a churchyard was to me merely the receptacle of bodies deprived of -life, which, from being the seat of beauty and strength, had become -food for the worm. Now I was led to examine the cause and progress of -this decay and forced to spend days and nights in vaults and -charnel-houses. My attention was fixed upon every object the most -insupportable to the delicacy of the human feelings. I saw how the -fine form of man was degraded and wasted; I beheld the corruption of -death succeed to the blooming cheek of life; I saw how the worm -inherited the wonders of the eye and brain. I paused, examining and -analysing all the minutiae of causation, as exemplified in the change -from life to death, and death to life, until from the midst of this -darkness a sudden light broke in upon me--a light so brilliant and -wondrous, yet so simple, that while I became dizzy with the immensity -of the prospect which it illustrated, I was surprised that among so -many men of genius who had directed their inquiries towards the same -science, that I alone should be reserved to discover so astonishing a -secret. - -Remember, I am not recording the vision of a madman. The sun does not -more certainly shine in the heavens than that which I now affirm is -true. Some miracle might have produced it, yet the stages of the -discovery were distinct and probable. After days and nights of -incredible labour and fatigue, I succeeded in discovering the cause of -generation and life; nay, more, I became myself capable of bestowing -animation upon lifeless matter. - -The astonishment which I had at first experienced on this discovery -soon gave place to delight and rapture. After so much time spent in -painful labour, to arrive at once at the summit of my desires was the -most gratifying consummation of my toils. But this discovery was so -great and overwhelming that all the steps by which I had been -progressively led to it were obliterated, and I beheld only the result. -What had been the study and desire of the wisest men since the creation -of the world was now within my grasp. Not that, like a magic scene, it -all opened upon me at once: the information I had obtained was of a -nature rather to direct my endeavours so soon as I should point them -towards the object of my search than to exhibit that object already -accomplished. I was like the Arabian who had been buried with the dead -and found a passage to life, aided only by one glimmering and seemingly -ineffectual light. - -I see by your eagerness and the wonder and hope which your eyes -express, my friend, that you expect to be informed of the secret with -which I am acquainted; that cannot be; listen patiently until the end -of my story, and you will easily perceive why I am reserved upon that -subject. I will not lead you on, unguarded and ardent as I then was, -to your destruction and infallible misery. Learn from me, if not by my -precepts, at least by my example, how dangerous is the acquirement of -knowledge and how much happier that man is who believes his native town -to be the world, than he who aspires to become greater than his nature -will allow. - -When I found so astonishing a power placed within my hands, I hesitated -a long time concerning the manner in which I should employ it. -Although I possessed the capacity of bestowing animation, yet to -prepare a frame for the reception of it, with all its intricacies of -fibres, muscles, and veins, still remained a work of inconceivable -difficulty and labour. I doubted at first whether I should attempt the -creation of a being like myself, or one of simpler organization; but my -imagination was too much exalted by my first success to permit me to -doubt of my ability to give life to an animal as complex and wonderful -as man. The materials at present within my command hardly appeared -adequate to so arduous an undertaking, but I doubted not that I should -ultimately succeed. I prepared myself for a multitude of reverses; my -operations might be incessantly baffled, and at last my work be -imperfect, yet when I considered the improvement which every day takes -place in science and mechanics, I was encouraged to hope my present -attempts would at least lay the foundations of future success. Nor -could I consider the magnitude and complexity of my plan as any -argument of its impracticability. It was with these feelings that I -began the creation of a human being. As the minuteness of the parts -formed a great hindrance to my speed, I resolved, contrary to my first -intention, to make the being of a gigantic stature, that is to say, -about eight feet in height, and proportionably large. After having -formed this determination and having spent some months in successfully -collecting and arranging my materials, I began. - -No one can conceive the variety of feelings which bore me onwards, like -a hurricane, in the first enthusiasm of success. Life and death -appeared to me ideal bounds, which I should first break through, and -pour a torrent of light into our dark world. A new species would bless -me as its creator and source; many happy and excellent natures would -owe their being to me. No father could claim the gratitude of his -child so completely as I should deserve theirs. Pursuing these -reflections, I thought that if I could bestow animation upon lifeless -matter, I might in process of time (although I now found it impossible) -renew life where death had apparently devoted the body to corruption. - -These thoughts supported my spirits, while I pursued my undertaking -with unremitting ardour. My cheek had grown pale with study, and my -person had become emaciated with confinement. Sometimes, on the very -brink of certainty, I failed; yet still I clung to the hope which the -next day or the next hour might realize. One secret which I alone -possessed was the hope to which I had dedicated myself; and the moon -gazed on my midnight labours, while, with unrelaxed and breathless -eagerness, I pursued nature to her hiding-places. Who shall conceive -the horrors of my secret toil as I dabbled among the unhallowed damps -of the grave or tortured the living animal to animate the lifeless -clay? My limbs now tremble, and my eyes swim with the remembrance; but -then a resistless and almost frantic impulse urged me forward; I seemed -to have lost all soul or sensation but for this one pursuit. It was -indeed but a passing trance, that only made me feel with renewed -acuteness so soon as, the unnatural stimulus ceasing to operate, I had -returned to my old habits. I collected bones from charnel-houses and -disturbed, with profane fingers, the tremendous secrets of the human -frame. In a solitary chamber, or rather cell, at the top of the house, -and separated from all the other apartments by a gallery and staircase, -I kept my workshop of filthy creation; my eyeballs were starting from -their sockets in attending to the details of my employment. The -dissecting room and the slaughter-house furnished many of my materials; -and often did my human nature turn with loathing from my occupation, -whilst, still urged on by an eagerness which perpetually increased, I -brought my work near to a conclusion. - -The summer months passed while I was thus engaged, heart and soul, in -one pursuit. It was a most beautiful season; never did the fields -bestow a more plentiful harvest or the vines yield a more luxuriant -vintage, but my eyes were insensible to the charms of nature. And the -same feelings which made me neglect the scenes around me caused me also -to forget those friends who were so many miles absent, and whom I had -not seen for so long a time. I knew my silence disquieted them, and I -well remembered the words of my father: "I know that while you are -pleased with yourself you will think of us with affection, and we shall -hear regularly from you. You must pardon me if I regard any -interruption in your correspondence as a proof that your other duties -are equally neglected." - -I knew well therefore what would be my father's feelings, but I could -not tear my thoughts from my employment, loathsome in itself, but which -had taken an irresistible hold of my imagination. I wished, as it -were, to procrastinate all that related to my feelings of affection -until the great object, which swallowed up every habit of my nature, -should be completed. - -I then thought that my father would be unjust if he ascribed my neglect -to vice or faultiness on my part, but I am now convinced that he was -justified in conceiving that I should not be altogether free from -blame. A human being in perfection ought always to preserve a calm and -peaceful mind and never to allow passion or a transitory desire to -disturb his tranquillity. I do not think that the pursuit of knowledge -is an exception to this rule. If the study to which you apply yourself -has a tendency to weaken your affections and to destroy your taste for -those simple pleasures in which no alloy can possibly mix, then that -study is certainly unlawful, that is to say, not befitting the human -mind. If this rule were always observed; if no man allowed any pursuit -whatsoever to interfere with the tranquillity of his domestic -affections, Greece had not been enslaved, Caesar would have spared his -country, America would have been discovered more gradually, and the -empires of Mexico and Peru had not been destroyed. - -But I forget that I am moralizing in the most interesting part of my -tale, and your looks remind me to proceed. My father made no reproach -in his letters and only took notice of my silence by inquiring into my -occupations more particularly than before. Winter, spring, and summer -passed away during my labours; but I did not watch the blossom or the -expanding leaves--sights which before always yielded me supreme -delight--so deeply was I engrossed in my occupation. The leaves of -that year had withered before my work drew near to a close, and now -every day showed me more plainly how well I had succeeded. But my -enthusiasm was checked by my anxiety, and I appeared rather like one -doomed by slavery to toil in the mines, or any other unwholesome trade -than an artist occupied by his favourite employment. Every night I was -oppressed by a slow fever, and I became nervous to a most painful -degree; the fall of a leaf startled me, and I shunned my fellow -creatures as if I had been guilty of a crime. Sometimes I grew alarmed -at the wreck I perceived that I had become; the energy of my purpose -alone sustained me: my labours would soon end, and I believed that -exercise and amusement would then drive away incipient disease; and I -promised myself both of these when my creation should be complete. - - - -Chapter 5 - -It was on a dreary night of November that I beheld the accomplishment -of my toils. With an anxiety that almost amounted to agony, I -collected the instruments of life around me, that I might infuse a -spark of being into the lifeless thing that lay at my feet. It was -already one in the morning; the rain pattered dismally against the -panes, and my candle was nearly burnt out, when, by the glimmer of the -half-extinguished light, I saw the dull yellow eye of the creature -open; it breathed hard, and a convulsive motion agitated its limbs. - -How can I describe my emotions at this catastrophe, or how delineate -the wretch whom with such infinite pains and care I had endeavoured to -form? His limbs were in proportion, and I had selected his features as -beautiful. Beautiful! Great God! His yellow skin scarcely covered -the work of muscles and arteries beneath; his hair was of a lustrous -black, and flowing; his teeth of a pearly whiteness; but these -luxuriances only formed a more horrid contrast with his watery eyes, -that seemed almost of the same colour as the dun-white sockets in which -they were set, his shrivelled complexion and straight black lips. - -The different accidents of life are not so changeable as the feelings -of human nature. I had worked hard for nearly two years, for the sole -purpose of infusing life into an inanimate body. For this I had -deprived myself of rest and health. I had desired it with an ardour -that far exceeded moderation; but now that I had finished, the beauty -of the dream vanished, and breathless horror and disgust filled my -heart. Unable to endure the aspect of the being I had created, I -rushed out of the room and continued a long time traversing my -bed-chamber, unable to compose my mind to sleep. At length lassitude -succeeded to the tumult I had before endured, and I threw myself on the -bed in my clothes, endeavouring to seek a few moments of forgetfulness. -But it was in vain; I slept, indeed, but I was disturbed by the wildest -dreams. I thought I saw Elizabeth, in the bloom of health, walking in -the streets of Ingolstadt. Delighted and surprised, I embraced her, -but as I imprinted the first kiss on her lips, they became livid with -the hue of death; her features appeared to change, and I thought that I -held the corpse of my dead mother in my arms; a shroud enveloped her -form, and I saw the grave-worms crawling in the folds of the flannel. -I started from my sleep with horror; a cold dew covered my forehead, my -teeth chattered, and every limb became convulsed; when, by the dim and -yellow light of the moon, as it forced its way through the window -shutters, I beheld the wretch--the miserable monster whom I had -created. He held up the curtain of the bed; and his eyes, if eyes they -may be called, were fixed on me. His jaws opened, and he muttered some -inarticulate sounds, while a grin wrinkled his cheeks. He might have -spoken, but I did not hear; one hand was stretched out, seemingly to -detain me, but I escaped and rushed downstairs. I took refuge in the -courtyard belonging to the house which I inhabited, where I remained -during the rest of the night, walking up and down in the greatest -agitation, listening attentively, catching and fearing each sound as if -it were to announce the approach of the demoniacal corpse to which I -had so miserably given life. - -Oh! No mortal could support the horror of that countenance. A mummy -again endued with animation could not be so hideous as that wretch. I -had gazed on him while unfinished; he was ugly then, but when those -muscles and joints were rendered capable of motion, it became a thing -such as even Dante could not have conceived. - -I passed the night wretchedly. Sometimes my pulse beat so quickly and -hardly that I felt the palpitation of every artery; at others, I nearly -sank to the ground through languor and extreme weakness. Mingled with -this horror, I felt the bitterness of disappointment; dreams that had -been my food and pleasant rest for so long a space were now become a -hell to me; and the change was so rapid, the overthrow so complete! - -Morning, dismal and wet, at length dawned and discovered to my -sleepless and aching eyes the church of Ingolstadt, its white steeple -and clock, which indicated the sixth hour. The porter opened the gates -of the court, which had that night been my asylum, and I issued into -the streets, pacing them with quick steps, as if I sought to avoid the -wretch whom I feared every turning of the street would present to my -view. I did not dare return to the apartment which I inhabited, but -felt impelled to hurry on, although drenched by the rain which poured -from a black and comfortless sky. - -I continued walking in this manner for some time, endeavouring by -bodily exercise to ease the load that weighed upon my mind. I -traversed the streets without any clear conception of where I was or -what I was doing. My heart palpitated in the sickness of fear, and I -hurried on with irregular steps, not daring to look about me: - - - Like one who, on a lonely road, - Doth walk in fear and dread, - And, having once turned round, walks on, - And turns no more his head; - Because he knows a frightful fiend - Doth close behind him tread. - - [Coleridge's "Ancient Mariner."] - - -Continuing thus, I came at length opposite to the inn at which the -various diligences and carriages usually stopped. Here I paused, I -knew not why; but I remained some minutes with my eyes fixed on a coach -that was coming towards me from the other end of the street. As it -drew nearer I observed that it was the Swiss diligence; it stopped just -where I was standing, and on the door being opened, I perceived Henry -Clerval, who, on seeing me, instantly sprung out. "My dear -Frankenstein," exclaimed he, "how glad I am to see you! How fortunate -that you should be here at the very moment of my alighting!" - -Nothing could equal my delight on seeing Clerval; his presence brought -back to my thoughts my father, Elizabeth, and all those scenes of home -so dear to my recollection. I grasped his hand, and in a moment forgot -my horror and misfortune; I felt suddenly, and for the first time -during many months, calm and serene joy. I welcomed my friend, -therefore, in the most cordial manner, and we walked towards my -college. Clerval continued talking for some time about our mutual -friends and his own good fortune in being permitted to come to -Ingolstadt. "You may easily believe," said he, "how great was the -difficulty to persuade my father that all necessary knowledge was not -comprised in the noble art of book-keeping; and, indeed, I believe I -left him incredulous to the last, for his constant answer to my -unwearied entreaties was the same as that of the Dutch schoolmaster in -The Vicar of Wakefield: 'I have ten thousand florins a year without -Greek, I eat heartily without Greek.' But his affection for me at -length overcame his dislike of learning, and he has permitted me to -undertake a voyage of discovery to the land of knowledge." - -"It gives me the greatest delight to see you; but tell me how you left -my father, brothers, and Elizabeth." - -"Very well, and very happy, only a little uneasy that they hear from -you so seldom. By the by, I mean to lecture you a little upon their -account myself. But, my dear Frankenstein," continued he, stopping -short and gazing full in my face, "I did not before remark how very ill -you appear; so thin and pale; you look as if you had been watching for -several nights." - -"You have guessed right; I have lately been so deeply engaged in one -occupation that I have not allowed myself sufficient rest, as you see; -but I hope, I sincerely hope, that all these employments are now at an -end and that I am at length free." - -I trembled excessively; I could not endure to think of, and far less to -allude to, the occurrences of the preceding night. I walked with a -quick pace, and we soon arrived at my college. I then reflected, and -the thought made me shiver, that the creature whom I had left in my -apartment might still be there, alive and walking about. I dreaded to -behold this monster, but I feared still more that Henry should see him. -Entreating him, therefore, to remain a few minutes at the bottom of the -stairs, I darted up towards my own room. My hand was already on the -lock of the door before I recollected myself. I then paused, and a -cold shivering came over me. I threw the door forcibly open, as -children are accustomed to do when they expect a spectre to stand in -waiting for them on the other side; but nothing appeared. I stepped -fearfully in: the apartment was empty, and my bedroom was also freed -from its hideous guest. I could hardly believe that so great a good -fortune could have befallen me, but when I became assured that my enemy -had indeed fled, I clapped my hands for joy and ran down to Clerval. - -We ascended into my room, and the servant presently brought breakfast; -but I was unable to contain myself. It was not joy only that possessed -me; I felt my flesh tingle with excess of sensitiveness, and my pulse -beat rapidly. I was unable to remain for a single instant in the same -place; I jumped over the chairs, clapped my hands, and laughed aloud. -Clerval at first attributed my unusual spirits to joy on his arrival, -but when he observed me more attentively, he saw a wildness in my eyes -for which he could not account, and my loud, unrestrained, heartless -laughter frightened and astonished him. - -"My dear Victor," cried he, "what, for God's sake, is the matter? Do -not laugh in that manner. How ill you are! What is the cause of all -this?" - -"Do not ask me," cried I, putting my hands before my eyes, for I -thought I saw the dreaded spectre glide into the room; "HE can tell. -Oh, save me! Save me!" I imagined that the monster seized me; I -struggled furiously and fell down in a fit. - -Poor Clerval! What must have been his feelings? A meeting, which he -anticipated with such joy, so strangely turned to bitterness. But I -was not the witness of his grief, for I was lifeless and did not -recover my senses for a long, long time. - -This was the commencement of a nervous fever which confined me for -several months. During all that time Henry was my only nurse. I -afterwards learned that, knowing my father's advanced age and unfitness -for so long a journey, and how wretched my sickness would make -Elizabeth, he spared them this grief by concealing the extent of my -disorder. He knew that I could not have a more kind and attentive -nurse than himself; and, firm in the hope he felt of my recovery, he -did not doubt that, instead of doing harm, he performed the kindest -action that he could towards them. - -But I was in reality very ill, and surely nothing but the unbounded and -unremitting attentions of my friend could have restored me to life. -The form of the monster on whom I had bestowed existence was forever -before my eyes, and I raved incessantly concerning him. Doubtless my -words surprised Henry; he at first believed them to be the wanderings -of my disturbed imagination, but the pertinacity with which I -continually recurred to the same subject persuaded him that my disorder -indeed owed its origin to some uncommon and terrible event. - -By very slow degrees, and with frequent relapses that alarmed and -grieved my friend, I recovered. I remember the first time I became -capable of observing outward objects with any kind of pleasure, I -perceived that the fallen leaves had disappeared and that the young -buds were shooting forth from the trees that shaded my window. It was -a divine spring, and the season contributed greatly to my -convalescence. I felt also sentiments of joy and affection revive in -my bosom; my gloom disappeared, and in a short time I became as -cheerful as before I was attacked by the fatal passion. - -"Dearest Clerval," exclaimed I, "how kind, how very good you are to me. -This whole winter, instead of being spent in study, as you promised -yourself, has been consumed in my sick room. How shall I ever repay -you? I feel the greatest remorse for the disappointment of which I -have been the occasion, but you will forgive me." - -"You will repay me entirely if you do not discompose yourself, but get -well as fast as you can; and since you appear in such good spirits, I -may speak to you on one subject, may I not?" - -I trembled. One subject! What could it be? Could he allude to an -object on whom I dared not even think? "Compose yourself," said -Clerval, who observed my change of colour, "I will not mention it if it -agitates you; but your father and cousin would be very happy if they -received a letter from you in your own handwriting. They hardly know -how ill you have been and are uneasy at your long silence." - -"Is that all, my dear Henry? How could you suppose that my first -thought would not fly towards those dear, dear friends whom I love and -who are so deserving of my love?" - -"If this is your present temper, my friend, you will perhaps be glad to -see a letter that has been lying here some days for you; it is from -your cousin, I believe." - - - -Chapter 6 - -Clerval then put the following letter into my hands. It was from my -own Elizabeth: - -"My dearest Cousin, - -"You have been ill, very ill, and even the constant letters of dear -kind Henry are not sufficient to reassure me on your account. You are -forbidden to write--to hold a pen; yet one word from you, dear Victor, -is necessary to calm our apprehensions. For a long time I have thought -that each post would bring this line, and my persuasions have -restrained my uncle from undertaking a journey to Ingolstadt. I have -prevented his encountering the inconveniences and perhaps dangers of so -long a journey, yet how often have I regretted not being able to -perform it myself! I figure to myself that the task of attending on -your sickbed has devolved on some mercenary old nurse, who could never -guess your wishes nor minister to them with the care and affection of -your poor cousin. Yet that is over now: Clerval writes that indeed -you are getting better. I eagerly hope that you will confirm this -intelligence soon in your own handwriting. - -"Get well--and return to us. You will find a happy, cheerful home and -friends who love you dearly. Your father's health is vigorous, and he -asks but to see you, but to be assured that you are well; and not a -care will ever cloud his benevolent countenance. How pleased you would -be to remark the improvement of our Ernest! He is now sixteen and full -of activity and spirit. He is desirous to be a true Swiss and to enter -into foreign service, but we cannot part with him, at least until his -elder brother returns to us. My uncle is not pleased with the idea of -a military career in a distant country, but Ernest never had your -powers of application. He looks upon study as an odious fetter; his -time is spent in the open air, climbing the hills or rowing on the -lake. I fear that he will become an idler unless we yield the point -and permit him to enter on the profession which he has selected. - -"Little alteration, except the growth of our dear children, has taken -place since you left us. The blue lake and snow-clad mountains--they -never change; and I think our placid home and our contented hearts are -regulated by the same immutable laws. My trifling occupations take up -my time and amuse me, and I am rewarded for any exertions by seeing -none but happy, kind faces around me. Since you left us, but one -change has taken place in our little household. Do you remember on -what occasion Justine Moritz entered our family? Probably you do not; -I will relate her history, therefore in a few words. Madame Moritz, -her mother, was a widow with four children, of whom Justine was the -third. This girl had always been the favourite of her father, but -through a strange perversity, her mother could not endure her, and -after the death of M. Moritz, treated her very ill. My aunt observed -this, and when Justine was twelve years of age, prevailed on her mother -to allow her to live at our house. The republican institutions of our -country have produced simpler and happier manners than those which -prevail in the great monarchies that surround it. Hence there is less -distinction between the several classes of its inhabitants; and the -lower orders, being neither so poor nor so despised, their manners are -more refined and moral. A servant in Geneva does not mean the same -thing as a servant in France and England. Justine, thus received in -our family, learned the duties of a servant, a condition which, in our -fortunate country, does not include the idea of ignorance and a -sacrifice of the dignity of a human being. - -"Justine, you may remember, was a great favourite of yours; and I -recollect you once remarked that if you were in an ill humour, one -glance from Justine could dissipate it, for the same reason that -Ariosto gives concerning the beauty of Angelica--she looked so -frank-hearted and happy. My aunt conceived a great attachment for her, -by which she was induced to give her an education superior to that -which she had at first intended. This benefit was fully repaid; -Justine was the most grateful little creature in the world: I do not -mean that she made any professions I never heard one pass her lips, but -you could see by her eyes that she almost adored her protectress. -Although her disposition was gay and in many respects inconsiderate, -yet she paid the greatest attention to every gesture of my aunt. She -thought her the model of all excellence and endeavoured to imitate her -phraseology and manners, so that even now she often reminds me of her. - -"When my dearest aunt died every one was too much occupied in their own -grief to notice poor Justine, who had attended her during her illness -with the most anxious affection. Poor Justine was very ill; but other -trials were reserved for her. - -"One by one, her brothers and sister died; and her mother, with the -exception of her neglected daughter, was left childless. The -conscience of the woman was troubled; she began to think that the -deaths of her favourites was a judgement from heaven to chastise her -partiality. She was a Roman Catholic; and I believe her confessor -confirmed the idea which she had conceived. Accordingly, a few months -after your departure for Ingolstadt, Justine was called home by her -repentant mother. Poor girl! She wept when she quitted our house; she -was much altered since the death of my aunt; grief had given softness -and a winning mildness to her manners, which had before been remarkable -for vivacity. Nor was her residence at her mother's house of a nature -to restore her gaiety. The poor woman was very vacillating in her -repentance. She sometimes begged Justine to forgive her unkindness, -but much oftener accused her of having caused the deaths of her -brothers and sister. Perpetual fretting at length threw Madame Moritz -into a decline, which at first increased her irritability, but she is -now at peace for ever. She died on the first approach of cold weather, -at the beginning of this last winter. Justine has just returned to us; -and I assure you I love her tenderly. She is very clever and gentle, -and extremely pretty; as I mentioned before, her mien and her -expression continually remind me of my dear aunt. - -"I must say also a few words to you, my dear cousin, of little darling -William. I wish you could see him; he is very tall of his age, with -sweet laughing blue eyes, dark eyelashes, and curling hair. When he -smiles, two little dimples appear on each cheek, which are rosy with -health. He has already had one or two little WIVES, but Louisa Biron -is his favourite, a pretty little girl of five years of age. - -"Now, dear Victor, I dare say you wish to be indulged in a little -gossip concerning the good people of Geneva. The pretty Miss Mansfield -has already received the congratulatory visits on her approaching -marriage with a young Englishman, John Melbourne, Esq. Her ugly -sister, Manon, married M. Duvillard, the rich banker, last autumn. Your -favourite schoolfellow, Louis Manoir, has suffered several misfortunes -since the departure of Clerval from Geneva. But he has already -recovered his spirits, and is reported to be on the point of marrying a -lively pretty Frenchwoman, Madame Tavernier. She is a widow, and much -older than Manoir; but she is very much admired, and a favourite with -everybody. - -"I have written myself into better spirits, dear cousin; but my anxiety -returns upon me as I conclude. Write, dearest Victor,--one line--one -word will be a blessing to us. Ten thousand thanks to Henry for his -kindness, his affection, and his many letters; we are sincerely -grateful. Adieu! my cousin; take care of your self; and, I entreat -you, write! - -"Elizabeth Lavenza. - -"Geneva, March 18, 17--." - - -"Dear, dear Elizabeth!" I exclaimed, when I had read her letter: "I -will write instantly and relieve them from the anxiety they must feel." -I wrote, and this exertion greatly fatigued me; but my convalescence -had commenced, and proceeded regularly. In another fortnight I was -able to leave my chamber. - -One of my first duties on my recovery was to introduce Clerval to the -several professors of the university. In doing this, I underwent a -kind of rough usage, ill befitting the wounds that my mind had -sustained. Ever since the fatal night, the end of my labours, and the -beginning of my misfortunes, I had conceived a violent antipathy even -to the name of natural philosophy. When I was otherwise quite restored -to health, the sight of a chemical instrument would renew all the agony -of my nervous symptoms. Henry saw this, and had removed all my -apparatus from my view. He had also changed my apartment; for he -perceived that I had acquired a dislike for the room which had -previously been my laboratory. But these cares of Clerval were made of -no avail when I visited the professors. M. Waldman inflicted torture -when he praised, with kindness and warmth, the astonishing progress I -had made in the sciences. He soon perceived that I disliked the -subject; but not guessing the real cause, he attributed my feelings to -modesty, and changed the subject from my improvement, to the science -itself, with a desire, as I evidently saw, of drawing me out. What -could I do? He meant to please, and he tormented me. I felt as if he -had placed carefully, one by one, in my view those instruments which -were to be afterwards used in putting me to a slow and cruel death. I -writhed under his words, yet dared not exhibit the pain I felt. -Clerval, whose eyes and feelings were always quick in discerning the -sensations of others, declined the subject, alleging, in excuse, his -total ignorance; and the conversation took a more general turn. I -thanked my friend from my heart, but I did not speak. I saw plainly -that he was surprised, but he never attempted to draw my secret from -me; and although I loved him with a mixture of affection and reverence -that knew no bounds, yet I could never persuade myself to confide in -him that event which was so often present to my recollection, but which -I feared the detail to another would only impress more deeply. - -M. Krempe was not equally docile; and in my condition at that time, of -almost insupportable sensitiveness, his harsh blunt encomiums gave me -even more pain than the benevolent approbation of M. Waldman. "D--n -the fellow!" cried he; "why, M. Clerval, I assure you he has outstript -us all. Ay, stare if you please; but it is nevertheless true. A -youngster who, but a few years ago, believed in Cornelius Agrippa as -firmly as in the gospel, has now set himself at the head of the -university; and if he is not soon pulled down, we shall all be out of -countenance.--Ay, ay," continued he, observing my face expressive of -suffering, "M. Frankenstein is modest; an excellent quality in a young -man. Young men should be diffident of themselves, you know, M. -Clerval: I was myself when young; but that wears out in a very short -time." - -M. Krempe had now commenced an eulogy on himself, which happily turned -the conversation from a subject that was so annoying to me. - -Clerval had never sympathized in my tastes for natural science; and his -literary pursuits differed wholly from those which had occupied me. He -came to the university with the design of making himself complete -master of the oriental languages, and thus he should open a field for -the plan of life he had marked out for himself. Resolved to pursue no -inglorious career, he turned his eyes toward the East, as affording -scope for his spirit of enterprise. The Persian, Arabic, and Sanskrit -languages engaged his attention, and I was easily induced to enter on -the same studies. Idleness had ever been irksome to me, and now that I -wished to fly from reflection, and hated my former studies, I felt -great relief in being the fellow-pupil with my friend, and found not -only instruction but consolation in the works of the orientalists. I -did not, like him, attempt a critical knowledge of their dialects, for -I did not contemplate making any other use of them than temporary -amusement. I read merely to understand their meaning, and they well -repaid my labours. Their melancholy is soothing, and their joy -elevating, to a degree I never experienced in studying the authors of -any other country. When you read their writings, life appears to -consist in a warm sun and a garden of roses,--in the smiles and frowns -of a fair enemy, and the fire that consumes your own heart. How -different from the manly and heroical poetry of Greece and Rome! - -Summer passed away in these occupations, and my return to Geneva was -fixed for the latter end of autumn; but being delayed by several -accidents, winter and snow arrived, the roads were deemed impassable, -and my journey was retarded until the ensuing spring. I felt this -delay very bitterly; for I longed to see my native town and my beloved -friends. My return had only been delayed so long, from an -unwillingness to leave Clerval in a strange place, before he had become -acquainted with any of its inhabitants. The winter, however, was spent -cheerfully; and although the spring was uncommonly late, when it came -its beauty compensated for its dilatoriness. - -The month of May had already commenced, and I expected the letter daily -which was to fix the date of my departure, when Henry proposed a -pedestrian tour in the environs of Ingolstadt, that I might bid a -personal farewell to the country I had so long inhabited. I acceded -with pleasure to this proposition: I was fond of exercise, and Clerval -had always been my favourite companion in the ramble of this nature -that I had taken among the scenes of my native country. - -We passed a fortnight in these perambulations: my health and spirits -had long been restored, and they gained additional strength from the -salubrious air I breathed, the natural incidents of our progress, and -the conversation of my friend. Study had before secluded me from the -intercourse of my fellow-creatures, and rendered me unsocial; but -Clerval called forth the better feelings of my heart; he again taught -me to love the aspect of nature, and the cheerful faces of children. -Excellent friend! how sincerely you did love me, and endeavour to -elevate my mind until it was on a level with your own. A selfish -pursuit had cramped and narrowed me, until your gentleness and -affection warmed and opened my senses; I became the same happy creature -who, a few years ago, loved and beloved by all, had no sorrow or care. -When happy, inanimate nature had the power of bestowing on me the most -delightful sensations. A serene sky and verdant fields filled me with -ecstasy. The present season was indeed divine; the flowers of spring -bloomed in the hedges, while those of summer were already in bud. I -was undisturbed by thoughts which during the preceding year had pressed -upon me, notwithstanding my endeavours to throw them off, with an -invincible burden. - -Henry rejoiced in my gaiety, and sincerely sympathised in my feelings: -he exerted himself to amuse me, while he expressed the sensations that -filled his soul. The resources of his mind on this occasion were truly -astonishing: his conversation was full of imagination; and very often, -in imitation of the Persian and Arabic writers, he invented tales of -wonderful fancy and passion. At other times he repeated my favourite -poems, or drew me out into arguments, which he supported with great -ingenuity. We returned to our college on a Sunday afternoon: the -peasants were dancing, and every one we met appeared gay and happy. My -own spirits were high, and I bounded along with feelings of unbridled -joy and hilarity. - - - -Chapter 7 - -On my return, I found the following letter from my father:-- - - -"My dear Victor, - -"You have probably waited impatiently for a letter to fix the date of -your return to us; and I was at first tempted to write only a few -lines, merely mentioning the day on which I should expect you. But -that would be a cruel kindness, and I dare not do it. What would be -your surprise, my son, when you expected a happy and glad welcome, to -behold, on the contrary, tears and wretchedness? And how, Victor, can -I relate our misfortune? Absence cannot have rendered you callous to -our joys and griefs; and how shall I inflict pain on my long absent -son? I wish to prepare you for the woeful news, but I know it is -impossible; even now your eye skims over the page to seek the words -which are to convey to you the horrible tidings. - -"William is dead!--that sweet child, whose smiles delighted and warmed -my heart, who was so gentle, yet so gay! Victor, he is murdered! - -"I will not attempt to console you; but will simply relate the -circumstances of the transaction. - -"Last Thursday (May 7th), I, my niece, and your two brothers, went to -walk in Plainpalais. The evening was warm and serene, and we prolonged -our walk farther than usual. It was already dusk before we thought of -returning; and then we discovered that William and Ernest, who had gone -on before, were not to be found. We accordingly rested on a seat until -they should return. Presently Ernest came, and enquired if we had seen -his brother; he said, that he had been playing with him, that William -had run away to hide himself, and that he vainly sought for him, and -afterwards waited for a long time, but that he did not return. - -"This account rather alarmed us, and we continued to search for him -until night fell, when Elizabeth conjectured that he might have -returned to the house. He was not there. We returned again, with -torches; for I could not rest, when I thought that my sweet boy had -lost himself, and was exposed to all the damps and dews of night; -Elizabeth also suffered extreme anguish. About five in the morning I -discovered my lovely boy, whom the night before I had seen blooming and -active in health, stretched on the grass livid and motionless; the -print of the murder's finger was on his neck. - -"He was conveyed home, and the anguish that was visible in my -countenance betrayed the secret to Elizabeth. She was very earnest to -see the corpse. At first I attempted to prevent her but she persisted, -and entering the room where it lay, hastily examined the neck of the -victim, and clasping her hands exclaimed, 'O God! I have murdered my -darling child!' - -"She fainted, and was restored with extreme difficulty. When she again -lived, it was only to weep and sigh. She told me, that that same -evening William had teased her to let him wear a very valuable -miniature that she possessed of your mother. This picture is gone, and -was doubtless the temptation which urged the murderer to the deed. We -have no trace of him at present, although our exertions to discover him -are unremitted; but they will not restore my beloved William! - -"Come, dearest Victor; you alone can console Elizabeth. She weeps -continually, and accuses herself unjustly as the cause of his death; -her words pierce my heart. We are all unhappy; but will not that be an -additional motive for you, my son, to return and be our comforter? -Your dear mother! Alas, Victor! I now say, Thank God she did not live -to witness the cruel, miserable death of her youngest darling! - -"Come, Victor; not brooding thoughts of vengeance against the assassin, -but with feelings of peace and gentleness, that will heal, instead of -festering, the wounds of our minds. Enter the house of mourning, my -friend, but with kindness and affection for those who love you, and not -with hatred for your enemies. - - "Your affectionate and afflicted father, - "Alphonse Frankenstein. - - - -"Geneva, May 12th, 17--." - -Clerval, who had watched my countenance as I read this letter, was -surprised to observe the despair that succeeded the joy I at first -expressed on receiving new from my friends. I threw the letter on the -table, and covered my face with my hands. - -"My dear Frankenstein," exclaimed Henry, when he perceived me weep with -bitterness, "are you always to be unhappy? My dear friend, what has -happened?" - -I motioned him to take up the letter, while I walked up and down the -room in the extremest agitation. Tears also gushed from the eyes of -Clerval, as he read the account of my misfortune. - -"I can offer you no consolation, my friend," said he; "your disaster is -irreparable. What do you intend to do?" - -"To go instantly to Geneva: come with me, Henry, to order the horses." - -During our walk, Clerval endeavoured to say a few words of consolation; -he could only express his heartfelt sympathy. "Poor William!" said he, -"dear lovely child, he now sleeps with his angel mother! Who that had -seen him bright and joyous in his young beauty, but must weep over his -untimely loss! To die so miserably; to feel the murderer's grasp! How -much more a murdered that could destroy radiant innocence! Poor little -fellow! one only consolation have we; his friends mourn and weep, but -he is at rest. The pang is over, his sufferings are at an end for ever. -A sod covers his gentle form, and he knows no pain. He can no longer -be a subject for pity; we must reserve that for his miserable -survivors." - -Clerval spoke thus as we hurried through the streets; the words -impressed themselves on my mind and I remembered them afterwards in -solitude. But now, as soon as the horses arrived, I hurried into a -cabriolet, and bade farewell to my friend. - -My journey was very melancholy. At first I wished to hurry on, for I -longed to console and sympathise with my loved and sorrowing friends; -but when I drew near my native town, I slackened my progress. I could -hardly sustain the multitude of feelings that crowded into my mind. I -passed through scenes familiar to my youth, but which I had not seen -for nearly six years. How altered every thing might be during that -time! One sudden and desolating change had taken place; but a thousand -little circumstances might have by degrees worked other alterations, -which, although they were done more tranquilly, might not be the less -decisive. Fear overcame me; I dared no advance, dreading a thousand -nameless evils that made me tremble, although I was unable to define -them. I remained two days at Lausanne, in this painful state of mind. -I contemplated the lake: the waters were placid; all around was calm; -and the snowy mountains, 'the palaces of nature,' were not changed. By -degrees the calm and heavenly scene restored me, and I continued my -journey towards Geneva. - -The road ran by the side of the lake, which became narrower as I -approached my native town. I discovered more distinctly the black -sides of Jura, and the bright summit of Mont Blanc. I wept like a -child. "Dear mountains! my own beautiful lake! how do you welcome your -wanderer? Your summits are clear; the sky and lake are blue and -placid. Is this to prognosticate peace, or to mock at my unhappiness?" - -I fear, my friend, that I shall render myself tedious by dwelling on -these preliminary circumstances; but they were days of comparative -happiness, and I think of them with pleasure. My country, my beloved -country! who but a native can tell the delight I took in again -beholding thy streams, thy mountains, and, more than all, thy lovely -lake! - -Yet, as I drew nearer home, grief and fear again overcame me. Night -also closed around; and when I could hardly see the dark mountains, I -felt still more gloomily. The picture appeared a vast and dim scene of -evil, and I foresaw obscurely that I was destined to become the most -wretched of human beings. Alas! I prophesied truly, and failed only -in one single circumstance, that in all the misery I imagined and -dreaded, I did not conceive the hundredth part of the anguish I was -destined to endure. It was completely dark when I arrived in the -environs of Geneva; the gates of the town were already shut; and I was -obliged to pass the night at Secheron, a village at the distance of -half a league from the city. The sky was serene; and, as I was unable -to rest, I resolved to visit the spot where my poor William had been -murdered. As I could not pass through the town, I was obliged to cross -the lake in a boat to arrive at Plainpalais. During this short voyage -I saw the lightning playing on the summit of Mont Blanc in the most -beautiful figures. The storm appeared to approach rapidly, and, on -landing, I ascended a low hill, that I might observe its progress. It -advanced; the heavens were clouded, and I soon felt the rain coming -slowly in large drops, but its violence quickly increased. - -I quitted my seat, and walked on, although the darkness and storm -increased every minute, and the thunder burst with a terrific crash -over my head. It was echoed from Saleve, the Juras, and the Alps of -Savoy; vivid flashes of lightning dazzled my eyes, illuminating the -lake, making it appear like a vast sheet of fire; then for an instant -every thing seemed of a pitchy darkness, until the eye recovered itself -from the preceding flash. The storm, as is often the case in -Switzerland, appeared at once in various parts of the heavens. The -most violent storm hung exactly north of the town, over the part of the -lake which lies between the promontory of Belrive and the village of -Copet. Another storm enlightened Jura with faint flashes; and another -darkened and sometimes disclosed the Mole, a peaked mountain to the -east of the lake. - -While I watched the tempest, so beautiful yet terrific, I wandered on -with a hasty step. This noble war in the sky elevated my spirits; I -clasped my hands, and exclaimed aloud, "William, dear angel! this is -thy funeral, this thy dirge!" As I said these words, I perceived in the -gloom a figure which stole from behind a clump of trees near me; I -stood fixed, gazing intently: I could not be mistaken. A flash of -lightning illuminated the object, and discovered its shape plainly to -me; its gigantic stature, and the deformity of its aspect more hideous -than belongs to humanity, instantly informed me that it was the wretch, -the filthy daemon, to whom I had given life. What did he there? Could -he be (I shuddered at the conception) the murderer of my brother? No -sooner did that idea cross my imagination, than I became convinced of -its truth; my teeth chattered, and I was forced to lean against a tree -for support. The figure passed me quickly, and I lost it in the gloom. - -Nothing in human shape could have destroyed the fair child. HE was the -murderer! I could not doubt it. The mere presence of the idea was an -irresistible proof of the fact. I thought of pursuing the devil; but -it would have been in vain, for another flash discovered him to me -hanging among the rocks of the nearly perpendicular ascent of Mont -Saleve, a hill that bounds Plainpalais on the south. He soon reached -the summit, and disappeared. - -I remained motionless. The thunder ceased; but the rain still -continued, and the scene was enveloped in an impenetrable darkness. I -revolved in my mind the events which I had until now sought to forget: -the whole train of my progress toward the creation; the appearance of -the works of my own hands at my bedside; its departure. Two years had -now nearly elapsed since the night on which he first received life; and -was this his first crime? Alas! I had turned loose into the world a -depraved wretch, whose delight was in carnage and misery; had he not -murdered my brother? - -No one can conceive the anguish I suffered during the remainder of the -night, which I spent, cold and wet, in the open air. But I did not -feel the inconvenience of the weather; my imagination was busy in -scenes of evil and despair. I considered the being whom I had cast -among mankind, and endowed with the will and power to effect purposes -of horror, such as the deed which he had now done, nearly in the light -of my own vampire, my own spirit let loose from the grave, and forced -to destroy all that was dear to me. - -Day dawned; and I directed my steps towards the town. The gates were -open, and I hastened to my father's house. My first thought was to -discover what I knew of the murderer, and cause instant pursuit to be -made. But I paused when I reflected on the story that I had to tell. A -being whom I myself had formed, and endued with life, had met me at -midnight among the precipices of an inaccessible mountain. I -remembered also the nervous fever with which I had been seized just at -the time that I dated my creation, and which would give an air of -delirium to a tale otherwise so utterly improbable. I well knew that -if any other had communicated such a relation to me, I should have -looked upon it as the ravings of insanity. Besides, the strange nature -of the animal would elude all pursuit, even if I were so far credited -as to persuade my relatives to commence it. And then of what use would -be pursuit? Who could arrest a creature capable of scaling the -overhanging sides of Mont Saleve? These reflections determined me, and -I resolved to remain silent. - -It was about five in the morning when I entered my father's house. I -told the servants not to disturb the family, and went into the library -to attend their usual hour of rising. - -Six years had elapsed, passed in a dream but for one indelible trace, -and I stood in the same place where I had last embraced my father -before my departure for Ingolstadt. Beloved and venerable parent! He -still remained to me. I gazed on the picture of my mother, which stood -over the mantel-piece. It was an historical subject, painted at my -father's desire, and represented Caroline Beaufort in an agony of -despair, kneeling by the coffin of her dead father. Her garb was -rustic, and her cheek pale; but there was an air of dignity and beauty, -that hardly permitted the sentiment of pity. Below this picture was a -miniature of William; and my tears flowed when I looked upon it. While -I was thus engaged, Ernest entered: he had heard me arrive, and -hastened to welcome me: "Welcome, my dearest Victor," said he. "Ah! I -wish you had come three months ago, and then you would have found us -all joyous and delighted. You come to us now to share a misery which -nothing can alleviate; yet your presence will, I hope, revive our -father, who seems sinking under his misfortune; and your persuasions -will induce poor Elizabeth to cease her vain and tormenting -self-accusations.--Poor William! he was our darling and our pride!" - -Tears, unrestrained, fell from my brother's eyes; a sense of mortal -agony crept over my frame. Before, I had only imagined the -wretchedness of my desolated home; the reality came on me as a new, and -a not less terrible, disaster. I tried to calm Ernest; I enquired more -minutely concerning my father, and here I named my cousin. - -"She most of all," said Ernest, "requires consolation; she accused -herself of having caused the death of my brother, and that made her -very wretched. But since the murderer has been discovered--" - -"The murderer discovered! Good God! how can that be? who could attempt -to pursue him? It is impossible; one might as well try to overtake the -winds, or confine a mountain-stream with a straw. I saw him too; he -was free last night!" - -"I do not know what you mean," replied my brother, in accents of -wonder, "but to us the discovery we have made completes our misery. No -one would believe it at first; and even now Elizabeth will not be -convinced, notwithstanding all the evidence. Indeed, who would credit -that Justine Moritz, who was so amiable, and fond of all the family, -could suddenly become so capable of so frightful, so appalling a crime?" - -"Justine Moritz! Poor, poor girl, is she the accused? But it is -wrongfully; every one knows that; no one believes it, surely, Ernest?" - -"No one did at first; but several circumstances came out, that have -almost forced conviction upon us; and her own behaviour has been so -confused, as to add to the evidence of facts a weight that, I fear, -leaves no hope for doubt. But she will be tried today, and you will -then hear all." - -He then related that, the morning on which the murder of poor William -had been discovered, Justine had been taken ill, and confined to her -bed for several days. During this interval, one of the servants, -happening to examine the apparel she had worn on the night of the -murder, had discovered in her pocket the picture of my mother, which -had been judged to be the temptation of the murderer. The servant -instantly showed it to one of the others, who, without saying a word to -any of the family, went to a magistrate; and, upon their deposition, -Justine was apprehended. On being charged with the fact, the poor girl -confirmed the suspicion in a great measure by her extreme confusion of -manner. - -This was a strange tale, but it did not shake my faith; and I replied -earnestly, "You are all mistaken; I know the murderer. Justine, poor, -good Justine, is innocent." - -At that instant my father entered. I saw unhappiness deeply impressed -on his countenance, but he endeavoured to welcome me cheerfully; and, -after we had exchanged our mournful greeting, would have introduced -some other topic than that of our disaster, had not Ernest exclaimed, -"Good God, papa! Victor says that he knows who was the murderer of -poor William." - -"We do also, unfortunately," replied my father, "for indeed I had -rather have been for ever ignorant than have discovered so much -depravity and ungratitude in one I valued so highly." - -"My dear father, you are mistaken; Justine is innocent." - -"If she is, God forbid that she should suffer as guilty. She is to be -tried today, and I hope, I sincerely hope, that she will be acquitted." - -This speech calmed me. I was firmly convinced in my own mind that -Justine, and indeed every human being, was guiltless of this murder. I -had no fear, therefore, that any circumstantial evidence could be -brought forward strong enough to convict her. My tale was not one to -announce publicly; its astounding horror would be looked upon as -madness by the vulgar. Did any one indeed exist, except I, the -creator, who would believe, unless his senses convinced him, in the -existence of the living monument of presumption and rash ignorance -which I had let loose upon the world? - -We were soon joined by Elizabeth. Time had altered her since I last -beheld her; it had endowed her with loveliness surpassing the beauty of -her childish years. There was the same candour, the same vivacity, but -it was allied to an expression more full of sensibility and intellect. -She welcomed me with the greatest affection. "Your arrival, my dear -cousin," said she, "fills me with hope. You perhaps will find some -means to justify my poor guiltless Justine. Alas! who is safe, if she -be convicted of crime? I rely on her innocence as certainly as I do -upon my own. Our misfortune is doubly hard to us; we have not only -lost that lovely darling boy, but this poor girl, whom I sincerely -love, is to be torn away by even a worse fate. If she is condemned, I -never shall know joy more. But she will not, I am sure she will not; -and then I shall be happy again, even after the sad death of my little -William." - -"She is innocent, my Elizabeth," said I, "and that shall be proved; -fear nothing, but let your spirits be cheered by the assurance of her -acquittal." - -"How kind and generous you are! every one else believes in her guilt, -and that made me wretched, for I knew that it was impossible: and to -see every one else prejudiced in so deadly a manner rendered me -hopeless and despairing." She wept. - -"Dearest niece," said my father, "dry your tears. If she is, as you -believe, innocent, rely on the justice of our laws, and the activity -with which I shall prevent the slightest shadow of partiality." - - - -Chapter 8 - -We passed a few sad hours until eleven o'clock, when the trial was to -commence. My father and the rest of the family being obliged to attend -as witnesses, I accompanied them to the court. During the whole of -this wretched mockery of justice I suffered living torture. It was to -be decided whether the result of my curiosity and lawless devices would -cause the death of two of my fellow beings: one a smiling babe full of -innocence and joy, the other far more dreadfully murdered, with every -aggravation of infamy that could make the murder memorable in horror. -Justine also was a girl of merit and possessed qualities which promised -to render her life happy; now all was to be obliterated in an -ignominious grave, and I the cause! A thousand times rather would I -have confessed myself guilty of the crime ascribed to Justine, but I -was absent when it was committed, and such a declaration would have -been considered as the ravings of a madman and would not have -exculpated her who suffered through me. - -The appearance of Justine was calm. She was dressed in mourning, and -her countenance, always engaging, was rendered, by the solemnity of her -feelings, exquisitely beautiful. Yet she appeared confident in -innocence and did not tremble, although gazed on and execrated by -thousands, for all the kindness which her beauty might otherwise have -excited was obliterated in the minds of the spectators by the -imagination of the enormity she was supposed to have committed. She -was tranquil, yet her tranquillity was evidently constrained; and as -her confusion had before been adduced as a proof of her guilt, she -worked up her mind to an appearance of courage. When she entered the -court she threw her eyes round it and quickly discovered where we were -seated. A tear seemed to dim her eye when she saw us, but she quickly -recovered herself, and a look of sorrowful affection seemed to attest -her utter guiltlessness. - -The trial began, and after the advocate against her had stated the -charge, several witnesses were called. Several strange facts combined -against her, which might have staggered anyone who had not such proof -of her innocence as I had. She had been out the whole of the night on -which the murder had been committed and towards morning had been -perceived by a market-woman not far from the spot where the body of the -murdered child had been afterwards found. The woman asked her what she -did there, but she looked very strangely and only returned a confused -and unintelligible answer. She returned to the house about eight -o'clock, and when one inquired where she had passed the night, she -replied that she had been looking for the child and demanded earnestly -if anything had been heard concerning him. When shown the body, she -fell into violent hysterics and kept her bed for several days. The -picture was then produced which the servant had found in her pocket; -and when Elizabeth, in a faltering voice, proved that it was the same -which, an hour before the child had been missed, she had placed round -his neck, a murmur of horror and indignation filled the court. - -Justine was called on for her defence. As the trial had proceeded, her -countenance had altered. Surprise, horror, and misery were strongly -expressed. Sometimes she struggled with her tears, but when she was -desired to plead, she collected her powers and spoke in an audible -although variable voice. - -"God knows," she said, "how entirely I am innocent. But I do not -pretend that my protestations should acquit me; I rest my innocence on -a plain and simple explanation of the facts which have been adduced -against me, and I hope the character I have always borne will incline -my judges to a favourable interpretation where any circumstance appears -doubtful or suspicious." - -She then related that, by the permission of Elizabeth, she had passed -the evening of the night on which the murder had been committed at the -house of an aunt at Chene, a village situated at about a league from -Geneva. On her return, at about nine o'clock, she met a man who asked -her if she had seen anything of the child who was lost. She was -alarmed by this account and passed several hours in looking for him, -when the gates of Geneva were shut, and she was forced to remain -several hours of the night in a barn belonging to a cottage, being -unwilling to call up the inhabitants, to whom she was well known. Most -of the night she spent here watching; towards morning she believed that -she slept for a few minutes; some steps disturbed her, and she awoke. -It was dawn, and she quitted her asylum, that she might again endeavour -to find my brother. If she had gone near the spot where his body lay, -it was without her knowledge. That she had been bewildered when -questioned by the market-woman was not surprising, since she had passed -a sleepless night and the fate of poor William was yet uncertain. -Concerning the picture she could give no account. - -"I know," continued the unhappy victim, "how heavily and fatally this -one circumstance weighs against me, but I have no power of explaining -it; and when I have expressed my utter ignorance, I am only left to -conjecture concerning the probabilities by which it might have been -placed in my pocket. But here also I am checked. I believe that I -have no enemy on earth, and none surely would have been so wicked as to -destroy me wantonly. Did the murderer place it there? I know of no -opportunity afforded him for so doing; or, if I had, why should he have -stolen the jewel, to part with it again so soon? - -"I commit my cause to the justice of my judges, yet I see no room for -hope. I beg permission to have a few witnesses examined concerning my -character, and if their testimony shall not overweigh my supposed -guilt, I must be condemned, although I would pledge my salvation on my -innocence." - -Several witnesses were called who had known her for many years, and -they spoke well of her; but fear and hatred of the crime of which they -supposed her guilty rendered them timorous and unwilling to come -forward. Elizabeth saw even this last resource, her excellent -dispositions and irreproachable conduct, about to fail the accused, -when, although violently agitated, she desired permission to address -the court. - -"I am," said she, "the cousin of the unhappy child who was murdered, or -rather his sister, for I was educated by and have lived with his -parents ever since and even long before his birth. It may therefore be -judged indecent in me to come forward on this occasion, but when I see -a fellow creature about to perish through the cowardice of her -pretended friends, I wish to be allowed to speak, that I may say what I -know of her character. I am well acquainted with the accused. I have -lived in the same house with her, at one time for five and at another -for nearly two years. During all that period she appeared to me the -most amiable and benevolent of human creatures. She nursed Madame -Frankenstein, my aunt, in her last illness, with the greatest affection -and care and afterwards attended her own mother during a tedious -illness, in a manner that excited the admiration of all who knew her, -after which she again lived in my uncle's house, where she was beloved -by all the family. She was warmly attached to the child who is now -dead and acted towards him like a most affectionate mother. For my own -part, I do not hesitate to say that, notwithstanding all the evidence -produced against her, I believe and rely on her perfect innocence. She -had no temptation for such an action; as to the bauble on which the -chief proof rests, if she had earnestly desired it, I should have -willingly given it to her, so much do I esteem and value her." - -A murmur of approbation followed Elizabeth's simple and powerful -appeal, but it was excited by her generous interference, and not in -favour of poor Justine, on whom the public indignation was turned with -renewed violence, charging her with the blackest ingratitude. She -herself wept as Elizabeth spoke, but she did not answer. My own -agitation and anguish was extreme during the whole trial. I believed -in her innocence; I knew it. Could the demon who had (I did not for a -minute doubt) murdered my brother also in his hellish sport have -betrayed the innocent to death and ignominy? I could not sustain the -horror of my situation, and when I perceived that the popular voice and -the countenances of the judges had already condemned my unhappy victim, -I rushed out of the court in agony. The tortures of the accused did -not equal mine; she was sustained by innocence, but the fangs of -remorse tore my bosom and would not forgo their hold. - -I passed a night of unmingled wretchedness. In the morning I went to -the court; my lips and throat were parched. I dared not ask the fatal -question, but I was known, and the officer guessed the cause of my -visit. The ballots had been thrown; they were all black, and Justine -was condemned. - -I cannot pretend to describe what I then felt. I had before -experienced sensations of horror, and I have endeavoured to bestow upon -them adequate expressions, but words cannot convey an idea of the -heart-sickening despair that I then endured. The person to whom I -addressed myself added that Justine had already confessed her guilt. -"That evidence," he observed, "was hardly required in so glaring a -case, but I am glad of it, and, indeed, none of our judges like to -condemn a criminal upon circumstantial evidence, be it ever so -decisive." - -This was strange and unexpected intelligence; what could it mean? Had -my eyes deceived me? And was I really as mad as the whole world would -believe me to be if I disclosed the object of my suspicions? I -hastened to return home, and Elizabeth eagerly demanded the result. - -"My cousin," replied I, "it is decided as you may have expected; all -judges had rather that ten innocent should suffer than that one guilty -should escape. But she has confessed." - -This was a dire blow to poor Elizabeth, who had relied with firmness -upon Justine's innocence. "Alas!" said she. "How shall I ever again -believe in human goodness? Justine, whom I loved and esteemed as my -sister, how could she put on those smiles of innocence only to betray? -Her mild eyes seemed incapable of any severity or guile, and yet she -has committed a murder." - -Soon after we heard that the poor victim had expressed a desire to see -my cousin. My father wished her not to go but said that he left it to -her own judgment and feelings to decide. "Yes," said Elizabeth, "I -will go, although she is guilty; and you, Victor, shall accompany me; I -cannot go alone." The idea of this visit was torture to me, yet I -could not refuse. We entered the gloomy prison chamber and beheld -Justine sitting on some straw at the farther end; her hands were -manacled, and her head rested on her knees. She rose on seeing us -enter, and when we were left alone with her, she threw herself at the -feet of Elizabeth, weeping bitterly. My cousin wept also. - -"Oh, Justine!" said she. "Why did you rob me of my last consolation? -I relied on your innocence, and although I was then very wretched, I -was not so miserable as I am now." - -"And do you also believe that I am so very, very wicked? Do you also -join with my enemies to crush me, to condemn me as a murderer?" Her -voice was suffocated with sobs. - -"Rise, my poor girl," said Elizabeth; "why do you kneel, if you are -innocent? I am not one of your enemies, I believed you guiltless, -notwithstanding every evidence, until I heard that you had yourself -declared your guilt. That report, you say, is false; and be assured, -dear Justine, that nothing can shake my confidence in you for a moment, -but your own confession." - -"I did confess, but I confessed a lie. I confessed, that I might -obtain absolution; but now that falsehood lies heavier at my heart than -all my other sins. The God of heaven forgive me! Ever since I was -condemned, my confessor has besieged me; he threatened and menaced, -until I almost began to think that I was the monster that he said I -was. He threatened excommunication and hell fire in my last moments if -I continued obdurate. Dear lady, I had none to support me; all looked -on me as a wretch doomed to ignominy and perdition. What could I do? -In an evil hour I subscribed to a lie; and now only am I truly -miserable." - -She paused, weeping, and then continued, "I thought with horror, my -sweet lady, that you should believe your Justine, whom your blessed -aunt had so highly honoured, and whom you loved, was a creature capable -of a crime which none but the devil himself could have perpetrated. -Dear William! dearest blessed child! I soon shall see you again in -heaven, where we shall all be happy; and that consoles me, going as I -am to suffer ignominy and death." - -"Oh, Justine! Forgive me for having for one moment distrusted you. -Why did you confess? But do not mourn, dear girl. Do not fear. I -will proclaim, I will prove your innocence. I will melt the stony -hearts of your enemies by my tears and prayers. You shall not die! -You, my playfellow, my companion, my sister, perish on the scaffold! -No! No! I never could survive so horrible a misfortune." - -Justine shook her head mournfully. "I do not fear to die," she said; -"that pang is past. God raises my weakness and gives me courage to -endure the worst. I leave a sad and bitter world; and if you remember -me and think of me as of one unjustly condemned, I am resigned to the -fate awaiting me. Learn from me, dear lady, to submit in patience to -the will of heaven!" - -During this conversation I had retired to a corner of the prison room, -where I could conceal the horrid anguish that possessed me. Despair! -Who dared talk of that? The poor victim, who on the morrow was to pass -the awful boundary between life and death, felt not, as I did, such -deep and bitter agony. I gnashed my teeth and ground them together, -uttering a groan that came from my inmost soul. Justine started. When -she saw who it was, she approached me and said, "Dear sir, you are very -kind to visit me; you, I hope, do not believe that I am guilty?" - -I could not answer. "No, Justine," said Elizabeth; "he is more -convinced of your innocence than I was, for even when he heard that you -had confessed, he did not credit it." - -"I truly thank him. In these last moments I feel the sincerest -gratitude towards those who think of me with kindness. How sweet is -the affection of others to such a wretch as I am! It removes more than -half my misfortune, and I feel as if I could die in peace now that my -innocence is acknowledged by you, dear lady, and your cousin." - -Thus the poor sufferer tried to comfort others and herself. She indeed -gained the resignation she desired. But I, the true murderer, felt the -never-dying worm alive in my bosom, which allowed of no hope or -consolation. Elizabeth also wept and was unhappy, but hers also was -the misery of innocence, which, like a cloud that passes over the fair -moon, for a while hides but cannot tarnish its brightness. Anguish and -despair had penetrated into the core of my heart; I bore a hell within -me which nothing could extinguish. We stayed several hours with -Justine, and it was with great difficulty that Elizabeth could tear -herself away. "I wish," cried she, "that I were to die with you; I -cannot live in this world of misery." - -Justine assumed an air of cheerfulness, while she with difficulty -repressed her bitter tears. She embraced Elizabeth and said in a voice -of half-suppressed emotion, "Farewell, sweet lady, dearest Elizabeth, -my beloved and only friend; may heaven, in its bounty, bless and -preserve you; may this be the last misfortune that you will ever -suffer! Live, and be happy, and make others so." - -And on the morrow Justine died. Elizabeth's heart-rending eloquence -failed to move the judges from their settled conviction in the -criminality of the saintly sufferer. My passionate and indignant -appeals were lost upon them. And when I received their cold answers -and heard the harsh, unfeeling reasoning of these men, my purposed -avowal died away on my lips. Thus I might proclaim myself a madman, -but not revoke the sentence passed upon my wretched victim. She -perished on the scaffold as a murderess! - -From the tortures of my own heart, I turned to contemplate the deep and -voiceless grief of my Elizabeth. This also was my doing! And my -father's woe, and the desolation of that late so smiling home all was -the work of my thrice-accursed hands! Ye weep, unhappy ones, but these -are not your last tears! Again shall you raise the funeral wail, and -the sound of your lamentations shall again and again be heard! -Frankenstein, your son, your kinsman, your early, much-loved friend; he -who would spend each vital drop of blood for your sakes, who has no -thought nor sense of joy except as it is mirrored also in your dear -countenances, who would fill the air with blessings and spend his life -in serving you--he bids you weep, to shed countless tears; happy beyond -his hopes, if thus inexorable fate be satisfied, and if the destruction -pause before the peace of the grave have succeeded to your sad torments! - -Thus spoke my prophetic soul, as, torn by remorse, horror, and despair, -I beheld those I loved spend vain sorrow upon the graves of William and -Justine, the first hapless victims to my unhallowed arts. - - - -Chapter 9 - -Nothing is more painful to the human mind than, after the feelings have -been worked up by a quick succession of events, the dead calmness of -inaction and certainty which follows and deprives the soul both of hope -and fear. Justine died, she rested, and I was alive. The blood flowed -freely in my veins, but a weight of despair and remorse pressed on my -heart which nothing could remove. Sleep fled from my eyes; I wandered -like an evil spirit, for I had committed deeds of mischief beyond -description horrible, and more, much more (I persuaded myself) was yet -behind. Yet my heart overflowed with kindness and the love of virtue. -I had begun life with benevolent intentions and thirsted for the moment -when I should put them in practice and make myself useful to my fellow -beings. Now all was blasted; instead of that serenity of conscience -which allowed me to look back upon the past with self-satisfaction, and -from thence to gather promise of new hopes, I was seized by remorse and -the sense of guilt, which hurried me away to a hell of intense tortures -such as no language can describe. - -This state of mind preyed upon my health, which had perhaps never -entirely recovered from the first shock it had sustained. I shunned -the face of man; all sound of joy or complacency was torture to me; -solitude was my only consolation--deep, dark, deathlike solitude. - -My father observed with pain the alteration perceptible in my -disposition and habits and endeavoured by arguments deduced from the -feelings of his serene conscience and guiltless life to inspire me with -fortitude and awaken in me the courage to dispel the dark cloud which -brooded over me. "Do you think, Victor," said he, "that I do not -suffer also? No one could love a child more than I loved your -brother"--tears came into his eyes as he spoke--"but is it not a duty -to the survivors that we should refrain from augmenting their -unhappiness by an appearance of immoderate grief? It is also a duty -owed to yourself, for excessive sorrow prevents improvement or -enjoyment, or even the discharge of daily usefulness, without which no -man is fit for society." - -This advice, although good, was totally inapplicable to my case; I -should have been the first to hide my grief and console my friends if -remorse had not mingled its bitterness, and terror its alarm, with my -other sensations. Now I could only answer my father with a look of -despair and endeavour to hide myself from his view. - -About this time we retired to our house at Belrive. This change was -particularly agreeable to me. The shutting of the gates regularly at -ten o'clock and the impossibility of remaining on the lake after that -hour had rendered our residence within the walls of Geneva very irksome -to me. I was now free. Often, after the rest of the family had -retired for the night, I took the boat and passed many hours upon the -water. Sometimes, with my sails set, I was carried by the wind; and -sometimes, after rowing into the middle of the lake, I left the boat to -pursue its own course and gave way to my own miserable reflections. I -was often tempted, when all was at peace around me, and I the only -unquiet thing that wandered restless in a scene so beautiful and -heavenly--if I except some bat, or the frogs, whose harsh and -interrupted croaking was heard only when I approached the shore--often, -I say, I was tempted to plunge into the silent lake, that the waters -might close over me and my calamities forever. But I was restrained, -when I thought of the heroic and suffering Elizabeth, whom I tenderly -loved, and whose existence was bound up in mine. I thought also of my -father and surviving brother; should I by my base desertion leave them -exposed and unprotected to the malice of the fiend whom I had let loose -among them? - -At these moments I wept bitterly and wished that peace would revisit my -mind only that I might afford them consolation and happiness. But that -could not be. Remorse extinguished every hope. I had been the author -of unalterable evils, and I lived in daily fear lest the monster whom I -had created should perpetrate some new wickedness. I had an obscure -feeling that all was not over and that he would still commit some -signal crime, which by its enormity should almost efface the -recollection of the past. There was always scope for fear so long as -anything I loved remained behind. My abhorrence of this fiend cannot -be conceived. When I thought of him I gnashed my teeth, my eyes became -inflamed, and I ardently wished to extinguish that life which I had so -thoughtlessly bestowed. When I reflected on his crimes and malice, my -hatred and revenge burst all bounds of moderation. I would have made a -pilgrimage to the highest peak of the Andes, could I when there have -precipitated him to their base. I wished to see him again, that I -might wreak the utmost extent of abhorrence on his head and avenge the -deaths of William and Justine. Our house was the house of mourning. My -father's health was deeply shaken by the horror of the recent events. -Elizabeth was sad and desponding; she no longer took delight in her -ordinary occupations; all pleasure seemed to her sacrilege toward the -dead; eternal woe and tears she then thought was the just tribute she -should pay to innocence so blasted and destroyed. She was no longer -that happy creature who in earlier youth wandered with me on the banks -of the lake and talked with ecstasy of our future prospects. The first -of those sorrows which are sent to wean us from the earth had visited -her, and its dimming influence quenched her dearest smiles. - -"When I reflect, my dear cousin," said she, "on the miserable death of -Justine Moritz, I no longer see the world and its works as they before -appeared to me. Before, I looked upon the accounts of vice and -injustice that I read in books or heard from others as tales of ancient -days or imaginary evils; at least they were remote and more familiar to -reason than to the imagination; but now misery has come home, and men -appear to me as monsters thirsting for each other's blood. Yet I am -certainly unjust. Everybody believed that poor girl to be guilty; and -if she could have committed the crime for which she suffered, assuredly -she would have been the most depraved of human creatures. For the sake -of a few jewels, to have murdered the son of her benefactor and friend, -a child whom she had nursed from its birth, and appeared to love as if -it had been her own! I could not consent to the death of any human -being, but certainly I should have thought such a creature unfit to -remain in the society of men. But she was innocent. I know, I feel -she was innocent; you are of the same opinion, and that confirms me. -Alas! Victor, when falsehood can look so like the truth, who can -assure themselves of certain happiness? I feel as if I were walking on -the edge of a precipice, towards which thousands are crowding and -endeavouring to plunge me into the abyss. William and Justine were -assassinated, and the murderer escapes; he walks about the world free, -and perhaps respected. But even if I were condemned to suffer on the -scaffold for the same crimes, I would not change places with such a -wretch." - -I listened to this discourse with the extremest agony. I, not in deed, -but in effect, was the true murderer. Elizabeth read my anguish in my -countenance, and kindly taking my hand, said, "My dearest friend, you -must calm yourself. These events have affected me, God knows how -deeply; but I am not so wretched as you are. There is an expression of -despair, and sometimes of revenge, in your countenance that makes me -tremble. Dear Victor, banish these dark passions. Remember the -friends around you, who centre all their hopes in you. Have we lost -the power of rendering you happy? Ah! While we love, while we are -true to each other, here in this land of peace and beauty, your native -country, we may reap every tranquil blessing--what can disturb our -peace?" - -And could not such words from her whom I fondly prized before every -other gift of fortune suffice to chase away the fiend that lurked in my -heart? Even as she spoke I drew near to her, as if in terror, lest at -that very moment the destroyer had been near to rob me of her. - -Thus not the tenderness of friendship, nor the beauty of earth, nor of -heaven, could redeem my soul from woe; the very accents of love were -ineffectual. I was encompassed by a cloud which no beneficial -influence could penetrate. The wounded deer dragging its fainting -limbs to some untrodden brake, there to gaze upon the arrow which had -pierced it, and to die, was but a type of me. - -Sometimes I could cope with the sullen despair that overwhelmed me, but -sometimes the whirlwind passions of my soul drove me to seek, by bodily -exercise and by change of place, some relief from my intolerable -sensations. It was during an access of this kind that I suddenly left -my home, and bending my steps towards the near Alpine valleys, sought -in the magnificence, the eternity of such scenes, to forget myself and -my ephemeral, because human, sorrows. My wanderings were directed -towards the valley of Chamounix. I had visited it frequently during my -boyhood. Six years had passed since then: _I_ was a wreck, but nought -had changed in those savage and enduring scenes. - -I performed the first part of my journey on horseback. I afterwards -hired a mule, as the more sure-footed and least liable to receive -injury on these rugged roads. The weather was fine; it was about the -middle of the month of August, nearly two months after the death of -Justine, that miserable epoch from which I dated all my woe. The -weight upon my spirit was sensibly lightened as I plunged yet deeper in -the ravine of Arve. The immense mountains and precipices that overhung -me on every side, the sound of the river raging among the rocks, and -the dashing of the waterfalls around spoke of a power mighty as -Omnipotence--and I ceased to fear or to bend before any being less -almighty than that which had created and ruled the elements, here -displayed in their most terrific guise. Still, as I ascended higher, -the valley assumed a more magnificent and astonishing character. -Ruined castles hanging on the precipices of piny mountains, the -impetuous Arve, and cottages every here and there peeping forth from -among the trees formed a scene of singular beauty. But it was -augmented and rendered sublime by the mighty Alps, whose white and -shining pyramids and domes towered above all, as belonging to another -earth, the habitations of another race of beings. - -I passed the bridge of Pelissier, where the ravine, which the river -forms, opened before me, and I began to ascend the mountain that -overhangs it. Soon after, I entered the valley of Chamounix. This -valley is more wonderful and sublime, but not so beautiful and -picturesque as that of Servox, through which I had just passed. The -high and snowy mountains were its immediate boundaries, but I saw no -more ruined castles and fertile fields. Immense glaciers approached -the road; I heard the rumbling thunder of the falling avalanche and -marked the smoke of its passage. Mont Blanc, the supreme and -magnificent Mont Blanc, raised itself from the surrounding aiguilles, -and its tremendous dome overlooked the valley. - -A tingling long-lost sense of pleasure often came across me during this -journey. Some turn in the road, some new object suddenly perceived and -recognized, reminded me of days gone by, and were associated with the -lighthearted gaiety of boyhood. The very winds whispered in soothing -accents, and maternal Nature bade me weep no more. Then again the -kindly influence ceased to act--I found myself fettered again to grief -and indulging in all the misery of reflection. Then I spurred on my -animal, striving so to forget the world, my fears, and more than all, -myself--or, in a more desperate fashion, I alighted and threw myself on -the grass, weighed down by horror and despair. - -At length I arrived at the village of Chamounix. Exhaustion succeeded -to the extreme fatigue both of body and of mind which I had endured. -For a short space of time I remained at the window watching the pallid -lightnings that played above Mont Blanc and listening to the rushing of -the Arve, which pursued its noisy way beneath. The same lulling sounds -acted as a lullaby to my too keen sensations; when I placed my head -upon my pillow, sleep crept over me; I felt it as it came and blessed -the giver of oblivion. - - - -Chapter 10 - -I spent the following day roaming through the valley. I stood beside -the sources of the Arveiron, which take their rise in a glacier, that -with slow pace is advancing down from the summit of the hills to -barricade the valley. The abrupt sides of vast mountains were before -me; the icy wall of the glacier overhung me; a few shattered pines were -scattered around; and the solemn silence of this glorious -presence-chamber of imperial nature was broken only by the brawling -waves or the fall of some vast fragment, the thunder sound of the -avalanche or the cracking, reverberated along the mountains, of the -accumulated ice, which, through the silent working of immutable laws, -was ever and anon rent and torn, as if it had been but a plaything in -their hands. These sublime and magnificent scenes afforded me the -greatest consolation that I was capable of receiving. They elevated me -from all littleness of feeling, and although they did not remove my -grief, they subdued and tranquillized it. In some degree, also, they -diverted my mind from the thoughts over which it had brooded for the -last month. I retired to rest at night; my slumbers, as it were, -waited on and ministered to by the assemblance of grand shapes which I -had contemplated during the day. They congregated round me; the -unstained snowy mountain-top, the glittering pinnacle, the pine woods, -and ragged bare ravine, the eagle, soaring amidst the clouds--they all -gathered round me and bade me be at peace. - -Where had they fled when the next morning I awoke? All of -soul-inspiriting fled with sleep, and dark melancholy clouded every -thought. The rain was pouring in torrents, and thick mists hid the -summits of the mountains, so that I even saw not the faces of those -mighty friends. Still I would penetrate their misty veil and seek them -in their cloudy retreats. What were rain and storm to me? My mule was -brought to the door, and I resolved to ascend to the summit of -Montanvert. I remembered the effect that the view of the tremendous -and ever-moving glacier had produced upon my mind when I first saw it. -It had then filled me with a sublime ecstasy that gave wings to the -soul and allowed it to soar from the obscure world to light and joy. -The sight of the awful and majestic in nature had indeed always the -effect of solemnizing my mind and causing me to forget the passing -cares of life. I determined to go without a guide, for I was well -acquainted with the path, and the presence of another would destroy the -solitary grandeur of the scene. - -The ascent is precipitous, but the path is cut into continual and short -windings, which enable you to surmount the perpendicularity of the -mountain. It is a scene terrifically desolate. In a thousand spots -the traces of the winter avalanche may be perceived, where trees lie -broken and strewed on the ground, some entirely destroyed, others bent, -leaning upon the jutting rocks of the mountain or transversely upon -other trees. The path, as you ascend higher, is intersected by ravines -of snow, down which stones continually roll from above; one of them is -particularly dangerous, as the slightest sound, such as even speaking -in a loud voice, produces a concussion of air sufficient to draw -destruction upon the head of the speaker. The pines are not tall or -luxuriant, but they are sombre and add an air of severity to the scene. -I looked on the valley beneath; vast mists were rising from the rivers -which ran through it and curling in thick wreaths around the opposite -mountains, whose summits were hid in the uniform clouds, while rain -poured from the dark sky and added to the melancholy impression I -received from the objects around me. Alas! Why does man boast of -sensibilities superior to those apparent in the brute; it only renders -them more necessary beings. If our impulses were confined to hunger, -thirst, and desire, we might be nearly free; but now we are moved by -every wind that blows and a chance word or scene that that word may -convey to us. - - - We rest; a dream has power to poison sleep. - We rise; one wand'ring thought pollutes the day. - We feel, conceive, or reason; laugh or weep, - Embrace fond woe, or cast our cares away; - It is the same: for, be it joy or sorrow, - The path of its departure still is free. - Man's yesterday may ne'er be like his morrow; - Nought may endure but mutability! - - -It was nearly noon when I arrived at the top of the ascent. For some -time I sat upon the rock that overlooks the sea of ice. A mist covered -both that and the surrounding mountains. Presently a breeze dissipated -the cloud, and I descended upon the glacier. The surface is very -uneven, rising like the waves of a troubled sea, descending low, and -interspersed by rifts that sink deep. The field of ice is almost a -league in width, but I spent nearly two hours in crossing it. The -opposite mountain is a bare perpendicular rock. From the side where I -now stood Montanvert was exactly opposite, at the distance of a league; -and above it rose Mont Blanc, in awful majesty. I remained in a recess -of the rock, gazing on this wonderful and stupendous scene. The sea, -or rather the vast river of ice, wound among its dependent mountains, -whose aerial summits hung over its recesses. Their icy and glittering -peaks shone in the sunlight over the clouds. My heart, which was -before sorrowful, now swelled with something like joy; I exclaimed, -"Wandering spirits, if indeed ye wander, and do not rest in your narrow -beds, allow me this faint happiness, or take me, as your companion, -away from the joys of life." - -As I said this I suddenly beheld the figure of a man, at some distance, -advancing towards me with superhuman speed. He bounded over the -crevices in the ice, among which I had walked with caution; his -stature, also, as he approached, seemed to exceed that of man. I was -troubled; a mist came over my eyes, and I felt a faintness seize me, -but I was quickly restored by the cold gale of the mountains. I -perceived, as the shape came nearer (sight tremendous and abhorred!) -that it was the wretch whom I had created. I trembled with rage and -horror, resolving to wait his approach and then close with him in -mortal combat. He approached; his countenance bespoke bitter anguish, -combined with disdain and malignity, while its unearthly ugliness -rendered it almost too horrible for human eyes. But I scarcely -observed this; rage and hatred had at first deprived me of utterance, -and I recovered only to overwhelm him with words expressive of furious -detestation and contempt. - -"Devil," I exclaimed, "do you dare approach me? And do not you fear -the fierce vengeance of my arm wreaked on your miserable head? Begone, -vile insect! Or rather, stay, that I may trample you to dust! And, -oh! That I could, with the extinction of your miserable existence, -restore those victims whom you have so diabolically murdered!" - -"I expected this reception," said the daemon. "All men hate the -wretched; how, then, must I be hated, who am miserable beyond all -living things! Yet you, my creator, detest and spurn me, thy creature, -to whom thou art bound by ties only dissoluble by the annihilation of -one of us. You purpose to kill me. How dare you sport thus with life? -Do your duty towards me, and I will do mine towards you and the rest of -mankind. If you will comply with my conditions, I will leave them and -you at peace; but if you refuse, I will glut the maw of death, until it -be satiated with the blood of your remaining friends." - -"Abhorred monster! Fiend that thou art! The tortures of hell are too -mild a vengeance for thy crimes. Wretched devil! You reproach me with -your creation, come on, then, that I may extinguish the spark which I -so negligently bestowed." - -My rage was without bounds; I sprang on him, impelled by all the -feelings which can arm one being against the existence of another. - -He easily eluded me and said, - -"Be calm! I entreat you to hear me before you give vent to your hatred -on my devoted head. Have I not suffered enough, that you seek to -increase my misery? Life, although it may only be an accumulation of -anguish, is dear to me, and I will defend it. Remember, thou hast made -me more powerful than thyself; my height is superior to thine, my -joints more supple. But I will not be tempted to set myself in -opposition to thee. I am thy creature, and I will be even mild and -docile to my natural lord and king if thou wilt also perform thy part, -the which thou owest me. Oh, Frankenstein, be not equitable to every -other and trample upon me alone, to whom thy justice, and even thy -clemency and affection, is most due. Remember that I am thy creature; -I ought to be thy Adam, but I am rather the fallen angel, whom thou -drivest from joy for no misdeed. Everywhere I see bliss, from which I -alone am irrevocably excluded. I was benevolent and good; misery made -me a fiend. Make me happy, and I shall again be virtuous." - -"Begone! I will not hear you. There can be no community between you -and me; we are enemies. Begone, or let us try our strength in a fight, -in which one must fall." - -"How can I move thee? Will no entreaties cause thee to turn a -favourable eye upon thy creature, who implores thy goodness and -compassion? Believe me, Frankenstein, I was benevolent; my soul glowed -with love and humanity; but am I not alone, miserably alone? You, my -creator, abhor me; what hope can I gather from your fellow creatures, -who owe me nothing? They spurn and hate me. The desert mountains and -dreary glaciers are my refuge. I have wandered here many days; the -caves of ice, which I only do not fear, are a dwelling to me, and the -only one which man does not grudge. These bleak skies I hail, for they -are kinder to me than your fellow beings. If the multitude of mankind -knew of my existence, they would do as you do, and arm themselves for -my destruction. Shall I not then hate them who abhor me? I will keep -no terms with my enemies. I am miserable, and they shall share my -wretchedness. Yet it is in your power to recompense me, and deliver -them from an evil which it only remains for you to make so great, that -not only you and your family, but thousands of others, shall be -swallowed up in the whirlwinds of its rage. Let your compassion be -moved, and do not disdain me. Listen to my tale; when you have heard -that, abandon or commiserate me, as you shall judge that I deserve. -But hear me. The guilty are allowed, by human laws, bloody as they -are, to speak in their own defence before they are condemned. Listen -to me, Frankenstein. You accuse me of murder, and yet you would, with -a satisfied conscience, destroy your own creature. Oh, praise the -eternal justice of man! Yet I ask you not to spare me; listen to me, -and then, if you can, and if you will, destroy the work of your hands." - -"Why do you call to my remembrance," I rejoined, "circumstances of -which I shudder to reflect, that I have been the miserable origin and -author? Cursed be the day, abhorred devil, in which you first saw -light! Cursed (although I curse myself) be the hands that formed you! -You have made me wretched beyond expression. You have left me no power -to consider whether I am just to you or not. Begone! Relieve me from -the sight of your detested form." - -"Thus I relieve thee, my creator," he said, and placed his hated hands -before my eyes, which I flung from me with violence; "thus I take from -thee a sight which you abhor. Still thou canst listen to me and grant -me thy compassion. By the virtues that I once possessed, I demand this -from you. Hear my tale; it is long and strange, and the temperature of -this place is not fitting to your fine sensations; come to the hut upon -the mountain. The sun is yet high in the heavens; before it descends -to hide itself behind your snowy precipices and illuminate another -world, you will have heard my story and can decide. On you it rests, -whether I quit forever the neighbourhood of man and lead a harmless -life, or become the scourge of your fellow creatures and the author of -your own speedy ruin." - -As he said this he led the way across the ice; I followed. My heart -was full, and I did not answer him, but as I proceeded, I weighed the -various arguments that he had used and determined at least to listen to -his tale. I was partly urged by curiosity, and compassion confirmed my -resolution. I had hitherto supposed him to be the murderer of my -brother, and I eagerly sought a confirmation or denial of this opinion. -For the first time, also, I felt what the duties of a creator towards -his creature were, and that I ought to render him happy before I -complained of his wickedness. These motives urged me to comply with -his demand. We crossed the ice, therefore, and ascended the opposite -rock. The air was cold, and the rain again began to descend; we -entered the hut, the fiend with an air of exultation, I with a heavy -heart and depressed spirits. But I consented to listen, and seating -myself by the fire which my odious companion had lighted, he thus began -his tale. - - - -Chapter 11 - -"It is with considerable difficulty that I remember the original era of -my being; all the events of that period appear confused and indistinct. -A strange multiplicity of sensations seized me, and I saw, felt, heard, -and smelt at the same time; and it was, indeed, a long time before I -learned to distinguish between the operations of my various senses. By -degrees, I remember, a stronger light pressed upon my nerves, so that I -was obliged to shut my eyes. Darkness then came over me and troubled -me, but hardly had I felt this when, by opening my eyes, as I now -suppose, the light poured in upon me again. I walked and, I believe, -descended, but I presently found a great alteration in my sensations. -Before, dark and opaque bodies had surrounded me, impervious to my -touch or sight; but I now found that I could wander on at liberty, with -no obstacles which I could not either surmount or avoid. The light -became more and more oppressive to me, and the heat wearying me as I -walked, I sought a place where I could receive shade. This was the -forest near Ingolstadt; and here I lay by the side of a brook resting -from my fatigue, until I felt tormented by hunger and thirst. This -roused me from my nearly dormant state, and I ate some berries which I -found hanging on the trees or lying on the ground. I slaked my thirst -at the brook, and then lying down, was overcome by sleep. - -"It was dark when I awoke; I felt cold also, and half frightened, as it -were, instinctively, finding myself so desolate. Before I had quitted -your apartment, on a sensation of cold, I had covered myself with some -clothes, but these were insufficient to secure me from the dews of -night. I was a poor, helpless, miserable wretch; I knew, and could -distinguish, nothing; but feeling pain invade me on all sides, I sat -down and wept. - -"Soon a gentle light stole over the heavens and gave me a sensation of -pleasure. I started up and beheld a radiant form rise from among the -trees. [The moon] I gazed with a kind of wonder. It moved slowly, -but it enlightened my path, and I again went out in search of berries. -I was still cold when under one of the trees I found a huge cloak, with -which I covered myself, and sat down upon the ground. No distinct -ideas occupied my mind; all was confused. I felt light, and hunger, -and thirst, and darkness; innumerable sounds rang in my ears, and on -all sides various scents saluted me; the only object that I could -distinguish was the bright moon, and I fixed my eyes on that with -pleasure. - -"Several changes of day and night passed, and the orb of night had -greatly lessened, when I began to distinguish my sensations from each -other. I gradually saw plainly the clear stream that supplied me with -drink and the trees that shaded me with their foliage. I was delighted -when I first discovered that a pleasant sound, which often saluted my -ears, proceeded from the throats of the little winged animals who had -often intercepted the light from my eyes. I began also to observe, -with greater accuracy, the forms that surrounded me and to perceive the -boundaries of the radiant roof of light which canopied me. Sometimes I -tried to imitate the pleasant songs of the birds but was unable. -Sometimes I wished to express my sensations in my own mode, but the -uncouth and inarticulate sounds which broke from me frightened me into -silence again. - -"The moon had disappeared from the night, and again, with a lessened -form, showed itself, while I still remained in the forest. My -sensations had by this time become distinct, and my mind received every -day additional ideas. My eyes became accustomed to the light and to -perceive objects in their right forms; I distinguished the insect from -the herb, and by degrees, one herb from another. I found that the -sparrow uttered none but harsh notes, whilst those of the blackbird and -thrush were sweet and enticing. - -"One day, when I was oppressed by cold, I found a fire which had been -left by some wandering beggars, and was overcome with delight at the -warmth I experienced from it. In my joy I thrust my hand into the live -embers, but quickly drew it out again with a cry of pain. How strange, -I thought, that the same cause should produce such opposite effects! I -examined the materials of the fire, and to my joy found it to be -composed of wood. I quickly collected some branches, but they were wet -and would not burn. I was pained at this and sat still watching the -operation of the fire. The wet wood which I had placed near the heat -dried and itself became inflamed. I reflected on this, and by touching -the various branches, I discovered the cause and busied myself in -collecting a great quantity of wood, that I might dry it and have a -plentiful supply of fire. When night came on and brought sleep with -it, I was in the greatest fear lest my fire should be extinguished. I -covered it carefully with dry wood and leaves and placed wet branches -upon it; and then, spreading my cloak, I lay on the ground and sank -into sleep. - -"It was morning when I awoke, and my first care was to visit the fire. -I uncovered it, and a gentle breeze quickly fanned it into a flame. I -observed this also and contrived a fan of branches, which roused the -embers when they were nearly extinguished. When night came again I -found, with pleasure, that the fire gave light as well as heat and that -the discovery of this element was useful to me in my food, for I found -some of the offals that the travellers had left had been roasted, and -tasted much more savoury than the berries I gathered from the trees. I -tried, therefore, to dress my food in the same manner, placing it on -the live embers. I found that the berries were spoiled by this -operation, and the nuts and roots much improved. - -"Food, however, became scarce, and I often spent the whole day -searching in vain for a few acorns to assuage the pangs of hunger. When -I found this, I resolved to quit the place that I had hitherto -inhabited, to seek for one where the few wants I experienced would be -more easily satisfied. In this emigration I exceedingly lamented the -loss of the fire which I had obtained through accident and knew not how -to reproduce it. I gave several hours to the serious consideration of -this difficulty, but I was obliged to relinquish all attempt to supply -it, and wrapping myself up in my cloak, I struck across the wood -towards the setting sun. I passed three days in these rambles and at -length discovered the open country. A great fall of snow had taken -place the night before, and the fields were of one uniform white; the -appearance was disconsolate, and I found my feet chilled by the cold -damp substance that covered the ground. - -"It was about seven in the morning, and I longed to obtain food and -shelter; at length I perceived a small hut, on a rising ground, which -had doubtless been built for the convenience of some shepherd. This -was a new sight to me, and I examined the structure with great -curiosity. Finding the door open, I entered. An old man sat in it, -near a fire, over which he was preparing his breakfast. He turned on -hearing a noise, and perceiving me, shrieked loudly, and quitting the -hut, ran across the fields with a speed of which his debilitated form -hardly appeared capable. His appearance, different from any I had ever -before seen, and his flight somewhat surprised me. But I was enchanted -by the appearance of the hut; here the snow and rain could not -penetrate; the ground was dry; and it presented to me then as exquisite -and divine a retreat as Pandemonium appeared to the demons of hell -after their sufferings in the lake of fire. I greedily devoured the -remnants of the shepherd's breakfast, which consisted of bread, cheese, -milk, and wine; the latter, however, I did not like. Then, overcome by -fatigue, I lay down among some straw and fell asleep. - -"It was noon when I awoke, and allured by the warmth of the sun, which -shone brightly on the white ground, I determined to recommence my -travels; and, depositing the remains of the peasant's breakfast in a -wallet I found, I proceeded across the fields for several hours, until -at sunset I arrived at a village. How miraculous did this appear! The -huts, the neater cottages, and stately houses engaged my admiration by -turns. The vegetables in the gardens, the milk and cheese that I saw -placed at the windows of some of the cottages, allured my appetite. One -of the best of these I entered, but I had hardly placed my foot within -the door before the children shrieked, and one of the women fainted. -The whole village was roused; some fled, some attacked me, until, -grievously bruised by stones and many other kinds of missile weapons, I -escaped to the open country and fearfully took refuge in a low hovel, -quite bare, and making a wretched appearance after the palaces I had -beheld in the village. This hovel however, joined a cottage of a neat -and pleasant appearance, but after my late dearly bought experience, I -dared not enter it. My place of refuge was constructed of wood, but so -low that I could with difficulty sit upright in it. No wood, however, -was placed on the earth, which formed the floor, but it was dry; and -although the wind entered it by innumerable chinks, I found it an -agreeable asylum from the snow and rain. - -"Here, then, I retreated and lay down happy to have found a shelter, -however miserable, from the inclemency of the season, and still more -from the barbarity of man. As soon as morning dawned I crept from my -kennel, that I might view the adjacent cottage and discover if I could -remain in the habitation I had found. It was situated against the back -of the cottage and surrounded on the sides which were exposed by a pig -sty and a clear pool of water. One part was open, and by that I had -crept in; but now I covered every crevice by which I might be perceived -with stones and wood, yet in such a manner that I might move them on -occasion to pass out; all the light I enjoyed came through the sty, and -that was sufficient for me. - -"Having thus arranged my dwelling and carpeted it with clean straw, I -retired, for I saw the figure of a man at a distance, and I remembered -too well my treatment the night before to trust myself in his power. I -had first, however, provided for my sustenance for that day by a loaf -of coarse bread, which I purloined, and a cup with which I could drink -more conveniently than from my hand of the pure water which flowed by -my retreat. The floor was a little raised, so that it was kept -perfectly dry, and by its vicinity to the chimney of the cottage it was -tolerably warm. - -"Being thus provided, I resolved to reside in this hovel until -something should occur which might alter my determination. It was -indeed a paradise compared to the bleak forest, my former residence, -the rain-dropping branches, and dank earth. I ate my breakfast with -pleasure and was about to remove a plank to procure myself a little -water when I heard a step, and looking through a small chink, I beheld -a young creature, with a pail on her head, passing before my hovel. The -girl was young and of gentle demeanour, unlike what I have since found -cottagers and farmhouse servants to be. Yet she was meanly dressed, a -coarse blue petticoat and a linen jacket being her only garb; her fair -hair was plaited but not adorned: she looked patient yet sad. I lost -sight of her, and in about a quarter of an hour she returned bearing -the pail, which was now partly filled with milk. As she walked along, -seemingly incommoded by the burden, a young man met her, whose -countenance expressed a deeper despondence. Uttering a few sounds with -an air of melancholy, he took the pail from her head and bore it to the -cottage himself. She followed, and they disappeared. Presently I saw -the young man again, with some tools in his hand, cross the field -behind the cottage; and the girl was also busied, sometimes in the -house and sometimes in the yard. - -"On examining my dwelling, I found that one of the windows of the -cottage had formerly occupied a part of it, but the panes had been -filled up with wood. In one of these was a small and almost -imperceptible chink through which the eye could just penetrate. -Through this crevice a small room was visible, whitewashed and clean -but very bare of furniture. In one corner, near a small fire, sat an -old man, leaning his head on his hands in a disconsolate attitude. The -young girl was occupied in arranging the cottage; but presently she -took something out of a drawer, which employed her hands, and she sat -down beside the old man, who, taking up an instrument, began to play -and to produce sounds sweeter than the voice of the thrush or the -nightingale. It was a lovely sight, even to me, poor wretch who had -never beheld aught beautiful before. The silver hair and benevolent -countenance of the aged cottager won my reverence, while the gentle -manners of the girl enticed my love. He played a sweet mournful air -which I perceived drew tears from the eyes of his amiable companion, of -which the old man took no notice, until she sobbed audibly; he then -pronounced a few sounds, and the fair creature, leaving her work, knelt -at his feet. He raised her and smiled with such kindness and affection -that I felt sensations of a peculiar and overpowering nature; they were -a mixture of pain and pleasure, such as I had never before experienced, -either from hunger or cold, warmth or food; and I withdrew from the -window, unable to bear these emotions. - -"Soon after this the young man returned, bearing on his shoulders a -load of wood. The girl met him at the door, helped to relieve him of -his burden, and taking some of the fuel into the cottage, placed it on -the fire; then she and the youth went apart into a nook of the cottage, -and he showed her a large loaf and a piece of cheese. She seemed -pleased and went into the garden for some roots and plants, which she -placed in water, and then upon the fire. She afterwards continued her -work, whilst the young man went into the garden and appeared busily -employed in digging and pulling up roots. After he had been employed -thus about an hour, the young woman joined him and they entered the -cottage together. - -"The old man had, in the meantime, been pensive, but on the appearance -of his companions he assumed a more cheerful air, and they sat down to -eat. The meal was quickly dispatched. The young woman was again -occupied in arranging the cottage, the old man walked before the -cottage in the sun for a few minutes, leaning on the arm of the youth. -Nothing could exceed in beauty the contrast between these two excellent -creatures. One was old, with silver hairs and a countenance beaming -with benevolence and love; the younger was slight and graceful in his -figure, and his features were moulded with the finest symmetry, yet his -eyes and attitude expressed the utmost sadness and despondency. The -old man returned to the cottage, and the youth, with tools different -from those he had used in the morning, directed his steps across the -fields. - -"Night quickly shut in, but to my extreme wonder, I found that the -cottagers had a means of prolonging light by the use of tapers, and was -delighted to find that the setting of the sun did not put an end to the -pleasure I experienced in watching my human neighbours. In the evening -the young girl and her companion were employed in various occupations -which I did not understand; and the old man again took up the -instrument which produced the divine sounds that had enchanted me in -the morning. So soon as he had finished, the youth began, not to play, -but to utter sounds that were monotonous, and neither resembling the -harmony of the old man's instrument nor the songs of the birds; I since -found that he read aloud, but at that time I knew nothing of the -science of words or letters. - -"The family, after having been thus occupied for a short time, -extinguished their lights and retired, as I conjectured, to rest." - - - -Chapter 12 - -"I lay on my straw, but I could not sleep. I thought of the -occurrences of the day. What chiefly struck me was the gentle manners -of these people, and I longed to join them, but dared not. I -remembered too well the treatment I had suffered the night before from -the barbarous villagers, and resolved, whatever course of conduct I -might hereafter think it right to pursue, that for the present I would -remain quietly in my hovel, watching and endeavouring to discover the -motives which influenced their actions. - -"The cottagers arose the next morning before the sun. The young woman -arranged the cottage and prepared the food, and the youth departed -after the first meal. - -"This day was passed in the same routine as that which preceded it. -The young man was constantly employed out of doors, and the girl in -various laborious occupations within. The old man, whom I soon -perceived to be blind, employed his leisure hours on his instrument or -in contemplation. Nothing could exceed the love and respect which the -younger cottagers exhibited towards their venerable companion. They -performed towards him every little office of affection and duty with -gentleness, and he rewarded them by his benevolent smiles. - -"They were not entirely happy. The young man and his companion often -went apart and appeared to weep. I saw no cause for their unhappiness, -but I was deeply affected by it. If such lovely creatures were -miserable, it was less strange that I, an imperfect and solitary being, -should be wretched. Yet why were these gentle beings unhappy? They -possessed a delightful house (for such it was in my eyes) and every -luxury; they had a fire to warm them when chill and delicious viands -when hungry; they were dressed in excellent clothes; and, still more, -they enjoyed one another's company and speech, interchanging each day -looks of affection and kindness. What did their tears imply? Did they -really express pain? I was at first unable to solve these questions, -but perpetual attention and time explained to me many appearances which -were at first enigmatic. - -"A considerable period elapsed before I discovered one of the causes of -the uneasiness of this amiable family: it was poverty, and they -suffered that evil in a very distressing degree. Their nourishment -consisted entirely of the vegetables of their garden and the milk of -one cow, which gave very little during the winter, when its masters -could scarcely procure food to support it. They often, I believe, -suffered the pangs of hunger very poignantly, especially the two -younger cottagers, for several times they placed food before the old -man when they reserved none for themselves. - -"This trait of kindness moved me sensibly. I had been accustomed, -during the night, to steal a part of their store for my own -consumption, but when I found that in doing this I inflicted pain on -the cottagers, I abstained and satisfied myself with berries, nuts, and -roots which I gathered from a neighbouring wood. - -"I discovered also another means through which I was enabled to assist -their labours. I found that the youth spent a great part of each day -in collecting wood for the family fire, and during the night I often -took his tools, the use of which I quickly discovered, and brought home -firing sufficient for the consumption of several days. - -"I remember, the first time that I did this, the young woman, when she -opened the door in the morning, appeared greatly astonished on seeing a -great pile of wood on the outside. She uttered some words in a loud -voice, and the youth joined her, who also expressed surprise. I -observed, with pleasure, that he did not go to the forest that day, but -spent it in repairing the cottage and cultivating the garden. - -"By degrees I made a discovery of still greater moment. I found that -these people possessed a method of communicating their experience and -feelings to one another by articulate sounds. I perceived that the -words they spoke sometimes produced pleasure or pain, smiles or -sadness, in the minds and countenances of the hearers. This was indeed -a godlike science, and I ardently desired to become acquainted with it. -But I was baffled in every attempt I made for this purpose. Their -pronunciation was quick, and the words they uttered, not having any -apparent connection with visible objects, I was unable to discover any -clue by which I could unravel the mystery of their reference. By great -application, however, and after having remained during the space of -several revolutions of the moon in my hovel, I discovered the names -that were given to some of the most familiar objects of discourse; I -learned and applied the words, 'fire,' 'milk,' 'bread,' and 'wood.' I -learned also the names of the cottagers themselves. The youth and his -companion had each of them several names, but the old man had only one, -which was 'father.' The girl was called 'sister' or 'Agatha,' and the -youth 'Felix,' 'brother,' or 'son.' I cannot describe the delight I -felt when I learned the ideas appropriated to each of these sounds and -was able to pronounce them. I distinguished several other words -without being able as yet to understand or apply them, such as 'good,' -'dearest,' 'unhappy.' - -"I spent the winter in this manner. The gentle manners and beauty of -the cottagers greatly endeared them to me; when they were unhappy, I -felt depressed; when they rejoiced, I sympathized in their joys. I saw -few human beings besides them, and if any other happened to enter the -cottage, their harsh manners and rude gait only enhanced to me the -superior accomplishments of my friends. The old man, I could perceive, -often endeavoured to encourage his children, as sometimes I found that -he called them, to cast off their melancholy. He would talk in a -cheerful accent, with an expression of goodness that bestowed pleasure -even upon me. Agatha listened with respect, her eyes sometimes filled -with tears, which she endeavoured to wipe away unperceived; but I -generally found that her countenance and tone were more cheerful after -having listened to the exhortations of her father. It was not thus -with Felix. He was always the saddest of the group, and even to my -unpractised senses, he appeared to have suffered more deeply than his -friends. But if his countenance was more sorrowful, his voice was more -cheerful than that of his sister, especially when he addressed the old -man. - -"I could mention innumerable instances which, although slight, marked -the dispositions of these amiable cottagers. In the midst of poverty -and want, Felix carried with pleasure to his sister the first little -white flower that peeped out from beneath the snowy ground. Early in -the morning, before she had risen, he cleared away the snow that -obstructed her path to the milk-house, drew water from the well, and -brought the wood from the outhouse, where, to his perpetual -astonishment, he found his store always replenished by an invisible -hand. In the day, I believe, he worked sometimes for a neighbouring -farmer, because he often went forth and did not return until dinner, -yet brought no wood with him. At other times he worked in the garden, -but as there was little to do in the frosty season, he read to the old -man and Agatha. - -"This reading had puzzled me extremely at first, but by degrees I -discovered that he uttered many of the same sounds when he read as when -he talked. I conjectured, therefore, that he found on the paper signs -for speech which he understood, and I ardently longed to comprehend -these also; but how was that possible when I did not even understand -the sounds for which they stood as signs? I improved, however, -sensibly in this science, but not sufficiently to follow up any kind of -conversation, although I applied my whole mind to the endeavour, for I -easily perceived that, although I eagerly longed to discover myself to -the cottagers, I ought not to make the attempt until I had first become -master of their language, which knowledge might enable me to make them -overlook the deformity of my figure, for with this also the contrast -perpetually presented to my eyes had made me acquainted. - -"I had admired the perfect forms of my cottagers--their grace, beauty, -and delicate complexions; but how was I terrified when I viewed myself -in a transparent pool! At first I started back, unable to believe that -it was indeed I who was reflected in the mirror; and when I became -fully convinced that I was in reality the monster that I am, I was -filled with the bitterest sensations of despondence and mortification. -Alas! I did not yet entirely know the fatal effects of this miserable -deformity. - -"As the sun became warmer and the light of day longer, the snow -vanished, and I beheld the bare trees and the black earth. From this -time Felix was more employed, and the heart-moving indications of -impending famine disappeared. Their food, as I afterwards found, was -coarse, but it was wholesome; and they procured a sufficiency of it. -Several new kinds of plants sprang up in the garden, which they -dressed; and these signs of comfort increased daily as the season -advanced. - -"The old man, leaning on his son, walked each day at noon, when it did -not rain, as I found it was called when the heavens poured forth its -waters. This frequently took place, but a high wind quickly dried the -earth, and the season became far more pleasant than it had been. - -"My mode of life in my hovel was uniform. During the morning I -attended the motions of the cottagers, and when they were dispersed in -various occupations, I slept; the remainder of the day was spent in -observing my friends. When they had retired to rest, if there was any -moon or the night was star-light, I went into the woods and collected -my own food and fuel for the cottage. When I returned, as often as it -was necessary, I cleared their path from the snow and performed those -offices that I had seen done by Felix. I afterwards found that these -labours, performed by an invisible hand, greatly astonished them; and -once or twice I heard them, on these occasions, utter the words 'good -spirit,' 'wonderful'; but I did not then understand the signification -of these terms. - -"My thoughts now became more active, and I longed to discover the -motives and feelings of these lovely creatures; I was inquisitive to -know why Felix appeared so miserable and Agatha so sad. I thought -(foolish wretch!) that it might be in my power to restore happiness to -these deserving people. When I slept or was absent, the forms of the -venerable blind father, the gentle Agatha, and the excellent Felix -flitted before me. I looked upon them as superior beings who would be -the arbiters of my future destiny. I formed in my imagination a -thousand pictures of presenting myself to them, and their reception of -me. I imagined that they would be disgusted, until, by my gentle -demeanour and conciliating words, I should first win their favour and -afterwards their love. - -"These thoughts exhilarated me and led me to apply with fresh ardour to -the acquiring the art of language. My organs were indeed harsh, but -supple; and although my voice was very unlike the soft music of their -tones, yet I pronounced such words as I understood with tolerable ease. -It was as the ass and the lap-dog; yet surely the gentle ass whose -intentions were affectionate, although his manners were rude, deserved -better treatment than blows and execration. - -"The pleasant showers and genial warmth of spring greatly altered the -aspect of the earth. Men who before this change seemed to have been -hid in caves dispersed themselves and were employed in various arts of -cultivation. The birds sang in more cheerful notes, and the leaves -began to bud forth on the trees. Happy, happy earth! Fit habitation -for gods, which, so short a time before, was bleak, damp, and -unwholesome. My spirits were elevated by the enchanting appearance of -nature; the past was blotted from my memory, the present was tranquil, -and the future gilded by bright rays of hope and anticipations of joy." - - - -Chapter 13 - -"I now hasten to the more moving part of my story. I shall relate -events that impressed me with feelings which, from what I had been, -have made me what I am. - -"Spring advanced rapidly; the weather became fine and the skies -cloudless. It surprised me that what before was desert and gloomy -should now bloom with the most beautiful flowers and verdure. My -senses were gratified and refreshed by a thousand scents of delight and -a thousand sights of beauty. - -"It was on one of these days, when my cottagers periodically rested -from labour--the old man played on his guitar, and the children -listened to him--that I observed the countenance of Felix was -melancholy beyond expression; he sighed frequently, and once his father -paused in his music, and I conjectured by his manner that he inquired -the cause of his son's sorrow. Felix replied in a cheerful accent, and -the old man was recommencing his music when someone tapped at the door. - -"It was a lady on horseback, accompanied by a country-man as a guide. -The lady was dressed in a dark suit and covered with a thick black -veil. Agatha asked a question, to which the stranger only replied by -pronouncing, in a sweet accent, the name of Felix. Her voice was -musical but unlike that of either of my friends. On hearing this word, -Felix came up hastily to the lady, who, when she saw him, threw up her -veil, and I beheld a countenance of angelic beauty and expression. Her -hair of a shining raven black, and curiously braided; her eyes were -dark, but gentle, although animated; her features of a regular -proportion, and her complexion wondrously fair, each cheek tinged with -a lovely pink. - -"Felix seemed ravished with delight when he saw her, every trait of -sorrow vanished from his face, and it instantly expressed a degree of -ecstatic joy, of which I could hardly have believed it capable; his -eyes sparkled, as his cheek flushed with pleasure; and at that moment I -thought him as beautiful as the stranger. She appeared affected by -different feelings; wiping a few tears from her lovely eyes, she held -out her hand to Felix, who kissed it rapturously and called her, as -well as I could distinguish, his sweet Arabian. She did not appear to -understand him, but smiled. He assisted her to dismount, and -dismissing her guide, conducted her into the cottage. Some -conversation took place between him and his father, and the young -stranger knelt at the old man's feet and would have kissed his hand, -but he raised her and embraced her affectionately. - -"I soon perceived that although the stranger uttered articulate sounds -and appeared to have a language of her own, she was neither understood -by nor herself understood the cottagers. They made many signs which I -did not comprehend, but I saw that her presence diffused gladness -through the cottage, dispelling their sorrow as the sun dissipates the -morning mists. Felix seemed peculiarly happy and with smiles of -delight welcomed his Arabian. Agatha, the ever-gentle Agatha, kissed -the hands of the lovely stranger, and pointing to her brother, made -signs which appeared to me to mean that he had been sorrowful until she -came. Some hours passed thus, while they, by their countenances, -expressed joy, the cause of which I did not comprehend. Presently I -found, by the frequent recurrence of some sound which the stranger -repeated after them, that she was endeavouring to learn their language; -and the idea instantly occurred to me that I should make use of the -same instructions to the same end. The stranger learned about twenty -words at the first lesson; most of them, indeed, were those which I had -before understood, but I profited by the others. - -"As night came on, Agatha and the Arabian retired early. When they -separated Felix kissed the hand of the stranger and said, 'Good night -sweet Safie.' He sat up much longer, conversing with his father, and -by the frequent repetition of her name I conjectured that their lovely -guest was the subject of their conversation. I ardently desired to -understand them, and bent every faculty towards that purpose, but found -it utterly impossible. - -"The next morning Felix went out to his work, and after the usual -occupations of Agatha were finished, the Arabian sat at the feet of the -old man, and taking his guitar, played some airs so entrancingly -beautiful that they at once drew tears of sorrow and delight from my -eyes. She sang, and her voice flowed in a rich cadence, swelling or -dying away like a nightingale of the woods. - -"When she had finished, she gave the guitar to Agatha, who at first -declined it. She played a simple air, and her voice accompanied it in -sweet accents, but unlike the wondrous strain of the stranger. The old -man appeared enraptured and said some words which Agatha endeavoured to -explain to Safie, and by which he appeared to wish to express that she -bestowed on him the greatest delight by her music. - -"The days now passed as peaceably as before, with the sole alteration -that joy had taken place of sadness in the countenances of my friends. -Safie was always gay and happy; she and I improved rapidly in the -knowledge of language, so that in two months I began to comprehend most -of the words uttered by my protectors. - -"In the meanwhile also the black ground was covered with herbage, and -the green banks interspersed with innumerable flowers, sweet to the -scent and the eyes, stars of pale radiance among the moonlight woods; -the sun became warmer, the nights clear and balmy; and my nocturnal -rambles were an extreme pleasure to me, although they were considerably -shortened by the late setting and early rising of the sun, for I never -ventured abroad during daylight, fearful of meeting with the same -treatment I had formerly endured in the first village which I entered. - -"My days were spent in close attention, that I might more speedily -master the language; and I may boast that I improved more rapidly than -the Arabian, who understood very little and conversed in broken -accents, whilst I comprehended and could imitate almost every word that -was spoken. - -"While I improved in speech, I also learned the science of letters as -it was taught to the stranger, and this opened before me a wide field -for wonder and delight. - -"The book from which Felix instructed Safie was Volney's Ruins of -Empires. I should not have understood the purport of this book had not -Felix, in reading it, given very minute explanations. He had chosen -this work, he said, because the declamatory style was framed in -imitation of the Eastern authors. Through this work I obtained a -cursory knowledge of history and a view of the several empires at -present existing in the world; it gave me an insight into the manners, -governments, and religions of the different nations of the earth. I -heard of the slothful Asiatics, of the stupendous genius and mental -activity of the Grecians, of the wars and wonderful virtue of the early -Romans--of their subsequent degenerating--of the decline of that mighty -empire, of chivalry, Christianity, and kings. I heard of the discovery -of the American hemisphere and wept with Safie over the hapless fate of -its original inhabitants. - -"These wonderful narrations inspired me with strange feelings. Was -man, indeed, at once so powerful, so virtuous and magnificent, yet so -vicious and base? He appeared at one time a mere scion of the evil -principle and at another as all that can be conceived of noble and -godlike. To be a great and virtuous man appeared the highest honour -that can befall a sensitive being; to be base and vicious, as many on -record have been, appeared the lowest degradation, a condition more -abject than that of the blind mole or harmless worm. For a long time I -could not conceive how one man could go forth to murder his fellow, or -even why there were laws and governments; but when I heard details of -vice and bloodshed, my wonder ceased and I turned away with disgust and -loathing. - -"Every conversation of the cottagers now opened new wonders to me. -While I listened to the instructions which Felix bestowed upon the -Arabian, the strange system of human society was explained to me. I -heard of the division of property, of immense wealth and squalid -poverty, of rank, descent, and noble blood. - -"The words induced me to turn towards myself. I learned that the -possessions most esteemed by your fellow creatures were high and -unsullied descent united with riches. A man might be respected with -only one of these advantages, but without either he was considered, -except in very rare instances, as a vagabond and a slave, doomed to -waste his powers for the profits of the chosen few! And what was I? Of -my creation and creator I was absolutely ignorant, but I knew that I -possessed no money, no friends, no kind of property. I was, besides, -endued with a figure hideously deformed and loathsome; I was not even -of the same nature as man. I was more agile than they and could -subsist upon coarser diet; I bore the extremes of heat and cold with -less injury to my frame; my stature far exceeded theirs. When I looked -around I saw and heard of none like me. Was I, then, a monster, a blot -upon the earth, from which all men fled and whom all men disowned? - -"I cannot describe to you the agony that these reflections inflicted -upon me; I tried to dispel them, but sorrow only increased with -knowledge. Oh, that I had forever remained in my native wood, nor -known nor felt beyond the sensations of hunger, thirst, and heat! - -"Of what a strange nature is knowledge! It clings to the mind when it -has once seized on it like a lichen on the rock. I wished sometimes to -shake off all thought and feeling, but I learned that there was but one -means to overcome the sensation of pain, and that was death--a state -which I feared yet did not understand. I admired virtue and good -feelings and loved the gentle manners and amiable qualities of my -cottagers, but I was shut out from intercourse with them, except -through means which I obtained by stealth, when I was unseen and -unknown, and which rather increased than satisfied the desire I had of -becoming one among my fellows. The gentle words of Agatha and the -animated smiles of the charming Arabian were not for me. The mild -exhortations of the old man and the lively conversation of the loved -Felix were not for me. Miserable, unhappy wretch! - -"Other lessons were impressed upon me even more deeply. I heard of the -difference of sexes, and the birth and growth of children, how the -father doted on the smiles of the infant, and the lively sallies of the -older child, how all the life and cares of the mother were wrapped up -in the precious charge, how the mind of youth expanded and gained -knowledge, of brother, sister, and all the various relationships which -bind one human being to another in mutual bonds. - -"But where were my friends and relations? No father had watched my -infant days, no mother had blessed me with smiles and caresses; or if -they had, all my past life was now a blot, a blind vacancy in which I -distinguished nothing. From my earliest remembrance I had been as I -then was in height and proportion. I had never yet seen a being -resembling me or who claimed any intercourse with me. What was I? The -question again recurred, to be answered only with groans. - -"I will soon explain to what these feelings tended, but allow me now to -return to the cottagers, whose story excited in me such various -feelings of indignation, delight, and wonder, but which all terminated -in additional love and reverence for my protectors (for so I loved, in -an innocent, half-painful self-deceit, to call them)." - - - -Chapter 14 - -"Some time elapsed before I learned the history of my friends. It was -one which could not fail to impress itself deeply on my mind, unfolding -as it did a number of circumstances, each interesting and wonderful to -one so utterly inexperienced as I was. - -"The name of the old man was De Lacey. He was descended from a good -family in France, where he had lived for many years in affluence, -respected by his superiors and beloved by his equals. His son was bred -in the service of his country, and Agatha had ranked with ladies of the -highest distinction. A few months before my arrival they had lived in -a large and luxurious city called Paris, surrounded by friends and -possessed of every enjoyment which virtue, refinement of intellect, or -taste, accompanied by a moderate fortune, could afford. - -"The father of Safie had been the cause of their ruin. He was a -Turkish merchant and had inhabited Paris for many years, when, for some -reason which I could not learn, he became obnoxious to the government. -He was seized and cast into prison the very day that Safie arrived from -Constantinople to join him. He was tried and condemned to death. The -injustice of his sentence was very flagrant; all Paris was indignant; -and it was judged that his religion and wealth rather than the crime -alleged against him had been the cause of his condemnation. - -"Felix had accidentally been present at the trial; his horror and -indignation were uncontrollable when he heard the decision of the -court. He made, at that moment, a solemn vow to deliver him and then -looked around for the means. After many fruitless attempts to gain -admittance to the prison, he found a strongly grated window in an -unguarded part of the building, which lighted the dungeon of the -unfortunate Muhammadan, who, loaded with chains, waited in despair the -execution of the barbarous sentence. Felix visited the grate at night -and made known to the prisoner his intentions in his favour. The Turk, -amazed and delighted, endeavoured to kindle the zeal of his deliverer -by promises of reward and wealth. Felix rejected his offers with -contempt, yet when he saw the lovely Safie, who was allowed to visit -her father and who by her gestures expressed her lively gratitude, the -youth could not help owning to his own mind that the captive possessed -a treasure which would fully reward his toil and hazard. - -"The Turk quickly perceived the impression that his daughter had made -on the heart of Felix and endeavoured to secure him more entirely in -his interests by the promise of her hand in marriage so soon as he -should be conveyed to a place of safety. Felix was too delicate to -accept this offer, yet he looked forward to the probability of the -event as to the consummation of his happiness. - -"During the ensuing days, while the preparations were going forward for -the escape of the merchant, the zeal of Felix was warmed by several -letters that he received from this lovely girl, who found means to -express her thoughts in the language of her lover by the aid of an old -man, a servant of her father who understood French. She thanked him in -the most ardent terms for his intended services towards her parent, and -at the same time she gently deplored her own fate. - -"I have copies of these letters, for I found means, during my residence -in the hovel, to procure the implements of writing; and the letters -were often in the hands of Felix or Agatha. Before I depart I will -give them to you; they will prove the truth of my tale; but at present, -as the sun is already far declined, I shall only have time to repeat -the substance of them to you. - -"Safie related that her mother was a Christian Arab, seized and made a -slave by the Turks; recommended by her beauty, she had won the heart of -the father of Safie, who married her. The young girl spoke in high and -enthusiastic terms of her mother, who, born in freedom, spurned the -bondage to which she was now reduced. She instructed her daughter in -the tenets of her religion and taught her to aspire to higher powers of -intellect and an independence of spirit forbidden to the female -followers of Muhammad. This lady died, but her lessons were indelibly -impressed on the mind of Safie, who sickened at the prospect of again -returning to Asia and being immured within the walls of a harem, -allowed only to occupy herself with infantile amusements, ill-suited to -the temper of her soul, now accustomed to grand ideas and a noble -emulation for virtue. The prospect of marrying a Christian and -remaining in a country where women were allowed to take a rank in -society was enchanting to her. - -"The day for the execution of the Turk was fixed, but on the night -previous to it he quitted his prison and before morning was distant -many leagues from Paris. Felix had procured passports in the name of -his father, sister, and himself. He had previously communicated his -plan to the former, who aided the deceit by quitting his house, under -the pretence of a journey and concealed himself, with his daughter, in -an obscure part of Paris. - -"Felix conducted the fugitives through France to Lyons and across Mont -Cenis to Leghorn, where the merchant had decided to wait a favourable -opportunity of passing into some part of the Turkish dominions. - -"Safie resolved to remain with her father until the moment of his -departure, before which time the Turk renewed his promise that she -should be united to his deliverer; and Felix remained with them in -expectation of that event; and in the meantime he enjoyed the society -of the Arabian, who exhibited towards him the simplest and tenderest -affection. They conversed with one another through the means of an -interpreter, and sometimes with the interpretation of looks; and Safie -sang to him the divine airs of her native country. - -"The Turk allowed this intimacy to take place and encouraged the hopes -of the youthful lovers, while in his heart he had formed far other -plans. He loathed the idea that his daughter should be united to a -Christian, but he feared the resentment of Felix if he should appear -lukewarm, for he knew that he was still in the power of his deliverer -if he should choose to betray him to the Italian state which they -inhabited. He revolved a thousand plans by which he should be enabled -to prolong the deceit until it might be no longer necessary, and -secretly to take his daughter with him when he departed. His plans -were facilitated by the news which arrived from Paris. - -"The government of France were greatly enraged at the escape of their -victim and spared no pains to detect and punish his deliverer. The -plot of Felix was quickly discovered, and De Lacey and Agatha were -thrown into prison. The news reached Felix and roused him from his -dream of pleasure. His blind and aged father and his gentle sister lay -in a noisome dungeon while he enjoyed the free air and the society of -her whom he loved. This idea was torture to him. He quickly arranged -with the Turk that if the latter should find a favourable opportunity -for escape before Felix could return to Italy, Safie should remain as a -boarder at a convent at Leghorn; and then, quitting the lovely Arabian, -he hastened to Paris and delivered himself up to the vengeance of the -law, hoping to free De Lacey and Agatha by this proceeding. - -"He did not succeed. They remained confined for five months before the -trial took place, the result of which deprived them of their fortune -and condemned them to a perpetual exile from their native country. - -"They found a miserable asylum in the cottage in Germany, where I -discovered them. Felix soon learned that the treacherous Turk, for -whom he and his family endured such unheard-of oppression, on -discovering that his deliverer was thus reduced to poverty and ruin, -became a traitor to good feeling and honour and had quitted Italy with -his daughter, insultingly sending Felix a pittance of money to aid him, -as he said, in some plan of future maintenance. - -"Such were the events that preyed on the heart of Felix and rendered -him, when I first saw him, the most miserable of his family. He could -have endured poverty, and while this distress had been the meed of his -virtue, he gloried in it; but the ingratitude of the Turk and the loss -of his beloved Safie were misfortunes more bitter and irreparable. The -arrival of the Arabian now infused new life into his soul. - -"When the news reached Leghorn that Felix was deprived of his wealth -and rank, the merchant commanded his daughter to think no more of her -lover, but to prepare to return to her native country. The generous -nature of Safie was outraged by this command; she attempted to -expostulate with her father, but he left her angrily, reiterating his -tyrannical mandate. - -"A few days after, the Turk entered his daughter's apartment and told -her hastily that he had reason to believe that his residence at Leghorn -had been divulged and that he should speedily be delivered up to the -French government; he had consequently hired a vessel to convey him to -Constantinople, for which city he should sail in a few hours. He -intended to leave his daughter under the care of a confidential -servant, to follow at her leisure with the greater part of his -property, which had not yet arrived at Leghorn. - -"When alone, Safie resolved in her own mind the plan of conduct that it -would become her to pursue in this emergency. A residence in Turkey -was abhorrent to her; her religion and her feelings were alike averse -to it. By some papers of her father which fell into her hands she -heard of the exile of her lover and learnt the name of the spot where -he then resided. She hesitated some time, but at length she formed her -determination. Taking with her some jewels that belonged to her and a -sum of money, she quitted Italy with an attendant, a native of Leghorn, -but who understood the common language of Turkey, and departed for -Germany. - -"She arrived in safety at a town about twenty leagues from the cottage -of De Lacey, when her attendant fell dangerously ill. Safie nursed her -with the most devoted affection, but the poor girl died, and the -Arabian was left alone, unacquainted with the language of the country -and utterly ignorant of the customs of the world. She fell, however, -into good hands. The Italian had mentioned the name of the spot for -which they were bound, and after her death the woman of the house in -which they had lived took care that Safie should arrive in safety at -the cottage of her lover." - - - -Chapter 15 - -"Such was the history of my beloved cottagers. It impressed me deeply. -I learned, from the views of social life which it developed, to admire -their virtues and to deprecate the vices of mankind. - -"As yet I looked upon crime as a distant evil, benevolence and -generosity were ever present before me, inciting within me a desire to -become an actor in the busy scene where so many admirable qualities -were called forth and displayed. But in giving an account of the -progress of my intellect, I must not omit a circumstance which occurred -in the beginning of the month of August of the same year. - -"One night during my accustomed visit to the neighbouring wood where I -collected my own food and brought home firing for my protectors, I -found on the ground a leathern portmanteau containing several articles -of dress and some books. I eagerly seized the prize and returned with -it to my hovel. Fortunately the books were written in the language, -the elements of which I had acquired at the cottage; they consisted of -Paradise Lost, a volume of Plutarch's Lives, and the Sorrows of Werter. -The possession of these treasures gave me extreme delight; I now -continually studied and exercised my mind upon these histories, whilst -my friends were employed in their ordinary occupations. - -"I can hardly describe to you the effect of these books. They produced -in me an infinity of new images and feelings, that sometimes raised me -to ecstasy, but more frequently sunk me into the lowest dejection. In -the Sorrows of Werter, besides the interest of its simple and affecting -story, so many opinions are canvassed and so many lights thrown upon -what had hitherto been to me obscure subjects that I found in it a -never-ending source of speculation and astonishment. The gentle and -domestic manners it described, combined with lofty sentiments and -feelings, which had for their object something out of self, accorded -well with my experience among my protectors and with the wants which -were forever alive in my own bosom. But I thought Werter himself a -more divine being than I had ever beheld or imagined; his character -contained no pretension, but it sank deep. The disquisitions upon -death and suicide were calculated to fill me with wonder. I did not -pretend to enter into the merits of the case, yet I inclined towards -the opinions of the hero, whose extinction I wept, without precisely -understanding it. - -"As I read, however, I applied much personally to my own feelings and -condition. I found myself similar yet at the same time strangely -unlike to the beings concerning whom I read and to whose conversation I -was a listener. I sympathized with and partly understood them, but I -was unformed in mind; I was dependent on none and related to none. -'The path of my departure was free,' and there was none to lament my -annihilation. My person was hideous and my stature gigantic. What did -this mean? Who was I? What was I? Whence did I come? What was my -destination? These questions continually recurred, but I was unable to -solve them. - -"The volume of Plutarch's Lives which I possessed contained the -histories of the first founders of the ancient republics. This book -had a far different effect upon me from the Sorrows of Werter. I -learned from Werter's imaginations despondency and gloom, but Plutarch -taught me high thoughts; he elevated me above the wretched sphere of my -own reflections, to admire and love the heroes of past ages. Many -things I read surpassed my understanding and experience. I had a very -confused knowledge of kingdoms, wide extents of country, mighty rivers, -and boundless seas. But I was perfectly unacquainted with towns and -large assemblages of men. The cottage of my protectors had been the -only school in which I had studied human nature, but this book -developed new and mightier scenes of action. I read of men concerned -in public affairs, governing or massacring their species. I felt the -greatest ardour for virtue rise within me, and abhorrence for vice, as -far as I understood the signification of those terms, relative as they -were, as I applied them, to pleasure and pain alone. Induced by these -feelings, I was of course led to admire peaceable lawgivers, Numa, -Solon, and Lycurgus, in preference to Romulus and Theseus. The -patriarchal lives of my protectors caused these impressions to take a -firm hold on my mind; perhaps, if my first introduction to humanity had -been made by a young soldier, burning for glory and slaughter, I should -have been imbued with different sensations. - -"But Paradise Lost excited different and far deeper emotions. I read -it, as I had read the other volumes which had fallen into my hands, as -a true history. It moved every feeling of wonder and awe that the -picture of an omnipotent God warring with his creatures was capable of -exciting. I often referred the several situations, as their similarity -struck me, to my own. Like Adam, I was apparently united by no link to -any other being in existence; but his state was far different from mine -in every other respect. He had come forth from the hands of God a -perfect creature, happy and prosperous, guarded by the especial care of -his Creator; he was allowed to converse with and acquire knowledge from -beings of a superior nature, but I was wretched, helpless, and alone. -Many times I considered Satan as the fitter emblem of my condition, for -often, like him, when I viewed the bliss of my protectors, the bitter -gall of envy rose within me. - -"Another circumstance strengthened and confirmed these feelings. Soon -after my arrival in the hovel I discovered some papers in the pocket of -the dress which I had taken from your laboratory. At first I had -neglected them, but now that I was able to decipher the characters in -which they were written, I began to study them with diligence. It was -your journal of the four months that preceded my creation. You -minutely described in these papers every step you took in the progress -of your work; this history was mingled with accounts of domestic -occurrences. You doubtless recollect these papers. Here they are. -Everything is related in them which bears reference to my accursed -origin; the whole detail of that series of disgusting circumstances -which produced it is set in view; the minutest description of my odious -and loathsome person is given, in language which painted your own -horrors and rendered mine indelible. I sickened as I read. 'Hateful -day when I received life!' I exclaimed in agony. 'Accursed creator! -Why did you form a monster so hideous that even YOU turned from me in -disgust? God, in pity, made man beautiful and alluring, after his own -image; but my form is a filthy type of yours, more horrid even from the -very resemblance. Satan had his companions, fellow devils, to admire -and encourage him, but I am solitary and abhorred.' - -"These were the reflections of my hours of despondency and solitude; -but when I contemplated the virtues of the cottagers, their amiable and -benevolent dispositions, I persuaded myself that when they should -become acquainted with my admiration of their virtues they would -compassionate me and overlook my personal deformity. Could they turn -from their door one, however monstrous, who solicited their compassion -and friendship? I resolved, at least, not to despair, but in every way -to fit myself for an interview with them which would decide my fate. I -postponed this attempt for some months longer, for the importance -attached to its success inspired me with a dread lest I should fail. -Besides, I found that my understanding improved so much with every -day's experience that I was unwilling to commence this undertaking -until a few more months should have added to my sagacity. - -"Several changes, in the meantime, took place in the cottage. The -presence of Safie diffused happiness among its inhabitants, and I also -found that a greater degree of plenty reigned there. Felix and Agatha -spent more time in amusement and conversation, and were assisted in -their labours by servants. They did not appear rich, but they were -contented and happy; their feelings were serene and peaceful, while -mine became every day more tumultuous. Increase of knowledge only -discovered to me more clearly what a wretched outcast I was. I -cherished hope, it is true, but it vanished when I beheld my person -reflected in water or my shadow in the moonshine, even as that frail -image and that inconstant shade. - -"I endeavoured to crush these fears and to fortify myself for the trial -which in a few months I resolved to undergo; and sometimes I allowed my -thoughts, unchecked by reason, to ramble in the fields of Paradise, and -dared to fancy amiable and lovely creatures sympathizing with my -feelings and cheering my gloom; their angelic countenances breathed -smiles of consolation. But it was all a dream; no Eve soothed my -sorrows nor shared my thoughts; I was alone. I remembered Adam's -supplication to his Creator. But where was mine? He had abandoned me, -and in the bitterness of my heart I cursed him. - -"Autumn passed thus. I saw, with surprise and grief, the leaves decay -and fall, and nature again assume the barren and bleak appearance it -had worn when I first beheld the woods and the lovely moon. Yet I did -not heed the bleakness of the weather; I was better fitted by my -conformation for the endurance of cold than heat. But my chief -delights were the sight of the flowers, the birds, and all the gay -apparel of summer; when those deserted me, I turned with more attention -towards the cottagers. Their happiness was not decreased by the -absence of summer. They loved and sympathized with one another; and -their joys, depending on each other, were not interrupted by the -casualties that took place around them. The more I saw of them, the -greater became my desire to claim their protection and kindness; my -heart yearned to be known and loved by these amiable creatures; to see -their sweet looks directed towards me with affection was the utmost -limit of my ambition. I dared not think that they would turn them from -me with disdain and horror. The poor that stopped at their door were -never driven away. I asked, it is true, for greater treasures than a -little food or rest: I required kindness and sympathy; but I did not -believe myself utterly unworthy of it. - -"The winter advanced, and an entire revolution of the seasons had taken -place since I awoke into life. My attention at this time was solely -directed towards my plan of introducing myself into the cottage of my -protectors. I revolved many projects, but that on which I finally -fixed was to enter the dwelling when the blind old man should be alone. -I had sagacity enough to discover that the unnatural hideousness of my -person was the chief object of horror with those who had formerly -beheld me. My voice, although harsh, had nothing terrible in it; I -thought, therefore, that if in the absence of his children I could gain -the good will and mediation of the old De Lacey, I might by his means -be tolerated by my younger protectors. - -"One day, when the sun shone on the red leaves that strewed the ground -and diffused cheerfulness, although it denied warmth, Safie, Agatha, -and Felix departed on a long country walk, and the old man, at his own -desire, was left alone in the cottage. When his children had departed, -he took up his guitar and played several mournful but sweet airs, more -sweet and mournful than I had ever heard him play before. At first his -countenance was illuminated with pleasure, but as he continued, -thoughtfulness and sadness succeeded; at length, laying aside the -instrument, he sat absorbed in reflection. - -"My heart beat quick; this was the hour and moment of trial, which -would decide my hopes or realize my fears. The servants were gone to a -neighbouring fair. All was silent in and around the cottage; it was an -excellent opportunity; yet, when I proceeded to execute my plan, my -limbs failed me and I sank to the ground. Again I rose, and exerting -all the firmness of which I was master, removed the planks which I had -placed before my hovel to conceal my retreat. The fresh air revived -me, and with renewed determination I approached the door of their -cottage. - -"I knocked. 'Who is there?' said the old man. 'Come in.' - -"I entered. 'Pardon this intrusion,' said I; 'I am a traveller in want -of a little rest; you would greatly oblige me if you would allow me to -remain a few minutes before the fire.' - -"'Enter,' said De Lacey, 'and I will try in what manner I can to -relieve your wants; but, unfortunately, my children are from home, and -as I am blind, I am afraid I shall find it difficult to procure food -for you.' - -"'Do not trouble yourself, my kind host; I have food; it is warmth and -rest only that I need.' - -"I sat down, and a silence ensued. I knew that every minute was -precious to me, yet I remained irresolute in what manner to commence -the interview, when the old man addressed me. 'By your language, -stranger, I suppose you are my countryman; are you French?' - -"'No; but I was educated by a French family and understand that -language only. I am now going to claim the protection of some friends, -whom I sincerely love, and of whose favour I have some hopes.' - -"'Are they Germans?' - -"'No, they are French. But let us change the subject. I am an -unfortunate and deserted creature, I look around and I have no relation -or friend upon earth. These amiable people to whom I go have never -seen me and know little of me. I am full of fears, for if I fail -there, I am an outcast in the world forever.' - -"'Do not despair. To be friendless is indeed to be unfortunate, but -the hearts of men, when unprejudiced by any obvious self-interest, are -full of brotherly love and charity. Rely, therefore, on your hopes; -and if these friends are good and amiable, do not despair.' - -"'They are kind--they are the most excellent creatures in the world; -but, unfortunately, they are prejudiced against me. I have good -dispositions; my life has been hitherto harmless and in some degree -beneficial; but a fatal prejudice clouds their eyes, and where they -ought to see a feeling and kind friend, they behold only a detestable -monster.' - -"'That is indeed unfortunate; but if you are really blameless, cannot -you undeceive them?' - -"'I am about to undertake that task; and it is on that account that I -feel so many overwhelming terrors. I tenderly love these friends; I -have, unknown to them, been for many months in the habits of daily -kindness towards them; but they believe that I wish to injure them, and -it is that prejudice which I wish to overcome.' - -"'Where do these friends reside?' - -"'Near this spot.' - -"The old man paused and then continued, 'If you will unreservedly -confide to me the particulars of your tale, I perhaps may be of use in -undeceiving them. I am blind and cannot judge of your countenance, but -there is something in your words which persuades me that you are -sincere. I am poor and an exile, but it will afford me true pleasure -to be in any way serviceable to a human creature.' - -"'Excellent man! I thank you and accept your generous offer. You -raise me from the dust by this kindness; and I trust that, by your aid, -I shall not be driven from the society and sympathy of your fellow -creatures.' - -"'Heaven forbid! Even if you were really criminal, for that can only -drive you to desperation, and not instigate you to virtue. I also am -unfortunate; I and my family have been condemned, although innocent; -judge, therefore, if I do not feel for your misfortunes.' - -"'How can I thank you, my best and only benefactor? From your lips -first have I heard the voice of kindness directed towards me; I shall -be forever grateful; and your present humanity assures me of success -with those friends whom I am on the point of meeting.' - -"'May I know the names and residence of those friends?' - -"I paused. This, I thought, was the moment of decision, which was to -rob me of or bestow happiness on me forever. I struggled vainly for -firmness sufficient to answer him, but the effort destroyed all my -remaining strength; I sank on the chair and sobbed aloud. At that -moment I heard the steps of my younger protectors. I had not a moment -to lose, but seizing the hand of the old man, I cried, 'Now is the -time! Save and protect me! You and your family are the friends whom I -seek. Do not you desert me in the hour of trial!' - -"'Great God!' exclaimed the old man. 'Who are you?' - -"At that instant the cottage door was opened, and Felix, Safie, and -Agatha entered. Who can describe their horror and consternation on -beholding me? Agatha fainted, and Safie, unable to attend to her -friend, rushed out of the cottage. Felix darted forward, and with -supernatural force tore me from his father, to whose knees I clung, in -a transport of fury, he dashed me to the ground and struck me violently -with a stick. I could have torn him limb from limb, as the lion rends -the antelope. But my heart sank within me as with bitter sickness, and -I refrained. I saw him on the point of repeating his blow, when, -overcome by pain and anguish, I quitted the cottage, and in the general -tumult escaped unperceived to my hovel." - - - -Chapter 16 - -"Cursed, cursed creator! Why did I live? Why, in that instant, did I -not extinguish the spark of existence which you had so wantonly -bestowed? I know not; despair had not yet taken possession of me; my -feelings were those of rage and revenge. I could with pleasure have -destroyed the cottage and its inhabitants and have glutted myself with -their shrieks and misery. - -"When night came I quitted my retreat and wandered in the wood; and -now, no longer restrained by the fear of discovery, I gave vent to my -anguish in fearful howlings. I was like a wild beast that had broken -the toils, destroying the objects that obstructed me and ranging -through the wood with a stag-like swiftness. Oh! What a miserable -night I passed! The cold stars shone in mockery, and the bare trees -waved their branches above me; now and then the sweet voice of a bird -burst forth amidst the universal stillness. All, save I, were at rest -or in enjoyment; I, like the arch-fiend, bore a hell within me, and -finding myself unsympathized with, wished to tear up the trees, spread -havoc and destruction around me, and then to have sat down and enjoyed -the ruin. - -"But this was a luxury of sensation that could not endure; I became -fatigued with excess of bodily exertion and sank on the damp grass in -the sick impotence of despair. There was none among the myriads of men -that existed who would pity or assist me; and should I feel kindness -towards my enemies? No; from that moment I declared everlasting war -against the species, and more than all, against him who had formed me -and sent me forth to this insupportable misery. - -"The sun rose; I heard the voices of men and knew that it was -impossible to return to my retreat during that day. Accordingly I hid -myself in some thick underwood, determining to devote the ensuing hours -to reflection on my situation. - -"The pleasant sunshine and the pure air of day restored me to some -degree of tranquillity; and when I considered what had passed at the -cottage, I could not help believing that I had been too hasty in my -conclusions. I had certainly acted imprudently. It was apparent that -my conversation had interested the father in my behalf, and I was a -fool in having exposed my person to the horror of his children. I -ought to have familiarized the old De Lacey to me, and by degrees to -have discovered myself to the rest of his family, when they should have -been prepared for my approach. But I did not believe my errors to be -irretrievable, and after much consideration I resolved to return to the -cottage, seek the old man, and by my representations win him to my -party. - -"These thoughts calmed me, and in the afternoon I sank into a profound -sleep; but the fever of my blood did not allow me to be visited by -peaceful dreams. The horrible scene of the preceding day was forever -acting before my eyes; the females were flying and the enraged Felix -tearing me from his father's feet. I awoke exhausted, and finding that -it was already night, I crept forth from my hiding-place, and went in -search of food. - -"When my hunger was appeased, I directed my steps towards the -well-known path that conducted to the cottage. All there was at peace. -I crept into my hovel and remained in silent expectation of the -accustomed hour when the family arose. That hour passed, the sun -mounted high in the heavens, but the cottagers did not appear. I -trembled violently, apprehending some dreadful misfortune. The inside -of the cottage was dark, and I heard no motion; I cannot describe the -agony of this suspense. - -"Presently two countrymen passed by, but pausing near the cottage, they -entered into conversation, using violent gesticulations; but I did not -understand what they said, as they spoke the language of the country, -which differed from that of my protectors. Soon after, however, Felix -approached with another man; I was surprised, as I knew that he had not -quitted the cottage that morning, and waited anxiously to discover from -his discourse the meaning of these unusual appearances. - -"'Do you consider,' said his companion to him, 'that you will be -obliged to pay three months' rent and to lose the produce of your -garden? I do not wish to take any unfair advantage, and I beg -therefore that you will take some days to consider of your -determination.' - -"'It is utterly useless,' replied Felix; 'we can never again inhabit -your cottage. The life of my father is in the greatest danger, owing -to the dreadful circumstance that I have related. My wife and my -sister will never recover from their horror. I entreat you not to -reason with me any more. Take possession of your tenement and let me -fly from this place.' - -"Felix trembled violently as he said this. He and his companion -entered the cottage, in which they remained for a few minutes, and then -departed. I never saw any of the family of De Lacey more. - -"I continued for the remainder of the day in my hovel in a state of -utter and stupid despair. My protectors had departed and had broken -the only link that held me to the world. For the first time the -feelings of revenge and hatred filled my bosom, and I did not strive to -control them, but allowing myself to be borne away by the stream, I -bent my mind towards injury and death. When I thought of my friends, -of the mild voice of De Lacey, the gentle eyes of Agatha, and the -exquisite beauty of the Arabian, these thoughts vanished and a gush of -tears somewhat soothed me. But again when I reflected that they had -spurned and deserted me, anger returned, a rage of anger, and unable to -injure anything human, I turned my fury towards inanimate objects. As -night advanced I placed a variety of combustibles around the cottage, -and after having destroyed every vestige of cultivation in the garden, -I waited with forced impatience until the moon had sunk to commence my -operations. - -"As the night advanced, a fierce wind arose from the woods and quickly -dispersed the clouds that had loitered in the heavens; the blast tore -along like a mighty avalanche and produced a kind of insanity in my -spirits that burst all bounds of reason and reflection. I lighted the -dry branch of a tree and danced with fury around the devoted cottage, -my eyes still fixed on the western horizon, the edge of which the moon -nearly touched. A part of its orb was at length hid, and I waved my -brand; it sank, and with a loud scream I fired the straw, and heath, -and bushes, which I had collected. The wind fanned the fire, and the -cottage was quickly enveloped by the flames, which clung to it and -licked it with their forked and destroying tongues. - -"As soon as I was convinced that no assistance could save any part of -the habitation, I quitted the scene and sought for refuge in the woods. - -"And now, with the world before me, whither should I bend my steps? I -resolved to fly far from the scene of my misfortunes; but to me, hated -and despised, every country must be equally horrible. At length the -thought of you crossed my mind. I learned from your papers that you -were my father, my creator; and to whom could I apply with more fitness -than to him who had given me life? Among the lessons that Felix had -bestowed upon Safie, geography had not been omitted; I had learned from -these the relative situations of the different countries of the earth. -You had mentioned Geneva as the name of your native town, and towards -this place I resolved to proceed. - -"But how was I to direct myself? I knew that I must travel in a -southwesterly direction to reach my destination, but the sun was my -only guide. I did not know the names of the towns that I was to pass -through, nor could I ask information from a single human being; but I -did not despair. From you only could I hope for succour, although -towards you I felt no sentiment but that of hatred. Unfeeling, -heartless creator! You had endowed me with perceptions and passions -and then cast me abroad an object for the scorn and horror of mankind. -But on you only had I any claim for pity and redress, and from you I -determined to seek that justice which I vainly attempted to gain from -any other being that wore the human form. - -"My travels were long and the sufferings I endured intense. It was -late in autumn when I quitted the district where I had so long resided. -I travelled only at night, fearful of encountering the visage of a -human being. Nature decayed around me, and the sun became heatless; -rain and snow poured around me; mighty rivers were frozen; the surface -of the earth was hard and chill, and bare, and I found no shelter. Oh, -earth! How often did I imprecate curses on the cause of my being! The -mildness of my nature had fled, and all within me was turned to gall -and bitterness. The nearer I approached to your habitation, the more -deeply did I feel the spirit of revenge enkindled in my heart. Snow -fell, and the waters were hardened, but I rested not. A few incidents -now and then directed me, and I possessed a map of the country; but I -often wandered wide from my path. The agony of my feelings allowed me -no respite; no incident occurred from which my rage and misery could -not extract its food; but a circumstance that happened when I arrived -on the confines of Switzerland, when the sun had recovered its warmth -and the earth again began to look green, confirmed in an especial -manner the bitterness and horror of my feelings. - -"I generally rested during the day and travelled only when I was -secured by night from the view of man. One morning, however, finding -that my path lay through a deep wood, I ventured to continue my journey -after the sun had risen; the day, which was one of the first of spring, -cheered even me by the loveliness of its sunshine and the balminess of -the air. I felt emotions of gentleness and pleasure, that had long -appeared dead, revive within me. Half surprised by the novelty of -these sensations, I allowed myself to be borne away by them, and -forgetting my solitude and deformity, dared to be happy. Soft tears -again bedewed my cheeks, and I even raised my humid eyes with -thankfulness towards the blessed sun, which bestowed such joy upon me. - -"I continued to wind among the paths of the wood, until I came to its -boundary, which was skirted by a deep and rapid river, into which many -of the trees bent their branches, now budding with the fresh spring. -Here I paused, not exactly knowing what path to pursue, when I heard -the sound of voices, that induced me to conceal myself under the shade -of a cypress. I was scarcely hid when a young girl came running -towards the spot where I was concealed, laughing, as if she ran from -someone in sport. She continued her course along the precipitous sides -of the river, when suddenly her foot slipped, and she fell into the -rapid stream. I rushed from my hiding-place and with extreme labour, -from the force of the current, saved her and dragged her to shore. She -was senseless, and I endeavoured by every means in my power to restore -animation, when I was suddenly interrupted by the approach of a rustic, -who was probably the person from whom she had playfully fled. On -seeing me, he darted towards me, and tearing the girl from my arms, -hastened towards the deeper parts of the wood. I followed speedily, I -hardly knew why; but when the man saw me draw near, he aimed a gun, -which he carried, at my body and fired. I sank to the ground, and my -injurer, with increased swiftness, escaped into the wood. - -"This was then the reward of my benevolence! I had saved a human being -from destruction, and as a recompense I now writhed under the miserable -pain of a wound which shattered the flesh and bone. The feelings of -kindness and gentleness which I had entertained but a few moments -before gave place to hellish rage and gnashing of teeth. Inflamed by -pain, I vowed eternal hatred and vengeance to all mankind. But the -agony of my wound overcame me; my pulses paused, and I fainted. - -"For some weeks I led a miserable life in the woods, endeavouring to -cure the wound which I had received. The ball had entered my shoulder, -and I knew not whether it had remained there or passed through; at any -rate I had no means of extracting it. My sufferings were augmented -also by the oppressive sense of the injustice and ingratitude of their -infliction. My daily vows rose for revenge--a deep and deadly revenge, -such as would alone compensate for the outrages and anguish I had -endured. - -"After some weeks my wound healed, and I continued my journey. The -labours I endured were no longer to be alleviated by the bright sun or -gentle breezes of spring; all joy was but a mockery which insulted my -desolate state and made me feel more painfully that I was not made for -the enjoyment of pleasure. - -"But my toils now drew near a close, and in two months from this time I -reached the environs of Geneva. - -"It was evening when I arrived, and I retired to a hiding-place among -the fields that surround it to meditate in what manner I should apply -to you. I was oppressed by fatigue and hunger and far too unhappy to -enjoy the gentle breezes of evening or the prospect of the sun setting -behind the stupendous mountains of Jura. - -"At this time a slight sleep relieved me from the pain of reflection, -which was disturbed by the approach of a beautiful child, who came -running into the recess I had chosen, with all the sportiveness of -infancy. Suddenly, as I gazed on him, an idea seized me that this -little creature was unprejudiced and had lived too short a time to have -imbibed a horror of deformity. If, therefore, I could seize him and -educate him as my companion and friend, I should not be so desolate in -this peopled earth. - -"Urged by this impulse, I seized on the boy as he passed and drew him -towards me. As soon as he beheld my form, he placed his hands before -his eyes and uttered a shrill scream; I drew his hand forcibly from his -face and said, 'Child, what is the meaning of this? I do not intend to -hurt you; listen to me.' - -"He struggled violently. 'Let me go,' he cried; 'monster! Ugly -wretch! You wish to eat me and tear me to pieces. You are an ogre. -Let me go, or I will tell my papa.' - -"'Boy, you will never see your father again; you must come with me.' - -"'Hideous monster! Let me go. My papa is a syndic--he is M. -Frankenstein--he will punish you. You dare not keep me.' - -"'Frankenstein! you belong then to my enemy--to him towards whom I have -sworn eternal revenge; you shall be my first victim.' - -"The child still struggled and loaded me with epithets which carried -despair to my heart; I grasped his throat to silence him, and in a -moment he lay dead at my feet. - -"I gazed on my victim, and my heart swelled with exultation and hellish -triumph; clapping my hands, I exclaimed, 'I too can create desolation; -my enemy is not invulnerable; this death will carry despair to him, and -a thousand other miseries shall torment and destroy him.' - -"As I fixed my eyes on the child, I saw something glittering on his -breast. I took it; it was a portrait of a most lovely woman. In spite -of my malignity, it softened and attracted me. For a few moments I -gazed with delight on her dark eyes, fringed by deep lashes, and her -lovely lips; but presently my rage returned; I remembered that I was -forever deprived of the delights that such beautiful creatures could -bestow and that she whose resemblance I contemplated would, in -regarding me, have changed that air of divine benignity to one -expressive of disgust and affright. - -"Can you wonder that such thoughts transported me with rage? I only -wonder that at that moment, instead of venting my sensations in -exclamations and agony, I did not rush among mankind and perish in the -attempt to destroy them. - -"While I was overcome by these feelings, I left the spot where I had -committed the murder, and seeking a more secluded hiding-place, I -entered a barn which had appeared to me to be empty. A woman was -sleeping on some straw; she was young, not indeed so beautiful as her -whose portrait I held, but of an agreeable aspect and blooming in the -loveliness of youth and health. Here, I thought, is one of those whose -joy-imparting smiles are bestowed on all but me. And then I bent over -her and whispered, 'Awake, fairest, thy lover is near--he who would -give his life but to obtain one look of affection from thine eyes; my -beloved, awake!' - -"The sleeper stirred; a thrill of terror ran through me. Should she -indeed awake, and see me, and curse me, and denounce the murderer? Thus -would she assuredly act if her darkened eyes opened and she beheld me. -The thought was madness; it stirred the fiend within me--not I, but -she, shall suffer; the murder I have committed because I am forever -robbed of all that she could give me, she shall atone. The crime had -its source in her; be hers the punishment! Thanks to the lessons of -Felix and the sanguinary laws of man, I had learned now to work -mischief. I bent over her and placed the portrait securely in one of -the folds of her dress. She moved again, and I fled. - -"For some days I haunted the spot where these scenes had taken place, -sometimes wishing to see you, sometimes resolved to quit the world and -its miseries forever. At length I wandered towards these mountains, -and have ranged through their immense recesses, consumed by a burning -passion which you alone can gratify. We may not part until you have -promised to comply with my requisition. I am alone and miserable; man -will not associate with me; but one as deformed and horrible as myself -would not deny herself to me. My companion must be of the same species -and have the same defects. This being you must create." - - - -Chapter 17 - -The being finished speaking and fixed his looks upon me in the -expectation of a reply. But I was bewildered, perplexed, and unable to -arrange my ideas sufficiently to understand the full extent of his -proposition. He continued, - -"You must create a female for me with whom I can live in the -interchange of those sympathies necessary for my being. This you alone -can do, and I demand it of you as a right which you must not refuse to -concede." - -The latter part of his tale had kindled anew in me the anger that had -died away while he narrated his peaceful life among the cottagers, and -as he said this I could no longer suppress the rage that burned within -me. - -"I do refuse it," I replied; "and no torture shall ever extort a -consent from me. You may render me the most miserable of men, but you -shall never make me base in my own eyes. Shall I create another like -yourself, whose joint wickedness might desolate the world. Begone! I -have answered you; you may torture me, but I will never consent." - -"You are in the wrong," replied the fiend; "and instead of threatening, -I am content to reason with you. I am malicious because I am -miserable. Am I not shunned and hated by all mankind? You, my -creator, would tear me to pieces and triumph; remember that, and tell -me why I should pity man more than he pities me? You would not call it -murder if you could precipitate me into one of those ice-rifts and -destroy my frame, the work of your own hands. Shall I respect man when -he condemns me? Let him live with me in the interchange of kindness, -and instead of injury I would bestow every benefit upon him with tears -of gratitude at his acceptance. But that cannot be; the human senses -are insurmountable barriers to our union. Yet mine shall not be the -submission of abject slavery. I will revenge my injuries; if I cannot -inspire love, I will cause fear, and chiefly towards you my arch-enemy, -because my creator, do I swear inextinguishable hatred. Have a care; I -will work at your destruction, nor finish until I desolate your heart, -so that you shall curse the hour of your birth." - -A fiendish rage animated him as he said this; his face was wrinkled -into contortions too horrible for human eyes to behold; but presently -he calmed himself and proceeded-- - -"I intended to reason. This passion is detrimental to me, for you do -not reflect that YOU are the cause of its excess. If any being felt -emotions of benevolence towards me, I should return them a hundred and -a hundredfold; for that one creature's sake I would make peace with the -whole kind! But I now indulge in dreams of bliss that cannot be -realized. What I ask of you is reasonable and moderate; I demand a -creature of another sex, but as hideous as myself; the gratification is -small, but it is all that I can receive, and it shall content me. It -is true, we shall be monsters, cut off from all the world; but on that -account we shall be more attached to one another. Our lives will not -be happy, but they will be harmless and free from the misery I now -feel. Oh! My creator, make me happy; let me feel gratitude towards -you for one benefit! Let me see that I excite the sympathy of some -existing thing; do not deny me my request!" - -I was moved. I shuddered when I thought of the possible consequences -of my consent, but I felt that there was some justice in his argument. -His tale and the feelings he now expressed proved him to be a creature -of fine sensations, and did I not as his maker owe him all the portion -of happiness that it was in my power to bestow? He saw my change of -feeling and continued, - -"If you consent, neither you nor any other human being shall ever see -us again; I will go to the vast wilds of South America. My food is not -that of man; I do not destroy the lamb and the kid to glut my appetite; -acorns and berries afford me sufficient nourishment. My companion will -be of the same nature as myself and will be content with the same fare. -We shall make our bed of dried leaves; the sun will shine on us as on -man and will ripen our food. The picture I present to you is peaceful -and human, and you must feel that you could deny it only in the -wantonness of power and cruelty. Pitiless as you have been towards me, -I now see compassion in your eyes; let me seize the favourable moment -and persuade you to promise what I so ardently desire." - -"You propose," replied I, "to fly from the habitations of man, to dwell -in those wilds where the beasts of the field will be your only -companions. How can you, who long for the love and sympathy of man, -persevere in this exile? You will return and again seek their -kindness, and you will meet with their detestation; your evil passions -will be renewed, and you will then have a companion to aid you in the -task of destruction. This may not be; cease to argue the point, for I -cannot consent." - -"How inconstant are your feelings! But a moment ago you were moved by -my representations, and why do you again harden yourself to my -complaints? I swear to you, by the earth which I inhabit, and by you -that made me, that with the companion you bestow I will quit the -neighbourhood of man and dwell, as it may chance, in the most savage of -places. My evil passions will have fled, for I shall meet with -sympathy! My life will flow quietly away, and in my dying moments I -shall not curse my maker." - -His words had a strange effect upon me. I compassionated him and -sometimes felt a wish to console him, but when I looked upon him, when -I saw the filthy mass that moved and talked, my heart sickened and my -feelings were altered to those of horror and hatred. I tried to stifle -these sensations; I thought that as I could not sympathize with him, I -had no right to withhold from him the small portion of happiness which -was yet in my power to bestow. - -"You swear," I said, "to be harmless; but have you not already shown a -degree of malice that should reasonably make me distrust you? May not -even this be a feint that will increase your triumph by affording a -wider scope for your revenge?" - -"How is this? I must not be trifled with, and I demand an answer. If -I have no ties and no affections, hatred and vice must be my portion; -the love of another will destroy the cause of my crimes, and I shall -become a thing of whose existence everyone will be ignorant. My vices -are the children of a forced solitude that I abhor, and my virtues will -necessarily arise when I live in communion with an equal. I shall feel -the affections of a sensitive being and become linked to the chain of -existence and events from which I am now excluded." - -I paused some time to reflect on all he had related and the various -arguments which he had employed. I thought of the promise of virtues -which he had displayed on the opening of his existence and the -subsequent blight of all kindly feeling by the loathing and scorn which -his protectors had manifested towards him. His power and threats were -not omitted in my calculations; a creature who could exist in the ice -caves of the glaciers and hide himself from pursuit among the ridges of -inaccessible precipices was a being possessing faculties it would be -vain to cope with. After a long pause of reflection I concluded that -the justice due both to him and my fellow creatures demanded of me that -I should comply with his request. Turning to him, therefore, I said, - -"I consent to your demand, on your solemn oath to quit Europe forever, -and every other place in the neighbourhood of man, as soon as I shall -deliver into your hands a female who will accompany you in your exile." - -"I swear," he cried, "by the sun, and by the blue sky of heaven, and by -the fire of love that burns my heart, that if you grant my prayer, -while they exist you shall never behold me again. Depart to your home -and commence your labours; I shall watch their progress with -unutterable anxiety; and fear not but that when you are ready I shall -appear." - -Saying this, he suddenly quitted me, fearful, perhaps, of any change in -my sentiments. I saw him descend the mountain with greater speed than -the flight of an eagle, and quickly lost among the undulations of the -sea of ice. - -His tale had occupied the whole day, and the sun was upon the verge of -the horizon when he departed. I knew that I ought to hasten my descent -towards the valley, as I should soon be encompassed in darkness; but my -heart was heavy, and my steps slow. The labour of winding among the -little paths of the mountain and fixing my feet firmly as I advanced -perplexed me, occupied as I was by the emotions which the occurrences -of the day had produced. Night was far advanced when I came to the -halfway resting-place and seated myself beside the fountain. The stars -shone at intervals as the clouds passed from over them; the dark pines -rose before me, and every here and there a broken tree lay on the -ground; it was a scene of wonderful solemnity and stirred strange -thoughts within me. I wept bitterly, and clasping my hands in agony, I -exclaimed, "Oh! Stars and clouds and winds, ye are all about to mock -me; if ye really pity me, crush sensation and memory; let me become as -nought; but if not, depart, depart, and leave me in darkness." - -These were wild and miserable thoughts, but I cannot describe to you -how the eternal twinkling of the stars weighed upon me and how I -listened to every blast of wind as if it were a dull ugly siroc on its -way to consume me. - -Morning dawned before I arrived at the village of Chamounix; I took no -rest, but returned immediately to Geneva. Even in my own heart I could -give no expression to my sensations--they weighed on me with a -mountain's weight and their excess destroyed my agony beneath them. -Thus I returned home, and entering the house, presented myself to the -family. My haggard and wild appearance awoke intense alarm, but I -answered no question, scarcely did I speak. I felt as if I were placed -under a ban--as if I had no right to claim their sympathies--as if -never more might I enjoy companionship with them. Yet even thus I -loved them to adoration; and to save them, I resolved to dedicate -myself to my most abhorred task. The prospect of such an occupation -made every other circumstance of existence pass before me like a dream, -and that thought only had to me the reality of life. - - - -Chapter 18 - -Day after day, week after week, passed away on my return to Geneva; and -I could not collect the courage to recommence my work. I feared the -vengeance of the disappointed fiend, yet I was unable to overcome my -repugnance to the task which was enjoined me. I found that I could not -compose a female without again devoting several months to profound -study and laborious disquisition. I had heard of some discoveries -having been made by an English philosopher, the knowledge of which was -material to my success, and I sometimes thought of obtaining my -father's consent to visit England for this purpose; but I clung to -every pretence of delay and shrank from taking the first step in an -undertaking whose immediate necessity began to appear less absolute to -me. A change indeed had taken place in me; my health, which had -hitherto declined, was now much restored; and my spirits, when -unchecked by the memory of my unhappy promise, rose proportionably. My -father saw this change with pleasure, and he turned his thoughts -towards the best method of eradicating the remains of my melancholy, -which every now and then would return by fits, and with a devouring -blackness overcast the approaching sunshine. At these moments I took -refuge in the most perfect solitude. I passed whole days on the lake -alone in a little boat, watching the clouds and listening to the -rippling of the waves, silent and listless. But the fresh air and -bright sun seldom failed to restore me to some degree of composure, and -on my return I met the salutations of my friends with a readier smile -and a more cheerful heart. - -It was after my return from one of these rambles that my father, -calling me aside, thus addressed me, - -"I am happy to remark, my dear son, that you have resumed your former -pleasures and seem to be returning to yourself. And yet you are still -unhappy and still avoid our society. For some time I was lost in -conjecture as to the cause of this, but yesterday an idea struck me, -and if it is well founded, I conjure you to avow it. Reserve on such a -point would be not only useless, but draw down treble misery on us all." - -I trembled violently at his exordium, and my father continued--"I -confess, my son, that I have always looked forward to your marriage -with our dear Elizabeth as the tie of our domestic comfort and the stay -of my declining years. You were attached to each other from your -earliest infancy; you studied together, and appeared, in dispositions -and tastes, entirely suited to one another. But so blind is the -experience of man that what I conceived to be the best assistants to my -plan may have entirely destroyed it. You, perhaps, regard her as your -sister, without any wish that she might become your wife. Nay, you may -have met with another whom you may love; and considering yourself as -bound in honour to Elizabeth, this struggle may occasion the poignant -misery which you appear to feel." - -"My dear father, reassure yourself. I love my cousin tenderly and -sincerely. I never saw any woman who excited, as Elizabeth does, my -warmest admiration and affection. My future hopes and prospects are -entirely bound up in the expectation of our union." - -"The expression of your sentiments of this subject, my dear Victor, -gives me more pleasure than I have for some time experienced. If you -feel thus, we shall assuredly be happy, however present events may cast -a gloom over us. But it is this gloom which appears to have taken so -strong a hold of your mind that I wish to dissipate. Tell me, -therefore, whether you object to an immediate solemnization of the -marriage. We have been unfortunate, and recent events have drawn us -from that everyday tranquillity befitting my years and infirmities. You -are younger; yet I do not suppose, possessed as you are of a competent -fortune, that an early marriage would at all interfere with any future -plans of honour and utility that you may have formed. Do not suppose, -however, that I wish to dictate happiness to you or that a delay on -your part would cause me any serious uneasiness. Interpret my words -with candour and answer me, I conjure you, with confidence and -sincerity." - -I listened to my father in silence and remained for some time incapable -of offering any reply. I revolved rapidly in my mind a multitude of -thoughts and endeavoured to arrive at some conclusion. Alas! To me -the idea of an immediate union with my Elizabeth was one of horror and -dismay. I was bound by a solemn promise which I had not yet fulfilled -and dared not break, or if I did, what manifold miseries might not -impend over me and my devoted family! Could I enter into a festival -with this deadly weight yet hanging round my neck and bowing me to the -ground? I must perform my engagement and let the monster depart with -his mate before I allowed myself to enjoy the delight of a union from -which I expected peace. - -I remembered also the necessity imposed upon me of either journeying to -England or entering into a long correspondence with those philosophers -of that country whose knowledge and discoveries were of indispensable -use to me in my present undertaking. The latter method of obtaining -the desired intelligence was dilatory and unsatisfactory; besides, I -had an insurmountable aversion to the idea of engaging myself in my -loathsome task in my father's house while in habits of familiar -intercourse with those I loved. I knew that a thousand fearful -accidents might occur, the slightest of which would disclose a tale to -thrill all connected with me with horror. I was aware also that I -should often lose all self-command, all capacity of hiding the -harrowing sensations that would possess me during the progress of my -unearthly occupation. I must absent myself from all I loved while thus -employed. Once commenced, it would quickly be achieved, and I might be -restored to my family in peace and happiness. My promise fulfilled, -the monster would depart forever. Or (so my fond fancy imaged) some -accident might meanwhile occur to destroy him and put an end to my -slavery forever. - -These feelings dictated my answer to my father. I expressed a wish to -visit England, but concealing the true reasons of this request, I -clothed my desires under a guise which excited no suspicion, while I -urged my desire with an earnestness that easily induced my father to -comply. After so long a period of an absorbing melancholy that -resembled madness in its intensity and effects, he was glad to find -that I was capable of taking pleasure in the idea of such a journey, -and he hoped that change of scene and varied amusement would, before my -return, have restored me entirely to myself. - -The duration of my absence was left to my own choice; a few months, or -at most a year, was the period contemplated. One paternal kind -precaution he had taken to ensure my having a companion. Without -previously communicating with me, he had, in concert with Elizabeth, -arranged that Clerval should join me at Strasbourg. This interfered -with the solitude I coveted for the prosecution of my task; yet at the -commencement of my journey the presence of my friend could in no way be -an impediment, and truly I rejoiced that thus I should be saved many -hours of lonely, maddening reflection. Nay, Henry might stand between -me and the intrusion of my foe. If I were alone, would he not at times -force his abhorred presence on me to remind me of my task or to -contemplate its progress? - -To England, therefore, I was bound, and it was understood that my union -with Elizabeth should take place immediately on my return. My father's -age rendered him extremely averse to delay. For myself, there was one -reward I promised myself from my detested toils--one consolation for my -unparalleled sufferings; it was the prospect of that day when, -enfranchised from my miserable slavery, I might claim Elizabeth and -forget the past in my union with her. - -I now made arrangements for my journey, but one feeling haunted me -which filled me with fear and agitation. During my absence I should -leave my friends unconscious of the existence of their enemy and -unprotected from his attacks, exasperated as he might be by my -departure. But he had promised to follow me wherever I might go, and -would he not accompany me to England? This imagination was dreadful in -itself, but soothing inasmuch as it supposed the safety of my friends. -I was agonized with the idea of the possibility that the reverse of -this might happen. But through the whole period during which I was the -slave of my creature I allowed myself to be governed by the impulses of -the moment; and my present sensations strongly intimated that the fiend -would follow me and exempt my family from the danger of his -machinations. - -It was in the latter end of September that I again quitted my native -country. My journey had been my own suggestion, and Elizabeth -therefore acquiesced, but she was filled with disquiet at the idea of -my suffering, away from her, the inroads of misery and grief. It had -been her care which provided me a companion in Clerval--and yet a man -is blind to a thousand minute circumstances which call forth a woman's -sedulous attention. She longed to bid me hasten my return; a thousand -conflicting emotions rendered her mute as she bade me a tearful, silent -farewell. - -I threw myself into the carriage that was to convey me away, hardly -knowing whither I was going, and careless of what was passing around. -I remembered only, and it was with a bitter anguish that I reflected on -it, to order that my chemical instruments should be packed to go with -me. Filled with dreary imaginations, I passed through many beautiful -and majestic scenes, but my eyes were fixed and unobserving. I could -only think of the bourne of my travels and the work which was to occupy -me whilst they endured. - -After some days spent in listless indolence, during which I traversed -many leagues, I arrived at Strasbourg, where I waited two days for -Clerval. He came. Alas, how great was the contrast between us! He -was alive to every new scene, joyful when he saw the beauties of the -setting sun, and more happy when he beheld it rise and recommence a new -day. He pointed out to me the shifting colours of the landscape and -the appearances of the sky. "This is what it is to live," he cried; -"how I enjoy existence! But you, my dear Frankenstein, wherefore are -you desponding and sorrowful!" In truth, I was occupied by gloomy -thoughts and neither saw the descent of the evening star nor the golden -sunrise reflected in the Rhine. And you, my friend, would be far more -amused with the journal of Clerval, who observed the scenery with an -eye of feeling and delight, than in listening to my reflections. I, a -miserable wretch, haunted by a curse that shut up every avenue to -enjoyment. - -We had agreed to descend the Rhine in a boat from Strasbourg to -Rotterdam, whence we might take shipping for London. During this -voyage we passed many willowy islands and saw several beautiful towns. -We stayed a day at Mannheim, and on the fifth from our departure from -Strasbourg, arrived at Mainz. The course of the Rhine below Mainz -becomes much more picturesque. The river descends rapidly and winds -between hills, not high, but steep, and of beautiful forms. We saw -many ruined castles standing on the edges of precipices, surrounded by -black woods, high and inaccessible. This part of the Rhine, indeed, -presents a singularly variegated landscape. In one spot you view -rugged hills, ruined castles overlooking tremendous precipices, with -the dark Rhine rushing beneath; and on the sudden turn of a promontory, -flourishing vineyards with green sloping banks and a meandering river -and populous towns occupy the scene. - -We travelled at the time of the vintage and heard the song of the -labourers as we glided down the stream. Even I, depressed in mind, and -my spirits continually agitated by gloomy feelings, even I was pleased. -I lay at the bottom of the boat, and as I gazed on the cloudless blue -sky, I seemed to drink in a tranquillity to which I had long been a -stranger. And if these were my sensations, who can describe those of -Henry? He felt as if he had been transported to fairy-land and enjoyed -a happiness seldom tasted by man. "I have seen," he said, "the most -beautiful scenes of my own country; I have visited the lakes of Lucerne -and Uri, where the snowy mountains descend almost perpendicularly to -the water, casting black and impenetrable shades, which would cause a -gloomy and mournful appearance were it not for the most verdant islands -that believe the eye by their gay appearance; I have seen this lake -agitated by a tempest, when the wind tore up whirlwinds of water and -gave you an idea of what the water-spout must be on the great ocean; -and the waves dash with fury the base of the mountain, where the priest -and his mistress were overwhelmed by an avalanche and where their dying -voices are still said to be heard amid the pauses of the nightly wind; -I have seen the mountains of La Valais, and the Pays de Vaud; but this -country, Victor, pleases me more than all those wonders. The mountains -of Switzerland are more majestic and strange, but there is a charm in -the banks of this divine river that I never before saw equalled. Look -at that castle which overhangs yon precipice; and that also on the -island, almost concealed amongst the foliage of those lovely trees; and -now that group of labourers coming from among their vines; and that -village half hid in the recess of the mountain. Oh, surely the spirit -that inhabits and guards this place has a soul more in harmony with man -than those who pile the glacier or retire to the inaccessible peaks of -the mountains of our own country." Clerval! Beloved friend! Even now -it delights me to record your words and to dwell on the praise of which -you are so eminently deserving. He was a being formed in the "very -poetry of nature." His wild and enthusiastic imagination was chastened -by the sensibility of his heart. His soul overflowed with ardent -affections, and his friendship was of that devoted and wondrous nature -that the world-minded teach us to look for only in the imagination. But -even human sympathies were not sufficient to satisfy his eager mind. -The scenery of external nature, which others regard only with -admiration, he loved with ardour:-- - - - ----The sounding cataract - Haunted him like a passion: the tall rock, - The mountain, and the deep and gloomy wood, - Their colours and their forms, were then to him - An appetite; a feeling, and a love, - That had no need of a remoter charm, - By thought supplied, or any interest - Unborrow'd from the eye. - - [Wordsworth's "Tintern Abbey".] - - -And where does he now exist? Is this gentle and lovely being lost -forever? Has this mind, so replete with ideas, imaginations fanciful -and magnificent, which formed a world, whose existence depended on the -life of its creator;--has this mind perished? Does it now only exist -in my memory? No, it is not thus; your form so divinely wrought, and -beaming with beauty, has decayed, but your spirit still visits and -consoles your unhappy friend. - -Pardon this gush of sorrow; these ineffectual words are but a slight -tribute to the unexampled worth of Henry, but they soothe my heart, -overflowing with the anguish which his remembrance creates. I will -proceed with my tale. - -Beyond Cologne we descended to the plains of Holland; and we resolved -to post the remainder of our way, for the wind was contrary and the -stream of the river was too gentle to aid us. Our journey here lost -the interest arising from beautiful scenery, but we arrived in a few -days at Rotterdam, whence we proceeded by sea to England. It was on a -clear morning, in the latter days of December, that I first saw the -white cliffs of Britain. The banks of the Thames presented a new -scene; they were flat but fertile, and almost every town was marked by -the remembrance of some story. We saw Tilbury Fort and remembered the -Spanish Armada, Gravesend, Woolwich, and Greenwich--places which I had -heard of even in my country. - -At length we saw the numerous steeples of London, St. Paul's towering -above all, and the Tower famed in English history. - - - -Chapter 19 - -London was our present point of rest; we determined to remain several -months in this wonderful and celebrated city. Clerval desired the -intercourse of the men of genius and talent who flourished at this -time, but this was with me a secondary object; I was principally -occupied with the means of obtaining the information necessary for the -completion of my promise and quickly availed myself of the letters of -introduction that I had brought with me, addressed to the most -distinguished natural philosophers. - -If this journey had taken place during my days of study and happiness, -it would have afforded me inexpressible pleasure. But a blight had -come over my existence, and I only visited these people for the sake of -the information they might give me on the subject in which my interest -was so terribly profound. Company was irksome to me; when alone, I -could fill my mind with the sights of heaven and earth; the voice of -Henry soothed me, and I could thus cheat myself into a transitory -peace. But busy, uninteresting, joyous faces brought back despair to -my heart. I saw an insurmountable barrier placed between me and my -fellow men; this barrier was sealed with the blood of William and -Justine, and to reflect on the events connected with those names filled -my soul with anguish. - -But in Clerval I saw the image of my former self; he was inquisitive -and anxious to gain experience and instruction. The difference of -manners which he observed was to him an inexhaustible source of -instruction and amusement. He was also pursuing an object he had long -had in view. His design was to visit India, in the belief that he had -in his knowledge of its various languages, and in the views he had -taken of its society, the means of materially assisting the progress of -European colonization and trade. In Britain only could he further the -execution of his plan. He was forever busy, and the only check to his -enjoyments was my sorrowful and dejected mind. I tried to conceal this -as much as possible, that I might not debar him from the pleasures -natural to one who was entering on a new scene of life, undisturbed by -any care or bitter recollection. I often refused to accompany him, -alleging another engagement, that I might remain alone. I now also -began to collect the materials necessary for my new creation, and this -was to me like the torture of single drops of water continually falling -on the head. Every thought that was devoted to it was an extreme -anguish, and every word that I spoke in allusion to it caused my lips -to quiver, and my heart to palpitate. - -After passing some months in London, we received a letter from a person -in Scotland who had formerly been our visitor at Geneva. He mentioned -the beauties of his native country and asked us if those were not -sufficient allurements to induce us to prolong our journey as far north -as Perth, where he resided. Clerval eagerly desired to accept this -invitation, and I, although I abhorred society, wished to view again -mountains and streams and all the wondrous works with which Nature -adorns her chosen dwelling-places. We had arrived in England at the -beginning of October, and it was now February. We accordingly -determined to commence our journey towards the north at the expiration -of another month. In this expedition we did not intend to follow the -great road to Edinburgh, but to visit Windsor, Oxford, Matlock, and the -Cumberland lakes, resolving to arrive at the completion of this tour -about the end of July. I packed up my chemical instruments and the -materials I had collected, resolving to finish my labours in some -obscure nook in the northern highlands of Scotland. - -We quitted London on the 27th of March and remained a few days at -Windsor, rambling in its beautiful forest. This was a new scene to us -mountaineers; the majestic oaks, the quantity of game, and the herds of -stately deer were all novelties to us. - -From thence we proceeded to Oxford. As we entered this city our minds -were filled with the remembrance of the events that had been transacted -there more than a century and a half before. It was here that Charles -I. had collected his forces. This city had remained faithful to him, -after the whole nation had forsaken his cause to join the standard of -Parliament and liberty. The memory of that unfortunate king and his -companions, the amiable Falkland, the insolent Goring, his queen, and -son, gave a peculiar interest to every part of the city which they -might be supposed to have inhabited. The spirit of elder days found a -dwelling here, and we delighted to trace its footsteps. If these -feelings had not found an imaginary gratification, the appearance of -the city had yet in itself sufficient beauty to obtain our admiration. -The colleges are ancient and picturesque; the streets are almost -magnificent; and the lovely Isis, which flows beside it through meadows -of exquisite verdure, is spread forth into a placid expanse of waters, -which reflects its majestic assemblage of towers, and spires, and -domes, embosomed among aged trees. - -I enjoyed this scene, and yet my enjoyment was embittered both by the -memory of the past and the anticipation of the future. I was formed -for peaceful happiness. During my youthful days discontent never -visited my mind, and if I was ever overcome by ennui, the sight of what -is beautiful in nature or the study of what is excellent and sublime in -the productions of man could always interest my heart and communicate -elasticity to my spirits. But I am a blasted tree; the bolt has -entered my soul; and I felt then that I should survive to exhibit what -I shall soon cease to be--a miserable spectacle of wrecked humanity, -pitiable to others and intolerable to myself. - -We passed a considerable period at Oxford, rambling among its environs -and endeavouring to identify every spot which might relate to the most -animating epoch of English history. Our little voyages of discovery -were often prolonged by the successive objects that presented -themselves. We visited the tomb of the illustrious Hampden and the -field on which that patriot fell. For a moment my soul was elevated -from its debasing and miserable fears to contemplate the divine ideas -of liberty and self sacrifice of which these sights were the monuments -and the remembrancers. For an instant I dared to shake off my chains -and look around me with a free and lofty spirit, but the iron had eaten -into my flesh, and I sank again, trembling and hopeless, into my -miserable self. - -We left Oxford with regret and proceeded to Matlock, which was our next -place of rest. The country in the neighbourhood of this village -resembled, to a greater degree, the scenery of Switzerland; but -everything is on a lower scale, and the green hills want the crown of -distant white Alps which always attend on the piny mountains of my -native country. We visited the wondrous cave and the little cabinets -of natural history, where the curiosities are disposed in the same -manner as in the collections at Servox and Chamounix. The latter name -made me tremble when pronounced by Henry, and I hastened to quit -Matlock, with which that terrible scene was thus associated. - -From Derby, still journeying northwards, we passed two months in -Cumberland and Westmorland. I could now almost fancy myself among the -Swiss mountains. The little patches of snow which yet lingered on the -northern sides of the mountains, the lakes, and the dashing of the -rocky streams were all familiar and dear sights to me. Here also we -made some acquaintances, who almost contrived to cheat me into -happiness. The delight of Clerval was proportionably greater than -mine; his mind expanded in the company of men of talent, and he found -in his own nature greater capacities and resources than he could have -imagined himself to have possessed while he associated with his -inferiors. "I could pass my life here," said he to me; "and among -these mountains I should scarcely regret Switzerland and the Rhine." - -But he found that a traveller's life is one that includes much pain -amidst its enjoyments. His feelings are forever on the stretch; and -when he begins to sink into repose, he finds himself obliged to quit -that on which he rests in pleasure for something new, which again -engages his attention, and which also he forsakes for other novelties. - -We had scarcely visited the various lakes of Cumberland and Westmorland -and conceived an affection for some of the inhabitants when the period -of our appointment with our Scotch friend approached, and we left them -to travel on. For my own part I was not sorry. I had now neglected my -promise for some time, and I feared the effects of the daemon's -disappointment. He might remain in Switzerland and wreak his vengeance -on my relatives. This idea pursued me and tormented me at every moment -from which I might otherwise have snatched repose and peace. I waited -for my letters with feverish impatience; if they were delayed I was -miserable and overcome by a thousand fears; and when they arrived and I -saw the superscription of Elizabeth or my father, I hardly dared to -read and ascertain my fate. Sometimes I thought that the fiend -followed me and might expedite my remissness by murdering my companion. -When these thoughts possessed me, I would not quit Henry for a moment, -but followed him as his shadow, to protect him from the fancied rage of -his destroyer. I felt as if I had committed some great crime, the -consciousness of which haunted me. I was guiltless, but I had indeed -drawn down a horrible curse upon my head, as mortal as that of crime. - -I visited Edinburgh with languid eyes and mind; and yet that city might -have interested the most unfortunate being. Clerval did not like it so -well as Oxford, for the antiquity of the latter city was more pleasing -to him. But the beauty and regularity of the new town of Edinburgh, -its romantic castle and its environs, the most delightful in the world, -Arthur's Seat, St. Bernard's Well, and the Pentland Hills compensated -him for the change and filled him with cheerfulness and admiration. But -I was impatient to arrive at the termination of my journey. - -We left Edinburgh in a week, passing through Coupar, St. Andrew's, and -along the banks of the Tay, to Perth, where our friend expected us. -But I was in no mood to laugh and talk with strangers or enter into -their feelings or plans with the good humour expected from a guest; and -accordingly I told Clerval that I wished to make the tour of Scotland -alone. "Do you," said I, "enjoy yourself, and let this be our -rendezvous. I may be absent a month or two; but do not interfere with -my motions, I entreat you; leave me to peace and solitude for a short -time; and when I return, I hope it will be with a lighter heart, more -congenial to your own temper." - -Henry wished to dissuade me, but seeing me bent on this plan, ceased to -remonstrate. He entreated me to write often. "I had rather be with -you," he said, "in your solitary rambles, than with these Scotch -people, whom I do not know; hasten, then, my dear friend, to return, -that I may again feel myself somewhat at home, which I cannot do in -your absence." - -Having parted from my friend, I determined to visit some remote spot of -Scotland and finish my work in solitude. I did not doubt but that the -monster followed me and would discover himself to me when I should have -finished, that he might receive his companion. With this resolution I -traversed the northern highlands and fixed on one of the remotest of -the Orkneys as the scene of my labours. It was a place fitted for such -a work, being hardly more than a rock whose high sides were continually -beaten upon by the waves. The soil was barren, scarcely affording -pasture for a few miserable cows, and oatmeal for its inhabitants, -which consisted of five persons, whose gaunt and scraggy limbs gave -tokens of their miserable fare. Vegetables and bread, when they -indulged in such luxuries, and even fresh water, was to be procured -from the mainland, which was about five miles distant. - -On the whole island there were but three miserable huts, and one of -these was vacant when I arrived. This I hired. It contained but two -rooms, and these exhibited all the squalidness of the most miserable -penury. The thatch had fallen in, the walls were unplastered, and the -door was off its hinges. I ordered it to be repaired, bought some -furniture, and took possession, an incident which would doubtless have -occasioned some surprise had not all the senses of the cottagers been -benumbed by want and squalid poverty. As it was, I lived ungazed at -and unmolested, hardly thanked for the pittance of food and clothes -which I gave, so much does suffering blunt even the coarsest sensations -of men. - -In this retreat I devoted the morning to labour; but in the evening, -when the weather permitted, I walked on the stony beach of the sea to -listen to the waves as they roared and dashed at my feet. It was a -monotonous yet ever-changing scene. I thought of Switzerland; it was -far different from this desolate and appalling landscape. Its hills -are covered with vines, and its cottages are scattered thickly in the -plains. Its fair lakes reflect a blue and gentle sky, and when -troubled by the winds, their tumult is but as the play of a lively -infant when compared to the roarings of the giant ocean. - -In this manner I distributed my occupations when I first arrived, but -as I proceeded in my labour, it became every day more horrible and -irksome to me. Sometimes I could not prevail on myself to enter my -laboratory for several days, and at other times I toiled day and night -in order to complete my work. It was, indeed, a filthy process in -which I was engaged. During my first experiment, a kind of -enthusiastic frenzy had blinded me to the horror of my employment; my -mind was intently fixed on the consummation of my labour, and my eyes -were shut to the horror of my proceedings. But now I went to it in -cold blood, and my heart often sickened at the work of my hands. - -Thus situated, employed in the most detestable occupation, immersed in -a solitude where nothing could for an instant call my attention from -the actual scene in which I was engaged, my spirits became unequal; I -grew restless and nervous. Every moment I feared to meet my -persecutor. Sometimes I sat with my eyes fixed on the ground, fearing -to raise them lest they should encounter the object which I so much -dreaded to behold. I feared to wander from the sight of my fellow -creatures lest when alone he should come to claim his companion. - -In the mean time I worked on, and my labour was already considerably -advanced. I looked towards its completion with a tremulous and eager -hope, which I dared not trust myself to question but which was -intermixed with obscure forebodings of evil that made my heart sicken -in my bosom. - - - -Chapter 20 - -I sat one evening in my laboratory; the sun had set, and the moon was -just rising from the sea; I had not sufficient light for my employment, -and I remained idle, in a pause of consideration of whether I should -leave my labour for the night or hasten its conclusion by an -unremitting attention to it. As I sat, a train of reflection occurred -to me which led me to consider the effects of what I was now doing. -Three years before, I was engaged in the same manner and had created a -fiend whose unparalleled barbarity had desolated my heart and filled it -forever with the bitterest remorse. I was now about to form another -being of whose dispositions I was alike ignorant; she might become ten -thousand times more malignant than her mate and delight, for its own -sake, in murder and wretchedness. He had sworn to quit the -neighbourhood of man and hide himself in deserts, but she had not; and -she, who in all probability was to become a thinking and reasoning -animal, might refuse to comply with a compact made before her creation. -They might even hate each other; the creature who already lived loathed -his own deformity, and might he not conceive a greater abhorrence for -it when it came before his eyes in the female form? She also might -turn with disgust from him to the superior beauty of man; she might -quit him, and he be again alone, exasperated by the fresh provocation -of being deserted by one of his own species. Even if they were to -leave Europe and inhabit the deserts of the new world, yet one of the -first results of those sympathies for which the daemon thirsted would -be children, and a race of devils would be propagated upon the earth -who might make the very existence of the species of man a condition -precarious and full of terror. Had I right, for my own benefit, to -inflict this curse upon everlasting generations? I had before been -moved by the sophisms of the being I had created; I had been struck -senseless by his fiendish threats; but now, for the first time, the -wickedness of my promise burst upon me; I shuddered to think that -future ages might curse me as their pest, whose selfishness had not -hesitated to buy its own peace at the price, perhaps, of the existence -of the whole human race. - -I trembled and my heart failed within me, when, on looking up, I saw by -the light of the moon the daemon at the casement. A ghastly grin -wrinkled his lips as he gazed on me, where I sat fulfilling the task -which he had allotted to me. Yes, he had followed me in my travels; he -had loitered in forests, hid himself in caves, or taken refuge in wide -and desert heaths; and he now came to mark my progress and claim the -fulfilment of my promise. - -As I looked on him, his countenance expressed the utmost extent of -malice and treachery. I thought with a sensation of madness on my -promise of creating another like to him, and trembling with passion, -tore to pieces the thing on which I was engaged. The wretch saw me -destroy the creature on whose future existence he depended for -happiness, and with a howl of devilish despair and revenge, withdrew. - -I left the room, and locking the door, made a solemn vow in my own -heart never to resume my labours; and then, with trembling steps, I -sought my own apartment. I was alone; none were near me to dissipate -the gloom and relieve me from the sickening oppression of the most -terrible reveries. - -Several hours passed, and I remained near my window gazing on the sea; -it was almost motionless, for the winds were hushed, and all nature -reposed under the eye of the quiet moon. A few fishing vessels alone -specked the water, and now and then the gentle breeze wafted the sound -of voices as the fishermen called to one another. I felt the silence, -although I was hardly conscious of its extreme profundity, until my ear -was suddenly arrested by the paddling of oars near the shore, and a -person landed close to my house. - -In a few minutes after, I heard the creaking of my door, as if some one -endeavoured to open it softly. I trembled from head to foot; I felt a -presentiment of who it was and wished to rouse one of the peasants who -dwelt in a cottage not far from mine; but I was overcome by the -sensation of helplessness, so often felt in frightful dreams, when you -in vain endeavour to fly from an impending danger, and was rooted to -the spot. Presently I heard the sound of footsteps along the passage; -the door opened, and the wretch whom I dreaded appeared. - -Shutting the door, he approached me and said in a smothered voice, "You -have destroyed the work which you began; what is it that you intend? -Do you dare to break your promise? I have endured toil and misery; I -left Switzerland with you; I crept along the shores of the Rhine, among -its willow islands and over the summits of its hills. I have dwelt -many months in the heaths of England and among the deserts of Scotland. -I have endured incalculable fatigue, and cold, and hunger; do you dare -destroy my hopes?" - -"Begone! I do break my promise; never will I create another like -yourself, equal in deformity and wickedness." - -"Slave, I before reasoned with you, but you have proved yourself -unworthy of my condescension. Remember that I have power; you believe -yourself miserable, but I can make you so wretched that the light of -day will be hateful to you. You are my creator, but I am your master; -obey!" - -"The hour of my irresolution is past, and the period of your power is -arrived. Your threats cannot move me to do an act of wickedness; but -they confirm me in a determination of not creating you a companion in -vice. Shall I, in cool blood, set loose upon the earth a daemon whose -delight is in death and wretchedness? Begone! I am firm, and your -words will only exasperate my rage." - -The monster saw my determination in my face and gnashed his teeth in -the impotence of anger. "Shall each man," cried he, "find a wife for -his bosom, and each beast have his mate, and I be alone? I had -feelings of affection, and they were requited by detestation and scorn. -Man! You may hate, but beware! Your hours will pass in dread and -misery, and soon the bolt will fall which must ravish from you your -happiness forever. Are you to be happy while I grovel in the intensity -of my wretchedness? You can blast my other passions, but revenge -remains--revenge, henceforth dearer than light or food! I may die, but -first you, my tyrant and tormentor, shall curse the sun that gazes on -your misery. Beware, for I am fearless and therefore powerful. I will -watch with the wiliness of a snake, that I may sting with its venom. -Man, you shall repent of the injuries you inflict." - -"Devil, cease; and do not poison the air with these sounds of malice. -I have declared my resolution to you, and I am no coward to bend -beneath words. Leave me; I am inexorable." - -"It is well. I go; but remember, I shall be with you on your -wedding-night." - -I started forward and exclaimed, "Villain! Before you sign my -death-warrant, be sure that you are yourself safe." - -I would have seized him, but he eluded me and quitted the house with -precipitation. In a few moments I saw him in his boat, which shot -across the waters with an arrowy swiftness and was soon lost amidst the -waves. - -All was again silent, but his words rang in my ears. I burned with -rage to pursue the murderer of my peace and precipitate him into the -ocean. I walked up and down my room hastily and perturbed, while my -imagination conjured up a thousand images to torment and sting me. Why -had I not followed him and closed with him in mortal strife? But I had -suffered him to depart, and he had directed his course towards the -mainland. I shuddered to think who might be the next victim sacrificed -to his insatiate revenge. And then I thought again of his words--"I -WILL BE WITH YOU ON YOUR WEDDING-NIGHT." That, then, was the period -fixed for the fulfilment of my destiny. In that hour I should die and -at once satisfy and extinguish his malice. The prospect did not move -me to fear; yet when I thought of my beloved Elizabeth, of her tears -and endless sorrow, when she should find her lover so barbarously -snatched from her, tears, the first I had shed for many months, -streamed from my eyes, and I resolved not to fall before my enemy -without a bitter struggle. - -The night passed away, and the sun rose from the ocean; my feelings -became calmer, if it may be called calmness when the violence of rage -sinks into the depths of despair. I left the house, the horrid scene -of the last night's contention, and walked on the beach of the sea, -which I almost regarded as an insuperable barrier between me and my -fellow creatures; nay, a wish that such should prove the fact stole -across me. - -I desired that I might pass my life on that barren rock, wearily, it is -true, but uninterrupted by any sudden shock of misery. If I returned, -it was to be sacrificed or to see those whom I most loved die under the -grasp of a daemon whom I had myself created. - -I walked about the isle like a restless spectre, separated from all it -loved and miserable in the separation. When it became noon, and the -sun rose higher, I lay down on the grass and was overpowered by a deep -sleep. I had been awake the whole of the preceding night, my nerves -were agitated, and my eyes inflamed by watching and misery. The sleep -into which I now sank refreshed me; and when I awoke, I again felt as -if I belonged to a race of human beings like myself, and I began to -reflect upon what had passed with greater composure; yet still the -words of the fiend rang in my ears like a death-knell; they appeared -like a dream, yet distinct and oppressive as a reality. - -The sun had far descended, and I still sat on the shore, satisfying my -appetite, which had become ravenous, with an oaten cake, when I saw a -fishing-boat land close to me, and one of the men brought me a packet; -it contained letters from Geneva, and one from Clerval entreating me to -join him. He said that he was wearing away his time fruitlessly where -he was, that letters from the friends he had formed in London desired -his return to complete the negotiation they had entered into for his -Indian enterprise. He could not any longer delay his departure; but as -his journey to London might be followed, even sooner than he now -conjectured, by his longer voyage, he entreated me to bestow as much of -my society on him as I could spare. He besought me, therefore, to -leave my solitary isle and to meet him at Perth, that we might proceed -southwards together. This letter in a degree recalled me to life, and -I determined to quit my island at the expiration of two days. Yet, -before I departed, there was a task to perform, on which I shuddered to -reflect; I must pack up my chemical instruments, and for that purpose I -must enter the room which had been the scene of my odious work, and I -must handle those utensils the sight of which was sickening to me. The -next morning, at daybreak, I summoned sufficient courage and unlocked -the door of my laboratory. The remains of the half-finished creature, -whom I had destroyed, lay scattered on the floor, and I almost felt as -if I had mangled the living flesh of a human being. I paused to -collect myself and then entered the chamber. With trembling hand I -conveyed the instruments out of the room, but I reflected that I ought -not to leave the relics of my work to excite the horror and suspicion -of the peasants; and I accordingly put them into a basket, with a great -quantity of stones, and laying them up, determined to throw them into -the sea that very night; and in the meantime I sat upon the beach, -employed in cleaning and arranging my chemical apparatus. - -Nothing could be more complete than the alteration that had taken place -in my feelings since the night of the appearance of the daemon. I had -before regarded my promise with a gloomy despair as a thing that, with -whatever consequences, must be fulfilled; but I now felt as if a film -had been taken from before my eyes and that I for the first time saw -clearly. The idea of renewing my labours did not for one instant occur -to me; the threat I had heard weighed on my thoughts, but I did not -reflect that a voluntary act of mine could avert it. I had resolved in -my own mind that to create another like the fiend I had first made -would be an act of the basest and most atrocious selfishness, and I -banished from my mind every thought that could lead to a different -conclusion. - -Between two and three in the morning the moon rose; and I then, putting -my basket aboard a little skiff, sailed out about four miles from the -shore. The scene was perfectly solitary; a few boats were returning -towards land, but I sailed away from them. I felt as if I was about -the commission of a dreadful crime and avoided with shuddering anxiety -any encounter with my fellow creatures. At one time the moon, which -had before been clear, was suddenly overspread by a thick cloud, and I -took advantage of the moment of darkness and cast my basket into the -sea; I listened to the gurgling sound as it sank and then sailed away -from the spot. The sky became clouded, but the air was pure, although -chilled by the northeast breeze that was then rising. But it refreshed -me and filled me with such agreeable sensations that I resolved to -prolong my stay on the water, and fixing the rudder in a direct -position, stretched myself at the bottom of the boat. Clouds hid the -moon, everything was obscure, and I heard only the sound of the boat as -its keel cut through the waves; the murmur lulled me, and in a short -time I slept soundly. I do not know how long I remained in this -situation, but when I awoke I found that the sun had already mounted -considerably. The wind was high, and the waves continually threatened -the safety of my little skiff. I found that the wind was northeast and -must have driven me far from the coast from which I had embarked. I -endeavoured to change my course but quickly found that if I again made -the attempt the boat would be instantly filled with water. Thus -situated, my only resource was to drive before the wind. I confess -that I felt a few sensations of terror. I had no compass with me and -was so slenderly acquainted with the geography of this part of the -world that the sun was of little benefit to me. I might be driven into -the wide Atlantic and feel all the tortures of starvation or be -swallowed up in the immeasurable waters that roared and buffeted around -me. I had already been out many hours and felt the torment of a -burning thirst, a prelude to my other sufferings. I looked on the -heavens, which were covered by clouds that flew before the wind, only -to be replaced by others; I looked upon the sea; it was to be my grave. -"Fiend," I exclaimed, "your task is already fulfilled!" I thought of -Elizabeth, of my father, and of Clerval--all left behind, on whom the -monster might satisfy his sanguinary and merciless passions. This idea -plunged me into a reverie so despairing and frightful that even now, -when the scene is on the point of closing before me forever, I shudder -to reflect on it. - -Some hours passed thus; but by degrees, as the sun declined towards the -horizon, the wind died away into a gentle breeze and the sea became -free from breakers. But these gave place to a heavy swell; I felt sick -and hardly able to hold the rudder, when suddenly I saw a line of high -land towards the south. - -Almost spent, as I was, by fatigue and the dreadful suspense I endured -for several hours, this sudden certainty of life rushed like a flood of -warm joy to my heart, and tears gushed from my eyes. - -How mutable are our feelings, and how strange is that clinging love we -have of life even in the excess of misery! I constructed another sail -with a part of my dress and eagerly steered my course towards the land. -It had a wild and rocky appearance, but as I approached nearer I easily -perceived the traces of cultivation. I saw vessels near the shore and -found myself suddenly transported back to the neighbourhood of -civilized man. I carefully traced the windings of the land and hailed -a steeple which I at length saw issuing from behind a small promontory. -As I was in a state of extreme debility, I resolved to sail directly -towards the town, as a place where I could most easily procure -nourishment. Fortunately I had money with me. - -As I turned the promontory I perceived a small neat town and a good -harbour, which I entered, my heart bounding with joy at my unexpected -escape. - -As I was occupied in fixing the boat and arranging the sails, several -people crowded towards the spot. They seemed much surprised at my -appearance, but instead of offering me any assistance, whispered -together with gestures that at any other time might have produced in me -a slight sensation of alarm. As it was, I merely remarked that they -spoke English, and I therefore addressed them in that language. "My -good friends," said I, "will you be so kind as to tell me the name of -this town and inform me where I am?" - -"You will know that soon enough," replied a man with a hoarse voice. -"Maybe you are come to a place that will not prove much to your taste, -but you will not be consulted as to your quarters, I promise you." - -I was exceedingly surprised on receiving so rude an answer from a -stranger, and I was also disconcerted on perceiving the frowning and -angry countenances of his companions. "Why do you answer me so -roughly?" I replied. "Surely it is not the custom of Englishmen to -receive strangers so inhospitably." - -"I do not know," said the man, "what the custom of the English may be, -but it is the custom of the Irish to hate villains." While this strange -dialogue continued, I perceived the crowd rapidly increase. Their -faces expressed a mixture of curiosity and anger, which annoyed and in -some degree alarmed me. - -I inquired the way to the inn, but no one replied. I then moved -forward, and a murmuring sound arose from the crowd as they followed -and surrounded me, when an ill-looking man approaching tapped me on the -shoulder and said, "Come, sir, you must follow me to Mr. Kirwin's to -give an account of yourself." - -"Who is Mr. Kirwin? Why am I to give an account of myself? Is not -this a free country?" - -"Ay, sir, free enough for honest folks. Mr. Kirwin is a magistrate, -and you are to give an account of the death of a gentleman who was -found murdered here last night." - -This answer startled me, but I presently recovered myself. I was -innocent; that could easily be proved; accordingly I followed my -conductor in silence and was led to one of the best houses in the town. -I was ready to sink from fatigue and hunger, but being surrounded by a -crowd, I thought it politic to rouse all my strength, that no physical -debility might be construed into apprehension or conscious guilt. -Little did I then expect the calamity that was in a few moments to -overwhelm me and extinguish in horror and despair all fear of ignominy -or death. I must pause here, for it requires all my fortitude to recall -the memory of the frightful events which I am about to relate, in -proper detail, to my recollection. - - - -Chapter 21 - -I was soon introduced into the presence of the magistrate, an old -benevolent man with calm and mild manners. He looked upon me, however, -with some degree of severity, and then, turning towards my conductors, -he asked who appeared as witnesses on this occasion. - -About half a dozen men came forward; and, one being selected by the -magistrate, he deposed that he had been out fishing the night before -with his son and brother-in-law, Daniel Nugent, when, about ten -o'clock, they observed a strong northerly blast rising, and they -accordingly put in for port. It was a very dark night, as the moon had -not yet risen; they did not land at the harbour, but, as they had been -accustomed, at a creek about two miles below. He walked on first, -carrying a part of the fishing tackle, and his companions followed him -at some distance. - -As he was proceeding along the sands, he struck his foot against -something and fell at his length on the ground. His companions came up -to assist him, and by the light of their lantern they found that he had -fallen on the body of a man, who was to all appearance dead. Their -first supposition was that it was the corpse of some person who had -been drowned and was thrown on shore by the waves, but on examination -they found that the clothes were not wet and even that the body was not -then cold. They instantly carried it to the cottage of an old woman -near the spot and endeavoured, but in vain, to restore it to life. It -appeared to be a handsome young man, about five and twenty years of -age. He had apparently been strangled, for there was no sign of any -violence except the black mark of fingers on his neck. - -The first part of this deposition did not in the least interest me, but -when the mark of the fingers was mentioned I remembered the murder of -my brother and felt myself extremely agitated; my limbs trembled, and a -mist came over my eyes, which obliged me to lean on a chair for -support. The magistrate observed me with a keen eye and of course drew -an unfavourable augury from my manner. - -The son confirmed his father's account, but when Daniel Nugent was -called he swore positively that just before the fall of his companion, -he saw a boat, with a single man in it, at a short distance from the -shore; and as far as he could judge by the light of a few stars, it was -the same boat in which I had just landed. A woman deposed that she -lived near the beach and was standing at the door of her cottage, -waiting for the return of the fishermen, about an hour before she heard -of the discovery of the body, when she saw a boat with only one man in -it push off from that part of the shore where the corpse was afterwards -found. - -Another woman confirmed the account of the fishermen having brought the -body into her house; it was not cold. They put it into a bed and -rubbed it, and Daniel went to the town for an apothecary, but life was -quite gone. - -Several other men were examined concerning my landing, and they agreed -that, with the strong north wind that had arisen during the night, it -was very probable that I had beaten about for many hours and had been -obliged to return nearly to the same spot from which I had departed. -Besides, they observed that it appeared that I had brought the body -from another place, and it was likely that as I did not appear to know -the shore, I might have put into the harbour ignorant of the distance -of the town of ---- from the place where I had deposited the corpse. - -Mr. Kirwin, on hearing this evidence, desired that I should be taken -into the room where the body lay for interment, that it might be -observed what effect the sight of it would produce upon me. This idea -was probably suggested by the extreme agitation I had exhibited when -the mode of the murder had been described. I was accordingly -conducted, by the magistrate and several other persons, to the inn. I -could not help being struck by the strange coincidences that had taken -place during this eventful night; but, knowing that I had been -conversing with several persons in the island I had inhabited about the -time that the body had been found, I was perfectly tranquil as to the -consequences of the affair. I entered the room where the corpse lay -and was led up to the coffin. How can I describe my sensations on -beholding it? I feel yet parched with horror, nor can I reflect on -that terrible moment without shuddering and agony. The examination, -the presence of the magistrate and witnesses, passed like a dream from -my memory when I saw the lifeless form of Henry Clerval stretched -before me. I gasped for breath, and throwing myself on the body, I -exclaimed, "Have my murderous machinations deprived you also, my -dearest Henry, of life? Two I have already destroyed; other victims -await their destiny; but you, Clerval, my friend, my benefactor--" - -The human frame could no longer support the agonies that I endured, and -I was carried out of the room in strong convulsions. A fever succeeded -to this. I lay for two months on the point of death; my ravings, as I -afterwards heard, were frightful; I called myself the murderer of -William, of Justine, and of Clerval. Sometimes I entreated my -attendants to assist me in the destruction of the fiend by whom I was -tormented; and at others I felt the fingers of the monster already -grasping my neck, and screamed aloud with agony and terror. -Fortunately, as I spoke my native language, Mr. Kirwin alone understood -me; but my gestures and bitter cries were sufficient to affright the -other witnesses. Why did I not die? More miserable than man ever was -before, why did I not sink into forgetfulness and rest? Death snatches -away many blooming children, the only hopes of their doting parents; -how many brides and youthful lovers have been one day in the bloom of -health and hope, and the next a prey for worms and the decay of the -tomb! Of what materials was I made that I could thus resist so many -shocks, which, like the turning of the wheel, continually renewed the -torture? - -But I was doomed to live and in two months found myself as awaking from -a dream, in a prison, stretched on a wretched bed, surrounded by -jailers, turnkeys, bolts, and all the miserable apparatus of a dungeon. -It was morning, I remember, when I thus awoke to understanding; I had -forgotten the particulars of what had happened and only felt as if some -great misfortune had suddenly overwhelmed me; but when I looked around -and saw the barred windows and the squalidness of the room in which I -was, all flashed across my memory and I groaned bitterly. - -This sound disturbed an old woman who was sleeping in a chair beside -me. She was a hired nurse, the wife of one of the turnkeys, and her -countenance expressed all those bad qualities which often characterize -that class. The lines of her face were hard and rude, like that of -persons accustomed to see without sympathizing in sights of misery. Her -tone expressed her entire indifference; she addressed me in English, -and the voice struck me as one that I had heard during my sufferings. -"Are you better now, sir?" said she. - -I replied in the same language, with a feeble voice, "I believe I am; -but if it be all true, if indeed I did not dream, I am sorry that I am -still alive to feel this misery and horror." - -"For that matter," replied the old woman, "if you mean about the -gentleman you murdered, I believe that it were better for you if you -were dead, for I fancy it will go hard with you! However, that's none -of my business; I am sent to nurse you and get you well; I do my duty -with a safe conscience; it were well if everybody did the same." - -I turned with loathing from the woman who could utter so unfeeling a -speech to a person just saved, on the very edge of death; but I felt -languid and unable to reflect on all that had passed. The whole series -of my life appeared to me as a dream; I sometimes doubted if indeed it -were all true, for it never presented itself to my mind with the force -of reality. - -As the images that floated before me became more distinct, I grew -feverish; a darkness pressed around me; no one was near me who soothed -me with the gentle voice of love; no dear hand supported me. The -physician came and prescribed medicines, and the old woman prepared -them for me; but utter carelessness was visible in the first, and the -expression of brutality was strongly marked in the visage of the -second. Who could be interested in the fate of a murderer but the -hangman who would gain his fee? - -These were my first reflections, but I soon learned that Mr. Kirwin had -shown me extreme kindness. He had caused the best room in the prison -to be prepared for me (wretched indeed was the best); and it was he who -had provided a physician and a nurse. It is true, he seldom came to -see me, for although he ardently desired to relieve the sufferings of -every human creature, he did not wish to be present at the agonies and -miserable ravings of a murderer. He came, therefore, sometimes to see -that I was not neglected, but his visits were short and with long -intervals. One day, while I was gradually recovering, I was seated in -a chair, my eyes half open and my cheeks livid like those in death. I -was overcome by gloom and misery and often reflected I had better seek -death than desire to remain in a world which to me was replete with -wretchedness. At one time I considered whether I should not declare -myself guilty and suffer the penalty of the law, less innocent than -poor Justine had been. Such were my thoughts when the door of my -apartment was opened and Mr. Kirwin entered. His countenance expressed -sympathy and compassion; he drew a chair close to mine and addressed me -in French, "I fear that this place is very shocking to you; can I do -anything to make you more comfortable?" - -"I thank you, but all that you mention is nothing to me; on the whole -earth there is no comfort which I am capable of receiving." - -"I know that the sympathy of a stranger can be but of little relief to -one borne down as you are by so strange a misfortune. But you will, I -hope, soon quit this melancholy abode, for doubtless evidence can -easily be brought to free you from the criminal charge." - -"That is my least concern; I am, by a course of strange events, become -the most miserable of mortals. Persecuted and tortured as I am and -have been, can death be any evil to me?" - -"Nothing indeed could be more unfortunate and agonizing than the -strange chances that have lately occurred. You were thrown, by some -surprising accident, on this shore, renowned for its hospitality, -seized immediately, and charged with murder. The first sight that was -presented to your eyes was the body of your friend, murdered in so -unaccountable a manner and placed, as it were, by some fiend across -your path." - -As Mr. Kirwin said this, notwithstanding the agitation I endured on -this retrospect of my sufferings, I also felt considerable surprise at -the knowledge he seemed to possess concerning me. I suppose some -astonishment was exhibited in my countenance, for Mr. Kirwin hastened -to say, "Immediately upon your being taken ill, all the papers that -were on your person were brought me, and I examined them that I might -discover some trace by which I could send to your relations an account -of your misfortune and illness. I found several letters, and, among -others, one which I discovered from its commencement to be from your -father. I instantly wrote to Geneva; nearly two months have elapsed -since the departure of my letter. But you are ill; even now you -tremble; you are unfit for agitation of any kind." - -"This suspense is a thousand times worse than the most horrible event; -tell me what new scene of death has been acted, and whose murder I am -now to lament?" - -"Your family is perfectly well," said Mr. Kirwin with gentleness; "and -someone, a friend, is come to visit you." - -I know not by what chain of thought the idea presented itself, but it -instantly darted into my mind that the murderer had come to mock at my -misery and taunt me with the death of Clerval, as a new incitement for -me to comply with his hellish desires. I put my hand before my eyes, -and cried out in agony, "Oh! Take him away! I cannot see him; for -God's sake, do not let him enter!" - -Mr. Kirwin regarded me with a troubled countenance. He could not help -regarding my exclamation as a presumption of my guilt and said in -rather a severe tone, "I should have thought, young man, that the -presence of your father would have been welcome instead of inspiring -such violent repugnance." - -"My father!" cried I, while every feature and every muscle was relaxed -from anguish to pleasure. "Is my father indeed come? How kind, how -very kind! But where is he, why does he not hasten to me?" - -My change of manner surprised and pleased the magistrate; perhaps he -thought that my former exclamation was a momentary return of delirium, -and now he instantly resumed his former benevolence. He rose and -quitted the room with my nurse, and in a moment my father entered it. - -Nothing, at this moment, could have given me greater pleasure than the -arrival of my father. I stretched out my hand to him and cried, "Are -you, then, safe--and Elizabeth--and Ernest?" My father calmed me with -assurances of their welfare and endeavoured, by dwelling on these -subjects so interesting to my heart, to raise my desponding spirits; -but he soon felt that a prison cannot be the abode of cheerfulness. - -"What a place is this that you inhabit, my son!" said he, looking -mournfully at the barred windows and wretched appearance of the room. -"You travelled to seek happiness, but a fatality seems to pursue you. -And poor Clerval--" - -The name of my unfortunate and murdered friend was an agitation too -great to be endured in my weak state; I shed tears. "Alas! Yes, my -father," replied I; "some destiny of the most horrible kind hangs over -me, and I must live to fulfil it, or surely I should have died on the -coffin of Henry." - -We were not allowed to converse for any length of time, for the -precarious state of my health rendered every precaution necessary that -could ensure tranquillity. Mr. Kirwin came in and insisted that my -strength should not be exhausted by too much exertion. But the -appearance of my father was to me like that of my good angel, and I -gradually recovered my health. - -As my sickness quitted me, I was absorbed by a gloomy and black -melancholy that nothing could dissipate. The image of Clerval was -forever before me, ghastly and murdered. More than once the agitation -into which these reflections threw me made my friends dread a dangerous -relapse. Alas! Why did they preserve so miserable and detested a -life? It was surely that I might fulfil my destiny, which is now -drawing to a close. Soon, oh, very soon, will death extinguish these -throbbings and relieve me from the mighty weight of anguish that bears -me to the dust; and, in executing the award of justice, I shall also -sink to rest. Then the appearance of death was distant, although the -wish was ever present to my thoughts; and I often sat for hours -motionless and speechless, wishing for some mighty revolution that -might bury me and my destroyer in its ruins. - -The season of the assizes approached. I had already been three months -in prison, and although I was still weak and in continual danger of a -relapse, I was obliged to travel nearly a hundred miles to the country -town where the court was held. Mr. Kirwin charged himself with every -care of collecting witnesses and arranging my defence. I was spared -the disgrace of appearing publicly as a criminal, as the case was not -brought before the court that decides on life and death. The grand -jury rejected the bill, on its being proved that I was on the Orkney -Islands at the hour the body of my friend was found; and a fortnight -after my removal I was liberated from prison. - -My father was enraptured on finding me freed from the vexations of a -criminal charge, that I was again allowed to breathe the fresh -atmosphere and permitted to return to my native country. I did not -participate in these feelings, for to me the walls of a dungeon or a -palace were alike hateful. The cup of life was poisoned forever, and -although the sun shone upon me, as upon the happy and gay of heart, I -saw around me nothing but a dense and frightful darkness, penetrated by -no light but the glimmer of two eyes that glared upon me. Sometimes -they were the expressive eyes of Henry, languishing in death, the dark -orbs nearly covered by the lids and the long black lashes that fringed -them; sometimes it was the watery, clouded eyes of the monster, as I -first saw them in my chamber at Ingolstadt. - -My father tried to awaken in me the feelings of affection. He talked -of Geneva, which I should soon visit, of Elizabeth and Ernest; but -these words only drew deep groans from me. Sometimes, indeed, I felt a -wish for happiness and thought with melancholy delight of my beloved -cousin or longed, with a devouring maladie du pays, to see once more -the blue lake and rapid Rhone, that had been so dear to me in early -childhood; but my general state of feeling was a torpor in which a -prison was as welcome a residence as the divinest scene in nature; and -these fits were seldom interrupted but by paroxysms of anguish and -despair. At these moments I often endeavoured to put an end to the -existence I loathed, and it required unceasing attendance and vigilance -to restrain me from committing some dreadful act of violence. - -Yet one duty remained to me, the recollection of which finally -triumphed over my selfish despair. It was necessary that I should -return without delay to Geneva, there to watch over the lives of those -I so fondly loved and to lie in wait for the murderer, that if any -chance led me to the place of his concealment, or if he dared again to -blast me by his presence, I might, with unfailing aim, put an end to -the existence of the monstrous image which I had endued with the -mockery of a soul still more monstrous. My father still desired to -delay our departure, fearful that I could not sustain the fatigues of a -journey, for I was a shattered wreck--the shadow of a human being. My -strength was gone. I was a mere skeleton, and fever night and day -preyed upon my wasted frame. Still, as I urged our leaving Ireland -with such inquietude and impatience, my father thought it best to -yield. We took our passage on board a vessel bound for Havre-de-Grace -and sailed with a fair wind from the Irish shores. It was midnight. I -lay on the deck looking at the stars and listening to the dashing of -the waves. I hailed the darkness that shut Ireland from my sight, and -my pulse beat with a feverish joy when I reflected that I should soon -see Geneva. The past appeared to me in the light of a frightful dream; -yet the vessel in which I was, the wind that blew me from the detested -shore of Ireland, and the sea which surrounded me told me too forcibly -that I was deceived by no vision and that Clerval, my friend and -dearest companion, had fallen a victim to me and the monster of my -creation. I repassed, in my memory, my whole life--my quiet happiness -while residing with my family in Geneva, the death of my mother, and my -departure for Ingolstadt. I remembered, shuddering, the mad enthusiasm -that hurried me on to the creation of my hideous enemy, and I called to -mind the night in which he first lived. I was unable to pursue the -train of thought; a thousand feelings pressed upon me, and I wept -bitterly. Ever since my recovery from the fever I had been in the -custom of taking every night a small quantity of laudanum, for it was -by means of this drug only that I was enabled to gain the rest -necessary for the preservation of life. Oppressed by the recollection -of my various misfortunes, I now swallowed double my usual quantity and -soon slept profoundly. But sleep did not afford me respite from -thought and misery; my dreams presented a thousand objects that scared -me. Towards morning I was possessed by a kind of nightmare; I felt the -fiend's grasp in my neck and could not free myself from it; groans and -cries rang in my ears. My father, who was watching over me, perceiving -my restlessness, awoke me; the dashing waves were around, the cloudy -sky above, the fiend was not here: a sense of security, a feeling that -a truce was established between the present hour and the irresistible, -disastrous future imparted to me a kind of calm forgetfulness, of which -the human mind is by its structure peculiarly susceptible. - - - -Chapter 22 - -The voyage came to an end. We landed, and proceeded to Paris. I soon -found that I had overtaxed my strength and that I must repose before I -could continue my journey. My father's care and attentions were -indefatigable, but he did not know the origin of my sufferings and -sought erroneous methods to remedy the incurable ill. He wished me to -seek amusement in society. I abhorred the face of man. Oh, not -abhorred! They were my brethren, my fellow beings, and I felt -attracted even to the most repulsive among them, as to creatures of an -angelic nature and celestial mechanism. But I felt that I had no right -to share their intercourse. I had unchained an enemy among them whose -joy it was to shed their blood and to revel in their groans. How they -would, each and all, abhor me and hunt me from the world did they know -my unhallowed acts and the crimes which had their source in me! - -My father yielded at length to my desire to avoid society and strove by -various arguments to banish my despair. Sometimes he thought that I -felt deeply the degradation of being obliged to answer a charge of -murder, and he endeavoured to prove to me the futility of pride. - -"Alas! My father," said I, "how little do you know me. Human beings, -their feelings and passions, would indeed be degraded if such a wretch -as I felt pride. Justine, poor unhappy Justine, was as innocent as I, -and she suffered the same charge; she died for it; and I am the cause -of this--I murdered her. William, Justine, and Henry--they all died by -my hands." - -My father had often, during my imprisonment, heard me make the same -assertion; when I thus accused myself, he sometimes seemed to desire an -explanation, and at others he appeared to consider it as the offspring -of delirium, and that, during my illness, some idea of this kind had -presented itself to my imagination, the remembrance of which I -preserved in my convalescence. - -I avoided explanation and maintained a continual silence concerning the -wretch I had created. I had a persuasion that I should be supposed -mad, and this in itself would forever have chained my tongue. But, -besides, I could not bring myself to disclose a secret which would fill -my hearer with consternation and make fear and unnatural horror the -inmates of his breast. I checked, therefore, my impatient thirst for -sympathy and was silent when I would have given the world to have -confided the fatal secret. Yet, still, words like those I have -recorded would burst uncontrollably from me. I could offer no -explanation of them, but their truth in part relieved the burden of my -mysterious woe. Upon this occasion my father said, with an expression -of unbounded wonder, "My dearest Victor, what infatuation is this? My -dear son, I entreat you never to make such an assertion again." - -"I am not mad," I cried energetically; "the sun and the heavens, who -have viewed my operations, can bear witness of my truth. I am the -assassin of those most innocent victims; they died by my machinations. -A thousand times would I have shed my own blood, drop by drop, to have -saved their lives; but I could not, my father, indeed I could not -sacrifice the whole human race." - -The conclusion of this speech convinced my father that my ideas were -deranged, and he instantly changed the subject of our conversation and -endeavoured to alter the course of my thoughts. He wished as much as -possible to obliterate the memory of the scenes that had taken place in -Ireland and never alluded to them or suffered me to speak of my -misfortunes. - -As time passed away I became more calm; misery had her dwelling in my -heart, but I no longer talked in the same incoherent manner of my own -crimes; sufficient for me was the consciousness of them. By the utmost -self-violence I curbed the imperious voice of wretchedness, which -sometimes desired to declare itself to the whole world, and my manners -were calmer and more composed than they had ever been since my journey -to the sea of ice. A few days before we left Paris on our way to -Switzerland, I received the following letter from Elizabeth: - - -"My dear Friend, - -"It gave me the greatest pleasure to receive a letter from my uncle -dated at Paris; you are no longer at a formidable distance, and I may -hope to see you in less than a fortnight. My poor cousin, how much you -must have suffered! I expect to see you looking even more ill than -when you quitted Geneva. This winter has been passed most miserably, -tortured as I have been by anxious suspense; yet I hope to see peace in -your countenance and to find that your heart is not totally void of -comfort and tranquillity. - -"Yet I fear that the same feelings now exist that made you so miserable -a year ago, even perhaps augmented by time. I would not disturb you at -this period, when so many misfortunes weigh upon you, but a -conversation that I had with my uncle previous to his departure renders -some explanation necessary before we meet. Explanation! You may -possibly say, What can Elizabeth have to explain? If you really say -this, my questions are answered and all my doubts satisfied. But you -are distant from me, and it is possible that you may dread and yet be -pleased with this explanation; and in a probability of this being the -case, I dare not any longer postpone writing what, during your absence, -I have often wished to express to you but have never had the courage to -begin. - -"You well know, Victor, that our union had been the favourite plan of -your parents ever since our infancy. We were told this when young, and -taught to look forward to it as an event that would certainly take -place. We were affectionate playfellows during childhood, and, I -believe, dear and valued friends to one another as we grew older. But -as brother and sister often entertain a lively affection towards each -other without desiring a more intimate union, may not such also be our -case? Tell me, dearest Victor. Answer me, I conjure you by our mutual -happiness, with simple truth--Do you not love another? - -"You have travelled; you have spent several years of your life at -Ingolstadt; and I confess to you, my friend, that when I saw you last -autumn so unhappy, flying to solitude from the society of every -creature, I could not help supposing that you might regret our -connection and believe yourself bound in honour to fulfil the wishes of -your parents, although they opposed themselves to your inclinations. -But this is false reasoning. I confess to you, my friend, that I love -you and that in my airy dreams of futurity you have been my constant -friend and companion. But it is your happiness I desire as well as my -own when I declare to you that our marriage would render me eternally -miserable unless it were the dictate of your own free choice. Even now -I weep to think that, borne down as you are by the cruellest -misfortunes, you may stifle, by the word 'honour,' all hope of that -love and happiness which would alone restore you to yourself. I, who -have so disinterested an affection for you, may increase your miseries -tenfold by being an obstacle to your wishes. Ah! Victor, be assured -that your cousin and playmate has too sincere a love for you not to be -made miserable by this supposition. Be happy, my friend; and if you -obey me in this one request, remain satisfied that nothing on earth -will have the power to interrupt my tranquillity. - -"Do not let this letter disturb you; do not answer tomorrow, or the -next day, or even until you come, if it will give you pain. My uncle -will send me news of your health, and if I see but one smile on your -lips when we meet, occasioned by this or any other exertion of mine, I -shall need no other happiness. - - "Elizabeth Lavenza - - - "Geneva, May 18th, 17--" - - -This letter revived in my memory what I had before forgotten, the -threat of the fiend--"I WILL BE WITH YOU ON YOUR WEDDING-NIGHT!" Such -was my sentence, and on that night would the daemon employ every art to -destroy me and tear me from the glimpse of happiness which promised -partly to console my sufferings. On that night he had determined to -consummate his crimes by my death. Well, be it so; a deadly struggle -would then assuredly take place, in which if he were victorious I -should be at peace and his power over me be at an end. If he were -vanquished, I should be a free man. Alas! What freedom? Such as the -peasant enjoys when his family have been massacred before his eyes, his -cottage burnt, his lands laid waste, and he is turned adrift, homeless, -penniless, and alone, but free. Such would be my liberty except that in -my Elizabeth I possessed a treasure, alas, balanced by those horrors of -remorse and guilt which would pursue me until death. - -Sweet and beloved Elizabeth! I read and reread her letter, and some -softened feelings stole into my heart and dared to whisper paradisiacal -dreams of love and joy; but the apple was already eaten, and the -angel's arm bared to drive me from all hope. Yet I would die to make -her happy. If the monster executed his threat, death was inevitable; -yet, again, I considered whether my marriage would hasten my fate. My -destruction might indeed arrive a few months sooner, but if my torturer -should suspect that I postponed it, influenced by his menaces, he would -surely find other and perhaps more dreadful means of revenge. - -He had vowed TO BE WITH ME ON MY WEDDING-NIGHT, yet he did not consider -that threat as binding him to peace in the meantime, for as if to show -me that he was not yet satiated with blood, he had murdered Clerval -immediately after the enunciation of his threats. I resolved, -therefore, that if my immediate union with my cousin would conduce -either to hers or my father's happiness, my adversary's designs against -my life should not retard it a single hour. - -In this state of mind I wrote to Elizabeth. My letter was calm and -affectionate. "I fear, my beloved girl," I said, "little happiness -remains for us on earth; yet all that I may one day enjoy is centred in -you. Chase away your idle fears; to you alone do I consecrate my life -and my endeavours for contentment. I have one secret, Elizabeth, a -dreadful one; when revealed to you, it will chill your frame with -horror, and then, far from being surprised at my misery, you will only -wonder that I survive what I have endured. I will confide this tale of -misery and terror to you the day after our marriage shall take place, -for, my sweet cousin, there must be perfect confidence between us. But -until then, I conjure you, do not mention or allude to it. This I most -earnestly entreat, and I know you will comply." - -In about a week after the arrival of Elizabeth's letter we returned to -Geneva. The sweet girl welcomed me with warm affection, yet tears were -in her eyes as she beheld my emaciated frame and feverish cheeks. I -saw a change in her also. She was thinner and had lost much of that -heavenly vivacity that had before charmed me; but her gentleness and -soft looks of compassion made her a more fit companion for one blasted -and miserable as I was. The tranquillity which I now enjoyed did not -endure. Memory brought madness with it, and when I thought of what had -passed, a real insanity possessed me; sometimes I was furious and burnt -with rage, sometimes low and despondent. I neither spoke nor looked at -anyone, but sat motionless, bewildered by the multitude of miseries -that overcame me. - -Elizabeth alone had the power to draw me from these fits; her gentle -voice would soothe me when transported by passion and inspire me with -human feelings when sunk in torpor. She wept with me and for me. When -reason returned, she would remonstrate and endeavour to inspire me with -resignation. Ah! It is well for the unfortunate to be resigned, but -for the guilty there is no peace. The agonies of remorse poison the -luxury there is otherwise sometimes found in indulging the excess of -grief. Soon after my arrival my father spoke of my immediate marriage -with Elizabeth. I remained silent. - -"Have you, then, some other attachment?" - -"None on earth. I love Elizabeth and look forward to our union with -delight. Let the day therefore be fixed; and on it I will consecrate -myself, in life or death, to the happiness of my cousin." - -"My dear Victor, do not speak thus. Heavy misfortunes have befallen -us, but let us only cling closer to what remains and transfer our love -for those whom we have lost to those who yet live. Our circle will be -small but bound close by the ties of affection and mutual misfortune. -And when time shall have softened your despair, new and dear objects of -care will be born to replace those of whom we have been so cruelly -deprived." - -Such were the lessons of my father. But to me the remembrance of the -threat returned; nor can you wonder that, omnipotent as the fiend had -yet been in his deeds of blood, I should almost regard him as -invincible, and that when he had pronounced the words "I SHALL BE WITH -YOU ON YOUR WEDDING-NIGHT," I should regard the threatened fate as -unavoidable. But death was no evil to me if the loss of Elizabeth were -balanced with it, and I therefore, with a contented and even cheerful -countenance, agreed with my father that if my cousin would consent, the -ceremony should take place in ten days, and thus put, as I imagined, -the seal to my fate. - -Great God! If for one instant I had thought what might be the hellish -intention of my fiendish adversary, I would rather have banished myself -forever from my native country and wandered a friendless outcast over -the earth than have consented to this miserable marriage. But, as if -possessed of magic powers, the monster had blinded me to his real -intentions; and when I thought that I had prepared only my own death, I -hastened that of a far dearer victim. - -As the period fixed for our marriage drew nearer, whether from -cowardice or a prophetic feeling, I felt my heart sink within me. But -I concealed my feelings by an appearance of hilarity that brought -smiles and joy to the countenance of my father, but hardly deceived the -ever-watchful and nicer eye of Elizabeth. She looked forward to our -union with placid contentment, not unmingled with a little fear, which -past misfortunes had impressed, that what now appeared certain and -tangible happiness might soon dissipate into an airy dream and leave no -trace but deep and everlasting regret. Preparations were made for the -event, congratulatory visits were received, and all wore a smiling -appearance. I shut up, as well as I could, in my own heart the anxiety -that preyed there and entered with seeming earnestness into the plans -of my father, although they might only serve as the decorations of my -tragedy. Through my father's exertions a part of the inheritance of -Elizabeth had been restored to her by the Austrian government. A small -possession on the shores of Como belonged to her. It was agreed that, -immediately after our union, we should proceed to Villa Lavenza and -spend our first days of happiness beside the beautiful lake near which -it stood. - -In the meantime I took every precaution to defend my person in case the -fiend should openly attack me. I carried pistols and a dagger -constantly about me and was ever on the watch to prevent artifice, and -by these means gained a greater degree of tranquillity. Indeed, as the -period approached, the threat appeared more as a delusion, not to be -regarded as worthy to disturb my peace, while the happiness I hoped for -in my marriage wore a greater appearance of certainty as the day fixed -for its solemnization drew nearer and I heard it continually spoken of -as an occurrence which no accident could possibly prevent. - -Elizabeth seemed happy; my tranquil demeanour contributed greatly to -calm her mind. But on the day that was to fulfil my wishes and my -destiny, she was melancholy, and a presentiment of evil pervaded her; -and perhaps also she thought of the dreadful secret which I had -promised to reveal to her on the following day. My father was in the -meantime overjoyed and in the bustle of preparation only recognized in -the melancholy of his niece the diffidence of a bride. - -After the ceremony was performed a large party assembled at my -father's, but it was agreed that Elizabeth and I should commence our -journey by water, sleeping that night at Evian and continuing our -voyage on the following day. The day was fair, the wind favourable; -all smiled on our nuptial embarkation. - -Those were the last moments of my life during which I enjoyed the -feeling of happiness. We passed rapidly along; the sun was hot, but we -were sheltered from its rays by a kind of canopy while we enjoyed the -beauty of the scene, sometimes on one side of the lake, where we saw -Mont Saleve, the pleasant banks of Montalegre, and at a distance, -surmounting all, the beautiful Mont Blanc and the assemblage of snowy -mountains that in vain endeavour to emulate her; sometimes coasting the -opposite banks, we saw the mighty Jura opposing its dark side to the -ambition that would quit its native country, and an almost -insurmountable barrier to the invader who should wish to enslave it. - -I took the hand of Elizabeth. "You are sorrowful, my love. Ah! If -you knew what I have suffered and what I may yet endure, you would -endeavour to let me taste the quiet and freedom from despair that this -one day at least permits me to enjoy." - -"Be happy, my dear Victor," replied Elizabeth; "there is, I hope, -nothing to distress you; and be assured that if a lively joy is not -painted in my face, my heart is contented. Something whispers to me -not to depend too much on the prospect that is opened before us, but I -will not listen to such a sinister voice. Observe how fast we move -along and how the clouds, which sometimes obscure and sometimes rise -above the dome of Mont Blanc, render this scene of beauty still more -interesting. Look also at the innumerable fish that are swimming in -the clear waters, where we can distinguish every pebble that lies at -the bottom. What a divine day! How happy and serene all nature -appears!" - -Thus Elizabeth endeavoured to divert her thoughts and mine from all -reflection upon melancholy subjects. But her temper was fluctuating; -joy for a few instants shone in her eyes, but it continually gave place -to distraction and reverie. - -The sun sank lower in the heavens; we passed the river Drance and -observed its path through the chasms of the higher and the glens of the -lower hills. The Alps here come closer to the lake, and we approached -the amphitheatre of mountains which forms its eastern boundary. The -spire of Evian shone under the woods that surrounded it and the range -of mountain above mountain by which it was overhung. - -The wind, which had hitherto carried us along with amazing rapidity, -sank at sunset to a light breeze; the soft air just ruffled the water -and caused a pleasant motion among the trees as we approached the -shore, from which it wafted the most delightful scent of flowers and -hay. The sun sank beneath the horizon as we landed, and as I touched -the shore I felt those cares and fears revive which soon were to clasp -me and cling to me forever. - - - -Chapter 23 - -It was eight o'clock when we landed; we walked for a short time on the -shore, enjoying the transitory light, and then retired to the inn and -contemplated the lovely scene of waters, woods, and mountains, obscured -in darkness, yet still displaying their black outlines. - -The wind, which had fallen in the south, now rose with great violence -in the west. The moon had reached her summit in the heavens and was -beginning to descend; the clouds swept across it swifter than the -flight of the vulture and dimmed her rays, while the lake reflected the -scene of the busy heavens, rendered still busier by the restless waves -that were beginning to rise. Suddenly a heavy storm of rain descended. - -I had been calm during the day, but so soon as night obscured the -shapes of objects, a thousand fears arose in my mind. I was anxious -and watchful, while my right hand grasped a pistol which was hidden in -my bosom; every sound terrified me, but I resolved that I would sell my -life dearly and not shrink from the conflict until my own life or that -of my adversary was extinguished. Elizabeth observed my agitation for -some time in timid and fearful silence, but there was something in my -glance which communicated terror to her, and trembling, she asked, -"What is it that agitates you, my dear Victor? What is it you fear?" - -"Oh! Peace, peace, my love," replied I; "this night, and all will be -safe; but this night is dreadful, very dreadful." - -I passed an hour in this state of mind, when suddenly I reflected how -fearful the combat which I momentarily expected would be to my wife, -and I earnestly entreated her to retire, resolving not to join her -until I had obtained some knowledge as to the situation of my enemy. - -She left me, and I continued some time walking up and down the passages -of the house and inspecting every corner that might afford a retreat to -my adversary. But I discovered no trace of him and was beginning to -conjecture that some fortunate chance had intervened to prevent the -execution of his menaces when suddenly I heard a shrill and dreadful -scream. It came from the room into which Elizabeth had retired. As I -heard it, the whole truth rushed into my mind, my arms dropped, the -motion of every muscle and fibre was suspended; I could feel the blood -trickling in my veins and tingling in the extremities of my limbs. This -state lasted but for an instant; the scream was repeated, and I rushed -into the room. Great God! Why did I not then expire! Why am I here -to relate the destruction of the best hope and the purest creature on -earth? She was there, lifeless and inanimate, thrown across the bed, -her head hanging down and her pale and distorted features half covered -by her hair. Everywhere I turn I see the same figure--her bloodless -arms and relaxed form flung by the murderer on its bridal bier. Could -I behold this and live? Alas! Life is obstinate and clings closest -where it is most hated. For a moment only did I lose recollection; I -fell senseless on the ground. - -When I recovered I found myself surrounded by the people of the inn; -their countenances expressed a breathless terror, but the horror of -others appeared only as a mockery, a shadow of the feelings that -oppressed me. I escaped from them to the room where lay the body of -Elizabeth, my love, my wife, so lately living, so dear, so worthy. She -had been moved from the posture in which I had first beheld her, and -now, as she lay, her head upon her arm and a handkerchief thrown across -her face and neck, I might have supposed her asleep. I rushed towards -her and embraced her with ardour, but the deadly languor and coldness -of the limbs told me that what I now held in my arms had ceased to be -the Elizabeth whom I had loved and cherished. The murderous mark of -the fiend's grasp was on her neck, and the breath had ceased to issue -from her lips. While I still hung over her in the agony of despair, I -happened to look up. The windows of the room had before been darkened, -and I felt a kind of panic on seeing the pale yellow light of the moon -illuminate the chamber. The shutters had been thrown back, and with a -sensation of horror not to be described, I saw at the open window a -figure the most hideous and abhorred. A grin was on the face of the -monster; he seemed to jeer, as with his fiendish finger he pointed -towards the corpse of my wife. I rushed towards the window, and -drawing a pistol from my bosom, fired; but he eluded me, leaped from -his station, and running with the swiftness of lightning, plunged into -the lake. - -The report of the pistol brought a crowd into the room. I pointed to -the spot where he had disappeared, and we followed the track with -boats; nets were cast, but in vain. After passing several hours, we -returned hopeless, most of my companions believing it to have been a -form conjured up by my fancy. After having landed, they proceeded to -search the country, parties going in different directions among the -woods and vines. - -I attempted to accompany them and proceeded a short distance from the -house, but my head whirled round, my steps were like those of a drunken -man, I fell at last in a state of utter exhaustion; a film covered my -eyes, and my skin was parched with the heat of fever. In this state I -was carried back and placed on a bed, hardly conscious of what had -happened; my eyes wandered round the room as if to seek something that -I had lost. - -After an interval I arose, and as if by instinct, crawled into the room -where the corpse of my beloved lay. There were women weeping around; I -hung over it and joined my sad tears to theirs; all this time no -distinct idea presented itself to my mind, but my thoughts rambled to -various subjects, reflecting confusedly on my misfortunes and their -cause. I was bewildered, in a cloud of wonder and horror. The death -of William, the execution of Justine, the murder of Clerval, and lastly -of my wife; even at that moment I knew not that my only remaining -friends were safe from the malignity of the fiend; my father even now -might be writhing under his grasp, and Ernest might be dead at his -feet. This idea made me shudder and recalled me to action. I started -up and resolved to return to Geneva with all possible speed. - -There were no horses to be procured, and I must return by the lake; but -the wind was unfavourable, and the rain fell in torrents. However, it -was hardly morning, and I might reasonably hope to arrive by night. I -hired men to row and took an oar myself, for I had always experienced -relief from mental torment in bodily exercise. But the overflowing -misery I now felt, and the excess of agitation that I endured rendered -me incapable of any exertion. I threw down the oar, and leaning my -head upon my hands, gave way to every gloomy idea that arose. If I -looked up, I saw scenes which were familiar to me in my happier time -and which I had contemplated but the day before in the company of her -who was now but a shadow and a recollection. Tears streamed from my -eyes. The rain had ceased for a moment, and I saw the fish play in the -waters as they had done a few hours before; they had then been observed -by Elizabeth. Nothing is so painful to the human mind as a great and -sudden change. The sun might shine or the clouds might lower, but -nothing could appear to me as it had done the day before. A fiend had -snatched from me every hope of future happiness; no creature had ever -been so miserable as I was; so frightful an event is single in the -history of man. But why should I dwell upon the incidents that followed -this last overwhelming event? Mine has been a tale of horrors; I have -reached their acme, and what I must now relate can but be tedious to -you. Know that, one by one, my friends were snatched away; I was left -desolate. My own strength is exhausted, and I must tell, in a few -words, what remains of my hideous narration. I arrived at Geneva. My -father and Ernest yet lived, but the former sunk under the tidings that -I bore. I see him now, excellent and venerable old man! His eyes -wandered in vacancy, for they had lost their charm and their -delight--his Elizabeth, his more than daughter, whom he doted on with -all that affection which a man feels, who in the decline of life, -having few affections, clings more earnestly to those that remain. -Cursed, cursed be the fiend that brought misery on his grey hairs and -doomed him to waste in wretchedness! He could not live under the -horrors that were accumulated around him; the springs of existence -suddenly gave way; he was unable to rise from his bed, and in a few -days he died in my arms. - -What then became of me? I know not; I lost sensation, and chains and -darkness were the only objects that pressed upon me. Sometimes, -indeed, I dreamt that I wandered in flowery meadows and pleasant vales -with the friends of my youth, but I awoke and found myself in a -dungeon. Melancholy followed, but by degrees I gained a clear -conception of my miseries and situation and was then released from my -prison. For they had called me mad, and during many months, as I -understood, a solitary cell had been my habitation. - -Liberty, however, had been a useless gift to me, had I not, as I -awakened to reason, at the same time awakened to revenge. As the -memory of past misfortunes pressed upon me, I began to reflect on their -cause--the monster whom I had created, the miserable daemon whom I had -sent abroad into the world for my destruction. I was possessed by a -maddening rage when I thought of him, and desired and ardently prayed -that I might have him within my grasp to wreak a great and signal -revenge on his cursed head. - -Nor did my hate long confine itself to useless wishes; I began to -reflect on the best means of securing him; and for this purpose, about -a month after my release, I repaired to a criminal judge in the town -and told him that I had an accusation to make, that I knew the -destroyer of my family, and that I required him to exert his whole -authority for the apprehension of the murderer. The magistrate -listened to me with attention and kindness. - -"Be assured, sir," said he, "no pains or exertions on my part shall be -spared to discover the villain." - -"I thank you," replied I; "listen, therefore, to the deposition that I -have to make. It is indeed a tale so strange that I should fear you -would not credit it were there not something in truth which, however -wonderful, forces conviction. The story is too connected to be -mistaken for a dream, and I have no motive for falsehood." My manner as -I thus addressed him was impressive but calm; I had formed in my own -heart a resolution to pursue my destroyer to death, and this purpose -quieted my agony and for an interval reconciled me to life. I now -related my history briefly but with firmness and precision, marking the -dates with accuracy and never deviating into invective or exclamation. - -The magistrate appeared at first perfectly incredulous, but as I -continued he became more attentive and interested; I saw him sometimes -shudder with horror; at others a lively surprise, unmingled with -disbelief, was painted on his countenance. When I had concluded my -narration I said, "This is the being whom I accuse and for whose -seizure and punishment I call upon you to exert your whole power. It -is your duty as a magistrate, and I believe and hope that your feelings -as a man will not revolt from the execution of those functions on this -occasion." This address caused a considerable change in the -physiognomy of my own auditor. He had heard my story with that half -kind of belief that is given to a tale of spirits and supernatural -events; but when he was called upon to act officially in consequence, -the whole tide of his incredulity returned. He, however, answered -mildly, "I would willingly afford you every aid in your pursuit, but -the creature of whom you speak appears to have powers which would put -all my exertions to defiance. Who can follow an animal which can -traverse the sea of ice and inhabit caves and dens where no man would -venture to intrude? Besides, some months have elapsed since the -commission of his crimes, and no one can conjecture to what place he -has wandered or what region he may now inhabit." - -"I do not doubt that he hovers near the spot which I inhabit, and if he -has indeed taken refuge in the Alps, he may be hunted like the chamois -and destroyed as a beast of prey. But I perceive your thoughts; you do -not credit my narrative and do not intend to pursue my enemy with the -punishment which is his desert." As I spoke, rage sparkled in my eyes; -the magistrate was intimidated. "You are mistaken," said he. "I will -exert myself, and if it is in my power to seize the monster, be assured -that he shall suffer punishment proportionate to his crimes. But I -fear, from what you have yourself described to be his properties, that -this will prove impracticable; and thus, while every proper measure is -pursued, you should make up your mind to disappointment." - -"That cannot be; but all that I can say will be of little avail. My -revenge is of no moment to you; yet, while I allow it to be a vice, I -confess that it is the devouring and only passion of my soul. My rage -is unspeakable when I reflect that the murderer, whom I have turned -loose upon society, still exists. You refuse my just demand; I have -but one resource, and I devote myself, either in my life or death, to -his destruction." - -I trembled with excess of agitation as I said this; there was a frenzy -in my manner, and something, I doubt not, of that haughty fierceness -which the martyrs of old are said to have possessed. But to a Genevan -magistrate, whose mind was occupied by far other ideas than those of -devotion and heroism, this elevation of mind had much the appearance of -madness. He endeavoured to soothe me as a nurse does a child and -reverted to my tale as the effects of delirium. - -"Man," I cried, "how ignorant art thou in thy pride of wisdom! Cease; -you know not what it is you say." - -I broke from the house angry and disturbed and retired to meditate on -some other mode of action. - - - -Chapter 24 - -My present situation was one in which all voluntary thought was -swallowed up and lost. I was hurried away by fury; revenge alone -endowed me with strength and composure; it moulded my feelings and -allowed me to be calculating and calm at periods when otherwise -delirium or death would have been my portion. - -My first resolution was to quit Geneva forever; my country, which, when -I was happy and beloved, was dear to me, now, in my adversity, became -hateful. I provided myself with a sum of money, together with a few -jewels which had belonged to my mother, and departed. And now my -wanderings began which are to cease but with life. I have traversed a -vast portion of the earth and have endured all the hardships which -travellers in deserts and barbarous countries are wont to meet. How I -have lived I hardly know; many times have I stretched my failing limbs -upon the sandy plain and prayed for death. But revenge kept me alive; -I dared not die and leave my adversary in being. - -When I quitted Geneva my first labour was to gain some clue by which I -might trace the steps of my fiendish enemy. But my plan was unsettled, -and I wandered many hours round the confines of the town, uncertain -what path I should pursue. As night approached I found myself at the -entrance of the cemetery where William, Elizabeth, and my father -reposed. I entered it and approached the tomb which marked their -graves. Everything was silent except the leaves of the trees, which -were gently agitated by the wind; the night was nearly dark, and the -scene would have been solemn and affecting even to an uninterested -observer. The spirits of the departed seemed to flit around and to -cast a shadow, which was felt but not seen, around the head of the -mourner. - -The deep grief which this scene had at first excited quickly gave way -to rage and despair. They were dead, and I lived; their murderer also -lived, and to destroy him I must drag out my weary existence. I knelt -on the grass and kissed the earth and with quivering lips exclaimed, -"By the sacred earth on which I kneel, by the shades that wander near -me, by the deep and eternal grief that I feel, I swear; and by thee, O -Night, and the spirits that preside over thee, to pursue the daemon who -caused this misery, until he or I shall perish in mortal conflict. For -this purpose I will preserve my life; to execute this dear revenge will -I again behold the sun and tread the green herbage of earth, which -otherwise should vanish from my eyes forever. And I call on you, -spirits of the dead, and on you, wandering ministers of vengeance, to -aid and conduct me in my work. Let the cursed and hellish monster -drink deep of agony; let him feel the despair that now torments me." I -had begun my adjuration with solemnity and an awe which almost assured -me that the shades of my murdered friends heard and approved my -devotion, but the furies possessed me as I concluded, and rage choked -my utterance. - -I was answered through the stillness of night by a loud and fiendish -laugh. It rang on my ears long and heavily; the mountains re-echoed -it, and I felt as if all hell surrounded me with mockery and laughter. -Surely in that moment I should have been possessed by frenzy and have -destroyed my miserable existence but that my vow was heard and that I -was reserved for vengeance. The laughter died away, when a well-known -and abhorred voice, apparently close to my ear, addressed me in an -audible whisper, "I am satisfied, miserable wretch! You have -determined to live, and I am satisfied." - -I darted towards the spot from which the sound proceeded, but the devil -eluded my grasp. Suddenly the broad disk of the moon arose and shone -full upon his ghastly and distorted shape as he fled with more than -mortal speed. - -I pursued him, and for many months this has been my task. Guided by a -slight clue, I followed the windings of the Rhone, but vainly. The -blue Mediterranean appeared, and by a strange chance, I saw the fiend -enter by night and hide himself in a vessel bound for the Black Sea. I -took my passage in the same ship, but he escaped, I know not how. - -Amidst the wilds of Tartary and Russia, although he still evaded me, I -have ever followed in his track. Sometimes the peasants, scared by -this horrid apparition, informed me of his path; sometimes he himself, -who feared that if I lost all trace of him I should despair and die, -left some mark to guide me. The snows descended on my head, and I saw -the print of his huge step on the white plain. To you first entering -on life, to whom care is new and agony unknown, how can you understand -what I have felt and still feel? Cold, want, and fatigue were the -least pains which I was destined to endure; I was cursed by some devil -and carried about with me my eternal hell; yet still a spirit of good -followed and directed my steps and when I most murmured would suddenly -extricate me from seemingly insurmountable difficulties. Sometimes, -when nature, overcome by hunger, sank under the exhaustion, a repast -was prepared for me in the desert that restored and inspirited me. The -fare was, indeed, coarse, such as the peasants of the country ate, but -I will not doubt that it was set there by the spirits that I had -invoked to aid me. Often, when all was dry, the heavens cloudless, and -I was parched by thirst, a slight cloud would bedim the sky, shed the -few drops that revived me, and vanish. - -I followed, when I could, the courses of the rivers; but the daemon -generally avoided these, as it was here that the population of the -country chiefly collected. In other places human beings were seldom -seen, and I generally subsisted on the wild animals that crossed my -path. I had money with me and gained the friendship of the villagers -by distributing it; or I brought with me some food that I had killed, -which, after taking a small part, I always presented to those who had -provided me with fire and utensils for cooking. - -My life, as it passed thus, was indeed hateful to me, and it was during -sleep alone that I could taste joy. O blessed sleep! Often, when most -miserable, I sank to repose, and my dreams lulled me even to rapture. -The spirits that guarded me had provided these moments, or rather -hours, of happiness that I might retain strength to fulfil my -pilgrimage. Deprived of this respite, I should have sunk under my -hardships. During the day I was sustained and inspirited by the hope -of night, for in sleep I saw my friends, my wife, and my beloved -country; again I saw the benevolent countenance of my father, heard the -silver tones of my Elizabeth's voice, and beheld Clerval enjoying -health and youth. Often, when wearied by a toilsome march, I persuaded -myself that I was dreaming until night should come and that I should -then enjoy reality in the arms of my dearest friends. What agonizing -fondness did I feel for them! How did I cling to their dear forms, as -sometimes they haunted even my waking hours, and persuade myself that -they still lived! At such moments vengeance, that burned within me, -died in my heart, and I pursued my path towards the destruction of the -daemon more as a task enjoined by heaven, as the mechanical impulse of -some power of which I was unconscious, than as the ardent desire of my -soul. What his feelings were whom I pursued I cannot know. Sometimes, -indeed, he left marks in writing on the barks of the trees or cut in -stone that guided me and instigated my fury. "My reign is not yet -over"--these words were legible in one of these inscriptions--"you -live, and my power is complete. Follow me; I seek the everlasting ices -of the north, where you will feel the misery of cold and frost, to -which I am impassive. You will find near this place, if you follow not -too tardily, a dead hare; eat and be refreshed. Come on, my enemy; we -have yet to wrestle for our lives, but many hard and miserable hours -must you endure until that period shall arrive." - -Scoffing devil! Again do I vow vengeance; again do I devote thee, -miserable fiend, to torture and death. Never will I give up my search -until he or I perish; and then with what ecstasy shall I join my -Elizabeth and my departed friends, who even now prepare for me the -reward of my tedious toil and horrible pilgrimage! - -As I still pursued my journey to the northward, the snows thickened and -the cold increased in a degree almost too severe to support. The -peasants were shut up in their hovels, and only a few of the most hardy -ventured forth to seize the animals whom starvation had forced from -their hiding-places to seek for prey. The rivers were covered with -ice, and no fish could be procured; and thus I was cut off from my -chief article of maintenance. The triumph of my enemy increased with -the difficulty of my labours. One inscription that he left was in -these words: "Prepare! Your toils only begin; wrap yourself in furs -and provide food, for we shall soon enter upon a journey where your -sufferings will satisfy my everlasting hatred." - -My courage and perseverance were invigorated by these scoffing words; I -resolved not to fail in my purpose, and calling on heaven to support -me, I continued with unabated fervour to traverse immense deserts, -until the ocean appeared at a distance and formed the utmost boundary -of the horizon. Oh! How unlike it was to the blue seasons of the -south! Covered with ice, it was only to be distinguished from land by -its superior wildness and ruggedness. The Greeks wept for joy when -they beheld the Mediterranean from the hills of Asia, and hailed with -rapture the boundary of their toils. I did not weep, but I knelt down -and with a full heart thanked my guiding spirit for conducting me in -safety to the place where I hoped, notwithstanding my adversary's gibe, -to meet and grapple with him. - -Some weeks before this period I had procured a sledge and dogs and thus -traversed the snows with inconceivable speed. I know not whether the -fiend possessed the same advantages, but I found that, as before I had -daily lost ground in the pursuit, I now gained on him, so much so that -when I first saw the ocean he was but one day's journey in advance, and -I hoped to intercept him before he should reach the beach. With new -courage, therefore, I pressed on, and in two days arrived at a wretched -hamlet on the seashore. I inquired of the inhabitants concerning the -fiend and gained accurate information. A gigantic monster, they said, -had arrived the night before, armed with a gun and many pistols, -putting to flight the inhabitants of a solitary cottage through fear of -his terrific appearance. He had carried off their store of winter -food, and placing it in a sledge, to draw which he had seized on a -numerous drove of trained dogs, he had harnessed them, and the same -night, to the joy of the horror-struck villagers, had pursued his -journey across the sea in a direction that led to no land; and they -conjectured that he must speedily be destroyed by the breaking of the -ice or frozen by the eternal frosts. - -On hearing this information I suffered a temporary access of despair. -He had escaped me, and I must commence a destructive and almost endless -journey across the mountainous ices of the ocean, amidst cold that few -of the inhabitants could long endure and which I, the native of a -genial and sunny climate, could not hope to survive. Yet at the idea -that the fiend should live and be triumphant, my rage and vengeance -returned, and like a mighty tide, overwhelmed every other feeling. -After a slight repose, during which the spirits of the dead hovered -round and instigated me to toil and revenge, I prepared for my journey. -I exchanged my land-sledge for one fashioned for the inequalities of -the frozen ocean, and purchasing a plentiful stock of provisions, I -departed from land. - -I cannot guess how many days have passed since then, but I have endured -misery which nothing but the eternal sentiment of a just retribution -burning within my heart could have enabled me to support. Immense and -rugged mountains of ice often barred up my passage, and I often heard -the thunder of the ground sea, which threatened my destruction. But -again the frost came and made the paths of the sea secure. - -By the quantity of provision which I had consumed, I should guess that -I had passed three weeks in this journey; and the continual protraction -of hope, returning back upon the heart, often wrung bitter drops of -despondency and grief from my eyes. Despair had indeed almost secured -her prey, and I should soon have sunk beneath this misery. Once, after -the poor animals that conveyed me had with incredible toil gained the -summit of a sloping ice mountain, and one, sinking under his fatigue, -died, I viewed the expanse before me with anguish, when suddenly my eye -caught a dark speck upon the dusky plain. I strained my sight to -discover what it could be and uttered a wild cry of ecstasy when I -distinguished a sledge and the distorted proportions of a well-known -form within. Oh! With what a burning gush did hope revisit my heart! -Warm tears filled my eyes, which I hastily wiped away, that they might -not intercept the view I had of the daemon; but still my sight was -dimmed by the burning drops, until, giving way to the emotions that -oppressed me, I wept aloud. - -But this was not the time for delay; I disencumbered the dogs of their -dead companion, gave them a plentiful portion of food, and after an -hour's rest, which was absolutely necessary, and yet which was bitterly -irksome to me, I continued my route. The sledge was still visible, nor -did I again lose sight of it except at the moments when for a short -time some ice-rock concealed it with its intervening crags. I indeed -perceptibly gained on it, and when, after nearly two days' journey, I -beheld my enemy at no more than a mile distant, my heart bounded within -me. - -But now, when I appeared almost within grasp of my foe, my hopes were -suddenly extinguished, and I lost all trace of him more utterly than I -had ever done before. A ground sea was heard; the thunder of its -progress, as the waters rolled and swelled beneath me, became every -moment more ominous and terrific. I pressed on, but in vain. The wind -arose; the sea roared; and, as with the mighty shock of an earthquake, -it split and cracked with a tremendous and overwhelming sound. The -work was soon finished; in a few minutes a tumultuous sea rolled -between me and my enemy, and I was left drifting on a scattered piece -of ice that was continually lessening and thus preparing for me a -hideous death. In this manner many appalling hours passed; several of -my dogs died, and I myself was about to sink under the accumulation of -distress when I saw your vessel riding at anchor and holding forth to -me hopes of succour and life. I had no conception that vessels ever -came so far north and was astounded at the sight. I quickly destroyed -part of my sledge to construct oars, and by these means was enabled, -with infinite fatigue, to move my ice raft in the direction of your -ship. I had determined, if you were going southwards, still to trust -myself to the mercy of the seas rather than abandon my purpose. I -hoped to induce you to grant me a boat with which I could pursue my -enemy. But your direction was northwards. You took me on board when -my vigour was exhausted, and I should soon have sunk under my -multiplied hardships into a death which I still dread, for my task is -unfulfilled. - -Oh! When will my guiding spirit, in conducting me to the daemon, allow -me the rest I so much desire; or must I die, and he yet live? If I do, -swear to me, Walton, that he shall not escape, that you will seek him -and satisfy my vengeance in his death. And do I dare to ask of you to -undertake my pilgrimage, to endure the hardships that I have undergone? -No; I am not so selfish. Yet, when I am dead, if he should appear, if -the ministers of vengeance should conduct him to you, swear that he -shall not live--swear that he shall not triumph over my accumulated -woes and survive to add to the list of his dark crimes. He is eloquent -and persuasive, and once his words had even power over my heart; but -trust him not. His soul is as hellish as his form, full of treachery -and fiend-like malice. Hear him not; call on the names of William, -Justine, Clerval, Elizabeth, my father, and of the wretched Victor, and -thrust your sword into his heart. I will hover near and direct the -steel aright. - - - Walton, in continuation. - - - - August 26th, 17-- - - -You have read this strange and terrific story, Margaret; and do you not -feel your blood congeal with horror, like that which even now curdles -mine? Sometimes, seized with sudden agony, he could not continue his -tale; at others, his voice broken, yet piercing, uttered with -difficulty the words so replete with anguish. His fine and lovely eyes -were now lighted up with indignation, now subdued to downcast sorrow -and quenched in infinite wretchedness. Sometimes he commanded his -countenance and tones and related the most horrible incidents with a -tranquil voice, suppressing every mark of agitation; then, like a -volcano bursting forth, his face would suddenly change to an expression -of the wildest rage as he shrieked out imprecations on his persecutor. - -His tale is connected and told with an appearance of the simplest -truth, yet I own to you that the letters of Felix and Safie, which he -showed me, and the apparition of the monster seen from our ship, -brought to me a greater conviction of the truth of his narrative than -his asseverations, however earnest and connected. Such a monster has, -then, really existence! I cannot doubt it, yet I am lost in surprise -and admiration. Sometimes I endeavoured to gain from Frankenstein the -particulars of his creature's formation, but on this point he was -impenetrable. "Are you mad, my friend?" said he. "Or whither does your -senseless curiosity lead you? Would you also create for yourself and -the world a demoniacal enemy? Peace, peace! Learn my miseries and do -not seek to increase your own." Frankenstein discovered that I made -notes concerning his history; he asked to see them and then himself -corrected and augmented them in many places, but principally in giving -the life and spirit to the conversations he held with his enemy. "Since -you have preserved my narration," said he, "I would not that a -mutilated one should go down to posterity." - -Thus has a week passed away, while I have listened to the strangest -tale that ever imagination formed. My thoughts and every feeling of my -soul have been drunk up by the interest for my guest which this tale -and his own elevated and gentle manners have created. I wish to soothe -him, yet can I counsel one so infinitely miserable, so destitute of -every hope of consolation, to live? Oh, no! The only joy that he can -now know will be when he composes his shattered spirit to peace and -death. Yet he enjoys one comfort, the offspring of solitude and -delirium; he believes that when in dreams he holds converse with his -friends and derives from that communion consolation for his miseries or -excitements to his vengeance, that they are not the creations of his -fancy, but the beings themselves who visit him from the regions of a -remote world. This faith gives a solemnity to his reveries that render -them to me almost as imposing and interesting as truth. - -Our conversations are not always confined to his own history and -misfortunes. On every point of general literature he displays -unbounded knowledge and a quick and piercing apprehension. His -eloquence is forcible and touching; nor can I hear him, when he relates -a pathetic incident or endeavours to move the passions of pity or love, -without tears. What a glorious creature must he have been in the days -of his prosperity, when he is thus noble and godlike in ruin! He seems -to feel his own worth and the greatness of his fall. - -"When younger," said he, "I believed myself destined for some great -enterprise. My feelings are profound, but I possessed a coolness of -judgment that fitted me for illustrious achievements. This sentiment -of the worth of my nature supported me when others would have been -oppressed, for I deemed it criminal to throw away in useless grief -those talents that might be useful to my fellow creatures. When I -reflected on the work I had completed, no less a one than the creation -of a sensitive and rational animal, I could not rank myself with the -herd of common projectors. But this thought, which supported me in the -commencement of my career, now serves only to plunge me lower in the -dust. All my speculations and hopes are as nothing, and like the -archangel who aspired to omnipotence, I am chained in an eternal hell. -My imagination was vivid, yet my powers of analysis and application -were intense; by the union of these qualities I conceived the idea and -executed the creation of a man. Even now I cannot recollect without -passion my reveries while the work was incomplete. I trod heaven in my -thoughts, now exulting in my powers, now burning with the idea of their -effects. From my infancy I was imbued with high hopes and a lofty -ambition; but how am I sunk! Oh! My friend, if you had known me as I -once was, you would not recognize me in this state of degradation. -Despondency rarely visited my heart; a high destiny seemed to bear me -on, until I fell, never, never again to rise." Must I then lose this -admirable being? I have longed for a friend; I have sought one who -would sympathize with and love me. Behold, on these desert seas I have -found such a one, but I fear I have gained him only to know his value -and lose him. I would reconcile him to life, but he repulses the idea. - -"I thank you, Walton," he said, "for your kind intentions towards so -miserable a wretch; but when you speak of new ties and fresh -affections, think you that any can replace those who are gone? Can any -man be to me as Clerval was, or any woman another Elizabeth? Even -where the affections are not strongly moved by any superior excellence, -the companions of our childhood always possess a certain power over our -minds which hardly any later friend can obtain. They know our -infantine dispositions, which, however they may be afterwards modified, -are never eradicated; and they can judge of our actions with more -certain conclusions as to the integrity of our motives. A sister or a -brother can never, unless indeed such symptoms have been shown early, -suspect the other of fraud or false dealing, when another friend, -however strongly he may be attached, may, in spite of himself, be -contemplated with suspicion. But I enjoyed friends, dear not only -through habit and association, but from their own merits; and wherever -I am, the soothing voice of my Elizabeth and the conversation of -Clerval will be ever whispered in my ear. They are dead, and but one -feeling in such a solitude can persuade me to preserve my life. If I -were engaged in any high undertaking or design, fraught with extensive -utility to my fellow creatures, then could I live to fulfil it. But -such is not my destiny; I must pursue and destroy the being to whom I -gave existence; then my lot on earth will be fulfilled and I may die." - - - - -September 2nd - -My beloved Sister, - -I write to you, encompassed by peril and ignorant whether I am ever -doomed to see again dear England and the dearer friends that inhabit -it. I am surrounded by mountains of ice which admit of no escape and -threaten every moment to crush my vessel. The brave fellows whom I -have persuaded to be my companions look towards me for aid, but I have -none to bestow. There is something terribly appalling in our -situation, yet my courage and hopes do not desert me. Yet it is -terrible to reflect that the lives of all these men are endangered -through me. If we are lost, my mad schemes are the cause. - -And what, Margaret, will be the state of your mind? You will not hear -of my destruction, and you will anxiously await my return. Years will -pass, and you will have visitings of despair and yet be tortured by -hope. Oh! My beloved sister, the sickening failing of your heart-felt -expectations is, in prospect, more terrible to me than my own death. - -But you have a husband and lovely children; you may be happy. Heaven -bless you and make you so! - -My unfortunate guest regards me with the tenderest compassion. He -endeavours to fill me with hope and talks as if life were a possession -which he valued. He reminds me how often the same accidents have -happened to other navigators who have attempted this sea, and in spite -of myself, he fills me with cheerful auguries. Even the sailors feel -the power of his eloquence; when he speaks, they no longer despair; he -rouses their energies, and while they hear his voice they believe these -vast mountains of ice are mole-hills which will vanish before the -resolutions of man. These feelings are transitory; each day of -expectation delayed fills them with fear, and I almost dread a mutiny -caused by this despair. - - - -September 5th - - -A scene has just passed of such uncommon interest that, although it is -highly probable that these papers may never reach you, yet I cannot -forbear recording it. - -We are still surrounded by mountains of ice, still in imminent danger -of being crushed in their conflict. The cold is excessive, and many of -my unfortunate comrades have already found a grave amidst this scene of -desolation. Frankenstein has daily declined in health; a feverish fire -still glimmers in his eyes, but he is exhausted, and when suddenly -roused to any exertion, he speedily sinks again into apparent -lifelessness. - -I mentioned in my last letter the fears I entertained of a mutiny. -This morning, as I sat watching the wan countenance of my friend--his -eyes half closed and his limbs hanging listlessly--I was roused by half -a dozen of the sailors, who demanded admission into the cabin. They -entered, and their leader addressed me. He told me that he and his -companions had been chosen by the other sailors to come in deputation -to me to make me a requisition which, in justice, I could not refuse. -We were immured in ice and should probably never escape, but they -feared that if, as was possible, the ice should dissipate and a free -passage be opened, I should be rash enough to continue my voyage and -lead them into fresh dangers, after they might happily have surmounted -this. They insisted, therefore, that I should engage with a solemn -promise that if the vessel should be freed I would instantly direct my -course southwards. - -This speech troubled me. I had not despaired, nor had I yet conceived -the idea of returning if set free. Yet could I, in justice, or even in -possibility, refuse this demand? I hesitated before I answered, when -Frankenstein, who had at first been silent, and indeed appeared hardly -to have force enough to attend, now roused himself; his eyes sparkled, -and his cheeks flushed with momentary vigour. Turning towards the men, -he said, "What do you mean? What do you demand of your captain? Are -you, then, so easily turned from your design? Did you not call this a -glorious expedition? - -"And wherefore was it glorious? Not because the way was smooth and -placid as a southern sea, but because it was full of dangers and -terror, because at every new incident your fortitude was to be called -forth and your courage exhibited, because danger and death surrounded -it, and these you were to brave and overcome. For this was it a -glorious, for this was it an honourable undertaking. You were -hereafter to be hailed as the benefactors of your species, your names -adored as belonging to brave men who encountered death for honour and -the benefit of mankind. And now, behold, with the first imagination of -danger, or, if you will, the first mighty and terrific trial of your -courage, you shrink away and are content to be handed down as men who -had not strength enough to endure cold and peril; and so, poor souls, -they were chilly and returned to their warm firesides. Why, that -requires not this preparation; ye need not have come thus far and -dragged your captain to the shame of a defeat merely to prove -yourselves cowards. Oh! Be men, or be more than men. Be steady to -your purposes and firm as a rock. This ice is not made of such stuff as -your hearts may be; it is mutable and cannot withstand you if you say -that it shall not. Do not return to your families with the stigma of -disgrace marked on your brows. Return as heroes who have fought and -conquered and who know not what it is to turn their backs on the foe." -He spoke this with a voice so modulated to the different feelings -expressed in his speech, with an eye so full of lofty design and -heroism, that can you wonder that these men were moved? They looked at -one another and were unable to reply. I spoke; I told them to retire -and consider of what had been said, that I would not lead them farther -north if they strenuously desired the contrary, but that I hoped that, -with reflection, their courage would return. They retired and I turned -towards my friend, but he was sunk in languor and almost deprived of -life. - -How all this will terminate, I know not, but I had rather die than -return shamefully, my purpose unfulfilled. Yet I fear such will be my -fate; the men, unsupported by ideas of glory and honour, can never -willingly continue to endure their present hardships. - - - -September 7th - - -The die is cast; I have consented to return if we are not destroyed. -Thus are my hopes blasted by cowardice and indecision; I come back -ignorant and disappointed. It requires more philosophy than I possess -to bear this injustice with patience. - - - -September 12th - - -It is past; I am returning to England. I have lost my hopes of utility -and glory; I have lost my friend. But I will endeavour to detail these -bitter circumstances to you, my dear sister; and while I am wafted -towards England and towards you, I will not despond. - -September 9th, the ice began to move, and roarings like thunder were -heard at a distance as the islands split and cracked in every -direction. We were in the most imminent peril, but as we could only -remain passive, my chief attention was occupied by my unfortunate guest -whose illness increased in such a degree that he was entirely confined -to his bed. The ice cracked behind us and was driven with force -towards the north; a breeze sprang from the west, and on the 11th the -passage towards the south became perfectly free. When the sailors saw -this and that their return to their native country was apparently -assured, a shout of tumultuous joy broke from them, loud and -long-continued. Frankenstein, who was dozing, awoke and asked the -cause of the tumult. "They shout," I said, "because they will soon -return to England." - -"Do you, then, really return?" - -"Alas! Yes; I cannot withstand their demands. I cannot lead them -unwillingly to danger, and I must return." - -"Do so, if you will; but I will not. You may give up your purpose, but -mine is assigned to me by heaven, and I dare not. I am weak, but -surely the spirits who assist my vengeance will endow me with -sufficient strength." Saying this, he endeavoured to spring from the -bed, but the exertion was too great for him; he fell back and fainted. - -It was long before he was restored, and I often thought that life was -entirely extinct. At length he opened his eyes; he breathed with -difficulty and was unable to speak. The surgeon gave him a composing -draught and ordered us to leave him undisturbed. In the meantime he -told me that my friend had certainly not many hours to live. - -His sentence was pronounced, and I could only grieve and be patient. I -sat by his bed, watching him; his eyes were closed, and I thought he -slept; but presently he called to me in a feeble voice, and bidding me -come near, said, "Alas! The strength I relied on is gone; I feel that -I shall soon die, and he, my enemy and persecutor, may still be in -being. Think not, Walton, that in the last moments of my existence I -feel that burning hatred and ardent desire of revenge I once expressed; -but I feel myself justified in desiring the death of my adversary. -During these last days I have been occupied in examining my past -conduct; nor do I find it blamable. In a fit of enthusiastic madness I -created a rational creature and was bound towards him to assure, as far -as was in my power, his happiness and well-being. - -"This was my duty, but there was another still paramount to that. My -duties towards the beings of my own species had greater claims to my -attention because they included a greater proportion of happiness or -misery. Urged by this view, I refused, and I did right in refusing, to -create a companion for the first creature. He showed unparalleled -malignity and selfishness in evil; he destroyed my friends; he devoted -to destruction beings who possessed exquisite sensations, happiness, -and wisdom; nor do I know where this thirst for vengeance may end. -Miserable himself that he may render no other wretched, he ought to -die. The task of his destruction was mine, but I have failed. When -actuated by selfish and vicious motives, I asked you to undertake my -unfinished work, and I renew this request now, when I am only induced -by reason and virtue. - -"Yet I cannot ask you to renounce your country and friends to fulfil -this task; and now that you are returning to England, you will have -little chance of meeting with him. But the consideration of these -points, and the well balancing of what you may esteem your duties, I -leave to you; my judgment and ideas are already disturbed by the near -approach of death. I dare not ask you to do what I think right, for I -may still be misled by passion. - -"That he should live to be an instrument of mischief disturbs me; in -other respects, this hour, when I momentarily expect my release, is the -only happy one which I have enjoyed for several years. The forms of -the beloved dead flit before me, and I hasten to their arms. Farewell, -Walton! Seek happiness in tranquillity and avoid ambition, even if it -be only the apparently innocent one of distinguishing yourself in -science and discoveries. Yet why do I say this? I have myself been -blasted in these hopes, yet another may succeed." - -His voice became fainter as he spoke, and at length, exhausted by his -effort, he sank into silence. About half an hour afterwards he -attempted again to speak but was unable; he pressed my hand feebly, and -his eyes closed forever, while the irradiation of a gentle smile passed -away from his lips. - -Margaret, what comment can I make on the untimely extinction of this -glorious spirit? What can I say that will enable you to understand the -depth of my sorrow? All that I should express would be inadequate and -feeble. My tears flow; my mind is overshadowed by a cloud of -disappointment. But I journey towards England, and I may there find -consolation. - -I am interrupted. What do these sounds portend? It is midnight; the -breeze blows fairly, and the watch on deck scarcely stir. Again there -is a sound as of a human voice, but hoarser; it comes from the cabin -where the remains of Frankenstein still lie. I must arise and examine. -Good night, my sister. - -Great God! what a scene has just taken place! I am yet dizzy with the -remembrance of it. I hardly know whether I shall have the power to -detail it; yet the tale which I have recorded would be incomplete -without this final and wonderful catastrophe. I entered the cabin where -lay the remains of my ill-fated and admirable friend. Over him hung a -form which I cannot find words to describe--gigantic in stature, yet -uncouth and distorted in its proportions. As he hung over the coffin, -his face was concealed by long locks of ragged hair; but one vast hand -was extended, in colour and apparent texture like that of a mummy. When -he heard the sound of my approach, he ceased to utter exclamations of -grief and horror and sprung towards the window. Never did I behold a -vision so horrible as his face, of such loathsome yet appalling -hideousness. I shut my eyes involuntarily and endeavoured to recollect -what were my duties with regard to this destroyer. I called on him to -stay. - -He paused, looking on me with wonder, and again turning towards the -lifeless form of his creator, he seemed to forget my presence, and -every feature and gesture seemed instigated by the wildest rage of some -uncontrollable passion. - -"That is also my victim!" he exclaimed. "In his murder my crimes are -consummated; the miserable series of my being is wound to its close! -Oh, Frankenstein! Generous and self-devoted being! What does it avail -that I now ask thee to pardon me? I, who irretrievably destroyed thee -by destroying all thou lovedst. Alas! He is cold, he cannot answer -me." His voice seemed suffocated, and my first impulses, which had -suggested to me the duty of obeying the dying request of my friend in -destroying his enemy, were now suspended by a mixture of curiosity and -compassion. I approached this tremendous being; I dared not again -raise my eyes to his face, there was something so scaring and unearthly -in his ugliness. I attempted to speak, but the words died away on my -lips. The monster continued to utter wild and incoherent -self-reproaches. At length I gathered resolution to address him in a -pause of the tempest of his passion. - -"Your repentance," I said, "is now superfluous. If you had listened to -the voice of conscience and heeded the stings of remorse before you had -urged your diabolical vengeance to this extremity, Frankenstein would -yet have lived." - -"And do you dream?" said the daemon. "Do you think that I was then -dead to agony and remorse? He," he continued, pointing to the corpse, -"he suffered not in the consummation of the deed. Oh! Not the -ten-thousandth portion of the anguish that was mine during the -lingering detail of its execution. A frightful selfishness hurried me -on, while my heart was poisoned with remorse. Think you that the -groans of Clerval were music to my ears? My heart was fashioned to be -susceptible of love and sympathy, and when wrenched by misery to vice -and hatred, it did not endure the violence of the change without -torture such as you cannot even imagine. - -"After the murder of Clerval I returned to Switzerland, heart-broken -and overcome. I pitied Frankenstein; my pity amounted to horror; I -abhorred myself. But when I discovered that he, the author at once of -my existence and of its unspeakable torments, dared to hope for -happiness, that while he accumulated wretchedness and despair upon me -he sought his own enjoyment in feelings and passions from the -indulgence of which I was forever barred, then impotent envy and bitter -indignation filled me with an insatiable thirst for vengeance. I -recollected my threat and resolved that it should be accomplished. I -knew that I was preparing for myself a deadly torture, but I was the -slave, not the master, of an impulse which I detested yet could not -disobey. Yet when she died! Nay, then I was not miserable. I had -cast off all feeling, subdued all anguish, to riot in the excess of my -despair. Evil thenceforth became my good. Urged thus far, I had no -choice but to adapt my nature to an element which I had willingly -chosen. The completion of my demoniacal design became an insatiable -passion. And now it is ended; there is my last victim!" - -I was at first touched by the expressions of his misery; yet, when I -called to mind what Frankenstein had said of his powers of eloquence -and persuasion, and when I again cast my eyes on the lifeless form of -my friend, indignation was rekindled within me. "Wretch!" I said. "It -is well that you come here to whine over the desolation that you have -made. You throw a torch into a pile of buildings, and when they are -consumed, you sit among the ruins and lament the fall. Hypocritical -fiend! If he whom you mourn still lived, still would he be the object, -again would he become the prey, of your accursed vengeance. It is not -pity that you feel; you lament only because the victim of your -malignity is withdrawn from your power." - -"Oh, it is not thus--not thus," interrupted the being. "Yet such must -be the impression conveyed to you by what appears to be the purport of -my actions. Yet I seek not a fellow feeling in my misery. No sympathy -may I ever find. When I first sought it, it was the love of virtue, -the feelings of happiness and affection with which my whole being -overflowed, that I wished to be participated. But now that virtue has -become to me a shadow, and that happiness and affection are turned into -bitter and loathing despair, in what should I seek for sympathy? I am -content to suffer alone while my sufferings shall endure; when I die, I -am well satisfied that abhorrence and opprobrium should load my memory. -Once my fancy was soothed with dreams of virtue, of fame, and of -enjoyment. Once I falsely hoped to meet with beings who, pardoning my -outward form, would love me for the excellent qualities which I was -capable of unfolding. I was nourished with high thoughts of honour and -devotion. But now crime has degraded me beneath the meanest animal. No -guilt, no mischief, no malignity, no misery, can be found comparable to -mine. When I run over the frightful catalogue of my sins, I cannot -believe that I am the same creature whose thoughts were once filled -with sublime and transcendent visions of the beauty and the majesty of -goodness. But it is even so; the fallen angel becomes a malignant -devil. Yet even that enemy of God and man had friends and associates -in his desolation; I am alone. - -"You, who call Frankenstein your friend, seem to have a knowledge of my -crimes and his misfortunes. But in the detail which he gave you of them -he could not sum up the hours and months of misery which I endured -wasting in impotent passions. For while I destroyed his hopes, I did -not satisfy my own desires. They were forever ardent and craving; still -I desired love and fellowship, and I was still spurned. Was there no -injustice in this? Am I to be thought the only criminal, when all -humankind sinned against me? Why do you not hate Felix, who drove his -friend from his door with contumely? Why do you not execrate the rustic -who sought to destroy the saviour of his child? Nay, these are virtuous -and immaculate beings! I, the miserable and the abandoned, am an -abortion, to be spurned at, and kicked, and trampled on. Even now my -blood boils at the recollection of this injustice. - -"But it is true that I am a wretch. I have murdered the lovely and the -helpless; I have strangled the innocent as they slept and grasped to -death his throat who never injured me or any other living thing. I -have devoted my creator, the select specimen of all that is worthy of -love and admiration among men, to misery; I have pursued him even to -that irremediable ruin. - -"There he lies, white and cold in death. You hate me, but your -abhorrence cannot equal that with which I regard myself. I look on the -hands which executed the deed; I think on the heart in which the -imagination of it was conceived and long for the moment when these -hands will meet my eyes, when that imagination will haunt my thoughts -no more. - -"Fear not that I shall be the instrument of future mischief. My work -is nearly complete. Neither yours nor any man's death is needed to -consummate the series of my being and accomplish that which must be -done, but it requires my own. Do not think that I shall be slow to -perform this sacrifice. I shall quit your vessel on the ice raft which -brought me thither and shall seek the most northern extremity of the -globe; I shall collect my funeral pile and consume to ashes this -miserable frame, that its remains may afford no light to any curious -and unhallowed wretch who would create such another as I have been. I -shall die. I shall no longer feel the agonies which now consume me or -be the prey of feelings unsatisfied, yet unquenched. He is dead who -called me into being; and when I shall be no more, the very remembrance -of us both will speedily vanish. I shall no longer see the sun or -stars or feel the winds play on my cheeks. - -"Light, feeling, and sense will pass away; and in this condition must I -find my happiness. Some years ago, when the images which this world -affords first opened upon me, when I felt the cheering warmth of summer -and heard the rustling of the leaves and the warbling of the birds, and -these were all to me, I should have wept to die; now it is my only -consolation. Polluted by crimes and torn by the bitterest remorse, -where can I find rest but in death? - -"Farewell! I leave you, and in you the last of humankind whom these -eyes will ever behold. Farewell, Frankenstein! If thou wert yet alive -and yet cherished a desire of revenge against me, it would be better -satiated in my life than in my destruction. But it was not so; thou -didst seek my extinction, that I might not cause greater wretchedness; -and if yet, in some mode unknown to me, thou hadst not ceased to think -and feel, thou wouldst not desire against me a vengeance greater than -that which I feel. Blasted as thou wert, my agony was still superior to -thine, for the bitter sting of remorse will not cease to rankle in my -wounds until death shall close them forever. - -"But soon," he cried with sad and solemn enthusiasm, "I shall die, and -what I now feel be no longer felt. Soon these burning miseries will be -extinct. I shall ascend my funeral pile triumphantly and exult in the -agony of the torturing flames. The light of that conflagration will -fade away; my ashes will be swept into the sea by the winds. My spirit -will sleep in peace, or if it thinks, it will not surely think thus. -Farewell." - -He sprang from the cabin window as he said this, upon the ice raft -which lay close to the vessel. He was soon borne away by the waves and -lost in darkness and distance. - - - - - - - - - - -End of the Project Gutenberg EBook of Frankenstein, by -Mary Wollstonecraft (Godwin) Shelley - -*** END OF THIS PROJECT GUTENBERG EBOOK FRANKENSTEIN *** - -***** This file should be named 84.txt or 84.zip ***** -This and all associated files of various formats will be found in: - http://www.gutenberg.org/8/84/ - -Produced by Judith Boss, Christy Phillips, Lynn Hanninen, -and David Meltzer. HTML version by Al Haines. - - -Updated editions will replace the previous one--the old editions -will be renamed. - -Creating the works from public domain print editions means that no -one owns a United States copyright in these works, so the Foundation -(and you!) can copy and distribute it in the United States without -permission and without paying copyright royalties. Special rules, -set forth in the General Terms of Use part of this license, apply to -copying and distributing Project Gutenberg-tm electronic works to -protect the PROJECT GUTENBERG-tm concept and trademark. Project -Gutenberg is a registered trademark, and may not be used if you -charge for the eBooks, unless you receive specific permission. If you -do not charge anything for copies of this eBook, complying with the -rules is very easy. You may use this eBook for nearly any purpose -such as creation of derivative works, reports, performances and -research. They may be modified and printed and given away--you may do -practically ANYTHING with public domain eBooks. Redistribution is -subject to the trademark license, especially commercial -redistribution. - - - -*** START: FULL LICENSE *** - -THE FULL PROJECT GUTENBERG LICENSE -PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK - -To protect the Project Gutenberg-tm mission of promoting the free -distribution of electronic works, by using or distributing this work -(or any other work associated in any way with the phrase "Project -Gutenberg"), you agree to comply with all the terms of the Full Project -Gutenberg-tm License (available with this file or online at -http://gutenberg.net/license). - - -Section 1. General Terms of Use and Redistributing Project Gutenberg-tm -electronic works - -1.A. By reading or using any part of this Project Gutenberg-tm -electronic work, you indicate that you have read, understand, agree to -and accept all the terms of this license and intellectual property -(trademark/copyright) agreement. If you do not agree to abide by all -the terms of this agreement, you must cease using and return or destroy -all copies of Project Gutenberg-tm electronic works in your possession. -If you paid a fee for obtaining a copy of or access to a Project -Gutenberg-tm electronic work and you do not agree to be bound by the -terms of this agreement, you may obtain a refund from the person or -entity to whom you paid the fee as set forth in paragraph 1.E.8. - -1.B. "Project Gutenberg" is a registered trademark. It may only be -used on or associated in any way with an electronic work by people who -agree to be bound by the terms of this agreement. There are a few -things that you can do with most Project Gutenberg-tm electronic works -even without complying with the full terms of this agreement. See -paragraph 1.C below. There are a lot of things you can do with Project -Gutenberg-tm electronic works if you follow the terms of this agreement -and help preserve free future access to Project Gutenberg-tm electronic -works. See paragraph 1.E below. - -1.C. The Project Gutenberg Literary Archive Foundation ("the Foundation" -or PGLAF), owns a compilation copyright in the collection of Project -Gutenberg-tm electronic works. Nearly all the individual works in the -collection are in the public domain in the United States. If an -individual work is in the public domain in the United States and you are -located in the United States, we do not claim a right to prevent you from -copying, distributing, performing, displaying or creating derivative -works based on the work as long as all references to Project Gutenberg -are removed. Of course, we hope that you will support the Project -Gutenberg-tm mission of promoting free access to electronic works by -freely sharing Project Gutenberg-tm works in compliance with the terms of -this agreement for keeping the Project Gutenberg-tm name associated with -the work. You can easily comply with the terms of this agreement by -keeping this work in the same format with its attached full Project -Gutenberg-tm License when you share it without charge with others. - -1.D. The copyright laws of the place where you are located also govern -what you can do with this work. Copyright laws in most countries are in -a constant state of change. If you are outside the United States, check -the laws of your country in addition to the terms of this agreement -before downloading, copying, displaying, performing, distributing or -creating derivative works based on this work or any other Project -Gutenberg-tm work. The Foundation makes no representations concerning -the copyright status of any work in any country outside the United -States. - -1.E. Unless you have removed all references to Project Gutenberg: - -1.E.1. The following sentence, with active links to, or other immediate -access to, the full Project Gutenberg-tm License must appear prominently -whenever any copy of a Project Gutenberg-tm work (any work on which the -phrase "Project Gutenberg" appears, or with which the phrase "Project -Gutenberg" is associated) is accessed, displayed, performed, viewed, -copied or distributed: - -This eBook is for the use of anyone anywhere at no cost and with -almost no restrictions whatsoever. You may copy it, give it away or -re-use it under the terms of the Project Gutenberg License included -with this eBook or online at www.gutenberg.net - -1.E.2. If an individual Project Gutenberg-tm electronic work is derived -from the public domain (does not contain a notice indicating that it is -posted with permission of the copyright holder), the work can be copied -and distributed to anyone in the United States without paying any fees -or charges. If you are redistributing or providing access to a work -with the phrase "Project Gutenberg" associated with or appearing on the -work, you must comply either with the requirements of paragraphs 1.E.1 -through 1.E.7 or obtain permission for the use of the work and the -Project Gutenberg-tm trademark as set forth in paragraphs 1.E.8 or -1.E.9. - -1.E.3. If an individual Project Gutenberg-tm electronic work is posted -with the permission of the copyright holder, your use and distribution -must comply with both paragraphs 1.E.1 through 1.E.7 and any additional -terms imposed by the copyright holder. Additional terms will be linked -to the Project Gutenberg-tm License for all works posted with the -permission of the copyright holder found at the beginning of this work. - -1.E.4. Do not unlink or detach or remove the full Project Gutenberg-tm -License terms from this work, or any files containing a part of this -work or any other work associated with Project Gutenberg-tm. - -1.E.5. Do not copy, display, perform, distribute or redistribute this -electronic work, or any part of this electronic work, without -prominently displaying the sentence set forth in paragraph 1.E.1 with -active links or immediate access to the full terms of the Project -Gutenberg-tm License. - -1.E.6. You may convert to and distribute this work in any binary, -compressed, marked up, nonproprietary or proprietary form, including any -word processing or hypertext form. However, if you provide access to or -distribute copies of a Project Gutenberg-tm work in a format other than -"Plain Vanilla ASCII" or other format used in the official version -posted on the official Project Gutenberg-tm web site (www.gutenberg.net), -you must, at no additional cost, fee or expense to the user, provide a -copy, a means of exporting a copy, or a means of obtaining a copy upon -request, of the work in its original "Plain Vanilla ASCII" or other -form. Any alternate format must include the full Project Gutenberg-tm -License as specified in paragraph 1.E.1. - -1.E.7. Do not charge a fee for access to, viewing, displaying, -performing, copying or distributing any Project Gutenberg-tm works -unless you comply with paragraph 1.E.8 or 1.E.9. - -1.E.8. You may charge a reasonable fee for copies of or providing -access to or distributing Project Gutenberg-tm electronic works provided -that - -- You pay a royalty fee of 20% of the gross profits you derive from - the use of Project Gutenberg-tm works calculated using the method - you already use to calculate your applicable taxes. The fee is - owed to the owner of the Project Gutenberg-tm trademark, but he - has agreed to donate royalties under this paragraph to the - Project Gutenberg Literary Archive Foundation. Royalty payments - must be paid within 60 days following each date on which you - prepare (or are legally required to prepare) your periodic tax - returns. Royalty payments should be clearly marked as such and - sent to the Project Gutenberg Literary Archive Foundation at the - address specified in Section 4, "Information about donations to - the Project Gutenberg Literary Archive Foundation." - -- You provide a full refund of any money paid by a user who notifies - you in writing (or by e-mail) within 30 days of receipt that s/he - does not agree to the terms of the full Project Gutenberg-tm - License. You must require such a user to return or - destroy all copies of the works possessed in a physical medium - and discontinue all use of and all access to other copies of - Project Gutenberg-tm works. - -- You provide, in accordance with paragraph 1.F.3, a full refund of any - money paid for a work or a replacement copy, if a defect in the - electronic work is discovered and reported to you within 90 days - of receipt of the work. - -- You comply with all other terms of this agreement for free - distribution of Project Gutenberg-tm works. - -1.E.9. If you wish to charge a fee or distribute a Project Gutenberg-tm -electronic work or group of works on different terms than are set -forth in this agreement, you must obtain permission in writing from -both the Project Gutenberg Literary Archive Foundation and Michael -Hart, the owner of the Project Gutenberg-tm trademark. Contact the -Foundation as set forth in Section 3 below. - -1.F. - -1.F.1. Project Gutenberg volunteers and employees expend considerable -effort to identify, do copyright research on, transcribe and proofread -public domain works in creating the Project Gutenberg-tm -collection. Despite these efforts, Project Gutenberg-tm electronic -works, and the medium on which they may be stored, may contain -"Defects," such as, but not limited to, incomplete, inaccurate or -corrupt data, transcription errors, a copyright or other intellectual -property infringement, a defective or damaged disk or other medium, a -computer virus, or computer codes that damage or cannot be read by -your equipment. - -1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for the "Right -of Replacement or Refund" described in paragraph 1.F.3, the Project -Gutenberg Literary Archive Foundation, the owner of the Project -Gutenberg-tm trademark, and any other party distributing a Project -Gutenberg-tm electronic work under this agreement, disclaim all -liability to you for damages, costs and expenses, including legal -fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT -LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE -PROVIDED IN PARAGRAPH F3. YOU AGREE THAT THE FOUNDATION, THE -TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE -LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE OR -INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH -DAMAGE. - -1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you discover a -defect in this electronic work within 90 days of receiving it, you can -receive a refund of the money (if any) you paid for it by sending a -written explanation to the person you received the work from. If you -received the work on a physical medium, you must return the medium with -your written explanation. The person or entity that provided you with -the defective work may elect to provide a replacement copy in lieu of a -refund. If you received the work electronically, the person or entity -providing it to you may choose to give you a second opportunity to -receive the work electronically in lieu of a refund. If the second copy -is also defective, you may demand a refund in writing without further -opportunities to fix the problem. - -1.F.4. Except for the limited right of replacement or refund set forth -in paragraph 1.F.3, this work is provided to you 'AS-IS' WITH NO OTHER -WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO -WARRANTIES OF MERCHANTIBILITY OR FITNESS FOR ANY PURPOSE. - -1.F.5. Some states do not allow disclaimers of certain implied -warranties or the exclusion or limitation of certain types of damages. -If any disclaimer or limitation set forth in this agreement violates the -law of the state applicable to this agreement, the agreement shall be -interpreted to make the maximum disclaimer or limitation permitted by -the applicable state law. The invalidity or unenforceability of any -provision of this agreement shall not void the remaining provisions. - -1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation, the -trademark owner, any agent or employee of the Foundation, anyone -providing copies of Project Gutenberg-tm electronic works in accordance -with this agreement, and any volunteers associated with the production, -promotion and distribution of Project Gutenberg-tm electronic works, -harmless from all liability, costs and expenses, including legal fees, -that arise directly or indirectly from any of the following which you do -or cause to occur: (a) distribution of this or any Project Gutenberg-tm -work, (b) alteration, modification, or additions or deletions to any -Project Gutenberg-tm work, and (c) any Defect you cause. - - -Section 2. Information about the Mission of Project Gutenberg-tm - -Project Gutenberg-tm is synonymous with the free distribution of -electronic works in formats readable by the widest variety of computers -including obsolete, old, middle-aged and new computers. It exists -because of the efforts of hundreds of volunteers and donations from -people in all walks of life. - -Volunteers and financial support to provide volunteers with the -assistance they need, is critical to reaching Project Gutenberg-tm's -goals and ensuring that the Project Gutenberg-tm collection will -remain freely available for generations to come. In 2001, the Project -Gutenberg Literary Archive Foundation was created to provide a secure -and permanent future for Project Gutenberg-tm and future generations. -To learn more about the Project Gutenberg Literary Archive Foundation -and how your efforts and donations can help, see Sections 3 and 4 -and the Foundation web page at http://www.pglaf.org. - - -Section 3. Information about the Project Gutenberg Literary Archive -Foundation - -The Project Gutenberg Literary Archive Foundation is a non profit -501(c)(3) educational corporation organized under the laws of the -state of Mississippi and granted tax exempt status by the Internal -Revenue Service. The Foundation's EIN or federal tax identification -number is 64-6221541. Its 501(c)(3) letter is posted at -http://pglaf.org/fundraising. Contributions to the Project Gutenberg -Literary Archive Foundation are tax deductible to the full extent -permitted by U.S. federal laws and your state's laws. - -The Foundation's principal office is located at 4557 Melan Dr. S. -Fairbanks, AK, 99712., but its volunteers and employees are scattered -throughout numerous locations. Its business office is located at -809 North 1500 West, Salt Lake City, UT 84116, (801) 596-1887, email -business@pglaf.org. Email contact links and up to date contact -information can be found at the Foundation's web site and official -page at http://pglaf.org - -For additional contact information: - Dr. Gregory B. Newby - Chief Executive and Director - gbnewby@pglaf.org - - -Section 4. Information about Donations to the Project Gutenberg -Literary Archive Foundation - -Project Gutenberg-tm depends upon and cannot survive without wide -spread public support and donations to carry out its mission of -increasing the number of public domain and licensed works that can be -freely distributed in machine readable form accessible by the widest -array of equipment including outdated equipment. Many small donations -($1 to $5,000) are particularly important to maintaining tax exempt -status with the IRS. - -The Foundation is committed to complying with the laws regulating -charities and charitable donations in all 50 states of the United -States. Compliance requirements are not uniform and it takes a -considerable effort, much paperwork and many fees to meet and keep up -with these requirements. We do not solicit donations in locations -where we have not received written confirmation of compliance. To -SEND DONATIONS or determine the status of compliance for any -particular state visit http://pglaf.org - -While we cannot and do not solicit contributions from states where we -have not met the solicitation requirements, we know of no prohibition -against accepting unsolicited donations from donors in such states who -approach us with offers to donate. - -International donations are gratefully accepted, but we cannot make -any statements concerning tax treatment of donations received from -outside the United States. U.S. laws alone swamp our small staff. - -Please check the Project Gutenberg Web pages for current donation -methods and addresses. Donations are accepted in a number of other -ways including including checks, online payments and credit card -donations. To donate, please visit: http://pglaf.org/donate - - -Section 5. General Information About Project Gutenberg-tm electronic -works. - -Professor Michael S. Hart is the originator of the Project Gutenberg-tm -concept of a library of electronic works that could be freely shared -with anyone. For thirty years, he produced and distributed Project -Gutenberg-tm eBooks with only a loose network of volunteer support. - - -Project Gutenberg-tm eBooks are often created from several printed -editions, all of which are confirmed as Public Domain in the U.S. -unless a copyright notice is included. Thus, we do not necessarily -keep eBooks in compliance with any particular paper edition. - - -Most people start at our Web site which has the main PG search facility: - - http://www.gutenberg.net - -This Web site includes information about Project Gutenberg-tm, -including how to make donations to the Project Gutenberg Literary -Archive Foundation, how to help produce our new eBooks, and how to -subscribe to our email newsletter to hear about new eBooks. \ No newline at end of file diff --git a/java/examples/Topics/Advanced Data/IntListLottery/IntListLottery.pde b/java/examples/Topics/Advanced Data/IntListLottery/IntListLottery.pde deleted file mode 100644 index de8910825..000000000 --- a/java/examples/Topics/Advanced Data/IntListLottery/IntListLottery.pde +++ /dev/null @@ -1,99 +0,0 @@ -/** - * IntList Lottery example - * by Daniel Shiffman. - * - * This example demonstrates an IntList can be used to store a list of numbers. - * While an array of integers serves a similar purpose it is of fixed size. The - * An IntList can easily have values added or deleted and it can also be - * shuffled and sorted. For lists of floats or Strings, you can use FloatList - * and StringList. For lists of objects, use ArrayList. - * - * In this example, three lists of integers are created. One is a pool of numbers - * that is shuffled and picked randomly from. One is the list of "picked" numbers. - * And one is a lottery "ticket" which includes 5 numbers that are trying to be matched. - */ - -// Three lists of integers -IntList lottery; -IntList results; -IntList ticket; - -void setup() { - size(640, 360); - frameRate(30); - // Create empy lists - lottery = new IntList(); - results = new IntList(); - ticket = new IntList(); - - - // Add 20 integers in order to the lottery list - for (int i = 0; i < 20; i++) { - lottery.append(i); - } - - // Pick five numbers from the lottery list to go into the Ticket list - for (int i = 0; i < 5; i++) { - int index = int(random(lottery.size())); - ticket.append(lottery.get(index)); - } -} - -void draw() { - background(51); - - // The shuffle() method randomly shuffles the order of the values in the list - lottery.shuffle(); - - // Call a method that will display the integers in the list at an x,y location - showList(lottery, 16, 48); - showList(results, 16, 100); - showList(ticket, 16, 140); - - - // This loop checks if the picked numbers (results) - // match the ticket numbers - for (int i = 0; i < results.size(); i++) { - // Are the integers equal? - if (results.get(i) == ticket.get(i)) { - fill(0, 255, 0, 100); // if so green - } else { - fill(255, 0, 0, 100); // if not red - } - ellipse(16+i*32, 140, 24, 24); - } - - - // One every 30 frames we pick a new lottery number to go in results - if (frameCount % 30 == 0) { - if (results.size() < 5) { - // Get the first value in the lottery list and remove it - int val = lottery.remove(0); - // Put it in the results - results.append(val); - } else { - // Ok we picked five numbers, let's reset - for (int i = 0; i < results.size(); i++) { - // Put the picked results back into the lottery - lottery.append(results.get(i)); - } - // Clear the results and start over - results.clear(); - } - } -} - -// Draw a list of numbers starting at an x,y location -void showList(IntList list, float x, float y) { - for (int i = 0; i < list.size(); i++) { - // Use get() to pull a value from the list at the specified index - int val = list.get(i); - stroke(255); - noFill(); - ellipse(x+i*32, y, 24, 24); - textAlign(CENTER); - fill(255); - text(val, x+i*32, y+6); - } -} - diff --git a/java/examples/Topics/Advanced Data/LoadSaveJSON/Bubble.pde b/java/examples/Topics/Advanced Data/LoadSaveJSON/Bubble.pde deleted file mode 100644 index 3a7b9b7f9..000000000 --- a/java/examples/Topics/Advanced Data/LoadSaveJSON/Bubble.pde +++ /dev/null @@ -1,40 +0,0 @@ -// A Bubble class - -class Bubble { - float x,y; - float diameter; - String name; - - boolean over = false; - - // Create the Bubble - Bubble(float x_, float y_, float diameter_, String s) { - x = x_; - y = y_; - diameter = diameter_; - name = s; - } - - // CHecking if mouse is over the Bubble - void rollover(float px, float py) { - float d = dist(px,py,x,y); - if (d < diameter/2) { - over = true; - } else { - over = false; - } - } - - // Display the Bubble - void display() { - stroke(0); - strokeWeight(2); - noFill(); - ellipse(x,y,diameter,diameter); - if (over) { - fill(0); - textAlign(CENTER); - text(name,x,y+diameter/2+20); - } - } -} diff --git a/java/examples/Topics/Advanced Data/LoadSaveJSON/LoadSaveJSON.pde b/java/examples/Topics/Advanced Data/LoadSaveJSON/LoadSaveJSON.pde deleted file mode 100644 index 4fcba4cf6..000000000 --- a/java/examples/Topics/Advanced Data/LoadSaveJSON/LoadSaveJSON.pde +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Loading XML Data - * by Daniel Shiffman. - * - * This example demonstrates how to use loadJSON() - * to retrieve data from a JSON file and make objects - * from that data. - * - * Here is what the JSON looks like (partial): - * - { - "bubbles": [ - { - "position": { - "x": 160, - "y": 103 - }, - "diameter": 43.19838, - "label": "Happy" - }, - { - "position": { - "x": 372, - "y": 137 - }, - "diameter": 52.42526, - "label": "Sad" - } - ] - } - */ - -// An Array of Bubble objects -Bubble[] bubbles; -// A JSON object -JSONObject json; - -void setup() { - size(640, 360); - loadData(); -} - -void draw() { - background(255); - // Display all bubbles - for (Bubble b : bubbles) { - b.display(); - b.rollover(mouseX, mouseY); - } - // - textAlign(LEFT); - fill(0); - text("Click to add bubbles.", 10, height-10); -} - void loadData() { - // Load JSON file - // Temporary full path until path problem resolved. - json = loadJSONObject("data.json"); - - JSONArray bubbleData = json.getJSONArray("bubbles"); - - // The size of the array of Bubble objects is determined by the total XML elements named "bubble" - bubbles = new Bubble[bubbleData.size()]; - - for (int i = 0; i < bubbleData.size(); i++) { - // Get each object in the array - JSONObject bubble = bubbleData.getJSONObject(i); - // Get a position object - JSONObject position = bubble.getJSONObject("position"); - // Get x,y from position - int x = position.getInt("x"); - int y = position.getInt("y"); - - // Get diamter and label - float diameter = bubble.getFloat("diameter"); - String label = bubble.getString("label"); - - // Put object in array - bubbles[i] = new Bubble(x, y, diameter, label); - } -} - - void mousePressed() { - // Create a new JSON bubble object - JSONObject newBubble = new JSONObject(); - - // Create a new JSON position object - JSONObject position = new JSONObject(); - position.setInt("x", mouseX); - position.setInt("y", mouseY); - - // Add position to bubble - newBubble.setJSONObject("position", position); - - // Add diamater and label to bubble - newBubble.setFloat("diameter", random(40, 80)); - newBubble.setString("label", "New label"); - - // Append the new JSON bubble object to the array - JSONArray bubbleData = json.getJSONArray("bubbles"); - bubbleData.append(newBubble); - - if (bubbleData.size() > 10) { - bubbleData.remove(0); - } - - // Save new data - saveJSONObject(json,"data/data.json"); - loadData(); -} - diff --git a/java/examples/Topics/Advanced Data/LoadSaveJSON/data/data.json b/java/examples/Topics/Advanced Data/LoadSaveJSON/data/data.json deleted file mode 100644 index bcb0079c3..000000000 --- a/java/examples/Topics/Advanced Data/LoadSaveJSON/data/data.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "bubbles": [ - { - "position": { - "x": 160, - "y": 103 - }, - "diameter": 43.19838, - "label": "Happy" - }, - { - "position": { - "x": 372, - "y": 137 - }, - "diameter": 52.42526, - "label": "Sad" - }, - { - "position": { - "x": 273, - "y": 235 - }, - "diameter": 61.14072, - "label": "Joyous" - }, - { - "position": { - "x": 121, - "y": 179 - }, - "diameter": 44.758068, - "label": "Melancholy" - } - ] -} \ No newline at end of file diff --git a/java/examples/Topics/Advanced Data/LoadSaveTable/Bubble.pde b/java/examples/Topics/Advanced Data/LoadSaveTable/Bubble.pde deleted file mode 100644 index 3a7b9b7f9..000000000 --- a/java/examples/Topics/Advanced Data/LoadSaveTable/Bubble.pde +++ /dev/null @@ -1,40 +0,0 @@ -// A Bubble class - -class Bubble { - float x,y; - float diameter; - String name; - - boolean over = false; - - // Create the Bubble - Bubble(float x_, float y_, float diameter_, String s) { - x = x_; - y = y_; - diameter = diameter_; - name = s; - } - - // CHecking if mouse is over the Bubble - void rollover(float px, float py) { - float d = dist(px,py,x,y); - if (d < diameter/2) { - over = true; - } else { - over = false; - } - } - - // Display the Bubble - void display() { - stroke(0); - strokeWeight(2); - noFill(); - ellipse(x,y,diameter,diameter); - if (over) { - fill(0); - textAlign(CENTER); - text(name,x,y+diameter/2+20); - } - } -} diff --git a/java/examples/Topics/Advanced Data/LoadSaveTable/LoadSaveTable.pde b/java/examples/Topics/Advanced Data/LoadSaveTable/LoadSaveTable.pde deleted file mode 100644 index 3baeb9a8a..000000000 --- a/java/examples/Topics/Advanced Data/LoadSaveTable/LoadSaveTable.pde +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Loading Tabular Data - * by Daniel Shiffman. - * - * This example demonstrates how to use loadTable() - * to retrieve data from a CSV file and make objects - * from that data. - * - * Here is what the CSV looks like: - * - x,y,diameter,name - 160,103,43.19838,Happy - 372,137,52.42526,Sad - 273,235,61.14072,Joyous - 121,179,44.758068,Melancholy - */ - -// An Array of Bubble objects -Bubble[] bubbles; -// A Table object -Table table; - -void setup() { - size(640, 360); - loadData(); -} - -void draw() { - background(255); - // Display all bubbles - for (Bubble b : bubbles) { - b.display(); - b.rollover(mouseX, mouseY); - } - - textAlign(LEFT); - fill(0); - text("Click to add bubbles.", 10, height-10); -} - -void loadData() { - // Load CSV file into a Table object - // "header" option indicates the file has a header row - table = loadTable("data.csv", "header"); - - // The size of the array of Bubble objects is determined by the total number of rows in the CSV - bubbles = new Bubble[table.getRowCount()]; - - // You can access iterate over all the rows in a table - int rowCount = 0; - for (TableRow row : table.rows()) { - // You can access the fields via their column name (or index) - float x = row.getFloat("x"); - float y = row.getFloat("y"); - float d = row.getFloat("diameter"); - String n = row.getString("name"); - // Make a Bubble object out of the data read - bubbles[rowCount] = new Bubble(x, y, d, n); - rowCount++; - } -} - -void mousePressed() { - // Create a new row - TableRow row = table.addRow(); - // Set the values of that row - row.setFloat("x", mouseX); - row.setFloat("y", mouseY); - row.setFloat("diameter", random(40, 80)); - row.setString("name", "Blah"); - - // If the table has more than 10 rows - if (table.getRowCount() > 10) { - // Delete the oldest row - table.removeRow(0); - } - - // Writing the CSV back to the same file - saveTable(table, "data/data.csv"); - // And reloading it - loadData(); -} - diff --git a/java/examples/Topics/Advanced Data/LoadSaveTable/data/data.csv b/java/examples/Topics/Advanced Data/LoadSaveTable/data/data.csv deleted file mode 100644 index 88ac4c1b7..000000000 --- a/java/examples/Topics/Advanced Data/LoadSaveTable/data/data.csv +++ /dev/null @@ -1,5 +0,0 @@ -x,y,diameter,name -160,103,43.19838,Happy -372,137,52.42526,Sad -273,235,61.14072,Joyous -121,179,44.758068,Melancholy \ No newline at end of file diff --git a/java/examples/Topics/Advanced Data/LoadSaveXML/Bubble.pde b/java/examples/Topics/Advanced Data/LoadSaveXML/Bubble.pde deleted file mode 100644 index 3a7b9b7f9..000000000 --- a/java/examples/Topics/Advanced Data/LoadSaveXML/Bubble.pde +++ /dev/null @@ -1,40 +0,0 @@ -// A Bubble class - -class Bubble { - float x,y; - float diameter; - String name; - - boolean over = false; - - // Create the Bubble - Bubble(float x_, float y_, float diameter_, String s) { - x = x_; - y = y_; - diameter = diameter_; - name = s; - } - - // CHecking if mouse is over the Bubble - void rollover(float px, float py) { - float d = dist(px,py,x,y); - if (d < diameter/2) { - over = true; - } else { - over = false; - } - } - - // Display the Bubble - void display() { - stroke(0); - strokeWeight(2); - noFill(); - ellipse(x,y,diameter,diameter); - if (over) { - fill(0); - textAlign(CENTER); - text(name,x,y+diameter/2+20); - } - } -} diff --git a/java/examples/Topics/Advanced Data/LoadSaveXML/LoadSaveXML.pde b/java/examples/Topics/Advanced Data/LoadSaveXML/LoadSaveXML.pde deleted file mode 100644 index b8a1d99b4..000000000 --- a/java/examples/Topics/Advanced Data/LoadSaveXML/LoadSaveXML.pde +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Loading XML Data - * by Daniel Shiffman. - * - * This example demonstrates how to use loadXML() - * to retrieve data from an XML file and make objects - * from that data. - * - * Here is what the XML looks like: - * - - - - - 43.19838 - - - - - 52.42526 - - - - */ - -// An Array of Bubble objects -Bubble[] bubbles; -// A Table object -XML xml; - -void setup() { - size(640, 360); - loadData(); -} - -void draw() { - background(255); - // Display all bubbles - for (Bubble b : bubbles) { - b.display(); - b.rollover(mouseX, mouseY); - } - - textAlign(LEFT); - fill(0); - text("Click to add bubbles.", 10, height-10); -} - -void loadData() { - // Load XML file - xml = loadXML("data.xml"); - // Get all the child nodes named "bubble" - XML[] children = xml.getChildren("bubble"); - - // The size of the array of Bubble objects is determined by the total XML elements named "bubble" - bubbles = new Bubble[children.length]; - - for (int i = 0; i < bubbles.length; i++) { - - // The position element has two attributes: x and y - XML positionElement = children[i].getChild("position"); - // Note how with attributes we can get an integer or float via getInt() and getFloat() - float x = positionElement.getInt("x"); - float y = positionElement.getInt("y"); - - // The diameter is the content of the child named "diamater" - XML diameterElement = children[i].getChild("diameter"); - // Note how with the content of an XML node, we retrieve via getIntContent() and getFloatContent() - float diameter = diameterElement.getFloatContent(); - - // The label is the content of the child named "label" - XML labelElement = children[i].getChild("label"); - String label = labelElement.getContent(); - - // Make a Bubble object out of the data read - bubbles[i] = new Bubble(x, y, diameter, label); - } - -} - -// Still need to work on adding and deleting - -void mousePressed() { - - // Create a new XML bubble element - XML bubble = xml.addChild("bubble"); - - // Set the poisition element - XML position = bubble.addChild("position"); - // Here we can set attributes as integers directly - position.setInt("x",mouseX); - position.setInt("y",mouseY); - - // Set the diameter element - XML diameter = bubble.addChild("diameter"); - // Here for a node's content, we have to convert to a String - diameter.setFloatContent(random(40,80)); - - // Set a label - XML label = bubble.addChild("label"); - label.setContent("New label"); - - - // Here we are removing the oldest bubble if there are more than 10 - XML[] children = xml.getChildren("bubble"); - // If the XML file has more than 10 bubble elements - if (children.length > 10) { - // Delete the first one - xml.removeChild(children[0]); - } - - // Save a new XML file - saveXML(xml,"data/data.xml"); - - // reload the new data - loadData(); -} - diff --git a/java/examples/Topics/Advanced Data/LoadSaveXML/data/data.xml b/java/examples/Topics/Advanced Data/LoadSaveXML/data/data.xml deleted file mode 100644 index 24bbf2acf..000000000 --- a/java/examples/Topics/Advanced Data/LoadSaveXML/data/data.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - 43.19838 - - - - - 52.42526 - - - - - 61.14072 - - - - - 44.758068 - - - diff --git a/java/examples/Topics/Advanced Data/Regex/Regex.pde b/java/examples/Topics/Advanced Data/Regex/Regex.pde deleted file mode 100644 index 6e5e8568f..000000000 --- a/java/examples/Topics/Advanced Data/Regex/Regex.pde +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Regular Expression example - * by Daniel Shiffman. - * - * This example demonstrates how to use matchAll() to create - * a list of all matches of a given regex. - * - * Here we'll load the raw HTML from a URL and search for any - * links - */ - -// Our source url -String url = "http://processing.org"; -// We'll store the results in an array -String[] links; - -void setup() { - size(640, 360); - smooth(); - // Load the links - links = loadLinks(url); -} - -void draw() { - background(0); - // Display the raw links - fill(255); - for (int i = 0; i < links.length; i++) { - text(links[i],10,16+i*16); - } -} - -String[] loadLinks(String s) { - // Load the raw HTML - String[] lines = loadStrings(s); - // Put it in one big string - String html = join(lines,"\n"); - - // A wacky regex for matching a URL - String regex = "<\\s*a\\s+href\\s*=\\s*\"(.*?)\""; - // The matches are in a two dimensional array - // The first dimension is all matches - // The second dimension is the groups - String[][] matches = matchAll(html, regex); - - // An array for the results - String[] results = new String[matches.length]; - - // We want group 1 for each result - for (int i = 0; i < results.length; i++) { - results[i] = matches[i][1]; - } - - // Return the results - return results; -} - diff --git a/java/examples/Topics/Advanced Data/Threads/Threads.pde b/java/examples/Topics/Advanced Data/Threads/Threads.pde deleted file mode 100644 index f43bc3d2e..000000000 --- a/java/examples/Topics/Advanced Data/Threads/Threads.pde +++ /dev/null @@ -1,109 +0,0 @@ -/** - * Thread function example - * by Daniel Shiffman. - * - * This example demonstrates how to use thread() to spawn - * a process that happens outside of the main animation thread. - * - * When thread() is called, the draw() loop will continue while - * the code inside the function passed to thread() will operate - * in the background. - * - * For more about threads, see: http://wiki.processing.org/w/Threading - */ - -// This sketch will load data from all of these URLs in a separate thread -String[] urls = { - "http://processing.org", - "http://www.processing.org/exhibition/", - "http://www.processing.org/reference/", - "http://www.processing.org/reference/libraries", - "http://www.processing.org/reference/tools", - "http://www.processing.org/reference/environment", - "http://www.processing.org/learning/", - "http://www.processing.org/learning/basics/", - "http://www.processing.org/learning/topics/", - "http://www.processing.org/learning/gettingstarted/", - "http://www.processing.org/download/", - "http://www.processing.org/shop/", - "http://www.processing.org/about/" -}; - -// This will keep track of whether the thread is finished -boolean finished = false; -// And how far along -float percent = 0; - -// A variable to keep all the data loaded -String allData; - -void setup() { - size(640, 360); - // Spawn the thread! - thread("loadData"); -} - -void draw() { - background(0); - - // If we're not finished draw a "loading bar" - // This is so that we can see the progress of the thread - // This would not be necessary in a sketch where you wanted to load data in the background - // and hide this from the user, allowing the draw() loop to simply continue - if (!finished) { - stroke(255); - noFill(); - rect(width/2-150, height/2, 300, 10); - fill(255); - // The size of the rectangle is mapped to the percentage completed - float w = map(percent, 0, 1, 0, 300); - rect(width/2-150, height/2, w, 10); - textSize(16); - textAlign(CENTER); - fill(255); - text("Loading", width/2, height/2+30); - } - else { - // The thread is complete! - textAlign(CENTER); - textSize(24); - fill(255); - text("Finished loading. Click the mouse to load again.", width/2, height/2); - } -} - -void mousePressed() { - thread("loadData"); -} - -void loadData() { - // The thread is not completed - finished = false; - // Reset the data to empty - allData = ""; - - // Look at each URL - // This example is doing some highly arbitrary things just to make it take longer - // If you had a lot of data parsing you needed to do, this can all happen in the background - for (int i = 0; i < urls.length; i++) { - String[] lines = loadStrings(urls[i]); - // Demonstrating some arbitrary text splitting, joining, and sorting to make the thread take longer - String allTxt = join(lines, " "); - String[] words = splitTokens(allTxt, "\t+\n <>=\\-!@#$%^&*(),.;:/?\"\'"); - for (int j = 0; j < words.length; j++) { - words[j] = words[j].trim(); - words[j] = words[j].toLowerCase(); - } - words = sort(words); - allData += join(words, " "); - percent = float(i)/urls.length; - } - - String[] words = split(allData," "); - words = sort(words); - allData = join(words, " "); - - // The thread is completed! - finished = true; -} - diff --git a/java/examples/Topics/Advanced Data/XMLYahooWeather/XMLYahooWeather.pde b/java/examples/Topics/Advanced Data/XMLYahooWeather/XMLYahooWeather.pde deleted file mode 100644 index 5499410b1..000000000 --- a/java/examples/Topics/Advanced Data/XMLYahooWeather/XMLYahooWeather.pde +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Loading XML Data - * by Daniel Shiffman. - * - * This example demonstrates how to use loadXML() - * to retrieve data from an XML document via a URL - */ - -// We're going to store the temperature -int temperature = 0; -// We're going to store text about the weather -String weather = ""; - -// The zip code we'll check for -String zip = "10003"; - -PFont font; - -void setup() { - size(600, 360); - - font = createFont("Merriweather-Light.ttf", 28); - textFont(font); - - // The URL for the XML document - String url = "http://xml.weather.yahoo.com/forecastrss?p=" + zip; - - // Load the XML document - XML xml = loadXML(url); - - // Grab the element we want - XML forecast = xml.getChild("channel/item/yweather:forecast"); - - // Get the attributes we want - temperature = forecast.getInt("high"); - weather = forecast.getString("text"); -} - -void draw() { - background(255); - fill(0); - - // Display all the stuff we want to display - text("Zip code: " + zip, width*0.15, height*0.33); - text("Today’s high: " + temperature, width*0.15, height*0.5); - text("Forecast: " + weather, width*0.15, height*0.66); - -} diff --git a/java/examples/Topics/Advanced Data/XMLYahooWeather/data/Merriweather-Light.ttf b/java/examples/Topics/Advanced Data/XMLYahooWeather/data/Merriweather-Light.ttf deleted file mode 100644 index 7b7731a14..000000000 Binary files a/java/examples/Topics/Advanced Data/XMLYahooWeather/data/Merriweather-Light.ttf and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/AnimatedSprite.pde b/java/examples/Topics/Animation/AnimatedSprite/AnimatedSprite.pde deleted file mode 100644 index 17d560cca..000000000 --- a/java/examples/Topics/Animation/AnimatedSprite/AnimatedSprite.pde +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Animated Sprite (Shifty + Teddy) - * by James Paterson. - * - * Press the mouse button to change animations. - * Demonstrates loading, displaying, and animating GIF images. - * It would be easy to write a program to display - * animated GIFs, but would not allow as much control over - * the display sequence and rate of display. - */ - -Animation animation1, animation2; - -float xpos; -float ypos; -float drag = 30.0; - -void setup() { - size(640, 360); - background(255, 204, 0); - frameRate(24); - animation1 = new Animation("PT_Shifty_", 38); - animation2 = new Animation("PT_Teddy_", 60); - ypos = height * 0.25; -} - -void draw() { - float dx = mouseX - xpos; - xpos = xpos + dx/drag; - - // Display the sprite at the position xpos, ypos - if (mousePressed) { - background(153, 153, 0); - animation1.display(xpos-animation1.getWidth()/2, ypos); - } else { - background(255, 204, 0); - animation2.display(xpos-animation1.getWidth()/2, ypos); - } -} diff --git a/java/examples/Topics/Animation/AnimatedSprite/Animation.pde b/java/examples/Topics/Animation/AnimatedSprite/Animation.pde deleted file mode 100644 index 6c98ef20b..000000000 --- a/java/examples/Topics/Animation/AnimatedSprite/Animation.pde +++ /dev/null @@ -1,27 +0,0 @@ -// Class for animating a sequence of GIFs - -class Animation { - PImage[] images; - int imageCount; - int frame; - - Animation(String imagePrefix, int count) { - imageCount = count; - images = new PImage[imageCount]; - - for (int i = 0; i < imageCount; i++) { - // Use nf() to number format 'i' into four digits - String filename = imagePrefix + nf(i, 4) + ".gif"; - images[i] = loadImage(filename); - } - } - - void display(float xpos, float ypos) { - frame = (frame+1) % imageCount; - image(images[frame], xpos, ypos); - } - - int getWidth() { - return images[0].width; - } -} diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0000.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0000.gif deleted file mode 100644 index 1a9893ad2..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0000.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0001.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0001.gif deleted file mode 100644 index 1a9893ad2..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0001.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0002.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0002.gif deleted file mode 100644 index c53edb943..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0002.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0003.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0003.gif deleted file mode 100644 index b9c4fc675..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0003.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0004.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0004.gif deleted file mode 100644 index b43d0b308..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0004.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0005.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0005.gif deleted file mode 100644 index 36f373249..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0005.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0006.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0006.gif deleted file mode 100644 index b4c6ab5e6..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0006.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0007.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0007.gif deleted file mode 100644 index a53c6abc7..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0007.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0008.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0008.gif deleted file mode 100644 index 1ce59b9a6..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0008.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0009.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0009.gif deleted file mode 100644 index 557bedf8e..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0009.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0010.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0010.gif deleted file mode 100644 index 31fd776e4..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0010.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0011.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0011.gif deleted file mode 100644 index a69083697..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0011.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0012.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0012.gif deleted file mode 100644 index fe81e42ac..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0012.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0013.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0013.gif deleted file mode 100644 index c8ede5df6..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0013.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0014.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0014.gif deleted file mode 100644 index 1f1413761..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0014.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0015.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0015.gif deleted file mode 100644 index de472dfe7..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0015.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0016.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0016.gif deleted file mode 100644 index 5bc583f0a..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0016.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0017.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0017.gif deleted file mode 100644 index 8ff438690..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0017.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0018.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0018.gif deleted file mode 100644 index 0b99e3727..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0018.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0019.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0019.gif deleted file mode 100644 index 7a9217ad3..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0019.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0020.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0020.gif deleted file mode 100644 index fe8fdae31..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0020.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0021.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0021.gif deleted file mode 100644 index ab36afe0d..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0021.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0022.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0022.gif deleted file mode 100644 index 98dc00b57..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0022.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0023.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0023.gif deleted file mode 100644 index a3dd7f38c..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0023.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0024.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0024.gif deleted file mode 100644 index f8287855a..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0024.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0025.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0025.gif deleted file mode 100644 index 0107f470c..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0025.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0026.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0026.gif deleted file mode 100644 index e05a13944..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0026.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0027.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0027.gif deleted file mode 100644 index decdebe59..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0027.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0028.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0028.gif deleted file mode 100644 index ec2bae766..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0028.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0029.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0029.gif deleted file mode 100644 index 67d14b168..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0029.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0030.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0030.gif deleted file mode 100644 index 619c30c94..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0030.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0031.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0031.gif deleted file mode 100644 index aae6bfbf3..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0031.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0032.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0032.gif deleted file mode 100644 index 7cdd3561b..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0032.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0033.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0033.gif deleted file mode 100644 index 97fc08480..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0033.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0034.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0034.gif deleted file mode 100644 index 85e71dd53..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0034.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0035.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0035.gif deleted file mode 100644 index 752393673..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0035.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0036.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0036.gif deleted file mode 100644 index 92bf1c3da..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0036.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0037.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0037.gif deleted file mode 100644 index 397590e38..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0037.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0000.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0000.gif deleted file mode 100644 index 2f824d4ae..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0000.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0001.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0001.gif deleted file mode 100644 index 08badda94..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0001.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0002.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0002.gif deleted file mode 100644 index 06624ab2c..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0002.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0003.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0003.gif deleted file mode 100644 index ea92ccc97..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0003.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0004.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0004.gif deleted file mode 100644 index 4bd11209c..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0004.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0005.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0005.gif deleted file mode 100644 index 35dd95adf..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0005.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0006.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0006.gif deleted file mode 100644 index e03110292..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0006.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0007.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0007.gif deleted file mode 100644 index c64d4f836..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0007.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0008.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0008.gif deleted file mode 100644 index 3ceb22ee7..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0008.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0009.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0009.gif deleted file mode 100644 index e641c42d8..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0009.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0010.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0010.gif deleted file mode 100644 index fcf8234bd..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0010.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0011.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0011.gif deleted file mode 100644 index 0a66343cc..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0011.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0012.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0012.gif deleted file mode 100644 index d99ab85ab..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0012.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0013.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0013.gif deleted file mode 100644 index bf83cace6..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0013.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0014.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0014.gif deleted file mode 100644 index 5cf39974a..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0014.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0015.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0015.gif deleted file mode 100644 index 2389da333..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0015.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0016.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0016.gif deleted file mode 100644 index 837b6e533..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0016.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0017.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0017.gif deleted file mode 100644 index be36c20b1..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0017.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0018.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0018.gif deleted file mode 100644 index e2da21d31..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0018.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0019.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0019.gif deleted file mode 100644 index c7125f6f2..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0019.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0020.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0020.gif deleted file mode 100644 index 21084a485..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0020.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0021.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0021.gif deleted file mode 100644 index 5a7d2b462..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0021.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0022.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0022.gif deleted file mode 100644 index aa4d8b34a..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0022.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0023.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0023.gif deleted file mode 100644 index 81952946e..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0023.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0024.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0024.gif deleted file mode 100644 index f0cfcd142..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0024.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0025.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0025.gif deleted file mode 100644 index d3e55f403..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0025.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0026.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0026.gif deleted file mode 100644 index 19aa7b6c3..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0026.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0027.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0027.gif deleted file mode 100644 index 0291b3f57..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0027.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0028.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0028.gif deleted file mode 100644 index 84d403c32..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0028.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0029.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0029.gif deleted file mode 100644 index a15ef905f..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0029.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0030.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0030.gif deleted file mode 100644 index 945a0053d..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0030.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0031.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0031.gif deleted file mode 100644 index f922e5651..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0031.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0032.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0032.gif deleted file mode 100644 index 0aff66645..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0032.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0033.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0033.gif deleted file mode 100644 index 7fedb4832..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0033.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0034.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0034.gif deleted file mode 100644 index 19a4d20ff..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0034.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0035.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0035.gif deleted file mode 100644 index 3dd6abcb7..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0035.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0036.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0036.gif deleted file mode 100644 index 93277ef54..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0036.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0037.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0037.gif deleted file mode 100644 index c9c0a0903..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0037.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0038.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0038.gif deleted file mode 100644 index f0a00a1be..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0038.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0039.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0039.gif deleted file mode 100644 index 4a8b14e27..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0039.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0040.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0040.gif deleted file mode 100644 index 88e8eb147..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0040.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0041.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0041.gif deleted file mode 100644 index 0353138a5..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0041.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0042.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0042.gif deleted file mode 100644 index 4ef947509..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0042.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0043.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0043.gif deleted file mode 100644 index aebe10476..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0043.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0044.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0044.gif deleted file mode 100644 index 96464a3cb..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0044.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0045.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0045.gif deleted file mode 100644 index 35e40b8c4..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0045.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0046.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0046.gif deleted file mode 100644 index 8476318e9..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0046.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0047.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0047.gif deleted file mode 100644 index 512c6eebc..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0047.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0048.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0048.gif deleted file mode 100644 index 9fdecf6f1..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0048.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0049.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0049.gif deleted file mode 100644 index 5988e0ff9..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0049.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0050.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0050.gif deleted file mode 100644 index 2dde61ea0..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0050.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0051.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0051.gif deleted file mode 100644 index 24ef0346d..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0051.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0052.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0052.gif deleted file mode 100644 index 132a9ad32..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0052.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0053.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0053.gif deleted file mode 100644 index d5ffebc03..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0053.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0054.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0054.gif deleted file mode 100644 index e09375aa0..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0054.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0055.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0055.gif deleted file mode 100644 index e09375aa0..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0055.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0056.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0056.gif deleted file mode 100644 index 80ee11d98..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0056.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0057.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0057.gif deleted file mode 100644 index 9af1fbacc..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0057.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0058.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0058.gif deleted file mode 100644 index 7265b9fee..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0058.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0059.gif b/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0059.gif deleted file mode 100644 index c4f730ef2..000000000 Binary files a/java/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0059.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/Sequential/Sequential.pde b/java/examples/Topics/Animation/Sequential/Sequential.pde deleted file mode 100644 index 89a1f3b91..000000000 --- a/java/examples/Topics/Animation/Sequential/Sequential.pde +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Sequential - * by James Paterson. - * - * Displaying a sequence of images creates the illusion of motion. - * Twelve images are loaded and each is displayed individually in a loop. - */ - -// @pjs preload must be used to preload media if the program is -// running with Processing.js -/* @pjs preload="PT_anim0000.gif, PT_anim0001.gif, PT_anim0002.gif, PT_anim0003.gif, -PT_anim0004.gif, PT_anim0005.gif, PT_anim0006.gif, PT_anim0007.gif, PT_anim0008.gif, -PT_anim0009.gif, PT_anim0010.gif, PT_anim0011.gif"; */ - -int numFrames = 12; // The number of frames in the animation -int currentFrame = 0; -PImage[] images = new PImage[numFrames]; - -void setup() { - size(640, 360); - frameRate(24); - - images[0] = loadImage("PT_anim0000.gif"); - images[1] = loadImage("PT_anim0001.gif"); - images[2] = loadImage("PT_anim0002.gif"); - images[3] = loadImage("PT_anim0003.gif"); - images[4] = loadImage("PT_anim0004.gif"); - images[5] = loadImage("PT_anim0005.gif"); - images[6] = loadImage("PT_anim0006.gif"); - images[7] = loadImage("PT_anim0007.gif"); - images[8] = loadImage("PT_anim0008.gif"); - images[9] = loadImage("PT_anim0009.gif"); - images[10] = loadImage("PT_anim0010.gif"); - images[11] = loadImage("PT_anim0011.gif"); - - // If you don't want to load each image separately - // and you know how many frames you have, you - // can create the filenames as the program runs. - // The nf() command does number formatting, which will - // ensure that the number is (in this case) 4 digits. - //for (int i = 0; i < numFrames; i++) { - // String imageName = "PT_anim" + nf(i, 4) + ".gif"; - // images[i] = loadImage(imageName); - //} -} - -void draw() { - background(0); - currentFrame = (currentFrame+1) % numFrames; // Use % to cycle through frames - int offset = 0; - for (int x = -100; x < width; x += images[0].width) { - image(images[(currentFrame+offset) % numFrames], x, -20); - offset+=2; - image(images[(currentFrame+offset) % numFrames], x, height/2); - offset+=2; - } -} diff --git a/java/examples/Topics/Animation/Sequential/data/PT_anim0000.gif b/java/examples/Topics/Animation/Sequential/data/PT_anim0000.gif deleted file mode 100644 index b0e3f04ac..000000000 Binary files a/java/examples/Topics/Animation/Sequential/data/PT_anim0000.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/Sequential/data/PT_anim0001.gif b/java/examples/Topics/Animation/Sequential/data/PT_anim0001.gif deleted file mode 100644 index 4f7cb9024..000000000 Binary files a/java/examples/Topics/Animation/Sequential/data/PT_anim0001.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/Sequential/data/PT_anim0002.gif b/java/examples/Topics/Animation/Sequential/data/PT_anim0002.gif deleted file mode 100644 index 4d37297fa..000000000 Binary files a/java/examples/Topics/Animation/Sequential/data/PT_anim0002.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/Sequential/data/PT_anim0003.gif b/java/examples/Topics/Animation/Sequential/data/PT_anim0003.gif deleted file mode 100644 index d3ab40361..000000000 Binary files a/java/examples/Topics/Animation/Sequential/data/PT_anim0003.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/Sequential/data/PT_anim0004.gif b/java/examples/Topics/Animation/Sequential/data/PT_anim0004.gif deleted file mode 100644 index 44cd62bdb..000000000 Binary files a/java/examples/Topics/Animation/Sequential/data/PT_anim0004.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/Sequential/data/PT_anim0005.gif b/java/examples/Topics/Animation/Sequential/data/PT_anim0005.gif deleted file mode 100644 index 185298a94..000000000 Binary files a/java/examples/Topics/Animation/Sequential/data/PT_anim0005.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/Sequential/data/PT_anim0006.gif b/java/examples/Topics/Animation/Sequential/data/PT_anim0006.gif deleted file mode 100644 index 30de51162..000000000 Binary files a/java/examples/Topics/Animation/Sequential/data/PT_anim0006.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/Sequential/data/PT_anim0007.gif b/java/examples/Topics/Animation/Sequential/data/PT_anim0007.gif deleted file mode 100644 index cc9f8f883..000000000 Binary files a/java/examples/Topics/Animation/Sequential/data/PT_anim0007.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/Sequential/data/PT_anim0008.gif b/java/examples/Topics/Animation/Sequential/data/PT_anim0008.gif deleted file mode 100644 index 76475facd..000000000 Binary files a/java/examples/Topics/Animation/Sequential/data/PT_anim0008.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/Sequential/data/PT_anim0009.gif b/java/examples/Topics/Animation/Sequential/data/PT_anim0009.gif deleted file mode 100644 index 3b224625a..000000000 Binary files a/java/examples/Topics/Animation/Sequential/data/PT_anim0009.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/Sequential/data/PT_anim0010.gif b/java/examples/Topics/Animation/Sequential/data/PT_anim0010.gif deleted file mode 100644 index 9c008f38b..000000000 Binary files a/java/examples/Topics/Animation/Sequential/data/PT_anim0010.gif and /dev/null differ diff --git a/java/examples/Topics/Animation/Sequential/data/PT_anim0011.gif b/java/examples/Topics/Animation/Sequential/data/PT_anim0011.gif deleted file mode 100644 index db227e220..000000000 Binary files a/java/examples/Topics/Animation/Sequential/data/PT_anim0011.gif and /dev/null differ diff --git a/java/examples/Topics/Cellular Automata/GameOfLife/GameOfLife.pde b/java/examples/Topics/Cellular Automata/GameOfLife/GameOfLife.pde deleted file mode 100644 index 68646edfd..000000000 --- a/java/examples/Topics/Cellular Automata/GameOfLife/GameOfLife.pde +++ /dev/null @@ -1,182 +0,0 @@ -/** - * A Processing implementation of Game of Life - * By Joan Soler-Adillon - * - * Press SPACE BAR to pause and change the cell's values with the mouse - * On pause, click to activate/deactivate cells - * Press R to randomly reset the cells' grid - * Press C to clear the cells' grid - * - * The original Game of Life was created by John Conway in 1970. - */ - -// Size of cells -int cellSize = 5; - -// How likely for a cell to be alive at start (in percentage) -float probabilityOfAliveAtStart = 15; - -// Variables for timer -int interval = 100; -int lastRecordedTime = 0; - -// Colors for active/inactive cells -color alive = color(0, 200, 0); -color dead = color(0); - -// Array of cells -int[][] cells; -// Buffer to record the state of the cells and use this while changing the others in the interations -int[][] cellsBuffer; - -// Pause -boolean pause = false; - -void setup() { - size (640, 360); - - // Instantiate arrays - cells = new int[width/cellSize][height/cellSize]; - cellsBuffer = new int[width/cellSize][height/cellSize]; - - // This stroke will draw the background grid - stroke(48); - - noSmooth(); - - // Initialization of cells - for (int x=0; x probabilityOfAliveAtStart) { - state = 0; - } - else { - state = 1; - } - cells[x][y] = int(state); // Save state of each cell - } - } - background(0); // Fill in black in case cells don't cover all the windows -} - - -void draw() { - - //Draw grid - for (int x=0; xinterval) { - if (!pause) { - iteration(); - lastRecordedTime = millis(); - } - } - - // Create new cells manually on pause - if (pause && mousePressed) { - // Map and avoid out of bound errors - int xCellOver = int(map(mouseX, 0, width, 0, width/cellSize)); - xCellOver = constrain(xCellOver, 0, width/cellSize-1); - int yCellOver = int(map(mouseY, 0, height, 0, height/cellSize)); - yCellOver = constrain(yCellOver, 0, height/cellSize-1); - - // Check against cells in buffer - if (cellsBuffer[xCellOver][yCellOver]==1) { // Cell is alive - cells[xCellOver][yCellOver]=0; // Kill - fill(dead); // Fill with kill color - } - else { // Cell is dead - cells[xCellOver][yCellOver]=1; // Make alive - fill(alive); // Fill alive color - } - } - else if (pause && !mousePressed) { // And then save to buffer once mouse goes up - // Save cells to buffer (so we opeate with one array keeping the other intact) - for (int x=0; x=0)&&(xx=0)&&(yy 3) { - cells[x][y] = 0; // Die unless it has 2 or 3 neighbours - } - } - else { // The cell is dead: make it live if necessary - if (neighbours == 3 ) { - cells[x][y] = 1; // Only if it has 3 neighbours - } - } // End of if - } // End of y loop - } // End of x loop -} // End of function - -void keyPressed() { - if (key=='r' || key == 'R') { - // Restart: reinitialization of cells - for (int x=0; x probabilityOfAliveAtStart) { - state = 0; - } - else { - state = 1; - } - cells[x][y] = int(state); // Save state of each cell - } - } - } - if (key==' ') { // On/off of pause - pause = !pause; - } - if (key=='c' || key == 'C') { // Clear all - for (int x=0; x width - 1) { - x-=width; - } - while(y < 0) { - y+=height; - } - while(y > height - 1) { - y-=height; - } - - // Cell instructions - if (w.getpix(x + 1, y) == black) { - move(0, 1); - } else if (w.getpix(x, y - 1) != black && w.getpix(x, y + 1) != black) { - move((int)random(9) - 4, (int)random(9) - 4); - } - } - - // Will move the cell (dx, dy) units if that space is empty - void move(int dx, int dy) { - if (w.getpix(x + dx, y + dy) == black) { - w.setpix(x + dx, y + dy, w.getpix(x, y)); - w.setpix(x, y, color(0)); - x += dx; - y += dy; - } - } -} - -// The World class simply provides two functions, get and set, which access the -// display in the same way as getPixel and setPixel. The only difference is that -// the World class's get and set do screen wraparound ("toroidal coordinates"). -class World { - - void setpix(int x, int y, int c) { - while(x < 0) x+=width; - while(x > width - 1) x-=width; - while(y < 0) y+=height; - while(y > height - 1) y-=height; - set(x, y, c); - } - - color getpix(int x, int y) { - while(x < 0) x+=width; - while(x > width - 1) x-=width; - while(y < 0) y+=height; - while(y > height - 1) y-=height; - return get(x, y); - } -} - -void mousePressed() { - numcells = 0; - reset(); -} - diff --git a/java/examples/Topics/Cellular Automata/Spore2/Spore2.pde b/java/examples/Topics/Cellular Automata/Spore2/Spore2.pde deleted file mode 100644 index 3ed57d1a5..000000000 --- a/java/examples/Topics/Cellular Automata/Spore2/Spore2.pde +++ /dev/null @@ -1,169 +0,0 @@ -/** - * Spore 2 - * by Mike Davis. - * - * A short program for alife experiments. Click in the window to restart. - * Each cell is represented by a pixel on the display as well as an entry in - * the array 'cells'. Each cell has a run() method, which performs actions - * based on the cell's surroundings. Cells run one at a time (to avoid conflicts - * like wanting to move to the same space) and in random order. - */ - -World w; -int maxcells = 8000; -int numcells; -Cell[] cells = new Cell[maxcells]; -color spore1, spore2, spore3, spore4; -color black = color(0, 0, 0); -// set lower for smoother animation, higher for faster simulation -int runs_per_loop = 10000; - -void setup() -{ - size(640, 360); - frameRate(24); - reset(); -} - -void reset() { - clearScreen(); - w = new World(); - spore1 = color(128, 172, 255); - spore2 = color(64, 128, 255); - spore3 = color(255, 128, 172); - spore4 = color(255, 64, 128); - numcells = 0; - seed(); -} - -void seed() -{ - // Add cells at random places - for (int i = 0; i < maxcells; i++) - { - int cX = int(random(width)); - int cY = int(random(height)); - int c; - float r = random(1); - if (r < 0.25) c = spore1; - else if (r < 0.5) c = spore2; - else if (r < 0.75) c = spore3; - else c = spore4; - if (w.getpix(cX, cY) == black) - { - w.setpix(cX, cY, c); - cells[numcells] = new Cell(cX, cY); - numcells++; - } - } -} - -void draw() { - // Run cells in random order - for (int i = 0; i < runs_per_loop; i++) { - int selected = min((int)random(numcells), numcells - 1); - cells[selected].run(); - } -} - -void clearScreen() { - background(0); -} - -class Cell { - int x, y; - Cell(int xin, int yin) { - x = xin; - y = yin; - } - - // Perform action based on surroundings - void run() { - // Fix cell coordinates - while(x < 0) { - x+=width; - } - while(x > width - 1) { - x-=width; - } - while(y < 0) { - y+=height; - } - while(y > height - 1) { - y-=height; - } - - // Cell instructions - int myColor = w.getpix(x, y); - if (myColor == spore1) { - if (w.getpix(x - 1, y + 1) == black && w.getpix(x + 1, y + 1) == black && w.getpix(x, y + 1) == black) move(0, 1); - else if (w.getpix(x - 1, y) == spore2 && w.getpix(x - 1, y - 1) != black) move(0, -1); - else if (w.getpix(x - 1, y) == spore2 && w.getpix(x - 1, y - 1) == black) move(-1, -1); - else if (w.getpix(x + 1, y) == spore1 && w.getpix(x + 1, y - 1) != black) move(0, -1); - else if (w.getpix(x + 1, y) == spore1 && w.getpix(x + 1, y - 1) == black) move(1, -1); - else move((int)random(3) - 1, 0); - } else if (myColor == spore2) { - if (w.getpix(x - 1, y + 1) == black && w.getpix(x + 1, y + 1) == black && w.getpix(x, y + 1) == black) move(0, 1); - else if (w.getpix(x + 1, y) == spore1 && w.getpix(x + 1, y - 1) != black) move(0, -1); - else if (w.getpix(x + 1, y) == spore1 && w.getpix(x + 1, y - 1) == black) move(1, -1); - else if (w.getpix(x - 1, y) == spore2 && w.getpix(x - 1, y - 1) != black) move(0, -1); - else if (w.getpix(x - 1, y) == spore2 && w.getpix(x - 1, y - 1) == black) move(-1, -1); - else move((int)random(3) - 1, 0); - } - else if (myColor == spore3) - { - if (w.getpix(x - 1, y - 1) == black && w.getpix(x + 1, y - 1) == black && w.getpix(x, y - 1) == black) move(0, -1); - else if (w.getpix(x - 1, y) == spore4 && w.getpix(x - 1, y + 1) != black) move(0, 1); - else if (w.getpix(x - 1, y) == spore4 && w.getpix(x - 1, y + 1) == black) move(-1, 1); - else if (w.getpix(x + 1, y) == spore3 && w.getpix(x + 1, y + 1) != black) move(0, 1); - else if (w.getpix(x + 1, y) == spore3 && w.getpix(x + 1, y + 1) == black) move(1, 1); - else move((int)random(3) - 1, 0); - } - else if (myColor == spore4) - { - if (w.getpix(x - 1, y - 1) == black && w.getpix(x + 1, y - 1) == black && w.getpix(x, y - 1) == black) move(0, -1); - else if (w.getpix(x + 1, y) == spore3 && w.getpix(x + 1, y + 1) != black) move(0, 1); - else if (w.getpix(x + 1, y) == spore3 && w.getpix(x + 1, y + 1) == black) move(1, 1); - else if (w.getpix(x - 1, y) == spore4 && w.getpix(x - 1, y + 1) != black) move(0, 1); - else if (w.getpix(x - 1, y) == spore4 && w.getpix(x - 1, y + 1) == black) move(-1, 1); - else move((int)random(3) - 1, 0); - } - } - - // Will move the cell (dx, dy) units if that space is empty - void move(int dx, int dy) { - if (w.getpix(x + dx, y + dy) == black) { - w.setpix(x + dx, y + dy, w.getpix(x, y)); - w.setpix(x, y, color(0)); - x += dx; - y += dy; - } - } -} - -// The World class simply provides two functions, get and set, which access the -// display in the same way as getPixel and setPixel. The only difference is that -// the World class's get and set do screen wraparound ("toroidal coordinates"). -class World { - - void setpix(int x, int y, int c) { - while(x < 0) x+=width; - while(x > width - 1) x-=width; - while(y < 0) y+=height; - while(y > height - 1) y-=height; - set(x, y, c); - } - - color getpix(int x, int y) { - while(x < 0) x+=width; - while(x > width - 1) x-=width; - while(y < 0) y+=height; - while(y > height - 1) y-=height; - return get(x, y); - } -} - -void mousePressed() { - reset(); -} - diff --git a/java/examples/Topics/Cellular Automata/Wolfram/CA.pde b/java/examples/Topics/Cellular Automata/Wolfram/CA.pde deleted file mode 100644 index 4beca4edc..000000000 --- a/java/examples/Topics/Cellular Automata/Wolfram/CA.pde +++ /dev/null @@ -1,92 +0,0 @@ -class CA { - - int[] cells; // An array of 0s and 1s - int generation; // How many generations? - int scl; // How many pixels wide/high is each cell? - - int[] rules; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1} - - CA(int[] r) { - rules = r; - scl = 1; - cells = new int[width/scl]; - restart(); - } - - // Set the rules of the CA - void setRules(int[] r) { - rules = r; - } - - // Make a random ruleset - void randomize() { - for (int i = 0; i < 8; i++) { - rules[i] = int(random(2)); - } - } - - // Reset to generation 0 - void restart() { - for (int i = 0; i < cells.length; i++) { - cells[i] = 0; - } - cells[cells.length/2] = 1; // We arbitrarily start with just the middle cell having a state of "1" - generation = 0; - } - - // The process of creating the new generation - void generate() { - // First we create an empty array for the new values - int[] nextgen = new int[cells.length]; - // For every spot, determine new state by examing current state, and neighbor states - // Ignore edges that only have one neighor - for (int i = 1; i < cells.length-1; i++) { - int left = cells[i-1]; // Left neighbor state - int me = cells[i]; // Current state - int right = cells[i+1]; // Right neighbor state - nextgen[i] = executeRules(left,me,right); // Compute next generation state based on ruleset - } - // Copy the array into current value - for (int i = 1; i < cells.length-1; i++) { - cells[i] = nextgen[i]; - } - //cells = (int[]) nextgen.clone(); - generation++; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void render() { - for (int i = 0; i < cells.length; i++) { - if (cells[i] == 1) { - fill(255); - } else { - fill(0); - } - noStroke(); - rect(i*scl,generation*scl, scl,scl); - } - } - - // Implementing the Wolfram rules - // Could be improved and made more concise, but here we can explicitly see what is going on for each case - int executeRules (int a, int b, int c) { - if (a == 1 && b == 1 && c == 1) { return rules[0]; } - if (a == 1 && b == 1 && c == 0) { return rules[1]; } - if (a == 1 && b == 0 && c == 1) { return rules[2]; } - if (a == 1 && b == 0 && c == 0) { return rules[3]; } - if (a == 0 && b == 1 && c == 1) { return rules[4]; } - if (a == 0 && b == 1 && c == 0) { return rules[5]; } - if (a == 0 && b == 0 && c == 1) { return rules[6]; } - if (a == 0 && b == 0 && c == 0) { return rules[7]; } - return 0; - } - - // The CA is done if it reaches the bottom of the screen - boolean finished() { - if (generation > height/scl) { - return true; - } else { - return false; - } - } -} diff --git a/java/examples/Topics/Cellular Automata/Wolfram/Wolfram.pde b/java/examples/Topics/Cellular Automata/Wolfram/Wolfram.pde deleted file mode 100644 index 936bcc3e9..000000000 --- a/java/examples/Topics/Cellular Automata/Wolfram/Wolfram.pde +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Wolfram Cellular Automata - * by Daniel Shiffman. - * - * Simple demonstration of a Wolfram 1-dimensional cellular automata - * When the system reaches bottom of the window, it restarts with a new ruleset - * Mouse click restarts as well. - */ - -CA ca; // An instance object to describe the Wolfram basic Cellular Automata - -void setup() { - size(640, 360); - int[] ruleset = {0,1,0,1,1,0,1,0}; // An initial rule system - ca = new CA(ruleset); // Initialize CA - background(0); -} - -void draw() { - ca.render(); // Draw the CA - ca.generate(); // Generate the next level - - if (ca.finished()) { // If we're done, clear the screen, pick a new ruleset and restart - background(0); - ca.randomize(); - ca.restart(); - } -} - -void mousePressed() { - background(0); - ca.randomize(); - ca.restart(); -} - - - diff --git a/java/examples/Topics/Create Shapes/BeginEndContour/BeginEndContour.pde b/java/examples/Topics/Create Shapes/BeginEndContour/BeginEndContour.pde deleted file mode 100644 index 03b847c4d..000000000 --- a/java/examples/Topics/Create Shapes/BeginEndContour/BeginEndContour.pde +++ /dev/null @@ -1,44 +0,0 @@ -/** - * BeginEndContour - * - * How to cut a shape out of another using beginContour() and endContour() - */ - -PShape s; - -void setup() { - size(640, 360, P2D); - smooth(); - // Make a shape - s = createShape(); - s.beginShape(); - s.fill(0); - s.stroke(255); - s.strokeWeight(2); - // Exterior part of shape - s.vertex(-100,-100); - s.vertex(100,-100); - s.vertex(100,100); - s.vertex(-100,100); - - // Interior part of shape - s.beginContour(); - s.vertex(-10,-10); - s.vertex(10,-10); - s.vertex(10,10); - s.vertex(-10,10); - s.endContour(); - - // Finishing off shape - s.endShape(CLOSE); -} - -void draw() { - background(52); - // Display shape - translate(width/2, height/2); - // Shapes can be rotated - s.rotate(0.01); - shape(s); -} - diff --git a/java/examples/Topics/Create Shapes/GroupPShape/GroupPShape.pde b/java/examples/Topics/Create Shapes/GroupPShape/GroupPShape.pde deleted file mode 100644 index a8cbd0ab9..000000000 --- a/java/examples/Topics/Create Shapes/GroupPShape/GroupPShape.pde +++ /dev/null @@ -1,67 +0,0 @@ -/** - * GroupPShape - * - * How to group multiple PShapes into one PShape - */ - - -// A PShape that will group PShapes -PShape group; - -void setup() { - size(640, 360, P2D); - smooth(); - // Create the shape as a group - group = createShape(GROUP); - - // Make a polygon PShape - PShape star = createShape(); - star.beginShape(); - star.noFill(); - star.stroke(255); - star.vertex(0, -50); - star.vertex(14, -20); - star.vertex(47, -15); - star.vertex(23, 7); - star.vertex(29, 40); - star.vertex(0, 25); - star.vertex(-29, 40); - star.vertex(-23, 7); - star.vertex(-47, -15); - star.vertex(-14, -20); - star.endShape(CLOSE); - - // Make a path PShape - PShape path = createShape(); - path.beginShape(); - path.noFill(); - path.stroke(255); - for (float a = -PI; a < 0; a += 0.1) { - float r = random(60, 70); - path.vertex(r*cos(a), r*sin(a)); - } - path.endShape(); - - // Make a primitive (Rectangle) PShape - PShape rectangle = createShape(RECT,-10,-10,20,20); - rectangle.setFill(false); - rectangle.setStroke(color(255)); - - // Add them all to the group - group.addChild(star); - group.addChild(path); - group.addChild(rectangle); -} - -void draw() { - // We can access them individually via the group PShape - PShape rectangle = group.getChild(2); - // Shapes can be rotated - rectangle.rotate(0.1); - - background(52); - // Display the group PShape - translate(mouseX, mouseY); - shape(group); -} - diff --git a/java/examples/Topics/Create Shapes/ParticleSystemPShape/Particle.pde b/java/examples/Topics/Create Shapes/ParticleSystemPShape/Particle.pde deleted file mode 100644 index ccccb6509..000000000 --- a/java/examples/Topics/Create Shapes/ParticleSystemPShape/Particle.pde +++ /dev/null @@ -1,82 +0,0 @@ -// An individual Particle - -class Particle { - - // Velocity - PVector center; - PVector velocity; - // Lifespane is tied to alpha - float lifespan; - - // The particle PShape - PShape part; - // The particle size - float partSize; - - // A single force - PVector gravity = new PVector(0, 0.1); - - Particle() { - partSize = random(10, 60); - // The particle is a textured quad - part = createShape(); - part.beginShape(QUAD); - part.noStroke(); - part.texture(sprite); - part.normal(0, 0, 1); - part.vertex(-partSize/2, -partSize/2, 0, 0); - part.vertex(+partSize/2, -partSize/2, sprite.width, 0); - part.vertex(+partSize/2, +partSize/2, sprite.width, sprite.height); - part.vertex(-partSize/2, +partSize/2, 0, sprite.height); - part.endShape(); - - // Initialize center vector - center = new PVector(); - - // Set the particle starting location - rebirth(width/2, height/2); - } - - PShape getShape() { - return part; - } - - void rebirth(float x, float y) { - float a = random(TWO_PI); - float speed = random(0.5, 4); - // A velocity with random angle and magnitude - velocity = PVector.fromAngle(a); - velocity.mult(speed); - // Set lifespan - lifespan = 255; - // Set location using translate - part.resetMatrix(); - part.translate(x, y); - - // Update center vector - center.set(x, y, 0); - } - - // Is it off the screen, or its lifespan is over? - boolean isDead() { - if (center.x > width || center.x < 0 || - center.y > height || center.y < 0 || lifespan < 0) { - return true; - } - else { - return false; - } - } - - void update() { - // Decrease life - lifespan = lifespan - 1; - // Apply gravity - velocity.add(gravity); - part.setTint(color(255, lifespan)); - // Move the particle according to its velocity - part.translate(velocity.x, velocity.y); - // and also update the center - center.add(velocity); - } -} diff --git a/java/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystem.pde b/java/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystem.pde deleted file mode 100644 index e2215046e..000000000 --- a/java/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystem.pde +++ /dev/null @@ -1,43 +0,0 @@ -// The Particle System - -class ParticleSystem { - // It's just an ArrayList of particle objects - ArrayList particles; - - // The PShape to group all the particle PShapes - PShape particleShape; - - ParticleSystem(int n) { - particles = new ArrayList(); - // The PShape is a group - particleShape = createShape(GROUP); - - // Make all the Particles - for (int i = 0; i < n; i++) { - Particle p = new Particle(); - particles.add(p); - // Each particle's PShape gets added to the System PShape - particleShape.addChild(p.getShape()); - } - } - - void update() { - for (Particle p : particles) { - p.update(); - } - } - - void setEmitter(float x, float y) { - for (Particle p : particles) { - // Each particle gets reborn at the emitter location - if (p.isDead()) { - p.rebirth(x, y); - } - } - } - - void display() { - shape(particleShape); - } -} - diff --git a/java/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystemPShape.pde b/java/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystemPShape.pde deleted file mode 100644 index 479e4e1d9..000000000 --- a/java/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystemPShape.pde +++ /dev/null @@ -1,41 +0,0 @@ -/** - * ParticleSystemPShape - * - * A particle system optimized for drawing using PShape - */ - -// Particle System object -ParticleSystem ps; -// A PImage for particle's texture -PImage sprite; - -void setup() { - size(640, 360, P2D); - // Load the image - sprite = loadImage("sprite.png"); - // A new particle system with 10,000 particles - ps = new ParticleSystem(10000); - - // Writing to the depth buffer is disabled to avoid rendering - // artifacts due to the fact that the particles are semi-transparent - // but not z-sorted. - hint(DISABLE_DEPTH_MASK); - -} - -void draw () { - background(0); - // Update and display system - ps.update(); - ps.display(); - - // Set the particle system's emitter location to the mouse - ps.setEmitter(mouseX,mouseY); - - // Display frame rate - fill(255); - textSize(16); - text("Frame rate: " + int(frameRate),10,20); - -} - diff --git a/java/examples/Topics/Create Shapes/PathPShape/PathPShape.pde b/java/examples/Topics/Create Shapes/PathPShape/PathPShape.pde deleted file mode 100644 index b40d41b43..000000000 --- a/java/examples/Topics/Create Shapes/PathPShape/PathPShape.pde +++ /dev/null @@ -1,38 +0,0 @@ -/** - * PathPShape - * - * A simple path using PShape - */ - -// A PShape object -PShape path; - -void setup() { - size(640, 360, P2D); - smooth(); - // Create the shape - path = createShape(); - path.beginShape(); - // Set fill and stroke - path.noFill(); - path.stroke(255); - path.strokeWeight(2); - - float x = 0; - // Calculate the path as a sine wave - for (float a = 0; a < TWO_PI; a+=0.1) { - path.vertex(x,sin(a)*100); - x+= 5; - } - // The path is complete - path.endShape(); - -} - -void draw() { - background(51); - // Draw the path at the mouse location - translate(mouseX, mouseY); - shape(path); -} - diff --git a/java/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pde b/java/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pde deleted file mode 100644 index 0cfaad37c..000000000 --- a/java/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pde +++ /dev/null @@ -1,42 +0,0 @@ - -/** - * PrimitivePShape. - * - * Using a PShape to display a custom polygon. - */ - -// The PShape object -PShape star; - -void setup() { - size(640, 360, P2D); - smooth(); - // First create the shape - star = createShape(); - star.beginShape(); - // You can set fill and stroke - star.fill(102); - star.stroke(255); - star.strokeWeight(2); - // Here, we are hardcoding a series of vertices - star.vertex(0, -50); - star.vertex(14, -20); - star.vertex(47, -15); - star.vertex(23, 7); - star.vertex(29, 40); - star.vertex(0, 25); - star.vertex(-29, 40); - star.vertex(-23, 7); - star.vertex(-47, -15); - star.vertex(-14, -20); - star.endShape(CLOSE); -} - -void draw() { - background(51); - // We can use translate to move the PShape - translate(mouseX, mouseY); - // Display the shape - shape(star); -} - diff --git a/java/examples/Topics/Create Shapes/PolygonPShapeOOP/PolygonPShapeOOP.pde b/java/examples/Topics/Create Shapes/PolygonPShapeOOP/PolygonPShapeOOP.pde deleted file mode 100644 index 83effe867..000000000 --- a/java/examples/Topics/Create Shapes/PolygonPShapeOOP/PolygonPShapeOOP.pde +++ /dev/null @@ -1,30 +0,0 @@ -/** - * PolygonPShapeOOP. - * - * Wrapping a PShape inside a custom class - */ - - -// A Star object -Star s1, s2; - -void setup() { - size(640, 360, P2D); - smooth(); - // Make a new Star - s1 = new Star(); - s2 = new Star(); - -} - -void draw() { - background(51); - - s1.display(); // Display the first star - s1.move(); // Move the first star - - s2.display(); // Display the second star - s2.move(); // Move the second star - -} - diff --git a/java/examples/Topics/Create Shapes/PolygonPShapeOOP/Star.pde b/java/examples/Topics/Create Shapes/PolygonPShapeOOP/Star.pde deleted file mode 100644 index d75d445eb..000000000 --- a/java/examples/Topics/Create Shapes/PolygonPShapeOOP/Star.pde +++ /dev/null @@ -1,52 +0,0 @@ -// A class to describe a Star shape - -class Star { - - // The PShape object - PShape s; - // The location where we will draw the shape - float x, y; - float speed; - - Star() { - x = random(100, width-100); - y = random(100, height-100); - speed = random(0.5, 3); - // First create the shape - s = createShape(); - s.beginShape(); - // You can set fill and stroke - s.fill(255, 204); - s.noStroke(); - // Here, we are hardcoding a series of vertices - s.vertex(0, -50); - s.vertex(14, -20); - s.vertex(47, -15); - s.vertex(23, 7); - s.vertex(29, 40); - s.vertex(0, 25); - s.vertex(-29, 40); - s.vertex(-23, 7); - s.vertex(-47, -15); - s.vertex(-14, -20); - // The shape is complete - s.endShape(CLOSE); - } - - void move() { - // Demonstrating some simple motion - x += speed; - if (x > width+100) { - x = -100; - } - } - - void display() { - // Locating and drawing the shape - pushMatrix(); - translate(x, y); - shape(s); - popMatrix(); - } -} - diff --git a/java/examples/Topics/Create Shapes/PolygonPShapeOOP2/Polygon.pde b/java/examples/Topics/Create Shapes/PolygonPShapeOOP2/Polygon.pde deleted file mode 100644 index f5bfac3ab..000000000 --- a/java/examples/Topics/Create Shapes/PolygonPShapeOOP2/Polygon.pde +++ /dev/null @@ -1,34 +0,0 @@ -// A class to describe a Polygon (with a PShape) - -class Polygon { - // The PShape object - PShape s; - // The location where we will draw the shape - float x, y; - // Variable for simple motion - float speed; - - Polygon(PShape s_) { - x = random(width); - y = random(-500, -100); - s = s_; - speed = random(2, 6); - } - - // Simple motion - void move() { - y += speed; - if (y > height+100) { - y = -100; - } - } - - // Draw the object - void display() { - pushMatrix(); - translate(x, y); - shape(s); - popMatrix(); - } -} - diff --git a/java/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pde b/java/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pde deleted file mode 100644 index ad6164c88..000000000 --- a/java/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pde +++ /dev/null @@ -1,53 +0,0 @@ -/** - * PolygonPShapeOOP. - * - * Wrapping a PShape inside a custom class - * and demonstrating how we can have a multiple objects each - * using the same PShape. - */ - - -// A list of objects -ArrayList polygons; - -void setup() { - size(640, 360, P2D); - smooth(); - // Make a PShape - PShape star = createShape(); - star.beginShape(); - star.noStroke(); - star.fill(0, 127); - star.vertex(0, -50); - star.vertex(14, -20); - star.vertex(47, -15); - star.vertex(23, 7); - star.vertex(29, 40); - star.vertex(0, 25); - star.vertex(-29, 40); - star.vertex(-23, 7); - star.vertex(-47, -15); - star.vertex(-14, -20); - star.endShape(CLOSE); - - // Make an ArrayList - polygons = new ArrayList(); - - // Add a bunch of objects to the ArrayList - // Pass in reference to the PShape - // We coud make polygons with different PShapes - for (int i = 0; i < 25; i++) { - polygons.add(new Polygon(star)); - } -} - -void draw() { - background(255); - - // Display and move them all - for (Polygon poly : polygons) { - poly.display(); - poly.move(); - } -} - diff --git a/java/examples/Topics/Create Shapes/PolygonPShapeOOP3/Polygon.pde b/java/examples/Topics/Create Shapes/PolygonPShapeOOP3/Polygon.pde deleted file mode 100644 index e775fb436..000000000 --- a/java/examples/Topics/Create Shapes/PolygonPShapeOOP3/Polygon.pde +++ /dev/null @@ -1,34 +0,0 @@ -// A class to describe a Polygon (with a PShape) - -class Polygon { - // The PShape object - PShape s; - // The location where we will draw the shape - float x, y; - // Variable for simple motion - float speed; - - Polygon(PShape s_) { - x = random(width); - y = random(-500, -100); - s = s_; - speed = random(2, 6); - } - - // Simple motion - void move() { - y+=speed; - if (y > height+100) { - y = -100; - } - } - - // Draw the object - void display() { - pushMatrix(); - translate(x, y); - shape(s); - popMatrix(); - } -} - diff --git a/java/examples/Topics/Create Shapes/PolygonPShapeOOP3/PolygonPShapeOOP3.pde b/java/examples/Topics/Create Shapes/PolygonPShapeOOP3/PolygonPShapeOOP3.pde deleted file mode 100644 index f662e7e99..000000000 --- a/java/examples/Topics/Create Shapes/PolygonPShapeOOP3/PolygonPShapeOOP3.pde +++ /dev/null @@ -1,61 +0,0 @@ -/** - * PolygonPShapeOOP. - * - * Wrapping a PShape inside a custom class - * and demonstrating how we can have a multiple objects each - * using the same PShape. - */ - - -// A list of objects -ArrayList polygons; - -// Three possible shapes -PShape[] shapes = new PShape[3]; - -void setup() { - size(640, 360, P2D); - smooth(); - - shapes[0] = createShape(ELLIPSE,0,0,100,100); - shapes[0].setFill(color(255, 127)); - shapes[0].setStroke(false); - shapes[1] = createShape(RECT,0,0,100,100); - shapes[1].setFill(color(255, 127)); - shapes[1].setStroke(false); - shapes[2] = createShape(); - shapes[2].beginShape(); - shapes[2].fill(0, 127); - shapes[2].noStroke(); - shapes[2].vertex(0, -50); - shapes[2].vertex(14, -20); - shapes[2].vertex(47, -15); - shapes[2].vertex(23, 7); - shapes[2].vertex(29, 40); - shapes[2].vertex(0, 25); - shapes[2].vertex(-29, 40); - shapes[2].vertex(-23, 7); - shapes[2].vertex(-47, -15); - shapes[2].vertex(-14, -20); - shapes[2].endShape(CLOSE); - - // Make an ArrayList - polygons = new ArrayList(); - - for (int i = 0; i < 25; i++) { - int selection = int(random(shapes.length)); // Pick a random index - Polygon p = new Polygon(shapes[selection]); // Use corresponding PShape to create Polygon - polygons.add(p); - } -} - -void draw() { - background(102); - - // Display and move them all - for (Polygon poly : polygons) { - poly.display(); - poly.move(); - } -} - diff --git a/java/examples/Topics/Create Shapes/PrimitivePShape/PrimitivePShape.pde b/java/examples/Topics/Create Shapes/PrimitivePShape/PrimitivePShape.pde deleted file mode 100644 index 6e24680ec..000000000 --- a/java/examples/Topics/Create Shapes/PrimitivePShape/PrimitivePShape.pde +++ /dev/null @@ -1,28 +0,0 @@ -/** - * PrimitivePShape. - * - * Using a PShape to display a primitive shape (in this case, ellipse). - */ - - -// The PShape object -PShape circle; - -void setup() { - size(640, 360, P2D); - smooth(); - // Creating the PShape as an ellipse - circle = createShape(ELLIPSE, 0, 0, 100, 50); -} - -void draw() { - background(51); - // We can dynamically set the stroke and fill of the shape - circle.setStroke(color(255)); - circle.setStrokeWeight(4); - circle.setFill(color(map(mouseX, 0, width, 0, 255))); - // We can use translate to move the PShape - translate(mouseX, mouseY); - // Drawing the PShape - shape(circle); -} diff --git a/java/examples/Topics/Create Shapes/WigglePShape/WigglePShape.pde b/java/examples/Topics/Create Shapes/WigglePShape/WigglePShape.pde deleted file mode 100644 index 972c11bc5..000000000 --- a/java/examples/Topics/Create Shapes/WigglePShape/WigglePShape.pde +++ /dev/null @@ -1,23 +0,0 @@ -/** - * WigglePShape. - * - * How to move the individual vertices of a PShape - */ - - -// A "Wiggler" object -Wiggler w; - -void setup() { - size(640, 360, P2D); - smooth(); - w = new Wiggler(); -} - -void draw() { - background(255); - w.display(); - w.wiggle(); -} - - diff --git a/java/examples/Topics/Create Shapes/WigglePShape/Wiggler.pde b/java/examples/Topics/Create Shapes/WigglePShape/Wiggler.pde deleted file mode 100644 index be4d7981f..000000000 --- a/java/examples/Topics/Create Shapes/WigglePShape/Wiggler.pde +++ /dev/null @@ -1,67 +0,0 @@ -// An object that wraps the PShape - -class Wiggler { - - // The PShape to be "wiggled" - PShape s; - // Its location - float x, y; - - // For 2D Perlin noise - float yoff = 0; - - // We are using an ArrayList to keep a duplicate copy - // of vertices original locations. - ArrayList original; - - Wiggler() { - x = width/2; - y = height/2; - - // The "original" locations of the vertices make up a circle - original = new ArrayList(); - for (float a = 0; a < TWO_PI; a+=0.2) { - PVector v = PVector.fromAngle(a); - v.mult(100); - original.add(v); - } - - // Now make the PShape with those vertices - s = createShape(); - s.beginShape(); - s.fill(127); - s.stroke(0); - s.strokeWeight(2); - for (PVector v : original) { - s.vertex(v.x, v.y); - } - s.endShape(CLOSE); - } - - void wiggle() { - float xoff = 0; - // Apply an offset to each vertex - for (int i = 0; i < s.getVertexCount(); i++) { - // Calculate a new vertex location based on noise around "original" location - PVector pos = original.get(i); - float a = TWO_PI*noise(xoff,yoff); - PVector r = PVector.fromAngle(a); - r.mult(4); - r.add(pos); - // Set the location of each vertex to the new one - s.setVertex(i, r.x, r.y); - // increment perlin noise x value - xoff+= 0.5; - } - // Increment perlin noise y value - yoff += 0.02; - } - - void display() { - pushMatrix(); - translate(x, y); - shape(s); - popMatrix(); - } -} - diff --git a/java/examples/Topics/Drawing/ContinuousLines/ContinuousLines.pde b/java/examples/Topics/Drawing/ContinuousLines/ContinuousLines.pde deleted file mode 100644 index a9e36e080..000000000 --- a/java/examples/Topics/Drawing/ContinuousLines/ContinuousLines.pde +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Continuous Lines. - * - * Click and drag the mouse to draw a line. - */ - -void setup() { - size(640, 360); - background(102); -} - -void draw() { - stroke(255); - if (mousePressed == true) { - line(mouseX, mouseY, pmouseX, pmouseY); - } -} diff --git a/java/examples/Topics/Drawing/Pattern/Pattern.pde b/java/examples/Topics/Drawing/Pattern/Pattern.pde deleted file mode 100644 index 39c16cd1d..000000000 --- a/java/examples/Topics/Drawing/Pattern/Pattern.pde +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Patterns. - * - * Move the cursor over the image to draw with a software tool - * which responds to the speed of the mouse. - */ - -void setup() { - size(640, 360); - background(102); -} - -void draw() { - // Call the variableEllipse() method and send it the - // parameters for the current mouse position - // and the previous mouse position - variableEllipse(mouseX, mouseY, pmouseX, pmouseY); -} - - -// The simple method variableEllipse() was created specifically -// for this program. It calculates the speed of the mouse -// and draws a small ellipse if the mouse is moving slowly -// and draws a large ellipse if the mouse is moving quickly - -void variableEllipse(int x, int y, int px, int py) { - float speed = abs(x-px) + abs(y-py); - stroke(speed); - ellipse(x, y, speed, speed); -} diff --git a/java/examples/Topics/Drawing/Pulses/Pulses.pde b/java/examples/Topics/Drawing/Pulses/Pulses.pde deleted file mode 100644 index 0051ec79c..000000000 --- a/java/examples/Topics/Drawing/Pulses/Pulses.pde +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Pulses. - * - * Software drawing instruments can follow a rhythm or abide by rules independent - * of drawn gestures. This is a form of collaborative drawing in which the draftsperson - * controls some aspects of the image and the software controls others. - */ - -int angle = 0; - -void setup() { - size(640, 360); - background(102); - noStroke(); - fill(0, 102); -} - -void draw() { - // Draw only when mouse is pressed - if (mousePressed == true) { - angle += 5; - float val = cos(radians(angle)) * 12.0; - for (int a = 0; a < 360; a += 75) { - float xoff = cos(radians(a)) * val; - float yoff = sin(radians(a)) * val; - fill(0); - ellipse(mouseX + xoff, mouseY + yoff, val, val); - } - fill(255); - ellipse(mouseX, mouseY, 2, 2); - } -} diff --git a/java/examples/Topics/File IO/DirectoryList/DirectoryList.pde b/java/examples/Topics/File IO/DirectoryList/DirectoryList.pde deleted file mode 100644 index 2bf64b991..000000000 --- a/java/examples/Topics/File IO/DirectoryList/DirectoryList.pde +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Listing files in directories and subdirectories - * by Daniel Shiffman. - * - * This example has three functions:
- * 1) List the names of files in a directory
- * 2) List the names along with metadata (size, lastModified)
- * of files in a directory
- * 3) List the names along with metadata (size, lastModified)
- * of files in a directory and all subdirectories (using recursion) - */ - -import java.util.Date; - -void setup() { - - // Path - String path = sketchPath; - - println("Listing all filenames in a directory: "); - String[] filenames = listFileNames(path); - println(filenames); - - println("\nListing info about all files in a directory: "); - File[] files = listFiles(path); - for (int i = 0; i < files.length; i++) { - File f = files[i]; - println("Name: " + f.getName()); - println("Is directory: " + f.isDirectory()); - println("Size: " + f.length()); - String lastModified = new Date(f.lastModified()).toString(); - println("Last Modified: " + lastModified); - println("-----------------------"); - } - - println("\nListing info about all files in a directory and all subdirectories: "); - ArrayList allFiles = listFilesRecursive(path); - - for (File f: allFiles) { - println("Name: " + f.getName()); - println("Full path: " + f.getAbsolutePath()); - println("Is directory: " + f.isDirectory()); - println("Size: " + f.length()); - String lastModified = new Date(f.lastModified()).toString(); - println("Last Modified: " + lastModified); - println("-----------------------"); - } - - noLoop(); -} - -// Nothing is drawn in this program and the draw() doesn't loop because -// of the noLoop() in setup() -void draw() { - -} - -// This function returns all the files in a directory as an array of Strings -String[] listFileNames(String dir) { - File file = new File(dir); - if (file.isDirectory()) { - String names[] = file.list(); - return names; - } else { - // If it's not a directory - return null; - } -} - -// This function returns all the files in a directory as an array of File objects -// This is useful if you want more info about the file -File[] listFiles(String dir) { - File file = new File(dir); - if (file.isDirectory()) { - File[] files = file.listFiles(); - return files; - } else { - // If it's not a directory - return null; - } -} - -// Function to get a list of all files in a directory and all subdirectories -ArrayList listFilesRecursive(String dir) { - ArrayList fileList = new ArrayList(); - recurseDir(fileList,dir); - return fileList; -} - -// Recursive function to traverse subdirectories -void recurseDir(ArrayList a, String dir) { - File file = new File(dir); - if (file.isDirectory()) { - // If you want to include directories in the list - a.add(file); - File[] subfiles = file.listFiles(); - for (int i = 0; i < subfiles.length; i++) { - // Call this function on all files in this directory - recurseDir(a,subfiles[i].getAbsolutePath()); - } - } else { - a.add(file); - } -} diff --git a/java/examples/Topics/File IO/LoadFile1/LoadFile1.pde b/java/examples/Topics/File IO/LoadFile1/LoadFile1.pde deleted file mode 100644 index ac42a81c6..000000000 --- a/java/examples/Topics/File IO/LoadFile1/LoadFile1.pde +++ /dev/null @@ -1,30 +0,0 @@ -/** - * LoadFile 1 - * - * Loads a text file that contains two numbers separated by a tab ('\t'). - * A new pair of numbers is loaded each frame and used to draw a point on the screen. - */ - -String[] lines; -int index = 0; - -void setup() { - size(200, 200); - background(0); - stroke(255); - frameRate(12); - lines = loadStrings("positions.txt"); -} - -void draw() { - if (index < lines.length) { - String[] pieces = split(lines[index], '\t'); - if (pieces.length == 2) { - int x = int(pieces[0]) * 2; - int y = int(pieces[1]) * 2; - point(x, y); - } - // Go to the next line for the next run through draw() - index = index + 1; - } -} diff --git a/java/examples/Topics/File IO/LoadFile1/data/positions.txt b/java/examples/Topics/File IO/LoadFile1/data/positions.txt deleted file mode 100644 index 3b8ff2e23..000000000 --- a/java/examples/Topics/File IO/LoadFile1/data/positions.txt +++ /dev/null @@ -1,206 +0,0 @@ -70 35 -69 35 -68 39 -67 42 -66 47 -64 51 -64 54 -63 57 -60 60 -58 64 -51 69 -48 72 -44 73 -39 75 -35 75 -30 75 -25 75 -21 75 -17 73 -13 69 -12 66 -11 61 -11 57 -10 49 -10 45 -10 38 -12 32 -13 29 -16 23 -20 19 -24 16 -27 15 -31 13 -33 13 -37 13 -40 15 -42 16 -45 19 -46 21 -47 24 -48 26 -48 29 -48 33 -47 39 -43 45 -42 47 -38 50 -35 51 -32 51 -30 51 -27 50 -27 50 -26 46 -26 41 -29 36 -30 34 -31 33 -31 33 -32 33 -33 33 -34 33 -34 33 -35 33 -37 33 -39 33 -42 32 -44 31 -46 29 -48 29 -49 27 -52 24 -53 23 -57 19 -61 16 -63 14 -67 13 -69 12 -69 12 -77 11 -77 11 -80 11 -86 16 -90 21 -93 25 -95 29 -95 32 -95 33 -95 37 -94 41 -93 44 -92 46 -91 49 -89 51 -87 55 -85 59 -82 62 -80 64 -79 67 -77 69 -74 71 -68 72 -65 73 -63 73 -62 73 -60 72 -58 69 -57 67 -57 66 -56 60 -56 56 -56 54 -58 49 -60 47 -62 47 -63 47 -67 48 -70 52 -73 55 -74 57 -74 58 -74 60 -74 62 -73 65 -70 68 -67 69 -65 70 -63 70 -62 70 -60 68 -57 65 -55 64 -50 62 -46 61 -40 60 -38 60 -36 60 -32 61 -30 62 -27 64 -26 68 -25 71 -25 77 -25 81 -26 84 -28 86 -31 87 -33 88 -36 88 -39 86 -41 85 -43 83 -44 81 -45 76 -45 74 -45 71 -40 67 -37 65 -34 63 -33 61 -33 61 -32 60 -33 49 -37 45 -41 41 -45 39 -47 38 -51 37 -54 37 -58 38 -61 41 -63 44 -65 46 -66 49 -66 51 -67 55 -67 58 -67 60 -66 62 -64 65 -63 66 -61 67 -60 68 -58 68 -55 69 -54 69 -51 69 -48 69 -46 68 -45 66 -44 65 -44 63 -44 61 -44 59 -44 56 -44 55 -45 53 -47 52 -49 50 -50 48 -51 47 -52 46 -54 46 -55 45 -55 45 -56 44 -57 44 diff --git a/java/examples/Topics/File IO/LoadFile2/LoadFile2.pde b/java/examples/Topics/File IO/LoadFile2/LoadFile2.pde deleted file mode 100644 index 356d8354f..000000000 --- a/java/examples/Topics/File IO/LoadFile2/LoadFile2.pde +++ /dev/null @@ -1,55 +0,0 @@ -/** - * LoadFile 2 - * - * This example loads a data file about cars. Each element is separated - * with a tab and corresponds to a different aspect of each car. The file stores - * the miles per gallon, cylinders, displacement, etc., for more than 400 different - * makes and models. Press a mouse button to advance to the next group of entries. - */ - -Record[] records; -String[] lines; -int recordCount; -PFont body; -int num = 9; // Display this many entries on each screen. -int startingEntry = 0; // Display from this entry number - -void setup() { - size(200, 200); - fill(255); - noLoop(); - - body = loadFont("TheSans-Plain-12.vlw"); - textFont(body); - - lines = loadStrings("cars2.tsv"); - records = new Record[lines.length]; - for (int i = 0; i < lines.length; i++) { - String[] pieces = split(lines[i], TAB); // Load data into array - if (pieces.length == 9) { - records[recordCount] = new Record(pieces); - recordCount++; - } - } - if (recordCount != records.length) { - records = (Record[]) subset(records, 0, recordCount); - } -} - -void draw() { - background(0); - for (int i = 0; i < num; i++) { - int thisEntry = startingEntry + i; - if (thisEntry < recordCount) { - text(thisEntry + " > " + records[thisEntry].name, 20, 20 + i*20); - } - } -} - -void mousePressed() { - startingEntry += num; - if (startingEntry > records.length) { - startingEntry = 0; // go back to the beginning - } - redraw(); -} diff --git a/java/examples/Topics/File IO/LoadFile2/Record.pde b/java/examples/Topics/File IO/LoadFile2/Record.pde deleted file mode 100644 index 2cc836abc..000000000 --- a/java/examples/Topics/File IO/LoadFile2/Record.pde +++ /dev/null @@ -1,23 +0,0 @@ -class Record { - String name; - float mpg; - int cylinders; - float displacement; - float horsepower; - float weight; - float acceleration; - int year; - float origin; - - public Record(String[] pieces) { - name = pieces[0]; - mpg = float(pieces[1]); - cylinders = int(pieces[2]); - displacement = float(pieces[3]); - horsepower = float(pieces[4]); - weight = float(pieces[5]); - acceleration = float(pieces[6]); - year = int(pieces[7]); - origin = float(pieces[8]); - } -} diff --git a/java/examples/Topics/File IO/LoadFile2/data/TheSans-Plain-12.vlw b/java/examples/Topics/File IO/LoadFile2/data/TheSans-Plain-12.vlw deleted file mode 100644 index 4fcefba6b..000000000 Binary files a/java/examples/Topics/File IO/LoadFile2/data/TheSans-Plain-12.vlw and /dev/null differ diff --git a/java/examples/Topics/File IO/LoadFile2/data/cars2.tsv b/java/examples/Topics/File IO/LoadFile2/data/cars2.tsv deleted file mode 100644 index 7f658bf20..000000000 --- a/java/examples/Topics/File IO/LoadFile2/data/cars2.tsv +++ /dev/null @@ -1,406 +0,0 @@ -chevrolet chevelle malibu 18 8 307 130 3504 12 70 1 -buick skylark 320 15 8 350 165 3693 11.5 70 1 -plymouth satellite 18 8 318 150 3436 11 70 1 -amc rebel sst 16 8 304 150 3433 12 70 1 -ford torino 17 8 302 140 3449 10.5 70 1 -ford galaxie 500 15 8 429 198 4341 10 70 1 -chevrolet impala 14 8 454 220 4354 9 70 1 -plymouth fury iii 14 8 440 215 4312 8.5 70 1 -pontiac catalina 14 8 455 225 4425 10 70 1 -amc ambassador dpl 15 8 390 190 3850 8.5 70 1 -citroen ds-21 pallas NA 4 133 115 3090 17.5 70 2 -chevrolet chevelle concours (sw) NA 8 350 165 4142 11.5 70 1 -ford torino (sw) NA 8 351 153 4034 11 70 1 -plymouth satellite (sw) NA 8 383 175 4166 10.5 70 1 -amc rebel sst (sw) NA 8 360 175 3850 11 70 1 -dodge challenger se 15 8 383 170 3563 10 70 1 -plymouth 'cuda 340 14 8 340 160 3609 8 70 1 -ford mustang boss 302 NA 8 302 140 3353 8 70 1 -chevrolet monte carlo 15 8 400 150 3761 9.5 70 1 -buick estate wagon (sw) 14 8 455 225 3086 10 70 1 -toyota corona mark ii 24 4 113 95 2372 15 70 3 -plymouth duster 22 6 198 95 2833 15.5 70 1 -amc hornet 18 6 199 97 2774 15.5 70 1 -ford maverick 21 6 200 85 2587 16 70 1 -datsun pl510 27 4 97 88 2130 14.5 70 3 -volkswagen 1131 deluxe sedan 26 4 97 46 1835 20.5 70 2 -peugeot 504 25 4 110 87 2672 17.5 70 2 -audi 100 ls 24 4 107 90 2430 14.5 70 2 -saab 99e 25 4 104 95 2375 17.5 70 2 -bmw 2002 26 4 121 113 2234 12.5 70 2 -amc gremlin 21 6 199 90 2648 15 70 1 -ford f250 10 8 360 215 4615 14 70 1 -chevy c20 10 8 307 200 4376 15 70 1 -dodge d200 11 8 318 210 4382 13.5 70 1 -hi 1200d 9 8 304 193 4732 18.5 70 1 -datsun pl510 27 4 97 88 2130 14.5 71 3 -chevrolet vega 2300 28 4 140 90 2264 15.5 71 1 -toyota corona 25 4 113 95 2228 14 71 3 -ford pinto 25 4 98 NA 2046 19 71 1 -volkswagen super beetle 117 NA 4 97 48 1978 20 71 2 -amc gremlin 19 6 232 100 2634 13 71 1 -plymouth satellite custom 16 6 225 105 3439 15.5 71 1 -chevrolet chevelle malibu 17 6 250 100 3329 15.5 71 1 -ford torino 500 19 6 250 88 3302 15.5 71 1 -amc matador 18 6 232 100 3288 15.5 71 1 -chevrolet impala 14 8 350 165 4209 12 71 1 -pontiac catalina brougham 14 8 400 175 4464 11.5 71 1 -ford galaxie 500 14 8 351 153 4154 13.5 71 1 -plymouth fury iii 14 8 318 150 4096 13 71 1 -dodge monaco (sw) 12 8 383 180 4955 11.5 71 1 -ford country squire (sw) 13 8 400 170 4746 12 71 1 -pontiac safari (sw) 13 8 400 175 5140 12 71 1 -amc hornet sportabout (sw) 18 6 258 110 2962 13.5 71 1 -chevrolet vega (sw) 22 4 140 72 2408 19 71 1 -pontiac firebird 19 6 250 100 3282 15 71 1 -ford mustang 18 6 250 88 3139 14.5 71 1 -mercury capri 2000 23 4 122 86 2220 14 71 1 -opel 1900 28 4 116 90 2123 14 71 2 -peugeot 304 30 4 79 70 2074 19.5 71 2 -fiat 124b 30 4 88 76 2065 14.5 71 2 -toyota corolla 1200 31 4 71 65 1773 19 71 3 -datsun 1200 35 4 72 69 1613 18 71 3 -volkswagen model 111 27 4 97 60 1834 19 71 2 -plymouth cricket 26 4 91 70 1955 20.5 71 1 -toyota corona hardtop 24 4 113 95 2278 15.5 72 3 -dodge colt hardtop 25 4 97.5 80 2126 17 72 1 -volkswagen type 3 23 4 97 54 2254 23.5 72 2 -chevrolet vega 20 4 140 90 2408 19.5 72 1 -ford pinto runabout 21 4 122 86 2226 16.5 72 1 -chevrolet impala 13 8 350 165 4274 12 72 1 -pontiac catalina 14 8 400 175 4385 12 72 1 -plymouth fury iii 15 8 318 150 4135 13.5 72 1 -ford galaxie 500 14 8 351 153 4129 13 72 1 -amc ambassador sst 17 8 304 150 3672 11.5 72 1 -mercury marquis 11 8 429 208 4633 11 72 1 -buick lesabre custom 13 8 350 155 4502 13.5 72 1 -oldsmobile delta 88 royale 12 8 350 160 4456 13.5 72 1 -chrysler newport royal 13 8 400 190 4422 12.5 72 1 -mazda rx2 coupe 19 3 70 97 2330 13.5 72 3 -amc matador (sw) 15 8 304 150 3892 12.5 72 1 -chevrolet chevelle concours (sw) 13 8 307 130 4098 14 72 1 -ford gran torino (sw) 13 8 302 140 4294 16 72 1 -plymouth satellite custom (sw) 14 8 318 150 4077 14 72 1 -volvo 145e (sw) 18 4 121 112 2933 14.5 72 2 -volkswagen 411 (sw) 22 4 121 76 2511 18 72 2 -peugeot 504 (sw) 21 4 120 87 2979 19.5 72 2 -renault 12 (sw) 26 4 96 69 2189 18 72 2 -ford pinto (sw) 22 4 122 86 2395 16 72 1 -datsun 510 (sw) 28 4 97 92 2288 17 72 3 -toyouta corona mark ii (sw) 23 4 120 97 2506 14.5 72 3 -dodge colt (sw) 28 4 98 80 2164 15 72 1 -toyota corolla 1600 (sw) 27 4 97 88 2100 16.5 72 3 -buick century 350 13 8 350 175 4100 13 73 1 -amc matador 14 8 304 150 3672 11.5 73 1 -chevrolet malibu 13 8 350 145 3988 13 73 1 -ford gran torino 14 8 302 137 4042 14.5 73 1 -dodge coronet custom 15 8 318 150 3777 12.5 73 1 -mercury marquis brougham 12 8 429 198 4952 11.5 73 1 -chevrolet caprice classic 13 8 400 150 4464 12 73 1 -ford ltd 13 8 351 158 4363 13 73 1 -plymouth fury gran sedan 14 8 318 150 4237 14.5 73 1 -chrysler new yorker brougham 13 8 440 215 4735 11 73 1 -buick electra 225 custom 12 8 455 225 4951 11 73 1 -amc ambassador brougham 13 8 360 175 3821 11 73 1 -plymouth valiant 18 6 225 105 3121 16.5 73 1 -chevrolet nova custom 16 6 250 100 3278 18 73 1 -amc hornet 18 6 232 100 2945 16 73 1 -ford maverick 18 6 250 88 3021 16.5 73 1 -plymouth duster 23 6 198 95 2904 16 73 1 -volkswagen super beetle 26 4 97 46 1950 21 73 2 -chevrolet impala 11 8 400 150 4997 14 73 1 -ford country 12 8 400 167 4906 12.5 73 1 -plymouth custom suburb 13 8 360 170 4654 13 73 1 -oldsmobile vista cruiser 12 8 350 180 4499 12.5 73 1 -amc gremlin 18 6 232 100 2789 15 73 1 -toyota carina 20 4 97 88 2279 19 73 3 -chevrolet vega 21 4 140 72 2401 19.5 73 1 -datsun 610 22 4 108 94 2379 16.5 73 3 -maxda rx3 18 3 70 90 2124 13.5 73 3 -ford pinto 19 4 122 85 2310 18.5 73 1 -mercury capri v6 21 6 155 107 2472 14 73 1 -fiat 124 sport coupe 26 4 98 90 2265 15.5 73 2 -chevrolet monte carlo s 15 8 350 145 4082 13 73 1 -pontiac grand prix 16 8 400 230 4278 9.5 73 1 -fiat 128 29 4 68 49 1867 19.5 73 2 -opel manta 24 4 116 75 2158 15.5 73 2 -audi 100ls 20 4 114 91 2582 14 73 2 -volvo 144ea 19 4 121 112 2868 15.5 73 2 -dodge dart custom 15 8 318 150 3399 11 73 1 -saab 99le 24 4 121 110 2660 14 73 2 -toyota mark ii 20 6 156 122 2807 13.5 73 3 -oldsmobile omega 11 8 350 180 3664 11 73 1 -plymouth duster 20 6 198 95 3102 16.5 74 1 -ford maverick 21 6 200 NA 2875 17 74 1 -amc hornet 19 6 232 100 2901 16 74 1 -chevrolet nova 15 6 250 100 3336 17 74 1 -datsun b210 31 4 79 67 1950 19 74 3 -ford pinto 26 4 122 80 2451 16.5 74 1 -toyota corolla 1200 32 4 71 65 1836 21 74 3 -chevrolet vega 25 4 140 75 2542 17 74 1 -chevrolet chevelle malibu classic 16 6 250 100 3781 17 74 1 -amc matador 16 6 258 110 3632 18 74 1 -plymouth satellite sebring 18 6 225 105 3613 16.5 74 1 -ford gran torino 16 8 302 140 4141 14 74 1 -buick century luxus (sw) 13 8 350 150 4699 14.5 74 1 -dodge coronet custom (sw) 14 8 318 150 4457 13.5 74 1 -ford gran torino (sw) 14 8 302 140 4638 16 74 1 -amc matador (sw) 14 8 304 150 4257 15.5 74 1 -audi fox 29 4 98 83 2219 16.5 74 2 -volkswagen dasher 26 4 79 67 1963 15.5 74 2 -opel manta 26 4 97 78 2300 14.5 74 2 -toyota corona 31 4 76 52 1649 16.5 74 3 -datsun 710 32 4 83 61 2003 19 74 3 -dodge colt 28 4 90 75 2125 14.5 74 1 -fiat 128 24 4 90 75 2108 15.5 74 2 -fiat 124 tc 26 4 116 75 2246 14 74 2 -honda civic 24 4 120 97 2489 15 74 3 -subaru 26 4 108 93 2391 15.5 74 3 -fiat x1.9 31 4 79 67 2000 16 74 2 -plymouth valiant custom 19 6 225 95 3264 16 75 1 -chevrolet nova 18 6 250 105 3459 16 75 1 -mercury monarch 15 6 250 72 3432 21 75 1 -ford maverick 15 6 250 72 3158 19.5 75 1 -pontiac catalina 16 8 400 170 4668 11.5 75 1 -chevrolet bel air 15 8 350 145 4440 14 75 1 -plymouth grand fury 16 8 318 150 4498 14.5 75 1 -ford ltd 14 8 351 148 4657 13.5 75 1 -buick century 17 6 231 110 3907 21 75 1 -chevroelt chevelle malibu 16 6 250 105 3897 18.5 75 1 -amc matador 15 6 258 110 3730 19 75 1 -plymouth fury 18 6 225 95 3785 19 75 1 -buick skyhawk 21 6 231 110 3039 15 75 1 -chevrolet monza 2+2 20 8 262 110 3221 13.5 75 1 -ford mustang ii 13 8 302 129 3169 12 75 1 -toyota corolla 29 4 97 75 2171 16 75 3 -ford pinto 23 4 140 83 2639 17 75 1 -amc gremlin 20 6 232 100 2914 16 75 1 -pontiac astro 23 4 140 78 2592 18.5 75 1 -toyota corona 24 4 134 96 2702 13.5 75 3 -volkswagen dasher 25 4 90 71 2223 16.5 75 2 -datsun 710 24 4 119 97 2545 17 75 3 -ford pinto 18 6 171 97 2984 14.5 75 1 -volkswagen rabbit 29 4 90 70 1937 14 75 2 -amc pacer 19 6 232 90 3211 17 75 1 -audi 100ls 23 4 115 95 2694 15 75 2 -peugeot 504 23 4 120 88 2957 17 75 2 -volvo 244dl 22 4 121 98 2945 14.5 75 2 -saab 99le 25 4 121 115 2671 13.5 75 2 -honda civic cvcc 33 4 91 53 1795 17.5 75 3 -fiat 131 28 4 107 86 2464 15.5 76 2 -opel 1900 25 4 116 81 2220 16.9 76 2 -capri ii 25 4 140 92 2572 14.9 76 1 -dodge colt 26 4 98 79 2255 17.7 76 1 -renault 12tl 27 4 101 83 2202 15.3 76 2 -chevrolet chevelle malibu classic 17.5 8 305 140 4215 13 76 1 -dodge coronet brougham 16 8 318 150 4190 13 76 1 -amc matador 15.5 8 304 120 3962 13.9 76 1 -ford gran torino 14.5 8 351 152 4215 12.8 76 1 -plymouth valiant 22 6 225 100 3233 15.4 76 1 -chevrolet nova 22 6 250 105 3353 14.5 76 1 -ford maverick 24 6 200 81 3012 17.6 76 1 -amc hornet 22.5 6 232 90 3085 17.6 76 1 -chevrolet chevette 29 4 85 52 2035 22.2 76 1 -chevrolet woody 24.5 4 98 60 2164 22.1 76 1 -vw rabbit 29 4 90 70 1937 14.2 76 2 -honda civic 33 4 91 53 1795 17.4 76 3 -dodge aspen se 20 6 225 100 3651 17.7 76 1 -ford granada ghia 18 6 250 78 3574 21 76 1 -pontiac ventura sj 18.5 6 250 110 3645 16.2 76 1 -amc pacer d/l 17.5 6 258 95 3193 17.8 76 1 -volkswagen rabbit 29.5 4 97 71 1825 12.2 76 2 -datsun b-210 32 4 85 70 1990 17 76 3 -toyota corolla 28 4 97 75 2155 16.4 76 3 -ford pinto 26.5 4 140 72 2565 13.6 76 1 -volvo 245 20 4 130 102 3150 15.7 76 2 -plymouth volare premier v8 13 8 318 150 3940 13.2 76 1 -peugeot 504 19 4 120 88 3270 21.9 76 2 -toyota mark ii 19 6 156 108 2930 15.5 76 3 -mercedes-benz 280s 16.5 6 168 120 3820 16.7 76 2 -cadillac seville 16.5 8 350 180 4380 12.1 76 1 -chevy c10 13 8 350 145 4055 12 76 1 -ford f108 13 8 302 130 3870 15 76 1 -dodge d100 13 8 318 150 3755 14 76 1 -honda accord cvcc 31.5 4 98 68 2045 18.5 77 3 -buick opel isuzu deluxe 30 4 111 80 2155 14.8 77 1 -renault 5 gtl 36 4 79 58 1825 18.6 77 2 -plymouth arrow gs 25.5 4 122 96 2300 15.5 77 1 -datsun f-10 hatchback 33.5 4 85 70 1945 16.8 77 3 -chevrolet caprice classic 17.5 8 305 145 3880 12.5 77 1 -oldsmobile cutlass supreme 17 8 260 110 4060 19 77 1 -dodge monaco brougham 15.5 8 318 145 4140 13.7 77 1 -mercury cougar brougham 15 8 302 130 4295 14.9 77 1 -chevrolet concours 17.5 6 250 110 3520 16.4 77 1 -buick skylark 20.5 6 231 105 3425 16.9 77 1 -plymouth volare custom 19 6 225 100 3630 17.7 77 1 -ford granada 18.5 6 250 98 3525 19 77 1 -pontiac grand prix lj 16 8 400 180 4220 11.1 77 1 -chevrolet monte carlo landau 15.5 8 350 170 4165 11.4 77 1 -chrysler cordoba 15.5 8 400 190 4325 12.2 77 1 -ford thunderbird 16 8 351 149 4335 14.5 77 1 -volkswagen rabbit custom 29 4 97 78 1940 14.5 77 2 -pontiac sunbird coupe 24.5 4 151 88 2740 16 77 1 -toyota corolla liftback 26 4 97 75 2265 18.2 77 3 -ford mustang ii 2+2 25.5 4 140 89 2755 15.8 77 1 -chevrolet chevette 30.5 4 98 63 2051 17 77 1 -dodge colt m/m 33.5 4 98 83 2075 15.9 77 1 -subaru dl 30 4 97 67 1985 16.4 77 3 -volkswagen dasher 30.5 4 97 78 2190 14.1 77 2 -datsun 810 22 6 146 97 2815 14.5 77 3 -bmw 320i 21.5 4 121 110 2600 12.8 77 2 -mazda rx-4 21.5 3 80 110 2720 13.5 77 3 -volkswagen rabbit custom diesel 43.1 4 90 48 1985 21.5 78 2 -ford fiesta 36.1 4 98 66 1800 14.4 78 1 -mazda glc deluxe 32.8 4 78 52 1985 19.4 78 3 -datsun b210 gx 39.4 4 85 70 2070 18.6 78 3 -honda civic cvcc 36.1 4 91 60 1800 16.4 78 3 -oldsmobile cutlass salon brougham 19.9 8 260 110 3365 15.5 78 1 -dodge diplomat 19.4 8 318 140 3735 13.2 78 1 -mercury monarch ghia 20.2 8 302 139 3570 12.8 78 1 -pontiac phoenix lj 19.2 6 231 105 3535 19.2 78 1 -chevrolet malibu 20.5 6 200 95 3155 18.2 78 1 -ford fairmont (auto) 20.2 6 200 85 2965 15.8 78 1 -ford fairmont (man) 25.1 4 140 88 2720 15.4 78 1 -plymouth volare 20.5 6 225 100 3430 17.2 78 1 -amc concord 19.4 6 232 90 3210 17.2 78 1 -buick century special 20.6 6 231 105 3380 15.8 78 1 -mercury zephyr 20.8 6 200 85 3070 16.7 78 1 -dodge aspen 18.6 6 225 110 3620 18.7 78 1 -amc concord d/l 18.1 6 258 120 3410 15.1 78 1 -chevrolet monte carlo landau 19.2 8 305 145 3425 13.2 78 1 -buick regal sport coupe (turbo) 17.7 6 231 165 3445 13.4 78 1 -ford futura 18.1 8 302 139 3205 11.2 78 1 -dodge magnum xe 17.5 8 318 140 4080 13.7 78 1 -chevrolet chevette 30 4 98 68 2155 16.5 78 1 -toyota corona 27.5 4 134 95 2560 14.2 78 3 -datsun 510 27.2 4 119 97 2300 14.7 78 3 -dodge omni 30.9 4 105 75 2230 14.5 78 1 -toyota celica gt liftback 21.1 4 134 95 2515 14.8 78 3 -plymouth sapporo 23.2 4 156 105 2745 16.7 78 1 -oldsmobile starfire sx 23.8 4 151 85 2855 17.6 78 1 -datsun 200-sx 23.9 4 119 97 2405 14.9 78 3 -audi 5000 20.3 5 131 103 2830 15.9 78 2 -volvo 264gl 17 6 163 125 3140 13.6 78 2 -saab 99gle 21.6 4 121 115 2795 15.7 78 2 -peugeot 604sl 16.2 6 163 133 3410 15.8 78 2 -volkswagen scirocco 31.5 4 89 71 1990 14.9 78 2 -honda accord lx 29.5 4 98 68 2135 16.6 78 3 -pontiac lemans v6 21.5 6 231 115 3245 15.4 79 1 -mercury zephyr 6 19.8 6 200 85 2990 18.2 79 1 -ford fairmont 4 22.3 4 140 88 2890 17.3 79 1 -amc concord dl 6 20.2 6 232 90 3265 18.2 79 1 -dodge aspen 6 20.6 6 225 110 3360 16.6 79 1 -chevrolet caprice classic 17 8 305 130 3840 15.4 79 1 -ford ltd landau 17.6 8 302 129 3725 13.4 79 1 -mercury grand marquis 16.5 8 351 138 3955 13.2 79 1 -dodge st. regis 18.2 8 318 135 3830 15.2 79 1 -buick estate wagon (sw) 16.9 8 350 155 4360 14.9 79 1 -ford country squire (sw) 15.5 8 351 142 4054 14.3 79 1 -chevrolet malibu classic (sw) 19.2 8 267 125 3605 15 79 1 -chrysler lebaron town @ country (sw) 18.5 8 360 150 3940 13 79 1 -vw rabbit custom 31.9 4 89 71 1925 14 79 2 -maxda glc deluxe 34.1 4 86 65 1975 15.2 79 3 -dodge colt hatchback custom 35.7 4 98 80 1915 14.4 79 1 -amc spirit dl 27.4 4 121 80 2670 15 79 1 -mercedes benz 300d 25.4 5 183 77 3530 20.1 79 2 -cadillac eldorado 23 8 350 125 3900 17.4 79 1 -peugeot 504 27.2 4 141 71 3190 24.8 79 2 -oldsmobile cutlass salon brougham 23.9 8 260 90 3420 22.2 79 1 -plymouth horizon 34.2 4 105 70 2200 13.2 79 1 -plymouth horizon tc3 34.5 4 105 70 2150 14.9 79 1 -datsun 210 31.8 4 85 65 2020 19.2 79 3 -fiat strada custom 37.3 4 91 69 2130 14.7 79 2 -buick skylark limited 28.4 4 151 90 2670 16 79 1 -chevrolet citation 28.8 6 173 115 2595 11.3 79 1 -oldsmobile omega brougham 26.8 6 173 115 2700 12.9 79 1 -pontiac phoenix 33.5 4 151 90 2556 13.2 79 1 -vw rabbit 41.5 4 98 76 2144 14.7 80 2 -toyota corolla tercel 38.1 4 89 60 1968 18.8 80 3 -chevrolet chevette 32.1 4 98 70 2120 15.5 80 1 -datsun 310 37.2 4 86 65 2019 16.4 80 3 -chevrolet citation 28 4 151 90 2678 16.5 80 1 -ford fairmont 26.4 4 140 88 2870 18.1 80 1 -amc concord 24.3 4 151 90 3003 20.1 80 1 -dodge aspen 19.1 6 225 90 3381 18.7 80 1 -audi 4000 34.3 4 97 78 2188 15.8 80 2 -toyota corona liftback 29.8 4 134 90 2711 15.5 80 3 -mazda 626 31.3 4 120 75 2542 17.5 80 3 -datsun 510 hatchback 37 4 119 92 2434 15 80 3 -toyota corolla 32.2 4 108 75 2265 15.2 80 3 -mazda glc 46.6 4 86 65 2110 17.9 80 3 -dodge colt 27.9 4 156 105 2800 14.4 80 1 -datsun 210 40.8 4 85 65 2110 19.2 80 3 -vw rabbit c (diesel) 44.3 4 90 48 2085 21.7 80 2 -vw dasher (diesel) 43.4 4 90 48 2335 23.7 80 2 -audi 5000s (diesel) 36.4 5 121 67 2950 19.9 80 2 -mercedes-benz 240d 30 4 146 67 3250 21.8 80 2 -honda civic 1500 gl 44.6 4 91 67 1850 13.8 80 3 -renault lecar deluxe 40.9 4 85 NA 1835 17.3 80 2 -subaru dl 33.8 4 97 67 2145 18 80 3 -vokswagen rabbit 29.8 4 89 62 1845 15.3 80 2 -datsun 280-zx 32.7 6 168 132 2910 11.4 80 3 -mazda rx-7 gs 23.7 3 70 100 2420 12.5 80 3 -triumph tr7 coupe 35 4 122 88 2500 15.1 80 2 -ford mustang cobra 23.6 4 140 NA 2905 14.3 80 1 -honda accord 32.4 4 107 72 2290 17 80 3 -plymouth reliant 27.2 4 135 84 2490 15.7 81 1 -buick skylark 26.6 4 151 84 2635 16.4 81 1 -dodge aries wagon (sw) 25.8 4 156 92 2620 14.4 81 1 -chevrolet citation 23.5 6 173 110 2725 12.6 81 1 -plymouth reliant 30 4 135 84 2385 12.9 81 1 -toyota starlet 39.1 4 79 58 1755 16.9 81 3 -plymouth champ 39 4 86 64 1875 16.4 81 1 -honda civic 1300 35.1 4 81 60 1760 16.1 81 3 -subaru 32.3 4 97 67 2065 17.8 81 3 -datsun 210 mpg 37 4 85 65 1975 19.4 81 3 -toyota tercel 37.7 4 89 62 2050 17.3 81 3 -mazda glc 4 34.1 4 91 68 1985 16 81 3 -plymouth horizon 4 34.7 4 105 63 2215 14.9 81 1 -ford escort 4w 34.4 4 98 65 2045 16.2 81 1 -ford escort 2h 29.9 4 98 65 2380 20.7 81 1 -volkswagen jetta 33 4 105 74 2190 14.2 81 2 -renault 18i 34.5 4 100 NA 2320 15.8 81 2 -honda prelude 33.7 4 107 75 2210 14.4 81 3 -toyota corolla 32.4 4 108 75 2350 16.8 81 3 -datsun 200sx 32.9 4 119 100 2615 14.8 81 3 -mazda 626 31.6 4 120 74 2635 18.3 81 3 -peugeot 505s turbo diesel 28.1 4 141 80 3230 20.4 81 2 -saab 900s NA 4 121 110 2800 15.4 81 2 -volvo diesel 30.7 6 145 76 3160 19.6 81 2 -toyota cressida 25.4 6 168 116 2900 12.6 81 3 -datsun 810 maxima 24.2 6 146 120 2930 13.8 81 3 -buick century 22.4 6 231 110 3415 15.8 81 1 -oldsmobile cutlass ls 26.6 8 350 105 3725 19 81 1 -ford granada gl 20.2 6 200 88 3060 17.1 81 1 -chrysler lebaron salon 17.6 6 225 85 3465 16.6 81 1 -chevrolet cavalier 28 4 112 88 2605 19.6 82 1 -chevrolet cavalier wagon 27 4 112 88 2640 18.6 82 1 -chevrolet cavalier 2-door 34 4 112 88 2395 18 82 1 -pontiac j2000 se hatchback 31 4 112 85 2575 16.2 82 1 -dodge aries se 29 4 135 84 2525 16 82 1 -pontiac phoenix 27 4 151 90 2735 18 82 1 -ford fairmont futura 24 4 140 92 2865 16.4 82 1 -amc concord dl 23 4 151 NA 3035 20.5 82 1 -volkswagen rabbit l 36 4 105 74 1980 15.3 82 2 -mazda glc custom l 37 4 91 68 2025 18.2 82 3 -mazda glc custom 31 4 91 68 1970 17.6 82 3 -plymouth horizon miser 38 4 105 63 2125 14.7 82 1 -mercury lynx l 36 4 98 70 2125 17.3 82 1 -nissan stanza xe 36 4 120 88 2160 14.5 82 3 -honda accord 36 4 107 75 2205 14.5 82 3 -toyota corolla 34 4 108 70 2245 16.9 82 3 -honda civic 38 4 91 67 1965 15 82 3 -honda civic (auto) 32 4 91 67 1965 15.7 82 3 -datsun 310 gx 38 4 91 67 1995 16.2 82 3 -buick century limited 25 6 181 110 2945 16.4 82 1 -oldsmobile cutlass ciera (diesel) 38 6 262 85 3015 17 82 1 -chrysler lebaron medallion 26 4 156 92 2585 14.5 82 1 -ford granada l 22 6 232 112 2835 14.7 82 1 -toyota celica gt 32 4 144 96 2665 13.9 82 3 -dodge charger 2.2 36 4 135 84 2370 13 82 1 -chevrolet camaro 27 4 151 90 2950 17.3 82 1 -ford mustang gl 27 4 140 86 2790 15.6 82 1 -vw pickup 44 4 97 52 2130 24.6 82 2 -dodge rampage 32 4 135 84 2295 11.6 82 1 -ford ranger 28 4 120 79 2625 18.6 82 1 -chevy s-10 31 4 119 82 2720 19.4 82 1 \ No newline at end of file diff --git a/java/examples/Topics/File IO/SaveFile1/SaveFile1.pde b/java/examples/Topics/File IO/SaveFile1/SaveFile1.pde deleted file mode 100644 index 9bcdbec18..000000000 --- a/java/examples/Topics/File IO/SaveFile1/SaveFile1.pde +++ /dev/null @@ -1,49 +0,0 @@ -/** - * SaveFile 1 - * - * Saving files is a useful way to store data so it can be viewed after a - * program has stopped running. The saveStrings() function writes an array - * of strings to a file, with each string written to a new line. This file - * is saved to the sketch's folder. This example won't work in a web browser - * because of Java security restrictions. - */ - -int[] x = new int[0]; -int[] y = new int[0]; - -void setup() -{ - size(200, 200); -} - -void draw() -{ - background(204); - stroke(0); - noFill(); - beginShape(); - for (int i = 0; i < x.length; i++) { - vertex(x[i], y[i]); - } - endShape(); - // Show the next segment to be added - if (x.length >= 1) { - stroke(255); - line(mouseX, mouseY, x[x.length-1], y[x.length-1]); - } -} - -void mousePressed() { // Click to add a line segment - x = append(x, mouseX); - y = append(y, mouseY); -} - -void keyPressed() { // Press a key to save the data - String[] lines = new String[x.length]; - for (int i = 0; i < x.length; i++) { - lines[i] = x[i] + "\t" + y[i]; - } - saveStrings("lines.txt", lines); - exit(); // Stop the program -} - diff --git a/java/examples/Topics/File IO/SaveFile2/SaveFile2.pde b/java/examples/Topics/File IO/SaveFile2/SaveFile2.pde deleted file mode 100644 index f47265063..000000000 --- a/java/examples/Topics/File IO/SaveFile2/SaveFile2.pde +++ /dev/null @@ -1,34 +0,0 @@ -/** - * SaveFile 2 - * - * This file a PrintWriter object to write data continuously to a file - * while the mouse is pressed. When a key is pressed, the file closes - * itself and the program is stopped. This example won't work in a web browser - * because of Java security restrictions. - */ - -PrintWriter output; - -void setup() -{ - size(200, 200); - // Create a new file in the sketch directory - output = createWriter("positions.txt"); - frameRate(12); -} - -void draw() -{ - if (mousePressed) { - point(mouseX, mouseY); - // Write the coordinate to a file with a - // "\t" (TAB character) between each entry - output.println(mouseX + "\t" + mouseY); - } -} - -void keyPressed() { // Press a key to save the data - output.flush(); // Write the remaining data - output.close(); // Finish the file - exit(); // Stop the program -} diff --git a/java/examples/Topics/File IO/SaveFrames/SaveFrames.pde b/java/examples/Topics/File IO/SaveFrames/SaveFrames.pde deleted file mode 100644 index ca5924e93..000000000 --- a/java/examples/Topics/File IO/SaveFrames/SaveFrames.pde +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Save Frames - * by Daniel Shiffman. - * - * This example demonstrates how to use saveFrame() to render - * out an image sequence that you can assemble into a movie - * using the MovieMaker tool. - */ - -// A boolean to track whether we are recording are not -boolean recording = false; - -void setup() { - size(640, 360); - smooth(); -} - -void draw() { - background(0); - - // An arbitrary oscillating rotating animation - // so that we have something to render - for (float a = 0; a < TWO_PI; a+= 0.2) { - pushMatrix(); - translate(width/2, height/2); - rotate(a+sin(frameCount*0.004*a)); - stroke(255); - line(-100, 0, 100, 0); - popMatrix(); - } - - // If we are recording call saveFrame! - // The number signs (#) indicate to Processing to - // number the files automatically - if (recording) { - saveFrame("output/frames####.png"); - } - - // Let's draw some stuff to tell us what is happening - // It's important to note that none of this will show up in the - // rendered files b/c it is drawn *after* saveFrame() - textAlign(CENTER); - fill(255); - if (!recording) { - text("Press r to start recording.", width/2, height-24); - } - else { - text("Press r to stop recording.", width/2, height-24); - } - - // A red dot for when we are recording - stroke(255); - if (recording) { - fill(255, 0, 0); - } else { - noFill(); - } - ellipse(width/2, height-48, 16, 16); -} - -void keyPressed() { - - // If we press r, start or stop recording! - if (key == 'r' || key == 'R') { - recording = !recording; - } -} - - diff --git a/java/examples/Topics/File IO/SaveOneFrame/SaveOneImage.pde b/java/examples/Topics/File IO/SaveOneFrame/SaveOneImage.pde deleted file mode 100644 index 8487ab524..000000000 --- a/java/examples/Topics/File IO/SaveOneFrame/SaveOneImage.pde +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Save One Image - * - * The save() function allows you to save an image from the - * display window. In this example, save() is run when a mouse - * button is pressed. The image "line.tif" is saved to the - * same folder as the sketch's program file. - */ - -void setup() { - size(200, 200); -} - -void draw() { - background(204); - line(0, 0, mouseX, height); - line(width, 0, 0, mouseY); -} - -void mousePressed() { - save("line.tif"); -} diff --git a/java/examples/Topics/File IO/TileImages/TileImages.pde b/java/examples/Topics/File IO/TileImages/TileImages.pde deleted file mode 100644 index d577e275e..000000000 --- a/java/examples/Topics/File IO/TileImages/TileImages.pde +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Tile Images - * - * Draws an image larger than the screen, and saves the image as six tiles. - * The scaleValue variable sets amount of scaling: 1 is 100%, 2 is 200%, etc. - */ - -int scaleValue = 3; // Multiplication factor -int xoffset = 0; // x-axis offset -int yoffset = 0; // y-axis offset - -void setup() { - size(600, 600); - stroke(0, 100); -} - -void draw() { - background(204); - scale(scaleValue); - translate(xoffset * (-width / scaleValue), yoffset * (-height / scaleValue)); - line(10, 150, 500, 50); - line(0, 600, 600, 0); - save("lines-" + yoffset + "-" + xoffset + ".png"); - setOffset(); -} - -void setOffset() { - xoffset++; - if (xoffset == scaleValue) { - xoffset = 0; - yoffset++; - if (yoffset == scaleValue) { - println("Tiles saved."); - exit(); - } - } -} \ No newline at end of file diff --git a/java/examples/Topics/Fractals and L-Systems/Koch/Koch.pde b/java/examples/Topics/Fractals and L-Systems/Koch/Koch.pde deleted file mode 100644 index 4299f06f8..000000000 --- a/java/examples/Topics/Fractals and L-Systems/Koch/Koch.pde +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Koch Curve - * by Daniel Shiffman. - * - * Renders a simple fractal, the Koch snowflake. - * Each recursive level is drawn in sequence. - */ - - -KochFractal k; - -void setup() { - size(640, 360); - frameRate(1); // Animate slowly - k = new KochFractal(); -} - -void draw() { - background(0); - // Draws the snowflake! - k.render(); - // Iterate - k.nextLevel(); - // Let's not do it more than 5 times. . . - if (k.getCount() > 5) { - k.restart(); - } -} - - diff --git a/java/examples/Topics/Fractals and L-Systems/Koch/KochFractal.pde b/java/examples/Topics/Fractals and L-Systems/Koch/KochFractal.pde deleted file mode 100644 index 22f8f9c0a..000000000 --- a/java/examples/Topics/Fractals and L-Systems/Koch/KochFractal.pde +++ /dev/null @@ -1,67 +0,0 @@ -// Koch Curve -// A class to manage the list of line segments in the snowflake pattern - -class KochFractal { - PVector start; // A PVector for the start - PVector end; // A PVector for the end - ArrayList lines; // A list to keep track of all the lines - int count; - - KochFractal() { - start = new PVector(0,height-20); - end = new PVector(width,height-20); - lines = new ArrayList(); - restart(); - } - - void nextLevel() { - // For every line that is in the arraylist - // create 4 more lines in a new arraylist - lines = iterate(lines); - count++; - } - - void restart() { - count = 0; // Reset count - lines.clear(); // Empty the array list - lines.add(new KochLine(start,end)); // Add the initial line (from one end PVector to the other) - } - - int getCount() { - return count; - } - - // This is easy, just draw all the lines - void render() { - for(KochLine l : lines) { - l.display(); - } - } - - // This is where the **MAGIC** happens - // Step 1: Create an empty arraylist - // Step 2: For every line currently in the arraylist - // - calculate 4 line segments based on Koch algorithm - // - add all 4 line segments into the new arraylist - // Step 3: Return the new arraylist and it becomes the list of line segments for the structure - - // As we do this over and over again, each line gets broken into 4 lines, which gets broken into 4 lines, and so on. . . - ArrayList iterate(ArrayList before) { - ArrayList now = new ArrayList(); // Create emtpy list - for(KochLine l : before) { - // Calculate 5 koch PVectors (done for us by the line object) - PVector a = l.start(); - PVector b = l.kochleft(); - PVector c = l.kochmiddle(); - PVector d = l.kochright(); - PVector e = l.end(); - // Make line segments between all the PVectors and add them - now.add(new KochLine(a,b)); - now.add(new KochLine(b,c)); - now.add(new KochLine(c,d)); - now.add(new KochLine(d,e)); - } - return now; - } - -} diff --git a/java/examples/Topics/Fractals and L-Systems/Koch/KochLine.pde b/java/examples/Topics/Fractals and L-Systems/Koch/KochLine.pde deleted file mode 100644 index 038549da7..000000000 --- a/java/examples/Topics/Fractals and L-Systems/Koch/KochLine.pde +++ /dev/null @@ -1,67 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Koch Curve -// A class to describe one line segment in the fractal -// Includes methods to calculate midPVectors along the line according to the Koch algorithm - -class KochLine { - - // Two PVectors, - // a is the "left" PVector and - // b is the "right PVector - PVector a; - PVector b; - - KochLine(PVector start, PVector end) { - a = start.get(); - b = end.get(); - } - - void display() { - stroke(255); - line(a.x, a.y, b.x, b.y); - } - - PVector start() { - return a.get(); - } - - PVector end() { - return b.get(); - } - - // This is easy, just 1/3 of the way - PVector kochleft() { - PVector v = PVector.sub(b, a); - v.div(3); - v.add(a); - return v; - } - - // More complicated, have to use a little trig to figure out where this PVector is! - PVector kochmiddle() { - PVector v = PVector.sub(b, a); - v.div(3); - - PVector p = a.get(); - p.add(v); - - v.rotate(-radians(60)); - p.add(v); - - return p; - } - - // Easy, just 2/3 of the way - PVector kochright() { - PVector v = PVector.sub(a, b); - v.div(3); - v.add(b); - return v; - } -} - - - diff --git a/java/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde b/java/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde deleted file mode 100644 index f0c666d73..000000000 --- a/java/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde +++ /dev/null @@ -1,75 +0,0 @@ -/** - * The Mandelbrot Set - * by Daniel Shiffman. - * - * Simple rendering of the Mandelbrot set. - */ - - -// Establish a range of values on the complex plane -// A different range will allow us to "zoom" in or out on the fractal -// float xmin = -1.5; float ymin = -.1; float wh = 0.15; -float xmin = -3; -float ymin = -1.25; -float w = 5; -float h = 2.5; - -size(640, 360); -noLoop(); -background(255); - -// Make sure we can write to the pixels[] array. -// Only need to do this once since we don't do any other drawing. -loadPixels(); - -// Maximum number of iterations for each point on the complex plane -int maxiterations = 100; - -// x goes from xmin to xmax -float xmax = xmin + w; -// y goes from ymin to ymax -float ymax = ymin + h; - -// Calculate amount we increment x,y for each pixel -float dx = (xmax - xmin) / (width); -float dy = (ymax - ymin) / (height); - -// Start y -float y = ymin; -for (int j = 0; j < height; j++) { - // Start x - float x = xmin; - for (int i = 0; i < width; i++) { - - // Now we test, as we iterate z = z^2 + cm does z tend towards infinity? - float a = x; - float b = y; - int n = 0; - while (n < maxiterations) { - float aa = a * a; - float bb = b * b; - float twoab = 2.0 * a * b; - a = aa - bb + x; - b = twoab + y; - // Infinty in our finite world is simple, let's just consider it 16 - if (aa + bb > 16.0) { - break; // Bail - } - n++; - } - - // We color each pixel based on how long it takes to get to infinity - // If we never got there, let's pick the color black - if (n == maxiterations) { - pixels[i+j*width] = color(0); - } - else { - // Gosh, we could make fancy colors here if we wanted - pixels[i+j*width] = color(n*16 % 255); - } - x += dx; - } - y += dy; -} -updatePixels(); - diff --git a/java/examples/Topics/Fractals and L-Systems/PenroseSnowflake/LSystem.pde b/java/examples/Topics/Fractals and L-Systems/PenroseSnowflake/LSystem.pde deleted file mode 100644 index 10e694d12..000000000 --- a/java/examples/Topics/Fractals and L-Systems/PenroseSnowflake/LSystem.pde +++ /dev/null @@ -1,76 +0,0 @@ -class LSystem -{ - int steps = 0; - - String axiom; - String rule; - String production; - - float startLength; - float drawLength; - float theta; - - int generations; - - LSystem() { - axiom = "F"; - rule = "F+F-F"; - startLength = 90.0; - theta = radians(120.0); - reset(); - } - - void reset() { - production = axiom; - drawLength = startLength; - generations = 0; - } - - int getAge() { - return generations; - } - - void render() { - translate(width/2, height/2); - steps += 5; - if (steps > production.length()) { - steps = production.length(); - } - for (int i = 0; i < steps; i++) { - char step = production.charAt(i); - if (step == 'F') { - rect(0, 0, -drawLength, -drawLength); - noFill(); - translate(0, -drawLength); - } - else if (step == '+') { - rotate(theta); - } - else if (step == '-') { - rotate(-theta); - } - else if (step == '[') { - pushMatrix(); - } - else if (step == ']') { - popMatrix(); - } - } - } - - void simulate(int gen) { - while (getAge() < gen) { - production = iterate(production, rule); - } - } - - String iterate(String prod_, String rule_) { - drawLength = drawLength * 0.6; - generations++; - String newProduction = prod_; - newProduction = newProduction.replaceAll("F", rule_); - return newProduction; - } -} - - diff --git a/java/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflake.pde b/java/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflake.pde deleted file mode 100644 index 2b4cb37d9..000000000 --- a/java/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflake.pde +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Penrose Snowflake L-System - * by Geraldine Sarmiento. - * - * This code was based on Patrick Dwyer's L-System class. - */ - -PenroseSnowflakeLSystem ps; - -void setup() { - size(640, 360); - stroke(255); - noFill(); - ps = new PenroseSnowflakeLSystem(); - ps.simulate(4); -} - -void draw() { - background(0); - ps.render(); -} - - diff --git a/java/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflakeLSystem.pde b/java/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflakeLSystem.pde deleted file mode 100644 index df1f775b0..000000000 --- a/java/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflakeLSystem.pde +++ /dev/null @@ -1,100 +0,0 @@ -class PenroseSnowflakeLSystem extends LSystem { - - String ruleF; - - PenroseSnowflakeLSystem() { - axiom = "F3-F3-F3-F3-F"; - ruleF = "F3-F3-F45-F++F3-F"; - startLength = 450.0; - theta = radians(18); - reset(); - } - - void useRule(String r_) { - rule = r_; - } - - void useAxiom(String a_) { - axiom = a_; - } - - void useLength(float l_) { - startLength = l_; - } - - void useTheta(float t_) { - theta = radians(t_); - } - - void reset() { - production = axiom; - drawLength = startLength; - generations = 0; - } - - int getAge() { - return generations; - } - - void render() { - translate(width, height); - int repeats = 1; - - steps += 3; - if (steps > production.length()) { - steps = production.length(); - } - - for (int i = 0; i < steps; i++) { - char step = production.charAt(i); - if (step == 'F') { - for (int j = 0; j < repeats; j++) { - line(0,0,0, -drawLength); - translate(0, -drawLength); - } - repeats = 1; - } - else if (step == '+') { - for (int j = 0; j < repeats; j++) { - rotate(theta); - } - repeats = 1; - } - else if (step == '-') { - for (int j =0; j < repeats; j++) { - rotate(-theta); - } - repeats = 1; - } - else if (step == '[') { - pushMatrix(); - } - else if (step == ']') { - popMatrix(); - } - else if ( (step >= 48) && (step <= 57) ) { - repeats += step - 48; - } - } - } - - - String iterate(String prod_, String rule_) { - String newProduction = ""; - for (int i = 0; i < prod_.length(); i++) { - char step = production.charAt(i); - if (step == 'F') { - newProduction = newProduction + ruleF; - } - else { - if (step != 'F') { - newProduction = newProduction + step; - } - } - } - drawLength = drawLength * 0.4; - generations++; - return newProduction; - } - -} diff --git a/java/examples/Topics/Fractals and L-Systems/PenroseTile/LSystem.pde b/java/examples/Topics/Fractals and L-Systems/PenroseTile/LSystem.pde deleted file mode 100644 index 8f00ddaf5..000000000 --- a/java/examples/Topics/Fractals and L-Systems/PenroseTile/LSystem.pde +++ /dev/null @@ -1,74 +0,0 @@ -class LSystem -{ - int steps = 0; - - String axiom; - String rule; - String production; - - float startLength; - float drawLength; - float theta; - - int generations; - - LSystem() { - axiom = "F"; - rule = "F+F-F"; - startLength = 190.0; - theta = radians(120.0); - reset(); - } - - void reset() { - production = axiom; - drawLength = startLength; - generations = 0; - } - - int getAge() { - return generations; - } - - void render() { - translate(width/2, height/2); - steps += 5; - if (steps > production.length()) { - steps = production.length(); - } - for (int i = 0; i < steps; i++) { - char step = production.charAt(i); - if (step == 'F') { - rect(0, 0, -drawLength, -drawLength); - noFill(); - translate(0, -drawLength); - } - else if (step == '+') { - rotate(theta); - } - else if (step == '-') { - rotate(-theta); - } - else if (step == '[') { - pushMatrix(); - } - else if (step == ']') { - popMatrix(); - } - } - } - - void simulate(int gen) { - while (getAge() < gen) { - production = iterate(production, rule); - } - } - - String iterate(String prod_, String rule_) { - drawLength = drawLength * 0.6; - generations++; - String newProduction = prod_; - newProduction = newProduction.replaceAll("F", rule_); - return newProduction; - } -} diff --git a/java/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseLSystem.pde b/java/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseLSystem.pde deleted file mode 100644 index 16a7f1c43..000000000 --- a/java/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseLSystem.pde +++ /dev/null @@ -1,128 +0,0 @@ -class PenroseLSystem extends LSystem { - - int steps = 0; - float somestep = 0.1; - String ruleW; - String ruleX; - String ruleY; - String ruleZ; - - PenroseLSystem() { - axiom = "[X]++[X]++[X]++[X]++[X]"; - ruleW = "YF++ZF4-XF[-YF4-WF]++"; - ruleX = "+YF--ZF[3-WF--XF]+"; - ruleY = "-WF++XF[+++YF++ZF]-"; - ruleZ = "--YF++++WF[+ZF++++XF]--XF"; - startLength = 460.0; - theta = radians(36); - reset(); - } - - void useRule(String r_) { - rule = r_; - } - - void useAxiom(String a_) { - axiom = a_; - } - - void useLength(float l_) { - startLength = l_; - } - - void useTheta(float t_) { - theta = radians(t_); - } - - void reset() { - production = axiom; - drawLength = startLength; - generations = 0; - } - - int getAge() { - return generations; - } - - void render() { - translate(width/2, height/2); - int pushes = 0; - int repeats = 1; - steps += 12; - if (steps > production.length()) { - steps = production.length(); - } - - for (int i = 0; i < steps; i++) { - char step = production.charAt(i); - if (step == 'F') { - stroke(255, 60); - for (int j = 0; j < repeats; j++) { - line(0, 0, 0, -drawLength); - noFill(); - translate(0, -drawLength); - } - repeats = 1; - } - else if (step == '+') { - for (int j = 0; j < repeats; j++) { - rotate(theta); - } - repeats = 1; - } - else if (step == '-') { - for (int j =0; j < repeats; j++) { - rotate(-theta); - } - repeats = 1; - } - else if (step == '[') { - pushes++; - pushMatrix(); - } - else if (step == ']') { - popMatrix(); - pushes--; - } - else if ( (step >= 48) && (step <= 57) ) { - repeats = (int)step - 48; - } - } - - // Unpush if we need too - while (pushes > 0) { - popMatrix(); - pushes--; - } - } - - String iterate(String prod_, String rule_) { - String newProduction = ""; - for (int i = 0; i < prod_.length(); i++) { - char step = production.charAt(i); - if (step == 'W') { - newProduction = newProduction + ruleW; - } - else if (step == 'X') { - newProduction = newProduction + ruleX; - } - else if (step == 'Y') { - newProduction = newProduction + ruleY; - } - else if (step == 'Z') { - newProduction = newProduction + ruleZ; - } - else { - if (step != 'F') { - newProduction = newProduction + step; - } - } - } - - drawLength = drawLength * 0.5; - generations++; - return newProduction; - } - -} - diff --git a/java/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseTile.pde b/java/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseTile.pde deleted file mode 100644 index 763c695e9..000000000 --- a/java/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseTile.pde +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Penrose Tile L-System - * by Geraldine Sarmiento. - * - * This code was based on Patrick Dwyer's L-System class. - */ - -PenroseLSystem ds; - -void setup() { - size(640, 360); - ds = new PenroseLSystem(); - ds.simulate(4); -} - -void draw() { - background(0); - ds.render(); -} - - - - - - diff --git a/java/examples/Topics/Fractals and L-Systems/Pentigree/LSystem.pde b/java/examples/Topics/Fractals and L-Systems/Pentigree/LSystem.pde deleted file mode 100644 index 2adcabcd5..000000000 --- a/java/examples/Topics/Fractals and L-Systems/Pentigree/LSystem.pde +++ /dev/null @@ -1,76 +0,0 @@ -class LSystem { - - int steps = 0; - - String axiom; - String rule; - String production; - - float startLength; - float drawLength; - float theta; - - int generations; - - LSystem() { - - axiom = "F"; - rule = "F+F-F"; - startLength = 90.0; - theta = radians(120.0); - reset(); - } - - void reset() { - production = axiom; - drawLength = startLength; - generations = 0; - } - - int getAge() { - return generations; - } - - void render() { - translate(width/2, height/2); - steps += 5; - if (steps > production.length()) { - steps = production.length(); - } - for (int i = 0; i < steps; i++) { - char step = production.charAt(i); - if (step == 'F') { - rect(0, 0, -drawLength, -drawLength); - noFill(); - translate(0, -drawLength); - } - else if (step == '+') { - rotate(theta); - } - else if (step == '-') { - rotate(-theta); - } - else if (step == '[') { - pushMatrix(); - } - else if (step == ']') { - popMatrix(); - } - } - } - - void simulate(int gen) { - while (getAge() < gen) { - production = iterate(production, rule); - } - } - - String iterate(String prod_, String rule_) { - drawLength = drawLength * 0.6; - generations++; - String newProduction = prod_; - newProduction = newProduction.replaceAll("F", rule_); - return newProduction; - } -} - diff --git a/java/examples/Topics/Fractals and L-Systems/Pentigree/Pentigree.pde b/java/examples/Topics/Fractals and L-Systems/Pentigree/Pentigree.pde deleted file mode 100644 index a58ee50ac..000000000 --- a/java/examples/Topics/Fractals and L-Systems/Pentigree/Pentigree.pde +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Pentigree L-System - * by Geraldine Sarmiento. - * - * This code was based on Patrick Dwyer's L-System class. - */ - - -PentigreeLSystem ps; - -void setup() { - size(640, 360); - ps = new PentigreeLSystem(); - ps.simulate(3); -} - -void draw() { - background(0); - ps.render(); -} - diff --git a/java/examples/Topics/Fractals and L-Systems/Pentigree/PentigreeLSystem.pde b/java/examples/Topics/Fractals and L-Systems/Pentigree/PentigreeLSystem.pde deleted file mode 100644 index a377c016d..000000000 --- a/java/examples/Topics/Fractals and L-Systems/Pentigree/PentigreeLSystem.pde +++ /dev/null @@ -1,71 +0,0 @@ -class PentigreeLSystem extends LSystem { - - int steps = 0; - float somestep = 0.1; - float xoff = 0.01; - - PentigreeLSystem() { - axiom = "F-F-F-F-F"; - rule = "F-F++F+F-F-F"; - startLength = 60.0; - theta = radians(72); - reset(); - } - - void useRule(String r_) { - rule = r_; - } - - void useAxiom(String a_) { - axiom = a_; - } - - void useLength(float l_) { - startLength = l_; - } - - void useTheta(float t_) { - theta = radians(t_); - } - - void reset() { - production = axiom; - drawLength = startLength; - generations = 0; - } - - int getAge() { - return generations; - } - - void render() { - translate(width/4, height/2); - steps += 3; - if (steps > production.length()) { - steps = production.length(); - } - - for (int i = 0; i < steps; i++) { - char step = production.charAt(i); - if (step == 'F') { - noFill(); - stroke(255); - line(0, 0, 0, -drawLength); - translate(0, -drawLength); - } - else if (step == '+') { - rotate(theta); - } - else if (step == '-') { - rotate(-theta); - } - else if (step == '[') { - pushMatrix(); - } - else if (step == ']') { - popMatrix(); - } - } - } - -} diff --git a/java/examples/Topics/Fractals and L-Systems/Tree/Tree.pde b/java/examples/Topics/Fractals and L-Systems/Tree/Tree.pde deleted file mode 100644 index aafb31049..000000000 --- a/java/examples/Topics/Fractals and L-Systems/Tree/Tree.pde +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Recursive Tree - * by Daniel Shiffman. - * - * Renders a simple tree-like structure via recursion. - * The branching angle is calculated as a function of - * the horizontal mouse location. Move the mouse left - * and right to change the angle. - */ - -float theta; - -void setup() { - size(640, 360); -} - -void draw() { - background(0); - frameRate(30); - stroke(255); - // Let's pick an angle 0 to 90 degrees based on the mouse position - float a = (mouseX / (float) width) * 90f; - // Convert it to radians - theta = radians(a); - // Start the tree from the bottom of the screen - translate(width/2,height); - // Draw a line 120 pixels - line(0,0,0,-120); - // Move to the end of that line - translate(0,-120); - // Start the recursive branching! - branch(120); - -} - -void branch(float h) { - // Each branch will be 2/3rds the size of the previous one - h *= 0.66; - - // All recursive functions must have an exit condition!!!! - // Here, ours is when the length of the branch is 2 pixels or less - if (h > 2) { - pushMatrix(); // Save the current state of transformation (i.e. where are we now) - rotate(theta); // Rotate by theta - line(0, 0, 0, -h); // Draw the branch - translate(0, -h); // Move to the end of the branch - branch(h); // Ok, now call myself to draw two new branches!! - popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state - - // Repeat the same thing, only branch off to the "left" this time! - pushMatrix(); - rotate(-theta); - line(0, 0, 0, -h); - translate(0, -h); - branch(h); - popMatrix(); - } -} - - diff --git a/java/examples/Topics/GUI/Button/Button.pde b/java/examples/Topics/GUI/Button/Button.pde deleted file mode 100644 index 4b8a536cc..000000000 --- a/java/examples/Topics/GUI/Button/Button.pde +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Button. - * - * Click on one of the colored squares in the - * center of the image to change the color of - * the background. - */ - -int rectX, rectY; // Position of square button -int circleX, circleY; // Position of circle button -int rectSize = 90; // Diameter of rect -int circleSize = 93; // Diameter of circle -color rectColor, circleColor, baseColor; -color rectHighlight, circleHighlight; -color currentColor; -boolean rectOver = false; -boolean circleOver = false; - -void setup() { - size(640, 360); - rectColor = color(0); - rectHighlight = color(51); - circleColor = color(255); - circleHighlight = color(204); - baseColor = color(102); - currentColor = baseColor; - circleX = width/2+circleSize/2+10; - circleY = height/2; - rectX = width/2-rectSize-10; - rectY = height/2-rectSize/2; - ellipseMode(CENTER); -} - -void draw() { - update(mouseX, mouseY); - background(currentColor); - - if (rectOver) { - fill(rectHighlight); - } else { - fill(rectColor); - } - stroke(255); - rect(rectX, rectY, rectSize, rectSize); - - if (circleOver) { - fill(circleHighlight); - } else { - fill(circleColor); - } - stroke(0); - ellipse(circleX, circleY, circleSize, circleSize); -} - -void update(int x, int y) { - if ( overCircle(circleX, circleY, circleSize) ) { - circleOver = true; - rectOver = false; - } else if ( overRect(rectX, rectY, rectSize, rectSize) ) { - rectOver = true; - circleOver = false; - } else { - circleOver = rectOver = false; - } -} - -void mousePressed() { - if (circleOver) { - currentColor = circleColor; - } - if (rectOver) { - currentColor = rectColor; - } -} - -boolean overRect(int x, int y, int width, int height) { - if (mouseX >= x && mouseX <= x+width && - mouseY >= y && mouseY <= y+height) { - return true; - } else { - return false; - } -} - -boolean overCircle(int x, int y, int diameter) { - float disX = x - mouseX; - float disY = y - mouseY; - if (sqrt(sq(disX) + sq(disY)) < diameter/2 ) { - return true; - } else { - return false; - } -} diff --git a/java/examples/Topics/GUI/Handles/Handles.pde b/java/examples/Topics/GUI/Handles/Handles.pde deleted file mode 100644 index f2c9626f3..000000000 --- a/java/examples/Topics/GUI/Handles/Handles.pde +++ /dev/null @@ -1,127 +0,0 @@ -/** - * Handles. - * - * Click and drag the white boxes to change their position. - */ - -Handle[] handles; - -void setup() { - size(640, 360); - int num = height/15; - handles = new Handle[num]; - int hsize = 10; - for (int i = 0; i < handles.length; i++) { - handles[i] = new Handle(width/2, 10+i*15, 50-hsize/2, 10, handles); - } -} - -void draw() { - background(153); - - for (int i = 0; i < handles.length; i++) { - handles[i].update(); - handles[i].display(); - } - - fill(0); - rect(0, 0, width/2, height); -} - -void mouseReleased() { - for (int i = 0; i < handles.length; i++) { - handles[i].releaseEvent(); - } -} - -class Handle { - - int x, y; - int boxx, boxy; - int stretch; - int size; - boolean over; - boolean press; - boolean locked = false; - boolean otherslocked = false; - Handle[] others; - - Handle(int ix, int iy, int il, int is, Handle[] o) { - x = ix; - y = iy; - stretch = il; - size = is; - boxx = x+stretch - size/2; - boxy = y - size/2; - others = o; - } - - void update() { - boxx = x+stretch; - boxy = y - size/2; - - for (int i=0; i= x && mouseX <= x+width && - mouseY >= y && mouseY <= y+height) { - return true; - } else { - return false; - } -} - -int lock(int val, int minv, int maxv) { - return min(max(val, minv), maxv); -} diff --git a/java/examples/Topics/GUI/Rollover/Rollover.pde b/java/examples/Topics/GUI/Rollover/Rollover.pde deleted file mode 100644 index a7e3f27b3..000000000 --- a/java/examples/Topics/GUI/Rollover/Rollover.pde +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Rollover. - * - * Roll over the colored squares in the center of the image - * to change the color of the outside rectangle. - */ - - -int rectX, rectY; // Position of square button -int circleX, circleY; // Position of circle button -int rectSize = 90; // Diameter of rect -int circleSize = 93; // Diameter of circle - -color rectColor; -color circleColor; -color baseColor; - -boolean rectOver = false; -boolean circleOver = false; - -void setup() { - size(640, 360); - rectColor = color(0); - circleColor = color(255); - baseColor = color(102); - circleX = width/2+circleSize/2+10; - circleY = height/2; - rectX = width/2-rectSize-10; - rectY = height/2-rectSize/2; - ellipseMode(CENTER); -} - -void draw() { - update(mouseX, mouseY); - - noStroke(); - if (rectOver) { - background(rectColor); - } else if (circleOver) { - background(circleColor); - } else { - background(baseColor); - } - - stroke(255); - fill(rectColor); - rect(rectX, rectY, rectSize, rectSize); - stroke(0); - fill(circleColor); - ellipse(circleX, circleY, circleSize, circleSize); -} - -void update(int x, int y) { - if( overCircle(circleX, circleY, circleSize) ) { - circleOver = true; - rectOver = false; - } else if ( overRect(rectX, rectY, rectSize, rectSize) ) { - rectOver = true; - circleOver = false; - } else { - circleOver = rectOver = false; - } -} - -boolean overRect(int x, int y, int width, int height) { - if (mouseX >= x && mouseX <= x+width && - mouseY >= y && mouseY <= y+height) { - return true; - } else { - return false; - } -} - -boolean overCircle(int x, int y, int diameter) { - float disX = x - mouseX; - float disY = y - mouseY; - if(sqrt(sq(disX) + sq(disY)) < diameter/2 ) { - return true; - } else { - return false; - } -} diff --git a/java/examples/Topics/GUI/Scrollbar/Scrollbar.pde b/java/examples/Topics/GUI/Scrollbar/Scrollbar.pde deleted file mode 100644 index 453f009cc..000000000 --- a/java/examples/Topics/GUI/Scrollbar/Scrollbar.pde +++ /dev/null @@ -1,126 +0,0 @@ -/** - * Scrollbar. - * - * Move the scrollbars left and right to change the positions of the images. - */ - - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="seedTop.jpg,seedBottom.jpg"; */ - - -HScrollbar hs1, hs2; // Two scrollbars -PImage img1, img2; // Two images to load - -void setup() { - size(640, 360); - noStroke(); - - hs1 = new HScrollbar(0, height/2-8, width, 16, 16); - hs2 = new HScrollbar(0, height/2+8, width, 16, 16); - - // Load images - img1 = loadImage("seedTop.jpg"); - img2 = loadImage("seedBottom.jpg"); -} - -void draw() { - background(255); - - // Get the position of the img1 scrollbar - // and convert to a value to display the img1 image - float img1Pos = hs1.getPos()-width/2; - fill(255); - image(img1, width/2-img1.width/2 + img1Pos*1.5, 0); - - // Get the position of the img2 scrollbar - // and convert to a value to display the img2 image - float img2Pos = hs2.getPos()-width/2; - fill(255); - image(img2, width/2-img2.width/2 + img2Pos*1.5, height/2); - - hs1.update(); - hs2.update(); - hs1.display(); - hs2.display(); - - stroke(0); - line(0, height/2, width, height/2); -} - - -class HScrollbar { - int swidth, sheight; // width and height of bar - float xpos, ypos; // x and y position of bar - float spos, newspos; // x position of slider - float sposMin, sposMax; // max and min values of slider - int loose; // how loose/heavy - boolean over; // is the mouse over the slider? - boolean locked; - float ratio; - - HScrollbar (float xp, float yp, int sw, int sh, int l) { - swidth = sw; - sheight = sh; - int widthtoheight = sw - sh; - ratio = (float)sw / (float)widthtoheight; - xpos = xp; - ypos = yp-sheight/2; - spos = xpos + swidth/2 - sheight/2; - newspos = spos; - sposMin = xpos; - sposMax = xpos + swidth - sheight; - loose = l; - } - - void update() { - if (overEvent()) { - over = true; - } else { - over = false; - } - if (mousePressed && over) { - locked = true; - } - if (!mousePressed) { - locked = false; - } - if (locked) { - newspos = constrain(mouseX-sheight/2, sposMin, sposMax); - } - if (abs(newspos - spos) > 1) { - spos = spos + (newspos-spos)/loose; - } - } - - float constrain(float val, float minv, float maxv) { - return min(max(val, minv), maxv); - } - - boolean overEvent() { - if (mouseX > xpos && mouseX < xpos+swidth && - mouseY > ypos && mouseY < ypos+sheight) { - return true; - } else { - return false; - } - } - - void display() { - noStroke(); - fill(204); - rect(xpos, ypos, swidth, sheight); - if (over || locked) { - fill(0, 0, 0); - } else { - fill(102, 102, 102); - } - rect(spos, ypos, sheight, sheight); - } - - float getPos() { - // Convert spos to be values between - // 0 and the total width of the scrollbar - return spos * ratio; - } -} diff --git a/java/examples/Topics/Geometry/Icosahedra/Dimension3D.pde b/java/examples/Topics/Geometry/Icosahedra/Dimension3D.pde deleted file mode 100644 index 90c949967..000000000 --- a/java/examples/Topics/Geometry/Icosahedra/Dimension3D.pde +++ /dev/null @@ -1,10 +0,0 @@ -class Dimension3D{ - float w, h, d; - - Dimension3D(float w, float h, float d){ - this.w=w; - this.h=h; - this.d=d; - } -} - diff --git a/java/examples/Topics/Geometry/Icosahedra/Icosahedra.pde b/java/examples/Topics/Geometry/Icosahedra/Icosahedra.pde deleted file mode 100644 index 0c046b726..000000000 --- a/java/examples/Topics/Geometry/Icosahedra/Icosahedra.pde +++ /dev/null @@ -1,52 +0,0 @@ -/** - * I Like Icosahedra - * by Ira Greenberg. - * - * This example plots icosahedra. The Icosahdron is a regular - * polyhedron composed of twenty equalateral triangles. - */ - -Icosahedron ico1; -Icosahedron ico2; -Icosahedron ico3; - -void setup(){ - size(640, 360, P3D); - ico1 = new Icosahedron(75); - ico2 = new Icosahedron(75); - ico3 = new Icosahedron(75); -} - -void draw(){ - background(0); - lights(); - translate(width/2, height/2); - - pushMatrix(); - translate(-width/3.5, 0); - rotateX(frameCount*PI/185); - rotateY(frameCount*PI/-200); - stroke(170, 0, 0); - noFill(); - ico1.create(); - popMatrix(); - - pushMatrix(); - rotateX(frameCount*PI/200); - rotateY(frameCount*PI/300); - stroke(150, 0, 180); - fill(170, 170, 0); - ico2.create(); - popMatrix(); - - pushMatrix(); - translate(width/3.5, 0); - rotateX(frameCount*PI/-200); - rotateY(frameCount*PI/200); - noStroke(); - fill(0, 0, 185); - ico3.create(); - popMatrix(); -} - - diff --git a/java/examples/Topics/Geometry/Icosahedra/Icosahedron.pde b/java/examples/Topics/Geometry/Icosahedra/Icosahedron.pde deleted file mode 100644 index 3a7f89453..000000000 --- a/java/examples/Topics/Geometry/Icosahedra/Icosahedron.pde +++ /dev/null @@ -1,159 +0,0 @@ -class Icosahedron extends Shape3D{ - - // icosahedron - PVector topPoint; - PVector[] topPent = new PVector[5]; - PVector bottomPoint; - PVector[] bottomPent = new PVector[5]; - float angle = 0, radius = 150; - float triDist; - float triHt; - float a, b, c; - - // constructor - Icosahedron(float radius){ - this.radius = radius; - init(); - } - - Icosahedron(PVector v, float radius){ - super(v); - this.radius = radius; - init(); - } - - // calculate geometry - void init(){ - c = dist(cos(0)*radius, sin(0)*radius, cos(radians(72))*radius, sin(radians(72))*radius); - b = radius; - a = (float)(Math.sqrt(((c*c)-(b*b)))); - - triHt = (float)(Math.sqrt((c*c)-((c/2)*(c/2)))); - - for (int i=0; i 0.01) { - xmag -= diff/4.0; - } - - diff = ymag-newYmag; - if (abs(diff) > 0.01) { - ymag -= diff/4.0; - } - - rotateX(-ymag); - rotateY(-xmag); - - scale(90); - beginShape(QUADS); - - fill(0, 1, 1); vertex(-1, 1, 1); - fill(1, 1, 1); vertex( 1, 1, 1); - fill(1, 0, 1); vertex( 1, -1, 1); - fill(0, 0, 1); vertex(-1, -1, 1); - - fill(1, 1, 1); vertex( 1, 1, 1); - fill(1, 1, 0); vertex( 1, 1, -1); - fill(1, 0, 0); vertex( 1, -1, -1); - fill(1, 0, 1); vertex( 1, -1, 1); - - fill(1, 1, 0); vertex( 1, 1, -1); - fill(0, 1, 0); vertex(-1, 1, -1); - fill(0, 0, 0); vertex(-1, -1, -1); - fill(1, 0, 0); vertex( 1, -1, -1); - - fill(0, 1, 0); vertex(-1, 1, -1); - fill(0, 1, 1); vertex(-1, 1, 1); - fill(0, 0, 1); vertex(-1, -1, 1); - fill(0, 0, 0); vertex(-1, -1, -1); - - fill(0, 1, 0); vertex(-1, 1, -1); - fill(1, 1, 0); vertex( 1, 1, -1); - fill(1, 1, 1); vertex( 1, 1, 1); - fill(0, 1, 1); vertex(-1, 1, 1); - - fill(0, 0, 0); vertex(-1, -1, -1); - fill(1, 0, 0); vertex( 1, -1, -1); - fill(1, 0, 1); vertex( 1, -1, 1); - fill(0, 0, 1); vertex(-1, -1, 1); - - endShape(); - - popMatrix(); -} diff --git a/java/examples/Topics/Geometry/ShapeTransform/ShapeTransform.pde b/java/examples/Topics/Geometry/ShapeTransform/ShapeTransform.pde deleted file mode 100644 index c779a3a1a..000000000 --- a/java/examples/Topics/Geometry/ShapeTransform/ShapeTransform.pde +++ /dev/null @@ -1,116 +0,0 @@ -/** - * Shape Transform - * by Ira Greenberg. - * - * Illustrates the geometric relationship - * between Cube, Pyramid, Cone and - * Cylinder 3D primitives. - * - * Instructions:
- * Up Arrow - increases points
- * Down Arrow - decreases points
- * 'p' key toggles between cube/pyramid
- */ - -int pts = 4; -float angle = 0; -float radius = 99; -float cylinderLength = 95; - -//vertices -PVector vertices[][]; -boolean isPyramid = false; - -float angleInc; - -void setup(){ - size(640, 360, P3D); - noStroke(); - angleInc = PI/300.0; -} - -void draw(){ - background(170, 95, 95); - lights(); - fill(255, 200, 200); - translate(width/2, height/2); - rotateX(frameCount * angleInc); - rotateY(frameCount * angleInc); - rotateZ(frameCount * angleInc); - - // initialize vertex arrays - vertices = new PVector[2][pts+1]; - - // fill arrays - for (int i = 0; i < 2; i++){ - angle = 0; - for(int j = 0; j <= pts; j++){ - vertices[i][j] = new PVector(); - if (isPyramid){ - if (i==1){ - vertices[i][j].x = 0; - vertices[i][j].y = 0; - } - else { - vertices[i][j].x = cos(radians(angle)) * radius; - vertices[i][j].y = sin(radians(angle)) * radius; - } - } - else { - vertices[i][j].x = cos(radians(angle)) * radius; - vertices[i][j].y = sin(radians(angle)) * radius; - } - vertices[i][j].z = cylinderLength; - // the .0 after the 360 is critical - angle += 360.0/pts; - } - cylinderLength *= -1; - } - - // draw cylinder tube - beginShape(QUAD_STRIP); - for(int j = 0; j <= pts; j++){ - vertex(vertices[0][j].x, vertices[0][j].y, vertices[0][j].z); - vertex(vertices[1][j].x, vertices[1][j].y, vertices[1][j].z); - } - endShape(); - - //draw cylinder ends - for (int i = 0; i < 2; i++){ - beginShape(); - for(int j = 0; j < pts; j++){ - vertex(vertices[i][j].x, vertices[i][j].y, vertices[i][j].z); - } - endShape(CLOSE); - } -} - - -/* - up/down arrow keys control - polygon detail. - */ -void keyPressed(){ - if(key == CODED) { - // pts - if (keyCode == UP) { - if (pts < 90){ - pts++; - } - } - else if (keyCode == DOWN) { - if (pts > 4){ - pts--; - } - } - } - if (key =='p'){ - if (isPyramid){ - isPyramid = false; - } - else { - isPyramid = true; - } - } -} - diff --git a/java/examples/Topics/Geometry/SpaceJunk/Cube.pde b/java/examples/Topics/Geometry/SpaceJunk/Cube.pde deleted file mode 100644 index 121b33f9b..000000000 --- a/java/examples/Topics/Geometry/SpaceJunk/Cube.pde +++ /dev/null @@ -1,67 +0,0 @@ - -class Cube { - - // Properties - int w, h, d; - int shiftX, shiftY, shiftZ; - - // Constructor - Cube(int w, int h, int d, int shiftX, int shiftY, int shiftZ){ - this.w = w; - this.h = h; - this.d = d; - this.shiftX = shiftX; - this.shiftY = shiftY; - this.shiftZ = shiftZ; - } - - // Main cube drawing method, which looks - // more confusing than it really is. It's - // just a bunch of rectangles drawn for - // each cube face - void drawCube(){ - beginShape(QUADS); - // Front face - vertex(-w/2 + shiftX, -h/2 + shiftY, -d/2 + shiftZ); - vertex(w + shiftX, -h/2 + shiftY, -d/2 + shiftZ); - vertex(w + shiftX, h + shiftY, -d/2 + shiftZ); - vertex(-w/2 + shiftX, h + shiftY, -d/2 + shiftZ); - - // Back face - vertex(-w/2 + shiftX, -h/2 + shiftY, d + shiftZ); - vertex(w + shiftX, -h/2 + shiftY, d + shiftZ); - vertex(w + shiftX, h + shiftY, d + shiftZ); - vertex(-w/2 + shiftX, h + shiftY, d + shiftZ); - - // Left face - vertex(-w/2 + shiftX, -h/2 + shiftY, -d/2 + shiftZ); - vertex(-w/2 + shiftX, -h/2 + shiftY, d + shiftZ); - vertex(-w/2 + shiftX, h + shiftY, d + shiftZ); - vertex(-w/2 + shiftX, h + shiftY, -d/2 + shiftZ); - - // Right face - vertex(w + shiftX, -h/2 + shiftY, -d/2 + shiftZ); - vertex(w + shiftX, -h/2 + shiftY, d + shiftZ); - vertex(w + shiftX, h + shiftY, d + shiftZ); - vertex(w + shiftX, h + shiftY, -d/2 + shiftZ); - - // Top face - vertex(-w/2 + shiftX, -h/2 + shiftY, -d/2 + shiftZ); - vertex(w + shiftX, -h/2 + shiftY, -d/2 + shiftZ); - vertex(w + shiftX, -h/2 + shiftY, d + shiftZ); - vertex(-w/2 + shiftX, -h/2 + shiftY, d + shiftZ); - - // Bottom face - vertex(-w/2 + shiftX, h + shiftY, -d/2 + shiftZ); - vertex(w + shiftX, h + shiftY, -d/2 + shiftZ); - vertex(w + shiftX, h + shiftY, d + shiftZ); - vertex(-w/2 + shiftX, h + shiftY, d + shiftZ); - - endShape(); - - // Add some rotation to each box for pizazz. - rotateY(radians(1)); - rotateX(radians(1)); - rotateZ(radians(1)); - } -} diff --git a/java/examples/Topics/Geometry/SpaceJunk/SpaceJunk.pde b/java/examples/Topics/Geometry/SpaceJunk/SpaceJunk.pde deleted file mode 100644 index d13b5dc33..000000000 --- a/java/examples/Topics/Geometry/SpaceJunk/SpaceJunk.pde +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Space Junk - * by Ira Greenberg (zoom suggestion by Danny Greenberg). - * - * Rotating cubes in space using a custom Cube class. - * Color controlled by light sources. Move the mouse left - * and right to zoom. - */ - -// Used for oveall rotation -float angle; - -// Cube count-lower/raise to test performance -int limit = 500; - -// Array for all cubes -Cube[] cubes = new Cube[limit]; - -void setup() { - size(640, 360, P3D); - background(0); - noStroke(); - - // Instantiate cubes, passing in random vals for size and postion - for (int i = 0; i < cubes.length; i++){ - cubes[i] = new Cube(int(random(-10, 10)), int(random(-10, 10)), - int(random(-10, 10)), int(random(-140, 140)), - int(random(-140, 140)), int(random(-140, 140))); - } -} - -void draw(){ - background(0); - fill(200); - - // Set up some different colored lights - pointLight(51, 102, 255, 65, 60, 100); - pointLight(200, 40, 60, -65, -60, -150); - - // Raise overall light in scene - ambientLight(70, 70, 10); - - // Center geometry in display windwow. - // you can changlee 3rd argument ('0') - // to move block group closer(+) / further(-) - translate(width/2, height/2, -200 + mouseX * 0.65); - - // Rotate around y and x axes - rotateY(radians(angle)); - rotateX(radians(angle)); - - // Draw cubes - for (int i = 0; i < cubes.length; i++){ - cubes[i].drawCube(); - } - - // Used in rotate function calls above - angle += 0.2; -} - - diff --git a/java/examples/Topics/Geometry/Toroid/Toroid.pde b/java/examples/Topics/Geometry/Toroid/Toroid.pde deleted file mode 100644 index f79a8d174..000000000 --- a/java/examples/Topics/Geometry/Toroid/Toroid.pde +++ /dev/null @@ -1,182 +0,0 @@ -/** - * Interactive Toroid - * by Ira Greenberg. - * - * Illustrates the geometric relationship between Toroid, Sphere, and Helix - * 3D primitives, as well as lathing principal. - * - * Instructions:
- * UP arrow key pts++
- * DOWN arrow key pts--
- * LEFT arrow key segments--
- * RIGHT arrow key segments++
- * 'a' key toroid radius--
- * 's' key toroid radius++
- * 'z' key initial polygon radius--
- * 'x' key initial polygon radius++
- * 'w' key toggle wireframe/solid shading
- * 'h' key toggle sphere/helix
- */ - -int pts = 40; -float angle = 0; -float radius = 60.0; - -// lathe segments -int segments = 60; -float latheAngle = 0; -float latheRadius = 100.0; - -//vertices -PVector vertices[], vertices2[]; - -// for shaded or wireframe rendering -boolean isWireFrame = false; - -// for optional helix -boolean isHelix = false; -float helixOffset = 5.0; - -void setup(){ - size(640, 360, P3D); -} - -void draw(){ - background(50, 64, 42); - // basic lighting setup - lights(); - // 2 rendering styles - // wireframe or solid - if (isWireFrame){ - stroke(255, 255, 150); - noFill(); - } - else { - noStroke(); - fill(150, 195, 125); - } - //center and spin toroid - translate(width/2, height/2, -100); - - rotateX(frameCount*PI/150); - rotateY(frameCount*PI/170); - rotateZ(frameCount*PI/90); - - // initialize point arrays - vertices = new PVector[pts+1]; - vertices2 = new PVector[pts+1]; - - // fill arrays - for(int i=0; i<=pts; i++){ - vertices[i] = new PVector(); - vertices2[i] = new PVector(); - vertices[i].x = latheRadius + sin(radians(angle))*radius; - if (isHelix){ - vertices[i].z = cos(radians(angle))*radius-(helixOffset* - segments)/2; - } - else{ - vertices[i].z = cos(radians(angle))*radius; - } - angle+=360.0/pts; - } - - // draw toroid - latheAngle = 0; - for(int i=0; i<=segments; i++){ - beginShape(QUAD_STRIP); - for(int j=0; j<=pts; j++){ - if (i>0){ - vertex(vertices2[j].x, vertices2[j].y, vertices2[j].z); - } - vertices2[j].x = cos(radians(latheAngle))*vertices[j].x; - vertices2[j].y = sin(radians(latheAngle))*vertices[j].x; - vertices2[j].z = vertices[j].z; - // optional helix offset - if (isHelix){ - vertices[j].z+=helixOffset; - } - vertex(vertices2[j].x, vertices2[j].y, vertices2[j].z); - } - // create extra rotation for helix - if (isHelix){ - latheAngle+=720.0/segments; - } - else { - latheAngle+=360.0/segments; - } - endShape(); - } -} - -/* - left/right arrow keys control ellipse detail - up/down arrow keys control segment detail. - 'a','s' keys control lathe radius - 'z','x' keys control ellipse radius - 'w' key toggles between wireframe and solid - 'h' key toggles between toroid and helix - */ -void keyPressed(){ - if(key == CODED) { - // pts - if (keyCode == UP) { - if (pts<40){ - pts++; - } - } - else if (keyCode == DOWN) { - if (pts>3){ - pts--; - } - } - // extrusion length - if (keyCode == LEFT) { - if (segments>3){ - segments--; - } - } - else if (keyCode == RIGHT) { - if (segments<80){ - segments++; - } - } - } - // lathe radius - if (key =='a'){ - if (latheRadius>0){ - latheRadius--; - } - } - else if (key == 's'){ - latheRadius++; - } - // ellipse radius - if (key =='z'){ - if (radius>10){ - radius--; - } - } - else if (key == 'x'){ - radius++; - } - // wireframe - if (key =='w'){ - if (isWireFrame){ - isWireFrame=false; - } - else { - isWireFrame=true; - } - } - // helix - if (key =='h'){ - if (isHelix){ - isHelix=false; - } - else { - isHelix=true; - } - } -} - diff --git a/java/examples/Topics/Geometry/Vertices/Vertices.pde b/java/examples/Topics/Geometry/Vertices/Vertices.pde deleted file mode 100644 index 5609ff94f..000000000 --- a/java/examples/Topics/Geometry/Vertices/Vertices.pde +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Vertices - * by Simon Greenwold. - * - * Draw a cylinder centered on the y-axis, going down - * from y=0 to y=height. The radius at the top can be - * different from the radius at the bottom, and the - * number of sides drawn is variable. - */ - -void setup() { - size(640, 360, P3D); -} - -void draw() { - background(0); - lights(); - translate(width / 2, height / 2); - rotateY(map(mouseX, 0, width, 0, PI)); - rotateZ(map(mouseY, 0, height, 0, -PI)); - noStroke(); - fill(255, 255, 255); - translate(0, -40, 0); - drawCylinder(10, 180, 200, 16); // Draw a mix between a cylinder and a cone - //drawCylinder(70, 70, 120, 64); // Draw a cylinder - //drawCylinder(0, 180, 200, 4); // Draw a pyramid -} - -void drawCylinder(float topRadius, float bottomRadius, float tall, int sides) { - float angle = 0; - float angleIncrement = TWO_PI / sides; - beginShape(QUAD_STRIP); - for (int i = 0; i < sides + 1; ++i) { - vertex(topRadius*cos(angle), 0, topRadius*sin(angle)); - vertex(bottomRadius*cos(angle), tall, bottomRadius*sin(angle)); - angle += angleIncrement; - } - endShape(); - - // If it is not a cone, draw the circular top cap - if (topRadius != 0) { - angle = 0; - beginShape(TRIANGLE_FAN); - - // Center point - vertex(0, 0, 0); - for (int i = 0; i < sides + 1; i++) { - vertex(topRadius * cos(angle), 0, topRadius * sin(angle)); - angle += angleIncrement; - } - endShape(); - } - - // If it is not a cone, draw the circular bottom cap - if (bottomRadius != 0) { - angle = 0; - beginShape(TRIANGLE_FAN); - - // Center point - vertex(0, tall, 0); - for (int i = 0; i < sides + 1; i++) { - vertex(bottomRadius * cos(angle), tall, bottomRadius * sin(angle)); - angle += angleIncrement; - } - endShape(); - } -} diff --git a/java/examples/Topics/Image Processing/Blending/Blending.pde b/java/examples/Topics/Image Processing/Blending/Blending.pde deleted file mode 100644 index 6cdb2501b..000000000 --- a/java/examples/Topics/Image Processing/Blending/Blending.pde +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Blending - * by Andres Colubri. - * - * Images can be blended using one of the 10 blending modes - * (currently available only in P2D and P3). - * Click to go to cycle through the modes. - */ - -// NOTE: THIS EXAMPLE IS IN PROGRESS -- REAS - -PImage img1, img2; -int selMode = REPLACE; -String name = "REPLACE"; -int picAlpha = 255; - -void setup() { - size(640, 360, P3D); - img1 = loadImage("layer1.jpg"); - img2 = loadImage("layer2.jpg"); - noStroke(); -} - -void draw() { - - picAlpha = int(map(mouseX, 0, width, 0, 255)); - - background(0); - - tint(255, 255); - image(img1, 0, 0); - - blendMode(selMode); - tint(255, picAlpha); - image(img2, 0, 0); - - blendMode(REPLACE); - fill(255); - rect(0, 0, 94, 22); - fill(0); - text(name, 10, 15); -} - -void mousePressed() { - - if (selMode == REPLACE) { - selMode = BLEND; - name = "BLEND"; - } else if (selMode == BLEND) { - selMode = ADD; - name = "ADD"; - } else if (selMode == ADD) { - selMode = SUBTRACT; - name = "SUBTRACT"; - } else if (selMode == SUBTRACT) { - selMode = LIGHTEST; - name = "LIGHTEST"; - } else if (selMode == LIGHTEST) { - selMode = DARKEST; - name = "DARKEST"; - } else if (selMode == DARKEST) { - selMode = DIFFERENCE; - name = "DIFFERENCE"; - } else if (selMode == DIFFERENCE) { - selMode = EXCLUSION; - name = "EXCLUSION"; - } else if (selMode == EXCLUSION) { - selMode = MULTIPLY; - name = "MULTIPLY"; - } else if (selMode == MULTIPLY) { - selMode = SCREEN; - name = "SCREEN"; - } else if (selMode == SCREEN) { - selMode = REPLACE; - name = "REPLACE"; - } -} - -void mouseDragged() { - if (height - 50 < mouseY) { - picAlpha = int(map(mouseX, 0, width, 0, 255)); - } -} diff --git a/java/examples/Topics/Image Processing/Blur/Blur.pde b/java/examples/Topics/Image Processing/Blur/Blur.pde deleted file mode 100644 index 86c89732d..000000000 --- a/java/examples/Topics/Image Processing/Blur/Blur.pde +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Blur. - * - * A low-pass filter blurs an image. This program analyzes every - * pixel in an image and blends it with the neighboring pixels - * to blur the image. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="moon.jpg"; */ - -float v = 1.0 / 9.0; -float[][] kernel = {{ v, v, v }, - { v, v, v }, - { v, v, v }}; - -PImage img; - -void setup() { - size(640, 360); - img = loadImage("moon.jpg"); // Load the original image - noLoop(); -} - -void draw() { - image(img, 0, 0); // Displays the image from point (0,0) - img.loadPixels(); - - // Create an opaque image of the same size as the original - PImage edgeImg = createImage(img.width, img.height, RGB); - - // Loop through every pixel in the image - for (int y = 1; y < img.height-1; y++) { // Skip top and bottom edges - for (int x = 1; x < img.width-1; x++) { // Skip left and right edges - float sum = 0; // Kernel sum for this pixel - for (int ky = -1; ky <= 1; ky++) { - for (int kx = -1; kx <= 1; kx++) { - // Calculate the adjacent pixel for this kernel point - int pos = (y + ky)*img.width + (x + kx); - // Image is grayscale, red/green/blue are identical - float val = red(img.pixels[pos]); - // Multiply adjacent pixels based on the kernel values - sum += kernel[ky+1][kx+1] * val; - } - } - // For this pixel in the new image, set the gray value - // based on the sum from the kernel - edgeImg.pixels[y*img.width + x] = color(sum); - } - } - // State that there are changes to edgeImg.pixels[] - edgeImg.updatePixels(); - - image(edgeImg, width/2, 0); // Draw the new image -} - diff --git a/java/examples/Topics/Image Processing/Brightness/Brightness.pde b/java/examples/Topics/Image Processing/Brightness/Brightness.pde deleted file mode 100644 index aee8d1ad4..000000000 --- a/java/examples/Topics/Image Processing/Brightness/Brightness.pde +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brightness - * by Daniel Shiffman. - * - * This program adjusts the brightness of a part of the image by - * calculating the distance of each pixel to the mouse. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="moon-wide.jpg"; */ - -PImage img; - -void setup() { - size(640, 360); - frameRate(30); - img = loadImage("moon-wide.jpg"); - img.loadPixels(); - // Only need to load the pixels[] array once, because we're only - // manipulating pixels[] inside draw(), not drawing shapes. - loadPixels(); -} - -void draw() { - for (int x = 0; x < img.width; x++) { - for (int y = 0; y < img.height; y++ ) { - // Calculate the 1D location from a 2D grid - int loc = x + y*img.width; - // Get the R,G,B values from image - float r,g,b; - r = red (img.pixels[loc]); - //g = green (img.pixels[loc]); - //b = blue (img.pixels[loc]); - // Calculate an amount to change brightness based on proximity to the mouse - float maxdist = 50;//dist(0,0,width,height); - float d = dist(x, y, mouseX, mouseY); - float adjustbrightness = 255*(maxdist-d)/maxdist; - r += adjustbrightness; - //g += adjustbrightness; - //b += adjustbrightness; - // Constrain RGB to make sure they are within 0-255 color range - r = constrain(r, 0, 255); - //g = constrain(g, 0, 255); - //b = constrain(b, 0, 255); - // Make a new color and set pixel in the window - //color c = color(r, g, b); - color c = color(r); - pixels[y*width + x] = c; - } - } - updatePixels(); -} diff --git a/java/examples/Topics/Image Processing/Convolution/Convolution.pde b/java/examples/Topics/Image Processing/Convolution/Convolution.pde deleted file mode 100644 index 40660c09f..000000000 --- a/java/examples/Topics/Image Processing/Convolution/Convolution.pde +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Convolution - * by Daniel Shiffman. - * - * Applies a convolution matrix to a portion of an image. Move mouse to - * apply filter to different parts of the image. This example is currently - * not accurate in JavaScript mode. - */ - - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="moon-wide.jpg"; */ - -PImage img; -int w = 120; - -// It's possible to convolve the image with many different -// matrices to produce different effects. This is a high-pass -// filter; it accentuates the edges. -float[][] matrix = { { -1, -1, -1 }, - { -1, 9, -1 }, - { -1, -1, -1 } }; - -void setup() { - size(640, 360); - img = loadImage("moon-wide.jpg"); -} - -void draw() { - // We're only going to process a portion of the image - // so let's set the whole image as the background first - image(img, 0, 0); - - // Calculate the small rectangle we will process - int xstart = constrain(mouseX - w/2, 0, img.width); - int ystart = constrain(mouseY - w/2, 0, img.height); - int xend = constrain(mouseX + w/2, 0, img.width); - int yend = constrain(mouseY + w/2, 0, img.height); - int matrixsize = 3; - loadPixels(); - // Begin our loop for every pixel in the smaller image - for (int x = xstart; x < xend; x++) { - for (int y = ystart; y < yend; y++ ) { - color c = convolution(x, y, matrix, matrixsize, img); - int loc = x + y*img.width; - pixels[loc] = c; - } - } - updatePixels(); -} - -color convolution(int x, int y, float[][] matrix, int matrixsize, PImage img) -{ - float rtotal = 0.0; - float gtotal = 0.0; - float btotal = 0.0; - int offset = matrixsize / 2; - for (int i = 0; i < matrixsize; i++){ - for (int j= 0; j < matrixsize; j++){ - // What pixel are we testing - int xloc = x+i-offset; - int yloc = y+j-offset; - int loc = xloc + img.width*yloc; - // Make sure we haven't walked off our image, we could do better here - loc = constrain(loc,0,img.pixels.length-1); - // Calculate the convolution - rtotal += (red(img.pixels[loc]) * matrix[i][j]); - gtotal += (green(img.pixels[loc]) * matrix[i][j]); - btotal += (blue(img.pixels[loc]) * matrix[i][j]); - } - } - // Make sure RGB is within range - rtotal = constrain(rtotal, 0, 255); - gtotal = constrain(gtotal, 0, 255); - btotal = constrain(btotal, 0, 255); - // Return the resulting color - return color(rtotal, gtotal, btotal); -} - diff --git a/java/examples/Topics/Image Processing/EdgeDetection/EdgeDetection.pde b/java/examples/Topics/Image Processing/EdgeDetection/EdgeDetection.pde deleted file mode 100644 index 48e2c3dd3..000000000 --- a/java/examples/Topics/Image Processing/EdgeDetection/EdgeDetection.pde +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Edge Detection. - * - * A high-pass filter sharpens an image. This program analyzes every - * pixel in an image in relation to the neighboring pixels to sharpen - * the image. This example is currently not accurate in JavaScript mode. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="moon.jpg"; */ - -float[][] kernel = {{ -1, -1, -1}, - { -1, 9, -1}, - { -1, -1, -1}}; - -PImage img; - -void setup() { - size(640, 360); - img = loadImage("moon.jpg"); // Load the original image - noLoop(); -} - -void draw() { - image(img, 0, 0); // Displays the image from point (0,0) - img.loadPixels(); - // Create an opaque image of the same size as the original - PImage edgeImg = createImage(img.width, img.height, RGB); - // Loop through every pixel in the image. - for (int y = 1; y < img.height-1; y++) { // Skip top and bottom edges - for (int x = 1; x < img.width-1; x++) { // Skip left and right edges - float sum = 0; // Kernel sum for this pixel - for (int ky = -1; ky <= 1; ky++) { - for (int kx = -1; kx <= 1; kx++) { - // Calculate the adjacent pixel for this kernel point - int pos = (y + ky)*img.width + (x + kx); - // Image is grayscale, red/green/blue are identical - float val = red(img.pixels[pos]); - // Multiply adjacent pixels based on the kernel values - sum += kernel[ky+1][kx+1] * val; - } - } - // For this pixel in the new image, set the gray value - // based on the sum from the kernel - edgeImg.pixels[y*img.width + x] = color(sum, sum, sum); - } - } - // State that there are changes to edgeImg.pixels[] - edgeImg.updatePixels(); - image(edgeImg, width/2, 0); // Draw the new image -} - diff --git a/java/examples/Topics/Image Processing/Explode/Explode.pde b/java/examples/Topics/Image Processing/Explode/Explode.pde deleted file mode 100644 index 491fea650..000000000 --- a/java/examples/Topics/Image Processing/Explode/Explode.pde +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Explode - * by Daniel Shiffman. - * - * Mouse horizontal location controls breaking apart of image and - * Maps pixels from a 2D image into 3D space. Pixel brightness controls - * translation along z axis. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="eames.jpg"; */ - -PImage img; // The source image -int cellsize = 2; // Dimensions of each cell in the grid -int columns, rows; // Number of columns and rows in our system - -void setup() { - size(640, 360, P3D); - img = loadImage("eames.jpg"); // Load the image - columns = img.width / cellsize; // Calculate # of columns - rows = img.height / cellsize; // Calculate # of rows -} - -void draw() { - background(0); - // Begin loop for columns - for ( int i = 0; i < columns; i++) { - // Begin loop for rows - for ( int j = 0; j < rows; j++) { - int x = i*cellsize + cellsize/2; // x position - int y = j*cellsize + cellsize/2; // y position - int loc = x + y*img.width; // Pixel array location - color c = img.pixels[loc]; // Grab the color - // Calculate a z position as a function of mouseX and pixel brightness - float z = (mouseX / float(width)) * brightness(img.pixels[loc]) - 20.0; - // Translate to the location, set fill and stroke, and draw the rect - pushMatrix(); - translate(x + 200, y + 100, z); - fill(c, 204); - noStroke(); - rectMode(CENTER); - rect(0, 0, cellsize, cellsize); - popMatrix(); - } - } -} diff --git a/java/examples/Topics/Image Processing/Extrusion/Extrusion.pde b/java/examples/Topics/Image Processing/Extrusion/Extrusion.pde deleted file mode 100755 index 7d3520dc4..000000000 --- a/java/examples/Topics/Image Processing/Extrusion/Extrusion.pde +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Extrusion. - * - * Converts a flat image into spatial data points and rotates the points - * around the center. - */ - -PImage a; -boolean onetime = true; -int[][] aPixels; -int[][] values; -float angle; - -void setup() { - size(640, 360, P3D); - - aPixels = new int[width][height]; - values = new int[width][height]; - noFill(); - - // Load the image into a new array - // Extract the values and store in an array - a = loadImage("ystone08.jpg"); - a.loadPixels(); - for (int i = 0; i < a.height; i++) { - for (int j = 0; j < a.width; j++) { - aPixels[j][i] = a.pixels[i*a.width + j]; - values[j][i] = int(blue(aPixels[j][i])); - } - } -} - -void draw() { - background(0); - translate(width/2, height/2, -height/2); - scale(2.0); - - // Update and constrain the angle - angle += 0.005; - rotateY(angle); - - // Display the image mass - for (int i = 0; i < a.height; i += 4) { - for (int j = 0; j < a.width; j += 4) { - stroke(values[j][i], 255); - line(j-a.width/2, i-a.height/2, -values[j][i], j-a.width/2, i-a.height/2, -values[j][i]-10); - } - } -} diff --git a/java/examples/Topics/Image Processing/Histogram/Histogram.pde b/java/examples/Topics/Image Processing/Histogram/Histogram.pde deleted file mode 100644 index c4ce73332..000000000 --- a/java/examples/Topics/Image Processing/Histogram/Histogram.pde +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Histogram. - * - * Calculates the histogram of an image. - * A histogram is the frequency distribution - * of the gray levels with the number of pure black values - * displayed on the left and number of pure white values on the right. - * - * Note that this sketch will behave differently on Android, - * since most images will no longer be full 24-bit color. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="frontier.jpg"; */ - -size(640, 360); - -// Load an image from the data directory -// Load a different image by modifying the comments -PImage img = loadImage("frontier.jpg"); -image(img, 0, 0); -int[] hist = new int[256]; - -// Calculate the histogram -for (int i = 0; i < img.width; i++) { - for (int j = 0; j < img.height; j++) { - int bright = int(brightness(get(i, j))); - hist[bright]++; - } -} - -// Find the largest value in the histogram -int histMax = max(hist); - -stroke(255); -// Draw half of the histogram (skip every second value) -for (int i = 0; i < img.width; i += 2) { - // Map i (from 0..img.width) to a location in the histogram (0..255) - int which = int(map(i, 0, img.width, 0, 255)); - // Convert the histogram value to a location between - // the bottom and the top of the picture - int y = int(map(hist[which], 0, histMax, img.height, 0)); - line(i, img.height, i, y); -} diff --git a/java/examples/Topics/Image Processing/LinearImage/LinearImage.pde b/java/examples/Topics/Image Processing/LinearImage/LinearImage.pde deleted file mode 100644 index f5ec79d9a..000000000 --- a/java/examples/Topics/Image Processing/LinearImage/LinearImage.pde +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Linear Image. - * - * Click and drag mouse up and down to control the signal. - * Press and hold any key to watch the scanning. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="sea.jpg"; */ - -PImage img; -int direction = 1; - -float signal; - -void setup() { - size(640, 360); - stroke(255); - img = loadImage("sea.jpg"); - img.loadPixels(); - loadPixels(); -} - -void draw() { - if (signal > img.height-1 || signal < 0) { - direction = direction * -1; - } - if (mousePressed == true) { - signal = abs(mouseY % img.height); - } - else { - signal += (0.3*direction); - } - - if (keyPressed == true) { - set(0, 0, img); - line(0, signal, img.width, signal); - } - else { - int signalOffset = int(signal)*img.width; - for (int y = 0; y < img.height; y++) { - arrayCopy(img.pixels, signalOffset, pixels, y*width, img.width); - } - updatePixels(); - } -} - diff --git a/java/examples/Topics/Image Processing/PixelArray/PixelArray.pde b/java/examples/Topics/Image Processing/PixelArray/PixelArray.pde deleted file mode 100644 index 75c89f212..000000000 --- a/java/examples/Topics/Image Processing/PixelArray/PixelArray.pde +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Pixel Array. - * - * Click and drag the mouse up and down to control the signal and - * press and hold any key to see the current pixel being read. - * This program sequentially reads the color of every pixel of an image - * and displays this color to fill the window. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="sea.jpg"; */ - -PImage img; -int direction = 1; -float signal; - -void setup() { - size(640, 360); - noFill(); - stroke(255); - frameRate(30); - img = loadImage("sea.jpg"); -} - -void draw() { - if (signal > img.width*img.height-1 || signal < 0) { - direction = direction * -1; - } - - if (mousePressed) { - int mx = constrain(mouseX, 0, img.width-1); - int my = constrain(mouseY, 0, img.height-1); - signal = my*img.width + mx; - } else { - signal += 0.33*direction; - } - - int sx = int(signal) % img.width; - int sy = int(signal) / img.width; - - if (keyPressed) { - set(0, 0, img); // fast way to draw an image - point(sx, sy); - rect(sx - 5, sy - 5, 10, 10); - } else { - color c = img.get(sx, sy); - background(c); - } -} diff --git a/java/examples/Topics/Image Processing/Zoom/Zoom.pde b/java/examples/Topics/Image Processing/Zoom/Zoom.pde deleted file mode 100644 index 9bf306ff7..000000000 --- a/java/examples/Topics/Image Processing/Zoom/Zoom.pde +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Zoom. - * - * Move the cursor over the image to alter its position. Click and press - * the mouse to zoom. This program displays a series of lines with their - * heights corresponding to a color value read from an image. - */ - -// The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="ystone08.jpg"; */ - -PImage img; -int[][] imgPixels; -float sval = 1.0; -float nmx, nmy; -int res = 5; - -void setup() { - size(640, 360, P3D); - noFill(); - stroke(255); - img = loadImage("ystone08.jpg"); - imgPixels = new int[img.width][img.height]; - for (int i = 0; i < img.height; i++) { - for (int j = 0; j < img.width; j++) { - imgPixels[j][i] = img.get(j, i); - } - } -} - -void draw() { - background(0); - - nmx += (mouseX-nmx)/20; - nmy += (mouseY-nmy)/20; - - if(mousePressed) { - sval += 0.005; - } - else { - sval -= 0.01; - } - - sval = constrain(sval, 1.0, 2.0); - - translate(width/2 + nmx * sval-100, height/2 + nmy*sval - 100, -50); - scale(sval); - rotateZ(PI/9 - sval + 1.0); - rotateX(PI/sval/8 - 0.125); - rotateY(sval/8 - 0.125); - - translate(-width/2, -height/2, 0); - - for (int i = 0; i < img.height; i += res) { - for (int j = 0; j < img.width; j += res) { - float rr = red(imgPixels[j][i]); - float gg = green(imgPixels[j][i]); - float bb = blue(imgPixels[j][i]); - float tt = rr+gg+bb; - stroke(rr, gg, gg); - line(i, j, tt/10-20, i, j, tt/10 ); - } - } -} - - - - - - diff --git a/java/examples/Topics/Interaction/Follow1/Follow1.pde b/java/examples/Topics/Interaction/Follow1/Follow1.pde deleted file mode 100644 index 7ba78c62c..000000000 --- a/java/examples/Topics/Interaction/Follow1/Follow1.pde +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Follow 1 - * based on code from Keith Peters. - * - * A line segment is pushed and pulled by the cursor. - */ - -float x = 100; -float y = 100; -float angle1 = 0.0; -float segLength = 50; - -void setup() { - size(640, 360); - strokeWeight(20.0); - stroke(255, 100); -} - -void draw() { - background(0); - - float dx = mouseX - x; - float dy = mouseY - y; - angle1 = atan2(dy, dx); - x = mouseX - (cos(angle1) * segLength); - y = mouseY - (sin(angle1) * segLength); - - segment(x, y, angle1); - ellipse(x, y, 20, 20); -} - -void segment(float x, float y, float a) { - pushMatrix(); - translate(x, y); - rotate(a); - line(0, 0, segLength, 0); - popMatrix(); -} diff --git a/java/examples/Topics/Interaction/Follow2/Follow2.pde b/java/examples/Topics/Interaction/Follow2/Follow2.pde deleted file mode 100644 index aeafe11df..000000000 --- a/java/examples/Topics/Interaction/Follow2/Follow2.pde +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Follow 2 - * based on code from Keith Peters. - * - * A two-segmented arm follows the cursor position. The relative - * angle between the segments is calculated with atan2() and the - * position calculated with sin() and cos(). - */ - -float[] x = new float[2]; -float[] y = new float[2]; -float segLength = 50; - -void setup() { - size(640, 360); - strokeWeight(20.0); - stroke(255, 100); -} - -void draw() { - background(0); - dragSegment(0, mouseX, mouseY); - dragSegment(1, x[0], y[0]); -} - -void dragSegment(int i, float xin, float yin) { - float dx = xin - x[i]; - float dy = yin - y[i]; - float angle = atan2(dy, dx); - x[i] = xin - cos(angle) * segLength; - y[i] = yin - sin(angle) * segLength; - segment(x[i], y[i], angle); -} - -void segment(float x, float y, float a) { - pushMatrix(); - translate(x, y); - rotate(a); - line(0, 0, segLength, 0); - popMatrix(); -} diff --git a/java/examples/Topics/Interaction/Follow3/Follow3.pde b/java/examples/Topics/Interaction/Follow3/Follow3.pde deleted file mode 100644 index 5df62c4e0..000000000 --- a/java/examples/Topics/Interaction/Follow3/Follow3.pde +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Follow 3 - * based on code from Keith Peters. - * - * A segmented line follows the mouse. The relative angle from - * each segment to the next is calculated with atan2() and the - * position of the next is calculated with sin() and cos(). - */ - -float[] x = new float[20]; -float[] y = new float[20]; -float segLength = 18; - -void setup() { - size(640, 360); - strokeWeight(9); - stroke(255, 100); -} - -void draw() { - background(0); - dragSegment(0, mouseX, mouseY); - for(int i=0; i=1; i--) { - positionSegment(i, i-1); - } - for(int i=0; i width-25 || ballX < 25) { - ballXDirection *= -1; - } - if(ballY > height-25 || ballY < 25) { - ballYDirection *= -1; - } - ellipse(ballX, ballY, 30, 30); - - reachSegment(0, ballX, ballY); - for(int i=1; i=1; i--) { - positionSegment(i, i-1); - } - for(int i=0; i width-rad || xpos < rad) { - xdirection *= -1; - } - if (ypos > height-rad || ypos < rad) { - ydirection *= -1; - } - - // Draw the shape - ellipse(xpos, ypos, rad, rad); -} diff --git a/java/examples/Topics/Motion/BouncyBubbles/BouncyBubbles.pde b/java/examples/Topics/Motion/BouncyBubbles/BouncyBubbles.pde deleted file mode 100644 index 0b3067d1b..000000000 --- a/java/examples/Topics/Motion/BouncyBubbles/BouncyBubbles.pde +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Bouncy Bubbles - * based on code from Keith Peters. - * - * Multiple-object collision. - */ - - -int numBalls = 12; -float spring = 0.05; -float gravity = 0.03; -float friction = -0.9; -Ball[] balls = new Ball[numBalls]; - -void setup() { - size(640, 360); - for (int i = 0; i < numBalls; i++) { - balls[i] = new Ball(random(width), random(height), random(30, 70), i, balls); - } - noStroke(); - fill(255, 204); -} - -void draw() { - background(0); - for (int i = 0; i < numBalls; i++) { - balls[i].collide(); - balls[i].move(); - balls[i].display(); - } -} - -class Ball { - - float x, y; - float diameter; - float vx = 0; - float vy = 0; - int id; - Ball[] others; - - Ball(float xin, float yin, float din, int idin, Ball[] oin) { - x = xin; - y = yin; - diameter = din; - id = idin; - others = oin; - } - - void collide() { - for (int i = id + 1; i < numBalls; i++) { - float dx = others[i].x - x; - float dy = others[i].y - y; - float distance = sqrt(dx*dx + dy*dy); - float minDist = others[i].diameter/2 + diameter/2; - if (distance < minDist) { - float angle = atan2(dy, dx); - float targetX = x + cos(angle) * minDist; - float targetY = y + sin(angle) * minDist; - float ax = (targetX - others[i].x) * spring; - float ay = (targetY - others[i].y) * spring; - vx -= ax; - vy -= ay; - others[i].vx += ax; - others[i].vy += ay; - } - } - } - - void move() { - vy += gravity; - x += vx; - y += vy; - if (x + diameter/2 > width) { - x = width - diameter/2; - vx *= friction; - } - else if (x - diameter/2 < 0) { - x = diameter/2; - vx *= friction; - } - if (y + diameter/2 > height) { - y = height - diameter/2; - vy *= friction; - } - else if (y - diameter/2 < 0) { - y = diameter/2; - vy *= friction; - } - } - - void display() { - ellipse(x, y, diameter, diameter); - } -} diff --git a/java/examples/Topics/Motion/Brownian/Brownian.pde b/java/examples/Topics/Motion/Brownian/Brownian.pde deleted file mode 100644 index 7f8daf978..000000000 --- a/java/examples/Topics/Motion/Brownian/Brownian.pde +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Brownian motion. - * - * Recording random movement as a continuous line. - */ - -int num = 2000; -int range = 6; - -float[] ax = new float[num]; -float[] ay = new float[num]; - - -void setup() -{ - size(640, 360); - for(int i = 0; i < num; i++) { - ax[i] = width/2; - ay[i] = height/2; - } - frameRate(30); -} - -void draw() -{ - background(51); - - // Shift all elements 1 place to the left - for(int i = 1; i < num; i++) { - ax[i-1] = ax[i]; - ay[i-1] = ay[i]; - } - - // Put a new value at the end of the array - ax[num-1] += random(-range, range); - ay[num-1] += random(-range, range); - - // Constrain all points to the screen - ax[num-1] = constrain(ax[num-1], 0, width); - ay[num-1] = constrain(ay[num-1], 0, height); - - // Draw a line connecting the points - for(int i=1; i width-r) { - position.x = width-r; - velocity.x *= -1; - } - else if (position.x < r) { - position.x = r; - velocity.x *= -1; - } - else if (position.y > height-r) { - position.y = height-r; - velocity.y *= -1; - } - else if (position.y < r) { - position.y = r; - velocity.y *= -1; - } - } - - void checkCollision(Ball other) { - - // get distances between the balls components - PVector bVect = PVector.sub(other.position, position); - - // calculate magnitude of the vector separating the balls - float bVectMag = bVect.mag(); - - if (bVectMag < r + other.r) { - // get angle of bVect - float theta = bVect.heading(); - // precalculate trig values - float sine = sin(theta); - float cosine = cos(theta); - - /* bTemp will hold rotated ball positions. You - just need to worry about bTemp[1] position*/ - PVector[] bTemp = { - new PVector(), new PVector() - }; - - /* this ball's position is relative to the other - so you can use the vector between them (bVect) as the - reference point in the rotation expressions. - bTemp[0].position.x and bTemp[0].position.y will initialize - automatically to 0.0, which is what you want - since b[1] will rotate around b[0] */ - bTemp[1].x = cosine * bVect.x + sine * bVect.y; - bTemp[1].y = cosine * bVect.y - sine * bVect.x; - - // rotate Temporary velocities - PVector[] vTemp = { - new PVector(), new PVector() - }; - - vTemp[0].x = cosine * velocity.x + sine * velocity.y; - vTemp[0].y = cosine * velocity.y - sine * velocity.x; - vTemp[1].x = cosine * other.velocity.x + sine * other.velocity.y; - vTemp[1].y = cosine * other.velocity.y - sine * other.velocity.x; - - /* Now that velocities are rotated, you can use 1D - conservation of momentum equations to calculate - the final velocity along the x-axis. */ - PVector[] vFinal = { - new PVector(), new PVector() - }; - - // final rotated velocity for b[0] - vFinal[0].x = ((m - other.m) * vTemp[0].x + 2 * other.m * vTemp[1].x) / (m + other.m); - vFinal[0].y = vTemp[0].y; - - // final rotated velocity for b[0] - vFinal[1].x = ((other.m - m) * vTemp[1].x + 2 * m * vTemp[0].x) / (m + other.m); - vFinal[1].y = vTemp[1].y; - - // hack to avoid clumping - bTemp[0].x += vFinal[0].x; - bTemp[1].x += vFinal[1].x; - - /* Rotate ball positions and velocities back - Reverse signs in trig expressions to rotate - in the opposite direction */ - // rotate balls - PVector[] bFinal = { - new PVector(), new PVector() - }; - - bFinal[0].x = cosine * bTemp[0].x - sine * bTemp[0].y; - bFinal[0].y = cosine * bTemp[0].y + sine * bTemp[0].x; - bFinal[1].x = cosine * bTemp[1].x - sine * bTemp[1].y; - bFinal[1].y = cosine * bTemp[1].y + sine * bTemp[1].x; - - // update balls to screen position - other.position.x = position.x + bFinal[1].x; - other.position.y = position.y + bFinal[1].y; - - position.add(bFinal[0]); - - // update velocities - velocity.x = cosine * vFinal[0].x - sine * vFinal[0].y; - velocity.y = cosine * vFinal[0].y + sine * vFinal[0].x; - other.velocity.x = cosine * vFinal[1].x - sine * vFinal[1].y; - other.velocity.y = cosine * vFinal[1].y + sine * vFinal[1].x; - } - } - - - void display() { - noStroke(); - fill(204); - ellipse(position.x, position.y, r*2, r*2); - } -} - diff --git a/java/examples/Topics/Motion/CircleCollision/CircleCollision.pde b/java/examples/Topics/Motion/CircleCollision/CircleCollision.pde deleted file mode 100644 index 05e2a350a..000000000 --- a/java/examples/Topics/Motion/CircleCollision/CircleCollision.pde +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Circle Collision with Swapping Velocities - * by Ira Greenberg. - * - * Based on Keith Peter's Solution in - * Foundation Actionscript Animation: Making Things Move! - */ - -Ball[] balls = { - new Ball(100, 400, 20), - new Ball(700, 400, 80) -}; - -void setup() { - size(640, 360); -} - -void draw() { - background(51); - - for (Ball b : balls) { - b.update(); - b.display(); - b.checkBoundaryCollision(); - } - - balls[0].checkCollision(balls[1]); -} - - - - diff --git a/java/examples/Topics/Motion/CubesWithinCube/Cube.pde b/java/examples/Topics/Motion/CubesWithinCube/Cube.pde deleted file mode 100644 index 190722770..000000000 --- a/java/examples/Topics/Motion/CubesWithinCube/Cube.pde +++ /dev/null @@ -1,114 +0,0 @@ - -// Custom Cube Class - -class Cube { - // Position, velocity vectors - PVector position; - PVector velocity; - // Also using PVector to hold rotation values for 3 axes - PVector rotation; - - // Vertices of the cube - PVector[] vertices = new PVector[24]; - // width, height, depth - float w, h, d; - - // colors for faces of cube - color[] quadBG = new color[6]; - - Cube(float w, float h, float d) { - this.w = w; - this.h = h; - this.d = d; - - // Colors are hardcoded - quadBG[0] = color(0); - quadBG[1] = color(51); - quadBG[2] = color(102); - quadBG[3] = color(153); - quadBG[4] = color(204); - quadBG[5] = color(255); - - // Start in center - position = new PVector(); - // Random velocity vector - velocity = PVector.random3D(); - // Random rotation - rotation = new PVector(random(40, 100), random(40, 100), random(40, 100)); - - // cube composed of 6 quads - //front - vertices[0] = new PVector(-w/2, -h/2, d/2); - vertices[1] = new PVector(w/2, -h/2, d/2); - vertices[2] = new PVector(w/2, h/2, d/2); - vertices[3] = new PVector(-w/2, h/2, d/2); - //left - vertices[4] = new PVector(-w/2, -h/2, d/2); - vertices[5] = new PVector(-w/2, -h/2, -d/2); - vertices[6] = new PVector(-w/2, h/2, -d/2); - vertices[7] = new PVector(-w/2, h/2, d/2); - //right - vertices[8] = new PVector(w/2, -h/2, d/2); - vertices[9] = new PVector(w/2, -h/2, -d/2); - vertices[10] = new PVector(w/2, h/2, -d/2); - vertices[11] = new PVector(w/2, h/2, d/2); - //back - vertices[12] = new PVector(-w/2, -h/2, -d/2); - vertices[13] = new PVector(w/2, -h/2, -d/2); - vertices[14] = new PVector(w/2, h/2, -d/2); - vertices[15] = new PVector(-w/2, h/2, -d/2); - //top - vertices[16] = new PVector(-w/2, -h/2, d/2); - vertices[17] = new PVector(-w/2, -h/2, -d/2); - vertices[18] = new PVector(w/2, -h/2, -d/2); - vertices[19] = new PVector(w/2, -h/2, d/2); - //bottom - vertices[20] = new PVector(-w/2, h/2, d/2); - vertices[21] = new PVector(-w/2, h/2, -d/2); - vertices[22] = new PVector(w/2, h/2, -d/2); - vertices[23] = new PVector(w/2, h/2, d/2); - } - - // Cube shape itself - void drawCube() { - // Draw cube - for (int i=0; i<6; i++) { - fill(quadBG[i]); - beginShape(QUADS); - for (int j=0; j<4; j++) { - vertex(vertices[j+4*i].x, vertices[j+4*i].y, vertices[j+4*i].z); - } - endShape(); - } - } - - // Update location - void update() { - position.add(velocity); - - // Check wall collisions - if (position.x > bounds/2 || position.x < -bounds/2) { - velocity.x*=-1; - } - if (position.y > bounds/2 || position.y < -bounds/2) { - velocity.y*=-1; - } - if (position.z > bounds/2 || position.z < -bounds/2) { - velocity.z*=-1; - } - } - - - // Display method - void display() { - pushMatrix(); - translate(position.x, position.y, position.z); - rotateX(frameCount*PI/rotation.x); - rotateY(frameCount*PI/rotation.y); - rotateZ(frameCount*PI/rotation.z); - noStroke(); - drawCube(); // Farm out shape to another method - popMatrix(); - } -} - diff --git a/java/examples/Topics/Motion/CubesWithinCube/CubesWithinCube.pde b/java/examples/Topics/Motion/CubesWithinCube/CubesWithinCube.pde deleted file mode 100644 index 2259ecd5f..000000000 --- a/java/examples/Topics/Motion/CubesWithinCube/CubesWithinCube.pde +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Cubes Contained Within a Cube - * by Ira Greenberg. - * - * Collision detection against all - * outer cube's surfaces. - */ - -// 20 little internal cubes -Cube[] cubies = new Cube[20]; - -// Size of outer cube -float bounds = 300; - -void setup() { - size(640, 360, P3D); - - for (int i = 0; i < cubies.length; i++) { - // Cubies are randomly sized - float cubieSize = random(5, 15); - cubies[i] = new Cube(cubieSize, cubieSize, cubieSize); - } - -} - -void draw() { - background(50); - lights(); - - // Center in display window - translate(width/2, height/2, -130); - - // Rotate everything, including external large cube - rotateX(frameCount * 0.001); - rotateY(frameCount * 0.002); - rotateZ(frameCount * 0.001); - stroke(255); - - - // Outer transparent cube, just using box() method - noFill(); - box(bounds); - - // Move and rotate cubies - for (Cube c : cubies) { - c.update(); - c.display(); - } -} - diff --git a/java/examples/Topics/Motion/Linear/Linear.pde b/java/examples/Topics/Motion/Linear/Linear.pde deleted file mode 100644 index 914055b90..000000000 --- a/java/examples/Topics/Motion/Linear/Linear.pde +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Linear Motion. - * - * Changing a variable to create a moving line. - * When the line moves off the edge of the window, - * the variable is set to 0, which places the line - * back at the bottom of the screen. - */ - -float a; - -void setup() { - size(640, 360); - stroke(255); - a = height/2; -} - -void draw() { - background(51); - line(0, a, width, a); - a = a - 0.5; - if (a < 0) { - a = height; - } -} diff --git a/java/examples/Topics/Motion/Morph/Morph.pde b/java/examples/Topics/Motion/Morph/Morph.pde deleted file mode 100644 index e34fbad1b..000000000 --- a/java/examples/Topics/Motion/Morph/Morph.pde +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Morph. - * - * Changing one shape into another by interpolating - * vertices from one to another - */ - -// Two ArrayLists to store the vertices for two shapes -// This example assumes that each shape will have the same -// number of vertices, i.e. the size of each ArrayList will be the same -ArrayList circle = new ArrayList(); -ArrayList square = new ArrayList(); - -// An ArrayList for a third set of vertices, the ones we will be drawing -// in the window -ArrayList morph = new ArrayList(); - -// This boolean variable will control if we are morphing to a circle or square -boolean state = false; - -void setup() { - size(640, 360); - - // Create a circle using vectors pointing from center - for (int angle = 0; angle < 360; angle += 9) { - // Note we are not starting from 0 in order to match the - // path of a circle. - PVector v = PVector.fromAngle(radians(angle-135)); - v.mult(100); - circle.add(v); - // Let's fill out morph ArrayList with blank PVectors while we are at it - morph.add(new PVector()); - } - - // A square is a bunch of vertices along straight lines - // Top of square - for (int x = -50; x < 50; x += 10) { - square.add(new PVector(x, -50)); - } - // Right side - for (int y = -50; y < 50; y += 10) { - square.add(new PVector(50, y)); - } - // Bottom - for (int x = 50; x > -50; x -= 10) { - square.add(new PVector(x, 50)); - } - // Left side - for (int y = 50; y > -50; y -= 10) { - square.add(new PVector(-50, y)); - } -} - -void draw() { - background(51); - - // We will keep how far the vertices are from their target - float totalDistance = 0; - - // Look at each vertex - for (int i = 0; i < circle.size(); i++) { - PVector v1; - // Are we lerping to the circle or square? - if (state) { - v1 = circle.get(i); - } - else { - v1 = square.get(i); - } - // Get the vertex we will draw - PVector v2 = morph.get(i); - // Lerp to the target - v2.lerp(v1, 0.1); - // Check how far we are from target - totalDistance += PVector.dist(v1, v2); - } - - // If all the vertices are close, switch shape - if (totalDistance < 0.1) { - state = !state; - } - - // Draw relative to center - translate(width/2, height/2); - strokeWeight(4); - // Draw a polygon that makes up all the vertices - beginShape(); - noFill(); - stroke(255); - for (PVector v : morph) { - vertex(v.x, v.y); - } - endShape(CLOSE); -} - diff --git a/java/examples/Topics/Motion/MovingOnCurves/MovingOnCurves.pde b/java/examples/Topics/Motion/MovingOnCurves/MovingOnCurves.pde deleted file mode 100644 index b2022adf8..000000000 --- a/java/examples/Topics/Motion/MovingOnCurves/MovingOnCurves.pde +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Moving On Curves. - * - * In this example, the circles moves along the curve y = x^4. - * Click the mouse to have it move to a new position. - */ - -float beginX = 20.0; // Initial x-coordinate -float beginY = 10.0; // Initial y-coordinate -float endX = 570.0; // Final x-coordinate -float endY = 320.0; // Final y-coordinate -float distX; // X-axis distance to move -float distY; // Y-axis distance to move -float exponent = 4; // Determines the curve -float x = 0.0; // Current x-coordinate -float y = 0.0; // Current y-coordinate -float step = 0.01; // Size of each step along the path -float pct = 0.0; // Percentage traveled (0.0 to 1.0) - -void setup() { - size(640, 360); - noStroke(); - distX = endX - beginX; - distY = endY - beginY; -} - -void draw() { - fill(0, 2); - rect(0, 0, width, height); - pct += step; - if (pct < 1.0) { - x = beginX + (pct * distX); - y = beginY + (pow(pct, exponent) * distY); - } - fill(255); - ellipse(x, y, 20, 20); -} - -void mousePressed() { - pct = 0.0; - beginX = x; - beginY = y; - endX = mouseX; - endY = mouseY; - distX = endX - beginX; - distY = endY - beginY; -} diff --git a/java/examples/Topics/Motion/Reflection1/Reflection1.pde b/java/examples/Topics/Motion/Reflection1/Reflection1.pde deleted file mode 100644 index a6bc6073b..000000000 --- a/java/examples/Topics/Motion/Reflection1/Reflection1.pde +++ /dev/null @@ -1,124 +0,0 @@ -/** - * Non-orthogonal Reflection - * by Ira Greenberg. - * - * Based on the equation (R = 2N(N*L)-L) where R is the - * reflection vector, N is the normal, and L is the incident - * vector. - */ - -// Position of left hand side of floor -PVector base1; -// Position of right hand side of floor -PVector base2; -// Length of floor -float baseLength; - -// An array of subpoints along the floor path -PVector[] coords; - -// Variables related to moving ball -PVector position; -PVector velocity; -float r = 6; -float speed = 3.5; - -void setup() { - size(640, 360); - - fill(128); - base1 = new PVector(0, height-150); - base2 = new PVector(width, height); - createGround(); - - // start ellipse at middle top of screen - position = new PVector(width/2, 0); - - // calculate initial random velocity - velocity = PVector.random2D(); - velocity.mult(speed); -} - -void draw() { - // draw background - fill(0, 12); - noStroke(); - rect(0, 0, width, height); - - // draw base - fill(200); - quad(base1.x, base1.y, base2.x, base2.y, base2.x, height, 0, height); - - // calculate base top normal - PVector baseDelta = PVector.sub(base2, base1); - baseDelta.normalize(); - PVector normal = new PVector(-baseDelta.y, baseDelta.x); - - // draw ellipse - noStroke(); - fill(255); - ellipse(position.x, position.y, r*2, r*2); - - // move elipse - position.add(velocity); - - // normalized incidence vector - PVector incidence = PVector.mult(velocity, -1); - incidence.normalize(); - - // detect and handle collision - for (int i=0; i width-r) { - position.x = width-r; - velocity.x *= -1; - } - // left - if (position.x < r) { - position.x = r; - velocity.x *= -1; - } - // top - if (position.y < r) { - position.y = r; - velocity.y *= -1; - // randomize base top - base1.y = random(height-100, height); - base2.y = random(height-100, height); - createGround(); - } -} - - -// Calculate variables for the ground -void createGround() { - // calculate length of base top - baseLength = PVector.dist(base1, base2); - - // fill base top coordinate array - coords = new PVector[ceil(baseLength)]; - for (int i=0; i width-r) { - position.x = width-r; - velocity.x *= -damping; - } - else if (position.x < r) { - position.x = r; - velocity.x *= -damping; - } - } - - void checkGroundCollision(Ground groundSegment) { - - // Get difference between orb and ground - float deltaX = position.x - groundSegment.x; - float deltaY = position.y - groundSegment.y; - - // Precalculate trig values - float cosine = cos(groundSegment.rot); - float sine = sin(groundSegment.rot); - - /* Rotate ground and velocity to allow - orthogonal collision calculations */ - float groundXTemp = cosine * deltaX + sine * deltaY; - float groundYTemp = cosine * deltaY - sine * deltaX; - float velocityXTemp = cosine * velocity.x + sine * velocity.y; - float velocityYTemp = cosine * velocity.y - sine * velocity.x; - - /* Ground collision - check for surface - collision and also that orb is within - left/rights bounds of ground segment */ - if (groundYTemp > -r && - position.x > groundSegment.x1 && - position.x < groundSegment.x2 ) { - // keep orb from going into ground - groundYTemp = -r; - // bounce and slow down orb - velocityYTemp *= -1.0; - velocityYTemp *= damping; - } - - // Reset ground, velocity and orb - deltaX = cosine * groundXTemp - sine * groundYTemp; - deltaY = cosine * groundYTemp + sine * groundXTemp; - velocity.x = cosine * velocityXTemp - sine * velocityYTemp; - velocity.y = cosine * velocityYTemp + sine * velocityXTemp; - position.x = groundSegment.x + deltaX; - position.y = groundSegment.y + deltaY; - } -} - diff --git a/java/examples/Topics/Motion/Reflection2/Reflection2.pde b/java/examples/Topics/Motion/Reflection2/Reflection2.pde deleted file mode 100644 index d227e736b..000000000 --- a/java/examples/Topics/Motion/Reflection2/Reflection2.pde +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Non-orthogonal Collision with Multiple Ground Segments - * by Ira Greenberg. - * - * Based on Keith Peter's Solution in - * Foundation Actionscript Animation: Making Things Move! - */ - -Orb orb; - -PVector gravity = new PVector(0,0.05); -// The ground is an array of "Ground" objects -int segments = 40; -Ground[] ground = new Ground[segments]; - -void setup(){ - size(640, 360); - // An orb object that will fall and bounce around - orb = new Orb(50, 50, 3); - - // Calculate ground peak heights - float[] peakHeights = new float[segments+1]; - for (int i=0; i 0.5) { - gl_FragColor = live; - } else { - gl_FragColor = blue; - } - } else { - float sum = 0.; - sum += texture2D(ppixels, position + pixel * vec2(-1., -1.)).g; - sum += texture2D(ppixels, position + pixel * vec2(-1., 0.)).g; - sum += texture2D(ppixels, position + pixel * vec2(-1., 1.)).g; - sum += texture2D(ppixels, position + pixel * vec2(1., -1.)).g; - sum += texture2D(ppixels, position + pixel * vec2(1., 0.)).g; - sum += texture2D(ppixels, position + pixel * vec2(1., 1.)).g; - sum += texture2D(ppixels, position + pixel * vec2(0., -1.)).g; - sum += texture2D(ppixels, position + pixel * vec2(0., 1.)).g; - vec4 me = texture2D(ppixels, position); - - if (me.g <= 0.1) { - if ((sum >= 2.9) && (sum <= 3.1)) { - gl_FragColor = live; - } else if (me.b > 0.004) { - gl_FragColor = vec4(0., 0., max(me.b - 0.004, 0.25), 0.); - } else { - gl_FragColor = dead; - } - } else { - if ((sum >= 1.9) && (sum <= 3.1)) { - gl_FragColor = live; - } else { - gl_FragColor = blue; - } - } - } -} \ No newline at end of file diff --git a/java/examples/Topics/Shaders/CustomBlend/CustomBlend.pde b/java/examples/Topics/Shaders/CustomBlend/CustomBlend.pde deleted file mode 100644 index c6fb40b1d..000000000 --- a/java/examples/Topics/Shaders/CustomBlend/CustomBlend.pde +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Custom Blend - * - * The OpenGL-based renderers (P2D and P3D) only support some of the - * blending modes available in the default renderer. The reason for this - * is that the blend equations in OpenGL allow for combinations of the - * form dest_factor * dest_color + src_factor * src_color of the source and - * destination colors (see this page http://www.opengl.org/wiki/Blending - * for an extensive discussion of blending in OpenGL). - * Complex blending modes typically available in photo editing tools, - * like hard light or dodge, cannot be modeled with those equations. - * However, we can implement virtually any blending math directly in the - * fragment shader. - * - * This example shows how custom blend shaders can be loaded and used in - * Processing. - * For detailed information on how to implement Photoshop-like blending modes, - * check the following pages (a bit old but still useful): - * http://www.pegtop.net/delphi/articles/blendmodes/index.htm - * http://mouaif.wordpress.com/2009/01/05/photoshop-math-with-glsl-shaders/ - * - */ - -PImage destImage; -PImage srcImage; -PShader dodge; -PShader burn; -PShader overlay; -PShader difference; - -void setup() { - size(640, 360, P2D); - destImage = loadImage("leaves.jpg"); - srcImage = loadImage("moonwalk.jpg"); - - initShaders(); -} - -void draw() { - background(0); - - shader(dodge); - drawOutput(0, 0, width/2, height/2); - shader(burn); - drawOutput(width/2, 0, width/2, height/2); - shader(overlay); - drawOutput(0, height/2, width/2, height/2); - shader(difference); - drawOutput(width/2, height/2, width/2, height/2); - - noLoop(); -} - -void initShaders() { - dodge = loadShader("dodge.glsl"); - burn = loadShader("burn.glsl"); - overlay = loadShader("overlay.glsl"); - difference = loadShader("difference.glsl"); - - // The names destination and source come from the OpenGL terminology: - // destination from the image already in the framebuffer, or "base layer", - // and source for the image that will be blended into the framebuffer, or - // "blend layer": - dodge.set("destSampler", destImage); - dodge.set("srcSampler", srcImage); - burn.set("destSampler", destImage); - burn.set("srcSampler", srcImage); - overlay.set("destSampler", destImage); - overlay.set("srcSampler", srcImage); - difference.set("destSampler", destImage); - difference.set("srcSampler", srcImage); - - // We set the sizes of de st and src images, and the rectangular areas - // from the images that we will use for blending: - dodge.set("destSize", 640, 360); - dodge.set("destRect", 100, 50, 200, 200); - burn.set("destSize", 640, 360); - burn.set("destRect", 100, 50, 200, 200); - overlay.set("destSize", 640, 360); - overlay.set("destRect", 100, 50, 200, 200); - difference.set("destSize", 640, 360); - difference.set("destRect", 100, 50, 200, 200); - - dodge.set("srcSize", 640, 360); - dodge.set("srcRect", 0, 0, 640, 360); - burn.set("srcSize", 640, 360); - burn.set("srcRect", 0, 0, 640, 360); - overlay.set("srcSize", 640, 360); - overlay.set("srcRect", 0, 0, 640, 360); - difference.set("srcSize", 640, 360); - difference.set("srcRect", 0, 0, 640, 360); -} - -void drawOutput(float x, float y, float w, float h) { - pushMatrix(); - translate(x, y); - noStroke(); - beginShape(QUAD); - // Although we are not associating a texture to - // this shape, the uv coordinates will be stored - // anyways so they can be used in the fragment - // shader to access the destination and source - // images. - vertex(0, 0, 0, 0); - vertex(w, 0, 1, 0); - vertex(w, h, 1, 1); - vertex(0, h, 0, 1); - endShape(); - popMatrix(); -} diff --git a/java/examples/Topics/Shaders/CustomBlend/data/burn.glsl b/java/examples/Topics/Shaders/CustomBlend/data/burn.glsl deleted file mode 100644 index 0d090a6ac..000000000 --- a/java/examples/Topics/Shaders/CustomBlend/data/burn.glsl +++ /dev/null @@ -1,22 +0,0 @@ -uniform sampler2D destSampler; -uniform sampler2D srcSampler; - -uniform ivec2 destSize; -uniform ivec4 destRect; - -uniform ivec2 srcSize; -uniform ivec4 srcRect; - -varying vec4 vertTexCoord; - -void main() { - vec2 st = vertTexCoord.st; - - vec2 dest = vec2(destRect.xy) / vec2(destSize) + st * vec2(destRect.zw) / vec2(destSize); - vec2 src = vec2(srcRect.xy) / vec2(srcSize) + st * vec2(srcRect.zw) / vec2(srcSize); - - vec3 destColor = texture2D(destSampler, dest).rgb; - vec3 srcColor = texture2D(srcSampler, src).rgb; - - gl_FragColor = vec4(1.0 - (1.0 - destColor) / srcColor, 1.0); -} \ No newline at end of file diff --git a/java/examples/Topics/Shaders/CustomBlend/data/difference.glsl b/java/examples/Topics/Shaders/CustomBlend/data/difference.glsl deleted file mode 100644 index 7f0040a22..000000000 --- a/java/examples/Topics/Shaders/CustomBlend/data/difference.glsl +++ /dev/null @@ -1,22 +0,0 @@ -uniform sampler2D destSampler; -uniform sampler2D srcSampler; - -uniform ivec2 destSize; -uniform ivec4 destRect; - -uniform ivec2 srcSize; -uniform ivec4 srcRect; - -varying vec4 vertTexCoord; - -void main() { - vec2 st = vertTexCoord.st; - - vec2 dest = vec2(destRect.xy) / vec2(destSize) + st * vec2(destRect.zw) / vec2(destSize); - vec2 src = vec2(srcRect.xy) / vec2(srcSize) + st * vec2(srcRect.zw) / vec2(srcSize); - - vec3 destColor = texture2D(destSampler, dest).rgb; - vec3 srcColor = texture2D(srcSampler, src).rgb; - - gl_FragColor = vec4(abs(srcColor - destColor), 1.0); -} \ No newline at end of file diff --git a/java/examples/Topics/Shaders/CustomBlend/data/dodge.glsl b/java/examples/Topics/Shaders/CustomBlend/data/dodge.glsl deleted file mode 100644 index 115dbaa09..000000000 --- a/java/examples/Topics/Shaders/CustomBlend/data/dodge.glsl +++ /dev/null @@ -1,22 +0,0 @@ -uniform sampler2D destSampler; -uniform sampler2D srcSampler; - -uniform ivec2 destSize; -uniform ivec4 destRect; - -uniform ivec2 srcSize; -uniform ivec4 srcRect; - -varying vec4 vertTexCoord; - -void main() { - vec2 st = vertTexCoord.st; - - vec2 dest = vec2(destRect.xy) / vec2(destSize) + st * vec2(destRect.zw) / vec2(destSize); - vec2 src = vec2(srcRect.xy) / vec2(srcSize) + st * vec2(srcRect.zw) / vec2(srcSize); - - vec3 destColor = texture2D(destSampler, dest).rgb; - vec3 srcColor = texture2D(srcSampler, src).rgb; - - gl_FragColor = vec4(destColor / (1.0 - srcColor), 1.0); -} \ No newline at end of file diff --git a/java/examples/Topics/Shaders/CustomBlend/data/overlay.glsl b/java/examples/Topics/Shaders/CustomBlend/data/overlay.glsl deleted file mode 100644 index f7d28efac..000000000 --- a/java/examples/Topics/Shaders/CustomBlend/data/overlay.glsl +++ /dev/null @@ -1,28 +0,0 @@ -uniform sampler2D destSampler; -uniform sampler2D srcSampler; - -uniform ivec2 destSize; -uniform ivec4 destRect; - -uniform ivec2 srcSize; -uniform ivec4 srcRect; - -varying vec4 vertTexCoord; - -void main() { - vec2 st = vertTexCoord.st; - - vec2 dest = vec2(destRect.xy) / vec2(destSize) + st * vec2(destRect.zw) / vec2(destSize); - vec2 src = vec2(srcRect.xy) / vec2(srcSize) + st * vec2(srcRect.zw) / vec2(srcSize); - - vec3 destColor = texture2D(destSampler, dest).rgb; - vec3 srcColor = texture2D(srcSampler, src).rgb; - - float luminance = dot(vec3(0.2126, 0.7152, 0.0722), destColor); - - if (luminance < 0.5) { - gl_FragColor = vec4(2.0 * destColor * srcColor, 1.0); - } else { - gl_FragColor = vec4(1.0 - 2.0 * (1.0 - destColor) * (1.0 - srcColor), 1); - } -} \ No newline at end of file diff --git a/java/examples/Topics/Shaders/Deform/Deform.pde b/java/examples/Topics/Shaders/Deform/Deform.pde deleted file mode 100644 index b47cfc32d..000000000 --- a/java/examples/Topics/Shaders/Deform/Deform.pde +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Deform. - * - * A GLSL version of the oldschool 2D deformation effect, by Inigo Quilez. - * Ported from the webGL version available in ShaderToy: - * http://www.iquilezles.org/apps/shadertoy/ - * (Look for Deform under the Plane Deformations Presets) - * - */ - -PImage tex; -PShader deform; - -void setup() { - size(640, 360, P2D); - - textureWrap(REPEAT); - tex = loadImage("tex1.jpg"); - - deform = loadShader("deform.glsl"); - deform.set("resolution", float(width), float(height)); -} - -void draw() { - deform.set("time", millis() / 1000.0); - deform.set("mouse", float(mouseX), float(mouseY)); - shader(deform); - image(tex, 0, 0, width, height); -} diff --git a/java/examples/Topics/Shaders/Deform/data/deform.glsl b/java/examples/Topics/Shaders/Deform/data/deform.glsl deleted file mode 100644 index 0c69cfdc1..000000000 --- a/java/examples/Topics/Shaders/Deform/data/deform.glsl +++ /dev/null @@ -1,31 +0,0 @@ -#ifdef GL_ES -precision mediump float; -precision mediump int; -#endif - -#define PROCESSING_TEXTURE_SHADER - -uniform sampler2D texture; - -uniform float time; -uniform vec2 resolution; -uniform vec2 mouse; - -void main(void) { - vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / resolution.xy; - vec2 m = -1.0 + 2.0 * mouse.xy / resolution.xy; - - float a1 = atan(p.y - m.y, p.x - m.x); - float r1 = sqrt(dot(p - m, p - m)); - float a2 = atan(p.y + m.y, p.x + m.x); - float r2 = sqrt(dot(p + m, p + m)); - - vec2 uv; - uv.x = 0.2 * time + (r1 - r2) * 0.25; - uv.y = sin(2.0 * (a1 - a2)); - - float w = r1 * r2 * 0.8; - vec3 col = texture2D(texture, 0.5 - 0.495 * uv).xyz; - - gl_FragColor = vec4(col / (0.1 + w), 1.0); -} \ No newline at end of file diff --git a/java/examples/Topics/Shaders/DomeProjection/CubeMapUtils.pde b/java/examples/Topics/Shaders/DomeProjection/CubeMapUtils.pde deleted file mode 100644 index 49c822eb7..000000000 --- a/java/examples/Topics/Shaders/DomeProjection/CubeMapUtils.pde +++ /dev/null @@ -1,99 +0,0 @@ -void initCubeMap() { - sphereDetail(50); - domeSphere = createShape(SPHERE, height/2.0f); - domeSphere.rotateX(HALF_PI); - domeSphere.setStroke(false); - - PGL pgl = beginPGL(); - - envMapTextureID = IntBuffer.allocate(1); - pgl.genTextures(1, envMapTextureID); - pgl.bindTexture(PGL.TEXTURE_CUBE_MAP, envMapTextureID.get(0)); - pgl.texParameteri(PGL.TEXTURE_CUBE_MAP, PGL.TEXTURE_WRAP_S, PGL.CLAMP_TO_EDGE); - pgl.texParameteri(PGL.TEXTURE_CUBE_MAP, PGL.TEXTURE_WRAP_T, PGL.CLAMP_TO_EDGE); - pgl.texParameteri(PGL.TEXTURE_CUBE_MAP, PGL.TEXTURE_WRAP_R, PGL.CLAMP_TO_EDGE); - pgl.texParameteri(PGL.TEXTURE_CUBE_MAP, PGL.TEXTURE_MIN_FILTER, PGL.NEAREST); - pgl.texParameteri(PGL.TEXTURE_CUBE_MAP, PGL.TEXTURE_MAG_FILTER, PGL.NEAREST); - for (int i = PGL.TEXTURE_CUBE_MAP_POSITIVE_X; i < PGL.TEXTURE_CUBE_MAP_POSITIVE_X + 6; i++) { - pgl.texImage2D(i, 0, PGL.RGBA8, envMapSize, envMapSize, 0, PGL.RGBA, PGL.UNSIGNED_BYTE, null); - } - - // Init fbo, rbo - fbo = IntBuffer.allocate(1); - rbo = IntBuffer.allocate(1); - pgl.genFramebuffers(1, fbo); - pgl.bindFramebuffer(PGL.FRAMEBUFFER, fbo.get(0)); - pgl.framebufferTexture2D(PGL.FRAMEBUFFER, PGL.COLOR_ATTACHMENT0, PGL.TEXTURE_CUBE_MAP_POSITIVE_X, envMapTextureID.get(0), 0); - - pgl.genRenderbuffers(1, rbo); - pgl.bindRenderbuffer(PGL.RENDERBUFFER, rbo.get(0)); - pgl.renderbufferStorage(PGL.RENDERBUFFER, PGL.DEPTH_COMPONENT24, envMapSize, envMapSize); - - // Attach depth buffer to FBO - pgl.framebufferRenderbuffer(PGL.FRAMEBUFFER, PGL.DEPTH_ATTACHMENT, PGL.RENDERBUFFER, rbo.get(0)); - - endPGL(); - - // Load cubemap shader. - cubemapShader = loadShader("cubemapfrag.glsl", "cubemapvert.glsl"); - cubemapShader.set("cubemap", 1); -} - -void drawCubeMap() { - PGL pgl = beginPGL(); - pgl.activeTexture(PGL.TEXTURE1); - pgl.enable(PGL.TEXTURE_CUBE_MAP); - pgl.bindTexture(PGL.TEXTURE_CUBE_MAP, envMapTextureID.get(0)); - regenerateEnvMap(pgl); - endPGL(); - - drawDomeMaster(); - - pgl.disable(PGL.TEXTURE_CUBE_MAP); - pgl.bindTexture(PGL.TEXTURE_CUBE_MAP, 0); -} - -void drawDomeMaster() { - camera(); - ortho(0, width, 0, height); - resetMatrix(); - shader(cubemapShader); - shape(domeSphere); - resetShader(); -} - -// Called to regenerate the envmap -void regenerateEnvMap(PGL pgl) { - // bind fbo - pgl.bindFramebuffer(PGL.FRAMEBUFFER, fbo.get(0)); - - // generate 6 views from origin(0, 0, 0) - pgl.viewport(0, 0, envMapSize, envMapSize); - perspective(90.0f * DEG_TO_RAD, 1.0f, 1.0f, 1025.0f); - for (int face = PGL.TEXTURE_CUBE_MAP_POSITIVE_X; face < - PGL.TEXTURE_CUBE_MAP_NEGATIVE_Z; face++) { - resetMatrix(); - - if (face == PGL.TEXTURE_CUBE_MAP_POSITIVE_X) { - camera(0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f); - } else if (face == PGL.TEXTURE_CUBE_MAP_NEGATIVE_X) { - camera(0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f); - } else if (face == PGL.TEXTURE_CUBE_MAP_POSITIVE_Y) { - camera(0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, -1.0f); - } else if (face == PGL.TEXTURE_CUBE_MAP_NEGATIVE_Y) { - camera(0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f); - } else if (face == PGL.TEXTURE_CUBE_MAP_POSITIVE_Z) { - camera(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, -1.0f, 0.0f); - } - - scale(-1, 1, -1); - translate(-width * 0.5f, -height * 0.5f, -500); - - pgl.framebufferTexture2D(PGL.FRAMEBUFFER, PGL.COLOR_ATTACHMENT0, face, envMapTextureID.get(0), 0); - - drawScene(); // Draw objects in the scene - flush(); // Make sure that the geometry in the scene is pushed to the GPU - noLights(); // Disabling lights to avoid adding many times - pgl.framebufferTexture2D(PGL.FRAMEBUFFER, PGL.COLOR_ATTACHMENT0, face, 0, 0); - } -} diff --git a/java/examples/Topics/Shaders/DomeProjection/DomeProjection.pde b/java/examples/Topics/Shaders/DomeProjection/DomeProjection.pde deleted file mode 100644 index 2c39c08cc..000000000 --- a/java/examples/Topics/Shaders/DomeProjection/DomeProjection.pde +++ /dev/null @@ -1,52 +0,0 @@ -/** - * DomeProjection - * - * This sketch uses use environmental mapping to render the output - * on a full spherical dome. - * - * Based on the FullDomeTemplate code from Christopher Warnow: - * https://github.com/mphasize/FullDome - * - */ - -import java.nio.IntBuffer; - -PShader cubemapShader; -PShape domeSphere; - -IntBuffer fbo; -IntBuffer rbo; -IntBuffer envMapTextureID; - -int envMapSize = 1024; - -void setup() { - size(640, 640, P3D); - initCubeMap(); -} - -void draw() { - background(0); - drawCubeMap(); -} - -void drawScene() { - background(0); - - stroke(255, 0, 0); - strokeWeight(2); - for (int i = -width; i < 2 * width; i += 50) { - line(i, -height, -100, i, 2 *height, -100); - } - for (int i = -height; i < 2 * height; i += 50) { - line(-width, i, -100, 2 * width, i, -100); - } - - lights(); - noStroke(); - translate(mouseX, mouseY, 200); - rotateX(frameCount * 0.01); - rotateY(frameCount * 0.01); - box(100); -} - diff --git a/java/examples/Topics/Shaders/DomeProjection/data/cubemapfrag.glsl b/java/examples/Topics/Shaders/DomeProjection/data/cubemapfrag.glsl deleted file mode 100644 index 0d47ce133..000000000 --- a/java/examples/Topics/Shaders/DomeProjection/data/cubemapfrag.glsl +++ /dev/null @@ -1 +0,0 @@ -uniform samplerCube cubemap; varying vec3 reflectDir; void main() { vec3 color = vec3(textureCube(cubemap, reflectDir)); gl_FragColor = vec4(color, 1.0); } \ No newline at end of file diff --git a/java/examples/Topics/Shaders/DomeProjection/data/cubemapvert.glsl b/java/examples/Topics/Shaders/DomeProjection/data/cubemapvert.glsl deleted file mode 100644 index 1d96e9b52..000000000 --- a/java/examples/Topics/Shaders/DomeProjection/data/cubemapvert.glsl +++ /dev/null @@ -1 +0,0 @@ -uniform mat4 transform; uniform mat4 modelview; uniform mat3 normalMatrix; attribute vec4 vertex; attribute vec3 normal; varying vec3 reflectDir; void main() { gl_Position = transform * vertex; vec3 ecNormal = normalize(normalMatrix * normal); // Vertex in eye coordinates vec3 ecVertex = vec3(modelview * vertex); // Normal vector in eye coordinates vec3 eyeDir = ecVertex.xyz; reflectDir = reflect(eyeDir, ecNormal); } \ No newline at end of file diff --git a/java/examples/Topics/Shaders/EdgeDetect/EdgeDetect.pde b/java/examples/Topics/Shaders/EdgeDetect/EdgeDetect.pde deleted file mode 100644 index db617514a..000000000 --- a/java/examples/Topics/Shaders/EdgeDetect/EdgeDetect.pde +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Edge Detection - * - * Change the default shader to apply a simple, custom edge detection filter. - * - * Press the mouse to switch between the custom and default shader. - */ - -PShader edges; -PImage img; -boolean enabled = true; - -void setup() { - size(640, 360, P2D); - img = loadImage("leaves.jpg"); - edges = loadShader("edges.glsl"); -} - -void draw() { - if (enabled == true) { - shader(edges); - } - image(img, 0, 0); -} - -void mousePressed() { - enabled = !enabled; - if (!enabled == true) { - resetShader(); - } -} diff --git a/java/examples/Topics/Shaders/EdgeDetect/data/edges.glsl b/java/examples/Topics/Shaders/EdgeDetect/data/edges.glsl deleted file mode 100644 index 62109e3e3..000000000 --- a/java/examples/Topics/Shaders/EdgeDetect/data/edges.glsl +++ /dev/null @@ -1,40 +0,0 @@ -#ifdef GL_ES -precision mediump float; -precision mediump int; -#endif - -#define PROCESSING_TEXTURE_SHADER - -uniform sampler2D texture; -uniform vec2 texOffset; - -varying vec4 vertColor; -varying vec4 vertTexCoord; - -void main(void) { - // Grouping texcoord variables in order to make it work in the GMA 950. See post #13 - // in this thread: - // http://www.idevgames.com/forums/thread-3467.html - vec2 tc0 = vertTexCoord.st + vec2(-texOffset.s, -texOffset.t); - vec2 tc1 = vertTexCoord.st + vec2( 0.0, -texOffset.t); - vec2 tc2 = vertTexCoord.st + vec2(+texOffset.s, -texOffset.t); - vec2 tc3 = vertTexCoord.st + vec2(-texOffset.s, 0.0); - vec2 tc4 = vertTexCoord.st + vec2( 0.0, 0.0); - vec2 tc5 = vertTexCoord.st + vec2(+texOffset.s, 0.0); - vec2 tc6 = vertTexCoord.st + vec2(-texOffset.s, +texOffset.t); - vec2 tc7 = vertTexCoord.st + vec2( 0.0, +texOffset.t); - vec2 tc8 = vertTexCoord.st + vec2(+texOffset.s, +texOffset.t); - - vec4 col0 = texture2D(texture, tc0); - vec4 col1 = texture2D(texture, tc1); - vec4 col2 = texture2D(texture, tc2); - vec4 col3 = texture2D(texture, tc3); - vec4 col4 = texture2D(texture, tc4); - vec4 col5 = texture2D(texture, tc5); - vec4 col6 = texture2D(texture, tc6); - vec4 col7 = texture2D(texture, tc7); - vec4 col8 = texture2D(texture, tc8); - - vec4 sum = 8.0 * col4 - (col0 + col1 + col2 + col3 + col5 + col6 + col7 + col8); - gl_FragColor = vec4(sum.rgb, 1.0) * vertColor; -} diff --git a/java/examples/Topics/Shaders/EdgeFilter/EdgeFilter.pde b/java/examples/Topics/Shaders/EdgeFilter/EdgeFilter.pde deleted file mode 100644 index 845a9fbcc..000000000 --- a/java/examples/Topics/Shaders/EdgeFilter/EdgeFilter.pde +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Edge Filter - * - * Apply a custom shader to the filter() function to affect the geometry drawn to the screen. - * - * Press the mouse to turn the filter on and off. - */ - - PShader edges; -boolean applyFilter = true; - -void setup() { - size(640, 360, P3D); - edges = loadShader("edges.glsl"); - noStroke(); -} - -void draw() { - background(0); - lights(); - - translate(width/2, height/2); - pushMatrix(); - rotateX(frameCount * 0.01); - rotateY(frameCount * 0.01); - box(120); - popMatrix(); - - if (applyFilter == true) { - filter(edges); - } - - // The sphere doesn't have the edge detection applied - // on it because it is drawn after filter() is called. - rotateY(frameCount * 0.02); - translate(150, 0); - sphere(40); -} - -void mousePressed() { - applyFilter = !applyFilter; -} diff --git a/java/examples/Topics/Shaders/EdgeFilter/data/edges.glsl b/java/examples/Topics/Shaders/EdgeFilter/data/edges.glsl deleted file mode 100644 index 62109e3e3..000000000 --- a/java/examples/Topics/Shaders/EdgeFilter/data/edges.glsl +++ /dev/null @@ -1,40 +0,0 @@ -#ifdef GL_ES -precision mediump float; -precision mediump int; -#endif - -#define PROCESSING_TEXTURE_SHADER - -uniform sampler2D texture; -uniform vec2 texOffset; - -varying vec4 vertColor; -varying vec4 vertTexCoord; - -void main(void) { - // Grouping texcoord variables in order to make it work in the GMA 950. See post #13 - // in this thread: - // http://www.idevgames.com/forums/thread-3467.html - vec2 tc0 = vertTexCoord.st + vec2(-texOffset.s, -texOffset.t); - vec2 tc1 = vertTexCoord.st + vec2( 0.0, -texOffset.t); - vec2 tc2 = vertTexCoord.st + vec2(+texOffset.s, -texOffset.t); - vec2 tc3 = vertTexCoord.st + vec2(-texOffset.s, 0.0); - vec2 tc4 = vertTexCoord.st + vec2( 0.0, 0.0); - vec2 tc5 = vertTexCoord.st + vec2(+texOffset.s, 0.0); - vec2 tc6 = vertTexCoord.st + vec2(-texOffset.s, +texOffset.t); - vec2 tc7 = vertTexCoord.st + vec2( 0.0, +texOffset.t); - vec2 tc8 = vertTexCoord.st + vec2(+texOffset.s, +texOffset.t); - - vec4 col0 = texture2D(texture, tc0); - vec4 col1 = texture2D(texture, tc1); - vec4 col2 = texture2D(texture, tc2); - vec4 col3 = texture2D(texture, tc3); - vec4 col4 = texture2D(texture, tc4); - vec4 col5 = texture2D(texture, tc5); - vec4 col6 = texture2D(texture, tc6); - vec4 col7 = texture2D(texture, tc7); - vec4 col8 = texture2D(texture, tc8); - - vec4 sum = 8.0 * col4 - (col0 + col1 + col2 + col3 + col5 + col6 + col7 + col8); - gl_FragColor = vec4(sum.rgb, 1.0) * vertColor; -} diff --git a/java/examples/Topics/Shaders/GlossyFishEye/GlossyFishEye.pde b/java/examples/Topics/Shaders/GlossyFishEye/GlossyFishEye.pde deleted file mode 100644 index 075913a85..000000000 --- a/java/examples/Topics/Shaders/GlossyFishEye/GlossyFishEye.pde +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Glossy Fish Eye - * - * A fish-eye shader is used on the main surface and - * a glossy specular reflection shader is used on the - * offscreen canvas. - */ - -PShader fisheye; -PShader glossy; -PGraphics canvas; -PImage img; -PShape ball; - -boolean useFishEye = true; - -void setup() { - size(640, 640, P3D); - canvas = createGraphics(width, height, P3D); - - fisheye = loadShader("FishEye.glsl"); - fisheye.set("aperture", 180.0); - - glossy = loadShader("GlossyFrag.glsl", "GlossyVert.glsl"); - glossy.set("AmbientColour", 0.0, 0.0, 0.0); - glossy.set("DiffuseColour", 0.9, 0.2, 0.2); - glossy.set("SpecularColour", 1.0, 1.0, 1.0); - glossy.set("AmbientIntensity", 1.0); - glossy.set("DiffuseIntensity", 1.0); - glossy.set("SpecularIntensity", 0.7); - glossy.set("Roughness", 0.7); - glossy.set("Sharpness", 0.0); - - ball = createShape(SPHERE, 50); - ball.setStroke(false); -} - -void draw() { - canvas.beginDraw(); - canvas.shader(glossy); - canvas.noStroke(); - canvas.background(0); - canvas.pushMatrix(); - canvas.rotateY(frameCount * 0.01); - canvas.pointLight(204, 204, 204, 1000, 1000, 1000); - canvas.popMatrix(); - for (float x = 0; x < canvas.width + 100; x += 100) { - for (float y = 0; y < canvas.height + 100; y += 100) { - for (float z = 0; z < 400; z += 100) { - canvas.pushMatrix(); - canvas.translate(x, y, -z); - canvas.shape(ball); - canvas.popMatrix(); - } - } - } - canvas.endDraw(); - - if (useFishEye == true) { - shader(fisheye); - } - image(canvas, 0, 0, width, height); -} - -void mousePressed() { - if (useFishEye) { - useFishEye = false; - resetShader(); - } else { - useFishEye = true; - } -} diff --git a/java/examples/Topics/Shaders/GlossyFishEye/data/FishEye.glsl b/java/examples/Topics/Shaders/GlossyFishEye/data/FishEye.glsl deleted file mode 100644 index 9865603e6..000000000 --- a/java/examples/Topics/Shaders/GlossyFishEye/data/FishEye.glsl +++ /dev/null @@ -1,59 +0,0 @@ -// Inspired by the "Angular Fisheye à la Bourke" sketch from -// Jonathan Cremieux, as shown in the OpenProcessing website: -// http://openprocessing.org/visuals/?visualID=12140 -// Using the inverse transform of the angular fisheye as -// explained in Paul Bourke's website: -// http://paulbourke.net/miscellaneous/domefisheye/fisheye/ - -#ifdef GL_ES -precision mediump float; -precision mediump int; -#endif - -#define PROCESSING_TEXTURE_SHADER - -uniform sampler2D texture; -uniform mat4 texMatrix; - -varying vec4 vertColor; -varying vec4 vertTexCoord; - -uniform float aperture; - -const float PI = 3.1415926535; - -void main(void) { - float apertureHalf = 0.5 * aperture * (PI / 180.0); - - // This factor ajusts the coordinates in the case that - // the aperture angle is less than 180 degrees, in which - // case the area displayed is not the entire half-sphere. - float maxFactor = sin(apertureHalf); - - // The st factor takes into account the situation when non-pot - // textures are not supported, so that the maximum texture - // coordinate to cover the entire image might not be 1. - vec2 stFactor = vec2(1.0 / abs(texMatrix[0][0]), 1.0 / abs(texMatrix[1][1])); - vec2 pos = (2.0 * vertTexCoord.st * stFactor - 1.0); - - float l = length(pos); - if (l > 1.0) { - gl_FragColor = vec4(0, 0, 0, 1); - } else { - float x = maxFactor * pos.x; - float y = maxFactor * pos.y; - - float n = length(vec2(x, y)); - - float z = sqrt(1.0 - n * n); - - float r = atan(n, z) / PI; - - float phi = atan(y, x); - - float u = r * cos(phi) + 0.5; - float v = r * sin(phi) + 0.5; - - gl_FragColor = texture2D(texture, vec2(u, v) / stFactor) * vertColor; - } -} \ No newline at end of file diff --git a/java/examples/Topics/Shaders/GlossyFishEye/data/GlossyFrag.glsl b/java/examples/Topics/Shaders/GlossyFishEye/data/GlossyFrag.glsl deleted file mode 100644 index 239b29237..000000000 --- a/java/examples/Topics/Shaders/GlossyFishEye/data/GlossyFrag.glsl +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2007 Dave Griffiths -// Copyright (C) 2007 Dave Griffiths -// Licence: GPLv2 (see COPYING) -// Fluxus Shader Library -// --------------------- -// Glossy Specular Reflection Shader -// A more controllable version of blinn shading, -// Useful for ceramic or fluids - from Advanced -// Renderman, thanks to Larry Gritz - -#ifdef GL_ES -precision mediump float; -precision mediump int; -#endif - -uniform vec3 AmbientColour; -uniform vec3 DiffuseColour; -uniform vec3 SpecularColour; -uniform float AmbientIntensity; -uniform float DiffuseIntensity; -uniform float SpecularIntensity; -uniform float Roughness; -uniform float Sharpness; - -varying vec3 N; -varying vec3 P; -varying vec3 V; -varying vec3 L; - -void main() { - float w = 0.18*(1.0-Sharpness); - - vec3 l = normalize(L); - vec3 n = normalize(N); - vec3 v = normalize(V); - vec3 h = normalize(l+v); - - float diffuse = dot(l,n); - float specular = smoothstep(0.72-w,0.72+w,pow(max(0.0,dot(n,h)),1.0/Roughness)); - - gl_FragColor = vec4(AmbientColour*AmbientIntensity + - DiffuseColour*diffuse*DiffuseIntensity + - SpecularColour*specular*SpecularIntensity,1); -} diff --git a/java/examples/Topics/Shaders/GlossyFishEye/data/GlossyVert.glsl b/java/examples/Topics/Shaders/GlossyFishEye/data/GlossyVert.glsl deleted file mode 100644 index ee0652310..000000000 --- a/java/examples/Topics/Shaders/GlossyFishEye/data/GlossyVert.glsl +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (C) 2007 Dave Griffiths -// Licence: GPLv2 (see COPYING) -// Fluxus Shader Library -// --------------------- -// Glossy Specular Reflection Shader -// A more controllable version of blinn shading, -// Useful for ceramic or fluids - from Advanced -// Renderman, thanks to Larry Gritz - -#define PROCESSING_LIGHT_SHADER - -uniform mat4 modelview; -uniform mat4 transform; -uniform mat3 normalMatrix; - -uniform vec4 lightPosition[8]; - -attribute vec4 vertex; -attribute vec3 normal; - -varying vec3 N; -varying vec3 P; -varying vec3 V; -varying vec3 L; - -void main() { - N = normalize(normalMatrix * normal); - P = vertex.xyz; - V = -vec3(modelview * vertex); - L = vec3(modelview * (lightPosition[0] - vertex)); - gl_Position = transform * vertex; -} - diff --git a/java/examples/Topics/Shaders/ImageMask/ImageMask.pde b/java/examples/Topics/Shaders/ImageMask/ImageMask.pde deleted file mode 100644 index 4a30e7684..000000000 --- a/java/examples/Topics/Shaders/ImageMask/ImageMask.pde +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Image Mask - * - * Move the mouse to reveal the image through the dynamic mask. - */ - -PShader maskShader; -PImage srcImage; -PGraphics maskImage; - -void setup() { - size(640, 360, P2D); - srcImage = loadImage("leaves.jpg"); - maskImage = createGraphics(srcImage.width, srcImage.height, P2D); - maskImage.noSmooth(); - maskShader = loadShader("mask.glsl"); - maskShader.set("mask", maskImage); - background(255); -} - -void draw() { - maskImage.beginDraw(); - maskImage.background(0); - if (mouseX != 0 && mouseY != 0) { - maskImage.noStroke(); - maskImage.fill(255, 0, 0); - maskImage.ellipse(mouseX, mouseY, 50, 50); - } - maskImage.endDraw(); - - shader(maskShader); - image(srcImage, 0, 0, width, height); -} - diff --git a/java/examples/Topics/Shaders/ImageMask/data/mask.glsl b/java/examples/Topics/Shaders/ImageMask/data/mask.glsl deleted file mode 100644 index 006219d43..000000000 --- a/java/examples/Topics/Shaders/ImageMask/data/mask.glsl +++ /dev/null @@ -1,19 +0,0 @@ -#ifdef GL_ES -precision mediump float; -precision mediump int; -#endif - -#define PROCESSING_TEXTURE_SHADER - -uniform sampler2D texture; -uniform sampler2D mask; - -uniform vec2 texOffset; -varying vec4 vertColor; -varying vec4 vertTexCoord; - -void main() { - vec4 texColor = texture2D(texture, vertTexCoord.st).rgba; - vec4 maskColor = texture2D(mask, vec2(vertTexCoord.s, 1.0 - vertTexCoord.t)).rgba; - gl_FragColor = mix(texColor, vec4(0, 0, 0, 0), 1.0 - maskColor.r); -} \ No newline at end of file diff --git a/java/examples/Topics/Shaders/Landscape/Landscape.pde b/java/examples/Topics/Shaders/Landscape/Landscape.pde deleted file mode 100644 index 31d765457..000000000 --- a/java/examples/Topics/Shaders/Landscape/Landscape.pde +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Elevated - * https://www.shadertoy.com/view/MdX3Rr by inigo quilez - * Created by inigo quilez - iq/2013 - * License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. - * Processing port by Raphaël de Courville. - */ - -PShader shader; - -void setup() { - size(640, 360, P2D); - noStroke(); - - // The code of this shader shows how to integrate shaders from shadertoy - // into Processing with minimal changes. - shader = loadShader("landscape.glsl"); - shader.set("resolution", float(width), float(height)); -} - -void draw() { - background(0); - - shader.set("time", (float)(millis()/1000.0)); - shader(shader); - rect(0, 0, width, height); - - frame.setTitle("frame: " + frameCount + " - fps: " + frameRate); -} - diff --git a/java/examples/Topics/Shaders/Landscape/data/landscape.glsl b/java/examples/Topics/Shaders/Landscape/data/landscape.glsl deleted file mode 100644 index b334641e2..000000000 --- a/java/examples/Topics/Shaders/Landscape/data/landscape.glsl +++ /dev/null @@ -1,352 +0,0 @@ -// Elevated shader -// https://www.shadertoy.com/view/MdX3Rr by inigo quilez - -// Created by inigo quilez - iq/2013 -// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. - -// Processing port by Raphaël de Courville. - -#ifdef GL_ES -precision highp float; -#endif - -// Type of shader expected by Processing -#define PROCESSING_COLOR_SHADER - -// Processing specific input -uniform float time; -uniform vec2 resolution; -uniform vec2 mouse; - -// Layer between Processing and Shadertoy uniforms -vec3 iResolution = vec3(resolution,0.0); -float iGlobalTime = time; -vec4 iMouse = vec4(mouse,0.0,0.0); // zw would normally be the click status - -// ------- Below is the unmodified Shadertoy code ---------- -// Created by inigo quilez - iq/2013 -// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. - -//stereo thanks to Croqueteer -//#define STEREO - -mat3 m = mat3( 0.00, 0.80, 0.60, - -0.80, 0.36, -0.48, - -0.60, -0.48, 0.64 ); - -float hash( float n ) -{ - return fract(sin(n)*43758.5453123); -} - - -float noise( in vec3 x ) -{ - vec3 p = floor(x); - vec3 f = fract(x); - - f = f*f*(3.0-2.0*f); - - float n = p.x + p.y*57.0 + 113.0*p.z; - - float res = mix(mix(mix( hash(n+ 0.0), hash(n+ 1.0),f.x), - mix( hash(n+ 57.0), hash(n+ 58.0),f.x),f.y), - mix(mix( hash(n+113.0), hash(n+114.0),f.x), - mix( hash(n+170.0), hash(n+171.0),f.x),f.y),f.z); - return res; -} - - - - -vec3 noised( in vec2 x ) -{ - vec2 p = floor(x); - vec2 f = fract(x); - - vec2 u = f*f*(3.0-2.0*f); - - float n = p.x + p.y*57.0; - - float a = hash(n+ 0.0); - float b = hash(n+ 1.0); - float c = hash(n+ 57.0); - float d = hash(n+ 58.0); - return vec3(a+(b-a)*u.x+(c-a)*u.y+(a-b-c+d)*u.x*u.y, - 30.0*f*f*(f*(f-2.0)+1.0)*(vec2(b-a,c-a)+(a-b-c+d)*u.yx)); - -} - -float noise( in vec2 x ) -{ - vec2 p = floor(x); - vec2 f = fract(x); - - f = f*f*(3.0-2.0*f); - - float n = p.x + p.y*57.0; - - float res = mix(mix( hash(n+ 0.0), hash(n+ 1.0),f.x), - mix( hash(n+ 57.0), hash(n+ 58.0),f.x),f.y); - - return res; -} - -float fbm( vec3 p ) -{ - float f = 0.0; - - f += 0.5000*noise( p ); p = m*p*2.02; - f += 0.2500*noise( p ); p = m*p*2.03; - f += 0.1250*noise( p ); p = m*p*2.01; - f += 0.0625*noise( p ); - - return f/0.9375; -} - -mat2 m2 = mat2(1.6,-1.2,1.2,1.6); - -float fbm( vec2 p ) -{ - float f = 0.0; - - f += 0.5000*noise( p ); p = m2*p*2.02; - f += 0.2500*noise( p ); p = m2*p*2.03; - f += 0.1250*noise( p ); p = m2*p*2.01; - f += 0.0625*noise( p ); - - return f/0.9375; -} - -float terrain( in vec2 x ) -{ - vec2 p = x*0.003; - float a = 0.0; - float b = 1.0; - vec2 d = vec2(0.0); - for(int i=0;i<5; i++) - { - vec3 n = noised(p); - d += n.yz; - a += b*n.x/(1.0+dot(d,d)); - b *= 0.5; - p=mat2(1.6,-1.2,1.2,1.6)*p; - } - - return 140.0*a; -} - -float terrain2( in vec2 x ) -{ - vec2 p = x*0.003; - float a = 0.0; - float b = 1.0; - vec2 d = vec2(0.0); - for(int i=0;i<14; i++) - { - vec3 n = noised(p); - d += n.yz; - a += b*n.x/(1.0+dot(d,d)); - b *= 0.5; - p=m2*p; - } - - return 140.0*a; -} - - -float map( in vec3 p ) -{ - float h = terrain(p.xz); - - float ss = 0.03; - float hh = h*ss; - float fh = fract(hh); - float ih = floor(hh); - fh = mix( sqrt(fh), fh, smoothstep(50.0,140.0,h) ); - h = (ih+fh)/ss; - - return p.y - h; -} - -float map2( in vec3 p ) -{ - float h = terrain2(p.xz); - - - float ss = 0.03; - float hh = h*ss; - float fh = fract(hh); - float ih = floor(hh); - fh = mix( sqrt(fh), fh, smoothstep(50.0,140.0,h) ); - h = (ih+fh)/ss; - - return p.y - h; -} - -bool jinteresct(in vec3 rO, in vec3 rD, out float resT ) -{ - float h = 0.0; - float t = 0.0; - for( int j=0; j<120; j++ ) - { - //if( t>2000.0 ) break; - - vec3 p = rO + t*rD; -if( p.y>300.0 ) break; - h = map( p ); - - if( h<0.1 ) - { - resT = t; - return true; - } - t += max(0.1,0.5*h); - - } - - if( h<5.0 ) - { - resT = t; - return true; - } - return false; -} - -float sinteresct(in vec3 rO, in vec3 rD ) -{ - float res = 1.0; - float t = 0.0; - for( int j=0; j<50; j++ ) - { - //if( t>1000.0 ) break; - vec3 p = rO + t*rD; - - float h = map( p ); - - if( h<0.1 ) - { - return 0.0; - } - res = min( res, 16.0*h/t ); - t += h; - - } - - return clamp( res, 0.0, 1.0 ); -} - -vec3 calcNormal( in vec3 pos, float t ) -{ - float e = 0.001; - e = 0.001*t; - vec3 eps = vec3(e,0.0,0.0); - vec3 nor; - nor.x = map2(pos+eps.xyy) - map2(pos-eps.xyy); - nor.y = map2(pos+eps.yxy) - map2(pos-eps.yxy); - nor.z = map2(pos+eps.yyx) - map2(pos-eps.yyx); - return normalize(nor); -} - -vec3 camPath( float time ) -{ - vec2 p = 600.0*vec2( cos(1.4+0.37*time), - cos(3.2+0.31*time) ); - - return vec3( p.x, 0.0, p.y ); -} - -void main(void) -{ - vec2 xy = -1.0 + 2.0*gl_FragCoord.xy / iResolution.xy; - - vec2 s = xy*vec2(1.75,1.0); - - #ifdef STEREO - float isCyan = mod(gl_FragCoord.x + mod(gl_FragCoord.y,2.0),2.0); - #endif - - float time = iGlobalTime*.15; - - vec3 light1 = normalize( vec3( 0.4, 0.22, 0.6 ) ); - vec3 light2 = vec3( -0.707, 0.000, -0.707 ); - - - vec3 campos = camPath( time ); - vec3 camtar = camPath( time + 3.0 ); - campos.y = terrain( campos.xz ) + 15.0; - camtar.y = campos.y*0.5; - - float roll = 0.1*cos(0.1*time); - vec3 cw = normalize(camtar-campos); - vec3 cp = vec3(sin(roll), cos(roll),0.0); - vec3 cu = normalize(cross(cw,cp)); - vec3 cv = normalize(cross(cu,cw)); - vec3 rd = normalize( s.x*cu + s.y*cv + 1.6*cw ); - - #ifdef STEREO - campos += 2.0*cu*isCyan; // move camera to the right - the rd vector is still good - #endif - - float sundot = clamp(dot(rd,light1),0.0,1.0); - vec3 col; - float t; - if( !jinteresct(campos,rd,t) ) - { - col = 0.9*vec3(0.97,.99,1.0)*(1.0-0.3*rd.y); - col += 0.2*vec3(0.8,0.7,0.5)*pow( sundot, 4.0 ); - } - else - { - vec3 pos = campos + t*rd; - - vec3 nor = calcNormal( pos, t ); - - float dif1 = clamp( dot( light1, nor ), 0.0, 1.0 ); - float dif2 = clamp( 0.2 + 0.8*dot( light2, nor ), 0.0, 1.0 ); - float sh = 1.0; - if( dif1>0.001 ) - sh = sinteresct(pos+light1*20.0,light1); - - vec3 dif1v = vec3(dif1); - dif1v *= vec3( sh, sh*sh*0.5+0.5*sh, sh*sh ); - - float r = noise( 7.0*pos.xz ); - - col = (r*0.25+0.75)*0.9*mix( vec3(0.10,0.05,0.03), vec3(0.13,0.10,0.08), clamp(terrain2( vec2(pos.x,pos.y*48.0))/200.0,0.0,1.0) ); - col = mix( col, 0.17*vec3(0.5,.23,0.04)*(0.50+0.50*r),smoothstep(0.70,0.9,nor.y) ); - col = mix( col, 0.10*vec3(0.2,.30,0.00)*(0.25+0.75*r),smoothstep(0.95,1.0,nor.y) ); - col *= 0.75; - // snow - #if 1 - float h = smoothstep(55.0,80.0,pos.y + 25.0*fbm(0.01*pos.xz) ); - float e = smoothstep(1.0-0.5*h,1.0-0.1*h,nor.y); - float o = 0.3 + 0.7*smoothstep(0.0,0.1,nor.x+h*h); - float s = h*e*o; - s = smoothstep( 0.1, 0.9, s ); - col = mix( col, 0.4*vec3(0.6,0.65,0.7), s ); - #endif - - - vec3 brdf = 2.0*vec3(0.17,0.19,0.20)*clamp(nor.y,0.0,1.0); - brdf += 6.0*vec3(1.00,0.95,0.80)*dif1v; - brdf += 2.0*vec3(0.20,0.20,0.20)*dif2; - - col *= brdf; - - float fo = 1.0-exp(-pow(0.0015*t,1.5)); - vec3 fco = vec3(0.7) + 0.6*vec3(0.8,0.7,0.5)*pow( sundot, 4.0 ); - col = mix( col, fco, fo ); - } - - col = sqrt(col); - - vec2 uv = xy*0.5+0.5; - col *= 0.7 + 0.3*pow(16.0*uv.x*uv.y*(1.0-uv.x)*(1.0-uv.y),0.1); - - #ifdef STEREO - col *= vec3( isCyan, 1.0-isCyan, 1.0-isCyan ); - #endif - - gl_FragColor=vec4(col,1.0); -} diff --git a/java/examples/Topics/Shaders/Monjori/Monjori.pde b/java/examples/Topics/Shaders/Monjori/Monjori.pde deleted file mode 100644 index 8ff7ca468..000000000 --- a/java/examples/Topics/Shaders/Monjori/Monjori.pde +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Monjori. - * - * GLSL version of the 1k intro Monjori from the demoscene - * (http://www.pouet.net/prod.php?which=52761) - * Ported from the webGL version available in ShaderToy: - * http://www.iquilezles.org/apps/shadertoy/ - * (Look for Monjori under the Plane Deformations Presets) - */ - -PShader monjori; - -void setup() { - size(640, 360, P2D); - noStroke(); - - monjori = loadShader("monjori.glsl"); - monjori.set("resolution", float(width), float(height)); -} - -void draw() { - monjori.set("time", millis() / 1000.0); - - shader(monjori); - // This kind of effects are entirely implemented in the - // fragment shader, they only need a quad covering the - // entire view area so every pixel is pushed through the - // shader. - rect(0, 0, width, height); -} - diff --git a/java/examples/Topics/Shaders/Monjori/data/monjori.glsl b/java/examples/Topics/Shaders/Monjori/data/monjori.glsl deleted file mode 100644 index 96e53f6da..000000000 --- a/java/examples/Topics/Shaders/Monjori/data/monjori.glsl +++ /dev/null @@ -1,30 +0,0 @@ -#define PROCESSING_COLOR_SHADER - -uniform vec2 resolution; -uniform float time; - -void main(void) { - vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / resolution.xy; - float a = time*40.0; - float d,e,f,g=1.0/40.0,h,i,r,q; - e=400.0*(p.x*0.5+0.5); - f=400.0*(p.y*0.5+0.5); - i=200.0+sin(e*g+a/150.0)*20.0; - d=200.0+cos(f*g/2.0)*18.0+cos(e*g)*7.0; - r=sqrt(pow(i-e,2.0)+pow(d-f,2.0)); - q=f/r; - e=(r*cos(q))-a/2.0;f=(r*sin(q))-a/2.0; - d=sin(e*g)*176.0+sin(e*g)*164.0+r; - h=((f+d)+a/2.0)*g; - i=cos(h+r*p.x/1.3)*(e+e+a)+cos(q*g*6.0)*(r+h/3.0); - h=sin(f*g)*144.0-sin(e*g)*212.0*p.x; - h=(h+(f-e)*q+sin(r-(a+h)/7.0)*10.0+i/4.0)*g; - i+=cos(h*2.3*sin(a/350.0-q))*184.0*sin(q-(r*4.3+a/12.0)*g)+tan(r*g+h)*184.0*cos(r*g+h); - i=mod(i/5.6,256.0)/64.0; - if(i<0.0) i+=4.0; - if(i>=2.0) i=4.0-i; - d=r/350.0; - d+=sin(d*d*8.0)*0.52; - f=(sin(a*g)+1.0)/2.0; - gl_FragColor=vec4(vec3(f*i/1.6,i/2.0+d/13.0,i)*d*p.x+vec3(i/1.3+d/8.0,i/2.0+d/18.0,i)*d*(1.0-p.x),1.0); -} diff --git a/java/examples/Topics/Shaders/Nebula/Nebula.pde b/java/examples/Topics/Shaders/Nebula/Nebula.pde deleted file mode 100644 index c8b092394..000000000 --- a/java/examples/Topics/Shaders/Nebula/Nebula.pde +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Nebula. - * - * From CoffeeBreakStudios.com (CBS) - * Ported from the webGL version in GLSL Sandbox: - * http://glsl.heroku.com/e#3265.2 - */ - -PShader nebula; - -void setup() { - size(640, 360, P2D); - noStroke(); - - nebula = loadShader("nebula.glsl"); - nebula.set("resolution", float(width), float(height)); -} - -void draw() { - nebula.set("time", millis() / 500.0); - shader(nebula); - // This kind of raymarching effects are entirely implemented in the - // fragment shader, they only need a quad covering the entire view - // area so every pixel is pushed through the shader. - rect(0, 0, width, height); -} - diff --git a/java/examples/Topics/Shaders/Nebula/data/nebula.glsl b/java/examples/Topics/Shaders/Nebula/data/nebula.glsl deleted file mode 100644 index 11717c9af..000000000 --- a/java/examples/Topics/Shaders/Nebula/data/nebula.glsl +++ /dev/null @@ -1,111 +0,0 @@ -#define PROCESSING_COLOR_SHADER - -uniform float time; -uniform vec2 resolution; - -// NEBULA - CoffeeBreakStudios.com (CBS) -// Work in progress... -// -// 3148.26: Switched from classic to simplex noise -// 3148.27: Reduced number of stars -// 3249.0: Switched to fast computed 3D noise. Less quality but ~ 2x faster -// 3249.5: Removed use of random number generator to gain performance -// 3265.0: Added rotation: glsl.heroku.com/e#3005.1 - -//Utility functions - -vec3 fade(vec3 t) { - return vec3(1.0,1.0,1.0);//t*t*t*(t*(t*6.0-15.0)+10.0); -} - -vec2 rotate(vec2 point, float rads) { - float cs = cos(rads); - float sn = sin(rads); - return point * mat2(cs, -sn, sn, cs); -} - -vec4 randomizer4(const vec4 x) -{ - vec4 z = mod(x, vec4(5612.0)); - z = mod(z, vec4(3.1415927 * 2.0)); - return(fract(cos(z) * vec4(56812.5453))); -} - -// Fast computed noise -// http://www.gamedev.net/topic/502913-fast-computed-noise/ - -const float A = 1.0; -const float B = 57.0; -const float C = 113.0; -const vec3 ABC = vec3(A, B, C); -const vec4 A3 = vec4(0, B, C, C+B); -const vec4 A4 = vec4(A, A+B, C+A, C+A+B); - -float cnoise4(const in vec3 xx) -{ - vec3 x = mod(xx + 32768.0, 65536.0); - vec3 ix = floor(x); - vec3 fx = fract(x); - vec3 wx = fx*fx*(3.0-2.0*fx); - float nn = dot(ix, ABC); - - vec4 N1 = nn + A3; - vec4 N2 = nn + A4; - vec4 R1 = randomizer4(N1); - vec4 R2 = randomizer4(N2); - vec4 R = mix(R1, R2, wx.x); - float re = mix(mix(R.x, R.y, wx.y), mix(R.z, R.w, wx.y), wx.z); - - return 1.0 - 2.0 * re; -} -float surface3 ( vec3 coord, float frequency ) { - - float n = 0.0; - - n += 1.0 * abs( cnoise4( coord * frequency ) ); - n += 0.5 * abs( cnoise4( coord * frequency * 2.0 ) ); - n += 0.25 * abs( cnoise4( coord * frequency * 4.0 ) ); - n += 0.125 * abs( cnoise4( coord * frequency * 8.0 ) ); - n += 0.0625 * abs( cnoise4( coord * frequency * 16.0 ) ); - - return n; -} - -void main( void ) { - float rads = radians(time*3.15); - vec2 position = gl_FragCoord.xy / resolution.xy; - position += rotate(position, rads); - float n = surface3(vec3(position*sin(time*0.1), time * 0.05)*mat3(1,0,0,0,.8,.6,0,-.6,.8),0.9); - float n2 = surface3(vec3(position*cos(time*0.1), time * 0.04)*mat3(1,0,0,0,.8,.6,0,-.6,.8),0.8); - float lum = length(n); - float lum2 = length(n2); - - vec3 tc = pow(vec3(1.0-lum),vec3(sin(position.x)+cos(time)+4.0,8.0+sin(time)+4.0,8.0)); - vec3 tc2 = pow(vec3(1.1-lum2),vec3(5.0,position.y+cos(time)+7.0,sin(position.x)+sin(time)+2.0)); - vec3 curr_color = (tc*0.8) + (tc2*0.5); - - - //Let's draw some stars - - float scale = sin(0.3 * time) + 5.0; - vec2 position2 = (((gl_FragCoord.xy / resolution) - 0.5) * scale); - float gradient = 0.0; - vec3 color = vec3(0.0); - float fade = 0.0; - float z = 0.0; - vec2 centered_coord = position2 - vec2(sin(time*0.1),sin(time*0.1)); - centered_coord = rotate(centered_coord, rads); - - for (float i=1.0; i<=60.0; i++) - { - vec2 star_pos = vec2(sin(i) * 250.0, sin(i*i*i) * 250.0); - float z = mod(i*i - 10.0*time, 256.0); - float fade = (256.0 - z) /256.0; - vec2 blob_coord = star_pos / z; - gradient += ((fade / 384.0) / pow(length(centered_coord - blob_coord), 1.5)) * ( fade); - } - - curr_color += gradient; - - gl_FragColor = vec4(curr_color, 1.0); -} \ No newline at end of file diff --git a/java/examples/Topics/Shaders/SepBlur/SepBlur.pde b/java/examples/Topics/Shaders/SepBlur/SepBlur.pde deleted file mode 100644 index e9e61a19b..000000000 --- a/java/examples/Topics/Shaders/SepBlur/SepBlur.pde +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Separate Blur Shader - * - * This blur shader works by applying two successive passes, one horizontal - * and the other vertical. - * - * Press the mouse to switch between the custom and default shader. - */ - -PShader blur; -PGraphics src; -PGraphics pass1, pass2; - -void setup() { - size(640, 360, P2D); - - blur = loadShader("blur.glsl"); - blur.set("blurSize", 9); - blur.set("sigma", 5.0f); - - src = createGraphics(width, height, P2D); - - pass1 = createGraphics(width, height, P2D); - pass1.noSmooth(); - - pass2 = createGraphics(width, height, P2D); - pass2.noSmooth(); -} - -void draw() { - src.beginDraw(); - src.background(0); - src.fill(255); - src.ellipse(width/2, height/2, 100, 100); - src.endDraw(); - - // Applying the blur shader along the vertical direction - blur.set("horizontalPass", 0); - pass1.beginDraw(); - pass1.shader(blur); - pass1.image(src, 0, 0); - pass1.endDraw(); - - // Applying the blur shader along the horizontal direction - blur.set("horizontalPass", 1); - pass2.beginDraw(); - pass2.shader(blur); - pass2.image(pass1, 0, 0); - pass2.endDraw(); - - image(pass2, 0, 0); -} - -void keyPressed() { - if (key == '9') { - blur.set("blurSize", 9); - blur.set("sigma", 5.0); - } else if (key == '7') { - blur.set("blurSize", 7); - blur.set("sigma", 3.0); - } else if (key == '5') { - blur.set("blurSize", 5); - blur.set("sigma", 2.0); - } else if (key == '3') { - blur.set("blurSize", 5); - blur.set("sigma", 1.0); - } -} diff --git a/java/examples/Topics/Shaders/SepBlur/data/blur.glsl b/java/examples/Topics/Shaders/SepBlur/data/blur.glsl deleted file mode 100644 index 1b15094c4..000000000 --- a/java/examples/Topics/Shaders/SepBlur/data/blur.glsl +++ /dev/null @@ -1,59 +0,0 @@ -// Adapted from: -// http://callumhay.blogspot.com/2010/09/gaussian-blur-shader-glsl.html - -#ifdef GL_ES -precision mediump float; -precision mediump int; -#endif - -#define PROCESSING_TEXTURE_SHADER - -uniform sampler2D texture; - -// The inverse of the texture dimensions along X and Y -uniform vec2 texOffset; - -varying vec4 vertColor; -varying vec4 vertTexCoord; - -uniform int blurSize; -uniform int horizontalPass; // 0 or 1 to indicate vertical or horizontal pass -uniform float sigma; // The sigma value for the gaussian function: higher value means more blur - // A good value for 9x9 is around 3 to 5 - // A good value for 7x7 is around 2.5 to 4 - // A good value for 5x5 is around 2 to 3.5 - // ... play around with this based on what you need :) - -const float pi = 3.14159265; - -void main() { - float numBlurPixelsPerSide = float(blurSize / 2); - - vec2 blurMultiplyVec = 0 < horizontalPass ? vec2(1.0, 0.0) : vec2(0.0, 1.0); - - // Incremental Gaussian Coefficent Calculation (See GPU Gems 3 pp. 877 - 889) - vec3 incrementalGaussian; - incrementalGaussian.x = 1.0 / (sqrt(2.0 * pi) * sigma); - incrementalGaussian.y = exp(-0.5 / (sigma * sigma)); - incrementalGaussian.z = incrementalGaussian.y * incrementalGaussian.y; - - vec4 avgValue = vec4(0.0, 0.0, 0.0, 0.0); - float coefficientSum = 0.0; - - // Take the central sample first... - avgValue += texture2D(texture, vertTexCoord.st) * incrementalGaussian.x; - coefficientSum += incrementalGaussian.x; - incrementalGaussian.xy *= incrementalGaussian.yz; - - // Go through the remaining 8 vertical samples (4 on each side of the center) - for (float i = 1.0; i <= numBlurPixelsPerSide; i++) { - avgValue += texture2D(texture, vertTexCoord.st - i * texOffset * - blurMultiplyVec) * incrementalGaussian.x; - avgValue += texture2D(texture, vertTexCoord.st + i * texOffset * - blurMultiplyVec) * incrementalGaussian.x; - coefficientSum += 2.0 * incrementalGaussian.x; - incrementalGaussian.xy *= incrementalGaussian.yz; - } - - gl_FragColor = avgValue / coefficientSum; -} \ No newline at end of file diff --git a/java/examples/Topics/Shaders/ToonShading/ToonShading.pde b/java/examples/Topics/Shaders/ToonShading/ToonShading.pde deleted file mode 100644 index 644a74c95..000000000 --- a/java/examples/Topics/Shaders/ToonShading/ToonShading.pde +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Toon Shading. - * - * Example showing the use of a custom lighting shader in order - * to apply a "toon" effect on the scene. Based on the glsl tutorial - * from lighthouse 3D: - * http://www.lighthouse3d.com/tutorials/glsl-tutorial/toon-shader-version-ii/ - */ - -PShader toon; -boolean shaderEnabled = true; - -void setup() { - size(640, 360, P3D); - noStroke(); - fill(204); - toon = loadShader("ToonFrag.glsl", "ToonVert.glsl"); -} - -void draw() { - if (shaderEnabled == true) { - shader(toon); - } - - noStroke(); - background(0); - float dirY = (mouseY / float(height) - 0.5) * 2; - float dirX = (mouseX / float(width) - 0.5) * 2; - directionalLight(204, 204, 204, -dirX, -dirY, -1); - translate(width/2, height/2); - sphere(120); -} - -void mousePressed() { - if (shaderEnabled) { - shaderEnabled = false; - resetShader(); - } - else { - shaderEnabled = true; - } -} - diff --git a/java/examples/Topics/Shaders/ToonShading/data/ToonFrag.glsl b/java/examples/Topics/Shaders/ToonShading/data/ToonFrag.glsl deleted file mode 100644 index 054bb0dfb..000000000 --- a/java/examples/Topics/Shaders/ToonShading/data/ToonFrag.glsl +++ /dev/null @@ -1,25 +0,0 @@ -#ifdef GL_ES -precision mediump float; -precision mediump int; -#endif - -varying vec3 vertNormal; -varying vec3 vertLightDir; - -void main() { - float intensity; - vec4 color; - intensity = max(0.0, dot(vertLightDir, vertNormal)); - - if (intensity > 0.95) { - color = vec4(1.0, 0.5, 0.5, 1.0); - } else if (intensity > 0.5) { - color = vec4(0.6, 0.3, 0.3, 1.0); - } else if (intensity > 0.25) { - color = vec4(0.4, 0.2, 0.2, 1.0); - } else { - color = vec4(0.2, 0.1, 0.1, 1.0); - } - - gl_FragColor = color; -} \ No newline at end of file diff --git a/java/examples/Topics/Shaders/ToonShading/data/ToonVert.glsl b/java/examples/Topics/Shaders/ToonShading/data/ToonVert.glsl deleted file mode 100644 index 01b77b2c9..000000000 --- a/java/examples/Topics/Shaders/ToonShading/data/ToonVert.glsl +++ /dev/null @@ -1,31 +0,0 @@ -// Toon shader using per-pixel lighting. Based on the glsl -// tutorial from lighthouse 3D: -// http://www.lighthouse3d.com/tutorials/glsl-tutorial/toon-shader-version-ii/ - -#define PROCESSING_LIGHT_SHADER - -uniform mat4 modelview; -uniform mat4 transform; -uniform mat3 normalMatrix; - -uniform vec3 lightNormal[8]; - -attribute vec4 vertex; -attribute vec3 normal; - -varying vec3 vertNormal; -varying vec3 vertLightDir; - -void main() { - // Vertex in clip coordinates - gl_Position = transform * vertex; - - // Normal vector in eye coordinates is passed - // to the fragment shader - vertNormal = normalize(normalMatrix * normal); - - // Assuming that there is only one directional light. - // Its normal vector is passed to the fragment shader - // in order to perform per-pixel lighting calculation. - vertLightDir = -lightNormal[0]; -} \ No newline at end of file diff --git a/java/examples/Topics/Simulate/Chain/Chain.pde b/java/examples/Topics/Simulate/Chain/Chain.pde deleted file mode 100644 index 8f05c4294..000000000 --- a/java/examples/Topics/Simulate/Chain/Chain.pde +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Chain. - * - * One mass is attached to the mouse position and the other - * is attached the position of the other mass. The gravity - * in the environment pulls down on both. - */ - - -Spring2D s1, s2; - -float gravity = 9.0; -float mass = 2.0; - -void setup() -{ - size(640, 360); - fill(255, 126); - // Inputs: x, y, mass, gravity - s1 = new Spring2D(0.0, width/2, mass, gravity); - s2 = new Spring2D(0.0, width/2, mass, gravity); -} - -void draw() -{ - background(0); - s1.update(mouseX, mouseY); - s1.display(mouseX, mouseY); - s2.update(s1.x, s1.y); - s2.display(s1.x, s1.y); -} - -class Spring2D { - float vx, vy; // The x- and y-axis velocities - float x, y; // The x- and y-coordinates - float gravity; - float mass; - float radius = 30; - float stiffness = 0.2; - float damping = 0.7; - - Spring2D(float xpos, float ypos, float m, float g) { - x = xpos; - y = ypos; - mass = m; - gravity = g; - } - - void update(float targetX, float targetY) { - float forceX = (targetX - x) * stiffness; - float ax = forceX / mass; - vx = damping * (vx + ax); - x += vx; - float forceY = (targetY - y) * stiffness; - forceY += gravity; - float ay = forceY / mass; - vy = damping * (vy + ay); - y += vy; - } - - void display(float nx, float ny) { - noStroke(); - ellipse(x, y, radius*2, radius*2); - stroke(255); - line(x, y, nx, ny); - } -} diff --git a/java/examples/Topics/Simulate/Flocking/Boid.pde b/java/examples/Topics/Simulate/Flocking/Boid.pde deleted file mode 100644 index a7f425451..000000000 --- a/java/examples/Topics/Simulate/Flocking/Boid.pde +++ /dev/null @@ -1,202 +0,0 @@ -// The Boid class - -class Boid { - - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Boid(float x, float y) { - acceleration = new PVector(0, 0); - - // This is a new PVector method not yet implemented in JS - // velocity = PVector.random2D(); - - // Leaving the code temporarily this way so that this example runs in JS - float angle = random(TWO_PI); - velocity = new PVector(cos(angle), sin(angle)); - - location = new PVector(x, y); - r = 2.0; - maxspeed = 2; - maxforce = 0.03; - } - - void run(ArrayList boids) { - flock(boids); - update(); - borders(); - render(); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // We accumulate a new acceleration each time based on three rules - void flock(ArrayList boids) { - PVector sep = separate(boids); // Separation - PVector ali = align(boids); // Alignment - PVector coh = cohesion(boids); // Cohesion - // Arbitrarily weight these forces - sep.mult(1.5); - ali.mult(1.0); - coh.mult(1.0); - // Add the force vectors to acceleration - applyForce(sep); - applyForce(ali); - applyForce(coh); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - // A method that calculates and applies a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - PVector seek(PVector target) { - PVector desired = PVector.sub(target, location); // A vector pointing from the location to the target - // Scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - - // Above two lines of code below could be condensed with new PVector setMag() method - // Not using this method until Processing.js catches up - // desired.setMag(maxspeed); - - // Steering = Desired minus Velocity - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); // Limit to maximum steering force - return steer; - } - - void render() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - // heading2D() above is now heading() but leaving old syntax until Processing.js catches up - - fill(200, 100); - stroke(255); - pushMatrix(); - translate(location.x, location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } - - // Separation - // Method checks for nearby boids and steers away - PVector separate (ArrayList boids) { - float desiredseparation = 25.0f; - PVector steer = new PVector(0, 0, 0); - int count = 0; - // For every boid in the system, check if it's too close - for (Boid other : boids) { - float d = PVector.dist(location, other.location); - // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) - if ((d > 0) && (d < desiredseparation)) { - // Calculate vector pointing away from neighbor - PVector diff = PVector.sub(location, other.location); - diff.normalize(); - diff.div(d); // Weight by distance - steer.add(diff); - count++; // Keep track of how many - } - } - // Average -- divide by how many - if (count > 0) { - steer.div((float)count); - } - - // As long as the vector is greater than 0 - if (steer.mag() > 0) { - // First two lines of code below could be condensed with new PVector setMag() method - // Not using this method until Processing.js catches up - // steer.setMag(maxspeed); - - // Implement Reynolds: Steering = Desired - Velocity - steer.normalize(); - steer.mult(maxspeed); - steer.sub(velocity); - steer.limit(maxforce); - } - return steer; - } - - // Alignment - // For every nearby boid in the system, calculate the average velocity - PVector align (ArrayList boids) { - float neighbordist = 50; - PVector sum = new PVector(0, 0); - int count = 0; - for (Boid other : boids) { - float d = PVector.dist(location, other.location); - if ((d > 0) && (d < neighbordist)) { - sum.add(other.velocity); - count++; - } - } - if (count > 0) { - sum.div((float)count); - // First two lines of code below could be condensed with new PVector setMag() method - // Not using this method until Processing.js catches up - // sum.setMag(maxspeed); - - // Implement Reynolds: Steering = Desired - Velocity - sum.normalize(); - sum.mult(maxspeed); - PVector steer = PVector.sub(sum, velocity); - steer.limit(maxforce); - return steer; - } - else { - return new PVector(0, 0); - } - } - - // Cohesion - // For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location - PVector cohesion (ArrayList boids) { - float neighbordist = 50; - PVector sum = new PVector(0, 0); // Start with empty vector to accumulate all locations - int count = 0; - for (Boid other : boids) { - float d = PVector.dist(location, other.location); - if ((d > 0) && (d < neighbordist)) { - sum.add(other.location); // Add location - count++; - } - } - if (count > 0) { - sum.div(count); - return seek(sum); // Steer towards the location - } - else { - return new PVector(0, 0); - } - } -} - diff --git a/java/examples/Topics/Simulate/Flocking/Flock.pde b/java/examples/Topics/Simulate/Flocking/Flock.pde deleted file mode 100644 index cea728a78..000000000 --- a/java/examples/Topics/Simulate/Flocking/Flock.pde +++ /dev/null @@ -1,21 +0,0 @@ -// The Flock (a list of Boid objects) - -class Flock { - ArrayList boids; // An ArrayList for all the boids - - Flock() { - boids = new ArrayList(); // Initialize the ArrayList - } - - void run() { - for (Boid b : boids) { - b.run(boids); // Passing the entire list of boids to each boid individually - } - } - - void addBoid(Boid b) { - boids.add(b); - } - -} - diff --git a/java/examples/Topics/Simulate/Flocking/Flocking.pde b/java/examples/Topics/Simulate/Flocking/Flocking.pde deleted file mode 100644 index ac7302217..000000000 --- a/java/examples/Topics/Simulate/Flocking/Flocking.pde +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Flocking - * by Daniel Shiffman. - * - * An implementation of Craig Reynold's Boids program to simulate - * the flocking behavior of birds. Each boid steers itself based on - * rules of avoidance, alignment, and coherence. - * - * Click the mouse to add a new boid. - */ - -Flock flock; - -void setup() { - size(640, 360); - flock = new Flock(); - // Add an initial set of boids into the system - for (int i = 0; i < 150; i++) { - flock.addBoid(new Boid(width/2,height/2)); - } -} - -void draw() { - background(50); - flock.run(); -} - -// Add a new boid into the System -void mousePressed() { - flock.addBoid(new Boid(mouseX,mouseY)); -} diff --git a/java/examples/Topics/Simulate/ForcesWithVectors/ForcesWithVectors.pde b/java/examples/Topics/Simulate/ForcesWithVectors/ForcesWithVectors.pde deleted file mode 100644 index f56783423..000000000 --- a/java/examples/Topics/Simulate/ForcesWithVectors/ForcesWithVectors.pde +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Forces (Gravity and Fluid Resistence) with Vectors - * by Daniel Shiffman. - * - * Demonstration of multiple force acting on bodies (Mover class) - * Bodies experience gravity continuously - * Bodies experience fluid resistance when in "water" - * - * For the basics of working with PVector, see - * http://processing.org/learning/pvector/ - * as well as examples in Topics/Vectors/ - * - */ - -// Five moving bodies -Mover[] movers = new Mover[10]; - -// Liquid -Liquid liquid; - -void setup() { - size(640, 360); - reset(); - // Create liquid object - liquid = new Liquid(0, height/2, width, height/2, 0.1); -} - -void draw() { - background(0); - - // Draw water - liquid.display(); - - for (int i = 0; i < movers.length; i++) { - - // Is the Mover in the liquid? - if (liquid.contains(movers[i])) { - // Calculate drag force - PVector drag = liquid.drag(movers[i]); - // Apply drag force to Mover - movers[i].applyForce(drag); - } - - // Gravity is scaled by mass here! - PVector gravity = new PVector(0, 0.1*movers[i].mass); - // Apply gravity - movers[i].applyForce(gravity); - - // Update and display - movers[i].update(); - movers[i].display(); - movers[i].checkEdges(); - } - - fill(255); - text("click mouse to reset",10,30); - -} - -void mousePressed() { - reset(); -} - -// Restart all the Mover objects randomly -void reset() { - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(0.5, 3), 40+i*70, 0); - } -} - - - - - - - diff --git a/java/examples/Topics/Simulate/ForcesWithVectors/Liquid.pde b/java/examples/Topics/Simulate/ForcesWithVectors/Liquid.pde deleted file mode 100644 index 98ccfe34d..000000000 --- a/java/examples/Topics/Simulate/ForcesWithVectors/Liquid.pde +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Forces (Gravity and Fluid Resistence) with Vectors - * by Daniel Shiffman. - * - * Demonstration of multiple force acting on bodies (Mover class) - * Bodies experience gravity continuously - * Bodies experience fluid resistance when in "water" - */ - - // Liquid class - class Liquid { - - - // Liquid is a rectangle - float x,y,w,h; - // Coefficient of drag - float c; - - Liquid(float x_, float y_, float w_, float h_, float c_) { - x = x_; - y = y_; - w = w_; - h = h_; - c = c_; - } - - // Is the Mover in the Liquid? - boolean contains(Mover m) { - PVector l = m.location; - if (l.x > x && l.x < x + w && l.y > y && l.y < y + h) { - return true; - } - else { - return false; - } - } - - // Calculate drag force - PVector drag(Mover m) { - // Magnitude is coefficient * speed squared - float speed = m.velocity.mag(); - float dragMagnitude = c * speed * speed; - - // Direction is inverse of velocity - PVector drag = m.velocity.get(); - drag.mult(-1); - - // Scale according to magnitude - drag.setMag(dragMagnitude); - return drag; - } - - void display() { - noStroke(); - fill(127); - rect(x,y,w,h); - } - -} - diff --git a/java/examples/Topics/Simulate/ForcesWithVectors/Mover.pde b/java/examples/Topics/Simulate/ForcesWithVectors/Mover.pde deleted file mode 100644 index b14754b71..000000000 --- a/java/examples/Topics/Simulate/ForcesWithVectors/Mover.pde +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Forces (Gravity and Fluid Resistence) with Vectors - * by Daniel Shiffman. - * - * Demonstration of multiple force acting on bodies (Mover class) - * Bodies experience gravity continuously - * Bodies experience fluid resistance when in "water" - */ - - -class Mover { - - // location, velocity, and acceleration - PVector location; - PVector velocity; - PVector acceleration; - - // Mass is tied to size - float mass; - - Mover(float m, float x, float y) { - mass = m; - location = new PVector(x, y); - velocity = new PVector(0, 0); - acceleration = new PVector(0, 0); - } - - // Newton's 2nd law: F = M * A - // or A = F / M - void applyForce(PVector force) { - // Divide by mass - PVector f = PVector.div(force, mass); - // Accumulate all forces in acceleration - acceleration.add(f); - } - - void update() { - - // Velocity changes according to acceleration - velocity.add(acceleration); - // Location changes by velocity - location.add(velocity); - // We must clear acceleration each frame - acceleration.mult(0); - } - - // Draw Mover - void display() { - stroke(255); - strokeWeight(2); - fill(255, 200); - ellipse(location.x, location.y, mass*16, mass*16); - } - - // Bounce off bottom of window - void checkEdges() { - if (location.y > height) { - velocity.y *= -0.9; // A little dampening when hitting the bottom - location.y = height; - } - } -} - - diff --git a/java/examples/Topics/Simulate/GravitationalAttraction3D/GravitationalAttraction3D.pde b/java/examples/Topics/Simulate/GravitationalAttraction3D/GravitationalAttraction3D.pde deleted file mode 100644 index 6a0c3dbbc..000000000 --- a/java/examples/Topics/Simulate/GravitationalAttraction3D/GravitationalAttraction3D.pde +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Gravitational Attraction (3D) - * by Daniel Shiffman. - * - * Simulating gravitational attraction - * G ---> universal gravitational constant - * m1 --> mass of object #1 - * m2 --> mass of object #2 - * d ---> distance between objects - * F = (G*m1*m2)/(d*d) - * - * For the basics of working with PVector, see - * http://processing.org/learning/pvector/ - * as well as examples in Topics/Vectors/ - * - */ - -// A bunch of planets -Planet[] planets = new Planet[10]; -// One sun (note sun is not attracted to planets (violation of Newton's 3rd Law) -Sun s; - -// An angle to rotate around the scene -float angle = 0; - -void setup() { - size(640, 360, P3D); - smooth(); - // Some random planets - for (int i = 0; i < planets.length; i++) { - planets[i] = new Planet(random(0.1, 2), random(-width/2, width/2), random(-height/2, height/2), random(-100, 100)); - } - // A single sun - s = new Sun(); -} - -void draw() { - background(0); - // Setup the scene - sphereDetail(8); - lights(); - translate(width/2, height/2); - rotateY(angle); - - - // Display the Sun - s.display(); - - // All the Planets - for (int i = 0; i < planets.length; i++) { - // Sun attracts Planets - PVector force = s.attract(planets[i]); - planets[i].applyForce(force); - // Update and draw Planets - planets[i].update(); - planets[i].display(); - } - - // Rotate around the scene - angle += 0.003; -} - - - - - - - - - - diff --git a/java/examples/Topics/Simulate/GravitationalAttraction3D/Planet.pde b/java/examples/Topics/Simulate/GravitationalAttraction3D/Planet.pde deleted file mode 100644 index ae8be2537..000000000 --- a/java/examples/Topics/Simulate/GravitationalAttraction3D/Planet.pde +++ /dev/null @@ -1,45 +0,0 @@ -// Gravitational Attraction (3D) -// Daniel Shiffman - -// A class for an orbiting Planet - -class Planet { - - // Basic physics model (location, velocity, acceleration, mass) - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Planet(float m, float x, float y, float z) { - mass = m; - location = new PVector(x,y,z); - velocity = new PVector(1,0); // Arbitrary starting velocity - acceleration = new PVector(0,0); - } - - // Newton's 2nd Law (F = M*A) applied - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - // Our motion algorithm (aka Euler Integration) - void update() { - velocity.add(acceleration); // Velocity changes according to acceleration - location.add(velocity); // Location changes according to velocity - acceleration.mult(0); - } - - // Draw the Planet - void display() { - noStroke(); - fill(255); - pushMatrix(); - translate(location.x,location.y,location.z); - sphere(mass*8); - popMatrix(); - } -} - - diff --git a/java/examples/Topics/Simulate/GravitationalAttraction3D/Sun.pde b/java/examples/Topics/Simulate/GravitationalAttraction3D/Sun.pde deleted file mode 100644 index 10fcc0373..000000000 --- a/java/examples/Topics/Simulate/GravitationalAttraction3D/Sun.pde +++ /dev/null @@ -1,38 +0,0 @@ -// Gravitational Attraction (3D) -// Daniel Shiffman - -// A class for an attractive body in our world - -class Sun { - float mass; // Mass, tied to size - PVector location; // Location - float G; // Universal gravitational constant (arbitrary value) - - Sun() { - location = new PVector(0,0); - mass = 20; - G = 0.4; - } - - - PVector attract(Planet m) { - PVector force = PVector.sub(location,m.location); // Calculate direction of force - float d = force.mag(); // Distance between objects - d = constrain(d,5.0,25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - float strength = (G * mass * m.mass) / (d * d); // Calculate gravitional force magnitude - force.setMag(strength); // Get force vector --> magnitude * direction - return force; - } - - // Draw Sun - void display() { - stroke(255); - noFill(); - pushMatrix(); - translate(location.x,location.y,location.z); - sphere(mass*2); - popMatrix(); - } -} - - diff --git a/java/examples/Topics/Simulate/MultipleParticleSystems/CrazyParticle.pde b/java/examples/Topics/Simulate/MultipleParticleSystems/CrazyParticle.pde deleted file mode 100644 index 9c77dc6e3..000000000 --- a/java/examples/Topics/Simulate/MultipleParticleSystems/CrazyParticle.pde +++ /dev/null @@ -1,40 +0,0 @@ -// A subclass of Particle - -class CrazyParticle extends Particle { - - // Just adding one new variable to a CrazyParticle - // It inherits all other fields from "Particle", and we don't have to retype them! - float theta; - - // The CrazyParticle constructor can call the parent class (super class) constructor - CrazyParticle(PVector l) { - // "super" means do everything from the constructor in Particle - super(l); - // One more line of code to deal with the new variable, theta - theta = 0.0; - } - - // Notice we don't have the method run() here; it is inherited from Particle - - // This update() method overrides the parent class update() method - void update() { - super.update(); - // Increment rotation based on horizontal velocity - float theta_vel = (velocity.x * velocity.mag()) / 10.0f; - theta += theta_vel; - } - - // This display() method overrides the parent class display() method - void display() { - // Render the ellipse just like in a regular particle - super.display(); - // Then add a rotating line - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - stroke(255,lifespan); - line(0,0,25,0); - popMatrix(); - } - -} diff --git a/java/examples/Topics/Simulate/MultipleParticleSystems/MultipleParticleSystems.pde b/java/examples/Topics/Simulate/MultipleParticleSystems/MultipleParticleSystems.pde deleted file mode 100644 index 5bc038e7d..000000000 --- a/java/examples/Topics/Simulate/MultipleParticleSystems/MultipleParticleSystems.pde +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Multiple Particle Systems - * by Daniel Shiffman. - * - * Click the mouse to generate a burst of particles - * at mouse location. - * - * Each burst is one instance of a particle system - * with Particles and CrazyParticles (a subclass of Particle) - * Note use of Inheritance and Polymorphism here. - */ - -ArrayList systems; - -void setup() { - size(640, 360); - systems = new ArrayList(); -} - -void draw() { - background(0); - for (ParticleSystem ps: systems) { - ps.run(); - ps.addParticle(); - } - if (systems.isEmpty()) { - fill(255); - textAlign(CENTER); - text("click mouse to add particle systems", width/2, height/2); - } -} - -void mousePressed() { - systems.add(new ParticleSystem(1, new PVector(mouseX, mouseY))); -} diff --git a/java/examples/Topics/Simulate/MultipleParticleSystems/Particle.pde b/java/examples/Topics/Simulate/MultipleParticleSystems/Particle.pde deleted file mode 100644 index 078ef23c5..000000000 --- a/java/examples/Topics/Simulate/MultipleParticleSystems/Particle.pde +++ /dev/null @@ -1,40 +0,0 @@ -// A simple Particle class - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0,0.05); - velocity = new PVector(random(-1,1),random(-2,0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(255,lifespan); - fill(255,lifespan); - ellipse(location.x,location.y,8,8); - } - - // Is the particle still useful? - boolean isDead() { - return (lifespan < 0.0); - } - -} diff --git a/java/examples/Topics/Simulate/MultipleParticleSystems/ParticleSystem.pde b/java/examples/Topics/Simulate/MultipleParticleSystems/ParticleSystem.pde deleted file mode 100644 index 7b5586835..000000000 --- a/java/examples/Topics/Simulate/MultipleParticleSystems/ParticleSystem.pde +++ /dev/null @@ -1,49 +0,0 @@ -// An ArrayList is used to manage the list of Particles - -class ParticleSystem { - - ArrayList particles; // An arraylist for all the particles - PVector origin; // An origin point for where particles are birthed - - ParticleSystem(int num, PVector v) { - particles = new ArrayList(); // Initialize the arraylist - origin = v.get(); // Store the origin point - for (int i = 0; i < num; i++) { - particles.add(new Particle(origin)); // Add "num" amount of particles to the arraylist - } - } - - - void run() { - // Cycle through the ArrayList backwards, because we are deleting while iterating - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } - - void addParticle() { - Particle p; - // Add either a Particle or CrazyParticle to the system - if (int(random(0, 2)) == 0) { - p = new Particle(origin); - } - else { - p = new CrazyParticle(origin); - } - particles.add(p); - } - - void addParticle(Particle p) { - particles.add(p); - } - - // A method to test if the particle system still has particles - boolean dead() { - return particles.isEmpty(); - } -} - diff --git a/java/examples/Topics/Simulate/SimpleParticleSystem/Particle.pde b/java/examples/Topics/Simulate/SimpleParticleSystem/Particle.pde deleted file mode 100644 index 44a592d66..000000000 --- a/java/examples/Topics/Simulate/SimpleParticleSystem/Particle.pde +++ /dev/null @@ -1,44 +0,0 @@ -// A simple Particle class - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0,0.05); - velocity = new PVector(random(-1,1),random(-2,0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 1.0; - } - - // Method to display - void display() { - stroke(255,lifespan); - fill(255,lifespan); - ellipse(location.x,location.y,8,8); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - diff --git a/java/examples/Topics/Simulate/SimpleParticleSystem/ParticleSystem.pde b/java/examples/Topics/Simulate/SimpleParticleSystem/ParticleSystem.pde deleted file mode 100644 index bd5937e77..000000000 --- a/java/examples/Topics/Simulate/SimpleParticleSystem/ParticleSystem.pde +++ /dev/null @@ -1,26 +0,0 @@ -// A class to describe a group of Particles -// An ArrayList is used to manage the list of Particles - -class ParticleSystem { - ArrayList particles; - PVector origin; - - ParticleSystem(PVector location) { - origin = location.get(); - particles = new ArrayList(); - } - - void addParticle() { - particles.add(new Particle(origin)); - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} diff --git a/java/examples/Topics/Simulate/SimpleParticleSystem/SimpleParticleSystem.pde b/java/examples/Topics/Simulate/SimpleParticleSystem/SimpleParticleSystem.pde deleted file mode 100644 index 9b46822f1..000000000 --- a/java/examples/Topics/Simulate/SimpleParticleSystem/SimpleParticleSystem.pde +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Simple Particle System - * by Daniel Shiffman. - * - * Particles are generated each cycle through draw(), - * fall with gravity and fade out over time - * A ParticleSystem object manages a variable size (ArrayList) - * list of particles. - */ - -ParticleSystem ps; - -void setup() { - size(640,360); - ps = new ParticleSystem(new PVector(width/2,50)); -} - -void draw() { - background(0); - ps.addParticle(); - ps.run(); -} - - diff --git a/java/examples/Topics/Simulate/SmokeParticleSystem/Particle.pde b/java/examples/Topics/Simulate/SmokeParticleSystem/Particle.pde deleted file mode 100644 index 3351e144c..000000000 --- a/java/examples/Topics/Simulate/SmokeParticleSystem/Particle.pde +++ /dev/null @@ -1,60 +0,0 @@ - -// A simple Particle class, renders the particle as an image - -class Particle { - PVector loc; - PVector vel; - PVector acc; - float lifespan; - PImage img; - - Particle(PVector l,PImage img_) { - acc = new PVector(0,0); - float vx = randomGaussian()*0.3; - float vy = randomGaussian()*0.3 - 1.0; - vel = new PVector(vx,vy); - loc = l.get(); - lifespan = 100.0; - img = img_; - } - - void run() { - update(); - render(); - } - - // Method to apply a force vector to the Particle object - // Note we are ignoring "mass" here - void applyForce(PVector f) { - acc.add(f); - } - - // Method to update location - void update() { - vel.add(acc); - loc.add(vel); - lifespan -= 2.5; - acc.mult(0); // clear Acceleration - } - - // Method to display - void render() { - imageMode(CENTER); - tint(255,lifespan); - image(img,loc.x,loc.y); - // Drawing a circle instead - // fill(255,lifespan); - // noStroke(); - // ellipse(loc.x,loc.y,img.width,img.height); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan <= 0.0) { - return true; - } else { - return false; - } - } -} - diff --git a/java/examples/Topics/Simulate/SmokeParticleSystem/ParticleSystem.pde b/java/examples/Topics/Simulate/SmokeParticleSystem/ParticleSystem.pde deleted file mode 100644 index 5c2d5bcab..000000000 --- a/java/examples/Topics/Simulate/SmokeParticleSystem/ParticleSystem.pde +++ /dev/null @@ -1,44 +0,0 @@ -// A class to describe a group of Particles -// An ArrayList is used to manage the list of Particles - -class ParticleSystem { - - ArrayList particles; // An arraylist for all the particles - PVector origin; // An origin point for where particles are birthed - PImage img; - - ParticleSystem(int num, PVector v, PImage img_) { - particles = new ArrayList(); // Initialize the arraylist - origin = v.get(); // Store the origin point - img = img_; - for (int i = 0; i < num; i++) { - particles.add(new Particle(origin, img)); // Add "num" amount of particles to the arraylist - } - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } - - // Method to add a force vector to all particles currently in the system - void applyForce(PVector dir) { - // Enhanced loop!!! - for (Particle p: particles) { - p.applyForce(dir); - } - - } - - void addParticle() { - particles.add(new Particle(origin,img)); - } - -} - - diff --git a/java/examples/Topics/Simulate/SmokeParticleSystem/SmokeParticleSystem.pde b/java/examples/Topics/Simulate/SmokeParticleSystem/SmokeParticleSystem.pde deleted file mode 100644 index 23be99484..000000000 --- a/java/examples/Topics/Simulate/SmokeParticleSystem/SmokeParticleSystem.pde +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Smoke Particle System - * by Daniel Shiffman. - * - * A basic smoke effect using a particle system. Each particle - * is rendered as an alpha masked image. - */ - -// @pjs preload must be used to preload media if the program is -// running with Processing.js -/* @pjs preload="texture.png"; */ - -ParticleSystem ps; - -void setup() { - size(640,360); - PImage img = loadImage("texture.png"); - ps = new ParticleSystem(0,new PVector(width/2,height-60),img); -} - -void draw() { - background(0); - - // Calculate a "wind" force based on mouse horizontal position - float dx = map(mouseX,0,width,-0.2,0.2); - PVector wind = new PVector(dx,0); - ps.applyForce(wind); - ps.run(); - for (int i = 0; i < 2; i++) { - ps.addParticle(); - } - - // Draw an arrow representing the wind force - drawVector(wind, new PVector(width/2,50,0),500); - -} - -// Renders a vector object 'v' as an arrow and a location 'loc' -void drawVector(PVector v, PVector loc, float scayl) { - pushMatrix(); - float arrowsize = 4; - // Translate to location to render vector - translate(loc.x,loc.y); - stroke(255); - // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate - rotate(v.heading()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) - line(0,0,len,0); - line(len,0,len-arrowsize,+arrowsize/2); - line(len,0,len-arrowsize,-arrowsize/2); - popMatrix(); -} diff --git a/java/examples/Topics/Simulate/SmokeParticleSystem/data/texture.gif b/java/examples/Topics/Simulate/SmokeParticleSystem/data/texture.gif deleted file mode 100644 index 17e84e806..000000000 Binary files a/java/examples/Topics/Simulate/SmokeParticleSystem/data/texture.gif and /dev/null differ diff --git a/java/examples/Topics/Simulate/SoftBody/SoftBody.pde b/java/examples/Topics/Simulate/SoftBody/SoftBody.pde deleted file mode 100644 index b0eb8f826..000000000 --- a/java/examples/Topics/Simulate/SoftBody/SoftBody.pde +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Soft Body - * by Ira Greenberg. - * - * Softbody dynamics simulation using curveVertex() and curveTightness(). - */ - -// center point -float centerX = 0, centerY = 0; - -float radius = 45, rotAngle = -90; -float accelX, accelY; -float springing = .0009, damping = .98; - -//corner nodes -int nodes = 5; -float nodeStartX[] = new float[nodes]; -float nodeStartY[] = new float[nodes]; -float[]nodeX = new float[nodes]; -float[]nodeY = new float[nodes]; -float[]angle = new float[nodes]; -float[]frequency = new float[nodes]; - -// soft-body dynamics -float organicConstant = 1; - -void setup() { - size(640, 360); - //center shape in window - centerX = width/2; - centerY = height/2; - // iniitalize frequencies for corner nodes - for (int i=0; i left && mouseX < right && mouseY > ps && mouseY < ps + springHeight) { - over = true; - } else { - over = false; - } - - // Set and constrain the position of top bar - if(move) { - ps = mouseY - springHeight/2; - ps = constrain(ps, min, max); - } -} - -void mousePressed() { - if(over) { - move = true; - } -} - -void mouseReleased() { - move = false; -} diff --git a/java/examples/Topics/Simulate/Springs/Springs.pde b/java/examples/Topics/Simulate/Springs/Springs.pde deleted file mode 100644 index 06c2e3048..000000000 --- a/java/examples/Topics/Simulate/Springs/Springs.pde +++ /dev/null @@ -1,161 +0,0 @@ -/** - * Springs. - * - * Move the mouse over one of the circles and click to re-position. - * When you release the mouse, it will snap back into position. - * Each circle has a slightly different behavior. - */ - - -int num = 3; -Spring[] springs = new Spring[num]; - -void setup() -{ - size(640, 360); - noStroke(); - springs[0] = new Spring(240, 260, 40, 0.98, 8.0, 0.1, springs, 0); - springs[1] = new Spring(320, 210, 120, 0.95, 9.0, 0.1, springs, 1); - springs[2] = new Spring(180, 170, 200, 0.90, 9.9, 0.1, springs, 2); -} - -void draw() -{ - background(51); - - for (int i = 0; i < num; i++) { - springs[i].update(); - springs[i].display(); - } -} - -void mousePressed() -{ - for (int i = 0; i < num; i++) { - springs[i].pressed(); - } -} - -void mouseReleased() -{ - for (int i=0; i width) || (location.x < 0)) { - velocity.x = velocity.x * -1; - } - if (location.y > height) { - // We're reducing velocity ever so slightly - // when it hits the bottom of the window - velocity.y = velocity.y * -0.95; - location.y = height; - } - - // Display circle at location vector - stroke(255); - strokeWeight(2); - fill(127); - ellipse(location.x,location.y,48,48); -} - - diff --git a/java/examples/Topics/Vectors/VectorMath/VectorMath.pde b/java/examples/Topics/Vectors/VectorMath/VectorMath.pde deleted file mode 100644 index 3a3804881..000000000 --- a/java/examples/Topics/Vectors/VectorMath/VectorMath.pde +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Vector - * by Daniel Shiffman. - * - * Demonstration some basic vector math: subtraction, normalization, scaling - * Normalizing a vector sets its length to 1. - */ - -void setup() { - size(640,360); - smooth(); -} - -void draw() { - background(0); - - // A vector that points to the mouse location - PVector mouse = new PVector(mouseX,mouseY); - // A vector that points to the center of the window - PVector center = new PVector(width/2,height/2); - // Subtract center from mouse which results in a vector that points from center to mouse - mouse.sub(center); - - // Normalize the vector - mouse.normalize(); - - // Multiply its length by 150 (Scaling its length) - mouse.mult(150); - - translate(width/2,height/2); - // Draw the resulting vector - stroke(255); - strokeWeight(4); - line(0,0,mouse.x,mouse.y); - -} - - diff --git a/java/libraries/minim/examples/AnalyzeSound/AnalyzeSound.pde b/java/libraries/minim/examples/AnalyzeSound/AnalyzeSound.pde deleted file mode 100644 index 46bdec13a..000000000 --- a/java/libraries/minim/examples/AnalyzeSound/AnalyzeSound.pde +++ /dev/null @@ -1,58 +0,0 @@ -/** - * This sketch demonstrates how to use an FFT to analyze - * the audio being generated by an AudioPlayer. - *

- * FFT stands for Fast Fourier Transform, which is a - * method of analyzing audio that allows you to visualize - * the frequency content of a signal. You've seen - * visualizations like this before in music players - * and car stereos. - *

- * For more information about Minim and additional features, - * visit http://code.compartmental.net/minim/ - */ - -import ddf.minim.analysis.*; -import ddf.minim.*; - -Minim minim; -AudioPlayer jingle; -FFT fft; - -void setup() -{ - size(512, 200, P3D); - - minim = new Minim(this); - - // specify that we want the audio buffers of the AudioPlayer - // to be 1024 samples long because our FFT needs to have - // a power-of-two buffer size and this is a good size. - jingle = minim.loadFile("jingle.mp3", 1024); - - // loop the file indefinitely - jingle.loop(); - - // create an FFT object that has a time-domain buffer - // the same size as jingle's sample buffer - // note that this needs to be a power of two - // and that it means the size of the spectrum will be half as large. - fft = new FFT( jingle.bufferSize(), jingle.sampleRate() ); - -} - -void draw() -{ - background(0); - stroke(255); - - // perform a forward FFT on the samples in jingle's mix buffer, - // which contains the mix of both the left and right channels of the file - fft.forward( jingle.mix ); - - for(int i = 0; i < fft.specSize(); i++) - { - // draw the line for frequency band i, scaling it up a bit so we can see it - line( i, height, i, height - fft.getBand(i)*8 ); - } -} diff --git a/java/libraries/minim/examples/AnalyzeSound/data/jingle.mp3 b/java/libraries/minim/examples/AnalyzeSound/data/jingle.mp3 deleted file mode 100644 index 8774a7632..000000000 Binary files a/java/libraries/minim/examples/AnalyzeSound/data/jingle.mp3 and /dev/null differ diff --git a/java/libraries/minim/examples/CreateAnInstrument/CreateAnInstrument.pde b/java/libraries/minim/examples/CreateAnInstrument/CreateAnInstrument.pde deleted file mode 100644 index e43c3f339..000000000 --- a/java/libraries/minim/examples/CreateAnInstrument/CreateAnInstrument.pde +++ /dev/null @@ -1,85 +0,0 @@ -/** - * This sketch demonstrates how to create synthesized sound with Minim using an AudioOutput and - * an Instrument we define. By using the playNote method you can schedule notes to played - * at some point in the future, essentially allowing to you create musical scores with code. - * Because they are constructed with code, they can be either deterministic or different every time. - * This sketch creates a deterministic score, meaning it is the same every time you run the sketch. - *

- * For more complex examples of using playNote check out algorithmicCompExample and compositionExample - * in the Synthesis folder. - *

- * For more information about Minim and additional features, visit http://code.compartmental.net/minim/ - */ - -import ddf.minim.*; -import ddf.minim.ugens.*; - -Minim minim; -AudioOutput out; - -// to make an Instrument we must define a class -// that implements the Instrument interface. -class SineInstrument implements Instrument -{ - Oscil wave; - Line ampEnv; - - SineInstrument( float frequency ) - { - // make a sine wave oscillator - // the amplitude is zero because - // we are going to patch a Line to it anyway - wave = new Oscil( frequency, 0, Waves.SINE ); - ampEnv = new Line(); - ampEnv.patch( wave.amplitude ); - } - - // this is called by the sequencer when this instrument - // should start making sound. the duration is expressed in seconds. - void noteOn( float duration ) - { - // start the amplitude envelope - ampEnv.activate( duration, 0.5f, 0 ); - // attach the oscil to the output so it makes sound - wave.patch( out ); - } - - // this is called by the sequencer when the instrument should - // stop making sound - void noteOff() - { - wave.unpatch( out ); - } -} - -void setup() -{ - size(512, 200, P3D); - - minim = new Minim(this); - - // use the getLineOut method of the Minim object to get an AudioOutput object - out = minim.getLineOut(); - - // when providing an Instrument, we always specify start time and duration - out.playNote( 0.0, 0.9, new SineInstrument( 97.99 ) ); - out.playNote( 1.0, 0.9, new SineInstrument( 123.47 ) ); - - // we can use the Frequency class to create frequencies from pitch names - out.playNote( 2.0, 2.9, new SineInstrument( Frequency.ofPitch( "C3" ).asHz() ) ); - out.playNote( 3.0, 1.9, new SineInstrument( Frequency.ofPitch( "E3" ).asHz() ) ); - out.playNote( 4.0, 0.9, new SineInstrument( Frequency.ofPitch( "G3" ).asHz() ) ); -} - -void draw() -{ - background(0); - stroke(255); - - // draw the waveforms - for(int i = 0; i < out.bufferSize() - 1; i++) - { - line( i, 50 + out.left.get(i)*50, i+1, 50 + out.left.get(i+1)*50 ); - line( i, 150 + out.right.get(i)*50, i+1, 150 + out.right.get(i+1)*50 ); - } -} diff --git a/java/libraries/minim/examples/GetMetaData/GetMetaData.pde b/java/libraries/minim/examples/GetMetaData/GetMetaData.pde deleted file mode 100644 index 717152ba2..000000000 --- a/java/libraries/minim/examples/GetMetaData/GetMetaData.pde +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Get Meta Data - * by Damien Di Fede. - * - * This sketch demonstrates how to use the getMetaData - * method of AudioPlayer. This method is also available - * for AudioSnippet and AudioSample. - * You should use this method when you want to retrieve metadata - * about a file that you have loaded, like ID3 tags from an mp3 file. - * If you load WAV file or other non-tagged file, most of the metadata - * will be empty, but you will still have information like the filename - * and the length. - *

- * For more information about Minim and additional features, - * visit http://code.compartmental.net/minim/ - */ - -import ddf.minim.*; - -Minim minim; -AudioPlayer groove; -AudioMetaData meta; - -void setup() -{ - size(512, 256, P2D); - - minim = new Minim(this); - groove = minim.loadFile("groove.mp3"); - meta = groove.getMetaData(); - - textFont(createFont("Serif", 12)); -} - -int ys = 25; -int yi = 15; - -void draw() -{ - background(0); - int y = ys; - text("File Name: " + meta.fileName(), 5, y); - text("Length (in milliseconds): " + meta.length(), 5, y+=yi); - text("Title: " + meta.title(), 5, y+=yi); - text("Author: " + meta.author(), 5, y+=yi); - text("Album: " + meta.album(), 5, y+=yi); - text("Date: " + meta.date(), 5, y+=yi); - text("Comment: " + meta.comment(), 5, y+=yi); - text("Track: " + meta.track(), 5, y+=yi); - text("Genre: " + meta.genre(), 5, y+=yi); - text("Copyright: " + meta.copyright(), 5, y+=yi); - text("Disc: " + meta.disc(), 5, y+=yi); - text("Composer: " + meta.composer(), 5, y+=yi); - text("Orchestra: " + meta.orchestra(), 5, y+=yi); - text("Publisher: " + meta.publisher(), 5, y+=yi); - text("Encoded: " + meta.encoded(), 5, y+=yi); -} diff --git a/java/libraries/minim/examples/GetMetaData/data/groove.mp3 b/java/libraries/minim/examples/GetMetaData/data/groove.mp3 deleted file mode 100644 index 22fd64fd4..000000000 Binary files a/java/libraries/minim/examples/GetMetaData/data/groove.mp3 and /dev/null differ diff --git a/java/libraries/minim/examples/GetMetaData/data/serif.vlw b/java/libraries/minim/examples/GetMetaData/data/serif.vlw deleted file mode 100644 index dbb25086b..000000000 Binary files a/java/libraries/minim/examples/GetMetaData/data/serif.vlw and /dev/null differ diff --git a/java/libraries/minim/examples/MonitorInput/MonitorInput.pde b/java/libraries/minim/examples/MonitorInput/MonitorInput.pde deleted file mode 100644 index 86679683b..000000000 --- a/java/libraries/minim/examples/MonitorInput/MonitorInput.pde +++ /dev/null @@ -1,61 +0,0 @@ -/** - * This sketch demonstrates how to monitor the currently active audio input - * of the computer using an AudioInput. What you will actually - * be monitoring depends on the current settings of the machine the sketch is running on. - * Typically, you will be monitoring the built-in microphone, but if running on a desktop - * it's feasible that the user may have the actual audio output of the computer - * as the active audio input, or something else entirely. - *

- * Press 'm' to toggle monitoring on and off. - *

- * When you run your sketch as an applet you will need to sign it in order to get an input. - *

- * For more information about Minim and additional features, - * visit http://code.compartmental.net/minim/ - */ - -import ddf.minim.*; - -Minim minim; -AudioInput in; - -void setup() -{ - size(512, 200, P3D); - - minim = new Minim(this); - - // use the getLineIn method of the Minim object to get an AudioInput - in = minim.getLineIn(); -} - -void draw() -{ - background(0); - stroke(255); - - // draw the waveforms so we can see what we are monitoring - for(int i = 0; i < in.bufferSize() - 1; i++) - { - line( i, 50 + in.left.get(i)*50, i+1, 50 + in.left.get(i+1)*50 ); - line( i, 150 + in.right.get(i)*50, i+1, 150 + in.right.get(i+1)*50 ); - } - - String monitoringState = in.isMonitoring() ? "enabled" : "disabled"; - text( "Input monitoring is currently " + monitoringState + ".", 5, 15 ); -} - -void keyPressed() -{ - if ( key == 'm' || key == 'M' ) - { - if ( in.isMonitoring() ) - { - in.disableMonitoring(); - } - else - { - in.enableMonitoring(); - } - } -} diff --git a/java/libraries/minim/examples/PatchingAnInput/PatchingAnInput.pde b/java/libraries/minim/examples/PatchingAnInput/PatchingAnInput.pde deleted file mode 100644 index e756a6d17..000000000 --- a/java/libraries/minim/examples/PatchingAnInput/PatchingAnInput.pde +++ /dev/null @@ -1,56 +0,0 @@ -/** - * This sketch demonstrates how to create a simple synthesis chain that - * involves controlling the value of a UGenInput with the output of - * a UGen. In this case, we patch an Oscil generating a sine wave into - * the amplitude input of an Oscil generating a square wave. The result - * is known as amplitude modulation. - *

- * For more information about Minim and additional features, - * visit http://code.compartmental.net/minim/ - */ - -import ddf.minim.*; -import ddf.minim.ugens.*; - -Minim minim; -AudioOutput out; -Oscil wave; -Oscil mod; - -void setup() -{ - size(512, 200, P3D); - - minim = new Minim(this); - - // use the getLineOut method of the Minim object to get an AudioOutput object - out = minim.getLineOut(); - - // create a triangle wave Oscil, set to 440 Hz, at 1.0 amplitude - // in this case, the amplitude we construct the Oscil with - // doesn't matter because we will be patching something to - // its amplitude input. - wave = new Oscil( 440, 1.0f, Waves.TRIANGLE ); - - // create a sine wave Oscil for modulating the amplitude of wave - mod = new Oscil( 2, 0.4f, Waves.SINE ); - - // connect up the modulator - mod.patch( wave.amplitude ); - - // patch wave to the output - wave.patch( out ); -} - -void draw() -{ - background(0); - stroke(255); - - // draw the waveforms - for(int i = 0; i < out.bufferSize() - 1; i++) - { - line( i, 50 + out.left.get(i)*50, i+1, 50 + out.left.get(i+1)*50 ); - line( i, 150 + out.right.get(i)*50, i+1, 150 + out.right.get(i+1)*50 ); - } -} diff --git a/java/libraries/minim/examples/PlayAFile/PlayAFile.pde b/java/libraries/minim/examples/PlayAFile/PlayAFile.pde deleted file mode 100644 index c95eb3956..000000000 --- a/java/libraries/minim/examples/PlayAFile/PlayAFile.pde +++ /dev/null @@ -1,48 +0,0 @@ -/** - * This sketch demonstrates how to play a file with Minim using an AudioPlayer.
- * It's also a good example of how to draw the waveform of the audio. - *

- * For more information about Minim and additional features, - * visit http://code.compartmental.net/minim/ - */ - -import ddf.minim.*; - -Minim minim; -AudioPlayer player; - -void setup() -{ - size(512, 200, P3D); - - // we pass this to Minim so that it can load files from the data directory - minim = new Minim(this); - - // loadFile will look in all the same places as loadImage does. - // this means you can find files that are in the data folder and the - // sketch folder. you can also pass an absolute path, or a URL. - player = minim.loadFile("marcus_kellis_theme.mp3"); - - // play the file from start to finish. - // if you want to play the file again, - // you need to call rewind() first. - player.play(); -} - -void draw() -{ - background(0); - stroke(255); - - // draw the waveforms - // the values returned by left.get() and right.get() will be between -1 and 1, - // so we need to scale them up to see the waveform - // note that if the file is MONO, left.get() and right.get() will return the same value - for(int i = 0; i < player.bufferSize() - 1; i++) - { - float x1 = map( i, 0, player.bufferSize(), 0, width ); - float x2 = map( i+1, 0, player.bufferSize(), 0, width ); - line( x1, 50 + player.left.get(i)*50, x2, 50 + player.left.get(i+1)*50 ); - line( x1, 150 + player.right.get(i)*50, x2, 150 + player.right.get(i+1)*50 ); - } -} diff --git a/java/libraries/minim/examples/PlayAFile/data/marcus_kellis_theme.mp3 b/java/libraries/minim/examples/PlayAFile/data/marcus_kellis_theme.mp3 deleted file mode 100644 index ba57c5aac..000000000 Binary files a/java/libraries/minim/examples/PlayAFile/data/marcus_kellis_theme.mp3 and /dev/null differ diff --git a/java/libraries/minim/examples/RecordAudioInput/RecordAudioInput.pde b/java/libraries/minim/examples/RecordAudioInput/RecordAudioInput.pde deleted file mode 100644 index b5983fde7..000000000 --- a/java/libraries/minim/examples/RecordAudioInput/RecordAudioInput.pde +++ /dev/null @@ -1,87 +0,0 @@ -/** - * This sketch demonstrates how to an AudioRecorder to record audio to disk. - * To use this sketch you need to have something plugged into the line-in on your computer, - * or else be working on a laptop with an active built-in microphone. - *

- * Press 'r' to toggle recording on and off and the press 's' to save to disk. - * The recorded file will be placed in the sketch folder of the sketch. - *

- * For more information about Minim and additional features, - * visit http://code.compartmental.net/minim/ - */ - -import ddf.minim.*; - -Minim minim; -AudioInput in; -AudioRecorder recorder; - -void setup() -{ - size(512, 200, P3D); - - minim = new Minim(this); - - in = minim.getLineIn(); - // create a recorder that will record from the input to the filename specified - // the file will be located in the sketch's root folder. - recorder = minim.createRecorder(in, "myrecording.wav"); - - textFont(createFont("Arial", 12)); -} - -void draw() -{ - background(0); - stroke(255); - // draw the waveforms - // the values returned by left.get() and right.get() will be between -1 and 1, - // so we need to scale them up to see the waveform - for(int i = 0; i < in.bufferSize() - 1; i++) - { - line(i, 50 + in.left.get(i)*50, i+1, 50 + in.left.get(i+1)*50); - line(i, 150 + in.right.get(i)*50, i+1, 150 + in.right.get(i+1)*50); - } - - if ( recorder.isRecording() ) - { - text("Currently recording...", 5, 15); - } - else - { - text("Not recording.", 5, 15); - } -} - -void keyReleased() -{ - if ( key == 'r' ) - { - // to indicate that you want to start or stop capturing audio data, you must call - // beginRecord() and endRecord() on the AudioRecorder object. You can start and stop - // as many times as you like, the audio data will be appended to the end of the buffer - // (in the case of buffered recording) or to the end of the file (in the case of streamed recording). - if ( recorder.isRecording() ) - { - recorder.endRecord(); - } - else - { - recorder.beginRecord(); - } - } - if ( key == 's' ) - { - // we've filled the file out buffer, - // now write it to the file we specified in createRecorder - // in the case of buffered recording, if the buffer is large, - // this will appear to freeze the sketch for sometime - // in the case of streamed recording, - // it will not freeze as the data is already in the file and all that is being done - // is closing the file. - // the method returns the recorded audio as an AudioRecording, - // see the example AudioRecorder >> RecordAndPlayback for more about that - recorder.save(); - println("Done saving."); - } -} diff --git a/java/libraries/minim/examples/RecordAudioOutput/RecordAudioOutput.pde b/java/libraries/minim/examples/RecordAudioOutput/RecordAudioOutput.pde deleted file mode 100644 index c34d03f1e..000000000 --- a/java/libraries/minim/examples/RecordAudioOutput/RecordAudioOutput.pde +++ /dev/null @@ -1,93 +0,0 @@ -/** - * This sketch demonstrates how to use an AudioRecorder to record audio to disk. - * Press 'r' to toggle recording on and off and the press 's' to save to disk. - * The recorded file will be placed in the sketch folder of the sketch. - *

- * For more information about Minim and additional features, - * visit http://code.compartmental.net/minim/ - */ - -import ddf.minim.*; -import ddf.minim.ugens.*; - -Minim minim; -AudioOutput out; -AudioRecorder recorder; - -void setup() -{ - size(512, 200, P3D); - - minim = new Minim(this); - - out = minim.getLineOut(); - - // create a recorder that will record from the output to the filename specified - // the file will be located in the sketch's root folder. - recorder = minim.createRecorder(out, "myrecording.wav"); - - // patch some sound into the output so we have something to record - Oscil wave = new Oscil( 440.f, 1.0f ); - Oscil mod = new Oscil( 4.0f, 0.25f, Waves.SAW ); - mod.offset.setLastValue( 0.5f ); - mod.patch( wave.amplitude ); - wave.patch( out ); - - textFont(createFont("Arial", 12)); -} - -void draw() -{ - background(0); - stroke(255); - // draw the waveforms - // the values returned by left.get() and right.get() will be between -1 and 1, - // so we need to scale them up to see the waveform - for(int i = 0; i < out.bufferSize() - 1; i++) - { - line(i, 50 + out.left.get(i)*50, i+1, 50 + out.left.get(i+1)*50); - line(i, 150 + out.right.get(i)*50, i+1, 150 + out.right.get(i+1)*50); - } - - if ( recorder.isRecording() ) - { - text("Currently recording...", 5, 15); - } - else - { - text("Not recording.", 5, 15); - } -} - -void keyReleased() -{ - if ( key == 'r' ) - { - // to indicate that you want to start or stop capturing audio data, you must call - // beginRecord() and endRecord() on the AudioRecorder object. You can start and stop - // as many times as you like, the audio data will be appended to the end of the buffer - // (in the case of buffered recording) or to the end of the file (in the case of streamed recording). - if ( recorder.isRecording() ) - { - recorder.endRecord(); - } - else - { - recorder.beginRecord(); - } - } - if ( key == 's' ) - { - // we've filled the file out buffer, - // now write it to the file we specified in createRecorder - // in the case of buffered recording, if the buffer is large, - // this will appear to freeze the sketch for sometime - // in the case of streamed recording, - // it will not freeze as the data is already in the file and all that is being done - // is closing the file. - // the method returns the recorded audio as an AudioRecording, - // see the example AudioRecorder >> RecordAndPlayback for more about that - recorder.save(); - println("Done saving."); - } -} diff --git a/java/libraries/minim/examples/Scrubbing/Scrubbing.pde b/java/libraries/minim/examples/Scrubbing/Scrubbing.pde deleted file mode 100644 index 23f24bdb1..000000000 --- a/java/libraries/minim/examples/Scrubbing/Scrubbing.pde +++ /dev/null @@ -1,71 +0,0 @@ -/** - * This is a relatively simple file player that lets you scrub forward and backward in an audio file.
- * It should be noted that it's not *exactly* scrubbing because the playback speed is not changed, - * it's simply that the position in the song is changed by very small increments when fast-forwarding or rewinding. - * But the end result is convincing enough. - *

- * The positioning code is inside of the Play, Rewind, and Forward classes, which are in button.pde. - *

- * For more information about Minim and additional features, - * visit http://code.compartmental.net/minim/ - */ - -import ddf.minim.*; - -Minim minim; -AudioPlayer song; -Play play; -Rewind rewind; -Forward ffwd; - -void setup() -{ - size(512, 200, P3D); - minim = new Minim(this); - // load a file from the data folder, use a sample buffer of 1024 samples - song = minim.loadFile("fair1939.wav", 512); - // buttons for control - play = new Play(width/2 - 50, 130, 20, 10); - rewind = new Rewind(width/2, 130, 20, 10); - ffwd = new Forward(width/2 + 50, 130, 20, 10); -} - -void draw() -{ - background(0); - // draw the wave form - // this wav is MONO, so we only need the left channel, - // though we could have used the right channel and gotten the same values - stroke(255); - for (int i = 0; i < song.bufferSize() - 1; i++) - { - line(i, 50 - song.left.get(i)*50, i+1, 50 - song.left.get(i+1)*10); - } - // draw the position in the song - // the position is in milliseconds, - // to get a meaningful graphic, we need to map the value to the range [0, width] - float x = map(song.position(), 0, song.length(), 0, width); - stroke(255, 0, 0); - line(x, 50 - 20, x, 50 + 20); - // do the controls - play.update(); - play.draw(); - rewind.update(); - rewind.draw(); - ffwd.update(); - ffwd.draw(); -} - -void mousePressed() -{ - play.mousePressed(); - rewind.mousePressed(); - ffwd.mousePressed(); -} - -void mouseReleased() -{ - play.mouseReleased(); - rewind.mouseReleased(); - ffwd.mouseReleased(); -} diff --git a/java/libraries/minim/examples/Scrubbing/button.pde b/java/libraries/minim/examples/Scrubbing/button.pde deleted file mode 100755 index 90cc1b15b..000000000 --- a/java/libraries/minim/examples/Scrubbing/button.pde +++ /dev/null @@ -1,255 +0,0 @@ -abstract class Button -{ - int x, y, hw, hh; - - Button(int x, int y, int hw, int hh) - { - this.x = x; - this.y = y; - this.hw = hw; - this.hh = hh; - } - - boolean pressed() - { - return mouseX > x - hw && mouseX < x + hw && mouseY > y - hh && mouseY < y + hh; - } - - abstract void mousePressed(); - abstract void mouseReleased(); - abstract void update(); - abstract void draw(); -} - -class Play extends Button -{ - boolean play; - boolean invert; - - Play(int x, int y, int hw, int hh) - { - super(x, y, hw, hh); - play = true; - } - - // code to handle playing and pausing the file - void mousePressed() - { - if ( pressed() ) - { - invert = true; - if ( song.isPlaying() ) - { - song.pause(); - play = true; - } - else - { - song.loop(); - play = false; - } - } - } - - void mouseReleased() - { - invert = false; - } - - // play is a boolean value used to determine what to draw on the button - void update() - { - if ( song.isPlaying() ) play = false; - else play = true; - } - - void draw() - { - if ( invert ) - { - fill(255); - stroke(0); - } - else - { - noFill(); - stroke(255); - } - rect(x - hw, y - hh, hw*2, hh*2); - if ( invert ) - { - fill(0); - stroke(255); - } - else - { - fill(255); - noStroke(); - } - if ( play ) - { - triangle(x - hw/3, y - hh/2, x - hw/3, y + hh/2, x + hw/2, y); - } - else - { - rect(x - hw/3, y - hh/2, hw/4, hh); - rect(x + hw/8, y - hh/2, hw/4, hh); - } - } -} - -class Rewind extends Button -{ - boolean invert; - boolean pressed; - - Rewind(int x, int y, int hw, int hh) - { - super(x, y, hw, hh); - invert = false; - } - - // code used to scrub backward in the file - void update() - { - // if the rewind button is currently being pressed - if (pressed) - { - // get the current song position - int pos = song.position(); - // if it greater than 200 milliseconds - if ( pos > 200 ) - { - // rewind the song by 200 milliseconds - song.skip(-200); - } - else - { - // if the song hasn't played more than 100 milliseconds - // just rewind to the beginning - song.rewind(); - } - } - } - - void mousePressed() - { - pressed = pressed(); - if ( pressed ) - { - invert = true; - // if the song isn't currently playing, rewind it to the beginning - if ( !song.isPlaying() ) song.rewind(); - } - } - - void mouseReleased() - { - pressed = false; - invert = false; - } - - void draw() - { - if ( invert ) - { - fill(255); - stroke(0); - } - else - { - noFill(); - stroke(255); - } - rect(x - hw, y - hh, hw*2, hh*2); - if ( invert ) - { - fill(0); - stroke(255); - } - else - { - fill(255); - noStroke(); - } - triangle(x - hw/2, y, x, y - hh/2, x, y + hh/2); - triangle(x, y, x + hw/2, y - hh/2, x + hw/2, y + hh/2); - } -} - -class Forward extends Button -{ - boolean invert; - boolean pressed; - - Forward(int x, int y, int hw, int hh) - { - super(x, y, hw, hh); - invert = false; - } - - void update() - { - // if the forward button is currently being pressed - if (pressed) - { - // get the current position of the song - int pos = song.position(); - // if the song's position is more than 40 milliseconds from the end of the song - if ( pos < song.length() - 40 ) - { - // forward the song by 40 milliseconds - song.skip(40); - } - else - { - // otherwise, cue the song at the end of the song - song.cue( song.length() ); - } - // start the song playing - song.play(); - } - } - - void mousePressed() - { - pressed = pressed(); - if ( pressed ) - { - invert = true; - } - } - - void mouseReleased() - { - pressed = false; - invert = false; - } - - void draw() - { - if ( invert ) - { - fill(255); - stroke(0); - } - else - { - noFill(); - stroke(255); - } - rect(x - hw, y - hh, hw*2, hh*2); - if ( invert ) - { - fill(0); - stroke(255); - } - else - { - fill(255); - noStroke(); - } - triangle(x, y, x - hw/2, y - hh/2, x - hw/2, y + hh/2); - triangle(x, y - hh/2, x, y + hh/2, x + hw/2, y); - } -} diff --git a/java/libraries/minim/examples/Scrubbing/data/fair1939.wav b/java/libraries/minim/examples/Scrubbing/data/fair1939.wav deleted file mode 100755 index 815a691e6..000000000 Binary files a/java/libraries/minim/examples/Scrubbing/data/fair1939.wav and /dev/null differ diff --git a/java/libraries/minim/examples/SequenceSound/SequenceSound.pde b/java/libraries/minim/examples/SequenceSound/SequenceSound.pde deleted file mode 100644 index c23c8fa36..000000000 --- a/java/libraries/minim/examples/SequenceSound/SequenceSound.pde +++ /dev/null @@ -1,85 +0,0 @@ -/** - * This sketch demonstrates how to create synthesized sound with Minim using an AudioOutput and the - * default instrument built into an AudioOutput. By using the playNote method you can - * schedule notes to played at some point in the future, essentially allowing to you create musical scores with - * code. Because they are constructed with code, they can be either deterministic or different every time. This - * sketch creates a deterministic score, meaning it is the same every time you run the sketch. It also demonstrates - * a couple different versions of the playNote method. - *

- * For more complex examples of using playNote check out - * algorithmicCompExample and compositionExample in the Synthesis folder. - *

- * For more information about Minim and additional features, - * visit http://code.compartmental.net/minim/ - */ - -import ddf.minim.*; -import ddf.minim.ugens.*; - -Minim minim; -AudioOutput out; - -void setup() -{ - size(512, 200, P3D); - - minim = new Minim(this); - - // use the getLineOut method of the Minim object to get an AudioOutput object - out = minim.getLineOut(); - - // set the tempo of the sequencer - // this makes the first argument of playNote - // specify the start time in quarter notes - // and the duration becomes relative to the length of a quarter note - // by default the tempo is 60 BPM (beats per minute). - // at 60 BPM both start time and duration can be interpreted as seconds. - // to retrieve the current tempo, use getTempo(). - out.setTempo( 80 ); - - // pause the sequencer so our note play back will be rock solid - // if you don't do this, then tiny bits of error can occur since - // the sequencer is running in parallel with you note queueing. - out.pauseNotes(); - - // given start time, duration, and frequency - out.playNote( 0.0, 0.9, 97.99 ); - out.playNote( 1.0, 0.9, 123.47 ); - - // given start time, duration, and note name - out.playNote( 2.0, 2.9, "C3" ); - out.playNote( 3.0, 1.9, "E3" ); - out.playNote( 4.0, 0.9, "G3" ); - - // given start time and note name or frequency - // (duration defaults to 1.0) - out.playNote( 5.0, "" ); - out.playNote( 6.0, 329.63); - out.playNote( 7.0, "G4" ); - - // the note offset is simply added into the start time of - // every subsequenct call to playNote. It's expressed in beats. - // to get the current note offset, use getNoteOffset(). - out.setNoteOffset( 8.1 ); - - // because only given a note name or frequency - // starttime defaults to 0.0 and duration defaults to 1.0 - out.playNote( "G5" ); - out.playNote( 987.77 ); - - // now we can start the sequencer again to hear our sequence - out.resumeNotes(); -} - -void draw() -{ - background(0); - stroke(255); - - // draw the waveforms - for(int i = 0; i < out.bufferSize() - 1; i++) - { - line( i, 50 + out.left.get(i)*50, i+1, 50 + out.left.get(i+1)*50 ); - line( i, 150 + out.right.get(i)*50, i+1, 150 + out.right.get(i+1)*50 ); - } -} diff --git a/java/libraries/minim/examples/SoundSpectrum/SoundSpectrum.pde b/java/libraries/minim/examples/SoundSpectrum/SoundSpectrum.pde deleted file mode 100644 index 73de17a0c..000000000 --- a/java/libraries/minim/examples/SoundSpectrum/SoundSpectrum.pde +++ /dev/null @@ -1,180 +0,0 @@ -/** - * An FFT object is used to convert an audio signal into its frequency domain representation. This representation - * lets you see how much of each frequency is contained in an audio signal. Sometimes you might not want to - * work with the entire spectrum, so it's possible to have the FFT object calculate average frequency bands by - * simply averaging the values of adjacent frequency bands in the full spectrum. There are two different ways - * these can be calculated: Linearly, by grouping equal numbers of adjacent frequency bands, or - * Logarithmically, by grouping frequency bands by octave, which is more akin to how humans hear sound. - *
- * This sketch illustrates the difference between viewing the full spectrum, - * linearly spaced averaged bands, and logarithmically spaced averaged bands. - *

- * From top to bottom: - *

    - *
  • The full spectrum.
  • - *
  • The spectrum grouped into 30 linearly spaced averages.
  • - *
  • The spectrum grouped logarithmically into 10 octaves, each split into 3 bands.
  • - *
- * - * Moving the mouse across the sketch will highlight a band in each spectrum and display what the center - * frequency of that band is. The averaged bands are drawn so that they line up with full spectrum bands they - * are averages of. In this way, you can clearly see how logarithmic averages differ from linear averages. - *

- * For more information about Minim and additional features, visit http://code.compartmental.net/minim/ - */ - -import ddf.minim.analysis.*; -import ddf.minim.*; - -Minim minim; -AudioPlayer jingle; -FFT fftLin; -FFT fftLog; - -float height3; -float height23; -float spectrumScale = 4; - -PFont font; - -void setup() -{ - size(512, 480); - height3 = height/3; - height23 = 2*height/3; - - minim = new Minim(this); - jingle = minim.loadFile("jingle.mp3", 1024); - - // loop the file - jingle.loop(); - - // create an FFT object that has a time-domain buffer the same size as jingle's sample buffer - // note that this needs to be a power of two - // and that it means the size of the spectrum will be 1024. - // see the online tutorial for more info. - fftLin = new FFT( jingle.bufferSize(), jingle.sampleRate() ); - - // calculate the averages by grouping frequency bands linearly. use 30 averages. - fftLin.linAverages( 30 ); - - // create an FFT object for calculating logarithmically spaced averages - fftLog = new FFT( jingle.bufferSize(), jingle.sampleRate() ); - - // calculate averages based on a miminum octave width of 22 Hz - // split each octave into three bands - // this should result in 30 averages - fftLog.logAverages( 22, 3 ); - - rectMode(CORNERS); - font = loadFont("ArialMT-12.vlw"); -} - -void draw() -{ - background(0); - - textFont(font); - textSize( 18 ); - - float centerFrequency = 0; - - // perform a forward FFT on the samples in jingle's mix buffer - // note that if jingle were a MONO file, this would be the same as using jingle.left or jingle.right - fftLin.forward( jingle.mix ); - fftLog.forward( jingle.mix ); - - // draw the full spectrum - { - noFill(); - for(int i = 0; i < fftLin.specSize(); i++) - { - // if the mouse is over the spectrum value we're about to draw - // set the stroke color to red - if ( i == mouseX ) - { - centerFrequency = fftLin.indexToFreq(i); - stroke(255, 0, 0); - } - else - { - stroke(255); - } - line(i, height3, i, height3 - fftLin.getBand(i)*spectrumScale); - } - - fill(255, 128); - text("Spectrum Center Frequency: " + centerFrequency, 5, height3 - 25); - } - - // no more outline, we'll be doing filled rectangles from now - noStroke(); - - // draw the linear averages - { - // since linear averages group equal numbers of adjacent frequency bands - // we can simply precalculate how many pixel wide each average's - // rectangle should be. - int w = int( width/fftLin.avgSize() ); - for(int i = 0; i < fftLin.avgSize(); i++) - { - // if the mouse is inside the bounds of this average, - // print the center frequency and fill in the rectangle with red - if ( mouseX >= i*w && mouseX < i*w + w ) - { - centerFrequency = fftLin.getAverageCenterFrequency(i); - - fill(255, 128); - text("Linear Average Center Frequency: " + centerFrequency, 5, height23 - 25); - - fill(255, 0, 0); - } - else - { - fill(255); - } - // draw a rectangle for each average, multiply the value by spectrumScale so we can see it better - rect(i*w, height23, i*w + w, height23 - fftLin.getAvg(i)*spectrumScale); - } - } - - // draw the logarithmic averages - { - // since logarithmically spaced averages are not equally spaced - // we can't precompute the width for all averages - for(int i = 0; i < fftLog.avgSize(); i++) - { - centerFrequency = fftLog.getAverageCenterFrequency(i); - // how wide is this average in Hz? - float averageWidth = fftLog.getAverageBandWidth(i); - - // we calculate the lowest and highest frequencies - // contained in this average using the center frequency - // and bandwidth of this average. - float lowFreq = centerFrequency - averageWidth/2; - float highFreq = centerFrequency + averageWidth/2; - - // freqToIndex converts a frequency in Hz to a spectrum band index - // that can be passed to getBand. in this case, we simply use the - // index as coordinates for the rectangle we draw to represent - // the average. - int xl = (int)fftLog.freqToIndex(lowFreq); - int xr = (int)fftLog.freqToIndex(highFreq); - - // if the mouse is inside of this average's rectangle - // print the center frequency and set the fill color to red - if ( mouseX >= xl && mouseX < xr ) - { - fill(255, 128); - text("Logarithmic Average Center Frequency: " + centerFrequency, 5, height - 25); - fill(255, 0, 0); - } - else - { - fill(255); - } - // draw a rectangle for each average, multiply the value by spectrumScale so we can see it better - rect( xl, height, xr, height - fftLog.getAvg(i)*spectrumScale ); - } - } -} diff --git a/java/libraries/minim/examples/SoundSpectrum/data/ArialMT-12.vlw b/java/libraries/minim/examples/SoundSpectrum/data/ArialMT-12.vlw deleted file mode 100644 index 45150ecac..000000000 Binary files a/java/libraries/minim/examples/SoundSpectrum/data/ArialMT-12.vlw and /dev/null differ diff --git a/java/libraries/minim/examples/SoundSpectrum/data/jingle.mp3 b/java/libraries/minim/examples/SoundSpectrum/data/jingle.mp3 deleted file mode 100644 index 8774a7632..000000000 Binary files a/java/libraries/minim/examples/SoundSpectrum/data/jingle.mp3 and /dev/null differ diff --git a/java/libraries/minim/examples/SynthesizeSound/SynthesizeSound.pde b/java/libraries/minim/examples/SynthesizeSound/SynthesizeSound.pde deleted file mode 100644 index 64b8d915d..000000000 --- a/java/libraries/minim/examples/SynthesizeSound/SynthesizeSound.pde +++ /dev/null @@ -1,100 +0,0 @@ -/** - * This sketch demonstrates how to create synthesized sound with Minim - * using an AudioOutput and an Oscil. An Oscil is a UGen object, - * one of many different types included with Minim. By using - * the numbers 1 thru 5, you can change the waveform being used - * by the Oscil to make sound. These basic waveforms are the - * basis of much audio synthesis. - * - * For many more examples of UGens included with Minim, - * have a look in the Synthesis folder of the Minim examples. - *

- * For more information about Minim and additional features, - * visit http://code.compartmental.net/minim/ - */ - -import ddf.minim.*; -import ddf.minim.ugens.*; - -Minim minim; -AudioOutput out; -Oscil wave; - -void setup() -{ - size(512, 200, P3D); - - minim = new Minim(this); - - // use the getLineOut method of the Minim object to get an AudioOutput object - out = minim.getLineOut(); - - // create a sine wave Oscil, set to 440 Hz, at 0.5 amplitude - wave = new Oscil( 440, 0.5f, Waves.SINE ); - // patch the Oscil to the output - wave.patch( out ); -} - -void draw() -{ - background(0); - stroke(255); - strokeWeight(1); - - // draw the waveform of the output - for(int i = 0; i < out.bufferSize() - 1; i++) - { - line( i, 50 - out.left.get(i)*50, i+1, 50 - out.left.get(i+1)*50 ); - line( i, 150 - out.right.get(i)*50, i+1, 150 - out.right.get(i+1)*50 ); - } - - // draw the waveform we are using in the oscillator - stroke( 128, 0, 0 ); - strokeWeight(4); - for( int i = 0; i < width-1; ++i ) - { - point( i, height/2 - (height*0.49) * wave.getWaveform().value( (float)i / width ) ); - } -} - -void mouseMoved() -{ - // usually when setting the amplitude and frequency of an Oscil - // you will want to patch something to the amplitude and frequency inputs - // but this is a quick and easy way to turn the screen into - // an x-y control for them. - - float amp = map( mouseY, 0, height, 1, 0 ); - wave.setAmplitude( amp ); - - float freq = map( mouseX, 0, width, 110, 880 ); - wave.setFrequency( freq ); -} - -void keyPressed() -{ - switch( key ) - { - case '1': - wave.setWaveform( Waves.SINE ); - break; - - case '2': - wave.setWaveform( Waves.TRIANGLE ); - break; - - case '3': - wave.setWaveform( Waves.SAW ); - break; - - case '4': - wave.setWaveform( Waves.SQUARE ); - break; - - case '5': - wave.setWaveform( Waves.QUARTERPULSE ); - break; - - default: break; - } -} diff --git a/java/libraries/minim/examples/TriggerASample/TriggerASample.pde b/java/libraries/minim/examples/TriggerASample/TriggerASample.pde deleted file mode 100644 index dc39a4091..000000000 --- a/java/libraries/minim/examples/TriggerASample/TriggerASample.pde +++ /dev/null @@ -1,84 +0,0 @@ -/** - * This sketch demonstrates how to use the loadSample method of Minim. - * The loadSample method allows you to specify the sample you want to load - * with a String and optionally specify what you want the buffer size of the - * returned AudioSample to be. Minim is able to load wav files, au files, aif - * files, snd files, and mp3 files. When you call loadSample, if you just - * specify the filename it will try to load the sample from the data folder of your sketch. - * However, you can also specify an absolute path (such as "C:\foo\bar\thing.wav") and the - * file will be loaded from that location (keep in mind that won't work from an applet). - * You can also specify a URL (such as "http://www.mysite.com/mp3/song.mp3") but keep in mind - * that if you run the sketch as an applet you may run in to security restrictions - * if the applet is not on the same domain as the file you want to load. You can get around - * the restriction by signing all of the jars in the applet. - *

- * An AudioSample is a special kind of file playback that allows - * you to repeatedly trigger an audio file. It does this by keeping the - * entire file in an internal buffer and then keeping a list of trigger points. - * AudioSample supports up to 20 overlapping triggers, which - * should be plenty for short sounds. It is not advised that you use this class - * for long sounds (like entire songs, for example) because the entire file is - * kept in memory. - *

- * Use 'k' and 's' to trigger a kick drum sample and a snare sample, respectively. - * You will see their waveforms drawn when they are played back. - *

- * For more information about Minim and additional features, - * visit http://code.compartmental.net/minim/ - */ - -import ddf.minim.*; - -Minim minim; -AudioSample kick; -AudioSample snare; - -void setup() -{ - size(512, 200, P3D); - minim = new Minim(this); - - // load BD.wav from the data folder - kick = minim.loadSample( "BD.mp3", // filename - 512 // buffer size - ); - - // An AudioSample will spawn its own audio processing Thread, - // and since audio processing works by generating one buffer - // of samples at a time, we can specify how big we want that - // buffer to be in the call to loadSample. - // above, we requested a buffer size of 512 because - // this will make the triggering of the samples sound more responsive. - // on some systems, this might be too small and the audio - // will sound corrupted, in that case, you can just increase - // the buffer size. - - // if a file doesn't exist, loadSample will return null - if ( kick == null ) println("Didn't get kick!"); - - // load SD.wav from the data folder - snare = minim.loadSample("SD.wav", 512); - if ( snare == null ) println("Didn't get snare!"); -} - -void draw() -{ - background(0); - stroke(255); - - // use the mix buffer to draw the waveforms. - for (int i = 0; i < kick.bufferSize() - 1; i++) - { - float x1 = map(i, 0, kick.bufferSize(), 0, width); - float x2 = map(i+1, 0, kick.bufferSize(), 0, width); - line(x1, 50 - kick.mix.get(i)*50, x2, 50 - kick.mix.get(i+1)*50); - line(x1, 150 - snare.mix.get(i)*50, x2, 150 - snare.mix.get(i+1)*50); - } -} - -void keyPressed() -{ - if ( key == 's' ) snare.trigger(); - if ( key == 'k' ) kick.trigger(); -} - diff --git a/java/libraries/minim/examples/TriggerASample/data/BD.mp3 b/java/libraries/minim/examples/TriggerASample/data/BD.mp3 deleted file mode 100644 index 9d1aa49fe..000000000 Binary files a/java/libraries/minim/examples/TriggerASample/data/BD.mp3 and /dev/null differ diff --git a/java/libraries/minim/examples/TriggerASample/data/SD.wav b/java/libraries/minim/examples/TriggerASample/data/SD.wav deleted file mode 100644 index 5020ce899..000000000 Binary files a/java/libraries/minim/examples/TriggerASample/data/SD.wav and /dev/null differ diff --git a/java/libraries/minim/examples/delayExample/delayExample.pde b/java/libraries/minim/examples/delayExample/delayExample.pde deleted file mode 100644 index 6c2b7941b..000000000 --- a/java/libraries/minim/examples/delayExample/delayExample.pde +++ /dev/null @@ -1,90 +0,0 @@ -/* delayExample
- * is an example of using the Delay UGen in a continuous sound example. - *

- * For more information about Minim and additional features, - * visit http://code.compartmental.net/minim/ - *

- * author: Anderson Mills
- * Anderson Mills's work was supported by numediart (www.numediart.org) - */ - -// import everything necessary to make sound. -import ddf.minim.*; -import ddf.minim.ugens.*; - -// create all of the variables that will need to be accessed in -// more than one methods (setup(), draw(), stop()). -Minim minim; -AudioOutput out; -Delay myDelay; - -// setup is run once at the beginning -void setup() -{ - // initialize the drawing window - size( 512, 200 ); - - // initialize the minim and out objects - minim = new Minim(this); - out = minim.getLineOut(); - - // initialize myDelay with continual feedback and audio passthrough - myDelay = new Delay( 0.4, 0.5, true, true ); - - // sawh will create a Sawtooth wave with the requested number of harmonics. - // like with Waves.randomNHarms for sine waves, - // you can create a richer sounding sawtooth this way. - Waveform saw = Waves.sawh( 15 ); - // create the Blip that will be used - Oscil myBlip = new Oscil( 245.0, 0.3, saw ); - - // Waves.square will create a square wave with an uneven duty-cycle, - // also known as a pulse wave. a square wave has only two values, - // either -1 or 1 and the duty cycle indicates how much of the wave - // should -1 and how much 1. in this case, we are asking for a square - // wave that is -1 90% of the time, and 1 10% of the time. - Waveform square = Waves.square( 0.9 ); - // create an LFO to be used for an amplitude envelope - Oscil myLFO = new Oscil( 1, 0.3, square ); - // offset the center value of the LFO so that it outputs 0 - // for the long portion of the duty cycle - myLFO.offset.setLastValue( 0.3 ); - - myLFO.patch( myBlip.amplitude ); - - // and the Blip is patched through the delay into the output - myBlip.patch( myDelay ).patch( out ); -} - -// draw is run many times -void draw() -{ - // erase the window to dark grey - background( 64 ); - // draw using a light gray stroke - stroke( 192 ); - // draw the waveforms - for( int i = 0; i < out.bufferSize() - 1; i++ ) - { - // find the x position of each buffer value - float x1 = map( i, 0, out.bufferSize(), 0, width ); - float x2 = map( i+1, 0, out.bufferSize(), 0, width ); - // draw a line from one buffer position to the next for both channels - line( x1, 50 + out.left.get(i)*50, x2, 50 + out.left.get(i+1)*50); - line( x1, 150 + out.right.get(i)*50, x2, 150 + out.right.get(i+1)*50); - } - - text( "Delay time is " + myDelay.delTime.getLastValue(), 5, 15 ); - text( "Delay amplitude (feedback) is " + myDelay.delAmp.getLastValue(), 5, 30 ); -} - -// when the mouse is moved, change the delay parameters -void mouseMoved() -{ - // set the delay time by the horizontal location - float delayTime = map( mouseX, 0, width, 0.0001, 0.5 ); - myDelay.setDelTime( delayTime ); - // set the feedback factor by the vertical location - float feedbackFactor = map( mouseY, 0, height, 0.99, 0.0 ); - myDelay.setDelAmp( feedbackFactor ); -} diff --git a/java/libraries/minim/examples/filterExample/filterExample.pde b/java/libraries/minim/examples/filterExample/filterExample.pde deleted file mode 100644 index 2b82c52ba..000000000 --- a/java/libraries/minim/examples/filterExample/filterExample.pde +++ /dev/null @@ -1,84 +0,0 @@ -/* filterExample
- * is an example of using the different filters - * in continuous sound. - *

- * For more information about Minim and additional features, - * visit http://code.compartmental.net/minim/ - *

- * author: Damien Di Fede, Anderson Mills
- * Anderson Mills's work was supported by numediart (www.numediart.org) - */ - -// import everything necessary to make sound. -import ddf.minim.*; -import ddf.minim.ugens.*; -// the effects package is needed because the filters are there for now. -import ddf.minim.effects.*; - -// create all of the variables that will need to be accessed in -// more than one methods (setup(), draw(), stop()). -Minim minim; -AudioOutput out; - -// setup is run once at the beginning -void setup() -{ -// initialize the drawing window - size(300, 200, P2D); - - // initialize the minim and out objects - minim = new Minim(this); - out = minim.getLineOut(); - - // create all of the variables - IIRFilter filt; - Oscil osc; - Oscil cutOsc; - Constant cutoff; - - // initialize the oscillator - // (a sawtooth wave has energy across the spectrum) - osc = new Oscil(500, 0.2, Waves.SAW); - - // uncoment one of the filters to hear it's effect - //filt = new LowPassSP(400, out.sampleRate()); - //filt = new LowPassFS(400, out.sampleRate()); - filt = new BandPass(400, 100, out.sampleRate()); - //filt = new HighPassSP(400, out.sampleRate()); - //filt = new NotchFilter(400, 100, out.sampleRate()); - - // create an Oscil we will use to modulate - // the cutoff frequency of the filter. - // by using an amplitude of 800 and an - // offset of 1000, the cutoff frequency - // will sweep between 200 and 1800 Hertz. - cutOsc = new Oscil(1, 800, Waves.SINE); - // offset the center value of the Oscil by 1000 - cutOsc.offset.setLastValue( 1000 ); - - // patch the oscil to the cutoff frequency of the filter - cutOsc.patch(filt.cutoff); - - // patch the sawtooth oscil through the filter and then to the output - osc.patch(filt).patch(out); -} - - -// draw is run many times -void draw() -{ - // erase the window to black - background( 0 ); - // draw using a white stroke - stroke( 255 ); - // draw the waveforms - for( int i = 0; i < out.bufferSize() - 1; i++ ) - { - // find the x position of each buffer value - float x1 = map( i, 0, out.bufferSize(), 0, width ); - float x2 = map( i+1, 0, out.bufferSize(), 0, width ); - // draw a line from one buffer position to the next for both channels - line( x1, 50 + out.left.get(i)*50, x2, 50 + out.left.get(i+1)*50); - line( x1, 150 + out.right.get(i)*50, x2, 150 + out.right.get(i+1)*50); - } -} diff --git a/java/libraries/minim/examples/frequencyModulation/frequencyModulation.pde b/java/libraries/minim/examples/frequencyModulation/frequencyModulation.pde deleted file mode 100644 index 7fcb7645a..000000000 --- a/java/libraries/minim/examples/frequencyModulation/frequencyModulation.pde +++ /dev/null @@ -1,81 +0,0 @@ -/* frequencyModulation -

- A simple example for doing FM (frequency modulation) using two Oscils. -

- For more information about Minim and additional features, - visit http://code.compartmental.net/minim/ -

- Author: Damien Di Fede - */ - -// import everything necessary to make sound. -import ddf.minim.*; -import ddf.minim.ugens.*; - -// create all of the variables that will need to be accessed in -// more than one methods (setup(), draw(), stop()). -Minim minim; -AudioOutput out; - -// the Oscil we use for modulating frequency. -Oscil fm; - -// setup is run once at the beginning -void setup() -{ - // initialize the drawing window - size( 512, 200, P3D ); - - // initialize the minim and out objects - minim = new Minim( this ); - out = minim.getLineOut(); - - // make the Oscil we will hear. - // arguments are frequency, amplitude, and waveform - Oscil wave = new Oscil( 200, 0.8, Waves.TRIANGLE ); - // make the Oscil we will use to modulate the frequency of wave. - // the frequency of this Oscil will determine how quickly the - // frequency of wave changes and the amplitude determines how much. - // since we are using the output of fm directly to set the frequency - // of wave, you can think of the amplitude as being expressed in Hz. - fm = new Oscil( 10, 2, Waves.SINE ); - // set the offset of fm so that it generates values centered around 200 Hz - fm.offset.setLastValue( 200 ); - // patch it to the frequency of wave so it controls it - fm.patch( wave.frequency ); - // and patch wave to the output - wave.patch( out ); -} - -// draw is run many times -void draw() -{ - // erase the window to black - background( 0 ); - // draw using a white stroke - stroke( 255 ); - // draw the waveforms - for( int i = 0; i < out.bufferSize() - 1; i++ ) - { - // find the x position of each buffer value - float x1 = map( i, 0, out.bufferSize(), 0, width ); - float x2 = map( i+1, 0, out.bufferSize(), 0, width ); - // draw a line from one buffer position to the next for both channels - line( x1, 50 + out.left.get(i)*50, x2, 50 + out.left.get(i+1)*50); - line( x1, 150 + out.right.get(i)*50, x2, 150 + out.right.get(i+1)*50); - } - - text( "Modulation frequency: " + fm.frequency.getLastValue(), 5, 15 ); - text( "Modulation amplitude: " + fm.amplitude.getLastValue(), 5, 30 ); -} - -// we can change the parameters of the frequency modulation Oscil -// in real-time using the mouse. -void mouseMoved() -{ - float modulateAmount = map( mouseY, 0, height, 220, 1 ); - float modulateFrequency = map( mouseX, 0, width, 0.1, 100 ); - - fm.setFrequency( modulateFrequency ); - fm.setAmplitude( modulateAmount ); -} diff --git a/java/libraries/minim/examples/loadFileIntoBuffer/data/SD.wav b/java/libraries/minim/examples/loadFileIntoBuffer/data/SD.wav deleted file mode 100644 index 5020ce899..000000000 Binary files a/java/libraries/minim/examples/loadFileIntoBuffer/data/SD.wav and /dev/null differ diff --git a/java/libraries/minim/examples/loadFileIntoBuffer/loadFileIntoBuffer.pde b/java/libraries/minim/examples/loadFileIntoBuffer/loadFileIntoBuffer.pde deleted file mode 100644 index 32db474e4..000000000 --- a/java/libraries/minim/examples/loadFileIntoBuffer/loadFileIntoBuffer.pde +++ /dev/null @@ -1,93 +0,0 @@ -/** - * This sketch demonstrates how to use the loadFileIntoBuffer method of the Minim class and is also a good - * reference for some of the methods of the MultiChannelBuffer class. When the sketch begins it loads - * a file from the data folder into a MultiChannelBuffer and then modifies that sample data before - * using it to create a Sampler UGen. You can hear the result of this modification by hitting - * the space bar. - *

- * For more information about Minim and additional features, - * visit http://code.compartmental.net/minim/ - */ - -import ddf.minim.*; -import ddf.minim.ugens.*; - -Minim minim; -MultiChannelBuffer sampleBuffer; - -AudioOutput output; -Sampler sampler; - -void setup() -{ - size(512, 200, P3D); - - // create Minim and an AudioOutput - minim = new Minim(this); - output = minim.getLineOut(); - - // construct a new MultiChannelBuffer with 2 channels and 1024 sample frames. - // in our particular case, it doesn't really matter what we choose for these - // two values because loadFileIntoBuffer will reconfigure the buffer - // to match the channel count and length of the file. - sampleBuffer = new MultiChannelBuffer( 1, 1024 ); - - // we pass the buffer to the method and Minim will reconfigure it to match - // the file. if the file doesn't exist, or there is some other problen with - // loading it, the function will return 0 as the sample rate. - float sampleRate = minim.loadFileIntoBuffer( "SD.wav", sampleBuffer ); - - // make sure the file load worked - if ( sampleRate > 0 ) - { - // double the size of the buffer to give ourselves some silence to play with - int originalBufferSize = sampleBuffer.getBufferSize(); - sampleBuffer.setBufferSize( originalBufferSize * 2 ); - - // go through first half of the buffer, which contains the original sample, - // and add a delayed version of each sample at some random position. - // we happen to know that the source file is only one channel - // but in general you'd want to iterate over all channels when doing something like this - for( int s = 0; s < originalBufferSize; ++s ) - { - int delayIndex = s + int( random( 0, originalBufferSize ) ); - float sampleValue = sampleBuffer.getSample( 0, s ); - float destValue = sampleBuffer.getSample( 0, delayIndex ); - sampleBuffer.setSample( 0, // channel - delayIndex, // sample frame to set - sampleValue + destValue // the value to set - ); - } - - // create a sampler that will use our buffer to generate audio. - // we must provide the sample rate of the audio and the number of voices. - sampler = new Sampler( sampleBuffer, sampleRate, 1 ); - - // and finally, connect to the output so we can hear it - sampler.patch( output ); - } -} - -void draw() -{ - background(0); - stroke(255); - - // use the mix buffer to draw the waveforms. - for (int i = 0; i < output.bufferSize() - 1; i++) - { - float x1 = map(i, 0, output.bufferSize(), 0, width); - float x2 = map(i+1, 0, output.bufferSize(), 0, width); - line(x1, 50 - output.left.get(i)*50, x2, 50 - output.left.get(i+1)*50); - line(x1, 150 - output.right.get(i)*50, x2, 150 - output.right.get(i+1)*50); - } -} - -void keyPressed() -{ - if ( key == ' ' && sampler != null ) - { - sampler.trigger(); - } -} - diff --git a/java/libraries/minim/library/export.txt b/java/libraries/minim/library/export.txt deleted file mode 100644 index f2681acab..000000000 --- a/java/libraries/minim/library/export.txt +++ /dev/null @@ -1 +0,0 @@ -name = Minim Audio diff --git a/java/libraries/minim/license.txt b/java/libraries/minim/license.txt deleted file mode 100644 index fc8a5de7e..000000000 --- a/java/libraries/minim/license.txt +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/java/libraries/minim/version.txt b/java/libraries/minim/version.txt deleted file mode 100644 index bab1033cc..000000000 --- a/java/libraries/minim/version.txt +++ /dev/null @@ -1 +0,0 @@ -3.0 BETA \ No newline at end of file diff --git a/java/libraries/net/src/processing/net/Server.java b/java/libraries/net/src/processing/net/Server.java index 4cfeb784d..05addd256 100644 --- a/java/libraries/net/src/processing/net/Server.java +++ b/java/libraries/net/src/processing/net/Server.java @@ -107,8 +107,9 @@ public class Server implements Runnable { } } catch (IOException e) { - e.printStackTrace(); + //e.printStackTrace(); thread = null; + throw new RuntimeException(e); //errorMessage("", e); } } diff --git a/java/libraries/sound/.gitignore b/java/libraries/sound/.gitignore new file mode 100644 index 000000000..06a0ef56d --- /dev/null +++ b/java/libraries/sound/.gitignore @@ -0,0 +1,5 @@ +*.o +*.class +.DS_Store +/distribution +/bin diff --git a/java/libraries/sound/README.md b/java/libraries/sound/README.md new file mode 100644 index 000000000..701da6535 --- /dev/null +++ b/java/libraries/sound/README.md @@ -0,0 +1,19 @@ +## Processing MethCla Interface + +This is a processing interface and a collection of plugins for MethCla, a leight-weight, efficient sound engine for mobile devices [methcla](http://methc.la). + + +## Building the libMethClaInterface + +The library requires a compiled shared library of MethCla for each platform. There are specific Makefile in the src folder which compile the JNI library. For the moment this library is OSX + Linux only. To build the JNI Lib simply rename the respective Makefile_x to Makefile and do + +$make +$make install + +in the src/cpp folder. + +The Java Library is to be compiled with ant. Please install the latest version on ant on your computer. The build.xml file is in in the root folder. Core.jar needs to be compiled and ready in ../../../core/library. To compile do + +$ ant + +in the root folder. \ No newline at end of file diff --git a/java/libraries/video/build.xml b/java/libraries/sound/build.xml similarity index 70% rename from java/libraries/video/build.xml rename to java/libraries/sound/build.xml index 202242085..463f18c57 100755 --- a/java/libraries/video/build.xml +++ b/java/libraries/sound/build.xml @@ -1,11 +1,11 @@ - + - + - + @@ -18,14 +18,14 @@ srcdir="src" destdir="bin" encoding="UTF-8" includeAntRuntime="false" - classpath="../../../core/library/core.jar; library/gstreamer-java.jar; library/jna.jar" + classpath="../../../core/library/core.jar; library/sound.jar" nowarn="true" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"> - - + + diff --git a/java/libraries/sound/examples/Analysis/AmplitudeRMS/AmplitudeRMS.pde b/java/libraries/sound/examples/Analysis/AmplitudeRMS/AmplitudeRMS.pde new file mode 100644 index 000000000..8dfcb284f --- /dev/null +++ b/java/libraries/sound/examples/Analysis/AmplitudeRMS/AmplitudeRMS.pde @@ -0,0 +1,37 @@ +/* +This example shows how to use the RMS amplitude tracker. The tracker +calculates the Root Mean Square over a block of audio and returns +the mean as a float between 0 and 1. +*/ + +import processing.sound.*; + +SoundFile sample; +Amplitude rms; + +int scale=1; + +public void setup() { + size(640,360); + + //Load and play a soundfile and loop it + sample = new SoundFile(this, "beat.aiff"); + sample.loop(); + + // Create and patch the rms tracker + rms = new Amplitude(this); + rms.input(sample); +} + +public void draw() { + background(125,255,125); + + // rms.analyze() return a value between 0 and 1. To adjust + // the scaling and mapping of an ellipse we scale from 0 to 0.5 + scale=int(map(rms.analyze(), 0, 0.5, 1, 350)); + noStroke(); + + fill(255,0,150); + // We draw an ellispe coupled to the audio analysis + ellipse(width/2, height/2, 1*scale, 1*scale); +} diff --git a/java/libraries/sound/examples/Analysis/AmplitudeRMS/data/beat.aiff b/java/libraries/sound/examples/Analysis/AmplitudeRMS/data/beat.aiff new file mode 100644 index 000000000..017b7ce23 Binary files /dev/null and b/java/libraries/sound/examples/Analysis/AmplitudeRMS/data/beat.aiff differ diff --git a/java/libraries/sound/examples/Analysis/FFTSpectrum/FFTSpectrum.pde b/java/libraries/sound/examples/Analysis/FFTSpectrum/FFTSpectrum.pde new file mode 100644 index 000000000..56de63aa1 --- /dev/null +++ b/java/libraries/sound/examples/Analysis/FFTSpectrum/FFTSpectrum.pde @@ -0,0 +1,42 @@ +/* +This example shows how to use the Fast Fourier Transform function to get the spectrum +of a sound. This function calculates the FFT of a signal and returns the positive normalized +magnitude spectrum. This means we pass it the number of bands we want (the actual FFT size is +two times that size) and a float array with the same size. +*/ + +import processing.sound.*; + +SoundFile sample; +FFT fft; + +int scale=1; +int bands=512; +float[] spectrum = new float[bands]; + +public void setup() { + size(bands,360); + background(255); + + //Load and play a soundfile and loop it. This has to be called + // before the FFT is created. + sample = new SoundFile(this, "beat.aiff"); + sample.loop(); + + // Create and patch the rms tracker + fft = new FFT(this); + fft.input(sample, bands); +} + +public void draw() { + background(255); + + fft.analyze(spectrum); + + for(int i = 0; i < bands; i++) + { + // The result of the FFT is normalized + // draw the line for frequency band i scaling it up by 5 to get more amplitude. + line( i, height, i, height - spectrum[i]*height*5 ); + } +} diff --git a/java/libraries/sound/examples/Analysis/FFTSpectrum/data/beat.aiff b/java/libraries/sound/examples/Analysis/FFTSpectrum/data/beat.aiff new file mode 100644 index 000000000..017b7ce23 Binary files /dev/null and b/java/libraries/sound/examples/Analysis/FFTSpectrum/data/beat.aiff differ diff --git a/java/libraries/sound/examples/Demos/Envelopes/Envelopes.pde b/java/libraries/sound/examples/Demos/Envelopes/Envelopes.pde new file mode 100644 index 000000000..6d2f4e1fb --- /dev/null +++ b/java/libraries/sound/examples/Demos/Envelopes/Envelopes.pde @@ -0,0 +1,75 @@ +/* +This sketch shows how to use envelopes and oscillators. Envelopes are pre-defined amplitude +distribution over time. The sound library provides an ASR envelope which stands for attach, +sustain, release. The amplitude rises then sustains at the maximum level and decays slowly +depending on pre defined time segments. + + .________ + . --- + . --- + . --- + A S R + +*/ + +import processing.sound.*; + +TriOsc triOsc; +Env env; + +// Times and levels for the ASR envelope +float attackTime = 0.001; +float sustainTime = 0.004; +float sustainLevel = 0.3; +float releaseTime = 0.4; + +// This is an octave in MIDI notes. +int[] midiSequence = { 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72}; +int duration = 200; +// Set the note trigger +int trigger = millis(); + +// An index to count up the notes +int note=0; + +void setup() { + size(640, 360); + background(255); + + // Create triangle wave and start it + triOsc = new TriOsc(this); + //triOsc.play(); + + // Create the envelope + env = new Env(this); + +} + +void draw() { + + // If the determined trigger moment in time matches up with the computer clock and we if the + // sequence of notes hasn't been finished yet the next note gets played. + if ((millis() > trigger) && (note trigger){ + // Redraw the background every time to erase old rects + background(255); + + // By iterating through the playSound array we check for 1 or 0, 1 plays a sound and draws a rect, + // for 0 nothing happens. + + for (int i = 0; i < numsounds; i++){ + // Check which indexes are 1 and 0. + if (playSound[i] == 1){ + float rate; + // Choose a random color and get set to noStroke() + fill(int(random(255)),int(random(255)),int(random(255))); + noStroke(); + // Draw the rect in the positions we defined earlier in posx + rect(posx[i], 50, 128, 260); + // Choose a random index of the octave array + rate = octave[int(random(0,5))]; + // Play the soundfile from the array with the respective rate and loop set to false + file[i].play(rate, 1.0); + } + + // Renew the indexes of playSound so that at the next event the order is different and randomized. + playSound[i] = int(random(0,2)); + } + + // Create a new triggertime in the future, with a random offset between 200 and 1000 milliseconds + trigger = millis() + int(random(200,1000)); + } +} diff --git a/java/libraries/sound/examples/Demos/Sampler/data/1.aif b/java/libraries/sound/examples/Demos/Sampler/data/1.aif new file mode 100644 index 000000000..fd65b3123 Binary files /dev/null and b/java/libraries/sound/examples/Demos/Sampler/data/1.aif differ diff --git a/java/libraries/sound/examples/Demos/Sampler/data/2.aif b/java/libraries/sound/examples/Demos/Sampler/data/2.aif new file mode 100644 index 000000000..742301e7a Binary files /dev/null and b/java/libraries/sound/examples/Demos/Sampler/data/2.aif differ diff --git a/java/libraries/sound/examples/Demos/Sampler/data/3.aif b/java/libraries/sound/examples/Demos/Sampler/data/3.aif new file mode 100644 index 000000000..7b8da50f3 Binary files /dev/null and b/java/libraries/sound/examples/Demos/Sampler/data/3.aif differ diff --git a/java/libraries/sound/examples/Demos/Sampler/data/4.aif b/java/libraries/sound/examples/Demos/Sampler/data/4.aif new file mode 100644 index 000000000..7884a3418 Binary files /dev/null and b/java/libraries/sound/examples/Demos/Sampler/data/4.aif differ diff --git a/java/libraries/sound/examples/Demos/Sampler/data/5.aif b/java/libraries/sound/examples/Demos/Sampler/data/5.aif new file mode 100644 index 000000000..5664dad51 Binary files /dev/null and b/java/libraries/sound/examples/Demos/Sampler/data/5.aif differ diff --git a/java/libraries/sound/examples/Demos/SineCluster/SineCluster.pde b/java/libraries/sound/examples/Demos/SineCluster/SineCluster.pde new file mode 100644 index 000000000..730b85c9a --- /dev/null +++ b/java/libraries/sound/examples/Demos/SineCluster/SineCluster.pde @@ -0,0 +1,56 @@ +/* +This example shows how to create a cluster of sine oscillators, change the frequency and detune them +depending on the position of the mouse in the renderer window. The Y position determines the basic +frequency of the oscillator and X the detuning of the oscillator. The basic frequncy ranges between +150 and 1150 Hz. +*/ + +import processing.sound.*; + +SinOsc[] sineWaves; + +// The number of oscillators +int numSines = 5; + +// A float for calculating the amplitudes +float[] sineVolume; + +void setup() { + size(500, 500); + background(255); + + // Create the oscillators and amplitudes + sineWaves = new SinOsc[numSines]; + sineVolume = new float[numSines]; + + for (int i = 0; i < numSines; i++) { + + // The overall amplitude shouldn't exceed 1.0 which is prevented by 1.0/numSines. + // The ascending waves will get lower in volume the higher the frequency + sineVolume[i] = (1.0 / numSines) / (i + 1); + + // Create the Sine Oscillators and start them + sineWaves[i] = new SinOsc(this); + sineWaves[i].play(); + } +} + +void draw() { + noStroke(); + + // Map mouseY to get values from 0.0 to 1.0 + float yoffset = (height - mouseY) / float(height); + + // Map that value logarithmically to 150 - 1150 Hz + float frequency = pow(1000, yoffset) + 150; + + // Map mouseX from -0.5 to 0.5 to get a multiplier for detuning the oscillators + float detune = float(mouseX) / width - 0.5; + + // Set the frequencies, detuning and volume + for (int i = 0; i < numSines; i++) { + sineWaves[i].freq(frequency * (i + 1 + i * detune)); + sineWaves[i].amp(sineVolume[i]); + + } +} diff --git a/java/libraries/sound/examples/Demos/Spectrum/Spectrum.pde b/java/libraries/sound/examples/Demos/Spectrum/Spectrum.pde new file mode 100644 index 000000000..296e4ad80 --- /dev/null +++ b/java/libraries/sound/examples/Demos/Spectrum/Spectrum.pde @@ -0,0 +1,42 @@ +/* +This example shows how to use the Fast Fourier Transform function to get the spectrum +of a sound. This function calculates the FFT of a signal and returns the positive normalized +magnitude spectrum. This means we pass it the number of bands we want (the actual FFT size is +two times that size) and a float array with the same size. +*/ + +import processing.sound.*; + +SoundFile sample; +FFT fft; + +int scale=1; +int bands=512; +float[] spec = new float[bands]; + +public void setup() { + size(bands,360); + background(255); + + //Load and play a soundfile and loop it. This has to be called + // before the FFT is created. + sample = new SoundFile(this, "beat.aiff"); + sample.loop(); + + // Create and patch the rms tracker + fft = new FFT(this); + fft.input(sample, bands); +} + +public void draw() { + background(255); + + fft.analyze(spec); + + for(int i = 0; i < bands; i++) + { + // The result of the FFT is normalized + // draw the line for frequency band i scaling it up by 5 to get more amplitude. + line( i, height, i, height - spec[i]*height*5 ); + } +} diff --git a/java/libraries/sound/examples/Demos/Spectrum/data/beat.aiff b/java/libraries/sound/examples/Demos/Spectrum/data/beat.aiff new file mode 100644 index 000000000..017b7ce23 Binary files /dev/null and b/java/libraries/sound/examples/Demos/Spectrum/data/beat.aiff differ diff --git a/java/libraries/sound/examples/Effects/Filter/BPF/BPF.pde b/java/libraries/sound/examples/Effects/Filter/BPF/BPF.pde new file mode 100644 index 000000000..30a1f0746 --- /dev/null +++ b/java/libraries/sound/examples/Effects/Filter/BPF/BPF.pde @@ -0,0 +1,30 @@ +/* +This is a simple WhiteNoise generator. It can be started with .play(float amp). +In this example it is started and stopped by clicking into the renderer window. +*/ + +import processing.sound.*; + +WhiteNoise noise; +BandPass bandPass; + +float amp=0.0; + +void setup() { + size(640,360); + background(255); + + // Create the noise generator + Filter + noise = new WhiteNoise(this); + bandPass = new BandPass(this); + + noise.play(0.5); + bandPass.process(noise, 100); +} + +void draw() { + + bandPass.freq(map(mouseX, 0, width, 20, 10000)); + + bandPass.bw(map(mouseY, 0, height, 100, 1000)); +} diff --git a/java/libraries/sound/examples/Effects/Filter/HPF/HPF.pde b/java/libraries/sound/examples/Effects/Filter/HPF/HPF.pde new file mode 100644 index 000000000..d4a82cac9 --- /dev/null +++ b/java/libraries/sound/examples/Effects/Filter/HPF/HPF.pde @@ -0,0 +1,27 @@ +/* +This is a simple WhiteNoise generator. It can be started with .play(float amp). +In this example it is started and stopped by clicking into the renderer window. +*/ + +import processing.sound.*; + +WhiteNoise noise; +HighPass highPass; + +float amp=0.0; + +void setup() { + size(640,360); + background(255); + + // Create the noise generator + filter + noise = new WhiteNoise(this); + highPass = new HighPass(this); + + noise.play(0.5); + highPass.process(noise, 100); +} + +void draw() { + highPass.freq(map(mouseX, 0, width, 80, 10000)); +} diff --git a/java/libraries/sound/examples/Effects/Filter/LPF/LPF.pde b/java/libraries/sound/examples/Effects/Filter/LPF/LPF.pde new file mode 100644 index 000000000..070b280ed --- /dev/null +++ b/java/libraries/sound/examples/Effects/Filter/LPF/LPF.pde @@ -0,0 +1,26 @@ +/* +This is a simple WhiteNoise generator. It can be started with .play(float amp). +In this example it is started and stopped by clicking into the renderer window. +*/ + +import processing.sound.*; + +WhiteNoise noise; +LowPass lowPass; + +float amp=0.0; + +void setup() { + size(640,360); + background(255); + + // Create the noise generator + filter + noise = new WhiteNoise(this); + lowPass = new LowPass(this); + noise.play(0.2); + lowPass.process(noise, 800); +} + +void draw() { + lowPass.freq(map(mouseX, 0, width, 80, 10000)); +} diff --git a/java/libraries/sound/examples/Effects/FreeVerb/FreeVerb.pde b/java/libraries/sound/examples/Effects/FreeVerb/FreeVerb.pde new file mode 100644 index 000000000..a3606cf89 --- /dev/null +++ b/java/libraries/sound/examples/Effects/FreeVerb/FreeVerb.pde @@ -0,0 +1,40 @@ +/* +This is a sound file player. +*/ + +import processing.sound.*; + +SoundFile soundfile; +Reverb reverb; + + +void setup() { + size(640,360); + background(255); + + //Load a soundfile + soundfile = new SoundFile(this, "vibraphon.aiff"); + + // create a Delay Effect + reverb = new Reverb(this); + + // Play the file in a loop + soundfile.loop(); + + // Set soundfile as input to the reverb + reverb.process(soundfile); +} + + +void draw() { + + // change the roomsize of the reverb + reverb.room(map(mouseX, 0, width, 0, 1.0)); + + // change the high frequency dampening parameter + reverb.damp(map(mouseX, 0, width, 0, 1.0)); + + // change the wet/dry relation of the effect + reverb.wet(map(mouseY, 0, height, 0, 1.0)); + +} diff --git a/java/libraries/sound/examples/Effects/FreeVerb/data/vibraphon.aiff b/java/libraries/sound/examples/Effects/FreeVerb/data/vibraphon.aiff new file mode 100644 index 000000000..b4e95a3a9 Binary files /dev/null and b/java/libraries/sound/examples/Effects/FreeVerb/data/vibraphon.aiff differ diff --git a/java/libraries/sound/examples/Effects/Variable_Delay/Variable_Delay.pde b/java/libraries/sound/examples/Effects/Variable_Delay/Variable_Delay.pde new file mode 100644 index 000000000..4d8858a41 --- /dev/null +++ b/java/libraries/sound/examples/Effects/Variable_Delay/Variable_Delay.pde @@ -0,0 +1,49 @@ +/* +This is a sound file player. +*/ + +import processing.sound.*; + +SoundFile soundfile; +Delay delay; + +void setup() { + size(640,360); + background(255); + + //Load a soundfile + soundfile = new SoundFile(this, "vibraphon.aiff"); + + // create a Delay Effect + delay = new Delay(this); + + // These methods return useful infos about the file + println("SFSampleRate= " + soundfile.sampleRate() + " Hz"); + println("SFSamples= " + soundfile.frames() + " samples"); + println("SFDuration= " + soundfile.duration() + " seconds"); + + // Play the file in a loop + soundfile.loop(); + + // Patch the delay + delay.process(soundfile, 5); +} + + +void draw() { + // Map mouseX from 0.25 to 4.0 for playback rate. 1 equals original playback + // speed 2 is an octave up 0.5 is an octave down. + soundfile.rate(map(mouseX, 0, width, 0.25, 4.0)); + + // Map mouseY from 0.2 to 1.0 for amplitude + soundfile.amp(map(mouseY, 0, height, 0.2, 1.0)); + + // Map mouseY from -1.0 to 1.0 for left to right + soundfile.pan(map(mouseY, 0, height, -1.0, 1.0)); + + // Map mouseY from 0.001 to 2.0 seconds for the delaytime + delay.time(map(mouseY, 0, height, 0.001, 2.0)); + + // Map mouseX from 0 to 0.8 for the delay feedback + delay.feedback(map(mouseX, 0, width, 0.0, 0.8)); +} diff --git a/java/libraries/sound/examples/Effects/Variable_Delay/data/vibraphon.aiff b/java/libraries/sound/examples/Effects/Variable_Delay/data/vibraphon.aiff new file mode 100644 index 000000000..b4e95a3a9 Binary files /dev/null and b/java/libraries/sound/examples/Effects/Variable_Delay/data/vibraphon.aiff differ diff --git a/java/libraries/sound/examples/IO/AudioInput/AudioInput.pde b/java/libraries/sound/examples/IO/AudioInput/AudioInput.pde new file mode 100644 index 000000000..59afab706 --- /dev/null +++ b/java/libraries/sound/examples/IO/AudioInput/AudioInput.pde @@ -0,0 +1,46 @@ +/* +Be Careful with your speaker volume, you might produce a painful +feedback. We recommend to wear headphones for this example. + +*/ + +import processing.sound.*; + +AudioIn input; +Amplitude rms; + +int scale=1; + +void setup() { + size(640,360); + background(255); + + //Create an Audio input and grab the 1st channel + input = new AudioIn(this, 0); + + // start the Audio Input + input.play(); + + // create a new Amplitude analyzer + rms = new Amplitude(this); + + // Patch the input to an volume analyzer + rms.input(input); +} + + +void draw() { + background(125,255,125); + + // adjust the volume of the audio input + input.amp(map(mouseY, 0, height, 0.0, 1.0)); + + // rms.analyze() return a value between 0 and 1. To adjust + // the scaling and mapping of an ellipse we scale from 0 to 0.5 + scale=int(map(rms.analyze(), 0, 0.5, 1, 350)); + noStroke(); + + fill(255,0,150); + // We draw an ellispe coupled to the audio analysis + ellipse(width/2, height/2, 1*scale, 1*scale); +} diff --git a/java/libraries/sound/examples/Noise/Brown/Brown.pde b/java/libraries/sound/examples/Noise/Brown/Brown.pde new file mode 100644 index 000000000..15f686b17 --- /dev/null +++ b/java/libraries/sound/examples/Noise/Brown/Brown.pde @@ -0,0 +1,27 @@ +/* +This is a simple brownian noise generator. It can be started with .play(float amp). +In this example it is started and stopped by clicking into the renderer window. +*/ + +import processing.sound.*; + +BrownNoise noise; + +float amp=0.0; + +void setup() { + size(640, 360); + background(255); + + // Create the noise generator + noise = new BrownNoise(this); + noise.play(); +} + +void draw() { + // Map mouseX from 0.0 to 1.0 for amplitude + noise.amp(map(mouseX, 0, width, 0.0, 1.0)); + + // Map mouseY from -1.0 to 1.0 for left to right + noise.pan(map(mouseY, 0, width, -1.0, 1.0)); +} diff --git a/java/libraries/sound/examples/Noise/Pink/Pink.pde b/java/libraries/sound/examples/Noise/Pink/Pink.pde new file mode 100644 index 000000000..af424ccd1 --- /dev/null +++ b/java/libraries/sound/examples/Noise/Pink/Pink.pde @@ -0,0 +1,27 @@ +/* +This is a simple pink noise generator. It can be started with .play(float amp). +In this example it is started and stopped by clicking into the renderer window. +*/ + +import processing.sound.*; + +PinkNoise noise; + +float amp=0.0; + +void setup() { + size(640, 360); + background(255); + + // Create and start noise generator + noise = new PinkNoise(this); + noise.play(); +} + +void draw() { + // Map mouseX from 0.0 to 1.0 for amplitude + noise.amp(map(mouseX, 0, width, 0.0, 1.0)); + + // Map mouseY from -1.0 to 1.0 for left to right + noise.pan(map(mouseY, 0, width, -1.0, 1.0)); +} diff --git a/java/libraries/sound/examples/Noise/White/White.pde b/java/libraries/sound/examples/Noise/White/White.pde new file mode 100644 index 000000000..ef69fc032 --- /dev/null +++ b/java/libraries/sound/examples/Noise/White/White.pde @@ -0,0 +1,27 @@ +/* +This is a simple white noise generator. It can be started with .play(float amp). +In this example it is started and stopped by clicking into the renderer window. +*/ + +import processing.sound.*; + +WhiteNoise noise; + +float amp=0.0; + +void setup() { + size(640, 360); + background(255); + + // Create the noise generator + noise = new WhiteNoise(this); + noise.play(); +} + +void draw() { + // Map mouseX from 0.0 to 1.0 for amplitude + noise.amp(map(mouseX, 0, width, 0.0, 1.0)); + + // Map mouseY from -1.0 to 1.0 for left to right + noise.pan(map(mouseY, 0, width, -1.0, 1.0)); +} diff --git a/java/libraries/sound/examples/Oscillators/PulseWidth/PulseWidth.pde b/java/libraries/sound/examples/Oscillators/PulseWidth/PulseWidth.pde new file mode 100644 index 000000000..80529d5f6 --- /dev/null +++ b/java/libraries/sound/examples/Oscillators/PulseWidth/PulseWidth.pde @@ -0,0 +1,30 @@ +/* +This is a pulse-wave oscillator. The method .play() starts the oscillator. +There are several setters like .amp(), .freq(), .width(), .pan() and .add(). +If you want to set all of them at the same time use +.set(float freq, float width, float amp, float add, float pan) +*/ + +import processing.sound.*; + +Pulse pulse; + +void setup() { + size(640,360); + background(255); + + // Create and start the pulse wave oscillator + pulse = new Pulse(this); + pulse.play(); +} + +void draw() { + // Map mouseX from 20Hz to 500Hz for frequency + pulse.freq(map(mouseX, 0, width, 20.0, 500.0)); + // Map mouseX from 0.0 to 0.5 for amplitude + pulse.pan(map(mouseX, 0, width, -1.0, 1.0)); + // Map mouseY from 0.0 to 0.5 for amplitude + pulse.amp(map(mouseY, 0, height, 0.0, 0.5)); + // Map mouseY from 0.0 to 0.5 for amplitude + pulse.width(map(mouseY, 0, height, 0.0, 1.0)); +} diff --git a/java/libraries/sound/examples/Oscillators/SawWave/SawWave.pde b/java/libraries/sound/examples/Oscillators/SawWave/SawWave.pde new file mode 100644 index 000000000..885127c86 --- /dev/null +++ b/java/libraries/sound/examples/Oscillators/SawWave/SawWave.pde @@ -0,0 +1,32 @@ +/* +This is a saw-wave oscillator. The method .play() starts the oscillator. There +are several setters like .amp(), .freq(), .pan() and .add(). If you want to set all of them at +the same time use .set(float freq, float amp, float add, float pan) +*/ + +import processing.sound.*; + +SawOsc saw; + +void setup() { + size(640, 360); + background(255); + + // Create the sine oscillator. + saw = new SawOsc(this); + + //Start the Sine Oscillator. There will be no sound in the beginning + //unless the mouse enters the + saw.play(); +} + +void draw() { + // Map mouseY from 0.0 to 1.0 for amplitude + saw.amp(map(mouseY, 0, height, 1.0, 0.0)); + + // Map mouseX from 20Hz to 1000Hz for frequency + saw.freq(map(mouseX, 0, width, 80.0, 200.0)); + + // Map mouseX from -1.0 to 1.0 for left to right + saw.pan(map(mouseX, 0, width, -1.0, 1.0)); +} diff --git a/java/libraries/sound/examples/Oscillators/SineWave/SineWave.pde b/java/libraries/sound/examples/Oscillators/SineWave/SineWave.pde new file mode 100644 index 000000000..d0c0f577e --- /dev/null +++ b/java/libraries/sound/examples/Oscillators/SineWave/SineWave.pde @@ -0,0 +1,40 @@ +/* +This is a sine-wave oscillator. The method .play() starts the oscillator. There +are several setters like .amp(), .freq(), .pan() and .add(). If you want to set all of them at +the same time use .set(float freq, float amp, float add, float pan) +*/ + +import processing.sound.*; + +SinOsc sine; + +float freq=400; +float amp=0.5; +float pos; + +void setup() { + size(640, 360); + background(255); + + // Create and start the sine oscillator. + + sine = new SinOsc(this); + + //Start the Sine Oscillator. + sine.play(); +} + +void draw() { + + // Map mouseY from 0.0 to 1.0 for amplitude + amp=map(mouseY, 0, height, 1.0, 0.0); + sine.amp(amp); + + // Map mouseX from 20Hz to 1000Hz for frequency + freq=map(mouseX, 0, width, 80.0, 1000.0); + sine.freq(freq); + + // Map mouseX from -1.0 to 1.0 for left to right + pos=map(mouseX, 0, width, -1.0, 1.0); + sine.pan(pos); +} diff --git a/java/libraries/sound/examples/Oscillators/SqrWave/SqrWave.pde b/java/libraries/sound/examples/Oscillators/SqrWave/SqrWave.pde new file mode 100644 index 000000000..1a568dea2 --- /dev/null +++ b/java/libraries/sound/examples/Oscillators/SqrWave/SqrWave.pde @@ -0,0 +1,33 @@ +/* +This is a saw-wave oscillator. The method .play() starts the oscillator. There +are several setters like .amp(), .freq(), .pan() and .add(). If you want to set all of them at +the same time use .set(float freq, float amp, float add, float pan) +*/ + +import processing.sound.*; + +SqrOsc sqr; + +void setup() { + size(640,360); + background(255); + + // Create and start the sine oscillator. + + sqr = new SqrOsc(this); + + //Start the Sine Oscillator. There will be no sound in the beginning + //unless the mouse enters the + sqr.play(); +} + +void draw() { + // Map mouseY from 0.0 to 1.0 for amplitude + sqr.amp(map(mouseY, 0, height, 1.0, 0.0)); + + // Map mouseX from 20Hz to 1000Hz for frequency + sqr.freq(map(mouseX, 0, width, 80.0, 200.0)); + + // Map mouseX from -1.0 to 1.0 for left to right + sqr.pan(map(mouseX, 0, width, -1.0, 1.0)); +} diff --git a/java/libraries/sound/examples/Oscillators/TriWave/TriWave.pde b/java/libraries/sound/examples/Oscillators/TriWave/TriWave.pde new file mode 100644 index 000000000..e2d55620f --- /dev/null +++ b/java/libraries/sound/examples/Oscillators/TriWave/TriWave.pde @@ -0,0 +1,33 @@ +/* +This is a saw-wave oscillator. The method .play() starts the oscillator. There +are several setters like .amp(), .freq(), .pan() and .add(). If you want to set all of them at +the same time use .set(float freq, float amp, float add, float pan) +*/ + +import processing.sound.*; + +TriOsc tri; + +void setup() { + size(640,360); + background(255); + + // Create and start the triangle wave oscillator. + + tri = new TriOsc(this); + + //Start the Sine Oscillator. There will be no sound in the beginning + //unless the mouse enters the + tri.play(); +} + +void draw() { + // Map mouseY from 0.0 to 1.0 for amplitude + tri.amp(map(mouseY, 0, height, 1.0, 0.0)); + + // Map mouseX from 20Hz to 1000Hz for frequency + tri.freq(map(mouseX, 0, width, 80.0, 1000.0)); + + // Map mouseX from -1.0 to 1.0 for left to right + tri.pan(map(mouseX, 0, width, -1.0, 1.0)); +} diff --git a/java/libraries/sound/examples/Soundfile/Sample/Sample.pde b/java/libraries/sound/examples/Soundfile/Sample/Sample.pde new file mode 100644 index 000000000..4d8caa67c --- /dev/null +++ b/java/libraries/sound/examples/Soundfile/Sample/Sample.pde @@ -0,0 +1,37 @@ +/* +This is a sound file player. +*/ + + +import processing.sound.*; + +SoundFile soundfile; + +void setup() { + size(640,360); + background(255); + + //Load a soundfile + soundfile = new SoundFile(this, "vibraphon.aiff"); + + // These methods return useful infos about the file + println("SFSampleRate= " + soundfile.sampleRate() + " Hz"); + println("SFSamples= " + soundfile.frames() + " samples"); + println("SFDuration= " + soundfile.duration() + " seconds"); + + // Play the file in a loop + soundfile.loop(); +} + + +void draw() { + // Map mouseX from 0.25 to 4.0 for playback rate. 1 equals original playback + // speed 2 is an octave up 0.5 is an octave down. + soundfile.rate(map(mouseX, 0, width, 0.25, 4.0)); + + // Map mouseY from 0.2 to 1.0 for amplitude + soundfile.amp(map(mouseY, 0, width, 0.2, 1.0)); + + // Map mouseY from -1.0 to 1.0 for left to right + soundfile.pan(map(mouseY, 0, width, -1.0, 1.0)); +} diff --git a/java/libraries/sound/examples/Soundfile/Sample/data/vibraphon.aiff b/java/libraries/sound/examples/Soundfile/Sample/data/vibraphon.aiff new file mode 100644 index 000000000..b4e95a3a9 Binary files /dev/null and b/java/libraries/sound/examples/Soundfile/Sample/data/vibraphon.aiff differ diff --git a/java/libraries/sound/library/.gitignore b/java/libraries/sound/library/.gitignore new file mode 100644 index 000000000..4a611631b --- /dev/null +++ b/java/libraries/sound/library/.gitignore @@ -0,0 +1,2 @@ +sound.jar + diff --git a/java/libraries/sound/src/cpp/MakeFile_Linux b/java/libraries/sound/src/cpp/MakeFile_Linux new file mode 100644 index 000000000..52004b60c --- /dev/null +++ b/java/libraries/sound/src/cpp/MakeFile_Linux @@ -0,0 +1,12 @@ +all: + + gcc -fPIC -I/usr/local/java/jdk1.7.0_60/include/linux -I./include -I/usr/local/java/jdk1.7.0_60/include -std=c++11 -g -c processing_sound_MethClaInterface.cpp; + gcc -shared -o libMethClaInterface.so *.o -lmethcla; + +clean: + rm *.o + rm *.jnilib + +install: + cp libMethClaInterface.so ../../library/linux + diff --git a/java/libraries/sound/src/cpp/MakeFile_Win b/java/libraries/sound/src/cpp/MakeFile_Win new file mode 100644 index 000000000..f4816d288 --- /dev/null +++ b/java/libraries/sound/src/cpp/MakeFile_Win @@ -0,0 +1,11 @@ +all: + + g++ -Ic:/Java/jdk1.7.0_60/include -Ic:/Java/jdk1.7.0_60/include/win32 -I./include -std=c++11 -g -c processing_sound_MethClaInterface.cpp; + g++ -dynamiclib -lmethcla -L../../library/macosx/ -o libMethClaInterface.jnilib *.o; + +clean: + rm *.o + rm *.jnilib + +install: + cp libMethClaInterface.jnilib ../../lib/macosx diff --git a/java/libraries/sound/src/cpp/Makefile b/java/libraries/sound/src/cpp/Makefile new file mode 100644 index 000000000..7e866267d --- /dev/null +++ b/java/libraries/sound/src/cpp/Makefile @@ -0,0 +1,11 @@ +all: + g++ -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers -I./include -std=c++11 -g -c processing_sound_MethClaInterface.cpp; + g++ -dynamiclib -lmethcla -L../../library/macosx/ -o libMethClaInterface.jnilib *.o; + +clean: + rm *.o + rm *.jnilib + +install: + cp libMethClaInterface.jnilib ../../library/macosx + cp libMethClaInterface.jnilib /Users/wirsing/Documents/Processing/libraries/sound/library/macosx/ diff --git a/java/libraries/sound/src/cpp/include/methcla/common.h b/java/libraries/sound/src/cpp/include/methcla/common.h new file mode 100644 index 000000000..2cdb58a5b --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/common.h @@ -0,0 +1,153 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_COMMON_H_INCLUDED +#define METHCLA_COMMON_H_INCLUDED + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +#if defined(__cplusplus) +# define METHCLA_C_LINKAGE extern "C" +#else +# define METHCLA_C_LINKAGE +#endif + +#if defined _WIN32 || defined __CYGWIN__ + #if defined(BUILDING_DLL) + #if defined(__GNUC__) || defined(__clang__) + #define METHCLA_VISIBLE __attribute__ ((dllexport)) + #else + #define METHCLA_VISIBLE __declspec(dllexport) // Note: actually gcc seems to also supports this syntax. + #endif + #else + #if defined(__GNUC__) || defined(__clang__) + #define METHCLA_VISIBLE __attribute__ ((dllimport)) + #else + #define METHCLA_VISIBLE __declspec(dllimport) // Note: actually gcc seems to also supports this syntax. + #endif + #endif +#else + #if (__GNUC__ >= 4) || (defined(__clang__) && (__clang_major__ >= 4)) + #define METHCLA_VISIBLE __attribute__ ((visibility ("default"))) + #else + #define METHCLA_VISIBLE + #endif +#endif + +#define METHCLA_EXPORT METHCLA_C_LINKAGE METHCLA_VISIBLE + +//* Time in seconds. +typedef double Methcla_Time; + +typedef struct +{ + const void* data; + size_t size; +} Methcla_OSCPacket; + +typedef enum +{ + kMethcla_NoError = 0, + + /* Generic error codes */ + kMethcla_UnspecifiedError, + kMethcla_LogicError, + kMethcla_ArgumentError, + kMethcla_MemoryError, + kMethcla_UnimplementedError, + kMethcla_SystemError, + + /* Engine errors */ + kMethcla_SynthDefNotFoundError = 1000, + kMethcla_NodeIdError, + kMethcla_NodeTypeError, + + /* File errors */ + kMethcla_FileNotFoundError = 2000, + kMethcla_FileExistsError, + kMethcla_PermissionsError, + kMethcla_UnsupportedFileTypeError, + kMethcla_UnsupportedDataFormatError, + kMethcla_InvalidFileError, + + /* Audio driver errors */ + kMethcla_DeviceUnavailableError = 3000, +} Methcla_ErrorCode; + +METHCLA_EXPORT const char* methcla_error_code_description(Methcla_ErrorCode code); + +typedef struct Methcla_Error +{ + Methcla_ErrorCode error_code; + char* error_message; +} Methcla_Error; + +static inline bool methcla_is_ok(const Methcla_Error error) +{ + return error.error_code == kMethcla_NoError; +} + +static inline bool methcla_is_error(const Methcla_Error error) +{ + return error.error_code != kMethcla_NoError; +} + +static inline bool methcla_error_has_code(const Methcla_Error error, Methcla_ErrorCode code) +{ + return error.error_code == code; +} + +static inline Methcla_ErrorCode methcla_error_code(const Methcla_Error error) +{ + return error.error_code; +} + +static inline const char* methcla_error_message(const Methcla_Error error) +{ + return error.error_message; +} + +//* Create a new Methcla_Error with a specific error code. +// The error message is set to NULL. +METHCLA_EXPORT Methcla_Error methcla_error_new(Methcla_ErrorCode code); + +//* Create a new Methcla_Error with a specific error code and message. +METHCLA_EXPORT Methcla_Error methcla_error_new_with_message(Methcla_ErrorCode code, const char* message); + +//* Free the resources associated with a Methcla_Error. +METHCLA_EXPORT void methcla_error_free(Methcla_Error error); + +//* Return a Methcla_Error indicating that no error has occurred. +static inline Methcla_Error methcla_no_error() +{ + return methcla_error_new(kMethcla_NoError); +} + +//* Audio sample type +typedef float Methcla_AudioSample; + +METHCLA_EXPORT void methcla_init(); + +#if defined(__cplusplus) +} +#endif + +#endif /* METHCLA_COMMON_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/detail.hpp b/java/libraries/sound/src/cpp/include/methcla/detail.hpp new file mode 100644 index 000000000..a09a7d960 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/detail.hpp @@ -0,0 +1,98 @@ +// Copyright 2013 Samplecount S.L. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef METHCLA_DETAIL_HPP_INCLUDED +#define METHCLA_DETAIL_HPP_INCLUDED + +#include +#include +#include + +#include + +namespace Methcla +{ + namespace detail + { + template class Id + { + public: + explicit Id(T id) + : m_id(id) + { } + Id(const D& other) + : m_id(other.m_id) + { } + + T id() const + { + return m_id; + } + + bool operator==(const D& other) const + { + return m_id == other.m_id; + } + + bool operator!=(const D& other) const + { + return m_id != other.m_id; + } + + private: + T m_id; + }; + + inline static void throwError(Methcla_Error err) + { + if (methcla_is_error(err)) + { + if (methcla_error_has_code(err, kMethcla_ArgumentError)) { + std::string msg(methcla_error_message(err)); + methcla_error_free(err); + throw std::invalid_argument(msg); + } else if (methcla_error_has_code(err, kMethcla_LogicError)) { + std::string msg(methcla_error_message(err)); + methcla_error_free(err); + throw std::logic_error(msg); + } else if (methcla_error_has_code(err, kMethcla_MemoryError)) { + methcla_error_free(err); + throw std::bad_alloc(); + } else { + std::string msg( methcla_error_message(err) + ? methcla_error_message(err) + : methcla_error_code_description(methcla_error_code(err))); + methcla_error_free(err); + throw std::runtime_error(msg); + } + } + } + + inline static void checkReturnCode(Methcla_Error err) + { + throwError(err); + } + + template T combineFlags(T a, T b) + { + // FIXME: Not available in GCC 4.6, Clang 3.3 + // typedef typename std::underlying_type::type enum_type; + typedef int enum_type; + static_assert(sizeof(T) <= sizeof(enum_type), "combineFlags: Cannot determine underlying enum type"); + return static_cast(static_cast(a) | static_cast(b)); + } + } +} + +#endif // METHCLA_DETAIL_HPP_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/methcla/detail/result.hpp b/java/libraries/sound/src/cpp/include/methcla/detail/result.hpp new file mode 100644 index 000000000..bf1bf4e33 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/detail/result.hpp @@ -0,0 +1,171 @@ +// Copyright 2013 Samplecount S.L. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef METHCLA_DETAIL_RESULT_HPP_INCLUDED +#define METHCLA_DETAIL_RESULT_HPP_INCLUDED + +#include +#include + +#include +#include +#include +#include +#include + +namespace Methcla +{ + namespace detail + { + class ResultBase + { + std::condition_variable m_cond_var; + + protected: + std::mutex m_mutex; + bool m_cond; + Methcla_ErrorCode m_error; + std::string m_errorMessage; + + public: + ResultBase() + : m_cond(false) + , m_error(kMethcla_NoError) + { } + + ResultBase(const ResultBase&) = delete; + ResultBase& operator=(const ResultBase&) = delete; + + void checkResponse(const char* requestAddress, const OSCPP::Server::Message& msg) + { + if (msg == "/error") + { + auto args(msg.args()); + Methcla_ErrorCode errorCode = static_cast(args.int32()); + const char* errorMessage = args.string(); + setError(errorCode, errorMessage); + } + else if (msg != requestAddress) + { + std::stringstream s; + s << "Unexpected response message address " << msg.address() << " (expected " << requestAddress << ")"; + setError(kMethcla_LogicError, s.str().c_str()); + } + } + + protected: + inline void notify() + { + m_cond = true; + m_cond_var.notify_one(); + } + + inline void wait() + { + std::unique_lock lock(m_mutex); + while (!m_cond) { + m_cond_var.wait(lock); + } + if (m_error != kMethcla_NoError) { + throwError(methcla_error_new_with_message(m_error, m_errorMessage.c_str())); + } + } + + void setError(Methcla_ErrorCode error, const char* message) + { + std::lock_guard lock(m_mutex); + if (m_cond) + { + m_error = kMethcla_LogicError; + m_errorMessage = "Result error already set"; + } + else + { + m_error = error; + m_errorMessage = message; + } + notify(); + } + }; + + template class Result : public ResultBase + { + public: + void set(Methcla_ErrorCode error, const char* message) + { + setError(error, message); + } + + void set(const T& value) + { + std::lock_guard lock(m_mutex); + if (m_error == kMethcla_NoError) + { + if (m_cond) + { + m_error = kMethcla_LogicError; + m_errorMessage = "Result already set"; + } + else + { + m_value = value; + notify(); + } + } + } + + const T& get() + { + wait(); + return m_value; + } + + private: + T m_value; + }; + + template <> class Result : public ResultBase + { + public: + void set(Methcla_ErrorCode error, const char* message) + { + setError(error, message); + } + + void set() + { + std::lock_guard lock(m_mutex); + if (m_error == kMethcla_NoError) + { + if (m_cond) + { + m_error = kMethcla_LogicError; + m_errorMessage = "Result already set"; + } + else + { + notify(); + } + } + } + + void get() + { + wait(); + } + }; + } +} + +#endif // METHCLA_DETAIL_RESULT_HPP_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/methcla/engine.h b/java/libraries/sound/src/cpp/include/methcla/engine.h new file mode 100644 index 000000000..a820885a2 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/engine.h @@ -0,0 +1,155 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_ENGINE_H_INCLUDED +#define METHCLA_ENGINE_H_INCLUDED + +#include +#include +#include +#include + +#include +#include +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +//* Return library version string. +const char* methcla_version(); + +//* Return true if using the pro version of methcla. +static inline bool methcla_version_is_pro() +{ + return strstr(methcla_version(), "pro") != NULL; +} + +//* Common audio driver options. +typedef struct Methcla_AudioDriverOptions +{ + int sample_rate; + int num_inputs; + int num_outputs; + int buffer_size; +} Methcla_AudioDriverOptions; + +//* Abstract audio driver type. +typedef struct Methcla_AudioDriver Methcla_AudioDriver; + +//* Initialize audio options. +METHCLA_EXPORT void methcla_audio_driver_options_init(Methcla_AudioDriverOptions* options); + +//* Return default audio driver for this platform. +METHCLA_EXPORT Methcla_Error methcla_default_audio_driver(const Methcla_AudioDriverOptions* options, Methcla_AudioDriver** outDriver); + +//* An integral type for uniquely identifying requests sent to the engine. +typedef int32_t Methcla_RequestId; + +enum +{ + //* Request id reserved for asynchronous notifications. + // Clients should not use this id when sending requests to the engine. + kMethcla_Notification = 0 +}; + +//* Callback closure type for handling OSC packets coming from the engine. +// Packets can be either responses to previously issued requests, or, if request_id is equal to kMethcla_Notification, an asynchronous notification. +typedef struct Methcla_PacketHandler +{ + void* handle; + void (*handle_packet)(void* handle, Methcla_RequestId request_id, const void* packet, size_t size); +} Methcla_PacketHandler; + +typedef struct Methcla_EngineOptions Methcla_EngineOptions; + +struct Methcla_EngineOptions +{ + Methcla_LogHandler log_handler; + Methcla_PacketHandler packet_handler; + + size_t sample_rate; + size_t block_size; + + size_t realtime_memory_size; + size_t max_num_nodes; + size_t max_num_audio_buses; + + //* NULL terminated array of plugin library functions. + Methcla_LibraryFunction* plugin_libraries; +}; + +METHCLA_EXPORT void methcla_engine_options_init(Methcla_EngineOptions* options); + +//* Abstract type for the sound engine. +typedef struct Methcla_Engine Methcla_Engine; + +//* Create a new engine with the given options and an audio driver. +METHCLA_EXPORT Methcla_Error methcla_engine_new_with_driver( + const Methcla_EngineOptions* options, + Methcla_AudioDriver* driver, + Methcla_Engine** engine + ); + +//* Free the resources associated with engine. +// +// Dereferencing engine after this function returns results in undefined behavior. +METHCLA_EXPORT void methcla_engine_free(Methcla_Engine* engine); + +//* Return the last error code. +// METHCLA_EXPORT Methcla_Error methcla_engine_error(const Methcla_Engine* engine); + +//* Start the engine. +METHCLA_EXPORT Methcla_Error methcla_engine_start(Methcla_Engine* engine); + +//* Stop the engine. +METHCLA_EXPORT Methcla_Error methcla_engine_stop(Methcla_Engine* engine); + +enum Methcla_EngineLogFlags +{ + kMethcla_EngineLogDefault = 0x00, + kMethcla_EngineLogDebug = 0x01, + kMethcla_EngineLogRequests = 0x02 +}; + +//* Set flags for debug logging. +METHCLA_EXPORT void methcla_engine_set_log_flags(Methcla_Engine* engine, Methcla_EngineLogFlags flags); + +//* Log a line using the registered log handler. +METHCLA_EXPORT void methcla_engine_log_line(Methcla_Engine* engine, Methcla_LogLevel level, const char* message); + +//* Encode a Methcla_Time value as a 64 bit unsigned integer. +METHCLA_EXPORT uint64_t methcla_time_to_uint64(Methcla_Time time); + +//* Decode a Methcla_Time value from a 64 bit unsigned integer. +METHCLA_EXPORT Methcla_Time methcla_time_from_uint64(uint64_t time); + +//* Get the current time. +METHCLA_EXPORT Methcla_Time methcla_engine_current_time(Methcla_Engine* engine); + +//* Send an OSC packet to the engine. +METHCLA_EXPORT Methcla_Error methcla_engine_send(Methcla_Engine* engine, const void* packet, size_t size); + +//* Open a sound file. +METHCLA_EXPORT Methcla_Error methcla_engine_soundfile_open(const Methcla_Engine* engine, const char* path, Methcla_FileMode mode, Methcla_SoundFile** file, Methcla_SoundFileInfo* info); + +#if defined(__cplusplus) +} +#endif + +#endif /* METHCLA_ENGINE_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/engine.hpp b/java/libraries/sound/src/cpp/include/methcla/engine.hpp new file mode 100644 index 000000000..f42b759c7 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/engine.hpp @@ -0,0 +1,1146 @@ +// Copyright 2012-2013 Samplecount S.L. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef METHCLA_ENGINE_HPP_INCLUDED +#define METHCLA_ENGINE_HPP_INCLUDED + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace Methcla +{ + static inline const char* version() + { + return methcla_version(); + } + + namespace Version + { + static inline bool isPro() + { + return methcla_version_is_pro(); + } + }; + + inline static void dumpRequest(std::ostream& out, const OSCPP::Client::Packet& packet) + { + out << "Request (send): " << packet << std::endl; + } + + class NodeId : public detail::Id + { + public: + NodeId(int32_t id) + : Id(id) + { } + NodeId() + : NodeId(-1) + { } + }; + + class GroupId : public NodeId + { + public: + // Inheriting constructors not supported by clang 3.2 + // using NodeId::NodeId; + GroupId(int32_t id) + : NodeId(id) + { } + GroupId() + : NodeId() + { } + }; + + class SynthId : public NodeId + { + public: + SynthId(int32_t id) + : NodeId(id) + { } + SynthId() + : NodeId() + { } + }; + + class AudioBusId : public detail::Id + { + public: + AudioBusId(int32_t id) + : Id(id) + { } + AudioBusId() + : AudioBusId(0) + { } + }; + + // Node placement specification given a target. + class NodePlacement + { + NodeId m_target; + Methcla_NodePlacement m_placement; + + public: + NodePlacement(NodeId target, Methcla_NodePlacement placement) + : m_target(target) + , m_placement(placement) + { } + + NodePlacement(GroupId target) + : NodePlacement(target, kMethcla_NodePlacementTailOfGroup) + { } + + NodeId target() const + { + return m_target; + } + + Methcla_NodePlacement placement() const + { + return m_placement; + } + + static NodePlacement head(GroupId target) + { + return NodePlacement(target, kMethcla_NodePlacementHeadOfGroup); + } + + static NodePlacement tail(GroupId target) + { + return NodePlacement(target, kMethcla_NodePlacementTailOfGroup); + } + + static NodePlacement before(NodeId target) + { + return NodePlacement(target, kMethcla_NodePlacementBeforeNode); + } + + static NodePlacement after(NodeId target) + { + return NodePlacement(target, kMethcla_NodePlacementAfterNode); + } + }; + + enum BusMappingFlags + { + kBusMappingInternal = kMethcla_BusMappingInternal, + kBusMappingExternal = kMethcla_BusMappingExternal, + kBusMappingFeedback = kMethcla_BusMappingFeedback, + kBusMappingReplace = kMethcla_BusMappingReplace + }; + + static inline BusMappingFlags operator|(BusMappingFlags a, BusMappingFlags b) + { + return detail::combineFlags(a, b); + } + + enum NodeDoneFlags + { + kNodeDoneDoNothing = kMethcla_NodeDoneDoNothing + , kNodeDoneFreeSelf = kMethcla_NodeDoneFreeSelf + , kNodeDoneFreePreceeding = kMethcla_NodeDoneFreePreceeding + , kNodeDoneFreeFollowing = kMethcla_NodeDoneFreeFollowing + , kNodeDoneFreeAllSiblings = kMethcla_NodeDoneFreeAllSiblings + , kNodeDoneFreeParent = kMethcla_NodeDoneFreeParent + }; + + static inline NodeDoneFlags operator|(NodeDoneFlags a, NodeDoneFlags b) + { + return detail::combineFlags(a, b); + } + + struct NodeTreeStatistics + { + size_t numGroups; + size_t numSynths; + + NodeTreeStatistics() + : numGroups(0) + , numSynths(0) + {} + }; + + struct RealtimeMemoryStatistics + { + size_t freeNumBytes; + size_t usedNumBytes; + + RealtimeMemoryStatistics() + : freeNumBytes(0) + , usedNumBytes(0) + {} + + size_t totalNumBytes() const + { + return freeNumBytes + usedNumBytes; + } + }; + + template class ResourceIdAllocator + { + public: + class Statistics + { + size_t m_capacity; + size_t m_allocated; + + public: + Statistics(size_t capacity, size_t allocated) + : m_capacity(capacity) + , m_allocated(allocated) + { } + Statistics(const Statistics&) = default; + + size_t capacity() const { return m_capacity; } + size_t allocated() const { return m_allocated; } + size_t available() const { return capacity() - allocated(); } + }; + + ResourceIdAllocator(T minValue, size_t n) + : m_offset(minValue) + , m_bits(n) + , m_pos(0) + , m_allocated(0) + { } + + Statistics getStatistics() + { + std::lock_guard lock(m_mutex); + return Statistics(m_bits.size(), m_allocated); + } + + Id alloc() + { + std::lock_guard lock(m_mutex); + for (size_t i=m_pos; i < m_bits.size(); i++) { + if (!m_bits[i]) { + m_bits[i] = true; + m_pos = (i+1) == m_bits.size() ? 0 : i+1; + m_allocated++; + return Id(m_offset + i); + } + } + for (size_t i=0; i < m_pos; i++) { + if (!m_bits[i]) { + m_bits[i] = true; + m_pos = i+1; + m_allocated++; + return Id(m_offset + i); + } + } + throw std::runtime_error("No free ids"); + } + + void free(Id id) + { + std::lock_guard lock(m_mutex); + T i = id.id() - m_offset; + if ((i >= 0) && (i < (T)m_bits.size()) && m_bits[i]) { + m_bits[i] = false; + m_allocated--; +#if 0 // Don't throw exception for now + } else { + throw std::runtime_error("Invalid id"); +#endif + } + } + + private: + T m_offset; + std::vector m_bits; + size_t m_pos; + size_t m_allocated; + // TODO: Make lock configurable? + std::mutex m_mutex; + }; + + class PacketPool + { + public: + PacketPool(const PacketPool&) = delete; + PacketPool& operator=(const PacketPool&) = delete; + + PacketPool(size_t packetSize) + : m_packetSize(packetSize) + { } + ~PacketPool() + { + std::lock_guard lock(m_mutex); + while (!m_freeList.empty()) { + void* ptr = m_freeList.front(); + delete [] (char*)ptr; + m_freeList.pop_front(); + } + } + + size_t packetSize() const + { + return m_packetSize; + } + + void* alloc() + { + std::lock_guard lock(m_mutex); + if (m_freeList.empty()) + return new char[m_packetSize]; + void* result = m_freeList.back(); + m_freeList.pop_back(); + return result; + } + + void free(void* ptr) + { + std::lock_guard lock(m_mutex); + m_freeList.push_back(ptr); + } + + private: + size_t m_packetSize; + // TODO: Use boost::lockfree::queue for free list + std::list m_freeList; + std::mutex m_mutex; + }; + + class Packet + { + public: + Packet(PacketPool& pool) + : m_pool(pool) + , m_packet(pool.alloc(), pool.packetSize()) + { } + ~Packet() + { + m_pool.free(m_packet.data()); + } + + Packet(const Packet&) = delete; + Packet& operator=(const Packet&) = delete; + + const OSCPP::Client::Packet& packet() const + { + return m_packet; + } + + OSCPP::Client::Packet& packet() + { + return m_packet; + } + + private: + PacketPool& m_pool; + OSCPP::Client::Packet m_packet; + }; + + class Value + { + public: + enum Type + { + kInt, + kFloat, + kString + }; + + explicit Value(int x) : m_type(kInt), m_int(x) {} + explicit Value(bool x) : m_type(kInt), m_int(x) { } + explicit Value(float x) : m_type(kFloat), m_float(x) {} + explicit Value(double x) : Value((float)x) {} + explicit Value(const std::string& x) : m_type(kString), m_string(x) {} + explicit Value(const char* x) : Value(std::string(x)) {} + + void put(OSCPP::Client::Packet& packet) const + { + switch (m_type) { + case kInt: + packet.int32(m_int); + break; + case kFloat: + packet.float32(m_float); + break; + case kString: + packet.string(m_string.c_str()); + break; + } + } + + private: + Type m_type; + int m_int; + float m_float; + std::string m_string; + }; + + typedef Methcla_LibraryFunction LibraryFunction; + + template class Optional + { + bool m_isSet; + T m_value; + + public: + Optional() + : m_isSet(false) + { } + Optional(const T& value) + : m_isSet(true) + , m_value(value) + { } + Optional(const Optional& other) = default; + + bool isSet() const + { + return m_isSet; + } + + const T& value(const T& def) const + { + return isSet() ? m_value : def; + } + + const T& value() const + { + if (!isSet()) + throw std::logic_error("Optional value unset"); + return m_value; + } + }; + + typedef std::function LogHandler; + + class AudioDriverOptions + { + public: + Optional sampleRate; + Optional numInputs; + Optional numOutputs; + Optional bufferSize; + + operator Methcla_AudioDriverOptions() const + { + Methcla_AudioDriverOptions result; + methcla_audio_driver_options_init(&result); + result.sample_rate = sampleRate.value(-1); + result.num_inputs = numInputs.value(-1); + result.num_outputs = numOutputs.value(-1); + result.buffer_size = bufferSize.value(-1); + return result; + } + }; + + class EngineOptions + { + Methcla_EngineOptions m_options; + std::vector m_pluginLibraries; + + public: + LogHandler logHandler; + Methcla_EngineLogFlags logFlags = kMethcla_EngineLogDefault; + + size_t realtimeMemorySize = 1024*1024; + size_t maxNumNodes = 1024; + size_t maxNumAudioBuses = 1024; + size_t maxNumControlBuses = 4096; + size_t sampleRate = 44100; + size_t blockSize = 64; + std::list pluginLibraries; + + AudioDriverOptions audioDriver; + + EngineOptions& addLibrary(LibraryFunction pluginLibrary) + { + pluginLibraries.push_back(pluginLibrary); + return *this; + } + + Methcla_EngineOptions& options() + { + methcla_engine_options_init(&m_options); + + m_options.sample_rate = sampleRate; + m_options.block_size = blockSize; + m_options.realtime_memory_size = realtimeMemorySize; + m_options.max_num_nodes = maxNumNodes; + m_options.max_num_audio_buses = maxNumAudioBuses; + + m_pluginLibraries.assign(pluginLibraries.begin(), pluginLibraries.end()); + m_pluginLibraries.push_back(nullptr); + + m_options.plugin_libraries = m_pluginLibraries.data(); + + return m_options; + } + }; + + static const Methcla_Time immediately = 0.; + + typedef ResourceIdAllocator NodeIdAllocator; + typedef ResourceIdAllocator AudioBusIdAllocator; + + class Request; + + class EngineInterface + { + public: + virtual ~EngineInterface() { } + + GroupId root() const + { + return GroupId(0); + } + + virtual NodeIdAllocator& nodeIdAllocator() = 0; + + virtual std::unique_ptr allocPacket() = 0; + virtual void sendPacket(const std::unique_ptr& packet) = 0; + + inline void bundle(Methcla_Time time, std::function func); + + inline GroupId group(const NodePlacement& placement); + inline void freeAll(GroupId group); + inline SynthId synth(const char* synthDef, const NodePlacement& placement, const std::vector& controls, const std::list& options=std::list()); + inline void activate(SynthId synth); + inline void mapInput(SynthId synth, size_t index, AudioBusId bus, BusMappingFlags flags=kBusMappingInternal); + inline void mapOutput(SynthId synth, size_t index, AudioBusId bus, BusMappingFlags flags=kBusMappingInternal); + inline void set(NodeId node, size_t index, double value); + inline void free(NodeId node); + }; + + class Request + { + struct Flags + { + bool isMessage : 1; + bool isBundle : 1; + bool isClosed : 1; + }; + + EngineInterface* m_engine; + std::unique_ptr m_packet; + size_t m_bundleCount; + Flags m_flags; + + private: + void beginMessage() + { + if (m_flags.isMessage) + throw std::runtime_error("Cannot add more than one message to non-bundle packet"); + else if (m_flags.isBundle && m_flags.isClosed) + throw std::runtime_error("Cannot add message to closed top-level bundle"); + else if (!m_flags.isBundle) + m_flags.isMessage = true; + } + + OSCPP::Client::Packet& oscPacket() + { + return m_packet->packet(); + } + + public: + Request(EngineInterface* engine) + : m_engine(engine) + , m_packet(engine->allocPacket()) + , m_bundleCount(0) + { + m_flags.isMessage = false; + m_flags.isBundle = false; + m_flags.isClosed = false; + } + + Request(EngineInterface& engine) + : Request(&engine) + { } + + Request(const Request&) = delete; + Request& operator=(const Request&) = delete; + + //* Return size of request packet in bytes. + size_t size() const + { + return m_packet->packet().size(); + } + + void openBundle(Methcla_Time time=immediately) + { + if (m_flags.isMessage) + { + throw std::runtime_error("Cannot open bundle within message packet"); + } + else + { + m_flags.isBundle = true; + m_bundleCount++; + oscPacket().openBundle(methcla_time_to_uint64(time)); + } + } + + // Close nested bundle + void closeBundle() + { + if (m_flags.isMessage) + { + throw std::runtime_error("closeBundle called on a message request"); + } + else if (m_bundleCount == 0) + { + throw std::runtime_error("closeBundle without matching openBundle"); + } + else + { + oscPacket().closeBundle(); + m_bundleCount--; + if (m_bundleCount == 0) + m_flags.isClosed = true; + } + } + + void bundle(Methcla_Time time, std::function func) + { + openBundle(time); + func(*this); + closeBundle(); + } + + //* Finalize request and send to the engine. + void send() + { + if (m_flags.isBundle && m_bundleCount > 0) + throw std::runtime_error("openBundle without matching closeBundle"); + m_engine->sendPacket(m_packet); + } + + GroupId group(const NodePlacement& placement) + { + beginMessage(); + + const NodeId nodeId(m_engine->nodeIdAllocator().alloc()); + + oscPacket() + .openMessage("/group/new", 3) + .int32(nodeId.id()) + .int32(placement.target().id()) + .int32(placement.placement()) + .closeMessage(); + + return GroupId(nodeId.id()); + } + + void freeAll(GroupId group) + { + beginMessage(); + + oscPacket() + .openMessage("/group/freeAll", 1) + .int32(group.id()) + .closeMessage(); + } + + SynthId synth(const char* synthDef, const NodePlacement& placement, const std::vector& controls, const std::list& options=std::list()) + { + beginMessage(); + + const NodeId nodeId(m_engine->nodeIdAllocator().alloc()); + + oscPacket() + .openMessage("/synth/new", 4 + OSCPP::Tags::array(controls.size()) + OSCPP::Tags::array(options.size())) + .string(synthDef) + .int32(nodeId.id()) + .int32(placement.target().id()) + .int32(placement.placement()) + .putArray(controls.begin(), controls.end()); + + oscPacket().openArray(); + for (const auto& x : options) { + x.put(oscPacket()); + } + oscPacket().closeArray(); + + oscPacket().closeMessage(); + + return SynthId(nodeId.id()); + } + + void activate(SynthId synth) + { + beginMessage(); + + oscPacket() + .openMessage("/synth/activate", 1) + .int32(synth.id()) + .closeMessage(); + } + + void mapInput(SynthId synth, size_t index, AudioBusId bus, BusMappingFlags flags=kBusMappingInternal) + { + beginMessage(); + + oscPacket() + .openMessage("/synth/map/input", 4) + .int32(synth.id()) + .int32(index) + .int32(bus.id()) + .int32(flags) + .closeMessage(); + } + + void mapOutput(SynthId synth, size_t index, AudioBusId bus, BusMappingFlags flags=kBusMappingInternal) + { + beginMessage(); + + oscPacket() + .openMessage("/synth/map/output", 4) + .int32(synth.id()) + .int32(index) + .int32(bus.id()) + .int32(flags) + .closeMessage(); + } + + void set(NodeId node, size_t index, double value) + { + beginMessage(); + + oscPacket() + .openMessage("/node/set", 3) + .int32(node.id()) + .int32(index) + .float32(value) + .closeMessage(); + } + + void free(NodeId node) + { + beginMessage(); + + oscPacket() + .openMessage("/node/free", 1) + .int32(node.id()) + .closeMessage(); + m_engine->nodeIdAllocator().free(node.id()); + } + + void whenDone(SynthId synth, NodeDoneFlags flags) + { + beginMessage(); + + oscPacket() + .openMessage("/synth/property/doneFlags/set", 2) + .int32(synth.id()) + .int32(flags) + .closeMessage(); + } + }; + + void EngineInterface::bundle(Methcla_Time time, std::function func) + { + Request request(this); + request.bundle(time, func); + request.send(); + } + + GroupId EngineInterface::group(const NodePlacement& placement) + { + Request request(this); + GroupId result = request.group(placement); + request.send(); + return result; + } + + void EngineInterface::freeAll(GroupId group) + { + Request request(this); + request.freeAll(group); + request.send(); + } + + SynthId EngineInterface::synth(const char* synthDef, const NodePlacement& placement, const std::vector& controls, const std::list& options) + { + Request request(this); + SynthId result = request.synth(synthDef, placement, controls, options); + request.send(); + return result; + } + + void EngineInterface::activate(SynthId synth) + { + Request request(this); + request.activate(synth); + request.send(); + } + + void EngineInterface::mapInput(SynthId synth, size_t index, AudioBusId bus, BusMappingFlags flags) + { + Request request(this); + request.mapInput(synth, index, bus, flags); + request.send(); + } + + void EngineInterface::mapOutput(SynthId synth, size_t index, AudioBusId bus, BusMappingFlags flags) + { + Request request(this); + request.mapOutput(synth, index, bus, flags); + request.send(); + } + + void EngineInterface::set(NodeId node, size_t index, double value) + { + Request request(this); + request.set(node, index, value); + request.send(); + } + + void EngineInterface::free(NodeId node) + { + Request request(this); + request.free(node); + request.send(); + } + + class Engine : public EngineInterface + { + public: + Engine(EngineOptions inOptions=EngineOptions(), Methcla_AudioDriver* driver=nullptr) + : m_logHandler(inOptions.logHandler) + , m_nodeIds(1, inOptions.maxNumNodes - 1) + , m_audioBusIds(0, inOptions.maxNumAudioBuses) + , m_requestId(kMethcla_Notification+1) + , m_notificationHandlerId(0) + , m_packets(8192) + { + Methcla_EngineOptions& options = inOptions.options(); + + if (m_logHandler != nullptr) + { + options.log_handler.handle = this; + options.log_handler.log_line = logLineCallback; + } + + options.packet_handler.handle = this; + options.packet_handler.handle_packet = handlePacket; + + if (driver == nullptr) { + Methcla_AudioDriverOptions driverOptions(inOptions.audioDriver); + detail::checkReturnCode(methcla_default_audio_driver(&driverOptions, &driver)); + } + + detail::checkReturnCode( + methcla_engine_new_with_driver(&options, driver, &m_engine) + ); + + methcla_engine_set_log_flags(m_engine, inOptions.logFlags); + } + + ~Engine() + { + methcla_engine_free(m_engine); + } + + operator const Methcla_Engine* () const + { + return m_engine; + } + + operator Methcla_Engine* () + { + return m_engine; + } + + void start() + { + detail::checkReturnCode(methcla_engine_start(m_engine)); + } + + void stop() + { + detail::checkReturnCode(methcla_engine_stop(m_engine)); + } + + Methcla_Time currentTime() + { + return methcla_engine_current_time(m_engine); + } + + void setLogFlags(Methcla_EngineLogFlags flags) + { + methcla_engine_set_log_flags(m_engine, flags); + } + + void logLine(Methcla_LogLevel level, const char* message) + { + methcla_engine_log_line(m_engine, level, message); + } + + void logLine(Methcla_LogLevel level, const std::string& message) + { + logLine(level, message.c_str()); + } + + NodeIdAllocator& nodeIdAllocator() override + { + return m_nodeIds; + } + + AudioBusIdAllocator& audioBusId() + { + return m_audioBusIds; + } + + std::unique_ptr allocPacket() override + { + return std::unique_ptr(new Packet(m_packets)); + } + + void sendPacket(const std::unique_ptr& packet) override + { + send(*packet); + } + + typedef std::function NotificationHandler; + typedef uint64_t NotificationHandlerId; + + NotificationHandlerId addNotificationHandler(NotificationHandler handler) + { + std::lock_guard lock(m_notificationHandlersMutex); + NotificationHandlerId handlerId = m_notificationHandlerId; + m_notificationHandlers[handlerId] = handler; + m_notificationHandlerId++; + return handlerId; + } + + void removeNotificationHandler(NotificationHandlerId handlerId) + { + std::lock_guard lock(m_notificationHandlersMutex); + m_notificationHandlers.erase(handlerId); + } + + NotificationHandler freeNodeIdHandler(NodeId nodeId) + { + return [this,nodeId](const OSCPP::Server::Message& msg) { + if (msg == "/node/ended") + { + NodeId otherNodeId = NodeId(msg.args().int32()); + if (nodeId == otherNodeId) + { + nodeIdAllocator().free(nodeId); + return true; + } + } + return false; + }; + } + + NotificationHandler freeNodeIdHandler(NodeId nodeId, std::function whenDone) + { + return [this,nodeId,whenDone](const OSCPP::Server::Message& msg) { + if (msg == "/node/ended") + { + NodeId otherNodeId = NodeId(msg.args().int32()); + if (nodeId == otherNodeId) + { + nodeIdAllocator().free(nodeId); + whenDone(nodeId); + return true; + } + } + return false; + }; + } + + NodeTreeStatistics getNodeTreeStatistics() + { + const char* request = "/node/tree/statistics"; + const Methcla_RequestId requestId = getRequestId(); + std::unique_ptr packet = allocPacket(); + packet->packet() + .openMessage(request, 1) + .int32(requestId) + .closeMessage(); + detail::Result result; + withRequest(requestId, packet->packet(), [&request,&result](Methcla_RequestId, const OSCPP::Server::Message& response){ + result.checkResponse(request, response); + OSCPP::Server::ArgStream args(response.args()); + NodeTreeStatistics value; + value.numGroups = args.int32(); + value.numSynths = args.int32(); + result.set(value); + }); + return result.get(); + } + + RealtimeMemoryStatistics getRealtimeMemoryStatistics() + { + const char* request = "/engine/realtime-memory/statistics"; + const Methcla_RequestId requestId = getRequestId(); + auto packet = allocPacket(); + packet->packet() + .openMessage(request, 1) + .int32(requestId) + .closeMessage(); + detail::Result result; + withRequest(requestId, packet->packet(), [&request,&result](Methcla_RequestId, const OSCPP::Server::Message& response){ + result.checkResponse(request, response); + OSCPP::Server::ArgStream args(response.args()); + RealtimeMemoryStatistics value; + value.freeNumBytes = args.int32(); + value.usedNumBytes = args.int32(); + result.set(value); + }); + return result.get(); + } + + private: + static void logLineCallback(void* data, Methcla_LogLevel level, const char* message) + { + assert( data != nullptr ); + static_cast(data)->m_logHandler(level, message); + } + + static void handlePacket(void* data, Methcla_RequestId requestId, const void* packet, size_t size) + { + if (requestId == kMethcla_Notification) + static_cast(data)->handleNotification(packet, size); + else + static_cast(data)->handleReply(requestId, packet, size); + } + + void handleNotification(const void* packet, size_t size) + { + // Parse notification packet + OSCPP::Server::Message message(OSCPP::Server::Packet(packet, size)); + + // Broadcast notification to handlers + std::lock_guard lock(m_notificationHandlersMutex); + for (auto it=m_notificationHandlers.begin(); it != m_notificationHandlers.end();) + { + if (it->second(message)) it = m_notificationHandlers.erase(it); + else it++; + } + } + + void handleReply(Methcla_RequestId requestId, const void* packet, size_t size) + { + // Parse response packet + OSCPP::Server::Message message(OSCPP::Server::Packet(packet, size)); + + // Look up request id and invoke callback + std::lock_guard lock(m_responseHandlersMutex); + + auto it = m_responseHandlers.find(requestId); + if (it != m_responseHandlers.end()) + { + try + { + it->second(requestId, message); + m_responseHandlers.erase(it); + } + catch (...) + { + m_responseHandlers.erase(it); + throw; + } + } + } + + void send(const void* packet, size_t size) + { + detail::checkReturnCode(methcla_engine_send(m_engine, packet, size)); + } + + void send(const OSCPP::Client::Packet& packet) + { + // dumpRequest(std::cout, packet); + send(packet.data(), packet.size()); + } + + void send(const Packet& packet) + { + send(packet.packet()); + } + + Methcla_RequestId getRequestId() + { + std::lock_guard lock(m_requestIdMutex); + Methcla_RequestId result = m_requestId; + if (result == kMethcla_Notification) { + result++; + } + m_requestId = result + 1; + return result; + } + + typedef std::function ResponseHandler; + + void addResponseHandler(Methcla_RequestId requestId, ResponseHandler handler) + { + std::lock_guard lock(m_responseHandlersMutex); + if (m_responseHandlers.find(requestId) != m_responseHandlers.end()) { + throw std::logic_error("Methcla::Engine::addResponseHandler: Duplicate request id"); + } + m_responseHandlers[requestId] = handler; + } + + void withRequest(Methcla_RequestId requestId, const OSCPP::Client::Packet& request, ResponseHandler handler) + { + addResponseHandler(requestId, handler); + send(request); + } + + void execRequest(const char* requestAddress, Methcla_RequestId requestId, const OSCPP::Client::Packet& request) + { + detail::Result result; + withRequest(requestId, request, [requestAddress,&result](Methcla_RequestId, const OSCPP::Server::Message& response){ + result.checkResponse(requestAddress, response); + result.set(); + }); + result.get(); + } + + private: + typedef std::unordered_map ResponseHandlers; + typedef std::unordered_map NotificationHandlers; + + Methcla_Engine* m_engine; + LogHandler m_logHandler; + NodeIdAllocator m_nodeIds; + AudioBusIdAllocator m_audioBusIds; + Methcla_RequestId m_requestId; + std::mutex m_requestIdMutex; + ResponseHandlers m_responseHandlers; + std::mutex m_responseHandlersMutex; + NotificationHandlers m_notificationHandlers; + NotificationHandlerId m_notificationHandlerId; + std::mutex m_notificationHandlersMutex; + PacketPool m_packets; + }; +}; + +#endif // METHCLA_ENGINE_HPP_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/methcla/file.h b/java/libraries/sound/src/cpp/include/methcla/file.h new file mode 100644 index 000000000..532f64979 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/file.h @@ -0,0 +1,121 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_FILE_H_INCLUDED +#define METHCLA_FILE_H_INCLUDED + +#include +#include +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +typedef enum +{ + kMethcla_FileModeRead, + kMethcla_FileModeWrite +} Methcla_FileMode; + +typedef enum +{ + kMethcla_SoundFileTypeUnknown, + kMethcla_SoundFileTypeAIFF, + kMethcla_SoundFileTypeWAV +} Methcla_SoundFileType; + +typedef enum +{ + kMethcla_SoundFileFormatUnknown, + kMethcla_SoundFileFormatPCM16, + kMethcla_SoundFileFormatPCM24, + kMethcla_SoundFileFormatPCM32, + kMethcla_SoundFileFormatFloat +} Methcla_SoundFileFormat; + +typedef struct +{ + int64_t frames; + unsigned int channels; + unsigned int samplerate; + Methcla_SoundFileType file_type; + Methcla_SoundFileFormat file_format; +} Methcla_SoundFileInfo; + +typedef struct Methcla_SoundFile Methcla_SoundFile; + +struct Methcla_SoundFile +{ + void* handle; + Methcla_Error (*close)(const Methcla_SoundFile* file); + Methcla_Error (*seek)(const Methcla_SoundFile* file, int64_t numFrames); + Methcla_Error (*tell)(const Methcla_SoundFile* file, int64_t* numFrames); + Methcla_Error (*read_float)(const Methcla_SoundFile* file, float* buffer, size_t numFrames, size_t* outNumFrames); + Methcla_Error (*write_float)(const Methcla_SoundFile* file, const float* buffer, size_t numFrames, size_t* outNumFrames); +}; + +typedef struct Methcla_SoundFileAPI Methcla_SoundFileAPI; + +struct Methcla_SoundFileAPI +{ + void* handle; + Methcla_Error (*open)(const Methcla_SoundFileAPI* api, const char* path, Methcla_FileMode mode, Methcla_SoundFile** file, Methcla_SoundFileInfo* info); +}; + +static inline Methcla_Error methcla_soundfile_close(Methcla_SoundFile* file) +{ + if ((file == NULL) || (file->close == NULL)) + return methcla_error_new(kMethcla_ArgumentError); + return file->close(file); +} + +static inline Methcla_Error methcla_soundfile_seek(Methcla_SoundFile* file, int64_t numFrames) +{ + if ((file == NULL) || (file->seek == NULL)) + return methcla_error_new(kMethcla_ArgumentError); + return file->seek(file, numFrames); +} + +static inline Methcla_Error methcla_soundfile_tell(Methcla_SoundFile* file, int64_t* numFrames) +{ + if ((file == NULL) || (file->tell == NULL) || (numFrames == NULL)) + return methcla_error_new(kMethcla_ArgumentError); + return file->tell(file, numFrames); +} + +static inline Methcla_Error methcla_soundfile_read_float(Methcla_SoundFile* file, float* buffer, size_t numFrames, size_t* outNumFrames) +{ + if ((file == NULL) || (file->read_float == NULL) || + (buffer == NULL) || (outNumFrames == NULL)) + return methcla_error_new(kMethcla_ArgumentError); + return file->read_float(file, buffer, numFrames, outNumFrames); +} + +static inline Methcla_Error methcla_soundfile_write_float(Methcla_SoundFile* file, const float* buffer, size_t numFrames, size_t* outNumFrames) +{ + if ((file == NULL) || (file->write_float == NULL) || + (buffer == NULL) || (outNumFrames == NULL)) + return methcla_error_new(kMethcla_ArgumentError); + return file->write_float(file, buffer, numFrames, outNumFrames); +} + +#if defined(__cplusplus) +} +#endif + +#endif /* METHCLA_FILE_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/file.hpp b/java/libraries/sound/src/cpp/include/methcla/file.hpp new file mode 100644 index 000000000..f9b07fe78 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/file.hpp @@ -0,0 +1,185 @@ +// Copyright 2012-2013 Samplecount S.L. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef METHCLA_FILE_HPP_INCLUDED +#define METHCLA_FILE_HPP_INCLUDED + +#include +#include +#include +#include + +#include + +namespace Methcla +{ + class SoundFileInfo : public Methcla_SoundFileInfo + { + public: + SoundFileInfo() + { + frames = 0; + channels = 0; + samplerate = 0; + file_type = kMethcla_SoundFileTypeUnknown; + file_format = kMethcla_SoundFileFormatUnknown; + } + + SoundFileInfo(const Methcla_SoundFileInfo& info) + { + frames = info.frames; + channels = info.channels; + samplerate = info.samplerate; + file_type = info.file_type; + file_format = info.file_format; + } + + int64_t samples() const + { + return channels * frames; + } + + template T duration() const + { + return (T)frames/(T)samplerate; + } + }; + + class SoundFile + { + Methcla_SoundFile* m_file; + SoundFileInfo m_info; + + inline void ensureInitialized() const + { + if (!m_file) + throw std::logic_error("SoundFile has not been initialized"); + } + + public: + SoundFile() + : m_file(nullptr) + {} + + SoundFile(Methcla_SoundFile* file, const Methcla_SoundFileInfo& info) + : m_file(file) + , m_info(info) + {} + + SoundFile(const Engine& engine, const std::string& path) + { + detail::checkReturnCode( + methcla_engine_soundfile_open(engine, path.c_str(), kMethcla_FileModeRead, &m_file, &m_info) + ); + } + + SoundFile(const Engine& engine, const std::string& path, const SoundFileInfo& info) + : m_info(info) + { + detail::checkReturnCode( + methcla_engine_soundfile_open(engine, path.c_str(), kMethcla_FileModeWrite, &m_file, &m_info) + ); + } + + SoundFile(const Methcla_Host* host, const std::string& path) + { + detail::checkReturnCode( + methcla_host_soundfile_open(host, path.c_str(), kMethcla_FileModeRead, &m_file, &m_info) + ); + } + + SoundFile(const Methcla_Host* host, const std::string& path, const SoundFileInfo& info) + : m_info(info) + { + detail::checkReturnCode( + methcla_host_soundfile_open(host, path.c_str(), kMethcla_FileModeWrite, &m_file, &m_info) + ); + } + + // SoundFile is moveable + SoundFile(SoundFile&& other) + : m_file(std::move(other.m_file)) + , m_info(std::move(other.m_info)) + { + other.m_file = nullptr; + } + + SoundFile& operator=(SoundFile&& other) + { + m_file = std::move(other.m_file); + m_info = std::move(other.m_info); + other.m_file = nullptr; + return *this; + } + + // SoundFile is not copyable + SoundFile(const SoundFile&) = delete; + SoundFile& operator=(const SoundFile&) = delete; + + ~SoundFile() + { + if (m_file != nullptr) + methcla_soundfile_close(m_file); + } + + operator bool() const + { + return m_file != nullptr; + } + + const SoundFileInfo& info() const + { + return m_info; + } + + void close() + { + ensureInitialized(); + detail::checkReturnCode(methcla_soundfile_close(m_file)); + m_file = nullptr; + } + + void seek(int64_t numFrames) + { + ensureInitialized(); + detail::checkReturnCode(methcla_soundfile_seek(m_file, numFrames)); + } + + int64_t tell() + { + ensureInitialized(); + int64_t numFrames; + detail::checkReturnCode(methcla_soundfile_tell(m_file, &numFrames)); + return numFrames; + } + + size_t read(float* buffer, size_t numFrames) + { + ensureInitialized(); + size_t outNumFrames; + detail::checkReturnCode(methcla_soundfile_read_float(m_file, buffer, numFrames, &outNumFrames)); + return outNumFrames; + } + + size_t write(const float* buffer, size_t numFrames) + { + ensureInitialized(); + size_t outNumFrames; + detail::checkReturnCode(methcla_soundfile_write_float(m_file, buffer, numFrames, &outNumFrames)); + return outNumFrames; + } + }; +} + +#endif // METHCLA_FILE_HPP_INCLUDED \ No newline at end of file diff --git a/java/libraries/sound/src/cpp/include/methcla/log.h b/java/libraries/sound/src/cpp/include/methcla/log.h new file mode 100644 index 000000000..6525c4649 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/log.h @@ -0,0 +1,34 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_LOG_H_INCLUDED +#define METHCLA_LOG_H_INCLUDED + +typedef enum Methcla_LogLevel +{ + kMethcla_LogError, + kMethcla_LogWarn, + kMethcla_LogInfo, + kMethcla_LogDebug +} Methcla_LogLevel; + +typedef struct Methcla_LogHandler +{ + void* handle; + void (*log_line)(void* handle, Methcla_LogLevel level, const char* message); +} Methcla_LogHandler; + +#endif /* METHCLA_LOG_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/log.hpp b/java/libraries/sound/src/cpp/include/methcla/log.hpp new file mode 100644 index 000000000..51e0658d4 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/log.hpp @@ -0,0 +1,81 @@ +// Copyright 2014 Samplecount S.L. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef METHCLA_LOG_HPP_INCLUDED +#define METHCLA_LOG_HPP_INCLUDED + +#include + +#include +#include +#include + +namespace Methcla { + +class LogStream +{ + Methcla_LogLevel m_level; + std::function m_callback; + std::stringstream* m_stream; + +public: + LogStream(std::function callback, Methcla_LogLevel messageLevel, Methcla_LogLevel currentLevel) + : m_level(messageLevel) + , m_callback(messageLevel <= currentLevel ? callback : nullptr) + , m_stream(nullptr) + {} + + LogStream(std::function callback, Methcla_LogLevel messageLevel) + : LogStream(callback, messageLevel, messageLevel) + {} + + LogStream(const LogStream& other) + : m_level(other.m_level) + , m_callback(other.m_callback) + , m_stream(other.m_stream ? new std::stringstream(other.m_stream->str()) : nullptr) + {} + + ~LogStream() + { + if (m_stream) + { + try + { + if (m_callback) + m_callback(m_level, m_stream->str().c_str()); + delete m_stream; + } + catch (...) + { + delete m_stream; + throw; + } + } + } + + template LogStream& operator<<(const T& x) + { + if (m_callback) + { + if (!m_stream) + m_stream = new std::stringstream(); + *m_stream << x; + } + return *this; + } +}; + +} // namespace Methcla + +#endif // METHCLA_LOG_HPP_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/methcla/platform/pepper.hpp b/java/libraries/sound/src/cpp/include/methcla/platform/pepper.hpp new file mode 100644 index 000000000..5d5413f5a --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/platform/pepper.hpp @@ -0,0 +1,27 @@ +// Copyright 2013 Samplecount S.L. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef METHCLA_PLATFORM_PEPPER_HPP_INCLUDED +#define METHCLA_PLATFORM_PEPPER_HPP_INCLUDED + +#include +#include +#include "ppapi/cpp/instance_handle.h" + +METHCLA_EXPORT Methcla_AudioDriver* methcla_platform_pepper_audio_driver_new( + const Methcla_AudioDriverOptions* options, + const pp::InstanceHandle& instance + ); + +#endif // METHCLA_PLATFORM_PEPPER_HPP_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/methcla/platform/rtaudio.hpp b/java/libraries/sound/src/cpp/include/methcla/platform/rtaudio.hpp new file mode 100644 index 000000000..d1b39f625 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/platform/rtaudio.hpp @@ -0,0 +1,24 @@ +// Copyright 2014 Samplecount S.L. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef METHCLA_PLATFORM_RTAUDIO_HPP_INCLUDED +#define METHCLA_PLATFORM_RTAUDIO_HPP_INCLUDED + +#include + +METHCLA_EXPORT Methcla_AudioDriver* methcla_rtaudio_driver_new( + const Methcla_AudioDriverOptions* options + ); + +#endif // METHCLA_PLATFORM_RTAUDIO_HPP_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/methcla/plugin.h b/java/libraries/sound/src/cpp/include/methcla/plugin.h new file mode 100644 index 000000000..2ff03dd6a --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugin.h @@ -0,0 +1,322 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGIN_H_INCLUDED +#define METHCLA_PLUGIN_H_INCLUDED + +#include +#include +#include + +#include +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +#define METHCLA_PLUGINS_URI "http://methc.la/plugins" + +//* Realtime interface. +typedef struct Methcla_World Methcla_World; + +//* Non-realtime interface. +typedef struct Methcla_Host Methcla_Host; + +//* Synth handle managed by a plugin. +typedef void Methcla_Synth; + +//* Callback function type for performing commands in the non-realtime context. +typedef void (*Methcla_HostPerformFunction)(const Methcla_Host* host, void* data); + +//* Callback function type for performing commands in the realtime context. +typedef void (*Methcla_WorldPerformFunction)(const Methcla_World* world, void* data); + +//* Realtime interface +struct Methcla_World +{ + //* Handle for implementation specific data. + void* handle; + + //* Return engine sample rate. + double (*samplerate)(const Methcla_World*); + + //* Return maximum audio block size. + size_t (*block_size)(const Methcla_World* world); + + //* Return the time at the start of the current audio block in seconds. + Methcla_Time (*current_time)(const struct Methcla_World* world); + + // Realtime memory allocation + void* (*alloc)(const struct Methcla_World* world, size_t size); + void* (*alloc_aligned)(const struct Methcla_World* world, size_t alignment, size_t size); + void (*free)(const struct Methcla_World* world, void* ptr); + + //* Schedule a command for execution in the non-realtime context. + void (*perform_command)(const Methcla_World* world, Methcla_HostPerformFunction perform, void* data); + + //* Log a message and a newline character. + void (*log_line)(const Methcla_World* world, Methcla_LogLevel level, const char* message); + + //* Free synth. + void (*synth_done)(const struct Methcla_World* world, Methcla_Synth* synth); +}; + +static inline double methcla_world_samplerate(const Methcla_World* world) +{ + assert(world && world->samplerate); + return world->samplerate(world); +} + +static inline size_t methcla_world_block_size(const Methcla_World* world) +{ + assert(world && world->block_size); + return world->block_size(world); +} + +static inline Methcla_Time methcla_world_current_time(const Methcla_World* world) +{ + assert(world); + assert(world->current_time); + return world->current_time(world); +} + +static inline void* methcla_world_alloc(const Methcla_World* world, size_t size) +{ + assert(world && world->alloc); + return world->alloc(world, size); +} + +static inline void* methcla_world_alloc_aligned(const Methcla_World* world, size_t alignment, size_t size) +{ + assert(world && world->alloc_aligned); + return world->alloc_aligned(world, alignment, size); +} + +static inline void methcla_world_free(const Methcla_World* world, void* ptr) +{ + assert(world && world->free); + world->free(world, ptr); +} + +static inline void methcla_world_perform_command(const Methcla_World* world, Methcla_HostPerformFunction perform, void* data) +{ + assert(world && world->perform_command); + assert(perform); + world->perform_command(world, perform, data); +} + +static inline void methcla_world_log_line(const Methcla_World* world, Methcla_LogLevel level, const char* message) +{ + assert(world); + assert(world->log_line); + assert(message); + world->log_line(world, level, message); +} + +static inline void methcla_world_synth_done(const Methcla_World* world, Methcla_Synth* synth) +{ + assert(world); + assert(world->synth_done); + assert(synth); + world->synth_done(world, synth); +} + +typedef enum +{ + kMethcla_Input, + kMethcla_Output +} Methcla_PortDirection; + +typedef enum +{ + kMethcla_ControlPort, + kMethcla_AudioPort +} Methcla_PortType; + +typedef enum +{ + kMethcla_PortFlags = 0x0 + , kMethcla_Trigger = 0x1 +} Methcla_PortFlags; + +typedef struct Methcla_PortDescriptor Methcla_PortDescriptor; + +struct Methcla_PortDescriptor +{ + Methcla_PortDirection direction; + Methcla_PortType type; + Methcla_PortFlags flags; +}; + +typedef uint16_t Methcla_PortCount; + +typedef void Methcla_SynthOptions; + +typedef struct Methcla_SynthDef Methcla_SynthDef; + +struct Methcla_SynthDef +{ + //* Synth definition URI. + const char* uri; + + //* Size of an instance in bytes. + size_t instance_size; + + //* Size of options struct in bytes. + size_t options_size; + + //* Parse OSC options and fill options struct. + void (*configure)(const void* tag_buffer, size_t tag_size, const void* arg_buffer, size_t arg_size, Methcla_SynthOptions* options); + + //* Get port descriptor at index. + bool (*port_descriptor)(const Methcla_SynthOptions* options, Methcla_PortCount index, Methcla_PortDescriptor* port); + + //* Construct a synth instance at the location given. + void (*construct)(const Methcla_World* world, const Methcla_SynthDef* def, const Methcla_SynthOptions* options, Methcla_Synth* synth); + + //* Connect port at index to data. + void (*connect)(Methcla_Synth* synth, Methcla_PortCount index, void* data); + + //* Activate the synth instance just before starting to call `process`. + void (*activate)(const Methcla_World* world, Methcla_Synth* synth); + + //* Process numFrames of audio samples. + void (*process)(const Methcla_World* world, Methcla_Synth* synth, size_t numFrames); + + //* Destroy a synth instance. + void (*destroy)(const Methcla_World* world, Methcla_Synth* synth); +}; + +struct Methcla_Host +{ + //* Handle for implementation specific data. + void* handle; + + //* Register a synth definition. + void (*register_synthdef)(const struct Methcla_Host* host, const Methcla_SynthDef* synthDef); + + //* Register sound file API. + void (*register_soundfile_api)(const struct Methcla_Host* host, const Methcla_SoundFileAPI* api); + + //* Allocate a block of memory + void* (*alloc)(const struct Methcla_Host* context, size_t size); + + //* Allocate a block of aligned memory. + void* (*alloc_aligned)(const struct Methcla_Host* context, size_t alignment, size_t size); + + //* Free a block of memory previously allocated by alloc or alloc_aligned. + void (*free)(const struct Methcla_Host* context, void* ptr); + + //* Open sound file. + Methcla_Error (*soundfile_open)(const Methcla_Host* host, const char* path, Methcla_FileMode mode, Methcla_SoundFile** file, Methcla_SoundFileInfo* info); + + //* Schedule a command for execution in the realtime context. + void (*perform_command)(const Methcla_Host* host, const Methcla_WorldPerformFunction perform, void* data); + + //* Send an OSC notification packet to the client. + void (*notify)(const Methcla_Host* host, const void* packet, size_t size); + + //* Log a message and a newline character. + void (*log_line)(const Methcla_Host* host, Methcla_LogLevel level, const char* message); +}; + +static inline void methcla_host_register_synthdef(const Methcla_Host* host, const Methcla_SynthDef* synthDef) +{ + assert(host && host->register_synthdef); + assert(synthDef); + host->register_synthdef(host, synthDef); +} + +static inline void methcla_host_register_soundfile_api(const Methcla_Host* host, const Methcla_SoundFileAPI* api) +{ + assert(host && host->register_soundfile_api && api); + host->register_soundfile_api(host, api); +} + +static inline void* methcla_host_alloc(const Methcla_Host* context, size_t size) +{ + assert(context); + assert(context->alloc); + return context->alloc(context, size); +} + +static inline void* methcla_host_alloc_aligned(const Methcla_Host* context, size_t alignment, size_t size) +{ + assert(context); + assert(context->alloc_aligned); + return context->alloc_aligned(context, alignment, size); +} + +static inline void methcla_host_free(const Methcla_Host* context, void* ptr) +{ + assert(context); + assert(context->free); + context->free(context, ptr); +} + +static inline Methcla_Error methcla_host_soundfile_open(const Methcla_Host* host, const char* path, Methcla_FileMode mode, Methcla_SoundFile** file, Methcla_SoundFileInfo* info) +{ + assert(host && host->soundfile_open); + assert(path); + assert(file); + assert(info); + return host->soundfile_open(host, path, mode, file, info); +} + +static inline void methcla_host_perform_command(const Methcla_Host* host, Methcla_WorldPerformFunction perform, void* data) +{ + assert(host && host->perform_command); + host->perform_command(host, perform, data); +} + +static inline void methcla_host_log_line(const Methcla_Host* host, Methcla_LogLevel level, const char* message) +{ + assert(host); + assert(host->log_line); + assert(message); + host->log_line(host, level, message); +} + +typedef struct Methcla_Library Methcla_Library; + +struct Methcla_Library +{ + //* Handle for implementation specific data. + void* handle; + + //* Destroy the library and clean up associated resources. + void (*destroy)(const Methcla_Library* library); +}; + +typedef const Methcla_Library* (*Methcla_LibraryFunction)(const Methcla_Host* host, const char* bundlePath); + +static inline void methcla_library_destroy(const Methcla_Library* library) +{ + assert(library); + if (library->destroy) + library->destroy(library); +} + +// #define MESCALINE_MAKE_INIT_FUNC(name) MethclaInit_##name +// #define MESCALINE_INIT_FUNC(name) MESCALINE_MAKE_INIT_FUNC(name) + +#if defined(__cplusplus) +} +#endif + +#endif /* METHCLA_PLUGIN_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugin.hpp b/java/libraries/sound/src/cpp/include/methcla/plugin.hpp new file mode 100644 index 000000000..219c3f5d6 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugin.hpp @@ -0,0 +1,305 @@ +// Copyright 2013 Samplecount S.L. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef METHCLA_PLUGIN_HPP_INCLUDED +#define METHCLA_PLUGIN_HPP_INCLUDED + +#include +#include +#include + +#include +#include + +// NOTE: This API is unstable and subject to change! + +namespace Methcla { namespace Plugin { + + template class World + { + const Methcla_World* m_context; + + public: + World(const Methcla_World* context) + : m_context(context) + { } + + double sampleRate() const + { + return methcla_world_samplerate(m_context); + } + + size_t blockSize() const + { + return methcla_world_block_size(m_context); + } + + Methcla_Time currentTime() const + { + return methcla_world_current_time(m_context); + } + + void* alloc(size_t size) const + { + return methcla_world_alloc(m_context, size); + } + + void* allocAligned(size_t alignment, size_t size) const + { + return methcla_world_alloc_aligned(m_context, alignment, size); + } + + void free(void* ptr) + { + methcla_world_free(m_context, ptr); + } + + void performCommand(Methcla_HostPerformFunction perform, void* data) + { + methcla_world_perform_command(m_context, perform, data); + } + + LogStream log(Methcla_LogLevel logLevel=kMethcla_LogInfo) + { + using namespace std::placeholders; + return LogStream(std::bind(m_context->log_line, m_context, _1, _2), logLevel); + } + + void synthRetain(Synth* synth) const + { + methcla_world_synth_retain(m_context, synth); + } + + void synthRelease(Synth* synth) const + { + methcla_world_synth_release(m_context, synth); + } + + void synthDone(Synth* synth) const + { + methcla_world_synth_done(m_context, synth); + } + }; + + class HostContext + { + const Methcla_Host* m_context; + + public: + HostContext(const Methcla_Host* context) + : m_context(context) + {} + + LogStream log(Methcla_LogLevel logLevel=kMethcla_LogInfo) + { + using namespace std::placeholders; + return LogStream(std::bind(m_context->log_line, m_context, _1, _2), logLevel); + } + }; + + class NoPorts + { + public: + enum Port { }; + + static size_t numPorts() { return 0; } + + static Methcla_PortDescriptor descriptor(Port) + { + Methcla_PortDescriptor result; + std::memset(&result, 0, sizeof(result)); + return result; + } + }; + + class PortDescriptor + { + public: + static Methcla_PortDescriptor make(Methcla_PortDirection direction, Methcla_PortType type, Methcla_PortFlags flags=kMethcla_PortFlags) + { + Methcla_PortDescriptor pd; + pd.direction = direction; + pd.type = type; + pd.flags = flags; + return pd; + } + + static Methcla_PortDescriptor audioInput(Methcla_PortFlags flags=kMethcla_PortFlags) + { + return make(kMethcla_Input, kMethcla_AudioPort, flags); + } + + static Methcla_PortDescriptor audioOutput(Methcla_PortFlags flags=kMethcla_PortFlags) + { + return make(kMethcla_Output, kMethcla_AudioPort, flags); + } + + static Methcla_PortDescriptor controlInput(Methcla_PortFlags flags=kMethcla_PortFlags) + { + return make(kMethcla_Input, kMethcla_ControlPort, flags); + } + + static Methcla_PortDescriptor controlOutput(Methcla_PortFlags flags=kMethcla_PortFlags) + { + return make(kMethcla_Output, kMethcla_ControlPort, flags); + } + }; + + template class StaticSynthOptions + { + public: + typedef Options Type; + + static void + configure( const void* tag_buffer + , size_t tag_buffer_size + , const void* arg_buffer + , size_t arg_buffer_size + , Methcla_SynthOptions* options ) + { + OSCPP::Server::ArgStream args( + OSCPP::ReadStream(tag_buffer, tag_buffer_size), + OSCPP::ReadStream(arg_buffer, arg_buffer_size) + ); + new (options) Type(args); + } + + static bool + port_descriptor( const Methcla_SynthOptions* + , Methcla_PortCount index + , Methcla_PortDescriptor* port ) + { + if (index < PortDescriptor::numPorts()) + { + *port = PortDescriptor::descriptor(static_cast(index)); + return true; + } + return false; + } + }; + + namespace detail + { + template + class IfSynthDefHasActivate + { + public: + static inline void exec(const Methcla_World*, Synth*) { } + }; + + template + class IfSynthDefHasActivate + { + public: + static inline void exec(const Methcla_World* context, Synth* synth) + { synth->activate(World(context)); } + }; + + template + class IfSynthDefHasCleanup + { + public: + static inline void exec(const Methcla_World*, Synth*) { } + }; + + template + class IfSynthDefHasCleanup + { + public: + static inline void exec(const Methcla_World* context, Synth* synth) + { synth->cleanup(World(context)); } + }; + } // namespace detail + + enum SynthDefFlags + { + kSynthDefDefaultFlags = 0x00, + kSynthDefHasActivate = 0x01, + kSynthDefHasCleanup = 0x02 + }; + + template class SynthDef + { + static void + construct( const Methcla_World* context + , const Methcla_SynthDef* synthDef + , const Methcla_SynthOptions* options + , Methcla_Synth* synth ) + { + assert(context != nullptr); + assert(options != nullptr); + new (synth) Synth(World(context), synthDef, *static_cast(options)); + } + + static void + connect( Methcla_Synth* synth + , Methcla_PortCount port + , void* data) + { + static_cast(synth)->connect(static_cast(port), data); + } + + static void + activate(const Methcla_World* context, Methcla_Synth* synth) + { + detail::IfSynthDefHasActivate< + Synth, + (Flags & kSynthDefHasActivate) == kSynthDefHasActivate + >::exec(context, static_cast(synth)); + } + + static void + process(const Methcla_World* context, Methcla_Synth* synth, size_t numFrames) + { + static_cast(synth)->process(World(context), numFrames); + } + + static void + destroy(const Methcla_World* context, Methcla_Synth* synth) + { + // Call cleanup method + detail::IfSynthDefHasActivate< + Synth, + (Flags & kSynthDefHasCleanup) == kSynthDefHasCleanup + >::exec(context, static_cast(synth)); + // Call destructor + static_cast(synth)->~Synth(); + } + + public: + void operator()(const Methcla_Host* host, const char* uri) + { + static const Methcla_SynthDef kSynthDef = + { + uri, + sizeof(Synth), + sizeof(typename Options::Type), + Options::configure, + Options::port_descriptor, + construct, + connect, + activate, + process, + destroy + }; + methcla_host_register_synthdef(host, &kSynthDef); + } + }; + + template + using StaticSynthDef + = SynthDef, Ports, Flags>; +} } + +#endif // METHCLA_PLUGIN_HPP_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/ampfol.h b/java/libraries/sound/src/cpp/include/methcla/plugins/ampfol.h new file mode 100644 index 000000000..8d4823326 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/ampfol.h @@ -0,0 +1,25 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_AMPLITUDE_FOLLOWER_H_INCLUDED +#define METHCLA_PLUGINS_AMPLITUDE_FOLLOWER_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_amplitude_follower(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_AMPLITUDE_FOLLOWER_URI METHCLA_PLUGINS_URI "/amplidute_follower" + +#endif /* METHCLA_PLUGINS_AMPLITUDE_FOLLOWER_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/audio_in.h b/java/libraries/sound/src/cpp/include/methcla/plugins/audio_in.h new file mode 100644 index 000000000..c6eb76819 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/audio_in.h @@ -0,0 +1,25 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_AUDIOIN_H_INCLUDED +#define METHCLA_PLUGINS_AUDIOIN_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_audioin(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_AUDIOIN_URI METHCLA_PLUGINS_URI "/audioin" + +#endif /* METHCLA_PLUGINS_AUDIOIN_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/bpf.h b/java/libraries/sound/src/cpp/include/methcla/plugins/bpf.h new file mode 100644 index 000000000..c58b8931c --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/bpf.h @@ -0,0 +1,25 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_BPF_H_INCLUDED +#define METHCLA_PLUGINS_BPF_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_bpf(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_BPF_URI METHCLA_PLUGINS_URI "/bpf" + +#endif /* METHCLA_PLUGINS_BPF_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/brownnoise.h b/java/libraries/sound/src/cpp/include/methcla/plugins/brownnoise.h new file mode 100644 index 000000000..30ad2e7ce --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/brownnoise.h @@ -0,0 +1,19 @@ +// +// whitenoise.h +// +// +// Created by wirsing on 13.12.13. +// +// + + +#ifndef METHCLA_PLUGINS_BROWN_NOISE_H_INCLUDED +#define METHCLA_PLUGINS_BROWN_NOISE_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_brown_noise(const Methcla_Host*, const char*); + +#define METHCLA_PLUGINS_BROWN_NOISE_URI METHCLA_PLUGINS_URI "/brown_noise" + +#endif // METHCLA_PLUGINS_BROWN_NOISE_H_INCLUDED \ No newline at end of file diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/delay.h b/java/libraries/sound/src/cpp/include/methcla/plugins/delay.h new file mode 100644 index 000000000..36ffee64a --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/delay.h @@ -0,0 +1,25 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_DELAY_H_INCLUDED +#define METHCLA_PLUGINS_DELAY_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_delay(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_DELAY_URI METHCLA_PLUGINS_URI "/delay" + +#endif /* METHCLA_PLUGINS_DELAY_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/fft.h b/java/libraries/sound/src/cpp/include/methcla/plugins/fft.h new file mode 100644 index 000000000..7ef3fde5b --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/fft.h @@ -0,0 +1,25 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_FFT_H_INCLUDED +#define METHCLA_PLUGINS_FFT_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_fft(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_FFT_URI METHCLA_PLUGINS_URI "/fft" + +#endif /* METHCLA_PLUGINS_FFT_H_INCLUDED */ \ No newline at end of file diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/hpf.h b/java/libraries/sound/src/cpp/include/methcla/plugins/hpf.h new file mode 100644 index 000000000..a9d0dcc43 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/hpf.h @@ -0,0 +1,25 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_HPF_H_INCLUDED +#define METHCLA_PLUGINS_HPF_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_hpf(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_HPF_URI METHCLA_PLUGINS_URI "/hpf" + +#endif /* METHCLA_PLUGINS_HPF_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/lpf.h b/java/libraries/sound/src/cpp/include/methcla/plugins/lpf.h new file mode 100644 index 000000000..8dd48df45 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/lpf.h @@ -0,0 +1,25 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_LPF_H_INCLUDED +#define METHCLA_PLUGINS_LPF_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_lpf(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_LPF_URI METHCLA_PLUGINS_URI "/lpf" + +#endif /* METHCLA_PLUGINS_LPF_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/node-control.h b/java/libraries/sound/src/cpp/include/methcla/plugins/node-control.h new file mode 100644 index 000000000..300389093 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/node-control.h @@ -0,0 +1,27 @@ +/* + Copyright 2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_NODE_CONTROL_H_INCLUDED +#define METHCLA_PLUGINS_NODE_CONTROL_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_node_control(const Methcla_Host*, const char*); + +#define METHCLA_PLUGINS_DONE_AFTER_URI METHCLA_PLUGINS_URI "/done-after" +#define METHCLA_PLUGINS_ASR_ENVELOPE_URI METHCLA_PLUGINS_URI "/asr-envelope" + +#endif // METHCLA_PLUGINS_NODE_CONTROL_H_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/osc.h b/java/libraries/sound/src/cpp/include/methcla/plugins/osc.h new file mode 100644 index 000000000..2449e082b --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/osc.h @@ -0,0 +1,25 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_OSC_H_INCLUDED +#define METHCLA_PLUGINS_OSC_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_osc(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_OSC_URI METHCLA_PLUGINS_URI "/osc" + +#endif /* METHCLA_PLUGINS_OSC_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/pan.h b/java/libraries/sound/src/cpp/include/methcla/plugins/pan.h new file mode 100644 index 000000000..5a1a7e468 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/pan.h @@ -0,0 +1,25 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_PAN_H_INCLUDED +#define METHCLA_PLUGINS_PAN_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_pan(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_PAN_URI METHCLA_PLUGINS_URI "/pan" + +#endif /* METHCLA_PLUGINS_PAN_H_INCLUDED */ \ No newline at end of file diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/pan2.h b/java/libraries/sound/src/cpp/include/methcla/plugins/pan2.h new file mode 100644 index 000000000..e1480ab7d --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/pan2.h @@ -0,0 +1,25 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_PAN2_H_INCLUDED +#define METHCLA_PLUGINS_PAN2_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_pan2(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_PAN2_URI METHCLA_PLUGINS_URI "/pan2" + +#endif /* METHCLA_PLUGINS_PAN2_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/patch-cable.h b/java/libraries/sound/src/cpp/include/methcla/plugins/patch-cable.h new file mode 100644 index 000000000..1c416bd23 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/patch-cable.h @@ -0,0 +1,25 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_PATCH_CABLE_H_INCLUDED +#define METHCLA_PLUGINS_PATCH_CABLE_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_patch_cable(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_PATCH_CABLE_URI METHCLA_PLUGINS_URI "/patch-cable" + +#endif // METHCLA_PLUGINS_PATCH_CABLE_H_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/pinknoise.h b/java/libraries/sound/src/cpp/include/methcla/plugins/pinknoise.h new file mode 100644 index 000000000..fc4a74f86 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/pinknoise.h @@ -0,0 +1,19 @@ +// +// whitenoise.h +// +// +// Created by wirsing on 13.12.13. +// +// + + +#ifndef METHCLA_PLUGINS_PINK_NOISE_H_INCLUDED +#define METHCLA_PLUGINS_PINK_NOISE_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_pink_noise(const Methcla_Host*, const char*); + +#define METHCLA_PLUGINS_PINK_NOISE_URI METHCLA_PLUGINS_URI "/pink_noise" + +#endif // METHCLA_PLUGINS_PINK_NOISE_H_INCLUDED \ No newline at end of file diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/pro/disksampler.h b/java/libraries/sound/src/cpp/include/methcla/plugins/pro/disksampler.h new file mode 100644 index 000000000..538065718 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/pro/disksampler.h @@ -0,0 +1,15 @@ +// Copyright 2012-2013 Samplecount S.L. +// All Rights Reserved. +// +// See the file LICENSE-PRO for licensing details. + +#ifndef METHCLA_PLUGINS_DISKSAMPLER_H_INCLUDED +#define METHCLA_PLUGINS_DISKSAMPLER_H_INCLUDED + +#include + +#define METHCLA_PLUGINS_DISKSAMPLER "methcla_plugins_disksampler" +METHCLA_EXPORT const Methcla_Library* methcla_plugins_disksampler(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_DISKSAMPLER_URI METHCLA_PLUGINS_URI "/disksampler" + +#endif // METHCLA_PLUGINS_DISKSAMPLER_H_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/pro/soundfile_api_extaudiofile.h b/java/libraries/sound/src/cpp/include/methcla/plugins/pro/soundfile_api_extaudiofile.h new file mode 100644 index 000000000..1f3541737 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/pro/soundfile_api_extaudiofile.h @@ -0,0 +1,14 @@ +// Copyright 2012-2013 Samplecount S.L. +// All Rights Reserved. +// +// See the file LICENSE-PRO for licensing details. + +#ifndef METHCLA_SOUNDFILEAPI_EXTAUDIOFILE_H_INCLUDED +#define METHCLA_SOUNDFILEAPI_EXTAUDIOFILE_H_INCLUDED + +#include +#include + +METHCLA_EXPORT const Methcla_Library* methcla_soundfile_api_extaudiofile(const Methcla_Host*, const char*); + +#endif // METHCLA_SOUNDFILEAPI_EXTAUDIOFILE_H_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/pulse.h b/java/libraries/sound/src/cpp/include/methcla/plugins/pulse.h new file mode 100644 index 000000000..0624df72d --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/pulse.h @@ -0,0 +1,25 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_PULSE_H_INCLUDED +#define METHCLA_PLUGINS_PULSE_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_pulse(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_PULSE_URI METHCLA_PLUGINS_URI "/pulse" + +#endif /* METHCLA_PLUGINS_PULSE_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/reverb.h b/java/libraries/sound/src/cpp/include/methcla/plugins/reverb.h new file mode 100644 index 000000000..eafed231e --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/reverb.h @@ -0,0 +1,25 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_REVERB_H_INCLUDED +#define METHCLA_PLUGINS_REVERB_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_reverb(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_REVERB_URI METHCLA_PLUGINS_URI "/reverb" + +#endif /* METHCLA_PLUGINS_REVERB_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/sampler.h b/java/libraries/sound/src/cpp/include/methcla/plugins/sampler.h new file mode 100644 index 000000000..4c2f666dd --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/sampler.h @@ -0,0 +1,25 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_SAMPLER_H_INCLUDED +#define METHCLA_PLUGINS_SAMPLER_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_sampler(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_SAMPLER_URI METHCLA_PLUGINS_URI "/sampler" + +#endif /* METHCLA_PLUGINS_SAMPLER_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/saw.h b/java/libraries/sound/src/cpp/include/methcla/plugins/saw.h new file mode 100644 index 000000000..0650798e0 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/saw.h @@ -0,0 +1,25 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_SAW_H_INCLUDED +#define METHCLA_PLUGINS_SAW_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_saw(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_SAW_URI METHCLA_PLUGINS_URI "/saw" + +#endif /* METHCLA_PLUGINS_SAW_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/sine.h b/java/libraries/sound/src/cpp/include/methcla/plugins/sine.h new file mode 100644 index 000000000..d40a4a207 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/sine.h @@ -0,0 +1,25 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_SINE_H_INCLUDED +#define METHCLA_PLUGINS_SINE_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_sine(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_SINE_URI METHCLA_PLUGINS_URI "/sine" + +#endif /* METHCLA_PLUGINS_SINE_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/soundfile_api_dummy.h b/java/libraries/sound/src/cpp/include/methcla/plugins/soundfile_api_dummy.h new file mode 100644 index 000000000..3eb39f43d --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/soundfile_api_dummy.h @@ -0,0 +1,23 @@ +// Copyright 2013 Samplecount S.L. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef METHCLA_SOUNDFILEAPI_DUMMY_H_INCLUDED +#define METHCLA_SOUNDFILEAPI_DUMMY_H_INCLUDED + +#include +#include + +METHCLA_EXPORT const Methcla_Library* methcla_soundfile_api_dummy(const Methcla_Host*, const char*); + +#endif /* METHCLA_SOUNDFILEAPI_DUMMY_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/soundfile_api_libsndfile.h b/java/libraries/sound/src/cpp/include/methcla/plugins/soundfile_api_libsndfile.h new file mode 100644 index 000000000..0f908c711 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/soundfile_api_libsndfile.h @@ -0,0 +1,23 @@ +// Copyright 2013 Samplecount S.L. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef METHCLA_SOUNDFILEAPI_LIBSNDFILE_H_INCLUDED +#define METHCLA_SOUNDFILEAPI_LIBSNDFILE_H_INCLUDED + +#include +#include + +METHCLA_EXPORT const Methcla_Library* methcla_soundfile_api_libsndfile(const Methcla_Host*, const char*); + +#endif /* METHCLA_SOUNDFILEAPI_LIBSNDFILE_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/soundfile_api_mpg123.h b/java/libraries/sound/src/cpp/include/methcla/plugins/soundfile_api_mpg123.h new file mode 100644 index 000000000..d18d143a8 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/soundfile_api_mpg123.h @@ -0,0 +1,23 @@ +// Copyright 2013-2014 Samplecount S.L. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef METHCLA_SOUNDFILEAPI_MPG123_H_INCLUDED +#define METHCLA_SOUNDFILEAPI_MPG123_H_INCLUDED + +#include +#include + +METHCLA_EXPORT const Methcla_Library* methcla_soundfile_api_mpg123(const Methcla_Host*, const char*); + +#endif /* METHCLA_SOUNDFILEAPI_MPG123_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/tri.h b/java/libraries/sound/src/cpp/include/methcla/plugins/tri.h new file mode 100644 index 000000000..0daa3b3b8 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/tri.h @@ -0,0 +1,25 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_PLUGINS_TRI_H_INCLUDED +#define METHCLA_PLUGINS_TRI_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_tri(const Methcla_Host*, const char*); +#define METHCLA_PLUGINS_TRI_URI METHCLA_PLUGINS_URI "/tri" + +#endif /* METHCLA_PLUGINS_TRI_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/methcla/plugins/whitenoise.h b/java/libraries/sound/src/cpp/include/methcla/plugins/whitenoise.h new file mode 100644 index 000000000..535f57482 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/plugins/whitenoise.h @@ -0,0 +1,19 @@ +// +// whitenoise.h +// +// +// Created by wirsing on 13.12.13. +// +// + + +#ifndef METHCLA_PLUGINS_WHITE_NOISE_H_INCLUDED +#define METHCLA_PLUGINS_WHITE_NOISE_H_INCLUDED + +#include + +METHCLA_EXPORT const Methcla_Library* methcla_plugins_white_noise(const Methcla_Host*, const char*); + +#define METHCLA_PLUGINS_WHITE_NOISE_URI METHCLA_PLUGINS_URI "/white_noise" + +#endif // METHCLA_PLUGINS_WHITE_NOISE_H_INCLUDED \ No newline at end of file diff --git a/java/libraries/sound/src/cpp/include/methcla/types.h b/java/libraries/sound/src/cpp/include/methcla/types.h new file mode 100644 index 000000000..728a3cc36 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/methcla/types.h @@ -0,0 +1,46 @@ +/* + Copyright 2012-2013 Samplecount S.L. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef METHCLA_TYPES_H_INCLUDED +#define METHCLA_TYPES_H_INCLUDED + +enum Methcla_NodePlacement +{ + kMethcla_NodePlacementHeadOfGroup, + kMethcla_NodePlacementTailOfGroup, + kMethcla_NodePlacementBeforeNode, + kMethcla_NodePlacementAfterNode +}; + +enum Methcla_BusMappingFlags +{ + kMethcla_BusMappingInternal = 0x00 + , kMethcla_BusMappingExternal = 0x01 + , kMethcla_BusMappingFeedback = 0x02 + , kMethcla_BusMappingReplace = 0x04 +}; + +enum Methcla_NodeDoneFlags +{ + kMethcla_NodeDoneDoNothing = 0x00 + , kMethcla_NodeDoneFreeSelf = 0x01 + , kMethcla_NodeDoneFreePreceeding = 0x02 + , kMethcla_NodeDoneFreeFollowing = 0x04 + , kMethcla_NodeDoneFreeAllSiblings = 0x08 + , kMethcla_NodeDoneFreeParent = 0x10 +}; + +#endif /* METHCLA_TYPES_H_INCLUDED */ diff --git a/java/libraries/sound/src/cpp/include/oscpp/client.hpp b/java/libraries/sound/src/cpp/include/oscpp/client.hpp new file mode 100644 index 000000000..04b4c3315 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/oscpp/client.hpp @@ -0,0 +1,314 @@ +// oscpp library +// +// Copyright (c) 2004-2013 Stefan Kersten +// +// Permission is hereby granted, free of charge, to any person or organization +// obtaining a copy of the software and accompanying documentation covered by +// this license (the "Software") to use, reproduce, display, distribute, +// execute, and transmit the Software, and to prepare derivative works of the +// Software, and to permit third-parties to whom the Software is furnished to +// do so, all subject to the following: +// +// The copyright notices in the Software and this entire statement, including +// the above license grant, this restriction and the following disclaimer, +// must be included in all copies of the Software, in whole or in part, and +// all derivative works of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef OSCPP_CLIENT_HPP_INCLUDED +#define OSCPP_CLIENT_HPP_INCLUDED + +#include +#include +#include + +#include +#include +#include +#include + +namespace OSCPP { +namespace Client { + +//! OSC packet construction. +/*! + * Construct a valid OSC packet for transmitting over a transport medium. + */ +class Packet +{ + int32_t calcSize(const char* begin, const char* end) + { + // TODO: Make sure pointer difference fits into int32_t + return end - begin - 4; + } + +public: + //! Constructor. + /*! + */ + Packet() + { + reset(0, 0); + } + + //! Constructor. + /*! + */ + Packet(void* buffer, size_t size) + { + reset(buffer, size); + } + + //! Destructor. + virtual ~Packet() { } + + //! Get packet buffer address. + /*! + * Return the start address of the packet currently under construction. + */ + void* data() const + { + return m_buffer; + } + + size_t capacity() const + { + return m_capacity; + } + + //! Get packet content size. + /*! + * Return the size of the packet currently under construction. + */ + size_t size() const + { + return m_args.consumed(); + } + + //! Reset packet state. + void reset(void* buffer, size_t size) + { + checkAlignment(&m_buffer, kAlignment); + m_buffer = buffer; + m_capacity = size; + m_args = WriteStream(m_buffer, m_capacity); + m_sizePosM = m_sizePosB = nullptr; + m_inBundle = 0; + } + + void reset() + { + reset(m_buffer, m_capacity); + } + + Packet& openBundle(uint64_t time) + { + if (m_inBundle > 0) { + // Remember previous size pos offset + // TODO: Make sure pointer difference fits into int32_t + const int32_t offset = m_sizePosB - m_args.begin(); + char* curPos = m_args.pos(); + m_args.skip(4); + // Record size pos + std::memcpy(curPos, &offset, 4); + m_sizePosB = curPos; + } else if (m_args.pos() != m_args.begin()) { + throw std::logic_error("Cannot open toplevel bundle in non-empty packet"); + } + + m_inBundle++; + m_args.putString("#bundle"); + m_args.putUInt64(time); + return *this; + } + + Packet& closeBundle() + { + if (m_inBundle > 0) { + if (m_inBundle > 1) { + // Get current stream pos + char* curPos = m_args.pos(); + + // Get previous bundle size stream pos + int32_t offset; + memcpy(&offset, m_sizePosB, 4); + // Get previous size pos + char* prevPos = m_args.begin() + offset; + + const int32_t bundleSize = calcSize(m_sizePosB, curPos); + assert(bundleSize >= 0 && (size_t)bundleSize >= Size::bundle(0)); + // Write bundle size + m_args.setPos(m_sizePosB); + m_args.putInt32(bundleSize); + m_args.setPos(curPos); + + // record outer bundle size pos + m_sizePosB = prevPos; + } + m_inBundle--; + } else { + throw std::logic_error("closeBundle() without matching openBundle()"); + } + return *this; + } + + Packet& openMessage(const char* addr, size_t numTags) + { + if (m_inBundle > 0) { + // record message size pos + m_sizePosM = m_args.pos(); + // advance arg stream + m_args.skip(4); + } + m_args.putString(addr); + size_t sigLen = numTags + 2; + m_tags = WriteStream(m_args, sigLen); + m_args.zero(align(sigLen)); + m_tags.putChar(','); + return *this; + } + + Packet& closeMessage() + { + if (m_inBundle > 0) { + // Get current stream pos + char* curPos = m_args.pos(); + // write message size + m_args.setPos(m_sizePosM); + m_args.putInt32(calcSize(m_sizePosM, curPos)); + // restore stream pos + m_args.setPos(curPos); + // reset tag stream + m_tags = WriteStream(); + } + return *this; + } + + //! Write integer message argument. + /*! + * Write a 32 bit integer message argument. + * + * \param arg 32 bit integer argument. + * + * \pre openMessage must have been called before with no intervening + * closeMessage. + * + * \throw OSCPP::XRunError stream buffer xrun. + */ + Packet& int32(int32_t arg) + { + m_tags.putChar('i'); + m_args.putInt32(arg); + return *this; + } + + Packet& float32(float arg) + { + m_tags.putChar('f'); + m_args.putFloat32(arg); + return *this; + } + + Packet& string(const char* arg) + { + m_tags.putChar('s'); + m_args.putString(arg); + return *this; + } + + // @throw std::invalid_argument if blob size is greater than std::numeric_limits::max() + Packet& blob(const Blob& arg) + { + if (arg.size() > (size_t)std::numeric_limits::max()) + throw std::invalid_argument("Blob size greater than maximum value representable by int32_t"); + m_tags.putChar('b'); + m_args.putInt32(arg.size()); + m_args.putData(arg.data(), arg.size()); + return *this; + } + + Packet& openArray() + { + m_tags.putChar('['); + return *this; + } + + Packet& closeArray() + { + m_tags.putChar(']'); + return *this; + } + + template Packet& put(T) + { + T::OSC_Client_Packet_put_unimplemented; + return *this; + } + + template Packet& put(InputIterator begin, InputIterator end) + { + for (auto it = begin; it != end; it++) { + put(*it); + } + return *this; + } + + template Packet& putArray(InputIterator begin, InputIterator end) + { + openArray(); + put(begin, end); + closeArray(); + return *this; + } + +private: + void* m_buffer; + size_t m_capacity; + WriteStream m_args; // packet stream + WriteStream m_tags; // current tag stream + char* m_sizePosM; // last message size position + char* m_sizePosB; // last bundle size position + size_t m_inBundle; // bundle nesting depth +}; + +template <> inline Packet& Packet::put(int32_t x) { return int32(x); } +template <> inline Packet& Packet::put(float x) { return float32(x); } +template <> inline Packet& Packet::put(const char* x) { return string(x); } +template <> inline Packet& Packet::put(Blob x) { return blob(x); } + +template class StaticPacket : public Packet +{ +public: + StaticPacket() + : Packet(reinterpret_cast(&m_buffer), buffer_size) + { } + +private: + typedef typename std::aligned_storage::type AlignedBuffer; + AlignedBuffer m_buffer; +}; + +class DynamicPacket : public Packet +{ +public: + DynamicPacket(size_t buffer_size) + : Packet(static_cast(new char[buffer_size]), buffer_size) + { } + + ~DynamicPacket() + { + delete [] static_cast(data()); + } +}; + +} +} + +#endif // OSCPP_CLIENT_HPP_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/oscpp/detail/endian.hpp b/java/libraries/sound/src/cpp/include/oscpp/detail/endian.hpp new file mode 100644 index 000000000..11bb76727 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/oscpp/detail/endian.hpp @@ -0,0 +1,85 @@ +// Copyright 2005 Caleb Epstein +// Copyright 2006 John Maddock +// Copyright 2010 Rene Rivera +// Distributed under the Boost Software License, Version 1.0. (See accompany- +// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +/* + * Copyright (c) 1997 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +/* + * Copyright notice reproduced from , from + * which this code was originally taken. + * + * Modified by Caleb Epstein to use with GNU libc and to + * defined the BOOST_ENDIAN macro. + */ + +/* + * Modifications for oscpp by Stefan Kersten + * - Change prefix from BOOST to OSCPP + * - Remove PDP endianness + * - Add OSCPP_BYTE_ORDER_* macros + */ + +#ifndef OSCPP_ENDIAN_HPP_INCLUDED +#define OSCPP_ENDIAN_HPP_INCLUDED + +#define OSCPP_BYTE_ORDER_BIG_ENDIAN 4321 +#define OSCPP_BYTE_ORDER_LITTLE_ENDIAN 1234 + +// GNU libc offers the helpful header which defines +// __BYTE_ORDER + +#if defined (__GLIBC__) || defined(__ANDROID__) +# include +# if (__BYTE_ORDER == __LITTLE_ENDIAN) +# define OSCPP_LITTLE_ENDIAN +# elif (__BYTE_ORDER == __BIG_ENDIAN) +# define OSCPP_BIG_ENDIAN +# else +# error Unknown machine endianness detected. +# endif +# define OSCPP_BYTE_ORDER __BYTE_ORDER +#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) || \ + defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) || \ + defined(_STLP_BIG_ENDIAN) && !defined(_STLP_LITTLE_ENDIAN) +# define OSCPP_BIG_ENDIAN +# define OSCPP_BYTE_ORDER OSCPP_BYTE_ORDER_BIG_ENDIAN +#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) || \ + defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) || \ + defined(_STLP_LITTLE_ENDIAN) && !defined(_STLP_BIG_ENDIAN) +# define OSCPP_LITTLE_ENDIAN +# define OSCPP_BYTE_ORDER OSCPP_BYTE_ORDER_LITTLE_ENDIAN +#elif defined(__sparc) || defined(__sparc__) \ + || defined(_POWER) || defined(__powerpc__) \ + || defined(__ppc__) || defined(__hpux) || defined(__hppa) \ + || defined(_MIPSEB) || defined(_POWER) \ + || defined(__s390__) +# define OSCPP_BIG_ENDIAN +# define OSCPP_BYTE_ORDER OSCPP_BYTE_ORDER_BIG_ENDIAN +#elif defined(__i386__) || defined(__alpha__) \ + || defined(__ia64) || defined(__ia64__) \ + || defined(_M_IX86) || defined(_M_IA64) \ + || defined(_M_ALPHA) || defined(__amd64) \ + || defined(__amd64__) || defined(_M_AMD64) \ + || defined(__x86_64) || defined(__x86_64__) \ + || defined(_M_X64) || defined(__bfin__) + +# define OSCPP_LITTLE_ENDIAN +# define OSCPP_BYTE_ORDER OSCPP_BYTE_ORDER_LITTLE_ENDIAN +#else +# error The file oscpp/endian.hpp needs to be set up for your CPU type. +#endif + +#endif // OSCPP_ENDIAN_HPP_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/oscpp/detail/host.hpp b/java/libraries/sound/src/cpp/include/oscpp/detail/host.hpp new file mode 100644 index 000000000..ec52fd0b5 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/oscpp/detail/host.hpp @@ -0,0 +1,118 @@ +// oscpp library +// +// Copyright (c) 2004-2013 Stefan Kersten +// +// Permission is hereby granted, free of charge, to any person or organization +// obtaining a copy of the software and accompanying documentation covered by +// this license (the "Software") to use, reproduce, display, distribute, +// execute, and transmit the Software, and to prepare derivative works of the +// Software, and to permit third-parties to whom the Software is furnished to +// do so, all subject to the following: +// +// The copyright notices in the Software and this entire statement, including +// the above license grant, this restriction and the following disclaimer, +// must be included in all copies of the Software, in whole or in part, and +// all derivative works of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef OSCPP_HOST_HPP_INCLUDED +#define OSCPP_HOST_HPP_INCLUDED + +#include +#include +#include + +namespace OSCPP +{ +#if defined(__GNUC__) + inline static uint32_t bswap32(uint32_t x) + { + return __builtin_bswap32(x); + } + inline static uint64_t bswap64(uint64_t x) + { + return __builtin_bswap64(x); + } +#elif defined(_WINDOWS_) +# include + inline static uint32_t bswap32(uint32_t x) + { + return _byteswap_ulong(x); + } + inline static uint64_t bswap64(uint64_t x) + { + return _byteswap_uint64(x); + } +#else + // Fallback implementation +# warning Using unoptimized byte swap functions + + inline static uint32_t bswap32(uint32_t x) + { + const uint32_t b1 = x << 24; + const uint32_t b2 = (x & 0x0000FF00) << 8; + const uint32_t b3 = (x & 0x00FF0000) >> 8; + const uint32_t b4 = x >> 24; + return b1 | b2 | b3 | b4; + } + inline static uint64_t bswap64(int64_t x) + { + const uint64_t w1 = oscpp_bswap(uint32_t(x & 0x00000000FFFFFFFF)) << 32; + const uint64_t w2 = oscpp_bswap(uint32_t(x >> 32)); + return w1 | w2; + } +#endif + + enum ByteOrder + { + NetworkByteOrder, + HostByteOrder + }; + + template inline uint32_t convert32(uint32_t) + { + throw std::logic_error("Invalid byte order"); + } + + template<> inline uint32_t convert32(uint32_t x) + { +#if defined(OSCPP_LITTLE_ENDIAN) + return bswap32(x); +#else + return x; +#endif + } + + template<> inline uint32_t convert32(uint32_t x) + { + return x; + } + + template inline uint64_t convert64(uint64_t) + { + throw std::logic_error("Invalid byte order"); + } + + template<> inline uint64_t convert64(uint64_t x) + { +#if defined(OSCPP_LITTLE_ENDIAN) + return bswap64(x); +#else + return x; +#endif + } + + template<> inline uint64_t convert64(uint64_t x) + { + return x; + } +} + +#endif // OSCPP_HOST_HPP_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/oscpp/detail/stream.hpp b/java/libraries/sound/src/cpp/include/oscpp/detail/stream.hpp new file mode 100644 index 000000000..41520290a --- /dev/null +++ b/java/libraries/sound/src/cpp/include/oscpp/detail/stream.hpp @@ -0,0 +1,346 @@ +// oscpp library +// +// Copyright (c) 2004-2013 Stefan Kersten +// +// Permission is hereby granted, free of charge, to any person or organization +// obtaining a copy of the software and accompanying documentation covered by +// this license (the "Software") to use, reproduce, display, distribute, +// execute, and transmit the Software, and to prepare derivative works of the +// Software, and to permit third-parties to whom the Software is furnished to +// do so, all subject to the following: +// +// The copyright notices in the Software and this entire statement, including +// the above license grant, this restriction and the following disclaimer, +// must be included in all copies of the Software, in whole or in part, and +// all derivative works of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef OSCPP_STREAM_HPP_INCLUDED +#define OSCPP_STREAM_HPP_INCLUDED + +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace OSCPP { + +class Stream +{ +public: + Stream() + { + m_begin = m_end = m_pos = 0; + } + + Stream(void* data, size_t size) + { + m_begin = static_cast(data); + m_end = m_begin + size; + m_pos = m_begin; + } + + Stream(const Stream& stream) + { + m_begin = m_pos = stream.m_pos; + m_end = stream.m_end; + } + + Stream(const Stream& stream, size_t size) + { + m_begin = m_pos = stream.m_pos; + m_end = m_begin + size; + if (m_end > stream.m_end) throw UnderrunError(); + } + + void reset() + { + m_pos = m_begin; + } + + const char* begin() const + { + return m_begin; + } + + char* begin() + { + return m_begin; + } + + const char* end() const + { + return m_end; + } + + size_t capacity() const + { + return end() - begin(); + } + + const char* pos() const + { + return m_pos; + } + + char* pos() + { + return m_pos; + } + + void setPos(char* pos) + { + assert((pos >= m_begin) && (pos <= m_end)); + m_pos = pos; + } + + void advance(size_t n) + { + m_pos += n; + } + + bool atEnd() const + { + return pos() == end(); + } + + size_t consumed() const + { + return pos() - begin(); + } + + size_t consumable() const + { + return end() - pos(); + } + + inline void checkAlignment(size_t n) const + { + OSCPP::checkAlignment(pos(), n); + } + +protected: + char* m_begin; + char* m_end; + char* m_pos; +}; + +class WriteStream: public Stream +{ +public: + WriteStream() + : Stream() + { } + + WriteStream(void* data, size_t size) + : Stream(data, size) + { } + + WriteStream(const WriteStream& stream) + : Stream(stream) + { } + + WriteStream(const WriteStream& stream, size_t size) + : Stream(stream, size) + { } + + // throw (OverflowError) + inline void checkWritable(size_t n) const + { + if (consumable() < n) + throw OverflowError(n - consumable()); + } + + void skip(size_t n) + { + checkWritable(n); + advance(n); + } + + void zero(size_t n) + { + checkWritable(n); + std::memset(m_pos, 0, n); + advance(n); + } + + void putChar(char c) + { + checkWritable(1); + *pos() = c; + advance(1); + } + + void putInt32(int32_t x) + { + checkWritable(4); + checkAlignment(4); + uint32_t uh; + memcpy(&uh, &x, 4); + const uint32_t un = convert32(uh); + std::memcpy(pos(), &un, 4); + advance(4); + } + + void putUInt64(uint64_t x) + { + checkWritable(8); + const uint64_t un = convert64(x); + std::memcpy(pos(), &un, 8); + advance(8); + } + + void putFloat32(float f) + { + checkWritable(4); + checkAlignment(4); + uint32_t uh; + std::memcpy(&uh, &f, 4); + const uint32_t un = convert32(uh); + std::memcpy(pos(), &un, 4); + advance(4); + } + + void putData(const void* data, size_t size) + { + const size_t padding = OSCPP::padding(size); + const size_t n = size + padding; + checkWritable(n); + std::memcpy(pos(), data, size); + std::memset(pos()+size, 0, padding); + advance(n); + } + + void putString(const char* s) + { + putData(s, strlen(s)+1); + } +}; + + +class ReadStream : public Stream +{ +public: + ReadStream() + { } + + ReadStream(const void* data, size_t size) + : Stream(const_cast(data), size) + { } + + ReadStream(const ReadStream& stream) + : Stream(stream) + { } + + ReadStream(const ReadStream& stream, size_t size) + : Stream(stream, size) + { } + + // throw (UnderrunError) + void checkReadable(size_t n) const + { + if (consumable() < n) throw UnderrunError(); + } + + // throw (UnderrunError) + void skip(size_t n) + { + checkReadable(n); + advance(n); + } + + // throw (UnderrunError) + inline char peekChar() const + { + checkReadable(1); + return *pos(); + } + + // throw (UnderrunError) + inline char getChar() + { + const char x = peekChar(); + advance(1); + return x; + } + + // throw (UnderrunError) + inline int32_t peekInt32() const + { + checkReadable(4); + checkAlignment(4); + uint32_t un; + std::memcpy(&un, pos(), 4); + const uint32_t uh = convert32(un); + int32_t x; + std::memcpy(&x, &uh, 4); + return x; + } + + // throw (UnderrunError) + inline int32_t getInt32() + { + const int32_t x = peekInt32(); + advance(4); + return x; + } + + // throw (UnderrunError) + inline uint64_t getUInt64() + { + checkReadable(8); + uint64_t un; + std::memcpy(&un, pos(), 8); + advance(8); + return convert64(un); + } + + // throw (UnderrunError) + inline float getFloat32() + { + checkReadable(4); + checkAlignment(4); + uint32_t un; + std::memcpy(&un, pos(), 4); + advance(4); + const uint32_t uh = convert32(un); + float f; + std::memcpy(&f, &uh, 4); + return f; + } + + // throw (UnderrunError, ParseError) + const char* getString() + { + checkReadable(4); // min string length + + const char* ptr = static_cast(pos()) + 3; + const char* end = static_cast(this->end()); + + while (true) { + if (ptr >= end) throw UnderrunError(); + if (*ptr == '\0') break; + ptr += 4; + } + + const char* x = pos(); + advance(ptr - pos() + 1); + + return x; + } +}; +} + +#endif // OSCPP_STREAM_HPP_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/oscpp/error.hpp b/java/libraries/sound/src/cpp/include/oscpp/error.hpp new file mode 100644 index 000000000..bea43e74b --- /dev/null +++ b/java/libraries/sound/src/cpp/include/oscpp/error.hpp @@ -0,0 +1,84 @@ +// oscpp library +// +// Copyright (c) 2004-2013 Stefan Kersten +// +// Permission is hereby granted, free of charge, to any person or organization +// obtaining a copy of the software and accompanying documentation covered by +// this license (the "Software") to use, reproduce, display, distribute, +// execute, and transmit the Software, and to prepare derivative works of the +// Software, and to permit third-parties to whom the Software is furnished to +// do so, all subject to the following: +// +// The copyright notices in the Software and this entire statement, including +// the above license grant, this restriction and the following disclaimer, +// must be included in all copies of the Software, in whole or in part, and +// all derivative works of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef OSCPP_ERROR_HPP_INCLUDED +#define OSCPP_ERROR_HPP_INCLUDED + +#include +#include + +namespace OSCPP { + +class Error : public std::exception +{ +public: + Error(const std::string& what) + : m_what(what) + { } + + virtual ~Error() noexcept + { } + + const char* what() const noexcept override + { + return m_what.c_str(); + } + +private: + std::string m_what; +}; + +class UnderrunError : public Error +{ +public: + UnderrunError() + : Error(std::string("Buffer underrun")) + { } +}; + +class OverflowError : public Error +{ +public: + OverflowError(size_t bytes) + : Error(std::string("Buffer overflow")), + m_bytes(bytes) + { } + + size_t numBytes() const { return m_bytes; } + +private: + size_t m_bytes; +}; + +class ParseError : public Error +{ +public: + ParseError(const std::string& what="Parse error") + : Error(what) + { } +}; + +} + +#endif // OSCPP_ERROR_HPP_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/oscpp/print.hpp b/java/libraries/sound/src/cpp/include/oscpp/print.hpp new file mode 100644 index 000000000..448e20b61 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/oscpp/print.hpp @@ -0,0 +1,166 @@ +// OSCpp library +// +// Copyright (c) 2004-2011 Stefan Kersten +// +// Permission is hereby granted, free of charge, to any person or organization +// obtaining a copy of the software and accompanying documentation covered by +// this license (the "Software") to use, reproduce, display, distribute, +// execute, and transmit the Software, and to prepare derivative works of the +// Software, and to permit third-parties to whom the Software is furnished to +// do so, all subject to the following: +// +// The copyright notices in the Software and this entire statement, including +// the above license grant, this restriction and the following disclaimer, +// must be included in all copies of the Software, in whole or in part, and +// all derivative works of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef OSCPP_PRINT_HPP_INCLUDED +#define OSCPP_PRINT_HPP_INCLUDED + +#include +#include +#include + +namespace OSCPP { +namespace detail { + +const size_t kDefaultIndentWidth = 4; + +class Indent +{ +public: + Indent(size_t w) + : m_width(w) + , m_indent(0) + { } + Indent(size_t w, size_t n) + : m_width(w) + , m_indent(n) + { } + Indent(const Indent&) = default; + + operator size_t () const { return m_indent; } + Indent inc() const { return Indent(m_width, m_indent+m_width); } + +private: + size_t m_width; + size_t m_indent; +}; + +inline std::ostream& operator<<(std::ostream& out, const Indent& indent) +{ + size_t n = indent; + while (n-- > 0) out << ' '; + return out; +} + +inline void printArgs(std::ostream& out, Server::ArgStream args) +{ + while (!args.atEnd()) { + const char t = args.tag(); + switch (t) { + case 'i': + out << "i:" << args.int32(); + break; + case 'f': + out << "f:" << args.float32(); + break; + case 's': + out << "s:" << args.string(); + break; + case 'b': + out << "b:" << args.blob().size(); + break; + case '[': + out << "[ "; + printArgs(out, args.array()); + out << " ]"; + break; + default: + out << t << ":?"; + args.drop(); + break; + } + out << ' '; + } +} + +inline void printMessage(std::ostream& out, const Server::Message& msg, const Indent& indent) +{ + out << indent << msg.address() << ' '; + printArgs(out, msg.args()); +} + +inline void printBundle(std::ostream& out, const Server::Bundle& bundle, const Indent& indent) +{ + out << indent << "# " << bundle.time() << " [" << std::endl; + Indent nextIndent = indent.inc(); + auto packets = bundle.packets(); + while (!packets.atEnd()) { + auto packet = packets.next(); + if (packet.isMessage()) { + printMessage(out, packet, nextIndent); + } else { + printBundle(out, packet, nextIndent); + } + out << std::endl; + } + out << indent << "]"; +} + +inline void printPacket(std::ostream& out, const Server::Packet& packet, const Indent& indent) +{ + if (packet.isMessage()) { + printMessage(out, packet, indent); + } else { + printBundle(out, packet, indent); + } +} + +} +} + +namespace OSCPP { +namespace Server { + +inline std::ostream& operator<<(std::ostream& out, const Packet& packet) +{ + detail::printPacket(out, packet, detail::Indent(detail::kDefaultIndentWidth)); + return out; +} + +inline std::ostream& operator<<(std::ostream& out, const Bundle& packet) +{ + detail::printBundle(out, packet, detail::Indent(detail::kDefaultIndentWidth)); + return out; +} + +inline std::ostream& operator<<(std::ostream& out, const Message& packet) +{ + detail::printMessage(out, packet, detail::Indent(detail::kDefaultIndentWidth)); + return out; +} + +} +} + +namespace OSCPP { +namespace Client { + +inline std::ostream& operator<<(std::ostream& out, const Packet& packet) +{ + return out << Server::Packet(packet.data(), packet.size()); +} + +} +} + +#endif // OSCPP_PRINT_HPP_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/oscpp/server.hpp b/java/libraries/sound/src/cpp/include/oscpp/server.hpp new file mode 100644 index 000000000..a08f0ea0f --- /dev/null +++ b/java/libraries/sound/src/cpp/include/oscpp/server.hpp @@ -0,0 +1,450 @@ +// oscpp library +// +// Copyright (c) 2004-2013 Stefan Kersten +// +// Permission is hereby granted, free of charge, to any person or organization +// obtaining a copy of the software and accompanying documentation covered by +// this license (the "Software") to use, reproduce, display, distribute, +// execute, and transmit the Software, and to prepare derivative works of the +// Software, and to permit third-parties to whom the Software is furnished to +// do so, all subject to the following: +// +// The copyright notices in the Software and this entire statement, including +// the above license grant, this restriction and the following disclaimer, +// must be included in all copies of the Software, in whole or in part, and +// all derivative works of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef OSCPP_SERVER_HPP_INCLUDED +#define OSCPP_SERVER_HPP_INCLUDED + +#include +#include + +#include +#include +#include + +namespace OSCPP { +namespace Server { + +//! OSC Message Argument Iterator. +/*! + * Retrieve typed arguments from an incoming message. + * + * Supported tags and their correspondong types are: + * + * i -- 32 bit signed integer number
+ * f -- 32 bit floating point number
+ * s -- NULL-terminated string padded to 4-byte boundary
+ * b -- 32-bit integer size followed by 4-byte aligned data + * + * \sa getArgInt32 + * \sa getArgFloat32 + * \sa getArgString + */ +class ArgStream +{ +public: + //* Empty argument stream. + ArgStream() = default; + + //* Construct argument stream from tag and value streams. + ArgStream(const ReadStream& tags, const ReadStream& args) + : m_tags(tags) + , m_args(args) + { } + + //! Constructor. + /*! + * Read arguments from stream, which has to point to the start of a + * message type signature. + * + * \throw OSCPP::UnderrunError stream buffer underrun. + * \throw OSCPP::ParseError error while parsing input stream. + */ + ArgStream(const ReadStream& stream) + { + m_args = stream; + const char* tags = m_args.getString(); + if (tags[0] != ',') throw ParseError("Tag string doesn't start with ','"); + m_tags = ReadStream(tags+1, strlen(tags)-1); + } + + //* Return the number of arguments that can be read from the stream. + size_t size() const + { + return m_tags.capacity(); + } + + //* Return true if no more arguments can be read from the stream. + bool atEnd() const + { + return m_tags.atEnd(); + } + + //* Return tag and argument streams. + std::tuple state() const + { + return std::make_tuple(m_tags, m_args); + } + + //* Return the type tag corresponding to the next message argument. + char tag() const + { + return m_tags.peekChar(); + } + + //* Drop next argument. + void drop() + { + drop(m_tags.getChar()); + } + + //! Get next integer argument. + /*! + * Read next numerical argument from the input stream and convert it to + * an integer. + * + * \exception OSCPP::UnderrunError stream buffer underrun. + * \exception OSCPP::ParseError argument could not be converted. + */ + int32_t int32() + { + const char t = m_tags.getChar(); + if (t == 'i') return m_args.getInt32(); + if (t == 'f') return (int32_t)m_args.getFloat32(); + throw ParseError("Cannot convert argument to int"); + } + + //! Get next float argument. + /*! + * Read next numerical argument from the input stream and convert it to + * a float. + * + * \exception OSCPP::UnderrunError stream buffer underrun. + * \exception OSCPP::ParseError argument could not be converted. + */ + float float32() + { + const char t = m_tags.getChar(); + if (t == 'f') return m_args.getFloat32(); + if (t == 'i') return (float)m_args.getInt32(); + throw ParseError("Cannot convert argument to float"); + } + + //! Get next string argument. + /*! + * Read next string argument and return it as a NULL-terminated string. + * + * \exception OSCPP::UnderrunError stream buffer underrun. + * \exception OSCPP::ParseError argument could not be converted or is not + * a valid string. + */ + const char* string() + { + if (m_tags.getChar() == 's') { + return m_args.getString(); + } + throw ParseError("Cannot convert argument to string"); + } + + //* Get next blob argument. + // + // @throw OSCPP::UnderrunError stream buffer underrun. + // @throw OSCPP::ParseError argument is not a valid blob + Blob blob() + { + if (m_tags.getChar() == 'b') { + return parseBlob(); + } else { + throw ParseError("Cannot convert argument to blob"); + } + } + + //* Return a stream corresponding to an array argument. + ArgStream array() + { + if (m_tags.getChar() == '[') { + const char* tags = m_tags.pos(); + const char* args = m_args.pos(); + dropArray(); + // m_tags.pos() points right after the closing ']'. + return ArgStream(ReadStream(tags, m_tags.pos() - tags - 1), + ReadStream(args, m_args.pos() - args)); + } else { + throw ParseError("Expected array"); + } + } + + template T next() + { + return T::OSC_Server_ArgStream_next_unimplemented; + } + +private: + // Parse a blob (type tag already consumed). + Blob parseBlob() + { + int32_t size = m_args.getInt32(); + if (size < 0) { + throw ParseError("Invalid blob size is less than zero"); + } else { + static_assert(sizeof(size_t) >= sizeof(int32_t), + "Size of size_t must be greater than size of int32_t"); + const void* data = m_args.pos(); + m_args.skip(align(size)); + return Blob(data, static_cast(size)); + } + } + // Drop an atomic value of type t (type tag already consumed). + void dropAtom(char t) + { + switch (t) { + case 'i': m_args.skip(4); break; + case 'f': m_args.skip(4); break; + case 's': m_args.getString(); break; + case 'b': parseBlob(); break; + } + } + // Drop a possibly nested array. + void dropArray() + { + unsigned int level = 0; + for (;;) { + char t = m_tags.getChar(); + if (t == ']') { + if (level == 0) break; + else level--; + } else if (t == '[') { + level++; + } else { + dropAtom(t); + } + } + } + // Drop the next argument of type t (type tag already consumed). + void drop(char t) + { + switch (t) { + case '[': dropArray(); break; + default: dropAtom(t); + } + } + +private: + ReadStream m_tags; + ReadStream m_args; +}; + +class Message +{ +public: + Message(const char* address, const ReadStream& stream) + : m_address(address) + , m_args(ArgStream(stream)) + { } + + const char* address() const + { + return m_address; + } + + ArgStream args() const + { + return m_args; + } + +private: + const char* m_address; + ArgStream m_args; +}; + +class PacketStream; + +class Bundle +{ +public: + Bundle(uint64_t time, const ReadStream& stream) + : m_time(time) + , m_stream(stream) + { } + + uint64_t time() const + { + return m_time; + } + + inline PacketStream packets() const; + +private: + uint64_t m_time; + ReadStream m_stream; +}; + +class Packet +{ +public: + Packet() + : m_isBundle(false) + { } + + Packet(const ReadStream& stream) + : m_stream(stream) + , m_isBundle(isBundle(stream)) + { + // Skip over #bundle header + if (m_isBundle) m_stream.skip(8); + } + + Packet(const void* data, size_t size) + : Packet(ReadStream(data, size)) + { } + + const void* data() const + { + return m_stream.begin(); + } + + size_t size() const + { + return m_stream.capacity(); + } + + bool isBundle() const + { + return m_isBundle; + } + + bool isMessage() const + { + return !isBundle(); + } + + operator Bundle () const + { + if (!isBundle()) throw ParseError("Packet is not a bundle"); + ReadStream stream(m_stream); + uint64_t time = stream.getUInt64(); + return Bundle(time, std::move(stream)); + } + + operator Message () const + { + if (!isMessage()) throw ParseError("Packet is not a message"); + ReadStream stream(m_stream); + const char* address = stream.getString(); + return Message(address, std::move(stream)); + } + + static bool isMessage(const void* data, size_t size) + { + return (size > 3) && (static_cast(data)[0] != '#'); + } + + static bool isMessage(const ReadStream& stream) + { + return isMessage(stream.pos(), stream.consumable()); + } + + static bool isBundle(const void* data, size_t size) + { + return (size > 15) && (std::memcmp(data, "#bundle", 8) == 0); + } + + static bool isBundle(const ReadStream& stream) + { + return isBundle(stream.pos(), stream.consumable()); + } + +private: + ReadStream m_stream; + bool m_isBundle; +}; + + +class PacketStream +{ +public: + PacketStream(const ReadStream& stream) + : m_stream(stream) + { } + + bool atEnd() const + { + return m_stream.atEnd(); + } + + Packet next() + { + size_t size = m_stream.getInt32(); + ReadStream stream(m_stream, size); + m_stream.skip(size); + return Packet(stream); + } + +private: + ReadStream m_stream; +}; + +template <> inline int32_t ArgStream::next() +{ + return int32(); +} + +template <> inline float ArgStream::next() +{ + return float32(); +} + +template <> inline const char* ArgStream::next() +{ + return string(); +} + +template <> inline Blob ArgStream::next() +{ + return blob(); +} + +template <> inline ArgStream ArgStream::next() +{ + return array(); +} + +PacketStream Bundle::packets() const +{ + return PacketStream(m_stream); +} + +} +} + +static inline bool operator==(const OSCPP::Server::Message& msg, const char* str) +{ + return strcmp(msg.address(), str) == 0; +} + +static inline bool operator==(const char* str, const OSCPP::Server::Message& msg) +{ + return msg == str; +} + +static inline bool operator!=(const OSCPP::Server::Message& msg, const char* str) +{ + return !(msg == str); +} + +static inline bool operator!=(const char* str, const OSCPP::Server::Message& msg) +{ + return msg != str; +} + +#endif // OSCPP_SERVER_HPP_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/oscpp/types.hpp b/java/libraries/sound/src/cpp/include/oscpp/types.hpp new file mode 100644 index 000000000..636a7cddd --- /dev/null +++ b/java/libraries/sound/src/cpp/include/oscpp/types.hpp @@ -0,0 +1,51 @@ +// oscpp library +// +// Copyright (c) 2004-2013 Stefan Kersten +// +// Permission is hereby granted, free of charge, to any person or organization +// obtaining a copy of the software and accompanying documentation covered by +// this license (the "Software") to use, reproduce, display, distribute, +// execute, and transmit the Software, and to prepare derivative works of the +// Software, and to permit third-parties to whom the Software is furnished to +// do so, all subject to the following: +// +// The copyright notices in the Software and this entire statement, including +// the above license grant, this restriction and the following disclaimer, +// must be included in all copies of the Software, in whole or in part, and +// all derivative works of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef OSCPP_TYPES_HPP_INCLUDED +#define OSCPP_TYPES_HPP_INCLUDED + +namespace OSCPP { + +class Blob +{ +public: + Blob() + : m_size(0), m_data(nullptr) + { } + Blob(const void* data, size_t size) + : m_size(size), m_data(data) + { } + Blob(const Blob& other) = default; + + size_t size() const { return m_size; } + const void* data() const { return m_data; } + +private: + size_t m_size; + const void* m_data; +}; + +} + +#endif // OSCPP_TYPES_HPP_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/oscpp/util.hpp b/java/libraries/sound/src/cpp/include/oscpp/util.hpp new file mode 100644 index 000000000..40fd52e7a --- /dev/null +++ b/java/libraries/sound/src/cpp/include/oscpp/util.hpp @@ -0,0 +1,151 @@ +// oscpp library +// +// Copyright (c) 2004-2013 Stefan Kersten +// +// Permission is hereby granted, free of charge, to any person or organization +// obtaining a copy of the software and accompanying documentation covered by +// this license (the "Software") to use, reproduce, display, distribute, +// execute, and transmit the Software, and to prepare derivative works of the +// Software, and to permit third-parties to whom the Software is furnished to +// do so, all subject to the following: +// +// The copyright notices in the Software and this entire statement, including +// the above license grant, this restriction and the following disclaimer, +// must be included in all copies of the Software, in whole or in part, and +// all derivative works of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef OSCPP_UTIL_HPP_INCLUDED +#define OSCPP_UTIL_HPP_INCLUDED + +#include +#include + +namespace OSCPP { + +static const size_t kAlignment = 4; + +inline bool isAligned(const void* ptr, size_t alignment) +{ + return (reinterpret_cast(ptr) & (alignment-1)) == 0; +} + +constexpr bool isAligned(size_t n) +{ + return (n & 3) == 0; +} + +constexpr size_t align(size_t n) +{ + return (n + 3) & -4; +} + +constexpr size_t padding(size_t n) +{ + return align(n) - n; +} + +inline void checkAlignment(const void* ptr, size_t n) +{ + if (!isAligned(ptr, n)) { + throw std::runtime_error("Unaligned pointer"); + } +} + +namespace Tags { + + constexpr size_t int32() + { + return 1; + } + constexpr size_t float32() + { + return 1; + } + constexpr size_t string() + { + return 1; + } + constexpr size_t blob() + { + return 1; + } + constexpr size_t array(size_t numElems) + { + return numElems+2; + } +} + +namespace Size { + + class String + { + public: + String(const char* x) + : m_value(x) + {} + + operator const char* () const + { + return m_value; + } + + private: + const char* m_value; + }; + + inline size_t string(const String& x) + { + return align(std::strlen(x)+1); + } + + template constexpr size_t string(char const (&)[N]) + { + return align(N); + } + + constexpr size_t bundle(size_t numPackets) + { + return 8 /* #bundle */ + 8 /* timestamp */ + 4 * numPackets /* size prefix */; + } + + inline size_t message(const String& address, size_t numArgs) + { + return string(address) + align(numArgs + 2); + } + + template constexpr size_t message(char const (&address)[N], size_t numArgs) + { + return string(address) + align(numArgs + 2); + } + + constexpr size_t int32(size_t n=1) + { + return n*4; + } + + constexpr size_t float32(size_t n=1) + { + return n*4; + } + + constexpr size_t string(size_t n) + { + return align(n + 1); + } + + constexpr size_t blob(size_t size) + { + return 4 + align(size); + } +} +} + +#endif // OSCPP_UTIL_HPP_INCLUDED diff --git a/java/libraries/sound/src/cpp/include/processing_sound_MethClaInterface.h b/java/libraries/sound/src/cpp/include/processing_sound_MethClaInterface.h new file mode 100644 index 000000000..de571b3a0 --- /dev/null +++ b/java/libraries/sound/src/cpp/include/processing_sound_MethClaInterface.h @@ -0,0 +1,365 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class processing_sound_MethClaInterface */ + +#ifndef _Included_processing_sound_MethClaInterface +#define _Included_processing_sound_MethClaInterface +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: processing_sound_MethClaInterface + * Method: engineNew + * Signature: (II)I + */ +JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_engineNew + (JNIEnv *, jobject, jint, jint); + +/* + * Class: processing_sound_MethClaInterface + * Method: engineStart + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_engineStart + (JNIEnv *, jobject); + +/* + * Class: processing_sound_MethClaInterface + * Method: engineStop + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_engineStop + (JNIEnv *, jobject); + +/* + * Class: processing_sound_MethClaInterface + * Method: synthStop + * Signature: ([I)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_synthStop + (JNIEnv *, jobject, jintArray); + +/* + * Class: processing_sound_MethClaInterface + * Method: oscSet + * Signature: (FFFF[I)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_oscSet + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat, jintArray); + +/* + * Class: processing_sound_MethClaInterface + * Method: oscAudioSet + * Signature: ([I[I[I[I[I)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_oscAudioSet + (JNIEnv *, jobject, jintArray, jintArray, jintArray, jintArray, jintArray); + +/* + * Class: processing_sound_MethClaInterface + * Method: sinePlay + * Signature: (FFFF)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_sinePlay + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat); + +/* + * Class: processing_sound_MethClaInterface + * Method: sawPlay + * Signature: (FFFF)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_sawPlay + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat); + +/* + * Class: processing_sound_MethClaInterface + * Method: sqrPlay + * Signature: (FFFF)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_sqrPlay + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat); + +/* + * Class: processing_sound_MethClaInterface + * Method: sqrSet + * Signature: (FFFF[I)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_sqrSet + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat, jintArray); + +/* + * Class: processing_sound_MethClaInterface + * Method: triPlay + * Signature: (FFFF)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_triPlay + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat); + +/* + * Class: processing_sound_MethClaInterface + * Method: pulsePlay + * Signature: (FFFFF)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_pulsePlay + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat, jfloat); + +/* + * Class: processing_sound_MethClaInterface + * Method: pulseSet + * Signature: (FFFFF[I)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_pulseSet + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat, jfloat, jintArray); + +/* + * Class: processing_sound_MethClaInterface + * Method: audioInPlay + * Signature: (FFFI)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_audioInPlay + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jint); + +/* + * Class: processing_sound_MethClaInterface + * Method: audioInSet + * Signature: (FFF[I)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_audioInSet + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jintArray); + +/* + * Class: processing_sound_MethClaInterface + * Method: soundFileInfo + * Signature: (Ljava/lang/String;)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_soundFileInfo + (JNIEnv *, jobject, jstring); + +/* + * Class: processing_sound_MethClaInterface + * Method: soundFilePlayMono + * Signature: (FFFFZLjava/lang/String;FI)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_soundFilePlayMono + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat, jboolean, jstring, jfloat, jint); + +/* + * Class: processing_sound_MethClaInterface + * Method: soundFilePlayMulti + * Signature: (FFFZLjava/lang/String;FI)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_soundFilePlayMulti + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jboolean, jstring, jfloat, jint); + +/* + * Class: processing_sound_MethClaInterface + * Method: soundFileSetMono + * Signature: (FFFF[I)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_soundFileSetMono + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat, jintArray); + +/* + * Class: processing_sound_MethClaInterface + * Method: soundFileSetStereo + * Signature: (FFF[I)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_soundFileSetStereo + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jintArray); + +/* + * Class: processing_sound_MethClaInterface + * Method: whiteNoisePlay + * Signature: (FFF)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_whiteNoisePlay + (JNIEnv *, jobject, jfloat, jfloat, jfloat); + +/* + * Class: processing_sound_MethClaInterface + * Method: whiteNoiseSet + * Signature: (FFF[I)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_whiteNoiseSet + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jintArray); + +/* + * Class: processing_sound_MethClaInterface + * Method: pinkNoisePlay + * Signature: (FFF)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_pinkNoisePlay + (JNIEnv *, jobject, jfloat, jfloat, jfloat); + +/* + * Class: processing_sound_MethClaInterface + * Method: pinkNoiseSet + * Signature: (FFF[I)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_pinkNoiseSet + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jintArray); + +/* + * Class: processing_sound_MethClaInterface + * Method: brownNoisePlay + * Signature: (FFF)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_brownNoisePlay + (JNIEnv *, jobject, jfloat, jfloat, jfloat); + +/* + * Class: processing_sound_MethClaInterface + * Method: brownNoiseSet + * Signature: (FFF[I)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_brownNoiseSet + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jintArray); + +/* + * Class: processing_sound_MethClaInterface + * Method: envelopePlay + * Signature: ([IFFFF)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_envelopePlay + (JNIEnv *, jobject, jintArray, jfloat, jfloat, jfloat, jfloat); + +/* + * Class: processing_sound_MethClaInterface + * Method: doneAfter + * Signature: (F)I + */ +JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_doneAfter + (JNIEnv *, jobject, jfloat); + +/* + * Class: processing_sound_MethClaInterface + * Method: highPassPlay + * Signature: ([IF)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_highPassPlay + (JNIEnv *, jobject, jintArray, jfloat); + +/* + * Class: processing_sound_MethClaInterface + * Method: lowPassPlay + * Signature: ([IF)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_lowPassPlay + (JNIEnv *, jobject, jintArray, jfloat); + +/* + * Class: processing_sound_MethClaInterface + * Method: bandPassPlay + * Signature: ([IFF)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_bandPassPlay + (JNIEnv *, jobject, jintArray, jfloat, jfloat); + +/* + * Class: processing_sound_MethClaInterface + * Method: filterSet + * Signature: (FI)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_filterSet + (JNIEnv *, jobject, jfloat, jint); + +/* + * Class: processing_sound_MethClaInterface + * Method: filterBwSet + * Signature: (FFI)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_filterBwSet + (JNIEnv *, jobject, jfloat, jfloat, jint); + +/* + * Class: processing_sound_MethClaInterface + * Method: delayPlay + * Signature: ([IFFF)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_delayPlay + (JNIEnv *, jobject, jintArray, jfloat, jfloat, jfloat); + +/* + * Class: processing_sound_MethClaInterface + * Method: delaySet + * Signature: (FFI)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_delaySet + (JNIEnv *, jobject, jfloat, jfloat, jint); + +/* + * Class: processing_sound_MethClaInterface + * Method: reverbPlay + * Signature: ([IFFF)[I + */ +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_reverbPlay + (JNIEnv *, jobject, jintArray, jfloat, jfloat, jfloat); + +/* + * Class: processing_sound_MethClaInterface + * Method: reverbSet + * Signature: (FFFI)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_reverbSet + (JNIEnv *, jobject, jfloat, jfloat, jfloat, jint); + +/* + * Class: processing_sound_MethClaInterface + * Method: out + * Signature: (I[I)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_out + (JNIEnv *, jobject, jint, jintArray); + +/* + * Class: processing_sound_MethClaInterface + * Method: amplitude + * Signature: ([I)J + */ +JNIEXPORT jlong JNICALL Java_processing_sound_MethClaInterface_amplitude + (JNIEnv *, jobject, jintArray); + +/* + * Class: processing_sound_MethClaInterface + * Method: poll_amplitude + * Signature: (J)F + */ +JNIEXPORT jfloat JNICALL Java_processing_sound_MethClaInterface_poll_1amplitude + (JNIEnv *, jobject, jlong); + +/* + * Class: processing_sound_MethClaInterface + * Method: destroy_amplitude + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_destroy_1amplitude + (JNIEnv *, jobject, jlong); + +/* + * Class: processing_sound_MethClaInterface + * Method: fft + * Signature: ([II)J + */ +JNIEXPORT jlong JNICALL Java_processing_sound_MethClaInterface_fft + (JNIEnv *, jobject, jintArray, jint); + +/* + * Class: processing_sound_MethClaInterface + * Method: poll_fft + * Signature: (J)[F + */ +JNIEXPORT jfloatArray JNICALL Java_processing_sound_MethClaInterface_poll_1fft + (JNIEnv *, jobject, jlong); + +/* + * Class: processing_sound_MethClaInterface + * Method: destroy_fft + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_destroy_1fft + (JNIEnv *, jobject, jlong); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/java/libraries/sound/src/cpp/processing_sound_MethClaInterface.cpp b/java/libraries/sound/src/cpp/processing_sound_MethClaInterface.cpp new file mode 100644 index 000000000..796bb8593 --- /dev/null +++ b/java/libraries/sound/src/cpp/processing_sound_MethClaInterface.cpp @@ -0,0 +1,1330 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "processing_sound_MethClaInterface.h" +#include "methcla/file.hpp" +#include "methcla/engine.hpp" +#include "methcla/plugins/sine.h" +#include "methcla/plugins/saw.h" +#include "methcla/plugins/tri.h" +#include "methcla/plugins/pulse.h" +#include "methcla/plugins/patch-cable.h" +#include "methcla/plugins/soundfile_api_libsndfile.h" +#include "methcla/plugins/sampler.h" +#include "methcla/plugins/whitenoise.h" +#include "methcla/plugins/pinknoise.h" +#include "methcla/plugins/brownnoise.h" +#include "methcla/plugins/node-control.h" +#include "methcla/plugins/pan2.h" +#include "methcla/plugins/soundfile_api_mpg123.h" +#include "methcla/plugins/ampfol.h" +#include "methcla/plugins/fft.h" +#include "methcla/plugins/hpf.h" +#include "methcla/plugins/lpf.h" +#include "methcla/plugins/bpf.h" +#include "methcla/plugins/delay.h" +#include "methcla/plugins/reverb.h" +#include "methcla/plugins/audio_in.h" + +#define OUTPUT_BUFFER_SIZE 1024 +#define SNDF_BUFFER_LEN 1024 + +#define MAX_CHANNELS 4 + +Methcla::Engine* m_engine; +Methcla::Engine& engine() { return *m_engine; } +std::mutex mutex_fft_in; +std::mutex mutex_fft_out; +std::mutex mutex_amp_in; +std::mutex mutex_amp_out; + + +static Methcla_Time kLatency = 0.1; + +struct ServerValue{ + ServerValue() : + amp(0), + id(-1) + {} + float amp; + int id; +}; + +struct ServerArray{ + ServerArray() : + fftSize(512), + fft(fftSize), + id(-1) + {} + int fftSize; + std::vector fft; + int id; +}; + +// Engine + +JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_engineNew (JNIEnv *, jobject, jint sampleRate, jint bufferSize){ + + Methcla::EngineOptions options; + options.audioDriver.bufferSize = bufferSize; + options.audioDriver.numInputs = 2; + options.realtimeMemorySize = 1024 * 1024 * 20; + options.maxNumNodes = 1024 * 20; + options.addLibrary(methcla_plugins_sine) + .addLibrary(methcla_plugins_saw) + .addLibrary(methcla_plugins_tri) + .addLibrary(methcla_plugins_pulse) + .addLibrary(methcla_soundfile_api_libsndfile) + .addLibrary(methcla_plugins_patch_cable) + .addLibrary(methcla_plugins_sampler) + .addLibrary(methcla_plugins_white_noise) + .addLibrary(methcla_plugins_pink_noise) + .addLibrary(methcla_plugins_brown_noise) + .addLibrary(methcla_plugins_node_control) + .addLibrary(methcla_plugins_pan2) + .addLibrary(methcla_plugins_amplitude_follower) + .addLibrary(methcla_plugins_hpf) + .addLibrary(methcla_plugins_lpf) + .addLibrary(methcla_plugins_bpf) + .addLibrary(methcla_plugins_delay) + .addLibrary(methcla_plugins_reverb) + .addLibrary(methcla_plugins_fft) + .addLibrary(methcla_plugins_audioin); + + m_engine = new Methcla::Engine(options); + + return 1; +}; + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_engineStart(JNIEnv *env, jobject object){ + engine().start(); +}; + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_engineStop(JNIEnv *env, jobject object){ + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + request.freeAll(engine().root()); + request.closeBundle(); + request.send(); + + engine().stop(); + //delete m_engine; + +}; + +// General Synth + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_synthStop(JNIEnv *env, jobject object, jintArray nodeId){ + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + request.free(m_nodeId[0]); + request.free(m_nodeId[1]); + + request.closeBundle(); + request.send(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + +}; + +// General Oscillator set method + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_oscSet (JNIEnv *env, jobject object, jfloat freq, jfloat amp, jfloat add, jfloat pos, jintArray nodeId){ + + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + request.set(m_nodeId[0], 0 , freq); + request.set(m_nodeId[0], 1 , amp); + request.set(m_nodeId[0], 2 , add); + request.set(m_nodeId[1], 0, pos); + request.closeBundle(); + request.send(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); +}; + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_oscAudioSet(JNIEnv *env, jobject object, jintArray freq, jintArray amp, jintArray add, jintArray pos, jintArray nodeId){ + + jint* m_freq = env->GetIntArrayElements(freq, 0); + jint* m_amp = env->GetIntArrayElements(amp, 0); + jint* m_add = env->GetIntArrayElements(add, 0); + jint* m_pos = env->GetIntArrayElements(pos, 0); + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + + if (m_freq[0] != -1) + { + Methcla::AudioBusId freq_bus = m_engine->audioBusId().alloc(); + //request.set(m_nodeId[0], 0 , 0); + //request.free(m_freq[1]); + request.mapOutput(m_freq[0], 0, freq_bus); + request.mapInput(m_nodeId[0], 0, freq_bus); + + std::cout << "freq" << std::endl; + } + + if (m_amp[0] != -1) + { + + Methcla::AudioBusId amp_bus = m_engine->audioBusId().alloc(); + //request.set(m_nodeId[0], 1 , 0); + //request.free(m_amp[1]); + request.mapOutput(m_amp[0], 0, amp_bus); + request.mapInput(m_nodeId[0], 1, amp_bus); + + std::cout << "amp" << std::endl; + } + + if (m_add[0] != -1) + { + Methcla::AudioBusId add_bus = m_engine->audioBusId().alloc(); + request.set(m_nodeId[0], 2 , 0); + request.free(m_add[1]); + request.mapOutput(m_add[0], 0, add_bus); + request.mapInput(m_nodeId[0], 2, add_bus); + + std::cout << "add" << std::endl; + } + + if (m_pos[0] != -1) + { + Methcla::AudioBusId pos_bus = m_engine->audioBusId().alloc(); + request.set(m_nodeId[1], 0 , 0); + request.free(m_pos[1]); + request.mapOutput(m_pos[0], 0, pos_bus); + request.mapInput(m_nodeId[1], 0, pos_bus); + + std::cout << "pos" << std::endl; + } + + request.closeBundle(); + request.send(); + + env->ReleaseIntArrayElements(freq, m_freq, 0); + env->ReleaseIntArrayElements(amp, m_amp, 0); + env->ReleaseIntArrayElements(add, m_add, 0); + env->ReleaseIntArrayElements(pos, m_pos, 0); + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); +}; + +// SineOsc + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_sinePlay(JNIEnv *env, jobject object, jfloat freq, jfloat amp, jfloat add, jfloat pos){ + + jintArray nodeId = env->NewIntArray(2); + jint *m_nodeId = env->GetIntArrayElements(nodeId, NULL); + + Methcla::AudioBusId bus = m_engine->audioBusId().alloc(); + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + + auto synth = request.synth( + METHCLA_PLUGINS_SINE_URI, + engine().root(), + {freq, amp, add} + ); + + auto pan = request.synth( + METHCLA_PLUGINS_PAN2_URI, + engine().root(), + {pos, 1.f}, + {Methcla::Value(1.f)} + ); + + engine().addNotificationHandler(engine().freeNodeIdHandler(synth.id())); + engine().addNotificationHandler(engine().freeNodeIdHandler(pan.id())); + + request.mapOutput(synth.id(), 0, bus); + request.mapInput(pan.id(), 0, bus); + request.mapOutput(pan.id(), 0, Methcla::AudioBusId(0), Methcla::kBusMappingExternal); + request.mapOutput(pan.id(), 1, Methcla::AudioBusId(1), Methcla::kBusMappingExternal); + + request.activate(synth.id()); + request.activate(pan.id()); + + request.closeBundle(); + request.send(); + + m_nodeId[0]=synth.id(); + m_nodeId[1]=pan.id(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return nodeId; +}; + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_sawPlay(JNIEnv *env, jobject object, jfloat freq, jfloat amp, jfloat add, jfloat pos){ + jintArray nodeId = env->NewIntArray(2); + jint *m_nodeId = env->GetIntArrayElements(nodeId, NULL); + + Methcla::AudioBusId bus = m_engine->audioBusId().alloc(); + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + + auto synth = request.synth( + METHCLA_PLUGINS_SAW_URI, + engine().root(), + {freq, amp, add} + ); + + auto pan = request.synth( + METHCLA_PLUGINS_PAN2_URI, + engine().root(), + {pos, 1.f}, + {Methcla::Value(1.f)} + ); + + engine().addNotificationHandler(engine().freeNodeIdHandler(synth.id())); + engine().addNotificationHandler(engine().freeNodeIdHandler(pan.id())); + + request.mapOutput(synth.id(), 0, bus); + request.mapInput(pan.id(), 0, bus); + request.mapOutput(pan.id(), 0, Methcla::AudioBusId(0), Methcla::kBusMappingExternal); + request.mapOutput(pan.id(), 1, Methcla::AudioBusId(1), Methcla::kBusMappingExternal); + + request.activate(synth.id()); + request.activate(pan.id()); + + request.closeBundle(); + request.send(); + + m_nodeId[0]=synth.id(); + m_nodeId[1]=pan.id(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return nodeId; +}; + + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_triPlay(JNIEnv *env, jobject object, jfloat freq, jfloat amp, jfloat add, jfloat pos){ + + jintArray nodeId = env->NewIntArray(2); + jint *m_nodeId = env->GetIntArrayElements(nodeId, NULL); + + Methcla::AudioBusId bus = m_engine->audioBusId().alloc(); + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + + auto synth = request.synth( + METHCLA_PLUGINS_TRI_URI, + engine().root(), + {freq, amp, add} + ); + + auto pan = request.synth( + METHCLA_PLUGINS_PAN2_URI, + engine().root(), + {pos, 1.f}, + {Methcla::Value(1.f)} + ); + + request.mapOutput(synth.id(), 0, bus); + request.mapInput(pan.id(), 0, bus); + request.mapOutput(pan.id(), 0, Methcla::AudioBusId(0), Methcla::kBusMappingExternal); + request.mapOutput(pan.id(), 1, Methcla::AudioBusId(1), Methcla::kBusMappingExternal); + + request.activate(synth.id()); + request.activate(pan.id()); + + request.closeBundle(); + request.send(); + + m_nodeId[0]=synth.id(); + m_nodeId[1]=pan.id(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return nodeId; +} + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_sqrPlay(JNIEnv *env, jobject object, jfloat freq, jfloat amp, jfloat add, jfloat pos){ + jintArray nodeId = env->NewIntArray(2); + jint *m_nodeId = env->GetIntArrayElements(nodeId, NULL); + + Methcla::AudioBusId bus = m_engine->audioBusId().alloc(); + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + + auto synth = request.synth( + METHCLA_PLUGINS_PULSE_URI, + engine().root(), + {freq, 0.5, amp*2.f, add-1.f} + ); + + auto pan = request.synth( + METHCLA_PLUGINS_PAN2_URI, + engine().root(), + {pos, 1.f}, + {Methcla::Value(1.f)} + ); + + request.mapOutput(synth.id(), 0, bus); + request.mapInput(pan.id(), 0, bus); + request.mapOutput(pan.id(), 0, Methcla::AudioBusId(0), Methcla::kBusMappingExternal); + request.mapOutput(pan.id(), 1, Methcla::AudioBusId(1), Methcla::kBusMappingExternal); + + request.activate(synth.id()); + request.activate(pan.id()); + + request.closeBundle(); + request.send(); + + m_nodeId[0]=synth.id(); + m_nodeId[1]=pan.id(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return nodeId; +}; + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_sqrSet(JNIEnv *env, jobject object, jfloat freq, jfloat amp, jfloat add, jfloat pos, jintArray nodeId){ + + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + request.set(m_nodeId[0], 0 , freq); + request.set(m_nodeId[0], 0 , 0.5f); + request.set(m_nodeId[0], 2 , amp); + request.set(m_nodeId[1], 0 , pos); + request.closeBundle(); + request.send(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); +}; + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_pulsePlay(JNIEnv *env, jobject object, jfloat freq, jfloat width, jfloat amp, jfloat add, jfloat pos){ + + jintArray nodeId = env->NewIntArray(2); + jint *m_nodeId = env->GetIntArrayElements(nodeId, NULL); + + Methcla::AudioBusId bus = m_engine->audioBusId().alloc(); + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + + auto synth = request.synth( + METHCLA_PLUGINS_PULSE_URI, + engine().root(), + {freq, width, amp, add} + ); + + auto pan = request.synth( + METHCLA_PLUGINS_PAN2_URI, + engine().root(), + {pos, 1.f}, + {Methcla::Value(1.f)} + ); + + request.mapOutput(synth.id(), 0, bus); + request.mapInput(pan.id(), 0, bus); + request.mapOutput(pan.id(), 0, Methcla::AudioBusId(0), Methcla::kBusMappingExternal); + request.mapOutput(pan.id(), 1, Methcla::AudioBusId(1), Methcla::kBusMappingExternal); + + request.activate(synth.id()); + request.activate(pan.id()); + + request.closeBundle(); + request.send(); + + m_nodeId[0]=synth.id(); + m_nodeId[1]=pan.id(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return nodeId; +} + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_pulseSet(JNIEnv *env, jobject object, jfloat freq, jfloat width, jfloat amp, jfloat add, jfloat pos, jintArray nodeId){ + + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + request.set(m_nodeId[0], 0 , freq); + request.set(m_nodeId[0], 1 , width); + request.set(m_nodeId[0], 2 , amp); + request.set(m_nodeId[1], 0 , pos); + request.closeBundle(); + request.send(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); +}; + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_audioInPlay(JNIEnv *env, jobject object, jfloat amp, jfloat add, jfloat pos, jint in){ + + jintArray nodeId = env->NewIntArray(2); + jint *m_nodeId = env->GetIntArrayElements(nodeId, NULL); + + Methcla::AudioBusId bus = m_engine->audioBusId().alloc(); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + + auto synth = request.synth( + METHCLA_PLUGINS_AUDIOIN_URI, + engine().root(), + {amp, add, pos} + ); + + auto pan = request.synth( + METHCLA_PLUGINS_PAN2_URI, + engine().root(), + {pos, 1.f}, + {Methcla::Value(1.f)} + ); + + request.mapInput(synth.id(), 0, Methcla::AudioBusId(in), Methcla::kBusMappingExternal); + request.mapOutput(synth.id(), 0, bus); + request.mapInput(pan.id(), 0, bus); + + request.mapOutput(pan.id(), 0, Methcla::AudioBusId(0), Methcla::kBusMappingExternal); + request.mapOutput(pan.id(), 1, Methcla::AudioBusId(1), Methcla::kBusMappingExternal); + + + request.activate(synth.id()); + request.activate(pan.id()); + + request.closeBundle(); + request.send(); + + m_nodeId[0]=synth.id(); + m_nodeId[1]= pan.id(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return nodeId; +}; + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_audioInSet(JNIEnv *env, jobject object, jfloat amp, jfloat add, jfloat pos, jintArray nodeId){ + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + request.set(m_nodeId[0], 0 , amp); + request.set(m_nodeId[0], 1 , add); + request.set(m_nodeId[1], 0 , pos); + request.closeBundle(); + request.send(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); +}; + + + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_soundFileInfo(JNIEnv *env, jobject object, jstring path){ + const char *str = env->GetStringUTFChars(path, 0); + + Methcla::SoundFile file(engine(), str); + + jintArray info = env->NewIntArray(3); + jint *temp = env->GetIntArrayElements(info, NULL); + + temp[0] = file.info().frames; + temp[1] = file.info().samplerate; + temp[2] = file.info().channels; + + env->ReleaseIntArrayElements(info, temp, 0); + env->ReleaseStringUTFChars(path, str); + + return info; +}; + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_soundFilePlayMono (JNIEnv *env, jobject object, jfloat rate, jfloat pos, jfloat amp, jfloat add, jboolean loop, jstring path, jfloat dur, jint cue){ + + const char *str = env->GetStringUTFChars(path, 0); + + jintArray nodeId = env->NewIntArray(2); + jint *m_nodeId = env->GetIntArrayElements(nodeId, NULL); + + Methcla::Request request(engine()); + Methcla::NodeTreeStatistics results; + + Methcla::AudioBusId bus = m_engine->audioBusId().alloc(); + + request.openBundle(Methcla::immediately); + auto synth = request.synth( + METHCLA_PLUGINS_SAMPLER_URI, + engine().root(), + { amp, rate }, + { Methcla::Value(str), + Methcla::Value(loop), + Methcla::Value(cue) } + ); + + auto pan = request.synth( + METHCLA_PLUGINS_PAN2_URI, + engine().root(), + {pos, 1.f}, + {Methcla::Value(1.f)} + ); + + auto after = request.synth( + METHCLA_PLUGINS_DONE_AFTER_URI, + engine().root(), + { }, + { Methcla::Value(dur) } + ); + + engine().addNotificationHandler(engine().freeNodeIdHandler(synth.id())); + engine().addNotificationHandler(engine().freeNodeIdHandler(pan.id())); + engine().addNotificationHandler(engine().freeNodeIdHandler(after.id())); + + request.mapOutput(synth.id(), 0, bus); + request.mapInput(pan.id(), 0, bus); + request.mapOutput(pan.id(), 0, Methcla::AudioBusId(0), Methcla::kBusMappingExternal); + request.mapOutput(pan.id(), 1, Methcla::AudioBusId(1), Methcla::kBusMappingExternal); + + request.whenDone(after.id(), Methcla::kNodeDoneFreeSelf | Methcla::kNodeDoneFreePreceeding); + request.activate(synth.id()); + request.activate(pan.id()); + if (loop == false) + { + request.activate(after.id()); + } + request.closeBundle(); + + request.send(); + + m_nodeId[0]=synth.id(); + m_nodeId[1]=pan.id(); + + //results = engine().getNodeTreeStatistics(); + //std::cout << results.numSynths << std::endl; + + env->ReleaseStringUTFChars(path, str); + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return nodeId; +}; + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_soundFilePlayMulti(JNIEnv *env, jobject object, jfloat rate, jfloat amp, jfloat add, jboolean loop, jstring path, jfloat dur, jint cue){ + const char *str = env->GetStringUTFChars(path, 0); + + jintArray nodeId = env->NewIntArray(2); + jint *m_nodeId = env->GetIntArrayElements(nodeId, NULL); + + Methcla::Request request(engine()); + Methcla::NodeTreeStatistics results; + + request.openBundle(Methcla::immediately); + auto synth = request.synth( + METHCLA_PLUGINS_SAMPLER_URI, + engine().root(), + { amp, rate }, + { Methcla::Value(str), + Methcla::Value(loop), + Methcla::Value(cue) } + ); + + auto after = request.synth( + METHCLA_PLUGINS_DONE_AFTER_URI, + engine().root(), + { }, + { Methcla::Value(dur) } + ); + + request.mapOutput(synth.id(), 0, Methcla::AudioBusId(0), Methcla::kBusMappingExternal); + request.mapOutput(synth.id(), 1, Methcla::AudioBusId(1), Methcla::kBusMappingExternal); + + request.whenDone(after.id(), Methcla::kNodeDoneFreeSelf | Methcla::kNodeDoneFreePreceeding); + request.activate(synth.id()); + request.activate(after.id()); + request.closeBundle(); + + engine().addNotificationHandler(engine().freeNodeIdHandler(synth.id())); + engine().addNotificationHandler(engine().freeNodeIdHandler(after.id())); + + request.send(); + + m_nodeId[0]=synth.id(); + m_nodeId[1]=after.id(); + + //results = engine().getNodeTreeStatistics(); + //std::cout << results.numSynths << std::endl; + + env->ReleaseStringUTFChars(path, str); + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return nodeId; +} + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_soundFileSetMono (JNIEnv *env, jobject object, jfloat rate, jfloat pos, jfloat amp, jfloat add, jintArray nodeId){ + + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + request.set(m_nodeId[0], 0, amp); + request.set(m_nodeId[0], 1, rate); + request.set(m_nodeId[1], 0, pos); + request.closeBundle(); + request.send(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); +}; + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_soundFileSetStereo(JNIEnv *env, jobject object, jfloat rate, jfloat amp, jfloat add, jintArray nodeId){ + + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + request.set(m_nodeId[0], 0, amp); + request.set(m_nodeId[0], 1, rate); + request.closeBundle(); + request.send(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + +}; + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_whiteNoisePlay(JNIEnv *env, jobject object, jfloat amp, jfloat add, jfloat pos){ + + jintArray nodeId = env->NewIntArray(2); + jint *m_nodeId = env->GetIntArrayElements(nodeId, NULL); + + Methcla::AudioBusId bus = m_engine->audioBusId().alloc(); + Methcla::Request request(engine()); + + request.openBundle(Methcla::immediately); + + auto synth = request.synth( + METHCLA_PLUGINS_WHITE_NOISE_URI, + engine().root(), + { amp, add }, + {Methcla::Value(0.0)} + ); + + auto pan = request.synth( + METHCLA_PLUGINS_PAN2_URI, + engine().root(), + {pos, 1.f}, + {Methcla::Value(1.f)} + ); + + request.mapOutput(synth.id(), 0, bus); + request.mapInput(pan.id(), 0, bus); + request.mapOutput(pan.id(), 0, Methcla::AudioBusId(0), Methcla::kBusMappingExternal); + request.mapOutput(pan.id(), 1, Methcla::AudioBusId(1), Methcla::kBusMappingExternal); + + request.activate(synth.id()); + request.activate(pan.id()); + + request.closeBundle(); + request.send(); + + m_nodeId[0]=synth.id(); + m_nodeId[1]=pan.id(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return nodeId; +}; + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_whiteNoiseSet(JNIEnv *env, jobject object, jfloat amp, jfloat add, jfloat pos, jintArray nodeId){ + + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + request.set(m_nodeId[0], 0, amp); + request.set(m_nodeId[1], 0, pos); + request.closeBundle(); + request.send(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); +}; + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_pinkNoisePlay(JNIEnv *env, jobject object, jfloat amp, jfloat add, jfloat pos){ + jintArray nodeId = env->NewIntArray(2); + jint *m_nodeId = env->GetIntArrayElements(nodeId, NULL); + + Methcla::AudioBusId bus = m_engine->audioBusId().alloc(); + Methcla::Request request(engine()); + + request.openBundle(Methcla::immediately); + + auto synth = request.synth( + METHCLA_PLUGINS_PINK_NOISE_URI, + engine().root(), + { amp, add }, + {} + ); + + auto pan = request.synth( + METHCLA_PLUGINS_PAN2_URI, + engine().root(), + {pos, 1.f}, + {Methcla::Value(1.f)} + ); + + request.mapOutput(synth.id(), 0, bus); + request.mapInput(pan.id(), 0, bus); + request.mapOutput(pan.id(), 0, Methcla::AudioBusId(0), Methcla::kBusMappingExternal); + request.mapOutput(pan.id(), 1, Methcla::AudioBusId(1), Methcla::kBusMappingExternal); + + request.activate(synth.id()); + request.activate(pan.id()); + + request.closeBundle(); + request.send(); + + m_nodeId[0]=synth.id(); + m_nodeId[1]=pan.id(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return nodeId; +}; + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_pinkNoiseSet(JNIEnv *env, jobject object, jfloat amp, jfloat add, jfloat pos, jintArray nodeId){ + + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + request.set(m_nodeId[0], 0, amp); + request.set(m_nodeId[1], 0, pos); + request.closeBundle(); + request.send(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); +}; + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_brownNoisePlay(JNIEnv *env, jobject object, jfloat amp, jfloat add, jfloat pos){ + jintArray nodeId = env->NewIntArray(2); + jint *m_nodeId = env->GetIntArrayElements(nodeId, NULL); + + Methcla::AudioBusId bus = m_engine->audioBusId().alloc(); + Methcla::Request request(engine()); + + request.openBundle(Methcla::immediately); + + auto synth = request.synth( + METHCLA_PLUGINS_BROWN_NOISE_URI, + engine().root(), + { amp, add }, + {} + ); + + auto pan = request.synth( + METHCLA_PLUGINS_PAN2_URI, + engine().root(), + {pos, 1.f}, + {Methcla::Value(1.f)} + ); + + request.mapOutput(synth.id(), 0, bus); + request.mapInput(pan.id(), 0, bus); + request.mapOutput(pan.id(), 0, Methcla::AudioBusId(0), Methcla::kBusMappingExternal); + request.mapOutput(pan.id(), 1, Methcla::AudioBusId(1), Methcla::kBusMappingExternal); + + request.activate(synth.id()); + request.activate(pan.id()); + + request.closeBundle(); + request.send(); + + m_nodeId[0]=synth.id(); + m_nodeId[1]=pan.id(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return nodeId; +}; + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_brownNoiseSet(JNIEnv *env, jobject object, jfloat amp, jfloat add, jfloat pos, jintArray nodeId){ + + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + request.set(m_nodeId[0], 0, amp); + request.set(m_nodeId[1], 0, pos); + request.closeBundle(); + request.send(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); +}; + + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_envelopePlay(JNIEnv *env, jobject object, jintArray nodeId, jfloat attackTime, jfloat sustainTime, jfloat sustainLevel, jfloat releaseTime){ + + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + jintArray returnId = env->NewIntArray(2); + jint *m_returnId = env->GetIntArrayElements(returnId, NULL); + + Methcla::AudioBusId in_bus = m_engine->audioBusId().alloc(); + Methcla::AudioBusId out_bus = m_engine->audioBusId().alloc(); + + + const std::list envOptions = + { Methcla::Value(attackTime) + , Methcla::Value(sustainTime) + , Methcla::Value(sustainLevel) + , Methcla::Value(releaseTime) + }; + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + auto synth = request.synth( + METHCLA_PLUGINS_ASR_ENVELOPE_URI, + Methcla::NodePlacement::after(m_nodeId[0]), + {}, + envOptions + ); + + request.mapOutput(m_nodeId[0], 0, in_bus); + request.mapInput(synth.id(), 0, in_bus); + request.mapOutput(synth.id(), 0, out_bus); + request.mapInput(m_nodeId[1], 0, out_bus); + + request.activate(synth.id()); + + request.closeBundle(); + request.send(); + + m_returnId[0]=synth.id(); + m_returnId[1]=m_nodeId[1]; + + env->ReleaseIntArrayElements(returnId, m_returnId, 0); + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return returnId; +}; + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_highPassPlay(JNIEnv *env, jobject object, jintArray nodeId, jfloat freq){ + + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + jintArray returnId = env->NewIntArray(2); + jint *m_returnId = env->GetIntArrayElements(returnId, NULL); + + Methcla::AudioBusId in_bus = m_engine->audioBusId().alloc(); + Methcla::AudioBusId out_bus = m_engine->audioBusId().alloc(); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + auto synth = request.synth( + METHCLA_PLUGINS_HPF_URI, + Methcla::NodePlacement::after(m_nodeId[0]), + {freq}, + {} + ); + + request.mapOutput(m_nodeId[0], 0, in_bus); + request.mapInput(synth.id(), 0, in_bus); + request.mapOutput(synth.id(), 0, out_bus); + request.mapInput(m_nodeId[1], 0, out_bus); + + request.activate(synth.id()); + + request.closeBundle(); + request.send(); + + m_returnId[0]=synth.id(); + m_returnId[1]=m_nodeId[1]; + + env->ReleaseIntArrayElements(returnId, m_returnId, 0); + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return returnId; +}; + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_lowPassPlay(JNIEnv *env, jobject object, jintArray nodeId, jfloat freq){ + + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + jintArray returnId = env->NewIntArray(2); + jint *m_returnId = env->GetIntArrayElements(returnId, NULL); + + Methcla::AudioBusId in_bus = m_engine->audioBusId().alloc(); + Methcla::AudioBusId out_bus = m_engine->audioBusId().alloc(); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + auto synth = request.synth( + METHCLA_PLUGINS_LPF_URI, + Methcla::NodePlacement::after(m_nodeId[0]), + {freq}, + {} + ); + + request.mapOutput(m_nodeId[0], 0, in_bus); + request.mapInput(synth.id(), 0, in_bus); + request.mapOutput(synth.id(), 0, out_bus); + request.mapInput(m_nodeId[1], 0, out_bus); + + request.activate(synth.id()); + + request.closeBundle(); + request.send(); + + m_returnId[0]=synth.id(); + m_returnId[1]=m_nodeId[1]; + + env->ReleaseIntArrayElements(returnId, m_returnId, 0); + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return returnId; +}; + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_bandPassPlay(JNIEnv *env, jobject object, jintArray nodeId, jfloat freq, jfloat bw){ + + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + jintArray returnId = env->NewIntArray(2); + jint *m_returnId = env->GetIntArrayElements(returnId, NULL); + + Methcla::AudioBusId in_bus = m_engine->audioBusId().alloc(); + Methcla::AudioBusId out_bus = m_engine->audioBusId().alloc(); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + auto synth = request.synth( + METHCLA_PLUGINS_BPF_URI, + Methcla::NodePlacement::after(m_nodeId[0]), + {freq, bw}, + {} + ); + + request.mapOutput(m_nodeId[0], 0, in_bus); + request.mapInput(synth.id(), 0, in_bus); + request.mapOutput(synth.id(), 0, out_bus); + request.mapInput(m_nodeId[1], 0, out_bus); + + request.activate(synth.id()); + + request.closeBundle(); + request.send(); + + m_returnId[0]=synth.id(); + m_returnId[1]=m_nodeId[1]; + + env->ReleaseIntArrayElements(returnId, m_returnId, 0); + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return returnId; +}; + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_filterSet(JNIEnv *env, jobject object, jfloat freq, jint nodeId){ + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + request.set(nodeId, 0, freq); + request.closeBundle(); + request.send(); +}; + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_filterBwSet(JNIEnv *env, jobject object, jfloat freq, jfloat bw, jint nodeId){ + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + request.set(nodeId, 0, freq); + request.set(nodeId, 1, bw); + request.closeBundle(); + request.send(); +}; + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_delayPlay(JNIEnv *env, jobject object, jintArray nodeId, jfloat maxDelayTime, jfloat delayTime, jfloat feedBack){ + + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + jintArray returnId = env->NewIntArray(2); + jint *m_returnId = env->GetIntArrayElements(returnId, NULL); + + Methcla::AudioBusId in_bus = m_engine->audioBusId().alloc(); + Methcla::AudioBusId out_bus = m_engine->audioBusId().alloc(); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + + auto synth = request.synth( + METHCLA_PLUGINS_DELAY_URI, + Methcla::NodePlacement::after(m_nodeId[0]), + {delayTime, feedBack}, + {Methcla::Value(maxDelayTime)} + ); + + request.mapOutput(m_nodeId[0], 0, in_bus); + request.mapInput(synth.id(), 0, in_bus); + request.mapOutput(synth.id(), 0, out_bus); + request.mapInput(m_nodeId[1], 0, out_bus); + + request.activate(synth.id()); + + request.closeBundle(); + request.send(); + + m_returnId[0]=synth.id(); + m_returnId[1]=m_nodeId[1]; + + env->ReleaseIntArrayElements(returnId, m_returnId, 0); + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return returnId; +}; + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_delaySet(JNIEnv *env, jobject object, jfloat delayTime, jfloat feedBack, jint nodeId){ + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + request.set(nodeId, 0, delayTime); + request.set(nodeId, 1, feedBack); + request.closeBundle(); + request.send(); +}; + +JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_reverbPlay(JNIEnv *env, jobject object, jintArray nodeId, jfloat room, jfloat damp, jfloat wet){ + + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + jintArray returnId = env->NewIntArray(2); + jint *m_returnId = env->GetIntArrayElements(returnId, NULL); + + Methcla::AudioBusId in_bus = m_engine->audioBusId().alloc(); + Methcla::AudioBusId out_bus = m_engine->audioBusId().alloc(); + Methcla::Request request(engine()); + + float dry = 1-wet; + + request.openBundle(Methcla::immediately); + auto synth = request.synth( + METHCLA_PLUGINS_REVERB_URI, + Methcla::NodePlacement::after(m_nodeId[0]), + {room, damp, wet, dry}, + {} + ); + + request.mapOutput(m_nodeId[0], 0, in_bus); + request.mapInput(synth.id(), 0, in_bus); + request.mapOutput(synth.id(), 0, out_bus); + request.mapInput(m_nodeId[1], 0, out_bus); + + request.activate(synth.id()); + + request.closeBundle(); + request.send(); + + m_returnId[0]=synth.id(); + m_returnId[1]=m_nodeId[1]; + + env->ReleaseIntArrayElements(returnId, m_returnId, 0); + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return returnId; +}; + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_reverbSet(JNIEnv *env, jobject object, jfloat room, jfloat damp, jfloat wet, jint nodeId){ + Methcla::Request request(engine()); + float dry = 1-wet; + + request.openBundle(Methcla::immediately); + request.set(nodeId, 0, room); + request.set(nodeId, 1, damp); + request.set(nodeId, 2, wet); + request.set(nodeId, 3, dry); + request.closeBundle(); + request.send(); +}; + + +JNIEXPORT jlong JNICALL Java_processing_sound_MethClaInterface_amplitude(JNIEnv *env, jobject object, jintArray nodeId){ + + jlong ptr; + + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + + Methcla::AudioBusId in_bus = m_engine->audioBusId().alloc(); + Methcla::AudioBusId out_bus = m_engine->audioBusId().alloc(); + + Methcla::Request request(engine()); + + ServerValue * amp_ptr = new ServerValue; + + ptr = (jlong)amp_ptr; + + request.openBundle(Methcla::immediately); + + auto synth = request.synth( + METHCLA_PLUGINS_AMPLITUDE_FOLLOWER_URI, + Methcla::NodePlacement::after(m_nodeId[0]), + {}, + {} + ); + + request.mapOutput(m_nodeId[0], 0, in_bus); + request.mapInput(synth.id(), 0, in_bus); + request.mapOutput(synth.id(), 0, out_bus); + request.mapInput(m_nodeId[1], 0, out_bus); + + request.activate(synth.id()); + request.closeBundle(); + request.send(); + + auto id = engine().addNotificationHandler([amp_ptr](const OSCPP::Server::Message& msg) { + if (msg == "/amplitude") { + OSCPP::Server::ArgStream args(msg.args()); + std::lock_guard guard(mutex_amp_in); + while (!args.atEnd()) { + amp_ptr->amp = args.float32(); + } + return false; + } + return false; + }); + + amp_ptr->id = id; + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return ptr; +}; + +JNIEXPORT jfloat JNICALL Java_processing_sound_MethClaInterface_poll_1amplitude(JNIEnv * env, jobject object, jlong ptr){ + ServerValue *amp_ptr = (ServerValue*)ptr; + std::lock_guard guard(mutex_amp_out); + return amp_ptr->amp; +}; + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_destroy_1amplitude(JNIEnv *env, jobject object, jlong ptr){ + + ServerValue *amp_ptr = (ServerValue*)ptr; + engine().removeNotificationHandler(amp_ptr->id); + delete amp_ptr; +}; + +JNIEXPORT jlong JNICALL Java_processing_sound_MethClaInterface_fft(JNIEnv *env, jobject object, jintArray nodeId, jint fftSize){ + + jlong ptr; + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + //ServerArray *fft_ptr = (ServerArray *) malloc(sizeof(ServerArray)); + + ServerArray * fft_ptr = new ServerArray; + + fft_ptr->fft.resize(fftSize, 0); + + fft_ptr->fftSize=fftSize; + ptr = (jlong)fft_ptr; + + Methcla::Engine::NotificationHandler msg; + + Methcla::AudioBusId in_bus = m_engine->audioBusId().alloc(); + Methcla::AudioBusId out_bus = m_engine->audioBusId().alloc(); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + + std::cout << fftSize << std::endl; + + auto synth = request.synth( + METHCLA_PLUGINS_FFT_URI, + Methcla::NodePlacement::after(m_nodeId[0]), + {}, + {Methcla::Value(fftSize)} + ); + + request.mapOutput(m_nodeId[0], 0, in_bus); + request.mapInput(synth.id(), 0, in_bus); + request.mapOutput(synth.id(), 0, out_bus); + request.mapInput(m_nodeId[1], 0, out_bus); + + request.activate(synth.id()); + request.closeBundle(); + request.send(); + + auto id = engine().addNotificationHandler([fft_ptr](const OSCPP::Server::Message& msg) { + if (msg == "/fft") { + OSCPP::Server::ArgStream args(msg.args()); + int i=0; + { + std::lock_guard guard(mutex_fft_in); + while (!args.atEnd()) { + fft_ptr->fft[i] = args.float32(); + i++; + } + } + return false; + } + return false; + }); + + fft_ptr->id = id; + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); + + return ptr; +}; + +JNIEXPORT jfloatArray JNICALL Java_processing_sound_MethClaInterface_poll_1fft(JNIEnv *env, jobject object, jlong ptr){ + + ServerArray *fft_ptr = (ServerArray*)ptr; + jfloatArray fft_mag = env->NewFloatArray(fft_ptr->fftSize); + jfloat *m_fft_mag = env->GetFloatArrayElements(fft_mag, NULL); + + std::lock_guard guard(mutex_fft_out); + for (int i = 0; i < fft_ptr->fftSize; ++i) + { + m_fft_mag[i]=fft_ptr->fft[i]; + } + + env->ReleaseFloatArrayElements(fft_mag, m_fft_mag, 0); + + return fft_mag; +}; + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_destroy_1fft(JNIEnv *env, jobject object, jlong ptr){ + ServerArray * fft_ptr = (ServerArray*)ptr; + engine().removeNotificationHandler(fft_ptr->id); + delete fft_ptr; +}; + +/* OLD VARIABLE IN OUT FUNCTION +JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_out(JNIEnv *env, jobject object, jint in, jint out, jfloatArray pos){ + + float* n_pos = (float *)env->GetFloatArrayElements(pos, 0); + std::vector control (in, 0.f); + + for (int i = 0; i < in; ++i){control[i]=n_pos[i];} + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + auto synth = request.synth( + METHCLA_PLUGINS_PAN2_URI, + engine().root(), + control, + {Methcla::Value(in), Methcla::Value(out)} + ); + //request.mapOutput(synth.id(), 0, Methcla::AudioBusId(0), Methcla::kBusMappingExternal); + request.activate(synth.id()); + request.closeBundle(); + request.send(); + + env->ReleaseFloatArrayElements(pos, n_pos, 0); + + return synth.id(); +}; +*/ + +JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_out(JNIEnv *env, jobject object, jint out, jintArray nodeId){ + + jint* m_nodeId = env->GetIntArrayElements(nodeId, 0); + + Methcla::Request request(engine()); + request.openBundle(Methcla::immediately); + + request.mapOutput(m_nodeId[0], 0, Methcla::AudioBusId(out), Methcla::kBusMappingExternal); + + request.closeBundle(); + request.send(); + + env->ReleaseIntArrayElements(nodeId, m_nodeId, 0); +}; + diff --git a/java/libraries/sound/src/processing/sound/Amplitude.java b/java/libraries/sound/src/processing/sound/Amplitude.java new file mode 100644 index 000000000..40f864440 --- /dev/null +++ b/java/libraries/sound/src/processing/sound/Amplitude.java @@ -0,0 +1,37 @@ +package processing.sound; +import processing.core.*; + +public class Amplitude { + + PApplet parent; + private Engine m_engine; + private long ptr; + + public Amplitude(PApplet theParent) { + this.parent = theParent; + parent.registerMethod("dispose", this); + m_engine.setPreferences(theParent, 512, 44100); + m_engine.start(); + } + + public void input(SoundObject input){ + ptr = m_engine.amplitude(input.returnId()); + } + + public float analyze(){ + return m_engine.poll_amplitude(ptr); + } + /* + public void stop(){ + m_engine.synthStop(m_nodeId); + } + + public int returnId(){ + return m_nodeId; + } + */ + public void dispose() { + m_engine.destroy_amplitude(ptr); + //m_engine.synthStop(m_nodeId); + } +} diff --git a/java/libraries/sound/src/processing/sound/AudioDevice.java b/java/libraries/sound/src/processing/sound/AudioDevice.java new file mode 100644 index 000000000..fa4d66ad5 --- /dev/null +++ b/java/libraries/sound/src/processing/sound/AudioDevice.java @@ -0,0 +1,47 @@ +/** + * + * Copyright ##copyright## ##author## + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA + * + * @author ##Wilm Thoben## + * + */ + +package processing.sound; +import processing.core.PApplet; + + +public class AudioDevice { + + PApplet parent; + static int m_test; + private Engine m_engine; + + public AudioDevice(PApplet theParent, int sampleRate, int bufferSize) { + m_engine.setPreferences(theParent, bufferSize, sampleRate); + m_engine.start(); + } + + public void engineStop() { + m_engine.engineStop(); + } + + public void dispose() { + m_engine.engineStop(); + } + +} \ No newline at end of file diff --git a/java/libraries/sound/src/processing/sound/AudioIn.java b/java/libraries/sound/src/processing/sound/AudioIn.java new file mode 100644 index 000000000..42f572972 --- /dev/null +++ b/java/libraries/sound/src/processing/sound/AudioIn.java @@ -0,0 +1,77 @@ +package processing.sound; + +import processing.core.PApplet; + +public class AudioIn implements SoundObject{ + + PApplet parent; + private Engine m_engine; + private int[] m_nodeId = {-1,-1}; + private float m_amp = 1.f; + private float m_add = 0; + private int m_in = 0; + private float m_pos = 0; + + public AudioIn (PApplet theParent, int in) { + this.parent = theParent; + parent.registerMethod("dispose", this); + m_engine.setPreferences(theParent, 512, 44100); + m_engine.start(); + m_in = in; + } + + public void play(){ + m_nodeId = m_engine.audioInPlay(m_amp, m_add, m_pos, m_in); + } + + public void play(float amp, float add, float pos){ + m_amp=amp; m_add=add; m_pos=pos; + this.play(); + } + + public void play(float amp, float add){ + m_amp=amp; m_add=add; + this.play(); + } + + public void play(float amp){ + m_amp=amp; + this.play(); + } + + private void set(){ + m_engine.audioInSet(m_amp, m_add, m_pos, m_nodeId); + } + + public void set(float amp, float add, float pos){ + m_amp=amp; m_add=add; m_pos=pos; + this.set(); + } + + public void amp(float amp){ + m_amp=amp; + this.set(); + } + + public void add(float add){ + m_add=add; + this.set(); + } + + public void pan(float pos){ + m_pos=pos; + this.set(); + } + + public void stop(){ + m_engine.synthStop(m_nodeId); + } + + public int[] returnId(){ + return m_nodeId; + } + + public void dispose() { + m_engine.synthStop(m_nodeId); + } +} diff --git a/java/libraries/sound/src/processing/sound/BandPass.java b/java/libraries/sound/src/processing/sound/BandPass.java new file mode 100644 index 000000000..91d173f47 --- /dev/null +++ b/java/libraries/sound/src/processing/sound/BandPass.java @@ -0,0 +1,64 @@ +package processing.sound; + +import processing.core.PApplet; + +public class BandPass implements SoundObject{ + + PApplet parent; + private Engine m_engine; + private int[] m_nodeId = {-1,-1}; + private float m_freq = 4000; + private float m_bw = 1000; + + public BandPass(PApplet theParent) { + this.parent = theParent; + parent.registerMethod("dispose", this); + m_engine.setPreferences(theParent, 512, 44100); + m_engine.start(); + } + + public void process(SoundObject input, float freq, float bw){ + m_freq=freq; m_bw=bw; + m_nodeId = m_engine.bandPassPlay(input.returnId(), m_freq, m_bw); + } + + public void process(SoundObject input, float freq){ + m_freq=freq; + m_nodeId = m_engine.bandPassPlay(input.returnId(), m_freq, m_bw); + } + + public void process(SoundObject input){ + m_nodeId = m_engine.bandPassPlay(input.returnId(), m_freq, m_bw); + } + + private void set(){ + m_engine.filterBwSet(m_freq, m_bw, m_nodeId[0]); + } + + public void set(float freq, float bw){ + m_freq=freq; m_bw=bw; + this.set(); + } + + public void freq(float freq){ + m_freq=freq; + this.set(); + } + + public void bw(float bw){ + m_bw=bw; + this.set(); + } + + public int[] returnId(){ + return m_nodeId; + } + + public void stop(){ + m_engine.synthStop(m_nodeId); + } + + public void dispose() { + m_engine.synthStop(m_nodeId); + } +} diff --git a/java/libraries/sound/src/processing/sound/BrownNoise.java b/java/libraries/sound/src/processing/sound/BrownNoise.java new file mode 100644 index 000000000..74bbd80df --- /dev/null +++ b/java/libraries/sound/src/processing/sound/BrownNoise.java @@ -0,0 +1,77 @@ +package processing.sound; +import processing.core.*; + +public class BrownNoise implements Noise{ + + PApplet parent; + private Engine m_engine; + private int[] m_nodeId = {-1,-1}; + private float m_amp=0.5f; + private float m_add=0; + private float m_pos=0; + + public BrownNoise(PApplet theParent) { + this.parent = theParent; + parent.registerMethod("dispose", this); + m_engine.setPreferences(theParent, 512, 44100); + m_engine.start(); + } + + public void play(){ + m_nodeId = m_engine.brownNoisePlay(m_amp, m_add, m_pos); + } + + public void play(float amp, float add, float pos){ + m_amp=amp; m_add=add; m_pos=pos; + this.play(); + } + + public void play(float amp, float add){ + m_amp=amp; m_add=add; + this.play(); + } + + public void play(float amp){ + m_amp=amp; + this.play(); + } + + private void set(){ + if(m_nodeId[0] != -1 ) { + m_engine.brownNoiseSet(m_amp, m_add, m_pos, m_nodeId); + } + } + + public void set(float amp, float add, float pos){ + m_amp=amp; + this.set(); + } + + public void amp(float amp){ + m_amp=amp; + this.set(); + } + + public void add(float add){ + m_add=add; + this.set(); + } + + public void pan(float pos){ + m_pos=pos; + this.set(); + } + + public void stop(){ + m_engine.synthStop(m_nodeId); + } + + public int[] returnId(){ + return m_nodeId; + } + + public void dispose() { + m_engine.synthStop(m_nodeId); + } +}; + \ No newline at end of file diff --git a/java/libraries/sound/src/processing/sound/Delay.java b/java/libraries/sound/src/processing/sound/Delay.java new file mode 100644 index 000000000..262105a8f --- /dev/null +++ b/java/libraries/sound/src/processing/sound/Delay.java @@ -0,0 +1,66 @@ +package processing.sound; + +import processing.core.PApplet; + +public class Delay implements SoundObject{ + + PApplet parent; + private Engine m_engine; + private int m_nodeId[] = {-1,-1}; + private float m_maxDelayTime = 2; + private float m_delayTime = 0; + private float m_feedBack = 0; + + public Delay(PApplet theParent) { + this.parent = theParent; + parent.registerMethod("dispose", this); + m_engine.setPreferences(theParent, 512, 44100); + m_engine.start(); + } + + public void process(SoundObject input, float maxDelayTime, float delayTime, float feedBack){ + m_maxDelayTime=maxDelayTime; m_delayTime=delayTime; m_feedBack=feedBack; + m_nodeId = m_engine.delayPlay(input.returnId(), m_maxDelayTime, m_delayTime, m_feedBack); + } + + public void process(SoundObject input, float maxDelayTime, float delayTime){ + m_maxDelayTime=maxDelayTime; m_delayTime=delayTime; + m_nodeId = m_engine.delayPlay(input.returnId(), m_maxDelayTime, m_delayTime, m_feedBack); + } + + public void process(SoundObject input, float maxDelayTime){ + m_maxDelayTime=maxDelayTime; + m_nodeId = m_engine.delayPlay(input.returnId(), m_maxDelayTime, m_delayTime, m_feedBack); + } + + private void set(){ + m_engine.delaySet(m_delayTime, m_feedBack, m_nodeId[0]); + } + + public void set(float delayTime, float feedBack){ + m_delayTime=delayTime; m_feedBack=feedBack; + this.set(); + } + + public void time(float delayTime){ + m_delayTime=delayTime; + this.set(); + } + + public void feedback(float feedBack){ + m_feedBack=feedBack; + this.set(); + } + + public int[] returnId(){ + return m_nodeId; + } + + public void stop(){ + m_engine.synthStop(m_nodeId); + } + + public void dispose() { + m_engine.synthStop(m_nodeId); + } +} diff --git a/java/libraries/sound/src/processing/sound/Engine.java b/java/libraries/sound/src/processing/sound/Engine.java new file mode 100644 index 000000000..9d03657b9 --- /dev/null +++ b/java/libraries/sound/src/processing/sound/Engine.java @@ -0,0 +1,266 @@ +/** + * + * Copyright ##copyright## ##author## + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA + * + * @author ##Wilm Thoben## + * + */ + +package processing.sound; +import processing.core.PApplet; + +public class Engine { + + private static PApplet parent; + static MethClaInterface methCla; + private static int m_sampleRate=44100; + private static int m_bufferSize=512; + + private Engine() { + //welcome(); + methCla = new MethClaInterface(); + methCla.engineNew(m_sampleRate, m_bufferSize); + methCla.engineStart(); + } + + private static class LazyHolder { + private static final Engine INSTANCE = new Engine(); + } + + public static Engine start() { + return LazyHolder.INSTANCE; + } + + public static void setPreferences(PApplet theParent, int bufferSize, int sampleRate){ + parent = theParent; + m_bufferSize = bufferSize; + m_sampleRate = sampleRate; + } + + // general Synth methods + public static void synthStop(int[] nodeId){ + methCla.synthStop(nodeId); + } + + // general Oscillator methods + + public static void oscSet(float freq, float amp, float add, float pos, int[] nodeId){ + methCla.oscSet(freq, amp, add, pos, nodeId); + }; + + public static void oscAudioSet(int[] freqId, int[] ampId, int[] addId, int[] posId, int[] nodeId){ + methCla.oscAudioSet(freqId, ampId, addId, posId, nodeId); + }; + + // Sine Wave Oscillator + + public static int[] sinePlay(float freq, float amp, float add, float pos){ + return methCla.sinePlay(freq, amp, add, pos); + }; + + //Saw Wave Oscillator + + public static int[] sawPlay(float freq, float amp, float add, float pos){ + return methCla.sawPlay(freq, amp, add, pos); + }; + + //Square Wave Oscillator + + public static int[] sqrPlay(float freq, float amp, float add, float pos){ + return methCla.sqrPlay(freq, amp, add, pos); + }; + + public static void sqrSet(float freq, float amp, float add, float pos, int[] nodeId){ + methCla.sqrSet(freq, amp, add, pos, nodeId); + }; + + // Triangle Wave Oscillator + + public static int[] triPlay(float freq, float amp, float add, float pos){ + return methCla.triPlay(freq, amp, add, pos); + }; + + public static int[] pulsePlay(float freq, float width, float amp, float add, float pos){ + return methCla.pulsePlay(freq, width, amp, add, pos); + }; + + public static void pulseSet(float freq, float width, float amp, float add, float pos, int[] nodeId){ + methCla.pulseSet(freq, width, amp, add, pos, nodeId); + }; + + // AudioIn + + public static int[] audioInPlay(float amp, float add, float pos, int in){ + return methCla.audioInPlay(amp, add, pos, in); + }; + + public static void audioInSet(float amp, float add, float pos, int[] nodeId){ + methCla.audioInSet(amp, add, pos, nodeId); + }; + + // SoundFile + + public static int[] soundFileInfo(String path){ + return methCla.soundFileInfo(path); + }; + + public static int[] soundFilePlayMono(float rate, float pos, float amp, float add, boolean loop, String path, float dur, int cue){ + return soundFilePlayMono(rate, pos, amp, add, loop, path, dur, cue); + }; + + public static int[] soundFilePlayMulti(float rate, float amp, float add, boolean loop, String path, float dur, int cue){ + return methCla.soundFilePlayMulti(rate, amp, add, loop, path, dur, cue); + }; + + public static void soundFileSetMono(float rate, float pos, float amp, float add, int[] nodeId){ + methCla.soundFileSetMono(rate, pos, amp, add, nodeId); + }; + + public static void soundFileSetStereo(float rate, float amp, float add, int[] nodeId){ + methCla.soundFileSetStereo(rate, amp, add, nodeId); + }; + + // White Noise + + public static int[] whiteNoisePlay(float amp, float add, float pos){ + return methCla.whiteNoisePlay(amp, add, pos); + }; + + public static void whiteNoiseSet(float amp, float add, float pos, int[] nodeId){ + methCla.whiteNoiseSet(amp, add, pos, nodeId); + }; + + // Pink Noise + + public static int[] pinkNoisePlay(float amp, float add, float pos){ + return methCla.pinkNoisePlay(amp, add, pos); + }; + + public static void pinkNoiseSet(float amp, float add, float pos, int[] nodeId){ + methCla.pinkNoiseSet(amp, add, pos, nodeId); + }; + + // Brown Noise + + public static int[] brownNoisePlay(float amp, float add, float pos){ + return methCla.brownNoisePlay(amp, add, pos); + }; + + public static void brownNoiseSet(float amp, float add, float pos, int[] nodeId){ + methCla.brownNoiseSet(amp, add, pos, nodeId); + }; + + // Envelope + + public static int[] envelopePlay(int[] input, float attackTime, float sustainTime, float sustainLevel, float releaseTime){ + return methCla.envelopePlay(input, attackTime, sustainTime, sustainLevel, releaseTime); + }; + + public static int doneAfter(float seconds){ + return methCla.doneAfter(seconds); + }; + + // Filters + + public static int[] highPassPlay(int[] input, float freq){ + return methCla.highPassPlay(input, freq); + }; + + public static int[] lowPassPlay(int[] input, float freq){ + return methCla.lowPassPlay(input, freq); + }; + + public static int[] bandPassPlay(int[] input, float freq, float bw){ + return methCla.bandPassPlay(input, freq, bw); + }; + + public static void filterSet(float freq, int nodeId){ + methCla.filterSet(freq, nodeId); + }; + + public static void filterBwSet(float freq, float bw, int nodeId){ + methCla.filterBwSet(freq, bw, nodeId); + }; + + // Delay + + public static int[] delayPlay(int[] input, float maxDelayTime, float delayTime, float feedBack){ + return methCla.delayPlay(input, maxDelayTime, delayTime, feedBack); + }; + + public static void delaySet(float delayTime, float feedBack, int nodeId){ + methCla.delaySet(delayTime, feedBack, nodeId); + }; + + // Reverb + + public static int[] reverbPlay(int[] input, float room, float damp, float wet){ + return methCla.reverbPlay(input, room, damp, wet); + }; + + public static void reverbSet(float room, float damp, float wet, int nodeId){ + methCla.reverbSet(room, damp, wet, nodeId); + }; + + // Amplitude Follower + + public static long amplitude(int[] nodeId){ + return methCla.amplitude(nodeId); + }; + + public static float poll_amplitude(long ptr){ + return methCla.poll_amplitude(ptr); + }; + + public static void destroy_amplitude(long ptr){ + methCla.destroy_amplitude(ptr); + }; + + // FFT + + public static long fft(int[] nodeId, int fftSize){ + return methCla.fft(nodeId, fftSize); + }; + + public static float[] poll_fft(long ptr){ + return methCla.poll_fft(ptr); + }; + + public static void destroy_fft(long ptr){ + methCla.destroy_fft(ptr); + }; + + // Out + + public static void out(int out, int[] nodeId){ + methCla.out(out, nodeId); + }; + + + public static void engineStop() { + methCla.engineStop(); + } + + public void dispose() { + methCla.engineStop(); + } + + private void welcome() { + System.out.println("processing.sound v.09 by Wilm Thoben"); + } +} \ No newline at end of file diff --git a/java/libraries/sound/src/processing/sound/Env.java b/java/libraries/sound/src/processing/sound/Env.java new file mode 100644 index 000000000..499f9ccdc --- /dev/null +++ b/java/libraries/sound/src/processing/sound/Env.java @@ -0,0 +1,28 @@ +package processing.sound; +import processing.core.*; + +public class Env { + + PApplet parent; + private Engine m_engine; + int[] m_nodeId = {-1, -1}; + + public Env (PApplet theParent) { + this.parent = theParent; + parent.registerMethod("dispose", this); + m_engine.setPreferences(theParent, 512, 44100); + m_engine.start(); + } + + public void play(SoundObject input, float attackTime, float sustainTime, float sustainLevel, float releaseTime){ + m_nodeId = m_engine.envelopePlay(input.returnId(), attackTime, sustainTime, sustainLevel, releaseTime); + } + + public int[] returnId(){ + return m_nodeId; + } + + public void dispose(){ + m_engine.synthStop(m_nodeId); + } +}; diff --git a/java/libraries/sound/src/processing/sound/FFT.java b/java/libraries/sound/src/processing/sound/FFT.java new file mode 100644 index 000000000..30d1df8e4 --- /dev/null +++ b/java/libraries/sound/src/processing/sound/FFT.java @@ -0,0 +1,41 @@ +package processing.sound; +import processing.core.*; + +public class FFT { + + PApplet parent; + private Engine m_engine; + private long ptr; + + public FFT(PApplet theParent) { + this.parent = theParent; + parent.registerMethod("dispose", this); + m_engine.setPreferences(theParent, 512, 44100); + m_engine.start(); + } + + public void input(SoundObject input, int fftSize){ + ptr = m_engine.fft(input.returnId(), fftSize); + } + + public void analyze(float[] value){ + float[] m_value = m_engine.poll_fft(ptr); + int num_samples = Math.min(value.length, m_value.length); + for(int i=0; i(-1)){ + this.stop(); + } + + m_cue = (int)time * m_info[1]; + + if(m_loop == true) { + if(this.channels() < 2){ + m_nodeId = methCla.soundFilePlayMono(m_rate, m_pos, m_amp, m_add, true, m_filePath, this.duration()*(1/m_rate), m_cue); + } + else if(this.channels() == 2){ + m_nodeId = methCla.soundFilePlayMulti(m_rate, m_amp, m_add, true, m_filePath, this.duration()*(1/m_rate), m_cue); + } + } + else { + if(this.channels() < 2){ + m_nodeId = methCla.soundFilePlayMono(m_rate, m_pos, m_amp, m_add, false, m_filePath, this.duration()*(1/m_rate), m_cue); + } + else if(this.channels() == 2){ + m_nodeId = methCla.soundFilePlayMulti(m_rate, m_amp, m_add, false, m_filePath, this.duration()*(1/m_rate), m_cue); + } + } + } + + public void cue(float time){ + m_cue = (int)time * m_info[1]; + } + + private void set(){ + if(m_nodeId[0] != -1 ) { + if(this.channels() < 2){ + m_engine.soundFileSetMono(m_rate, m_pos, m_amp, m_add, m_nodeId); + } + else if(this.channels() == 2){ + m_engine.soundFileSetStereo(m_rate, m_amp, m_add, m_nodeId); + } + } + } + + public void set(float rate, float pos, float amp, float add){ + m_rate=rate;m_pos=pos;m_amp=amp;m_add=add; + this.set(); + } + + public void pan(float pos){ + if(this.channels() > 1){ + throw new UnsupportedOperationException("Panning is not supported for stereo files"); + } + + m_pos=pos; + this.set(); + } + + public void rate(float rate){ + m_rate=rate; + this.set(); + } + + public void amp(float amp){ + m_amp=amp; + this.set(); + } + + public void add(float add){ + m_add=add; + this.set(); + } + + public void stop(){ + m_engine.synthStop(m_nodeId); + } + + public int[] returnId(){ + return m_nodeId; + } + + public void dispose() { + m_engine.synthStop(m_nodeId); + } +} diff --git a/java/libraries/sound/src/processing/sound/SoundObject.java b/java/libraries/sound/src/processing/sound/SoundObject.java new file mode 100644 index 000000000..4afa032a7 --- /dev/null +++ b/java/libraries/sound/src/processing/sound/SoundObject.java @@ -0,0 +1,8 @@ +package processing.sound; + +interface SoundObject { + + //public int numBusses=128; + //public int topBus=0; + public int[] returnId(); +} \ No newline at end of file diff --git a/java/libraries/sound/src/processing/sound/SqrOsc.java b/java/libraries/sound/src/processing/sound/SqrOsc.java new file mode 100644 index 000000000..68d56e5b3 --- /dev/null +++ b/java/libraries/sound/src/processing/sound/SqrOsc.java @@ -0,0 +1,91 @@ +package processing.sound; + +import processing.core.PApplet; + +public class SqrOsc implements SoundObject { + + PApplet parent; + private Engine m_engine; + private int[] m_nodeId = {-1,-1}; + private float m_freq = 440; + private float m_amp = 0.5f; + private float m_add = 0; + private float m_pos = 0; + + public SqrOsc(PApplet theParent) { + this.parent = theParent; + parent.registerMethod("dispose", this); + m_engine.setPreferences(theParent, 512, 44100); + m_engine.start(); + } + + public void play(){ + //m_nodeId = m_engine.pulsePlay(m_freq, 0.5f, m_amp*2, m_add-1, m_pos); + m_nodeId = m_engine.sqrPlay(m_freq, m_amp, m_add-1, m_pos); + }; + + public void play(float freq, float amp, float add, float pos){ + m_freq=freq; m_amp=amp; m_add=add; m_pos=pos; + this.play(); + }; + + public void play(float freq, float amp, float add){ + m_freq=freq; m_amp=amp; m_add=add; + this.play(); + }; + + public void play(float freq, float amp){ + m_freq=freq; m_amp=amp; + this.play(); + }; + + public void play(float freq){ + m_freq=freq; + this.play(); + }; + + private void set(){ + if(m_nodeId[0] != -1 ) { + m_engine.oscSet(m_freq, m_amp, m_add, m_pos, m_nodeId); + } + } + + public void set(float freq, float amp, float add, float pos){ + m_freq=freq; m_amp=amp; m_add=add; m_pos=pos; + this.set(); + }; + + public void freq(float freq){ + m_freq=freq; + this.set(); + } + + public void amp(float amp){ + m_amp=amp; + this.set(); + } + + public void add(float add){ + m_add=add; + this.set(); + } + + public void pan(float pos){ + m_pos=pos; + this.set(); + } + + public void stop(){ + m_engine.synthStop(m_nodeId); + }; + + public int[] returnId(){ + return m_nodeId; + }; + + public void dispose(){ + m_engine.synthStop(m_nodeId); + }; +} + + diff --git a/java/libraries/sound/src/processing/sound/TriOsc.java b/java/libraries/sound/src/processing/sound/TriOsc.java new file mode 100644 index 000000000..7e0c3ecdc --- /dev/null +++ b/java/libraries/sound/src/processing/sound/TriOsc.java @@ -0,0 +1,82 @@ +package processing.sound; +import processing.core.PApplet; + +public class TriOsc implements Oscillator{ + + PApplet parent; + private Engine m_engine; + private int[] m_nodeId = {-1,-1}; + private float m_freq = 440; + private float m_amp = 0.5f; + private float m_add = 0; + private float m_pos = 0; + + public TriOsc(PApplet theParent) { + this.parent = theParent; + parent.registerMethod("dispose", this); + m_engine.setPreferences(theParent, 512, 44100); + m_engine.start(); + } + + public void play(float freq, float amp, float add, float pos){ + m_freq=freq; m_amp=amp; m_add=add; m_pos=pos; + m_nodeId = m_engine.triPlay(m_freq, m_amp, m_add, m_pos); + } + + public void play(float freq, float amp, float add){ + m_freq=freq; m_amp=amp; m_add=add; + m_nodeId = m_engine.triPlay(m_freq, m_amp, m_add, m_pos); + } + + public void play(float freq, float amp){ + m_freq=freq; m_amp=amp; + m_nodeId = m_engine.triPlay(m_freq, m_amp, m_add, m_pos); + } + + public void play(){ + m_nodeId = m_engine.triPlay(m_freq, m_amp, m_add, m_pos); + } + + private void set(){ + if(m_nodeId[0] != -1 ) { + m_engine.oscSet(m_freq, m_amp, m_add, m_pos, m_nodeId); + } + } + + public void set(float freq, float amp, float add, float pos){ + m_freq=freq; m_amp=amp; m_add=add; m_pos=pos; + this.set(); + } + + public void freq(float freq){ + m_freq=freq; + this.set(); + } + + public void amp(float amp){ + m_amp=amp; + this.set(); + } + + public void add(float add){ + m_add=add; + this.set(); + } + + public void pan(float pos){ + m_pos=pos; + this.set(); + } + + public void stop(){ + m_engine.synthStop(m_nodeId); + } + + public int[] returnId(){ + return m_nodeId; + } + + public void dispose() { + m_engine.synthStop(m_nodeId); + } +} diff --git a/java/libraries/sound/src/processing/sound/WhiteNoise.java b/java/libraries/sound/src/processing/sound/WhiteNoise.java new file mode 100644 index 000000000..b69f8cff5 --- /dev/null +++ b/java/libraries/sound/src/processing/sound/WhiteNoise.java @@ -0,0 +1,77 @@ +package processing.sound; +import processing.core.*; + +public class WhiteNoise implements Noise{ + + PApplet parent; + private Engine m_engine; + private int[] m_nodeId = {-1,-1}; + private float m_amp=0.5f; + private float m_add=0; + private float m_pos=0; + + public WhiteNoise(PApplet theParent) { + this.parent = theParent; + parent.registerMethod("dispose", this); + m_engine.setPreferences(theParent, 512, 44100); + m_engine.start(); + } + + public void play(){ + m_nodeId = m_engine.whiteNoisePlay(m_amp, m_add, m_pos); + } + + public void play(float amp, float add, float pos){ + m_amp=amp; m_add=add; m_pos=pos; + this.play(); + } + + public void play(float amp, float add){ + m_amp=amp; m_add=add; + this.play(); + } + + public void play(float amp){ + m_amp=amp; + this.play(); + } + + private void set(){ + if(m_nodeId[0] != -1 ) { + m_engine.whiteNoiseSet(m_amp, m_add, m_pos, m_nodeId); + } + } + + public void set(float amp, float add, float pos){ + m_amp=amp; + this.set(); + } + + public void amp(float amp){ + m_amp=amp; + this.set(); + } + + public void add(float add){ + m_add=add; + this.set(); + } + + public void pan(float pos){ + m_pos=pos; + this.set(); + } + + public void stop(){ + m_engine.synthStop(m_nodeId); + } + + public int[] returnId(){ + return m_nodeId; + } + + public void dispose() { + m_engine.synthStop(m_nodeId); + } +}; + \ No newline at end of file diff --git a/java/libraries/sound/src/scripts/createHeaders.sh b/java/libraries/sound/src/scripts/createHeaders.sh new file mode 100755 index 000000000..c09d888a9 --- /dev/null +++ b/java/libraries/sound/src/scripts/createHeaders.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# this is a small script to create the .h file for the JNIlib and put it into the right directory. + +cd ../processing/sound +javac MethClaInterface.java +cd ../../ +javah processing.sound.MethClaInterface +mv processing_sound_MethClaInterface.h cpp/include +rm processing/sound/MethClaInterface.class diff --git a/java/libraries/sound/todo.txt b/java/libraries/sound/todo.txt new file mode 100644 index 000000000..8842855ff --- /dev/null +++ b/java/libraries/sound/todo.txt @@ -0,0 +1,42 @@ +// // // // // // // // // // // // // // // // // // // // // + +2.0 SOUND + + FOR RELEASE (GSoC) + + - Improve/make examples + + Bugs (GSoC): + + Fix FFT Crash + + Fix Low Pass Distortion + + Review Filter Algorithms, exclude Resonance, introduce Bandwith for BPass + + Fix problem of passing effects to Analyzers + + Make audio input work + - Use Patch Cables for signal splitting for effects + + Features (GSoC): + - Compile Windows Version + - Make oscillators modulatable + - Bandlimit oscillators + - Introduce wet/dry for Delay + - Interpolate control signals + + Overload Filter Functions + - If you loop a sample and use jump make it play from the beginning + + Documentation: + - Write reference for Sound for Processing website + - Review Processing Book + + NICE + - Pitchtracker (GSoC optional) + - isPlaying method for Synths + - helper functions (ampToDB, midiToFreq etc..) + - make non-bandlimited a pro option + + + EYE ON THE FUTURE + - Multichannel panning + - More Descriptors (beat tracking etc.?) + - Separate audio scheduling loop + +// // // // // // // // // // // // // // // // // // // // // diff --git a/java/libraries/video/.classpath b/java/libraries/video/.classpath deleted file mode 100644 index 80820b4c9..000000000 --- a/java/libraries/video/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/java/libraries/video/.gitignore b/java/libraries/video/.gitignore deleted file mode 100644 index ba077a403..000000000 --- a/java/libraries/video/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/java/libraries/video/examples/Capture/AsciiVideo/AsciiVideo.pde b/java/libraries/video/examples/Capture/AsciiVideo/AsciiVideo.pde deleted file mode 100644 index 59364288b..000000000 --- a/java/libraries/video/examples/Capture/AsciiVideo/AsciiVideo.pde +++ /dev/null @@ -1,140 +0,0 @@ -/** - * ASCII Video - * by Ben Fry. - * - * - * Text characters have been used to represent images since the earliest computers. - * This sketch is a simple homage that re-interprets live video as ASCII text. - * See the keyPressed function for more options, like changing the font size. - */ - -import processing.video.*; - -Capture video; -boolean cheatScreen; - -// All ASCII characters, sorted according to their visual density -String letterOrder = - " .`-_':,;^=+/\"|)\\<>)iv%xclrs{*}I?!][1taeo7zjLu" + - "nT#JCwfy325Fp6mqSghVd4EgXPGZbYkOA&8U$@KHDBWNMR0Q"; -char[] letters; - -float[] bright; -char[] chars; - -PFont font; -float fontSize = 1.5; - - -void setup() { - size(640, 480); - - // This the default video input, see the GettingStartedCapture - // example if it creates an error - video = new Capture(this, 160, 120); - - // Start capturing the images from the camera - video.start(); - - int count = video.width * video.height; - //println(count); - - font = loadFont("UniversLTStd-Light-48.vlw"); - - // for the 256 levels of brightness, distribute the letters across - // the an array of 256 elements to use for the lookup - letters = new char[256]; - for (int i = 0; i < 256; i++) { - int index = int(map(i, 0, 256, 0, letterOrder.length())); - letters[i] = letterOrder.charAt(index); - } - - // current characters for each position in the video - chars = new char[count]; - - // current brightness for each point - bright = new float[count]; - for (int i = 0; i < count; i++) { - // set each brightness at the midpoint to start - bright[i] = 128; - } -} - - -void captureEvent(Capture c) { - c.read(); -} - - -void draw() { - background(0); - - pushMatrix(); - - float hgap = width / float(video.width); - float vgap = height / float(video.height); - - scale(max(hgap, vgap) * fontSize); - textFont(font, fontSize); - - int index = 0; - video.loadPixels(); - for (int y = 1; y < video.height; y++) { - - // Move down for next line - translate(0, 1.0 / fontSize); - - pushMatrix(); - for (int x = 0; x < video.width; x++) { - int pixelColor = video.pixels[index]; - // Faster method of calculating r, g, b than red(), green(), blue() - int r = (pixelColor >> 16) & 0xff; - int g = (pixelColor >> 8) & 0xff; - int b = pixelColor & 0xff; - - // Another option would be to properly calculate brightness as luminance: - // luminance = 0.3*red + 0.59*green + 0.11*blue - // Or you could instead red + green + blue, and make the the values[] array - // 256*3 elements long instead of just 256. - int pixelBright = max(r, g, b); - - // The 0.1 value is used to damp the changes so that letters flicker less - float diff = pixelBright - bright[index]; - bright[index] += diff * 0.1; - - fill(pixelColor); - int num = int(bright[index]); - text(letters[num], 0, 0); - - // Move to the next pixel - index++; - - // Move over for next character - translate(1.0 / fontSize, 0); - } - popMatrix(); - } - popMatrix(); - - if (cheatScreen) { - //image(video, 0, height - video.height); - // set() is faster than image() when drawing untransformed images - set(0, height - video.height, video); - } -} - - -/** - * Handle key presses: - * 'c' toggles the cheat screen that shows the original image in the corner - * 'g' grabs an image and saves the frame to a tiff image - * 'f' and 'F' increase and decrease the font size - */ -void keyPressed() { - switch (key) { - case 'g': saveFrame(); break; - case 'c': cheatScreen = !cheatScreen; break; - case 'f': fontSize *= 1.1; break; - case 'F': fontSize *= 0.9; break; - } -} diff --git a/java/libraries/video/examples/Capture/AsciiVideo/data/UniversLTStd-Light-48.vlw b/java/libraries/video/examples/Capture/AsciiVideo/data/UniversLTStd-Light-48.vlw deleted file mode 100644 index 0d624969b..000000000 Binary files a/java/libraries/video/examples/Capture/AsciiVideo/data/UniversLTStd-Light-48.vlw and /dev/null differ diff --git a/java/libraries/video/examples/Capture/BackgroundSubtraction/BackgroundSubtraction.pde b/java/libraries/video/examples/Capture/BackgroundSubtraction/BackgroundSubtraction.pde deleted file mode 100644 index 01f16016f..000000000 --- a/java/libraries/video/examples/Capture/BackgroundSubtraction/BackgroundSubtraction.pde +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Background Subtraction - * by Golan Levin. - * - * Detect the presence of people and objects in the frame using a simple - * background-subtraction technique. To initialize the background, press a key. - */ - - -import processing.video.*; - -int numPixels; -int[] backgroundPixels; -Capture video; - -void setup() { - size(640, 480); - - // This the default video input, see the GettingStartedCapture - // example if it creates an error - //video = new Capture(this, 160, 120); - video = new Capture(this, width, height); - - // Start capturing the images from the camera - video.start(); - - numPixels = video.width * video.height; - // Create array to store the background image - backgroundPixels = new int[numPixels]; - // Make the pixels[] array available for direct manipulation - loadPixels(); -} - -void draw() { - if (video.available()) { - video.read(); // Read a new video frame - video.loadPixels(); // Make the pixels of video available - // Difference between the current frame and the stored background - int presenceSum = 0; - for (int i = 0; i < numPixels; i++) { // For each pixel in the video frame... - // Fetch the current color in that location, and also the color - // of the background in that spot - color currColor = video.pixels[i]; - color bkgdColor = backgroundPixels[i]; - // Extract the red, green, and blue components of the current pixel's color - int currR = (currColor >> 16) & 0xFF; - int currG = (currColor >> 8) & 0xFF; - int currB = currColor & 0xFF; - // Extract the red, green, and blue components of the background pixel's color - int bkgdR = (bkgdColor >> 16) & 0xFF; - int bkgdG = (bkgdColor >> 8) & 0xFF; - int bkgdB = bkgdColor & 0xFF; - // Compute the difference of the red, green, and blue values - int diffR = abs(currR - bkgdR); - int diffG = abs(currG - bkgdG); - int diffB = abs(currB - bkgdB); - // Add these differences to the running tally - presenceSum += diffR + diffG + diffB; - // Render the difference image to the screen - pixels[i] = color(diffR, diffG, diffB); - // The following line does the same thing much faster, but is more technical - //pixels[i] = 0xFF000000 | (diffR << 16) | (diffG << 8) | diffB; - } - updatePixels(); // Notify that the pixels[] array has changed - println(presenceSum); // Print out the total amount of movement - } -} - -// When a key is pressed, capture the background image into the backgroundPixels -// buffer, by copying each of the current frame's pixels into it. -void keyPressed() { - video.loadPixels(); - arraycopy(video.pixels, backgroundPixels); -} diff --git a/java/libraries/video/examples/Capture/BrightnessThresholding/BrightnessThresholding.pde b/java/libraries/video/examples/Capture/BrightnessThresholding/BrightnessThresholding.pde deleted file mode 100644 index 0902784ec..000000000 --- a/java/libraries/video/examples/Capture/BrightnessThresholding/BrightnessThresholding.pde +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Brightness Thresholding - * by Golan Levin. - * - * Determines whether a test location (such as the cursor) is contained within - * the silhouette of a dark object. - */ - - -import processing.video.*; - -color black = color(0); -color white = color(255); -int numPixels; -Capture video; - -void setup() { - size(640, 480); // Change size to 320 x 240 if too slow at 640 x 480 - strokeWeight(5); - - // This the default video input, see the GettingStartedCapture - // example if it creates an error - video = new Capture(this, width, height); - - // Start capturing the images from the camera - video.start(); - - numPixels = video.width * video.height; - noCursor(); - smooth(); -} - -void draw() { - if (video.available()) { - video.read(); - video.loadPixels(); - int threshold = 127; // Set the threshold value - float pixelBrightness; // Declare variable to store a pixel's color - // Turn each pixel in the video frame black or white depending on its brightness - loadPixels(); - for (int i = 0; i < numPixels; i++) { - pixelBrightness = brightness(video.pixels[i]); - if (pixelBrightness > threshold) { // If the pixel is brighter than the - pixels[i] = white; // threshold value, make it white - } - else { // Otherwise, - pixels[i] = black; // make it black - } - } - updatePixels(); - // Test a location to see where it is contained. Fetch the pixel at the test - // location (the cursor), and compute its brightness - int testValue = get(mouseX, mouseY); - float testBrightness = brightness(testValue); - if (testBrightness > threshold) { // If the test location is brighter than - fill(black); // the threshold set the fill to black - } - else { // Otherwise, - fill(white); // set the fill to white - } - ellipse(mouseX, mouseY, 20, 20); - } -} diff --git a/java/libraries/video/examples/Capture/BrightnessTracking/BrightnessTracking.pde b/java/libraries/video/examples/Capture/BrightnessTracking/BrightnessTracking.pde deleted file mode 100644 index b1a1b5677..000000000 --- a/java/libraries/video/examples/Capture/BrightnessTracking/BrightnessTracking.pde +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Brightness Tracking - * by Golan Levin. - * - * Tracks the brightest pixel in a live video signal. - */ - - -import processing.video.*; - -Capture video; - -void setup() { - size(640, 480); - // Uses the default video input, see the reference if this causes an error - video = new Capture(this, width, height); - video.start(); - noStroke(); - smooth(); -} - -void draw() { - if (video.available()) { - video.read(); - image(video, 0, 0, width, height); // Draw the webcam video onto the screen - int brightestX = 0; // X-coordinate of the brightest video pixel - int brightestY = 0; // Y-coordinate of the brightest video pixel - float brightestValue = 0; // Brightness of the brightest video pixel - // Search for the brightest pixel: For each row of pixels in the video image and - // for each pixel in the yth row, compute each pixel's index in the video - video.loadPixels(); - int index = 0; - for (int y = 0; y < video.height; y++) { - for (int x = 0; x < video.width; x++) { - // Get the color stored in the pixel - int pixelValue = video.pixels[index]; - // Determine the brightness of the pixel - float pixelBrightness = brightness(pixelValue); - // If that value is brighter than any previous, then store the - // brightness of that pixel, as well as its (x,y) location - if (pixelBrightness > brightestValue) { - brightestValue = pixelBrightness; - brightestY = y; - brightestX = x; - } - index++; - } - } - // Draw a large, yellow circle at the brightest pixel - fill(255, 204, 0, 128); - ellipse(brightestX, brightestY, 200, 200); - } -} diff --git a/java/libraries/video/examples/Capture/ColorSorting/ColorSorting.pde b/java/libraries/video/examples/Capture/ColorSorting/ColorSorting.pde deleted file mode 100644 index e040a1923..000000000 --- a/java/libraries/video/examples/Capture/ColorSorting/ColorSorting.pde +++ /dev/null @@ -1,146 +0,0 @@ -/** - * Color Sorting - * by Ben Fry. - * - * Example that sorts all colors from the incoming video - * and arranges them into vertical bars. - */ - - -import processing.video.*; - -Capture video; -boolean cheatScreen; - -Tuple[] captureColors; -Tuple[] drawColors; -int[] bright; - -// How many pixels to skip in either direction -int increment = 5; - -void setup() { - size(800, 600); - - // This the default video input, see the GettingStartedCapture - // example if it creates an error - video = new Capture(this, 160, 120); - - // Start capturing the images from the camera - video.start(); - - int count = (video.width * video.height) / (increment * increment); - bright = new int[count]; - captureColors = new Tuple[count]; - drawColors = new Tuple[count]; - for (int i = 0; i < count; i++) { - captureColors[i] = new Tuple(); - drawColors[i] = new Tuple(0.5, 0.5, 0.5); - } -} - - -void draw() { - if (video.available()) { - video.read(); - video.loadPixels(); - - background(0); - noStroke(); - - int index = 0; - for (int j = 0; j < video.height; j += increment) { - for (int i = 0; i < video.width; i += increment) { - int pixelColor = video.pixels[j*video.width + i]; - - int r = (pixelColor >> 16) & 0xff; - int g = (pixelColor >> 8) & 0xff; - int b = pixelColor & 0xff; - - // Technically would be sqrt of the following, but no need to do - // sqrt before comparing the elements since we're only ordering - bright[index] = r*r + g*g + b*b; - captureColors[index].set(r, g, b); - - index++; - } - } - sort(index, bright, captureColors); - - beginShape(QUAD_STRIP); - for (int i = 0; i < index; i++) { - drawColors[i].target(captureColors[i], 0.1); - drawColors[i].phil(); - - float x = map(i, 0, index, 0, width); - vertex(x, 0); - vertex(x, height); - } - endShape(); - - if (cheatScreen) { - //image(video, 0, height - video.height); - // Faster method of displaying pixels array on screen - set(0, height - video.height, video); - } - } -} - - -void keyPressed() { - if (key == 'g') { - saveFrame(); - } else if (key == 'c') { - cheatScreen = !cheatScreen; - } -} - - -// Functions to handle sorting the color data - - -void sort(int length, int[] a, Tuple[] stuff) { - sortSub(a, stuff, 0, length - 1); -} - - -void sortSwap(int[] a, Tuple[] stuff, int i, int j) { - int T = a[i]; - a[i] = a[j]; - a[j] = T; - - Tuple v = stuff[i]; - stuff[i] = stuff[j]; - stuff[j] = v; -} - - -void sortSub(int[] a, Tuple[] stuff, int lo0, int hi0) { - int lo = lo0; - int hi = hi0; - int mid; - - if (hi0 > lo0) { - mid = a[(lo0 + hi0) / 2]; - - while (lo <= hi) { - while ((lo < hi0) && (a[lo] < mid)) { - ++lo; - } - while ((hi > lo0) && (a[hi] > mid)) { - --hi; - } - if (lo <= hi) { - sortSwap(a, stuff, lo, hi); - ++lo; - --hi; - } - } - - if (lo0 < hi) - sortSub(a, stuff, lo0, hi); - - if (lo < hi0) - sortSub(a, stuff, lo, hi0); - } -} diff --git a/java/libraries/video/examples/Capture/ColorSorting/Tuple.pde b/java/libraries/video/examples/Capture/ColorSorting/Tuple.pde deleted file mode 100644 index c3d8b5900..000000000 --- a/java/libraries/video/examples/Capture/ColorSorting/Tuple.pde +++ /dev/null @@ -1,29 +0,0 @@ -// Simple vector class that holds an x,y,z position. - -class Tuple { - float x, y, z; - - Tuple() { } - - Tuple(float x, float y, float z) { - set(x, y, z); - } - - void set(float x, float y, float z) { - this.x = x; - this.y = y; - this.z = z; - } - - void target(Tuple another, float amount) { - float amount1 = 1.0 - amount; - x = x*amount1 + another.x*amount; - y = y*amount1 + another.y*amount; - z = z*amount1 + another.z*amount; - } - - void phil() { - fill(x, y, z); - } -} - diff --git a/java/libraries/video/examples/Capture/FrameDifferencing/FrameDifferencing.pde b/java/libraries/video/examples/Capture/FrameDifferencing/FrameDifferencing.pde deleted file mode 100644 index 78869cd6d..000000000 --- a/java/libraries/video/examples/Capture/FrameDifferencing/FrameDifferencing.pde +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Frame Differencing - * by Golan Levin. - * - * Quantify the amount of movement in the video frame using frame-differencing. - */ - - -import processing.video.*; - -int numPixels; -int[] previousFrame; -Capture video; - -void setup() { - size(640, 480); - - // This the default video input, see the GettingStartedCapture - // example if it creates an error - video = new Capture(this, width, height); - - // Start capturing the images from the camera - video.start(); - - numPixels = video.width * video.height; - // Create an array to store the previously captured frame - previousFrame = new int[numPixels]; - loadPixels(); -} - -void draw() { - if (video.available()) { - // When using video to manipulate the screen, use video.available() and - // video.read() inside the draw() method so that it's safe to draw to the screen - video.read(); // Read the new frame from the camera - video.loadPixels(); // Make its pixels[] array available - - int movementSum = 0; // Amount of movement in the frame - for (int i = 0; i < numPixels; i++) { // For each pixel in the video frame... - color currColor = video.pixels[i]; - color prevColor = previousFrame[i]; - // Extract the red, green, and blue components from current pixel - int currR = (currColor >> 16) & 0xFF; // Like red(), but faster - int currG = (currColor >> 8) & 0xFF; - int currB = currColor & 0xFF; - // Extract red, green, and blue components from previous pixel - int prevR = (prevColor >> 16) & 0xFF; - int prevG = (prevColor >> 8) & 0xFF; - int prevB = prevColor & 0xFF; - // Compute the difference of the red, green, and blue values - int diffR = abs(currR - prevR); - int diffG = abs(currG - prevG); - int diffB = abs(currB - prevB); - // Add these differences to the running tally - movementSum += diffR + diffG + diffB; - // Render the difference image to the screen - pixels[i] = color(diffR, diffG, diffB); - // The following line is much faster, but more confusing to read - //pixels[i] = 0xff000000 | (diffR << 16) | (diffG << 8) | diffB; - // Save the current color into the 'previous' buffer - previousFrame[i] = currColor; - } - // To prevent flicker from frames that are all black (no movement), - // only update the screen if the image has changed. - if (movementSum > 0) { - updatePixels(); - println(movementSum); // Print the total amount of movement to the console - } - } -} diff --git a/java/libraries/video/examples/Capture/Framingham/Framingham.pde b/java/libraries/video/examples/Capture/Framingham/Framingham.pde deleted file mode 100644 index 70d775d72..000000000 --- a/java/libraries/video/examples/Capture/Framingham/Framingham.pde +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Framingham - * by Ben Fry. - * - * Show subsequent frames from video input as a grid. Also fun with movie files. - */ - - -import processing.video.*; - -Capture video; -int column; -int columnCount; -int lastRow; - -// Buffer used to move all the pixels up -int[] scoot; - - -void setup() { - size(640, 480); - - // This the default video input, see the GettingStartedCapture - // example if it creates an error - video = new Capture(this, 160, 120); - - // Start capturing the images from the camera - video.start(); - - column = 0; - columnCount = width / video.width; - int rowCount = height / video.height; - lastRow = rowCount - 1; - - scoot = new int[lastRow*video.height * width]; - background(0); -} - - -void draw() { - // By using video.available, only the frame rate need be set inside setup() - if (video.available()) { - video.read(); - video.loadPixels(); - image(video, video.width*column, video.height*lastRow); - column++; - if (column == columnCount) { - loadPixels(); - - // Scoot everybody up one row - arrayCopy(pixels, video.height*width, scoot, 0, scoot.length); - arrayCopy(scoot, 0, pixels, 0, scoot.length); - - // Set the moved row to black - for (int i = scoot.length; i < width*height; i++) { - pixels[i] = #000000; - } - column = 0; - updatePixels(); - } - } -} diff --git a/java/libraries/video/examples/Capture/GettingStartedCapture/GettingStartedCapture.pde b/java/libraries/video/examples/Capture/GettingStartedCapture/GettingStartedCapture.pde deleted file mode 100644 index 517ba8786..000000000 --- a/java/libraries/video/examples/Capture/GettingStartedCapture/GettingStartedCapture.pde +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Getting Started with Capture. - * - * Reading and displaying an image from an attached Capture device. - */ - -import processing.video.*; - -Capture cam; - -void setup() { - size(640, 480); - - String[] cameras = Capture.list(); - - if (cameras == null) { - println("Failed to retrieve the list of available cameras, will try the default..."); - cam = new Capture(this, 640, 480); - } if (cameras.length == 0) { - println("There are no cameras available for capture."); - exit(); - } else { - println("Available cameras:"); - for (int i = 0; i < cameras.length; i++) { - println(cameras[i]); - } - - // The camera can be initialized directly using an element - // from the array returned by list(): - cam = new Capture(this, cameras[0]); - // Or, the settings can be defined based on the text in the list - //cam = new Capture(this, 640, 480, "Built-in iSight", 30); - - // Start capturing the images from the camera - cam.start(); - } -} - -void draw() { - if (cam.available() == true) { - cam.read(); - } - image(cam, 0, 0); - // The following does the same as the above image() line, but - // is faster when just drawing the image without any additional - // resizing, transformations, or tint. - //set(0, 0, cam); -} - diff --git a/java/libraries/video/examples/Capture/HsvSpace/HsvSpace.pde b/java/libraries/video/examples/Capture/HsvSpace/HsvSpace.pde deleted file mode 100644 index c77208410..000000000 --- a/java/libraries/video/examples/Capture/HsvSpace/HsvSpace.pde +++ /dev/null @@ -1,213 +0,0 @@ -/** - * HSV Space - * by Ben Fry. - * - * Arrange the pixels from live video into the HSV Color Cone. - */ - -import processing.video.*; -import java.awt.Color; - -Capture video; -int count; -boolean cheatScreen = true; - -static final float BOX_SIZE = 0.75; -static final float CONE_HEIGHT = 1.2; -static final float MAX_RADIUS = 10; -static final float ROT_INCREMENT = 3.0; -static final float TRANS_INCREMENT = 1; -static final float STEP_AMOUNT = 0.1; - -Tuple[] farbe; -Tuple[] trans; - -float[] hsb = new float[3]; - -float leftRightAngle; -float upDownAngle; -float fwdBackTrans; -float upDownTrans; -float leftRightTrans; -boolean motion; - -boolean blobby = false; - - -void setup() { - size(640, 480, P3D); - - // This the default video input, see the GettingStartedCapture - // example if it creates an error - video = new Capture(this, 160, 120); - - // Start capturing the images from the camera - video.start(); - - count = video.width * video.height; - - sphereDetail(60); - - upDownTrans = 0; - leftRightTrans = 0; - motion = false; - - leftRightAngle = 101.501297; - upDownAngle = -180.098694; - fwdBackTrans = 14.800003; - - farbe = new Tuple[count]; - trans = new Tuple[count]; - for (int i = 0; i < count; i++) { - farbe[i] = new Tuple(); - trans[i] = new Tuple(); - } -} - - -void draw() { - background(0); - - if (!blobby) { - lights(); - } - - pushMatrix(); - translate(width/2, height/2); - scale(min(width, height) / 10.0); - - translate(0, 0, -20 + fwdBackTrans); - rotateY(radians(36 + leftRightAngle)); //, 0, 1, 0); - rotateX(radians(-228 + upDownAngle)); //, 1, 0, 0); - - strokeWeight(0.1); - if (blobby) { - stroke(0.35, 0.35, 0.25, 0.15); - wireCone(MAX_RADIUS, MAX_RADIUS * CONE_HEIGHT, 18, 18); - } - else { - stroke(0.35, 0.35, 0.25, 0.25); - wireCone(MAX_RADIUS, MAX_RADIUS * CONE_HEIGHT, 180, 18); - } - - noStroke(); - video.loadPixels(); - for (int i = 0; i < count; i++) { - int pixelColor = video.pixels[i]; - int r = (pixelColor >> 16) & 0xff; - int g = (pixelColor >> 8) & 0xff; - int b = pixelColor & 0xff; - Color.RGBtoHSB(r, g, b, hsb); - - float radius = hsb[1] * hsb[2]; - float angle = hsb[0] * 360.0 * DEG_TO_RAD; - float nx = MAX_RADIUS * radius * cos(angle); - float ny = MAX_RADIUS * radius * sin(angle); - float nz = hsb[2] * MAX_RADIUS * CONE_HEIGHT; - - trans[i].set(trans[i].x - (trans[i].x - nx)*STEP_AMOUNT, - trans[i].y - (trans[i].y - ny)*STEP_AMOUNT, - trans[i].z - (trans[i].z - nz)*STEP_AMOUNT); - - farbe[i].set(farbe[i].x - (farbe[i].x - r)*STEP_AMOUNT, - farbe[i].y - (farbe[i].y - g)*STEP_AMOUNT, - farbe[i].z - (farbe[i].z - b)*STEP_AMOUNT); - - pushMatrix(); - farbe[i].phil(); - trans[i].tran(); - - rotate(radians(45), 1, 1, 0); - if (blobby) { - sphere(BOX_SIZE * 2); //, 20, 20); - } else { - box(BOX_SIZE); - } - - popMatrix(); - } - popMatrix(); - - if (motion) { - upDownAngle--; - leftRightAngle--; - } - - if (cheatScreen) { - image(video, 0, height - video.height); - } -} - - -void captureEvent(Capture c) { - c.read(); -} - - -void keyPressed() { - switch (key) { - case 'g': - saveFrame(); - break; - case 'c': - cheatScreen = !cheatScreen; - break; - - case 'm': - motion = !motion; - break; - case '=': - fwdBackTrans += TRANS_INCREMENT; - break; - case '-': - fwdBackTrans -= TRANS_INCREMENT; - break; - case 'b': - blobby = !blobby; - break; - } -} - - -void mouseDragged() { - float dX, dY; - - switch (mouseButton) { - case LEFT: // left right up down - dX = pmouseX - mouseX; - dY = pmouseY - mouseY; - leftRightAngle -= dX * 0.2; - upDownAngle += dY * 0.4; - break; - - case CENTER: - dX = pmouseX - mouseX; - dY = pmouseY - mouseY; - leftRightTrans -= TRANS_INCREMENT * dX; - upDownTrans -= TRANS_INCREMENT * dY; - break; - - case RIGHT: // in and out - dY = (float) (pmouseY - mouseY); - fwdBackTrans -= TRANS_INCREMENT * dY; - break; - } -} - - -void wireCone(float radius, float height, int stepX, int stepY) { - int steps = 10; - stroke(40); - for (int i = 0; i < steps; i++) { - float angle = map(i, 0, steps, 0, TWO_PI); - float x = radius * cos(angle); - float y = radius * sin(angle); - line(x, y, height, 0, 0, 0); - } - noFill(); - pushMatrix(); - translate(0, 0, height); - ellipseMode(CENTER); - ellipse(0, 0, radius, radius); - popMatrix(); -} diff --git a/java/libraries/video/examples/Capture/HsvSpace/Tuple.pde b/java/libraries/video/examples/Capture/HsvSpace/Tuple.pde deleted file mode 100644 index 19c1507aa..000000000 --- a/java/libraries/video/examples/Capture/HsvSpace/Tuple.pde +++ /dev/null @@ -1,33 +0,0 @@ -// Simple vector class that holds an x,y,z position. - -class Tuple { - float x, y, z; - - Tuple() { } - - Tuple(float x, float y, float z) { - set(x, y, z); - } - - void set(float x, float y, float z) { - this.x = x; - this.y = y; - this.z = z; - } - - void target(Tuple another, float amount) { - float amount1 = 1.0 - amount; - x = x*amount1 + another.x*amount; - y = y*amount1 + another.y*amount; - z = z*amount1 + another.z*amount; - } - - void phil() { - fill(x, y, z); - } - - void tran() { - translate(x, y, z); - } -} - diff --git a/java/libraries/video/examples/Capture/LivePocky/LivePocky.pde b/java/libraries/video/examples/Capture/LivePocky/LivePocky.pde deleted file mode 100644 index 64b4b6db5..000000000 --- a/java/libraries/video/examples/Capture/LivePocky/LivePocky.pde +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Live Pocky - * by Ben Fry. - * - * Unwrap each frame of live video into a single line of pixels. - */ - -import processing.video.*; - -Capture video; -int count; -int writeRow; -int maxRows; -int topRow; -int buffer[]; - - -void setup() { - size(600, 400); - - // This the default video input, see the GettingStartedCapture - // example if it creates an error - video = new Capture(this, 320, 240); - - // Start capturing the images from the camera - video.start(); - - maxRows = height * 2; - buffer = new int[width * maxRows]; - writeRow = height - 1; - topRow = 0; - - background(0); - loadPixels(); -} - - -void draw() { - video.loadPixels(); - arraycopy(video.pixels, 0, buffer, writeRow * width, width); - writeRow++; - if (writeRow == maxRows) { - writeRow = 0; - } - topRow++; - - for (int y = 0; y < height; y++) { - int row = (topRow + y) % maxRows; - arraycopy(buffer, row * width, g.pixels, y*width, width); - } - updatePixels(); -} - - -void captureEvent(Capture c) { - c.read(); -} diff --git a/java/libraries/video/examples/Capture/Mirror/Mirror.pde b/java/libraries/video/examples/Capture/Mirror/Mirror.pde deleted file mode 100644 index 0c527c802..000000000 --- a/java/libraries/video/examples/Capture/Mirror/Mirror.pde +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Mirror - * by Daniel Shiffman. - * - * Each pixel from the video source is drawn as a rectangle with rotation based on brightness. - */ - -import processing.video.*; - - -// Size of each cell in the grid -int cellSize = 20; -// Number of columns and rows in our system -int cols, rows; -// Variable for capture device -Capture video; - - -void setup() { - size(640, 480); - frameRate(30); - cols = width / cellSize; - rows = height / cellSize; - colorMode(RGB, 255, 255, 255, 100); - - // This the default video input, see the GettingStartedCapture - // example if it creates an error - video = new Capture(this, width, height); - - // Start capturing the images from the camera - video.start(); - - background(0); -} - - -void draw() { - if (video.available()) { - video.read(); - video.loadPixels(); - - // Begin loop for columns - for (int i = 0; i < cols; i++) { - // Begin loop for rows - for (int j = 0; j < rows; j++) { - - // Where are we, pixel-wise? - int x = i*cellSize; - int y = j*cellSize; - int loc = (video.width - x - 1) + y*video.width; // Reversing x to mirror the image - - float r = red(video.pixels[loc]); - float g = green(video.pixels[loc]); - float b = blue(video.pixels[loc]); - // Make a new color with an alpha component - color c = color(r, g, b, 75); - - // Code for drawing a single rect - // Using translate in order for rotation to work properly - pushMatrix(); - translate(x+cellSize/2, y+cellSize/2); - // Rotation formula based on brightness - rotate((2 * PI * brightness(c) / 255.0)); - rectMode(CENTER); - fill(c); - noStroke(); - // Rects are larger than the cell for some overlap - rect(0, 0, cellSize+6, cellSize+6); - popMatrix(); - } - } - } -} diff --git a/java/libraries/video/examples/Capture/Mirror2/Mirror2.pde b/java/libraries/video/examples/Capture/Mirror2/Mirror2.pde deleted file mode 100644 index 242e55a10..000000000 --- a/java/libraries/video/examples/Capture/Mirror2/Mirror2.pde +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Mirror 2 - * by Daniel Shiffman. - * - * Each pixel from the video source is drawn as a rectangle with size based on brightness. - */ - -import processing.video.*; - -// Size of each cell in the grid -int cellSize = 15; -// Number of columns and rows in our system -int cols, rows; -// Variable for capture device -Capture video; - - -void setup() { - size(640, 480); - // Set up columns and rows - cols = width / cellSize; - rows = height / cellSize; - colorMode(RGB, 255, 255, 255, 100); - rectMode(CENTER); - - // This the default video input, see the GettingStartedCapture - // example if it creates an error - video = new Capture(this, width, height); - - // Start capturing the images from the camera - video.start(); - - background(0); -} - - -void draw() { - if (video.available()) { - video.read(); - video.loadPixels(); - - background(0, 0, 255); - - // Begin loop for columns - for (int i = 0; i < cols;i++) { - // Begin loop for rows - for (int j = 0; j < rows;j++) { - - // Where are we, pixel-wise? - int x = i * cellSize; - int y = j * cellSize; - int loc = (video.width - x - 1) + y*video.width; // Reversing x to mirror the image - - // Each rect is colored white with a size determined by brightness - color c = video.pixels[loc]; - float sz = (brightness(c) / 255.0) * cellSize; - fill(255); - noStroke(); - rect(x + cellSize/2, y + cellSize/2, sz, sz); - } - } - } -} diff --git a/java/libraries/video/examples/Capture/RadialPocky/RadialPocky.pde b/java/libraries/video/examples/Capture/RadialPocky/RadialPocky.pde deleted file mode 100644 index ed4ca728c..000000000 --- a/java/libraries/video/examples/Capture/RadialPocky/RadialPocky.pde +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Radial Pocky - * by Ben Fry. - * - * Unwrap each frame of live video into a single line of pixels along a circle - */ - -import processing.video.*; - -Capture video; -int videoCount; -int currentAngle; -int pixelCount; -int angleCount = 200; // how many divisions - -int radii[]; -int angles[]; - - -void setup() { - // size must be set to video.width*video.height*2 in both directions - size(600, 600); - - // This the default video input, see the GettingStartedCapture - // example if it creates an error - video = new Capture(this, 160, 120); - - // Start capturing the images from the camera - video.start(); - - videoCount = video.width * video.height; - - pixelCount = width*height; - int centerX = width / 2; - int centerY = height / 2; - radii = new int[pixelCount]; - angles = new int[pixelCount]; - - int offset = 0; - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - int dx = centerX - x; - int dy = centerY - y; - - float angle = atan2(dy, dx); - if (angle < 0) angle += TWO_PI; - angles[offset] = (int) (angleCount * (angle / TWO_PI)); - - int radius = (int) mag(dx, dy); - if (radius >= videoCount) { - radius = -1; - angles[offset] = -1; - } - radii[offset] = radius; - - offset++; - } - } - background(0); -} - - -void draw() { - if (video.available()) { - video.read(); - video.loadPixels(); - - loadPixels(); - for (int i = 0; i < pixelCount; i++) { - if (angles[i] == currentAngle) { - pixels[i] = video.pixels[radii[i]]; - } - } - updatePixels(); - - currentAngle++; - if (currentAngle == angleCount) { - currentAngle = 0; - } - } -} diff --git a/java/libraries/video/examples/Capture/SlitScan/SlitScan.pde b/java/libraries/video/examples/Capture/SlitScan/SlitScan.pde deleted file mode 100644 index 8f4e06a02..000000000 --- a/java/libraries/video/examples/Capture/SlitScan/SlitScan.pde +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Simple Real-Time Slit-Scan Program. - * By Golan Levin. - * - * This demonstration depends on the canvas height being equal - * to the video capture height. If you would prefer otherwise, - * consider using the image copy() function rather than the - * direct pixel-accessing approach I have used here. - */ - - -import processing.video.*; - -Capture video; - -int videoSliceX; -int drawPositionX; - -void setup() { - size(600, 240); - - // This the default video input, see the GettingStartedCapture - // example if it creates an error - video = new Capture(this,320, 240); - - // Start capturing the images from the camera - video.start(); - - videoSliceX = video.width / 2; - drawPositionX = width - 1; - background(0); -} - - -void draw() { - if (video.available()) { - video.read(); - video.loadPixels(); - - // Copy a column of pixels from the middle of the video - // To a location moving slowly across the canvas. - loadPixels(); - for (int y = 0; y < video.height; y++){ - int setPixelIndex = y*width + drawPositionX; - int getPixelIndex = y*video.width + videoSliceX; - pixels[setPixelIndex] = video.pixels[getPixelIndex]; - } - updatePixels(); - - drawPositionX--; - // Wrap the position back to the beginning if necessary. - if (drawPositionX < 0) { - drawPositionX = width - 1; - } - } -} diff --git a/java/libraries/video/examples/Capture/Spatiotemporal/Spatiotemporal.pde b/java/libraries/video/examples/Capture/Spatiotemporal/Spatiotemporal.pde deleted file mode 100644 index 24a1a83d4..000000000 --- a/java/libraries/video/examples/Capture/Spatiotemporal/Spatiotemporal.pde +++ /dev/null @@ -1,131 +0,0 @@ -/** - * Spatiotemporal - * by David Muth - * - * Records a number of video frames into memory, then plays back the video - * buffer by turning the time axis into the x-axis and vice versa - */ - -import processing.video.*; - -Capture video; -int signal = 0; - -//the buffer for storing video frames -ArrayList frames; - -//different program modes for recording and playback -int mode = 0; -int MODE_NEWBUFFER = 0; -int MODE_RECORDING = 1; -int MODE_PLAYBACK = 2; - -int currentX = 0; - -void setup() { - size(640, 480); - - // This the default video input, see the GettingStartedCapture - // example if it creates an error - video = new Capture(this, width, height); - - // Start capturing the images from the camera - video.start(); -} - -void captureEvent(Capture c) { - c.read(); - - //create a new buffer in case one is needed - if (mode == MODE_NEWBUFFER) { - frames = new ArrayList(); - mode = MODE_RECORDING; - } - - //record into the buffer until there are enough frames - if (mode == MODE_RECORDING) { - //copy the current video frame into an image, so it can be stored in the buffer - PImage img = createImage(width, height, RGB); - video.loadPixels(); - arrayCopy(video.pixels, img.pixels); - - frames.add(img); - - //in case enough frames have been recorded, switch to playback mode - if (frames.size() >= width) { - mode = MODE_PLAYBACK; - } - } -} - -void draw() { - loadPixels(); - - //code for the recording mode - if (mode == MODE_RECORDING) { - //set the image counter to 0 - int currentImage = 0; - - //begin a loop for displaying pixel columns - for (int x = 0; x < video.width; x++) { - //go through the frame buffer and pick an image using the image counter - if (currentImage < frames.size()) { - PImage img = (PImage)frames.get(currentImage); - - //display a pixel column of the current image - if (img != null) { - img.loadPixels(); - - for (int y = 0; y < video.height; y++) { - pixels[x + y * width] = img.pixels[x + y * video.width]; - } - } - - //increase the image counter - currentImage++; - - } - else { - break; - } - } - } - - //code for displaying the spatiotemporal transformation - if (mode == MODE_PLAYBACK) { - - //begin a loop for displaying pixel columns - for (int x = 0; x < video.width; x++) { - //get an image from the buffer using loopcounter x as the index - PImage img = (PImage)frames.get(x); - - if (img != null) { - img.loadPixels(); - - //pick the same column from each image for display, - //then distribute the columns over the x-axis on the screen - for(int y = 0; y < video.height; y++) { - pixels[x + y * width] = img.pixels[currentX + y * video.width]; - } - } - } - - //a different column shall be used next time draw() is being called - currentX++; - - //if the end of the buffer is reached - if(currentX >= video.width) { - //create a new buffer when the next video frame arrives - mode = MODE_NEWBUFFER; - //reset the column counter - currentX = 0; - } - } - - updatePixels(); -} - - - - - diff --git a/java/libraries/video/examples/Capture/TimeDisplacement/TimeDisplacement.pde b/java/libraries/video/examples/Capture/TimeDisplacement/TimeDisplacement.pde deleted file mode 100644 index 460f8adcf..000000000 --- a/java/libraries/video/examples/Capture/TimeDisplacement/TimeDisplacement.pde +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Time Displacement - * by David Muth - * - * Keeps a buffer of video frames in memory and displays pixel rows - * taken from consecutive frames distributed over the y-axis - */ - -import processing.video.*; - -Capture video; -int signal = 0; - -//the buffer for storing video frames -ArrayList frames = new ArrayList(); - -void setup() { - size(640, 480); - - // This the default video input, see the GettingStartedCapture - // example if it creates an error - video = new Capture(this, width, height); - - // Start capturing the images from the camera - video.start(); -} - -void captureEvent(Capture camera) { - camera.read(); - - // Copy the current video frame into an image, so it can be stored in the buffer - PImage img = createImage(width, height, RGB); - video.loadPixels(); - arrayCopy(video.pixels, img.pixels); - - frames.add(img); - - // Once there are enough frames, remove the oldest one when adding a new one - if (frames.size() > height/4) { - frames.remove(0); - } -} - -void draw() { - // Set the image counter to 0 - int currentImage = 0; - - loadPixels(); - - // Begin a loop for displaying pixel rows of 4 pixels height - for (int y = 0; y < video.height; y+=4) { - // Go through the frame buffer and pick an image, starting with the oldest one - if (currentImage < frames.size()) { - PImage img = (PImage)frames.get(currentImage); - - if (img != null) { - img.loadPixels(); - - // Put 4 rows of pixels on the screen - for (int x = 0; x < video.width; x++) { - pixels[x + y * width] = img.pixels[x + y * video.width]; - pixels[x + (y + 1) * width] = img.pixels[x + (y + 1) * video.width]; - pixels[x + (y + 2) * width] = img.pixels[x + (y + 2) * video.width]; - pixels[x + (y + 3) * width] = img.pixels[x + (y + 3) * video.width]; - } - } - - // Increase the image counter - currentImage++; - - } else { - break; - } - } - - updatePixels(); - - // For recording an image sequence - //saveFrame("frame-####.jpg"); -} - - - - diff --git a/java/libraries/video/examples/Movie/Frames/Frames.pde b/java/libraries/video/examples/Movie/Frames/Frames.pde deleted file mode 100644 index 04fbf81fb..000000000 --- a/java/libraries/video/examples/Movie/Frames/Frames.pde +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Frames - * by Andres Colubri. - * - * Moves through the video one frame at the time by using the - * arrow keys. It estimates the frame counts using the framerate - * of the movie file, so it might not be exact in some cases. - */ - -import processing.video.*; - -Movie mov; -int newFrame = 0; -int movFrameRate = 30; - -void setup() { - size(640, 360); - background(0); - // Load and set the video to play. Setting the video - // in play mode is needed so at least one frame is read - // and we can get duration, size and other information from - // the video stream. - mov = new Movie(this, "transit.mov"); - - // Pausing the video at the first frame. - mov.play(); - mov.jump(0); - mov.pause(); -} - -void movieEvent(Movie m) { - m.read(); -} - -void draw() { - background(0); - image(mov, 0, 0, width, height); - fill(255); - text(getFrame() + " / " + (getLength() - 1), 10, 30); -} - -void keyPressed() { - if (key == CODED) { - if (keyCode == LEFT) { - if (0 < newFrame) newFrame--; - } else if (keyCode == RIGHT) { - if (newFrame < getLength() - 1) newFrame++; - } - } - setFrame(newFrame); -} - -int getFrame() { - return ceil(mov.time() * 30) - 1; -} - -void setFrame(int n) { - mov.play(); - - // The duration of a single frame: - float frameDuration = 1.0 / movFrameRate; - - // We move to the middle of the frame by adding 0.5: - float where = (n + 0.5) * frameDuration; - - // Taking into account border effects: - float diff = mov.duration() - where; - if (diff < 0) { - where += diff - 0.25 * frameDuration; - } - - mov.jump(where); - mov.pause(); -} - -int getLength() { - return int(mov.duration() * movFrameRate); -} - diff --git a/java/libraries/video/examples/Movie/Loop/Loop.pde b/java/libraries/video/examples/Movie/Loop/Loop.pde deleted file mode 100644 index 05383b620..000000000 --- a/java/libraries/video/examples/Movie/Loop/Loop.pde +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Loop. - * - * Shows how to load and play a QuickTime movie file. - * - */ - -import processing.video.*; - -Movie movie; - -void setup() { - size(640, 360); - background(0); - // Load and play the video in a loop - movie = new Movie(this, "transit.mov"); - movie.loop(); -} - -void movieEvent(Movie m) { - m.read(); -} - -void draw() { - //if (movie.available() == true) { - // movie.read(); - //} - image(movie, 0, 0, width, height); -} diff --git a/java/libraries/video/examples/Movie/Pixelate/Pixelate.pde b/java/libraries/video/examples/Movie/Pixelate/Pixelate.pde deleted file mode 100644 index 1ac791581..000000000 --- a/java/libraries/video/examples/Movie/Pixelate/Pixelate.pde +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Pixelate - * by Hernando Barragan. - * - * Load a QuickTime file and display the video signal - * using rectangles as pixels by reading the values stored - * in the current video frame pixels array. - */ - -import processing.video.*; - -int numPixelsWide, numPixelsHigh; -int blockSize = 10; -Movie mov; -color movColors[]; - -void setup() { - size(640, 360); - noStroke(); - mov = new Movie(this, "transit.mov"); - mov.loop(); - numPixelsWide = width / blockSize; - numPixelsHigh = height / blockSize; - println(numPixelsWide); - movColors = new color[numPixelsWide * numPixelsHigh]; -} - -// Display values from movie -void draw() { - if (mov.available() == true) { - mov.read(); - mov.loadPixels(); - int count = 0; - for (int j = 0; j < numPixelsHigh; j++) { - for (int i = 0; i < numPixelsWide; i++) { - movColors[count] = mov.get(i*blockSize, j*blockSize); - count++; - } - } - } - - background(255); - for (int j = 0; j < numPixelsHigh; j++) { - for (int i = 0; i < numPixelsWide; i++) { - fill(movColors[j*numPixelsWide + i]); - rect(i*blockSize, j*blockSize, blockSize, blockSize); - } - } - -} - diff --git a/java/libraries/video/examples/Movie/Reverse/Reverse.pde b/java/libraries/video/examples/Movie/Reverse/Reverse.pde deleted file mode 100644 index 817368aa8..000000000 --- a/java/libraries/video/examples/Movie/Reverse/Reverse.pde +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Reverse playback example. - * - * The Movie.speed() method allows to change the playback speed. - * Use negative values for backwards playback. Note that not all - * video formats support backwards playback. This depends on the - * underlying gstreamer plugins used by gsvideo. For example, the - * theora codec does support backward playback, but not so the H264 - * codec, at least in its current version. - * - */ - -import processing.video.*; - -Movie mov; -boolean speedSet = false; -boolean once = true; - -void setup() { - size(640, 360); - background(0); - mov = new Movie(this, "transit.mkv"); - mov.play(); -} - -void movieEvent(Movie m) { - m.read(); - if (speedSet == true) { - speedSet = false; - } -} - -void draw() { - if (speedSet == false && once == true) { - // Setting the speed should be done only once, - // this is the reason for the if statement. - speedSet = true; - once = false; - mov.jump(mov.duration()); - // -1 means backward playback at normal speed. - mov.speed(-1.0); - // Setting to play again, since the movie stop - // playback once it reached the end. - mov.play(); - } - image(mov, 0, 0, width, height); -} - diff --git a/java/libraries/video/examples/Movie/Scratch/Scratch.pde b/java/libraries/video/examples/Movie/Scratch/Scratch.pde deleted file mode 100644 index dbd9fdcec..000000000 --- a/java/libraries/video/examples/Movie/Scratch/Scratch.pde +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Scratch - * by Andres Colubri. - * - * Move the cursor horizontally across the screen to set - * the position in the movie file. - */ - -import processing.video.*; - -Movie mov; - -void setup() { - size(640, 360); - background(0); - - mov = new Movie(this, "transit.mov"); - - // Pausing the video at the first frame. - mov.play(); - mov.jump(0); - mov.pause(); -} - -void draw() { - - if (mov.available()) { - mov.read(); - // A new time position is calculated using the current mouse location: - float f = map(mouseX, 0, width, 0, 1); - float t = mov.duration() * f; - mov.play(); - mov.jump(t); - mov.pause(); - } - - image(mov, 0, 0); -} - diff --git a/java/libraries/video/examples/Movie/Speed/Speed.pde b/java/libraries/video/examples/Movie/Speed/Speed.pde deleted file mode 100644 index c08137651..000000000 --- a/java/libraries/video/examples/Movie/Speed/Speed.pde +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Speed. - * - * Use the Movie.speed() method to change - * the playback speed. - * - */ - -import processing.video.*; - -Movie mov; - -void setup() { - size(640, 360); - background(0); - mov = new Movie(this, "transit.mov"); - mov.loop(); -} - -void movieEvent(Movie movie) { - mov.read(); -} - -void draw() { - image(mov, 0, 0); - - float newSpeed = map(mouseX, 0, width, 0.1, 2); - mov.speed(newSpeed); - - fill(255); - text(nfc(newSpeed, 2) + "X", 10, 30); -} - diff --git a/java/libraries/video/library/.gitignore b/java/libraries/video/library/.gitignore deleted file mode 100644 index 374cc6ccf..000000000 --- a/java/libraries/video/library/.gitignore +++ /dev/null @@ -1 +0,0 @@ -video.jar diff --git a/java/libraries/video/library/export.txt b/java/libraries/video/library/export.txt deleted file mode 100644 index 189254a96..000000000 --- a/java/libraries/video/library/export.txt +++ /dev/null @@ -1 +0,0 @@ -name = Video diff --git a/java/libraries/video/src/processing/video/Capture.java b/java/libraries/video/src/processing/video/Capture.java deleted file mode 100644 index 5d4221fb5..000000000 --- a/java/libraries/video/src/processing/video/Capture.java +++ /dev/null @@ -1,1227 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2004-12 Ben Fry and Casey Reas - The previous version of this code was developed by Hernando Barragan - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.video; - -import processing.core.*; - -import java.nio.*; -import java.util.ArrayList; -import java.io.File; -import java.lang.reflect.*; - -import org.gstreamer.*; -import org.gstreamer.Buffer; -import org.gstreamer.elements.*; -import org.gstreamer.interfaces.PropertyProbe; -import org.gstreamer.interfaces.Property; - -/** - * ( begin auto-generated from Capture.xml ) - * - * Datatype for storing and manipulating video frames from an attached - * capture device such as a camera. Use Capture.list() to show the - * names of any attached devices. Using the version of the constructor - * without name will attempt to use the last device used by a - * QuickTime program. - * - * ( end auto-generated ) - * - *

Advanced

- * Class for storing and manipulating video frames from an attached capture - * device such as a camera. - * @webref video - * @usage application - */ -public class Capture extends PImage implements PConstants { - protected static String sourceElementName; - protected static String devicePropertyName; - protected static String indexPropertyName; - // Default gstreamer capture plugin for each platform, and property names. - static { - if (PApplet.platform == MACOSX) { - sourceElementName = "qtkitvideosrc"; - devicePropertyName = "device-name"; - indexPropertyName = "device-index"; - } else if (PApplet.platform == WINDOWS) { - sourceElementName = "ksvideosrc"; - devicePropertyName = "device-name"; - indexPropertyName = "device-index"; - } else if (PApplet.platform == LINUX) { - sourceElementName = "v4l2src"; - // The "device" property in v4l2src expects the device location - // (/dev/video0, etc). v4l2src has "device-name", which requires the - // human-readable name... but how to query in linux?. - devicePropertyName = "device"; - indexPropertyName = "device-fd"; - } else {} - } - protected static boolean useResMacHack = true; - - public float frameRate; - public Pipeline pipeline; - - protected boolean capturing = false; - - protected String frameRateString; - protected int bufWidth; - protected int bufHeight; - - protected String sourceName; - protected Element sourceElement; - - protected Method captureEventMethod; - protected Object eventHandler; - - protected boolean available; - protected boolean pipelineReady; - protected boolean newFrame; - - protected RGBDataAppSink rgbSink = null; - protected int[] copyPixels = null; - - protected boolean firstFrame = true; - - protected int reqWidth; - protected int reqHeight; - - protected boolean useBufferSink = false; - protected boolean outdatedPixels = true; - protected Object bufferSink; - protected Method sinkCopyMethod; - protected Method sinkSetMethod; - protected Method sinkDisposeMethod; - protected Method sinkGetMethod; - protected String copyMask; - protected Buffer natBuffer = null; - protected BufferDataAppSink natSink = null; - - - public Capture(PApplet parent) { - String[] configs = Capture.list(); - if (configs.length == 0) { - throw new RuntimeException("There are no cameras available for capture"); - } - String name = getName(configs[0]); - int[] size = getSize(configs[0]); - String fps = getFrameRate(configs[0]); - String idName; - Object idValue; - if (devicePropertyName.equals("")) { - // For plugins without device name property, the name is casted - // as an index - idName = indexPropertyName; - idValue = new Integer(PApplet.parseInt(name)); - } else { - idName = devicePropertyName; - idValue = name; - } - initGStreamer(parent, size[0], size[1], sourceElementName, - idName, idValue, fps); - } - - - public Capture(PApplet parent, String requestConfig) { - String name = getName(requestConfig); - int[] size = getSize(requestConfig); - String fps = getFrameRate(requestConfig); - String idName; - Object idValue; - if (devicePropertyName.equals("")) { - // For plugins without device name property, the name is casted - // as an index - idName = indexPropertyName; - idValue = new Integer(PApplet.parseInt(name)); - } else { - idName = devicePropertyName; - idValue = name; - } - initGStreamer(parent, size[0], size[1], sourceElementName, - idName, idValue, fps); - } - - - /** - * @param parent typically use "this" - * @param requestWidth width of the frame - * @param requestHeight height of the frame - */ - public Capture(PApplet parent, int requestWidth, int requestHeight) { - super(requestWidth, requestHeight, RGB); - initGStreamer(parent, requestWidth, requestHeight, sourceElementName, - null, null, ""); - } - - - /** - *

Advanced

- * Constructor that takes resolution and framerate. - * - * @param frameRate number of frames to read per second - */ - public Capture(PApplet parent, int requestWidth, int requestHeight, - int frameRate) { - super(requestWidth, requestHeight, RGB); - initGStreamer(parent, requestWidth, requestHeight, sourceElementName, - null, null, frameRate + "/1"); - } - - - /** - *

Advanced

- * This constructor allows to specify resolution and camera name. - * - * @param cameraName name of the camera - */ - public Capture(PApplet parent, int requestWidth, int requestHeight, - String cameraName) { - super(requestWidth, requestHeight, RGB); - String idName; - Object idValue; - if (devicePropertyName.equals("")) { - // For plugins without device name property, the name is casted - // as an index - idName = indexPropertyName; - idValue = new Integer(PApplet.parseInt(cameraName)); - } else { - idName = devicePropertyName; - idValue = cameraName; - } - initGStreamer(parent, requestWidth, requestHeight, sourceElementName, - idName, idValue, ""); - } - - - /** - *

Advanced

- * This constructor allows to specify the camera name and the desired - * framerate, in addition to the resolution. - */ - public Capture(PApplet parent, int requestWidth, int requestHeight, - String cameraName, int frameRate) { - super(requestWidth, requestHeight, RGB); - String idName; - Object idValue; - if (devicePropertyName.equals("")) { - // For plugins without device name property, the name is casted - // as an index - idName = indexPropertyName; - idValue = new Integer(PApplet.parseInt(cameraName)); - } else { - idName = devicePropertyName; - idValue = cameraName; - } - initGStreamer(parent, requestWidth, requestHeight, sourceElementName, - idName, idValue, frameRate + "/1"); - } - - - /** - * Disposes all the native resources associated to this capture device. - * - * NOTE: This is not official API and may/will be removed at any time. - */ - public void dispose() { - if (pipeline != null) { - try { - if (pipeline.isPlaying()) { - pipeline.stop(); - pipeline.getState(); - } - } catch (Exception e) { - e.printStackTrace(); - } - - pixels = null; - - copyPixels = null; - if (rgbSink != null) { - rgbSink.removeListener(); - rgbSink.dispose(); - rgbSink = null; - } - - natBuffer = null; - if (natSink != null) { - natSink.removeListener(); - natSink.dispose(); - natSink = null; - } - - pipeline.dispose(); - pipeline = null; - - parent.g.removeCache(this); - parent.unregisterMethod("dispose", this); - parent.unregisterMethod("post", this); - } - } - - - /** - * Finalizer of the class. - */ - protected void finalize() throws Throwable { - try { - dispose(); - } finally { - super.finalize(); - } - } - - - /** - * ( begin auto-generated from Capture_available.xml ) - * - * Returns "true" when a new video frame is available to read. - * - * ( end auto-generated ) - * - * @webref capture - * @brief Returns "true" when a new video frame is available to read - */ - public boolean available() { - return available; - } - - - /** - * ( begin auto-generated from Capture_start.xml ) - * - * Starts capturing frames from the selected device. - * - * ( end auto-generated ) - * - * @webref capture - * @brief Starts capturing frames from the selected device - */ - public void start() { - boolean init = false; - if (!pipelineReady) { - initPipeline(); - init = true; - } - - capturing = true; - pipeline.play(); - - if (init) { - checkResIsValid(); - } - } - - - /** - * ( begin auto-generated from Capture_stop.xml ) - * - * Stops capturing frames from an attached device. - * - * ( end auto-generated ) - * - * @webref capture - * @brief Stops capturing frames from an attached device - */ - public void stop() { - if (!pipelineReady) { - initPipeline(); - } - - capturing = false; - pipeline.stop(); - pipeline.getState(); - } - - - /** - * ( begin auto-generated from Capture_read.xml ) - * - * Reads the current video frame. - * - * ( end auto-generated ) - * - *

Advanced

- * This method() and invokeEvent() are now synchronized, so that invokeEvent() - * can't be called whilst we're busy reading. Problematic frame error - * fixed by Charl P. Botha - * - * @webref capture - * @brief Reads the current video frame - */ - public synchronized void read() { - if (frameRate < 0) { - // Framerate not set yet, so we obtain from stream, - // which is already playing since we are in read(). - frameRate = getSourceFrameRate(); - } - - if (useBufferSink) { // The native buffer from gstreamer is copied to the buffer sink. - outdatedPixels = true; - if (natBuffer == null) { - return; - } - - if (firstFrame) { - super.init(bufWidth, bufHeight, ARGB); - firstFrame = false; - } - - if (bufferSink == null) { - Object cache = parent.g.getCache(this); - if (cache == null) { - return; - } - setBufferSink(cache); - getSinkMethods(); - } - - ByteBuffer byteBuffer = natBuffer.getByteBuffer(); - - try { - sinkCopyMethod.invoke(bufferSink, - new Object[] { natBuffer, byteBuffer, bufWidth, bufHeight }); - } catch (Exception e) { - e.printStackTrace(); - } - - natBuffer = null; - } else { // The pixels just read from gstreamer are copied to the pixels array. - if (copyPixels == null) { - return; - } - - if (firstFrame) { - super.init(bufWidth, bufHeight, RGB); - firstFrame = false; - } - - int[] temp = pixels; - pixels = copyPixels; - updatePixels(); - copyPixels = temp; - } - - available = false; - newFrame = true; - } - - - public synchronized void loadPixels() { - super.loadPixels(); - if (useBufferSink) { - if (natBuffer != null) { - // This means that the OpenGL texture hasn't been created so far (the - // video frame not drawn using image()), but the user wants to use the - // pixel array, which we can just get from natBuffer. - IntBuffer buf = natBuffer.getByteBuffer().asIntBuffer(); - buf.rewind(); - buf.get(pixels); - Video.convertToARGB(pixels, width, height); - } else if (sinkGetMethod != null) { - try { - // sinkGetMethod will copy the latest buffer to the pixels array, - // and the pixels will be copied to the texture when the OpenGL - // renderer needs to draw it. - sinkGetMethod.invoke(bufferSink, new Object[] { pixels }); - } catch (Exception e) { - e.printStackTrace(); - } - } - - outdatedPixels = false; - } - } - - - public int get(int x, int y) { - if (outdatedPixels) loadPixels(); - return super.get(x, y); - } - - - protected void getImpl(int sourceX, int sourceY, - int sourceWidth, int sourceHeight, - PImage target, int targetX, int targetY) { - if (outdatedPixels) loadPixels(); - super.getImpl(sourceX, sourceY, sourceWidth, sourceHeight, - target, targetX, targetY); - } - - - //////////////////////////////////////////////////////////// - - // List methods. - - - /** - * ( begin auto-generated from Capture_list.xml ) - * - * Gets a list of all available capture devices such as a camera. Use - * print() to write the information to the text window. - * - * ( end auto-generated ) - * - * @webref capture - * @brief Gets a list of all available capture devices such as a camera - */ - static public String[] list() { - if (devicePropertyName.equals("")) { - return list(sourceElementName, indexPropertyName); - } else { - return list(sourceElementName, devicePropertyName); - } - } - - - static protected String[] list(String sourceName, String propertyName) { - Video.init(); - ArrayList devices = listDevices(sourceName, propertyName); - - ArrayList configList = new ArrayList(); - for (String device: devices) { - ArrayList resolutions = listResolutions(sourceName, propertyName, - device); - if (0 < resolutions.size()) { - for (String res: resolutions) { - configList.add("name=" + device + "," + res); - } - } else { - configList.add("name=" + device); - } - } - - String[] configs = new String[configList.size()]; - for (int i = 0; i < configs.length; i++) { - configs[i] = configList.get(i); - } - - return configs; - } - - - static protected ArrayList listDevices(String sourceName, - String propertyName) { - ArrayList devices = new ArrayList(); - try { - // Using property-probe interface - Element videoSource = ElementFactory.make(sourceName, "Source"); - PropertyProbe probe = PropertyProbe.wrap(videoSource); - if (probe != null) { - Property property = probe.getProperty(propertyName); - if (property != null) { - Object[] values = probe.getValues(property); - if (values != null) { - for (int i = 0; i < values.length; i++) { - if (values[i] instanceof String) { - devices.add((String)values[i]); - } else if (values[i] instanceof Integer) { - devices.add(((Integer)values[i]).toString()); - } - } - } - } - } - } catch (IllegalArgumentException e) { - if (PApplet.platform == LINUX) { - // Linux hack to detect currently connected cameras - // by looking for device files named /dev/video0, /dev/video1, etc. - devices = new ArrayList(); - String dir = "/dev"; - File libPath = new File(dir); - String[] files = libPath.list(); - if (files != null) { - for (int i = 0; i < files.length; i++) { - if (-1 < files[i].indexOf("video")) { - devices.add("/dev/" + files[i]); - } - } - } - } else { - PGraphics.showWarning("The capture plugin does not support " + - "device query!"); - devices = new ArrayList(); - } - } - return devices; - } - - - static protected ArrayList listResolutions(String sourceName, - String propertyName, - Object propertyValue) { - // Creating temporary pipeline so that we can query - // the resolutions supported by the device. - Pipeline testPipeline = new Pipeline("test"); - Element source = ElementFactory.make(sourceName, "source"); - source.set(propertyName, propertyValue); - - BufferDataAppSink sink = new BufferDataAppSink("sink", "", - new BufferDataAppSink.Listener() { - public void bufferFrame(int w, int h, Buffer buffer) { } - }); - testPipeline.addMany(source, sink); - Element.linkMany(source, sink); - - // Play/pause sequence (with getState() calls to to make sure - // all async operations are done) to trigger the capture momentarily - // for the device and obtain its supported resolutions. - testPipeline.play(); - testPipeline.getState(); - testPipeline.pause(); - testPipeline.getState(); - - ArrayList resolutions = new ArrayList(); - addResFromSource(resolutions, source); - - testPipeline.stop(); - testPipeline.getState(); - - if (sink != null) { - sink.removeListener(); - sink.dispose(); - } - - testPipeline.dispose(); - return resolutions; - } - - - static protected void addResFromSource(ArrayList res, Element src) { - if (PApplet.platform == MACOSX && useResMacHack) { - addResFromSourceMacHack(res, src); - } else { - addResFromSourceImpl(res, src); - } - } - - - static protected void addResFromSourceImpl(ArrayList res, - Element src) { - for (Pad pad : src.getPads()) { - Caps caps = pad.getCaps(); - int n = caps.size(); - for (int i = 0; i < n; i++) { - Structure str = caps.getStructure(i); - - if (!str.hasIntField("width") || !str.hasIntField("height")) continue; - - int w = ((Integer)str.getValue("width")).intValue(); - int h = ((Integer)str.getValue("height")).intValue(); - - if (PApplet.platform == WINDOWS) { - // In Windows the getValueList() method doesn't seem to - // return a valid list of fraction values, so working on - // the string representation of the caps structure. - addResFromString(res, str.toString(), w, h); - } else { - addResFromStructure(res, str, w, h); - } - } - } - } - - - // The problem on OSX, at least when using qtkitvideosrc, is that it is only - // possible to obtain a single supported caps, the native maximum, using - // getNegotiatedCaps. getCaps() just gives the maximum possible ranges that - // are useless to build a list of supported resolutions. Using the fact that - // QTKit allows to capture streams at arbitrary resolutions, then the list is - // faked by repeatedly dividing the maximum by 2 until the width becomes too - // small (or not divisible by 2). - static protected void addResFromSourceMacHack(ArrayList res, - Element src) { - for (Pad pad : src.getPads()) { - Caps caps = pad.getNegotiatedCaps(); - int n = caps.size(); - if (0 < n) { - Structure str = caps.getStructure(0); - - if (!str.hasIntField("width") || !str.hasIntField("height")) return; - - int w = ((Integer)str.getValue("width")).intValue(); - int h = ((Integer)str.getValue("height")).intValue(); - while (80 <= w) { - int num = 30; - int den = 1; - try { - Fraction fr = str.getFraction("framerate"); - num = fr.numerator; - den = fr.denominator; - } catch (Exception e) { - } - - res.add(makeResolutionString(w, h, num, den)); - if (num == 30 && den == 1) { - // Adding additional framerates to allow for slower capture. Again, - // QTKit can output frames at arbitrary rates. - res.add(makeResolutionString(w, h, 15, 1)); - res.add(makeResolutionString(w, h, 1, 1)); - } - - if (w % 2 == 0 && h % 2 == 0) { - w /= 2; - h /= 2; - } else { - break; - } - } - } - } - } - - - static protected void addResFromString(ArrayList res, String str, - int w, int h) { - int n0 = str.indexOf("framerate=(fraction)"); - if (-1 < n0) { - String temp = str.substring(n0 + 20, str.length()); - int n1 = temp.indexOf("["); - int n2 = temp.indexOf("]"); - if (-1 < n1 && -1 < n2) { - // A list of fractions enclosed between '[' and ']' - temp = temp.substring(n1 + 1, n2); - String[] fractions = temp.split(","); - for (int k = 0; k < fractions.length; k++) { - String fpsStr = fractions[k].trim(); - res.add(makeResolutionString(w, h, fpsStr)); - } - } else { - // A single fraction - int n3 = temp.indexOf(","); - int n4 = temp.indexOf(";"); - if (-1 < n3 || -1 < n4) { - int n5 = -1; - if (n3 == -1) { - n5 = n4; - } else if (n4 == -1) { - n5 = n3; - } else { - n5 = PApplet.min(n3, n4); - } - - temp = temp.substring(0, n5); - String fpsStr = temp.trim(); - res.add(makeResolutionString(w, h, fpsStr)); - } - } - } - } - - - static protected void addResFromStructure(ArrayList res, - Structure str, int w, int h) { - boolean singleFrac = false; - try { - Fraction fr = str.getFraction("framerate"); - res.add(makeResolutionString(w, h, fr.numerator, fr.denominator)); - singleFrac = true; - } catch (Exception e) { - } - - if (!singleFrac) { - ValueList flist = null; - - try { - flist = str.getValueList("framerate"); - } catch (Exception e) { - } - - if (flist != null) { - // All the framerates are put together, but this is not - // entirely accurate since there might be some of them - // that work only for certain resolutions. - for (int k = 0; k < flist.getSize(); k++) { - Fraction fr = flist.getFraction(k); - res.add(makeResolutionString(w, h, fr.numerator, fr.denominator)); - } - } - } - } - - - static protected String makeResolutionString(int width, int height, int - fpsNumerator, - int fpsDenominator) { - String res = "size=" + width + "x" + height + ",fps=" + fpsNumerator; - if (fpsDenominator != 1) { - res += "/" + fpsDenominator; - } - return res; - } - - - static protected String makeResolutionString(int width, int height, - String fpsStr) { - String res = "size=" + width + "x" + height; - String[] parts = fpsStr.split("/"); - if (parts.length == 2) { - int fpsNumerator = PApplet.parseInt(parts[0]); - int fpsDenominator = PApplet.parseInt(parts[1]); - res += ",fps=" + fpsNumerator; - if (fpsDenominator != 1) { - res += "/" + fpsDenominator; - } - } - return res; - } - - - protected void checkResIsValid() { - ArrayList resolutions = new ArrayList(); - addResFromSource(resolutions, sourceElement); - - boolean valid = resolutions.size() == 0; - for (String res: resolutions) { - if (validRes(res)) { - valid = true; - break; - } - } - - if (!valid) { - String fpsStr = ""; - if (!frameRateString.equals("")) { - fpsStr = ", " + frameRateString + "fps"; - } - throw new RuntimeException("The requested resolution of " + reqWidth + - "x" + reqHeight + fpsStr + - " is not supported by the selected capture " + - "device.\n"); - } - } - - - protected void checkValidDevices(String src) { - ArrayList devices; - if (devicePropertyName.equals("")) { - devices = listDevices(src, indexPropertyName); - } else { - devices = listDevices(src, devicePropertyName); - } - if (devices.size() == 0) { - throw new RuntimeException("There are no capture devices connected to " + - "this computer.\n"); - } - } - - - protected boolean validRes(String res) { - int[] size = getSize(res); - String fps = getFrameRate(res); - return (reqWidth == 0 || reqHeight == 0 || - (size[0] == reqWidth && size[1] == reqHeight)) && - (frameRateString.equals("") || frameRateString.equals(fps)); - } - - - //////////////////////////////////////////////////////////// - - // Initialization methods. - - - // The main initialization here. - protected void initGStreamer(PApplet parent, int rw, int rh, String src, - String idName, Object idValue, - String fps) { - this.parent = parent; - - Video.init(); - checkValidDevices(src); - - // register methods - parent.registerMethod("dispose", this); - parent.registerMethod("post", this); - - setEventHandlerObject(parent); - - pipeline = new Pipeline("Video Capture"); - - frameRateString = fps; - if (frameRateString.equals("")) { - frameRate = -1; - } else { - String[] parts = frameRateString.split("/"); - if (parts.length == 2) { - int fpsDenominator = PApplet.parseInt(parts[0]); - int fpsNumerator = PApplet.parseInt(parts[1]); - frameRate = (float)fpsDenominator / (float)fpsNumerator; - } else if (parts.length == 1) { - frameRateString += "/1"; - frameRate = PApplet.parseFloat(parts[0]); - } else { - frameRateString = ""; - frameRate = -1; - } - } - - reqWidth = rw; - reqHeight = rh; - - sourceName = src; - sourceElement = ElementFactory.make(src, "Source"); - - if (idName != null && !idName.equals("")) { - sourceElement.set(idName, idValue); - } - - bufWidth = bufHeight = 0; - pipelineReady = false; - } - - - protected void initPipeline() { - String whStr = ""; - if (0 < reqWidth && 0 < reqHeight) { - whStr = "width=" + reqWidth + ", height=" + reqHeight; - } else { - PGraphics.showWarning("Resolution information not available, attempting" + - " to open the capture device at 320x240"); - whStr = "width=320, height=240"; - } - - String fpsStr = ""; - if (!frameRateString.equals("")) { - // If the framerate string is empty we left the source element - // to use the default value. - fpsStr = ", framerate=" + frameRateString; - } - - if (bufferSink != null || (Video.useGLBufferSink && parent.g.isGL())) { - useBufferSink = true; - - if (bufferSink != null) { - getSinkMethods(); - } - - if (copyMask == null || copyMask.equals("")) { - initCopyMask(); - } - - String caps = whStr + fpsStr + ", " + copyMask; - - natSink = new BufferDataAppSink("nat", caps, - new BufferDataAppSink.Listener() { - public void bufferFrame(int w, int h, Buffer buffer) { - invokeEvent(w, h, buffer); - } - }); - - natSink.setAutoDisposeBuffer(false); - - // No need for rgbSink.dispose(), because the addMany() doesn't increment the - // refcount of the videoSink object. - - pipeline.addMany(sourceElement, natSink); - Element.linkMany(sourceElement, natSink); - - } else { - Element conv = ElementFactory.make("ffmpegcolorspace", "ColorConverter"); - - Element videofilter = ElementFactory.make("capsfilter", "ColorFilter"); - videofilter.setCaps(new Caps("video/x-raw-rgb, width=" + reqWidth + - ", height=" + reqHeight + - ", bpp=32, depth=24" + fpsStr)); - - rgbSink = new RGBDataAppSink("rgb", - new RGBDataAppSink.Listener() { - public void rgbFrame(int w, int h, IntBuffer buffer) { - invokeEvent(w, h, buffer); - } - }); - - // Setting direct buffer passing in the video sink. - rgbSink.setPassDirectBuffer(Video.passDirectBuffer); - - // No need for rgbSink.dispose(), because the addMany() doesn't increment - // the refcount of the videoSink object. - - pipeline.addMany(sourceElement, conv, videofilter, rgbSink); - Element.linkMany(sourceElement, conv, videofilter, rgbSink); - } - - pipelineReady = true; - newFrame = false; - } - - - /** - * Uses a generic object as handler of the capture. This object should have a - * captureEvent method that receives a Capture argument. This method will - * be called upon a new frame read event. - * - */ - protected void setEventHandlerObject(Object obj) { - eventHandler = obj; - - try { - captureEventMethod = obj.getClass().getMethod("captureEvent", Capture.class); - return; - } catch (Exception e) { - // no such method, or an error.. which is fine, just ignore - } - - // The captureEvent method may be declared as receiving Object, rather - // than Capture. - try { - captureEventMethod = obj.getClass().getMethod("captureEvent", Object.class); - return; - } catch (Exception e) { - // no such method, or an error.. which is fine, just ignore - } - } - - - //////////////////////////////////////////////////////////// - - // Stream event handling. - - - /** - * invokeEvent() and read() are synchronized so that they can not be - * called simultaneously. when they were not synchronized, this caused - * the infamous problematic frame crash. - * found and fixed by Charl P. Botha - */ - protected synchronized void invokeEvent(int w, int h, IntBuffer buffer) { - available = true; - bufWidth = w; - bufHeight = h; - if (copyPixels == null) { - copyPixels = new int[w * h]; - } - buffer.rewind(); - try { - buffer.get(copyPixels); - } catch (BufferUnderflowException e) { - e.printStackTrace(); - copyPixels = null; - return; - } - fireCaptureEvent(); - } - - - protected synchronized void invokeEvent(int w, int h, Buffer buffer) { - available = true; - bufWidth = w; - bufHeight = h; - if (natBuffer != null) { - // To handle the situation where read() is not called in the sketch, - // so that the native buffers are not being sent to the sink, - // and therefore, not disposed by it. - natBuffer.dispose(); - } - natBuffer = buffer; - fireCaptureEvent(); - } - - - private void fireCaptureEvent() { - if (captureEventMethod != null) { - try { - captureEventMethod.invoke(eventHandler, this); - - } catch (Exception e) { - System.err.println("error, disabling captureEvent()"); - e.printStackTrace(); - captureEventMethod = null; - } - } - } - - - //////////////////////////////////////////////////////////// - - // Stream query methods. - - - protected float getSourceFrameRate() { - for (Element sink : pipeline.getSinks()) { - for (Pad pad : sink.getPads()) { - Fraction frameRate = org.gstreamer.Video.getVideoFrameRate(pad); - if (frameRate != null) { - return (float)frameRate.toDouble(); - } - } - } - return 0; - } - - - protected String getName(String config) { - String name = ""; - String[] parts = PApplet.split(config, ','); - for (String part: parts) { - if (-1 < part.indexOf("name")) { - String[] values = PApplet.split(part, '='); - if (0 < values.length) { - name = values[1]; - } - } - } - return name; - } - - - protected int[] getSize(String config) { - int[] wh = {0, 0}; - String[] parts = PApplet.split(config, ','); - for (String part: parts) { - if (-1 < part.indexOf("size")) { - String[] values = PApplet.split(part, '='); - if (0 < values.length) { - String[] whstr = PApplet.split(values[1], 'x'); - if (whstr.length == 2) { - wh[0] = PApplet.parseInt(whstr[0]); - wh[1] = PApplet.parseInt(whstr[1]); - } - } - } - } - return wh; - } - - - protected String getFrameRate(String config) { - String fps = ""; - String[] parts = PApplet.split(config, ','); - for (String part: parts) { - if (-1 < part.indexOf("fps")) { - String[] values = PApplet.split(part, '='); - if (0 < values.length) { - fps = values[1]; - if (fps.indexOf("/") == -1) { - fps += "/1"; - } - } - } - } - return fps; - } - - - //////////////////////////////////////////////////////////// - - // Buffer source interface. - - - /** - * Sets the object to use as destination for the frames read from the stream. - * The color conversion mask is automatically set to the one required to - * copy the frames to OpenGL. - * - * NOTE: This is not official API and may/will be removed at any time. - * - * @param Object dest - */ - public void setBufferSink(Object sink) { - bufferSink = sink; - initCopyMask(); - } - - - /** - * Sets the object to use as destination for the frames read from the stream. - * - * NOTE: This is not official API and may/will be removed at any time. - * - * @param Object dest - * @param String mask - */ - public void setBufferSink(Object sink, String mask) { - bufferSink = sink; - copyMask = mask; - } - - - /** - * NOTE: This is not official API and may/will be removed at any time. - */ - public boolean hasBufferSink() { - return bufferSink != null; - } - - - /** - * NOTE: This is not official API and may/will be removed at any time. - */ - public synchronized void disposeBuffer(Object buf) { - ((Buffer)buf).dispose(); - } - - - protected void getSinkMethods() { - try { - sinkCopyMethod = bufferSink.getClass().getMethod("copyBufferFromSource", - new Class[] { Object.class, ByteBuffer.class, int.class, int.class }); - } catch (Exception e) { - throw new RuntimeException("Capture: provided sink object doesn't have " + - "a copyBufferFromSource method."); - } - - try { - sinkSetMethod = bufferSink.getClass().getMethod("setBufferSource", - new Class[] { Object.class }); - sinkSetMethod.invoke(bufferSink, new Object[] { this }); - } catch (Exception e) { - throw new RuntimeException("Capture: provided sink object doesn't have "+ - "a setBufferSource method."); - } - - try { - sinkDisposeMethod = bufferSink.getClass().getMethod("disposeSourceBuffer", - new Class[] { }); - } catch (Exception e) { - throw new RuntimeException("Capture: provided sink object doesn't have " + - "a disposeSourceBuffer method."); - } - - try { - sinkGetMethod = bufferSink.getClass().getMethod("getBufferPixels", - new Class[] { int[].class }); - } catch (Exception e) { - throw new RuntimeException("Capture: provided sink object doesn't have " + - "a getBufferPixels method."); - } - } - - - protected void initCopyMask() { - if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) { - copyMask = "red_mask=(int)0xFF000000, green_mask=(int)0xFF0000, blue_mask=(int)0xFF00"; - } else { - copyMask = "red_mask=(int)0xFF, green_mask=(int)0xFF00, blue_mask=(int)0xFF0000"; - } - } - - - public synchronized void post() { - if (useBufferSink && sinkDisposeMethod != null) { - try { - sinkDisposeMethod.invoke(bufferSink, new Object[] {}); - } catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/java/libraries/video/src/processing/video/LibraryLoader.java b/java/libraries/video/src/processing/video/LibraryLoader.java deleted file mode 100644 index befa4c6d4..000000000 --- a/java/libraries/video/src/processing/video/LibraryLoader.java +++ /dev/null @@ -1,236 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2011-12 Ben Fry and Casey Reas - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.video; - -import java.util.HashMap; -import java.util.Map; - -import com.sun.jna.Library; -import com.sun.jna.Native; -import com.sun.jna.Platform; - -/** - * This class loads the gstreamer native libraries. - * By Andres Colubri - * Based on code by Tal Shalif - * - */ -public class LibraryLoader { - - public interface DummyLibrary extends Library { - } - - private static LibraryLoader instance; - - static final Object[][] WINDOWS_DEPENDENCIES = { - // glib libraries - { "gio-2.0", new String[] {}, true }, - { "glib-2.0", new String[] {}, true }, - { "gmodule-2.0", new String[] {}, true }, - { "gobject-2.0", new String[] {}, true }, - { "gthread-2.0", new String[] {}, true }, - - // Core gstreamer libraries - { "gstapp-0.10", new String[] {}, true }, - { "gstaudio-0.10", new String[] {}, true }, - { "gstbase-0.10", new String[] {}, true }, - { "gstbasevideo-0.10", new String[] {}, true }, - { "gstcdda-0.10", new String[] {}, true }, - { "gstcontroller-0.10", new String[] {}, true }, - { "gstdataprotocol-0.10", new String[] {}, true }, - { "gstfft-0.10", new String[] {}, true }, - { "gstinterfaces-0.10", new String[] {}, true }, - { "gstnet-0.10", new String[] {}, true }, - { "gstnetbuffer-0.10", new String[] {}, true }, - { "gstpbutils-0.10", new String[] {}, true }, - { "gstphotography-0.10", new String[] {}, true }, - { "gstreamer-0.10", new String[] {}, true }, - { "gstriff-0.10", new String[] {}, true }, - { "gstrtp-0.10", new String[] {}, true }, - { "gstrtsp-0.10", new String[] {}, true }, - { "gstsdp-0.10", new String[] {}, true }, - { "gstsignalprocessor-0.10", new String[] {}, true }, - { "gsttag-0.10", new String[] {}, true }, - { "gstvideo-0.10", new String[] {}, true }, - - // External libraries - { "libiconv-2", new String[] {}, false }, - { "libintl-8", new String[] {}, false }, - { "libjpeg-8", new String[] {}, false }, - { "libogg-0", new String[] {}, false }, - { "liborc-0.4-0", new String[] {}, false }, - { "liborc-test-0.4-0", new String[] {}, false }, - { "libpng14-14", new String[] {}, false }, - { "libtheora-0", new String[] {}, false }, - { "libtheoradec-1", new String[] {}, false }, - { "libtheoraenc-1", new String[] {}, false }, - { "libvorbis-0", new String[] {}, false }, - { "libvorbisenc-2", new String[] {}, false }, - { "libvorbisfile-3", new String[] {}, false }, - { "libxml2-2", new String[] {}, false }, - { "zlib1", new String[] {}, false } }; - - static final Object[][] MACOSX_DEPENDENCIES = { - { "gstbase-0.10", new String[] { "gstreamer-0.10" }, true }, - { "gstinterfaces-0.10", new String[] { "gstreamer-0.10" }, true }, - { "gstcontroller-0.10", new String[] { "gstreamer-0.10" }, true }, - { "gstaudio-0.10", new String[] { "gstbase-0.10" }, true }, - { "gstvideo-0.10", new String[] { "gstbase-0.10" }, true } }; - - static final Object[][] DEFAULT_DEPENDENCIES = { - { "gstreamer-0.10", new String[] {}, true }, - { "gstbase-0.10", new String[] { "gstreamer-0.10" }, true }, - { "gstinterfaces-0.10", new String[] { "gstreamer-0.10" }, true }, - { "gstcontroller-0.10", new String[] { "gstreamer-0.10" }, true }, - { "gstaudio-0.10", new String[] { "gstbase-0.10" }, true }, - { "gstvideo-0.10", new String[] { "gstbase-0.10" }, true }, }; - - - static final Object[][] dependencies = - Platform.isWindows() ? WINDOWS_DEPENDENCIES : - Platform.isMac() ? MACOSX_DEPENDENCIES : DEFAULT_DEPENDENCIES; - - - private static final Map loadedMap = - new HashMap(); - - - private static final int RECURSIVE_LOAD_MAX_DEPTH = 5; - - - private LibraryLoader() { - } - - - private void preLoadLibs() { - for (Object[] a : dependencies) { - load(a[0].toString(), DummyLibrary.class, true, 0, (Boolean) a[2]); - } - } - - - private String[] findDeps(String name) { - - for (Object[] a : dependencies) { - if (name.equals(a[0])) { - - return (String[]) a[1]; - } - } - - return new String[] {}; // library dependancy load chain unspecified - - // probably client call - } - - - public Object load(String name, Class clazz, boolean reqLib) { - return load(name, clazz, true, 0, reqLib); - } - - - private Object load(String name, Class clazz, boolean forceReload, - int depth, boolean reqLib) { - - assert depth < RECURSIVE_LOAD_MAX_DEPTH : String.format( - "recursive max load depth %s has been exceeded", depth); - - Object library = loadedMap.get(name); - - if (null == library || forceReload) { - - // Logger.getAnonymousLogger().info(String.format("%" + ((depth + 1) * 2) - // + "sloading %s", "->", name)); - - try { - String[] deps = findDeps(name); - - for (String lib : deps) { - load(lib, DummyLibrary.class, false, depth + 1, reqLib); - } - - library = loadLibrary(name, clazz, reqLib); - - if (library != null) { - loadedMap.put(name, library); - } - } catch (Exception e) { - if (reqLib) - throw new RuntimeException(String.format( - "can not load required library %s", name, e)); - else - System.out.println(String.format("can not load library %s", name, e)); - } - } - - return library; - } - - - private static Object loadLibrary(String name, Class clazz, - boolean reqLib) { - - // Logger.getAnonymousLogger().info(String.format("loading %s", name)); - - String[] nameFormats; - nameFormats = Platform.isWindows() ? new String[] { "lib%s", "lib%s-0", - "%s" } : new String[] { "%s-0", "%s" }; - - UnsatisfiedLinkError linkError = null; - - for (String fmt : nameFormats) { - try { - String s = String.format(fmt, name); - //System.out.println("Trying to load library file " + s); - Object obj = Native.loadLibrary(s, clazz); - //System.out.println("Loaded library " + s + " succesfully!"); - return obj; - } catch (UnsatisfiedLinkError ex) { - linkError = ex; - } - } - - if (reqLib) - throw new UnsatisfiedLinkError( - String.format( - "can't load library %s (%1$s|lib%1$s|lib%1$s-0) with " + - "-Djna.library.path=%s. Last error:%s", - name, System.getProperty("jna.library.path"), linkError)); - else { - System.out.println(String.format( - "can't load library %s (%1$s|lib%1$s|lib%1$s-0) with " + - "-Djna.library.path=%s. Last error:%s", - name, System.getProperty("jna.library.path"), linkError)); - return null; - } - } - - - public static synchronized LibraryLoader getInstance() { - if (null == instance) { - instance = new LibraryLoader(); - instance.preLoadLibs(); - } - return instance; - } -} diff --git a/java/libraries/video/src/processing/video/LibraryPath.java b/java/libraries/video/src/processing/video/LibraryPath.java deleted file mode 100644 index ccabe2467..000000000 --- a/java/libraries/video/src/processing/video/LibraryPath.java +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2011-12 Ben Fry and Casey Reas - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.video; - -import java.net.URL; - -import com.sun.jna.Platform; - -class LibraryPath { - // This method returns the folder inside which the gstreamer library folder - // is located. - String get() { - URL url = this.getClass().getResource("LibraryPath.class"); - if (url != null) { - // Convert URL to string, taking care of spaces represented by the "%20" - // string. - String path = url.toString().replace("%20", " "); - int n0 = path.indexOf('/'); - - int n1 = -1; - - if (Platform.isLinux()) { - return ""; - } else { - n1 = path.indexOf("video.jar"); - if (Platform.isWindows()) { - // In Windows, path string starts with "jar file/C:/..." - // so the substring up to the first / is removed. - n0++; - } - } - - if ((-1 < n0) && (-1 < n1)) { - return path.substring(n0, n1); - } else { - return ""; - } - } - return ""; - } -} \ No newline at end of file diff --git a/java/libraries/video/src/processing/video/Movie.java b/java/libraries/video/src/processing/video/Movie.java deleted file mode 100644 index 958be1109..000000000 --- a/java/libraries/video/src/processing/video/Movie.java +++ /dev/null @@ -1,1026 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2004-12 Ben Fry and Casey Reas - The previous version of this code was developed by Hernando Barragan - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.video; - -import processing.core.*; - -import java.awt.Dimension; -import java.io.*; -import java.net.URI; -import java.nio.*; -import java.util.concurrent.TimeUnit; -import java.lang.reflect.*; - -import org.gstreamer.*; -import org.gstreamer.Buffer; -import org.gstreamer.elements.*; - - -/** - * ( begin auto-generated from Movie.xml ) - * - * Datatype for storing and playing movies in Apple's QuickTime format. - * Movies must be located in the sketch's data directory or an accessible - * place on the network to load without an error. - * - * ( end auto-generated ) - * - * @webref video - * @usage application - */ -public class Movie extends PImage implements PConstants { - public static String[] supportedProtocols = { "http" }; - public float frameRate; - public String filename; - public PlayBin2 playbin; - - protected boolean playing = false; - protected boolean paused = false; - protected boolean repeat = false; - - protected float rate; - protected int bufWidth; - protected int bufHeight; - protected float volume; - - protected Method movieEventMethod; - protected Object eventHandler; - - protected boolean available; - protected boolean sinkReady; - protected boolean newFrame; - - protected RGBDataAppSink rgbSink = null; - protected int[] copyPixels = null; - - protected boolean firstFrame = true; - protected boolean seeking = false; - - protected boolean useBufferSink = false; - protected boolean outdatedPixels = true; - protected Object bufferSink; - protected Method sinkCopyMethod; - protected Method sinkSetMethod; - protected Method sinkDisposeMethod; - protected Method sinkGetMethod; - protected String copyMask; - protected Buffer natBuffer = null; - protected BufferDataAppSink natSink = null; - - - /** - * Creates an instance of GSMovie loading the movie from filename. - * - * @param parent PApplet - * @param filename String - */ - public Movie(PApplet parent, String filename) { - super(0, 0, RGB); - initGStreamer(parent, filename); - } - - - /** - * Disposes all the native resources associated to this movie. - * - * NOTE: This is not official API and may/will be removed at any time. - */ - public void dispose() { - if (playbin != null) { - try { - if (playbin.isPlaying()) { - playbin.stop(); - playbin.getState(); - } - } catch (Exception e) { - e.printStackTrace(); - } - - pixels = null; - - copyPixels = null; - if (rgbSink != null) { - rgbSink.removeListener(); - rgbSink.dispose(); - rgbSink = null; - } - - natBuffer = null; - if (natSink != null) { - natSink.removeListener(); - natSink.dispose(); - natSink = null; - } - - playbin.dispose(); - playbin = null; - - parent.g.removeCache(this); - parent.unregisterMethod("dispose", this); - parent.unregisterMethod("post", this); - } - } - - - /** - * Finalizer of the class. - */ - protected void finalize() throws Throwable { - try { - dispose(); - } finally { - super.finalize(); - } - } - - - /** - * ( begin auto-generated from Movie_frameRate.xml ) - * - * Sets how often frames are read from the movie. Setting the fps - * parameter to 4, for example, will cause 4 frames to be read per second. - * - * ( end auto-generated ) - * - * @webref movie - * @usage web_application - * @param ifps speed of the movie in frames per second - * @brief Sets the target frame rate - */ - public void frameRate(float ifps) { - if (seeking) return; - - // We calculate the target ratio in the case both the - // current and target framerates are valid (greater than - // zero), otherwise we leave it as 1. - float f = (0 < ifps && 0 < frameRate) ? ifps / frameRate : 1; - - if (playing) { - playbin.pause(); - playbin.getState(); - } - - long t = playbin.queryPosition(TimeUnit.NANOSECONDS); - - boolean res; - long start, stop; - if (rate > 0) { - start = t; - stop = -1; - } else { - start = 0; - stop = t; - } - - res = playbin.seek(rate * f, Format.TIME, SeekFlags.FLUSH, - SeekType.SET, start, SeekType.SET, stop); - playbin.getState(); - - if (!res) { - PGraphics.showWarning("Seek operation failed."); - } - - if (playing) { - playbin.play(); - } - - frameRate = ifps; - - // getState() will wait until any async state change - // (like seek in this case) has completed - seeking = true; - playbin.getState(); - seeking = false; - } - - - /** - * ( begin auto-generated from Movie_speed.xml ) - * - * Sets the relative playback speed of the movie. The rate - * parameters sets the speed where 2.0 will play the movie twice as fast, - * 0.5 will play at half the speed, and -1 will play the movie in normal - * speed in reverse. - * - * ( end auto-generated ) - * - - * @webref movie - - * @usage web_application - * @param irate speed multiplier for movie playback - * @brief Sets the relative playback speed - */ - public void speed(float irate) { - // If the frameRate() method is called continuously with very similar - // rate values, playback might become sluggish. This condition attempts - // to take care of that. - if (PApplet.abs(rate - irate) > 0.1) { - rate = irate; - frameRate(frameRate); // The framerate is the same, but the rate (speed) could be different. - } - } - - - /** - * ( begin auto-generated from Movie_duration.xml ) - * - * Returns the length of the movie in seconds. If the movie is 1 minute and - * 20 seconds long the value returned will be 80.0. - * - * ( end auto-generated ) - * - * @webref movie - * @usage web_application - * @brief Returns length of movie in seconds - */ - public float duration() { - float sec = playbin.queryDuration().toSeconds(); - float nanosec = playbin.queryDuration().getNanoSeconds(); - return sec + Video.nanoSecToSecFrac(nanosec); - } - - - /** - * ( begin auto-generated from Movie_time.xml ) - * - * Returns the location of the playback head in seconds. For example, if - * the movie has been playing for 4 seconds, the number 4.0 will be returned. - * - * ( end auto-generated ) - * - * @webref movie - * @usage web_application - * @brief Returns location of playback head in units of seconds - */ - public float time() { - float sec = playbin.queryPosition().toSeconds(); - float nanosec = playbin.queryPosition().getNanoSeconds(); - return sec + Video.nanoSecToSecFrac(nanosec); - } - - - /** - * ( begin auto-generated from Movie_jump.xml ) - * - * Jumps to a specific location within a movie. The parameter where - * is in terms of seconds. For example, if the movie is 12.2 seconds long, - * calling jump(6.1) would go to the middle of the movie. - * - * ( end auto-generated ) - * - * @webref movie - * @usage web_application - * @param where position to jump to specified in seconds - * @brief Jumps to a specific location - */ - public void jump(float where) { - if (seeking) return; - - if (!sinkReady) { - initSink(); - } - - // Round the time to a multiple of the source framerate, in - // order to eliminate stutter. Suggested by Daniel Shiffman - float fps = getSourceFrameRate(); - int frame = (int)(where * fps); - where = frame / fps; - - boolean res; - long pos = Video.secToNanoLong(where); - - res = playbin.seek(rate, Format.TIME, SeekFlags.FLUSH, - SeekType.SET, pos, SeekType.NONE, -1); - - if (!res) { - PGraphics.showWarning("Seek operation failed."); - } - - // getState() will wait until any async state change - // (like seek in this case) has completed - seeking = true; - playbin.getState(); - seeking = false; - /* - if (seeking) return; // don't seek again until the current seek operation is done. - - if (!sinkReady) { - initSink(); - } - - // Round the time to a multiple of the source framerate, in - // order to eliminate stutter. Suggested by Daniel Shiffman - float fps = getSourceFrameRate(); - int frame = (int)(where * fps); - final float seconds = frame / fps; - - // Put the seek operation inside a thread to avoid blocking the main - // animation thread - Thread seeker = new Thread() { - @Override - public void run() { - long pos = Video.secToNanoLong(seconds); - boolean res = playbin.seek(rate, Format.TIME, SeekFlags.FLUSH, - SeekType.SET, pos, SeekType.NONE, -1); - if (!res) { - PGraphics.showWarning("Seek operation failed."); - } - - // getState() will wait until any async state change - // (like seek in this case) has completed - seeking = true; - playbin.getState(); - seeking = false; - } - }; - seeker.start(); - */ - } - - - /** - * ( begin auto-generated from Movie_available.xml ) - * - * Returns "true" when a new movie frame is available to read. - * - * ( end auto-generated ) - * - * @webref movie - * @usage web_application - * @brief Returns "true" when a new movie frame is available to read. - */ - public boolean available() { - return available; - } - - - /** - * ( begin auto-generated from Movie_play.xml ) - * - * Plays a movie one time and stops at the last frame. - * - * ( end auto-generated ) - * - * @webref movie - * @usage web_application - * @brief Plays movie one time and stops at the last frame - */ - public void play() { - if (seeking) return; - - if (!sinkReady) { - initSink(); - } - - playing = true; - paused = false; - playbin.play(); - playbin.getState(); - } - - - /** - * ( begin auto-generated from Movie_loop.xml ) - * - * Plays a movie continuously, restarting it when it's over. - * - * ( end auto-generated ) - * - * @webref movie - * @usage web_application - * @brief Plays a movie continuously, restarting it when it's over. - */ - public void loop() { - if (seeking) return; - - repeat = true; - play(); - } - - - /** - * ( begin auto-generated from Movie_noLoop.xml ) - * - * If a movie is looping, calling noLoop() will cause it to play until the - * end and then stop on the last frame. - * - * ( end auto-generated ) - * - * @webref movie - * @usage web_application - * @brief Stops the movie from looping - */ - public void noLoop() { - if (seeking) return; - - if (!sinkReady) { - initSink(); - } - - repeat = false; - } - - - /** - * ( begin auto-generated from Movie_pause.xml ) - * - * Pauses a movie during playback. If a movie is started again with play(), - * it will continue from where it was paused. - * - * ( end auto-generated ) - * - * @webref movie - * @usage web_application - * @brief Pauses the movie - */ - public void pause() { - if (seeking) return; - - if (!sinkReady) { - initSink(); - } - - playing = false; - paused = true; - playbin.pause(); - playbin.getState(); - } - - - /** - * ( begin auto-generated from Movie_stop.xml ) - * - * Stops a movie from continuing. The playback returns to the beginning so - * when a movie is played, it will begin from the beginning. - * - * ( end auto-generated ) - * - * @webref movie - * @usage web_application - * @brief Stops the movie - */ - public void stop() { - if (seeking) return; - - if (!sinkReady) { - initSink(); - } - - if (playing) { - jump(0); - playing = false; - } - paused = false; - playbin.stop(); - playbin.getState(); - } - - - /** - * ( begin auto-generated from Movie_read.xml ) - * - * Reads the current frame of the movie. - * - * ( end auto-generated ) - * - * @webref movie - * @usage web_application - * @brief Reads the current frame - */ - public synchronized void read() { - if (frameRate < 0) { - // Framerate not set yet, so we obtain from stream, - // which is already playing since we are in read(). - frameRate = getSourceFrameRate(); - } - if (volume < 0) { - // Idem for volume - volume = (float)playbin.getVolume(); - } - - if (useBufferSink) { // The native buffer from gstreamer is copied to the buffer sink. - outdatedPixels = true; - if (natBuffer == null) { - return; - } - - if (firstFrame) { - super.init(bufWidth, bufHeight, ARGB); - firstFrame = false; - } - - if (bufferSink == null) { - Object cache = parent.g.getCache(this); - if (cache == null) { - return; - } - setBufferSink(cache); - getSinkMethods(); - } - - ByteBuffer byteBuffer = natBuffer.getByteBuffer(); - - try { - sinkCopyMethod.invoke(bufferSink, new Object[] { natBuffer, byteBuffer, bufWidth, bufHeight }); - } catch (Exception e) { - e.printStackTrace(); - } - - natBuffer = null; - } else { // The pixels just read from gstreamer are copied to the pixels array. - if (copyPixels == null) { - return; - } - - if (firstFrame) { - super.init(bufWidth, bufHeight, RGB); - firstFrame = false; - } - - int[] temp = pixels; - pixels = copyPixels; - updatePixels(); - copyPixels = temp; - } - - available = false; - newFrame = true; - } - - - /** - * Change the volume. Values are from 0 to 1. - * - * @param float v - */ - public void volume(float v) { - if (playing && PApplet.abs(volume - v) > 0.001f) { - playbin.setVolume(v); - volume = v; - } - } - - - public synchronized void loadPixels() { - super.loadPixels(); - if (useBufferSink) { - if (natBuffer != null) { - // This means that the OpenGL texture hasn't been created so far (the - // video frame not drawn using image()), but the user wants to use the - // pixel array, which we can just get from natBuffer. - IntBuffer buf = natBuffer.getByteBuffer().asIntBuffer(); - buf.rewind(); - buf.get(pixels); - Video.convertToARGB(pixels, width, height); - } else if (sinkGetMethod != null) { - try { - // sinkGetMethod will copy the latest buffer to the pixels array, - // and the pixels will be copied to the texture when the OpenGL - // renderer needs to draw it. - sinkGetMethod.invoke(bufferSink, new Object[] { pixels }); - } catch (Exception e) { - e.printStackTrace(); - } - } - - outdatedPixels = false; - } - } - - - public int get(int x, int y) { - if (outdatedPixels) loadPixels(); - return super.get(x, y); - } - - - protected void getImpl(int sourceX, int sourceY, - int sourceWidth, int sourceHeight, - PImage target, int targetX, int targetY) { - if (outdatedPixels) loadPixels(); - super.getImpl(sourceX, sourceY, sourceWidth, sourceHeight, - target, targetX, targetY); - } - - - //////////////////////////////////////////////////////////// - - // Initialization methods. - - - protected void initGStreamer(PApplet parent, String filename) { - this.parent = parent; - playbin = null; - - File file; - - Video.init(); - - // first check to see if this can be read locally from a file. - try { - try { - // first try a local file using the dataPath. usually this will - // work ok, but sometimes the dataPath is inside a jar file, - // which is less fun, so this will crap out. - file = new File(parent.dataPath(filename)); - if (file.exists()) { - playbin = new PlayBin2("Movie Player"); - playbin.setInputFile(file); - } - } catch (Exception e) { - } // ignored - - // read from a file just hanging out in the local folder. - // this might happen when the video library is used with some - // other application, or the person enters a full path name - if (playbin == null) { - try { - file = new File(filename); - if (file.exists()) { - playbin = new PlayBin2("Movie Player"); - playbin.setInputFile(file); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - if (playbin == null) { - // Try network read... - for (int i = 0; i < supportedProtocols.length; i++) { - if (filename.startsWith(supportedProtocols[i] + "://")) { - try { - playbin = new PlayBin2("Movie Player"); - playbin.setURI(URI.create(filename)); - break; - } catch (Exception e) { - e.printStackTrace(); - } - } - } - } - } catch (SecurityException se) { - // online, whups. catch the security exception out here rather than - // doing it three times (or whatever) for each of the cases above. - } - - if (playbin == null) { - parent.die("Could not load movie file " + filename, null); - } - - // we've got a valid movie! let's rock. - try { - this.filename = filename; // for error messages - - // register methods - parent.registerMethod("dispose", this); - parent.registerMethod("post", this); - - setEventHandlerObject(parent); - - rate = 1.0f; - frameRate = -1; - volume = -1; - sinkReady = false; - bufWidth = bufHeight = 0; - } catch (Exception e) { - e.printStackTrace(); - } - } - - - /** - * Uses a generic object as handler of the movie. This object should have a - * movieEvent method that receives a GSMovie argument. This method will - * be called upon a new frame read event. - * - */ - protected void setEventHandlerObject(Object obj) { - eventHandler = obj; - - try { - movieEventMethod = eventHandler.getClass().getMethod("movieEvent", Movie.class); - return; - } catch (Exception e) { - // no such method, or an error... which is fine, just ignore - } - - // movieEvent can alternatively be defined as receiving an Object, to allow - // Processing mode implementors to support the video library without linking - // to it at build-time. - try { - movieEventMethod = eventHandler.getClass().getMethod("movieEvent", Object.class); - } catch (Exception e) { - // no such method, or an error... which is fine, just ignore - } - } - - - protected void initSink() { - if (bufferSink != null || (Video.useGLBufferSink && parent.g.isGL())) { - useBufferSink = true; - - if (bufferSink != null) { - getSinkMethods(); - } - - if (copyMask == null || copyMask.equals("")) { - initCopyMask(); - } - - natSink = new BufferDataAppSink("nat", copyMask, - new BufferDataAppSink.Listener() { - public void bufferFrame(int w, int h, Buffer buffer) { - invokeEvent(w, h, buffer); - } - }); - - natSink.setAutoDisposeBuffer(false); - playbin.setVideoSink(natSink); - // The setVideoSink() method sets the videoSink as a property of the - // PlayBin, which increments the refcount of the videoSink element. - // Disposing here once to decrement the refcount. - natSink.dispose(); - } else { - rgbSink = new RGBDataAppSink("rgb", - new RGBDataAppSink.Listener() { - public void rgbFrame(int w, int h, IntBuffer buffer) { - invokeEvent(w, h, buffer); - } - }); - - // Setting direct buffer passing in the video sink. - rgbSink.setPassDirectBuffer(Video.passDirectBuffer); - playbin.setVideoSink(rgbSink); - // The setVideoSink() method sets the videoSink as a property of the - // PlayBin, which increments the refcount of the videoSink element. - // Disposing here once to decrement the refcount. - rgbSink.dispose(); - } - - // Creating bus to handle end-of-stream event. - Bus bus = playbin.getBus(); - bus.connect(new Bus.EOS() { - public void endOfStream(GstObject element) { - eosEvent(); - } - }); - - sinkReady = true; - newFrame = false; - } - - - //////////////////////////////////////////////////////////// - - // Stream event handling. - - - protected synchronized void invokeEvent(int w, int h, IntBuffer buffer) { - available = true; - bufWidth = w; - bufHeight = h; - - if (copyPixels == null) { - copyPixels = new int[w * h]; - } - buffer.rewind(); - try { - buffer.get(copyPixels); - } catch (BufferUnderflowException e) { - e.printStackTrace(); - copyPixels = null; - return; - } - - if (playing) { - fireMovieEvent(); - } - } - - protected synchronized void invokeEvent(int w, int h, Buffer buffer) { - available = true; - bufWidth = w; - bufHeight = h; - if (natBuffer != null) { - // To handle the situation where read() is not called in the sketch, so - // that the native buffers are not being sent to the sinke, and therefore, not disposed - // by it. - natBuffer.dispose(); - } - natBuffer = buffer; - - if (playing) { - fireMovieEvent(); - } - } - - private void fireMovieEvent() { - // Creates a movieEvent. - if (movieEventMethod != null) { - try { - movieEventMethod.invoke(eventHandler, this); - } catch (Exception e) { - System.err.println("error, disabling movieEvent() for " + filename); - e.printStackTrace(); - movieEventMethod = null; - } - } - } - - protected void eosEvent() { - if (repeat) { - if (0 < rate) { - // Playing forward, so we return to the beginning - jump(0); - } else { - // Playing backwards, so we go to the end. - jump(duration()); - } - - // The rate is set automatically to 1 when restarting the - // stream, so we need to call frameRate in order to reset - // to the latest fps rate. - frameRate(frameRate); - } else { - playing = false; - } - } - - - //////////////////////////////////////////////////////////// - - // Stream query methods. - - - /** - * Get the height of the source video. Note: calling this method repeatedly - * can slow down playback performance. - * - * @return int - */ - protected int getSourceHeight() { - Dimension dim = playbin.getVideoSize(); - if (dim != null) { - return dim.height; - } else { - return 0; - } - } - - - /** - * Get the original framerate of the source video. Note: calling this method - * repeatedly can slow down playback performance. - * - * @return float - */ - protected float getSourceFrameRate() { - return (float)playbin.getVideoSinkFrameRate(); - } - - - /** - * Get the width of the source video. Note: calling this method repeatedly - * can slow down playback performance. - * - * @return int - */ - protected int getSourceWidth() { - Dimension dim = playbin.getVideoSize(); - if (dim != null) { - return dim.width; - } else { - return 0; - } - } - - - //////////////////////////////////////////////////////////// - - // Buffer source interface. - - - /** - * Sets the object to use as destination for the frames read from the stream. - * The color conversion mask is automatically set to the one required to - * copy the frames to OpenGL. - * - * NOTE: This is not official API and may/will be removed at any time. - * - * @param Object dest - */ - public void setBufferSink(Object sink) { - bufferSink = sink; - initCopyMask(); - } - - - /** - * Sets the object to use as destination for the frames read from the stream. - * - * NOTE: This is not official API and may/will be removed at any time. - * - * @param Object dest - * @param String mask - */ - public void setBufferSink(Object sink, String mask) { - bufferSink = sink; - copyMask = mask; - } - - - /** - * NOTE: This is not official API and may/will be removed at any time. - */ - public boolean hasBufferSink() { - return bufferSink != null; - } - - - /** - * NOTE: This is not official API and may/will be removed at any time. - */ - public synchronized void disposeBuffer(Object buf) { - ((Buffer)buf).dispose(); - } - - - protected void getSinkMethods() { - try { - sinkCopyMethod = bufferSink.getClass().getMethod("copyBufferFromSource", - new Class[] { Object.class, ByteBuffer.class, int.class, int.class }); - } catch (Exception e) { - throw new RuntimeException("Movie: provided sink object doesn't have a " + - "copyBufferFromSource method."); - } - - try { - sinkSetMethod = bufferSink.getClass().getMethod("setBufferSource", - new Class[] { Object.class }); - sinkSetMethod.invoke(bufferSink, new Object[] { this }); - } catch (Exception e) { - throw new RuntimeException("Movie: provided sink object doesn't have a " + - "setBufferSource method."); - } - - try { - sinkDisposeMethod = bufferSink.getClass().getMethod("disposeSourceBuffer", - new Class[] { }); - } catch (Exception e) { - throw new RuntimeException("Movie: provided sink object doesn't have " + - "a disposeSourceBuffer method."); - } - - try { - sinkGetMethod = bufferSink.getClass().getMethod("getBufferPixels", - new Class[] { int[].class }); - } catch (Exception e) { - throw new RuntimeException("Movie: provided sink object doesn't have " + - "a getBufferPixels method."); - } - } - - - protected void initCopyMask() { - if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) { - copyMask = "red_mask=(int)0xFF000000, green_mask=(int)0xFF0000, blue_mask=(int)0xFF00"; - } else { - copyMask = "red_mask=(int)0xFF, green_mask=(int)0xFF00, blue_mask=(int)0xFF0000"; - } - } - - - public synchronized void post() { - if (useBufferSink && sinkDisposeMethod != null) { - try { - sinkDisposeMethod.invoke(bufferSink, new Object[] {}); - } catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/java/libraries/video/src/processing/video/Video.java b/java/libraries/video/src/processing/video/Video.java deleted file mode 100644 index 1eaa0e090..000000000 --- a/java/libraries/video/src/processing/video/Video.java +++ /dev/null @@ -1,229 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2011-12 Ben Fry and Casey Reas - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.video; - -import org.gstreamer.*; -import processing.core.PApplet; -import processing.core.PConstants; - -import java.io.File; -import java.nio.ByteOrder; -import java.util.List; - -/** - * This class contains some basic functions used by the rest of the classes in - * this library. - */ -public class Video implements PConstants { - // Path that the video library will use to load the GStreamer base libraries - // and plugins from. They can be passed from the application using the - // gstreamer.library.path and gstreamer.plugin.path system variables (see - // comments in initImpl() below). - protected static String gstreamerLibPath = ""; - protected static String gstreamerPluginPath = ""; - - // Direct buffer pass enabled by default. With this mode enabled, no new - // buffers are created and disposed by the GC in each frame (thanks to Octavi - // Estape for suggesting this improvement) which should help performance in - // most situations. - protected static boolean passDirectBuffer = true; - - // OpenGL texture used as buffer sink by default, when the renderer is - // GL-based. This can improve performance significantly, since the video - // frames are automatically copied into the texture without passing through - // the pixels arrays, as well as having the color conversion into RGBA handled - // natively by GStreamer. - protected static boolean useGLBufferSink = true; - - protected static boolean defaultGLibContext = false; - - protected static long INSTANCES_COUNT = 0; - - protected static int bitsJVM; - static { - bitsJVM = PApplet.parseInt(System.getProperty("sun.arch.data.model")); - } - - - static protected void init() { - if (INSTANCES_COUNT == 0) { - initImpl(); - } - INSTANCES_COUNT++; - } - - - static protected void restart() { - removePlugins(); - Gst.deinit(); - initImpl(); - } - - - static protected void initImpl() { - // The location of the GStreamer base libraries can be passed from the - // application to the vide library via a system variable. In Eclipse, add to - // "VM Arguments" in "Run Configurations" the following line: - // -Dgstreamer.library.path=path - String libPath = System.getProperty("gstreamer.library.path"); - if (libPath != null) { - gstreamerLibPath = libPath; - - // If the GStreamer installation referred by gstreamer.library.path is not - // a system installation, then the path containing the plugins needs to be - // specified separately, otherwise the plugins will be automatically - // loaded from the default location. The system property for the plugin - // path is "gstreamer.plugin.path" - String pluginPath = System.getProperty("gstreamer.plugin.path"); - if (pluginPath != null) { - gstreamerPluginPath = pluginPath; - } - } else { - // Paths are build automatically from the curren location of the video - // library. - if (PApplet.platform == LINUX) { - buildLinuxPaths(); - } else if (PApplet.platform == WINDOWS) { - buildWindowsPaths(); - } else if (PApplet.platform == MACOSX) { - buildMacOSXPaths(); - } - } - - if (!gstreamerLibPath.equals("")) { - System.setProperty("jna.library.path", gstreamerLibPath); - } - - if (PApplet.platform == WINDOWS) { - LibraryLoader loader = LibraryLoader.getInstance(); - if (loader == null) { - System.err.println("Cannot load local version of GStreamer libraries."); - } - } - - String[] args = { "" }; - Gst.setUseDefaultContext(defaultGLibContext); - Gst.init("Processing core video", args); - - addPlugins(); - } - - - static protected void addPlugins() { - if (!gstreamerPluginPath.equals("")) { - Registry reg = Registry.getDefault(); - boolean res; - res = reg.scanPath(gstreamerPluginPath); - if (!res) { - System.err.println("Cannot load GStreamer plugins from " + - gstreamerPluginPath); - } - } - } - - - static protected void removePlugins() { - Registry reg = Registry.getDefault(); - List list = reg.getPluginList(); - for (Plugin plg : list) { - reg.removePlugin(plg); - } - } - - - static protected void buildLinuxPaths() { - gstreamerLibPath = ""; - gstreamerPluginPath = ""; - } - - - static protected void buildWindowsPaths() { - LibraryPath libPath = new LibraryPath(); - String path = libPath.get(); - gstreamerLibPath = buildGStreamerLibPath(path, "\\windows" + bitsJVM); - gstreamerPluginPath = gstreamerLibPath + "\\plugins"; - } - - - static protected void buildMacOSXPaths() { - LibraryPath libPath = new LibraryPath(); - String path = libPath.get(); - gstreamerLibPath = buildGStreamerLibPath(path, "/macosx" + bitsJVM); - gstreamerPluginPath = gstreamerLibPath + "/plugins"; - } - - - static protected String buildGStreamerLibPath(String base, String os) { - File path = new File(base + os); - if (path.exists()) { - return base + os; - } else { - return base; - } - } - - - static protected float nanoSecToSecFrac(float nanosec) { - for (int i = 0; i < 3; i++) - nanosec /= 1E3; - return nanosec; - } - - - static protected long secToNanoLong(float sec) { - Float f = new Float(sec * 1E9); - return f.longValue(); - } - - - /** - * Reorders an OpenGL pixel array (RGBA) into ARGB. The array must be - * of size width * height. - * @param pixels int[] - */ - static protected void convertToARGB(int[] pixels, int width, int height) { - int t = 0; - int p = 0; - if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN) { - // RGBA to ARGB conversion: shifting RGB 8 bits to the right, - // and placing A 24 bits to the left. - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - int pixel = pixels[p++]; - pixels[t++] = (pixel >>> 8) | ((pixel << 24) & 0xFF000000); - } - } - } else { - // We have to convert ABGR into ARGB, so R and B must be swapped, - // A and G just brought back in. - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - int pixel = pixels[p++]; - pixels[t++] = ((pixel & 0xFF) << 16) | ((pixel & 0xFF0000) >> 16) | - (pixel & 0xFF00FF00); - } - } - } - } -} diff --git a/pdex/.classpath b/pdex/.classpath new file mode 100644 index 000000000..eed303dde --- /dev/null +++ b/pdex/.classpath @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pdex/.externalToolBuilders/Ant_Builder.launch b/pdex/.externalToolBuilders/Ant_Builder.launch new file mode 100644 index 000000000..9b95f0090 --- /dev/null +++ b/pdex/.externalToolBuilders/Ant_Builder.launch @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/pdex/.gitignore b/pdex/.gitignore new file mode 100644 index 000000000..e79cb3191 --- /dev/null +++ b/pdex/.gitignore @@ -0,0 +1,8 @@ +.DS_Store +.AppleDouble +._* +*~ +bin +mode/ExperimentalMode.jar +dist +build.properties \ No newline at end of file diff --git a/java/libraries/video/.project b/pdex/.project similarity index 52% rename from java/libraries/video/.project rename to pdex/.project index aa59004d2..1dc755de3 100644 --- a/java/libraries/video/.project +++ b/pdex/.project @@ -1,6 +1,6 @@ - processing-video + processing-experimental @@ -10,6 +10,15 @@ + + org.eclipse.ui.externaltools.ExternalToolBuilder + + + LaunchConfigHandle + <project>/.externalToolBuilders/Ant_Builder.launch + + + org.eclipse.jdt.core.javanature diff --git a/java/libraries/video/.settings/org.eclipse.jdt.core.prefs b/pdex/.settings/org.eclipse.jdt.core.prefs old mode 100755 new mode 100644 similarity index 93% rename from java/libraries/video/.settings/org.eclipse.jdt.core.prefs rename to pdex/.settings/org.eclipse.jdt.core.prefs index 1b3d9a205..8000cd6ca --- a/java/libraries/video/.settings/org.eclipse.jdt.core.prefs +++ b/pdex/.settings/org.eclipse.jdt.core.prefs @@ -1,12 +1,11 @@ -#Sat Nov 12 10:54:16 CST 2011 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/pdex/README.md b/pdex/README.md new file mode 100644 index 000000000..f384daadf --- /dev/null +++ b/pdex/README.md @@ -0,0 +1,29 @@ +PDE X +===== + +PDE X is a [Processing](http://processing.org/) Mode that brings powerful new features to the Processing Development Environment: + +* Intelligent Code Completion +* Quick Renaming(Refactoring) +* Quick Navigation +* Import Suggestions +* Live Error Checker +* Integrated Debugger +* Integrated TweakMode + +Find out more at [Getting Started](https://github.com/processing/processing-experimental/wiki/Getting-Started). Or checkout the [FAQ](https://github.com/processing/processing-experimental/wiki/FAQ) + +PDE X was originally developed in its own [processing-experimental](https://github.com/processing/processing-experimental) repo, but has now been moved into the main processing code base. PDE X has been set as the default startup mode. (Java Mode still exists, though no longer the default mode) + +Manindra Moharana + +Last Updated: 7 July, 2014 + +-- +#### Contributors + +* [Martin Leopold](https://github.com/martinleopold) - Debugger +* [Gal Sasson](https://github.com/galsasson) - Tweak Mode + +-- +PDE X is supported by Google Summer of [Code 2013](http://www.google-melange.com/gsoc/homepage/google/gsoc2013), [2014](https://www.google-melange.com/gsoc/homepage/google/gsoc2014) \ No newline at end of file diff --git a/pdex/Todo, GSoC 2013.txt b/pdex/Todo, GSoC 2013.txt new file mode 100644 index 000000000..c7020fcc0 --- /dev/null +++ b/pdex/Todo, GSoC 2013.txt @@ -0,0 +1,170 @@ +TODO List for Experimental Mode Plus- GSOC 2013 + +This would also be a break down of my thought process and ideas as I tackle various tasks. Also lines are fairly long. Make sure you turn on word wrap. ;) + +Manindra Moharana (me@mkmoharana.com) + +[ ]: Todo, [x] : Done, ? : Undecided Todo, ! : Critical, + : Minor Todo + +Code Completion +=============== + +The big stuff: + +*! May be I should just implement recursive find for compiled code first, see how it goes and hopefully it would give me some ideas about how to integrating the two. + - Making very good progress here. The elegance of recurion - Hats off! + - Many of the cases seem to have been covered, and I'm achieving more and more code unification as I'm working through the problem step by step + - Looks almost complete now, nearly all cases covered(July 13th) +x After popup appears, the popup location is fixed for the current line. So if editor window is moved while staying in the same line, popup appears at the prev location. Need to ensure editor is still at last know location. Fixed. +[ ]Keyboard Shortcut for completion popup - Ctrl + Space +[ ]Scope handling? Static/non static scope? +[ ]Disable completions on comment line +[ ]Trie implementation would be lower priority, "premature optimisation is pure evil". Get all features of CC working good enough and then plan this. + +[x]Ensure that a compilation unit is created at startup! +x! Code competition for local code is working with recursive look up. +[x]Completion doesn't seem to show up for fields of a type defined locally. But works for methods with return type defined locally. Take ideas. Some case missing most probably. Fixed +[x]Discovered another major issue due to offset differences -> While looking for predictions, if the parsed string contains pde enhancements, predictions FAIL! Zomg. +Ex - "s.substring(int(13.4))." fails. Thinking to just do the substitutions before sending it to updatePredictions(), coz offsets aren't really a concern here, right? Yup, fixed it! +x! Code completion with library code, non-nested seems to be broken, fix it. Fixed. +[x]Completion for external classes - ArrayList, HashMap, etc. +x! Recursive lookup for compiled(library) code! +x! Library CC for nested would be tricky. Need to jump from local->compiled code while searching recursively. Recursive find's current implementation is based on ASTNode return type. Afaik, no way to instantiate orphaned ASTNode objects(or did I miss it?). ASTNode objects have to be created only from the main ast instance. But I need to find a way to switch to compiled instances from local class instance. +x! Should I implement wrapper for ASTNode? - possibly needed for code completion with compiled and non-compiled code. Done. +[x]Differentiating between multiple statements on the same line. How to? Done with offset handling. +[x]- Cache predictions if current 'word' is increasing in length. If already showing predictions beginning with 's', for 'sa', remove extra completions, rather than recalculating predictions. Performance increase. +[x]Parameterized type support is broken. +[x]Array types, all all other types support broken. :\ +[x]Completion for array access, strings[0]. + +Finer details + +[ ]findDeclarations should support 3rd party classes too. It's about time. ;) +[ ]printStuff(int,float,String) - completion endings have to be appropriate. Right now it's just printStuff(,,). Cursor positioning also needs to be taken care of(done). Argument list as tooltip if possible? +*! p5 enhanced stuff in java, how does it fit in with everything else, and edge cases. Possibly add support for them. Offset handling improvements should help here. +[ ]Diamond operator isn't supported for now. Bummer. + +[x]Completion popup height is now dynamic, decreases to fit. +[ ]Completion width can be dynamic, if really needed.. +[x]Icons for completions? Or overkill right now? +[x]'Show Usage' menu item added +[x]Show declaring class for completions +x! Ignore String case while finding completion candidates +[x]Multiple 3rd party classes found in various packages. Not a chance no more. +[x]Obj a1; a1.-> completion doesn't work before it is instantiated. Look into that. Began working again by itself. Yay! +[x]Cursor positioning should be after the first ( if arguments present, else after () +[x]Display the type of Completion(method return type, variable type) in the popup. + - facing some issues for local types. Fixed. +[x]Sorted list of completion candidates - fields, then methods. It's unsorted presently. +[x]Reflection API - getMethods vs getDeclaredMethods. declared. +[x]Need to add offset correction to ASTGenerator and its lookup methods. Or leave it for later? All set to implement +[x]Completion List should get hidden on hitting esc key + +Offset Mapping +============== + +First major hurdle is offset mapping +*! pde<->java code offset : precise conversion needed +[ ]W.r.t PDE specific enhancements, things are almost working. There are some offset issues when multiple pde statements are in the same line, but I guess it's good enough for now to proceed ahead. Will keep a close watch for potential bugs. +[x]for the above, I've decide to first implement a sketch outline like feature, which would highlight an AST element precisely in the pde code. This would ensure I've got the mapping working properly. And may lead to a future feature. +[x]This is precise upto a certain line. Once on a line, pde stuff have to be taken into consideration. +[x]Edge case - multiple statements in a single line +[x]PDE specific enhancements will also have to be tackled like int(), # literals. The length of the node returned needs to be modified to make up for extra chars added like PApplet.parseFloat, etc. Also the 2nd or futher pde enhancements in the same line means even the beginning offset would need adjustment. Meh. + +Refactoring +=========== + +[ ]Undo misbehaves here, handle carefully. +[ ]Fails to rename the first defined global variable, if a javadoc comment precedes it. But owrds for single/multiline comments. Wth! +[x]New Name is validated. +[x]Ordered list in 'Show Usage' window +[x]Add support for word select on right click and rename, mouse co-ordinates need to obtained carefully + +Refactoring would work only when code is compiler error free. I plan to do a find replace type op on the compile ready code. +1. First identify the declaration of the variable in the AST. We'll then make a list of all its occurrences. +2. DFS through the AST, for each (SimpleName)instance of the word in code, find if the matched word is the same one whose declaration we found. +[x]Edge Case: For renaming a TypeDeclaration, the declaration of SimpleName instance of the TD and it's constructor(s) aren't added to the list generated by DFS. So for renaming TD, will have to manually add the TD SimpleName and it's constructors' SimpleNames to the a list of declaration nodes that can be positively matched against. +[x]Renaming any constructor is equivalent to renaming the TD +3. Find corresponding PDE offsets of the SimpleNames, rename in each line. +[x]Edge Case: Need to take displaced offsets on a line, due to pde enhancements, into consideration. +4. All the changes in code would be made in a separate copy of the code(?). After all the renaming is done, allow it only if the new code compiles. Basically an undo should be possible in case of conflicts. +[x]Refactoring ui +[x]For now, user needs to highlight the name of the var, and then right-click -> Rename.. +[x]Handle saving. If sketch closed after renaming w/o saving find bugs. Done, marking the sketch as modified after renaming. + +Quick Navigation +================ + +*+ A silly bug where the name of the first field declaration isn't highlighted correctly. Seems to be happening if there's a javadoc or multiline comment near about the top. + +[x]On OS X, Ctrl + Click is right mouse click, so implement Cmd + Click instead. isMetaDown()? +[x]Ctrl + Click on an element to scroll to its definition in code +[x]Local Vars +[x]Local Methods +[x]Local Classes +[x]Recursive lookup, a.b().c() +[x]Now highlihgting the declaration name, rather than the whole declaration. + +Sketch Outline +============== + +[x]Show Sketch Outline Tree +[x]Filter stuff in text field +[x]Add icons - custom cell renderer + +Suggestion for missing imports +============================== + +[ ]Find a more subtle way to suggest for imports. The current method is too troublesome. Randomly pops up offering suggestions. May intimidate beginners. + +1. In compileCheck() in ECS, check if error message is of the type "__" cannot be resolved to a type. +2. Find the class name via astGen, and suggest import as a popup. +[x]Barebones functionality done. +[x]Add imports only to beginning of first tab. +[x]Search within contributed libraries folder +[x]Hide suggestion list before showing import suggestions +[x]Search within code folder of sketch + +Labels for Java elements +======================== + +[x]Working for local code +[ ]Need to modify getASTNodeAt to also fetch the type for predefined classes. +[ ]Labels for predefined class objects +[ ]Chaining support for labels + +Synchronization +=============== + +Gotta do it carefully between main thread, ECS Thread, and SwingWorker threads +Fields that are concurrently accessed: + +ECS members: +[x]ArrayList problems - updated in ECS, accessed by ErrorBar.update() +[x]ArrayList classpathJars - updated in ECS, accessed by ASTGenerator.loadJars() +[x]hasErrors, syntaxErrors - Atomic Boolean +[x]boolean warningsEnabled - made it volatile +[ ]CompilationUnit cu - updated in ECS, accessed a zillion times in ASTGenerator :'( + + +General Stuff +============= + +[ ][Critical] PermGen out of memory bug. Manually triggering GC after making the classloader null ensures permgen memory is reclaimed on editor exit. Max open window still limited by max permgen size. Also, added a classloadcounter in ECS to trigger GC periodically. +https://github.com/processing/processing-experimental/issues/1 +See: http://stackoverflow.com/questions/2095974/how-to-unload-a-already-loaded-class-in-java +I'm making the classLoader null, but what about the classes loaded by ASTGen? Investigate. +[x]Disabling Error Checking disables predictions as well! Fixed. +[x]Added doc listener for text area updates +[x]Consult Ben on where to save preferences - main preferences.txt or custom one. - Main prefs file +[x]Save preferences to main preference.txt +[x]Hide breakpoint markers when Debugger isn't active +[x]Ensure gutter mouse handler is taken care of when hiding Debugger breakpoint bar. +[x]Ensure all editor windows are closed when editor is closed. +[x]Add a red marker near Errors label in console toggle, to indicate errors present in sketch. +[x]Add option for toggling debug output +[x]On Run/Debug Console is visible(ProblemsList hidden) +[ ]Update wiki for Ctrl + H instead of Ctrl + J shortcuts +[x]update build.xml to produce dists +[x]Make this a contributed mode - mode.txt, github releases feature, version numbering, git tags, etc +[x]Add GitHub link to PDE X Menu diff --git a/pdex/application/Info.plist.tmpl b/pdex/application/Info.plist.tmpl new file mode 100644 index 000000000..28a2e0277 --- /dev/null +++ b/pdex/application/Info.plist.tmpl @@ -0,0 +1,74 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + @@sketch@@ + CFBundleIconFile + sketch.icns + CFBundleIdentifier + @@sketch@@ + CFBundleDisplayName + @@sketch@@ + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + @@sketch@@ + CFBundlePackageType + APPL + + + CFBundleShortVersionString + 1 + CFBundleVersion + 1 + CFBundleSignature + ???? + NSHumanReadableCopyright + Your copyright here + CFBundleGetInfoString + Created with Processing + + + @@jvm_runtime@@ + + JVMMainClassName + @@sketch@@ + + LSMinimumSystemVersion + 10.7.3 + + NSHighResolutionCapable + + + LSArchitecturePriority + + x86_64 + + + LSEnvironment + + LC_CTYPE + UTF-8 + + + LSUIPresentationMode + @@lsuipresentationmode@@ + + JVMOptions + + @@jvm_options_list@@ + -Xdock:icon=Contents/Resources/sketch.icns + -Dapple.laf.useScreenMenuBar=true + -Dcom.apple.macos.use-file-dialog-packages=true + -Dcom.apple.macos.useScreenMenuBar=true + -Dcom.apple.mrj.application.apple.menu.about.name=@@sketch@@ + -Dcom.apple.smallTabs=true + + JVMArguments + + + + diff --git a/pdex/application/sketch.icns b/pdex/application/sketch.icns new file mode 100644 index 000000000..2bdb4dfc2 Binary files /dev/null and b/pdex/application/sketch.icns differ diff --git a/pdex/application/template.app/Contents/MacOS/JavaApplicationStub b/pdex/application/template.app/Contents/MacOS/JavaApplicationStub new file mode 100755 index 000000000..56ec300e5 Binary files /dev/null and b/pdex/application/template.app/Contents/MacOS/JavaApplicationStub differ diff --git a/pdex/application/template.app/Contents/PkgInfo b/pdex/application/template.app/Contents/PkgInfo new file mode 100755 index 000000000..bd04210fb --- /dev/null +++ b/pdex/application/template.app/Contents/PkgInfo @@ -0,0 +1 @@ +APPL???? \ No newline at end of file diff --git a/pdex/application/template.app/Contents/Resources/sketch.icns b/pdex/application/template.app/Contents/Resources/sketch.icns new file mode 100644 index 000000000..2bdb4dfc2 Binary files /dev/null and b/pdex/application/template.app/Contents/Resources/sketch.icns differ diff --git a/pdex/application/template.exe b/pdex/application/template.exe new file mode 100755 index 000000000..03d8d5753 Binary files /dev/null and b/pdex/application/template.exe differ diff --git a/pdex/application/template.plist b/pdex/application/template.plist new file mode 100755 index 000000000..a9e22b9c5 --- /dev/null +++ b/pdex/application/template.plist @@ -0,0 +1,77 @@ + + + + + CFBundleName + @@sketch@@ + CFBundleVersion + 1.0 + CFBundleAllowMixedLocalizations + true + CFBundleExecutable + JavaApplicationStub + CFBundleDevelopmentRegion + English + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleInfoDictionaryVersion + 6.0 + CFBundleIconFile + sketch.icns + CFBundleIdentifier + @@sketch@@ + + + LSUIPresentationMode + @@lsuipresentationmode@@ + + LSArchitecturePriority + + @@lsarchitecturepriority@@ + + + Java + + VMOptions + @@vmoptions@@ + + MainClass + @@sketch@@ + + + JVMVersion + 1.6* + + ClassPath + @@classpath@@ + + + Properties + + apple.laf.useScreenMenuBar + true + apple.awt.showGrowBox + false + com.apple.smallTabs + true + apple.awt.Antialiasing + false + apple.awt.TextAntialiasing + true + com.apple.hwaccel + true + + apple.awt.use-file-dialog-packages + true + + + + diff --git a/pdex/build.properties b/pdex/build.properties new file mode 100644 index 000000000..4cb63ab8a --- /dev/null +++ b/pdex/build.properties @@ -0,0 +1,10 @@ +sketchbook.location=${user.home}/Documents/Processing +classpath.local.location=${user.home}/Documents/workspace/libs +core.library.location=../core/library +app.library.location=../app/ +java.target.version=1.7 +lib.name=ExperimentalMode +prettyName=PDE X +dist=dist +release=7 +prettyVersion=1.0.4b diff --git a/pdex/build.xml b/pdex/build.xml new file mode 100644 index 000000000..a839c9160 --- /dev/null +++ b/pdex/build.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pdex/keywords.txt b/pdex/keywords.txt new file mode 100644 index 000000000..5ba33d3ab --- /dev/null +++ b/pdex/keywords.txt @@ -0,0 +1,890 @@ +# For an explanation of these tags, see Token.java +# trunk/processing/app/src/processing/app/syntax/Token.java + +ADD LITERAL2 blend_ +ALIGN_CENTER LITERAL2 +ALIGN_LEFT LITERAL2 +ALIGN_RIGHT LITERAL2 +ALPHA LITERAL2 +ALPHA_MASK LITERAL2 +ALT LITERAL2 +AMBIENT LITERAL2 +ARC LITERAL2 createShape_ +ARROW LITERAL2 cursor_ +ARGB LITERAL2 +BACKSPACE LITERAL2 keyCode +BASELINE LITERAL2 textAlign_ +BEVEL LITERAL2 strokeJoin_ +BLEND LITERAL2 blend_ +BLUE_MASK LITERAL2 +BLUR LITERAL2 filter_ +BOTTOM LITERAL2 textAlign_ +BOX LITERAL2 createShape_ +BURN LITERAL2 blend_ +CENTER LITERAL2 +CHATTER LITERAL2 +CHORD LITERAL2 arc_ +CLAMP LITERAL2 +CLICK LITERAL2 +CLOSE LITERAL2 +CMYK LITERAL2 +CODED LITERAL2 key +COMPLAINT LITERAL2 +COMPOSITE LITERAL2 +COMPONENT LITERAL2 +CONCAVE_POLYGON LITERAL2 +CONTROL LITERAL2 +CONVEX_POLYGON LITERAL2 +CORNER LITERAL2 textAlign_ +CORNERS LITERAL2 +CROSS LITERAL2 cursor_ +CUSTOM LITERAL2 +DARKEST LITERAL2 blend_ +DEGREES LITERAL2 +DEG_TO_RAD LITERAL2 +DELETE LITERAL2 +DIAMETER LITERAL2 +DIFFERENCE LITERAL2 blend_ +DIFFUSE LITERAL2 +DILATE LITERAL2 filter_ +DIRECTIONAL LITERAL2 +DISABLE_ACCURATE_2D LITERAL2 +DISABLE_DEPTH_MASK LITERAL2 +DISABLE_DEPTH_SORT LITERAL2 +DISABLE_DEPTH_TEST LITERAL2 +DISABLE_NATIVE_FONTS LITERAL2 +DISABLE_OPENGL_ERRORS LITERAL2 +DISABLE_PURE_STROKE LITERAL2 +DISABLE_TEXTURE_MIPMAPS LITERAL2 +DISABLE_TRANSFORM_CACHE LITERAL2 +DISABLE_STROKE_PERSPECTIVE LITERAL2 +DISABLED LITERAL2 +DODGE LITERAL2 blend_ +DOWN LITERAL2 keyCode +DRAG LITERAL2 +DXF LITERAL2 size_ +ELLIPSE LITERAL2 createShape_ +ENABLE_ACCURATE_2D LITERAL2 +ENABLE_DEPTH_MASK LITERAL2 +ENABLE_DEPTH_SORT LITERAL2 +ENABLE_DEPTH_TEST LITERAL2 +ENABLE_NATIVE_FONTS LITERAL2 +ENABLE_OPENGL_ERRORS LITERAL2 +ENABLE_PURE_STROKE LITERAL2 +ENABLE_TEXTURE_MIPMAPS LITERAL2 +ENABLE_TRANSFORM_CACHE LITERAL2 +ENABLE_STROKE_PERSPECTIVE LITERAL2 +ENTER LITERAL2 keyCode +EPSILON LITERAL2 +ERODE LITERAL2 filter_ +ESC LITERAL2 keyCode +EXCLUSION LITERAL2 blend_ +EXIT LITERAL2 +GIF LITERAL2 +GRAY LITERAL2 filter_ +GREEN_MASK LITERAL2 +GROUP LITERAL2 +HALF LITERAL2 +HALF_PI LITERAL2 HALF_PI +HAND LITERAL2 cursor_ +HARD_LIGHT LITERAL2 blend_ +HINT_COUNT LITERAL2 +HSB LITERAL2 colorMode_ +IMAGE LITERAL2 textureMode_ +INVERT LITERAL2 filter_ +JPEG LITERAL2 +LEFT LITERAL2 keyCode +LIGHTEST LITERAL2 blend_ +LINE LITERAL2 createShape_ +LINES LITERAL2 beginShape_ +LINUX LITERAL2 +MACOSX LITERAL2 +MAX_FLOAT LITERAL2 +MAX_INT LITERAL2 +MIN_FLOAT LITERAL2 +MIN_INT LITERAL2 +MITER LITERAL2 stokeJoin_ +MODEL LITERAL2 textMode_ +MOVE LITERAL2 cursor_ +MULTIPLY LITERAL2 blend_ +NORMAL LITERAL2 +NORMALIZED LITERAL2 textureMode_ +NO_DEPTH_TEST LITERAL2 +NTSC LITERAL2 +ONE LITERAL2 +OPAQUE LITERAL2 filter_ +OPEN LITERAL2 +ORTHOGRAPHIC LITERAL2 +OVERLAY LITERAL2 blend_ +PAL LITERAL2 +PDF LITERAL2 size_ +P2D LITERAL2 size_ +P3D LITERAL2 size_ +PERSPECTIVE LITERAL2 +PI LITERAL2 PI +PIE LITERAL2 +PIXEL_CENTER LITERAL2 +POINT LITERAL2 +POINTS LITERAL2 +POSTERIZE LITERAL2 filter_ +PRESS LITERAL2 +PROBLEM LITERAL2 +PROJECT LITERAL2 strokeCap_ +QUAD LITERAL2 createShape_ +QUAD_STRIP LITERAL2 beginShape_ +QUADS LITERAL2 beginShape_ +QUARTER_PI LITERAL2 QUARTER_PI +RAD_TO_DEG LITERAL2 +RADIUS LITERAL2 +RADIANS LITERAL2 +RECT LITERAL2 +RED_MASK LITERAL2 +RELEASE LITERAL2 +REPEAT LITERAL2 +REPLACE LITERAL2 +RETURN LITERAL2 +RGB LITERAL2 colorMode_ +RIGHT LITERAL2 keyCode +ROUND LITERAL2 strokeCap_ +SCREEN LITERAL2 blend_ +SECAM LITERAL2 +SHAPE LITERAL2 textMode_ +SHIFT LITERAL2 +SPECULAR LITERAL2 +SPHERE LITERAL2 createShape_ +SOFT_LIGHT LITERAL2 blend_ +SQUARE LITERAL2 strokeCap_ +SUBTRACT LITERAL2 blend_ +SVIDEO LITERAL2 +TAB LITERAL2 keyCode +TARGA LITERAL2 +TAU LITERAL2 TAU +TEXT LITERAL2 cursor_ +TFF LITERAL2 +THIRD_PI LITERAL2 +THRESHOLD LITERAL2 filter_ +TIFF LITERAL2 +TOP LITERAL2 textAlign_ +TRIANGLE LITERAL2 createShape_ +TRIANGLE_FAN LITERAL2 beginShape_ +TRIANGLES LITERAL2 beginShape_ +TRIANGLE_STRIP LITERAL2 beginShape_ +TUNER LITERAL2 +TWO LITERAL2 +TWO_PI LITERAL2 TWO_PI +UP LITERAL2 keyCode +WAIT LITERAL2 cursor_ +WHITESPACE LITERAL2 + + +# Java keywords (void, import, , etc.) + +abstract KEYWORD1 +assert KEYWORD1 +break KEYWORD1 break +case KEYWORD1 case +class KEYWORD1 class +continue KEYWORD1 continue +default KEYWORD1 default +enum KEYWORD1 +extends KEYWORD1 extends +false KEYWORD1 false +final KEYWORD1 final +finally KEYWORD1 +implements KEYWORD1 implements +import KEYWORD1 import +instanceof KEYWORD1 +interface KEYWORD1 +native KEYWORD1 +new KEYWORD1 new +null KEYWORD1 null +package KEYWORD1 +private KEYWORD1 private +protected KEYWORD1 +public KEYWORD1 public +return KEYWORD1 return +static KEYWORD1 static +strictfp KEYWORD1 +super KEYWORD1 super +this KEYWORD1 this +throw KEYWORD1 +throws KEYWORD1 +transient KEYWORD1 +true KEYWORD1 true +void KEYWORD1 void +volatile KEYWORD1 + + +# Datatypes + +Array KEYWORD5 Array +ArrayList KEYWORD5 ArrayList +Boolean KEYWORD5 +Byte KEYWORD5 +BufferedReader KEYWORD5 BufferedReader +Character KEYWORD5 +Class KEYWORD5 class +Double KEYWORD5 +Float KEYWORD5 +Integer KEYWORD5 +HashMap KEYWORD5 HashMap +PrintWriter KEYWORD5 PrintWriter +String KEYWORD5 String +StringBuffer KEYWORD5 +Thread KEYWORD5 +boolean KEYWORD5 boolean +byte KEYWORD5 byte +char KEYWORD5 char +color KEYWORD5 color_datatype +double KEYWORD5 double +float KEYWORD5 float +int KEYWORD5 int +long KEYWORD5 long +short KEYWORD5 + + +# Flow structures + +catch KEYWORD3 catch +do KEYWORD3 +for KEYWORD3 for +if KEYWORD3 if +else KEYWORD3 else +switch KEYWORD3 switch +synchronized KEYWORD3 +while KEYWORD3 while +try KEYWORD3 try + +catch FUNCTION3 catch +do FUNCTION3 +for FUNCTION3 for +if FUNCTION3 if +#else FUNCTION3 else +switch FUNCTION3 switch +synchronized FUNCTION3 +while FUNCTION3 while +#try FUNCTION3 try + + +# These items are a part of Processing but, but pages don't generate + +boolean FUNCTION1 booleanconvert_ +byte FUNCTION1 byteconvert_ +cache FUNCTION2 +char FUNCTION1 charconvert_ +start FUNCTION1 +stop FUNCTION1 +breakShape FUNCTION1 +createPath FUNCTION1 +float FUNCTION1 floatconvert_ +int FUNCTION1 intconvert_ +str FUNCTION1 strconvert_ +loadMatrix FUNCTION1 +parseBoolean FUNCTION1 +parseByte FUNCTION1 +parseChar FUNCTION1 +parseFloat FUNCTION1 +parseInt FUNCTION1 +saveFile FUNCTION1 +savePath FUNCTION1 +sketchFile FUNCTION1 +sketchPath FUNCTION1 + +readLine FUNCTION2 BufferedReader_readLine_ +close FUNCTION2 PrintWriter_close_ +flush FUNCTION2 PrintWriter_flush_ +print FUNCTION2 PrintWriter_print_ +println FUNCTION2 PrintWriter_println_ +charAt FUNCTION2 String_charAt_ +equals FUNCTION2 String_equals_ +indexOf FUNCTION2 String_indexOf_ +length FUNCTION2 String_length_ +substring FUNCTION2 String_substring_ +toLowerCase FUNCTION2 String_toLowerCase_ +toUpperCase FUNCTION2 String_toUpperCase_ + +length KEYWORD2 String + + +# Temporary additions 3 September 2012 as the reference is getting updated + +end FUNCTION1 +addChild FUNCTION1 + +# Operators are without KEYWORDS + ++= addassign ++ addition +[] arrayaccess += assign +& bitwiseAND +| bitwiseOR +, comma +// comment +? conditional +{} curlybraces +-- decrement +/ divide +/= divideassign +/** doccomment +. dot +== equality +> greaterthan +>= greaterthanorequalto +++ increment +!= inequality +<< leftshift +< lessthan +<= lessthanorequalto +&& logicalAND +! logicalNOT +|| logicalOR +- minus +% modulo +/* multilinecomment +* multiply +*= multiplyassign +() parentheses +>> rightshift +; semicolon +-= subtractassign + +# Suppressed from Generate to avoid conflicts with variables inside methods + +width KEYWORD4 width_ +height KEYWORD4 height_ + +PVector FUNCTION1 PVector +ArrayList FUNCTION1 ArrayList +HashMap FUNCTION1 HashMap + + +# THE TEXT ABOVE IS HAND-WRITTEN AND FOUND IN THE FILE "keywords_base.txt" +# THE TEXT BELOW IS AUTO-GENERATED +# +# SO DON'T +# TOUCH IT + + +abs FUNCTION1 abs_ +acos FUNCTION1 acos_ +alpha FUNCTION1 alpha_ +ambient FUNCTION1 ambient_ +ambientLight FUNCTION1 ambientLight_ +append FUNCTION1 append_ +applyMatrix FUNCTION1 applyMatrix_ +arc FUNCTION1 arc_ +arrayCopy FUNCTION1 arrayCopy_ +asin FUNCTION1 asin_ +atan FUNCTION1 atan_ +atan2 FUNCTION1 atan2_ +background FUNCTION1 background_ +beginCamera FUNCTION1 beginCamera_ +beginContour FUNCTION1 beginContour_ +beginRaw FUNCTION1 beginRaw_ +beginRecord FUNCTION1 beginRecord_ +beginShape FUNCTION1 beginShape_ +bezier FUNCTION1 bezier_ +bezierDetail FUNCTION1 bezierDetail_ +bezierPoint FUNCTION1 bezierPoint_ +bezierTangent FUNCTION1 bezierTangent_ +bezierVertex FUNCTION1 bezierVertex_ +binary FUNCTION1 binary_ +blend FUNCTION1 blend_ +blendColor FUNCTION1 blendColor_ +blendMode FUNCTION1 blendMode_ +blue FUNCTION1 blue_ +box FUNCTION1 box_ +brightness FUNCTION1 brightness_ +camera FUNCTION1 camera_ +ceil FUNCTION1 ceil_ +clear FUNCTION1 clear_ +clip FUNCTION1 clip_ +color FUNCTION1 color_ +colorMode FUNCTION1 colorMode_ +concat FUNCTION1 concat_ +constrain FUNCTION1 constrain_ +copy FUNCTION1 copy_ +cos FUNCTION1 cos_ +createFont FUNCTION1 createFont_ +createGraphics FUNCTION1 createGraphics_ +createImage FUNCTION1 createImage_ +createInput FUNCTION1 createInput_ +createOutput FUNCTION1 createOutput_ +createReader FUNCTION1 createReader_ +createShape FUNCTION1 createShape_ +createWriter FUNCTION1 createWriter_ +cursor FUNCTION1 cursor_ +curve FUNCTION1 curve_ +curveDetail FUNCTION1 curveDetail_ +curvePoint FUNCTION1 curvePoint_ +curveTangent FUNCTION1 curveTangent_ +curveTightness FUNCTION1 curveTightness_ +curveVertex FUNCTION1 curveVertex_ +day FUNCTION1 day_ +degrees FUNCTION1 degrees_ +directionalLight FUNCTION1 directionalLight_ +displayHeight KEYWORD4 displayHeight +displayWidth KEYWORD4 displayWidth +dist FUNCTION1 dist_ +draw FUNCTION4 draw +ellipse FUNCTION1 ellipse_ +ellipseMode FUNCTION1 ellipseMode_ +emissive FUNCTION1 emissive_ +endCamera FUNCTION1 endCamera_ +endContour FUNCTION1 endContour_ +endRaw FUNCTION1 endRaw_ +endRecord FUNCTION1 endRecord_ +endShape FUNCTION1 endShape_ +exit FUNCTION1 exit_ +exp FUNCTION1 exp_ +expand FUNCTION1 expand_ +fill FUNCTION1 fill_ +filter FUNCTION1 filter_ +FloatDict KEYWORD5 FloatDict +add FUNCTION2 FloatDict_add_ +clear FUNCTION2 FloatDict_clear_ +div FUNCTION2 FloatDict_div_ +get FUNCTION2 FloatDict_get_ +hasKey FUNCTION2 FloatDict_hasKey_ +keyArray FUNCTION2 FloatDict_keyArray_ +keys FUNCTION2 FloatDict_keys_ +mult FUNCTION2 FloatDict_mult_ +remove FUNCTION2 FloatDict_remove_ +set FUNCTION2 FloatDict_set_ +size FUNCTION2 FloatDict_size_ +sortKeys FUNCTION2 FloatDict_sortKeys_ +sortKeysReverse FUNCTION2 FloatDict_sortKeysReverse_ +sortValues FUNCTION2 FloatDict_sortValues_ +sortValuesReverse FUNCTION2 FloatDict_sortValuesReverse_ +sub FUNCTION2 FloatDict_sub_ +valueArray FUNCTION2 FloatDict_valueArray_ +values FUNCTION2 FloatDict_values_ +FloatList KEYWORD5 FloatList +add FUNCTION2 FloatList_add_ +append FUNCTION2 FloatList_append_ +array FUNCTION2 FloatList_array_ +clear FUNCTION2 FloatList_clear_ +div FUNCTION2 FloatList_div_ +get FUNCTION2 FloatList_get_ +hasValue FUNCTION2 FloatList_hasValue_ +max FUNCTION2 FloatList_max_ +min FUNCTION2 FloatList_min_ +mult FUNCTION2 FloatList_mult_ +remove FUNCTION2 FloatList_remove_ +reverse FUNCTION2 FloatList_reverse_ +set FUNCTION2 FloatList_set_ +shuffle FUNCTION2 FloatList_shuffle_ +size FUNCTION2 FloatList_size_ +sort FUNCTION2 FloatList_sort_ +sortReverse FUNCTION2 FloatList_sortReverse_ +sub FUNCTION2 FloatList_sub_ +floor FUNCTION1 floor_ +focused KEYWORD4 focused +frameCount KEYWORD4 frameCount +frameRate KEYWORD4 frameRate +frameRate FUNCTION1 frameRate_ +frustum FUNCTION1 frustum_ +get FUNCTION1 get_ +green FUNCTION1 green_ +HALF_PI LITERAL2 HALF_PI +hex FUNCTION1 hex_ +hint FUNCTION1 hint_ +hour FUNCTION1 hour_ +hue FUNCTION1 hue_ +image FUNCTION1 image_ +imageMode FUNCTION1 imageMode_ +IntDict KEYWORD5 IntDict +add FUNCTION2 IntDict_add_ +clear FUNCTION2 IntDict_clear_ +div FUNCTION2 IntDict_div_ +get FUNCTION2 IntDict_get_ +hasKey FUNCTION2 IntDict_hasKey_ +increment FUNCTION2 IntDict_increment_ +keyArray FUNCTION2 IntDict_keyArray_ +keys FUNCTION2 IntDict_keys_ +mult FUNCTION2 IntDict_mult_ +remove FUNCTION2 IntDict_remove_ +set FUNCTION2 IntDict_set_ +size FUNCTION2 IntDict_size_ +sortKeys FUNCTION2 IntDict_sortKeys_ +sortKeysReverse FUNCTION2 IntDict_sortKeysReverse_ +sortValues FUNCTION2 IntDict_sortValues_ +sortValuesReverse FUNCTION2 IntDict_sortValuesReverse_ +sub FUNCTION2 IntDict_sub_ +valueArray FUNCTION2 IntDict_valueArray_ +values FUNCTION2 IntDict_values_ +IntList KEYWORD5 IntList +add FUNCTION2 IntList_add_ +append FUNCTION2 IntList_append_ +array FUNCTION2 IntList_array_ +clear FUNCTION2 IntList_clear_ +div FUNCTION2 IntList_div_ +get FUNCTION2 IntList_get_ +hasValue FUNCTION2 IntList_hasValue_ +increment FUNCTION2 IntList_increment_ +max FUNCTION2 IntList_max_ +min FUNCTION2 IntList_min_ +mult FUNCTION2 IntList_mult_ +remove FUNCTION2 IntList_remove_ +reverse FUNCTION2 IntList_reverse_ +set FUNCTION2 IntList_set_ +shuffle FUNCTION2 IntList_shuffle_ +size FUNCTION2 IntList_size_ +sort FUNCTION2 IntList_sort_ +sortReverse FUNCTION2 IntList_sortReverse_ +sub FUNCTION2 IntList_sub_ +join FUNCTION1 join_ +JSONArray KEYWORD5 JSONArray +append FUNCTION2 JSONArray_append_ +getBoolean FUNCTION2 JSONArray_getBoolean_ +getFloat FUNCTION2 JSONArray_getFloat_ +getInt FUNCTION2 JSONArray_getInt_ +getIntArray FUNCTION2 JSONArray_getIntArray_ +getJSONArray FUNCTION2 JSONArray_getJSONArray_ +getJSONObject FUNCTION2 JSONArray_getJSONObject_ +getString FUNCTION2 JSONArray_getString_ +getStringArray FUNCTION2 JSONArray_getStringArray_ +remove FUNCTION2 JSONArray_remove_ +setBoolean FUNCTION2 JSONArray_setBoolean_ +setFloat FUNCTION2 JSONArray_setFloat_ +setInt FUNCTION2 JSONArray_setInt_ +getJSONArray FUNCTION2 JSONArray_setJSONArray_ +getJSONObject FUNCTION2 JSONArray_setJSONObject_ +setString FUNCTION2 JSONArray_setString_ +size FUNCTION2 JSONArray_size_ +JSONObject KEYWORD5 JSONObject +getBoolean FUNCTION2 JSONObject_getBoolean_ +getFloat FUNCTION2 JSONObject_getFloat_ +getInt FUNCTION2 JSONObject_getInt_ +getJSONArray FUNCTION2 JSONObject_getJSONArray_ +getJSONObject FUNCTION2 JSONObject_getJSONObject_ +getString FUNCTION2 JSONObject_getString_ +setBoolean FUNCTION2 JSONObject_setBoolean_ +setFloat FUNCTION2 JSONObject_setFloat_ +setInt FUNCTION2 JSONObject_setInt_ +setJSONArray FUNCTION2 JSONObject_setJSONArray_ +setJSONObject FUNCTION2 JSONObject_setJSONObject_ +setString FUNCTION2 JSONObject_setString_ +key KEYWORD4 key +keyCode KEYWORD4 keyCode +keyPressed FUNCTION4 keyPressed +keyPressed KEYWORD4 keyPressed +keyReleased FUNCTION4 keyReleased +keyTyped FUNCTION4 keyTyped +lerp FUNCTION1 lerp_ +lerpColor FUNCTION1 lerpColor_ +lightFalloff FUNCTION1 lightFalloff_ +lights FUNCTION1 lights_ +lightSpecular FUNCTION1 lightSpecular_ +line FUNCTION1 line_ +loadBytes FUNCTION1 loadBytes_ +loadFont FUNCTION1 loadFont_ +loadImage FUNCTION1 loadImage_ +loadJSONArray FUNCTION1 loadJSONArray_ +loadJSONObject FUNCTION1 loadJSONObject_ +loadPixels FUNCTION1 loadPixels_ +loadShader FUNCTION1 loadShader_ +loadShape FUNCTION1 loadShape_ +loadStrings FUNCTION1 loadStrings_ +loadTable FUNCTION1 loadTable_ +loadXML FUNCTION1 loadXML_ +log FUNCTION1 log_ +loop FUNCTION1 loop_ +mag FUNCTION1 mag_ +map FUNCTION1 map_ +match FUNCTION1 match_ +matchAll FUNCTION1 matchAll_ +max FUNCTION1 max_ +millis FUNCTION1 millis_ +min FUNCTION1 min_ +minute FUNCTION1 minute_ +modelX FUNCTION1 modelX_ +modelY FUNCTION1 modelY_ +modelZ FUNCTION1 modelZ_ +month FUNCTION1 month_ +mouseButton KEYWORD4 mouseButton +mouseClicked FUNCTION4 mouseClicked +mouseDragged FUNCTION4 mouseDragged +mouseMoved FUNCTION4 mouseMoved +mousePressed FUNCTION4 mousePressed +mousePressed KEYWORD4 mousePressed +mouseReleased FUNCTION1 mouseReleased_ +mouseWheel FUNCTION4 mouseWheel +mouseX KEYWORD4 mouseX +mouseY KEYWORD4 mouseY +nf FUNCTION1 nf_ +nfc FUNCTION1 nfc_ +nfp FUNCTION1 nfp_ +nfs FUNCTION1 nfs_ +noClip FUNCTION1 noClip_ +noCursor FUNCTION1 noCursor_ +noFill FUNCTION1 noFill_ +noise FUNCTION1 noise_ +noiseDetail FUNCTION1 noiseDetail_ +noiseSeed FUNCTION1 noiseSeed_ +noLights FUNCTION1 noLights_ +noLoop FUNCTION1 noLoop_ +norm FUNCTION1 norm_ +normal FUNCTION1 normal_ +noSmooth FUNCTION1 noSmooth_ +noStroke FUNCTION1 noStroke_ +noTint FUNCTION1 noTint_ +open FUNCTION1 open_ +ortho FUNCTION1 ortho_ +parseXML FUNCTION1 parseXML_ +perspective FUNCTION1 perspective_ +PFont KEYWORD5 PFont +list FUNCTION1 PFont_list_ +PGraphics KEYWORD5 PGraphics +beginDraw FUNCTION2 PGraphics_beginDraw_ +endDraw FUNCTION2 PGraphics_endDraw_ +PI LITERAL2 PI +PImage KEYWORD5 PImage +blend FUNCTION2 PImage_blend_ +copy FUNCTION2 PImage_copy_ +filter FUNCTION2 PImage_filter_ +get FUNCTION2 PImage_get_ +loadPixels FUNCTION2 PImage_loadPixels_ +mask FUNCTION2 PImage_mask_ +pixels KEYWORD2 PImage_pixels +resize FUNCTION2 PImage_resize_ +save FUNCTION2 PImage_save_ +set FUNCTION2 PImage_set_ +updatePixels FUNCTION2 PImage_updatePixels_ +pixels KEYWORD4 pixels +pmouseX KEYWORD4 pmouseX +pmouseY KEYWORD4 pmouseY +point FUNCTION1 point_ +pointLight FUNCTION1 pointLight_ +popMatrix FUNCTION1 popMatrix_ +popStyle FUNCTION1 popStyle_ +pow FUNCTION1 pow_ +print FUNCTION1 print_ +printCamera FUNCTION1 printCamera_ +println FUNCTION1 println_ +printMatrix FUNCTION1 printMatrix_ +printProjection FUNCTION1 printProjection_ +PShader KEYWORD5 PShader +PShader FUNCTION2 PShader_set_ +PShape KEYWORD5 PShape +addChild FUNCTION2 PShape_addChild_ +beginContour FUNCTION2 PShape_beginContour_ +disableStyle FUNCTION2 PShape_disableStyle_ +enableStyle FUNCTION2 PShape_enableStyle_ +endContour FUNCTION2 PShape_endContour_ +endShape FUNCTION2 PShape_endShape_ +getChild FUNCTION2 PShape_getChild_ +getChildCount FUNCTION2 PShape_getChildCount_ +getVertex FUNCTION2 PShape_getVertex_ +getVertexCount FUNCTION2 PShape_getVertexCount_ +isVisible FUNCTION2 PShape_isVisible_ +resetMatrix FUNCTION2 PShape_resetMatrix_ +rotate FUNCTION2 PShape_rotate_ +rotateX FUNCTION2 PShape_rotateX_ +rotateY FUNCTION2 PShape_rotateY_ +rotateZ FUNCTION2 PShape_rotateZ_ +scale FUNCTION2 PShape_scale_ +setVertex FUNCTION2 PShape_setVertex_ +setVisible FUNCTION2 PShape_setVisible_ +translate FUNCTION2 PShape_translate_ +pushMatrix FUNCTION1 pushMatrix_ +pushStyle FUNCTION1 pushStyle_ +PVector KEYWORD5 PVector +add FUNCTION2 PVector_add_ +angleBetween FUNCTION2 PVector_angleBetween_ +array FUNCTION2 PVector_array_ +copy FUNCTION2 PVector_copy_ +cross FUNCTION2 PVector_cross_ +dist FUNCTION2 PVector_dist_ +div FUNCTION2 PVector_div_ +dot FUNCTION2 PVector_dot_ +fromAngle FUNCTION2 PVector_fromAngle_ +get FUNCTION2 PVector_get_ +heading FUNCTION2 PVector_heading_ +lerp FUNCTION2 PVector_lerp_ +limit FUNCTION2 PVector_limit_ +mag FUNCTION2 PVector_mag_ +magSq FUNCTION2 PVector_magSq_ +mult FUNCTION2 PVector_mult_ +normalize FUNCTION2 PVector_normalize_ +random2D FUNCTION2 PVector_random2D_ +random3D FUNCTION2 PVector_random3D_ +rotate FUNCTION2 PVector_rotate_ +set FUNCTION2 PVector_set_ +setMag FUNCTION2 PVector_setMag_ +sub FUNCTION2 PVector_sub_ +quad FUNCTION1 quad_ +quadraticVertex FUNCTION1 quadraticVertex_ +QUARTER_PI LITERAL2 QUARTER_PI +radians FUNCTION1 radians_ +random FUNCTION1 random_ +randomGaussian FUNCTION1 randomGaussian_ +randomSeed FUNCTION1 randomSeed_ +rect FUNCTION1 rect_ +rectMode FUNCTION1 rectMode_ +red FUNCTION1 red_ +redraw FUNCTION1 redraw_ +requestImage FUNCTION1 requestImage_ +resetMatrix FUNCTION1 resetMatrix_ +resetShader FUNCTION1 resetShader_ +reverse FUNCTION1 reverse_ +rotate FUNCTION1 rotate_ +rotateX FUNCTION1 rotateX_ +rotateY FUNCTION1 rotateY_ +rotateZ FUNCTION1 rotateZ_ +round FUNCTION1 round_ +saturation FUNCTION1 saturation_ +save FUNCTION1 save_ +saveBytes FUNCTION1 saveBytes_ +saveFrame FUNCTION1 saveFrame_ +saveJSONArray FUNCTION1 saveJSONArray_ +saveJSONObject FUNCTION1 saveJSONObject_ +saveStream FUNCTION1 saveStream_ +saveStrings FUNCTION1 saveStrings_ +loadTable FUNCTION1 saveTable_ +saveXML FUNCTION1 saveXML_ +scale FUNCTION1 scale_ +screenX FUNCTION1 screenX_ +screenY FUNCTION1 screenY_ +screenZ FUNCTION1 screenZ_ +second FUNCTION1 second_ +selectFolder FUNCTION1 selectFolder_ +selectInput FUNCTION1 selectInput_ +selectOutput FUNCTION1 selectOutput_ +set FUNCTION1 set_ +setup FUNCTION4 setup +shader FUNCTION1 shader_ +shape FUNCTION1 shape_ +shapeMode FUNCTION1 shapeMode_ +shearX FUNCTION1 shearX_ +shearY FUNCTION1 shearY_ +shininess FUNCTION1 shininess_ +shorten FUNCTION1 shorten_ +sin FUNCTION1 sin_ +size FUNCTION1 size_ +smooth FUNCTION1 smooth_ +sort FUNCTION1 sort_ +specular FUNCTION1 specular_ +sphere FUNCTION1 sphere_ +sphereDetail FUNCTION1 sphereDetail_ +splice FUNCTION1 splice_ +split FUNCTION1 split_ +splitTokens FUNCTION1 splitTokens_ +spotLight FUNCTION1 spotLight_ +sq FUNCTION1 sq_ +sqrt FUNCTION1 sqrt_ +StringDict KEYWORD5 StringDict +clear FUNCTION2 StringDict_clear_ +get FUNCTION2 StringDict_get_ +hasKey FUNCTION2 StringDict_hasKey_ +keyArray FUNCTION2 StringDict_keyArray_ +keys FUNCTION2 StringDict_keys_ +remove FUNCTION2 StringDict_remove_ +set FUNCTION2 StringDict_set_ +size FUNCTION2 StringDict_size_ +sortKeys FUNCTION2 StringDict_sortKeys_ +sortKeysReverse FUNCTION2 StringDict_sortKeysReverse_ +sortValues FUNCTION2 StringDict_sortValues_ +sortValuesReverse FUNCTION2 StringDict_sortValuesReverse_ +valueArray FUNCTION2 StringDict_valueArray_ +values FUNCTION2 StringDict_values_ +StringList KEYWORD5 StringList +append FUNCTION2 StringList_append_ +array FUNCTION2 StringList_array_ +clear FUNCTION2 StringList_clear_ +get FUNCTION2 StringList_get_ +hasValue FUNCTION2 StringList_hasValue_ +lower FUNCTION2 StringList_lower_ +remove FUNCTION2 StringList_remove_ +reverse FUNCTION2 StringList_reverse_ +set FUNCTION2 StringList_set_ +shuffle FUNCTION2 StringList_shuffle_ +size FUNCTION2 StringList_size_ +sort FUNCTION2 StringList_sort_ +sortReverse FUNCTION2 StringList_sortReverse_ +upper FUNCTION2 StringList_upper_ +stroke FUNCTION1 stroke_ +strokeCap FUNCTION1 strokeCap_ +strokeJoin FUNCTION1 strokeJoin_ +strokeWeight FUNCTION1 strokeWeight_ +subset FUNCTION1 subset_ +Table KEYWORD5 Table +addColumn FUNCTION2 Table_addColumn_ +addRow FUNCTION2 Table_addRow_ +clearRows FUNCTION2 Table_clearRows_ +findRow FUNCTION2 Table_findRow_ +findRows FUNCTION2 Table_findRows_ +getColumnCount FUNCTION2 Table_getColumnCount_ +getFloat FUNCTION2 Table_getFloat_ +getInt FUNCTION2 Table_getInt_ +getRow FUNCTION2 Table_getRow_ +getRowCount FUNCTION2 Table_getRowCount_ +getString FUNCTION2 Table_getString_ +getStringColumn FUNCTION2 Table_getStringColumn_ +matchRow FUNCTION2 Table_matchRow_ +matchRows FUNCTION2 Table_matchRows_ +removeColumn FUNCTION2 Table_removeColumn_ +removeRow FUNCTION2 Table_removeRow_ +removeTokens FUNCTION2 Table_removeTokens_ +rows FUNCTION2 Table_rows_ +setFloat FUNCTION2 Table_setFloat_ +setInt FUNCTION2 Table_setInt_ +setString FUNCTION2 Table_setString_ +trim FUNCTION2 Table_trim_ +TableRow KEYWORD5 TableRow +getFloat FUNCTION2 TableRow_getFloat_ +getFloat FUNCTION2 TableRow_getInt_ +getString FUNCTION2 TableRow_getString_ +setFloat FUNCTION2 TableRow_setFloat_ +setInt FUNCTION2 TableRow_setInt_ +setString FUNCTION2 TableRow_setString_ +tan FUNCTION1 tan_ +TAU LITERAL2 TAU +text FUNCTION1 text_ +textAlign FUNCTION1 textAlign_ +textAscent FUNCTION1 textAscent_ +textDescent FUNCTION1 textDescent_ +textFont FUNCTION1 textFont_ +textLeading FUNCTION1 textLeading_ +textMode FUNCTION1 textMode_ +textSize FUNCTION1 textSize_ +texture FUNCTION1 texture_ +textureMode FUNCTION1 textureMode_ +textureWrap FUNCTION1 textureWrap_ +textWidth FUNCTION1 textWidth_ +tint FUNCTION1 tint_ +translate FUNCTION1 translate_ +triangle FUNCTION1 triangle_ +trim FUNCTION1 trim_ +TWO_PI LITERAL2 TWO_PI +unbinary FUNCTION1 unbinary_ +unhex FUNCTION1 unhex_ +updatePixels FUNCTION1 updatePixels_ +vertex FUNCTION1 vertex_ +XML KEYWORD5 XML +addChild FUNCTION2 XML_addChild_ +format FUNCTION2 XML_format_ +getAttributeCount FUNCTION2 XML_getAttributeCount_ +getChild FUNCTION2 XML_getChild_ +getChildren FUNCTION2 XML_getChildren_ +getContent FUNCTION2 XML_getContent_ +getFloat FUNCTION2 XML_getFloat_ +getContent FUNCTION2 XML_getFloatContent_ +getInt FUNCTION2 XML_getInt_ +getContent FUNCTION2 XML_getIntContent_ +getName FUNCTION2 XML_getName_ +getParent FUNCTION2 XML_getParent_ +getString FUNCTION2 XML_getString_ +hasAttribute FUNCTION2 XML_hasAttribute_ +hasChildren FUNCTION2 XML_hasChildren_ +listAttributes FUNCTION2 XML_listAttributes_ +listChildren FUNCTION2 XML_listChildren_ +removeChild FUNCTION2 XML_removeChild_ +setContent FUNCTION2 XML_setContent_ +setFloat FUNCTION2 XML_setFloat_ +setInt FUNCTION2 XML_setInt_ +setName FUNCTION2 XML_setName_ +setString FUNCTION2 XML_setString_ +toString FUNCTION2 XML_toString_ +year FUNCTION1 year_ diff --git a/pdex/mode.properties b/pdex/mode.properties new file mode 100644 index 000000000..e70030c59 --- /dev/null +++ b/pdex/mode.properties @@ -0,0 +1,7 @@ +name=PDE X +authorList=[The Processing Foundation](http://processing.org) +url=https://github.com/processing/processing-experimental +sentence=The next generation of PDE +paragraph=Intelligent Code Completion, Quick Navigation, Refactoring, Live Error Checker, Debugger, etc. +version=@@version@@ +prettyVersion=@@pretty-version@@ diff --git a/pdex/mode/.gitignore b/pdex/mode/.gitignore new file mode 100644 index 000000000..9acf0e7e9 --- /dev/null +++ b/pdex/mode/.gitignore @@ -0,0 +1 @@ +experimental.jar diff --git a/pdex/mode/readme.txt b/pdex/mode/readme.txt new file mode 100644 index 000000000..2152b63de --- /dev/null +++ b/pdex/mode/readme.txt @@ -0,0 +1,5 @@ +Packages from Eclipse 4.2.1: +http://download.eclipse.org/eclipse/downloads/ + +The jdi.jar and jdimodel.jar files are unpacked +from the org.eclipse.jdt.debug JAR file. diff --git a/pdex/pdeX.txt b/pdex/pdeX.txt new file mode 100644 index 000000000..7c2a3aa85 --- /dev/null +++ b/pdex/pdeX.txt @@ -0,0 +1,7 @@ +name=PDE X +authorList=[The Processing Foundation](http://processing.org) +url=https://github.com/processing/processing-experimental +sentence=The next generation of PDE +paragraph=Intelligent Code Completion, Live Error Checker, Debugger, Auto Refactor, etc. +version=7 +prettyVersion=1.0.4b diff --git a/pdex/revisions.txt b/pdex/revisions.txt new file mode 100644 index 000000000..647859ae0 --- /dev/null +++ b/pdex/revisions.txt @@ -0,0 +1,85 @@ + +PDE X v1.0.4b - May 9, 2014 + +Requires Processing 2.1.2 or above. + +Bug fixes + ++ Disabled auto-save. My sincere apologies to those who lost data due +to this bug. It was wrong of me to release an untested feature without +adding an option to enable/disable it. I've learnt a lesson and I shall +ensure this sort of thing doesn't happen again in the future. + ++ Autocompletion bug, column is sometimes off by 1 +https://github.com/processing/processing-experimental/issues/38 + ++ Persistent completion dialog on OS X +https://github.com/processing/processing-experimental/issues/32 + ++ Status bar update bug +https://github.com/processing/processing-experimental/issues/29 + ++ Export application broken +https://github.com/processing/processing-experimental/issues/45 + ++ Status Bar - New Tab prompt bug +https://github.com/processing/processing-experimental/issues/53 + ++ Show usage fails for methods which have javadoc comment +https://github.com/processing/processing-experimental/issues/51 + +. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + +PDE X v1.0.3b - January 21, 2014 + +New Feature + ++ PDE X now saves a backup of your sketch every 3 minutes(configurable in preferences.txt). +In case of an unexpected crash, this should save the day! +https://github.com/processing/processing-experimental/issues/36 + +Bug fixes + ++ Outline Window width is now fixed +https://github.com/processing/processing-experimental/issues/31 + ++ Export Application works again on OS X +https://github.com/processing/processing-experimental/issues/33 + +. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + +PDE X v1.0.2b - October 21, 2013 + +Bug fixes + ++ Code completion window gets stuck when Processing loses focus + https://github.com/processing/processing-experimental/issues/21 + ++ Live-error checker is more efficient with memory now. + You can have upto 7 editor windows open at a time with PDE X. + https://github.com/processing/processing-experimental/issues/1 + ++ Cmd + Left Click should be working again in OS X with Processing 2.1 + https://github.com/processing/processing-experimental/issues/11 + ++ TextAreaPainter updated for Processing 2.1 + +. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + +PDE X v1.0.1b - 25 September, 2013 + +Bug fix + ++ Fixed a major issue where completion list was going blank. + https://github.com/processing/processing-experimental/issues/19 + +Changes + +- Removed the tiny markers shown at the start of error lines. Too. Much. Red. + +. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + +PDE X v1.0.0b - 22 September, 2013 + +Boom! First Public Beta Release! + diff --git a/pdex/src/com/illposed/osc/LICENSE b/pdex/src/com/illposed/osc/LICENSE new file mode 100644 index 000000000..13b6c5ccb --- /dev/null +++ b/pdex/src/com/illposed/osc/LICENSE @@ -0,0 +1,10 @@ +Copyright (c) 2002-2006, C. Ramakrishnan / Illposed Software +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + • Neither the name of the Illposed Software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pdex/src/com/illposed/osc/OSCBundle.java b/pdex/src/com/illposed/osc/OSCBundle.java new file mode 100644 index 000000000..5ce38235e --- /dev/null +++ b/pdex/src/com/illposed/osc/OSCBundle.java @@ -0,0 +1,190 @@ +/* + * Copyright (C) 2003-2006, C. Ramakrishnan / Illposed Software. + * All rights reserved. + * + * This code is licensed under the BSD 3-Clause license. + * See file LICENSE (or LICENSE.html) for more information. + */ + +package com.illposed.osc; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; + +import com.illposed.osc.utility.OSCJavaToByteArrayConverter; + +/** + * A bundle represents a collection of OSC packets + * (either messages or other bundles) + * and has a time-tag which can be used by a scheduler to execute + * a bundle in the future, + * instead of immediately. + * {@link OSCMessage}s are executed immediately. + * + * Bundles should be used if you want to send multiple messages to be executed + * atomically together, or you want to schedule one or more messages to be + * executed in the future. + * + * @author Chandrasekhar Ramakrishnan + */ +public class OSCBundle extends OSCPacket { + + /** + * 2208988800 seconds -- includes 17 leap years + */ + public static final BigInteger SECONDS_FROM_1900_TO_1970 = + new BigInteger("2208988800"); + + /** + * The Java representation of an OSC timestamp with the semantics of + * "immediately". + */ + public static final Date TIMESTAMP_IMMEDIATE = new Date(0); + + private Date timestamp; + private List packets; + + /** + * Create a new empty OSCBundle with a timestamp of immediately. + * You can add packets to the bundle with addPacket() + */ + public OSCBundle() { + this(TIMESTAMP_IMMEDIATE); + } + + /** + * Create an OSCBundle with the specified timestamp. + * @param timestamp the time to execute the bundle + */ + public OSCBundle(Date timestamp) { + this((Collection) null, timestamp); + } + + // deprecated since version 1.0, March 2012 + /** + * Creates an OSCBundle made up of the given packets + * with a timestamp of now. + * @param packets array of OSCPackets to initialize this object with + * @deprecated + */ + public OSCBundle(OSCPacket[] packets) { + this(packets, TIMESTAMP_IMMEDIATE); + } + + /** + * Creates an OSCBundle made up of the given packets + * with a timestamp of now. + * @param packets array of OSCPackets to initialize this object with + */ + public OSCBundle(Collection packets) { + this(packets, TIMESTAMP_IMMEDIATE); + } + + // deprecated since version 1.0, March 2012 + /** + * Creates an OSCBundle, specifying the packets and timestamp. + * @param packets the packets that make up the bundle + * @param timestamp the time to execute the bundle + * @deprecated + */ + public OSCBundle(OSCPacket[] packets, Date timestamp) { + this((packets == null) + ? new LinkedList() + : Arrays.asList(packets), + timestamp); + } + + /** + * Create an OSCBundle, specifying the packets and timestamp. + * @param packets the packets that make up the bundle + * @param timestamp the time to execute the bundle + */ + public OSCBundle(Collection packets, Date timestamp) { + + if (null == packets) { + this.packets = new LinkedList(); + } else { + this.packets = new ArrayList(packets); + } + this.timestamp = timestamp; + init(); + } + + /** + * Return the time the bundle will execute. + * @return a Date + */ + public Date getTimestamp() { + return timestamp; + } + + /** + * Set the time the bundle will execute. + * @param timestamp Date + */ + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + + /** + * Add a packet to the list of packets in this bundle. + * @param packet OSCMessage or OSCBundle + */ + public void addPacket(OSCPacket packet) { + packets.add(packet); + } + + /** + * Get the packets contained in this bundle. + * @return the packets contained in this bundle. + */ + public OSCPacket[] getPackets() { + OSCPacket[] packetArray = new OSCPacket[packets.size()]; + packets.toArray(packetArray); + return packetArray; + } + + /** + * Convert the time-tag (a Java Date) into the OSC byte stream. + * Used Internally. + */ + protected void computeTimeTagByteArray(OSCJavaToByteArrayConverter stream) { + if ((null == timestamp) || (timestamp == TIMESTAMP_IMMEDIATE)) { + stream.write(0); + stream.write(1); + return; + } + + long millisecs = timestamp.getTime(); + long secsSince1970 = millisecs / 1000; + long secs = secsSince1970 + SECONDS_FROM_1900_TO_1970.longValue(); + + // this line was cribbed from jakarta commons-net's NTP TimeStamp code + long fraction = ((millisecs % 1000) * 0x100000000L) / 1000; + + stream.write((int) secs); + stream.write((int) fraction); + } + + /** + * Compute the OSC byte stream representation of the bundle. + * Used Internally. + * @param stream OscPacketByteArrayConverter + */ + protected byte[] computeByteArray(OSCJavaToByteArrayConverter stream) { + stream.write("#bundle"); + computeTimeTagByteArray(stream); + byte[] packetBytes; + for (OSCPacket pkg : packets) { + packetBytes = pkg.getByteArray(); + stream.write(packetBytes.length); + stream.write(packetBytes); + } + return stream.toByteArray(); + } +} diff --git a/pdex/src/com/illposed/osc/OSCListener.java b/pdex/src/com/illposed/osc/OSCListener.java new file mode 100644 index 000000000..d65cc9130 --- /dev/null +++ b/pdex/src/com/illposed/osc/OSCListener.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2003-2006, C. Ramakrishnan / Illposed Software. + * All rights reserved. + * + * This code is licensed under the BSD 3-Clause license. + * See file LICENSE (or LICENSE.html) for more information. + */ + +package com.illposed.osc; + +import java.util.Date; + +/** + * Interface for things that listen for incoming OSC Messages + * + * @author Chandrasekhar Ramakrishnan + */ +public interface OSCListener { + + /** + * Accept an incoming OSCMessage + * @param time The time this message is to be executed. + * null means execute now + * @param message The message to execute. + */ + public void acceptMessage(Date time, OSCMessage message); + +} diff --git a/pdex/src/com/illposed/osc/OSCMessage.java b/pdex/src/com/illposed/osc/OSCMessage.java new file mode 100644 index 000000000..a57020ec8 --- /dev/null +++ b/pdex/src/com/illposed/osc/OSCMessage.java @@ -0,0 +1,150 @@ +/* + * Copyright (C) 2003-2006, C. Ramakrishnan / Illposed Software. + * All rights reserved. + * + * This code is licensed under the BSD 3-Clause license. + * See file LICENSE (or LICENSE.html) for more information. + */ + +package com.illposed.osc; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; + +import com.illposed.osc.utility.OSCJavaToByteArrayConverter; + +/** + * An simple (non-bundle) OSC message. + * + * An OSC message is made up of an address (the receiver of the message) + * and arguments (the content of the message). + * + * @author Chandrasekhar Ramakrishnan + */ +public class OSCMessage extends OSCPacket { + + private String address; + private List arguments; + + /** + * Creates an empty OSC Message. + * In order to send this OSC message, + * you need to set the address and optionally some arguments. + */ + public OSCMessage() { + arguments = new LinkedList(); + } + + /** + * Creates an OSCMessage with an address already initialized. + * @param address the recipient of this OSC message + */ + public OSCMessage(String address) { + this(address, (Collection) null); + } + + // deprecated since version 1.0, March 2012 + /** + * Creates an OSCMessage with an address and arguments already initialized. + * @param address the recipient of this OSC message + * @param arguments the data sent to the receiver + * @deprecated + */ + public OSCMessage(String address, Object[] arguments) { + + this.address = address; + if (arguments == null) { + this.arguments = new LinkedList(); + } else { + this.arguments = new ArrayList(arguments.length); + this.arguments.addAll(Arrays.asList(arguments)); + } + init(); + } + + /** + * Creates an OSCMessage with an address + * and arguments already initialized. + * @param address the recipient of this OSC message + * @param arguments the data sent to the receiver + */ + public OSCMessage(String address, Collection arguments) { + + this.address = address; + if (arguments == null) { + this.arguments = new LinkedList(); + } else { + this.arguments = new ArrayList(arguments); + } + init(); + } + + /** + * The receiver of this message. + * @return the receiver of this OSC Message + */ + public String getAddress() { + return address; + } + + /** + * Set the address of this message. + * @param address the receiver of the message + */ + public void setAddress(String address) { + this.address = address; + } + + /** + * Add an argument to the list of arguments. + * @param argument a Float, String, Integer, BigInteger, Boolean + * or an array of these + */ + public void addArgument(Object argument) { + arguments.add(argument); + } + + /** + * The arguments of this message. + * @return the arguments to this message + */ + public Object[] getArguments() { + return arguments.toArray(); + } + + /** + * Convert the address into a byte array. + * Used internally only. + */ + protected void computeAddressByteArray(OSCJavaToByteArrayConverter stream) { + stream.write(address); + } + + /** + * Convert the arguments into a byte array. + * Used internally only. + */ + protected void computeArgumentsByteArray(OSCJavaToByteArrayConverter stream) { + stream.write(','); + if (null == arguments) { + return; + } + stream.writeTypes(arguments); + for (Object argument : arguments) { + stream.write(argument); + } + } + + /** + * Convert the message into a byte array. + * Used internally only. + */ + protected byte[] computeByteArray(OSCJavaToByteArrayConverter stream) { + computeAddressByteArray(stream); + computeArgumentsByteArray(stream); + return stream.toByteArray(); + } +} diff --git a/pdex/src/com/illposed/osc/OSCPacket.java b/pdex/src/com/illposed/osc/OSCPacket.java new file mode 100644 index 000000000..e19524767 --- /dev/null +++ b/pdex/src/com/illposed/osc/OSCPacket.java @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2003-2006, C. Ramakrishnan / Illposed Software. + * All rights reserved. + * + * This code is licensed under the BSD 3-Clause license. + * See file LICENSE (or LICENSE.html) for more information. + */ + +package com.illposed.osc; + +import com.illposed.osc.utility.OSCJavaToByteArrayConverter; + +/** + * OSCPacket is the abstract superclass for the various + * kinds of OSC Messages. + * + * The actual packets are: + *
    + *
  • {@link OSCMessage}: simple OSC messages + *
  • {@link OSCBundle}: OSC messages with timestamps + * and/or made up of multiple messages + *
+ * + * This implementation is based on + * Markus Gaelli and + * Iannis Zannos' OSC implementation in Squeak Smalltalk. + */ +public abstract class OSCPacket { + + private boolean isByteArrayComputed; + private byte[] byteArray; + + /** + * Default constructor for the abstract class + */ + public OSCPacket() { + } + + /** + * Generate a representation of this packet conforming to the + * the OSC byte stream specification. Used Internally. + */ + protected byte[] computeByteArray() { + OSCJavaToByteArrayConverter stream = new OSCJavaToByteArrayConverter(); + return computeByteArray(stream); + } + + /** + * Subclasses should implement this method to product a byte array + * formatted according to the OSC specification. + * @param stream OscPacketByteArrayConverter + */ + protected abstract byte[] computeByteArray(OSCJavaToByteArrayConverter stream); + + /** + * Return the OSC byte stream for this packet. + * @return byte[] + */ + public byte[] getByteArray() { + if (!isByteArrayComputed) { + byteArray = computeByteArray(); + } + return byteArray; + } + + /** + * Run any post construction initialization. (By default, do nothing.) + */ + protected void init() { + + } +} diff --git a/pdex/src/com/illposed/osc/OSCPort.java b/pdex/src/com/illposed/osc/OSCPort.java new file mode 100644 index 000000000..9d3f38f14 --- /dev/null +++ b/pdex/src/com/illposed/osc/OSCPort.java @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2003-2006, C. Ramakrishnan / Illposed Software. + * All rights reserved. + * + * This code is licensed under the BSD 3-Clause license. + * See file LICENSE (or LICENSE.html) for more information. + */ + +package com.illposed.osc; + +import java.net.DatagramSocket; + +/** + * OSCPort is an abstract superclass, to send OSC messages, + * use {@link OSCPortOut}. + * To listen for OSC messages, use {@link OSCPortIn}. + * + * @author Chandrasekhar Ramakrishnan + */ +public abstract class OSCPort { + + private DatagramSocket socket; + private int port; + + public static final int DEFAULT_SC_OSC_PORT = 57110; + public static final int DEFAULT_SC_LANG_OSC_PORT = 57120; + + protected OSCPort(DatagramSocket socket, int port) { + this.socket = socket; + this.port = port; + } + + /** + * The port that the SuperCollider synth engine + * usually listens to. + * @see #DEFAULT_SC_OSC_PORT + */ + public static int defaultSCOSCPort() { + return DEFAULT_SC_OSC_PORT; + } + + /** + * The port that the SuperCollider language engine + * usually listens to. + * @see #DEFAULT_SC_LANG_OSC_PORT + */ + public static int defaultSCLangOSCPort() { + return DEFAULT_SC_LANG_OSC_PORT; + } + + /** + * Returns the socket associated with this port. + * @return this ports socket + */ + protected DatagramSocket getSocket() { + return socket; + } + + /** + * Returns the port number associated with this port. + * @return this ports number + */ + protected int getPort() { + return port; + } + + /** + * Close the socket if this hasn't already happened. + * @see java.lang.Object#finalize() + */ + protected void finalize() throws Throwable { + super.finalize(); + socket.close(); + } + + /** + * Close the socket and free-up resources. + * It is recommended that clients call this when they are done with the + * port. + */ + public void close() { + socket.close(); + } +} diff --git a/pdex/src/com/illposed/osc/OSCPortIn.java b/pdex/src/com/illposed/osc/OSCPortIn.java new file mode 100644 index 000000000..ca252675f --- /dev/null +++ b/pdex/src/com/illposed/osc/OSCPortIn.java @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2004-2006, C. Ramakrishnan / Illposed Software. + * All rights reserved. + * + * This code is licensed under the BSD 3-Clause license. + * See file LICENSE (or LICENSE.html) for more information. + */ + +package com.illposed.osc; + +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.io.IOException; +import java.net.SocketException; + +import com.illposed.osc.utility.OSCByteArrayToJavaConverter; +import com.illposed.osc.utility.OSCPacketDispatcher; + +/** + * OSCPortIn is the class that listens for OSC messages. + * + * An example based on + * {@link com.illposed.osc.OSCPortTest#testReceiving()}: + *
+
+	receiver = new OSCPortIn(OSCPort.DEFAULT_SC_OSC_PORT());
+	OSCListener listener = new OSCListener() {
+		public void acceptMessage(java.util.Date time, OSCMessage message) {
+			System.out.println("Message received!");
+		}
+	};
+	receiver.addListener("/message/receiving", listener);
+	receiver.startListening();
+
+ * 
+ * + * Then, using a program such as SuperCollider or sendOSC, send a message + * to this computer, port {@link #DEFAULT_SC_OSC_PORT}, + * with the address "/message/receiving". + * + * @author Chandrasekhar Ramakrishnan + */ +public class OSCPortIn extends OSCPort implements Runnable { + + // state for listening + private boolean listening; + private OSCByteArrayToJavaConverter converter + = new OSCByteArrayToJavaConverter(); + private OSCPacketDispatcher dispatcher = new OSCPacketDispatcher(); + + /** + * Create an OSCPort that listens on the specified port. + * @param port UDP port to listen on. + * @throws SocketException + */ + public OSCPortIn(int port) throws SocketException { + super(new DatagramSocket(port), port); + } + + /** + * Buffers were 1500 bytes in size, but were + * increased to 1536, as this is a common MTU. + */ + private static final int BUFFER_SIZE = 1536; + + /** + * Run the loop that listens for OSC on a socket until + * {@link #isListening()} becomes false. + * @see java.lang.Runnable#run() + */ + public void run() { + byte[] buffer = new byte[BUFFER_SIZE]; + DatagramPacket packet = new DatagramPacket(buffer, BUFFER_SIZE); + DatagramSocket socket = getSocket(); + while (listening) { + try { + try { + socket.receive(packet); + } catch (SocketException ex) { + if (listening) { + throw ex; + } else { + // if we closed the socket while receiving data, + // the exception is expected/normal, so we hide it + continue; + } + } + OSCPacket oscPacket = converter.convert(buffer, + packet.getLength()); + dispatcher.dispatchPacket(oscPacket); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + /** + * Start listening for incoming OSCPackets + */ + public void startListening() { + listening = true; + Thread thread = new Thread(this); + thread.start(); + } + + /** + * Stop listening for incoming OSCPackets + */ + public void stopListening() { + listening = false; + } + + /** + * Am I listening for packets? + */ + public boolean isListening() { + return listening; + } + + /** + * Register the listener for incoming OSCPackets addressed to an Address + * @param anAddress the address to listen for. The address can be specified as a regex, e.g., "/m.*e/receiving" + * @param listener the object to invoke when a message comes in + */ + public void addListener(String anAddress, OSCListener listener) { + dispatcher.addListener(anAddress, listener); + } +} diff --git a/pdex/src/com/illposed/osc/OSCPortOut.java b/pdex/src/com/illposed/osc/OSCPortOut.java new file mode 100644 index 000000000..7dbe05dc8 --- /dev/null +++ b/pdex/src/com/illposed/osc/OSCPortOut.java @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2004-2006, C. Ramakrishnan / Illposed Software. + * All rights reserved. + * + * This code is licensed under the BSD 3-Clause license. + * See file LICENSE (or LICENSE.html) for more information. + */ + +package com.illposed.osc; + +import java.io.IOException; +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetAddress; +import java.net.SocketException; +import java.net.UnknownHostException; + +/** + * OSCPortOut is the class that sends OSC messages + * to a specific address and port. + * + * To send an OSC message, call send(). + * + * An example based on + * {@link com.illposed.osc.OSCPortTest#testMessageWithArgs()}: + *
+	OSCPort sender = new OSCPort();
+	Object args[] = new Object[2];
+	args[0] = new Integer(3);
+	args[1] = "hello";
+	OSCMessage msg = new OSCMessage("/sayhello", args);
+	 try {
+		sender.send(msg);
+	 } catch (Exception e) {
+		 showError("Couldn't send");
+	 }
+ * 
+ * + * @author Chandrasekhar Ramakrishnan + */ +public class OSCPortOut extends OSCPort { + + private InetAddress address; + + /** + * Create an OSCPort that sends to address:port. + * @param address the UDP address to send to + * @param port the UDP port to send to + */ + public OSCPortOut(InetAddress address, int port) + throws SocketException + { + super(new DatagramSocket(), port); + this.address = address; + } + + /** + * Create an OSCPort that sends to address, + * using the standard SuperCollider port. + * @param address the UDP address to send to + */ + public OSCPortOut(InetAddress address) throws SocketException { + this(address, DEFAULT_SC_OSC_PORT); + } + + /** + * Create an OSCPort that sends to "localhost", + * on the standard SuperCollider port. + */ + public OSCPortOut() throws UnknownHostException, SocketException { + this(InetAddress.getLocalHost(), DEFAULT_SC_OSC_PORT); + } + + /** + * Send an OSC packet (message or bundle) to the receiver we are bound to. + * @param aPacket the bundle or message to send + */ + public void send(OSCPacket aPacket) throws IOException { + byte[] byteArray = aPacket.getByteArray(); + DatagramPacket packet = + new DatagramPacket(byteArray, byteArray.length, address, getPort()); + getSocket().send(packet); + } +} diff --git a/pdex/src/com/illposed/osc/utility/OSCByteArrayToJavaConverter.java b/pdex/src/com/illposed/osc/utility/OSCByteArrayToJavaConverter.java new file mode 100644 index 000000000..3c29412c6 --- /dev/null +++ b/pdex/src/com/illposed/osc/utility/OSCByteArrayToJavaConverter.java @@ -0,0 +1,351 @@ +/* + * Copyright (C) 2004-2006, C. Ramakrishnan / Illposed Software. + * All rights reserved. + * + * This code is licensed under the BSD 3-Clause license. + * See file LICENSE (or LICENSE.html) for more information. + */ + +package com.illposed.osc.utility; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.illposed.osc.OSCBundle; +import com.illposed.osc.OSCMessage; +import com.illposed.osc.OSCPacket; + +/** + * Utility class to convert a byte array, + * conforming to the OSC byte stream format, + * into Java objects. + * + * @author Chandrasekhar Ramakrishnan + */ +public class OSCByteArrayToJavaConverter { + + private byte[] bytes; + private int bytesLength; + private int streamPosition; + + /** + * Creates a helper object for converting from a byte array + * to an {@link OSCPacket} object. + */ + public OSCByteArrayToJavaConverter() { + } + + /** + * Converts a byte array into an {@link OSCPacket} + * (either an {@link OSCMessage} or {@link OSCBundle}). + */ + public OSCPacket convert(byte[] byteArray, int bytesLength) { + this.bytes = byteArray; + this.bytesLength = bytesLength; + this.streamPosition = 0; + if (isBundle()) { + return convertBundle(); + } else { + return convertMessage(); + } + } + + /** + * Is my byte array a bundle? + * @return true if it the byte array is a bundle, false o.w. + */ + private boolean isBundle() { + // only need the first 7 to check if it is a bundle + String bytesAsString = new String(bytes, 0, 7); + return bytesAsString.startsWith("#bundle"); + } + + /** + * Converts the byte array to a bundle. + * Assumes that the byte array is a bundle. + * @return a bundle containing the data specified in the byte stream + */ + private OSCBundle convertBundle() { + // skip the "#bundle " stuff + streamPosition = 8; + Date timestamp = readTimeTag(); + OSCBundle bundle = new OSCBundle(timestamp); + OSCByteArrayToJavaConverter myConverter + = new OSCByteArrayToJavaConverter(); + while (streamPosition < bytesLength) { + // recursively read through the stream and convert packets you find + int packetLength = ((Integer) readInteger()).intValue(); + byte[] packetBytes = new byte[packetLength]; + for (int i = 0; i < packetLength; i++) { + packetBytes[i] = bytes[streamPosition++]; + } + OSCPacket packet = myConverter.convert(packetBytes, packetLength); + bundle.addPacket(packet); + } + return bundle; + } + + /** + * Converts the byte array to a simple message. + * Assumes that the byte array is a message. + * @return a message containing the data specified in the byte stream + */ + private OSCMessage convertMessage() { + OSCMessage message = new OSCMessage(); + message.setAddress(readString()); + List types = readTypes(); + if (null == types) { + // we are done + return message; + } + moveToFourByteBoundry(); + for (int i = 0; i < types.size(); ++i) { + if ('[' == types.get(i).charValue()) { + // we're looking at an array -- read it in + message.addArgument(readArray(types, ++i).toArray()); + // then increment i to the end of the array + while (types.get(i).charValue() != ']') { + i++; + } + } else { + message.addArgument(readArgument(types.get(i))); + } + } + return message; + } + + /** + * Reads a string from the byte stream. + * @return the next string in the byte stream + */ + private String readString() { + int strLen = lengthOfCurrentString(); + char[] stringChars = new char[strLen]; + for (int i = 0; i < strLen; i++) { + stringChars[i] = (char) bytes[streamPosition++]; + } + moveToFourByteBoundry(); + return new String(stringChars); + } + + /** + * Reads the types of the arguments from the byte stream. + * @return a char array with the types of the arguments + */ + private List readTypes() { + // the next byte should be a ',' + if (bytes[streamPosition] != 0x2C) { + return null; + } + streamPosition++; + // find out how long the list of types is + int typesLen = lengthOfCurrentString(); + if (0 == typesLen) { + return null; + } + + // read in the types + List typesChars = new ArrayList(typesLen); + for (int i = 0; i < typesLen; i++) { + typesChars.add((char) bytes[streamPosition++]); + } + return typesChars; + } + + /** + * Reads an object of the type specified by the type char. + * @param type type of the argument to read + * @return a Java representation of the argument + */ + private Object readArgument(char type) { + switch (type) { + case 'i' : + return readInteger(); + case 'h' : + return readBigInteger(); + case 'f' : + return readFloat(); + case 'd' : + return readDouble(); + case 's' : + return readString(); + case 'c' : + return readChar(); + case 'T' : + return Boolean.TRUE; + case 'F' : + return Boolean.FALSE; + case 't' : + return readTimeTag(); + default: + return null; + } + } + + /** + * Reads a char from the byte stream. + * @return a {@link Character} + */ + private Object readChar() { + return new Character((char) bytes[streamPosition++]); + } + + /** + * Reads a double from the byte stream. + * This just reads a float. + * @return a {@link Double} + */ + private Object readDouble() { + return readFloat(); + } + + /** + * Reads a float from the byte stream. + * @return a {@link Float} + */ + private Object readFloat() { + byte[] floatBytes = new byte[4]; + floatBytes[0] = bytes[streamPosition++]; + floatBytes[1] = bytes[streamPosition++]; + floatBytes[2] = bytes[streamPosition++]; + floatBytes[3] = bytes[streamPosition++]; +// int floatBits = +// (floatBytes[0] << 24) +// | (floatBytes[1] << 16) +// | (floatBytes[2] << 8) +// | (floatBytes[3]); + BigInteger floatBits = new BigInteger(floatBytes); + return new Float(Float.intBitsToFloat(floatBits.intValue())); + } + + /** + * Reads a Big Integer (64 bit integer) from the byte stream. + * @return a {@link BigInteger} + */ + private Object readBigInteger() { + byte[] longintBytes = new byte[8]; + longintBytes[0] = bytes[streamPosition++]; + longintBytes[1] = bytes[streamPosition++]; + longintBytes[2] = bytes[streamPosition++]; + longintBytes[3] = bytes[streamPosition++]; + longintBytes[4] = bytes[streamPosition++]; + longintBytes[5] = bytes[streamPosition++]; + longintBytes[6] = bytes[streamPosition++]; + longintBytes[7] = bytes[streamPosition++]; + return new BigInteger(longintBytes); + } + + /** + * Reads an Integer (32 bit integer) from the byte stream. + * @return an {@link Integer} + */ + private Object readInteger() { + byte[] intBytes = new byte[4]; + intBytes[0] = bytes[streamPosition++]; + intBytes[1] = bytes[streamPosition++]; + intBytes[2] = bytes[streamPosition++]; + intBytes[3] = bytes[streamPosition++]; + BigInteger intBits = new BigInteger(intBytes); + return new Integer(intBits.intValue()); + } + + /** + * Reads the time tag and convert it to a Java Date object. + * A timestamp is a 64 bit number representing the time in NTP format. + * The first 32 bits are seconds since 1900, the second 32 bits are + * fractions of a second. + * @return a {@link Date} + */ + private Date readTimeTag() { + byte[] secondBytes = new byte[8]; + byte[] fractionBytes = new byte[8]; + for (int i = 0; i < 4; i++) { + // clear the higher order 4 bytes + secondBytes[i] = 0; fractionBytes[i] = 0; + } + // while reading in the seconds & fraction, check if + // this timetag has immediate semantics + boolean isImmediate = true; + for (int i = 4; i < 8; i++) { + secondBytes[i] = bytes[streamPosition++]; + if (secondBytes[i] > 0) { + isImmediate = false; + } + } + for (int i = 4; i < 8; i++) { + fractionBytes[i] = bytes[streamPosition++]; + if (i < 7) { + if (fractionBytes[i] > 0) { + isImmediate = false; + } + } else { + if (fractionBytes[i] > 1) { + isImmediate = false; + } + } + } + + if (isImmediate) { + return OSCBundle.TIMESTAMP_IMMEDIATE; + } + + BigInteger secsSince1900 = new BigInteger(secondBytes); + long secsSince1970 = secsSince1900.longValue() + - OSCBundle.SECONDS_FROM_1900_TO_1970.longValue(); + + // no point maintaining times in the distant past + if (secsSince1970 < 0) { + secsSince1970 = 0; + } + long fraction = (new BigInteger(fractionBytes).longValue()); + + // this line was cribbed from jakarta commons-net's NTP TimeStamp code + fraction = (fraction * 1000) / 0x100000000L; + + // I do not know where, but I'm losing 1ms somewhere... + fraction = (fraction > 0) ? fraction + 1 : 0; + long millisecs = (secsSince1970 * 1000) + fraction; + return new Date(millisecs); + } + + /** + * Reads an array from the byte stream. + * @param types + * @param pos at which position to start reading + * @return the array that was read + */ + private List readArray(List types, int pos) { + int arrayLen = 0; + while (types.get(pos + arrayLen).charValue() != ']') { + arrayLen++; + } + List array = new ArrayList(arrayLen); + for (int j = 0; j < arrayLen; j++) { + array.add(readArgument(types.get(pos + j))); + } + return array; + } + + /** + * Get the length of the string currently in the byte stream. + */ + private int lengthOfCurrentString() { + int i = 0; + while (bytes[streamPosition + i] != 0) { + i++; + } + return i; + } + + /** + * Move to the next byte with an index in the byte array + * which is dividable by four. + */ + private void moveToFourByteBoundry() { + // If i am already at a 4 byte boundry, I need to move to the next one + int mod = streamPosition % 4; + streamPosition += (4 - mod); + } +} diff --git a/pdex/src/com/illposed/osc/utility/OSCJavaToByteArrayConverter.java b/pdex/src/com/illposed/osc/utility/OSCJavaToByteArrayConverter.java new file mode 100644 index 000000000..ae1bea03a --- /dev/null +++ b/pdex/src/com/illposed/osc/utility/OSCJavaToByteArrayConverter.java @@ -0,0 +1,340 @@ +/* + * Copyright (C) 2003-2006, C. Ramakrishnan / Illposed Software. + * All rights reserved. + * + * This code is licensed under the BSD 3-Clause license. + * See file LICENSE (or LICENSE.html) for more information. + */ + +package com.illposed.osc.utility; + +import java.io.IOException; +import java.io.ByteArrayOutputStream; +import java.math.BigInteger; +import java.util.Collection; + +/** + * OSCJavaToByteArrayConverter is a helper class that translates + * from Java types to their byte stream representations according to + * the OSC spec. + * + * The implementation is based on + * Markus Gaelli and + * Iannis Zannos' OSC implementation in Squeak. + * + * This version includes bug fixes and improvements from + * Martin Kaltenbrunner and Alex Potsides. + * + * @author Chandrasekhar Ramakrishnan + * @author Martin Kaltenbrunner + * @author Alex Potsides + */ +public class OSCJavaToByteArrayConverter { + + private ByteArrayOutputStream stream = new ByteArrayOutputStream(); + private byte[] intBytes = new byte[4]; + private byte[] longintBytes = new byte[8]; + + public OSCJavaToByteArrayConverter() { + } + + /** + * Line up the Big end of the bytes to a 4 byte boundary. + * @return byte[] + * @param bytes byte[] + */ + private byte[] alignBigEndToFourByteBoundry(byte[] bytes) { + int mod = bytes.length % 4; + // if the remainder == 0 then return the bytes otherwise pad the bytes + // to lineup correctly + if (mod == 0) { + return bytes; + } + int pad = 4 - mod; + byte[] newBytes = new byte[pad + bytes.length]; +// for (int i = 0; i < pad; i++) +// newBytes[i] = 0; +// for (int i = 0; i < bytes.length; i++) +// newBytes[pad + i] = bytes[i]; + System.arraycopy(bytes, 0, newBytes, pad, bytes.length); + return newBytes; + } + + /** + * Pad the stream to have a size divisible by 4. + */ + public void appendNullCharToAlignStream() { + int mod = stream.size() % 4; + int pad = 4 - mod; + for (int i = 0; i < pad; i++) { + stream.write(0); + } + } + + /** + * Convert the contents of the output stream to a byte array. + * @return the byte array containing the byte stream + */ + public byte[] toByteArray() { + return stream.toByteArray(); + } + + /** + * Write bytes into the byte stream. + * @param bytes bytes to be written + */ + public void write(byte[] bytes) { + writeUnderHandler(bytes); + } + + /** + * Write an integer into the byte stream. + * @param i the integer to be written + */ + public void write(int i) { + writeInteger32ToByteArray(i); + } + + /** + * Write a float into the byte stream. + * @param f floating point number to be written + */ + public void write(Float f) { + writeInteger32ToByteArray(Float.floatToIntBits(f.floatValue())); + } + + /** + * @param i the integer to be written + */ + public void write(Integer i) { + writeInteger32ToByteArray(i.intValue()); + } + + /** + * @param i the integer to be written + */ + public void write(BigInteger i) { + writeInteger64ToByteArray(i.longValue()); + } + + /** + * Write a string into the byte stream. + * @param aString the string to be written + */ + public void write(String aString) { +/* + XXX to be revised ... + int stringLength = aString.length(); + // this is a deprecated method -- should use get char and convert + // the chars to bytes +// aString.getBytes(0, stringLength, stringBytes, 0); + aString.getChars(0, stringLength, stringChars, 0); + // pad out to align on 4 byte boundry + int mod = stringLength % 4; + int pad = 4 - mod; + for (int i = 0; i < pad; i++) + stringChars[stringLength++] = 0; + // convert the chars into bytes and write them out + for (int i = 0; i < stringLength; i++) { + stringBytes[i] = (byte) (stringChars[i] & 0x00FF); + } + stream.write(stringBytes, 0, stringLength); +*/ + byte[] stringBytes = aString.getBytes(); + + // pad out to align on 4 byte boundry + int mod = aString.length() % 4; + int pad = 4 - mod; + + byte[] newBytes = new byte[pad + stringBytes.length]; + System.arraycopy(stringBytes, 0, newBytes, 0, stringBytes.length); + + try { + stream.write(newBytes); + } catch (IOException e) { + throw new RuntimeException("You're screwed:" + + " IOException writing to a ByteArrayOutputStream", e); + } + } + + /** + * Write a char into the byte stream. + * @param c the character to be written + */ + public void write(char c) { + stream.write(c); + } + + /** + * Write an object into the byte stream. + * @param anObject one of Float, String, Integer, BigInteger, or array of + * these. + */ + public void write(Object anObject) { + // Can't do switch on class + if (null == anObject) { + } else if (anObject instanceof Object[]) { + Object[] theArray = (Object[]) anObject; + for (int i = 0; i < theArray.length; ++i) { + write(theArray[i]); + } + } else if (anObject instanceof Float) { + write((Float) anObject); + } else if (anObject instanceof String) { + write((String) anObject); + } else if (anObject instanceof Integer) { + write((Integer) anObject); + } else if (anObject instanceof BigInteger) { + write((BigInteger) anObject); + } + } + + /** + * Write the type tag for the type represented by the class + * @param c Class of a Java object in the arguments + */ + public void writeType(Class c) { + // A big ol' case statement -- what's polymorphism mean, again? + // I really wish I could extend the base classes! + + // use the appropriate flags to tell SuperCollider what kind of + // thing it is looking at + + if (Integer.class.equals(c)) { + stream.write('i'); + } else if (java.math.BigInteger.class.equals(c)) { + stream.write('h'); + } else if (Float.class.equals(c)) { + stream.write('f'); + } else if (Double.class.equals(c)) { + stream.write('d'); + } else if (String.class.equals(c)) { + stream.write('s'); + } else if (Character.class.equals(c)) { + stream.write('c'); + } + } + + /** + * Write the types for an array element in the arguments. + * @param array array of base Objects + */ + public void writeTypesArray(Object[] array) { + // A big ol' case statement in a for loop -- what's polymorphism mean, + // again? + // I really wish I could extend the base classes! + + for (int i = 0; i < array.length; i++) { + if (array[i] == null) { + } else if (Boolean.TRUE.equals(array[i])) { + // Create a way to deal with Boolean type objects + stream.write('T'); + } else if (Boolean.FALSE.equals(array[i])) { + stream.write('F'); + } else { + // this is an object -- write the type for the class + writeType(array[i].getClass()); + } + } + } + + /** + * Write types for the arguments. + * @param types the arguments to an OSCMessage + */ + public void writeTypes(Collection types) { + // A big ol' case statement in a for loop -- what's polymorphism mean, + // again? + // I really wish I could extend the base classes! + + for (Object type : types) { + if (null == type) { + continue; + } + // if the array at i is a type of array write a [ + // This is used for nested arguments + if (type.getClass().isArray()) { + stream.write('['); + // fill the [] with the SuperCollider types corresponding to + // the object (e.g., Object of type String needs -s). + writeTypesArray((Object[]) type); + // close the array + stream.write(']'); + continue; + } + // Create a way to deal with Boolean type objects + if (Boolean.TRUE.equals(type)) { + stream.write('T'); + continue; + } + if (Boolean.FALSE.equals(type)) { + stream.write('F'); + continue; + } + // go through the array and write the superCollider types as shown + // in the above method. + // The classes derived here are used as the arg to the above method. + writeType(type.getClass()); + } + // align the stream with padded bytes + appendNullCharToAlignStream(); + } + + /** + * Write bytes to the stream, catching IOExceptions and converting them to + * RuntimeExceptions. + * @param bytes byte[] + */ + private void writeUnderHandler(byte[] bytes) { + + try { + stream.write(alignBigEndToFourByteBoundry(bytes)); + } catch (IOException e) { + throw new RuntimeException("You're screwed:" + + " IOException writing to a ByteArrayOutputStream"); + } + } + + /** + * Write a 32 bit integer to the byte array without allocating memory. + * @param value a 32 bit integer. + */ + private void writeInteger32ToByteArray(int value) { + //byte[] intBytes = new byte[4]; + //I allocated the this buffer globally so the GC has less work + + intBytes[3] = (byte)value; value >>>= 8; + intBytes[2] = (byte)value; value >>>= 8; + intBytes[1] = (byte)value; value >>>= 8; + intBytes[0] = (byte)value; + + try { + stream.write(intBytes); + } catch (IOException ex) { + throw new RuntimeException("You're screwed:" + + " IOException writing to a ByteArrayOutputStream", ex); + } + } + + /** + * Write a 64 bit integer to the byte array without allocating memory. + * @param value a 64 bit integer. + */ + private void writeInteger64ToByteArray(long value) { + longintBytes[7] = (byte)value; value >>>= 8; + longintBytes[6] = (byte)value; value >>>= 8; + longintBytes[5] = (byte)value; value >>>= 8; + longintBytes[4] = (byte)value; value >>>= 8; + longintBytes[3] = (byte)value; value >>>= 8; + longintBytes[2] = (byte)value; value >>>= 8; + longintBytes[1] = (byte)value; value >>>= 8; + longintBytes[0] = (byte)value; + + try { + stream.write(longintBytes); + } catch (IOException ex) { + throw new RuntimeException("You're screwed:" + + " IOException writing to a ByteArrayOutputStream", ex); + } + } +} diff --git a/pdex/src/com/illposed/osc/utility/OSCPacketDispatcher.java b/pdex/src/com/illposed/osc/utility/OSCPacketDispatcher.java new file mode 100644 index 000000000..dd6b5240b --- /dev/null +++ b/pdex/src/com/illposed/osc/utility/OSCPacketDispatcher.java @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2003, C. Ramakrishnan / Auracle. + * All rights reserved. + * + * This code is licensed under the BSD 3-Clause license. + * See file LICENSE (or LICENSE.html) for more information. + */ + +package com.illposed.osc.utility; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import com.illposed.osc.OSCBundle; +import com.illposed.osc.OSCListener; +import com.illposed.osc.OSCMessage; +import com.illposed.osc.OSCPacket; + +/** + * Dispatches OSCMessages to registered listeners. + * + * @author Chandrasekhar Ramakrishnan + */ + +public class OSCPacketDispatcher { + + private Map addressToListener + = new HashMap(); + + /** + * + */ + public OSCPacketDispatcher() { + } + + public void addListener(String address, OSCListener listener) { + addressToListener.put(address, listener); + } + + public void dispatchPacket(OSCPacket packet) { + if (packet instanceof OSCBundle) { + dispatchBundle((OSCBundle) packet); + } else { + dispatchMessage((OSCMessage) packet); + } + } + + public void dispatchPacket(OSCPacket packet, Date timestamp) { + if (packet instanceof OSCBundle) { + dispatchBundle((OSCBundle) packet); + } else { + dispatchMessage((OSCMessage) packet, timestamp); + } + } + + private void dispatchBundle(OSCBundle bundle) { + Date timestamp = bundle.getTimestamp(); + OSCPacket[] packets = bundle.getPackets(); + for (OSCPacket packet : packets) { + dispatchPacket(packet, timestamp); + } + } + + private void dispatchMessage(OSCMessage message) { + dispatchMessage(message, null); + } + + private void dispatchMessage(OSCMessage message, Date time) { + for (Entry addrList : addressToListener.entrySet()) { + if (message.getAddress().matches(addrList.getKey())) { + addrList.getValue().acceptMessage(time, message); + } + } + } +} diff --git a/pdex/src/galsasson/mode/tweak/ColorControlBox.java b/pdex/src/galsasson/mode/tweak/ColorControlBox.java new file mode 100644 index 000000000..34eac43a6 --- /dev/null +++ b/pdex/src/galsasson/mode/tweak/ColorControlBox.java @@ -0,0 +1,367 @@ +package galsasson.mode.tweak; + +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.geom.AffineTransform; +import java.util.ArrayList; + +import processing.mode.experimental.TextAreaPainter; + +public class ColorControlBox { + + public boolean visible; + + ArrayList handles; + ColorMode colorMode; + Color color; + boolean ilegalColor = false; + boolean isBW; + boolean isHex; + + String drawContext; + + // interface + int x, y, width, height; + TextAreaPainter painter; + + public ColorControlBox(String context, ColorMode mode, ArrayList handles) + { + this.drawContext = context; + this.colorMode = mode; + this.handles = handles; + + // add this box to the handles so they can update this color on change + for (Handle h : handles) { + h.setColorBox(this); + } + + isBW = isGrayScale(); + isHex = isHexColor(); + color = getCurrentColor(); + + visible = Settings.alwaysShowColorBoxes; + } + + public void initInterface(TextAreaPainter textAreaPainter, int x, int y, int w, int h) + { + this.painter = textAreaPainter; + this.x = x; + this.y = y; + this.width = w; + this.height = h; + } + + public void setPos(int x, int y) + { + this.x = x; + this.y = y; + } + + public void draw(Graphics2D g2d) + { + if (!visible) { + return; + } + + AffineTransform trans = g2d.getTransform(); + g2d.translate(x, y); + + // draw current color + g2d.setColor(color); + g2d.fillRoundRect(0, 0, width, height, 5, 5); + + // draw black outline + g2d.setStroke(new BasicStroke(1)); + g2d.setColor(Color.BLACK); + g2d.drawRoundRect(0, 0, width, height, 5, 5); + + if (ilegalColor) { + g2d.setColor(Color.RED); + g2d.setStroke(new BasicStroke(2)); + g2d.drawLine(width-3, 3, 3, height-3); + } + + g2d.setTransform(trans); + } + + public boolean isGrayScale() + { + if (handles.size() <= 2) { + int value = handles.get(0).newValue.intValue(); + if ((value&0xff000000) == 0) { + return true; + } + } + + return false; + } + + /** + * Check if color is hex or webcolor + * @return + * true if number is hex or webcolor + */ + private boolean isHexColor() + { + if (handles.get(0).type == "hex" || handles.get(0).type == "webcolor") { + int value = handles.get(0).value.intValue(); + if ((value&0xff000000) != 0) { + return true; + } + } + + return false; + } + + public Color getCurrentColor() + { + try { + if (handles.size() == 1) + { + if (isBW) { + // treat as color(gray) + float gray = handles.get(0).newValue.floatValue(); + return verifiedGrayColor(gray); + } + else { + // treat as color(argb) + int argb = handles.get(0).newValue.intValue(); + return verifiedHexColor(argb); + } + } + else if (handles.size() == 2) + { + if (isBW) { + // color(gray, alpha) + float gray = handles.get(0).newValue.floatValue(); + return verifiedGrayColor(gray); + } + else { + // treat as color(argb, a) + int argb = handles.get(0).newValue.intValue(); + float a = handles.get(1).newValue.floatValue(); + return verifiedHexColor(argb, a); + } + } + else if (handles.size() == 3) + { + // color(v1, v2, v3) + float v1 = handles.get(0).newValue.floatValue(); + float v2 = handles.get(1).newValue.floatValue(); + float v3 = handles.get(2).newValue.floatValue(); + + if (colorMode.modeType == ColorMode.RGB) { + return verifiedRGBColor(v1, v2, v3, colorMode.aMax); + } + else { + return verifiedHSBColor(v1, v2, v3, colorMode.aMax); + } + } + else if (handles.size() == 4) + { + // color(v1, v2, v3, alpha) + float v1 = handles.get(0).newValue.floatValue(); + float v2 = handles.get(1).newValue.floatValue(); + float v3 = handles.get(2).newValue.floatValue(); + float a = handles.get(3).newValue.floatValue(); + + if (colorMode.modeType == ColorMode.RGB) { + return verifiedRGBColor(v1, v2, v3, a); + } + else { + return verifiedHSBColor(v1, v2, v3, a); + } + } + } + catch (Exception e) { + System.out.println("error parsing color value: " + e.toString()); + ilegalColor = true; + return Color.WHITE; + } + + // couldn't figure out this color, return WHITE color + ilegalColor = true; + return Color.WHITE; + } + + private Color verifiedGrayColor(float gray) + { + if (gray < 0 || gray > colorMode.v1Max) { + return colorError(); + } + + ilegalColor = false; + gray = gray/colorMode.v1Max * 255; + return new Color((int)gray, (int)gray, (int)gray, 255); + } + + private Color verifiedHexColor(int argb) + { + int r = (argb>>16)&0xff; + int g = (argb>>8)&0xff; + int b = (argb&0xff); + + ilegalColor = false; + return new Color(r, g, b, 255); + } + + private Color verifiedHexColor(int argb, float alpha) + { + int r = (argb>>16)&0xff; + int g = (argb>>8)&0xff; + int b = (argb&0xff); + + ilegalColor = false; + return new Color(r, g, b, 255); + } + + public Color verifiedRGBColor(float r, float g, float b, float a) + { + if (r < 0 || r > colorMode.v1Max || + g < 0 || g > colorMode.v2Max || + b < 0 || b > colorMode.v3Max) { + return colorError(); + } + + ilegalColor = false; + r = r/colorMode.v1Max * 255; + g = g/colorMode.v2Max * 255; + b = b/colorMode.v3Max * 255; + return new Color((int)r, (int)g, (int)b, 255); + } + + public Color verifiedHSBColor(float h, float s, float b, float a) + { + if (h < 0 || h > colorMode.v1Max || + s < 0 || s > colorMode.v2Max || + b < 0 || b > colorMode.v3Max) { + return colorError(); + } + + ilegalColor = false; + Color c = Color.getHSBColor(h/colorMode.v1Max, s/colorMode.v2Max, b/colorMode.v3Max); + return new Color(c.getRed(), c.getGreen(), c.getBlue(), 255); + } + + private Color colorError() + { + ilegalColor = true; + return Color.WHITE; + } + + public void colorChanged() + { + color = getCurrentColor(); + } + + public int getTabIndex() + { + return handles.get(0).tabIndex; + } + + public int getLine() + { + return handles.get(0).line; + } + + public int getCharIndex() + { + int lastHandle = handles.size()-1; + return handles.get(lastHandle).newEndChar + 2; + } + + /* Check if the point is in the box + * + */ + public boolean pick(int mx, int my) + { + if (!visible) { + return false; + } + + if (mx>x && mx < x+width && my>y && myy && my>24)&0xff; + Color c = Color.getHSBColor((float)hue/255, (float)saturation/255, (float)brightness/255); + int newVal = (prevAlpha<<24) | (c.getRed()<<16) | (c.getGreen()<<8) | (c.getBlue()); + handles.get(0).setValue(newVal); + } + else if (handles.size() == 3 || handles.size() == 4) { + // color(v1, v2, v3) or color(v1, v2, v3, alpha) + if (colorMode.modeType == ColorMode.HSB) { + // HSB + float v1 = (float)hue/255 * colorMode.v1Max; + float v2 = (float)saturation/255 * colorMode.v2Max; + float v3 = (float)brightness/255 * colorMode.v3Max; + handles.get(0).setValue(v1); + handles.get(1).setValue(v2); + handles.get(2).setValue(v3); + } + else { + // RGB + Color c = Color.getHSBColor((float)hue/255, (float)saturation/255, (float)brightness/255); + handles.get(0).setValue((float)c.getRed()/255*colorMode.v1Max); + handles.get(1).setValue((float)c.getGreen()/255*colorMode.v2Max); + handles.get(2).setValue((float)c.getBlue()/255*colorMode.v3Max); + } + } + } + + // update our own color + color = getCurrentColor(); + + // update code text painter so the user will see the changes + painter.updateCodeText(); + painter.repaint(); + } + + public String toString() + { + return handles.size() + " handles, color mode: " + colorMode.toString(); + } +} diff --git a/pdex/src/galsasson/mode/tweak/ColorMode.java b/pdex/src/galsasson/mode/tweak/ColorMode.java new file mode 100644 index 000000000..6a907c5d9 --- /dev/null +++ b/pdex/src/galsasson/mode/tweak/ColorMode.java @@ -0,0 +1,97 @@ +package galsasson.mode.tweak; + +public class ColorMode { + final static int RGB = 0; + final static int HSB = 1; + + float v1Max, v2Max, v3Max, aMax; + int modeType; + + boolean unrecognizedMode; + String drawContext; + + public ColorMode(String context) + { + this.drawContext = context; + modeType = RGB; + v1Max = 255; + v2Max = 255; + v3Max = 255; + aMax = 255; + + unrecognizedMode = false; + } + + public ColorMode(String context, int type, float v1, float v2, float v3, float a) + { + this.drawContext = context; + modeType = type; + v1Max = v1; + v2Max = v2; + v3Max = v3; + aMax = a; + + unrecognizedMode = false; + } + + public static ColorMode fromString(String context, String mode) + { + try + { + String[] elements = mode.split(","); + + // determine the type of the color mode + int type = RGB; + if (elements[0].trim().equals("HSB")) { + type = HSB; + } + + if (elements.length == 1) { + // colorMode in the form of colorMode(type) + return new ColorMode(context, type, 255, 255, 255, 255); + } + else if (elements.length == 2) { + // colorMode in the form of colorMode(type, max) + float max = Float.parseFloat(elements[1].trim()); + return new ColorMode(context, type, max, max, max, max); + } + else if (elements.length == 4) { + // colorMode in the form of colorMode(type, max1, max2, max3) + float r = Float.parseFloat(elements[1].trim()); + float g = Float.parseFloat(elements[2].trim()); + float b = Float.parseFloat(elements[3].trim()); + return new ColorMode(context, type, r, g, b, 255); + } + else if (elements.length == 5) { + // colorMode in the form of colorMode(type, max1, max2, max3, maxA) + float r = Float.parseFloat(elements[1].trim()); + float g = Float.parseFloat(elements[2].trim()); + float b = Float.parseFloat(elements[3].trim()); + float a = Float.parseFloat(elements[4].trim()); + return new ColorMode(context, type, r, g, b, a); + } + } + catch(Exception e) { } + + /* if we failed to parse this mode (uses variables etc..) + * we should still keep it so we'll know there is a mode declaration + * and we should mark it as unrecognizable + */ + ColorMode newMode = new ColorMode(context); + newMode.unrecognizedMode = true; + return newMode; + } + + public String toString() + { + String type; + if (modeType == RGB) { + type = "RGB"; + } + else { + type = "HSB"; + } + + return "ColorMode: " + type + ": (" + v1Max + ", " + v2Max + ", " + v3Max + ", " + aMax + ")"; + } +} diff --git a/pdex/src/galsasson/mode/tweak/ColorScheme.java b/pdex/src/galsasson/mode/tweak/ColorScheme.java new file mode 100644 index 000000000..3ee5f7ec8 --- /dev/null +++ b/pdex/src/galsasson/mode/tweak/ColorScheme.java @@ -0,0 +1,31 @@ +package galsasson.mode.tweak; + +import java.awt.Color; + +public class ColorScheme { + private static ColorScheme instance = null; + public Color redStrokeColor; + public Color progressFillColor; + public Color progressEmptyColor; + public Color markerColor; + public Color whitePaneColor; + + private ColorScheme() + { + redStrokeColor = new Color(160, 20, 20); // dark red + progressEmptyColor = new Color(180, 180, 180, 200); + progressFillColor = new Color(0, 0, 0, 200); + markerColor = new Color(228, 200, 91, 127); + whitePaneColor = new Color(255, 255, 255, 120); + } + + public static ColorScheme getInstance() { + if (instance == null) { + instance = new ColorScheme(); + } + return instance; + } + +} + + diff --git a/pdex/src/galsasson/mode/tweak/ColorSelector.java b/pdex/src/galsasson/mode/tweak/ColorSelector.java new file mode 100644 index 000000000..d2dbe82cb --- /dev/null +++ b/pdex/src/galsasson/mode/tweak/ColorSelector.java @@ -0,0 +1,401 @@ +package galsasson.mode.tweak; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; + +import javax.swing.Box; +import javax.swing.JFrame; + +import processing.core.PApplet; +import processing.core.PGraphics; +import processing.core.PImage; + +public class ColorSelector { + int hue, saturation, brightness; + + public JFrame frame; + public ColorControlBox colorBox; + ColorSelectorBox selectorBox; + ColorSelectorSlider selectorSlider; + SelectorTopBar topBar; + + + public ColorSelector(ColorControlBox colorBox) + { + this.colorBox = colorBox; + createFrame(); + } + + public void createFrame() + { + frame = new JFrame(); + frame.setBackground(Color.BLACK); + + Box box = Box.createHorizontalBox(); + box.setBackground(Color.BLACK); + + selectorSlider = new ColorSelectorSlider(); + selectorSlider.init(); + + if (!colorBox.isBW) { + selectorBox = new ColorSelectorBox(); + selectorBox.init(); + box.add(selectorBox); + } + + box.add(Box.createHorizontalGlue()); + box.add(selectorSlider, BorderLayout.CENTER); + box.add(Box.createHorizontalGlue()); + + frame.getContentPane().add(box, BorderLayout.CENTER); + frame.pack(); + frame.setResizable(false); + frame.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR)); + } + + public void show(int x, int y) + { + frame.setLocation(x, y); + frame.setVisible(true); + frame.repaint(); + } + + public void hide() + { + this.colorBox = null; + frame.setVisible(false); + } + + public void refreshColor() + { + if (colorBox.ilegalColor) { + return; + } + + setColor(colorBox.color); + } + + public void setColor(Color c) + { + if (selectorBox != null) { + selectorBox.setToColor(c); + } + selectorSlider.setToColor(c); + + repaintSelector(); + } + + public void satBrightChanged() + { + repaintSelector(); + } + + public void hueChanged() + { + if (selectorBox != null) { + selectorBox.renderBack(); + } + repaintSelector(); + } + + public void repaintSelector() + { + if (selectorBox != null) { + selectorBox.redraw(); + } + selectorSlider.redraw(); + } + + /* + * PApplets for the interactive color fields + */ + + public class ColorSelectorBox extends PApplet + { + int lastX, lastY; + PImage backImg; + + public void setup() + { + size(255, 255); + noLoop(); + colorMode(HSB, 255, 255, 255); + noFill(); + + if (!colorBox.ilegalColor) { + setToColor(colorBox.color); + } + + renderBack(); + } + + public void draw() + { + image(backImg, 0, 0); + + stroke((lastY<128) ? 0 : 255); + + pushMatrix(); + translate(lastX, lastY); + ellipse(0, 0, 5, 5); + line(-8, 0, -6, 0); + line(6, 0, 8, 0); + line(0, -8, 0, -6); + line(0, 6, 0, 8); + popMatrix(); + } + + public void renderBack() + { + PGraphics buf = createGraphics(255, 255); + buf.colorMode(HSB, 255, 255, 255); + buf.beginDraw(); + buf.loadPixels(); + int index=0; + for (int j=0; j<255; j++) { + for (int i=0; i<255; i++) { + buf.pixels[index++] = color(hue, i, 255-j); + } + } + buf.updatePixels(); + buf.endDraw(); + + backImg = buf.get(); + } + + public void setToColor(Color c) + { + // set selector color + float hsb[] = Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(), null); + saturation = (int)(hsb[1]*255); + brightness = (int)(hsb[2]*255); + lastX = saturation; + lastY = 255 - brightness; + } + + public void mousePressed() { + if (mouseX < 0 || mouseX > 255 || + mouseY < 0 || mouseY > 255) { + return; + } + + lastX = mouseX; + lastY = mouseY; + updateColor(); + } + + public void mouseDragged() { + if (mouseX < 0 || mouseX > 255 || + mouseY < 0 || mouseY > 255) { + return; + } + + lastX = mouseX; + lastY = mouseY; + updateColor(); + } + + public void updateColor() + { + saturation = lastX; + brightness = 255 - lastY; + + satBrightChanged(); + colorBox.selectorChanged(hue, saturation, brightness); + } + + public Dimension getPreferredSize() { + return new Dimension(255, 255); + } + + public Dimension getMinimumSize() { + return new Dimension(255, 255); + } + + public Dimension getMaximumSize() { + return new Dimension(255, 255); + } + } + + public class ColorSelectorSlider extends PApplet + { + PImage backImg; + int lastY; + + public void setup() + { + size(30, 255); + noLoop(); + colorMode(HSB, 255, 255, 255); + strokeWeight(1); + noFill(); + loadPixels(); + if (!colorBox.ilegalColor) { + setToColor(colorBox.color); + } + + // draw the slider background + renderBack(); + } + + public void draw() + { + image(backImg, 0, 0); + if (colorBox.isBW) { + stroke(lastY<128 ? 0 : 255); + } + else { + stroke(0); + } + + pushMatrix(); + translate(0, lastY); + // draw left bracket + beginShape(); + vertex(5, -2); + vertex(1, -2); + vertex(1, 2); + vertex(5, 2); + endShape(); + + // draw middle lines + line(13, 0, 17, 0); + line(15, -2, 15, 2); + + // draw right bracket + beginShape(); + vertex(24, -2); + vertex(28, -2); + vertex(28, 2); + vertex(24, 2); + endShape(); + popMatrix(); + + if (colorBox.isBW) { + stroke(255); + rect(0, 0, 29, 254); + } + else { + stroke(0); + line(0, 0, 0, 255); + line(29, 0, 29, 255); + } + } + + public void renderBack() + { + PGraphics buf = createGraphics(30, 255); + buf.beginDraw(); + buf.loadPixels(); + int index=0; + for (int j=0; j<255; j++) { + for (int i=0; i<30; i++) { + if (colorBox.isBW) { + buf.pixels[index++] = color(255-j); + } + else { + buf.pixels[index++] = color(255-j, 255, 255); + } + } + } + buf.updatePixels(); + buf.endDraw(); + + backImg = buf.get(); + } + + public void setToColor(Color c) + { + // set slider position + if (colorBox.isBW) { + hue = c.getRed(); + } + else { + float hsb[] = Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(), null); + hue = (int)(hsb[0]*255); + } + lastY = 255 - hue; + } + + public void mousePressed() + { + if (mouseX < 0 || mouseX > 30 || + mouseY < 0 || mouseY > 255) { + return; + } + + lastY = mouseY; + updateColor(); + } + + public void mouseDragged() + { + if (mouseX < 0 || mouseX > 30 || + mouseY < 0 || mouseY > 255) { + return; + } + + lastY = mouseY; + updateColor(); + } + + public void updateColor() + { + hue = 255 - lastY; + + hueChanged(); + colorBox.selectorChanged(hue, saturation, brightness); + } + + public Dimension getPreferredSize() { + return new Dimension(30, 255); + } + + public Dimension getMinimumSize() { + return new Dimension(30, 255); + } + + public Dimension getMaximumSize() { + return new Dimension(30, 255); + } + } + + public class SelectorTopBar extends PApplet + { + int barWidth; + int barHeight; + + public SelectorTopBar(int w) + { + super(); + barWidth = w; + barHeight = 16; + } + + public void setup() + { + size(barWidth, barHeight); + noLoop(); + } + + public void draw() + { + background(128); + } + + public Dimension getPreferredSize() { + return new Dimension(barWidth, barHeight); + } + + public Dimension getMinimumSize() { + return new Dimension(barWidth, barHeight); + } + + public Dimension getMaximumSize() { + return new Dimension(barWidth, barHeight); + } + } +} + diff --git a/pdex/src/galsasson/mode/tweak/HProgressBar.java b/pdex/src/galsasson/mode/tweak/HProgressBar.java new file mode 100644 index 000000000..f94e04974 --- /dev/null +++ b/pdex/src/galsasson/mode/tweak/HProgressBar.java @@ -0,0 +1,74 @@ +package galsasson.mode.tweak; + +import java.awt.Graphics2D; +import java.awt.Polygon; +import java.awt.geom.AffineTransform; + +public class HProgressBar { + int x, y, size, width; + int pos; + int lPolyX, rPolyX; + Polygon rightPoly, leftPoly; + + public HProgressBar(int size, int width) + { + this.size = size; + this.width = width; + x = 0; + y = 0; + setPos(0); + + + int xl[] = {0, 0, -(int)(size/1.5)}; + int yl[] = {-(int)((float)size/3), (int)((float)size/3), 0}; + leftPoly = new Polygon(xl, yl, 3); + int xr[] = {0, (int)(size/1.5), 0}; + int yr[] = {-(int)((float)size/3), 0, (int)((float)size/3)}; + rightPoly = new Polygon(xr, yr, 3); + } + + public void setPos(int pos) + { + this.pos = pos; + lPolyX = 0; + rPolyX = 0; + + if (pos > 0) { + rPolyX = pos; + } + else if (pos < 0) { + lPolyX = pos; + } + } + + public void setWidth(int width) + { + this.width = width; + } + + public void draw(Graphics2D g2d) + { + AffineTransform trans = g2d.getTransform(); + g2d.translate(x, y); + + // draw white cover on text line + g2d.setColor(ColorScheme.getInstance().whitePaneColor); + g2d.fillRect(-200+lPolyX, -size, 200-lPolyX-width/2, size+1); + g2d.fillRect(width/2, -size, 200+rPolyX, size+1); + + // draw left and right triangles and leading line + g2d.setColor(ColorScheme.getInstance().progressFillColor); + AffineTransform tmp = g2d.getTransform(); + g2d.translate(-width/2 - 5 + lPolyX, -size/2); + g2d.fillRect(0, -1, -lPolyX, 2); + g2d.fillPolygon(leftPoly); + g2d.setTransform(tmp); + g2d.translate(width/2 + 5 + rPolyX, -size/2); + g2d.fillRect(-rPolyX, -1, rPolyX+1, 2); + g2d.fillPolygon(rightPoly); + g2d.setTransform(tmp); + + g2d.setTransform(trans); + } + +} diff --git a/pdex/src/galsasson/mode/tweak/Handle.java b/pdex/src/galsasson/mode/tweak/Handle.java new file mode 100644 index 000000000..3e9453a6c --- /dev/null +++ b/pdex/src/galsasson/mode/tweak/Handle.java @@ -0,0 +1,289 @@ +package galsasson.mode.tweak; + +import java.awt.Graphics2D; +import java.awt.geom.AffineTransform; +import java.math.BigDecimal; +import java.util.Comparator; +import java.util.Locale; + +public class Handle { + public String type; + public String name; + public String strValue; + public String strNewValue; + public int varIndex; + public int startChar; + public int endChar; + public int newStartChar; + public int newEndChar; + public int line; + int tabIndex; + int decimalPlaces; // number of digits after the decimal point + float incValue; + + java.lang.Number value, newValue; + String strDiff; + + // connect with color control box + ColorControlBox colorBox; + + // interface + int x, y, width, height; + int xCenter, xCurrent, xLast; + HProgressBar progBar = null; + String textFormat; + + int oscPort; + + public Handle(String t, String n, int vi, String v, int ti, int l, int sc, int ec, int dp) + { + type = t; + name = n; + varIndex = vi; + strValue = v; + tabIndex = ti; + line = l; + startChar = sc; + endChar = ec; + decimalPlaces = dp; + + incValue = (float)(1/Math.pow(10, decimalPlaces)); + + if (type == "int") { + value = newValue = Integer.parseInt(strValue); + strNewValue = strValue; + textFormat = "%d"; + } + else if (type == "hex") { + Long val = Long.parseLong(strValue.substring(2, strValue.length()), 16); + value = newValue = val.intValue(); + strNewValue = strValue; + textFormat = "0x%x"; + } + else if (type == "webcolor") { + Long val = Long.parseLong(strValue.substring(1, strValue.length()), 16); + val = val | 0xff000000; + value = newValue = val.intValue(); + strNewValue = strValue; + textFormat = "#%06x"; + } + else if (type == "float") { + value = newValue = Float.parseFloat(strValue); + strNewValue = strValue; + textFormat = "%.0" + decimalPlaces + "f"; + } + + newStartChar = startChar; + newEndChar = endChar; + } + + public void initInterface(int x, int y, int width, int height) + { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + + // create drag ball + progBar = new HProgressBar(height, width); + } + + public void setCenterX(int mx) + { + xLast = xCurrent = xCenter = mx; + } + + public void setCurrentX(int mx) + { + xLast = xCurrent; + xCurrent = mx; + + progBar.setPos(xCurrent - xCenter); + + updateValue(); + } + + public void resetProgress() + { + progBar.setPos(0); + } + + public void updateValue() + { + float change = getChange(); + + if (type == "int") { + if (newValue.intValue() + (int)change > Integer.MAX_VALUE || + newValue.intValue() + (int)change < Integer.MIN_VALUE) { + change = 0; + return; + } + setValue(newValue.intValue() + (int)change); + } + else if (type == "hex") { + setValue(newValue.intValue() + (int)change); + } + else if (type == "webcolor") { + setValue(newValue.intValue() + (int)change); + } + else if (type == "float") { + setValue(newValue.floatValue() + change); + } + + updateColorBox(); + } + + public void setValue(Number value) + { + if (type == "int") { + newValue = value.intValue(); + strNewValue = String.format(Locale.US,textFormat, newValue.intValue()); + } + else if (type == "hex") { + newValue = value.intValue(); + strNewValue = String.format(Locale.US,textFormat, newValue.intValue()); + } + else if (type == "webcolor") { + newValue = value.intValue(); + // keep only RGB + int val = (newValue.intValue() & 0xffffff); + strNewValue = String.format(Locale.US,textFormat, val); + } + else if (type == "float") { + BigDecimal bd = new BigDecimal(value.floatValue()); + bd = bd.setScale(decimalPlaces, BigDecimal.ROUND_HALF_UP); + newValue = bd.floatValue(); + strNewValue = String.format(Locale.US,textFormat, newValue.floatValue()); + } + + // send new data to the server in the sketch + oscSendNewValue(); + } + + public void updateColorBox() + { + if (colorBox != null) + { + colorBox.colorChanged(); + } + } + + private float getChange() + { + int pixels = xCurrent - xLast; + return pixels*incValue; + } + + public void setPos(int nx, int ny) + { + x = nx; + y = ny; + } + + public void setWidth(int w) + { + width = w; + + progBar.setWidth(w); + } + + public void draw(Graphics2D g2d, boolean hasFocus) + { + AffineTransform prevTrans = g2d.getTransform(); + g2d.translate(x, y); + + // draw underline on the number + g2d.setColor(ColorScheme.getInstance().progressFillColor); + g2d.drawLine(0, 0, width, 0); + + if (hasFocus) { + if (progBar != null) { + g2d.translate(width/2, 2); + progBar.draw(g2d); + } + } + + g2d.setTransform(prevTrans); + } + + public boolean pick(int mx, int my) + { + return pickText(mx, my); + } + + public boolean pickText(int mx, int my) + { + if (mx>x-2 && mxy-height && my { + public int compare(Handle handle1, Handle handle2) { + int tab = handle1.tabIndex - handle2.tabIndex; + if (tab == 0) { + return handle1.startChar - handle2.startChar; + } + else { + return tab; + } + } +} diff --git a/pdex/src/galsasson/mode/tweak/OSCSender.java b/pdex/src/galsasson/mode/tweak/OSCSender.java new file mode 100644 index 000000000..1113ee1fd --- /dev/null +++ b/pdex/src/galsasson/mode/tweak/OSCSender.java @@ -0,0 +1,53 @@ +package galsasson.mode.tweak; + +import java.net.InetAddress; +import java.util.ArrayList; + +import com.illposed.osc.*; + +public class OSCSender { + + public static void sendFloat(int index, float val, int port) throws Exception + { + OSCPortOut sender = new OSCPortOut(InetAddress.getByName("localhost"), port); + ArrayList args = new ArrayList(); + args.add(new Integer(index)); + args.add(new Float(val)); + OSCMessage msg = new OSCMessage("/tm_change_float", args); + try { + sender.send(msg); + } catch (Exception e) { + System.out.println("TweakMode: error sending new value of float " + index); + } + } + + public static void sendInt(int index, int val, int port) throws Exception + { + OSCPortOut sender = new OSCPortOut(InetAddress.getByName("localhost"), port); + ArrayList args = new ArrayList(); + args.add(new Integer(index)); + args.add(new Integer(val)); + OSCMessage msg = new OSCMessage("/tm_change_int", args); + try { + sender.send(msg); + } catch (Exception e) { + System.out.println("TweakMode: error sending new value of int " + index); + System.out.println(e.toString()); + } + } + + public static void sendLong(int index, long val, int port) throws Exception + { + OSCPortOut sender = new OSCPortOut(InetAddress.getByName("localhost"), port); + ArrayList args = new ArrayList(); + args.add(new Integer(index)); + args.add(new Long(val)); + OSCMessage msg = new OSCMessage("/tm_change_long", args); + try { + sender.send(msg); + } catch (Exception e) { + System.out.println("TweakMode: error sending new value of long " + index); + System.out.println(e.toString()); + } + } +} diff --git a/pdex/src/galsasson/mode/tweak/Settings.java b/pdex/src/galsasson/mode/tweak/Settings.java new file mode 100644 index 000000000..24d901f4d --- /dev/null +++ b/pdex/src/galsasson/mode/tweak/Settings.java @@ -0,0 +1,5 @@ +package galsasson.mode.tweak; + +public class Settings { + public static boolean alwaysShowColorBoxes = true; +} diff --git a/pdex/src/galsasson/mode/tweak/SketchParser.java b/pdex/src/galsasson/mode/tweak/SketchParser.java new file mode 100644 index 000000000..8c42f27e9 --- /dev/null +++ b/pdex/src/galsasson/mode/tweak/SketchParser.java @@ -0,0 +1,816 @@ +package galsasson.mode.tweak; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class SketchParser +{ + public ArrayList colorBoxes[]; + public ArrayList allHandles[]; + + int intVarCount; + int floatVarCount; + final String varPrefix = "tweakmode"; + + String[] codeTabs; + boolean requiresComment; + ArrayList colorModes; + + ArrayList scientificNotations[]; + + public SketchParser(String[] codeTabs, boolean requiresComment) + { + this.codeTabs = codeTabs; + this.requiresComment = requiresComment; + intVarCount=0; + floatVarCount=0; + + scientificNotations = getAllScientificNotations(); + + // find, add, and sort all tweakable numbers in the sketch + addAllNumbers(); + + // handle colors + colorModes = findAllColorModes(); + colorBoxes = new ArrayList[codeTabs.length]; + createColorBoxes(); + createColorBoxesForLights(); + + /* If there is more than one color mode per context, + * allow only hex and webcolors in this context. + * Currently there is no notion of order of execution so we + * cannot know which color mode relate to a color. + */ + handleMultipleColorModes(); + } + + public void addAllNumbers() + { + allHandles = new ArrayList[codeTabs.length]; + addAllDecimalNumbers(); + addAllHexNumbers(); + addAllWebColorNumbers(); + for (int i=0; i(),\\t\\s\\+\\-\\/\\*^%!|&=?:~]\\d+\\.?\\d*"); + for (int i=0; i(); + String c = codeTabs[i]; + Matcher m = p.matcher(c); + + while (m.find()) + { + boolean forceFloat = false; + int start = m.start()+1; + int end = m.end(); + + if (isInComment(start, codeTabs[i])) { + // ignore comments + continue; + } + + if (requiresComment) { + // only add numbers that have the "// tweak" comment in their line + if (!lineHasTweakComment(start, c)) { + continue; + } + } + + // ignore scientific notation (e.g. 1e-6) + boolean found = false; + for (Range r : scientificNotations[i]) { + if (r.contains(start)) { + found=true; + break; + } + } + if (found) { + continue; + } + + // remove any 'f' after the number + if (c.charAt(end) == 'f') { + forceFloat = true; + end++; + } + + // if its a negative, include the '-' sign + if (c.charAt(start-1) == '-') { + if (isNegativeSign(start-2, c)) { + start--; + } + } + + // special case for ignoring (0x...). will be handled later + if (c.charAt(m.end()) == 'x' || + c.charAt(m.end()) == 'X') { + continue; + } + + // special case for ignoring number inside a string ("") + if (isInsideString(start, c)) + continue; + + // beware of the global assignment (bug from 26.07.2013) + if (isGlobal(m.start(), c)) + continue; + + int line = countLines(c.substring(0, start)) - 1; // zero based + String value = c.substring(start, end); + //value + if (value.contains(".") || forceFloat) { + // consider this as a float + String name = varPrefix + "_float[" + floatVarCount +"]"; + int decimalDigits = getNumDigitsAfterPoint(value); + allHandles[i].add(new Handle("float", name, floatVarCount, value, i, line, start, end, decimalDigits)); + floatVarCount++; + } else { + // consider this as an int + String name = varPrefix + "_int[" + intVarCount +"]"; + allHandles[i].add(new Handle("int", name, intVarCount, value, i, line, start, end, 0)); + intVarCount++; + } + } + } + } + + /** + * Get a list of all the hexadecimal numbers in the code + * @return + * list of all hexadecimal numbers in the sketch + */ + private void addAllHexNumbers() + { + /* for every number found: + * save its type (int/float), name, value and position in code. + */ + Pattern p = Pattern.compile("[\\[\\{<>(),\\t\\s\\+\\-\\/\\*^%!|&=?:~]0x[A-Fa-f0-9]+"); + for (int i=0; i findAllColorModes() + { + ArrayList modes = new ArrayList(); + + for (String tab : codeTabs) + { + int index = -1; + // search for a call to colorMode function + while ((index = tab.indexOf("colorMode", index+1)) > -1) { + // found colorMode at index + + if (isInComment(index, tab)) { + // ignore comments + continue; + } + + index += 9; + int parOpen = tab.indexOf('(', index); + if (parOpen < 0) { + continue; + } + + int parClose = tab.indexOf(')', parOpen+1); + if (parClose < 0) { + continue; + } + + // add this mode + String modeDesc = tab.substring(parOpen+1, parClose); + String context = getObject(index-9, tab); + modes.add(ColorMode.fromString(context, modeDesc)); + } + } + + return modes; + } + + private void createColorBoxes() + { + // search tab for the functions: 'color', 'fill', 'stroke', 'background', 'tint' + Pattern p = Pattern.compile("color\\(|color\\s\\(|fill[\\(\\s]|stroke[\\(\\s]|background[\\(\\s]|tint[\\(\\s]"); + for (int i=0; i(); + String tab = codeTabs[i]; + Matcher m = p.matcher(tab); + + while (m.find()) + { + ArrayList colorHandles = new ArrayList(); + + // look for the '(' and ')' positions + int openPar = tab.indexOf("(", m.start()); + int closePar = tab.indexOf(")", m.end()); + if (openPar < 0 || closePar < 0) { + // ignore this color + continue; + } + + if (isInComment(m.start(), tab)) { + // ignore colors in a comment + continue; + } + + // look for handles inside the parenthesis + for (Handle handle : allHandles[i]) + { + if (handle.startChar > openPar && + handle.endChar <= closePar) { + // we have a match + colorHandles.add(handle); + } + } + + if (colorHandles.size() > 0) { + /* make sure there is no other stuff between '()' like variables. + * substract all handle values from string inside parenthesis and + * check there is no garbage left + */ + String insidePar = tab.substring(openPar+1, closePar); + for (Handle h : colorHandles) { + insidePar = insidePar.replaceFirst(h.strValue, ""); + } + + // make sure there is only ' ' and ',' left in the string. + boolean garbage = false; + for (int j=0; j.fill()) + String context = getObject(m.start(), tab); + ColorMode cmode = getColorModeForContext(context); + + // not adding color operations for modes we couldn't understand + ColorControlBox newCCB = new ColorControlBox(context, cmode, colorHandles); + + if (cmode.unrecognizedMode) { + // the color mode is unrecognizable add only if is a hex or webcolor + if (newCCB.isHex) { + colorBoxes[i].add(newCCB); + } + } + else { + colorBoxes[i].add(newCCB); + } + } + } + } + } + } + + private void createColorBoxesForLights() + { + // search code for light color and material color functions. + Pattern p = Pattern.compile("ambientLight[\\(\\s]|directionalLight[\\(\\s]"+ + "|pointLight[\\(\\s]|spotLight[\\(\\s]|lightSpecular[\\(\\s]"+ + "|specular[\\(\\s]|ambient[\\(\\s]|emissive[\\(\\s]"); + for (int i=0; i colorHandles = new ArrayList(); + + // look for the '(' and ')' positions + int openPar = tab.indexOf("(", m.start()); + int closePar = tab.indexOf(")", m.end()); + if (openPar < 0 || closePar < 0) { + // ignore this color + continue; + } + + if (isInComment(m.start(), tab)) { + // ignore colors in a comment + continue; + } + + // put 'colorParamsEnd' after three parameters inside the parenthesis or at the close + int colorParamsEnd = openPar; + int commas=3; + while (commas-- > 0) { + colorParamsEnd=tab.indexOf(",", colorParamsEnd+1); + if (colorParamsEnd < 0 || + colorParamsEnd > closePar) { + colorParamsEnd = closePar; + break; + } + } + + for (Handle handle : allHandles[i]) + { + if (handle.startChar > openPar && + handle.endChar <= colorParamsEnd) { + // we have a match + colorHandles.add(handle); + } + } + + if (colorHandles.size() > 0) { + /* make sure there is no other stuff between '()' like variables. + * substract all handle values from string inside parenthesis and + * check there is no garbage left + */ + String insidePar = tab.substring(openPar+1, colorParamsEnd); + for (Handle h : colorHandles) { + insidePar = insidePar.replaceFirst(h.strValue, ""); + } + + // make sure there is only ' ' and ',' left in the string. + boolean garbage = false; + for (int j=0; j.fill()) + String context = getObject(m.start(), tab); + ColorMode cmode = getColorModeForContext(context); + + // not adding color operations for modes we couldn't understand + ColorControlBox newCCB = new ColorControlBox(context, cmode, colorHandles); + + if (cmode.unrecognizedMode) { + // the color mode is unrecognizable add only if is a hex or webcolor + if (newCCB.isHex) { + colorBoxes[i].add(newCCB); + } + } + else { + colorBoxes[i].add(newCCB); + } + } + } + } + } + } + + private ColorMode getColorModeForContext(String context) + { + for (ColorMode cm: colorModes) { + if (cm.drawContext.equals(context)) { + return cm; + } + } + + // if non found, create the default color mode for this context and return it + ColorMode newCM = new ColorMode(context); + colorModes.add(newCM); + + return newCM; + } + + private void handleMultipleColorModes() + { + // count how many color modes per context + Map modeCount = new HashMap(); + for (ColorMode cm : colorModes) + { + Integer prev = modeCount.get(cm.drawContext); + if (prev == null) { + prev=0; + } + modeCount.put(cm.drawContext, prev+1); + } + + // find the contexts that have more than one color mode + ArrayList multipleContexts = new ArrayList(); + Set allContexts = modeCount.keySet(); + for (String context : allContexts) { + if (modeCount.get(context) > 1) { + multipleContexts.add(context); + } + } + + /* keep only hex and web color boxes in color calls + * that belong to 'multipleContexts' contexts + */ + for (int i=0; i toDelete = new ArrayList(); + for (String context : multipleContexts) + { + for (ColorControlBox ccb : colorBoxes[i]) + { + if (ccb.drawContext.equals(context) && !ccb.isHex) { + toDelete.add(ccb); + } + } + } + colorBoxes[i].removeAll(toDelete); + } + } + + public ArrayList[] getAllScientificNotations() + { + ArrayList notations[] = new ArrayList[codeTabs.length]; + + Pattern p = Pattern.compile("[+\\-]?(?:0|[1-9]\\d*)(?:\\.\\d*)?[eE][+\\-]?\\d+"); + for (int i=0; i(); + Matcher m = p.matcher(codeTabs[i]); + while (m.find()) { + notations[i].add(new Range(m.start(), m.end())); + } + } + + return notations; + } + + + public static boolean containsTweakComment(String[] codeTabs) + { + for (String tab : codeTabs) { + if (hasTweakComment(tab)) { + return true; + } + } + + return false; + + } + + public static boolean lineHasTweakComment(int pos, String code) + { + int lineEnd = getEndOfLine(pos, code); + if (lineEnd < 0) { + return false; + } + + String line = code.substring(pos, lineEnd); + return hasTweakComment(line); + } + + private static boolean hasTweakComment(String code) + { + Pattern p = Pattern.compile("\\/\\/.*tweak", Pattern.CASE_INSENSITIVE); + Matcher m = p.matcher(code); + if (m.find()) { + return true; + } + + return false; + } + + + private boolean isNegativeSign(int pos, String code) + { + // go back and look for ,{[(=?+-/*%<>:&|^!~ + for (int i=pos; i>=0; i--) + { + char c = code.charAt(i); + if (c == ' ' || c == '\t') { + continue; + } + if (c==',' || c=='{' || c=='[' || c=='(' || + c=='=' || c=='?' || c=='+' || c=='-' || + c=='/' || c=='*' || c=='%' || c=='<' || + c=='>' || c==':' || c=='&' || c=='|' || + c=='^' || c=='!' || c=='~') { + return true; + } + else { + return false; + } + } + + return false; + } + + private int getNumDigitsAfterPoint(String number) + { + Pattern p = Pattern.compile("\\.[0-9]+"); + Matcher m = p.matcher(number); + + if (m.find()) { + return m.end() - m.start() - 1; + } + else { + return 0; + } + } + + private int countLines(String str) + { + String[] lines = str.split("\r\n|\n\r|\n|\r"); + return lines.length; + } + + /** + * Are we inside a string? (TODO: ignore comments in the code) + * @param pos + * position in the code + * @param code + * the code + * @return + */ + private boolean isInsideString(int pos, String code) + { + int quoteNum = 0; // count '"' + + for (int c = pos; c>=0 && code.charAt(c) != '\n'; c--) + { + if (code.charAt(c) == '"') { + quoteNum++; + } + } + + if (quoteNum%2 == 1) { + return true; + } + + return false; + } + + /** + * Is this a global position? + * @param pos position + * @param code code + * @return + * true if the position 'pos' is in global scope in the code 'code' + */ + private boolean isGlobal(int pos, String code) + { + int curlyScope = 0; // count '{-}' + + for (int c=pos; c>=0; c--) + { + if (code.charAt(c) == '{') { + // check if a function or an array assignment + for (int cc=c; cc>=0; cc--) { + if (code.charAt(cc)==')') { + curlyScope++; + break; + } + else if (code.charAt(cc)==']') { + break; + } + else if (code.charAt(cc)==';') { + break; + } + } + } + else if (code.charAt(c) == '}') { + // check if a function or an array assignment + for (int cc=c; cc>=0; cc--) { + if (code.charAt(cc)==')') { + curlyScope--; + break; + } + else if (code.charAt(cc)==']') { + break; + } + else if (code.charAt(cc)==';') { + break; + } + } + } + } + + if (curlyScope == 0) { + // it is a global position + return true; + } + + return false; + }; + + private boolean isInComment(int pos, String code) + { + // look for one line comment + int lineStart = getStartOfLine(pos, code); + if (lineStart < 0) { + return false; + } + if (code.substring(lineStart, pos).indexOf("//") != -1) { + return true; + } + + // TODO: look for block comments + + return false; + } + + public static int getEndOfLine(int pos, String code) + { + return code.indexOf("\n", pos); + } + + public static int getStartOfLine(int pos, String code) + { + while (pos >= 0) { + if (code.charAt(pos) == '\n') { + return pos+1; + } + pos--; + } + + return 0; + } + + /** returns the object of the function starting at 'pos' + * + * @param pos + * @param code + * @return + */ + private String getObject(int pos, String code) + { + boolean readObject = false; + String obj = "this"; + + while (pos-- >= 0) { + if (code.charAt(pos) == '.') { + if (!readObject) { + obj = ""; + readObject = true; + } + else { + break; + } + } + else if (code.charAt(pos) == ' ' || code.charAt(pos) == '\t') { + break; + } + else if (readObject) { + obj = code.charAt(pos) + obj; + } + } + + return obj; + } + + public static int getSetupStart(String code) + { + Pattern p = Pattern.compile("void[\\s\\t\\r\\n]*setup[\\s\\t]*\\(\\)[\\s\\t\\r\\n]*\\{"); + Matcher m = p.matcher(code); + + if (m.find()) { + return m.end(); + } + + return -1; + } + + + private String replaceString(String str, int start, int end, String put) + { + return str.substring(0, start) + put + str.substring(end, str.length()); + } + + class Range + { + int start; + int end; + + public Range(int s, int e) { + start = s; + end = e; + } + + public boolean contains(int v) + { + if (v>=start && v "); +// javadocPane.setEditable(false); +// scrollPane = new JScrollPane(); +// scrollPane.setViewportView(javadocPane); +// frmJavaDoc.add(scrollPane); + //frmJavaDoc.setUndecorated(true); + + + } + + /** + * Toggle AST View window + */ + public static final boolean SHOWAST = !true; + + protected DefaultMutableTreeNode buildAST(String source, CompilationUnit cu) { + if (cu == null) { + ASTParser parser = ASTParser.newParser(AST.JLS4); + parser.setSource(source.toCharArray()); + parser.setKind(ASTParser.K_COMPILATION_UNIT); + + Map options = JavaCore.getOptions(); + + JavaCore.setComplianceOptions(JavaCore.VERSION_1_6, options); + options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_6); + parser.setCompilerOptions(options); + compilationUnit = (CompilationUnit) parser.createAST(null); + } else { + compilationUnit = cu; + //log("Other cu"); + } +// OutlineVisitor visitor = new OutlineVisitor(); +// compilationUnit.accept(visitor); + getCodeComments(); + codeTree = new DefaultMutableTreeNode(new ASTNodeWrapper((ASTNode) compilationUnit + .types().get(0))); + //log("Total CU " + compilationUnit.types().size()); + if(compilationUnit.types() == null || compilationUnit.types().isEmpty()){ + logE("No CU found!"); + } + visitRecur((ASTNode) compilationUnit.types().get(0), codeTree); + SwingWorker worker = new SwingWorker() { + + @Override + protected Object doInBackground() throws Exception { + return null; + } + + protected void done() { + if (codeTree != null) { + if(SHOWAST){ + if (jtree.hasFocus() || frmASTView.hasFocus()) + return; + jtree.setModel(new DefaultTreeModel(codeTree)); + ((DefaultTreeModel) jtree.getModel()).reload(); + jtree.validate(); + if (!frmASTView.isVisible()) { + frmASTView.setVisible(true); + } + } +// if (!frameAutoComp.isVisible()) { +// +// frameAutoComp.setVisible(true); +// +// } +// if (!frmJavaDoc.isVisible()) { +// long t = System.currentTimeMillis(); +// loadJavaDoc(); +// log("Time taken: " +// + (System.currentTimeMillis() - t)); +// frmJavaDoc.setBounds(new Rectangle(errorCheckerService.getEditor() +// .getX() + errorCheckerService.getEditor().getWidth(), +// errorCheckerService.getEditor() +// .getY(), 450, 600)); +// frmJavaDoc.setVisible(true); +// } + } + } + }; + worker.execute(); +// logE("++>" + System.getProperty("java.class.path")); +// log(System.getProperty("java.class.path")); +// log("-------------------------------"); + return codeTree; + } + + protected ClassPathFactory factory; + + /** + * Used for searching for package declaration of a class + */ + protected ClassPath classPath; + + //protected JFrame frmJavaDoc; + + /** + * Loads up .jar files and classes defined in it for completion lookup + */ + protected void loadJars() { +// SwingWorker worker = new SwingWorker() { +// protected void done(){ +// } +// protected Object doInBackground() throws Exception { +// return null; +// } +// }; +// worker.execute(); + + Thread t = new Thread(new Runnable() { + + public void run() { + try { + factory = new ClassPathFactory(); + + StringBuffer tehPath = new StringBuffer(System + .getProperty("java.class.path")); + if(Base.isMacOS()){ + // rt.jar equivalent on OS X is JAVA_HOME/bundle/Classes/classes.jar + tehPath.append(File.pathSeparatorChar + + System.getProperty("java.home") + File.separator + "bundle" + + File.separator + "Classes" + File.separator + "classes.jar" + + File.pathSeparatorChar); + }else{ + tehPath.append(File.pathSeparatorChar + + System.getProperty("java.home") + File.separator + "lib" + + File.separator + "rt.jar" + File.pathSeparatorChar); + } + if (errorCheckerService.classpathJars != null) { + synchronized (errorCheckerService.classpathJars) { + for (URL jarPath : errorCheckerService.classpathJars) { + //log(jarPath.getPath()); + tehPath.append(jarPath.getPath() + File.pathSeparatorChar); + } + } + } + +// String paths[] = tehPath.toString().split(File.separatorChar +""); +// StringTokenizer st = new StringTokenizer(tehPath.toString(), +// File.pathSeparatorChar + ""); +// while (st.hasMoreElements()) { +// String sstr = (String) st.nextElement(); +// log(sstr); +// } + + classPath = factory.createFromPath(tehPath.toString()); + log("Classpath created " + (classPath != null)); +// for (String packageName : classPath.listPackages("")) { +// log(packageName); +// } +// RegExpResourceFilter regExpResourceFilter = new RegExpResourceFilter( +// ".*", +// "ArrayList.class"); +// String[] resources = classPath.findResources("", regExpResourceFilter); +// for (String className : resources) { +// log("-> " + className); +// } + log("Sketch classpath jars loaded."); + if (Base.isMacOS()) { + File f = new File(System.getProperty("java.home") + File.separator + "bundle" + + File.separator + "Classes" + File.separator + "classes.jar"); + log(f.getAbsolutePath() + " | classes.jar found?" + + f.exists()); + } else { + File f = new File(System.getProperty("java.home") + File.separator + + "lib" + File.separator + "rt.jar" + File.separator); + log(f.getAbsolutePath() + " | rt.jar found?" + + f.exists()); + } + + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + t.start(); + } + + protected TreeMap jdocMap; + + protected void loadJavaDoc() { + jdocMap = new TreeMap(); + // presently loading only p5 reference for PApplet + Thread t = new Thread(new Runnable() { + + @Override + public void run() { + JavadocHelper.loadJavaDoc(jdocMap, editor.mode().getReferenceFolder()); + } + }); + t.start(); + + } + + public DefaultMutableTreeNode buildAST(CompilationUnit cu) { + return buildAST(errorCheckerService.sourceCode, cu); + } + + public static CompletionCandidate[] checkForTypes(ASTNode node) { + + List vdfs = null; + switch (node.getNodeType()) { + case ASTNode.TYPE_DECLARATION: + return new CompletionCandidate[] { new CompletionCandidate((TypeDeclaration) node) }; + + case ASTNode.METHOD_DECLARATION: + MethodDeclaration md = (MethodDeclaration) node; + log(getNodeAsString(md)); + List params = (List) md + .getStructuralProperty(MethodDeclaration.PARAMETERS_PROPERTY); + CompletionCandidate[] cand = new CompletionCandidate[params.size() + 1]; + cand[0] = new CompletionCandidate(md); + for (int i = 0; i < params.size(); i++) { +// cand[i + 1] = new CompletionCandidate(params.get(i).toString(), "", "", +// CompletionCandidate.LOCAL_VAR); + cand[i + 1] = new CompletionCandidate((SingleVariableDeclaration)params.get(i)); + } + return cand; + + case ASTNode.SINGLE_VARIABLE_DECLARATION: + return new CompletionCandidate[] { new CompletionCandidate((SingleVariableDeclaration)node) }; + + case ASTNode.FIELD_DECLARATION: + vdfs = ((FieldDeclaration) node).fragments(); + break; + case ASTNode.VARIABLE_DECLARATION_STATEMENT: + vdfs = ((VariableDeclarationStatement) node).fragments(); + break; + case ASTNode.VARIABLE_DECLARATION_EXPRESSION: + vdfs = ((VariableDeclarationExpression) node).fragments(); + break; + default: + break; + } + + if (vdfs != null) { + CompletionCandidate ret[] = new CompletionCandidate[vdfs.size()]; + int i = 0; + for (VariableDeclarationFragment vdf : vdfs) { +// ret[i++] = new CompletionCandidate(getNodeAsString2(vdf), "", "", +// CompletionCandidate.LOCAL_VAR); + ret[i++] = new CompletionCandidate(vdf); + } + return ret; + } + + return null; + } + + /** + * Find the parent of the expression in a().b, this would give me the return + * type of a(), so that we can find all children of a() begininng with b + * + * @param nearestNode + * @param expression + * @return + */ + public static ASTNode resolveExpression(ASTNode nearestNode, + ASTNode expression, boolean noCompare) { + log("Resolving " + getNodeAsString(expression) + " noComp " + + noCompare); + if (expression instanceof SimpleName) { + return findDeclaration2(((SimpleName) expression), nearestNode); + } else if (expression instanceof MethodInvocation) { + log("3. Method Invo " + + ((MethodInvocation) expression).getName()); + return findDeclaration2(((MethodInvocation) expression).getName(), + nearestNode); + } else if (expression instanceof FieldAccess) { + log("2. Field access " + + getNodeAsString(((FieldAccess) expression).getExpression()) + "|||" + + getNodeAsString(((FieldAccess) expression).getName())); + if (noCompare) { + /* + * ASTNode ret = findDeclaration2(((FieldAccess) expression).getName(), + * nearestNode); log("Found as ->"+getNodeAsString(ret)); + * return ret; + */ + return findDeclaration2(((FieldAccess) expression).getName(), + nearestNode); + } else { + + /* + * Note how for the next recursion, noCompare is reversed. Let's say + * I've typed getABC().quark.nin where nin is incomplete(ninja being the + * field), when execution first enters here, it calls resolveExpr again + * for "getABC().quark" where we know that quark field must be complete, + * so we toggle noCompare. And kaboom. + */ + return resolveExpression(nearestNode, + ((FieldAccess) expression).getExpression(), + !noCompare); + } + //return findDeclaration2(((FieldAccess) expression).getExpression(), nearestNode); + } else if (expression instanceof QualifiedName) { + log("1. Resolving " + + ((QualifiedName) expression).getQualifier() + " ||| " + + ((QualifiedName) expression).getName()); + if (noCompare) { // no compare, as in "abc.hello." need to resolve hello here + return findDeclaration2(((QualifiedName) expression).getName(), + nearestNode); + } else { + //User typed "abc.hello.by" (bye being complete), so need to resolve "abc.hello." only + return findDeclaration2(((QualifiedName) expression).getQualifier(), + nearestNode); + } + } + + return null; + } + + /** + * Finds the type of the expression in foo.bar().a().b, this would give me the + * type of b if it exists in return type of a(). If noCompare is true, + * it'll return type of a() + * @param nearestNode + * @param astNode + * @return + */ + public ClassMember resolveExpression3rdParty(ASTNode nearestNode, + ASTNode astNode, boolean noCompare) { + log("Resolve 3rdParty expr-- " + getNodeAsString(astNode) + + " nearest node " + getNodeAsString(nearestNode)); + if(astNode == null) return null; + ClassMember scopeParent = null; + SimpleType stp = null; + if(astNode instanceof SimpleName){ + ASTNode decl = findDeclaration2(((SimpleName)astNode),nearestNode); + if(decl != null){ + // see if locally defined + log(getNodeAsString(astNode)+" found decl -> " + getNodeAsString(decl)); + return new ClassMember(extracTypeInfo(decl)); + } + else { + // or in a predefined class? + Class tehClass = findClassIfExists(((SimpleName) astNode).toString()); + if (tehClass != null) { + return new ClassMember(tehClass); + } + } + astNode = astNode.getParent(); + } + switch (astNode.getNodeType()) { + //TODO: Notice the redundancy in the 3 cases, you can simplify things even more. + case ASTNode.FIELD_ACCESS: + FieldAccess fa = (FieldAccess) astNode; + if (fa.getExpression() == null) { + + // TODO: Check for existence of 'new' keyword. Could be a ClassInstanceCreation + + // Local code or belongs to super class + log("FA,Not implemented."); + return null; + } else { + if (fa.getExpression() instanceof SimpleName) { + stp = extracTypeInfo(findDeclaration2((SimpleName) fa.getExpression(), + nearestNode)); + if(stp == null){ + /*The type wasn't found in local code, so it might be something like + * log(), or maybe belonging to super class, etc. + */ + Class tehClass = findClassIfExists(((SimpleName)fa.getExpression()).toString()); + if (tehClass != null) { + // Method Expression is a simple name and wasn't located locally, but found in a class + // so look for method in this class. + return definedIn3rdPartyClass(new ClassMember(tehClass), fa + .getName().toString()); + } + log("FA resolve 3rd par, Can't resolve " + fa.getExpression()); + + return null; + } + log("FA, SN Type " + getNodeAsString(stp)); + scopeParent = definedIn3rdPartyClass(stp.getName().toString(), "THIS"); + + } else { + scopeParent = resolveExpression3rdParty(nearestNode, + fa.getExpression(), noCompare); + } + log("FA, ScopeParent " + scopeParent); + return definedIn3rdPartyClass(scopeParent, fa.getName().toString()); + } + case ASTNode.METHOD_INVOCATION: + MethodInvocation mi = (MethodInvocation) astNode; + ASTNode temp = findDeclaration2(mi.getName(), nearestNode); + if(temp instanceof MethodDeclaration){ + // method is locally defined + log(mi.getName() + " was found locally," + getNodeAsString(extracTypeInfo(temp))); + return new ClassMember(extracTypeInfo(temp)); + } + if (mi.getExpression() == null) { +// if() + //Local code or belongs to super class + log("MI,Not implemented."); + return null; + } else { + if (mi.getExpression() instanceof SimpleName) { + stp = extracTypeInfo(findDeclaration2((SimpleName) mi.getExpression(), + nearestNode)); + if(stp == null){ + /*The type wasn't found in local code, so it might be something like + * System.console()., or maybe belonging to super class, etc. + */ + Class tehClass = findClassIfExists(((SimpleName)mi.getExpression()).toString()); + if (tehClass != null) { + // Method Expression is a simple name and wasn't located locally, but found in a class + // so look for method in this class. + return definedIn3rdPartyClass(new ClassMember(tehClass), mi + .getName().toString()); + } + log("MI resolve 3rd par, Can't resolve " + mi.getExpression()); + return null; + } + log("MI, SN Type " + getNodeAsString(stp)); + ASTNode typeDec = findDeclaration2(stp.getName(),nearestNode); + if(typeDec == null){ + log(stp.getName() + " couldn't be found locally.."); + Class tehClass = findClassIfExists(stp.getName().toString()); + if (tehClass != null) { + // Method Expression is a simple name and wasn't located locally, but found in a class + // so look for method in this class. + return definedIn3rdPartyClass(new ClassMember(tehClass), mi + .getName().toString()); + } + //return new ClassMember(findClassIfExists(stp.getName().toString())); + } + //scopeParent = definedIn3rdPartyClass(stp.getName().toString(), "THIS"); + return definedIn3rdPartyClass(new ClassMember(typeDec), mi + .getName().toString()); + } else { + log("MI EXP.."+getNodeAsString(mi.getExpression())); +// return null; + scopeParent = resolveExpression3rdParty(nearestNode, + mi.getExpression(), noCompare); + log("MI, ScopeParent " + scopeParent); + return definedIn3rdPartyClass(scopeParent, mi.getName().toString()); + } + + } + case ASTNode.QUALIFIED_NAME: + QualifiedName qn = (QualifiedName) astNode; + ASTNode temp2 = findDeclaration2(qn.getName(), nearestNode); + if(temp2 instanceof FieldDeclaration){ + // field is locally defined + log(qn.getName() + " was found locally," + getNodeAsString(extracTypeInfo(temp2))); + return new ClassMember(extracTypeInfo(temp2)); + } + if (qn.getQualifier() == null) { + log("QN,Not implemented."); + return null; + } else { + + if (qn.getQualifier() instanceof SimpleName) { + stp = extracTypeInfo(findDeclaration2(qn.getQualifier(), nearestNode)); + if(stp == null){ + /*The type wasn't found in local code, so it might be something like + * log(), or maybe belonging to super class, etc. + */ + Class tehClass = findClassIfExists(qn.getQualifier().toString()); + if (tehClass != null) { + // note how similar thing is called on line 690. Check check. + return definedIn3rdPartyClass(new ClassMember(tehClass), qn + .getName().toString()); + } + log("QN resolve 3rd par, Can't resolve " + qn.getQualifier()); + return null; + } + log("QN, SN Local Type " + getNodeAsString(stp)); + //scopeParent = definedIn3rdPartyClass(stp.getName().toString(), "THIS"); + ASTNode typeDec = findDeclaration2(stp.getName(),nearestNode); + if(typeDec == null){ + log(stp.getName() + " couldn't be found locally.."); + + Class tehClass = findClassIfExists(stp.getName().toString()); + if (tehClass != null) { + // note how similar thing is called on line 690. Check check. + return definedIn3rdPartyClass(new ClassMember(tehClass), qn + .getName().toString()); + } + log("QN resolve 3rd par, Can't resolve " + qn.getQualifier()); + return null; + } + return definedIn3rdPartyClass(new ClassMember(typeDec), qn + .getName().toString()); + } else { + scopeParent = resolveExpression3rdParty(nearestNode, + qn.getQualifier(), noCompare); + log("QN, ScopeParent " + scopeParent); + return definedIn3rdPartyClass(scopeParent, qn.getName().toString()); + } + + } + case ASTNode.ARRAY_ACCESS: + ArrayAccess arac = (ArrayAccess)astNode; + return resolveExpression3rdParty(nearestNode, arac.getArray(), noCompare); + default: + log("Unaccounted type " + getNodeAsString(astNode)); + break; + } + + return null; + } + + /** + * For a().abc.a123 this would return a123 + * + * @param expression + * @return + */ + public static ASTNode getChildExpression(ASTNode expression) { +// ASTNode anode = null; + if (expression instanceof SimpleName) { + return expression; + } else if (expression instanceof FieldAccess) { + return ((FieldAccess) expression).getName(); + } else if (expression instanceof QualifiedName) { + return ((QualifiedName) expression).getName(); + }else if (expression instanceof MethodInvocation) { + return ((MethodInvocation) expression).getName(); + }else if(expression instanceof ArrayAccess){ + return ((ArrayAccess)expression).getArray(); + } + log(" getChildExpression returning NULL for " + + getNodeAsString(expression)); + return null; + } + + public static ASTNode getParentExpression(ASTNode expression) { +// ASTNode anode = null; + if (expression instanceof SimpleName) { + return expression; + } else if (expression instanceof FieldAccess) { + return ((FieldAccess) expression).getExpression(); + } else if (expression instanceof QualifiedName) { + return ((QualifiedName) expression).getQualifier(); + } else if (expression instanceof MethodInvocation) { + return ((MethodInvocation) expression).getExpression(); + } else if (expression instanceof ArrayAccess) { + return ((ArrayAccess) expression).getArray(); + } + log("getParentExpression returning NULL for " + + getNodeAsString(expression)); + return null; + } + + protected void trimCandidates(String newWord){ + ArrayList newCandidate = new ArrayList(); + newWord = newWord.toLowerCase(); + for (CompletionCandidate comp : candidates) { + if(comp.toString().toLowerCase().startsWith(newWord)){ + // log("Adding " + comp); + newCandidate.add(comp); + } + } + candidates = newCandidate; + } + + /** + * List of CompletionCandidates + */ + protected ArrayList candidates; + protected String lastPredictedWord = " "; + //protected AtomicBoolean predictionsEnabled; + protected int predictionMinLength = 2; + + + private AtomicBoolean predictionOngoing; + + /** + * The main function that calculates possible code completion candidates + * + * @param word + * @param line + * @param lineStartNonWSOffset + */ + public void preparePredictions(final String word, final int line, final int lineStartNonWSOffset) { + if(predictionOngoing.get()) return; + + if(!ExperimentalMode.codeCompletionsEnabled) return; + if(word.length() < predictionMinLength) return; + + predictionOngoing.set(true); + // This method is called from TextArea.fetchPhrase, which is called via a SwingWorker instance + // in TextArea.processKeyEvent + if(caretWithinLineComment()){ + log("No predictions."); + predictionOngoing.set(false); + return; + } + +// SwingWorker worker = new SwingWorker() { +// +// @Override +// protected Object doInBackground() throws Exception { +// return null; +// } +// +// protected void done() { + + // If the parsed code contains pde enhancements, take 'em out. + String word2 = ASTNodeWrapper.getJavaCode(word); + + //After typing 'arg.' all members of arg type are to be listed. This one is a flag for it + boolean noCompare = false; + if (word2.endsWith(".")) { + // return all matches + word2 = word2.substring(0, word2.length() - 1); + noCompare = true; + } + + if (word2.length() >= predictionMinLength && !noCompare + && word2.length() > lastPredictedWord.length()) { + if (word2.startsWith(lastPredictedWord)) { + log(word + " starts with " + lastPredictedWord); + log("Don't recalc"); + if (word2.contains(".")) { + int x = word2.lastIndexOf('.'); + trimCandidates(word2.substring(x + 1)); + } else { + trimCandidates(word2); + } + showPredictions(word); + lastPredictedWord = word2; + predictionOngoing.set(false); + return; + } + } + + int lineNumber = line; + // Adjust line number for tabbed sketches + if (errorCheckerService != null) { + editor = errorCheckerService.getEditor(); + int codeIndex = editor.getSketch().getCodeIndex(editor + .getCurrentTab()); + if (codeIndex > 0) + for (int i = 0; i < codeIndex; i++) { + SketchCode sc = editor.getSketch().getCode(i); + int len = Base.countLines(sc.getProgram()) + 1; + lineNumber += len; + } + + } + + // Ensure that we're not inside a comment. TODO: Binary search + + /*for (Comment comm : getCodeComments()) { + int commLineNo = PdeToJavaLineNumber(compilationUnit + .getLineNumber(comm.getStartPosition())); + if(commLineNo == lineNumber){ + log("Found a comment line " + comm); + log("Comment LSO " + + javaCodeOffsetToLineStartOffset(compilationUnit + .getLineNumber(comm.getStartPosition()), + comm.getStartPosition())); + break; + } + }*/ + + // Now parse the expression into an ASTNode object + ASTNode nearestNode = null; + ASTParser parser = ASTParser.newParser(AST.JLS4); + parser.setKind(ASTParser.K_EXPRESSION); + parser.setSource(word2.toCharArray()); + ASTNode testnode = parser.createAST(null); + //logE("PREDICTION PARSER PROBLEMS: " + parser); + // Find closest ASTNode of the document to this word + logE("Typed: " + word2 + "|" + " temp Node type: " + testnode.getClass().getSimpleName()); + if(testnode instanceof MethodInvocation){ + MethodInvocation mi = (MethodInvocation)testnode; + log(mi.getName() + "," + mi.getExpression() + "," + mi.typeArguments().size()); + } + + // find nearest ASTNode + nearestNode = findClosestNode(lineNumber, (ASTNode) errorCheckerService.getLastCorrectCU().types() + .get(0)); + if (nearestNode == null) { + // Make sure nearestNode is not NULL if couldn't find a closeset node + nearestNode = (ASTNode) errorCheckerService.getLastCorrectCU().types().get(0); + } + logE(lineNumber + " Nearest ASTNode to PRED " + + getNodeAsString(nearestNode)); + + candidates = new ArrayList(); + lastPredictedWord = word2; + // Determine the expression typed + + if (testnode instanceof SimpleName && !noCompare) { + logE("One word expression " + getNodeAsString(testnode)); + //==> Simple one word exprssion - so is just an identifier + + // Bottom up traversal of the AST to look for possible definitions at + // higher levels. + //nearestNode = nearestNode.getParent(); + while (nearestNode != null) { + // If the current class has a super class, look inside it for + // definitions. + if (nearestNode instanceof TypeDeclaration) { + TypeDeclaration td = (TypeDeclaration) nearestNode; + if (td + .getStructuralProperty(TypeDeclaration.SUPERCLASS_TYPE_PROPERTY) != null) { + SimpleType st = (SimpleType) td + .getStructuralProperty(TypeDeclaration.SUPERCLASS_TYPE_PROPERTY); + log("Superclass " + st.getName()); + for (CompletionCandidate can : getMembersForType(st.getName() + .toString(), word2, noCompare, false)) { + candidates.add(can); + } + //findDeclaration(st.getName()) + + } + } + List sprops = nearestNode + .structuralPropertiesForType(); + for (StructuralPropertyDescriptor sprop : sprops) { + ASTNode cnode = null; + if (!sprop.isChildListProperty()) { + if (nearestNode.getStructuralProperty(sprop) instanceof ASTNode) { + cnode = (ASTNode) nearestNode.getStructuralProperty(sprop); + CompletionCandidate[] types = checkForTypes(cnode); + if (types != null) { + for (int i = 0; i < types.length; i++) { + if (types[i].getElementName().toLowerCase().startsWith(word2.toLowerCase())) + candidates.add(types[i]); + } + } + } + } else { + // Childlist prop + List nodelist = (List) nearestNode + .getStructuralProperty(sprop); + for (ASTNode clnode : nodelist) { + CompletionCandidate[] types = checkForTypes(clnode); + if (types != null) { + for (int i = 0; i < types.length; i++) { + if (types[i].getElementName().toLowerCase().startsWith(word2.toLowerCase())) + candidates.add(types[i]); + } + } + } + } + } + nearestNode = nearestNode.getParent(); + } + // We're seeing a simple name that's not defined locally or in + // the parent class. So most probably a pre-defined type. + log("Empty can. " + word2); + if (classPath != null) { + RegExpResourceFilter regExpResourceFilter; + regExpResourceFilter = new RegExpResourceFilter( + Pattern + .compile(".*"), + Pattern + .compile(word2 + + "[a-zA-Z_0-9]*.class", + Pattern.CASE_INSENSITIVE)); + String[] resources = classPath.findResources("", + regExpResourceFilter); + for (String matchedClass2 : resources) { + matchedClass2 = matchedClass2.replace('/', '.'); + String matchedClass = matchedClass2.substring(0, matchedClass2 + .length() - 6); + int d = matchedClass.lastIndexOf('.'); + if (ignorableImport(matchedClass2,matchedClass.substring(d + 1))) + continue; + + matchedClass = matchedClass.substring(d + 1); + candidates + .add(new CompletionCandidate(matchedClass, matchedClass + + " : " + matchedClass2.substring(0, d), matchedClass, + CompletionCandidate.PREDEF_CLASS)); + //log("-> " + className); + } + } + } else { + + // ==> Complex expression of type blah.blah2().doIt,etc + // Have to resolve it by carefully traversing AST of testNode + logE("Complex expression " + getNodeAsString(testnode)); + log("candidates empty"); + ASTNode childExpr = getChildExpression(testnode); + log("Parent expression : " + getParentExpression(testnode)); + log("Child expression : " + childExpr); + if (childExpr != null) { + if (!noCompare) { + log("Original testnode " + + getNodeAsString(testnode)); + testnode = getParentExpression(testnode); + log("Corrected testnode " + + getNodeAsString(testnode)); + } + ClassMember expr = resolveExpression3rdParty(nearestNode, testnode, + noCompare); + if (expr == null) { + log("Expr is null"); + } else { + log("Expr is " + expr.toString()); + candidates = getMembersForType(expr, childExpr.toString(), + noCompare, false); + } + } + else + { + log("ChildExpr is null"); + } + } + + showPredictions(word); + predictionOngoing.set(false); +// } +// }; +// +// worker.execute(); + } + + protected void showPredictions(final String word) { + if (sketchOutline != null) + if (sketchOutline.isVisible()) return; + Collections.sort(candidates); +// CompletionCandidate[][] candi = new CompletionCandidate[candidates.size()][1]; + DefaultListModel defListModel = new DefaultListModel(); + + for (int i = 0; i < candidates.size(); i++) { +// candi[i][0] = candidates.get(i); + defListModel.addElement(candidates.get(i)); + } + log("Total preds = " + candidates.size()); +// DefaultTableModel tm = new DefaultTableModel(candi, +// new String[] { "Suggestions" }); +// if (tableAuto.isVisible()) { +// tableAuto.setModel(tm); +// tableAuto.validate(); +// tableAuto.repaint(); +// } + errorCheckerService.getEditor().textArea() + .showSuggestion(defListModel, word); + } + + /** + * Loads classes from .jar files in sketch classpath + * + * @param typeName + * @param child + * @param noCompare + * @return + */ + public ArrayList getMembersForType(String typeName, + String child, + boolean noCompare, + boolean staticOnly) { + + ArrayList candidates = new ArrayList(); + log("In GMFT(), Looking for match " + child.toString() + + " in class " + typeName + " noCompare " + noCompare + " staticOnly " + + staticOnly); + Class probableClass = findClassIfExists(typeName); + if(probableClass == null){ + log("In GMFT(), class not found."); + return candidates; + } + return getMembersForType(new ClassMember(probableClass), child, noCompare, staticOnly); + + } + + public ArrayList getMembersForType(ClassMember tehClass, + String childToLookFor, + boolean noCompare, + boolean staticOnly) { + String child = childToLookFor.toLowerCase(); + ArrayList candidates = new ArrayList(); + log("getMemFoType-> Looking for match " + child.toString() + + " inside " + tehClass + " noCompare " + noCompare + " staticOnly " + + staticOnly); + if(tehClass == null){ + return candidates; + } + // tehClass will either be a TypeDecl defined locally + if(tehClass.getDeclaringNode() instanceof TypeDeclaration){ + + TypeDeclaration td = (TypeDeclaration) tehClass.getDeclaringNode(); + for (int i = 0; i < td.getFields().length; i++) { + List vdfs = td.getFields()[i] + .fragments(); + for (VariableDeclarationFragment vdf : vdfs) { + if (noCompare) { + candidates + .add(new CompletionCandidate(vdf)); + } else if (vdf.getName().toString().toLowerCase() + .startsWith(child)) + candidates + .add(new CompletionCandidate(vdf)); + } + + } + for (int i = 0; i < td.getMethods().length; i++) { + if (noCompare) { + candidates.add(new CompletionCandidate(td.getMethods()[i])); + } else if (td.getMethods()[i].getName().toString().toLowerCase() + .startsWith(child)) + candidates.add(new CompletionCandidate(td.getMethods()[i])); + } + + ArrayList superClassCandidates = new ArrayList(); + if(td.getSuperclassType() instanceof Type){ + log(getNodeAsString(td.getSuperclassType()) + " <-Looking into superclass of " + tehClass); + superClassCandidates = getMembersForType(new ClassMember(td + .getSuperclassType()), + childToLookFor, noCompare, staticOnly); + } + else + { + superClassCandidates = getMembersForType(new ClassMember(Object.class), + childToLookFor, noCompare, staticOnly); + } + for (CompletionCandidate cc : superClassCandidates) { + candidates.add(cc); + } + return candidates; + } + + // Or tehClass will be a predefined class + + Class probableClass; + if (tehClass.getClass_() != null) { + probableClass = tehClass.getClass_(); + } else { + probableClass = findClassIfExists(tehClass.getTypeAsString()); + if (probableClass == null) { + log("Couldn't find class " + tehClass.getTypeAsString()); + return candidates; + } + log("Loaded " + probableClass.toString()); + } + for (Method method : probableClass.getMethods()) { + if (!Modifier.isStatic(method.getModifiers()) && staticOnly) { + continue; + } + + StringBuffer label = new StringBuffer(method.getName() + "("); + for (int i = 0; i < method.getParameterTypes().length; i++) { + label.append(method.getParameterTypes()[i].getSimpleName()); + if (i < method.getParameterTypes().length - 1) + label.append(","); + } + label.append(")"); + if (noCompare) { + candidates.add(new CompletionCandidate(method)); + } else if (label.toString().toLowerCase().startsWith(child)) { + candidates.add(new CompletionCandidate(method)); + } + } + for (Field field : probableClass.getFields()) { + if (!Modifier.isStatic(field.getModifiers()) && staticOnly) { + continue; + } + if (noCompare) { + candidates.add(new CompletionCandidate(field)); + } else if (field.getName().toLowerCase().startsWith(child)) { + candidates.add(new CompletionCandidate(field)); + } + } + return candidates; + } + + public String getPDESourceCodeLine(int javaLineNumber) { + int res[] = errorCheckerService + .calculateTabIndexAndLineNumber(javaLineNumber); + if (res != null) { + return errorCheckerService.getPDECodeAtLine(res[0], res[1]); + } + return null; + } + + /** + * Returns the java source code line at the given line number + * @param javaLineNumber + * @return + */ + public String getJavaSourceCodeLine(int javaLineNumber) { + try { + PlainDocument javaSource = new PlainDocument(); + javaSource.insertString(0, errorCheckerService.sourceCode, null); + Element lineElement = javaSource.getDefaultRootElement() + .getElement(javaLineNumber - 1); + if (lineElement == null) { + log("Couldn't fetch jlinenum " + javaLineNumber); + return null; + } + String javaLine = javaSource.getText(lineElement.getStartOffset(), + lineElement.getEndOffset() + - lineElement.getStartOffset()); + return javaLine; + } catch (BadLocationException e) { + logE(e + " in getJavaSourceCodeline() for jinenum: " + javaLineNumber); + } + return null; + } + + /** + * Returns the java source code line Element at the given line number. + * The Element object stores the offset data, but not the actual line + * of code. + * @param javaLineNumber + * @return + */ + public Element getJavaSourceCodeElement(int javaLineNumber) { + try { + PlainDocument javaSource = new PlainDocument(); + javaSource.insertString(0, errorCheckerService.sourceCode, null); + Element lineElement = javaSource.getDefaultRootElement() + .getElement(javaLineNumber - 1); + if (lineElement == null) { + log("Couldn't fetch jlinenum " + javaLineNumber); + return null; + } +// String javaLine = javaSource.getText(lineElement.getStartOffset(), +// lineElement.getEndOffset() +// - lineElement.getStartOffset()); + return lineElement; + } catch (BadLocationException e) { + logE(e + " in getJavaSourceCodeline() for jinenum: " + javaLineNumber); + } + return null; + } + + /** + * Searches for the particular class in the default list of imports as well as + * the Sketch classpath + * @param className + * @return + */ + protected Class findClassIfExists(String className){ + if(className == null){ + return null; + } + Class tehClass = null; + // First, see if the classname is a fully qualified name and loads straightaway + tehClass = loadClass(className); + + if (tehClass != null) { + //log(tehClass.getName() + " located straightaway"); + return tehClass; + } + + log("Looking in the classloader for " + className); + ArrayList imports = errorCheckerService + .getProgramImports(); + + for (ImportStatement impS : imports) { + String temp = impS.getPackageName(); + + if (temp.endsWith("*")) { + temp = temp.substring(0, temp.length() - 1) + className; + } else { + int x = temp.lastIndexOf('.'); + //log("fclife " + temp.substring(x + 1)); + if (!temp.substring(x + 1).equals(className)) { + continue; + } + } + tehClass = loadClass(temp); + if (tehClass != null) { + log(tehClass.getName() + " located."); + return tehClass; + } + + //log("Doesn't exist in package: " + impS.getImportName()); + + } + + PdePreprocessor p = new PdePreprocessor(null); + for (String impS : p.getCoreImports()) { + tehClass = loadClass(impS.substring(0,impS.length()-1) + className); + if (tehClass != null) { + log(tehClass.getName() + " located."); + return tehClass; + } + //log("Doesn't exist in package: " + impS); + } + + for (String impS : p.getDefaultImports()) { + if(className.equals(impS) || impS.endsWith(className)){ + tehClass = loadClass(impS); + if (tehClass != null) { + log(tehClass.getName() + " located."); + return tehClass; + } + // log("Doesn't exist in package: " + impS); + } + } + + // And finally, the daddy + String daddy = "java.lang." + className; + tehClass = loadClass(daddy); + if (tehClass != null) { + log(tehClass.getName() + " located."); + return tehClass; + } + //log("Doesn't exist in java.lang"); + + return tehClass; + } + + protected Class loadClass(String className){ + Class tehClass = null; + if(className instanceof String){ + try { + tehClass = Class.forName(className, false, + errorCheckerService.getSketchClassLoader()); + } catch (ClassNotFoundException e) { + //log("Doesn't exist in package: "); + } + } + return tehClass; + } + + public ClassMember definedIn3rdPartyClass(String className,String memberName){ + Class probableClass = findClassIfExists(className); + if (probableClass == null) { + log("Couldn't load " + className); + return null; + } + if (memberName.equals("THIS")) { + return new ClassMember(probableClass); + } else { + return definedIn3rdPartyClass(new ClassMember(probableClass), memberName); + } + } + + public ClassMember definedIn3rdPartyClass(ClassMember tehClass,String memberName){ + if(tehClass == null) + return null; + log("definedIn3rdPartyClass-> Looking for " + memberName + + " in " + tehClass); + String memberNameL = memberName.toLowerCase(); + if(tehClass.getDeclaringNode() instanceof TypeDeclaration){ + + TypeDeclaration td = (TypeDeclaration) tehClass.getDeclaringNode(); + for (int i = 0; i < td.getFields().length; i++) { + List vdfs = td.getFields()[i] + .fragments(); + for (VariableDeclarationFragment vdf : vdfs) { + if (vdf.getName().toString().toLowerCase() + .startsWith(memberNameL)) + return new ClassMember(vdf); + } + + } + for (int i = 0; i < td.getMethods().length; i++) { + if (td.getMethods()[i].getName().toString().toLowerCase() + .startsWith(memberNameL)) + return new ClassMember(td.getMethods()[i]); + } + if(td.getSuperclassType() instanceof Type){ + log(getNodeAsString(td.getSuperclassType()) + " <-Looking into superclass of " + tehClass); + return definedIn3rdPartyClass(new ClassMember(td + .getSuperclassType()),memberName); + } + else + { + return definedIn3rdPartyClass(new ClassMember(Object.class),memberName); + } + } + + Class probableClass = null; + if(tehClass.getClass_() != null){ + probableClass = tehClass.getClass_(); + } + else + { + probableClass = findClassIfExists(tehClass.getTypeAsString()); + log("Loaded " + probableClass.toString()); + } + for (Method method : probableClass.getMethods()) { + if (method.getName().equalsIgnoreCase(memberName)) { + return new ClassMember(method); + } + } + for (Field field : probableClass.getFields()) { + if (field.getName().equalsIgnoreCase(memberName)) { + return new ClassMember(field); + } + } + return null; + } + + public void updateJavaDoc(final CompletionCandidate candidate) { + //TODO: Work on this later. + return; + /* String methodmatch = candidate.toString(); + if (methodmatch.indexOf('(') != -1) { + methodmatch = methodmatch.substring(0, methodmatch.indexOf('(')); + } + + //log("jdoc match " + methodmatch); + String temp = " "; + for (final String key : jdocMap.keySet()) { + if (key.startsWith(methodmatch) && key.length() > 3) { + log("Matched jdoc " + key); + if (candidate.getWrappedObject() != null) { + String definingClass = ""; + if (candidate.getWrappedObject() instanceof Field) + definingClass = ((Field) candidate.getWrappedObject()) + .getDeclaringClass().getName(); + else if (candidate.getWrappedObject() instanceof Method) + definingClass = ((Method) candidate.getWrappedObject()) + .getDeclaringClass().getName(); + if (definingClass.equals("processing.core.PApplet")) { + temp = (jdocMap.get(key)); + break; + } + } + } + } + + final String jdocString = temp; + SwingUtilities.invokeLater(new Runnable() { + public void run() { + javadocPane.setText(jdocString); + scrollPane.getVerticalScrollBar().setValue(0); + //frmJavaDoc.setVisible(!jdocString.equals(" ")); + editor.toFront(); + editor.ta.requestFocus(); + } + }); +*/ + } + + @SuppressWarnings("unchecked") + protected static ASTNode findClosestParentNode(int lineNumber, ASTNode node) { + Iterator it = node + .structuralPropertiesForType().iterator(); + // logE("Props of " + node.getClass().getName()); + while (it.hasNext()) { + StructuralPropertyDescriptor prop = it.next(); + + if (prop.isChildProperty() || prop.isSimpleProperty()) { + if (node.getStructuralProperty(prop) != null) { +// System.out +// .println(node.getStructuralProperty(prop) + " -> " + (prop)); + if (node.getStructuralProperty(prop) instanceof ASTNode) { + ASTNode cnode = (ASTNode) node.getStructuralProperty(prop); +// log("Looking at " + getNodeAsString(cnode)+ " for line num " + lineNumber); + int cLineNum = ((CompilationUnit) cnode.getRoot()) + .getLineNumber(cnode.getStartPosition() + cnode.getLength()); + if (getLineNumber(cnode) <= lineNumber && lineNumber <= cLineNum) { + return findClosestParentNode(lineNumber, cnode); + } + } + } + } + + else if (prop.isChildListProperty()) { + List nodelist = (List) node + .getStructuralProperty(prop); + for (ASTNode cnode : nodelist) { + int cLineNum = ((CompilationUnit) cnode.getRoot()) + .getLineNumber(cnode.getStartPosition() + cnode.getLength()); +// log("Looking at " + getNodeAsString(cnode)+ " for line num " + lineNumber); + if (getLineNumber(cnode) <= lineNumber && lineNumber <= cLineNum) { + return findClosestParentNode(lineNumber, cnode); + } + } + } + } + return node; + } + + protected static ASTNode findClosestNode(int lineNumber, ASTNode node) { + log("findClosestNode to line " + lineNumber); + ASTNode parent = findClosestParentNode(lineNumber, node); + log("findClosestParentNode returned " + getNodeAsString(parent)); + if (parent == null) + return null; + if (getLineNumber(parent) == lineNumber){ + log(parent + "|PNode " + getLineNumber(parent) + ", lfor " + lineNumber ); + return parent; + } + List nodes = null; + if (parent instanceof TypeDeclaration) { + nodes = ((TypeDeclaration) parent).bodyDeclarations(); + } else if (parent instanceof Block) { + nodes = ((Block) parent).statements(); + } else { + System.err.println("THIS CONDITION SHOULD NOT OCCUR - findClosestNode " + + getNodeAsString(parent)); + return null; + } + + if (nodes.size() > 0) { + ASTNode retNode = parent; + for (int i = 0; i < nodes.size(); i++) { + ASTNode cNode = nodes.get(i); + log(cNode + "|cNode " + getLineNumber(cNode) + ", lfor " + lineNumber ); + if (getLineNumber(cNode) <= lineNumber) + retNode = cNode; + } + + return retNode; + } + return parent; + } + + public DefaultMutableTreeNode getAST() { + return codeTree; + } + + public String getLabelForASTNode(int lineNumber, String name, int offset) { + return getASTNodeAt(lineNumber, name, offset, false).getLabel(); + //return ""; + } + + protected String getLabelIfType(ASTNodeWrapper node, SimpleName sn){ + ASTNode current = node.getNode().getParent(); + String type = ""; + StringBuffer fullName = new StringBuffer(); + Stack parents = new Stack(); + String simpleName = (sn == null) ? node.getNode().toString() : sn.toString(); + switch (node.getNodeType()) { + case ASTNode.TYPE_DECLARATION: + case ASTNode.METHOD_DECLARATION: + case ASTNode.FIELD_DECLARATION: + while (current != null) { + if (current instanceof TypeDeclaration) { + parents.push(((TypeDeclaration) current).getName().toString()); + } + current = current.getParent(); + } + while (parents.size() > 0) { + fullName.append(parents.pop() + "."); + } + fullName.append(simpleName); + if (node.getNode() instanceof MethodDeclaration) { + MethodDeclaration md = (MethodDeclaration) node.getNode(); + if (!md.isConstructor()) + type = md.getReturnType2().toString(); + fullName.append('('); + if (!md.parameters().isEmpty()) { + List params = md.parameters(); + for (ASTNode par : params) { + if (par instanceof SingleVariableDeclaration) { + SingleVariableDeclaration svd = (SingleVariableDeclaration) par; + fullName.append(svd.getType() + " " + svd.getName() + ","); + } + } + } + if(fullName.charAt(fullName.length() - 1) == ',') + fullName.deleteCharAt(fullName.length() - 1); + fullName.append(')'); + } + else if(node.getNode() instanceof FieldDeclaration){ + type = ((FieldDeclaration) node.getNode()).getType().toString(); + } + int x = fullName.indexOf("."); + fullName.delete(0, x + 1); + return type + " " + fullName; + + case ASTNode.SINGLE_VARIABLE_DECLARATION: + SingleVariableDeclaration svd = (SingleVariableDeclaration)node.getNode(); + return svd.getType() + " " + svd.getName(); + + case ASTNode.VARIABLE_DECLARATION_STATEMENT: + return ((VariableDeclarationStatement) node.getNode()).getType() + " " + + simpleName; + case ASTNode.VARIABLE_DECLARATION_EXPRESSION: + return ((VariableDeclarationExpression) node.getNode()).getType() + " " + + simpleName; + default: + break; + } + + + return ""; + } + + public void scrollToDeclaration(int lineNumber, String name, int offset) { + getASTNodeAt(lineNumber, name, offset, true); + } + + + /** + * Given a word(identifier) in pde code, finds its location in the ASTNode + * @param lineNumber + * @param name + * @param offset - line start nonwhitespace offset + * @param scrollOnly + * @return + */ + public ASTNodeWrapper getASTNodeAt(int lineNumber, String name, int offset, + boolean scrollOnly) { + + // Convert tab based pde line number to actual line number + int pdeLineNumber = lineNumber + errorCheckerService.mainClassOffset; +// log("----getASTNodeAt---- CU State: " +// + errorCheckerService.compilationUnitState); + if (errorCheckerService != null) { + editor = errorCheckerService.getEditor(); + int codeIndex = editor.getSketch().getCodeIndex(editor.getCurrentTab()); + if (codeIndex > 0) { + for (int i = 0; i < codeIndex; i++) { + SketchCode sc = editor.getSketch().getCode(i); + int len = Base.countLines(sc.getProgram()) + 1; + pdeLineNumber += len; + } + } + + } + + // Find closest ASTNode to the linenumber +// log("getASTNodeAt: Node line number " + pdeLineNumber); + ASTNode lineNode = findLineOfNode(compilationUnit, pdeLineNumber, offset, + name); + +// log("Node text +> " + lineNode); + ASTNode decl = null; + String nodeLabel = null; + String nameOfNode = null; // The node name which is to be scrolled to + + // Obtain correspondin java code at that line, match offsets + if (lineNode != null) { + String pdeCodeLine = errorCheckerService.getPDECodeAtLine(editor + .getSketch().getCurrentCodeIndex(), lineNumber); + String javaCodeLine = getJavaSourceCodeLine(pdeLineNumber); + +// log(lineNumber + " Original Line num.\nPDE :" + pdeCodeLine); +// log("JAVA:" + javaCodeLine); +// log("Clicked on: " + name + " start offset: " + offset); + // Calculate expected java offset based on the pde line + OffsetMatcher ofm = new OffsetMatcher(pdeCodeLine, javaCodeLine); + int javaOffset = ofm.getJavaOffForPdeOff(offset, name.length()) + + lineNode.getStartPosition(); +// log("JAVA ast offset: " + (javaOffset)); + + // Find the corresponding node in the AST + ASTNode simpName = dfsLookForASTNode(errorCheckerService.getLatestCU(), + name, javaOffset, + javaOffset + name.length()); + + // If node wasn't found in the AST, lineNode may contain something + if (simpName == null && lineNode instanceof SimpleName) { + switch (lineNode.getParent().getNodeType()) { + case ASTNode.TYPE_DECLARATION: + + case ASTNode.METHOD_DECLARATION: + + case ASTNode.FIELD_DECLARATION: + + case ASTNode.VARIABLE_DECLARATION_FRAGMENT: + decl = lineNode.getParent(); + return new ASTNodeWrapper(decl, ""); + default: + break; + } + } + + // SimpleName instance found, now find its declaration in code + if (simpName instanceof SimpleName) { + nameOfNode = simpName.toString(); + // log(getNodeAsString(simpName)); + decl = findDeclaration((SimpleName) simpName); + if (decl != null) { +// logE("DECLA: " + decl.getClass().getName()); + nodeLabel = getLabelIfType(new ASTNodeWrapper(decl), + (SimpleName) simpName); + //retLabelString = getNodeAsString(decl); + } else { +// logE("null"); + if (scrollOnly) { + editor.statusMessage(simpName + " is not defined in this sketch", + DebugEditor.STATUS_ERR); + } + } + +// log(getNodeAsString(decl)); + + /* + // - findDecl3 testing + + ASTNode nearestNode = findClosestNode(lineNumber, + (ASTNode) compilationUnit.types() + .get(0)); + ClassMember cmem = resolveExpression3rdParty(nearestNode, + (SimpleName) simpName, + false); + if (cmem != null) { + log("CMEM-> " + cmem); + } else + log("CMEM-> null"); + */ + } + } + + if (decl != null && scrollOnly) { + /* + * For scrolling, we highlight just the name of the node, i.e., a + * SimpleName instance. But the declared node always points to the + * declared node itself, like TypeDecl, MethodDecl, etc. This is important + * since it contains all the properties. + */ + ASTNode simpName2 = getNodeName(decl, nameOfNode); +// logE("FINAL String decl: " + getNodeAsString(decl)); +// logE("FINAL String label: " + getNodeAsString(simpName2)); + //errorCheckerService.highlightNode(simpName2); + ASTNodeWrapper declWrap = new ASTNodeWrapper(simpName2, nodeLabel); + //errorCheckerService.highlightNode(declWrap); + if (!declWrap.highlightNode(this)) { + logE("Highlighting failed."); + } + } + + // Return the declaration wrapped as ASTNodeWrapper + return new ASTNodeWrapper(decl, nodeLabel); + } + + /** + * Given a declaration type astnode, returns the SimpleName peroperty + * of that node. + * @param node + * @param name - The name we're looking for. + * @return SimpleName + */ + protected static ASTNode getNodeName(ASTNode node, String name){ + List vdfs = null; + switch (node.getNodeType()) { + case ASTNode.TYPE_DECLARATION: + return ((TypeDeclaration) node).getName(); + case ASTNode.METHOD_DECLARATION: + return ((MethodDeclaration) node).getName(); + case ASTNode.SINGLE_VARIABLE_DECLARATION: + return ((SingleVariableDeclaration) node).getName(); + case ASTNode.FIELD_DECLARATION: + vdfs = ((FieldDeclaration) node).fragments(); + break; + case ASTNode.VARIABLE_DECLARATION_STATEMENT: + vdfs = ((VariableDeclarationStatement) node).fragments(); + break; + case ASTNode.VARIABLE_DECLARATION_EXPRESSION: + vdfs = ((VariableDeclarationExpression) node).fragments(); + break; + default: + break; + } + + if (vdfs != null) { + for (VariableDeclarationFragment vdf : vdfs) { + if (vdf.getName().toString().equals(name)) { + return vdf.getName(); + } + } + + } + return null; + } + + /** + * Fetches line number of the node in its CompilationUnit. + * @param node + * @return + */ + public static int getLineNumber(ASTNode node) { + return ((CompilationUnit) node.getRoot()).getLineNumber(node + .getStartPosition()); + } + + public static int getLineNumber(ASTNode node, int pos) { + return ((CompilationUnit) node.getRoot()).getLineNumber(pos); + } + + public static void main(String[] args) { + //traversal2(); + } + + public static void traversal2() { + ASTParser parser = ASTParser.newParser(AST.JLS4); + String source = readFile("/media/quarkninja/Work/TestStuff/low.java"); +// String source = "package decl; \npublic class ABC{\n int ret(){\n}\n}"; + parser.setSource(source.toCharArray()); + parser.setKind(ASTParser.K_COMPILATION_UNIT); + + Map options = JavaCore.getOptions(); + + JavaCore.setComplianceOptions(JavaCore.VERSION_1_6, options); + options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_6); + parser.setCompilerOptions(options); + + CompilationUnit cu = (CompilationUnit) parser.createAST(null); + log(CompilationUnit.propertyDescriptors(AST.JLS4).size()); + + DefaultMutableTreeNode astTree = new DefaultMutableTreeNode( + "CompilationUnit"); + logE("Errors: " + cu.getProblems().length); + visitRecur(cu, astTree); + log(astTree.getChildCount()); + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + JFrame frame2 = new JFrame(); + JTree jtree = new JTree(astTree); + frame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame2.setBounds(new Rectangle(100, 100, 460, 620)); + JScrollPane sp = new JScrollPane(); + sp.setViewportView(jtree); + frame2.add(sp); + frame2.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + + ASTNode found = NodeFinder.perform(cu, 468, 5); + if (found != null) { + log(found); + } + } + + final ASTGenerator thisASTGenerator = this; + + protected void addListeners(){ + jtree.addTreeSelectionListener(new TreeSelectionListener() { + + @Override + public void valueChanged(TreeSelectionEvent e) { + log(e); + SwingWorker worker = new SwingWorker() { + + @Override + protected Object doInBackground() throws Exception { + return null; + } + + protected void done() { + if(jtree + .getLastSelectedPathComponent() == null){ + return; + } + DefaultMutableTreeNode tnode = (DefaultMutableTreeNode) jtree + .getLastSelectedPathComponent(); + if (tnode.getUserObject() instanceof ASTNodeWrapper) { + ASTNodeWrapper awrap = (ASTNodeWrapper) tnode.getUserObject(); + awrap.highlightNode(thisASTGenerator); + // errorCheckerService.highlightNode(awrap); + + //-- + try { + int javaLineNumber = getLineNumber(awrap.getNode()); + int pdeOffs[] = errorCheckerService + .calculateTabIndexAndLineNumber(javaLineNumber); + PlainDocument javaSource = new PlainDocument(); + javaSource.insertString(0, errorCheckerService.sourceCode, null); + Element lineElement = javaSource.getDefaultRootElement() + .getElement(javaLineNumber-1); + if(lineElement == null) { + return; + } + + String javaLine = javaSource.getText(lineElement.getStartOffset(), + lineElement.getEndOffset() + - lineElement.getStartOffset()); + editor.getSketch().setCurrentCode(pdeOffs[0]); + String pdeLine = editor.getLineText(pdeOffs[1]); + //String lookingFor = nodeName.toString(); + //log(lookingFor + ", " + nodeName.getStartPosition()); + log("JL " + javaLine + " LSO " + lineElement.getStartOffset() + "," + + lineElement.getEndOffset()); + log("PL " + pdeLine); + } catch (BadLocationException e) { + e.printStackTrace(); + } + } + } + }; + worker.execute(); + } + }); + + btnRename.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + if(txtRenameField.getText().length() == 0) + return; + SwingWorker worker = new SwingWorker() { + + @Override + protected Object doInBackground() throws Exception { + return null; + } + + protected void done() { + refactorIt(); + } + }; + worker.execute(); + } + }); + + btnListOccurrence.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + SwingWorker worker = new SwingWorker() { + + @Override + protected Object doInBackground() throws Exception { + return null; + } + + protected void done() { + handleShowUsage(); + } + }; + worker.execute(); + } + }); + + treeRename.addTreeSelectionListener(new TreeSelectionListener() { + + @Override + public void valueChanged(TreeSelectionEvent e) { + log(e); + SwingWorker worker = new SwingWorker() { + + @Override + protected Object doInBackground() throws Exception { + return null; + } + + protected void done() { + if(treeRename + .getLastSelectedPathComponent() == null){ + return; + } + DefaultMutableTreeNode tnode = (DefaultMutableTreeNode) treeRename + .getLastSelectedPathComponent(); + + if (tnode.getUserObject() instanceof ASTNodeWrapper) { + ASTNodeWrapper awrap = (ASTNodeWrapper) tnode.getUserObject(); + //errorCheckerService.highlightNode(awrap); + awrap.highlightNode(thisASTGenerator); + } + } + }; + worker.execute(); + } + }); + } + + protected void refactorIt(){ + String newName = txtRenameField.getText().trim(); + String selText = lastClickedWord == null ? editor.ta.getSelectedText() + : lastClickedWord; + // Find all occurrences of last clicked word + DefaultMutableTreeNode defCU = findAllOccurrences(); //TODO: Repetition here + if(defCU == null){ + editor.statusMessage("Can't locate definition of " + selText, + DebugEditor.STATUS_ERR); + return; + } + + // Verify if the new name is a valid java identifier + if(!newName.matches("([a-zA-Z][a-zA-Z0-9_]*)|([_][a-zA-Z0-9_]+)")) + { + JOptionPane.showConfirmDialog(new JFrame(), newName + + " isn't a valid name.", "Uh oh..", JOptionPane.PLAIN_MESSAGE); + return; + } + //else log("New name looks K."); + + errorCheckerService.pauseThread(); + if(treeRename.isVisible()){ + treeRename.setModel(new DefaultTreeModel(defCU)); + ((DefaultTreeModel) treeRename.getModel()).reload(); + } +// frmOccurenceList.setTitle("Usage of \"" + selText + "\" : " +// + defCU.getChildCount() + " time(s)"); +// frmOccurenceList.setLocation(editor.getX() + editor.getWidth(),editor.getY()); +// frmOccurenceList.setVisible(true); + int lineOffsetDisplacementConst = newName.length() + - selText.length(); + HashMap lineOffsetDisplacement = new HashMap(); + + // I need to store the pde and java offsets beforehand because once + // the replace starts, all offsets returned are affected + //int offsetsMap[][][] = new int[defCU.getChildCount()][2][]; + int pdeOffsets[][] = new int[defCU.getChildCount()][3]; + for (int i = 0; i < defCU.getChildCount(); i++) { + ASTNodeWrapper awrap = (ASTNodeWrapper) ((DefaultMutableTreeNode) (defCU + .getChildAt(i))).getUserObject(); + int ans[] = errorCheckerService.calculateTabIndexAndLineNumber(awrap + .getLineNumber()); + pdeOffsets[i][0] = ans[0]; + pdeOffsets[i][1] = ans[1]; + pdeOffsets[i][2] = awrap.getPDECodeOffsetForSN(this); + } + + editor.startCompoundEdit(); + for (int i = 0; i < defCU.getChildCount(); i++) { + ASTNodeWrapper awrap = (ASTNodeWrapper) ((DefaultMutableTreeNode) (defCU + .getChildAt(i))).getUserObject(); + // correction for pde enhancements related displacement on a line + int off = 0; + if (lineOffsetDisplacement.get(awrap.getLineNumber()) != null) { + off = lineOffsetDisplacement.get(awrap.getLineNumber()); + + lineOffsetDisplacement.put(awrap.getLineNumber(), + lineOffsetDisplacementConst + off); + } else { + lineOffsetDisplacement.put(awrap.getLineNumber(), + lineOffsetDisplacementConst); + } +// logE(getNodeAsString(awrap.getNode()) + ", T:" + pdeOffsets[i][0] +// + ", L:" + pdeOffsets[i][1] + ", O:" + pdeOffsets[i][2]); + highlightPDECode(pdeOffsets[i][0], + pdeOffsets[i][1], pdeOffsets[i][2] + + off, awrap.getNode() + .toString().length()); + //int k = JOptionPane.showConfirmDialog(new JFrame(), "Rename?","", JOptionPane.INFORMATION_MESSAGE); + editor.ta.setSelectedText(newName); + } + editor.stopCompoundEdit(); + errorCheckerService.resumeThread(); + editor.getSketch().setModified(true); + errorCheckerService.runManualErrorCheck(); +// frmOccurenceList.setVisible(false); + frmRename.setVisible(false); + lastClickedWord = null; + lastClickedWordNode = null; + } + + /** + * Highlights text in the editor + * @param tab + * @param lineNumber + * @param lineStartWSOffset - line start offset including initial white space + * @param length + */ + public void highlightPDECode(int tab, int lineNumber, int lineStartWSOffset, + int length) { +// log("ASTGen.highlightPDECode: T " + tab + ",L: " + lineNumber + ",LSO: " +// + lineStartWSOffset + ",Len: " + length); + editor.toFront(); + editor.getSketch().setCurrentCode(tab); + lineStartWSOffset += editor.ta.getLineStartOffset(lineNumber); + editor.ta.select(lineStartWSOffset, lineStartWSOffset + length); + } + + public void handleShowUsage(){ + if(editor.hasJavaTabs) return; // show usage disabled if java tabs + log("Last clicked word:" + lastClickedWord); + if(lastClickedWord == null && editor.ta.getSelectedText() == null){ + editor.statusMessage("Highlight the class/function/variable name first" + , DebugEditor.STATUS_INFO); + return; + } + + if(errorCheckerService.hasSyntaxErrors()){ + editor.statusMessage("Can't perform action until syntax errors are " + + "fixed :(", DebugEditor.STATUS_WARNING); + return; + } + DefaultMutableTreeNode defCU = findAllOccurrences(); + String selText = lastClickedWord == null ? editor.ta.getSelectedText() + : lastClickedWord; + if(defCU == null){ + editor.statusMessage("Can't locate definition of " + selText, + DebugEditor.STATUS_ERR); + return; + } + if(defCU.getChildCount() == 0) + return; + treeRename.setModel(new DefaultTreeModel(defCU)); + ((DefaultTreeModel) treeRename.getModel()).reload(); + treeRename.setRootVisible(false); + frmOccurenceList.setTitle("Usage of \"" + selText + "\" : " + + defCU.getChildCount() + " time(s)"); + frmOccurenceList.setLocation(editor.getX() + editor.getWidth(),editor.getY()); + frmOccurenceList.setVisible(true); + lastClickedWord = null; + lastClickedWordNode = null; + } + + protected String lastClickedWord = null; + protected ASTNodeWrapper lastClickedWordNode = null; + + public String getLastClickedWord() { + return lastClickedWord; + } + + public void setLastClickedWord(int lineNumber, String lastClickedWord, int offset) { + this.lastClickedWord = lastClickedWord; + lastClickedWordNode = getASTNodeAt(lineNumber, lastClickedWord, offset, false); + log("Last clicked node: " + lastClickedWordNode); + } + + protected DefaultMutableTreeNode findAllOccurrences(){ + log("Last clicked word:" + lastClickedWord); + String selText = lastClickedWord == null ? editor.ta.getSelectedText() + : lastClickedWord; + int line = editor.ta.getSelectionStartLine(); + log(selText + + "<- offsets " + + (line) + + ", " + + (editor.ta.getSelectionStart() - editor.ta + .getLineStartOffset(line)) + + ", " + + (editor.ta.getSelectionStop() - editor.ta + .getLineStartOffset(line))); + int offwhitespace = editor.ta + .getLineStartNonWhiteSpaceOffset(line); + ASTNodeWrapper wnode; + if (lastClickedWord == null || lastClickedWordNode.getNode() == null) { + wnode = getASTNodeAt(line + errorCheckerService.mainClassOffset, selText, + editor.ta.getSelectionStart() - offwhitespace, false); + } + else{ + wnode = lastClickedWordNode; + } + if(wnode.getNode() == null){ + return null; + } + logE("Gonna find all occurrences of " + + getNodeAsString(wnode.getNode())); + + //If wnode is a constructor, find the TD instead. + if (wnode.getNodeType() == ASTNode.METHOD_DECLARATION) { + MethodDeclaration md = (MethodDeclaration) wnode.getNode(); + ASTNode node = md.getParent(); + while (node != null) { + if (node instanceof TypeDeclaration) { + // log("Parent class " + getNodeAsString(node)); + break; + } + node = node.getParent(); + } + if(node != null && node instanceof TypeDeclaration){ + TypeDeclaration td = (TypeDeclaration) node; + if(td.getName().toString().equals(md.getName().toString())){ + logE("Renaming constructor of " + getNodeAsString(td)); + wnode = new ASTNodeWrapper(td); + } + } + } + + DefaultMutableTreeNode defCU = new DefaultMutableTreeNode( + new ASTNodeWrapper( + wnode + .getNode(), + selText)); + dfsNameOnly(defCU, wnode.getNode(), selText); + + // Reverse the list obtained via dfs + Stack tempS = new Stack(); + for (int i = 0; i < defCU.getChildCount(); i++) { + tempS.push(defCU.getChildAt(i)); + } + defCU.removeAllChildren(); + while (!tempS.isEmpty()) { + defCU.add((MutableTreeNode) tempS.pop()); + } + log(wnode); + + return defCU; + } + + @SuppressWarnings({ "unchecked" }) + /** + * Generates AST Swing component + * @param node + * @param tnode + */ + public static void visitRecur(ASTNode node, DefaultMutableTreeNode tnode) { + Iterator it = + node.structuralPropertiesForType().iterator(); + //logE("Props of " + node.getClass().getName()); + DefaultMutableTreeNode ctnode = null; + while (it.hasNext()) { + StructuralPropertyDescriptor prop = it.next(); + + if (prop.isChildProperty() || prop.isSimpleProperty()) { + if (node.getStructuralProperty(prop) != null) { +// System.out +// .println(node.getStructuralProperty(prop) + " -> " + (prop)); + if (node.getStructuralProperty(prop) instanceof ASTNode) { + ASTNode cnode = (ASTNode) node.getStructuralProperty(prop); + if (isAddableASTNode(cnode)) { + ctnode = new DefaultMutableTreeNode( + new ASTNodeWrapper((ASTNode) node + .getStructuralProperty(prop))); + tnode.add(ctnode); + visitRecur(cnode, ctnode); + } + } else { + tnode.add(new DefaultMutableTreeNode(node + .getStructuralProperty(prop))); + } + } + } + + else if (prop.isChildListProperty()) { + List nodelist = (List) node + .getStructuralProperty(prop); + for (ASTNode cnode : nodelist) { + if (isAddableASTNode(cnode)) { + ctnode = new DefaultMutableTreeNode(new ASTNodeWrapper(cnode)); + tnode.add(ctnode); + visitRecur(cnode, ctnode); + } else + visitRecur(cnode, tnode); + } + } + } + } + + public void dfsNameOnly(DefaultMutableTreeNode tnode,ASTNode decl, String name) { + Stack temp = new Stack(); + temp.push(codeTree); + + while(!temp.isEmpty()){ + DefaultMutableTreeNode cnode = (DefaultMutableTreeNode) temp.pop(); + for (int i = 0; i < cnode.getChildCount(); i++) { + temp.push(cnode.getChildAt(i)); + } + + if(!(cnode.getUserObject() instanceof ASTNodeWrapper)) + continue; + ASTNodeWrapper awnode = (ASTNodeWrapper) cnode.getUserObject(); +// log("Visiting: " + getNodeAsString(awnode.getNode())); + if(isInstanceOfType(awnode.getNode(), decl, name)){ + int val[] = errorCheckerService + .JavaToPdeOffsets(awnode.getLineNumber(), 0); + tnode.add(new DefaultMutableTreeNode(new ASTNodeWrapper(awnode + .getNode(), "Line " + (val[1] + 1) + " | Tab: " + + editor.getSketch().getCode(val[0]).getPrettyName()))); + } + + } + } + + public ASTNode dfsLookForASTNode(ASTNode root, String name, int startOffset, + int endOffset) { +// log("dfsLookForASTNode() lookin for " + name + " Offsets: " + startOffset +// + "," + endOffset); + Stack stack = new Stack(); + stack.push(root); + + while (!stack.isEmpty()) { + ASTNode node = stack.pop(); + //log("Popped from stack: " + getNodeAsString(node)); + Iterator it = + node.structuralPropertiesForType().iterator(); + while (it.hasNext()) { + StructuralPropertyDescriptor prop = it.next(); + + if (prop.isChildProperty() || prop.isSimpleProperty()) { + if (node.getStructuralProperty(prop) instanceof ASTNode) { + ASTNode temp = (ASTNode) node.getStructuralProperty(prop); + if (temp.getStartPosition() <= startOffset + && (temp.getStartPosition() + temp.getLength()) >= endOffset) { + if(temp instanceof SimpleName){ + if(name.equals(temp.toString())){ +// log("Found simplename: " + getNodeAsString(temp)); + return temp; + } +// log("Bummer, didn't match"); + } + else + stack.push(temp); + //log("Pushed onto stack: " + getNodeAsString(temp)); + } + } + } + else if (prop.isChildListProperty()) { + List nodelist = (List) node + .getStructuralProperty(prop); + for (ASTNode temp : nodelist) { + if (temp.getStartPosition() <= startOffset + && (temp.getStartPosition() + temp.getLength()) >= endOffset) { + stack.push(temp); +// log("Pushed onto stack: " + getNodeAsString(temp)); + if(temp instanceof SimpleName){ + if(name.equals(temp.toString())){ +// log("Found simplename: " + getNodeAsString(temp)); + return temp; + } +// log("Bummer, didn't match"); + } + else + stack.push(temp); + //log("Pushed onto stack: " + getNodeAsString(temp)); + } + } + } + } + } +// log("dfsLookForASTNode() not found " + name); + return null; + } + + protected SketchOutline sketchOutline; + protected void showSketchOutline(){ + if(editor.hasJavaTabs) return; // sketch outline disabled if java tabs + sketchOutline = new SketchOutline(codeTree, errorCheckerService); + sketchOutline.show(); + } + + protected void showTabOutline(){ + new TabOutline(errorCheckerService).show(); + } + + public int javaCodeOffsetToLineStartOffset(int line, int jOffset){ + // Find the first node with this line number, return its offset - jOffset + line = pdeLineNumToJavaLineNum(line); + log("Looking for line: " + line + ", jOff " + jOffset); + Stack temp = new Stack(); + temp.push(codeTree); + + while (!temp.isEmpty()) { + DefaultMutableTreeNode cnode = (DefaultMutableTreeNode) temp.pop(); + for (int i = 0; i < cnode.getChildCount(); i++) { + temp.push(cnode.getChildAt(i)); + } + + if (!(cnode.getUserObject() instanceof ASTNodeWrapper)) + continue; + ASTNodeWrapper awnode = (ASTNodeWrapper) cnode.getUserObject(); +// log("Visiting: " + getNodeAsString(awnode.getNode())); + if (awnode.getLineNumber() == line) { + log("First element with this line no is: " + awnode + + "LSO: " + (jOffset - awnode.getNode().getStartPosition())); + return (jOffset - awnode.getNode().getStartPosition()); + } + } + return -1; + } + + /** + * Converts pde line number to java line number + * @param pdeLineNum - pde line number + * @return + */ + protected int pdeLineNumToJavaLineNum(int pdeLineNum){ + int javaLineNumber = pdeLineNum + errorCheckerService.getPdeImportsCount(); + // Adjust line number for tabbed sketches + int codeIndex = editor.getSketch().getCodeIndex(editor.getCurrentTab()); + if (codeIndex > 0) + for (int i = 0; i < codeIndex; i++) { + SketchCode sc = editor.getSketch().getCode(i); + int len = Base.countLines(sc.getProgram()) + 1; + javaLineNumber += len; + } + return javaLineNumber; + } + + protected boolean isInstanceOfType(ASTNode node,ASTNode decl, String name){ + if(node instanceof SimpleName){ + SimpleName sn = (SimpleName) node; + + if (sn.toString().equals(name)) { + ArrayList nodesToBeMatched = new ArrayList(); + nodesToBeMatched.add(decl); + if(decl instanceof TypeDeclaration){ + log("decl is a TD"); + TypeDeclaration td = (TypeDeclaration)decl; + MethodDeclaration[] mlist = td.getMethods(); + for (MethodDeclaration md : mlist) { + if(md.getName().toString().equals(name)){ + nodesToBeMatched.add(md); + } + } + } + log("Visiting: " + getNodeAsString(node)); + ASTNode decl2 = findDeclaration(sn); + logE("It's decl: " + getNodeAsString(decl2)); + log("But we need: "+getNodeAsString(decl)); + for (ASTNode astNode : nodesToBeMatched) { + if(astNode.equals(decl2)){ + return true; + } + } + } + } + return false; + } + + public void handleRefactor(){ + if(editor.hasJavaTabs) return; // refactoring disabled if java tabs + log("Last clicked word:" + lastClickedWord); + if(lastClickedWord == null && editor.ta.getSelectedText() == null){ + editor.statusMessage("Highlight the class/function/variable name first", + DebugEditor.STATUS_INFO); + return; + } + + if(errorCheckerService.hasSyntaxErrors()){ + editor + .statusMessage("Can't perform action until syntax errors are fixed :(", + DebugEditor.STATUS_WARNING); + return; + } + + DefaultMutableTreeNode defCU = findAllOccurrences(); + String selText = lastClickedWord == null ? editor.ta.getSelectedText() + : lastClickedWord; + if(defCU == null){ + editor.statusMessage(selText + " isn't defined in this sketch, so it can't" + + " be renamed", DebugEditor.STATUS_ERR); + return; + } + if (!frmRename.isVisible()){ + frmRename.setLocation(editor.getX() + + (editor.getWidth() - frmRename.getWidth()) / 2, + editor.getY() + + (editor.getHeight() - frmRename.getHeight()) + / 2); + frmRename.setVisible(true); + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + String selText = lastClickedWord == null ? editor.ta.getSelectedText() + : lastClickedWord; + frmOccurenceList.setTitle("All occurrences of " + + selText); + lblRefactorOldName.setText("Current name: " + + selText); + txtRenameField.setText(""); + txtRenameField.requestFocus(); + } + }); + } + frmRename.toFront(); + } + + + public static void printRecur(ASTNode node) { + Iterator it = node + .structuralPropertiesForType().iterator(); + //logE("Props of " + node.getClass().getName()); + while (it.hasNext()) { + StructuralPropertyDescriptor prop = it.next(); + + if (prop.isChildProperty() || prop.isSimpleProperty()) { + if (node.getStructuralProperty(prop) != null) { +// System.out +// .println(node.getStructuralProperty(prop) + " -> " + (prop)); + if (node.getStructuralProperty(prop) instanceof ASTNode) { + ASTNode cnode = (ASTNode) node.getStructuralProperty(prop); + log(getNodeAsString(cnode)); + printRecur(cnode); + } + } + } + + else if (prop.isChildListProperty()) { + List nodelist = (List) node + .getStructuralProperty(prop); + for (ASTNode cnode : nodelist) { + log(getNodeAsString(cnode)); + printRecur(cnode); + } + } + } + } + + @SuppressWarnings("unchecked") + protected static ASTNode findLineOfNode(ASTNode node, int lineNumber, + int offset, String name) { + + CompilationUnit root = (CompilationUnit) node.getRoot(); +// log("Inside "+getNodeAsString(node) + " | " + root.getLineNumber(node.getStartPosition())); + if (root.getLineNumber(node.getStartPosition()) == lineNumber) { + // logE(3 + getNodeAsString(node) + " len " + node.getLength()); + return node; +// if (offset < node.getLength()) +// return node; +// else { +// logE(-11); +// return null; +// } + } + for (Object oprop : node.structuralPropertiesForType()) { + StructuralPropertyDescriptor prop = (StructuralPropertyDescriptor) oprop; + if (prop.isChildProperty() || prop.isSimpleProperty()) { + if (node.getStructuralProperty(prop) != null) { + if (node.getStructuralProperty(prop) instanceof ASTNode) { + ASTNode retNode = findLineOfNode((ASTNode) node + .getStructuralProperty(prop), + lineNumber, offset, name); + if (retNode != null) { +// logE(11 + getNodeAsString(retNode)); + return retNode; + } + } + } + } else if (prop.isChildListProperty()) { + List nodelist = (List) node + .getStructuralProperty(prop); + for (ASTNode retNode : nodelist) { + + ASTNode rr = findLineOfNode(retNode, lineNumber, offset, name); + if (rr != null) { +// logE(12 + getNodeAsString(rr)); + return rr; + } + } + } + } +// logE("-1"); + return null; + } + + /** + * + * @param node + * @param offset + * - from textarea painter + * @param lineStartOffset + * - obtained from findLineOfNode + * @param name + * @param root + * @return + */ + @SuppressWarnings("unchecked") + public static ASTNode pinpointOnLine(ASTNode node, int offset, + int lineStartOffset, String name) { + //log("pinpointOnLine node class: " + node.getClass().getSimpleName()); + if (node instanceof SimpleName) { + SimpleName sn = (SimpleName) node; + //log(offset+ "off,pol " + getNodeAsString(sn)); + if ((lineStartOffset + offset) >= sn.getStartPosition() + && (lineStartOffset + offset) <= sn.getStartPosition() + + sn.getLength()) { + if (sn.toString().equals(name)) { + return sn; + } + else { + return null; + } + } else { + return null; + } + } + for (Object oprop : node.structuralPropertiesForType()) { + StructuralPropertyDescriptor prop = (StructuralPropertyDescriptor) oprop; + if (prop.isChildProperty() || prop.isSimpleProperty()) { + if (node.getStructuralProperty(prop) != null) { + if (node.getStructuralProperty(prop) instanceof ASTNode) { + ASTNode retNode = pinpointOnLine((ASTNode) node + .getStructuralProperty(prop), + offset, lineStartOffset, name); + if (retNode != null) { +// logE(11 + getNodeAsString(retNode)); + return retNode; + } + } + } + } else if (prop.isChildListProperty()) { + List nodelist = (List) node + .getStructuralProperty(prop); + for (ASTNode retNode : nodelist) { + + ASTNode rr = pinpointOnLine(retNode, offset, lineStartOffset, name); + if (rr != null) { +// logE(12 + getNodeAsString(rr)); + return rr; + } + } + } + } +// logE("-1"); + return null; + } + + /** + * Give this thing a {@link Name} instance - a {@link SimpleName} from the + * ASTNode for ex, and it tries its level best to locate its declaration in + * the AST. It really does. + * + * @param findMe + * @return + */ + @SuppressWarnings("unchecked") + protected static ASTNode findDeclaration(Name findMe) { + + // WARNING: You're entering the Rube Goldberg territory of Experimental Mode. + // To debug this code, thou must take the Recursive Leap of Faith. + + // log("entering --findDeclaration1 -- " + findMe.toString()); + ASTNode declaringClass = null; + ASTNode parent = findMe.getParent(); + ASTNode ret = null; + ArrayList constrains = new ArrayList(); + if (parent.getNodeType() == ASTNode.METHOD_INVOCATION) { + Expression exp = (Expression) ((MethodInvocation) parent) + .getStructuralProperty(MethodInvocation.EXPRESSION_PROPERTY); + //TODO: Note the imbalance of constrains.add(ASTNode.METHOD_DECLARATION); + // Possibly a bug here. Investigate later. + if (((MethodInvocation) parent).getName().toString() + .equals(findMe.toString())) { + constrains.add(ASTNode.METHOD_DECLARATION); + + if (exp != null) { + constrains.add(ASTNode.TYPE_DECLARATION); +// log("MI EXP: " + exp.toString() + " of type " +// + exp.getClass().getName() + " parent: " + exp.getParent()); + if (exp instanceof MethodInvocation) { + SimpleType stp = extracTypeInfo(findDeclaration(((MethodInvocation) exp) + .getName())); + if (stp == null) + return null; + declaringClass = findDeclaration(stp.getName()); + return definedIn(declaringClass, ((MethodInvocation) parent) + .getName().toString(), constrains, declaringClass); + } else if (exp instanceof FieldAccess) { + SimpleType stp = extracTypeInfo(findDeclaration(((FieldAccess) exp) + .getName())); + if (stp == null) + return null; + declaringClass = findDeclaration((stp.getName())); + return definedIn(declaringClass, ((MethodInvocation) parent) + .getName().toString(), constrains, declaringClass); + } + if (exp instanceof SimpleName) { + SimpleType stp = extracTypeInfo(findDeclaration(((SimpleName) exp))); + if (stp == null) + return null; + declaringClass = findDeclaration(stp.getName()); +// log("MI.SN " + getNodeAsString(declaringClass)); + constrains.add(ASTNode.METHOD_DECLARATION); + return definedIn(declaringClass, ((MethodInvocation) parent) + .getName().toString(), constrains, declaringClass); + } + + } + } else { + parent = parent.getParent(); // Move one up the ast. V V IMP!! + } + } else if (parent.getNodeType() == ASTNode.FIELD_ACCESS) { + FieldAccess fa = (FieldAccess) parent; + Expression exp = fa.getExpression(); + if (fa.getName().toString().equals(findMe.toString())) { + constrains.add(ASTNode.FIELD_DECLARATION); + + if (exp != null) { + constrains.add(ASTNode.TYPE_DECLARATION); +// log("FA EXP: " + exp.toString() + " of type " +// + exp.getClass().getName() + " parent: " + exp.getParent()); + if (exp instanceof MethodInvocation) { + SimpleType stp = extracTypeInfo(findDeclaration(((MethodInvocation) exp) + .getName())); + if (stp == null) + return null; + declaringClass = findDeclaration(stp.getName()); + return definedIn(declaringClass, fa.getName().toString(), + constrains, declaringClass); + } else if (exp instanceof FieldAccess) { + SimpleType stp = extracTypeInfo(findDeclaration(((FieldAccess) exp) + .getName())); + if (stp == null) + return null; + declaringClass = findDeclaration((stp.getName())); + constrains.add(ASTNode.TYPE_DECLARATION); + return definedIn(declaringClass, fa.getName().toString(), + constrains, declaringClass); + } + if (exp instanceof SimpleName) { + SimpleType stp = extracTypeInfo(findDeclaration(((SimpleName) exp))); + if (stp == null) + return null; + declaringClass = findDeclaration(stp.getName()); +// log("FA.SN " + getNodeAsString(declaringClass)); + constrains.add(ASTNode.METHOD_DECLARATION); + return definedIn(declaringClass, fa.getName().toString(), + constrains, declaringClass); + } + } + + } else { + parent = parent.getParent(); // Move one up the ast. V V IMP!! + } + } else if (parent.getNodeType() == ASTNode.QUALIFIED_NAME) { + + QualifiedName qn = (QualifiedName) parent; + if (!findMe.toString().equals(qn.getQualifier().toString())) { + + SimpleType stp = extracTypeInfo(findDeclaration((qn.getQualifier()))); +// log(qn.getQualifier() + "->" + qn.getName()); + declaringClass = findDeclaration(stp.getName()); + +// log("QN decl class: " + getNodeAsString(declaringClass)); + constrains.clear(); + constrains.add(ASTNode.TYPE_DECLARATION); + constrains.add(ASTNode.FIELD_DECLARATION); + return definedIn(declaringClass, qn.getName().toString(), constrains, + null); + } + else{ + if(findMe instanceof QualifiedName){ + QualifiedName qnn = (QualifiedName) findMe; +// log("findMe is a QN, " +// + (qnn.getQualifier().toString() + " other " + qnn.getName() +// .toString())); + + SimpleType stp = extracTypeInfo(findDeclaration((qnn.getQualifier()))); +// log(qnn.getQualifier() + "->" + qnn.getName()); + declaringClass = findDeclaration(stp.getName()); + +// log("QN decl class: " +// + getNodeAsString(declaringClass)); + constrains.clear(); + constrains.add(ASTNode.TYPE_DECLARATION); + constrains.add(ASTNode.FIELD_DECLARATION); + return definedIn(declaringClass, qnn.getName().toString(), constrains, + null); + } + } + } else if (parent.getNodeType() == ASTNode.SIMPLE_TYPE) { + constrains.add(ASTNode.TYPE_DECLARATION); + if (parent.getParent().getNodeType() == ASTNode.CLASS_INSTANCE_CREATION) + constrains.add(ASTNode.CLASS_INSTANCE_CREATION); + } else if(parent.getNodeType() == ASTNode.TYPE_DECLARATION){ + // The condition where we look up the name of a class decl + TypeDeclaration td = (TypeDeclaration) parent; + if(findMe.equals(td.getName())) + { + return parent; + } + } + else if (parent instanceof Expression) { +// constrains.add(ASTNode.TYPE_DECLARATION); +// constrains.add(ASTNode.METHOD_DECLARATION); +// constrains.add(ASTNode.FIELD_DECLARATION); + } +// else if(findMe instanceof QualifiedName){ +// QualifiedName qn = (QualifiedName) findMe; +// System.out +// .println("findMe is a QN, " +// + (qn.getQualifier().toString() + " other " + qn.getName() +// .toString())); +// } + while (parent != null) { +// log("findDeclaration1 -> " + getNodeAsString(parent)); + for (Object oprop : parent.structuralPropertiesForType()) { + StructuralPropertyDescriptor prop = (StructuralPropertyDescriptor) oprop; + if (prop.isChildProperty() || prop.isSimpleProperty()) { + if (parent.getStructuralProperty(prop) instanceof ASTNode) { +// log(prop + " C/S Prop of -> " +// + getNodeAsString(parent)); + ret = definedIn((ASTNode) parent.getStructuralProperty(prop), + findMe.toString(), constrains, declaringClass); + if (ret != null) + return ret; + } + } else if (prop.isChildListProperty()) { +// log((prop) + " ChildList props of " +// + getNodeAsString(parent)); + List nodelist = (List) parent + .getStructuralProperty(prop); + for (ASTNode retNode : nodelist) { + ret = definedIn(retNode, findMe.toString(), constrains, + declaringClass); + if (ret != null) + return ret; + } + } + } + parent = parent.getParent(); + } + return null; + } + + /** + * A variation of findDeclaration() but accepts an alternate parent ASTNode + * @param findMe + * @param alternateParent + * @return + */ + protected static ASTNode findDeclaration2(Name findMe, ASTNode alternateParent) { + ASTNode declaringClass = null; + ASTNode parent = findMe.getParent(); + ASTNode ret = null; + ArrayList constrains = new ArrayList(); + if (parent.getNodeType() == ASTNode.METHOD_INVOCATION) { + Expression exp = (Expression) ((MethodInvocation) parent) + .getStructuralProperty(MethodInvocation.EXPRESSION_PROPERTY); + //TODO: Note the imbalance of constrains.add(ASTNode.METHOD_DECLARATION); + // Possibly a bug here. Investigate later. + if (((MethodInvocation) parent).getName().toString() + .equals(findMe.toString())) { + constrains.add(ASTNode.METHOD_DECLARATION); + + if (exp != null) { + constrains.add(ASTNode.TYPE_DECLARATION); +// log("MI EXP: " + exp.toString() + " of type " +// + exp.getClass().getName() + " parent: " + exp.getParent()); + if (exp instanceof MethodInvocation) { + SimpleType stp = extracTypeInfo(findDeclaration2(((MethodInvocation) exp) + .getName(), + alternateParent)); + if (stp == null) + return null; + declaringClass = findDeclaration2(stp.getName(), alternateParent); + return definedIn(declaringClass, ((MethodInvocation) parent) + .getName().toString(), constrains, declaringClass); + } else if (exp instanceof FieldAccess) { + SimpleType stp = extracTypeInfo(findDeclaration2(((FieldAccess) exp) + .getName(), + alternateParent)); + if (stp == null) + return null; + declaringClass = findDeclaration2((stp.getName()), alternateParent); + return definedIn(declaringClass, ((MethodInvocation) parent) + .getName().toString(), constrains, declaringClass); + } + if (exp instanceof SimpleName) { + SimpleType stp = extracTypeInfo(findDeclaration2(((SimpleName) exp), + alternateParent)); + if (stp == null) + return null; + declaringClass = findDeclaration2(stp.getName(), alternateParent); +// log("MI.SN " + getNodeAsString(declaringClass)); + constrains.add(ASTNode.METHOD_DECLARATION); + return definedIn(declaringClass, ((MethodInvocation) parent) + .getName().toString(), constrains, declaringClass); + } + + } + } else { + parent = parent.getParent(); // Move one up the ast. V V IMP!! + alternateParent = alternateParent.getParent(); + } + } else if (parent.getNodeType() == ASTNode.FIELD_ACCESS) { + FieldAccess fa = (FieldAccess) parent; + Expression exp = fa.getExpression(); + if (fa.getName().toString().equals(findMe.toString())) { + constrains.add(ASTNode.FIELD_DECLARATION); + + if (exp != null) { + constrains.add(ASTNode.TYPE_DECLARATION); +// log("FA EXP: " + exp.toString() + " of type " +// + exp.getClass().getName() + " parent: " + exp.getParent()); + if (exp instanceof MethodInvocation) { + SimpleType stp = extracTypeInfo(findDeclaration2(((MethodInvocation) exp) + .getName(), + alternateParent)); + if (stp == null) + return null; + declaringClass = findDeclaration2(stp.getName(), alternateParent); + return definedIn(declaringClass, fa.getName().toString(), + constrains, declaringClass); + } else if (exp instanceof FieldAccess) { + SimpleType stp = extracTypeInfo(findDeclaration2(((FieldAccess) exp) + .getName(), + alternateParent)); + if (stp == null) + return null; + declaringClass = findDeclaration2((stp.getName()), alternateParent); + constrains.add(ASTNode.TYPE_DECLARATION); + return definedIn(declaringClass, fa.getName().toString(), + constrains, declaringClass); + } + if (exp instanceof SimpleName) { + SimpleType stp = extracTypeInfo(findDeclaration2(((SimpleName) exp), + alternateParent)); + if (stp == null) + return null; + declaringClass = findDeclaration2(stp.getName(), alternateParent); +// log("FA.SN " + getNodeAsString(declaringClass)); + constrains.add(ASTNode.METHOD_DECLARATION); + return definedIn(declaringClass, fa.getName().toString(), + constrains, declaringClass); + } + } + + } else { + parent = parent.getParent(); // Move one up the ast. V V IMP!! + alternateParent = alternateParent.getParent(); + } + } else if (parent.getNodeType() == ASTNode.QUALIFIED_NAME) { + + QualifiedName qn = (QualifiedName) parent; + if (!findMe.toString().equals(qn.getQualifier().toString())) { + + SimpleType stp = extracTypeInfo(findDeclaration2((qn.getQualifier()), + alternateParent)); + if(stp == null) + return null; + declaringClass = findDeclaration2(stp.getName(), alternateParent); +// log(qn.getQualifier() + "->" + qn.getName()); +// log("QN decl class: " + getNodeAsString(declaringClass)); + constrains.clear(); + constrains.add(ASTNode.TYPE_DECLARATION); + constrains.add(ASTNode.FIELD_DECLARATION); + return definedIn(declaringClass, qn.getName().toString(), constrains, + null); + } + else{ + if(findMe instanceof QualifiedName){ + QualifiedName qnn = (QualifiedName) findMe; +// log("findMe is a QN, " +// + (qnn.getQualifier().toString() + " other " + qnn.getName() +// .toString())); + + SimpleType stp = extracTypeInfo(findDeclaration2((qnn.getQualifier()), alternateParent)); +// log(qnn.getQualifier() + "->" + qnn.getName()); + declaringClass = findDeclaration2(stp.getName(), alternateParent); + +// log("QN decl class: " +// + getNodeAsString(declaringClass)); + constrains.clear(); + constrains.add(ASTNode.TYPE_DECLARATION); + constrains.add(ASTNode.FIELD_DECLARATION); + return definedIn(declaringClass, qnn.getName().toString(), constrains, + null); + } + } + } else if (parent.getNodeType() == ASTNode.SIMPLE_TYPE) { + constrains.add(ASTNode.TYPE_DECLARATION); + if (parent.getParent().getNodeType() == ASTNode.CLASS_INSTANCE_CREATION) + constrains.add(ASTNode.CLASS_INSTANCE_CREATION); + } else if (parent instanceof Expression) { +// constrains.add(ASTNode.TYPE_DECLARATION); +// constrains.add(ASTNode.METHOD_DECLARATION); +// constrains.add(ASTNode.FIELD_DECLARATION); + } // TODO: in findDec, we also have a case where parent of type TD is handled. + // Figure out if needed here as well. +// log("Alternate parent: " + getNodeAsString(alternateParent)); + while (alternateParent != null) { +// log("findDeclaration2 -> " +// + getNodeAsString(alternateParent)); + for (Object oprop : alternateParent.structuralPropertiesForType()) { + StructuralPropertyDescriptor prop = (StructuralPropertyDescriptor) oprop; + if (prop.isChildProperty() || prop.isSimpleProperty()) { + if (alternateParent.getStructuralProperty(prop) instanceof ASTNode) { +// log(prop + " C/S Prop of -> " +// + getNodeAsString(alternateParent)); + ret = definedIn((ASTNode) alternateParent + .getStructuralProperty(prop), + findMe.toString(), constrains, declaringClass); + if (ret != null) + return ret; + } + } else if (prop.isChildListProperty()) { +// log((prop) + " ChildList props of " +// + getNodeAsString(alternateParent)); + List nodelist = (List) alternateParent + .getStructuralProperty(prop); + for (ASTNode retNode : nodelist) { + ret = definedIn(retNode, findMe.toString(), constrains, + declaringClass); + if (ret != null) + return ret; + } + } + } + alternateParent = alternateParent.getParent(); + } + return null; + } + + + protected List getCodeComments(){ + List commentList = compilationUnit.getCommentList(); +// log("Total comments: " + commentList.size()); +// int i = 0; +// for (Comment comment : commentList) { +// log(++i + ": "+comment + " Line:" +// + compilationUnit.getLineNumber(comment.getStartPosition()) + ", " +// + comment.getLength()); +// } + return commentList; + } + + protected boolean caretWithinLineComment(){ + String pdeLine = editor.getLineText(editor.textArea().getCaretLine()).trim(); + int caretPos = editor.textArea().getCaretPosition() + - editor.textArea() + .getLineStartNonWhiteSpaceOffset(editor.textArea().getCaretLine()); + int x = pdeLine.indexOf("//"); +// log(x + " , " + caretPos + ", Checking line for comment " + pdeLine); + //lineStartOffset = editor.textArea(). + + if (x >= 0 && caretPos > x) { +// log("INSIDE a comment"); + return true; + } +// log("not within comment"); + return false; + } + + /** + * A wrapper for java.lang.reflect types. + * Will have to see if the usage turns out to be internal only here or not + * and then accordingly decide where to place this class. + * @author quarkninja + * + */ + public class ClassMember { + private Field field; + + private Method method; + + private Constructor cons; + + private Class thisclass; + + private String stringVal; + + private String classType; + + private ASTNode astNode; + + private ASTNode declaringNode; + + public ClassMember(Class m) { + thisclass = m; + stringVal = "Predefined Class " + m.getName(); + classType = m.getName(); + } + + public ClassMember(Method m) { + method = m; + stringVal = "Method " + m.getReturnType().getName() + " | " + m.getName() + + " defined in " + m.getDeclaringClass().getName(); + classType = m.getReturnType().getName(); + } + + public ClassMember(Field m) { + field = m; + stringVal = "Field " + m.getType().getName() + " | " + m.getName() + + " defined in " + m.getDeclaringClass().getName(); + classType = m.getType().getName(); + } + + public ClassMember(Constructor m) { + cons = m; + stringVal = "Cons " + " " + m.getName() + " defined in " + + m.getDeclaringClass().getName(); + } + + public ClassMember(ASTNode node){ + astNode = node; + stringVal = getNodeAsString(node); + if(node instanceof TypeDeclaration){ + declaringNode = node; + } + if(node instanceof SimpleType){ + classType = ((SimpleType)node).getName().toString(); + } + SimpleType stp = (node instanceof SimpleType) ? (SimpleType) node + : extracTypeInfo(node); + if(stp != null){ + ASTNode decl =findDeclaration(stp.getName()); + // Czech out teh mutation + if(decl == null){ + // a predefined type + classType = stp.getName().toString(); + Class probableClass = findClassIfExists(classType); + thisclass = probableClass; + } + else{ + // a local type + declaringNode = decl; + } + } + } + + public Class getClass_() { + return thisclass; + } + + public ASTNode getDeclaringNode(){ + return declaringNode; + } + + public Field getField() { + return field; + } + + public Method getMethod() { + return method; + } + + public Constructor getCons() { + return cons; + } + + public ASTNode getASTNode(){ + return astNode; + } + + public String toString() { + return stringVal; + } + + public String getTypeAsString(){ + return classType; + } + } + + + /** + * Find the SimpleType from FD, SVD, VDS, etc + * + * @param node + * @return + */ + public static SimpleType extracTypeInfo(ASTNode node) { + if (node == null) { + return null; + } + Type t = extracTypeInfo2(node); + if (t instanceof PrimitiveType) { + return null; + } else if (t instanceof ArrayType) { + ArrayType at = (ArrayType) t; + log(at.getComponentType() + " <-comp type, ele type-> " + + at.getElementType() + ", " + + at.getElementType().getClass().getName()); + if (at.getElementType() instanceof PrimitiveType) { + return null; + } else if (at.getElementType() instanceof SimpleType) { + return (SimpleType) at.getElementType(); + } else + return null; + } else if (t instanceof ParameterizedType) { + ParameterizedType pmt = (ParameterizedType) t; + log(pmt.getType() + ", " + pmt.getType().getClass()); + if (pmt.getType() instanceof SimpleType) { + return (SimpleType) pmt.getType(); + } else + return null; + } + return (SimpleType) t; + } + + public static Type extracTypeInfo2(ASTNode node) { + if (node == null) + return null; + switch (node.getNodeType()) { + case ASTNode.METHOD_DECLARATION: + return ((MethodDeclaration) node).getReturnType2(); + case ASTNode.FIELD_DECLARATION: + return ((FieldDeclaration) node).getType(); + case ASTNode.VARIABLE_DECLARATION_EXPRESSION: + return ((VariableDeclarationExpression) node).getType(); + case ASTNode.VARIABLE_DECLARATION_STATEMENT: + return ((VariableDeclarationStatement) node).getType(); + case ASTNode.SINGLE_VARIABLE_DECLARATION: + return ((SingleVariableDeclaration) node).getType(); + case ASTNode.VARIABLE_DECLARATION_FRAGMENT: + return extracTypeInfo2(node.getParent()); + } + log("Unknown type info request " + getNodeAsString(node)); + return null; + } + + @SuppressWarnings("unchecked") + protected static ASTNode definedIn(ASTNode node, String name, + ArrayList constrains, + ASTNode declaringClass) { + if (node == null) + return null; + if (constrains != null) { +// log("Looking at " + getNodeAsString(node) + " for " + name +// + " in definedIn"); + if (!constrains.contains(node.getNodeType()) && constrains.size() > 0) { +// System.err.print("definedIn -1 " + " But constrain was "); +// for (Integer integer : constrains) { +// System.out.print(ASTNode.nodeClassForType(integer) + ","); +// } +// log(); + return null; + } + } + + List vdfList = null; + switch (node.getNodeType()) { + + case ASTNode.TYPE_DECLARATION: + //logE(getNodeAsString(node)); + TypeDeclaration td = (TypeDeclaration) node; + if (td.getName().toString().equals(name)) { + if (constrains.contains(ASTNode.CLASS_INSTANCE_CREATION)) { + // look for constructor; + MethodDeclaration[] methods = td.getMethods(); + for (MethodDeclaration md : methods) { + if (md.getName().toString().equalsIgnoreCase(name)) { + log("Found a constructor."); + return md; + } + } + } else { + // it's just the TD we're lookin for + return node; + } + } else { + if (constrains.contains(ASTNode.FIELD_DECLARATION)) { + // look for fields + FieldDeclaration[] fields = td.getFields(); + for (FieldDeclaration fd : fields) { + List fragments = fd.fragments(); + for (VariableDeclarationFragment vdf : fragments) { + if (vdf.getName().toString().equalsIgnoreCase(name)) + return fd; + } + } + } else if (constrains.contains(ASTNode.METHOD_DECLARATION)) { + // look for methods + MethodDeclaration[] methods = td.getMethods(); + for (MethodDeclaration md : methods) { + if (md.getName().toString().equalsIgnoreCase(name)) { + return md; + } + } + } + } + break; + case ASTNode.METHOD_DECLARATION: + //logE(getNodeAsString(node)); + if (((MethodDeclaration) node).getName().toString().equalsIgnoreCase(name)) + return node; + break; + case ASTNode.SINGLE_VARIABLE_DECLARATION: + //logE(getNodeAsString(node)); + if (((SingleVariableDeclaration) node).getName().toString().equalsIgnoreCase(name)) + return node; + break; + case ASTNode.FIELD_DECLARATION: + //logE("FD" + node); + vdfList = ((FieldDeclaration) node).fragments(); + break; + case ASTNode.VARIABLE_DECLARATION_EXPRESSION: + //logE("VDE" + node); + vdfList = ((VariableDeclarationExpression) node).fragments(); + break; + case ASTNode.VARIABLE_DECLARATION_STATEMENT: + //logE("VDS" + node); + vdfList = ((VariableDeclarationStatement) node).fragments(); + break; + + default: + + } + if (vdfList != null) { + for (VariableDeclarationFragment vdf : vdfList) { + if (vdf.getName().toString().equalsIgnoreCase(name)) + return node; + } + } + return null; + } + protected JFrame frmImportSuggest; + public void suggestImports(final String className){ + if(frmImportSuggest != null) + if(frmImportSuggest.isVisible()) + return; + log("Looking for class " + className); + RegExpResourceFilter regf = new RegExpResourceFilter( + Pattern.compile(".*"), + Pattern + .compile(className + + ".class", + Pattern.CASE_INSENSITIVE)); + String[] resources = classPath + .findResources("", regf); + ArrayList candidates = new ArrayList(); + for (String res : resources) { + candidates.add(res); + } + + // log("Couldn't find import for class " + className); + + for (Library lib : editor.dmode.contribLibraries) { + ClassPath cp = factory.createFromPath(lib.getClassPath()); + resources = cp.findResources("", regf); + for (String res : resources) { + candidates.add(res); + log("Res: " + res); + } + } + + if (editor.getSketch().hasCodeFolder()) { + File codeFolder = editor.getSketch().getCodeFolder(); + // get a list of .jar files in the "code" folder + // (class files in subfolders should also be picked up) + ClassPath cp = factory.createFromPath(Base + .contentsToClassPath(codeFolder)); + resources = cp.findResources("", regf); + for (String res : resources) { + candidates.add(res); + log("Res: " + res); + } + } + + resources = new String[candidates.size()]; + for (int i = 0; i < resources.length; i++) { + resources[i] = candidates.get(i).replace('/', '.') + .substring(0, candidates.get(i).length() - 6); + } + if (resources.length >= 1) { + final JList classList = new JList(resources); + classList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + frmImportSuggest = new JFrame(); + frmImportSuggest.setSize(350, 200); + Toolkit.setIcon(frmImportSuggest); + frmImportSuggest.setLayout(new BoxLayout(frmImportSuggest + .getContentPane(), BoxLayout.Y_AXIS)); + ((JComponent) frmImportSuggest.getContentPane()).setBorder(BorderFactory + .createEmptyBorder(5, 5, 5, 5)); + JLabel lbl = new JLabel("The class \"" + className + + "\" couldn't be determined. You are probably missing one of the following imports:"); + JScrollPane jsp = new JScrollPane(); + jsp.setViewportView(classList); + JButton btnInsertImport = new JButton("Insert import"); + btnInsertImport.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent evt) { + if (classList.getSelectedValue() != null) { + try { + String impString = "import " + classList.getSelectedValue() + + ";\n"; + int ct = editor.getSketch().getCurrentCodeIndex(); + editor.getSketch().setCurrentCode(0); + editor.textArea().getDocument().insertString(0, impString, null); + editor.getSketch().setCurrentCode(ct); + errorCheckerService.runManualErrorCheck(); + frmImportSuggest.setVisible(false); + frmImportSuggest = null; + } catch (BadLocationException e) { + log("Failed to insert import for " + className); + e.printStackTrace(); + } + } + } + }); + + JButton btnCancel = new JButton("Cancel"); + btnCancel.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + frmImportSuggest.setVisible(false); + } + }); + + JPanel panelTop = new JPanel(), panelBottom = new JPanel(), panelLabel = new JPanel(); + panelTop.setLayout(new BoxLayout(panelTop, BoxLayout.Y_AXIS)); + panelTop.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); + panelLabel.setLayout(new BorderLayout()); + panelLabel.add(lbl,BorderLayout.CENTER); + panelTop.add(panelLabel); + panelTop.add(Box.createRigidArea(new Dimension(1, 5))); + panelTop.add(jsp); + panelBottom.setLayout(new BoxLayout(panelBottom, BoxLayout.X_AXIS)); + panelBottom.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); + panelBottom .setLayout(new BoxLayout(panelBottom, BoxLayout.X_AXIS)); + panelBottom.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); + panelBottom.add(Box.createHorizontalGlue()); + panelBottom.add(btnInsertImport); + panelBottom.add(Box.createRigidArea(new Dimension(15, 0))); + panelBottom.add(btnCancel); + +// frmImportSuggest.add(lbl); +// frmImportSuggest.add(jsp); +// frmImportSuggest.add(btnInsertImport); + frmImportSuggest.add(panelTop); + frmImportSuggest.add(panelBottom); + frmImportSuggest.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); + frmImportSuggest.setTitle("Import Suggestion"); + frmImportSuggest.setLocation(editor.getX() + + (editor.getWidth() - frmImportSuggest.getWidth()) / 2, + editor.getY() + + (editor.getHeight() - frmImportSuggest.getHeight()) + / 2); + editor.ta.hideSuggestion(); + frmImportSuggest.setVisible(true); + } + + } + + public void disposeAllWindows() { + disposeWindow(frmASTView, frameAutoComp, frmImportSuggest, + frmOccurenceList, frmRename); + } + + public static void disposeWindow(JFrame... f) { + for (JFrame jFrame : f) { + if(jFrame != null) + jFrame.dispose(); + } + } + + public static final String ignoredImports[] = { + "com.oracle.", "sun.", "sunw.", "com.sun.", "javax.", "sunw.", "org.ietf.", + "org.jcp.", "org.omg.", "org.w3c.", "org.xml.", "org.eclipse.", "com.ibm.", + "org.netbeans.", "org.jsoup.", "org.junit.", "org.apache.", "antlr." }; + public static final String allowedImports[] = {"java.lang.", "java.util.", "java.io.", + "java.math.", "processing.core.", "processing.data.", "processing.event.", "processing.opengl."}; + protected boolean ignorableImport(String impName, String className) { + //TODO: Trie man. + for (ImportStatement impS : errorCheckerService.getProgramImports()) { + if(impName.startsWith(impS.getPackageName())) + return false; + } + for (String impS : allowedImports) { + if(impName.startsWith(impS) && className.indexOf('.') == -1) + return false; + } + return true; + } + + public static boolean isAddableASTNode(ASTNode node) { + switch (node.getNodeType()) { +// case ASTNode.STRING_LITERAL: +// case ASTNode.NUMBER_LITERAL: +// case ASTNode.BOOLEAN_LITERAL: +// case ASTNode.NULL_LITERAL: +// return false; + default: + return true; + } + } + + /** + * For any line or expression, finds the line start offset(java code). + * @param node + * @return + */ + public int getASTNodeLineStartOffset(ASTNode node){ + int nodeLineNo = getLineNumber(node); + while(node.getParent() != null){ + if (getLineNumber(node.getParent()) == nodeLineNo) { + node = node.getParent(); + } else { + break; + } + } + return node.getStartPosition(); + } + + /** + * For any node, finds various offsets (java code). + * + * @param node + * @return int[]{line number, line number start offset, node start offset, + * node length} + */ + public int[] getASTNodeAllOffsets(ASTNode node){ + int nodeLineNo = getLineNumber(node), nodeOffset = node.getStartPosition(), nodeLength = node + .getLength(); + while(node.getParent() != null){ + if (getLineNumber(node.getParent()) == nodeLineNo) { + node = node.getParent(); + } else { + break; + } + } + return new int[]{nodeLineNo, node.getStartPosition(), nodeOffset,nodeLength}; + } + + + + static protected String getNodeAsString(ASTNode node) { + if (node == null) + return "NULL"; + String className = node.getClass().getName(); + int index = className.lastIndexOf("."); + if (index > 0) + className = className.substring(index + 1); + + // if(node instanceof BodyDeclaration) + // return className; + + String value = className; + + if (node instanceof TypeDeclaration) + value = ((TypeDeclaration) node).getName().toString() + " | " + className; + else if (node instanceof MethodDeclaration) + value = ((MethodDeclaration) node).getName().toString() + " | " + + className; + else if (node instanceof MethodInvocation) + value = ((MethodInvocation) node).getName().toString() + " | " + + className; + else if (node instanceof FieldDeclaration) + value = ((FieldDeclaration) node).toString() + " FldDecl| "; + else if (node instanceof SingleVariableDeclaration) + value = ((SingleVariableDeclaration) node).getName() + " - " + + ((SingleVariableDeclaration) node).getType() + " | SVD "; + else if (node instanceof ExpressionStatement) + value = node.toString() + className; + else if (node instanceof SimpleName) + value = ((SimpleName) node).getFullyQualifiedName() + " | " + className; + else if (node instanceof QualifiedName) + value = node.toString() + " | " + className; + else if(node instanceof FieldAccess) + value = node.toString() + " | "; + else if (className.startsWith("Variable")) + value = node.toString() + " | " + className; + else if (className.endsWith("Type")) + value = node.toString() + " |" + className; + value += " [" + node.getStartPosition() + "," + + (node.getStartPosition() + node.getLength()) + "]"; + value += " Line: " + + ((CompilationUnit) node.getRoot()).getLineNumber(node + .getStartPosition()); + return value; + } + + /** + * CompletionPanel name + * + * @param node + * @return + */ + static protected String getNodeAsString2(ASTNode node) { + if (node == null) + return "NULL"; + String className = node.getClass().getName(); + int index = className.lastIndexOf("."); + if (index > 0) + className = className.substring(index + 1); + + // if(node instanceof BodyDeclaration) + // return className; + + String value = className; + + if (node instanceof TypeDeclaration) + value = ((TypeDeclaration) node).getName().toString(); + else if (node instanceof MethodDeclaration) + value = ((MethodDeclaration) node).getName().toString(); + else if (node instanceof MethodInvocation) + value = ((MethodInvocation) node).getName().toString() + " | " + + className; + else if (node instanceof FieldDeclaration) + value = ((FieldDeclaration) node).toString(); + else if (node instanceof SingleVariableDeclaration) + value = ((SingleVariableDeclaration) node).getName().toString(); + else if (node instanceof ExpressionStatement) + value = node.toString() + className; + else if (node instanceof SimpleName) + value = ((SimpleName) node).getFullyQualifiedName() + " | " + className; + else if (node instanceof QualifiedName) + value = node.toString(); + else if (node instanceof VariableDeclarationFragment) + value = ((VariableDeclarationFragment) node).getName().toString(); + else if (className.startsWith("Variable")) + value = node.toString(); + else if (node instanceof VariableDeclarationStatement) + value = ((VariableDeclarationStatement) node).toString(); + else if (className.endsWith("Type")) + value = node.toString(); +// value += " [" + node.getStartPosition() + "," +// + (node.getStartPosition() + node.getLength()) + "]"; +// value += " Line: " +// + ((CompilationUnit) node.getRoot()).getLineNumber(node +// .getStartPosition()); + return value; + } + + public void jdocWindowVisible(boolean visible) { + // frmJavaDoc.setVisible(visible); + } + + public static String readFile(String path) { + BufferedReader reader = null; + try { + reader = new BufferedReader( + new InputStreamReader( + new FileInputStream( + new File( + path)))); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + try { + StringBuilder ret = new StringBuilder(); + // ret.append("package " + className + ";\n"); + String line; + while ((line = reader.readLine()) != null) { + ret.append(line); + ret.append("\n"); + } + return ret.toString(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + reader.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + return null; + } + +} diff --git a/pdex/src/processing/mode/experimental/ASTNodeWrapper.java b/pdex/src/processing/mode/experimental/ASTNodeWrapper.java new file mode 100644 index 000000000..e3d26c271 --- /dev/null +++ b/pdex/src/processing/mode/experimental/ASTNodeWrapper.java @@ -0,0 +1,824 @@ +/* + * Copyright (C) 2012-14 Manindra Moharana + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package processing.mode.experimental; +import static processing.mode.experimental.ExperimentalMode.log; +import static processing.mode.experimental.ExperimentalMode.logE; +import static processing.mode.experimental.ExperimentalMode.log2; +import java.util.Iterator; +import java.util.List; +import java.util.TreeMap; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.swing.text.BadLocationException; +import javax.swing.text.Element; +import javax.swing.text.PlainDocument; + +import org.eclipse.jdt.core.dom.ASTNode; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jdt.core.dom.ExpressionStatement; +import org.eclipse.jdt.core.dom.FieldDeclaration; +import org.eclipse.jdt.core.dom.Javadoc; +import org.eclipse.jdt.core.dom.MethodDeclaration; +import org.eclipse.jdt.core.dom.MethodInvocation; +import org.eclipse.jdt.core.dom.QualifiedName; +import org.eclipse.jdt.core.dom.SimpleName; +import org.eclipse.jdt.core.dom.SingleVariableDeclaration; +import org.eclipse.jdt.core.dom.StructuralPropertyDescriptor; +import org.eclipse.jdt.core.dom.Type; +import org.eclipse.jdt.core.dom.TypeDeclaration; + +/** + * Wrapper class for ASTNode objects + * @author Manindra Moharana + * + */ +public class ASTNodeWrapper { + private ASTNode Node; + + private String label; + + private int lineNumber; + + //private int apiLevel; + + /* + * TODO: Every ASTNode object in ASTGenerator.codetree is stored as a + * ASTNodeWrapper instance. So how resource heavy would it be to store a + * pointer to ECS in every instance of ASTNodeWrapper? Currently I will rather + * pass an ECS pointer in the argument when I need to access a method which + * requires a method defined in ECS, i.e, only on demand. + * Bad design choice for ECS methods? IDK, yet. + */ + + public ASTNodeWrapper(ASTNode node) { + if (node == null){ + return; + } + this.Node = node; + label = getNodeAsString(node); + if (label == null) + label = node.toString(); + lineNumber = getLineNumber(node); + label += " | Line " + lineNumber; + //apiLevel = 0; + } + + public ASTNodeWrapper(ASTNode node, String label){ + if (node == null){ + return; + } + this.Node = node; + if(label != null) + this.label = label; + else{ + label = getNodeAsString(node); + if (label == null) + label = node.toString(); + + label += " | Line " + lineNumber; + } + lineNumber = getLineNumber(node); + } + + /** + * For this node, finds various offsets (java code). + * Note that line start offset for this node is int[2] - int[1] + * @return int[]{line number, line number start offset, node start offset, + * node length} + */ + public int[] getJavaCodeOffsets(ErrorCheckerService ecs) { + int nodeOffset = Node.getStartPosition(), nodeLength = Node + .getLength(); + log("0.nodeOffset " + nodeOffset); + ASTNode thisNode = Node; + while (thisNode.getParent() != null) { + if (getLineNumber(thisNode.getParent()) == lineNumber) { + thisNode = thisNode.getParent(); + } else { + break; + } + } + /* + * There's an edge case here - multiple statements in a single line. + * After identifying the statement with the line number, I'll have to + * look at previous tree nodes in the same level for same line number. + * The correct line start offset would be the line start offset of + * the first node with this line number. + * + * Using linear search for now. P.S: Eclipse AST iterators are messy. + * TODO: binary search might improve speed by 0.001%? + */ + + int altStartPos = thisNode.getStartPosition(); + log("1.Altspos " + altStartPos); + thisNode = thisNode.getParent(); + Javadoc jd = null; + + /* + * There's another case that needs to be handled. If a TD, MD or FD + * contains javadoc comments(multi or single line) the starting position + * of the javadoc is treated as the beginning of the declaration by the AST parser. + * But that's clearly not what we need. The true decl begins after the javadoc ends. + * So this offset needs to be found carefully and stored in altStartPos + * + */ + if (thisNode instanceof TypeDeclaration) { + jd = ((TypeDeclaration) thisNode).getJavadoc(); + altStartPos = getJavadocOffset((TypeDeclaration) thisNode); + log("Has t jdoc " + ((TypeDeclaration) thisNode).getJavadoc()); + } else if (thisNode instanceof MethodDeclaration) { + altStartPos = getJavadocOffset((MethodDeclaration) thisNode); + jd = ((MethodDeclaration) thisNode).getJavadoc(); + log("Has m jdoc " + jd); + } else if (thisNode instanceof FieldDeclaration) { + FieldDeclaration fd = ((FieldDeclaration) thisNode); + jd = fd.getJavadoc(); + log("Has f jdoc " + fd.getJavadoc()); + altStartPos = getJavadocOffset(fd); + //nodeOffset = ((VariableDeclarationFragment)(fd.fragments().get(0))).getName().getStartPosition(); + } + + if (jd == null) { + log("Visiting children of node " + getNodeAsString(thisNode)); + Iterator it = + (Iterator) thisNode + .structuralPropertiesForType().iterator(); + boolean flag = true; + while (it.hasNext()) { + StructuralPropertyDescriptor prop = it.next(); + if (prop.isChildListProperty()) { + List nodelist = (List) thisNode + .getStructuralProperty(prop); + log("prop " + prop); + for (ASTNode cnode : nodelist) { + log("Visiting node " + getNodeAsString(cnode)); + if (getLineNumber(cnode) == lineNumber) { + if (flag) { + altStartPos = cnode.getStartPosition(); + // log("multi..."); + + flag = false; + } else { + if (cnode == Node) { + // loop only till the current node. + break; + } + // We've located the first node in the line. + // Now normalize offsets till Node + //altStartPos += normalizeOffsets(cnode); + + } + + } + } + } + } + log("Altspos " + altStartPos); + } + + int pdeoffsets[] = getPDECodeOffsets(ecs); + String pdeCode = ecs.getPDECodeAtLine(pdeoffsets[0],pdeoffsets[1] - 1).trim(); + int vals[] = createOffsetMapping(ecs, pdeCode,nodeOffset - altStartPos,nodeLength); + if (vals != null) + return new int[] { + lineNumber, nodeOffset + vals[0] - altStartPos, vals[1] }; + else {// no offset mapping needed + log("joff[1] = " + (nodeOffset - altStartPos)); + return new int[] { lineNumber, nodeOffset - altStartPos, nodeLength }; + } + } + + /** + * When FD has javadoc attached, the beginning of FD is marked as the + * start of the javadoc. This kind of screws things when trying to locate + * the exact name of the FD. So, offset compensations... + * + * @param fd + * @return + */ + private int getJavadocOffset(FieldDeclaration fd){ + List list= (List)fd.modifiers(); + SimpleName sn = (SimpleName) getNode(); + + Type tp = fd.getType(); + int lineNum = getLineNumber(sn); + log("SN "+sn + ", " + lineNum); + for (ASTNode astNode : list) { + if(getLineNumber(astNode) == lineNum) + { + log("first node in that line " + astNode); + log("diff " + (sn.getStartPosition() - astNode.getStartPosition())); + return (astNode.getStartPosition()); + } + } + if(getLineNumber(fd.getType()) == lineNum) + { + log("first node in that line " + tp); + log("diff " + (sn.getStartPosition() - tp.getStartPosition())); + return (tp.getStartPosition()); + } + + + return 0; + } + + /** + * When MD has javadoc attached, the beginning of FD is marked as the + * start of the javadoc. This kind of screws things when trying to locate + * the exact name of the MD. So, offset compensations... + * + * @param md + * @return + */ + private int getJavadocOffset(MethodDeclaration md) { + List list = (List)md.modifiers(); + SimpleName sn = (SimpleName) getNode(); + int lineNum = getLineNumber(sn); + log("SN " + sn + ", " + lineNum); + + for (ASTNode astNode : list) { + if (getLineNumber(astNode) == lineNum) { + log("first node in that line " + astNode); + log("diff " + (sn.getStartPosition() - astNode.getStartPosition())); + return (astNode.getStartPosition()); + } + } + + if (!md.isConstructor()) { + Type tp = md.getReturnType2(); + if (getLineNumber(tp) == lineNum) { + log("first node in that line " + tp); + log("diff " + (sn.getStartPosition() - tp.getStartPosition())); + return (tp.getStartPosition()); + } + } + + return 0; + } + + /** + * When TD has javadoc attached, the beginning of FD is marked as the + * start of the javadoc. This kind of screws things when trying to locate + * the exact name of the TD. So, offset compensations... + * + * @param td + * @return + */ + private int getJavadocOffset(TypeDeclaration td){ + // TODO: This isn't perfect yet. Class \n \n \n className still breaks it.. :'( + List list= (List)td.modifiers(); + SimpleName sn = (SimpleName) getNode(); + + int lineNum = getLineNumber(sn); + log("SN "+sn + ", " + lineNum); + for (ASTNode astNode : list) { + if(getLineNumber(astNode) == lineNum) + { + log("first node in that line " + astNode); + log("diff " + (sn.getStartPosition() - astNode.getStartPosition())); + return (astNode.getStartPosition()); + } + } + + if(td.getJavadoc() != null){ + log("diff " + + (td.getJavadoc().getStartPosition() + td.getJavadoc().getLength() + 1)); + return (td.getJavadoc().getStartPosition() + td.getJavadoc().getLength() + 1); + } + log("getJavadocOffset(TypeDeclaration td) "+sn + ", found nothing. Meh."); + return 0; + } + + /** + * Finds the difference in pde and java code offsets + * @param source + * @param inpOffset + * @param nodeLen + * @return int[0] - difference in start offset, int[1] - node length + */ + private int[] createOffsetMapping(ErrorCheckerService ecs, String source, int inpOffset, int nodeLen) { + + int ret[][] = getOffsetMapping(ecs, source); + if(ret == null){ + // no offset mapping needed + return null; + } + int javaCodeMap[] = ret[0]; + int pdeCodeMap[] = ret[1]; + int pi = 1, pj = 1; + pj = 0; + pi = 0; + int count = 1; + // first find the java code index + pj = inpOffset; + + int startIndex = javaCodeMap[pj]; + + // find beginning + while (pdeCodeMap[pi] != startIndex && pi < pdeCodeMap.length) + pi++; + int startoffDif = pi - pj; + int stopindex = javaCodeMap[pj + nodeLen - 1]; + log(startIndex + "SI,St" + stopindex + "sod " + startoffDif); + + // count till stopindex + while (pdeCodeMap[pi] < stopindex && pi < pdeCodeMap.length) { + pi++; + count++; + } + +// log("PDE maps from " + pdeeCodeMap[pi]); + + log("pde len " + count); + return new int[] { startoffDif, count }; + } + + /** + * Generates offset mapping between java and pde code + * + * @param source + * @return int[0] - java code offsets, int[1] = pde code offsets + */ + public int[][] getOffsetMapping(ErrorCheckerService ecs, String source){ + + /* + * This is some tricky shiz. So detailed explanation follows: + * + * The main issue here is that pde enhancements like color vars, # literals + * and int() type casting deviate from standard java. But I need to exact + * index matching for pde and java versions of snippets.For ex: + * "color col = #ffaadd;" <-PDE version + * "int col = 0xffffaadd;" <-Converted to Java + * + * For exact index mapping, I need to know at which indices either is + * deviating from the other and by what amount. Turns out, it isn't quite + * easy.(1) First I take the pde version of the code as an argument(pde + * version fetched from the editor directly). I then find all instances + * which need to be converted to pure java, marking those indices and the + * index correction needed. (2) Now all java conversions are applied after + * marking the offsets. This ensures that the index order isn't disturbed by + * one at a time conversions as done in preprocessCode() in ECS. Took me + * sometime to figure out this was a bug. (3) Next I create a table(two + * separate arrays) which allows me to look it up for matching any index + * between pde or java version of the snippet. This also lets me find out + * any difference in length between both versions. + * + * Keep in mind though, dark magic was involved in creating the final lookup + * table. + * + * TODO: This is a work in progress. There may be more bugs here in hiding. + */ + + log("Src:" + source); + // Instead of converting pde into java, how can I simply extract the same source + // from the java code? Think. TODO + String sourceAlt = new String(source); + String sourceJava = ecs.astGenerator.getJavaSourceCodeLine(lineNumber); + TreeMap offsetmap = new TreeMap(); + + if(sourceJava.trim().startsWith("public") && !source.startsWith("public")){ + offsetmap.put(0,6); + //TODO: This is a temp fix. You GOTTA rewrite offset matching + } + // Find all #[web color] + // Should be 6 digits only. + final String webColorRegexp = "#{1}[A-F|a-f|0-9]{6}\\W"; + Pattern webPattern = Pattern.compile(webColorRegexp); + Matcher webMatcher = webPattern.matcher(sourceAlt); + while (webMatcher.find()) { + // log("Found at: " + webMatcher.start()); + // log("-> " + found); + offsetmap.put(webMatcher.end() - 1, 3); + } + + // Find all color data types + final String colorTypeRegex = "color(?![a-zA-Z0-9_])(?=\\[*)(?!(\\s*\\())"; + Pattern colorPattern = Pattern.compile(colorTypeRegex); + Matcher colorMatcher = colorPattern.matcher(sourceAlt); + while (colorMatcher.find()) { +// System.out.print("Start index: " + colorMatcher.start()); +// log(" End index: " + colorMatcher.end() + " "); +// log("-->" + colorMatcher.group() + "<--"); + offsetmap.put(colorMatcher.end() - 1, -2); + } + + // Find all int(), char() + String dataTypeFunc[] = { "int", "char", "float", "boolean", "byte" }; + + for (String dataType : dataTypeFunc) { + String dataTypeRegexp = "\\b" + dataType + "\\s*\\("; + Pattern pattern = Pattern.compile(dataTypeRegexp); + Matcher matcher = pattern.matcher(sourceAlt); + + while (matcher.find()) { +// System.out.print("Start index: " + matcher.start()); +// log(" End index: " + matcher.end() + " "); +// log("-->" + matcher.group() + "<--"); + offsetmap.put(matcher.end() - 1, ("PApplet.parse").length()); + } + matcher.reset(); + sourceAlt = matcher.replaceAll("PApplet.parse" + + Character.toUpperCase(dataType.charAt(0)) + dataType.substring(1) + + "("); + + } + if(offsetmap.isEmpty()){ + log("No offset matching needed."); + return null; + } + // replace with 0xff[webcolor] and others + webMatcher = webPattern.matcher(sourceAlt); + while (webMatcher.find()) { + // log("Found at: " + webMatcher.start()); + String found = sourceAlt.substring(webMatcher.start(), webMatcher.end()); + // log("-> " + found); + sourceAlt = webMatcher.replaceFirst("0xff" + found.substring(1)); + webMatcher = webPattern.matcher(sourceAlt); + } + + colorMatcher = colorPattern.matcher(sourceAlt); + sourceAlt = colorMatcher.replaceAll("int"); + + log("From direct source: "); +// sourceAlt = sourceJava; + log(sourceAlt); + + + // Create code map. Beware! Dark magic ahead. + int javaCodeMap[] = new int[source.length() * 2]; + int pdeCodeMap[] = new int[source.length() * 2]; + int pi = 1, pj = 1; + int keySum = 0; + for (Integer key : offsetmap.keySet()) { + for (; pi < key +keySum; pi++) { + javaCodeMap[pi] = javaCodeMap[pi - 1] + 1; + } + for (; pj < key; pj++) { + pdeCodeMap[pj] = pdeCodeMap[pj - 1] + 1; + } + + log(key + ":" + offsetmap.get(key)); + + int kval = offsetmap.get(key); + if (kval > 0) { + // repeat java offsets + pi--; + pj--; + for (int i = 0; i < kval; i++, pi++, pj++) { + if (pi > 1 && pj > 1) { + javaCodeMap[pi] = javaCodeMap[pi - 1]; + pdeCodeMap[pj] = pdeCodeMap[pj - 1] + 1; + } + } + } else { + // repeat pde offsets + pi--; + pj--; + for (int i = 0; i < -kval; i++, pi++, pj++) { + if (pi > 1 && pj > 1) { + javaCodeMap[pi] = javaCodeMap[pi - 1] + 1; + pdeCodeMap[pj] = pdeCodeMap[pj - 1]; + } + } + } + + // after each adjustment, the key values need to keep + // up with changed offset + keySum += kval; + } + + javaCodeMap[pi] = javaCodeMap[pi - 1] + 1; + pdeCodeMap[pj] = pdeCodeMap[pj - 1] + 1; + + while (pi < sourceAlt.length()) { + javaCodeMap[pi] = javaCodeMap[pi - 1] + 1; + pi++; + } + while (pj < source.length()) { + pdeCodeMap[pj] = pdeCodeMap[pj - 1] + 1; + pj++; + } + + // debug o/p + for (int i = 0; i < pdeCodeMap.length; i++) { + if (pdeCodeMap[i] > 0 || javaCodeMap[i] > 0 || i == 0) { + if (i < source.length()) + log2(source.charAt(i)); + log2(pdeCodeMap[i] + " - " + javaCodeMap[i]); + if (i < sourceAlt.length()) + log2(sourceAlt.charAt(i)); + log2(" <-[" + i + "]"); + log(""); + } + } + log(""); + + return new int[][]{javaCodeMap,pdeCodeMap}; + } + + /** + * Highlight the ASTNode in the editor, if it's of type + * SimpleName + * @param astGenerator + * @return - true if highlighting was successful + */ + public boolean highlightNode(ASTGenerator astGenerator){ + if(!(Node instanceof SimpleName)){ + return false; + } + SimpleName nodeName = (SimpleName) Node; + try { + //TODO: Redundant code. See ASTGenerator.getJavaSourceCodeline() + int javaLineNumber = getLineNumber(nodeName); + int pdeOffs[] = astGenerator.errorCheckerService + .calculateTabIndexAndLineNumber(javaLineNumber); + PlainDocument javaSource = new PlainDocument(); + javaSource.insertString(0, astGenerator.errorCheckerService.sourceCode, null); + Element lineElement = javaSource.getDefaultRootElement() + .getElement(javaLineNumber-1); + if(lineElement == null) { + log(lineNumber + " line element null while highlighting " + nodeName); + return false; + } + + String javaLine = javaSource.getText(lineElement.getStartOffset(), + lineElement.getEndOffset() + - lineElement.getStartOffset()); + astGenerator.editor.getSketch().setCurrentCode(pdeOffs[0]); + String pdeLine = astGenerator.editor.getLineText(pdeOffs[1]); + String lookingFor = nodeName.toString(); + log(lookingFor + ", " + nodeName.getStartPosition()); + log(javaLineNumber +" JL " + javaLine + " LSO " + lineElement.getStartOffset() + "," + + lineElement.getEndOffset()); + log(pdeOffs[1] + " PL " + pdeLine); + if (!javaLine.contains(lookingFor) || !pdeLine.contains(lookingFor)) { + logE("Logical error in highLightNode(). Please file a bug report."); + return false; + } + + OffsetMatcher ofm = new OffsetMatcher(pdeLine, javaLine); + int highlightStart = ofm.getPdeOffForJavaOff(nodeName.getStartPosition() + - lineElement.getStartOffset(), + nodeName.getLength()); + if (highlightStart == -1) { + logE("Logical error in highLightNode() during offset matching. " + + "Please file a bug report."); + return false; + } + int lso = astGenerator.editor.ta.getLineStartOffset(pdeOffs[1]); + highlightStart += lso; + astGenerator.editor.setSelection(highlightStart, highlightStart + + nodeName.getLength()); + /* + // First find the name in the java line, and marks its index + Pattern toFind = Pattern.compile("\\b" + nodeName.toString() + "\\b"); + Matcher matcher = toFind.matcher(javaLine); + int count = 0, index = 0; + int lsto = lineElement.getStartOffset(); + while(matcher.find()){ + count++; + //log(matcher.start() + lsto); + if(lsto + matcher.start() == nodeName.getStartPosition()) + break; + } + log("count=" + count); + index = 0; + // find the same name in the pde line by its index and get its offsets + matcher = toFind.matcher(pdeLine); + while(matcher.find()){ + count--; + if(count == 0){ + log("Found on pde line lso: " + matcher.start()); + index = matcher.end(); + break; + } + } + log("pde lso " + (index - lookingFor.length())); + + int lso = astGenerator.editor.ta.getLineStartOffset(pdeOffs[1]); + astGenerator.editor.setSelection(lso + index - lookingFor.length(), lso + + index); + */ + return true; + } catch (BadLocationException e) { + logE("BLE in highLightNode() for " + nodeName); + e.printStackTrace(); + } + return false; + } + + /** + * Gets offset mapping between java and pde code + * int[0][x] stores the java code offset and + * int[1][x] is the corresponding offset in pde code + * @param ecs + * @return int[0] - java code offset, int[1] - pde code offset + */ + public int[][] getOffsetMapping(ErrorCheckerService ecs){ + int pdeoffsets[] = getPDECodeOffsets(ecs); + String pdeCode = ecs.getPDECodeAtLine(pdeoffsets[0],pdeoffsets[1] - 1).trim(); + return getOffsetMapping(ecs, pdeCode); + } + + /** + * + * @param ecs + * - ErrorCheckerService instance + * @return int[0] - tab number, int[1] - line number in the int[0] tab, int[2] + * - line start offset, int[3] - offset from line start int[2] and + * int[3] are on TODO + */ + public int[] getPDECodeOffsets(ErrorCheckerService ecs) { + return ecs.JavaToPdeOffsets(lineNumber + 1, Node.getStartPosition()); + } + + public int getPDECodeOffsetForSN(ASTGenerator astGen){ + if (Node instanceof SimpleName) { + Element lineElement = astGen.getJavaSourceCodeElement(lineNumber); + log("Line element off " + lineElement.getStartOffset()); + OffsetMatcher ofm = new OffsetMatcher( + astGen + .getPDESourceCodeLine(lineNumber), + astGen + .getJavaSourceCodeLine(lineNumber)); + //log(""); + int pdeOffset = ofm.getPdeOffForJavaOff(Node.getStartPosition() + - lineElement.getStartOffset(), Node.toString().length()); + return pdeOffset; + } + return -1; + } + + public String toString() { + return label; + } + + public ASTNode getNode() { + return Node; + } + + public String getLabel() { + return label; + } + + public int getNodeType() { + return Node.getNodeType(); + } + + public int getLineNumber() { + return lineNumber; + } + + /** + * Applies pde enhancements to code. + * TODO: Code reuse happening here. :\ + * @param source + * @return + */ + public static String getJavaCode(String source){ + log("Src:" + source); + String sourceAlt = new String(source); + + // Find all #[web color] + // Should be 6 digits only. + final String webColorRegexp = "#{1}[A-F|a-f|0-9]{6}\\W"; + Pattern webPattern = Pattern.compile(webColorRegexp); + Matcher webMatcher = webPattern.matcher(sourceAlt); + while (webMatcher.find()) { + // log("Found at: " + webMatcher.start()); + // log("-> " + found); + } + + // Find all color data types + final String colorTypeRegex = "color(?![a-zA-Z0-9_])(?=\\[*)(?!(\\s*\\())"; + Pattern colorPattern = Pattern.compile(colorTypeRegex); + Matcher colorMatcher = colorPattern.matcher(sourceAlt); + while (colorMatcher.find()) { +// System.out.print("Start index: " + colorMatcher.start()); +// log(" End index: " + colorMatcher.end() + " "); +// log("-->" + colorMatcher.group() + "<--"); + } + + // Find all int(), char() + String dataTypeFunc[] = { "int", "char", "float", "boolean", "byte" }; + + for (String dataType : dataTypeFunc) { + String dataTypeRegexp = "\\b" + dataType + "\\s*\\("; + Pattern pattern = Pattern.compile(dataTypeRegexp); + Matcher matcher = pattern.matcher(sourceAlt); + + while (matcher.find()) { +// System.out.print("Start index: " + matcher.start()); +// log(" End index: " + matcher.end() + " "); +// log("-->" + matcher.group() + "<--"); + } + matcher.reset(); + sourceAlt = matcher.replaceAll("PApplet.parse" + + Character.toUpperCase(dataType.charAt(0)) + dataType.substring(1) + + "("); + + } + // replace with 0xff[webcolor] and others + webMatcher = webPattern.matcher(sourceAlt); + while (webMatcher.find()) { + // log("Found at: " + webMatcher.start()); + String found = sourceAlt.substring(webMatcher.start(), webMatcher.end()); + // log("-> " + found); + sourceAlt = webMatcher.replaceFirst("0xff" + found.substring(1)); + webMatcher = webPattern.matcher(sourceAlt); + } + + colorMatcher = colorPattern.matcher(sourceAlt); + sourceAlt = colorMatcher.replaceAll("int"); + + log("Converted:"+sourceAlt); + return sourceAlt; + } + + private static int getLineNumber(ASTNode node) { + return ((CompilationUnit) node.getRoot()).getLineNumber(node + .getStartPosition()); + } + + /*private static int getLineNumber2(ASTNode thisNode) { + int jdocOffset = 0; Javadoc jd = null; + if(thisNode instanceof TypeDeclaration){ + jd = ((TypeDeclaration)thisNode).getJavadoc(); + log("Has t jdoc " + ((TypeDeclaration)thisNode).getJavadoc()); + } else if(thisNode instanceof MethodDeclaration){ + jd = ((MethodDeclaration)thisNode).getJavadoc(); + log("Has m jdoc " + jd); + } else if(thisNode instanceof FieldDeclaration){ + jd = ((FieldDeclaration)thisNode).getJavadoc(); + log("Has f jdoc " + ((FieldDeclaration)thisNode).getJavadoc()); + } + if(jd != null){ + jdocOffset = 1+jd.getLength(); + } + log("ln 2 = " + ((CompilationUnit) thisNode.getRoot()).getLineNumber(thisNode + .getStartPosition() + jdocOffset)); + return ((CompilationUnit) thisNode.getRoot()).getLineNumber(thisNode + .getStartPosition() + jdocOffset); + }*/ + + static private String getNodeAsString(ASTNode node) { + if (node == null) + return "NULL"; + String className = node.getClass().getName(); + int index = className.lastIndexOf("."); + if (index > 0) + className = className.substring(index + 1); + + // if(node instanceof BodyDeclaration) + // return className; + + String value = className; + + if (node instanceof TypeDeclaration) + value = ((TypeDeclaration) node).getName().toString() + " | " + className; + else if (node instanceof MethodDeclaration) + value = ((MethodDeclaration) node).getName().toString() + " | " + + className; + else if (node instanceof MethodInvocation) + value = ((MethodInvocation) node).getName().toString() + " | " + + className; + else if (node instanceof FieldDeclaration) + value = ((FieldDeclaration) node).toString() + " FldDecl| "; + else if (node instanceof SingleVariableDeclaration) + value = ((SingleVariableDeclaration) node).getName() + " - " + + ((SingleVariableDeclaration) node).getType() + " | SVD "; + else if (node instanceof ExpressionStatement) + value = node.toString() + className; + else if (node instanceof SimpleName) + value = ((SimpleName) node).getFullyQualifiedName() + " | " + className; + else if (node instanceof QualifiedName) + value = node.toString() + " | " + className; + else if (className.startsWith("Variable")) + value = node.toString() + " | " + className; + else if (className.endsWith("Type")) + value = node.toString() + " |" + className; + value += " [" + node.getStartPosition() + "," + + (node.getStartPosition() + node.getLength()) + "]"; + value += " Line: " + + ((CompilationUnit) node.getRoot()).getLineNumber(node + .getStartPosition()); + return value; + } +} \ No newline at end of file diff --git a/pdex/src/processing/mode/experimental/ArrayFieldNode.java b/pdex/src/processing/mode/experimental/ArrayFieldNode.java new file mode 100755 index 000000000..04b3fb111 --- /dev/null +++ b/pdex/src/processing/mode/experimental/ArrayFieldNode.java @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2012 Martin Leopold + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +import com.sun.jdi.ArrayReference; +import com.sun.jdi.ClassNotLoadedException; +import com.sun.jdi.InvalidTypeException; +import com.sun.jdi.Value; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Specialized {@link VariableNode} for representing single fields in an array. + * Overrides {@link #setValue} to properly change the value of the encapsulated + * array field. + * + * @author Martin Leopold + */ +public class ArrayFieldNode extends VariableNode { + + protected ArrayReference array; + protected int index; + + /** + * Construct an {@link ArrayFieldNode}. + * + * @param name the name + * @param type the type + * @param value the value + * @param array a reference to the array + * @param index the index inside the array + */ + public ArrayFieldNode(String name, String type, Value value, ArrayReference array, int index) { + super(name, type, value); + this.array = array; + this.index = index; + } + + @Override + public void setValue(Value value) { + try { + array.setValue(index, value); + } catch (InvalidTypeException ex) { + Logger.getLogger(ArrayFieldNode.class.getName()).log(Level.SEVERE, null, ex); + } catch (ClassNotLoadedException ex) { + Logger.getLogger(ArrayFieldNode.class.getName()).log(Level.SEVERE, null, ex); + } + this.value = value; + } +} diff --git a/pdex/src/processing/mode/experimental/AutoSaveUtil.java b/pdex/src/processing/mode/experimental/AutoSaveUtil.java new file mode 100644 index 000000000..f3414ba0c --- /dev/null +++ b/pdex/src/processing/mode/experimental/AutoSaveUtil.java @@ -0,0 +1,353 @@ +/* + * Copyright (C) 2012-14 Manindra Moharana + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package processing.mode.experimental; + +import static processing.mode.experimental.ExperimentalMode.log; + +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.util.Timer; + +import processing.app.Base; +import processing.app.Sketch; + +/** + * Autosave utility for saving sketch backups in the background after + * certain intervals + * NOTE: This was developed as an experiment, but disabled for now. + * @author Manindra Moharana + * + */ +public class AutoSaveUtil { + + private DebugEditor editor; + + private Timer timer; + +// private int saveTime; + + private File autosaveDir, pastSave; + + private boolean isSaving; + + private boolean isAutoSaveBackup; + + private File sketchFolder, sketchBackupFolder; + + private static final String AUTOSAVEFOLDER = "__autosave__"; + + /** + * + * @param dedit + * @param timeOut - in minutes, how frequently should saves occur + */ + public AutoSaveUtil(DebugEditor dedit, int timeOut){ + /* + editor = dedit; + if (timeOut < 1) { // less than 1 minute not allowed! + saveTime = -1; + throw new IllegalArgumentException(""); + } + else{ + saveTime = timeOut * 60 * 1000; + log("AutoSaver Interval(mins): " + timeOut); + } + checkIfBackup(); + if(isAutoSaveBackup){ + sketchBackupFolder = sketchFolder; + } + else{ + autosaveDir = new File(editor.getSketch().getFolder().getAbsolutePath() + File.separator + AUTOSAVEFOLDER); + sketchFolder = editor.getSketch().getFolder(); + sketchBackupFolder = autosaveDir; + }*/ + } + + /** + * If the sketch path looks like ../__autosave__/../FooSketch + * then assume this is a backup sketch + */ + private void checkIfBackup(){ + File parent = sketchFolder.getParentFile().getParentFile(); + if(parent.isDirectory() && parent.getName().equals(AUTOSAVEFOLDER)){ + isAutoSaveBackup = true; + log("IS AUTOSAVE " + sketchFolder.getAbsolutePath()); + } + } + + public File getActualSketchFolder(){ + if(isAutoSaveBackup) + return sketchFolder.getParentFile().getParentFile().getParentFile(); + else + return sketchFolder; + } + + public boolean isAutoSaveBackup() { + return isAutoSaveBackup; + } + + /** + * Check if any previous autosave exists + * @return + */ + public boolean checkForPastSave(){ + if(autosaveDir.exists()){ + String prevSaves[] = Base.listFiles(autosaveDir, false); + if(prevSaves.length > 0){ + File t = new File(Base.listFiles(new File(prevSaves[0]), false)[0]); + sketchBackupFolder = t; + pastSave = new File(t.getAbsolutePath() + File.separator + t.getName() + ".pde"); + if(pastSave.exists()) + return true; + } + } + return false; + } + + /** + * Refresh autosave directory if current sketch location in the editor changes + */ + public void reloadAutosaveDir(){ + while(isSaving); + autosaveDir = new File(editor.getSketch().getFolder().getAbsolutePath() + File.separator + AUTOSAVEFOLDER); + } + + public File getAutoSaveDir(){ + return autosaveDir; + } + + /** + * The folder of the original sketch + * @return + */ + public File getSketchFolder(){ + return sketchFolder; + } + + public File getSketchBackupFolder(){ + return sketchBackupFolder; + } + + public File getPastSave(){ + return pastSave; + } + + /** + * Start the auto save service + */ + public void init(){ + /* + if(isAutoSaveBackup) { + log("AutoSaver not started"); + return; + } + if(saveTime < 10000) saveTime = 10 * 1000; + saveTime = 5 * 1000; //TODO: remove + timer = new Timer(); + timer.schedule(new SaveTask(), saveTime, saveTime); + isSaving = false; + log("AutoSaver started"); + */ + } + + /** + * Stop the autosave service + */ + public void stop(){ + while(isSaving); // save operation mustn't be interrupted + if(timer != null) timer.cancel(); + Base.removeDir(autosaveDir); + ExperimentalMode.log("Stopping autosaver and deleting backup dir"); + } + + /** + * Main function that performs the save operation + * Code reused from processing.app.Sketch.saveAs() + * @return + * @throws IOException + */ + private boolean saveSketch() throws IOException{ + if(!editor.getSketch().isModified()) return false; + isSaving = true; + Sketch sc = editor.getSketch(); + + boolean deleteOldSave = false; + String oldSave = null; + if(!autosaveDir.exists()){ + autosaveDir = new File(sc.getFolder().getAbsolutePath(), AUTOSAVEFOLDER); + autosaveDir.mkdir(); + } + else + { + // delete the previous backup after saving current one. + String prevSaves[] = Base.listFiles(autosaveDir, false); + if(prevSaves.length > 0){ + deleteOldSave = true; + oldSave = prevSaves[0]; + } + } + String newParentDir = autosaveDir + File.separator + System.currentTimeMillis(); + String newName = sc.getName(); + + + // check on the sanity of the name + String sanitaryName = Sketch.checkName(newName); + File newFolder = new File(newParentDir, sanitaryName); + if (!sanitaryName.equals(newName) && newFolder.exists()) { + Base.showMessage("Cannot Save", + "A sketch with the cleaned name\n" + + "“" + sanitaryName + "” already exists."); + isSaving = false; + return false; + } + newName = sanitaryName; + +// String newPath = newFolder.getAbsolutePath(); +// String oldPath = folder.getAbsolutePath(); + +// if (newPath.equals(oldPath)) { +// return false; // Can't save a sketch over itself +// } + + // make sure there doesn't exist a tab with that name already + // but ignore this situation for the first tab, since it's probably being + // resaved (with the same name) to another location/folder. + for (int i = 1; i < sc.getCodeCount(); i++) { + if (newName.equalsIgnoreCase(sc.getCode()[i].getPrettyName())) { + Base.showMessage("Nope", + "You can't save the sketch as \"" + newName + "\"\n" + + "because the sketch already has a tab with that name."); + isSaving = false; + return false; + } + } + + + + // if the new folder already exists, then first remove its contents before + // copying everything over (user will have already been warned). + if (newFolder.exists()) { + Base.removeDir(newFolder); + } + // in fact, you can't do this on Windows because the file dialog + // will instead put you inside the folder, but it happens on OS X a lot. + + // now make a fresh copy of the folder + newFolder.mkdirs(); + + // grab the contents of the current tab before saving + // first get the contents of the editor text area + if (sc.getCurrentCode().isModified()) { + sc.getCurrentCode().setProgram(editor.getText()); + } + + File[] copyItems = sc.getFolder().listFiles(new FileFilter() { + public boolean accept(File file) { + String name = file.getName(); + // just in case the OS likes to return these as if they're legit + if (name.equals(".") || name.equals("..")) { + return false; + } + // list of files/folders to be ignored during "save as" + for (String ignorable : editor.getMode().getIgnorable()) { + if (name.equals(ignorable)) { + return false; + } + } + // ignore the extensions for code, since that'll be copied below + for (String ext : editor.getMode().getExtensions()) { + if (name.endsWith(ext)) { + return false; + } + } + // don't do screen captures, since there might be thousands. kind of + // a hack, but seems harmless. hm, where have i heard that before... + if (name.startsWith("screen-")) { + return false; + } + return true; + } + }); + // now copy over the items that make sense + for (File copyable : copyItems) { + if (copyable.isDirectory()) { + Base.copyDir(copyable, new File(newFolder, copyable.getName())); + } else { + Base.copyFile(copyable, new File(newFolder, copyable.getName())); + } + } + + // save the other tabs to their new location + for (int i = 1; i < sc.getCodeCount(); i++) { + File newFile = new File(newFolder, sc.getCode()[i].getFileName()); + sc.getCode()[i].saveAs(newFile); + } + + // While the old path to the main .pde is still set, remove the entry from + // the Recent menu so that it's not sticking around after the rename. + // If untitled, it won't be in the menu, so there's no point. +// if (!isUntitled()) { +// editor.removeRecent(); +// } + + // save the main tab with its new name + File newFile = new File(newFolder, newName + ".pde"); + sc.getCode()[0].saveAs(newFile); + +// updateInternal(newName, newFolder); +// +// // Make sure that it's not an untitled sketch +// setUntitled(false); +// +// // Add this sketch back using the new name +// editor.addRecent(); + + // let Editor know that the save was successful + + if(deleteOldSave){ + Base.removeDir(new File(oldSave)); + } + isSaving = false; + return true; + } + + /** + * Timertask used to perform the save operation every X minutes + * @author quarkninja + * + */ + /* + private class SaveTask extends TimerTask{ + + @Override + public void run() { + try { + if(saveSketch()) + ExperimentalMode.log("Backup Saved " + editor.getSketch().getMainFilePath()); + } catch (IOException e) { + e.printStackTrace(); + } + + } + + } + */ + +} diff --git a/pdex/src/processing/mode/experimental/ClassLoadListener.java b/pdex/src/processing/mode/experimental/ClassLoadListener.java new file mode 100755 index 000000000..64bd5516b --- /dev/null +++ b/pdex/src/processing/mode/experimental/ClassLoadListener.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2012 Martin Leopold + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +import com.sun.jdi.ReferenceType; + +/** + * Listener to be notified when a class is loaded in the debugger. Used by + * {@link LineBreakpoint}s to activate themselves as soon as the respective + * class is loaded. + * + * @author Martin Leopold + */ +public interface ClassLoadListener { + + /** + * Event handler called when a class is loaded. + * + * @param theClass the class + */ + public void classLoaded(ReferenceType theClass); +} diff --git a/pdex/src/processing/mode/experimental/CompilationChecker.java b/pdex/src/processing/mode/experimental/CompilationChecker.java new file mode 100644 index 000000000..1b5459d06 --- /dev/null +++ b/pdex/src/processing/mode/experimental/CompilationChecker.java @@ -0,0 +1,549 @@ +/* + * Copyright (C) 2012-14 Martin Leopold and Manindra Moharana + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package processing.mode.experimental; + +import java.io.BufferedReader; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.StringTokenizer; + +import org.eclipse.jdt.core.JavaCore; +import org.eclipse.jdt.core.compiler.CharOperation; +import org.eclipse.jdt.core.compiler.IProblem; +import org.eclipse.jdt.core.dom.AST; +import org.eclipse.jdt.core.dom.ASTParser; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jdt.core.dom.PackageDeclaration; +import org.eclipse.jdt.core.dom.TypeDeclaration; +import org.eclipse.jdt.internal.compiler.ClassFile; +import org.eclipse.jdt.internal.compiler.CompilationResult; +import org.eclipse.jdt.internal.compiler.Compiler; +import org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies; +import org.eclipse.jdt.internal.compiler.ICompilerRequestor; +import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader; +import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException; +import org.eclipse.jdt.internal.compiler.env.ICompilationUnit; +import org.eclipse.jdt.internal.compiler.env.INameEnvironment; +import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; +import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory; +import org.eclipse.jface.text.Document; + +/** + * + * Provides compilation checking functionality + * + * @author Manindra Moharana <me@mkmoharana.com> + * + */ +public class CompilationChecker { + /** + * ICompilationUnit implementation + */ + private class CompilationUnitImpl implements ICompilationUnit { + + private CompilationUnit unit; + + CompilationUnitImpl(CompilationUnit unit) { + this.unit = unit; + } + + public char[] getContents() { + char[] contents = null; + try { + Document doc = new Document(); + if (readFromFile) + doc.set(readFile()); + else + doc.set(sourceText); + // TextEdit edits = unit.rewrite(doc, null); + // edits.apply(doc); + String sourceCode = doc.get(); + if (sourceCode != null) + contents = sourceCode.toCharArray(); + } catch (Exception e) { + throw new RuntimeException(e); + } + return contents; + } + + public char[] getMainTypeName() { + TypeDeclaration classType = (TypeDeclaration) unit.types().get(0); + return classType.getName().getFullyQualifiedName().toCharArray(); + } + + public char[][] getPackageName() { + String[] names = getSimpleNames(this.unit.getPackage().getName() + .getFullyQualifiedName()); + char[][] packages = new char[names.length][]; + for (int i = 0; i < names.length; ++i) + packages[i] = names[i].toCharArray(); + + return packages; + } + + public char[] getFileName() { + TypeDeclaration classType = (TypeDeclaration) unit.types().get(0); + String name = classType.getName().getFullyQualifiedName() + ".java"; + return name.toCharArray(); + } + + @Override + public boolean ignoreOptionalProblems() { + return false; + } + } + + /** + * ICompilerRequestor implementation + */ + private class CompileRequestorImpl implements ICompilerRequestor { + + private List problems; + + private List classes; + + public CompileRequestorImpl() { + this.problems = new ArrayList(); + this.classes = new ArrayList(); + } + + public void acceptResult(CompilationResult result) { + boolean errors = false; + if (result.hasProblems()) { + IProblem[] problems = result.getProblems(); + for (int i = 0; i < problems.length; i++) { + if (problems[i].isError()) + errors = true; + + this.problems.add(problems[i]); + } + } + if (!errors) { + ClassFile[] classFiles = result.getClassFiles(); + for (int i = 0; i < classFiles.length; i++) + this.classes.add(classFiles[i]); + } + } + + List getProblems() { + return this.problems; + } + + List getResults() { + //System.out.println("Calling get results"); + return this.classes; + } + } + + /** + * INameEnvironment implementation + */ + private class NameEnvironmentImpl implements INameEnvironment { + + private ICompilationUnit unit; + + private String fullName; + + NameEnvironmentImpl(ICompilationUnit unit) { + this.unit = unit; + this.fullName = CharOperation.toString(this.unit.getPackageName()) + "." + + new String(this.unit.getMainTypeName()); + } + + public NameEnvironmentAnswer findType(char[][] compoundTypeName) { + return findType(CharOperation.toString(compoundTypeName)); + } + + public NameEnvironmentAnswer findType(char[] typeName, char[][] packageName) { + String fullName = CharOperation.toString(packageName); + if (typeName != null) { + if (fullName.length() > 0) + fullName += "."; + + fullName += new String(typeName); + } + return findType(fullName); + } + + public boolean isPackage(char[][] parentPackageName, char[] packageName) { + String fullName = CharOperation.toString(parentPackageName); + if (packageName != null) { + if (fullName.length() > 0) + fullName += "."; + + fullName += new String(packageName); + } + if (findType(fullName) != null) + return false; + + try { + return (getClassLoader().loadClass(fullName) == null); + } catch (ClassNotFoundException e) { + return true; + } + } + + public void cleanup() { + } + + private NameEnvironmentAnswer findType(String fullName) { + + if (this.fullName.equals(fullName)) + return new NameEnvironmentAnswer(unit, null); + + try { + InputStream is = getClassLoader().getResourceAsStream(fullName + .replace('.', + '/') + + ".class"); + if (is != null) { + // System.out.println("Find type: " + fullName); + byte[] buffer = new byte[8192]; + int bytes = 0; + ByteArrayOutputStream os = new ByteArrayOutputStream(buffer.length); + while ((bytes = is.read(buffer, 0, buffer.length)) > 0) + os.write(buffer, 0, bytes); + + os.flush(); + ClassFileReader classFileReader = new ClassFileReader( + os.toByteArray(), + fullName + .toCharArray(), + true); + return new NameEnvironmentAnswer(classFileReader, null); + } + return null; + } catch (IOException e) { + throw new RuntimeException(e); + } catch (ClassFormatException e) { + throw new RuntimeException(e); + } + } + } + + private URLClassLoader urlClassLoader; + + private ClassLoader getClassLoader() { + if (urlClassLoader != null) { + return urlClassLoader; + } else { + return getClass().getClassLoader(); + } + } + + private void prepareClassLoader(ArrayList jarList) { + URL urls[] = new URL[jarList.size()]; + for (int i = 0; i < urls.length; i++) { + try { + urls[i] = jarList.get(i).toURI().toURL(); + } catch (MalformedURLException e) { + e.printStackTrace(); + } + } + urlClassLoader = new URLClassLoader(urls); + //System.out.println("URL Classloader ready"); + } + + /** + * ClassLoader implementation + */ + /* + private class CustomClassLoader extends ClassLoader { + + private Map classMap; + + CustomClassLoader(ClassLoader parent, List classesList) { + this.classMap = new HashMap(); + for (int i = 0; i < classesList.size(); i++) { + ClassFile classFile = (ClassFile) classesList.get(i); + String className = CharOperation.toString(classFile.getCompoundName()); + this.classMap.put(className, classFile.getBytes()); + } + } + + public Class findClass(String name) throws ClassNotFoundException { + byte[] bytes = (byte[]) this.classMap.get(name); + if (bytes != null) + return defineClass(name, bytes, 0, bytes.length); + + return super.findClass(name); + } + }; + */ + + private ICompilationUnit generateCompilationUnit() { + ASTParser parser = ASTParser.newParser(AST.JLS4); + try { + parser.setSource("".toCharArray()); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + Map options = JavaCore.getOptions(); + + // Ben has decided to move on to 1.6. Yay! + JavaCore.setComplianceOptions(JavaCore.VERSION_1_6, options); + parser.setCompilerOptions(options); + CompilationUnit unit = (CompilationUnit) parser.createAST(null); + unit.recordModifications(); + + AST ast = unit.getAST(); + + // Package statement + // package astexplorer; + + PackageDeclaration packageDeclaration = ast.newPackageDeclaration(); + unit.setPackage(packageDeclaration); + // unit.se + packageDeclaration.setName(ast.newSimpleName(fileName)); + // System.out.println("Filename: " + fileName); + // class declaration + // public class SampleComposite extends Composite { + + TypeDeclaration classType = ast.newTypeDeclaration(); + classType.setInterface(false); + // classType.s + classType.setName(ast.newSimpleName(fileName)); + unit.types().add(classType); + // classType.setSuperclass(ast.newSimpleName("Composite")); + return new CompilationUnitImpl(unit); + } + + public static String fileName = "HelloPeasy"; + + public static String readFile() { + BufferedReader reader = null; + System.out.println(fileName); + try { + reader = new BufferedReader( + new InputStreamReader( + new FileInputStream( + new File( + "/media/quarkninja/Work/TestStuff/" + + fileName + + ".java")))); + } catch (FileNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + try { + StringBuilder ret = new StringBuilder(); + String line; + while ((line = reader.readLine()) != null) { + ret.append(line); + ret.append("\n"); + } + return ("package " + fileName + ";\n" + ret.toString()); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } finally { + try { + reader.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + return null; + } + + private void compileMeQuitely(ICompilationUnit unit, Map compilerSettings) { + + Map settings; + if (compilerSettings == null) { + settings = new HashMap(); + + settings.put(CompilerOptions.OPTION_LineNumberAttribute, + CompilerOptions.GENERATE); + settings.put(CompilerOptions.OPTION_SourceFileAttribute, + CompilerOptions.GENERATE); + settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6); + settings.put(CompilerOptions.OPTION_SuppressWarnings, + CompilerOptions.DISABLED); + // settings.put(CompilerOptions.OPTION_ReportUnusedImport, + // CompilerOptions.IGNORE); + // settings.put(CompilerOptions.OPTION_ReportMissingSerialVersion, + // CompilerOptions.IGNORE); + // settings.put(CompilerOptions.OPTION_ReportRawTypeReference, + // CompilerOptions.IGNORE); + // settings.put(CompilerOptions.OPTION_ReportUncheckedTypeOperation, + // CompilerOptions.IGNORE); + } else { + settings = compilerSettings; + } + +// CompilerOptions cop = new CompilerOptions(); +// cop.set(settings); + CompileRequestorImpl requestor = new CompileRequestorImpl(); + Compiler compiler = new Compiler(new NameEnvironmentImpl(unit), + DefaultErrorHandlingPolicies + .proceedWithAllProblems(), + new CompilerOptions(settings), requestor, + new DefaultProblemFactory(Locale + .getDefault())); + compiler.compile(new ICompilationUnit[] { unit }); + + List problems = requestor.getProblems(); + prob = new IProblem[problems.size()]; + int count = 0; + for (Iterator it = problems.iterator(); it.hasNext();) { + IProblem problem = (IProblem) it.next(); + prob[count++] = problem; + } + + } + + private void compileMeQuitely(ICompilationUnit unit) { + compileMeQuitely(unit, null); + } + + static private String[] getSimpleNames(String qualifiedName) { + StringTokenizer st = new StringTokenizer(qualifiedName, "."); + ArrayList list = new ArrayList(); + while (st.hasMoreTokens()) { + String name = st.nextToken().trim(); + if (!name.equals("*")) + list.add(name); + } + return list.toArray(new String[0]); + } + + public static void main(String[] args) { + ArrayList fl = new ArrayList(); + fl.add(new File( + "/home/quarkninja/Workspaces/processing_workspace/processing/core/library/core.jar")); + CompilationChecker cc = new CompilationChecker(fl); + cc.getErrors("Brightness"); + cc.display(); + } + + public void display() { + boolean error = false; + int errorCount = 0, warningCount = 0, count = 0; + for (int i = 0; i < prob.length; i++) { + IProblem problem = prob[i]; + if (problem == null) + continue; + StringBuffer buffer = new StringBuffer(); + buffer.append(problem.getMessage()); + buffer.append(" | line: "); + buffer.append(problem.getSourceLineNumber()); + String msg = buffer.toString(); + if (problem.isError()) { + error = true; + msg = "Error: " + msg; + errorCount++; + } else if (problem.isWarning()) { + msg = "Warning: " + msg; + warningCount++; + } + System.out.println(msg); + prob[count++] = problem; + } + + if (!error) { + System.out.println("===================================="); + System.out.println(" Compiled without any errors. "); + System.out.println("===================================="); + } else { + System.out.println("===================================="); + System.out.println(" Compilation failed. You erred man! "); + System.out.println("===================================="); + + } + System.out.print("Total warnings: " + warningCount); + System.out.println(", Total errors: " + errorCount); + } + + IProblem[] prob; + + public IProblem[] getErrors(String name) { + fileName = name; + compileMeQuitely(generateCompilationUnit()); + // System.out.println("getErrors()"); + + return prob; + } + + /** + * Performs compiler error check. + * @param sourceName - name of the class + * @param source - source code + * @param settings - compiler options + * @param classLoader - custom classloader which can load all dependencies + * @return IProblem[] - list of compiler errors and warnings + */ + public IProblem[] getErrors(String sourceName, String source, Map settings, + URLClassLoader classLoader) { + fileName = sourceName; + readFromFile = false; + sourceText = "package " + fileName + ";\n" + source; + if (classLoader != null) + this.urlClassLoader = classLoader; + compileMeQuitely(generateCompilationUnit(), settings); + // System.out.println("getErrors(), Done."); + + return prob; + } + + private boolean readFromFile = true; + + String sourceText = ""; + + public IProblem[] getErrors(String sourceName, String source) { + return getErrors(sourceName, source, null); + } + + @SuppressWarnings("rawtypes") + public IProblem[] getErrors(String sourceName, String source, Map settings) { + fileName = sourceName; + readFromFile = false; + sourceText = "package " + fileName + ";\n" + source; + + compileMeQuitely(generateCompilationUnit(), settings); + // System.out.println("getErrors(), Done."); + return prob; + } + + public CompilationChecker() { + // System.out.println("Compilation Checker initialized."); + } + + public CompilationChecker(ArrayList fileList) { + prepareClassLoader(fileList); + // System.out.println("Compilation Checker initialized."); + } +} diff --git a/pdex/src/processing/mode/experimental/Compiler.java b/pdex/src/processing/mode/experimental/Compiler.java new file mode 100755 index 000000000..1a85c6a29 --- /dev/null +++ b/pdex/src/processing/mode/experimental/Compiler.java @@ -0,0 +1,367 @@ +/* + * Copyright (C) 2012 Martin Leopold + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +import java.io.*; +import java.lang.reflect.Method; +import processing.app.Base; +import processing.app.SketchException; +import processing.core.PApplet; + +/** + * Copied from processing.mode.java.Compiler, just added -g switch to generate + * debugging info. + * + * @author Martin Leopold + */ +public class Compiler extends processing.mode.java.Compiler { + /** + * Compile with ECJ. See http://j.mp/8paifz for documentation. + * + * @return true if successful. + * @throws RunnerException Only if there's a problem. Only then. + */ +// public boolean compile(Sketch sketch, +// File srcFolder, +// File binFolder, +// String primaryClassName, +// String sketchClassPath, +// String bootClassPath) throws RunnerException { + static public boolean compile(DebugBuild build) throws SketchException { + + // This will be filled in if anyone gets angry + SketchException exception = null; + boolean success = false; + + String baseCommand[] = new String[] { + "-g", + "-Xemacs", + //"-noExit", // not necessary for ecj + "-source", "1.6", + "-target", "1.6", + "-classpath", build.getClassPath(), + "-nowarn", // we're not currently interested in warnings (works in ecj) + "-d", build.getBinFolder().getAbsolutePath() // output the classes in the buildPath + }; + //PApplet.println(baseCommand); + + // make list of code files that need to be compiled +// String[] sourceFiles = new String[sketch.getCodeCount()]; +// int sourceCount = 0; +// sourceFiles[sourceCount++] = +// new File(buildPath, primaryClassName + ".java").getAbsolutePath(); +// +// for (SketchCode code : sketch.getCode()) { +// if (code.isExtension("java")) { +// String path = new File(buildPath, code.getFileName()).getAbsolutePath(); +// sourceFiles[sourceCount++] = path; +// } +// } + String[] sourceFiles = Base.listFiles(build.getSrcFolder(), false, ".java"); + +// String[] command = new String[baseCommand.length + sourceFiles.length]; +// System.arraycopy(baseCommand, 0, command, 0, baseCommand.length); +// // append each of the files to the command string +// System.arraycopy(sourceFiles, 0, command, baseCommand.length, sourceCount); + String[] command = PApplet.concat(baseCommand, sourceFiles); + + //PApplet.println(command); + + try { + // Load errors into a local StringBuffer + final StringBuffer errorBuffer = new StringBuffer(); + + // Create single method dummy writer class to slurp errors from ecj + Writer internalWriter = new Writer() { + public void write(char[] buf, int off, int len) { + errorBuffer.append(buf, off, len); + } + + public void flush() { } + + public void close() { } + }; + // Wrap as a PrintWriter since that's what compile() wants + PrintWriter writer = new PrintWriter(internalWriter); + + //result = com.sun.tools.javac.Main.compile(command, writer); + + PrintWriter outWriter = new PrintWriter(System.out); + + // Version that's not dynamically loaded + //CompilationProgress progress = null; + //success = BatchCompiler.compile(command, outWriter, writer, progress); + + // Version that *is* dynamically loaded. First gets the mode class loader + // so that it can grab the compiler JAR files from it. + ClassLoader loader = build.getMode().getJavaModeClassLoader(); + //ClassLoader loader = build.getMode().getClassLoader(); + try { + Class batchClass = + Class.forName("org.eclipse.jdt.core.compiler.batch.BatchCompiler", false, loader); + Class progressClass = + Class.forName("org.eclipse.jdt.core.compiler.CompilationProgress", false, loader); + Class[] compileArgs = + new Class[] { String[].class, PrintWriter.class, PrintWriter.class, progressClass }; + Method compileMethod = batchClass.getMethod("compile", compileArgs); + success = (Boolean) + compileMethod.invoke(null, new Object[] { command, outWriter, writer, null }); + } catch (Exception e) { + e.printStackTrace(); + throw new SketchException("Unknown error inside the compiler."); + } + + // Close out the stream for good measure + writer.flush(); + writer.close(); + + BufferedReader reader = + new BufferedReader(new StringReader(errorBuffer.toString())); + //System.err.println(errorBuffer.toString()); + + String line = null; + while ((line = reader.readLine()) != null) { + //System.out.println("got line " + line); // debug + + // get first line, which contains file name, line number, + // and at least the first line of the error message + String errorFormat = "([\\w\\d_]+.java):(\\d+):\\s*(.*):\\s*(.*)\\s*"; + String[] pieces = PApplet.match(line, errorFormat); + //PApplet.println(pieces); + + // if it's something unexpected, die and print the mess to the console + if (pieces == null) { + exception = new SketchException("Cannot parse error text: " + line); + exception.hideStackTrace(); + // Send out the rest of the error message to the console. + System.err.println(line); + while ((line = reader.readLine()) != null) { + System.err.println(line); + } + break; + } + + // translate the java filename and line number into a un-preprocessed + // location inside a source file or tab in the environment. + String dotJavaFilename = pieces[1]; + // Line numbers are 1-indexed from javac + int dotJavaLineIndex = PApplet.parseInt(pieces[2]) - 1; + String errorMessage = pieces[4]; + + exception = build.placeException(errorMessage, + dotJavaFilename, + dotJavaLineIndex); + /* + int codeIndex = 0; //-1; + int codeLine = -1; + + // first check to see if it's a .java file + for (int i = 0; i < sketch.getCodeCount(); i++) { + SketchCode code = sketch.getCode(i); + if (code.isExtension("java")) { + if (dotJavaFilename.equals(code.getFileName())) { + codeIndex = i; + codeLine = dotJavaLineIndex; + } + } + } + + // if it's not a .java file, codeIndex will still be 0 + if (codeIndex == 0) { // main class, figure out which tab + //for (int i = 1; i < sketch.getCodeCount(); i++) { + for (int i = 0; i < sketch.getCodeCount(); i++) { + SketchCode code = sketch.getCode(i); + + if (code.isExtension("pde")) { + if (code.getPreprocOffset() <= dotJavaLineIndex) { + codeIndex = i; + //System.out.println("i'm thinkin file " + i); + codeLine = dotJavaLineIndex - code.getPreprocOffset(); + } + } + } + } + //System.out.println("code line now " + codeLine); + exception = new RunnerException(errorMessage, codeIndex, codeLine, -1, false); + */ + + if (exception == null) { + exception = new SketchException(errorMessage); + } + + // for a test case once message parsing is implemented, + // use new Font(...) since that wasn't getting picked up properly. + + /* + if (errorMessage.equals("cannot find symbol")) { + handleCannotFindSymbol(reader, exception); + + } else if (errorMessage.indexOf("is already defined") != -1) { + reader.readLine(); // repeats the line of code w/ error + int codeColumn = caretColumn(reader.readLine()); + exception = new RunnerException(errorMessage, + codeIndex, codeLine, codeColumn); + + } else if (errorMessage.startsWith("package") && + errorMessage.endsWith("does not exist")) { + // Because imports are stripped out and re-added to the 0th line of + // the preprocessed code, codeLine will always be wrong for imports. + exception = new RunnerException("P" + errorMessage.substring(1) + + ". You might be missing a library."); + } else { + exception = new RunnerException(errorMessage); + } + */ + if (errorMessage.startsWith("The import ") && + errorMessage.endsWith("cannot be resolved")) { + // The import poo cannot be resolved + //import poo.shoe.blah.*; + //String what = errorMessage.substring("The import ".length()); + String[] m = PApplet.match(errorMessage, "The import (.*) cannot be resolved"); + //what = what.substring(0, what.indexOf(' ')); + if (m != null) { +// System.out.println("'" + m[1] + "'"); + if (m[1].equals("processing.xml")) { + exception.setMessage("processing.xml no longer exists, this code needs to be updated for 2.0."); + System.err.println("The processing.xml library has been replaced " + + "with a new 'XML' class that's built-in."); + handleCrustyCode(); + + } else { + exception.setMessage("The package " + + "\u201C" + m[1] + "\u201D" + + " does not exist. " + + "You might be missing a library."); + System.err.println("Libraries must be " + + "installed in a folder named 'libraries' " + + "inside the 'sketchbook' folder."); + } + } + +// // Actually create the folder and open it for the user +// File sketchbookLibraries = Base.getSketchbookLibrariesFolder(); +// if (!sketchbookLibraries.exists()) { +// if (sketchbookLibraries.mkdirs()) { +// Base.openFolder(sketchbookLibraries); +// } +// } + + } else if (errorMessage.endsWith("cannot be resolved to a type")) { + // xxx cannot be resolved to a type + //xxx c; + + String what = errorMessage.substring(0, errorMessage.indexOf(' ')); + + if (what.equals("BFont") || + what.equals("BGraphics") || + what.equals("BImage")) { + exception.setMessage(what + " has been replaced with P" + what.substring(1)); + handleCrustyCode(); + + } else { + exception.setMessage("Cannot find a class or type " + + "named \u201C" + what + "\u201D"); + } + + } else if (errorMessage.endsWith("cannot be resolved")) { + // xxx cannot be resolved + //println(xxx); + + String what = errorMessage.substring(0, errorMessage.indexOf(' ')); + + if (what.equals("LINE_LOOP") || + what.equals("LINE_STRIP")) { + exception.setMessage("LINE_LOOP and LINE_STRIP are not available, " + + "please update your code."); + handleCrustyCode(); + + } else if (what.equals("framerate")) { + exception.setMessage("framerate should be changed to frameRate."); + handleCrustyCode(); + + } else if (what.equals("screen")) { + exception.setMessage("Change screen.width and screen.height to " + + "displayWidth and displayHeight."); + handleCrustyCode(); + + } else if (what.equals("screenWidth") || + what.equals("screenHeight")) { + exception.setMessage("Change screenWidth and screenHeight to " + + "displayWidth and displayHeight."); + handleCrustyCode(); + + } else { + exception.setMessage("Cannot find anything " + + "named \u201C" + what + "\u201D"); + } + + } else if (errorMessage.startsWith("Duplicate")) { + // "Duplicate nested type xxx" + // "Duplicate local variable xxx" + + } else { + String[] parts = null; + + // The method xxx(String) is undefined for the type Temporary_XXXX_XXXX + //xxx("blah"); + // The method xxx(String, int) is undefined for the type Temporary_XXXX_XXXX + //xxx("blah", 34); + // The method xxx(String, int) is undefined for the type PApplet + //PApplet.sub("ding"); + String undefined = + "The method (\\S+\\(.*\\)) is undefined for the type (.*)"; + parts = PApplet.match(errorMessage, undefined); + if (parts != null) { + if (parts[1].equals("framerate(int)")) { + exception.setMessage("framerate() no longer exists, use frameRate() instead."); + handleCrustyCode(); + + } else if (parts[1].equals("push()")) { + exception.setMessage("push() no longer exists, use pushMatrix() instead."); + handleCrustyCode(); + + } else if (parts[1].equals("pop()")) { + exception.setMessage("pop() no longer exists, use popMatrix() instead."); + handleCrustyCode(); + + } else { + String mess = "The function " + parts[1] + " does not exist."; + exception.setMessage(mess); + } + break; + } + } + if (exception != null) { + // The stack trace just shows that this happened inside the compiler, + // which is a red herring. Don't ever show it for compiler stuff. + exception.hideStackTrace(); + break; + } + } + } catch (IOException e) { + String bigSigh = "Error while compiling. (" + e.getMessage() + ")"; + exception = new SketchException(bigSigh); + e.printStackTrace(); + success = false; + } + // In case there was something else. + if (exception != null) throw exception; + + return success; + } +} diff --git a/pdex/src/processing/mode/experimental/CompletionCandidate.java b/pdex/src/processing/mode/experimental/CompletionCandidate.java new file mode 100644 index 000000000..cf7ad5c40 --- /dev/null +++ b/pdex/src/processing/mode/experimental/CompletionCandidate.java @@ -0,0 +1,159 @@ +package processing.mode.experimental; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.List; + +import org.eclipse.jdt.core.dom.ASTNode; +import org.eclipse.jdt.core.dom.FieldDeclaration; +import org.eclipse.jdt.core.dom.MethodDeclaration; +import org.eclipse.jdt.core.dom.SingleVariableDeclaration; +import org.eclipse.jdt.core.dom.TypeDeclaration; +import org.eclipse.jdt.core.dom.VariableDeclarationFragment; + +public class CompletionCandidate implements Comparable{ + + private String elementName; // + + private String label; // the toString value + + private String completionString; + + private Object wrappedObject; + + private int type; + + public static final int PREDEF_CLASS = 0, PREDEF_FIELD = 1, + PREDEF_METHOD = 2, LOCAL_CLASS = 3, LOCAL_METHOD = 4, LOCAL_FIELD = 5, + LOCAL_VAR = 6; + + public CompletionCandidate(Method method) { + method.getDeclaringClass().getName(); + elementName = method.getName(); + StringBuffer label = new StringBuffer(method.getName() + "("); + StringBuffer cstr = new StringBuffer(method.getName() + "("); + for (int i = 0; i < method.getParameterTypes().length; i++) { + label.append(method.getParameterTypes()[i].getSimpleName()); + if (i < method.getParameterTypes().length - 1) { + label.append(","); + cstr.append(","); + } + } + if(method.getParameterTypes().length == 1) { + cstr.append(' '); + } + label.append(")"); + if(method.getReturnType() != null) + label.append(" : " + method.getReturnType().getSimpleName()); + label.append(" - " + method.getDeclaringClass().getSimpleName()); + cstr.append(")"); + this.label = label.toString(); + this.completionString = cstr.toString(); + type = PREDEF_METHOD; + wrappedObject = method; + } + + public Object getWrappedObject() { + return wrappedObject; + } + + public CompletionCandidate(SingleVariableDeclaration svd) { + completionString = svd.getName().toString(); + elementName = svd.getName().toString(); + if(svd.getParent() instanceof FieldDeclaration) + type = LOCAL_FIELD; + else + type = LOCAL_VAR; + label = svd.getName() + " : " + svd.getType(); + } + + public CompletionCandidate(VariableDeclarationFragment vdf) { + completionString = vdf.getName().toString(); + elementName = vdf.getName().toString(); + if(vdf.getParent() instanceof FieldDeclaration) + type = LOCAL_FIELD; + else + type = LOCAL_VAR; + label = vdf.getName() + " : " + ASTGenerator.extracTypeInfo2(vdf); + } + + public CompletionCandidate(MethodDeclaration method) { + // log("ComCan " + method.getName()); + elementName = method.getName().toString(); + type = LOCAL_METHOD; + List params = (List) method + .getStructuralProperty(MethodDeclaration.PARAMETERS_PROPERTY); + StringBuffer label = new StringBuffer(elementName + "("); + StringBuffer cstr = new StringBuffer(method.getName() + "("); + for (int i = 0; i < params.size(); i++) { + label.append(params.get(i).toString()); + if (i < params.size() - 1) { + label.append(","); + cstr.append(","); + } + } + if (params.size() == 1) { + cstr.append(' '); + } + label.append(")"); + if (method.getReturnType2() != null) + label.append(" : " + method.getReturnType2()); + cstr.append(")"); + this.label = label.toString(); + this.completionString = cstr.toString(); + } + + public CompletionCandidate(TypeDeclaration td){ + type = LOCAL_CLASS; + elementName = td.getName().toString(); + label = elementName; + completionString = elementName; + } + + public CompletionCandidate(Field f) { + f.getDeclaringClass().getName(); + elementName = f.getName(); + type = PREDEF_FIELD; + label = f.getName() + " : " + f.getType().getSimpleName() + + " - " + f.getDeclaringClass().getSimpleName(); + completionString = elementName; + wrappedObject = f; + } + + public CompletionCandidate(String name, String labelStr, String completionStr, int type) { + elementName = name; + label = labelStr; + completionString = completionStr; + this.type = type; + } + + public CompletionCandidate(String name, int type) { + elementName = name; + label = name; + completionString = name; + this.type = type; + } + + public String getElementName() { + return elementName; + } + + public String getCompletionString() { + return completionString; + } + + public String toString() { + return label; + } + + public int getType() { + return type; + } + + public int compareTo(CompletionCandidate cc) { + if(type != cc.getType()){ + return cc.getType() - type; + } + return (elementName.compareTo(cc.getElementName())); + } + +} diff --git a/pdex/src/processing/mode/experimental/CompletionPanel.java b/pdex/src/processing/mode/experimental/CompletionPanel.java new file mode 100644 index 000000000..5c3da8b42 --- /dev/null +++ b/pdex/src/processing/mode/experimental/CompletionPanel.java @@ -0,0 +1,447 @@ +/* + * Copyright (C) 2012-14 Manindra Moharana + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package processing.mode.experimental; +import static processing.mode.experimental.ExperimentalMode.log; +import static processing.mode.experimental.ExperimentalMode.log2; +import static processing.mode.experimental.ExperimentalMode.logE; + +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.FontMetrics; +import java.awt.Point; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.DefaultListModel; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JPopupMenu; +import javax.swing.JScrollPane; +import javax.swing.ListSelectionModel; +import javax.swing.SwingUtilities; +import javax.swing.text.BadLocationException; + +import processing.app.syntax.JEditTextArea; + +/** + * Manages the actual suggestion popup that gets displayed + * @author Manindra Moharana + * + */ +public class CompletionPanel { + + /** + * The completion list generated by ASTGenerator + */ + private JList completionList; + + /** + * The popup menu in which the suggestion list is shown + */ + private JPopupMenu popupMenu; + + /** + * Partial word which triggered the code completion and which needs to be completed + */ + private String subWord; + + /** + * Postion where the completion has to be inserted + */ + private int insertionPosition; + + private TextArea textarea; + + /** + * Scroll pane in which the completion list is displayed + */ + private JScrollPane scrollPane; + + protected DebugEditor editor; + + /** + * Triggers the completion popup + * @param textarea + * @param position - insertion position(caret pos) + * @param subWord - Partial word which triggered the code completion and which needs to be completed + * @param items - completion candidates + * @param location - Point location where popup list is to be displayed + * @param dedit + */ + public CompletionPanel(final JEditTextArea textarea, int position, String subWord, + DefaultListModel items, final Point location, DebugEditor dedit) { + this.textarea = (TextArea) textarea; + editor = dedit; + this.insertionPosition = position; + if (subWord.indexOf('.') != -1) + this.subWord = subWord.substring(subWord.lastIndexOf('.') + 1); + else + this.subWord = subWord; + popupMenu = new JPopupMenu(); + popupMenu.removeAll(); + popupMenu.setOpaque(false); + popupMenu.setBorder(null); + scrollPane = new JScrollPane(); + scrollPane.setViewportView(completionList = createSuggestionList(position, items)); + popupMenu.add(scrollPane, BorderLayout.CENTER); + popupMenu.setPopupSize(280, setHeight(items.getSize())); //TODO: Eradicate this evil + this.textarea.errorCheckerService.getASTGenerator() + .updateJavaDoc((CompletionCandidate) completionList.getSelectedValue()); + textarea.requestFocusInWindow(); + popupMenu.show(textarea, location.x, textarea.getBaseline(0, 0) + + location.y); + //log("Suggestion shown: " + System.currentTimeMillis()); + } + + public boolean isVisible() { + return popupMenu.isVisible(); + } + + public void setVisible(boolean v){ + //log("Pred popup visible."); + popupMenu.setVisible(v); + } + + private int setHeight(int itemCount){ + FontMetrics fm = textarea.getFontMetrics(textarea.getFont()); + float h = (fm.getHeight() + (fm.getDescent()) * 0.5f) * (itemCount); + if (scrollPane.getHorizontalScrollBar().isVisible()) + h += scrollPane.getHorizontalScrollBar().getHeight() + fm.getHeight() + + (fm.getDescent() + fm.getAscent()) * 0.8f; + // 0.5f and 0.8f scaling give respectable results. + //log("popup height " + Math.min(250,h) + //+ scrollPane.getHorizontalScrollBar().isVisible()); + return Math.min(250, (int) h); // popup menu height + } + + /*TODO: Make width dynamic + protected int setWidth(){ + if(scrollPane.getVerticalScrollBar().isVisible()) return 280; + float min = 280; + FontMetrics fm = textarea.getFontMetrics(textarea.getFont()); + for (int i = 0; i < completionList.getModel().getSize(); i++) { + float h = fm.stringWidth(completionList.getModel().getElementAt(i).toString()); + min = Math.min(min, h); + } + min += fm.stringWidth(" "); + log("popup width " + Math.min(280,min)); + return Math.min(280,(int)min); // popup menu height + }*/ + + /** + * Created the popup list to be displayed + * @param position + * @param items + * @return + */ + private JList createSuggestionList(final int position, + final DefaultListModel items) { + + JList list = new JList(items); + //list.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY, 1)); + list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + list.setSelectedIndex(0); + list.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + if (e.getClickCount() == 2) { + insertSelection(); + hide(); + } + } + }); + list.setCellRenderer(new CustomListRenderer()); + list.setFocusable(false); + return list; + } + + // possibly defunct + public boolean updateList(final DefaultListModel items, String newSubword, + final Point location, int position) { + this.subWord = new String(newSubword); + if (subWord.indexOf('.') != -1) + this.subWord = subWord.substring(subWord.lastIndexOf('.') + 1); + insertionPosition = position; + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + scrollPane.getViewport().removeAll(); + completionList.setModel(items); + completionList.setSelectedIndex(0); + scrollPane.setViewportView(completionList); + popupMenu.setPopupSize(popupMenu.getSize().width, setHeight(items.getSize())); + //log("Suggestion updated" + System.nanoTime()); + textarea.requestFocusInWindow(); + popupMenu.show(textarea, location.x, textarea.getBaseline(0, 0) + + location.y); + completionList.validate(); + scrollPane.validate(); + popupMenu.validate(); + } + }); + return true; + } + + /** + * Inserts the CompletionCandidate chosen from the suggestion list + * + * @return + */ + public boolean insertSelection() { + if (completionList.getSelectedValue() != null) { + try { + // If user types 'abc.', subword becomes '.' and null is returned + String currentSubword = fetchCurrentSubword(); + int currentSubwordLen = currentSubword == null ? 0 : currentSubword + .length(); + //logE(currentSubword + " <= subword,len => " + currentSubword.length()); + String selectedSuggestion = ((CompletionCandidate) completionList + .getSelectedValue()).getCompletionString(); + + if (currentSubword != null) { + selectedSuggestion = selectedSuggestion.substring(currentSubwordLen); + } else { + currentSubword = ""; + } + + logE(subWord + " <= subword, Inserting suggestion=> " + + selectedSuggestion + " Current sub: " + currentSubword); + if (currentSubword.length() > 0) { + textarea.getDocument().remove(insertionPosition - currentSubwordLen, + currentSubwordLen); + } + + textarea.getDocument() + .insertString(insertionPosition - currentSubwordLen, + ((CompletionCandidate) completionList + .getSelectedValue()).getCompletionString(), null); + if (selectedSuggestion.endsWith(")")) { + if (!selectedSuggestion.endsWith("()")) { + int x = selectedSuggestion.indexOf('('); + if (x != -1) { + //log("X................... " + x); + textarea.setCaretPosition(insertionPosition + (x + 1)); + } + } + } else { + textarea.setCaretPosition(insertionPosition + + selectedSuggestion.length()); + } + //log("Suggestion inserted: " + System.currentTimeMillis()); + return true; + } catch (BadLocationException e1) { + e1.printStackTrace(); + } + catch (Exception e) { + e.printStackTrace(); + } + hide(); + } + return false; + } + + private String fetchCurrentSubword() { + //log("Entering fetchCurrentSubword"); + TextArea ta = editor.ta; + int off = ta.getCaretPosition(); + //log2("off " + off); + if (off < 0) + return null; + int line = ta.getCaretLine(); + if (line < 0) + return null; + String s = ta.getLineText(line); + //log2("lin " + line); + //log2(s + " len " + s.length()); + + int x = ta.getCaretPosition() - ta.getLineStartOffset(line) - 1, x1 = x - 1; + if(x >= s.length() || x < 0) + return null; //TODO: Does this check cause problems? Verify. + log2(" x char: " + s.charAt(x)); + //int xLS = off - getLineStartNonWhiteSpaceOffset(line); + + String word = (x < s.length() ? s.charAt(x) : "") + ""; + if (s.trim().length() == 1) { + // word = "" + // + (keyChar == KeyEvent.CHAR_UNDEFINED ? s.charAt(x - 1) : keyChar); + //word = (x < s.length()?s.charAt(x):"") + ""; + word = word.trim(); + if (word.endsWith(".")) + word = word.substring(0, word.length() - 1); + + return word; + } + //log("fetchCurrentSubword 1 " + word); + if(word.equals(".")) return null; // If user types 'abc.', subword becomes '.' + // if (keyChar == KeyEvent.VK_BACK_SPACE || keyChar == KeyEvent.VK_DELETE) + // ; // accepted these keys + // else if (!(Character.isLetterOrDigit(keyChar) || keyChar == '_' || keyChar == '$')) + // return null; + int i = 0; + + while (true) { + i++; + //TODO: currently works on single line only. "a. b()" won't be detected + if (x1 >= 0) { +// if (s.charAt(x1) != ';' && s.charAt(x1) != ',' && s.charAt(x1) != '(') + if (Character.isLetterOrDigit(s.charAt(x1)) || s.charAt(x1) == '_') { + + word = s.charAt(x1--) + word; + + } else { + break; + } + } else { + break; + } + if (i > 200) { + // time out! + break; + } + } + // if (keyChar != KeyEvent.CHAR_UNDEFINED) + //log("fetchCurrentSubword 2 " + word); + if (Character.isDigit(word.charAt(0))) + return null; + word = word.trim(); + if (word.endsWith(".")) + word = word.substring(0, word.length() - 1); + //log("fetchCurrentSubword 3 " + word); + //showSuggestionLater(); + return word; + //} + } + + /** + * Hide the suggestion list + */ + public void hide() { + popupMenu.setVisible(false); + //log("Suggestion hidden" + System.nanoTime()); + //textarea.errorCheckerService.getASTGenerator().jdocWindowVisible(false); + } + + /** + * When up arrow key is pressed, moves the highlighted selection up in the list + */ + public void moveUp() { + if (completionList.getSelectedIndex() == 0) { + scrollPane.getVerticalScrollBar().setValue(scrollPane.getVerticalScrollBar().getMaximum()); + selectIndex(completionList.getModel().getSize() - 1); + return; + } else { + int index = Math.max(completionList.getSelectedIndex() - 1, 0); + selectIndex(index); + } + int step = scrollPane.getVerticalScrollBar().getMaximum() + / completionList.getModel().getSize(); + scrollPane.getVerticalScrollBar().setValue(scrollPane + .getVerticalScrollBar() + .getValue() + - step); + textarea.errorCheckerService.getASTGenerator() + .updateJavaDoc((CompletionCandidate) completionList.getSelectedValue()); + + } + + /** + * When down arrow key is pressed, moves the highlighted selection down in the list + */ + public void moveDown() { + if (completionList.getSelectedIndex() == completionList.getModel().getSize() - 1) { + scrollPane.getVerticalScrollBar().setValue(0); + selectIndex(0); + return; + } else { + int index = Math.min(completionList.getSelectedIndex() + 1, completionList.getModel() + .getSize() - 1); + selectIndex(index); + } + textarea.errorCheckerService.getASTGenerator() + .updateJavaDoc((CompletionCandidate) completionList.getSelectedValue()); + int step = scrollPane.getVerticalScrollBar().getMaximum() + / completionList.getModel().getSize(); + scrollPane.getVerticalScrollBar().setValue(scrollPane + .getVerticalScrollBar() + .getValue() + + step); + } + + private void selectIndex(int index) { + completionList.setSelectedIndex(index); +// final int position = textarea.getCaretPosition(); +// SwingUtilities.invokeLater(new Runnable() { +// @Override +// public void run() { +// textarea.setCaretPosition(position); +// }; +// }); + } + + + /** + * Custom cell renderer to display icons along with the completion candidates + * @author Manindra Moharana + * + */ + private class CustomListRenderer extends + javax.swing.DefaultListCellRenderer { + //protected final ImageIcon classIcon, fieldIcon, methodIcon; + + public Component getListCellRendererComponent(JList list, Object value, + int index, + boolean isSelected, + boolean cellHasFocus) { + JLabel label = (JLabel) super.getListCellRendererComponent(list, value, + index, + isSelected, + cellHasFocus); + if (value instanceof CompletionCandidate) { + CompletionCandidate cc = (CompletionCandidate) value; + switch (cc.getType()) { + case CompletionCandidate.LOCAL_VAR: + label.setIcon(editor.dmode.localVarIcon); + break; + case CompletionCandidate.LOCAL_FIELD: + case CompletionCandidate.PREDEF_FIELD: + label.setIcon(editor.dmode.fieldIcon); + break; + case CompletionCandidate.LOCAL_METHOD: + case CompletionCandidate.PREDEF_METHOD: + label.setIcon(editor.dmode.methodIcon); + break; + case CompletionCandidate.LOCAL_CLASS: + case CompletionCandidate.PREDEF_CLASS: + label.setIcon(editor.dmode.classIcon); + break; + + default: + log("(CustomListRenderer)Unknown CompletionCandidate type " + cc.getType()); + break; + } + + } + else + log("(CustomListRenderer)Unknown CompletionCandidate object " + value); + + return label; + } + } + +} \ No newline at end of file diff --git a/pdex/src/processing/mode/experimental/DebugBuild.java b/pdex/src/processing/mode/experimental/DebugBuild.java new file mode 100755 index 000000000..fdb9b34e3 --- /dev/null +++ b/pdex/src/processing/mode/experimental/DebugBuild.java @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2012 Martin Leopold + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +import java.io.File; +import processing.app.Sketch; +import processing.app.SketchException; +import processing.mode.java.JavaBuild; + +/** + * Copied from processing.mode.java.JavaBuild, just changed compiler. + * + * @author Martin Leopold + */ +public class DebugBuild extends JavaBuild { + + public DebugBuild(Sketch sketch) { + super(sketch); + } + + /** + * Preprocess and compile sketch. Copied from + * processing.mode.java.JavaBuild, just changed compiler. + * + * @param srcFolder + * @param binFolder + * @param sizeWarning + * @return main class name or null on compile failure + * @throws SketchException + */ + @Override + public String build(File srcFolder, File binFolder, boolean sizeWarning) throws SketchException { + this.srcFolder = srcFolder; + this.binFolder = binFolder; + +// Base.openFolder(srcFolder); +// Base.openFolder(binFolder); + + // run the preprocessor + String classNameFound = preprocess(srcFolder, sizeWarning); + + // compile the program. errors will happen as a RunnerException + // that will bubble up to whomever called build(). +// Compiler compiler = new Compiler(this); +// String bootClasses = System.getProperty("sun.boot.class.path"); +// if (compiler.compile(this, srcFolder, binFolder, primaryClassName, getClassPath(), bootClasses)) { + + if (Compiler.compile(this)) { // use compiler with debug info enabled (-g switch flicked) + sketchClassName = classNameFound; + return classNameFound; + } + return null; + } + + public ExperimentalMode getMode() { + return (ExperimentalMode)mode; + } +} diff --git a/pdex/src/processing/mode/experimental/DebugEditor.java b/pdex/src/processing/mode/experimental/DebugEditor.java new file mode 100755 index 000000000..861806ada --- /dev/null +++ b/pdex/src/processing/mode/experimental/DebugEditor.java @@ -0,0 +1,2173 @@ +/* + * Copyright (C) 2012-14 Martin Leopold and Manindra Moharana + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; +import static processing.mode.experimental.ExperimentalMode.log; +import static processing.mode.experimental.ExperimentalMode.logE; +import galsasson.mode.tweak.ColorControlBox; +import galsasson.mode.tweak.Handle; +import galsasson.mode.tweak.SketchParser; + +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Container; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Frame; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.awt.event.WindowEvent; +import java.awt.event.WindowFocusListener; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JCheckBoxMenuItem; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; +import javax.swing.border.EtchedBorder; +import javax.swing.table.TableModel; +import javax.swing.text.Document; + +import org.eclipse.jdt.core.compiler.IProblem; + +import processing.app.Base; +import processing.app.EditorState; +import processing.app.EditorToolbar; +import processing.app.Mode; +import processing.app.Sketch; +import processing.app.SketchCode; +import processing.app.Toolkit; +import processing.app.syntax.JEditTextArea; +import processing.app.syntax.PdeTextAreaDefaults; +import processing.core.PApplet; +import processing.mode.java.JavaEditor; + +/** + * Main View Class. Handles the editor window including tool bar and menu. Has + * access to the Sketch. Provides line highlighting (for breakpoints and the + * debuggers current line). + * + * @author Martin Leopold + * @author Manindra Moharana <me@mkmoharana.com> + * + * + */ +public class DebugEditor extends JavaEditor implements ActionListener { + // important fields from superclass + //protected Sketch sketch; + //private JMenu fileMenu; + //protected EditorToolbar toolbar; + + // highlighting + protected Color breakpointColor = new Color(240, 240, 240); // the background color for highlighting lines + protected Color currentLineColor = new Color(255, 255, 150); // the background color for highlighting lines + protected Color breakpointMarkerColor = new Color(74, 84, 94); // the color of breakpoint gutter markers + protected Color currentLineMarkerColor = new Color(226, 117, 0); // the color of current line gutter markers + protected List breakpointedLines = new ArrayList(); // breakpointed lines + protected LineHighlight currentLine; // line the debugger is currently suspended at + protected final String breakpointMarkerComment = " //<>//"; // breakpoint marker comment + // menus + protected JMenu debugMenu; // the debug menu + // debugger control + protected JMenuItem debugMenuItem; + protected JMenuItem continueMenuItem; + protected JMenuItem stopMenuItem; + // breakpoints + protected JMenuItem toggleBreakpointMenuItem; + protected JMenuItem listBreakpointsMenuItem; + // stepping + protected JMenuItem stepOverMenuItem; + protected JMenuItem stepIntoMenuItem; + protected JMenuItem stepOutMenuItem; + // info + protected JMenuItem printStackTraceMenuItem; + protected JMenuItem printLocalsMenuItem; + protected JMenuItem printThisMenuItem; + protected JMenuItem printSourceMenuItem; + protected JMenuItem printThreads; + // variable inspector + protected JMenuItem toggleVariableInspectorMenuItem; + // references + protected ExperimentalMode dmode; // the mode + protected Debugger dbg; // the debugger + protected VariableInspector vi; // the variable inspector frame + protected TextArea ta; // the text area + + + protected ErrorBar errorBar; + /** + * Show Console button + */ + protected XQConsoleToggle btnShowConsole; + + /** + * Show Problems button + */ + protected XQConsoleToggle btnShowErrors; + + /** + * Scroll pane for Error Table + */ + protected JScrollPane errorTableScrollPane; + + /** + * Panel with card layout which contains the p5 console and Error Table + * panes + */ + protected JPanel consoleProblemsPane; + + protected XQErrorTable errorTable; + + /** + * Enable/Disable compilation checking + */ + protected boolean compilationCheckEnabled = true; + + /** + * Show warnings menu item + */ + protected JCheckBoxMenuItem showWarnings; + + /** + * Check box menu item for show/hide Problem Window + */ + public JCheckBoxMenuItem problemWindowMenuCB; + + /** + * Enable/Disable debug ouput + */ + protected JCheckBoxMenuItem debugMessagesEnabled; + + /** + * Show outline view + */ + protected JMenuItem showOutline, showTabOutline; + + /** + * Enable/Disable error logging + */ + protected JCheckBoxMenuItem writeErrorLog; + + /** + * Enable/Disable code completion + */ + protected JCheckBoxMenuItem completionsEnabled; + + /** + * If sketch contains java tabs, some editor features are disabled + */ + protected boolean hasJavaTabs; + + /** + * UNUSED. Disbaled for now. + */ + protected AutoSaveUtil autosaver; + + public DebugEditor(Base base, String path, EditorState state, Mode mode) { + super(base, path, state, mode); + + // get mode + dmode = (ExperimentalMode) mode; + + // init controller class + dbg = new Debugger(this); + + // variable inspector window + vi = new VariableInspector(this); + + // access to customized (i.e. subclassed) text area + ta = (TextArea) textarea; + + // Add show usage option + JMenuItem showUsageItem = new JMenuItem("Show Usage.."); + showUsageItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + handleShowUsage(); + } + }); + ta.getRightClickPopup().add(showUsageItem); + + // add refactor option + JMenuItem renameItem = new JMenuItem("Rename.."); + renameItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + handleRefactor(); + } + }); + + // TODO: Add support for word select on right click and rename. +// ta.customPainter.addMouseListener(new MouseAdapter() { +// public void mouseClicked(MouseEvent evt) { +// System.out.println(evt); +// } +// }); + ta.getRightClickPopup().add(renameItem); + // set action on frame close +// addWindowListener(new WindowAdapter() { +// @Override +// public void windowClosing(WindowEvent e) { +// onWindowClosing(e); +// } +// }); + + // load settings from theme.txt + ExperimentalMode theme = dmode; + breakpointColor = theme.getThemeColor("breakpoint.bgcolor", breakpointColor); + breakpointMarkerColor = theme.getThemeColor("breakpoint.marker.color", breakpointMarkerColor); + currentLineColor = theme.getThemeColor("currentline.bgcolor", currentLineColor); + currentLineMarkerColor = theme.getThemeColor("currentline.marker.color", currentLineMarkerColor); + + // set breakpoints from marker comments + for (LineID lineID : stripBreakpointComments()) { + //System.out.println("setting: " + lineID); + dbg.setBreakpoint(lineID); + } + getSketch().setModified(false); // setting breakpoints will flag sketch as modified, so override this here + + checkForJavaTabs(); + initializeErrorChecker(); + ta.setECSandThemeforTextArea(errorCheckerService, dmode); + addXQModeUI(); + debugToolbarEnabled = new AtomicBoolean(false); + //log("Sketch Path: " + path); + + // TweakMode code + + // random port for OSC (0xff0 - 0xfff0) + oscPort = (int)(Math.random()*0xf000) + 0xff0; + } + + private void addXQModeUI(){ + + // Adding ErrorBar + JPanel textAndError = new JPanel(); + Box box = (Box) textarea.getParent(); + box.remove(2); // Remove textArea from it's container, i.e Box + textAndError.setLayout(new BorderLayout()); + errorBar = new ErrorBar(this, textarea.getMinimumSize().height, dmode); + textAndError.add(errorBar, BorderLayout.EAST); + textarea.setBounds(0, 0, errorBar.getX() - 1, textarea.getHeight()); + textAndError.add(textarea); + box.add(textAndError); + + // Adding Error Table in a scroll pane + errorTableScrollPane = new JScrollPane(); + errorTable = new XQErrorTable(errorCheckerService); + // errorTableScrollPane.setBorder(new EmptyBorder(2, 2, 2, 2)); + errorTableScrollPane.setBorder(new EtchedBorder()); + errorTableScrollPane.setViewportView(errorTable); + + // Adding toggle console button + consolePanel.remove(2); + JPanel lineStatusPanel = new JPanel(); + lineStatusPanel.setLayout(new BorderLayout()); + btnShowConsole = new XQConsoleToggle(this, + XQConsoleToggle.CONSOLE, lineStatus.getHeight()); + btnShowErrors = new XQConsoleToggle(this, + XQConsoleToggle.ERRORSLIST, lineStatus.getHeight()); + btnShowConsole.addMouseListener(btnShowConsole); + + // lineStatusPanel.add(btnShowConsole, BorderLayout.EAST); + // lineStatusPanel.add(btnShowErrors); + btnShowErrors.addMouseListener(btnShowErrors); + + JPanel toggleButtonPanel = new JPanel(new BorderLayout()); + toggleButtonPanel.add(btnShowConsole, BorderLayout.EAST); + toggleButtonPanel.add(btnShowErrors, BorderLayout.WEST); + lineStatusPanel.add(toggleButtonPanel, BorderLayout.EAST); + lineStatus.setBounds(0, 0, toggleButtonPanel.getX() - 1, + toggleButtonPanel.getHeight()); + lineStatusPanel.add(lineStatus); + consolePanel.add(lineStatusPanel, BorderLayout.SOUTH); + lineStatusPanel.repaint(); + + // Adding JPanel with CardLayout for Console/Problems Toggle + consolePanel.remove(1); + consoleProblemsPane = new JPanel(new CardLayout()); + consoleProblemsPane.add(errorTableScrollPane, XQConsoleToggle.ERRORSLIST); + consoleProblemsPane.add(console, XQConsoleToggle.CONSOLE); + consolePanel.add(consoleProblemsPane, BorderLayout.CENTER); + + // ensure completion gets hidden on editor losing focus + addWindowFocusListener(new WindowFocusListener() { + public void windowLostFocus(WindowEvent e) { + ta.hideSuggestion(); + } + public void windowGainedFocus(WindowEvent e) { + + } + }); + } + +// /** +// * Event handler called when closing the editor window. Kills the variable +// * inspector window. +// * +// * @param e the event object +// */ +// protected void onWindowClosing(WindowEvent e) { +// // remove var.inspector +// vi.dispose(); +// // quit running debug session +// dbg.stopDebug(); +// } + /** + * Used instead of the windowClosing event handler, since it's not called on + * mode switch. Called when closing the editor window. Stops running debug + * sessions and kills the variable inspector window. + */ + @Override + public void dispose() { + //System.out.println("window dispose"); + // quit running debug session + dbg.stopDebug(); + // remove var.inspector + vi.dispose(); + errorCheckerService.stopThread(); + // original dispose + super.dispose(); + } + + // Added temporarily to dump error log. TODO: Remove this later + public void internalCloseRunner(){ + if(ExperimentalMode.errorLogsEnabled) writeErrorsToFile(); +// if(autosaver != null && !viewingAutosaveBackup) { +// log("stopping autosaver in internalCloseRunner"); +// autosaver.stop(); +// } + super.internalCloseRunner(); + } + + /** + * Writes all error messages to a csv file. + * For analytics purposes only. + */ + private void writeErrorsToFile(){ + if (errorCheckerService.tempErrorLog.size() == 0) + return; + try { + System.out.println("Writing errors"); + StringBuffer sbuff = new StringBuffer(); + sbuff.append("Sketch: " + getSketch().getFolder() + ", " + + new java.sql.Timestamp(new java.util.Date().getTime()) + + "\nComma in error msg is substituted with ^ symbol\nFor separating arguments in error args | symbol is used\n"); + sbuff.append("ERROR TYPE, ERROR ARGS, ERROR MSG\n"); + for (String errMsg : errorCheckerService.tempErrorLog.keySet()) { + IProblem ip = errorCheckerService.tempErrorLog.get(errMsg); + if(ip != null){ + sbuff.append(ErrorMessageSimplifier.getIDName(ip.getID())); + sbuff.append(','); + sbuff.append("{"); + for (int i = 0; i < ip.getArguments().length; i++) { + sbuff.append(ip.getArguments()[i]); + if(i < ip.getArguments().length - 1) + sbuff.append("| "); + } + sbuff.append("}"); + sbuff.append(','); + sbuff.append(ip.getMessage().replace(',', '^')); + sbuff.append("\n"); + } + } + System.out.println(sbuff); + File opFile = new File(getSketch().getFolder(), "ErrorLogs" + + File.separator + "ErrorLog_" + System.currentTimeMillis() + ".csv"); + PApplet.saveStream(opFile, new ByteArrayInputStream(sbuff.toString() + .getBytes(Charset.defaultCharset()))); + } catch (Exception e) { + System.err.println("Failed to save log file for sketch " + getSketch().getName()); + e.printStackTrace(); + } + } + + /** + * Overrides sketch menu creation to change keyboard shortcuts from "Run". + * + * @return the sketch menu + */ + /*@Override + public JMenu buildSketchMenu() { + JMenuItem runItem = Toolkit.newJMenuItemShift(DebugToolbar.getTitle(DebugToolbar.RUN, false), KeyEvent.VK_R); + runItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + handleRun(); + } + }); + + JMenuItem presentItem = new JMenuItem(DebugToolbar.getTitle(DebugToolbar.RUN, true)); + presentItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + handlePresent(); + } + }); + + JMenuItem stopItem = new JMenuItem(DebugToolbar.getTitle(DebugToolbar.STOP, false)); + stopItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + handleStop(); + } + }); + return buildSketchMenu(new JMenuItem[]{runItem, presentItem, stopItem}); + }*/ + + /** + * Whether debug toolbar is enabled + */ + AtomicBoolean debugToolbarEnabled; + + protected EditorToolbar javaToolbar, debugToolbar; + + /** + * Toggles between java mode and debug mode toolbar + */ + protected void switchToolbars(){ + final EditorToolbar nextToolbar; + if(debugToolbarEnabled.get()){ + // switch to java + if(javaToolbar == null) + javaToolbar = createToolbar(); + nextToolbar = javaToolbar; + debugToolbarEnabled.set(false); + log("Switching to Java Mode Toolbar"); + } + else{ + // switch to debug + if(debugToolbar == null) + debugToolbar = new DebugToolbar(this, getBase()); + nextToolbar = debugToolbar; + debugToolbarEnabled.set(true); + log("Switching to Debugger Toolbar"); + } + + SwingUtilities.invokeLater(new Runnable() { + public void run() { + Box upper = (Box)splitPane.getComponent(0); + upper.remove(0); + upper.add(nextToolbar, 0); + upper.validate(); + nextToolbar.repaint(); + toolbar = nextToolbar; + // The toolbar responds to shift down/up events + // in order to show the alt version of toolbar buttons. + // With toolbar switch, KeyListener has to be changed as well + for (KeyListener kl : textarea.getKeyListeners()) { + if(kl instanceof EditorToolbar) + { + textarea.removeKeyListener(kl); + textarea.addKeyListener(toolbar); + break; + } + } + ta.repaint(); + } + }); + } + + /** + * Creates the debug menu. Includes ActionListeners for the menu items. + * Intended for adding to the menu bar. + * + * @return The debug menu + */ + protected JMenu buildDebugMenu() { + debugMenu = new JMenu("Debug"); + //debugMenu = new JMenu("PDE X"); + + JCheckBoxMenuItem toggleDebugger = new JCheckBoxMenuItem("Show Debug Toolbar"); + toggleDebugger.setSelected(false); + toggleDebugger.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + switchToolbars(); + } + }); + debugMenu.add(toggleDebugger); + debugMenuItem = Toolkit.newJMenuItemAlt("Debug", KeyEvent.VK_R); + debugMenuItem.addActionListener(this); + continueMenuItem = Toolkit.newJMenuItem("Continue", KeyEvent.VK_U); + continueMenuItem.addActionListener(this); + stopMenuItem = new JMenuItem("Stop"); + stopMenuItem.addActionListener(this); + + toggleBreakpointMenuItem = Toolkit.newJMenuItem("Toggle Breakpoint", KeyEvent.VK_B); + toggleBreakpointMenuItem.addActionListener(this); + listBreakpointsMenuItem = new JMenuItem("List Breakpoints"); + listBreakpointsMenuItem.addActionListener(this); + + stepOverMenuItem = Toolkit.newJMenuItem("Step", KeyEvent.VK_H); + stepOverMenuItem.addActionListener(this); + stepIntoMenuItem = Toolkit.newJMenuItemShift("Step Into", KeyEvent.VK_H); + stepIntoMenuItem.addActionListener(this); + stepOutMenuItem = Toolkit.newJMenuItemAlt("Step Out", KeyEvent.VK_H); + stepOutMenuItem.addActionListener(this); + + printStackTraceMenuItem = new JMenuItem("Print Stack Trace"); + printStackTraceMenuItem.addActionListener(this); + printLocalsMenuItem = new JMenuItem("Print Locals"); + printLocalsMenuItem.addActionListener(this); + printThisMenuItem = new JMenuItem("Print Fields"); + printThisMenuItem.addActionListener(this); + printSourceMenuItem = new JMenuItem("Print Source Location"); + printSourceMenuItem.addActionListener(this); + printThreads = new JMenuItem("Print Threads"); + printThreads.addActionListener(this); + + toggleVariableInspectorMenuItem = Toolkit.newJMenuItem("Toggle Variable Inspector", KeyEvent.VK_I); + toggleVariableInspectorMenuItem.addActionListener(this); + + debugMenu.add(debugMenuItem); + debugMenu.add(continueMenuItem); + debugMenu.add(stopMenuItem); + debugMenu.addSeparator(); + debugMenu.add(toggleBreakpointMenuItem); + debugMenu.add(listBreakpointsMenuItem); + debugMenu.addSeparator(); + debugMenu.add(stepOverMenuItem); + debugMenu.add(stepIntoMenuItem); + debugMenu.add(stepOutMenuItem); + debugMenu.addSeparator(); + debugMenu.add(printStackTraceMenuItem); + debugMenu.add(printLocalsMenuItem); + debugMenu.add(printThisMenuItem); + debugMenu.add(printSourceMenuItem); + debugMenu.add(printThreads); + debugMenu.addSeparator(); + debugMenu.add(toggleVariableInspectorMenuItem); + // debugMenu.addSeparator(); + + // XQMode menu items + /* + JCheckBoxMenuItem item; + item = new JCheckBoxMenuItem("Error Checker Enabled"); + item.setSelected(ExperimentalMode.errorCheckEnabled); + item.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + ExperimentalMode.errorCheckEnabled = ((JCheckBoxMenuItem) e.getSource()).isSelected(); + errorCheckerService.handleErrorCheckingToggle(); + dmode.savePreferences(); + } + }); + debugMenu.add(item); + + problemWindowMenuCB = new JCheckBoxMenuItem("Show Problem Window"); + // problemWindowMenuCB.setSelected(true); + problemWindowMenuCB.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + if (errorCheckerService.errorWindow == null) { + return; + } + errorCheckerService.errorWindow + .setVisible(((JCheckBoxMenuItem) e.getSource()) + .isSelected()); + // switch to console, now that Error Window is open + showProblemListView(XQConsoleToggle.CONSOLE); + } + }); + debugMenu.add(problemWindowMenuCB); + + showWarnings = new JCheckBoxMenuItem("Warnings Enabled"); + showWarnings.setSelected(ExperimentalMode.warningsEnabled); + showWarnings.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + ExperimentalMode.warningsEnabled = ((JCheckBoxMenuItem) e + .getSource()).isSelected(); + errorCheckerService.runManualErrorCheck(); + dmode.savePreferences(); + } + }); + debugMenu.add(showWarnings); + + completionsEnabled = new JCheckBoxMenuItem("Code Completion Enabled"); + completionsEnabled.setSelected(ExperimentalMode.codeCompletionsEnabled); + completionsEnabled.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + ExperimentalMode.codeCompletionsEnabled = (((JCheckBoxMenuItem) e + .getSource()).isSelected()); + dmode.savePreferences(); + } + }); + debugMenu.add(completionsEnabled); + + debugMessagesEnabled = new JCheckBoxMenuItem("Show Debug Messages"); + debugMessagesEnabled.setSelected(ExperimentalMode.DEBUG); + debugMessagesEnabled.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + ExperimentalMode.DEBUG = ((JCheckBoxMenuItem) e + .getSource()).isSelected(); + dmode.savePreferences(); + } + }); + debugMenu.add(debugMessagesEnabled); + + + writeErrorLog = new JCheckBoxMenuItem("Write Errors to Log"); + writeErrorLog.setSelected(ExperimentalMode.errorLogsEnabled); + writeErrorLog.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + ExperimentalMode.errorLogsEnabled = ((JCheckBoxMenuItem) e + .getSource()).isSelected(); + dmode.savePreferences(); + } + }); + debugMenu.add(writeErrorLog); + + debugMenu.addSeparator(); + JMenuItem jitem = new JMenuItem("PDE X on GitHub"); + jitem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + Base.openURL("https://github.com/processing/processing-experimental"); + } + }); + debugMenu.add(jitem); + */ + showOutline = Toolkit.newJMenuItem("Show Sketch Outline", KeyEvent.VK_L); + showOutline.addActionListener(this); + debugMenu.add(showOutline); + + showTabOutline = Toolkit.newJMenuItem("Show Tabs List", KeyEvent.VK_Y); + showTabOutline.addActionListener(this); + debugMenu.add(showTabOutline); + + + return debugMenu; + } + + @Override + public JMenu buildModeMenu() { + return buildDebugMenu(); + } + + public JMenu buildSketchMenu() { + JMenuItem runItem = Toolkit.newJMenuItem(DebugToolbar + .getTitle(DebugToolbar.RUN, false), 'R'); + runItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + handleRun(); + } + }); + + JMenuItem presentItem = Toolkit.newJMenuItemShift(DebugToolbar + .getTitle(DebugToolbar.RUN, true), 'R'); + presentItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + handlePresent(); + } + }); + + JMenuItem stopItem = new JMenuItem(DebugToolbar.getTitle(DebugToolbar.STOP, + false)); + stopItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + handleStop(); + } + }); + + JMenuItem enableTweak = Toolkit.newJMenuItemShift("Tweak", 'T'); + enableTweak.setSelected(ExperimentalMode.enableTweak); + enableTweak.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + ExperimentalMode.enableTweak = true; + handleRun(); + } + }); + + return buildSketchMenu(new JMenuItem[] { + runItem, presentItem, enableTweak, stopItem }); + } + + /** + * Callback for menu items. Implementation of Swing ActionListener. + * + * @param ae Action event + */ + @Override + public void actionPerformed(ActionEvent ae) { + //System.out.println("ActionEvent: " + ae.toString()); + + JMenuItem source = (JMenuItem) ae.getSource(); + if (source == debugMenuItem) { + Logger.getLogger(DebugEditor.class.getName()).log(Level.INFO, "Invoked 'Debug' menu item"); + //dmode.handleDebug(sketch, this); + dbg.startDebug(); + } else if (source == stopMenuItem) { + Logger.getLogger(DebugEditor.class.getName()).log(Level.INFO, "Invoked 'Stop' menu item"); + //dmode.handleDebug(sketch, this); + dbg.stopDebug(); + } else if (source == continueMenuItem) { + Logger.getLogger(DebugEditor.class.getName()).log(Level.INFO, "Invoked 'Continue' menu item"); + //dmode.handleDebug(sketch, this); + dbg.continueDebug(); + } else if (source == stepOverMenuItem) { + Logger.getLogger(DebugEditor.class.getName()).log(Level.INFO, "Invoked 'Step Over' menu item"); + dbg.stepOver(); + } else if (source == stepIntoMenuItem) { + Logger.getLogger(DebugEditor.class.getName()).log(Level.INFO, "Invoked 'Step Into' menu item"); + dbg.stepInto(); + } else if (source == stepOutMenuItem) { + Logger.getLogger(DebugEditor.class.getName()).log(Level.INFO, "Invoked 'Step Out' menu item"); + dbg.stepOut(); + } else if (source == printStackTraceMenuItem) { + Logger.getLogger(DebugEditor.class.getName()).log(Level.INFO, "Invoked 'Print Stack Trace' menu item"); + dbg.printStackTrace(); + } else if (source == printLocalsMenuItem) { + Logger.getLogger(DebugEditor.class.getName()).log(Level.INFO, "Invoked 'Print Locals' menu item"); + dbg.printLocals(); + } else if (source == printThisMenuItem) { + Logger.getLogger(DebugEditor.class.getName()).log(Level.INFO, "Invoked 'Print This' menu item"); + dbg.printThis(); + } else if (source == printSourceMenuItem) { + Logger.getLogger(DebugEditor.class.getName()).log(Level.INFO, "Invoked 'Print Source' menu item"); + dbg.printSource(); + } else if (source == printThreads) { + Logger.getLogger(DebugEditor.class.getName()).log(Level.INFO, "Invoked 'Print Threads' menu item"); + dbg.printThreads(); + } else if (source == toggleBreakpointMenuItem) { + Logger.getLogger(DebugEditor.class.getName()).log(Level.INFO, "Invoked 'Toggle Breakpoint' menu item"); + dbg.toggleBreakpoint(); + } else if (source == listBreakpointsMenuItem) { + Logger.getLogger(DebugEditor.class.getName()).log(Level.INFO, "Invoked 'List Breakpoints' menu item"); + dbg.listBreakpoints(); + } else if (source == toggleVariableInspectorMenuItem) { + Logger.getLogger(DebugEditor.class.getName()).log(Level.INFO, "Invoked 'Toggle Variable Inspector' menu item"); + toggleVariableInspector(); + } else if (source.equals(showOutline)){ + log("Show Sketch Outline:"); + errorCheckerService.getASTGenerator().showSketchOutline(); + } + else if (source.equals(showTabOutline)){ + log("Show Tab Outline:"); + errorCheckerService.getASTGenerator().showTabOutline(); + } + } + +// @Override +// public void handleRun() { +// dbg.continueDebug(); +// } + /** + * Event handler called when hitting the stop button. Stops a running debug + * session or performs standard stop action if not currently debugging. + */ + @Override + public void handleStop() { + if (dbg.isStarted()) { + dbg.stopDebug(); + } else { + super.handleStop(); + } + } + + /** + * Event handler called when loading another sketch in this editor. Clears + * breakpoints of previous sketch. + * + * @param path + * @return true if a sketch was opened, false if aborted + */ + @Override + protected boolean handleOpenInternal(String path) { + // log("handleOpenInternal, path: " + path); + boolean didOpen = super.handleOpenInternal(path); + if (didOpen && dbg != null) { + // should already been stopped (open calls handleStop) + dbg.clearBreakpoints(); + clearBreakpointedLines(); // force clear breakpoint highlights + variableInspector().reset(); // clear contents of variable inspector + } + //if(didOpen){ + // autosaver = new AutoSaveUtil(this, ExperimentalMode.autoSaveInterval); // this is used instead of loadAutosaver(), temp measure + // loadAutoSaver(); + // viewingAutosaveBackup = autosaver.isAutoSaveBackup(); + // log("handleOpenInternal, viewing autosave? " + viewingAutosaveBackup); + //} + return didOpen; + } + + /** + * Extract breakpointed lines from source code marker comments. This removes + * marker comments from the editor text. Intended to be called on loading a + * sketch, since re-setting the sketches contents after removing the markers + * will clear all breakpoints. + * + * @return the list of {@link LineID}s where breakpoint marker comments were + * removed from. + */ + protected List stripBreakpointComments() { + List bps = new ArrayList(); + // iterate over all tabs + Sketch sketch = getSketch(); + for (int i = 0; i < sketch.getCodeCount(); i++) { + SketchCode tab = sketch.getCode(i); + String code = tab.getProgram(); + String lines[] = code.split("\\r?\\n"); // newlines not included + //System.out.println(code); + + // scan code for breakpoint comments + int lineIdx = 0; + for (String line : lines) { + //System.out.println(line); + if (line.endsWith(breakpointMarkerComment)) { + LineID lineID = new LineID(tab.getFileName(), lineIdx); + bps.add(lineID); + //System.out.println("found breakpoint: " + lineID); + // got a breakpoint + //dbg.setBreakpoint(lineID); + int index = line.lastIndexOf(breakpointMarkerComment); + lines[lineIdx] = line.substring(0, index); + } + lineIdx++; + } + //tab.setProgram(code); + code = PApplet.join(lines, "\n"); + setTabContents(tab.getFileName(), code); + } + return bps; + } + + /** + * Add breakpoint marker comments to the source file of a specific tab. This + * acts on the source file on disk, not the editor text. Intended to be + * called just after saving the sketch. + * + * @param tabFilename the tab file name + */ + protected void addBreakpointComments(String tabFilename) { + SketchCode tab = getTab(tabFilename); + if(tab == null) { + // this method gets called twice when saving sketch for the first time + // once with new name and another with old(causing NPE). Keep an eye out + // for potential issues. See #2675. TODO: + logE("Illegal tab name to addBreakpointComments() " + tabFilename); + return; + } + List bps = dbg.getBreakpoints(tab.getFileName()); + + // load the source file + File sourceFile = new File(sketch.getFolder(), tab.getFileName()); + //System.out.println("file: " + sourceFile); + try { + String code = Base.loadFile(sourceFile); + //System.out.println("code: " + code); + String lines[] = code.split("\\r?\\n"); // newlines not included + for (LineBreakpoint bp : bps) { + //System.out.println("adding bp: " + bp.lineID()); + lines[bp.lineID().lineIdx()] += breakpointMarkerComment; + } + code = PApplet.join(lines, "\n"); + //System.out.println("new code: " + code); + Base.saveFile(code, sourceFile); + } catch (IOException ex) { + Logger.getLogger(DebugEditor.class.getName()).log(Level.SEVERE, null, ex); + } + } + + @Override + public boolean handleSave(boolean immediately) { + //System.out.println("handleSave " + immediately); + + //log("handleSave, viewing autosave? " + viewingAutosaveBackup); + /* If user wants to save a backup, the backup sketch should get + * copied to the main sketch directory, simply reload the main sketch. + */ + if(viewingAutosaveBackup){ + /* + File files[] = autosaver.getSketchBackupFolder().listFiles(); + File src = autosaver.getSketchBackupFolder(), dst = autosaver + .getActualSketchFolder(); + for (File f : files) { + log("Copying " + f.getAbsolutePath() + " to " + dst.getAbsolutePath()); + try { + if (f.isFile()) { + f.delete(); + Base.copyFile(f, new File(dst + File.separator + f.getName())); + } else { + Base.removeDir(f); + Base.copyDir(f, new File(dst + File.separator + f.getName())); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + File sk = autosaver.getActualSketchFolder(); + Base.removeDir(autosaver.getAutoSaveDir()); + //handleOpenInternal(sk.getAbsolutePath() + File.separator + sk.getName() + ".pde"); + getBase().handleOpen(sk.getAbsolutePath() + File.separator + sk.getName() + ".pde"); + //viewingAutosaveBackup = false; + */ + } + + // note modified tabs + final List modified = new ArrayList(); + for (int i = 0; i < getSketch().getCodeCount(); i++) { + SketchCode tab = getSketch().getCode(i); + if (tab.isModified()) { + modified.add(tab.getFileName()); + } + } + + boolean saved = super.handleSave(immediately); + if (saved) { + if (immediately) { + for (String tabFilename : modified) { + addBreakpointComments(tabFilename); + } + } else { + EventQueue.invokeLater(new Runnable() { + @Override + public void run() { + for (String tabFilename : modified) { + addBreakpointComments(tabFilename); + } + } + }); + } + } + // if file location has changed, update autosaver + // autosaver.reloadAutosaveDir(); + return saved; + } + + @Override + public boolean handleSaveAs() { + //System.out.println("handleSaveAs"); + String oldName = getSketch().getCode(0).getFileName(); + //System.out.println("old name: " + oldName); + boolean saved = super.handleSaveAs(); + if (saved) { + // re-set breakpoints in first tab (name has changed) + List bps = dbg.getBreakpoints(oldName); + dbg.clearBreakpoints(oldName); + String newName = getSketch().getCode(0).getFileName(); + //System.out.println("new name: " + newName); + for (LineBreakpoint bp : bps) { + LineID line = new LineID(newName, bp.lineID().lineIdx()); + //System.out.println("setting: " + line); + dbg.setBreakpoint(line); + } + // add breakpoint marker comments to source file + for (int i = 0; i < getSketch().getCodeCount(); i++) { + addBreakpointComments(getSketch().getCode(i).getFileName()); + } + + // set new name of variable inspector + vi.setTitle(getSketch().getName()); + } + // if file location has changed, update autosaver +// autosaver.reloadAutosaveDir(); + return saved; + } + + private boolean viewingAutosaveBackup; + + /** + * Loads and starts the auto save service + * Also handles the case where an auto save backup is found. + * The user is asked to save the sketch to a new location + */ + private void loadAutoSaver(){ + log("Load Auto Saver()"); + autosaver = new AutoSaveUtil(this, ExperimentalMode.autoSaveInterval); + if(!autosaver.checkForPastSave()) { + autosaver.init(); + return; + } + File pastSave = autosaver.getPastSave(); + int response = Base + .showYesNoQuestion(this, + "Unsaved backup found!", + "An automatic backup of \"" + + pastSave.getParentFile().getName() + + "\" sketch has been found. This may mean Processing " + + "was closed unexpectedly last time.", + "Select YES to view it or NO to delete the backup."); + if(response == JOptionPane.YES_OPTION){ + handleOpenInternal(pastSave.getAbsolutePath()); + // Base.showMessage("Save it..", "Remember to save the backup sketch to a specific location if you want to."); + //log(getSketch().getMainFilePath()); + log("loadAutoSaver, viewing autosave? " + viewingAutosaveBackup); + return; + } + else{ + autosaver.init(); + } + } + + /** + * Set text contents of a specific tab. Updates underlying document and text + * area. Clears Breakpoints. + * + * @param tabFilename the tab file name + * @param code the text to set + */ + protected void setTabContents(String tabFilename, String code) { + // remove all breakpoints of this tab + dbg.clearBreakpoints(tabFilename); + + SketchCode currentTab = getCurrentTab(); + + // set code of tab + SketchCode tab = getTab(tabFilename); + if (tab != null) { + tab.setProgram(code); + // this updates document and text area + // TODO: does this have any negative effects? (setting the doc to null) + tab.setDocument(null); + setCode(tab); + + // switch back to original tab + setCode(currentTab); + } + } + + /** + * Clear the console. + */ + public void clearConsole() { + console.clear(); + } + + /** + * Clear current text selection. + */ + public void clearSelection() { + setSelection(getCaretOffset(), getCaretOffset()); + } + + /** + * Select a line in the current tab. + * + * @param lineIdx 0-based line number + */ + public void selectLine(int lineIdx) { + setSelection(getLineStartOffset(lineIdx), getLineStopOffset(lineIdx)); + } + + /** + * Set the cursor to the start of a line. + * + * @param lineIdx 0-based line number + */ + public void cursorToLineStart(int lineIdx) { + setSelection(getLineStartOffset(lineIdx), getLineStartOffset(lineIdx)); + } + + /** + * Set the cursor to the end of a line. + * + * @param lineIdx 0-based line number + */ + public void cursorToLineEnd(int lineIdx) { + setSelection(getLineStopOffset(lineIdx), getLineStopOffset(lineIdx)); + } + + /** + * Switch to a tab. + * + * @param tabFileName the file name identifying the tab. (as in + * {@link SketchCode#getFileName()}) + */ + public void switchToTab(String tabFileName) { + Sketch s = getSketch(); + for (int i = 0; i < s.getCodeCount(); i++) { + if (tabFileName.equals(s.getCode(i).getFileName())) { + s.setCurrentCode(i); + break; + } + } + } + + /** + * Access the debugger. + * + * @return the debugger controller object + */ + public Debugger dbg() { + return dbg; + } + + /** + * Access the mode. + * + * @return the mode object + */ + public ExperimentalMode mode() { + return dmode; + } + + /** + * Access the custom text area object. + * + * @return the text area object + */ + public TextArea textArea() { + return ta; + } + + + /** + * Grab current contents of the sketch window, advance the console, stop any + * other running sketches, auto-save the user's code... not in that order. + */ + @Override + public void prepareRun() { + autoSave(); + super.prepareRun(); + } + + /** + * Displays a JDialog prompting the user to save when the user hits + * run/present/etc. + */ + protected void autoSave() { + if (!ExperimentalMode.autoSaveEnabled) + return; + + try { + // if (sketch.isUntitled() && + // ExperimentalMode.untitledAutoSaveEnabled) { + // if (handleSave(true)) + // statusTimedNotice("Saved. Running...", 5); + // else + // statusTimedNotice("Save Canceled. Running anyway...", 5); + // } + // else + if (sketch.isModified() && !sketch.isUntitled()) { + if (ExperimentalMode.autoSavePromptEnabled) { + final JDialog autoSaveDialog = new JDialog( + base.getActiveEditor(), this.getSketch().getName(), + true); + Container container = autoSaveDialog.getContentPane(); + + JPanel panelMain = new JPanel(); + panelMain.setBorder(BorderFactory.createEmptyBorder(4, 0, + 2, 2)); + panelMain.setLayout(new BoxLayout(panelMain, + BoxLayout.PAGE_AXIS)); + + JPanel panelLabel = new JPanel(new FlowLayout( + FlowLayout.LEFT)); + JLabel label = new JLabel( + " There are unsaved" + + " changes in your sketch.
" + + "    Do you want to save it before" + + " running? "); + label.setFont(new Font(label.getFont().getName(), + Font.PLAIN, label.getFont().getSize() + 1)); + panelLabel.add(label); + panelMain.add(panelLabel); + final JCheckBox dontRedisplay = new JCheckBox( + "Remember this decision"); + + JPanel panelButtons = new JPanel(new FlowLayout( + FlowLayout.CENTER, 8, 2)); + JButton btnRunSave = new JButton("Save and Run"); + btnRunSave.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + handleSave(true); + if (dontRedisplay.isSelected()) { + ExperimentalMode.autoSavePromptEnabled = !dontRedisplay + .isSelected(); + ExperimentalMode.defaultAutoSaveEnabled = true; + dmode.savePreferences(); + } + autoSaveDialog.dispose(); + } + }); + panelButtons.add(btnRunSave); + JButton btnRunNoSave = new JButton("Run, Don't Save"); + btnRunNoSave.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + if (dontRedisplay.isSelected()) { + ExperimentalMode.autoSavePromptEnabled = !dontRedisplay + .isSelected(); + ExperimentalMode.defaultAutoSaveEnabled = false; + dmode.savePreferences(); + } + autoSaveDialog.dispose(); + } + }); + panelButtons.add(btnRunNoSave); + panelMain.add(panelButtons); + + JPanel panelCheck = new JPanel(); + panelCheck + .setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0)); + panelCheck.add(dontRedisplay); + panelMain.add(panelCheck); + + container.add(panelMain); + + autoSaveDialog.setResizable(false); + autoSaveDialog.pack(); + autoSaveDialog + .setLocationRelativeTo(base.getActiveEditor()); + autoSaveDialog.setVisible(true); + + } else if (ExperimentalMode.defaultAutoSaveEnabled) + handleSave(true); + } + } catch (Exception e) { + statusError(e); + } + + } + + /** + * Access variable inspector window. + * + * @return the variable inspector object + */ + public VariableInspector variableInspector() { + return vi; + } + + public DebugToolbar toolbar() { + if(toolbar instanceof DebugToolbar) + return (DebugToolbar) toolbar; + return null; + } + + /** + * Show the variable inspector window. + */ + public void showVariableInspector() { + vi.setVisible(true); + } + + /** + * Set visibility of the variable inspector window. + * + * @param visible true to set the variable inspector visible, false for + * invisible. + */ + public void showVariableInspector(boolean visible) { + vi.setVisible(visible); + } + + /** + * Hide the variable inspector window. + */ + public void hideVariableInspector() { + vi.setVisible(true); + } + + /** + * Toggle visibility of the variable inspector window. + */ + public void toggleVariableInspector() { + vi.setFocusableWindowState(false); // to not get focus when set visible + vi.setVisible(!vi.isVisible()); + vi.setFocusableWindowState(true); // allow to get focus again + } + + /** + * Text area factory method. Instantiates the customized TextArea. + * + * @return the customized text area object + */ + @Override + protected JEditTextArea createTextArea() { + //System.out.println("overriding creation of text area"); + return new TextArea(new PdeTextAreaDefaults(mode), this); + } + + /** + * Set the line to highlight as currently suspended at. Will override the + * breakpoint color, if set. Switches to the appropriate tab and scroll to + * the line by placing the cursor there. + * + * @param line the line to highlight as current suspended line + */ + public void setCurrentLine(LineID line) { + clearCurrentLine(); + if (line == null) { + return; // safety, e.g. when no line mapping is found and the null line is used. + } + switchToTab(line.fileName()); + // scroll to line, by setting the cursor + cursorToLineStart(line.lineIdx()); + // highlight line + currentLine = new LineHighlight(line.lineIdx(), currentLineColor, this); + currentLine.setMarker(ta.currentLineMarker, currentLineMarkerColor); + currentLine.setPriority(10); // fixes current line being hidden by the breakpoint when moved down + } + + /** + * Clear the highlight for the debuggers current line. + */ + public void clearCurrentLine() { + if (currentLine != null) { + currentLine.clear(); + currentLine.dispose(); + + // revert to breakpoint color if any is set on this line + for (LineHighlight hl : breakpointedLines) { + if (hl.lineID().equals(currentLine.lineID())) { + hl.paint(); + break; + } + } + currentLine = null; + } + } + + /** + * Add highlight for a breakpointed line. + * + * @param lineID the line id to highlight as breakpointed + */ + public void addBreakpointedLine(LineID lineID) { + LineHighlight hl = new LineHighlight(lineID, breakpointColor, this); + hl.setMarker(ta.breakpointMarker, breakpointMarkerColor); + breakpointedLines.add(hl); + // repaint current line if it's on this line + if (currentLine != null && currentLine.lineID().equals(lineID)) { + currentLine.paint(); + } + } + + /** + * Add highlight for a breakpointed line on the current tab. + * + * @param lineIdx the line index on the current tab to highlight as + * breakpointed + */ + //TODO: remove and replace by {@link #addBreakpointedLine(LineID lineID)} + public void addBreakpointedLine(int lineIdx) { + addBreakpointedLine(getLineIDInCurrentTab(lineIdx)); + } + + /** + * Remove a highlight for a breakpointed line. Needs to be on the current + * tab. + * + * @param lineIdx the line index on the current tab to remove a breakpoint + * highlight from + */ + public void removeBreakpointedLine(int lineIdx) { + LineID line = getLineIDInCurrentTab(lineIdx); + //System.out.println("line id: " + line.fileName() + " " + line.lineIdx()); + LineHighlight foundLine = null; + for (LineHighlight hl : breakpointedLines) { + if (hl.lineID.equals(line)) { + foundLine = hl; + break; + } + } + if (foundLine != null) { + foundLine.clear(); + breakpointedLines.remove(foundLine); + foundLine.dispose(); + // repaint current line if it's on this line + if (currentLine != null && currentLine.lineID().equals(line)) { + currentLine.paint(); + } + } + } + + /** + * Remove all highlights for breakpointed lines. + */ + public void clearBreakpointedLines() { + for (LineHighlight hl : breakpointedLines) { + hl.clear(); + hl.dispose(); + } + breakpointedLines.clear(); // remove all breakpoints + // fix highlights not being removed when tab names have changed due to opening a new sketch in same editor + ta.clearLineBgColors(); // force clear all highlights + ta.clearGutterText(); + + // repaint current line + if (currentLine != null) { + currentLine.paint(); + } + } + + /** + * Retrieve a {@link LineID} object for a line on the current tab. + * + * @param lineIdx the line index on the current tab + * @return the {@link LineID} object representing a line index on the + * current tab + */ + public LineID getLineIDInCurrentTab(int lineIdx) { + return new LineID(getSketch().getCurrentCode().getFileName(), lineIdx); + } + + /** + * Retrieve line of sketch where the cursor currently resides. + * + * @return the current {@link LineID} + */ + protected LineID getCurrentLineID() { + String tab = getSketch().getCurrentCode().getFileName(); + int lineNo = getTextArea().getCaretLine(); + return new LineID(tab, lineNo); + } + + /** + * Check whether a {@link LineID} is on the current tab. + * + * @param line the {@link LineID} + * @return true, if the {@link LineID} is on the current tab. + */ + public boolean isInCurrentTab(LineID line) { + return line.fileName().equals(getSketch().getCurrentCode().getFileName()); + } + + /** + * Event handler called when switching between tabs. Loads all line + * background colors set for the tab. + * + * @param code tab to switch to + */ + @Override + protected void setCode(SketchCode code) { + //System.out.println("tab switch: " + code.getFileName()); + super.setCode(code); // set the new document in the textarea, etc. need to do this first + + // set line background colors for tab + if (ta != null) { // can be null when setCode is called the first time (in constructor) + // clear all line backgrounds + ta.clearLineBgColors(); + // clear all gutter text + ta.clearGutterText(); + // load appropriate line backgrounds for tab + // first paint breakpoints + for (LineHighlight hl : breakpointedLines) { + if (isInCurrentTab(hl.lineID())) { + hl.paint(); + } + } + // now paint current line (if any) + if (currentLine != null) { + if (isInCurrentTab(currentLine.lineID())) { + currentLine.paint(); + } + } + } + if (dbg() != null && dbg().isStarted()) { + dbg().startTrackingLineChanges(); + } + } + + /** + * Get a tab by its file name. + * + * @param fileName the filename to search for. + * @return the {@link SketchCode} object representing the tab, or null if + * not found + */ + public SketchCode getTab(String fileName) { + Sketch s = getSketch(); + for (SketchCode c : s.getCode()) { + if (c.getFileName().equals(fileName)) { + return c; + } + } + return null; + } + + /** + * Retrieve the current tab. + * + * @return the {@link SketchCode} representing the current tab + */ + public SketchCode getCurrentTab() { + return getSketch().getCurrentCode(); + } + + /** + * Access the currently edited document. + * + * @return the document object + */ + public Document currentDocument() { + //return ta.getDocument(); + return getCurrentTab().getDocument(); + } + + /** + * Factory method for the editor toolbar. Instantiates the customized + * toolbar. + * + * @return the toolbar + */ + /*@Override + public EditorToolbar createToolbar() { + return new DebugToolbar(this, base); + }*/ + + /** + * Event Handler for double clicking in the left hand gutter area. + * + * @param lineIdx the line (0-based) that was double clicked + */ + public void gutterDblClicked(int lineIdx) { + if (dbg != null) { + dbg.toggleBreakpoint(lineIdx); + } + } + + public void statusBusy() { + statusNotice("Debugger busy..."); + } + + public void statusHalted() { + statusNotice("Debugger halted."); + } + + public static final int STATUS_EMPTY = 100, STATUS_COMPILER_ERR = 200, + STATUS_WARNING = 300, STATUS_INFO = 400, STATUS_ERR = 500; + public int statusMessageType = STATUS_EMPTY; + public String statusMessage; + public void statusMessage(final String what, int type){ + // Don't re-display the old message again + if(type != STATUS_EMPTY) { + if(what.equals(statusMessage) && type == statusMessageType) { + return; + } + } + statusMessage = new String(what); + statusMessageType = type; + switch (type) { + case STATUS_COMPILER_ERR: + case STATUS_ERR: + super.statusError(what); + break; + case STATUS_INFO: + case STATUS_WARNING: + statusNotice(what); + break; + } + // Don't need to clear compiler error messages + if(type == STATUS_COMPILER_ERR) return; + + // Clear the message after a delay + SwingWorker s = new SwingWorker() { + @Override + protected Object doInBackground() throws Exception { + try { + Thread.sleep(2 * 1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + statusEmpty(); + return null; + } + }; + s.execute(); + } + + public void statusEmpty(){ + statusMessage = null; + statusMessageType = STATUS_EMPTY; + super.statusEmpty(); + } + + ErrorCheckerService errorCheckerService; + + /** + * Initializes and starts Error Checker Service + */ + private void initializeErrorChecker() { + Thread errorCheckerThread = null; + + if (errorCheckerThread == null) { + errorCheckerService = new ErrorCheckerService(this); + errorCheckerThread = new Thread(errorCheckerService); + try { + errorCheckerThread.start(); + } catch (Exception e) { + System.err + .println("Error Checker Service not initialized [XQEditor]: " + + e); + // e.printStackTrace(); + } + // System.out.println("Error Checker Service initialized."); + } + + } + + /** + * Updates the error bar + * @param problems + */ + public void updateErrorBar(ArrayList problems) { + errorBar.updateErrorPoints(problems); + } + + /** + * Toggle between Console and Errors List + * + * @param buttonName + * - Button Label + */ + public void showProblemListView(String buttonName) { + CardLayout cl = (CardLayout) consoleProblemsPane.getLayout(); + cl.show(consoleProblemsPane, buttonName); + } + + /** + * Updates the error table + * @param tableModel + * @return + */ + synchronized public boolean updateTable(final TableModel tableModel) { + return errorTable.updateTable(tableModel); + } + + /** + * Handle whether the tiny red error indicator is shown near the error button + * at the bottom of the PDE + */ + public void updateErrorToggle(){ + btnShowErrors.updateMarker(ExperimentalMode.errorCheckEnabled + && errorCheckerService.hasErrors(), errorBar.errorColor); + } + + /** + * Handle refactor operation + */ + private void handleRefactor() { + log("Caret at:"); + log(ta.getLineText(ta.getCaretLine())); + errorCheckerService.getASTGenerator().handleRefactor(); + } + + /** + * Handle show usage operation + */ + private void handleShowUsage() { + log("Caret at:"); + log(ta.getLineText(ta.getCaretLine())); + errorCheckerService.getASTGenerator().handleShowUsage(); + } + + /** + * Checks if the sketch contains java tabs. If it does, the editor ain't built + * for it, yet. Also, user should really start looking at more powerful IDEs + * likeEclipse. Disable compilation check and some more features. + */ + private void checkForJavaTabs() { + hasJavaTabs = false; + for (int i = 0; i < this.getSketch().getCodeCount(); i++) { + if (this.getSketch().getCode(i).getExtension().equals("java")) { + compilationCheckEnabled = false; + hasJavaTabs = true; + JOptionPane.showMessageDialog(new Frame(), this + .getSketch().getName() + + " contains .java tabs. Some editor features are not supported " + + "for .java tabs and will be disabled."); + break; + } + } + } + + protected void applyPreferences() { + super.applyPreferences(); + if (dmode != null) { + dmode.loadPreferences(); + log("Applying prefs"); + // trigger it once to refresh UI + errorCheckerService.runManualErrorCheck(); + } + } + + /** + * Handles toggle comment. Slightly improved from the default implementation + * in {@link processing.app.Editor} + */ + protected void handleCommentUncomment() { + // log("Entering handleCommentUncomment()"); + startCompoundEdit(); + + String prefix = getCommentPrefix(); + int prefixLen = prefix.length(); + + int startLine = textarea.getSelectionStartLine(); + int stopLine = textarea.getSelectionStopLine(); + + int lastLineStart = textarea.getLineStartOffset(stopLine); + int selectionStop = textarea.getSelectionStop(); + // If the selection ends at the beginning of the last line, + // then don't (un)comment that line. + if (selectionStop == lastLineStart) { + // Though if there's no selection, don't do that + if (textarea.isSelectionActive()) { + stopLine--; + } + } + + // If the text is empty, ignore the user. + // Also ensure that all lines are commented (not just the first) + // when determining whether to comment or uncomment. + boolean commented = true; + for (int i = startLine; commented && (i <= stopLine); i++) { + String lineText = textarea.getLineText(i).trim(); + if (lineText.length() == 0) + continue; //ignore blank lines + commented = lineText.startsWith(prefix); + } + + // log("Commented: " + commented); + + // This is the line start offset of the first line, which is added to + // all other lines while adding a comment. Required when commenting + // lines which have uneven whitespaces in the beginning. Makes the + // commented lines look more uniform. + int lso = Math.abs(textarea.getLineStartNonWhiteSpaceOffset(startLine) + - textarea.getLineStartOffset(startLine)); + + for (int line = startLine; line <= stopLine; line++) { + int location = textarea.getLineStartNonWhiteSpaceOffset(line); + String lineText = textarea.getLineText(line); + if (lineText.trim().length() == 0) + continue; //ignore blank lines + if (commented) { + // remove a comment + if (lineText.trim().startsWith(prefix + " ")) { + textarea.select(location, location + prefixLen + 1); + } else { + textarea.select(location, location + prefixLen); + } + textarea.setSelectedText(""); + } else { + // add a comment + location = textarea.getLineStartOffset(line) + lso; + textarea.select(location, location); + textarea.setSelectedText(prefix + " "); //Add a '// ' + } + } + // Subtract one from the end, otherwise selects past the current line. + // (Which causes subsequent calls to keep expanding the selection) + textarea.select(textarea.getLineStartOffset(startLine), + textarea.getLineStopOffset(stopLine) - 1); + stopCompoundEdit(); + sketch.setModified(true); + } + + // TweakMode code + /** + * Show warnings menu item + */ + //protected JCheckBoxMenuItem enableTweakCB; + + String[] baseCode; + + final static int SPACE_AMOUNT = 0; + + int oscPort; + + public void startInteractiveMode() + { + ta.startInteractiveMode(); + } + + public void stopInteractiveMode(ArrayList handles[]) + { + ta.stopInteractiveMode(); + + // remove space from the code (before and after) + removeSpacesFromCode(); + + // check which tabs were modified + boolean modified = false; + boolean[] modifiedTabs = getModifiedTabs(handles); + for (boolean mod : modifiedTabs) { + if (mod) { + modified = true; + break; + } + } + + if (modified) { + // ask to keep the values + int ret = Base.showYesNoQuestion(this, "Tweak Mode", + "Keep the changes?", + "You changed some values in your sketch. Would you like to keep the changes?"); + if (ret == 1) { + // NO! don't keep changes + loadSavedCode(); + // update the painter to draw the saved (old) code + ta.invalidate(); + } + else { + // YES! keep changes + // the new values are already present, just make sure the user can save the modified tabs + for (int i=0; i handles[], ArrayList colorBoxes[]) + { + // set OSC port of handles + for (int i=0; i handles[]) + { + boolean[] modifiedTabs = new boolean[handles.length]; + + for (int i=0; i handles[], boolean withSpaces) + { + SketchCode[] sketchCode = sketch.getCode(); + for (int tab=0; tab handles[]) + { + SketchCode[] code = sketch.getCode(); + + if (code.length<1) + return false; + + if (handles.length == 0) + return false; + + int setupStartPos = SketchParser.getSetupStart(baseCode[0]); + if (setupStartPos < 0) { + return false; + } + + // Copy current program to interactive program + + /* modify the code below, replace all numbers with their variable names */ + // loop through all tabs in the current sketch + for (int tab=0; tab 0) { + header += "int[] tweakmode_int = new int["+numOfInts+"];\n"; + } + if (numOfFloats > 0) { + header += "float[] tweakmode_float = new float["+numOfFloats+"];\n\n"; + } + + /* add the class for the OSC event handler that will respond to our messages */ + header += "public class TweakMode_OscHandler {\n" + + " public void oscEvent(OscMessage msg) {\n" + + " String type = msg.addrPattern();\n"; + if (numOfInts > 0) { + header += " if (type.contains(\"/tm_change_int\")) {\n" + + " int index = msg.get(0).intValue();\n" + + " int value = msg.get(1).intValue();\n" + + " tweakmode_int[index] = value;\n" + + " }\n"; + if (numOfFloats > 0) { + header += " else "; + } + } + if (numOfFloats > 0) { + header += "if (type.contains(\"/tm_change_float\")) {\n" + + " int index = msg.get(0).intValue();\n" + + " float value = msg.get(1).floatValue();\n" + + " tweakmode_float[index] = value;\n" + + " }\n"; + } + header += " }\n" + + "}\n"; + header += "TweakMode_OscHandler tweakmode_oscHandler = new TweakMode_OscHandler();\n"; + + header += "void tweakmode_initAllVars() {\n"; + for (int i=0; i handles[]) + { + int count = 0; + for (int i=0; i handles[]) + { + int count = 0; + for (int i=0; i + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +import com.sun.jdi.VirtualMachine; +import processing.app.RunnerListener; +import processing.app.SketchException; +import processing.app.exec.StreamRedirectThread; +import processing.mode.java.JavaBuild; +import processing.mode.java.runner.MessageSiphon; + +/** + * Runs a {@link JavaBuild}. Launches the build in a new debuggee VM. + * + * @author Martin Leopold + */ +public class DebugRunner extends processing.mode.java.runner.Runner { + + // important inherited fields + // protected VirtualMachine vm; + public DebugRunner(JavaBuild build, RunnerListener listener) throws SketchException { + super(build, listener); + } + + /** + * Launch the virtual machine. Simple non-blocking launch. VM starts + * suspended. + * + * @return debuggee VM or null on failure + */ + public VirtualMachine launch() { +// String[] machineParamList = getMachineParams(); +// String[] sketchParamList = getSketchParams(false); +// /* +// * System.out.println("vm launch sketch params:"); for (int i=0; +// * i + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +import java.awt.Graphics; +import java.awt.Image; +import java.awt.event.MouseEvent; +import java.awt.image.BufferedImage; +import java.util.logging.Level; +import java.util.logging.Logger; + +import processing.app.Base; +import processing.app.Editor; +import processing.app.Toolkit; +import processing.mode.java.JavaToolbar; + +/** + * Custom toolbar for the editor window. Preserves original button numbers + * ({@link JavaToolbar#RUN}, {@link JavaToolbar#STOP}, {@link JavaToolbar#NEW}, + * {@link JavaToolbar#OPEN}, {@link JavaToolbar#SAVE}, {@link JavaToolbar#EXPORT}) + * which can be used e.g. in {@link #activate} and + * {@link #deactivate}. + * + * @author Martin Leopold + */ +public class DebugToolbar extends JavaToolbar { + // preserve original button id's, but re-define so they are accessible + // (they are used by DebugEditor, so they want to be public) + + static protected final int RUN = 100; // change this, to be able to get it's name via getTitle() + static protected final int DEBUG = JavaToolbar.RUN; + + static protected final int CONTINUE = 101; + static protected final int STEP = 102; + static protected final int TOGGLE_BREAKPOINT = 103; + static protected final int TOGGLE_VAR_INSPECTOR = 104; + + static protected final int STOP = JavaToolbar.STOP; + + static protected final int NEW = JavaToolbar.NEW; + static protected final int OPEN = JavaToolbar.OPEN; + static protected final int SAVE = JavaToolbar.SAVE; + static protected final int EXPORT = JavaToolbar.EXPORT; + + + // the sequence of button ids. (this maps button position = index to button ids) + static protected final int[] buttonSequence = { + DEBUG, CONTINUE, STEP, STOP, TOGGLE_BREAKPOINT, TOGGLE_VAR_INSPECTOR, + NEW, OPEN, SAVE, EXPORT + }; + + + public DebugToolbar(Editor editor, Base base) { + super(editor, base); + } + public Image[][] loadDebugImages() { + int res = Toolkit.highResDisplay() ? 2 : 1; + + String suffix = null; + Image allButtons = null; + // Some modes may not have a 2x version. If a mode doesn't have a 1x + // version, this will cause an error... they should always have 1x. + if (res == 2) { + suffix = "-2x.png"; + allButtons = mode.loadImage("theme/buttons-debug" + suffix); + if (allButtons == null) { + res = 1; // take him down a notch + } + } + if (res == 1) { + suffix = ".png"; + allButtons = mode.loadImage("theme/buttons-debug" + suffix); + if (allButtons == null) { + // use the old (pre-2.0b9) file name + suffix = ".gif"; + allButtons = mode.loadImage("theme/buttons-debug" + suffix); + } + } + + // The following three final fields were not accessible, so just copied the values here + // for the time being. TODO: inform Ben, make these fields public + /** Width of each toolbar button. */ + final int BUTTON_WIDTH = 27; + /** Size (both width and height) of the buttons in the source image. */ + final int BUTTON_IMAGE_SIZE = 33; + int count = allButtons.getWidth(this) / BUTTON_WIDTH*res; + final int GRID_SIZE = 32; + + Image[][] buttonImages = new Image[count][3]; + + for (int i = 0; i < count; i++) { + for (int state = 0; state < 3; state++) { + Image image = new BufferedImage(BUTTON_WIDTH*res, GRID_SIZE*res, BufferedImage.TYPE_INT_ARGB); + Graphics g = image.getGraphics(); + g.drawImage(allButtons, + -(i*BUTTON_IMAGE_SIZE*res) - 3, + (state-2)*BUTTON_IMAGE_SIZE*res, null); + g.dispose(); + buttonImages[i][state] = image; + } + } + + return buttonImages; + } + + /** + * Initialize buttons. Loads images and adds the buttons to the toolbar. + */ + @Override + public void init() { + Image[][] images = loadDebugImages(); + for (int idx = 0; idx < buttonSequence.length; idx++) { + int id = buttonId(idx); + addButton(getTitle(id, false), getTitle(id, true), images[idx], id == NEW || id == TOGGLE_BREAKPOINT); + } + } + + + /** + * Get the title for a toolbar button. Displayed in the toolbar when + * hovering over a button. + * @param id id of the toolbar button + * @param shift true if shift is pressed + * @return the title + */ + public static String getTitle(int id, boolean shift) { + switch (id) { + case DebugToolbar.RUN: + return JavaToolbar.getTitle(JavaToolbar.RUN, shift); + case STOP: + return JavaToolbar.getTitle(JavaToolbar.STOP, shift); + case NEW: + return JavaToolbar.getTitle(JavaToolbar.NEW, shift); + case OPEN: + return JavaToolbar.getTitle(JavaToolbar.OPEN, shift); + case SAVE: + return JavaToolbar.getTitle(JavaToolbar.SAVE, shift); + case EXPORT: + return JavaToolbar.getTitle(JavaToolbar.EXPORT, shift); + case DEBUG: + if (shift) { + return "Run"; + } else { + return "Debug"; + } + case CONTINUE: + return "Continue"; + case TOGGLE_BREAKPOINT: + return "Toggle Breakpoint"; + case STEP: + if (shift) { + return "Step Into"; + } else { + return "Step"; + } + case TOGGLE_VAR_INSPECTOR: + return "Variable Inspector"; + } + return null; + } + + + /** + * Event handler called when a toolbar button is clicked. + * @param e the mouse event + * @param idx index (i.e. position) of the toolbar button clicked + */ + @Override + public void handlePressed(MouseEvent e, int idx) { + boolean shift = e.isShiftDown(); + DebugEditor deditor = (DebugEditor) editor; + int id = buttonId(idx); // convert index/position to button id + + switch (id) { +// case DebugToolbar.RUN: +// super.handlePressed(e, JavaToolbar.RUN); +// break; + case STOP: + Logger.getLogger(DebugToolbar.class.getName()).log(Level.INFO, "Invoked 'Stop' toolbar button"); + super.handlePressed(e, JavaToolbar.STOP); + break; + case NEW: + Logger.getLogger(DebugToolbar.class.getName()).log(Level.INFO, "Invoked 'New' toolbar button"); + super.handlePressed(e, JavaToolbar.NEW); + break; + case OPEN: + Logger.getLogger(DebugToolbar.class.getName()).log(Level.INFO, "Invoked 'Open' toolbar button"); + super.handlePressed(e, JavaToolbar.OPEN); + break; + case SAVE: + Logger.getLogger(DebugToolbar.class.getName()).log(Level.INFO, "Invoked 'Save' toolbar button"); + super.handlePressed(e, JavaToolbar.SAVE); + break; + case EXPORT: + Logger.getLogger(DebugToolbar.class.getName()).log(Level.INFO, "Invoked 'Export' toolbar button"); + super.handlePressed(e, JavaToolbar.EXPORT); + break; + case DEBUG: + deditor.handleStop(); // Close any running sketches + deditor.showProblemListView(XQConsoleToggle.CONSOLE); + if (shift) { + Logger.getLogger(DebugToolbar.class.getName()).log(Level.INFO, "Invoked 'Run' toolbar button"); + deditor.handleRun(); + } else { + Logger.getLogger(DebugToolbar.class.getName()).log(Level.INFO, "Invoked 'Debug' toolbar button"); + deditor.dbg.startDebug(); + } + break; + case CONTINUE: + Logger.getLogger(DebugToolbar.class.getName()).log(Level.INFO, "Invoked 'Continue' toolbar button"); + deditor.dbg.continueDebug(); + break; + case TOGGLE_BREAKPOINT: + Logger.getLogger(DebugToolbar.class.getName()).log(Level.INFO, "Invoked 'Toggle Breakpoint' toolbar button"); + deditor.dbg.toggleBreakpoint(); + break; + case STEP: + if (shift) { + Logger.getLogger(DebugToolbar.class.getName()).log(Level.INFO, "Invoked 'Step Into' toolbar button"); + deditor.dbg.stepInto(); + } else { + Logger.getLogger(DebugToolbar.class.getName()).log(Level.INFO, "Invoked 'Step' toolbar button"); + deditor.dbg.stepOver(); + } + break; +// case STEP_INTO: +// deditor.dbg.stepInto(); +// break; +// case STEP_OUT: +// deditor.dbg.stepOut(); +// break; + case TOGGLE_VAR_INSPECTOR: + Logger.getLogger(DebugToolbar.class.getName()).log(Level.INFO, "Invoked 'Variable Inspector' toolbar button"); + deditor.toggleVariableInspector(); + break; + } + } + + + /** + * Activate (light up) a button. + * @param id the button id + */ + @Override + public void activate(int id) { + //System.out.println("activate button idx: " + buttonIndex(id)); + super.activate(buttonIndex(id)); + } + + + /** + * Set a button to be inactive. + * @param id the button id + */ + @Override + public void deactivate(int id) { + //System.out.println("deactivate button idx: " + buttonIndex(id)); + super.deactivate(buttonIndex(id)); + } + + + /** + * Get button position (index) from it's id. + * @param buttonId the button id + * ({@link #RUN}, {@link #DEBUG}, {@link #CONTINUE}), {@link #STEP}, ...) + * @return the button index + */ + protected int buttonIndex(int buttonId) { + for (int i = 0; i < buttonSequence.length; i++) { + if (buttonSequence[i] == buttonId) { + return i; + } + } + return -1; + } + + + /** + * Get the button id from its position (index). + * @param buttonIdx the button index + * @return the button id + * ({@link #RUN}, {@link #DEBUG}, {@link #CONTINUE}), {@link #STEP}, ...) + */ + protected int buttonId(int buttonIdx) { + return buttonSequence[buttonIdx]; + } +} diff --git a/pdex/src/processing/mode/experimental/Debugger.java b/pdex/src/processing/mode/experimental/Debugger.java new file mode 100755 index 000000000..7f19d0622 --- /dev/null +++ b/pdex/src/processing/mode/experimental/Debugger.java @@ -0,0 +1,1372 @@ +/* + * Copyright (C) 2012 Martin Leopold + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +import com.sun.jdi.*; +import com.sun.jdi.event.*; +import com.sun.jdi.request.*; +import java.io.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.JTree; // needed for javadocs +import javax.swing.tree.DefaultMutableTreeNode; +import processing.app.Sketch; +import processing.app.SketchCode; + +/** + * Main controller class for debugging mode. Mainly works with DebugEditor as + * the corresponding "view". Uses DebugRunner to launch a VM. + * + * @author Martin Leopold + */ +public class Debugger implements VMEventListener { + + protected DebugEditor editor; // editor window, acting as main view + protected DebugRunner runtime; // the runtime, contains debuggee VM + protected boolean started = false; // debuggee vm has started, VMStartEvent received, main class loaded + protected boolean paused = false; // currently paused at breakpoint or step + protected ThreadReference currentThread; // thread the last breakpoint or step occured in + protected String mainClassName; // name of the main class that's currently being debugged + protected ReferenceType mainClass; // the debuggee's main class + protected Set classes = new HashSet(); // holds all loaded classes in the debuggee VM + protected List classLoadListeners = new ArrayList(); // listeners for class load events + protected String srcPath; // path to the src folder of the current build + protected List breakpoints = new ArrayList(); // list of current breakpoints + protected StepRequest requestedStep; // the step request we are currently in, or null if not in a step + protected Map runtimeLineChanges = new HashMap(); // maps line number changes at runtime (orig -> changed) + protected Set runtimeTabsTracked = new HashSet(); // contains tab filenames which already have been tracked for runtime changes + + /** + * Construct a Debugger object. + * + * @param editor The Editor that will act as primary view + */ + public Debugger(DebugEditor editor) { + this.editor = editor; + } + + /** + * Access the VM. + * + * @return the virtual machine object or null if not available. + */ + public VirtualMachine vm() { + if (runtime != null) { + return runtime.vm(); + } else { + return null; + } + } + + /** + * Access the editor associated with this debugger. + * + * @return the editor object + */ + public DebugEditor editor() { + return editor; + } + + /** + * Retrieve the main class of the debuggee VM. + * + * @return the main classes {@link ReferenceType} or null if the debugger is + * not started. + */ + public ReferenceType getMainClass() { + if (isStarted()) { + return mainClass; + } else { + return null; + } + + } + + /** + * Get the {@link ReferenceType} for a class name. + * + * @param name the class name + * @return the {@link ReferenceType} or null if not found (e.g. not yet + * loaded) + */ + public ReferenceType getClass(String name) { + if (name == null) { + return null; + } + if (name.equals(mainClassName)) { + return mainClass; + } + for (ReferenceType rt : classes) { + if (rt.name().equals(name)) { + return rt; + } + } + return null; + } + + /** + * Add a class load listener. Will be notified when a class is loaded in the + * debuggee VM. + * + * @param listener the {@link ClassLoadListener} + */ + public void addClassLoadListener(ClassLoadListener listener) { + classLoadListeners.add(listener); + } + + /** + * Remove a class load listener. Cease to be notified when classes are + * loaded in the debuggee VM. + * + * @param listener {@link ClassLoadListener} + */ + public void removeClassLoadListener(ClassLoadListener listener) { + classLoadListeners.remove(listener); + } + + /** + * Start a debugging session. Builds the sketch and launches a VM to run it. + * VM starts suspended. Should produce a VMStartEvent. + */ + public synchronized void startDebug() { + //stopDebug(); // stop any running sessions + if (isStarted()) { + return; // do nothing + } + + // we are busy now + editor.statusBusy(); + + // clear console + editor.clearConsole(); + + // clear variable inspector (also resets expanded states) + editor.variableInspector().reset(); + + // load edits into sketch obj, etc... + editor.prepareRun(); + if(editor.toolbar() != null) + editor.toolbar().activate(DebugToolbar.DEBUG); // after prepareRun, since this removes highlights + + try { + Sketch sketch = editor.getSketch(); + DebugBuild build = new DebugBuild(sketch); + + Logger.getLogger(Debugger.class.getName()).log(Level.INFO, "building sketch: {0}", sketch.getName()); + //LineMapping.addLineNumbers(sketch); // annotate + mainClassName = build.build(false); + //LineMapping.removeLineNumbers(sketch); // annotate + Logger.getLogger(Debugger.class.getName()).log(Level.INFO, "class: {0}", mainClassName); + + // folder with assembled/preprocessed src + srcPath = build.getSrcFolder().getPath(); + Logger.getLogger(Debugger.class.getName()).log(Level.INFO, "build src: {0}", srcPath); + // folder with compiled code (.class files) + Logger.getLogger(Debugger.class.getName()).log(Level.INFO, "build bin: {0}", build.getBinFolder().getPath()); + + if (mainClassName != null) { + // generate the source line mapping + //lineMap = LineMapping.generateMapping(srcPath + File.separator + mainClassName + ".java"); + + Logger.getLogger(Debugger.class.getName()).log(Level.INFO, "launching debuggee runtime"); + runtime = new DebugRunner(build, editor); + VirtualMachine vm = runtime.launch(); // non-blocking + if (vm == null) { + Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE, "error 37: launch failed"); + } + + // start receiving vm events + VMEventReader eventThread = new VMEventReader(vm.eventQueue(), this); + eventThread.start(); + + //return runtime; + + /* + * // launch runner in new thread new Thread(new Runnable() { + * + * @Override public void run() { runtime.launch(false); // this + * blocks until finished } }).start(); return runtime; + */ + + startTrackingLineChanges(); + editor.statusBusy(); + } + } catch (Exception e) { + editor.statusError(e); + } + } + + /** + * End debugging session. Stops and disconnects VM. Should produce + * VMDisconnectEvent. + */ + public synchronized void stopDebug() { + editor.variableInspector().lock(); + if (runtime != null) { + Logger.getLogger(Debugger.class.getName()).log(Level.INFO, "closing runtime"); + runtime.close(); + runtime = null; + //build = null; + classes.clear(); + // need to clear highlight here because, VMDisconnectedEvent seems to be unreliable. TODO: likely synchronization problem + editor.clearCurrentLine(); + } + stopTrackingLineChanges(); + started = false; + if(editor.toolbar() != null){ + editor.toolbar().deactivate(DebugToolbar.DEBUG); + editor.toolbar().deactivate(DebugToolbar.CONTINUE); + editor.toolbar().deactivate(DebugToolbar.STEP); + } + editor.statusEmpty(); + } + + /** + * Resume paused debugging session. Resumes VM. + */ + public synchronized void continueDebug() { + if(editor.toolbar() != null) + editor.toolbar().activate(DebugToolbar.CONTINUE); + editor.variableInspector().lock(); + //editor.clearSelection(); + //clearHighlight(); + editor.clearCurrentLine(); + if (!isStarted()) { + startDebug(); + } else if (isPaused()) { + runtime.vm().resume(); + paused = false; + editor.statusBusy(); + } + } + + /** + * Step through source code lines. + * + * @param stepDepth the step depth ({@link StepRequest#STEP_OVER}, + * {@link StepRequest#STEP_INTO} or {@link StepRequest#STEP_OUT}) + */ + protected void step(int stepDepth) { + if (!isStarted()) { + startDebug(); + } else if (isPaused()) { + editor.variableInspector().lock(); + if(editor.toolbar() != null) + editor.toolbar().activate(DebugToolbar.STEP); + + // use global to mark that there is a step request pending + requestedStep = runtime.vm().eventRequestManager().createStepRequest(currentThread, StepRequest.STEP_LINE, stepDepth); + requestedStep.addCountFilter(1); // valid for one step only + requestedStep.enable(); + paused = false; + runtime.vm().resume(); + editor.statusBusy(); + } + } + + /** + * Step over current statement. + */ + public synchronized void stepOver() { + step(StepRequest.STEP_OVER); + } + + /** + * Step into current statement. + */ + public synchronized void stepInto() { + step(StepRequest.STEP_INTO); + } + + /** + * Step out of current function. + */ + public synchronized void stepOut() { + step(StepRequest.STEP_OUT); + } + + /** + * Print the current stack trace. + */ + public synchronized void printStackTrace() { + if (isStarted()) { + printStackTrace(currentThread); + } + } + + /** + * Print local variables. Outputs type, name and value of each variable. + */ + public synchronized void printLocals() { + if (isStarted()) { + printLocalVariables(currentThread); + } + } + + /** + * Print fields of current {@code this}-object. Outputs type, name and value + * of each field. + */ + public synchronized void printThis() { + if (isStarted()) { + printThis(currentThread); + } + } + + /** + * Print a source code snippet of the current location. + */ + public synchronized void printSource() { + if (isStarted()) { + printSourceLocation(currentThread); + } + } + + /** + * Set a breakpoint on the current line. + */ + public synchronized void setBreakpoint() { + setBreakpoint(editor.getCurrentLineID()); + } + + /** + * Set a breakpoint on a line in the current tab. + * + * @param lineIdx the line index (0-based) of the current tab to set the + * breakpoint on + */ + public synchronized void setBreakpoint(int lineIdx) { + setBreakpoint(editor.getLineIDInCurrentTab(lineIdx)); + } + + /** + * Set a breakpoint. + * + * @param line the line id to set the breakpoint on + */ + public synchronized void setBreakpoint(LineID line) { + // do nothing if we are kinda busy + if (isStarted() && !isPaused()) { + return; + } + // do nothing if there already is a breakpoint on this line + if (hasBreakpoint(line)) { + return; + } + breakpoints.add(new LineBreakpoint(line, this)); + Logger.getLogger(Debugger.class.getName()).log(Level.INFO, "set breakpoint on line {0}", line); + } + + /** + * Remove a breakpoint from the current line (if set). + */ + public synchronized void removeBreakpoint() { + removeBreakpoint(editor.getCurrentLineID().lineIdx()); + } + + /** + * Remove a breakpoint from a line in the current tab. + * + * @param lineIdx the line index (0-based) in the current tab to remove the + * breakpoint from + */ + protected void removeBreakpoint(int lineIdx) { + // do nothing if we are kinda busy + if (isBusy()) { + return; + } + + LineBreakpoint bp = breakpointOnLine(editor.getLineIDInCurrentTab(lineIdx)); + if (bp != null) { + bp.remove(); + breakpoints.remove(bp); + Logger.getLogger(Debugger.class.getName()).log(Level.INFO, "removed breakpoint {0}", bp); + } + } + + /** + * Remove all breakpoints. + */ + public synchronized void clearBreakpoints() { + //TODO: handle busy-ness correctly + if (isBusy()) { + Logger.getLogger(Debugger.class.getName()).log(Level.WARNING, "busy"); + return; + } + + for (LineBreakpoint bp : breakpoints) { + bp.remove(); + } + breakpoints.clear(); + } + + /** + * Clear breakpoints in a specific tab. + * + * @param tabFilename the tab's file name + */ + public synchronized void clearBreakpoints(String tabFilename) { + //TODO: handle busy-ness correctly + if (isBusy()) { + Logger.getLogger(Debugger.class.getName()).log(Level.WARNING, "busy"); + return; + } + + Iterator i = breakpoints.iterator(); + while (i.hasNext()) { + LineBreakpoint bp = i.next(); + if (bp.lineID().fileName().equals(tabFilename)) { + bp.remove(); + i.remove(); + } + } + } + + /** + * Get the breakpoint on a certain line, if set. + * + * @param line the line to get the breakpoint from + * @return the breakpoint, or null if no breakpoint is set on the specified + * line. + */ + protected LineBreakpoint breakpointOnLine(LineID line) { + for (LineBreakpoint bp : breakpoints) { + if (bp.isOnLine(line)) { + return bp; + } + } + return null; + } + + /** + * Toggle a breakpoint on the current line. + */ + public synchronized void toggleBreakpoint() { + toggleBreakpoint(editor.getCurrentLineID().lineIdx()); + } + + /** + * Toggle a breakpoint on a line in the current tab. + * + * @param lineIdx the line index (0-based) in the current tab + */ + public synchronized void toggleBreakpoint(int lineIdx) { + LineID line = editor.getLineIDInCurrentTab(lineIdx); + if (!hasBreakpoint(line)) { + setBreakpoint(line.lineIdx()); + } else { + removeBreakpoint(line.lineIdx()); + } + } + + /** + * Check if there's a breakpoint on a particular line. + * + * @param line the line id + * @return true if a breakpoint is set on the given line, otherwise false + */ + protected boolean hasBreakpoint(LineID line) { + LineBreakpoint bp = breakpointOnLine(line); + return bp != null; + } + + /** + * Print a list of currently set breakpoints. + */ + public synchronized void listBreakpoints() { + if (breakpoints.isEmpty()) { + System.out.println("no breakpoints"); + } else { + System.out.println("line breakpoints:"); + for (LineBreakpoint bp : breakpoints) { + System.out.println(bp); + } + } + } + + /** + * Retrieve a list of breakpoint in a particular tab. + * + * @param tabFilename the tab's file name + * @return the list of breakpoints in the given tab + */ + public synchronized List getBreakpoints(String tabFilename) { + List list = new ArrayList(); + for (LineBreakpoint bp : breakpoints) { + if (bp.lineID().fileName().equals(tabFilename)) { + list.add(bp); + } + } + return list; + } + + /** + * Callback for VM events. Will be called from another thread. + * ({@link VMEventReader}) + * + * @param es Incoming set of events from VM + */ + @Override + public synchronized void vmEvent(EventSet es) { + for (Event e : es) { + Logger.getLogger(Debugger.class.getName()).log(Level.INFO, "*** VM Event: {0}", e.toString()); + if (e instanceof VMStartEvent) { + //initialThread = ((VMStartEvent) e).thread(); +// ThreadReference t = ((VMStartEvent) e).thread(); + //printStackTrace(t); + + // break on main class load + Logger.getLogger(Debugger.class.getName()).log(Level.INFO, "requesting event on main class load: {0}", mainClassName); + ClassPrepareRequest mainClassPrepare = runtime.vm().eventRequestManager().createClassPrepareRequest(); + mainClassPrepare.addClassFilter(mainClassName); + mainClassPrepare.enable(); + + // break on loading custom classes + for (SketchCode tab : editor.getSketch().getCode()) { + if (tab.isExtension("java")) { + Logger.getLogger(Debugger.class.getName()).log(Level.INFO, "requesting event on class load: {0}", tab.getPrettyName()); + ClassPrepareRequest customClassPrepare = runtime.vm().eventRequestManager().createClassPrepareRequest(); + customClassPrepare.addClassFilter(tab.getPrettyName()); + customClassPrepare.enable(); + } + } + + runtime.vm().resume(); + } else if (e instanceof ClassPrepareEvent) { + ClassPrepareEvent ce = (ClassPrepareEvent) e; + ReferenceType rt = ce.referenceType(); + currentThread = ce.thread(); + paused = true; // for now we're paused + + if (rt.name().equals(mainClassName)) { + //printType(rt); + mainClass = rt; + Logger.getLogger(Debugger.class.getName()).log(Level.INFO, "main class load: {0}", rt.name()); + started = true; // now that main class is loaded, we're started + } else { + classes.add(rt); // save loaded classes + Logger.getLogger(Debugger.class.getName()).log(Level.INFO, "class load: {0}", rt.name()); + } + + // notify listeners + for (ClassLoadListener listener : classLoadListeners) { + if (listener != null) { + listener.classLoaded(rt); + } + } + + paused = false; // resuming now + runtime.vm().resume(); + } else if (e instanceof BreakpointEvent) { + BreakpointEvent be = (BreakpointEvent) e; + currentThread = be.thread(); // save this thread +// BreakpointRequest br = (BreakpointRequest) be.request(); + + //printSourceLocation(currentThread); + updateVariableInspector(currentThread); // this is already on the EDT + final LineID newCurrentLine = locationToLineID(be.location()); + javax.swing.SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + editor.setCurrentLine(newCurrentLine); + if(editor.toolbar() != null){ + editor.toolbar().deactivate(DebugToolbar.STEP); + editor.toolbar().deactivate(DebugToolbar.CONTINUE); + } + } + }); + + // hit a breakpoint during a step, need to cancel the step. + if (requestedStep != null) { + runtime.vm().eventRequestManager().deleteEventRequest(requestedStep); + requestedStep = null; + } + + // fix canvas update issue + // TODO: is this a good solution? + resumeOtherThreads(currentThread); + + paused = true; + editor.statusHalted(); + } else if (e instanceof StepEvent) { + StepEvent se = (StepEvent) e; + currentThread = se.thread(); + + //printSourceLocation(currentThread); + updateVariableInspector(currentThread); // this is already on the EDT + final LineID newCurrentLine = locationToLineID(se.location()); + javax.swing.SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + editor.setCurrentLine(newCurrentLine); + if(editor.toolbar() != null){ + editor.toolbar().deactivate(DebugToolbar.STEP); + editor.toolbar().deactivate(DebugToolbar.CONTINUE); + } + } + }); + + // delete the steprequest that triggered this step so new ones can be placed (only one per thread) + EventRequestManager mgr = runtime.vm().eventRequestManager(); + mgr.deleteEventRequest(se.request()); + requestedStep = null; // mark that there is no step request pending + paused = true; + editor.statusHalted(); + + // disallow stepping into invisible lines + if (!locationIsVisible(se.location())) { + stepOutIntoViewOrContinue(); // TODO: this leads to stepping, should it run on the EDT? + } + } else if (e instanceof VMDisconnectEvent) { +// started = false; +// // clear line highlight +// editor.clearCurrentLine(); + stopDebug(); + } else if (e instanceof VMDeathEvent) { + started = false; + editor.statusEmpty(); + } + } + } + + /** + * Check whether a location corresponds to a code line in the editor. + * + * @param l the location + * @return true if the location corresponds to a line in the editor + */ + protected boolean locationIsVisible(Location l) { + return locationToLineID(l) != null; + } + + /** + * Step out if this results in a visible location, otherwise continue. + */ + protected void stepOutIntoViewOrContinue() { + try { + List frames = currentThread.frames(); + if (frames.size() > 1) { + if (locationIsVisible(frames.get(1).location())) { + //System.out.println("stepping out to: " + locationToString(frames.get(1).location())); + stepOut(); + return; + } + } + continueDebug(); + +// //Step out to the next visible location on the stack frame +// if (thread.frames(i, i1)) +// for (StackFrame f : thread.frames()) { +// Location l = f.location(); +// if (locationIsVisible(l)) { +// System.out.println("need to step out to: " + locationToString(l)); +// } +// } + } catch (IncompatibleThreadStateException ex) { + Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE, null, ex); + } + } + + /** + * Check whether a debugging session is running. i.e. the debugger is + * connected to a debuggee VM, VMStartEvent has been received and main class + * is loaded. + * + * @return true if the debugger is started. + */ + public synchronized boolean isStarted() { + return started && runtime != null && runtime.vm() != null; + } + + /** + * Check whether the debugger is paused. i.e. it is currently suspended at a + * breakpoint or step. + * + * @return true if the debugger is paused, false otherwise or if not started + * ({@link #isStarted()}) + */ + public synchronized boolean isPaused() { + return isStarted() && paused && currentThread != null && currentThread.isSuspended(); + } + + /** + * Check whether the debugger is currently busy. i.e. running (not + * suspended). + * + * @return true if the debugger is currently running and not suspended. + */ + public synchronized boolean isBusy() { + return isStarted() && !isPaused(); + } + + /** + * Print call stack trace of a thread. Only works on suspended threads. + * + * @param t suspended thread to print stack trace of + */ + protected void printStackTrace(ThreadReference t) { + if (!t.isSuspended()) { + return; + } + try { + System.out.println("stack trace for thread " + t.name() + ":"); + int i = 0; + for (StackFrame f : t.frames()) { +// Location l = f.location(); + System.out.println(i++ + ": " + f.toString()); + } + } catch (IncompatibleThreadStateException ex) { + Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE, null, ex); + } + } + + /** + * Resume all other threads except the one given as parameter. Useful e.g. + * to just keep the thread suspended a breakpoint occurred in. + * + * @param t the thread not to resume + */ + protected void resumeOtherThreads(ThreadReference t) { + if (!isStarted()) { + return; + } + for (ThreadReference other : vm().allThreads()) { + if (!other.equals(t) && other.isSuspended()) { + other.resume(); + } + } + } + + /** + * Print info about all current threads. Includes name, status, isSuspended, + * isAtBreakpoint. + */ + public synchronized void printThreads() { + if (!isPaused()) { + return; + } + System.out.println("threads:"); + for (ThreadReference t : vm().allThreads()) { + printThread(t); + } + } + + /** + * Print info about a thread. Includes name, status, isSuspended, + * isAtBreakpoint. + * + * @param t the thread to print info about + */ + protected void printThread(ThreadReference t) { + System.out.println(t.name()); + System.out.println(" is suspended: " + t.isSuspended()); + System.out.println(" is at breakpoint: " + t.isAtBreakpoint()); + System.out.println(" status: " + threadStatusToString(t.status())); + } + + /** + * Convert a status code returned by {@link ThreadReference#status() } to a + * human readable form. + * + * @param status {@link ThreadReference#THREAD_STATUS_MONITOR}, + * {@link ThreadReference#THREAD_STATUS_NOT_STARTED}, + * {@link ThreadReference#THREAD_STATUS_RUNNING}, + * {@link ThreadReference#THREAD_STATUS_SLEEPING}, + * {@link ThreadReference#THREAD_STATUS_UNKNOWN}, + * {@link ThreadReference#THREAD_STATUS_WAIT} or + * {@link ThreadReference#THREAD_STATUS_ZOMBIE} + * @return String containing readable status code. + */ + protected String threadStatusToString(int status) { + switch (status) { + case ThreadReference.THREAD_STATUS_MONITOR: + return "THREAD_STATUS_MONITOR"; + case ThreadReference.THREAD_STATUS_NOT_STARTED: + return "THREAD_STATUS_NOT_STARTED"; + case ThreadReference.THREAD_STATUS_RUNNING: + return "THREAD_STATUS_RUNNING"; + case ThreadReference.THREAD_STATUS_SLEEPING: + return "THREAD_STATUS_SLEEPING"; + case ThreadReference.THREAD_STATUS_UNKNOWN: + return "THREAD_STATUS_UNKNOWN"; + case ThreadReference.THREAD_STATUS_WAIT: + return "THREAD_STATUS_WAIT"; + case ThreadReference.THREAD_STATUS_ZOMBIE: + return "THREAD_STATUS_ZOMBIE"; + default: + return ""; + } + } + + /** + * Print local variables on a suspended thread. Takes the topmost stack + * frame and lists all local variables and their values. + * + * @param t suspended thread + */ + protected void printLocalVariables(ThreadReference t) { + if (!t.isSuspended()) { + return; + } + try { + if (t.frameCount() == 0) { + System.out.println("call stack empty"); + } else { + StackFrame sf = t.frame(0); + List locals = sf.visibleVariables(); + if (locals.isEmpty()) { + System.out.println("no local variables"); + return; + } + for (LocalVariable lv : locals) { + System.out.println(lv.typeName() + " " + lv.name() + " = " + sf.getValue(lv)); + } + } + } catch (IncompatibleThreadStateException ex) { + Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE, null, ex); + } catch (AbsentInformationException ex) { + System.out.println("local variable information not available"); + } + } + + /** + * Update variable inspector window. Displays local variables and this + * fields. + * + * @param t suspended thread to retrieve locals and this + */ + protected void updateVariableInspector(ThreadReference t) { + if (!t.isSuspended()) { + return; + } + try { + if (t.frameCount() == 0) { + // TODO: needs to be handled in a better way: + Logger.getLogger(Debugger.class.getName()).log(Level.WARNING, "call stack empty"); + } else { + final VariableInspector vi = editor.variableInspector(); + // first get data + final List stackTrace = getStackTrace(t); + final List locals = getLocals(t, 0); + final String currentLocation = currentLocation(t); + final List thisFields = getThisFields(t, 0, true); + final List declaredThisFields = getThisFields(t, 0, false); + final String thisName = thisName(t); + // now update asynchronously + javax.swing.SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + //System.out.println("updating vi. from EDT: " + javax.swing.SwingUtilities.isEventDispatchThread()); + vi.updateCallStack(stackTrace, "Call Stack"); + vi.updateLocals(locals, "Locals at " + currentLocation); + vi.updateThisFields(thisFields, "Class " + thisName); + vi.updateDeclaredThisFields(declaredThisFields, "Class " + thisName); + vi.unlock(); // need to do this before rebuilding, otherwise we get these ... dots in the labels + vi.rebuild(); + } + }); + } + } catch (IncompatibleThreadStateException ex) { + Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE, null, ex); + } + } + + /** + * Get the class name of the current this object in a suspended thread. + * + * @param t a suspended thread + * @return the class name of this + */ + protected String thisName(ThreadReference t) { + try { + if (!t.isSuspended() || t.frameCount() == 0) { + return ""; + } + return t.frame(0).thisObject().referenceType().name(); + } catch (IncompatibleThreadStateException ex) { + Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE, null, ex); + return ""; + } + } + + /** + * Get a description of the current location in a suspended thread. Format: + * class.method:translated_line_number + * + * @param t a suspended thread + * @return descriptive string for the given location + */ + protected String currentLocation(ThreadReference t) { + try { + if (!t.isSuspended() || t.frameCount() == 0) { + return ""; + } + return locationToString(t.frame(0).location()); + } catch (IncompatibleThreadStateException ex) { + Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE, null, ex); + return ""; + } + } + + /** + * Get a string describing a location. Format: + * class.method:translated_line_number + * + * @param l a location + * @return descriptive string for the given location + */ + protected String locationToString(Location l) { + LineID line = locationToLineID(l); + int lineNumber; + if (line != null) { + lineNumber = line.lineIdx() + 1; + } else { + lineNumber = l.lineNumber(); + } + return l.declaringType().name() + "." + l.method().name() + ":" + lineNumber; + } + + /** + * Compile a list of current locals usable for insertion into a + * {@link JTree}. Recursively resolves object references. + * + * @param t the suspended thread to get locals for + * @param depth how deep to resolve nested object references. 0 will not + * resolve nested objects. + * @return the list of current locals + */ + protected List getLocals(ThreadReference t, int depth) { + //System.out.println("getting locals"); + List vars = new ArrayList(); + try { + if (t.frameCount() > 0) { + StackFrame sf = t.frame(0); + for (LocalVariable lv : sf.visibleVariables()) { + //System.out.println("local var: " + lv.name()); + Value val = sf.getValue(lv); + VariableNode var = new LocalVariableNode(lv.name(), lv.typeName(), val, lv, sf); + if (depth > 0) { + var.addChildren(getFields(val, depth - 1, true)); + } + vars.add(var); + } + } + } catch (IncompatibleThreadStateException ex) { + Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE, null, ex); + } catch (AbsentInformationException ex) { + Logger.getLogger(Debugger.class.getName()).log(Level.WARNING, "local variable information not available", ex); + } + return vars; + } + + /** + * Compile a list of fields in the current this object usable for insertion + * into a {@link JTree}. Recursively resolves object references. + * + * @param t the suspended thread to get locals for + * @param depth how deep to resolve nested object references. 0 will not + * resolve nested objects. + * @return the list of fields in the current this object + */ + protected List getThisFields(ThreadReference t, int depth, boolean includeInherited) { + //System.out.println("getting this"); + try { + if (t.frameCount() > 0) { + StackFrame sf = t.frame(0); + ObjectReference thisObj = sf.thisObject(); + return getFields(thisObj, depth, includeInherited); + } + } catch (IncompatibleThreadStateException ex) { + Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE, null, ex); + } + return new ArrayList(); + } + + /** + * Recursively get the fields of a {@link Value} for insertion into a + * {@link JTree}. + * + * @param value must be an instance of {@link ObjectReference} + * @param depth the current depth + * @param maxDepth the depth to stop at (inclusive) + * @return list of child fields of the given value + */ + protected List getFields(Value value, int depth, int maxDepth, boolean includeInherited) { + // remember: Value <- ObjectReference, ArrayReference + List vars = new ArrayList(); + if (depth <= maxDepth) { + if (value instanceof ArrayReference) { + return getArrayFields((ArrayReference) value); + } else if (value instanceof ObjectReference) { + ObjectReference obj = (ObjectReference) value; + // get the fields of this object + List fields = includeInherited ? obj.referenceType().visibleFields() : obj.referenceType().fields(); + for (Field field : fields) { + Value val = obj.getValue(field); // get the value, may be null + VariableNode var = new FieldNode(field.name(), field.typeName(), val, field, obj); + // recursively add children + if (val != null) { + var.addChildren(getFields(val, depth + 1, maxDepth, includeInherited)); + } + vars.add(var); + } + } + } + return vars; + } + + /** + * Recursively get the fields of a {@link Value} for insertion into a + * {@link JTree}. + * + * @param value must be an instance of {@link ObjectReference} + * @param maxDepth max recursion depth. 0 will give only direct children + * @return list of child fields of the given value + */ + protected List getFields(Value value, int maxDepth, boolean includeInherited) { + return getFields(value, 0, maxDepth, includeInherited); + } + + /** + * Get the fields of an array for insertion into a {@link JTree}. + * + * @param array the array reference + * @return list of array fields + */ + protected List getArrayFields(ArrayReference array) { + List fields = new ArrayList(); + if (array != null) { + String arrayType = array.type().name(); + if (arrayType.endsWith("[]")) { + arrayType = arrayType.substring(0, arrayType.length() - 2); + } + int i = 0; + for (Value val : array.getValues()) { + VariableNode var = new ArrayFieldNode("[" + i + "]", arrayType, val, array, i); + fields.add(var); + i++; + } + } + return fields; + } + + /** + * Get the current call stack trace usable for insertion into a + * {@link JTree}. + * + * @param t the suspended thread to retrieve the call stack from + * @return call stack as list of {@link DefaultMutableTreeNode}s + */ + protected List getStackTrace(ThreadReference t) { + List stack = new ArrayList(); + try { +// int i = 0; + for (StackFrame f : t.frames()) { + stack.add(new DefaultMutableTreeNode(locationToString(f.location()))); + } + } catch (IncompatibleThreadStateException ex) { + Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE, null, ex); + } + return stack; + } + + /** + * Print visible fields of current "this" object on a suspended thread. + * Prints type, name and value. + * + * @param t suspended thread + */ + protected void printThis(ThreadReference t) { + if (!t.isSuspended()) { + return; + } + try { + if (t.frameCount() == 0) { + // TODO: needs to be handled in a better way + System.out.println("call stack empty"); + } else { + StackFrame sf = t.frame(0); + ObjectReference thisObject = sf.thisObject(); + if (this != null) { + ReferenceType type = thisObject.referenceType(); + System.out.println("fields in this (" + type.name() + "):"); + for (Field f : type.visibleFields()) { + System.out.println(f.typeName() + " " + f.name() + " = " + thisObject.getValue(f)); + } + } else { + System.out.println("can't get this (in native or static method)"); + } + } + } catch (IncompatibleThreadStateException ex) { + Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE, null, ex); + } + } + + /** + * Print source code snippet of current location in a suspended thread. + * + * @param t suspended thread + */ + protected void printSourceLocation(ThreadReference t) { + try { + if (t.frameCount() == 0) { + // TODO: needs to be handled in a better way + System.out.println("call stack empty"); + } else { + Location l = t.frame(0).location(); // current stack frame location + printSourceLocation(l); + } + } catch (IncompatibleThreadStateException ex) { + Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE, null, ex); + } + } + + /** + * Print source code snippet. + * + * @param l {@link Location} object to print source code for + */ + protected void printSourceLocation(Location l) { + try { + //System.out.println(l.sourceName() + ":" + l.lineNumber()); + System.out.println("in method " + l.method() + ":"); + System.out.println(getSourceLine(l.sourcePath(), l.lineNumber(), 2)); + + } catch (AbsentInformationException ex) { + Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE, null, ex); + } + } + + /** + * Read a line from the given file in the builds src folder. 1-based i.e. + * first line has line no. 1 + * + * @param filePath + * @param lineNo + * @return the requested source line + */ + protected String getSourceLine(String filePath, int lineNo, int radius) { + if (lineNo == -1) { + Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE, "invalid line number: {0}", lineNo); + return ""; + } + //System.out.println("getting line: " + lineNo); + File f = new File(srcPath + File.separator + filePath); + String output = ""; + try { + BufferedReader r = new BufferedReader(new FileReader(f)); + int i = 1; + //String line = ""; + while (i <= lineNo + radius) { + String line = r.readLine(); // line no. i + if (line == null) { + break; // end of file + } + if (i >= lineNo - radius) { + if (i > lineNo - radius) { + output += "\n"; // add newlines before all lines but the first + } + output += f.getName() + ":" + i + (i == lineNo ? " => " : " ") + line; + } + i++; + } + r.close(); + return output; + } catch (FileNotFoundException ex) { + //System.err.println(ex); + return f.getName() + ":" + lineNo; + } catch (IOException ex) { + Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE, null, ex); + return ""; + } + } + + /** + * Print info about a ReferenceType. Prints class name, source file name, + * lists methods. + * + * @param rt the reference type to print out + */ + protected void printType(ReferenceType rt) { + System.out.println("ref.type: " + rt); + System.out.println("name: " + rt.name()); + try { + System.out.println("sourceName: " + rt.sourceName()); + } catch (AbsentInformationException ex) { + System.out.println("sourceName: unknown"); + } + System.out.println("methods:"); + for (Method m : rt.methods()) { + System.out.println(m.toString()); + } + } + + /** + * Translate a java source location to a sketch line id. + * + * @param l the location to translate + * @return the corresponding line id, or null if not found + */ + protected LineID locationToLineID(Location l) { + try { + //return lineMap.get(LineID.create(l.sourceName(), l.lineNumber() - 1)); + return javaToSketchLine(new LineID(l.sourceName(), l.lineNumber() - 1)); + + } catch (AbsentInformationException ex) { + Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE, null, ex); + return null; + } + } + + /** + * Translate a line (index) from java space to sketch space. + * + * @param javaLine the java line id + * @return the corresponding sketch line id or null if failed to translate + */ + public LineID javaToSketchLine(LineID javaLine) { + Sketch sketch = editor.getSketch(); + + // it may belong to a pure java file created in the sketch + // try to find an exact filename match and check the extension + SketchCode tab = editor.getTab(javaLine.fileName()); + if (tab != null && tab.isExtension("java")) { + // can translate 1:1 + return originalToRuntimeLine(javaLine); + } + + // check if it is the preprocessed/assembled file for this sketch + // java file name needs to match the sketches filename + if (!javaLine.fileName().equals(sketch.getName() + ".java")) { + return null; + } + + // find the tab (.pde file) this line belongs to + // get the last tab that has an offset not greater than the java line number + for (int i = sketch.getCodeCount() - 1; i >= 0; i--) { + tab = sketch.getCode(i); + // ignore .java files + // the tab's offset must not be greater than the java line number + if (tab.isExtension("pde") && tab.getPreprocOffset() <= javaLine.lineIdx()) { + return originalToRuntimeLine(new LineID(tab.getFileName(), javaLine.lineIdx() - tab.getPreprocOffset())); + } + } + + return null; + } + + /** + * Get the runtime-changed line id for an original sketch line. Used to + * translate line numbers from the VM (which runs on the original line + * numbers) to their current (possibly changed) counterparts. + * + * @param line the original line id (at compile time) + * @return the changed version or the line given as parameter if not found + */ + protected LineID originalToRuntimeLine(LineID line) { + LineID transformed = runtimeLineChanges.get(line); + if (transformed == null) { + return line; + } + return transformed; + } + + /** + * Get the original line id for a sketch line that was changed at runtime. + * Used to translate line numbers from the UI at runtime (which can differ + * from the ones the VM runs on) to their original counterparts. + * + * @param line the (possibly) changed runtime line + * @return the original line or the line given as parameter if not found + */ + protected LineID runtimeToOriginalLine(LineID line) { + for (Entry entry : runtimeLineChanges.entrySet()) { + if (entry.getValue().equals(line)) { + return entry.getKey(); + } + } + return line; + } + + /** + * Translate a line (index) from sketch space to java space. + * + * @param sketchLine the sketch line id + * @return the corresponding java line id or null if failed to translate + */ + public LineID sketchToJavaLine(LineID sketchLine) { + sketchLine = runtimeToOriginalLine(sketchLine); // transform back to orig (before changes at runtime) + + // check if there is a tab for this line + SketchCode tab = editor.getTab(sketchLine.fileName()); + if (tab == null) { + return null; + } + + // check if the tab is a pure java file anyway + if (tab.isExtension("java")) { + // 1:1 translation + return sketchLine; + } + + // the java file has a name sketchname.java + // just add the tab's offset to get the java name + LineID javaLine = new LineID(editor.getSketch().getName() + ".java", sketchLine.lineIdx() + tab.getPreprocOffset()); + return javaLine; + } + + /** + * Start tracking all line changes (due to edits) in the current tab. + */ + // TODO: maybe move this to the editor? + protected void startTrackingLineChanges() { + SketchCode tab = editor.getSketch().getCurrentCode(); + if (runtimeTabsTracked.contains(tab.getFileName())) { + return; + } + + for (int i = 0; i < tab.getLineCount(); i++) { + LineID old = new LineID(tab.getFileName(), i); + LineID tracked = new LineID(tab.getFileName(), i); + tracked.startTracking(editor.currentDocument()); + runtimeLineChanges.put(old, tracked); + } + runtimeTabsTracked.add(tab.getFileName()); + //System.out.println("tracking tab: " + tab.getFileName()); + } + + /** + * Stop tracking line changes in all tabs. + */ + protected void stopTrackingLineChanges() { + //System.out.println("stop tracking line changes"); + for (LineID tracked : runtimeLineChanges.values()) { + tracked.stopTracking(); + } + runtimeLineChanges.clear(); + runtimeTabsTracked.clear(); + } +} diff --git a/pdex/src/processing/mode/experimental/ErrorBar.java b/pdex/src/processing/mode/experimental/ErrorBar.java new file mode 100755 index 000000000..b858dcdbb --- /dev/null +++ b/pdex/src/processing/mode/experimental/ErrorBar.java @@ -0,0 +1,316 @@ +/* + Part of the XQMode project - https://github.com/Manindra29/XQMode + + Under Google Summer of Code 2012 - + http://www.google-melange.com/gsoc/homepage/google/gsoc2012 + + Copyright (C) 2012 Manindra Moharana + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package processing.mode.experimental; + +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionListener; +import java.util.ArrayList; + +import javax.swing.JPanel; +import javax.swing.SwingWorker; +import javax.swing.text.BadLocationException; + +import processing.app.Base; +import processing.app.SketchCode; + +/** + * The bar on the left of the text area which displays all errors as rectangles.
+ *
+ * All errors and warnings of a sketch are drawn on the bar, clicking on one, + * scrolls to the tab and location. Error messages displayed on hover. Markers + * are not in sync with the error line. Similar to eclipse's right error bar + * which displays the overall errors in a document + * + * @author Manindra Moharana <me@mkmoharana.com> + * + */ +public class ErrorBar extends JPanel { + /** + * Preferred height of the component + */ + protected int preferredHeight; + + /** + * Preferred height of the component + */ + protected int preferredWidth = 12; + + /** + * Height of marker + */ + public static final int errorMarkerHeight = 4; + + /** + * Color of Error Marker + */ + public Color errorColor = new Color(0xED2630); + + /** + * Color of Warning Marker + */ + public Color warningColor = new Color(0xFFC30E); + + /** + * Background color of the component + */ + public Color backgroundColor = new Color(0x2C343D); + + /** + * DebugEditor instance + */ + protected DebugEditor editor; + + /** + * ErrorCheckerService instance + */ + protected ErrorCheckerService errorCheckerService; + + /** + * Stores error markers displayed PER TAB along the error bar. + */ + protected ArrayList errorPoints = new ArrayList(); + + /** + * Stores previous list of error markers. + */ + protected ArrayList errorPointsOld = new ArrayList(); + + public void paintComponent(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + g.setColor(backgroundColor); + g.fillRect(0, 0, getWidth(), getHeight()); + + for (ErrorMarker emarker : errorPoints) { + if (emarker.getType() == ErrorMarker.Error) { + g.setColor(errorColor); + } else { + g.setColor(warningColor); + } + g.fillRect(2, emarker.getY(), (getWidth() - 3), errorMarkerHeight); + } + } + + public Dimension getPreferredSize() { + return new Dimension(preferredWidth, preferredHeight); + } + + public Dimension getMinimumSize() { + return getPreferredSize(); + } + + public ErrorBar(DebugEditor editor, int height, ExperimentalMode mode) { + this.editor = editor; + this.preferredHeight = height; + this.errorCheckerService = editor.errorCheckerService; + errorColor = mode.getThemeColor("errorbar.errorcolor", errorColor); + warningColor = mode + .getThemeColor("errorbar.warningcolor", warningColor); + backgroundColor = mode.getThemeColor("errorbar.backgroundcolor", + backgroundColor); + addListeners(); + } + + /** + * Update error markers in the error bar. + * + * @param problems + * - List of problems. + */ + synchronized public void updateErrorPoints(final ArrayList problems) { + + // NOTE TO SELF: ErrorMarkers are calculated for the present tab only + // Error Marker index in the arraylist is LOCALIZED for current tab. + // Also, need to do the update in the UI thread to prevent concurrency issues. + final int fheight = this.getHeight(); + SwingWorker worker = new SwingWorker() { + + protected Object doInBackground() throws Exception { + SketchCode sc = editor.getSketch().getCurrentCode(); + int totalLines = 0, currentTab = editor.getSketch() + .getCurrentCodeIndex(); + try { + totalLines = Base.countLines(sc.getDocument() + .getText(0, sc.getDocument().getLength())) + 1; + } catch (BadLocationException e) { + e.printStackTrace(); + } + // System.out.println("Total lines: " + totalLines); + synchronized (errorPoints) { + errorPointsOld.clear(); + for (ErrorMarker marker : errorPoints) { + errorPointsOld.add(marker); + } + errorPoints.clear(); + + // Each problem.getSourceLine() will have an extra line added + // because of + // class declaration in the beginning as well as default imports + synchronized (problems) { + for (Problem problem : problems) { + if (problem.getTabIndex() == currentTab) { + // Ratio of error line to total lines + float y = (problem.getLineNumber() - errorCheckerService.defaultImportsOffset) + / ((float) totalLines); + // Ratio multiplied by height of the error bar + y *= fheight - 15; // -15 is just a vertical offset + errorPoints + .add(new ErrorMarker(problem, (int) y, + problem.isError() ? ErrorMarker.Error + : ErrorMarker.Warning)); + // System.out.println("Y: " + y); + } + } + } + } + return null; + } + + protected void done() { + repaint(); + } + }; + + try { + worker.execute(); // I eat concurrency bugs for breakfast. + } catch (Exception exp) { + System.out.println("Errorbar update markers is slacking." + + exp.getMessage()); + // e.printStackTrace(); + } + } + + /** + * Check if new errors have popped up in the sketch since the last check + * + * @return true - if errors have changed + */ + public boolean errorPointsChanged() { + if (errorPointsOld.size() != errorPoints.size()) { + editor.getTextArea().repaint(); + // System.out.println("2 Repaint " + System.currentTimeMillis()); + return true; + } + + else { + for (int i = 0; i < errorPoints.size(); i++) { + if (errorPoints.get(i).getY() != errorPointsOld.get(i).getY()) { + editor.getTextArea().repaint(); + // System.out.println("3 Repaint " + + // System.currentTimeMillis()); + return true; + } + } + } + return false; + } + + /** + * Add various mouse listeners. + */ + protected void addListeners() { + + this.addMouseListener(new MouseAdapter() { + + // Find out which error/warning the user has clicked + // and then scroll to that + @Override + public void mouseClicked(final MouseEvent e) { + SwingWorker worker = new SwingWorker() { + + protected Object doInBackground() throws Exception { + for (ErrorMarker eMarker : errorPoints) { + // -2 and +2 are extra allowance, clicks in the + // vicinity of the markers register that way + if (e.getY() >= eMarker.getY() - 2 + && e.getY() <= eMarker.getY() + 2 + errorMarkerHeight) { + errorCheckerService.scrollToErrorLine(eMarker.getProblem()); + return null; + } + } + return null; + } + }; + + try { + worker.execute(); + } catch (Exception exp) { + System.out.println("Errorbar mouseClicked is slacking." + + exp.getMessage()); + // e.printStackTrace(); + } + + } + }); + + // Tooltip on hover + this.addMouseMotionListener(new MouseMotionListener() { + + @Override + public void mouseMoved(final MouseEvent evt) { + // System.out.println(e); + SwingWorker worker = new SwingWorker() { + + protected Object doInBackground() throws Exception { + for (ErrorMarker eMarker : errorPoints) { + if (evt.getY() >= eMarker.getY() - 2 + && evt.getY() <= eMarker.getY() + 2 + errorMarkerHeight) { + Problem p = eMarker.getProblem(); + String msg = (p.isError() ? "Error: " : "Warning: ") + + p.getMessage(); + setToolTipText(msg); + setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + break; + } + } + return null; + } + }; + + try { + worker.execute(); + } catch (Exception exp) { + System.out + .println("Errorbar mousemoved Worker is slacking." + + exp.getMessage()); + // e.printStackTrace(); + } + } + + @Override + public void mouseDragged(MouseEvent arg0) { + + } + }); + + } + +} diff --git a/pdex/src/processing/mode/experimental/ErrorCheckerService.java b/pdex/src/processing/mode/experimental/ErrorCheckerService.java new file mode 100644 index 000000000..2f63a752a --- /dev/null +++ b/pdex/src/processing/mode/experimental/ErrorCheckerService.java @@ -0,0 +1,1702 @@ +/* + * Copyright (C) 2012-14 Manindra Moharana + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +import static processing.mode.experimental.ExperimentalMode.log; +import static processing.mode.experimental.ExperimentalMode.logE; + +import java.io.File; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.TreeMap; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.table.DefaultTableModel; +import javax.swing.text.BadLocationException; +import javax.swing.text.Element; +import javax.swing.text.PlainDocument; + +import org.eclipse.jdt.core.JavaCore; +import org.eclipse.jdt.core.compiler.IProblem; +import org.eclipse.jdt.core.dom.AST; +import org.eclipse.jdt.core.dom.ASTNode; +import org.eclipse.jdt.core.dom.ASTParser; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; + +import processing.app.Base; +import processing.app.Editor; +import processing.app.EditorStatus; +import processing.app.Library; +import processing.app.SketchCode; +import processing.app.syntax.SyntaxDocument; +import processing.core.PApplet; +import processing.mode.java.preproc.PdePreprocessor; + +/** + * The main error checking service + * + * @author Manindra Moharana <me@mkmoharana.com> + * + */ +public class ErrorCheckerService implements Runnable{ + + protected DebugEditor editor; + /** + * Error check happens every sleepTime milliseconds + */ + public static final int sleepTime = 4000; + + /** + * The amazing eclipse ast parser + */ + protected ASTParser parser; + + /** + * Used to indirectly stop the Error Checker Thread + */ + protected AtomicBoolean stopThread; + + /** + * If true, Error Checking is paused. Calls to checkCode() become useless. + */ + protected AtomicBoolean pauseThread; + + //protected ErrorWindow errorWindow; + + /** + * IProblem[] returned by parser stored in here + */ + protected IProblem[] problems; + + /** + * Class name of current sketch + */ + protected String className; + + /** + * Source code of current sketch + */ + protected String sourceCode; + + /** + * URLs of extra imports jar files stored here. + */ + protected URL[] classpath; + + /** + * Stores all Problems in the sketch + */ + public ArrayList problemsList; + + /** + * How many lines are present till the initial class declaration? In static + * mode, this would include imports, class declaration and setup + * declaration. In nomral mode, this would include imports, class + * declaration only. It's fate is decided inside preprocessCode() + */ + public int mainClassOffset; + + /** + * Fixed p5 offsets for all sketches + */ + public int defaultImportsOffset; + + /** + * Is the sketch running in static mode or active mode? + */ + public boolean staticMode = false; + + /** + * Compilation Unit for current sketch + */ + protected CompilationUnit cu; + + /** + * The Compilation Unit generated during compile check + */ + protected CompilationUnit compileCheckCU; + + /** + * This Compilation Unit points to the last error free CU + */ + protected CompilationUnit lastCorrectCU; + + /** + * If true, compilation checker will be reloaded with updated classpath + * items. + */ + protected boolean loadCompClass = true; + + /** + * Compiler Checker class. Note that methods for compilation checking are + * called from the compilationChecker object, not from this + */ + protected Class checkerClass; + + /** + * Compilation Checker object. + */ + protected CompilationChecker compilationChecker; + + + /** + * List of jar files to be present in compilation checker's classpath + */ + protected ArrayList classpathJars; + + /** + * Timestamp - for measuring total overhead + */ + protected long lastTimeStamp = System.currentTimeMillis(); + + /** + * Used for displaying the rotating slash on the Problem Window title bar + */ + protected String[] slashAnimation = { "|", "/", "--", "\\", "|", "/", "--", + "\\" }; + protected int slashAnimationIndex = 0; + + /** + * Used to detect if the current tab index has changed and thus repaint the + * textarea. + */ + public int currentTab = 0, lastTab = 0; + + /** + * Stores the current import statements in the program. Used to compare for + * changed import statements and update classpath if needed. + */ + protected ArrayList programImports; + + /** + * List of imports when sketch was last checked. Used for checking for + * changed imports + */ + protected ArrayList previousImports = new ArrayList(); + + /** + * Teh Preprocessor + */ + protected XQPreprocessor xqpreproc; + + /** + * Regexp for import statements. (Used from Processing source) + */ + final public String importRegexp = "(?:^|;)\\s*(import\\s+)((?:static\\s+)?\\S+)(\\s*;)"; + + /** + * Regexp for function declarations. (Used from Processing source) + */ + final Pattern FUNCTION_DECL = Pattern + .compile("(^|;)\\s*((public|private|protected|final|static)\\s+)*" + + "(void|int|float|double|String|char|byte|boolean)" + + "(\\s*\\[\\s*\\])?\\s+[a-zA-Z0-9]+\\s*\\(", Pattern.MULTILINE); + + protected ErrorMessageSimplifier errorMsgSimplifier; + + public ErrorCheckerService(DebugEditor debugEditor) { + ensureMinP5Version(); + this.editor = debugEditor; + stopThread = new AtomicBoolean(false); + pauseThread = new AtomicBoolean(false); + + problemsList = new ArrayList(); + classpathJars = new ArrayList(); + + initParser(); + //initializeErrorWindow(); + xqpreproc = new XQPreprocessor(); + PdePreprocessor pdePrepoc = new PdePreprocessor(null); + defaultImportsOffset = pdePrepoc.getCoreImports().length + + pdePrepoc.getDefaultImports().length + 1; + astGenerator = new ASTGenerator(this); + syntaxErrors = new AtomicBoolean(true); + containsErrors = new AtomicBoolean(true); + errorMsgSimplifier = new ErrorMessageSimplifier(); + tempErrorLog = new TreeMap(); + sketchChangedListener = new SketchChangedListener(); +// for (final SketchCode sc : editor.getSketch().getCode()) { +// sc.getDocument().addDocumentListener(sketchChangedListener); +// } + } + + /** + * Initializes ASTParser + */ + protected void initParser() { + try { + parser = ASTParser.newParser(AST.JLS4); + } catch (Exception e) { + System.err.println("Experimental Mode initialization failed. " + + "Are you running the right version of Processing? "); + pauseThread(); + } catch (Error e) { + System.err.println("Experimental Mode initialization failed. "); + e.printStackTrace(); + pauseThread(); + } + } + + /** + * Initialiazes the Error Window + */ + /*public void initializeErrorWindow() { + + if (editor == null) { + return; + } + + if (errorWindow != null) { + return; + } + + final ErrorCheckerService thisService = this; + final DebugEditor thisEditor = editor; + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + errorWindow = new ErrorWindow(thisEditor, thisService); + // errorWindow.setVisible(true); + editor.toFront(); + errorWindow.errorTable.setFocusable(false); + editor.setSelection(0, 0); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + }*/ + + /** + * Ensure user is running the minimum P5 version + */ + public void ensureMinP5Version(){ + // Processing 2.1.2 - Revision 0225 + if(Base.getRevision() < 225){ +// System.err.println("ERROR: PDE X requires Processing 2.1.2 or higher."); + Base.showWarning("Error", "ERROR: PDE X requires Processing 2.1.2 or higher.", null); + } + } + + /** + * The way the error checking happens is: DocumentListeners are added + * to each SketchCode object. Whenever the document is edited, it call + * runManualErrorCheck(). Internally, an atomic integer counter is incremented. + * The ECS thread checks the value of this counter evey sleepTime seconds. + * If the counter is non zero, error checking is done(in the ECS thread) + * and the counter is reset. + */ + public void run() { + stopThread.set(false); + + checkCode(); + if(!hasSyntaxErrors()) + editor.showProblemListView(XQConsoleToggle.CONSOLE); + // Make sure astGen has at least one CU to start with + // This is when the loaded sketch already has syntax errors. + // Completion wouldn't be complete, but it'd be still something + // better than nothing + astGenerator.buildAST(cu); + handleErrorCheckingToggle(); + while (!stopThread.get()) { + try { + // Take a nap. + Thread.sleep(sleepTime); + } catch (Exception e) { + log("Oops! [ErrorCheckerThreaded]: " + e); + // e.printStackTrace(); + } + + updatePaintedThingys(); + updateEditorStatus(); + updateSketchCodeListeners(); + if (pauseThread.get()) + continue; + if(textModified.get() == 0) + continue; + // Check every x seconds + checkCode(); + checkForMissingImports(); + } + + astGenerator.disposeAllWindows(); + compilationChecker = null; + checkerClass = null; + classLoader = null; + System.gc(); + logE("Thread stopped: " + editor.getSketch().getName()); + System.gc(); + } + + protected void updateSketchCodeListeners() { + for (final SketchCode sc : editor.getSketch().getCode()) { + boolean flag = false; + if (sc.getDocument() == null + || ((SyntaxDocument) sc.getDocument()).getDocumentListeners() == null) + continue; + for (DocumentListener dl : ((SyntaxDocument)sc.getDocument()).getDocumentListeners()) { + if(dl.equals(sketchChangedListener)){ + flag = true; + break; + } + } + if(!flag){ + // log("Adding doc listener to " + sc.getPrettyName()); + sc.getDocument().addDocumentListener(sketchChangedListener); + } + } + } + + protected void checkForMissingImports() { + for (Problem p : problemsList) { + if(p.getMessage().endsWith(" cannot be resolved to a type"));{ + int idx = p.getMessage().indexOf(" cannot be resolved to a type"); + if(idx > 1){ + String missingClass = p.getMessage().substring(0, idx); + //log("Will suggest for type:" + missingClass); + astGenerator.suggestImports(missingClass); + } + } + } + } + + protected ASTGenerator astGenerator; + + public ASTGenerator getASTGenerator() { + return astGenerator; + } + + /** + * This thing acts as an event queue counter of sort. + * Since error checking happens on demand, anytime this counter + * goes above 0, error check is triggered, and counter reset. + * It's thread safe to avoid any mess. + */ + protected AtomicInteger textModified = new AtomicInteger(); + + /** + * Triggers error check + */ + public void runManualErrorCheck() { + // log("Error Check."); + textModified.incrementAndGet(); + } + + protected SketchChangedListener sketchChangedListener; + protected class SketchChangedListener implements DocumentListener{ + + private SketchChangedListener(){ + } + + @Override + public void insertUpdate(DocumentEvent e) { + if (ExperimentalMode.errorCheckEnabled){ + runManualErrorCheck(); + //log("doc insert update, man error check.."); + } + } + + @Override + public void removeUpdate(DocumentEvent e) { + if (ExperimentalMode.errorCheckEnabled){ + runManualErrorCheck(); + //log("doc remove update, man error check.."); + } + } + + @Override + public void changedUpdate(DocumentEvent e) { + if (ExperimentalMode.errorCheckEnabled){ + runManualErrorCheck(); + //log("doc changed update, man error check.."); + } + } + + } + + public int compilationUnitState = 0; + + protected boolean checkCode() { + // log("checkCode() " + textModified.get()); + lastTimeStamp = System.currentTimeMillis(); + try { + sourceCode = preprocessCode(editor.getSketch().getMainProgram()); + compilationUnitState = 0; + syntaxCheck(); + // log(editor.getSketch().getName() + "1 MCO " + mainClassOffset); + // No syntax errors, proceed for compilation check, Stage 2. + + //if(hasSyntaxErrors()) astGenerator.buildAST(null); + if (!hasSyntaxErrors()) { + + } + if (problems.length == 0 && editor.compilationCheckEnabled) { + //mainClassOffset++; // just a hack. + + sourceCode = xqpreproc.doYourThing(sourceCode, programImports); + prepareCompilerClasspath(); +// mainClassOffset = xqpreproc.mainClassOffset; // tiny, but +// // significant +// if (staticMode) { +// mainClassOffset++; // Extra line for setup() decl. +// } + // log(sourceCode); + // log("--------------------------"); + compileCheck(); + // log(editor.getSketch().getName() + "2 MCO " + mainClassOffset); + } + + astGenerator.buildAST(cu); + if(!ExperimentalMode.errorCheckEnabled){ + problemsList.clear(); + log("Error Check disabled, so not updating UI."); + } + calcPDEOffsetsForProbList(); + updateErrorTable(); + editor.updateErrorBar(problemsList); + updateEditorStatus(); + editor.getTextArea().repaint(); + updatePaintedThingys(); + editor.updateErrorToggle(); + + int x = textModified.get(); + //log("TM " + x); + if (x >= 2) { + textModified.set(2); + x = 2; + } + + if (x > 0) + textModified.set(x - 1); + else + textModified.set(0); + return true; + + } catch (Exception e) { + log("Oops! [ErrorCheckerService.checkCode]: " + e); + e.printStackTrace(); + } + return false; + } + + protected AtomicBoolean syntaxErrors, containsErrors; + + public boolean hasSyntaxErrors(){ + return syntaxErrors.get(); + } + + public boolean hasErrors(){ + return containsErrors.get(); + } + + protected TreeMap tempErrorLog; + + protected void syntaxCheck() { + syntaxErrors.set(true); + containsErrors.set(true); + parser.setSource(sourceCode.toCharArray()); + parser.setKind(ASTParser.K_COMPILATION_UNIT); + + Map options = JavaCore.getOptions(); + + JavaCore.setComplianceOptions(JavaCore.VERSION_1_6, options); + options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_6); + options.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.ENABLED); + parser.setCompilerOptions(options); + + if (cu == null) + cu = (CompilationUnit) parser.createAST(null); + else { + synchronized (cu) { + cu = (CompilationUnit) parser.createAST(null); + } + } + compilationUnitState = 1; + synchronized (problemsList) { + + // Store errors returned by the ast parser + problems = cu.getProblems(); + // log("Problem Count: " + problems.length); + // Populate the probList + problemsList = new ArrayList(); + for (int i = 0; i < problems.length; i++) { + int a[] = calculateTabIndexAndLineNumber(problems[i].getSourceLineNumber()); + Problem p = new Problem(problems[i], a[0], a[1]); + problemsList.add(p); +// log(problems[i].getMessage()); +// for (String j : problems[i].getArguments()) { +// log("arg " + j); +// } + // log(p.toString()); + } + + if (problems.length == 0) { + syntaxErrors.set(false); + containsErrors.set(false); + parser.setSource(sourceCode.toCharArray()); + parser.setKind(ASTParser.K_COMPILATION_UNIT); + parser.setCompilerOptions(options); + lastCorrectCU = (CompilationUnit) parser.createAST(null); + } else { + syntaxErrors.set(true); + containsErrors.set(true); + } + } + } + + protected URLClassLoader classLoader; + + protected void compileCheck() { + + // CU needs to be updated coz before compileCheck xqpreprocessor is run on + // the source code which makes some further changes + //TODO Check if this breaks things + + parser.setSource(sourceCode.toCharArray()); + parser.setKind(ASTParser.K_COMPILATION_UNIT); + + Map options = JavaCore.getOptions(); + + JavaCore.setComplianceOptions(JavaCore.VERSION_1_6, options); + options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_6); + options.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.ENABLED); + parser.setCompilerOptions(options); + + if (compileCheckCU == null) + compileCheckCU = (CompilationUnit) parser.createAST(null); + else { + synchronized (compileCheckCU) { + compileCheckCU = (CompilationUnit) parser.createAST(null); + } + } + if(!hasSyntaxErrors()) + lastCorrectCU = compileCheckCU; + cu = compileCheckCU; + + compilationUnitState = 2; + // Currently (Sept, 2012) I'm using Java's reflection api to load the + // CompilationChecker class(from CompilationChecker.jar) that houses the + // Eclispe JDT compiler, and call its getErrorsAsObj method to obtain + // errors. This way, I'm able to add the paths of contributed libraries + // to the classpath of CompilationChecker, dynamically. The eclipse compiler + // needs all referenced libraries in the classpath. Totally a hack. If you find + // a better method, do let me know. + + try { + + // NOTE TO SELF: If classpath contains null Strings + // URLClassLoader shoots NPE bullets. + + // If imports have changed, reload classes with new classpath. + if (loadCompClass) { + + classpath = new URL[classpathJars.size()]; + int ii = 0; + for (; ii < classpathJars.size(); ii++) { + classpath[ii] = classpathJars.get(ii); + } + + compilationChecker = null; + classLoader = null; + System.gc(); + // log("CP Len -- " + classpath.length); + classLoader = new URLClassLoader(classpath); + compilationChecker = new CompilationChecker(); + loadCompClass = false; + } + + if (compilerSettings == null) { + prepareCompilerSetting(); + } + + synchronized (problemsList) { + problems = compilationChecker.getErrors(className, sourceCode, compilerSettings, classLoader); + if (problems == null) { + return; + } + + for (int i = 0; i < problems.length; i++) { + + IProblem problem = problems[i]; + + // added a -1 to line number because in compile check code + // an extra package statement is added, so all line numbers + // are increased by 1 + int a[] = calculateTabIndexAndLineNumber(problem.getSourceLineNumber() - 1); + + Problem p = new Problem(problem, a[0], a[1]); + if (problem.isError()) { + p.setType(Problem.ERROR); + containsErrors.set(true); // set flag + } + + if (problem.isWarning()) { + p.setType(Problem.WARNING); + } + + // If warnings are disabled, skip 'em + if (p.isWarning() && !ExperimentalMode.warningsEnabled) { + continue; + } + problemsList.add(p); + } + } + } + + catch (Exception e) { + System.err.println("compileCheck() problem." + e); + e.printStackTrace(); + pauseThread(); + } catch (NoClassDefFoundError e) { + System.err + .println(e + + " compileCheck() problem. Somebody tried to mess with Experimental Mode files."); + pauseThread(); + } catch(OutOfMemoryError e) { + System.err.println("Processing has used up its maximum alloted memory. Please close some Processing " + + " windows and then reopen this sketch."); + pauseThread(); + } + + // log("Compilecheck, Done."); + } + + /** + * Calculates PDE Offsets from Java Offsets for Problems + */ + private void calcPDEOffsetsForProbList() { + try { + PlainDocument javaSource = new PlainDocument(); + // Code in pde tabs stored as PlainDocument + PlainDocument pdeTabs[] = new PlainDocument[editor.getSketch() + .getCodeCount()]; +// log("calcPDEOffsetsForProbList() mco: " + mainClassOffset + " CU state: " +// + compilationUnitState); + + javaSource.insertString(0, sourceCode, null); + for (int i = 0; i < pdeTabs.length; i++) { + SketchCode sc = editor.getSketch().getCode(i); + pdeTabs[i] = new PlainDocument(); + if (editor.getSketch().getCurrentCode().equals(sc)) { + pdeTabs[i].insertString(0, + sc.getDocument().getText(0, + sc.getDocument() + .getLength()), + null); + } else { + pdeTabs[i].insertString(0, + sc.getProgram(), + null); + } + } + int pkgNameOffset = ("package " + className + ";\n").length(); + // package name is added only during compile check + if(compilationUnitState != 2) pkgNameOffset = 0; + + for (Problem p : problemsList) { + int prbStart = p.getIProblem().getSourceStart() - pkgNameOffset, prbEnd = p + .getIProblem().getSourceEnd() - pkgNameOffset; + // log(p.toString()); + // log("IProblem Start " + prbStart + ", End " + prbEnd); + int javaLineNumber = p.getSourceLineNumber() + - ((compilationUnitState != 2) ? 1 : 2); + Element lineElement = javaSource.getDefaultRootElement() + .getElement(javaLineNumber); + if (lineElement == null) { + log("calcPDEOffsetsForProbList(): Couldn't fetch javalinenum " + + javaLineNumber + "\nProblem: " + p); + p.setPDEOffsets(-1,-1); + continue; + } + String javaLine = javaSource + .getText(lineElement.getStartOffset(), lineElement.getEndOffset() + - lineElement.getStartOffset()); + + Element pdeLineElement = pdeTabs[p.getTabIndex()] + .getDefaultRootElement().getElement(p.getLineNumber()); + if (pdeLineElement == null) { + log("calcPDEOffsetsForProbList(): Couldn't fetch pdelinenum " + + javaLineNumber + "\nProblem: " + p); + p.setPDEOffsets(-1,-1); + continue; + } + String pdeLine = pdeTabs[p.getTabIndex()] + .getText(pdeLineElement.getStartOffset(), pdeLineElement.getEndOffset() + - pdeLineElement.getStartOffset()); + //log("calcPDEOffsetsForProbList(): P " + pdeLine); + //log("calcPDEOffsetsForProbList(): J " + javaLine); + OffsetMatcher ofm = new OffsetMatcher(pdeLine, javaLine); + //log(""); + int pdeOffset = ofm.getPdeOffForJavaOff(prbStart + - lineElement.getStartOffset(), (prbEnd - prbStart + 1)); +// astGenerator.highlightPDECode(p.getTabIndex(), p.getLineNumber(), +// pdeOffset, (prbEnd - prbStart + 1)); + p.setPDEOffsets(pdeOffset, pdeOffset + prbEnd - prbStart); + } + } catch (BadLocationException ble) { + ble.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public CompilationUnit getLastCorrectCU(){ + return lastCorrectCU; + } + + public CompilationUnit getLatestCU(){ + return compileCheckCU; + } + + private int loadClassCounter = 0; + public URLClassLoader getSketchClassLoader() { + loadClassCounter++; + if(loadClassCounter > 100){ + loadClassCounter = 0; + classLoader = null; + System.gc(); + classLoader = new URLClassLoader(classpath); + } + return classLoader; + } + + /** + * Processes import statements to obtain classpaths of contributed + * libraries. This would be needed for compilation check. Also, adds + * stuff(jar files, class files, candy) from the code folder. And it looks + * messed up. + * + */ + protected void prepareCompilerClasspath() { + if (!loadCompClass) { + return; + } + + synchronized (classpathJars) { + // log("1.."); + classpathJars = new ArrayList(); + String entry = ""; + boolean codeFolderChecked = false; + for (ImportStatement impstat : programImports) { + String item = impstat.getImportName(); + int dot = item.lastIndexOf('.'); + entry = (dot == -1) ? item : item.substring(0, dot); + + entry = entry.substring(6).trim(); + // log("Entry--" + entry); + if (ignorableImport(entry)) { + // log("Ignoring: " + entry); + continue; + } + Library library = null; + + // Try to get the library classpath and add it to the list + try { + library = editor.getMode().getLibrary(entry); + // log("lib->" + library.getClassPath() + "<-"); + String libraryPath[] = PApplet.split(library.getClassPath() + .substring(1).trim(), File.pathSeparatorChar); + for (int i = 0; i < libraryPath.length; i++) { + // log(entry + " ::" + // + new File(libraryPath[i]).toURI().toURL()); + classpathJars.add(new File(libraryPath[i]).toURI().toURL()); + } + // log("-- "); + // classpath[count] = (new File(library.getClassPath() + // .substring(1))).toURI().toURL(); + // log(" found "); + // log(library.getClassPath().substring(1)); + } catch (Exception e) { + if (library == null && !codeFolderChecked) { + // log(1); + // Look around in the code folder for jar files + if (editor.getSketch().hasCodeFolder()) { + File codeFolder = editor.getSketch().getCodeFolder(); + + // get a list of .jar files in the "code" folder + // (class files in subfolders should also be picked up) + String codeFolderClassPath = Base + .contentsToClassPath(codeFolder); + codeFolderChecked = true; + if (codeFolderClassPath.equalsIgnoreCase("")) { + System.err.println("Experimental Mode: Yikes! Can't find \"" + + entry + + "\" library! Line: " + + impstat.getLineNumber() + + " in tab: " + + editor.getSketch().getCode(impstat.getTab()) + .getPrettyName()); + System.out + .println("Please make sure that the library is present in /libraries folder or in the code folder of your sketch"); + + } + String codeFolderPath[] = PApplet.split( + codeFolderClassPath.substring(1).trim(), + File.pathSeparatorChar); + try { + for (int i = 0; i < codeFolderPath.length; i++) { + classpathJars.add(new File(codeFolderPath[i]) + .toURI().toURL()); + } + + } catch (Exception e2) { + System.out + .println("Yikes! codefolder, prepareImports(): " + + e2); + } + } else { + System.err.println("Experimental Mode: Yikes! Can't find \"" + + entry + + "\" library! Line: " + + impstat.getLineNumber() + + " in tab: " + + editor.getSketch().getCode(impstat.getTab()) + .getPrettyName()); + System.out + .println("Please make sure that the library is present in /libraries folder or in the code folder of your sketch"); + } + + } else { + System.err + .println("Yikes! There was some problem in prepareImports(): " + + e); + System.err.println("I was processing: " + entry); + + // e.printStackTrace(); + } + } + + } + } + astGenerator.loadJars(); // update jar file for completion lookup + } + + /** + * Ignore processing packages, java.*.*. etc. + * + * @param packageName + * @return boolean + */ + protected boolean ignorableImport(String packageName) { + // packageName.startsWith("processing.") + // || + if (packageName.startsWith("java.") || packageName.startsWith("javax.")) { + return true; + } + return false; + } + + /** + * Various option for JDT Compiler + */ + @SuppressWarnings("rawtypes") + protected Map compilerSettings; + + /** + * Sets compiler options for JDT Compiler + */ + @SuppressWarnings({ "unchecked", "rawtypes" }) + protected void prepareCompilerSetting() { + compilerSettings = new HashMap(); + + compilerSettings.put(CompilerOptions.OPTION_LineNumberAttribute, + CompilerOptions.GENERATE); + compilerSettings.put(CompilerOptions.OPTION_SourceFileAttribute, + CompilerOptions.GENERATE); + compilerSettings.put(CompilerOptions.OPTION_Source, + CompilerOptions.VERSION_1_6); + compilerSettings.put(CompilerOptions.OPTION_ReportUnusedImport, + CompilerOptions.IGNORE); + compilerSettings.put(CompilerOptions.OPTION_ReportMissingSerialVersion, + CompilerOptions.IGNORE); + compilerSettings.put(CompilerOptions.OPTION_ReportRawTypeReference, + CompilerOptions.IGNORE); + compilerSettings.put( + CompilerOptions.OPTION_ReportUncheckedTypeOperation, + CompilerOptions.IGNORE); + } + + + /** + * Updates the error table in the Error Window. + */ + public void updateErrorTable() { + + try { + String[][] errorData = new String[problemsList.size()][3]; + for (int i = 0; i < problemsList.size(); i++) { + errorData[i][0] = problemsList.get(i).getMessage(); ////TODO: this is temporary + //+ " : " + errorMsgSimplifier.getIDName(problemsList.get(i).getIProblem().getID()); + errorData[i][1] = editor.getSketch() + .getCode(problemsList.get(i).getTabIndex()).getPrettyName(); + errorData[i][2] = (problemsList.get(i).getLineNumber() + 1) + ""; + // Added +1 because lineNumbers internally are 0-indexed + + //TODO: This is temporary + if (tempErrorLog.size() < 200) + tempErrorLog.put(problemsList.get(i).getMessage(), problemsList + .get(i).getIProblem()); + } + + DefaultTableModel tm = new DefaultTableModel(errorData, + XQErrorTable.columnNames); + // Update error table in the editor + editor.updateTable(tm); + + /* + if (errorWindow != null) { + if (errorWindow.isVisible()) { + errorWindow.updateTable(tm); + } + + // A rotating slash animation on the title bar to show + // that error checker thread is running + + slashAnimationIndex++; + if (slashAnimationIndex == slashAnimation.length) { + slashAnimationIndex = 0; + } + if (editor != null) { + String info = slashAnimation[slashAnimationIndex] + " T:" + + (System.currentTimeMillis() - lastTimeStamp) + + "ms"; + errorWindow.setTitle("Problems - " + + editor.getSketch().getName() + " " + info); + } + }*/ + + } catch (Exception e) { + log("Exception at updateErrorTable() " + e); + e.printStackTrace(); + pauseThread(); + } + + } + + /** + * Repaints the textarea if required + */ + public void updatePaintedThingys() { + currentTab = editor.getSketch().getCodeIndex( + editor.getSketch().getCurrentCode()); + //log("Tab changed " + currentTab + " LT " + lastTab); + if (currentTab != lastTab) { + textModified.set(5); + lastTab = currentTab; + editor.getTextArea().repaint(); + editor.statusEmpty(); + return; + } + + } + + protected int lastCaretLine = -1; + + /** + * Updates editor status bar, depending on whether the caret is on an error + * line or not + */ + public void updateEditorStatus() { + + if(editor.getStatusMode() == EditorStatus.EDIT) return; + // editor.statusNotice("Position: " + + // editor.getTextArea().getCaretLine()); + if(ExperimentalMode.errorCheckEnabled) + synchronized (editor.errorBar.errorPoints) { + for (ErrorMarker emarker : editor.errorBar.errorPoints) { + if (emarker.getProblem().getLineNumber() == editor.getTextArea() + .getCaretLine()) { + if (emarker.getType() == ErrorMarker.Warning) { + editor.statusMessage(emarker.getProblem().getMessage(), + DebugEditor.STATUS_INFO); + //+ " : " + errorMsgSimplifier.getIDName(emarker.problem.getIProblem().getID())); + //TODO: this is temporary + } + else { + editor.statusMessage(emarker.getProblem().getMessage(), + DebugEditor.STATUS_COMPILER_ERR); + //+ " : " + errorMsgSimplifier.getIDName(emarker.problem.getIProblem().getID())); + } + return; + } + } + } + + // This line isn't an error line anymore, so probably just clear it + if (editor.statusMessageType == DebugEditor.STATUS_COMPILER_ERR) { + editor.statusEmpty(); + return; + } +// if (editor.ta.getCaretLine() != lastCaretLine) { +// editor.statusEmpty(); +// lastCaretLine = editor.ta.getCaretLine(); +// } + } + + /** + * Maps offset from java code to pde code. Returns a bunch of offsets as array + * + * @param line + * - line number in java code + * @param offset + * - offset from the start of the 'line' + * @return int[0] - tab number, int[1] - line number in the int[0] tab, int[2] + * - line start offset, int[3] - offset from line start. int[2] and + * int[3] are on TODO + */ + public int[] JavaToPdeOffsets(int line, int offset){ + int codeIndex = 0; + + int x = line - mainClassOffset; + if (x < 0) { + // log("Negative line number " + // + problem.getSourceLineNumber() + " , offset " + // + mainClassOffset); + x = line - 2; // Another -1 for 0 index + if (x < programImports.size() && x >= 0) { + ImportStatement is = programImports.get(x); + // log(is.importName + ", " + is.tab + ", " + // + is.lineNumber); + return new int[] { is.getTab(), is.getLineNumber() }; + } else { + + // Some seriously ugly stray error, just can't find the source + // line! Simply return first line for first tab. + return new int[] { 0, 1 }; + } + + } + + try { + for (SketchCode sc : editor.getSketch().getCode()) { + if (sc.isExtension("pde")) { + int len = 0; + if (editor.getSketch().getCurrentCode().equals(sc)) { + len = Base.countLines(sc.getDocument().getText(0, + sc.getDocument().getLength())) + 1; + } else { + len = Base.countLines(sc.getProgram()) + 1; + } + + // log("x,len, CI: " + x + "," + len + "," + // + codeIndex); + + if (x >= len) { + + // We're in the last tab and the line count is greater + // than the no. + // of lines in the tab, + if (codeIndex >= editor.getSketch().getCodeCount() - 1) { + // log("Exceeds lc " + x + "," + len + // + problem.toString()); + // x = len + x = editor.getSketch().getCode(codeIndex) + .getLineCount(); + // TODO: Obtain line having last non-white space + // character in the code. + break; + } else { + x -= len; + codeIndex++; + } + } else { + + if (codeIndex >= editor.getSketch().getCodeCount()) { + codeIndex = editor.getSketch().getCodeCount() - 1; + } + break; + } + + } + } + } catch (Exception e) { + System.err + .println("Things got messed up in ErrorCheckerService.JavaToPdeOffset()"); + } + return new int[] { codeIndex, x }; + } + + public String getPDECodeAtLine(int tab, int linenumber){ + if(linenumber < 0) return null; + editor.getSketch().setCurrentCode(tab); + return editor.ta.getLineText(linenumber); + } + + /** + * Calculates the tab number and line number of the error in that particular + * tab. Provides mapping between pure java and pde code. + * + * @param problem + * - IProblem + * @return int[0] - tab number, int[1] - line number + */ + public int[] calculateTabIndexAndLineNumber(int javalineNumber) { + // String[] lines = {};// = PApplet.split(sourceString, '\n'); + int codeIndex = 0; + + int x = javalineNumber - mainClassOffset; + if (x < 0) { + // log("Negative line number " + // + problem.getSourceLineNumber() + " , offset " + // + mainClassOffset); + x = javalineNumber - 2; // Another -1 for 0 index + if (x < programImports.size() && x >= 0) { + ImportStatement is = programImports.get(x); + // log(is.importName + ", " + is.tab + ", " + // + is.lineNumber); + return new int[] { is.getTab(), is.getLineNumber() }; + } else { + + // Some seriously ugly stray error, just can't find the source + // line! Simply return first line for first tab. + return new int[] { 0, 1 }; + } + + } + + try { + for (SketchCode sc : editor.getSketch().getCode()) { + if (sc.isExtension("pde")) { + int len = 0; + if (editor.getSketch().getCurrentCode().equals(sc)) { + len = Base.countLines(sc.getDocument().getText(0, + sc.getDocument().getLength())) + 1; + } else { + len = Base.countLines(sc.getProgram()) + 1; + } + + // log("x,len, CI: " + x + "," + len + "," + // + codeIndex); + + if (x >= len) { + + // We're in the last tab and the line count is greater + // than the no. + // of lines in the tab, + if (codeIndex >= editor.getSketch().getCodeCount() - 1) { + // log("Exceeds lc " + x + "," + len + // + problem.toString()); + // x = len + x = editor.getSketch().getCode(codeIndex) + .getLineCount(); + // TODO: Obtain line having last non-white space + // character in the code. + break; + } else { + x -= len; + codeIndex++; + } + } else { + + if (codeIndex >= editor.getSketch().getCodeCount()) { + codeIndex = editor.getSketch().getCodeCount() - 1; + } + break; + } + + } + } + } catch (Exception e) { + System.err + .println("Things got messed up in ErrorCheckerService.calculateTabIndexAndLineNumber()"); + } + + return new int[] { codeIndex, x }; + } + + /** + * Returns line number of corresponding java source + * @param tab + * @param pdeLineNum + * @return + */ + public int getJavaLineNumFromPDElineNum(int tab, int pdeLineNum){ + int jLineNum = programImports.size() + 1; + for (int i = 0; i < tab; i++) { + SketchCode sc = editor.getSketch().getCode(i); + int len = Base.countLines(sc.getProgram()) + 1; + jLineNum += len; + } + return jLineNum; + } + + /** + * Fetches code from the editor tabs and pre-processes it into parsable pure + * java source. And there's a difference between parsable and compilable. + * XQPrerocessor.java makes this code compilable.
+ * Handles:
  • Removal of import statements
  • Conversion of int(), + * char(), etc to PApplet.parseInt(), etc.
  • Replacing '#' with 0xff for + * color representation
  • Converts all 'color' datatypes to int + * (experimental)
  • Appends class declaration statement after determining + * the mode the sketch is in - ACTIVE or STATIC + * + * @return String - Pure java representation of PDE code. Note that this + * code is not yet compile ready. + */ + + protected String preprocessCode(String pdeCode) { + + programImports = new ArrayList(); + + StringBuffer rawCode = new StringBuffer(); + + try { + + for (SketchCode sc : editor.getSketch().getCode()) { + if (sc.isExtension("pde")) { + + try { + + if (editor.getSketch().getCurrentCode().equals(sc)) { + + rawCode.append(scrapImportStatements(sc.getDocument() + .getText(0, + sc.getDocument() + .getLength()), + editor.getSketch() + .getCodeIndex(sc))); + } else { + + rawCode.append(scrapImportStatements(sc.getProgram(), editor + .getSketch().getCodeIndex(sc))); + + } + rawCode.append('\n'); + } catch (Exception e) { + System.err.println("Exception in preprocessCode() - bigCode " + + e.toString()); + } + rawCode.append('\n'); + } + } + + } catch (Exception e) { + log("Exception in preprocessCode()"); + } + String sourceAlt = rawCode.toString(); + // Replace comments with whitespaces + // sourceAlt = scrubComments(sourceAlt); + + // Find all int(*), replace with PApplet.parseInt(*) + + // \bint\s*\(\s*\b , i.e all exclusive "int(" + + String dataTypeFunc[] = { "int", "char", "float", "boolean", "byte" }; + + for (String dataType : dataTypeFunc) { + String dataTypeRegexp = "\\b" + dataType + "\\s*\\("; + Pattern pattern = Pattern.compile(dataTypeRegexp); + Matcher matcher = pattern.matcher(sourceAlt); + + // while (matcher.find()) { + // System.out.print("Start index: " + matcher.start()); + // log(" End index: " + matcher.end() + " "); + // log("-->" + matcher.group() + "<--"); + // } + sourceAlt = matcher.replaceAll("PApplet.parse" + + Character.toUpperCase(dataType.charAt(0)) + + dataType.substring(1) + "("); + + } + + // Find all #[web color] and replace with 0xff[webcolor] + // Should be 6 digits only. + final String webColorRegexp = "#{1}[A-F|a-f|0-9]{6}\\W"; + Pattern webPattern = Pattern.compile(webColorRegexp); + Matcher webMatcher = webPattern.matcher(sourceAlt); + while (webMatcher.find()) { + // log("Found at: " + webMatcher.start()); + String found = sourceAlt.substring(webMatcher.start(), + webMatcher.end()); + // log("-> " + found); + sourceAlt = webMatcher.replaceFirst("0xff" + found.substring(1)); + webMatcher = webPattern.matcher(sourceAlt); + } + + // Replace all color data types with int + // Regex, Y U SO powerful? + final String colorTypeRegex = "color(?![a-zA-Z0-9_])(?=\\[*)(?!(\\s*\\())"; + Pattern colorPattern = Pattern.compile(colorTypeRegex); + Matcher colorMatcher = colorPattern.matcher(sourceAlt); + sourceAlt = colorMatcher.replaceAll("int"); + + checkForChangedImports(); + + className = (editor == null) ? "DefaultClass" : editor.getSketch() + .getName(); + + + // Check whether the code is being written in STATIC mode(no function + // declarations) - append class declaration and void setup() declaration + Matcher matcher = FUNCTION_DECL.matcher(sourceAlt); + if (!matcher.find()) { + sourceAlt = xqpreproc.prepareImports(programImports) + "public class " + className + " extends PApplet {\n" + + "public void setup() {\n" + sourceAlt + + "\nnoLoop();\n}\n" + "\n}\n"; + staticMode = true; + + } else { + sourceAlt = xqpreproc.prepareImports(programImports) + "public class " + className + " extends PApplet {\n" + + sourceAlt + "\n}"; + staticMode = false; + } + + int position = sourceAlt.indexOf("{") + 1; + mainClassOffset = 1; + for (int i = 0; i <= position; i++) { + if (sourceAlt.charAt(i) == '\n') { + mainClassOffset++; + } + } + if(staticMode) { + mainClassOffset++; + } + //mainClassOffset += 2; + // Handle unicode characters + sourceAlt = substituteUnicode(sourceAlt); + +// log("-->\n" + sourceAlt + "\n<--"); +// log("PDE code processed - " +// + editor.getSketch().getName()); + sourceCode = sourceAlt; + return sourceAlt; + + } + + /** + * Now defunct. + * The super method that highlights any ASTNode in the pde editor =D + * @param node + * @return true - if highlighting happened correctly. + */ + private boolean highlightNode(ASTNodeWrapper awrap){ + log("Highlighting: " + awrap); + try { + int pdeoffsets[] = awrap.getPDECodeOffsets(this); + int javaoffsets[] = awrap.getJavaCodeOffsets(this); + log("offsets: " +pdeoffsets[0] + "," + + pdeoffsets[1]+ "," +javaoffsets[1]+ "," + + javaoffsets[2]); + scrollToErrorLine(editor, pdeoffsets[0], + pdeoffsets[1],javaoffsets[1], + javaoffsets[2]); + return true; + } catch (Exception e) { + logE("Scrolling failed for " + awrap); + // e.printStackTrace(); + } + return false; + } + + public boolean highlightNode(ASTNode node){ + ASTNodeWrapper awrap = new ASTNodeWrapper(node); + return highlightNode(awrap); + } + + /** + * Scrolls to the error source in code. And selects the line text. Used by + * XQErrorTable and ErrorBar + * + * @param errorIndex + * - index of error + */ + public void scrollToErrorLine(int errorIndex) { + if (editor == null) { + return; + } + + if (errorIndex < problemsList.size() && errorIndex >= 0) { + Problem p = problemsList.get(errorIndex); + scrollToErrorLine(p); + } + } + + public void scrollToErrorLine(Problem p) { + if (editor == null) { + return; + } + if (p == null) + return; + try { + if(p.getPDELineStartOffset() == -1 || p.getPDELineStopOffset() == -1){ + // bad offsets, don't highlight, just scroll. + editor.toFront(); + editor.getSketch().setCurrentCode(p.getTabIndex()); + } + else { + astGenerator.highlightPDECode(p.getTabIndex(), + p.getLineNumber(), + p.getPDELineStartOffset(), + (p.getPDELineStopOffset() + - p.getPDELineStartOffset() + 1)); + } + + // scroll, but within boundaries + // It's also a bit silly that if parameters to scrollTo() are out of range, + // a BadLocation Exception is thrown internally and caught in JTextArea AND + // even the stack trace gets printed! W/o letting me catch it later! SMH + if (p.getLineNumber() < Base.countLines(editor.textArea().getDocument() + .getText(0, editor.textArea().getDocument().getLength())) + && p.getLineNumber() >= 0) { + editor.getTextArea().scrollTo(p.getLineNumber(), 0); + } + editor.repaint(); + } catch (Exception e) { + logE(e + + " : Error while selecting text in scrollToErrorLine(), for problem: " + p); + } + // log("---"); + } + + /** + * Static method for scroll to a particular line in the PDE. Also highlights + * the length of the text. Requires the editor instance as arguement. + * + * @param edt + * @param tabIndex + * @param lineNoInTab + * - line number in the corresponding tab + * @param lineStartOffset + * - selection start offset(from line start non-whitespace offset) + * @param length + * - length of selection + * @return - true, if scroll was successful + */ + public static boolean scrollToErrorLine(Editor edt, int tabIndex, int lineNoInTab, int lineStartOffset, int length) { + if (edt == null) { + return false; + } + try { + edt.toFront(); + edt.getSketch().setCurrentCode(tabIndex); + int lsno = edt.getTextArea() + .getLineStartNonWhiteSpaceOffset(lineNoInTab - 1) + lineStartOffset; + edt.setSelection(lsno, lsno + length); + edt.getTextArea().scrollTo(lineNoInTab - 1, 0); + edt.repaint(); + log(lineStartOffset + " LSO,len " + length); + } catch (Exception e) { + System.err.println(e + + " : Error while selecting text in static scrollToErrorLine()"); + e.printStackTrace(); + return false; + } + return true; + } + + /** + * Checks if import statements in the sketch have changed. If they have, + * compiler classpath needs to be updated. + */ + protected void checkForChangedImports() { +// log("Imports: " + programImports.size() + +// " Prev Imp: " +// + previousImports.size()); + if (programImports.size() != previousImports.size()) { + // log(1); + loadCompClass = true; + previousImports = programImports; + } else { + for (int i = 0; i < programImports.size(); i++) { + if (!programImports.get(i).getImportName().equals(previousImports + .get(i).getImportName())) { + // log(2); + loadCompClass = true; + previousImports = programImports; + break; + } + } + } + // log("load..? " + loadCompClass); + } + + protected int pdeImportsCount; + + public int getPdeImportsCount() { + return pdeImportsCount; + } + + /** + * Removes import statements from tabSource, replaces each with white spaces + * and adds the import to the list of program imports + * + * @param tabProgram + * - Code in a tab + * @param tabNumber + * - index of the tab + * @return String - Tab code with imports replaced with white spaces + */ + protected String scrapImportStatements(String tabProgram, int tabNumber) { + //TODO: Commented out imports are still detected as main imports. + pdeImportsCount = 0; + String tabSource = new String(tabProgram); + do { + // log("-->\n" + sourceAlt + "\n<--"); + String[] pieces = PApplet.match(tabSource, importRegexp); + + // Stop the loop if we've removed all the import lines + if (pieces == null) { + break; + } + + String piece = pieces[1] + pieces[2] + pieces[3]; + int len = piece.length(); // how much to trim out + + // programImports.add(piece); // the package name + + // find index of this import in the program + int idx = tabSource.indexOf(piece); + // System.out.print("Import -> " + piece); + // log(" - " + // + Base.countLines(tabSource.substring(0, idx)) + " tab " + // + tabNumber); + programImports.add(new ImportStatement(piece, tabNumber, Base + .countLines(tabSource.substring(0, idx)))); + // Remove the import from the main program + // Substitute with white spaces + String whiteSpace = ""; + for (int j = 0; j < piece.length(); j++) { + whiteSpace += " "; + } + tabSource = tabSource.substring(0, idx) + whiteSpace + + tabSource.substring(idx + len); + pdeImportsCount++; + } while (true); + // log(tabSource); + return tabSource; + } + + /** + * Replaces non-ascii characters with their unicode escape sequences and + * stuff. Used as it is from + * processing.src.processing.mode.java.preproc.PdePreprocessor + * + * @param program + * - Input String containing non ascii characters + * @return String - Converted String + */ + public static String substituteUnicode(String program) { + // check for non-ascii chars (these will be/must be in unicode format) + char p[] = program.toCharArray(); + int unicodeCount = 0; + for (int i = 0; i < p.length; i++) { + if (p[i] > 127) { + unicodeCount++; + } + } + if (unicodeCount == 0) { + return program; + } + // if non-ascii chars are in there, convert to unicode escapes + // add unicodeCount * 5.. replacing each unicode char + // with six digit uXXXX sequence (xxxx is in hex) + // (except for nbsp chars which will be a replaced with a space) + int index = 0; + char p2[] = new char[p.length + unicodeCount * 5]; + for (int i = 0; i < p.length; i++) { + if (p[i] < 128) { + p2[index++] = p[i]; + } else if (p[i] == 160) { // unicode for non-breaking space + p2[index++] = ' '; + } else { + int c = p[i]; + p2[index++] = '\\'; + p2[index++] = 'u'; + char str[] = Integer.toHexString(c).toCharArray(); + // add leading zeros, so that the length is 4 + // for (int i = 0; i < 4 - str.length; i++) p2[index++] = '0'; + for (int m = 0; m < 4 - str.length; m++) + p2[index++] = '0'; + System.arraycopy(str, 0, p2, index, str.length); + index += str.length; + } + } + return new String(p2, 0, index); + } + + public void handleErrorCheckingToggle(){ + if (!ExperimentalMode.errorCheckEnabled) { + // unticked Menu Item + // pauseThread(); + log(editor.getSketch().getName() + + " - Error Checker paused."); + editor.errorBar.errorPoints.clear(); + problemsList.clear(); + updateErrorTable(); + updateEditorStatus(); + editor.getTextArea().repaint(); + editor.errorBar.repaint(); + } else { + //resumeThread(); + log(editor.getSketch().getName() + + " - Error Checker resumed."); + runManualErrorCheck(); + } + } + + /** + * Stops the Error Checker Service thread + */ + public void stopThread() { + logE("Stopping thread: " + editor.getSketch().getName()); + stopThread.set(true); + } + + /** + * Pauses the Error Checker Service thread + */ + public void pauseThread() { + pauseThread.set(true); + } + + /** + * Resumes the Error Checker Service thread + */ + public void resumeThread() { + pauseThread.set(false); + } + + public DebugEditor getEditor() { + return editor; + } + +// public static void log(String message){ +// if(ExperimentalMode.DEBUG) +// log(message); +// } +// +// public static void log2(String message){ +// if(ExperimentalMode.DEBUG) +// System.out.print(message); +// } + + public ArrayList getProgramImports() { + return programImports; + } +} diff --git a/pdex/src/processing/mode/experimental/ErrorMarker.java b/pdex/src/processing/mode/experimental/ErrorMarker.java new file mode 100755 index 000000000..a3eab8ceb --- /dev/null +++ b/pdex/src/processing/mode/experimental/ErrorMarker.java @@ -0,0 +1,59 @@ +package processing.mode.experimental; +/** + * Error markers displayed on the Error Bar. + * + * @author Manindra Moharana <me@mkmoharana.com> + * + */ + public class ErrorMarker { + /** + * y co-ordinate of the marker + */ + private int y; + /** + * Type of marker: Error or Warning? + */ + private int type = -1; + /** + * Error Type constant + */ + public static final int Error = 1; + /** + * Warning Type constant + */ + public static final int Warning = 2; + /** + * Problem that the error marker represents + * @see Problem + */ + private Problem problem; + + public ErrorMarker(Problem problem, int y, int type) { + this.problem = problem; + this.y = y; + this.type = type; + } + + /** + * y co-ordinate of the marker + */ + public int getY() { + return y; + } + + /** + * Type of marker: ErrorMarker.Error or ErrorMarker.Warning? + */ + public int getType() { + return type; + } + + /** + * Problem that the error marker represents + * @see Problem + */ + public Problem getProblem() { + return problem; + } + + } \ No newline at end of file diff --git a/pdex/src/processing/mode/experimental/ErrorMessageSimplifier.java b/pdex/src/processing/mode/experimental/ErrorMessageSimplifier.java new file mode 100644 index 000000000..20a737dc4 --- /dev/null +++ b/pdex/src/processing/mode/experimental/ErrorMessageSimplifier.java @@ -0,0 +1,221 @@ +package processing.mode.experimental; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.TreeMap; + +import org.eclipse.jdt.core.compiler.IProblem; +import org.eclipse.jdt.internal.compiler.problem.DefaultProblem; + +public class ErrorMessageSimplifier { + +// private ErrorCheckerService errorCheckerService; + + /** + * Mapping between ProblemID constant and the constant name. Holds about 650 + * of them. Also, this is just temporary, will be used to find the common + * error types, cos you know, identifying String names is easier than + * identifying 8 digit int constants! + * TODO: this is temporary + */ + private static TreeMap constantsMap; + + public ErrorMessageSimplifier() { + + new Thread() { + public void run() { + prepareConstantsList(); + } + }.start(); + } + + private static void prepareConstantsList() { + constantsMap = new TreeMap(); + Class probClass = DefaultProblem.class; + Field f[] = probClass.getFields(); + for (Field field : f) { + if (Modifier.isStatic(field.getModifiers())) + try { + //System.out.println(field.getName() + " :" + field.get(null)); + Object val = field.get(null); + if (val instanceof Integer) { + constantsMap.put((Integer) (val), field.getName()); + } + } catch (Exception e) { + e.printStackTrace(); + break; + } + } + //System.out.println("Total items: " + constantsMap.size()); + } + + public static String getIDName(int id) { + if (constantsMap == null){ + prepareConstantsList(); + } + return constantsMap.get(id); + } + + public static String getSimplifiedErrorMessage(Problem problem) { + if (problem == null) + return null; + IProblem iprob = problem.getIProblem(); + String args[] = iprob.getArguments(); +// log("Simplifying message: " + problem.getMessage() + " ID: " +// + getIDName(iprob.getID())); +// log("Arg count: " + args.length); +// for (int i = 0; i < args.length; i++) { +// log("Arg " + args[i]); +// } + + String result = null; + + switch (iprob.getID()) { + case IProblem.ParsingError: + if (args.length > 0) { + if (problem.getMessage().endsWith("expected")) { + result = "Probably a \"" + args[args.length - 1] + + "\" should go here"; + } + else { + result = "Problem with code syntax: Consider removing \"" + args[0] + + "\""; + } + } + break; + case IProblem.ParsingErrorInsertToComplete: + if (args.length > 0) { + if (args[0].length() == 1) { + result = getErrorMessageForBracket(args[0].charAt(0)); + } + else { + result = "Consider adding a \"" + args[0] + "\""; + } + } + break; + case IProblem.ParsingErrorInsertTokenAfter: + if (args.length > 0) { + if (args[1].length() == 1) { + result = getErrorMessageForBracket(args[1].charAt(0)); + } + else { + result = "Consider adding a \"" + args[1] + "\""; + } + } + break; + case IProblem.UndefinedMethod: + if (args.length > 2) { + result = "The method \"" + args[args.length - 2] + "(" + + getSimpleName(args[args.length - 1]) + ")\" doesn't exist"; + } + break; + case IProblem.ParameterMismatch: + if (args.length > 3) { + // 2nd arg is method name, 3rd arg is correct param list + if (args[2].trim().length() == 0) { + // the case where no params are needed. + result = "The method \"" + args[1] + + "\" doesn't expect any parameters"; + } else { + result = "The method \"" + args[1] + + "\" expects parameters like this: " + args[1] + "(" + + getSimpleName(args[2]) + ")"; + } + } + break; + case IProblem.UndefinedField: + if (args.length > 0) { + result = "The global variable \"" + args[0] + "\" doesn't exist"; + } + break; + case IProblem.UndefinedType: + if (args.length > 0) { + result = "The class \"" + args[0] + "\" doesn't exist"; + } + break; + case IProblem.UnresolvedVariable: + if (args.length > 0) { + result = "The variable \"" + args[0] + "\" doesn't exist"; + } + break; + case IProblem.UndefinedName: + if (args.length > 0) { + result = "The name \"" + args[0] + "\" can't be recognized"; + } + break; + case IProblem.TypeMismatch: + if (args.length > 1) { + result = "Type mismatch, \"" + getSimpleName(args[0]) + + "\" doesn't match with \"" + getSimpleName(args[1]) + "\""; + } + break; + } + +// log("Simplified Error Msg: " + result); + if (result == null) + result = problem.getMessage(); + return result; + } + + /** + * Converts java.lang.String into String, etc + * + * @param inp + * @return + */ + private static String getSimpleName(String inp) { + if (inp.indexOf('.') < 0) + return inp; + String res = ""; + ArrayList names = new ArrayList(); + if (inp.indexOf(',') >= 0) { + String arr[] = inp.split(","); + for (int i = 0; i < arr.length; i++) { + names.add(arr[i]); + } + } else + names.add(inp); + for (String n : names) { + int x = n.lastIndexOf('.'); + if (x >= 0) { + n = n.substring(x + 1, n.length()); + } + res = res + ", " + n; + } + return res.substring(2, res.length()); + } + + private static String getErrorMessageForBracket(char c){ + String result = null; + switch (c) { + case ';': + result = "Missing a semi-colon \";\""; + break; + case '[': + result = "Missing opening square bracket \"[\""; + break; + case ']': + result = "Missing closing square bracket \"]\""; + break; + case '(': + result = "Missing opening parentheses \"(\""; + break; + case ')': + result = "Missing closing parentheses \")\""; + break; + case '{': + result = "Missing opening curly bracket \"{\""; + break; + case '}': + result = "Missing closing curly bracket \"}\""; + break; + default: + result = "Consider adding a \"" + c + "\""; + } + + return result; + } + + +} diff --git a/pdex/src/processing/mode/experimental/ErrorWindow.java b/pdex/src/processing/mode/experimental/ErrorWindow.java new file mode 100755 index 000000000..4e7db2e36 --- /dev/null +++ b/pdex/src/processing/mode/experimental/ErrorWindow.java @@ -0,0 +1,374 @@ +/* + Part of the XQMode project - https://github.com/Manindra29/XQMode + + Under Google Summer of Code 2012 - + http://www.google-melange.com/gsoc/homepage/google/gsoc2012 + + Copyright (C) 2012 Manindra Moharana + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package processing.mode.experimental; + +import java.awt.BorderLayout; +import java.awt.Frame; +import java.awt.Point; +import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.WindowConstants; +import javax.swing.border.EmptyBorder; +import javax.swing.table.TableModel; + +import processing.app.Editor; +import processing.app.Toolkit; + +/** + * Error Window that displays a tablular list of errors. Clicking on an error + * scrolls to its location in the code. + * + * @author Manindra Moharana <me@mkmoharana.com> + * + */ +public class ErrorWindow extends JFrame { + + private JPanel contentPane; + /** + * The table displaying the errors + */ + protected XQErrorTable errorTable; + /** + * Scroll pane that contains the Error Table + */ + protected JScrollPane scrollPane; + + protected DebugEditor thisEditor; + private JFrame thisErrorWindow; + + /** + * Handles the sticky Problem window + */ + private DockTool2Base Docker; + + protected ErrorCheckerService errorCheckerService; + + /** + * Preps up ErrorWindow + * + * @param editor + * - Editor + * @param ecs - ErrorCheckerService + */ + public ErrorWindow(DebugEditor editor, ErrorCheckerService ecs) { + thisErrorWindow = this; + errorCheckerService = ecs; + thisEditor = editor; + setTitle("Problems"); + prepareFrame(); + } + + /** + * Sets up ErrorWindow + */ + protected void prepareFrame() { + Toolkit.setIcon(this); + setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); + // Default size: setBounds(100, 100, 458, 160); + setBounds(100, 100, 458, 160); // Yeah, I hardcode such things sometimes. Hate me. + + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + contentPane.setLayout(new BorderLayout(0, 0)); + + scrollPane = new JScrollPane(); + contentPane.add(scrollPane); + + errorTable = new XQErrorTable(errorCheckerService); + scrollPane.setViewportView(errorTable); + + try { + Docker = new DockTool2Base(); + addListeners(); + } catch (Exception e) { + System.out.println("addListeners() acted silly."); + e.printStackTrace(); + } + + if (thisEditor != null) { + setLocation(new Point(thisEditor.getLocation().x + + thisEditor.getWidth(), thisEditor.getLocation().y)); + } + + } + + /** + * Updates the error table with new data(Table Model). Called from Error + * Checker Service. + * + * @param tableModel + * - Table Model + * @return True - If error table was updated successfully. + */ + synchronized public boolean updateTable(final TableModel tableModel) { + // XQErrorTable handles evrything now + return errorTable.updateTable(tableModel); + } + + /** + * Adds various listeners to components of EditorWindow and to the Editor + * window + */ + protected void addListeners() { + + if (thisErrorWindow == null) + System.out.println("ERW null"); + + thisErrorWindow.addComponentListener(new ComponentListener() { + + @Override + public void componentShown(ComponentEvent e) { + + } + + @Override + public void componentResized(ComponentEvent e) { + Docker.tryDocking(); + } + + @Override + public void componentMoved(ComponentEvent e) { + Docker.tryDocking(); + } + + @Override + public void componentHidden(ComponentEvent e) { + + } + }); + + thisErrorWindow.addWindowListener(new WindowAdapter() { + + @Override + public void windowClosing(WindowEvent e) { + thisEditor.problemWindowMenuCB.setSelected(false); + } + + @Override + public void windowDeiconified(WindowEvent e) { + thisEditor.setExtendedState(Frame.NORMAL); + } + + }); + + if (thisEditor == null) { + System.out.println("Editor null"); + return; + } + + /*thisEditor.addWindowListener(new WindowAdapter() { + + @Override + public void windowClosing(WindowEvent e) { + + } + + @Override + public void windowClosed(WindowEvent e) { + errorCheckerService.pauseThread(); + errorCheckerService.stopThread(); // Bye bye thread. + thisErrorWindow.dispose(); + } + + @Override + public void windowIconified(WindowEvent e) { + thisErrorWindow.setExtendedState(Frame.ICONIFIED); + } + + @Override + public void windowDeiconified(WindowEvent e) { + thisErrorWindow.setExtendedState(Frame.NORMAL); + } + + });*/ + + thisEditor.addComponentListener(new ComponentListener() { + + @Override + public void componentShown(ComponentEvent e) { + + } + + @Override + public void componentResized(ComponentEvent e) { + if (Docker.isDocked()) { + Docker.dock(); + } else { + Docker.tryDocking(); + } + } + + @Override + public void componentMoved(ComponentEvent e) { + + if (Docker.isDocked()) { + Docker.dock(); + } else { + Docker.tryDocking(); + } + + } + + @Override + public void componentHidden(ComponentEvent e) { + // System.out.println("ed hidden"); + } + }); + + } + + + /** + * Implements the docking feature of the tool - The frame sticks to the + * editor and once docked, moves along with it as the editor is resized, + * moved, or closed. + * + * This class has been borrowed from Tab Manager tool by Thomas Diewald. It + * has been slightly modified and used here. + * + * @author Thomas Diewald , http://thomasdiewald.com + */ + private class DockTool2Base { + + private int docking_border = 0; + private int dock_on_editor_y_offset_ = 0; + private int dock_on_editor_x_offset_ = 0; + + // /////////////////////////////// + // ____2____ + // | | + // | | + // 0 | editor | 1 + // | | + // |_________| + // 3 + // /////////////////////////////// + + // public void reset() { + // dock_on_editor_y_offset_ = 0; + // dock_on_editor_x_offset_ = 0; + // docking_border = 0; + // } + + public boolean isDocked() { + return (docking_border >= 0); + } + + private final int MAX_GAP_ = 20; + + // + public void tryDocking() { + if (thisEditor == null) + return; + Editor editor = thisEditor; + Frame frame = thisErrorWindow; + + int ex = editor.getX(); + int ey = editor.getY(); + int ew = editor.getWidth(); + int eh = editor.getHeight(); + + int fx = frame.getX(); + int fy = frame.getY(); + int fw = frame.getWidth(); + int fh = frame.getHeight(); + + if (((fy > ey) && (fy < ey + eh)) + || ((fy + fh > ey) && (fy + fh < ey + eh))) { + int dis_border_left = Math.abs(ex - (fx + fw)); + int dis_border_right = Math.abs((ex + ew) - (fx)); + + if (dis_border_left < MAX_GAP_ || dis_border_right < MAX_GAP_) { + docking_border = (dis_border_left < dis_border_right) ? 0 + : 1; + dock_on_editor_y_offset_ = fy - ey; + dock(); + return; + } + } + + if (((fx > ex) && (fx < ex + ew)) + || ((fx + fw > ey) && (fx + fw < ex + ew))) { + int dis_border_top = Math.abs(ey - (fy + fh)); + int dis_border_bot = Math.abs((ey + eh) - (fy)); + + if (dis_border_top < MAX_GAP_ || dis_border_bot < MAX_GAP_) { + docking_border = (dis_border_top < dis_border_bot) ? 2 : 3; + dock_on_editor_x_offset_ = fx - ex; + dock(); + return; + } + } + docking_border = -1; + } + + public void dock() { + if (thisEditor == null) + return; + Editor editor = thisEditor; + Frame frame = thisErrorWindow; + + int ex = editor.getX(); + int ey = editor.getY(); + int ew = editor.getWidth(); + int eh = editor.getHeight(); + + // int fx = frame.getX(); + // int fy = frame.getY(); + int fw = frame.getWidth(); + int fh = frame.getHeight(); + + int x = 0, y = 0; + if (docking_border == -1) { + return; + } + + if (docking_border == 0) { + x = ex - fw; + y = ey + dock_on_editor_y_offset_; + } + if (docking_border == 1) { + x = ex + ew; + y = ey + dock_on_editor_y_offset_; + } + + if (docking_border == 2) { + x = ex + dock_on_editor_x_offset_; + y = ey - fh; + } + if (docking_border == 3) { + x = ex + dock_on_editor_x_offset_; + y = ey + eh; + } + frame.setLocation(x, y); + } + + } +} diff --git a/pdex/src/processing/mode/experimental/ExperimentalMode.java b/pdex/src/processing/mode/experimental/ExperimentalMode.java new file mode 100755 index 000000000..94d0f9778 --- /dev/null +++ b/pdex/src/processing/mode/experimental/ExperimentalMode.java @@ -0,0 +1,482 @@ +/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ + +/* + Part of the Processing project - http://processing.org + + Copyright (c) 2012 The Processing Foundation + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package processing.mode.experimental; + +import galsasson.mode.tweak.SketchParser; + +import java.awt.Color; +import java.io.File; +import java.io.IOException; +import java.util.logging.FileHandler; +import java.util.logging.Handler; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.swing.ImageIcon; + +import processing.app.Base; +import processing.app.Editor; +import processing.app.EditorState; +import processing.app.Library; +import processing.app.Mode; +import processing.app.Preferences; +import processing.app.RunnerListener; +import processing.app.Sketch; +import processing.app.SketchCode; +import processing.app.SketchException; +import processing.mode.java.JavaBuild; +import processing.mode.java.JavaMode; +import processing.mode.java.runner.Runner; + + +/** + * Experimental Mode for Processing, combines Debug Mode and XQMode and + * starts us working toward our next generation editor/debugger setup. + */ +public class ExperimentalMode extends JavaMode { + public static final boolean VERBOSE_LOGGING = true; + //public static final boolean VERBOSE_LOGGING = false; + public static final int LOG_SIZE = 512 * 1024; // max log file size (in bytes) + public static boolean DEBUG = !true; + + public ExperimentalMode(Base base, File folder) { + super(base, folder); + + // use libraries folder from javamode. will make sketches using core libraries work, as well as import libraries and examples menus + for (Mode m : base.getModeList()) { + if (m.getClass() == JavaMode.class) { + JavaMode jMode = (JavaMode) m; + librariesFolder = jMode.getLibrariesFolder(); + rebuildLibraryList(); + break; + } + } + + // Fetch examples and reference from java mode + // thx to Manindra (https://github.com/martinleopold/DebugMode/issues/4) + examplesFolder = Base.getContentFile("modes/java/examples"); + // https://github.com/martinleopold/DebugMode/issues/6 + referenceFolder = Base.getContentFile("modes/java/reference"); + + // set logging level + Logger globalLogger = Logger.getLogger(""); + //Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME); // doesn't work on os x + if (VERBOSE_LOGGING) { + globalLogger.setLevel(Level.INFO); + } else { + globalLogger.setLevel(Level.WARNING); + } + + // enable logging to file + try { + // settings is writable for built-in modes, mode folder is not writable + File logFolder = Base.getSettingsFile("debug"); + if (!logFolder.exists()) { + logFolder.mkdir(); + } + File logFile = new File(logFolder, "DebugMode.%g.log"); + Handler handler = new FileHandler(logFile.getAbsolutePath(), LOG_SIZE, 10, false); + globalLogger.addHandler(handler); + + } catch (IOException ex) { + Logger.getLogger(ExperimentalMode.class.getName()).log(Level.SEVERE, null, ex); + } catch (SecurityException ex) { + Logger.getLogger(ExperimentalMode.class.getName()).log(Level.SEVERE, null, ex); + } + + // disable initial chattiness for now +// // output version from manifest file +// Package p = ExperimentalMode.class.getPackage(); +// String titleAndVersion = p.getImplementationTitle() + " (v" + p.getImplementationVersion() + ")"; +// //log(titleAndVersion); +// Logger.getLogger(ExperimentalMode.class.getName()).log(Level.INFO, titleAndVersion); + loadPreferences(); + loadIcons(); + } + + + @Override + public String getTitle() { + //return "PDE X"; + return "Java"; + } + + + public File[] getKeywordFiles() { + return new File[] { + Base.getContentFile("modes/java/keywords.txt") + }; + } + + public File getContentFile(String path) { + // workaround for #45 + if (path.startsWith("application" + File.separator)) { + return new File(Base.getContentFile("modes" + File.separator + "java") + .getAbsolutePath() + File.separator + path); + } + return new File(folder, path); + } + + volatile public static boolean errorCheckEnabled = true, + warningsEnabled = true, codeCompletionsEnabled = true, + debugOutputEnabled = false, errorLogsEnabled = false, + autoSaveEnabled = true, autoSavePromptEnabled = true, + defaultAutoSaveEnabled = true, // ,untitledAutoSaveEnabled; + ccTriggerEnabled = false; + public static int autoSaveInterval = 3; //in minutes + + /** + * After how many typed characters, code completion is triggered + */ + volatile public static int codeCompletionTriggerLength = 2; + + public static final String prefErrorCheck = "pdex.errorCheckEnabled", + prefWarnings = "pdex.warningsEnabled", + prefCodeCompletionEnabled = "pdex.ccEnabled", + prefDebugOP = "pdex.dbgOutput", + prefErrorLogs = "pdex.writeErrorLogs", + prefAutoSaveInterval = "pdex.autoSaveInterval", + prefAutoSave = "pdex.autoSave.autoSaveEnabled", // prefUntitledAutoSave = "pdex.autoSave.untitledAutoSaveEnabled", + prefAutoSavePrompt = "pdex.autoSave.promptDisplay", + prefDefaultAutoSave = "pdex.autoSave.autoSaveByDefault", + prefCCTriggerEnabled = "pdex.ccTriggerEnabled"; + + // TweakMode code (Preferences) + volatile public static boolean enableTweak = false; + public static final String prefEnableTweak = "pdex.enableTweak"; + + public void loadPreferences() { + log("Load PDEX prefs"); + ensurePrefsExist(); + errorCheckEnabled = Preferences.getBoolean(prefErrorCheck); + warningsEnabled = Preferences.getBoolean(prefWarnings); + codeCompletionsEnabled = Preferences.getBoolean(prefCodeCompletionEnabled); + DEBUG = Preferences.getBoolean(prefDebugOP); + errorLogsEnabled = Preferences.getBoolean(prefErrorLogs); + autoSaveInterval = Preferences.getInteger(prefAutoSaveInterval); +// untitledAutoSaveEnabled = Preferences.getBoolean(prefUntitledAutoSave); + autoSaveEnabled = Preferences.getBoolean(prefAutoSave); + autoSavePromptEnabled = Preferences.getBoolean(prefAutoSavePrompt); + defaultAutoSaveEnabled = Preferences.getBoolean(prefDefaultAutoSave); + ccTriggerEnabled = Preferences.getBoolean(prefCCTriggerEnabled); + + // TweakMode code - not a sticky preference anymore + // enableTweak = Preferences.getBoolean(prefEnableTweak); + } + + public void savePreferences() { + log("Saving PDEX prefs"); + Preferences.setBoolean(prefErrorCheck, errorCheckEnabled); + Preferences.setBoolean(prefWarnings, warningsEnabled); + Preferences.setBoolean(prefCodeCompletionEnabled, codeCompletionsEnabled); + Preferences.setBoolean(prefDebugOP, DEBUG); + Preferences.setBoolean(prefErrorLogs, errorLogsEnabled); + Preferences.setInteger(prefAutoSaveInterval, autoSaveInterval); +// Preferences.setBoolean(prefUntitledAutoSave,untitledAutoSaveEnabled); + Preferences.setBoolean(prefAutoSave, autoSaveEnabled); + Preferences.setBoolean(prefAutoSavePrompt, autoSavePromptEnabled); + Preferences.setBoolean(prefDefaultAutoSave, defaultAutoSaveEnabled); + Preferences.setBoolean(prefCCTriggerEnabled, ccTriggerEnabled); + + // TweakMode code - not a sticky preference anymore + // Preferences.setBoolean(prefEnableTweak, enableTweak); + } + + public void ensurePrefsExist() { + //TODO: Need to do a better job of managing prefs. Think lists. + if (Preferences.get(prefErrorCheck) == null) + Preferences.setBoolean(prefErrorCheck, errorCheckEnabled); + if (Preferences.get(prefWarnings) == null) + Preferences.setBoolean(prefWarnings, warningsEnabled); + if (Preferences.get(prefCodeCompletionEnabled) == null) + Preferences.setBoolean(prefCodeCompletionEnabled, codeCompletionsEnabled); + if (Preferences.get(prefDebugOP) == null) + Preferences.setBoolean(prefDebugOP, DEBUG); + if (Preferences.get(prefErrorLogs) == null) + Preferences.setBoolean(prefErrorLogs, errorLogsEnabled); + if (Preferences.get(prefAutoSaveInterval) == null) + Preferences.setInteger(prefAutoSaveInterval, autoSaveInterval); +// if(Preferences.get(prefUntitledAutoSave) == null) +// Preferences.setBoolean(prefUntitledAutoSave,untitledAutoSaveEnabled); + if (Preferences.get(prefAutoSave) == null) + Preferences.setBoolean(prefAutoSave, autoSaveEnabled); + if (Preferences.get(prefAutoSavePrompt) == null) + Preferences.setBoolean(prefAutoSavePrompt, autoSavePromptEnabled); + if (Preferences.get(prefDefaultAutoSave) == null) + Preferences.setBoolean(prefDefaultAutoSave, defaultAutoSaveEnabled); + if (Preferences.get(prefCCTriggerEnabled) == null) + Preferences.setBoolean(prefCCTriggerEnabled, ccTriggerEnabled); + + // TweakMode code - not a sticky preference anymore +// if (Preferences.get(prefEnableTweak) == null) { +// Preferences.setBoolean(prefEnableTweak, enableTweak); +// } + } + + + /** + * Create a new editor associated with this mode. + */ + @Override + public Editor createEditor(Base base, String path, EditorState state) { + return new DebugEditor(base, path, state, this); + } + + + /** + * Load a String value from theme.txt + * + * @param attribute the attribute key to load + * @param defaultValue the default value + * @return the attributes value, or the default value if the attribute + * couldn't be loaded + */ + public String loadThemeString(String attribute, String defaultValue) { + String newString = theme.get(attribute); + if (newString != null) { + return newString; + } + Logger.getLogger(getClass().getName()).log(Level.WARNING, "Error loading String: {0}", attribute); + return defaultValue; + } + + + /** + * Load a Color value from theme.txt + * + * @param attribute the attribute key to load + * @param defaultValue the default value + * @return the attributes value, or the default value if the attribute + * couldn't be loaded + */ + public Color getThemeColor(String attribute, Color defaultValue) { + Color newColor = theme.getColor(attribute); + if (newColor != null) { + return newColor; + } + log("error loading color: " + attribute); + Logger.getLogger(ExperimentalMode.class.getName()).log(Level.WARNING, "Error loading Color: {0}", attribute); + return defaultValue; + } + + protected ImageIcon classIcon, fieldIcon, methodIcon, localVarIcon; + protected void loadIcons(){ + String iconPath = getContentFile("data") + .getAbsolutePath() + + File.separator + "icons"; + classIcon = new ImageIcon(iconPath + File.separator + "class_obj.png"); + methodIcon = new ImageIcon(iconPath + File.separator + + "methpub_obj.png"); + fieldIcon = new ImageIcon(iconPath + File.separator + + "field_protected_obj.png"); + localVarIcon = new ImageIcon(iconPath + File.separator + + "field_default_obj.png"); + // log("Icons loaded"); + } + + + public ClassLoader getJavaModeClassLoader() { + for (Mode m : base.getModeList()) { + if (m.getClass() == JavaMode.class) { + JavaMode jMode = (JavaMode) m; + return jMode.getClassLoader(); + } + } + // badness + return null; + } + + /** + * System.out.println() + */ + public static final void log(Object message){ + if(ExperimentalMode.DEBUG) + System.out.println(message); + } + + /** + * System.err.println() + */ + public static final void logE(Object message){ + if(ExperimentalMode.DEBUG) + System.err.println(message); + } + + /** + * System.out.print + */ + public static final void log2(Object message){ + if(ExperimentalMode.DEBUG) + System.out.print(message); + } + + public String[] getIgnorable() { + return new String[] { + "applet", + "application.macosx", + "application.windows", + "application.linux", + "_autosave" + }; + } + + // TweakMode code + @Override + public Runner handleRun(Sketch sketch, RunnerListener listener) throws SketchException + { + if (enableTweak) { + enableTweak = false; + return handleTweakPresentOrRun(sketch, listener, false); + } + else { + /* Do the usual (JavaMode style) */ + JavaBuild build = new JavaBuild(sketch); + String appletClassName = build.build(false); + if (appletClassName != null) { + final Runner runtime = new Runner(build, listener); + new Thread(new Runnable() { + public void run() { + runtime.launch(false); // this blocks until finished + } + }).start(); + return runtime; + } + return null; + } + } + + @Override + public Runner handlePresent(Sketch sketch, RunnerListener listener) throws SketchException + { + if (enableTweak) { + enableTweak = false; + return handleTweakPresentOrRun(sketch, listener, true); + } + else { + /* Do the usual (JavaMode style) */ + JavaBuild build = new JavaBuild(sketch); + String appletClassName = build.build(false); + if (appletClassName != null) { + final Runner runtime = new Runner(build, listener); + new Thread(new Runnable() { + public void run() { + runtime.launch(true); + } + }).start(); + return runtime; + } + return null; + } + } + + public Runner handleTweakPresentOrRun(Sketch sketch, RunnerListener listener, boolean present) throws SketchException + { + final DebugEditor editor = (DebugEditor)listener; + final boolean toPresent = present; + + if (!verifyOscP5()) { + editor.deactivateRun(); + return null; + } + + boolean launchInteractive = false; + + if (isSketchModified(sketch)) { + editor.deactivateRun(); + Base.showMessage("Save", "Please save the sketch before running in Tweak Mode."); + return null; + } + + /* first try to build the unmodified code */ + JavaBuild build = new JavaBuild(sketch); + String appletClassName = build.build(false); + if (appletClassName == null) { + // unmodified build failed, so fail + return null; + } + + /* if compilation passed, modify the code and build again */ + editor.initBaseCode(); + // check for "// tweak" comment in the sketch + boolean requiresTweak = SketchParser.containsTweakComment(editor.baseCode); + // parse the saved sketch to get all (or only with "//tweak" comment) numbers + final SketchParser parser = new SketchParser(editor.baseCode, requiresTweak); + + // add our code to the sketch + launchInteractive = editor.automateSketch(sketch, parser.allHandles); + + build = new JavaBuild(sketch); + appletClassName = build.build(false); + + if (appletClassName != null) { + final Runner runtime = new Runner(build, listener); + new Thread(new Runnable() { + public void run() { + runtime.launch(toPresent); // this blocks until finished + + // executed when the sketch quits + editor.initEditorCode(parser.allHandles, false); + editor.stopInteractiveMode(parser.allHandles); + } + + }).start(); + + if (launchInteractive) { + + // replace editor code with baseCode + editor.initEditorCode(parser.allHandles, false); + editor.updateInterface(parser.allHandles, parser.colorBoxes); + editor.startInteractiveMode(); + } + + return runtime; + } + + return null; + } + + private boolean verifyOscP5() + { + for (Library l : contribLibraries) { + if (l.getName().equals("oscP5")) { + return true; + } + } + + // could not find oscP5 library + Base.showWarning("Tweak Mode", "Tweak Mode needs the 'oscP5' library.\n" + + "Please install this library by clicking \"Sketch --> Import Library --> Add Library ...\" and choose 'ocsP5'", null); + + return false; + } + + private boolean isSketchModified(Sketch sketch) + { + for (SketchCode sc : sketch.getCode()) { + if (sc.isModified()) { + return true; + } + } + return false; + } + +} diff --git a/pdex/src/processing/mode/experimental/FieldNode.java b/pdex/src/processing/mode/experimental/FieldNode.java new file mode 100755 index 000000000..dbe9d4fd9 --- /dev/null +++ b/pdex/src/processing/mode/experimental/FieldNode.java @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2012 Martin Leopold + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +import com.sun.jdi.ClassNotLoadedException; +import com.sun.jdi.Field; +import com.sun.jdi.InvalidTypeException; +import com.sun.jdi.ObjectReference; +import com.sun.jdi.Value; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Specialized {@link VariableNode} for representing fields. Overrides + * {@link #setValue} to properly change the value of the encapsulated field. + * + * @author Martin Leopold + */ +public class FieldNode extends VariableNode { + + protected Field field; + protected ObjectReference obj; + + /** + * Construct a {@link FieldNode}. + * + * @param name the name + * @param type the type + * @param value the value + * @param field the field + * @param obj a reference to the object containing the field + */ + public FieldNode(String name, String type, Value value, Field field, ObjectReference obj) { + super(name, type, value); + this.field = field; + this.obj = obj; + } + + @Override + public void setValue(Value value) { + try { + obj.setValue(field, value); + } catch (InvalidTypeException ex) { + Logger.getLogger(FieldNode.class.getName()).log(Level.SEVERE, null, ex); + } catch (ClassNotLoadedException ex) { + Logger.getLogger(FieldNode.class.getName()).log(Level.SEVERE, null, ex); + } + this.value = value; + } +} diff --git a/pdex/src/processing/mode/experimental/ImportStatement.java b/pdex/src/processing/mode/experimental/ImportStatement.java new file mode 100755 index 000000000..fb9e8eb8e --- /dev/null +++ b/pdex/src/processing/mode/experimental/ImportStatement.java @@ -0,0 +1,79 @@ +/* + Part of the XQMode project - https://github.com/Manindra29/XQMode + + Under Google Summer of Code 2012 - + http://www.google-melange.com/gsoc/homepage/google/gsoc2012 + + Copyright (C) 2012 Manindra Moharana + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package processing.mode.experimental; + +/** + * Wrapper for import statements + * + * @author Manindra Moharana <me@mkmoharana.com> + * + */ +public class ImportStatement { + /** + * Ex: processing.opengl.*, java.util.* + */ + private String importName; + + /** + * Which tab does it belong to? + */ + private int tab; + + /** + * Line number(pde code) of the import + */ + private int lineNumber; + + /** + * + * @param importName - Ex: processing.opengl.*, java.util.* + * @param tab - Which tab does it belong to? + * @param lineNumber - Line number(pde code) of the import + */ + public ImportStatement(String importName, int tab, int lineNumber) { + this.importName = importName; + this.tab = tab; + this.lineNumber = lineNumber; + } + + public String getImportName() { + return importName; + } + + public String getPackageName(){ + String ret = new String(importName.trim()); + if(ret.startsWith("import ")) + ret = ret.substring(7); + if(ret.endsWith(";")) + ret = ret.substring(0, ret.length() - 1); + return ret; + } + + public int getTab() { + return tab; + } + + public int getLineNumber() { + return lineNumber; + } +} \ No newline at end of file diff --git a/pdex/src/processing/mode/experimental/JavadocHelper.java b/pdex/src/processing/mode/experimental/JavadocHelper.java new file mode 100644 index 000000000..7cc582072 --- /dev/null +++ b/pdex/src/processing/mode/experimental/JavadocHelper.java @@ -0,0 +1,126 @@ +package processing.mode.experimental; + +import java.io.File; +import java.io.FileFilter; +import java.util.Iterator; +import java.util.TreeMap; + +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.jsoup.select.Elements; + +public class JavadocHelper { + + public static void loadJavaDoc(TreeMap jdocMap, File p5Ref){ + Document doc; + + //Pattern pat = Pattern.compile("\\w+"); + try { + if (p5Ref == null) { + System.out.println("P5 Ref location null"); + p5Ref = new File( + "/home/quarkninja/Workspaces/processing-workspace/processing/build/linux/work/modes/java/reference"); + } + + FileFilter fileFilter = new FileFilter() { + public boolean accept(File file) { + if(!file.getName().endsWith("_.html")) + return false; + int k = 0; + for (int i = 0; i < file.getName().length(); i++) { + if(file.getName().charAt(i)== '_') + k++; + if(k > 1) + return false; + } + return true; + } + }; + + for (File docFile : p5Ref.listFiles(fileFilter)) { + + doc = Jsoup.parse(docFile, null); + Elements elm = doc.getElementsByClass("ref-item"); + String msg = ""; + String methodName = docFile.getName().substring(0, docFile.getName().indexOf('_')); + //System.out.println(methodName); + for (Iterator it = elm.iterator(); it.hasNext();) { + Element ele = (Element) it.next(); + msg = "
    " + + ele.html() + "
    "; + //mat.replaceAll(""); + msg = msg.replaceAll("img src=\"", "img src=\"" + + p5Ref.toURI().toURL().toString() + "/"); + //System.out.println(ele.text()); + } + jdocMap.put(methodName, msg); + } + System.out.println("JDoc loaded "+jdocMap.size()); + /* File javaDocFile = new File( + "/home/quarkninja/Workspaces/processing-workspace/processing/build/javadoc/core/processing/core/PApplet.html"); + //SimpleOpenNI.SimpleOpenNI + doc = Jsoup.parse(javaDocFile, null); + + String msg = ""; + Elements elm = doc.getElementsByTag("pre"); +// Elements desc = doc.getElementsByTag("dl"); + //System.out.println(elm.toString()); + + for (Iterator iterator = elm.iterator(); iterator.hasNext();) { + Element element = (Element) iterator.next(); + + //System.out.println(element.text()); +// if (element.nextElementSibling() != null) +// System.out.println(element.nextElementSibling().text()); + //System.out.println("-------------------"); + msg = "
    " + + element.html() + + element.nextElementSibling() + + "
    "; + int k = 0; + Matcher matcher = pat.matcher(element.text()); + ArrayList parts = new ArrayList(); + while (matcher.find()) { +// System.out.print("Start index: " + matcher.start()); +// System.out.print(" End index: " + matcher.end() + " "); + if (k == 0 && !matcher.group().equals("public")) { + k = -1; + break; + } + // System.out.print(matcher.group() + " "); + parts.add(matcher.group()); + k++; + } + if (k <= 0 || parts.size() < 3) + continue; + int i = 0; + if (parts.get(i).equals("public")) + i++; + if (parts.get(i).equals("static") || parts.get(i).equals("final") + || parts.get(i).equals("class")) + i++; + if (parts.get(i).equals("static") || parts.get(i).equals("final")) + i++; +// System.out.println("Ret Type " + parts.get(i)); + + i++; // return type + + //System.out.println("Name " + parts.get(i)); + jdocMap.put(parts.get(i), msg); + } + +// for (String key : jdocMap.keySet()) { +// System.out.println("Method: " + key); +// System.out.println("Method: " + jdocMap.get(key)); +// } + * + */ + } catch (Exception e) { + e.printStackTrace(); + } + + + } + +} diff --git a/pdex/src/processing/mode/experimental/LineBreakpoint.java b/pdex/src/processing/mode/experimental/LineBreakpoint.java new file mode 100755 index 000000000..696726b8a --- /dev/null +++ b/pdex/src/processing/mode/experimental/LineBreakpoint.java @@ -0,0 +1,228 @@ +/* + * Copyright (C) 2012 Martin Leopold + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +import static processing.mode.experimental.ExperimentalMode.log; + +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.sun.jdi.AbsentInformationException; +import com.sun.jdi.Location; +import com.sun.jdi.ReferenceType; +import com.sun.jdi.request.BreakpointRequest; + +/** + * Model/Controller of a line breakpoint. Can be set before or while debugging. + * Adds a highlight using the debuggers view ({@link DebugEditor}). + * + * @author Martin Leopold + */ +public class LineBreakpoint implements ClassLoadListener { + + protected Debugger dbg; // the debugger + protected LineID line; // the line this breakpoint is set on + protected BreakpointRequest bpr; // the request on the VM's event request manager + protected ReferenceType theClass; // the class containing this breakpoint, null when not yet loaded + + /** + * Create a {@link LineBreakpoint}. If in a debug session, will try to + * immediately set the breakpoint. If not in a debug session or the + * corresponding class is not yet loaded the breakpoint will activate on + * class load. + * + * @param line the line id to create the breakpoint on + * @param dbg the {@link Debugger} + */ + public LineBreakpoint(LineID line, Debugger dbg) { + this.line = line; + line.startTracking(dbg.editor().getTab(line.fileName()).getDocument()); + this.dbg = dbg; + theClass = dbg.getClass(className()); // try to get the class immediately, may return null if not yet loaded + set(); // activate the breakpoint (show highlight, attach if debugger is running) + Logger.getLogger(LineBreakpoint.class.getName()).log(Level.INFO, "LBP Created " +toString() + " class: " + className(), new Object[]{}); + } + + /** + * Create a {@link LineBreakpoint} on a line in the current tab. + * + * @param lineIdx the line index of the current tab to create the breakpoint + * on + * @param dbg the {@link Debugger} + */ + // TODO: remove and replace by {@link #LineBreakpoint(LineID line, Debugger dbg)} + public LineBreakpoint(int lineIdx, Debugger dbg) { + this(dbg.editor().getLineIDInCurrentTab(lineIdx), dbg); + } + + /** + * Get the line id this breakpoint is on. + * + * @return the line id + */ + public LineID lineID() { + return line; + } + + /** + * Test if this breakpoint is on a certain line. + * + * @param testLine the line id to test + * @return true if this breakpoint is on the given line + */ + public boolean isOnLine(LineID testLine) { + return line.equals(testLine); + } + + /** + * Attach this breakpoint to the VM. Creates and enables a + * {@link BreakpointRequest}. VM needs to be paused. + */ + protected void attach() { + if (!dbg.isPaused()) { + Logger.getLogger(LineBreakpoint.class.getName()).log(Level.WARNING, "can't attach breakpoint, debugger not paused"); + return; + } + + if (theClass == null) { + Logger.getLogger(LineBreakpoint.class.getName()).log(Level.WARNING, "can't attach breakpoint, class not loaded: {0}", className()); + return; + } + + // find line in java space + LineID javaLine = dbg.sketchToJavaLine(line); + if (javaLine == null) { + Logger.getLogger(LineBreakpoint.class.getName()).log(Level.WARNING, "couldn't find line {0} in the java code", line); + return; + } + try { + Logger.getLogger(LineBreakpoint.class.getName()).log(Level.WARNING, "BPs of class: {0} , line " + (javaLine.lineIdx() + 1), new Object[]{theClass}); + List locations = theClass.locationsOfLine(javaLine.lineIdx() + 1); + if (locations.isEmpty()) { + Logger.getLogger(LineBreakpoint.class.getName()).log(Level.WARNING, "no location found for line {0} -> {1}", new Object[]{line, javaLine}); + return; + } + // use first found location + bpr = dbg.vm().eventRequestManager().createBreakpointRequest(locations.get(0)); + bpr.enable(); + Logger.getLogger(LineBreakpoint.class.getName()).log(Level.INFO, "attached breakpoint to {0} -> {1}", new Object[]{line, javaLine}); + } catch (AbsentInformationException ex) { + Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE, null, ex); + } + } + + /** + * Detach this breakpoint from the VM. Deletes the + * {@link BreakpointRequest}. + */ + protected void detach() { + if (bpr != null) { + dbg.vm().eventRequestManager().deleteEventRequest(bpr); + bpr = null; + } + } + + /** + * Set this breakpoint. Adds the line highlight. If Debugger is paused also + * attaches the breakpoint by calling {@link #attach()}. + */ + protected void set() { + dbg.addClassLoadListener(this); // class may not yet be loaded + dbg.editor().addBreakpointedLine(line); + if (theClass != null && dbg.isPaused()) { // class is loaded + // immediately activate the breakpoint + attach(); + } + if (dbg.editor().isInCurrentTab(line)) { + dbg.editor().getSketch().setModified(true); + } + } + + /** + * Remove this breakpoint. Clears the highlight and detaches the breakpoint + * if the debugger is paused. + */ + public void remove() { + dbg.removeClassLoadListener(this); + //System.out.println("removing " + line.lineIdx()); + dbg.editor().removeBreakpointedLine(line.lineIdx()); + if (dbg.isPaused()) { + // immediately remove the breakpoint + detach(); + } + line.stopTracking(); + if (dbg.editor().isInCurrentTab(line)) { + dbg.editor().getSketch().setModified(true); + } + } + +// public void enable() { +// } +// +// public void disable() { +// } + @Override + public String toString() { + return line.toString(); + } + + /** + * Get the name of the class this breakpoint belongs to. Needed for fetching + * the right location to create a breakpoint request. + * + * @return the class name + */ + protected String className() { + if (line.fileName().endsWith(".pde")) { + // standard tab + ReferenceType mainClass = dbg.getMainClass(); + //System.out.println(dbg.getMainClass().name()); + if (mainClass == null) { + return null; + } + return dbg.getMainClass().name(); + } + + if (line.fileName().endsWith(".java")) { + // pure java tab + return line.fileName().substring(0, line.fileName().lastIndexOf(".java")); + } + + return null; + } + + /** + * Event handler called when a class is loaded in the debugger. Causes the + * breakpoint to be attached, if its class was loaded. + * + * @param theClass the class that was just loaded. + */ + @Override + public void classLoaded(ReferenceType theClass) { + // check if our class is being loaded + log("Class Loaded: " + theClass.name()); + if (theClass.name().equals(className())) { + this.theClass = theClass; + attach(); + } + for (ReferenceType ct : theClass.nestedTypes()) { + log("Nested " + ct.name()); + } + } +} diff --git a/pdex/src/processing/mode/experimental/LineHighlight.java b/pdex/src/processing/mode/experimental/LineHighlight.java new file mode 100755 index 000000000..0fd18dfeb --- /dev/null +++ b/pdex/src/processing/mode/experimental/LineHighlight.java @@ -0,0 +1,196 @@ +/* + * Copyright (C) 2012 Martin Leopold + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +import java.awt.Color; +import java.util.HashSet; +import java.util.Set; + +/** + * Model/Controller for a highlighted source code line. Implements a custom + * background color and a text based marker placed in the left-hand gutter area. + * + * @author Martin Leopold + */ +public class LineHighlight implements LineListener { + + protected DebugEditor editor; // the view, used for highlighting lines by setting a background color + protected Color bgColor; // the background color for highlighting lines + protected LineID lineID; // the id of the line + protected String marker; // + protected Color markerColor; + protected int priority = 0; + protected static Set allHighlights = new HashSet(); + + protected static boolean isHighestPriority(LineHighlight hl) { + for (LineHighlight check : allHighlights) { + if (check.lineID().equals(hl.lineID()) && check.priority() > hl.priority()) { + return false; + } + } + return true; + } + + /** + * Create a {@link LineHighlight}. + * + * @param lineID the line id to highlight + * @param bgColor the background color used for highlighting + * @param editor the {@link DebugEditor} + */ + public LineHighlight(LineID lineID, Color bgColor, DebugEditor editor) { + this.lineID = lineID; + this.bgColor = bgColor; + this.editor = editor; + lineID.addListener(this); + lineID.startTracking(editor.getTab(lineID.fileName()).getDocument()); // TODO: overwrite a previous doc? + paint(); // already checks if on current tab + allHighlights.add(this); + } + + public void setPriority(int p) { + this.priority = p; + } + + public int priority() { + return priority; + } + + /** + * Create a {@link LineHighlight} on the current tab. + * + * @param lineIdx the line index on the current tab to highlight + * @param bgColor the background color used for highlighting + * @param editor the {@link DebugEditor} + */ + // TODO: Remove and replace by {@link #LineHighlight(LineID lineID, Color bgColor, DebugEditor editor)} + public LineHighlight(int lineIdx, Color bgColor, DebugEditor editor) { + this(editor.getLineIDInCurrentTab(lineIdx), bgColor, editor); + } + + /** + * Set a text based marker displayed in the left hand gutter area of this + * highlighted line. + * + * @param marker the marker text + */ + public void setMarker(String marker) { + this.marker = marker; + paint(); + } + + /** + * Set a text based marker displayed in the left hand gutter area of this + * highlighted line. Also use a custom text color. + * + * @param marker the marker text + * @param markerColor the text color + */ + public void setMarker(String marker, Color markerColor) { + this.markerColor = markerColor; + setMarker(marker); + } + + /** + * Retrieve the line id of this {@link LineHighlight}. + * + * @return the line id + */ + public LineID lineID() { + return lineID; + } + + /** + * Retrieve the color for highlighting this line. + * + * @return the highlight color. + */ + public Color getColor() { + return bgColor; + } + + /** + * Test if this highlight is on a certain line. + * + * @param testLine the line to test + * @return true if this highlight is on the given line + */ + public boolean isOnLine(LineID testLine) { + return lineID.equals(testLine); + } + + /** + * Event handler for line number changes (due to editing). Will remove the + * highlight from the old line number and repaint it at the new location. + * + * @param line the line that has changed + * @param oldLineIdx the old line index (0-based) + * @param newLineIdx the new line index (0-based) + */ + @Override + public void lineChanged(LineID line, int oldLineIdx, int newLineIdx) { + // clear old line + if (editor.isInCurrentTab(new LineID(line.fileName(), oldLineIdx))) { + editor.textArea().clearLineBgColor(oldLineIdx); + editor.textArea().clearGutterText(oldLineIdx); + } + + // paint new line + // but only if it's on top -> fixes current line being hidden by breakpoint moving it down. + // lineChanged events seem to come in inverse order of startTracking the LineID. (and bp is created first...) + if (LineHighlight.isHighestPriority(this)) { + paint(); + } + } + + /** + * Notify this line highlight that it is no longer used. Call this for + * cleanup before the {@link LineHighlight} is discarded. + */ + public void dispose() { + lineID.removeListener(this); + lineID.stopTracking(); + allHighlights.remove(this); + } + + /** + * (Re-)paint this line highlight. + */ + public void paint() { + if (editor.isInCurrentTab(lineID)) { + editor.textArea().setLineBgColor(lineID.lineIdx(), bgColor); + if (marker != null) { + if (markerColor != null) { + editor.textArea().setGutterText(lineID.lineIdx(), marker, markerColor); + } else { + editor.textArea().setGutterText(lineID.lineIdx(), marker); + } + } + } + } + + /** + * Clear this line highlight. + */ + public void clear() { + if (editor.isInCurrentTab(lineID)) { + editor.textArea().clearLineBgColor(lineID.lineIdx()); + editor.textArea().clearGutterText(lineID.lineIdx()); + } + } +} diff --git a/pdex/src/processing/mode/experimental/LineID.java b/pdex/src/processing/mode/experimental/LineID.java new file mode 100755 index 000000000..006098567 --- /dev/null +++ b/pdex/src/processing/mode/experimental/LineID.java @@ -0,0 +1,269 @@ +/* + * Copyright (C) 2012 Martin Leopold + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +import java.util.HashSet; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.BadLocationException; +import javax.swing.text.Document; +import javax.swing.text.Element; +import javax.swing.text.Position; + +/** + * Describes an ID for a code line. Comprised of a file name and a (0-based) + * line number. Can track changes to the line number due to text editing by + * attaching a {@link Document}. Registered {@link LineListener}s are notified + * of changes to the line number. + * + * @author Martin Leopold + */ +public class LineID implements DocumentListener { + + protected String fileName; // the filename + protected int lineIdx; // the line number, 0-based + protected Document doc; // the Document to use for line number tracking + protected Position pos; // the Position acquired during line number tracking + protected Set listeners = new HashSet(); // listeners for line number changes + + public LineID(String fileName, int lineIdx) { + this.fileName = fileName; + this.lineIdx = lineIdx; + } + + /** + * Get the file name of this line. + * + * @return the file name + */ + public String fileName() { + return fileName; + } + + /** + * Get the (0-based) line number of this line. + * + * @return the line index (i.e. line number, starting at 0) + */ + public synchronized int lineIdx() { + return lineIdx; + } + + @Override + public int hashCode() { + return toString().hashCode(); + } + + /** + * Test whether this {@link LineID} is equal to another object. Two + * {@link LineID}'s are equal when both their fileName and lineNo are equal. + * + * @param obj the object to test for equality + * @return {@code true} if equal + */ + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final LineID other = (LineID) obj; + if ((this.fileName == null) ? (other.fileName != null) : !this.fileName.equals(other.fileName)) { + return false; + } + if (this.lineIdx != other.lineIdx) { + return false; + } + return true; + } + + /** + * Output a string representation in the form fileName:lineIdx+1. Note this + * uses a 1-based line number as is customary for human-readable line + * numbers. + * + * @return the string representation of this line ID + */ + @Override + public String toString() { + return fileName + ":" + (lineIdx + 1); + } + +// /** +// * Retrieve a copy of this line ID. +// * +// * @return the copy +// */ +// @Override +// public LineID clone() { +// return new LineID(fileName, lineIdx); +// } + + /** + * Attach a {@link Document} to enable line number tracking when editing. + * The position to track is before the first non-whitespace character on the + * line. Edits happening before that position will cause the line number to + * update accordingly. Multiple {@link #startTracking} calls will replace + * the tracked document. Whoever wants a tracked line should track it and + * add itself as listener if necessary. + * ({@link LineHighlight}, {@link LineBreakpoint}) + * + * @param doc the {@link Document} to use for line number tracking + */ + public synchronized void startTracking(Document doc) { + //System.out.println("tracking: " + this); + if (doc == null) { + return; // null arg + } + if (doc == this.doc) { + return; // already tracking that doc + } + try { + Element line = doc.getDefaultRootElement().getElement(lineIdx); + if (line == null) { + return; // line doesn't exist + } + String lineText = doc.getText(line.getStartOffset(), line.getEndOffset() - line.getStartOffset()); + // set tracking position at (=before) first non-white space character on line + pos = doc.createPosition(line.getStartOffset() + nonWhiteSpaceOffset(lineText)); + this.doc = doc; + doc.addDocumentListener(this); + } catch (BadLocationException ex) { + Logger.getLogger(LineID.class.getName()).log(Level.SEVERE, null, ex); + pos = null; + this.doc = null; + } + } + + /** + * Notify this {@link LineID} that it is no longer in use. Will stop + * position tracking. Call this when this {@link LineID} is no longer + * needed. + */ + public synchronized void stopTracking() { + if (doc != null) { + doc.removeDocumentListener(this); + doc = null; + } + } + + /** + * Update the tracked position. Will notify listeners if line number has + * changed. + */ + protected synchronized void updatePosition() { + if (doc != null && pos != null) { + // track position + int offset = pos.getOffset(); + int oldLineIdx = lineIdx; + lineIdx = doc.getDefaultRootElement().getElementIndex(offset); // offset to lineNo + if (lineIdx != oldLineIdx) { + for (LineListener l : listeners) { + if (l != null) { + l.lineChanged(this, oldLineIdx, lineIdx); + } else { + listeners.remove(l); // remove null listener + } + } + } + } + } + + /** + * Add listener to be notified when the line number changes. + * + * @param l the listener to add + */ + public void addListener(LineListener l) { + listeners.add(l); + } + + /** + * Remove a listener for line number changes. + * + * @param l the listener to remove + */ + public void removeListener(LineListener l) { + listeners.remove(l); + } + + /** + * Calculate the offset of the first non-whitespace character in a string. + * + * @param str the string to examine + * @return offset of first non-whitespace character in str + */ + protected static int nonWhiteSpaceOffset(String str) { + for (int i = 0; i < str.length(); i++) { + if (!Character.isWhitespace(str.charAt(i))) { + return i; + } + } + return str.length(); + } + + /** + * Called when the {@link Document} registered using {@link #startTracking} + * is edited. This happens when text is inserted or removed. + * + * @param de + */ + protected void editEvent(DocumentEvent de) { + //System.out.println("document edit @ " + de.getOffset()); + if (de.getOffset() <= pos.getOffset()) { + updatePosition(); + //System.out.println("updating, new line no: " + lineNo); + } + } + + /** + * {@link DocumentListener} callback. Called when text is inserted. + * + * @param de + */ + @Override + public void insertUpdate(DocumentEvent de) { + editEvent(de); + } + + /** + * {@link DocumentListener} callback. Called when text is removed. + * + * @param de + */ + @Override + public void removeUpdate(DocumentEvent de) { + editEvent(de); + } + + /** + * {@link DocumentListener} callback. Called when attributes are changed. + * Not used. + * + * @param de + */ + @Override + public void changedUpdate(DocumentEvent de) { + // not needed. + } +} diff --git a/pdex/src/processing/mode/experimental/LineListener.java b/pdex/src/processing/mode/experimental/LineListener.java new file mode 100755 index 000000000..c6c3ae1b0 --- /dev/null +++ b/pdex/src/processing/mode/experimental/LineListener.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 Martin Leopold + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +/** + * A Listener for line number changes. + * + * @author Martin Leopold + */ +public interface LineListener { + + /** + * Event handler for line number changes (due to editing). + * + * @param line the line that has changed + * @param oldLineIdx the old line index (0-based) + * @param newLineIdx the new line index (0-based) + */ + void lineChanged(LineID line, int oldLineIdx, int newLineIdx); +} diff --git a/pdex/src/processing/mode/experimental/LocalVariableNode.java b/pdex/src/processing/mode/experimental/LocalVariableNode.java new file mode 100755 index 000000000..d1bdb2092 --- /dev/null +++ b/pdex/src/processing/mode/experimental/LocalVariableNode.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2012 Martin Leopold + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +import com.sun.jdi.ClassNotLoadedException; +import com.sun.jdi.InvalidTypeException; +import com.sun.jdi.LocalVariable; +import com.sun.jdi.StackFrame; +import com.sun.jdi.Value; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Specialized {@link VariableNode} for representing local variables. Overrides + * {@link #setValue} to properly change the value of the encapsulated local + * variable. + * + * @author Martin Leopold + */ +public class LocalVariableNode extends VariableNode { + + protected LocalVariable var; + protected StackFrame frame; + + /** + * Construct a {@link LocalVariableNode}. + * + * @param name the name + * @param type the type + * @param value the value + * @param var the local variable + * @param frame the stack frame containing the local variable + */ + public LocalVariableNode(String name, String type, Value value, LocalVariable var, StackFrame frame) { + super(name, type, value); + this.var = var; + this.frame = frame; + } + + @Override + public void setValue(Value value) { + try { + frame.setValue(var, value); + } catch (InvalidTypeException ex) { + Logger.getLogger(LocalVariableNode.class.getName()).log(Level.SEVERE, null, ex); + } catch (ClassNotLoadedException ex) { + Logger.getLogger(LocalVariableNode.class.getName()).log(Level.SEVERE, null, ex); + } + this.value = value; + } +} diff --git a/pdex/src/processing/mode/experimental/OffsetMatcher.java b/pdex/src/processing/mode/experimental/OffsetMatcher.java new file mode 100644 index 000000000..da62bb5a6 --- /dev/null +++ b/pdex/src/processing/mode/experimental/OffsetMatcher.java @@ -0,0 +1,273 @@ +/* + * Copyright (C) 2012-14 Manindra Moharana + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package processing.mode.experimental; + +import java.util.ArrayList; +import static processing.mode.experimental.ExperimentalMode.log; + +/** + * Performs offset matching between PDE and Java code (one line of code only) + * + * @author Manindra Moharana + * + */ + +public class OffsetMatcher { + + public ArrayList offsetMatch; + + String pdeCodeLine, javaCodeLine; + + boolean matchingNeeded = false; + + public OffsetMatcher(String pdeCode, String javaCode) { + this.pdeCodeLine = pdeCode; + this.javaCodeLine = javaCode; + if(pdeCodeLine.trim().equals(javaCodeLine.trim())){ //TODO: trim() needed here? + matchingNeeded = false; + offsetMatch = new ArrayList(); + //log("Offset Matching not needed"); + } + else + { + matchingNeeded = true; + minDistance(); + } + +// log("PDE <-> Java"); +// for (int i = 0; i < offsetMatch.size(); i++) { +// log(offsetMatch.get(i).pdeOffset + " <-> " +// + offsetMatch.get(i).javaOffset + +// ", " + pdeCodeLine.charAt(offsetMatch.get(i).pdeOffset) +// + " <-> " + javaCodeLine.charAt(offsetMatch.get(i).javaOffset)); +// } +// log("Length " + offsetMatch.size()); + } + + public int getPdeOffForJavaOff(int start, int length) { +// log("PDE :" + pdeCodeLine + "\nJAVA:" + javaCodeLine); +// log("getPdeOffForJavaOff() start:" + start + ", len " + length); + if(!matchingNeeded) return start; + int ans = getPdeOffForJavaOff(start); + int end = getPdeOffForJavaOff(start + length - 1); + if(ans == -1 || end == -1){ +// log("ans: " + ans + " end: " + end); + } + else { +// log(start + " java start off, pde start off " +// + ans); +// log((start + length - 1) + " java end off, pde end off " +// + end); +// log("J: " + javaCodeLine.substring(start, start + length) + "\nP: " +// + pdeCodeLine.substring(ans, end + 1)); + } + return ans; + } + + public int getJavaOffForPdeOff(int start, int length) { + if(!matchingNeeded) return start; + int ans = getJavaOffForPdeOff(start); +// log(start + " pde start off, java start off " +// + getJavaOffForPdeOff(start)); +// log((start + length - 1) + " pde end off, java end off " +// + getJavaOffForPdeOff(start + length - 1)); + return ans; + } + + public int getPdeOffForJavaOff(int javaOff) { + if (!matchingNeeded) + return javaOff; + for (int i = offsetMatch.size() - 1; i >= 0; i--) { + if (offsetMatch.get(i).javaOffset < javaOff) { + continue; + } else if (offsetMatch.get(i).javaOffset == javaOff) { +// int j = i; + + // sometimes there are multiple repeated j offsets for a single pde offset + // so go to the last one, with bound check + while (i > 0 && offsetMatch.get(--i).javaOffset == javaOff) { +// log("MP " + offsetMatch.get(i).javaOffset + " " +// + offsetMatch.get(i).pdeOffset); + } + if (i + 1 < offsetMatch.size()) { // bounds check, see #2664 + int pdeOff = offsetMatch.get(++i).pdeOffset; + while (i > 0 && offsetMatch.get(--i).pdeOffset == pdeOff) { + } + } + int j = i + 1; + if (j > -1 && j < offsetMatch.size()) + return offsetMatch.get(j).pdeOffset; + } + + } + return -1; + } + + public int getJavaOffForPdeOff(int pdeOff) { + if(!matchingNeeded) return pdeOff; + for (int i = offsetMatch.size() - 1; i >= 0; i--) { + if (offsetMatch.get(i).pdeOffset < pdeOff) { + continue; + } else if (offsetMatch.get(i).pdeOffset == pdeOff) { +// int j = i; + while (i > 0 && offsetMatch.get(--i).pdeOffset == pdeOff) { +// log("MP " + offsetMatch.get(i).javaOffset + " " +// + offsetMatch.get(i).pdeOffset); + } + if (i + 1 < offsetMatch.size()) { // bounds check, see #2664 + int javaOff = offsetMatch.get(++i).javaOffset; + while (i > 0 && offsetMatch.get(--i).javaOffset == javaOff) { + } + } + int j = i + 1; + if (j > -1 && j < offsetMatch.size()) + return offsetMatch.get(j).javaOffset; + } + + } + return -1; + } + + /** + * Finds 'distance' between two Strings. + * See Edit Distance Problem + * https://secweb.cs.odu.edu/~zeil/cs361/web/website/Lectures/styles/pages/editdistance.html + * http://www.stanford.edu/class/cs124/lec/med.pdf + * + */ + private int minDistance() { + +// word1 = reverse(word1); +// word2 = reverse(word2); + int len1 = pdeCodeLine.length(); + int len2 = javaCodeLine.length(); + // log(pdeCodeLine + " len: " + len1); + // log(javaCodeLine + " len: " + len2); + // len1+1, len2+1, because finally return dp[len1][len2] + int[][] dp = new int[len1 + 1][len2 + 1]; + + for (int i = 0; i <= len1; i++) { + dp[i][0] = i; + } + + for (int j = 0; j <= len2; j++) { + dp[0][j] = j; + } + + //iterate though, and check last char + for (int i = 0; i < len1; i++) { + char c1 = pdeCodeLine.charAt(i); + for (int j = 0; j < len2; j++) { + char c2 = javaCodeLine.charAt(j); + //System.out.print(c1 + "<->" + c2); + //if last two chars equal + if (c1 == c2) { + //update dp value for +1 length + dp[i + 1][j + 1] = dp[i][j]; +// log(); + } else { + int replace = dp[i][j] + 1; + int insert = dp[i][j + 1] + 1; + int delete = dp[i + 1][j] + 1; +// if (replace < delete) { +// log(" --- D"); +// } else +// log(" --- R"); + int min = replace > insert ? insert : replace; + min = delete > min ? min : delete; + dp[i + 1][j + 1] = min; + } + } + } + + ArrayList alist = new ArrayList(); + offsetMatch = alist; + minDistInGrid(dp, len1, len2, 0, 0, pdeCodeLine.toCharArray(), + javaCodeLine.toCharArray(), alist); + return dp[len1][len2]; + } + + private void minDistInGrid(int g[][], int i, int j, int fi, int fj, + char s1[], char s2[], ArrayList set) { +// if(i < s1.length)System.out.print(s1[i] + " <->"); +// if(j < s2.length)System.out.print(s2[j]); + if (i < s1.length && j < s2.length) { +// pdeCodeMap[k] = i; +// javaCodeMap[k] = j; + //System.out.print(s1[i] + " " + i + " <-> " + j + " " + s2[j]); + set.add(new OffsetPair(i, j)); +// if (s1[i] != s2[j]) +// System.out.println("--"); + } + //System.out.println(); + if (i == fi && j == fj) { + //System.out.println("Reached end."); + } else { + int a = Integer.MAX_VALUE, b = a, c = a; + if (i > 0) + a = g[i - 1][j]; + if (j > 0) + b = g[i][j - 1]; + if (i > 0 && j > 0) + c = g[i - 1][j - 1]; + int mini = Math.min(a, Math.min(b, c)); + if (mini == a) { + //System.out.println(s1[i + 1] + " " + s2[j]); + minDistInGrid(g, i - 1, j, fi, fj, s1, s2, set); + } else if (mini == b) { + //System.out.println(s1[i] + " " + s2[j + 1]); + minDistInGrid(g, i, j - 1, fi, fj, s1, s2, set); + } else if (mini == c) { + //System.out.println(s1[i + 1] + " " + s2[j + 1]); + minDistInGrid(g, i - 1, j - 1, fi, fj, s1, s2, set); + } + } + } + + private class OffsetPair { + public final int pdeOffset, javaOffset; + + public OffsetPair(int pde, int java) { + pdeOffset = pde; + javaOffset = java; + } + } + + public static void main(String[] args) { +// minDistance("c = #qwerty;", "c = 0xffqwerty;"); + OffsetMatcher a; + +// a = new OffsetMatcher("int a = int(can); int ball;", +// "int a = PApplet.parseInt(can); int ball;"); +// a.getPdeOffForJavaOff(25, 3); +// a.getJavaOffForPdeOff(12, 3); +// minDistance("static void main(){;", "public static void main(){;"); +// minDistance("#bb00aa", "0xffbb00aa"); +// a = new OffsetMatcher("void test(ArrayList boids){", +// "public void test(ArrayList boids){"); +// a.getJavaOffForPdeOff(20,4); + a = new OffsetMatcher("}", "\n"); + a.getPdeOffForJavaOff(0,1); + log("--"); + a = new OffsetMatcher("color abc = #qwerty;", "int abc = 0xffqwerty;"); + a.getPdeOffForJavaOff(4, 3); +// a.getJavaOffForPdeOff(6, 3); +// distance("c = #bb00aa;", "c = 0xffbb00aa;"); + } +} diff --git a/pdex/src/processing/mode/experimental/Problem.java b/pdex/src/processing/mode/experimental/Problem.java new file mode 100644 index 000000000..6fa029188 --- /dev/null +++ b/pdex/src/processing/mode/experimental/Problem.java @@ -0,0 +1,198 @@ +/* + Part of the XQMode project - https://github.com/Manindra29/XQMode + + Under Google Summer of Code 2012 - + http://www.google-melange.com/gsoc/homepage/google/gsoc2012 + + Copyright (C) 2012 Manindra Moharana + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package processing.mode.experimental; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.eclipse.jdt.core.compiler.IProblem; + +/** + * Wrapper class for IProblem. + * + * Stores the tabIndex and line number according to its tab, including the + * original IProblem object + * + * @author Manindra Moharana <me@mkmoharana.com> + * + */ +public class Problem { + /** + * The IProblem which is being wrapped + */ + private IProblem iProblem; + /** + * The tab number to which the error belongs to + */ + private int tabIndex; + /** + * Line number(pde code) of the error + */ + private int lineNumber; + + private int lineStartOffset; + + private int lineStopOffset; + + /** + * Error Message. Processed form of IProblem.getMessage() + */ + private String message; + + /** + * The type of error - WARNING or ERROR. + */ + private int type; + + public static final int ERROR = 1, WARNING = 2; + + /** + * + * @param iProblem - The IProblem which is being wrapped + * @param tabIndex - The tab number to which the error belongs to + * @param lineNumber - Line number(pde code) of the error + */ + public Problem(IProblem iProblem, int tabIndex, int lineNumber) { + this.iProblem = iProblem; + if(iProblem.isError()) { + type = ERROR; + } + else if(iProblem.isWarning()) { + type = WARNING; + } + this.tabIndex = tabIndex; + this.lineNumber = lineNumber; + this.message = process(iProblem); + this.message = ErrorMessageSimplifier.getSimplifiedErrorMessage(this); + //ErrorMessageSimplifier.getSimplifiedErrorMessage(this); + } + + public void setPDEOffsets(int startOffset, int stopOffset){ + lineStartOffset = startOffset; + lineStopOffset = stopOffset; + } + + public int getPDELineStartOffset(){ + return lineStartOffset; + } + + public int getPDELineStopOffset(){ + return lineStopOffset; + } + + public String toString() { + return new String("TAB " + tabIndex + ",LN " + lineNumber + "LN START OFF: " + + lineStartOffset + ",LN STOP OFF: " + lineStopOffset + ",PROB: " + + message); + } + + public boolean isError(){ + return type == ERROR; + } + + public boolean isWarning(){ + return type == WARNING; + } + + public String getMessage(){ + return message; + } + + public IProblem getIProblem(){ + return iProblem; + } + + public int getTabIndex(){ + return tabIndex; + } + + public int getLineNumber(){ + return lineNumber; + } + + /** + * Remember to subtract a -1 to line number because in compile check code an + * extra package statement is added, so all line numbers are increased by 1 + * + * @return + */ + public int getSourceLineNumber(){ + return iProblem.getSourceLineNumber(); + } + + public void setType(int ProblemType){ + if(ProblemType == ERROR) + type = ERROR; + else if(ProblemType == WARNING) + type = WARNING; + else throw new IllegalArgumentException("Illegal Problem type passed to Problem.setType(int)"); + } + + private static Pattern pattern; + private static Matcher matcher; + + private static final String tokenRegExp = "\\b token\\b"; + + public static String process(IProblem problem) { + return process(problem.getMessage()); + } + + /** + * Processes error messages and attempts to make them a bit more english like. + * Currently performs: + *
  • Remove all instances of token. "Syntax error on token 'blah', delete this token" + * becomes "Syntax error on 'blah', delete this" + * @param message - The message to be processed + * @return String - The processed message + */ + public static String process(String message) { + // Remove all instances of token + // "Syntax error on token 'blah', delete this token" + if(message == null) return null; + pattern = Pattern.compile(tokenRegExp); + matcher = pattern.matcher(message); + message = matcher.replaceAll(""); + + return message; + } + + // Split camel case words into separate words. + // "VaraibleDeclaration" becomes "Variable Declaration" + // But sadly "PApplet" become "P Applet" and so on. + public static String splitCamelCaseWord(String word) { + String newWord = ""; + for (int i = 1; i < word.length(); i++) { + if (Character.isUpperCase(word.charAt(i))) { + // System.out.println(word.substring(0, i) + " " + // + word.substring(i)); + newWord += word.substring(0, i) + " "; + word = word.substring(i); + i = 1; + } + } + newWord += word; + // System.out.println(newWord); + return newWord.trim(); + } + +} diff --git a/pdex/src/processing/mode/experimental/SketchOutline.java b/pdex/src/processing/mode/experimental/SketchOutline.java new file mode 100644 index 000000000..620d8d1b2 --- /dev/null +++ b/pdex/src/processing/mode/experimental/SketchOutline.java @@ -0,0 +1,388 @@ +package processing.mode.experimental; + +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Point; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowEvent; +import java.awt.event.WindowFocusListener; +import java.util.List; + +import javax.swing.BoxLayout; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextField; +import javax.swing.JTree; +import javax.swing.ScrollPaneConstants; +import javax.swing.SwingWorker; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.event.TreeSelectionListener; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeCellRenderer; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreeSelectionModel; + +import org.eclipse.jdt.core.dom.ASTNode; +import org.eclipse.jdt.core.dom.FieldDeclaration; +import org.eclipse.jdt.core.dom.MethodDeclaration; +import org.eclipse.jdt.core.dom.TypeDeclaration; +import org.eclipse.jdt.core.dom.VariableDeclarationFragment; + +public class SketchOutline { + protected JFrame frmOutlineView; + + protected ErrorCheckerService errorCheckerService; + + protected JScrollPane jsp; + + protected DefaultMutableTreeNode soNode, tempNode; + + protected final JTree soTree; + + protected JTextField searchField; + + protected DebugEditor editor; + + protected boolean internalSelection = false; + + public SketchOutline(DefaultMutableTreeNode codeTree, ErrorCheckerService ecs) { + errorCheckerService = ecs; + editor = ecs.getEditor(); + soNode = new DefaultMutableTreeNode(); + generateSketchOutlineTree(soNode, codeTree); + soNode = (DefaultMutableTreeNode) soNode.getChildAt(0); + tempNode = soNode; + soTree = new JTree(soNode); + createGUI(); + } + + private void createGUI(){ + frmOutlineView = new JFrame(); + frmOutlineView.setAlwaysOnTop(true); + frmOutlineView.setUndecorated(true); + Point tp = errorCheckerService.getEditor().ta.getLocationOnScreen(); +// frmOutlineView.setBounds(tp.x +// + errorCheckerService.getEditor().ta +// .getWidth() - 300, tp.y, 300, +// errorCheckerService.getEditor().ta.getHeight()); + + //TODO: ^Absolute dimensions are bad bro + + int minWidth = (int) (editor.getMinimumSize().width * 0.7f), + maxWidth = (int) (editor.getMinimumSize().width * 0.9f); + frmOutlineView.setLayout(new BoxLayout(frmOutlineView.getContentPane(), + BoxLayout.Y_AXIS)); + JPanel panelTop = new JPanel(), panelBottom = new JPanel(); + panelTop.setLayout(new BoxLayout(panelTop, BoxLayout.Y_AXIS)); + panelBottom.setLayout(new BoxLayout(panelBottom, BoxLayout.Y_AXIS)); + searchField = new JTextField(); + searchField.setMinimumSize(new Dimension(minWidth, 25)); + panelTop.add(searchField); + + jsp = new JScrollPane(); + + soTree.getSelectionModel() + .setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); + soTree.setRootVisible(false); + soTree.setCellRenderer(new CustomCellRenderer()); + for (int i = 0; i < soTree.getRowCount(); i++) { + soTree.expandRow(i); + } + soTree.setSelectionRow(0); + + jsp.setViewportView(soTree); + jsp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); + jsp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); + jsp.setMinimumSize(new Dimension(minWidth, editor.ta.getHeight() - 10)); + jsp.setMaximumSize(new Dimension(maxWidth, editor.ta.getHeight() - 10)); + + panelBottom.add(jsp); + frmOutlineView.add(panelTop); + frmOutlineView.add(panelBottom); + frmOutlineView.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + frmOutlineView.pack(); + frmOutlineView.setBounds(tp.x + + errorCheckerService.getEditor().ta + .getWidth() - minWidth, tp.y, minWidth, + Math.min(editor.ta.getHeight(), frmOutlineView.getHeight())); + frmOutlineView.setMinimumSize(new Dimension(minWidth, Math + .min(errorCheckerService.getEditor().ta.getHeight(), frmOutlineView.getHeight()))); + frmOutlineView.setLocation(tp.x + + errorCheckerService.getEditor().ta + .getWidth()/2 - frmOutlineView.getWidth()/2, + frmOutlineView.getY() + + (editor.ta.getHeight() - frmOutlineView + .getHeight()) / 2); + addListeners(); + } + + protected void addListeners() { + + searchField.addKeyListener(new KeyAdapter() { + public void keyPressed(KeyEvent evt) { + if (soTree.getRowCount() == 0) + return; + + internalSelection = true; + + if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { + close(); + } + else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { + if (soTree.getLastSelectedPathComponent() != null) { + DefaultMutableTreeNode tnode = (DefaultMutableTreeNode) soTree + .getLastSelectedPathComponent(); + if (tnode.getUserObject() instanceof ASTNodeWrapper) { + ASTNodeWrapper awrap = (ASTNodeWrapper) tnode.getUserObject(); + awrap.highlightNode(errorCheckerService.astGenerator); + //errorCheckerService.highlightNode(awrap); + close(); + } + } + } + else if (evt.getKeyCode() == KeyEvent.VK_UP) { + if (soTree.getLastSelectedPathComponent() == null) { + soTree.setSelectionRow(0); + return; + } + + int x = soTree.getLeadSelectionRow() - 1; + int step = jsp.getVerticalScrollBar().getMaximum() + / soTree.getRowCount(); + if (x == -1) { + x = soTree.getRowCount() - 1; + jsp.getVerticalScrollBar().setValue(jsp.getVerticalScrollBar().getMaximum()); + } else { + jsp.getVerticalScrollBar().setValue((jsp.getVerticalScrollBar() + .getValue() - step)); + } + soTree.setSelectionRow(x); + } + else if (evt.getKeyCode() == KeyEvent.VK_DOWN) { + if (soTree.getLastSelectedPathComponent() == null) { + soTree.setSelectionRow(0); + return; + } + int x = soTree.getLeadSelectionRow() + 1; + + int step = jsp.getVerticalScrollBar().getMaximum() + / soTree.getRowCount(); + if (x == soTree.getRowCount()) { + x = 0; + jsp.getVerticalScrollBar().setValue(jsp.getVerticalScrollBar().getMinimum()); + } else { + jsp.getVerticalScrollBar().setValue((jsp.getVerticalScrollBar() + .getValue() + step)); + } + soTree.setSelectionRow(x); + } + } + }); + + searchField.getDocument().addDocumentListener(new DocumentListener() { + + public void insertUpdate(DocumentEvent e) { + updateSelection(); + } + + public void removeUpdate(DocumentEvent e) { + updateSelection(); + } + + public void changedUpdate(DocumentEvent e) { + updateSelection(); + } + + private void updateSelection(){ + SwingWorker worker = new SwingWorker() { + protected Object doInBackground() throws Exception { + String text = searchField.getText().toLowerCase(); + tempNode = new DefaultMutableTreeNode(); + filterTree(text, tempNode, soNode); + return null; + } + + protected void done() { + soTree.setModel(new DefaultTreeModel(tempNode)); + ((DefaultTreeModel) soTree.getModel()).reload(); + for (int i = 0; i < soTree.getRowCount(); i++) { + soTree.expandRow(i); + } + internalSelection = true; + soTree.setSelectionRow(0); + } + }; + worker.execute(); + } + }); + + frmOutlineView.addWindowFocusListener(new WindowFocusListener() { + public void windowLostFocus(WindowEvent e) { + close(); + } + + public void windowGainedFocus(WindowEvent e) { + } + }); + + soTree.addTreeSelectionListener(new TreeSelectionListener() { + + public void valueChanged(TreeSelectionEvent e) { + + if (internalSelection) { + internalSelection = (false); + return; + } + // log(e); + scrollToNode(); + } + }); + + soTree.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent me) { + scrollToNode(); + } + }); + } + + private void scrollToNode(){ + SwingWorker worker = new SwingWorker() { + + protected Object doInBackground() throws Exception { + return null; + } + + protected void done() { + if (soTree.getLastSelectedPathComponent() == null) { + return; + } + DefaultMutableTreeNode tnode = (DefaultMutableTreeNode) soTree + .getLastSelectedPathComponent(); + if (tnode.getUserObject() instanceof ASTNodeWrapper) { + ASTNodeWrapper awrap = (ASTNodeWrapper) tnode.getUserObject(); + awrap.highlightNode(errorCheckerService.astGenerator); + // log(awrap); + //errorCheckerService.highlightNode(awrap); + close(); + } + } + }; + worker.execute(); + } + + protected boolean filterTree(String prefix, DefaultMutableTreeNode tree, + DefaultMutableTreeNode mainTree) { + if (mainTree.isLeaf()) { + return (mainTree.getUserObject().toString().toLowerCase() + .startsWith(prefix)); + } + + boolean found = false; + for (int i = 0; i < mainTree.getChildCount(); i++) { + DefaultMutableTreeNode tNode = new DefaultMutableTreeNode( + ((DefaultMutableTreeNode) mainTree + .getChildAt(i)) + .getUserObject()); + if (filterTree(prefix, tNode, + (DefaultMutableTreeNode) mainTree.getChildAt(i))) { + found = true; + tree.add(tNode); + } + } + return found; + } + + protected void generateSketchOutlineTree(DefaultMutableTreeNode node, + DefaultMutableTreeNode codetree) { + if (codetree == null) + return; + //log("Visi " + codetree + codetree.getUserObject().getClass().getSimpleName()); + if (!(codetree.getUserObject() instanceof ASTNodeWrapper)) + return; + ASTNodeWrapper awnode = (ASTNodeWrapper) codetree.getUserObject(), aw2 = null; + + if (awnode.getNode() instanceof TypeDeclaration) { + aw2 = new ASTNodeWrapper( ((TypeDeclaration) awnode.getNode()).getName(), + ((TypeDeclaration) awnode.getNode()).getName() + .toString()); + } else if (awnode.getNode() instanceof MethodDeclaration) { + aw2 = new ASTNodeWrapper( + ((MethodDeclaration) awnode.getNode()).getName(), + new CompletionCandidate( + ((MethodDeclaration) awnode + .getNode())) + .toString()); + } else if (awnode.getNode() instanceof FieldDeclaration) { + FieldDeclaration fd = (FieldDeclaration) awnode.getNode(); + for (VariableDeclarationFragment vdf : (List) fd + .fragments()) { + DefaultMutableTreeNode newNode = new DefaultMutableTreeNode( + new ASTNodeWrapper( + vdf.getName(), + new CompletionCandidate( + vdf) + .toString())); + node.add(newNode); + } + return; + } + if (aw2 == null) + return; + DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(aw2); + node.add(newNode); + for (int i = 0; i < codetree.getChildCount(); i++) { + generateSketchOutlineTree(newNode, + (DefaultMutableTreeNode) codetree.getChildAt(i)); + } + } + + public void show() { + frmOutlineView.setVisible(true); + } + + public void close(){ + frmOutlineView.setVisible(false); + frmOutlineView.dispose(); + } + + public boolean isVisible(){ + return frmOutlineView.isVisible(); + } + + protected class CustomCellRenderer extends DefaultTreeCellRenderer { + + public Component getTreeCellRendererComponent(JTree tree, Object value, + boolean sel, boolean expanded, boolean leaf, int row, + boolean hasFocus) { + + super.getTreeCellRendererComponent(tree, value, sel, expanded, + leaf, row, hasFocus); + if (value instanceof DefaultMutableTreeNode) + setIcon(getTreeIcon(value)); + + return this; + } + + public javax.swing.Icon getTreeIcon(Object o) { + if (((DefaultMutableTreeNode) o).getUserObject() instanceof ASTNodeWrapper) { + + ASTNodeWrapper awrap = (ASTNodeWrapper) ((DefaultMutableTreeNode) o) + .getUserObject(); + int type = awrap.getNode().getParent().getNodeType(); + if (type == ASTNode.METHOD_DECLARATION) + return editor.dmode.methodIcon; + if (type == ASTNode.TYPE_DECLARATION) + return editor.dmode.classIcon; + if (type == ASTNode.VARIABLE_DECLARATION_FRAGMENT) + return editor.dmode.fieldIcon; + } + return null; + } + } +} diff --git a/pdex/src/processing/mode/experimental/TabOutline.java b/pdex/src/processing/mode/experimental/TabOutline.java new file mode 100644 index 000000000..238671536 --- /dev/null +++ b/pdex/src/processing/mode/experimental/TabOutline.java @@ -0,0 +1,341 @@ +package processing.mode.experimental; + +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FontMetrics; +import java.awt.GridBagLayout; +import java.awt.Point; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowEvent; +import java.awt.event.WindowFocusListener; + +import javax.swing.BoxLayout; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextField; +import javax.swing.JTree; +import javax.swing.ScrollPaneConstants; +import javax.swing.SwingWorker; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.event.TreeSelectionListener; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeCellRenderer; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreeSelectionModel; + +import processing.app.SketchCode; + +public class TabOutline { + protected JFrame frmOutlineView; + + protected JScrollPane jsp; + + protected DefaultMutableTreeNode tabNode, tempNode; + + protected JTree tabTree; + + protected JTextField searchField; + + protected JLabel lblCaption; + + protected DebugEditor editor; + + protected ErrorCheckerService errorCheckerService; + + protected boolean internalSelection = false; + + public TabOutline(ErrorCheckerService ecs) { + errorCheckerService = ecs; + editor = ecs.getEditor(); + createGUI(); + } + + private void createGUI() { + frmOutlineView = new JFrame(); + frmOutlineView.setAlwaysOnTop(true); + frmOutlineView.setUndecorated(true); + Point tp = errorCheckerService.getEditor().ta.getLocationOnScreen(); + lblCaption = new JLabel("Tabs List (type to filter)"); +// int minWidth = (int) (editor.getMinimumSize().width * 0.7f), maxWidth = (int) (editor +// .getMinimumSize().width * 0.9f); + int minWidth = estimateFrameWidth(), maxWidth = (int) (editor + .getMinimumSize().width * 0.9f); + frmOutlineView.setLayout(new BoxLayout(frmOutlineView.getContentPane(), + BoxLayout.Y_AXIS)); + JPanel panelTop = new JPanel(), panelMiddle = new JPanel(), panelBottom = new JPanel(); + panelTop.setLayout(new GridBagLayout()); + panelMiddle.setLayout(new BoxLayout(panelMiddle, BoxLayout.Y_AXIS)); + panelBottom.setLayout(new BoxLayout(panelBottom, BoxLayout.Y_AXIS)); + lblCaption.setAlignmentX(Component.LEFT_ALIGNMENT); + panelTop.add(lblCaption); + searchField = new JTextField(); + searchField.setMinimumSize(new Dimension(minWidth, 25)); + panelMiddle.add(searchField); + + jsp = new JScrollPane(); + populateTabTree(); + jsp.setViewportView(tabTree); + jsp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); + jsp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); + jsp.setMinimumSize(new Dimension(minWidth, editor.ta.getHeight() - 10)); + jsp.setMaximumSize(new Dimension(maxWidth, editor.ta.getHeight() - 10)); + + panelBottom.add(jsp); + frmOutlineView.add(panelTop); + frmOutlineView.add(panelMiddle); + frmOutlineView.add(panelBottom); + frmOutlineView.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + frmOutlineView.pack(); + frmOutlineView.setBounds(tp.x + + errorCheckerService.getEditor().ta + .getWidth() - minWidth, + tp.y, + minWidth, + estimateFrameHeight()); + frmOutlineView.setMinimumSize(new Dimension(minWidth, Math + .min(errorCheckerService.getEditor().ta.getHeight(), + frmOutlineView.getHeight()))); + frmOutlineView.setLocation(tp.x + + errorCheckerService.getEditor().ta + .getWidth()/2 - frmOutlineView.getWidth()/2, + frmOutlineView.getY() + + (editor.ta.getHeight() - frmOutlineView + .getHeight()) / 2); + DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) tabTree.getCellRenderer(); + renderer.setLeafIcon(null); + renderer.setClosedIcon(null); + renderer.setOpenIcon(null); + addListeners(); + } + + private void addListeners() { + searchField.addKeyListener(new KeyAdapter() { + public void keyPressed(KeyEvent evt) { + if (tabTree.getRowCount() == 0) + return; + + internalSelection = true; + + if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { + close(); + } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { + if (tabTree.getLastSelectedPathComponent() != null) { + DefaultMutableTreeNode tnode = (DefaultMutableTreeNode) tabTree + .getLastSelectedPathComponent(); + //log("Enter Key, Tab: " + tnode); + switchToTab(tnode.toString()); + close(); + } + } else if (evt.getKeyCode() == KeyEvent.VK_UP) { + if (tabTree.getLastSelectedPathComponent() == null) { + tabTree.setSelectionRow(0); + return; + } + + int x = tabTree.getLeadSelectionRow() - 1; + int step = jsp.getVerticalScrollBar().getMaximum() + / tabTree.getRowCount(); + if (x == -1) { + x = tabTree.getRowCount() - 1; + jsp.getVerticalScrollBar().setValue(jsp.getVerticalScrollBar() + .getMaximum()); + } else { + jsp.getVerticalScrollBar().setValue((jsp.getVerticalScrollBar() + .getValue() - step)); + } + tabTree.setSelectionRow(x); + } else if (evt.getKeyCode() == KeyEvent.VK_DOWN) { + if (tabTree.getLastSelectedPathComponent() == null) { + tabTree.setSelectionRow(0); + return; + } + int x = tabTree.getLeadSelectionRow() + 1; + + int step = jsp.getVerticalScrollBar().getMaximum() + / tabTree.getRowCount(); + if (x == tabTree.getRowCount()) { + x = 0; + jsp.getVerticalScrollBar().setValue(jsp.getVerticalScrollBar() + .getMinimum()); + } else { + jsp.getVerticalScrollBar().setValue((jsp.getVerticalScrollBar() + .getValue() + step)); + } + tabTree.setSelectionRow(x); + } + } + }); + + searchField.getDocument().addDocumentListener(new DocumentListener() { + + public void insertUpdate(DocumentEvent e) { + updateSelection(); + } + + public void removeUpdate(DocumentEvent e) { + updateSelection(); + } + + public void changedUpdate(DocumentEvent e) { + updateSelection(); + } + + private void updateSelection() { + SwingWorker worker = new SwingWorker() { + protected Object doInBackground() throws Exception { + String text = searchField.getText().toLowerCase(); + tempNode = new DefaultMutableTreeNode(); + filterTree(text, tempNode, tabNode); + return null; + } + + protected void done() { + tabTree.setModel(new DefaultTreeModel(tempNode)); + ((DefaultTreeModel) tabTree.getModel()).reload(); +// for (int i = 0; i < tabTree.getRowCount(); i++) { +// tabTree.expandRow(i); +// } + internalSelection = true; + tabTree.setSelectionRow(0); + } + }; + worker.execute(); + } + }); + + tabTree.addTreeSelectionListener(new TreeSelectionListener() { + + public void valueChanged(TreeSelectionEvent e) { + + if (internalSelection) { + //log("Internal selection"); + internalSelection = (false); + return; + } + // log(e); + SwingWorker worker = new SwingWorker() { + + protected Object doInBackground() throws Exception { + return null; + } + + protected void done() { + if (tabTree.getLastSelectedPathComponent() == null) { + return; + } + DefaultMutableTreeNode tnode = (DefaultMutableTreeNode) tabTree + .getLastSelectedPathComponent(); + //log("Clicked " + tnode); + switchToTab(tnode.toString()); + close(); + } + }; + worker.execute(); + } + }); + + tabTree.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent me) { + if (tabTree.getLastSelectedPathComponent() == null) { + return; + } + DefaultMutableTreeNode tnode = (DefaultMutableTreeNode) tabTree + .getLastSelectedPathComponent(); + //log("Clicked " + tnode); + switchToTab(tnode.toString()); + close(); + } + }); + + frmOutlineView.addWindowFocusListener(new WindowFocusListener() { + public void windowLostFocus(WindowEvent e) { + close(); + } + + public void windowGainedFocus(WindowEvent e) { + } + }); + } + + private void switchToTab(String tabName) { + for (SketchCode sc : editor.getSketch().getCode()) { + if (sc.getPrettyName().equals(tabName)) { + editor.getSketch().setCurrentCode(editor.getSketch().getCodeIndex(sc)); + } + } + } + + private void populateTabTree() { + tabNode = new DefaultMutableTreeNode("Tabs"); + for (SketchCode sc : editor.getSketch().getCode()) { + DefaultMutableTreeNode tab = new DefaultMutableTreeNode( + sc.getPrettyName()); + tabNode.add(tab); + } + tempNode = tabNode; + tabTree = new JTree(tabNode); + tabTree.getSelectionModel() + .setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); + tabTree.setRootVisible(false); + tabTree.setSelectionRow(editor.getSketch().getCurrentCodeIndex()); + } + + protected boolean filterTree(String prefix, DefaultMutableTreeNode tree, + DefaultMutableTreeNode mainTree) { + if (mainTree.isLeaf()) { + return (mainTree.getUserObject().toString().toLowerCase() + .startsWith(prefix)); + } + + boolean found = false; + for (int i = 0; i < mainTree.getChildCount(); i++) { + DefaultMutableTreeNode tNode = new DefaultMutableTreeNode( + ((DefaultMutableTreeNode) mainTree + .getChildAt(i)) + .getUserObject()); + if (filterTree(prefix, tNode, + (DefaultMutableTreeNode) mainTree.getChildAt(i))) { + found = true; + tree.add(tNode); + } + } + return found; + } + + private int estimateFrameWidth() { + FontMetrics fm = editor.ta.getGraphics().getFontMetrics(); + int w = fm.stringWidth(lblCaption.getText()) + 10; + for (int i = 0; i < editor.getSketch().getCodeCount(); i++) { + w = Math.max(w, fm.stringWidth(editor.getSketch().getCode(i) + .getPrettyName()) + 10); + } + return w; + } + + private int estimateFrameHeight() { + int textHeight = jsp.getGraphics().getFontMetrics().getHeight() + 2; + int t = Math.max(4, editor.getSketch().getCodeCount() + 3); + return Math.min(textHeight * t, frmOutlineView.getHeight()); + } + + public void show() { + frmOutlineView.setVisible(true); + } + + public void close() { + frmOutlineView.setVisible(false); + frmOutlineView.dispose(); + } + + public boolean isVisible() { + return frmOutlineView.isVisible(); + } + +} diff --git a/pdex/src/processing/mode/experimental/TextArea.java b/pdex/src/processing/mode/experimental/TextArea.java new file mode 100644 index 000000000..7280b6bbb --- /dev/null +++ b/pdex/src/processing/mode/experimental/TextArea.java @@ -0,0 +1,913 @@ +/* + * Copyright (C) 2012-14 Martin Leopold and Manindra Moharana + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; +import static processing.mode.experimental.ExperimentalMode.log; +import static processing.mode.experimental.ExperimentalMode.log2; +import galsasson.mode.tweak.ColorControlBox; +import galsasson.mode.tweak.Handle; + +import java.awt.Color; +import java.awt.Cursor; +import java.awt.FontMetrics; +import java.awt.Point; +import java.awt.event.ComponentListener; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import javax.swing.DefaultListModel; +import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; + +import processing.app.syntax.JEditTextArea; +import processing.app.syntax.TextAreaDefaults; +/** + * Customized text area. Adds support for line background colors. + * + * @author Martin Leopold + */ +public class TextArea extends JEditTextArea { + + protected MouseListener[] mouseListeners; // cached mouselisteners, these are wrapped by MouseHandler + + protected DebugEditor editor; // the editor + + // line properties + protected Map lineColors = new HashMap(); // contains line background colors + + // left-hand gutter properties + protected int gutterPadding = 3; // [px] space added to the left and right of gutter chars + + protected Color gutterBgColor = new Color(252, 252, 252); // gutter background color + + protected Color gutterLineColor = new Color(233, 233, 233); // color of vertical separation line + + protected String breakpointMarker = "<>"; // the text marker for highlighting breakpoints in the gutter + + protected String currentLineMarker = "->"; // the text marker for highlighting the current line in the gutter + + protected Map gutterText = new HashMap(); // maps line index to gutter text + + protected Map gutterTextColors = new HashMap(); // maps line index to gutter text color + + protected TextAreaPainter customPainter; + + protected ErrorCheckerService errorCheckerService; + + public TextArea(TextAreaDefaults defaults, DebugEditor editor) { + super(defaults); + this.editor = editor; + + // replace the painter: + // first save listeners, these are package-private in JEditTextArea, so not accessible + ComponentListener[] componentListeners = painter.getComponentListeners(); + mouseListeners = painter.getMouseListeners(); + MouseMotionListener[] mouseMotionListeners = painter + .getMouseMotionListeners(); + + remove(painter); + + // set new painter + customPainter = new TextAreaPainter(this, defaults); + painter = customPainter; + + // set listeners + for (ComponentListener cl : componentListeners) { + painter.addComponentListener(cl); + } + + for (MouseMotionListener mml : mouseMotionListeners) { + painter.addMouseMotionListener(mml); + } + + // use a custom mouse handler instead of directly using mouseListeners + MouseHandler mouseHandler = new MouseHandler(); + painter.addMouseListener(mouseHandler); + painter.addMouseMotionListener(mouseHandler); + //addCompletionPopupListner(); + add(CENTER, painter); + + // load settings from theme.txt + ExperimentalMode theme = (ExperimentalMode) editor.getMode(); + gutterBgColor = theme.getThemeColor("gutter.bgcolor", gutterBgColor); + gutterLineColor = theme.getThemeColor("gutter.linecolor", gutterLineColor); + gutterPadding = theme.getInteger("gutter.padding"); + breakpointMarker = theme.loadThemeString("breakpoint.marker", + breakpointMarker); + currentLineMarker = theme.loadThemeString("currentline.marker", + currentLineMarker); + + // TweakMode code + + prevCompListeners = painter + .getComponentListeners(); + prevMouseListeners = painter.getMouseListeners(); + prevMMotionListeners = painter + .getMouseMotionListeners(); + prevKeyListeners = editor.getKeyListeners(); + + + interactiveMode = false; + addPrevListeners(); + + } + + /** + * Sets ErrorCheckerService and loads theme for TextArea(XQMode) + * + * @param ecs + * @param mode + */ + public void setECSandThemeforTextArea(ErrorCheckerService ecs, + ExperimentalMode mode) { + errorCheckerService = ecs; + customPainter.setECSandTheme(ecs, mode); + } + + /** + * Handles KeyEvents for TextArea + * Code completion begins from here. + */ + public void processKeyEvent(KeyEvent evt) { + + if(evt.getKeyCode() == KeyEvent.VK_ESCAPE){ + if(suggestion != null){ + if(suggestion.isVisible()){ + log("esc key"); + hideSuggestion(); + evt.consume(); + return; + } + } + } + if(evt.getKeyCode() == KeyEvent.VK_ENTER){ + if (suggestion != null) { + if (suggestion.isVisible()) { + if (suggestion.insertSelection()) { + hideSuggestion(); // Kill it! + evt.consume(); + return; + } + } + } + } + + + if (evt.getID() == KeyEvent.KEY_PRESSED) { + switch (evt.getKeyCode()) { + case KeyEvent.VK_DOWN: + if (suggestion != null) + if (suggestion.isVisible()) { + //log("KeyDown"); + suggestion.moveDown(); + return; + } + break; + case KeyEvent.VK_UP: + if (suggestion != null) + if (suggestion.isVisible()) { + //log("KeyUp"); + suggestion.moveUp(); + return; + } + break; + case KeyEvent.VK_BACK_SPACE: + log("BK Key"); + break; + case KeyEvent.VK_SPACE: + if (suggestion != null) + if (suggestion.isVisible()) { + log("Space bar, hide completion list"); + suggestion.hide(); + } + break; + default: + break; + } + } + super.processKeyEvent(evt); + + if(editor.hasJavaTabs) return; // code completion disabled if java tabs + if (evt.getID() == KeyEvent.KEY_TYPED) { + + char keyChar = evt.getKeyChar(); + if (keyChar == KeyEvent.VK_ENTER || keyChar == KeyEvent.VK_ESCAPE) { + return; + } else if (keyChar == KeyEvent.VK_TAB + || keyChar == KeyEvent.CHAR_UNDEFINED) { + return; + } + final KeyEvent evt2 = evt; + if (evt.isAltDown() || evt.isControlDown() || evt.isMetaDown()) { + if (ExperimentalMode.ccTriggerEnabled && keyChar == KeyEvent.VK_SPACE + && (evt.isControlDown() || evt.isMetaDown())) { + SwingWorker worker = new SwingWorker() { + protected Object doInBackground() throws Exception { + // Provide completions only if it's enabled + if (ExperimentalMode.codeCompletionsEnabled + && ExperimentalMode.ccTriggerEnabled) { + getDocument().remove(getCaretPosition() - 1, 1); // Remove the typed space + log("[KeyEvent]" + evt2.getKeyChar() + + " |Prediction started: " + System.currentTimeMillis()); + log("Typing: " + fetchPhrase(evt2) + " " + + (evt2.getKeyChar() == KeyEvent.VK_ENTER) + " T: " + + System.currentTimeMillis()); + } + return null; + } + }; + worker.execute(); + } + return; + } + + SwingWorker worker = new SwingWorker() { + protected Object doInBackground() throws Exception { + // errorCheckerService.runManualErrorCheck(); + // Provide completions only if it's enabled + if (ExperimentalMode.codeCompletionsEnabled + && (!ExperimentalMode.ccTriggerEnabled || suggestion.isVisible())) { + log("[KeyEvent]" + evt2.getKeyChar() + " |Prediction started: " + + System.currentTimeMillis()); + log("Typing: " + fetchPhrase(evt2) + " " + + (evt2.getKeyChar() == KeyEvent.VK_ENTER) + " T: " + + System.currentTimeMillis()); + } + return null; + } + }; + worker.execute(); + } + + + } + + /** + * Retrieves the word on which the mouse pointer is present + * @param evt - the MouseEvent which triggered this method + * @return + */ + private String fetchPhrase(MouseEvent evt) { + log("--handle Mouse Right Click--"); + int off = xyToOffset(evt.getX(), evt.getY()); + if (off < 0) + return null; + int line = getLineOfOffset(off); + if (line < 0) + return null; + String s = getLineText(line); + if (s == null) + return null; + else if (s.length() == 0) + return null; + else { + int x = xToOffset(line, evt.getX()), x2 = x + 1, x1 = x - 1; + int xLS = off - getLineStartNonWhiteSpaceOffset(line); + log("x=" + x); + if (x < 0 || x >= s.length()) + return null; + String word = s.charAt(x) + ""; + if (s.charAt(x) == ' ') + return null; + if (!(Character.isLetterOrDigit(s.charAt(x)) || s.charAt(x) == '_' || s + .charAt(x) == '$')) + return null; + int i = 0; + while (true) { + i++; + if (x1 >= 0 && x1 < s.length()) { + if (Character.isLetter(s.charAt(x1)) || s.charAt(x1) == '_') { + word = s.charAt(x1--) + word; + xLS--; + } else + x1 = -1; + } else + x1 = -1; + + if (x2 >= 0 && x2 < s.length()) { + if (Character.isLetterOrDigit(s.charAt(x2)) || s.charAt(x2) == '_' + || s.charAt(x2) == '$') + word = word + s.charAt(x2++); + else + x2 = -1; + } else + x2 = -1; + + if (x1 < 0 && x2 < 0) + break; + if (i > 200) { + // time out! + break; + } + } + if (Character.isDigit(word.charAt(0))) + return null; + log("Mouse click, word: " + word.trim()); + errorCheckerService.getASTGenerator().setLastClickedWord(line, word, xLS); + return word.trim(); + } + } + + /** + * Retrieves the current word typed just before the caret. + * Then triggers code completion for that word. + * + * @param evt - the KeyEvent which triggered this method + * @return + */ + private String fetchPhrase(KeyEvent evt) { + + int off = getCaretPosition(); + log2("off " + off); + if (off < 0) + return null; + int line = getCaretLine(); + if (line < 0) + return null; + String s = getLineText(line); + log2("lin " + line); + /* + * if (s == null) return null; else if (s.length() == 0) return null; + */ +// else { + //log2(s + " len " + s.length()); + + int x = getCaretPosition() - getLineStartOffset(line) - 1, x1 = x - 1; + if(x >= s.length() || x < 0) + return null; //TODO: Does this check cause problems? Verify. + log2(" x char: " + s.charAt(x)); + //int xLS = off - getLineStartNonWhiteSpaceOffset(line); + + String word = (x < s.length() ? s.charAt(x) : "") + ""; + if (s.trim().length() == 1) { +// word = "" +// + (keyChar == KeyEvent.CHAR_UNDEFINED ? s.charAt(x - 1) : keyChar); + //word = (x < s.length()?s.charAt(x):"") + ""; + word = word.trim(); + if (word.endsWith(".")) + word = word.substring(0, word.length() - 1); + + errorCheckerService.getASTGenerator().preparePredictions(word, line + + errorCheckerService.mainClassOffset,0); + return word; + } +// if (keyChar == KeyEvent.VK_BACK_SPACE || keyChar == KeyEvent.VK_DELETE) +// ; // accepted these keys +// else if (!(Character.isLetterOrDigit(keyChar) || keyChar == '_' || keyChar == '$')) +// return null; + int i = 0; + int closeB = 0; + + while (true) { + i++; + //TODO: currently works on single line only. "a. b()" won't be detected + if (x1 >= 0) { +// if (s.charAt(x1) != ';' && s.charAt(x1) != ',' && s.charAt(x1) != '(') + if (Character.isLetterOrDigit(s.charAt(x1)) || s.charAt(x1) == '_' + || s.charAt(x1) == '.' || s.charAt(x1) == ')' || s.charAt(x1) == ']') { + + if (s.charAt(x1) == ')') { + word = s.charAt(x1--) + word; + closeB++; + while (x1 >= 0 && closeB > 0) { + word = s.charAt(x1) + word; + if (s.charAt(x1) == '(') + closeB--; + if (s.charAt(x1) == ')') + closeB++; + x1--; + } + } + else if (s.charAt(x1) == ']') { + word = s.charAt(x1--) + word; + closeB++; + while (x1 >= 0 && closeB > 0) { + word = s.charAt(x1) + word; + if (s.charAt(x1) == '[') + closeB--; + if (s.charAt(x1) == ']') + closeB++; + x1--; + } + } + else { + word = s.charAt(x1--) + word; + } + } else { + break; + } + } else { + break; + } + + if (i > 200) { + // time out! + break; + } + } + // if (keyChar != KeyEvent.CHAR_UNDEFINED) + + if (Character.isDigit(word.charAt(0))) + return null; + word = word.trim(); + // if (word.endsWith(".")) + // word = word.substring(0, word.length() - 1); + int lineStartNonWSOffset = 0; + if (word.length() >= ExperimentalMode.codeCompletionTriggerLength) { + errorCheckerService.getASTGenerator() + .preparePredictions(word, line + errorCheckerService.mainClassOffset, + lineStartNonWSOffset); + } + return word; + + } + + /** + * Retrieve the total width of the gutter area. + * + * @return gutter width in pixels + */ + protected int getGutterWidth() { + if(editor.debugToolbarEnabled == null || !editor.debugToolbarEnabled.get()){ + return 0; + } + FontMetrics fm = painter.getFontMetrics(); +// log("fm: " + (fm == null)); +// log("editor: " + (editor == null)); + //log("BPBPBPBPB: " + (editor.breakpointMarker == null)); + + int textWidth = Math.max(fm.stringWidth(breakpointMarker), + fm.stringWidth(currentLineMarker)); + return textWidth + 2 * gutterPadding; + } + + /** + * Retrieve the width of margins applied to the left and right of the gutter + * text. + * + * @return margins in pixels + */ + protected int getGutterMargins() { + if(editor.debugToolbarEnabled == null || !editor.debugToolbarEnabled.get()){ + return 0; + } + return gutterPadding; + } + + /** + * Set the gutter text of a specific line. + * + * @param lineIdx + * the line index (0-based) + * @param text + * the text + */ + public void setGutterText(int lineIdx, String text) { + gutterText.put(lineIdx, text); + painter.invalidateLine(lineIdx); + } + + /** + * Set the gutter text and color of a specific line. + * + * @param lineIdx + * the line index (0-based) + * @param text + * the text + * @param textColor + * the text color + */ + public void setGutterText(int lineIdx, String text, Color textColor) { + gutterTextColors.put(lineIdx, textColor); + setGutterText(lineIdx, text); + } + + /** + * Clear the gutter text of a specific line. + * + * @param lineIdx + * the line index (0-based) + */ + public void clearGutterText(int lineIdx) { + gutterText.remove(lineIdx); + painter.invalidateLine(lineIdx); + } + + /** + * Clear all gutter text. + */ + public void clearGutterText() { + for (int lineIdx : gutterText.keySet()) { + painter.invalidateLine(lineIdx); + } + gutterText.clear(); + } + + /** + * Retrieve the gutter text of a specific line. + * + * @param lineIdx + * the line index (0-based) + * @return the gutter text + */ + public String getGutterText(int lineIdx) { + return gutterText.get(lineIdx); + } + + /** + * Retrieve the gutter text color for a specific line. + * + * @param lineIdx + * the line index + * @return the gutter text color + */ + public Color getGutterTextColor(int lineIdx) { + return gutterTextColors.get(lineIdx); + } + + /** + * Set the background color of a line. + * + * @param lineIdx + * 0-based line number + * @param col + * the background color to set + */ + public void setLineBgColor(int lineIdx, Color col) { + lineColors.put(lineIdx, col); + painter.invalidateLine(lineIdx); + } + + /** + * Clear the background color of a line. + * + * @param lineIdx + * 0-based line number + */ + public void clearLineBgColor(int lineIdx) { + lineColors.remove(lineIdx); + painter.invalidateLine(lineIdx); + } + + /** + * Clear all line background colors. + */ + public void clearLineBgColors() { + for (int lineIdx : lineColors.keySet()) { + painter.invalidateLine(lineIdx); + } + lineColors.clear(); + } + + /** + * Get a lines background color. + * + * @param lineIdx + * 0-based line number + * @return the color or null if no color was set for the specified line + */ + public Color getLineBgColor(int lineIdx) { + return lineColors.get(lineIdx); + } + + /** + * Convert a character offset to a horizontal pixel position inside the text + * area. Overridden to take gutter width into account. + * + * @param line + * the 0-based line number + * @param offset + * the character offset (0 is the first character on a line) + * @return the horizontal position + */ + @Override + public int _offsetToX(int line, int offset) { + return super._offsetToX(line, offset) + getGutterWidth(); + } + + /** + * Convert a horizontal pixel position to a character offset. Overridden to + * take gutter width into account. + * + * @param line + * the 0-based line number + * @param x + * the horizontal pixel position + * @return he character offset (0 is the first character on a line) + */ + @Override + public int xToOffset(int line, int x) { + return super.xToOffset(line, x - getGutterWidth()); + } + + /** + * Custom mouse handler. Implements double clicking in the gutter area to + * toggle breakpoints, sets default cursor (instead of text cursor) in the + * gutter area. + */ + protected class MouseHandler implements MouseListener, MouseMotionListener { + + protected int lastX; // previous horizontal positon of the mouse cursor + + @Override + public void mouseClicked(MouseEvent me) { + // forward to standard listeners + for (MouseListener ml : mouseListeners) { + ml.mouseClicked(me); + } + } + + @Override + public void mousePressed(MouseEvent me) { + // check if this happened in the gutter area + if (me.getX() < getGutterWidth()) { + if (me.getButton() == MouseEvent.BUTTON1 && me.getClickCount() == 2) { + int line = me.getY() / painter.getFontMetrics().getHeight() + + firstLine; + if (line >= 0 && line <= getLineCount() - 1) { + editor.gutterDblClicked(line); + } + } + return; + } + + if (me.getButton() == MouseEvent.BUTTON3) { + if(!editor.hasJavaTabs){ // tooltips, etc disabled for java tabs + fetchPhrase(me); + } + } + + // forward to standard listeners + for (MouseListener ml : mouseListeners) { + ml.mousePressed(me); + } + + } + + @Override + public void mouseReleased(MouseEvent me) { + // forward to standard listeners + for (MouseListener ml : mouseListeners) { + ml.mouseReleased(me); + } + } + + @Override + public void mouseEntered(MouseEvent me) { + // forward to standard listeners + for (MouseListener ml : mouseListeners) { + ml.mouseEntered(me); + } + } + + @Override + public void mouseExited(MouseEvent me) { + // forward to standard listeners + for (MouseListener ml : mouseListeners) { + ml.mouseExited(me); + } + } + + @Override + public void mouseDragged(MouseEvent me) { + // No need to forward since the standard MouseMotionListeners are called anyway + // nop + } + + @Override + public void mouseMoved(MouseEvent me) { + // No need to forward since the standard MouseMotionListeners are called anyway + if (me.getX() < getGutterWidth()) { + if (lastX >= getGutterWidth()) { + painter.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + } + } else { + if (lastX < getGutterWidth()) { + painter.setCursor(new Cursor(Cursor.TEXT_CURSOR)); + } + } + lastX = me.getX(); + } + } + + private CompletionPanel suggestion; + + //JEditTextArea textarea; + + /* No longer used + private void addCompletionPopupListner() { + this.addKeyListener(new KeyListener() { + + @Override + public void keyTyped(KeyEvent e) { + + } + + @Override + public void keyReleased(KeyEvent e) { + if (Character.isLetterOrDigit(e.getKeyChar()) + || e.getKeyChar() == KeyEvent.VK_BACK_SPACE + || e.getKeyChar() == KeyEvent.VK_DELETE) { +// SwingUtilities.invokeLater(new Runnable() { +// @Override +// public void run() { +// showSuggestion(); +// } +// +// }); + } else if (Character.isWhitespace(e.getKeyChar()) + || e.getKeyChar() == KeyEvent.VK_ESCAPE) { + hideSuggestion(); + } + } + + @Override + public void keyPressed(KeyEvent e) { + } + }); + }*/ + + public void showSuggestionLater(final DefaultListModel defListModel, final String word) { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + showSuggestion(defListModel,word); + } + + }); + } + + /** + * Calculates location of caret and displays the suggestion popup at the location. + * + * @param defListModel + * @param subWord + */ + protected void showSuggestion(DefaultListModel defListModel,String subWord) { + hideSuggestion(); + if (defListModel.size() == 0) { + log("TextArea: No suggestions to show."); + return; + } + int position = getCaretPosition(); + Point location = new Point(); + try { + location.x = offsetToX(getCaretLine(), position + - getLineStartOffset(getCaretLine())); + location.y = lineToY(getCaretLine()) + + getPainter().getFontMetrics().getHeight() + getPainter().getFontMetrics().getDescent(); + //log("TA position: " + location); + } catch (Exception e2) { + e2.printStackTrace(); + return; + } + + if (subWord.length() < 2) { + return; + } + //if (suggestion == null) + suggestion = new CompletionPanel(this, position, subWord, defListModel, + location,editor); +// else +// suggestion.updateList(defListModel, subWord, location, position); +// +// suggestion.setVisible(true); + requestFocusInWindow(); +// SwingUtilities.invokeLater(new Runnable() { +// @Override +// public void run() { +// requestFocusInWindow(); +// } +// }); + } + + /** + * Hides suggestion popup + */ + protected void hideSuggestion() { + if (suggestion != null) { + suggestion.hide(); + //log("Suggestion hidden."); + suggestion = null; + } + } + + // TweakMode code + + // save input listeners to stop/start text edit + ComponentListener[] prevCompListeners; + MouseListener[] prevMouseListeners; + MouseMotionListener[] prevMMotionListeners; + KeyListener[] prevKeyListeners; + + boolean interactiveMode; + + /* remove all standard interaction listeners */ + public void removeAllListeners() + { + ComponentListener[] componentListeners = painter + .getComponentListeners(); + MouseListener[] mouseListeners = painter.getMouseListeners(); + MouseMotionListener[] mouseMotionListeners = painter + .getMouseMotionListeners(); + KeyListener[] keyListeners = editor.getKeyListeners(); + + for (ComponentListener cl : componentListeners) + painter.removeComponentListener(cl); + + for (MouseListener ml : mouseListeners) + painter.removeMouseListener(ml); + + for (MouseMotionListener mml : mouseMotionListeners) + painter.removeMouseMotionListener(mml); + + for (KeyListener kl : keyListeners) { + editor.removeKeyListener(kl); + } + } + + public void startInteractiveMode() + { + // ignore if we are already in interactiveMode + if (interactiveMode) + return; + + removeAllListeners(); + + // add our private interaction listeners + customPainter.addMouseListener(customPainter); + customPainter.addMouseMotionListener(customPainter); + customPainter.startInterativeMode(); + customPainter.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + this.editable = false; + this.caretBlinks = false; + this.setCaretVisible(false); + interactiveMode = true; + } + + public void stopInteractiveMode() + { + // ignore if we are not in interactive mode + if (!interactiveMode) + return; + + removeAllListeners(); + addPrevListeners(); + + customPainter.stopInteractiveMode(); + customPainter.setCursor(new Cursor(Cursor.TEXT_CURSOR)); + this.editable = true; + this.caretBlinks = true; + this.setCaretVisible(true); + + interactiveMode = false; + } + + public int getHorizontalScroll() + { + return horizontal.getValue(); + } + + private void addPrevListeners() + { + // add the original text-edit listeners + for (ComponentListener cl : prevCompListeners) { + customPainter.addComponentListener(cl); + } + for (MouseListener ml : prevMouseListeners) { + customPainter.addMouseListener(ml); + } + for (MouseMotionListener mml : prevMMotionListeners) { + customPainter.addMouseMotionListener(mml); + } + for (KeyListener kl : prevKeyListeners) { + editor.addKeyListener(kl); + } + } + + public void updateInterface(ArrayList handles[], ArrayList colorBoxes[]) + { + customPainter.updateInterface(handles, colorBoxes); + } + +} diff --git a/pdex/src/processing/mode/experimental/TextAreaPainter.java b/pdex/src/processing/mode/experimental/TextAreaPainter.java new file mode 100644 index 000000000..38f8ddecf --- /dev/null +++ b/pdex/src/processing/mode/experimental/TextAreaPainter.java @@ -0,0 +1,844 @@ +/* + * Copyright (C) 2012 Martin Leopold + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; +import static processing.mode.experimental.ExperimentalMode.log; +import galsasson.mode.tweak.ColorControlBox; +import galsasson.mode.tweak.ColorSelector; +import galsasson.mode.tweak.Handle; +import galsasson.mode.tweak.Settings; + +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.RenderingHints; +import java.awt.Toolkit; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.image.BufferedImage; +import java.util.ArrayList; + +import javax.swing.text.BadLocationException; +import javax.swing.text.Segment; +import javax.swing.text.Utilities; + +import processing.app.SketchCode; +import processing.app.syntax.TextAreaDefaults; +import processing.app.syntax.TokenMarker; + +/** + * Customized line painter. Adds support for background colors, left hand gutter + * area with background color and text. + * + * @author Martin Leopold + */ +public class TextAreaPainter extends processing.app.syntax.TextAreaPainter + implements MouseListener, MouseMotionListener { + + protected TextArea ta; // we need the subclassed textarea + + protected ErrorCheckerService errorCheckerService; + + /** + * Error line underline color + */ + public Color errorColor = new Color(0xED2630); + + /** + * Warning line underline color + */ + + public Color warningColor = new Color(0xFFC30E); + + /** + * Color of Error Marker + */ + public Color errorMarkerColor = new Color(0xED2630); + + /** + * Color of Warning Marker + */ + public Color warningMarkerColor = new Color(0xFFC30E); + + static int ctrlMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); + + public TextAreaPainter(TextArea textArea, TextAreaDefaults defaults) { + super(textArea, defaults); + ta = textArea; + addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent evt) { + if(ta.editor.hasJavaTabs) return; // Ctrl + Click disabled for java tabs + if (evt.getButton() == MouseEvent.BUTTON1) { + if (evt.isControlDown() || evt.isMetaDown()) + handleCtrlClick(evt); + } + } + }); + + // TweakMode code + interactiveMode = false; + cursorType = Cursor.DEFAULT_CURSOR; + } + +// public void processKeyEvent(KeyEvent evt) { +// log(evt); +// } + + void handleCtrlClick(MouseEvent evt) { + log("--handleCtrlClick--"); + int off = ta.xyToOffset(evt.getX(), evt.getY()); + if (off < 0) + return; + int line = ta.getLineOfOffset(off); + if (line < 0) + return; + String s = ta.getLineText(line); + if (s == null) + return; + else if (s.length() == 0) + return; + else { + int x = ta.xToOffset(line, evt.getX()), x2 = x + 1, x1 = x - 1; + log("x="+x); + int xLS = off - ta.getLineStartNonWhiteSpaceOffset(line); + if (x < 0 || x >= s.length()) + return; + String word = s.charAt(x) + ""; + if (s.charAt(x) == ' ') + return; + if (!(Character.isLetterOrDigit(s.charAt(x)) || s.charAt(x) == '_' || s + .charAt(x) == '$')) + return; + int i = 0; + while (true) { + i++; + if (x1 >= 0 && x1 < s.length()) { + if (Character.isLetter(s.charAt(x1)) || s.charAt(x1) == '_') { + word = s.charAt(x1--) + word; + xLS--; + } else + x1 = -1; + } else + x1 = -1; + + if (x2 >= 0 && x2 < s.length()) { + if (Character.isLetterOrDigit(s.charAt(x2)) || s.charAt(x2) == '_' + || s.charAt(x2) == '$') + word = word + s.charAt(x2++); + else + x2 = -1; + } else + x2 = -1; + + if (x1 < 0 && x2 < 0) + break; + if (i > 200) { + // time out! + // System.err.println("Whoopsy! :P"); + break; + } + } + if (Character.isDigit(word.charAt(0))) + return; + + log(errorCheckerService.mainClassOffset + line + + "|" + line + "| offset " + xLS + word + " <= \n"); + errorCheckerService.getASTGenerator() + .scrollToDeclaration(line, word, xLS); + } + } + + private void loadTheme(ExperimentalMode mode) { + errorColor = mode.getThemeColor("editor.errorcolor", errorColor); + warningColor = mode.getThemeColor("editor.warningcolor", warningColor); + errorMarkerColor = mode.getThemeColor("editor.errormarkercolor", + errorMarkerColor); + warningMarkerColor = mode.getThemeColor("editor.warningmarkercolor", + warningMarkerColor); + } + + /** + * Paint a line. Paints the gutter (with background color and text) then the + * line (background color and text). + * + * @param gfx + * the graphics context + * @param tokenMarker + * @param line + * 0-based line number + * @param x + * horizontal position + */ + @Override + protected void paintLine(Graphics gfx, TokenMarker tokenMarker, int line, + int x) { + try { + //TODO: This line is causing NPE's randomly ever since I added the toggle for + //Java Mode/Debugger toolbar. + super.paintLine(gfx, tokenMarker, line, x + ta.getGutterWidth()); + } catch (Exception e) { + log(e.getMessage()); + } + if(ta.editor.debugToolbarEnabled != null && ta.editor.debugToolbarEnabled.get()){ + // paint gutter + paintGutterBg(gfx, line, x); + + // disabled line background after P5 2.1, since it adds highlight by default + //paintLineBgColor(gfx, line, x + ta.getGutterWidth()); + + paintGutterLine(gfx, line, x); + + // paint gutter symbol + paintGutterText(gfx, line, x); + + } + paintErrorLine(gfx, line, x); + } + + /** + * Paint the gutter background (solid color). + * + * @param gfx + * the graphics context + * @param line + * 0-based line number + * @param x + * horizontal position + */ + protected void paintGutterBg(Graphics gfx, int line, int x) { + gfx.setColor(ta.gutterBgColor); + int y = ta.lineToY(line) + fm.getLeading() + fm.getMaxDescent(); + gfx.fillRect(0, y, ta.getGutterWidth(), fm.getHeight()); + } + + /** + * Paint the vertical gutter separator line. + * + * @param gfx + * the graphics context + * @param line + * 0-based line number + * @param x + * horizontal position + */ + protected void paintGutterLine(Graphics gfx, int line, int x) { + int y = ta.lineToY(line) + fm.getLeading() + fm.getMaxDescent(); + gfx.setColor(ta.gutterLineColor); + gfx.drawLine(ta.getGutterWidth(), y, ta.getGutterWidth(), + y + fm.getHeight()); + } + + /** + * Paint the gutter text. + * + * @param gfx + * the graphics context + * @param line + * 0-based line number + * @param x + * horizontal position + */ + protected void paintGutterText(Graphics gfx, int line, int x) { + String text = ta.getGutterText(line); + if (text == null) { + return; + } + + gfx.setFont(getFont()); + Color textColor = ta.getGutterTextColor(line); + if (textColor == null) { + gfx.setColor(getForeground()); + } else { + gfx.setColor(textColor); + } + int y = ta.lineToY(line) + fm.getHeight(); + + // draw 4 times to make it appear bold, displaced 1px to the right, to the bottom and bottom right. + //int len = text.length() > ta.gutterChars ? ta.gutterChars : text.length(); + Utilities.drawTabbedText(new Segment(text.toCharArray(), 0, text.length()), + ta.getGutterMargins(), y, gfx, this, 0); + Utilities.drawTabbedText(new Segment(text.toCharArray(), 0, text.length()), + ta.getGutterMargins() + 1, y, gfx, this, 0); + Utilities.drawTabbedText(new Segment(text.toCharArray(), 0, text.length()), + ta.getGutterMargins(), y + 1, gfx, this, 0); + Utilities.drawTabbedText(new Segment(text.toCharArray(), 0, text.length()), + ta.getGutterMargins() + 1, y + 1, gfx, this, 0); + } + + /** + * Paint the background color of a line. + * + * @param gfx + * the graphics context + * @param line + * 0-based line number + * @param x + */ + protected void paintLineBgColor(Graphics gfx, int line, int x) { + int y = ta.lineToY(line); + y += fm.getLeading() + fm.getMaxDescent(); + int height = fm.getHeight(); + + // get the color + Color col = ta.getLineBgColor(line); + //System.out.print("bg line " + line + ": "); + // no need to paint anything + if (col == null) { + //log("none"); + return; + } + // paint line background + gfx.setColor(col); + gfx.fillRect(0, y, getWidth(), height); + } + + /** + * Paints the underline for an error/warning line + * + * @param gfx + * the graphics context + * @param tokenMarker + * @param line + * 0-based line number: NOTE + * @param x + */ + protected void paintErrorLine(Graphics gfx, int line, int x) { + if (errorCheckerService == null) { + return; + } + + if (errorCheckerService.problemsList == null) { + return; + } + + boolean notFound = true; + boolean isWarning = false; + Problem problem = null; + + // Check if current line contains an error. If it does, find if it's an + // error or warning + for (ErrorMarker emarker : errorCheckerService.getEditor().errorBar.errorPoints) { + if (emarker.getProblem().getLineNumber() == line) { + notFound = false; + if (emarker.getType() == ErrorMarker.Warning) { + isWarning = true; + } + problem = emarker.getProblem(); + //log(problem.toString()); + break; + } + } + + if (notFound) { + return; + } + + // Determine co-ordinates + // log("Hoff " + ta.getHorizontalOffset() + ", " + + // horizontalAdjustment); + int y = ta.lineToY(line); + y += fm.getLeading() + fm.getMaxDescent(); +// int height = fm.getHeight(); + int start = ta.getLineStartOffset(line) + problem.getPDELineStartOffset(); + int pLength = problem.getPDELineStopOffset() + 1 + - problem.getPDELineStartOffset(); + + try { + String badCode = null; + String goodCode = null; + try { + badCode = ta.getDocument().getText(start, pLength); + goodCode = ta.getDocument().getText(ta.getLineStartOffset(line), + problem.getPDELineStartOffset()); + //log("paintErrorLine() LineText GC: " + goodCode); + //log("paintErrorLine() LineText BC: " + badCode); + } catch (BadLocationException bl) { + // Error in the import statements or end of code. + // System.out.print("BL caught. " + ta.getLineCount() + " ," + // + line + " ,"); + // log((ta.getLineStopOffset(line) - start - 1)); + return; + } + + // Take care of offsets + int aw = fm.stringWidth(trimRight(badCode)) + ta.getHorizontalOffset(); // apparent width. Whitespaces + // to the left of line + text + // width + int rw = fm.stringWidth(badCode.trim()); // real width + int x1 = fm.stringWidth(goodCode) + (aw - rw), y1 = y + fm.getHeight() + - 2, x2 = x1 + rw; + // Adding offsets for the gutter + x1 += ta.getGutterWidth(); + x2 += ta.getGutterWidth(); + + // gfx.fillRect(x1, y, rw, height); + + // Let the painting begin! + + // Little rect at starting of a line containing errors - disabling it for now +// gfx.setColor(errorMarkerColor); +// if (isWarning) { +// gfx.setColor(warningMarkerColor); +// } +// gfx.fillRect(1, y + 2, 3, height - 2); + + + gfx.setColor(errorColor); + if (isWarning) { + gfx.setColor(warningColor); + } + int xx = x1; + + // Draw the jagged lines + while (xx < x2) { + gfx.drawLine(xx, y1, xx + 2, y1 + 1); + xx += 2; + gfx.drawLine(xx, y1 + 1, xx + 2, y1); + xx += 2; + } + } catch (Exception e) { + System.out + .println("Looks like I messed up! XQTextAreaPainter.paintLine() : " + + e); + //e.printStackTrace(); + } + + // Won't highlight the line. Select the text instead. + // gfx.setColor(Color.RED); + // gfx.fillRect(2, y, 3, height); + } + + /** + * Trims out trailing whitespaces (to the right) + * + * @param string + * @return - String + */ + private String trimRight(String string) { + String newString = ""; + for (int i = 0; i < string.length(); i++) { + if (string.charAt(i) != ' ') { + newString = string.substring(0, i) + string.trim(); + break; + } + } + return newString; + } + + /** + * Sets ErrorCheckerService and loads theme for TextAreaPainter(XQMode) + * + * @param ecs + * @param mode + */ + public void setECSandTheme(ErrorCheckerService ecs, ExperimentalMode mode) { + this.errorCheckerService = ecs; + loadTheme(mode); + } + + public String getToolTipText(java.awt.event.MouseEvent evt) { + if(ta.editor.hasJavaTabs) return null; // disabled for java tabs + int off = ta.xyToOffset(evt.getX(), evt.getY()); + if (off < 0) + return null; + int line = ta.getLineOfOffset(off); + if (line < 0) + return null; + String s = ta.getLineText(line); + if (s == null) + return evt.toString(); + else if (s.length() == 0) + return null; + else { + int x = ta.xToOffset(line, evt.getX()), x2 = x + 1, x1 = x - 1; + int xLS = off - ta.getLineStartNonWhiteSpaceOffset(line); + if (x < 0 || x >= s.length()) + return null; + String word = s.charAt(x) + ""; + if (s.charAt(x) == ' ') + return null; + if (!(Character.isLetterOrDigit(s.charAt(x)) || s.charAt(x) == '_' || s + .charAt(x) == '$')) + return null; + int i = 0; + while (true) { + i++; + if (x1 >= 0 && x1 < s.length()) { + if (Character.isLetter(s.charAt(x1)) || s.charAt(x1) == '_') { + word = s.charAt(x1--) + word; + xLS--; + } else + x1 = -1; + } else + x1 = -1; + + if (x2 >= 0 && x2 < s.length()) { + if (Character.isLetterOrDigit(s.charAt(x2)) || s.charAt(x2) == '_' + || s.charAt(x2) == '$') + word = word + s.charAt(x2++); + else + x2 = -1; + } else + x2 = -1; + + if (x1 < 0 && x2 < 0) + break; + if (i > 200) { + // time out! + // System.err.println("Whoopsy! :P"); + break; + } + } + if (Character.isDigit(word.charAt(0))) + return null; + String tooltipText = errorCheckerService.getASTGenerator() + .getLabelForASTNode(line, word, xLS); + +// log(errorCheckerService.mainClassOffset + " MCO " +// + "|" + line + "| offset " + xLS + word + " <= offf: "+off+ "\n"); + if (tooltipText != null) + return tooltipText; + return word; + } + + } + + // TweakMode code + protected int horizontalAdjustment = 0; + + public boolean interactiveMode = false; + public ArrayList handles[]; + public ArrayList colorBoxes[]; + + public Handle mouseHandle = null; + public ColorSelector colorSelector; + + int cursorType; + BufferedImage cursorImg = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB); + + // Create a new blank cursor. + Cursor blankCursor = Toolkit.getDefaultToolkit().createCustomCursor( + cursorImg, new Point(0, 0), "blank cursor"); + + + /** + * Repaints the text. + * @param gfx The graphics context + */ + @Override + public synchronized void paint(Graphics gfx) + { + super.paint(gfx); + + if (interactiveMode && handles!=null) + { + int currentTab = ta.editor.getSketch().getCurrentCodeIndex(); + // enable anti-aliasing + Graphics2D g2d = (Graphics2D)gfx; + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + + for (Handle n : handles[currentTab]) + { + // update n position and width, and draw it + int lineStartChar = ta.getLineStartOffset(n.line); + int x = ta.offsetToX(n.line, n.newStartChar - lineStartChar); + int y = ta.lineToY(n.line) + fm.getHeight() + 1; + int end = ta.offsetToX(n.line, n.newEndChar - lineStartChar); + n.setPos(x, y); + n.setWidth(end - x); + n.draw(g2d, n==mouseHandle); + } + + // draw color boxes + for (ColorControlBox cBox: colorBoxes[currentTab]) + { + int lineStartChar = ta.getLineStartOffset(cBox.getLine()); + int x = ta.offsetToX(cBox.getLine(), cBox.getCharIndex() - lineStartChar); + int y = ta.lineToY(cBox.getLine()) + fm.getDescent(); + cBox.setPos(x, y+1); + cBox.draw(g2d); + } + } + } + + public void startInterativeMode() + { + interactiveMode = true; + repaint(); + } + + public void stopInteractiveMode() + { + interactiveMode = false; + + if (colorSelector != null) { + // close color selector + colorSelector.hide(); + colorSelector.frame.dispatchEvent(new WindowEvent(colorSelector.frame, WindowEvent.WINDOW_CLOSING)); + } + + repaint(); + } + + // Update the interface + public void updateInterface(ArrayList handles[], ArrayList colorBoxes[]) + { + this.handles = handles; + this.colorBoxes = colorBoxes; + + initInterfacePositions(); + repaint(); + } + + /** + * Initialize all the number changing interfaces. + * synchronize this method to prevent the execution of 'paint' in the middle. + * (don't paint while we make changes to the text of the editor) + */ + public synchronized void initInterfacePositions() + { + SketchCode[] code = ta.editor.getSketch().getCode(); + int prevScroll = ta.getVerticalScrollPosition(); + String prevText = ta.getText(); + + for (int tab=0; tab + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package processing.mode.experimental; + +import java.util.ArrayList; + +/** + * A class containing multiple utility methods + * + * @author Manindra Moharana + * + */ + +public class Utils { + + public ArrayList offsetMatch; + String word1, word2; + public static String reverse(String s) { + char w[] = s.toCharArray(); + for (int i = 0; i < w.length / 2; i++) { + char t = w[i]; + w[i] = w[w.length - 1 - i]; + w[w.length - 1 - i] = t; + } + return new String(w); + } + + public void getPdeOffForJavaOff(int start, int length){ + System.out.println("PDE <-> Java" ); + for (int i = 0; i < offsetMatch.size(); i++) { + System.out.print(offsetMatch.get(i).pdeOffset + " <-> " + offsetMatch.get(i).javaOffset); + System.out.println(", " + word1.charAt(offsetMatch.get(i).pdeOffset) + " <-> " + + word2.charAt(offsetMatch.get(i).javaOffset)); + } + System.out.println("Length " + offsetMatch.size()); + System.out.println(start + " java start off, pde start off " + + getPdeOffForJavaOff(start)); + System.out.println((start + length - 1) + " java end off, pde end off " + + getPdeOffForJavaOff(start + length - 1)); + } + + public void getJavaOffForPdeOff(int start, int length){ +// System.out.println("PDE <-> Java" ); +// for (int i = 0; i < offsetMatch.size(); i++) { +// System.out.print(offsetMatch.get(i).pdeOffset + " <-> " + offsetMatch.get(i).javaOffset); +// System.out.println(", " + word1.charAt(offsetMatch.get(i).pdeOffset) + " <-> " +// + word2.charAt(offsetMatch.get(i).javaOffset)); +// } +// System.out.println("Length " + offsetMatch.size()); + System.out.println(start + " pde start off, java start off " + + getJavaOffForPdeOff(start)); + System.out.println((start + length - 1) + " pde end off, java end off " + + getJavaOffForPdeOff(start + length - 1)); + } + + public int getPdeOffForJavaOff(int javaOff){ + for (int i = offsetMatch.size() - 1; i >= 0;i--) { + if(offsetMatch.get(i).javaOffset < javaOff){ + continue; + } + else + if(offsetMatch.get(i).javaOffset == javaOff){ +// int j = i; + while(offsetMatch.get(--i).javaOffset == javaOff){ + System.out.println("MP " + offsetMatch.get(i).javaOffset + " " + + offsetMatch.get(i).pdeOffset); + } + int pdeOff = offsetMatch.get(++i).pdeOffset; + while(offsetMatch.get(--i).pdeOffset == pdeOff); + int j = i + 1; + if (j > -1 && j < offsetMatch.size()) + return offsetMatch.get(j).pdeOffset; + } + + } + return -1; + } + + public int getJavaOffForPdeOff(int pdeOff){ + for (int i = offsetMatch.size() - 1; i >= 0;i--) { + if(offsetMatch.get(i).pdeOffset < pdeOff){ + continue; + } + else + if(offsetMatch.get(i).pdeOffset == pdeOff){ +// int j = i; + while(offsetMatch.get(--i).pdeOffset == pdeOff){ +// System.out.println("MP " + offsetMatch.get(i).javaOffset + " " +// + offsetMatch.get(i).pdeOffset); + } + int javaOff = offsetMatch.get(++i).javaOffset; + while(offsetMatch.get(--i).javaOffset == javaOff); + int j = i + 1; + if (j > -1 && j < offsetMatch.size()) + return offsetMatch.get(j).javaOffset; + } + + } + return -1; + } + + public int minDistance(String word1, String word2) { + this.word1 = word1; + this.word2 = word2; +// word1 = reverse(word1); +// word2 = reverse(word2); + int len1 = word1.length(); + int len2 = word2.length(); + System.out.println(word1 + " len: " + len1); + System.out.println(word2 + " len: " + len2); + // len1+1, len2+1, because finally return dp[len1][len2] + int[][] dp = new int[len1 + 1][len2 + 1]; + + for (int i = 0; i <= len1; i++) { + dp[i][0] = i; + } + + for (int j = 0; j <= len2; j++) { + dp[0][j] = j; + } + + //iterate though, and check last char + for (int i = 0; i < len1; i++) { + char c1 = word1.charAt(i); + for (int j = 0; j < len2; j++) { + char c2 = word2.charAt(j); + //System.out.print(c1 + "<->" + c2); + //if last two chars equal + if (c1 == c2) { + //update dp value for +1 length + dp[i + 1][j + 1] = dp[i][j]; +// System.out.println(); + } else { + int replace = dp[i][j] + 1; + int insert = dp[i][j + 1] + 1; + int delete = dp[i + 1][j] + 1; +// if (replace < delete) { +// System.out.println(" --- D"); +// } else +// System.out.println(" --- R"); + int min = replace > insert ? insert : replace; + min = delete > min ? min : delete; + dp[i + 1][j + 1] = min; + } + } + } + +// for (int i = 0; i < dp.length; i++) { +// for (int j = 0; j < dp[0].length; j++) { +// System.out.print(dp[i][j] + " "); +// } +// System.out.println(); +// } +// int maxLen = Math.max(len1, len2)+2; +// int pdeCodeMap[] = new int[maxLen], javaCodeMap[] = new int[maxLen]; +// System.out.println("Edit distance1: " + dp[len1][len2]); + ArrayList alist = new ArrayList(); + offsetMatch = alist; + minDistInGrid(dp, len1, len2, 0, 0, word1.toCharArray(), + word2.toCharArray(), alist); +// System.out.println("PDE-to-Java"); +// for (int i = 0; i < maxLen; i++) { +// System.out.print(pdeCodeMap[i] + " <-> " + javaCodeMap[i]); +// System.out.println(", " + word1.charAt(pdeCodeMap[i]) + " <-> " +// + word2.charAt(javaCodeMap[i])); +// } +// for (int i = 0; i < alist.size(); i++) { +// System.out.print(alist.get(i).pdeOffset + " <-> " + alist.get(i).javaOffset); +// System.out.println(", " + word1.charAt(alist.get(i).pdeOffset) + " <-> " +// + word2.charAt(alist.get(i).javaOffset)); +// } +// System.out.println("Length " + alist.size()); + return dp[len1][len2]; + } + + public static int distance(String a, String b) { +// a = a.toLowerCase(); +// b = b.toLowerCase(); + + // i == 0 + int[] costs = new int[b.length() + 1]; + for (int j = 0; j < costs.length; j++) + costs[j] = j; + for (int i = 1; i <= a.length(); i++) { + // j == 0; nw = lev(i - 1, j) + costs[0] = i; + int nw = i - 1; + for (int j = 1; j <= b.length(); j++) { + int cj = Math.min(1 + Math.min(costs[j], costs[j - 1]), + a.charAt(i - 1) == b.charAt(j - 1) ? nw : nw + 1); + nw = costs[j]; + costs[j] = cj; + } + } + System.out.println("Edit distance2: " + costs[b.length()]); + return costs[b.length()]; + } + + public void minDistInGrid(int g[][], int i, int j, int fi, int fj, + char s1[], char s2[], ArrayList set) { +// if(i < s1.length)System.out.print(s1[i] + " <->"); +// if(j < s2.length)System.out.print(s2[j]); + if (i < s1.length && j < s2.length) { +// pdeCodeMap[k] = i; +// javaCodeMap[k] = j; + //System.out.print(s1[i] + " " + i + " <-> " + j + " " + s2[j]); + set.add(new OfsSetTemp(i, j)); +// if (s1[i] != s2[j]) +// System.out.println("--"); + } + //System.out.println(); + if (i == fi && j == fj) { + //System.out.println("Reached end."); + } else { + int a = Integer.MAX_VALUE, b = a, c = a; + if (i > 0) + a = g[i - 1][j]; + if (j > 0) + b = g[i][j - 1]; + if (i > 0 && j > 0) + c = g[i - 1][j - 1]; + int mini = Math.min(a, Math.min(b, c)); + if (mini == a) { + //System.out.println(s1[i + 1] + " " + s2[j]); + minDistInGrid(g, i - 1, j, fi, fj, s1, s2,set); + } else if (mini == b) { + //System.out.println(s1[i] + " " + s2[j + 1]); + minDistInGrid(g, i, j - 1, fi, fj, s1, s2, set); + } else if (mini == c) { + //System.out.println(s1[i + 1] + " " + s2[j + 1]); + minDistInGrid(g, i - 1, j - 1, fi, fj, s1, s2, set); + } + } + } + + public class OfsSetTemp { + public final int pdeOffset, javaOffset; + public OfsSetTemp(int pde, int java){ + pdeOffset = pde; + javaOffset = java; + } + } + +// public class OffsetMatch{ +// public final ArrayList pdeOffset, javaOffset; +// +// public OffsetMatch(){ +// pdeOffset = new ArrayList(); +// javaOffset = new ArrayList(); +// } +// } + + public static void main(String[] args) { +// minDistance("c = #qwerty;", "c = 0xffqwerty;"); + Utils a = new Utils(); + + a.minDistance("int a = int(can); int ball;", "int a = PApplet.parseInt(can); int ball;"); + a.getPdeOffForJavaOff(25, 3); + a.getJavaOffForPdeOff(12,3); +// minDistance("static void main(){;", "public static void main(){;"); +// minDistance("#bb00aa", "0xffbb00aa"); + //a.minDistance("color g = #qwerty;", "int g = 0xffqwerty;"); + System.out.println("--"); + a.minDistance("color abc = #qwerty;", "int abc = 0xffqwerty;"); + a.getPdeOffForJavaOff(4, 3); + a.getJavaOffForPdeOff(6,3); +// distance("c = #bb00aa;", "c = 0xffbb00aa;"); + } +} diff --git a/pdex/src/processing/mode/experimental/VMEventListener.java b/pdex/src/processing/mode/experimental/VMEventListener.java new file mode 100755 index 000000000..4cc648802 --- /dev/null +++ b/pdex/src/processing/mode/experimental/VMEventListener.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2012 Martin Leopold + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +import com.sun.jdi.event.EventSet; + +/** + * Interface for VM callbacks. + * + * @author Martin Leopold + */ +public interface VMEventListener { + + /** + * Receive an event from the VM. Events are sent in batches. See + * documentation of EventSet for more information. + * + * @param es Set of events + */ + void vmEvent(EventSet es); +} diff --git a/pdex/src/processing/mode/experimental/VMEventReader.java b/pdex/src/processing/mode/experimental/VMEventReader.java new file mode 100755 index 000000000..c4d05ddf9 --- /dev/null +++ b/pdex/src/processing/mode/experimental/VMEventReader.java @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2012 Martin Leopold + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +import com.sun.jdi.VMDisconnectedException; +import com.sun.jdi.event.EventQueue; +import com.sun.jdi.event.EventSet; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Reader Thread for VM Events. Constantly monitors a VMs EventQueue for new + * events and forwards them to an VMEventListener. + * + * @author Martin Leopold + */ +public class VMEventReader extends Thread { + + EventQueue eventQueue; + VMEventListener listener; + + /** + * Construct a VMEventReader. Needs to be kicked off with start() once + * constructed. + * + * @param eventQueue The queue to read events from. Can be obtained from a + * VirtualMachine via eventQueue(). + * @param listener the listener to forward events to. + */ + public VMEventReader(EventQueue eventQueue, VMEventListener listener) { + super("VM Event Thread"); + this.eventQueue = eventQueue; + this.listener = listener; + } + + @Override + public void run() { + try { + while (true) { + EventSet eventSet = eventQueue.remove(); + listener.vmEvent(eventSet); + /* + * for (Event e : eventSet) { System.out.println("VM Event: " + + * e.toString()); } + */ + } + } catch (VMDisconnectedException e) { + Logger.getLogger(VMEventReader.class.getName()).log(Level.INFO, "VMEventReader quit on VM disconnect"); + } catch (Exception e) { + Logger.getLogger(VMEventReader.class.getName()).log(Level.SEVERE, "VMEventReader quit", e); + } + } +} diff --git a/pdex/src/processing/mode/experimental/VariableInspector.form b/pdex/src/processing/mode/experimental/VariableInspector.form new file mode 100755 index 000000000..a5f40f1d3 --- /dev/null +++ b/pdex/src/processing/mode/experimental/VariableInspector.form @@ -0,0 +1,53 @@ + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/pdex/src/processing/mode/experimental/VariableInspector.java b/pdex/src/processing/mode/experimental/VariableInspector.java new file mode 100755 index 000000000..e80f9e579 --- /dev/null +++ b/pdex/src/processing/mode/experimental/VariableInspector.java @@ -0,0 +1,931 @@ +/* + * Copyright (C) 2012 Martin Leopold + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +import com.sun.jdi.Value; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.swing.DefaultCellEditor; +import javax.swing.GrayFilter; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.UIDefaults; +import javax.swing.UIManager; +import javax.swing.event.TreeExpansionEvent; +import javax.swing.event.TreeExpansionListener; +import javax.swing.table.TableColumn; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.ExpandVetoException; +import javax.swing.tree.MutableTreeNode; +import javax.swing.tree.TreeNode; +import javax.swing.tree.TreePath; + +import org.netbeans.swing.outline.DefaultOutlineCellRenderer; +import org.netbeans.swing.outline.DefaultOutlineModel; +import org.netbeans.swing.outline.ExtTreeWillExpandListener; +import org.netbeans.swing.outline.OutlineModel; +import org.netbeans.swing.outline.RenderDataProvider; +import org.netbeans.swing.outline.RowModel; + +/** + * Variable Inspector window. + * + * @author Martin Leopold + */ +public class VariableInspector extends javax.swing.JFrame { + + protected DefaultMutableTreeNode rootNode; // the root node (invisible) + protected DefaultMutableTreeNode builtins; // node for Processing built-in variables + protected DefaultTreeModel treeModel; // data model for the tree column + protected OutlineModel model; // data model for the whole Outline (tree and other columns) + protected List callStack; // the call stack + protected List locals; // current local variables + protected List thisFields; // all fields of the current this-object + protected List declaredThisFields; // declared i.e. non-inherited fields of this + protected DebugEditor editor; // the editor + protected Debugger dbg; // the debugger + protected List expandedNodes = new ArrayList(); // list of expanded tree paths. (using list to maintain the order of expansion) + protected boolean p5mode = true; // processing / "advanced" mode flag (currently not used + + /** + * Creates new form VariableInspector + */ + public VariableInspector(DebugEditor editor) { + this.editor = editor; + this.dbg = editor.dbg(); + + initComponents(); + + // setup Outline + rootNode = new DefaultMutableTreeNode("root"); + builtins = new DefaultMutableTreeNode("Processing"); + treeModel = new DefaultTreeModel(rootNode); // model for the tree column + model = DefaultOutlineModel.createOutlineModel(treeModel, new VariableRowModel(), true, "Name"); // model for all columns + + ExpansionHandler expansionHandler = new ExpansionHandler(); + model.getTreePathSupport().addTreeWillExpandListener(expansionHandler); + model.getTreePathSupport().addTreeExpansionListener(expansionHandler); + tree.setModel(model); + tree.setRootVisible(false); + tree.setRenderDataProvider(new OutlineRenderer()); + tree.setColumnHidingAllowed(false); // disable visible columns button (shows by default when right scroll bar is visible) + tree.setAutoscrolls(false); + + // set custom renderer and editor for value column, since we are using a custom class for values (VariableNode) + TableColumn valueColumn = tree.getColumnModel().getColumn(1); + valueColumn.setCellRenderer(new ValueCellRenderer()); + valueColumn.setCellEditor(new ValueCellEditor()); + + //System.out.println("renderer: " + tree.getDefaultRenderer(String.class).getClass()); + //System.out.println("editor: " + tree.getDefaultEditor(String.class).getClass()); + + callStack = new ArrayList(); + locals = new ArrayList(); + thisFields = new ArrayList(); + declaredThisFields = new ArrayList(); + + this.setTitle(editor.getSketch().getName()); + +// for (Entry entry : UIManager.getDefaults().entrySet()) { +// System.out.println(entry.getKey()); +// } + } + + @Override + public void setTitle(String title) { + super.setTitle(title + " | Variable Inspector"); + } + + /** + * Model for a Outline Row (excluding the tree column). Column 0 is "Value". + * Column 1 is "Type". Handles setting and getting values. TODO: Maybe use a + * TableCellRenderer instead of this to also have a different icon based on + * expanded state. See: + * http://kickjava.com/src/org/netbeans/swing/outline/DefaultOutlineCellRenderer.java.htm + */ + protected class VariableRowModel implements RowModel { + + protected String[] columnNames = {"Value", "Type"}; + protected int[] editableTypes = {VariableNode.TYPE_BOOLEAN, VariableNode.TYPE_FLOAT, VariableNode.TYPE_INTEGER, VariableNode.TYPE_STRING, VariableNode.TYPE_FLOAT, VariableNode.TYPE_DOUBLE, VariableNode.TYPE_LONG, VariableNode.TYPE_SHORT, VariableNode.TYPE_CHAR}; + + @Override + public int getColumnCount() { + if (p5mode) { + return 1; // only show value in p5 mode + } else { + return 2; + } + } + + @Override + public Object getValueFor(Object o, int i) { + if (o instanceof VariableNode) { + VariableNode var = (VariableNode) o; + switch (i) { + case 0: + return var; // will be converted to an appropriate String by ValueCellRenderer + case 1: + return var.getTypeName(); + default: + return ""; + } + } else { + return ""; + } + } + + @Override + public Class getColumnClass(int i) { + if (i == 0) { + return VariableNode.class; + } + return String.class; + } + + @Override + public boolean isCellEditable(Object o, int i) { + if (i == 0 && o instanceof VariableNode) { + VariableNode var = (VariableNode) o; + //System.out.println("type: " + var.getTypeName()); + for (int type : editableTypes) { + if (var.getType() == type) { + return true; + } + } + } + return false; + } + + @Override + public void setValueFor(Object o, int i, Object o1) { + VariableNode var = (VariableNode) o; + String stringValue = (String) o1; + + Value value = null; + try { + switch (var.getType()) { + case VariableNode.TYPE_INTEGER: + value = dbg.vm().mirrorOf(Integer.parseInt(stringValue)); + break; + case VariableNode.TYPE_BOOLEAN: + value = dbg.vm().mirrorOf(Boolean.parseBoolean(stringValue)); + break; + case VariableNode.TYPE_FLOAT: + value = dbg.vm().mirrorOf(Float.parseFloat(stringValue)); + break; + case VariableNode.TYPE_STRING: + value = dbg.vm().mirrorOf(stringValue); + break; + case VariableNode.TYPE_LONG: + value = dbg.vm().mirrorOf(Long.parseLong(stringValue)); + break; + case VariableNode.TYPE_BYTE: + value = dbg.vm().mirrorOf(Byte.parseByte(stringValue)); + break; + case VariableNode.TYPE_DOUBLE: + value = dbg.vm().mirrorOf(Double.parseDouble(stringValue)); + break; + case VariableNode.TYPE_SHORT: + value = dbg.vm().mirrorOf(Short.parseShort(stringValue)); + break; + case VariableNode.TYPE_CHAR: + // TODO: better char support + if (stringValue.length() > 0) { + value = dbg.vm().mirrorOf(stringValue.charAt(0)); + } + break; + } + } catch (NumberFormatException ex) { + Logger.getLogger(VariableRowModel.class.getName()).log(Level.INFO, "invalid value entered for {0}: {1}", new Object[]{var.getName(), stringValue}); + } + if (value != null) { + var.setValue(value); + Logger.getLogger(VariableRowModel.class.getName()).log(Level.INFO, "new value set: {0}", var.getStringValue()); + } + } + + @Override + public String getColumnName(int i) { + return columnNames[i]; + } + } + + /** + * Renderer for the tree portion of the outline component. Handles icons, + * text color and tool tips. + */ + protected class OutlineRenderer implements RenderDataProvider { + + protected Icon[][] icons; + protected static final int ICON_SIZE = 16; // icon size (square, size=width=height) + + public OutlineRenderer() { + // load icons + icons = loadIcons("theme/var-icons.gif"); + } + + /** + * Load multiple icons (horizotal) with multiple states (vertical) from + * a single file. + * + * @param fileName file path in the mode folder. + * @return a nested array (first index: icon, second index: state) or + * null if the file wasn't found. + */ + protected ImageIcon[][] loadIcons(String fileName) { + ExperimentalMode mode = editor.mode(); + File file = mode.getContentFile(fileName); + if (!file.exists()) { + Logger.getLogger(OutlineRenderer.class.getName()).log(Level.SEVERE, "icon file not found: {0}", file.getAbsolutePath()); + return null; + } + Image allIcons = mode.loadImage(fileName); + int cols = allIcons.getWidth(null) / ICON_SIZE; + int rows = allIcons.getHeight(null) / ICON_SIZE; + ImageIcon[][] iconImages = new ImageIcon[cols][rows]; + + for (int i = 0; i < cols; i++) { + for (int j = 0; j < rows; j++) { + //Image image = createImage(ICON_SIZE, ICON_SIZE); + Image image = new BufferedImage(ICON_SIZE, ICON_SIZE, BufferedImage.TYPE_INT_ARGB); + Graphics g = image.getGraphics(); + g.drawImage(allIcons, -i * ICON_SIZE, -j * ICON_SIZE, null); + iconImages[i][j] = new ImageIcon(image); + } + } + return iconImages; + } + + protected Icon getIcon(int type, int state) { + if (type < 0 || type > icons.length - 1) { + return null; + } + return icons[type][state]; + } + + protected VariableNode toVariableNode(Object o) { + if (o instanceof VariableNode) { + return (VariableNode) o; + } else { + return null; + } + } + + protected Icon toGray(Icon icon) { + if (icon instanceof ImageIcon) { + Image grayImage = GrayFilter.createDisabledImage(((ImageIcon) icon).getImage()); + return new ImageIcon(grayImage); + } + // Cannot convert + return icon; + } + + @Override + public String getDisplayName(Object o) { + return o.toString(); // VariableNode.toString() returns name; (for sorting) +// VariableNode var = toVariableNode(o); +// if (var != null) { +// return var.getName(); +// } else { +// return o.toString(); +// } + } + + @Override + public boolean isHtmlDisplayName(Object o) { + return false; + } + + @Override + public Color getBackground(Object o) { + return null; + } + + @Override + public Color getForeground(Object o) { + if (tree.isEnabled()) { + return null; // default + } else { + return Color.GRAY; + } + } + + @Override + public String getTooltipText(Object o) { + VariableNode var = toVariableNode(o); + if (var != null) { + return var.getDescription(); + } else { + return ""; + } + } + + @Override + public Icon getIcon(Object o) { + VariableNode var = toVariableNode(o); + if (var != null) { + if (tree.isEnabled()) { + return getIcon(var.getType(), 0); + } else { + return getIcon(var.getType(), 1); + } + } else { + if (o instanceof TreeNode) { +// TreeNode node = (TreeNode) o; +// AbstractLayoutCache layout = tree.getLayoutCache(); + UIDefaults defaults = UIManager.getDefaults(); + + boolean isLeaf = model.isLeaf(o); + Icon icon; + if (isLeaf) { + icon = defaults.getIcon("Tree.leafIcon"); + } else { + icon = defaults.getIcon("Tree.closedIcon"); + } + + if (!tree.isEnabled()) { + return toGray(icon); + } + return icon; + } + } + return null; // use standard icon + //UIManager.getIcon(o); + } + } + + // TODO: could probably extend the simpler javax.swing.table.DefaultTableCellRenderer here + /** + * Renderer for the value column. Uses an italic font for null values and + * Object values ("instance of ..."). Uses a gray color when tree is not + * enabled. + */ + protected class ValueCellRenderer extends DefaultOutlineCellRenderer { + + public ValueCellRenderer() { + super(); + } + + protected void setItalic(boolean on) { + if (on) { + setFont(new Font(getFont().getName(), Font.ITALIC, getFont().getSize())); + } else { + setFont(new Font(getFont().getName(), Font.PLAIN, getFont().getSize())); + } + } + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + + if (!tree.isEnabled()) { + setForeground(Color.GRAY); + } else { + setForeground(Color.BLACK); + } + + if (value instanceof VariableNode) { + VariableNode var = (VariableNode) value; + + if (var.getValue() == null || var.getType() == VariableNode.TYPE_OBJECT) { + setItalic(true); + } else { + setItalic(false); + } + value = var.getStringValue(); + } + + setValue(value); + return c; + } + } + + /** + * Editor for the value column. Will show an empty string when editing + * String values that are null. + */ + protected class ValueCellEditor extends DefaultCellEditor { + + public ValueCellEditor() { + super(new JTextField()); + } + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + if (!(value instanceof VariableNode)) { + return super.getTableCellEditorComponent(table, value, isSelected, row, column); + } + VariableNode var = (VariableNode) value; + if (var.getType() == VariableNode.TYPE_STRING && var.getValue() == null) { + return super.getTableCellEditorComponent(table, "", isSelected, row, column); + } else { + return super.getTableCellEditorComponent(table, var.getStringValue(), isSelected, row, column); + } + } + } + + /** + * Handler for expanding and collapsing tree nodes. Implements lazy loading + * of tree data (on expand). + */ + protected class ExpansionHandler implements ExtTreeWillExpandListener, TreeExpansionListener { + + @Override + public void treeWillExpand(TreeExpansionEvent tee) throws ExpandVetoException { + //System.out.println("will expand"); + Object last = tee.getPath().getLastPathComponent(); + if (!(last instanceof VariableNode)) { + return; + } + VariableNode var = (VariableNode) last; + // load children +// if (!dbg.isPaused()) { +// System.out.println("throwing veto"); +// //throw new ExpandVetoException(tee, "Debugger busy"); +// } else { + var.removeAllChildren(); // TODO: should we only load it once? + // TODO: don't filter in advanced mode + //System.out.println("loading children for: " + var); + // true means include inherited + var.addChildren(filterNodes(dbg.getFields(var.getValue(), 0, true), new ThisFilter())); +// } + } + + @Override + public void treeWillCollapse(TreeExpansionEvent tee) throws ExpandVetoException { + //throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void treeExpanded(TreeExpansionEvent tee) { + //System.out.println("expanded: " + tee.getPath()); + if (!expandedNodes.contains(tee.getPath())) { + expandedNodes.add(tee.getPath()); + } + +// TreePath newPath = tee.getPath(); +// if (expandedLast != null) { +// // test each node of the path for equality +// for (int i = 0; i < expandedLast.getPathCount(); i++) { +// if (i < newPath.getPathCount()) { +// Object last = expandedLast.getPathComponent(i); +// Object cur = newPath.getPathComponent(i); +// System.out.println(last + " =? " + cur + ": " + last.equals(cur) + "/" + (last.hashCode() == cur.hashCode())); +// } +// } +// } +// System.out.println("path equality: " + newPath.equals(expandedLast)); +// expandedLast = newPath; + } + + @Override + public void treeCollapsed(TreeExpansionEvent tee) { + //System.out.println("collapsed: " + tee.getPath()); + + // first remove all children of collapsed path + // this makes sure children do not appear before parents in the list. + // (children can't be expanded before their parents) + List removalList = new ArrayList(); + for (TreePath path : expandedNodes) { + if (path.getParentPath().equals(tee.getPath())) { + removalList.add(path); + } + } + for (TreePath path : removalList) { + expandedNodes.remove(path); + } + // remove collapsed path + expandedNodes.remove(tee.getPath()); + } + + @Override + public void treeExpansionVetoed(TreeExpansionEvent tee, ExpandVetoException eve) { + //System.out.println("expansion vetoed"); + // nop + } + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + scrollPane = new javax.swing.JScrollPane(); + tree = new org.netbeans.swing.outline.Outline(); + + scrollPane.setViewportView(tree); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 400, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(scrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 300, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(scrollPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)) + ); + + pack(); + }// //GEN-END:initComponents + +// /** +// * @param args the command line arguments +// */ +// public static void main(String args[]) { +// /* +// * Set the Nimbus look and feel +// */ +// // +// /* +// * If Nimbus (introduced in Java SE 6) is not available, stay with the +// * default look and feel. For details see +// * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html +// */ +// try { +// javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName()); +// } catch (ClassNotFoundException ex) { +// java.util.logging.Logger.getLogger(VariableInspector.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); +// } catch (InstantiationException ex) { +// java.util.logging.Logger.getLogger(VariableInspector.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); +// } catch (IllegalAccessException ex) { +// java.util.logging.Logger.getLogger(VariableInspector.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); +// } catch (javax.swing.UnsupportedLookAndFeelException ex) { +// java.util.logging.Logger.getLogger(VariableInspector.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); +// } +// // +// +// /* +// * Create and display the form +// */ +// run(new VariableInspector()); +// } + protected static void run(final VariableInspector vi) { + /* + * Create and display the form + */ + java.awt.EventQueue.invokeLater(new Runnable() { + @Override + public void run() { + vi.setVisible(true); + } + }); + } + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JScrollPane scrollPane; + protected org.netbeans.swing.outline.Outline tree; + // End of variables declaration//GEN-END:variables + + /** + * Access the root node of the tree. + * + * @return the root node + */ + public DefaultMutableTreeNode getRootNode() { + return rootNode; + } + + /** + * Unlock the inspector window. Rebuild after this to avoid ... dots in the + * trees labels + */ + public void unlock() { + tree.setEnabled(true); + } + + /** + * Lock the inspector window. Cancels open edits. + */ + public void lock() { + if (tree.getCellEditor() != null) { + //tree.getCellEditor().stopCellEditing(); // force quit open edit + tree.getCellEditor().cancelCellEditing(); // cancel an open edit + } + tree.setEnabled(false); + } + + /** + * Reset the inspector windows data. Rebuild after this to make changes + * visible. + */ + public void reset() { + rootNode.removeAllChildren(); + // clear local data for good measure (in case someone rebuilds) + callStack.clear(); + locals.clear(); + thisFields.clear(); + declaredThisFields.clear(); + expandedNodes.clear(); + // update + treeModel.nodeStructureChanged(rootNode); + } + +// public void setAdvancedMode() { +// p5mode = false; +// } +// +// public void setP5Mode() { +// p5mode = true; +// } +// +// public void toggleMode() { +// if (p5mode) { +// setAdvancedMode(); +// } else { +// setP5Mode(); +// } +// } + /** + * Update call stack data. + * + * @param nodes a list of nodes that represent the call stack. + * @param title the title to be used when labeling or otherwise grouping + * call stack data. + */ + public void updateCallStack(List nodes, String title) { + callStack = nodes; + } + + /** + * Update locals data. + * + * @param nodes a list of {@link VariableNode} to be shown as local + * variables in the inspector. + * @param title the title to be used when labeling or otherwise grouping + * locals data. + */ + public void updateLocals(List nodes, String title) { + locals = nodes; + } + + /** + * Update this-fields data. + * + * @param nodes a list of {@link VariableNode}s to be shown as this-fields + * in the inspector. + * @param title the title to be used when labeling or otherwise grouping + * this-fields data. + */ + public void updateThisFields(List nodes, String title) { + thisFields = nodes; + } + + /** + * Update declared (non-inherited) this-fields data. + * + * @param nodes a list of {@link VariableNode}s to be shown as declared + * this-fields in the inspector. + * @param title the title to be used when labeling or otherwise grouping + * declared this-fields data. + */ + public void updateDeclaredThisFields(List nodes, String title) { + declaredThisFields = nodes; + } + + /** + * Rebuild the outline tree from current data. Uses the data provided by + * {@link #updateCallStack}, {@link #updateLocals}, {@link #updateThisFields} + * and {@link #updateDeclaredThisFields} + */ + public void rebuild() { + rootNode.removeAllChildren(); + if (p5mode) { + // add all locals to root + addAllNodes(rootNode, locals); + + // add non-inherited this fields + addAllNodes(rootNode, filterNodes(declaredThisFields, new LocalHidesThisFilter(locals, LocalHidesThisFilter.MODE_PREFIX))); + + // add p5 builtins in a new folder + builtins.removeAllChildren(); + addAllNodes(builtins, filterNodes(thisFields, new P5BuiltinsFilter())); + if (builtins.getChildCount() > 0) { // skip builtins in certain situations e.g. in pure java tabs. + rootNode.add(builtins); + } + + // notify tree (using model) changed a node and its children + // http://stackoverflow.com/questions/2730851/how-to-update-jtree-elements + // needs to be done before expanding paths! + treeModel.nodeStructureChanged(rootNode); + + // handle node expansions + for (TreePath path : expandedNodes) { + //System.out.println("re-expanding: " + path); + path = synthesizePath(path); + if (path != null) { + tree.expandPath(path); + } else { + //System.out.println("couldn't synthesize path"); + } + } + + // this expansion causes problems when sorted and stepping + //tree.expandPath(new TreePath(new Object[]{rootNode, builtins})); + + } else { + // TODO: implement advanced mode here + } + } + + /** + * Re-build a {@link TreePath} from a previous path using equals-checks + * starting at the root node. This is used to use paths from previous trees + * for use on the current tree. + * + * @param path the path to synthesize. + * @return the rebuilt path, usable on the current tree. + */ + protected TreePath synthesizePath(TreePath path) { + //System.out.println("synthesizing: " + path); + if (path.getPathCount() == 0 || !rootNode.equals(path.getPathComponent(0))) { + return null; + } + Object[] newPath = new Object[path.getPathCount()]; + newPath[0] = rootNode; + TreeNode currentNode = rootNode; + for (int i = 0; i < path.getPathCount() - 1; i++) { + // get next node + for (int j = 0; j < currentNode.getChildCount(); j++) { + TreeNode nextNode = currentNode.getChildAt(j); + if (nextNode.equals(path.getPathComponent(i + 1))) { + currentNode = nextNode; + newPath[i + 1] = nextNode; + //System.out.println("found node " + (i+1) + ": " + nextNode); + break; + } + } + if (newPath[i + 1] == null) { + //System.out.println("didn't find node"); + return null; + } + } + return new TreePath(newPath); + } + + /** + * Filter a list of nodes using a {@link VariableNodeFilter}. + * + * @param nodes the list of nodes to filter. + * @param filter the filter to be used. + * @return the filtered list. + */ + protected List filterNodes(List nodes, VariableNodeFilter filter) { + List filtered = new ArrayList(); + for (VariableNode node : nodes) { + if (filter.accept(node)) { + filtered.add(node); + } + } + return filtered; + } + + /** + * Add all nodes in a list to a root node. + * + * @param root the root node to add to. + * @param nodes the list of nodes to add. + */ + protected void addAllNodes(DefaultMutableTreeNode root, List nodes) { + for (MutableTreeNode node : nodes) { + root.add(node); + } + } + + /** + * A filter for {@link VariableNode}s. + */ + public interface VariableNodeFilter { + + /** + * Check whether the filter accepts a {@link VariableNode}. + * + * @param var the input node + * @return true when the filter accepts the input node otherwise false. + */ + public boolean accept(VariableNode var); + } + + /** + * A {@link VariableNodeFilter} that accepts Processing built-in variable + * names. + */ + public class P5BuiltinsFilter implements VariableNodeFilter { + + protected String[] p5Builtins = { + "focused", + "frameCount", + "frameRate", + "height", + "online", + "screen", + "width", + "mouseX", + "mouseY", + "pmouseX", + "pmouseY", + "key", + "keyCode", + "keyPressed" + }; + + @Override + public boolean accept(VariableNode var) { + return Arrays.asList(p5Builtins).contains(var.getName()); + } + } + + /** + * A {@link VariableNodeFilter} that rejects implicit this references. + * (Names starting with "this$") + */ + public class ThisFilter implements VariableNodeFilter { + + @Override + public boolean accept(VariableNode var) { + return !var.getName().startsWith("this$"); + } + } + + /** + * A {@link VariableNodeFilter} that either rejects this-fields if hidden by + * a local, or prefixes its name with "this." + */ + public class LocalHidesThisFilter implements VariableNodeFilter { + + /** + * Reject a this-field if hidden by a local. + */ + public static final int MODE_HIDE = 0; // don't show hidden this fields + /** + * Prefix a this-fields name with "this." if hidden by a local. + */ + public static final int MODE_PREFIX = 1; // prefix hidden this fields with "this." + protected List locals; + protected int mode; + + /** + * Construct a {@link LocalHidesThisFilter}. + * + * @param locals a list of locals to check against + * @param mode either {@link #MODE_HIDE} or {@link #MODE_PREFIX} + */ + public LocalHidesThisFilter(List locals, int mode) { + this.locals = locals; + this.mode = mode; + } + + @Override + public boolean accept(VariableNode var) { + // check if the same name appears in the list of locals i.e. the local hides the field + for (VariableNode local : locals) { + if (var.getName().equals(local.getName())) { + switch (mode) { + case MODE_PREFIX: + var.setName("this." + var.getName()); + return true; + case MODE_HIDE: + return false; + } + } + } + return true; + } + } +} diff --git a/pdex/src/processing/mode/experimental/VariableNode.java b/pdex/src/processing/mode/experimental/VariableNode.java new file mode 100755 index 000000000..66b0575d7 --- /dev/null +++ b/pdex/src/processing/mode/experimental/VariableNode.java @@ -0,0 +1,358 @@ +/* + * Copyright (C) 2012 Martin Leopold + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package processing.mode.experimental; + +import com.sun.jdi.ArrayReference; +import com.sun.jdi.ObjectReference; +import com.sun.jdi.StringReference; +import com.sun.jdi.Value; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import java.util.List; +import javax.swing.tree.MutableTreeNode; +import javax.swing.tree.TreeNode; + +/** + * Model for a variable in the variable inspector. Has a type and name and + * optionally a value. Can have sub-variables (as is the case for objects, and + * arrays). + * + * @author Martin Leopold + */ +public class VariableNode implements MutableTreeNode { + + public static final int TYPE_UNKNOWN = -1; + public static final int TYPE_OBJECT = 0; + public static final int TYPE_ARRAY = 1; + public static final int TYPE_INTEGER = 2; + public static final int TYPE_FLOAT = 3; + public static final int TYPE_BOOLEAN = 4; + public static final int TYPE_CHAR = 5; + public static final int TYPE_STRING = 6; + public static final int TYPE_LONG = 7; + public static final int TYPE_DOUBLE = 8; + public static final int TYPE_BYTE = 9; + public static final int TYPE_SHORT = 10; + public static final int TYPE_VOID = 11; + protected String type; + protected String name; + protected Value value; + protected List children = new ArrayList(); + protected MutableTreeNode parent; + + /** + * Construct a {@link VariableNode}. + * @param name the name + * @param type the type + * @param value the value + */ + public VariableNode(String name, String type, Value value) { + this.name = name; + this.type = type; + this.value = value; + } + + public void setValue(Value value) { + this.value = value; + } + + public Value getValue() { + return value; + } + + /** + * Get a String representation of this variable nodes value. + * + * @return a String representing the value. + */ + public String getStringValue() { + String str; + if (value != null) { + if (getType() == TYPE_OBJECT) { + str = "instance of " + type; + } else if (getType() == TYPE_ARRAY) { + //instance of int[5] (id=998) --> instance of int[5] + str = value.toString().substring(0, value.toString().lastIndexOf(" ")); + } else if (getType() == TYPE_STRING) { + str = ((StringReference) value).value(); // use original string value (without quotes) + } else { + str = value.toString(); + } + } else { + str = "null"; + } + return str; + } + + public String getTypeName() { + return type; + } + + public int getType() { + if (type == null) { + return TYPE_UNKNOWN; + } + if (type.endsWith("[]")) { + return TYPE_ARRAY; + } + if (type.equals("int")) { + return TYPE_INTEGER; + } + if (type.equals("long")) { + return TYPE_LONG; + } + if (type.equals("byte")) { + return TYPE_BYTE; + } + if (type.equals("short")) { + return TYPE_SHORT; + } + if (type.equals("float")) { + return TYPE_FLOAT; + } + if (type.equals("double")) { + return TYPE_DOUBLE; + } + if (type.equals("char")) { + return TYPE_CHAR; + } + if (type.equals("java.lang.String")) { + return TYPE_STRING; + } + if (type.equals("boolean")) { + return TYPE_BOOLEAN; + } + if (type.equals("void")) { + return TYPE_VOID; //TODO: check if this is correct + } + return TYPE_OBJECT; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * Add a {@link VariableNode} as child. + * + * @param c the {@link VariableNode} to add. + */ + public void addChild(VariableNode c) { + children.add(c); + c.setParent(this); + } + + /** + * Add multiple {@link VariableNode}s as children. + * + * @param children the list of {@link VariableNode}s to add. + */ + public void addChildren(List children) { + for (VariableNode child : children) { + addChild(child); + } + } + + @Override + public TreeNode getChildAt(int i) { + return children.get(i); + } + + @Override + public int getChildCount() { + return children.size(); + } + + @Override + public TreeNode getParent() { + return parent; + } + + @Override + public int getIndex(TreeNode tn) { + return children.indexOf(tn); + } + + @Override + public boolean getAllowsChildren() { + if (value == null) { + return false; + } + + // handle strings + if (getType() == TYPE_STRING) { + return false; + } + + // handle arrays + if (getType() == TYPE_ARRAY) { + ArrayReference array = (ArrayReference) value; + return array.length() > 0; + } + // handle objects + if (getType() == TYPE_OBJECT) { // this also rules out null + // check if this object has any fields + ObjectReference obj = (ObjectReference) value; + return !obj.referenceType().visibleFields().isEmpty(); + } + + return false; + } + + /** + * This controls the default icon and disclosure triangle. + * + * @return true, will show "folder" icon and disclosure triangle. + */ + @Override + public boolean isLeaf() { + //return children.size() == 0; + return !getAllowsChildren(); + } + + @Override + public Enumeration children() { + return Collections.enumeration(children); + } + + /** + * Get a String representation of this {@link VariableNode}. + * + * @return the name of the variable (for sorting to work). + */ + @Override + public String toString() { + return getName(); // for sorting + } + + /** + * Get a String description of this {@link VariableNode}. Contains the type, + * name and value. + * + * @return the description + */ + public String getDescription() { + String str = ""; + if (type != null) { + str += type + " "; + } + str += name; + str += " = " + getStringValue(); + return str; + } + + @Override + public void insert(MutableTreeNode mtn, int i) { + children.add(i, this); + } + + @Override + public void remove(int i) { + MutableTreeNode mtn = children.remove(i); + if (mtn != null) { + mtn.setParent(null); + } + } + + @Override + public void remove(MutableTreeNode mtn) { + children.remove(mtn); + mtn.setParent(null); + } + + /** + * Remove all children from this {@link VariableNode}. + */ + public void removeAllChildren() { + for (MutableTreeNode mtn : children) { + mtn.setParent(null); + } + children.clear(); + } + + @Override + public void setUserObject(Object o) { + if (o instanceof Value) { + value = (Value) o; + } + } + + @Override + public void removeFromParent() { + parent.remove(this); + this.parent = null; + } + + @Override + public void setParent(MutableTreeNode mtn) { + parent = mtn; + } + + /** + * Test for equality. To be equal, two {@link VariableNode}s need to have + * equal type, name and value. + * + * @param obj the object to test for equality with this {@link VariableNode} + * @return true if the given object is equal to this {@link VariableNode} + */ + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final VariableNode other = (VariableNode) obj; + if ((this.type == null) ? (other.type != null) : !this.type.equals(other.type)) { + //System.out.println("type not equal"); + return false; + } + if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { + //System.out.println("name not equal"); + return false; + } + if (this.value != other.value && (this.value == null || !this.value.equals(other.value))) { + //System.out.println("value not equal"); + return false; + } +// if (this.parent != other.parent && (this.parent == null || !this.parent.equals(other.parent))) { +// System.out.println("parent not equal: " + this.parent + "/" + other.parent); +// return false; +// } + return true; + } + + /** + * Returns a hash code based on type, name and value. + */ + @Override + public int hashCode() { + int hash = 3; + hash = 97 * hash + (this.type != null ? this.type.hashCode() : 0); + hash = 97 * hash + (this.name != null ? this.name.hashCode() : 0); + hash = 97 * hash + (this.value != null ? this.value.hashCode() : 0); +// hash = 97 * hash + (this.parent != null ? this.parent.hashCode() : 0); + return hash; + } +} diff --git a/pdex/src/processing/mode/experimental/XQConsoleToggle.java b/pdex/src/processing/mode/experimental/XQConsoleToggle.java new file mode 100755 index 000000000..d34b9899c --- /dev/null +++ b/pdex/src/processing/mode/experimental/XQConsoleToggle.java @@ -0,0 +1,143 @@ +package processing.mode.experimental; + +/* + Part of the XQMode project - https://github.com/Manindra29/XQMode + + Under Google Summer of Code 2012 - + http://www.google-melange.com/gsoc/homepage/google/gsoc2012 + + Copyright (C) 2012 Manindra Moharana + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; + +import javax.swing.JPanel; + +/** + * Toggle Button displayed in the editor line status panel for toggling bewtween + * console and problems list. Glorified JPanel. + * + * @author Manindra Moharana <me@mkmoharana.com> + * + */ + +public class XQConsoleToggle extends JPanel implements MouseListener { + public static final String CONSOLE = "Console", ERRORSLIST = "Errors" ; + + private boolean toggleText = true; + private boolean toggleBG = true; + + /** + * Height of the component + */ + protected int height; + protected DebugEditor editor; + protected String buttonName; + + public XQConsoleToggle(DebugEditor editor, String buttonName, int height) { + this.editor = editor; + this.height = height; + this.buttonName = buttonName; + } + + public Dimension getPreferredSize() { + return new Dimension(70, height); + } + + public Dimension getMinimumSize() { + return getPreferredSize(); + } + + public Dimension getMaximumSize() { + return getPreferredSize(); + } + + public void paintComponent(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + + // On mouse hover, text and background color are changed. + if (toggleBG) { + g.setColor(new Color(0xff9DA7B0)); + g.fillRect(0, 0, this.getWidth(), this.getHeight()); + g.setColor(new Color(0xff29333D)); + g.fillRect(0, 0, 4, this.getHeight()); + g.setColor(Color.BLACK); + } else { + g.setColor(Color.DARK_GRAY); + g.fillRect(0, 0, this.getWidth(), this.getHeight()); + g.setColor(new Color(0xff29333D)); + g.fillRect(0, 0, 4, this.getHeight()); + g.setColor(Color.WHITE); + } + + g.drawString(buttonName, getWidth() / 2 + 2 // + 2 is a offset + - getFontMetrics(getFont()).stringWidth(buttonName) / 2, + this.getHeight() - 6); + if (drawMarker) { + g.setColor(markerColor); + g.fillRect(4, 0, 2, this.getHeight()); + } + } + + boolean drawMarker = false; + protected Color markerColor; + public void updateMarker(boolean value, Color color){ + drawMarker = value; + markerColor = color; + repaint(); + } + + @Override + public void mouseClicked(MouseEvent arg0) { + + this.repaint(); + try { + editor.showProblemListView(buttonName); + } catch (Exception e) { + System.out.println(e); + // e.printStackTrace(); + } + toggleText = !toggleText; + } + + @Override + public void mouseEntered(MouseEvent arg0) { + toggleBG = !toggleBG; + this.repaint(); + } + + @Override + public void mouseExited(MouseEvent arg0) { + toggleBG = !toggleBG; + this.repaint(); + } + + @Override + public void mousePressed(MouseEvent arg0) { + } + + @Override + public void mouseReleased(MouseEvent arg0) { + } +} \ No newline at end of file diff --git a/pdex/src/processing/mode/experimental/XQErrorTable.java b/pdex/src/processing/mode/experimental/XQErrorTable.java new file mode 100755 index 000000000..2e1c23aa7 --- /dev/null +++ b/pdex/src/processing/mode/experimental/XQErrorTable.java @@ -0,0 +1,165 @@ +package processing.mode.experimental; + +/* + Part of the XQMode project - https://github.com/Manindra29/XQMode + + Under Google Summer of Code 2012 - + http://www.google-melange.com/gsoc/homepage/google/gsoc2012 + + Copyright (C) 2012 Manindra Moharana + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.JTable; +import javax.swing.SwingWorker; +import javax.swing.table.JTableHeader; +import javax.swing.table.TableModel; + +/** + * Custom JTable implementation for XQMode. Minor tweaks and addtions. + * + * @author Manindra Moharana <me@mkmoharana.com> + * + */ +public class XQErrorTable extends JTable { + + /** + * Column Names of JTable + */ + public static final String[] columnNames = { "Problem", "Tab", "Line" }; + + /** + * Column Widths of JTable. + */ + public int[] columnWidths = { 600, 100, 50 }; // Default Values + + /** + * Is the column being resized? + */ + private boolean columnResizing = false; + + /** + * ErrorCheckerService instance + */ + protected ErrorCheckerService errorCheckerService; + + @Override + public boolean isCellEditable(int rowIndex, int colIndex) { + return false; // Disallow the editing of any cell + } + + public XQErrorTable(final ErrorCheckerService errorCheckerService) { + this.errorCheckerService = errorCheckerService; + for (int i = 0; i < this.getColumnModel().getColumnCount(); i++) { + this.getColumnModel().getColumn(i) + .setPreferredWidth(columnWidths[i]); + } + + this.getTableHeader().setReorderingAllowed(false); + + this.addMouseListener(new MouseAdapter() { + @Override + synchronized public void mouseReleased(MouseEvent e) { + try { + errorCheckerService.scrollToErrorLine(((XQErrorTable) e + .getSource()).getSelectedRow()); + // System.out.print("Row clicked: " + // + ((XQErrorTable) e.getSource()).getSelectedRow()); + } catch (Exception e1) { + System.out.println("Exception XQErrorTable mouseReleased " + + e); + } + } + }); + + // Handles the resizing of columns. When mouse press is detected on + // table header, Stop updating the table, store new values of column + // widths,and resume updating. Updating is disabled as long as + // columnResizing is true + this.getTableHeader().addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(MouseEvent e) { + columnResizing = true; + } + + @Override + public void mouseReleased(MouseEvent e) { + columnResizing = false; + for (int i = 0; i < ((JTableHeader) e.getSource()) + .getColumnModel().getColumnCount(); i++) { + columnWidths[i] = ((JTableHeader) e.getSource()) + .getColumnModel().getColumn(i).getWidth(); + // System.out.println("nw " + columnWidths[i]); + } + } + }); + } + + + /** + * Updates table contents with new data + * @param tableModel - TableModel + * @return boolean - If table data was updated + */ + synchronized public boolean updateTable(final TableModel tableModel) { + + // If problems list is not visible, no need to update + if (!this.isVisible()) { + return false; + } + + SwingWorker worker = new SwingWorker() { + + protected Object doInBackground() throws Exception { + return null; + } + + protected void done() { + + try { + setModel(tableModel); + + // Set column widths to user defined widths + for (int i = 0; i < getColumnModel().getColumnCount(); i++) { + getColumnModel().getColumn(i).setPreferredWidth( + columnWidths[i]); + } + getTableHeader().setReorderingAllowed(false); + validate(); + repaint(); + } catch (Exception e) { + System.out.println("Exception at XQErrorTable.updateTable " + e); + // e.printStackTrace(); + } + } + }; + + try { + if (!columnResizing) { + worker.execute(); + } + } catch (Exception e) { + System.out.println("ErrorTable updateTable Worker's slacking." + + e.getMessage()); + // e.printStackTrace(); + } + return true; + } + +} diff --git a/pdex/src/processing/mode/experimental/XQPreprocessor.java b/pdex/src/processing/mode/experimental/XQPreprocessor.java new file mode 100755 index 000000000..b9a63b45a --- /dev/null +++ b/pdex/src/processing/mode/experimental/XQPreprocessor.java @@ -0,0 +1,246 @@ +/* + Part of the XQMode project - https://github.com/Manindra29/XQMode + + Under Google Summer of Code 2012 - + http://www.google-melange.com/gsoc/homepage/google/gsoc2012 + + Copyright (C) 2012 Manindra Moharana + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package processing.mode.experimental; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.eclipse.jdt.core.JavaCore; +import org.eclipse.jdt.core.dom.AST; +import org.eclipse.jdt.core.dom.ASTParser; +import org.eclipse.jdt.core.dom.ASTVisitor; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jdt.core.dom.MethodDeclaration; +import org.eclipse.jdt.core.dom.Modifier; +import org.eclipse.jdt.core.dom.NumberLiteral; +import org.eclipse.jdt.core.dom.SimpleType; +import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; +import org.eclipse.jface.text.BadLocationException; +import org.eclipse.jface.text.Document; +import org.eclipse.text.edits.MalformedTreeException; +import org.eclipse.text.edits.TextEdit; + +import processing.mode.java.preproc.PdePreprocessor; + +/** + * My implementation of P5 preprocessor. Uses Eclipse JDT features instead of + * ANTLR. Performance gains mostly and full control over debug output. But needs + * lots and lots of testing. There will always an option to switch back to PDE + * preproc. + * + * @author Manindra Moharana <me@mkmoharana.com> + * + */ +public class XQPreprocessor { + + private ASTRewrite rewrite = null; + private ArrayList imports; + private ArrayList extraImports; + + private String[] coreImports, defaultImports; + + public XQPreprocessor() { + PdePreprocessor p = new PdePreprocessor(null); + defaultImports = p.getDefaultImports(); + coreImports = p.getCoreImports(); + } + + /** + * The main method that performs preprocessing. Converts code into compilable java. + * @param source - String + * @param programImports - List of import statements + * @return String - Compile ready java code + */ + public String doYourThing(String source, + ArrayList programImports) { + this.extraImports = programImports; + //source = prepareImports() + source; + Document doc = new Document(source); + + ASTParser parser = ASTParser.newParser(AST.JLS4); + parser.setSource(doc.get().toCharArray()); + parser.setKind(ASTParser.K_COMPILATION_UNIT); + + @SuppressWarnings("unchecked") + Map options = JavaCore.getOptions(); + + // Ben has decided to move on to 1.6. Yay! + JavaCore.setComplianceOptions(JavaCore.VERSION_1_6, options); + options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_6); + parser.setCompilerOptions(options); + CompilationUnit cu = (CompilationUnit) parser.createAST(null); + cu.recordModifications(); + rewrite = ASTRewrite.create(cu.getAST()); + cu.accept(new XQASTVisitor()); + + TextEdit edits = cu.rewrite(doc, null); + try { + edits.apply(doc); + } catch (MalformedTreeException e) { + e.printStackTrace(); + } catch (BadLocationException e) { + e.printStackTrace(); + } + // System.out.println("------------XQPreProc-----------------"); + // System.out.println(doc.get()); + // System.out.println("------------XQPreProc End-----------------"); + + // Calculate main class offset + // removed unused 'lines' tabulation [fry 140726] +// int position = doc.get().indexOf("{") + 1; +// int lines = 0; +// for (int i = 0; i < position; i++) { +// if (doc.get().charAt(i) == '\n') { +// lines++; +// } +// } +// lines += 2; + // System.out.println("Lines: " + lines); + + return doc.get(); + } + + /** + * Returns all import statements as lines of code + * + * @return String - All import statements combined. Each import in a separate line. + */ + public String prepareImports() { + imports = new ArrayList(); + for (int i = 0; i < extraImports.size(); i++) { + imports.add(new String(extraImports.get(i).getImportName())); + } + imports.add(new String("// Default Imports")); + for (int i = 0; i < coreImports.length; i++) { + imports.add(new String("import " + coreImports[i] + ";")); + } + for (int i = 0; i < defaultImports.length; i++) { + imports.add(new String("import " + defaultImports[i] + ";")); + } + String totalImports = ""; + for (int i = 0; i < imports.size(); i++) { + totalImports += imports.get(i) + "\n"; + } + totalImports += "\n"; + return totalImports; + } + + public String prepareImports(ArrayList programImports) { + this.extraImports = programImports; + return prepareImports(); + } + + /** + * Visitor implementation that does all the substitution dirty work.
    + *
  • Any function not specified as being protected or private will be made + * 'public'. This means that void setup() becomes + * public void setup(). + * + *
  • Converts doubles into floats, i.e. 12.3 becomes 12.3f so that people + * don't have to add f after their numbers all the time since it's confusing + * for beginners. Also, most functions of p5 core deal with floats only. + * + * @author Manindra Moharana + * + */ + private class XQASTVisitor extends ASTVisitor { + @SuppressWarnings({ "unchecked", "rawtypes" }) + public boolean visit(MethodDeclaration node) { + if (node.getReturnType2() != null) { + // if return type is color, make it int + // if (node.getReturnType2().toString().equals("color")) { + // System.err.println("color type detected!"); + // node.setReturnType2(rewrite.getAST().newPrimitiveType( + // PrimitiveType.INT)); + // } + + // The return type is not void, no need to make it public + // if (!node.getReturnType2().toString().equals("void")) + // return true; + } + + // Simple method, make it public + if (node.modifiers().size() == 0 && !node.isConstructor()) { + // rewrite.set(node, node.getModifiersProperty(), + // Modifier.PUBLIC, + // null); + // rewrite.getListRewrite(node, + // node.getModifiersProperty()).insertLast(Modifier., null) + List newMod = rewrite.getAST().newModifiers(Modifier.PUBLIC); + node.modifiers().add(newMod.get(0)); + } + + return true; + } + + public boolean visit(NumberLiteral node) { + if (!node.getToken().endsWith("f") + && !node.getToken().endsWith("d")) { + for (int i = 0; i < node.getToken().length(); i++) { + if (node.getToken().charAt(i) == '.') { + + String s = node.getToken() + "f"; + node.setToken(s); + break; + } + } + } + return true; + } + + // public boolean visit(FieldDeclaration node) { + // if (node.getType().toString().equals("color")){ + // System.err.println("color type detected!"); + // node.setType(rewrite.getAST().newPrimitiveType( + // PrimitiveType.INT)); + // } + // return true; + // } + // + // public boolean visit(VariableDeclarationStatement node) { + // if (node.getType().toString().equals("color")){ + // System.err.println("color type detected!"); + // node.setType(rewrite.getAST().newPrimitiveType( + // PrimitiveType.INT)); + // } + // return true; + // } + + /** + * This is added just for debugging purposes - to make sure that all + * instances of color type have been substituded as in by the regex + * search in ErrorCheckerService.preprocessCode(). + */ + public boolean visit(SimpleType node) { + if (node.toString().equals("color")) { + System.err + .println("color type detected! \nThis shouldn't be happening! Please report this as an issue."); + } + return true; + + } + + } + +} diff --git a/pdex/theme/theme.txt b/pdex/theme/theme.txt new file mode 100755 index 000000000..1a6179f5c --- /dev/null +++ b/pdex/theme/theme.txt @@ -0,0 +1,34 @@ +# DEBUGGER + +# breakpointed line background color +breakpoint.bgcolor = #f0f0f0 +# marker for breakpointed lines in left hand gutter (2 ascii characters) +breakpoint.marker = <> +breakpoint.marker.color = #4a545e + +# current line background color +currentline.bgcolor = #ffff96 +# marker for the current line in left hand gutter (2 ascii characters) +currentline.marker = -> +currentline.marker.color = #e27500 + +# left hand gutter background color +gutter.bgcolor = #fcfcfc +# color of vertical separation line +gutter.linecolor = #e9e9e9 +# space (in px) added to left and right of gutter markers +gutter.padding = 3 + + +# XQMODE + +# underline colors +editor.errorcolor = #ed2630 +editor.warningcolor = #ffc30e +editor.errormarkercolor = #ed2630 +editor.warningmarkercolor = #ffc30e + +# ERROR BAR - error bar on the right that shows the markers +errorbar.errorcolor = #ed2630 +errorbar.warningcolor = #ffc30e +errorbar.backgroundcolor = #2c343d diff --git a/pdex/theme/var-icons.gif b/pdex/theme/var-icons.gif new file mode 100755 index 000000000..1d0086a38 Binary files /dev/null and b/pdex/theme/var-icons.gif differ diff --git a/pdex/todo.txt b/pdex/todo.txt new file mode 100644 index 000000000..8b2659193 --- /dev/null +++ b/pdex/todo.txt @@ -0,0 +1,66 @@ +TODO List for PDE X +=================== + +This would also be a break down of my thought process and ideas as I tackle +various tasks. Previously, a different todo file was used for GSoC 2013. + +Manindra Moharana (me@mkmoharana.com) + +[ ]: Todo, [x] : Done, ? : Undecided Todo, ! : Critical, + : Minor Todo + + +Critical Bugs +------------- + +-[x] Better memory management. #1 + +-[ ] Breakpoints in classes. #47 + + +Misc Tasks +---------- + +-[ ] New sketchbook layout + +-[ ] Better compatibility with java tabs + +-[x] Trim CompilationChecker class + +-[x] Refactoring should support single undo + +Import Suggestion +----------------- + +-[ ] Ignore case while looking for classname + +-[ ] Prevent running into a suggestion loop + +Normal Bugs +----------- +-[x] Sketch NOC 6_09: steer PVector, doesn't show completion. #68 + +-[x] Sketch NOC 6_09: Classname in Template, doesn't scroll to decl. This is +happening due certain post processing offsets not being accounted for - "public void" + +-[x] New offset matching now used by Show Usage + +-[x] New offset matching now used by Refactoring + +Enhancements/New Features +------------------------- + +-[x] Precise error highlighting(PEH). Now working for one error per line. Hell yeah! + +-[ ] Gotta fix PEH for multiple errors per line. Will be slightly meticulous. + +-[x] Better comment/uncomment - ignores leading whitespaces, and more uniform // placement. + +-[ ] When viewing Outline View, instead of showing the beginning of the list, +it should select the current node element within which the cursor is presently +positioned. + +-[ ] Begin work on code snippets. + +-[ ] Preferences panel + +-[ ] Line Numbers diff --git a/todo.txt b/todo.txt index 340c441f5..a2eb233a6 100644 --- a/todo.txt +++ b/todo.txt @@ -1,14 +1,138 @@ -0228 pde +0229 pde (3.0a2) +X new tab/rename dialog box +X https://github.com/processing/processing/issues/2431 +X fix issue where the browser wasn't opening the reference properly +X https://github.com/processing/processing/pull/2657 +X fix "No such file or directory" error when exporting an application on OSX +X this also resulted in the application not being signed at all +X https://github.com/processing/processing/issues/2614 +X this is a fairly major issue... +X possible to open a sketch multiple times +X by double-clicking one of its files instead of the main pde file +X user opens non-main pde of already open sketch, it'll open again +X https://github.com/processing/processing/issues/2506 +X remove the prefs for 32/64-bit from Preferences +X also remove the extra OS X cruft inside Runner.java +X OS X export button not disabled on other platforms +X https://github.com/processing/processing/issues/2642 +o try new syntax package +X exclude 'fonts' folder from build (since it's going into the JRE) +X was storing our fonts in both ./lib/fonts and jre/lib/fonts +X now gets the jre folder and loads from there +X make ant fail when trying to delete JRE files that don't exist +X some aren't being removed properly +X fix the build scripts to include the examples +X https://github.com/processing/processing/issues/2652 +X all examples are out of "processing/java" and are now in "processing-docs/content/". The Book examples have been removed entirely from our repositories. +o "Platform is ${platform}" message during 'ant clean' +o on OS X, but not Windows (haven't checked Linux) +X this was in pdex/build.xml +X remove welcome message from the sound library +X URL opening problem fixed by use of getCanonicalPath() on Windows +X https://github.com/processing/processing/issues/2656 +X add a new pref for the 3.0 sketchbook location +X if Server constructor fails, throw an exception +X https://github.com/processing/processing/issues/2604 +o check on why 2x core.jar inside the Java folder +o maybe OS X Java can't look in subfolders? (just auto-adds things) +o https://github.com/processing/processing/issues/2344 +X one is used by the PDE, the other is used as a library +X get 'modified' indicator working on document windows again +X https://github.com/processing/processing/issues/2194 +X remove default menu bar hack when 7u60 arrives +X http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8022667 +X when renaming a tab, include the previous name to be edited +X changing the mode on an untitled, unmodified sketch removes untitled status + +gsoc +X clear status messages in the Contribution Manager +X https://github.com/processing/processing/pull/2667 +X https://github.com/processing/processing/issues/2599 +X may need a progress bar for "save as" +X or just the file copy function in general +X since it may take a long time (i.e. 1000s of screen grabs) +X http://code.google.com/p/processing/issues/detail?id=31 +X https://github.com/processing/processing/issues/70 +X https://github.com/processing/processing/pull/2370 +X NullPointerException in addBreakpointComments() when saving sketch +X https://github.com/processing/processing/issues/2675 +X run button seems to stay highlighted permanently +X https://github.com/processing/processing/issues/2676 + +pulls +X insert tabs properly when prefs set for tabs mode +X https://github.com/processing/processing/pull/2607 +X improve look of Nimbus LAF +X https://github.com/processing/processing/pull/2671 + +earlier +X maxHeapSize typo in the build scripts +X https://github.com/processing/processing/issues/2603 +X remove minim +X add the new sound library to the build process +X for() loop with nothing inside parens crashes Auto Format +X https://github.com/processing/processing/issues/2141 +o double-clicking a .pde file doesn't open properly on OS X +o https://github.com/processing/processing/issues/2639 +X moving p5 examples to the web repo +X move examples into web repo +o OS X not opening a sketch at all on pde double-click? (though opening the app) +X Chinese text is overlapped in Processing 2.1 editor +X https://github.com/processing/processing/issues/2173 +o type cut off in dialog boxes on OS X retina machines +o https://github.com/processing/processing/issues/2116 +o add spaces to the end of the text? +X seems to have fixed itself in newer Java releases +X implement Windows menu in the PDE +X https://github.com/processing/processing/issues/584 + + +pending +_ huge i18n patch +_ https://github.com/processing/processing/pull/2084 +_ look at the sound library https://github.com/wirsing/ProcessingSound +_ sound is not yet supported on Windows +_ glw? lwjgl? retina jogl? +_ make reference build process part of dist +_ https://github.com/processing/processing-docs/issues/85 +_ separate ant target, but only require them for dist +_ as separate targets, folks can build explicitly if they'd like +_ processing-docs/java_generate/ReferenceGenerator/processingrefBuild.sh +_ remove reference.zip from main repo + + +gsoc/help me +_ `return` keyword not treated as such when followed by a bracket +_ https://github.com/processing/processing/issues/2099 +_ IllegalArgumentException when clicking between editor windows +_ https://github.com/processing/processing/issues/2530 +_ "String index out of range" error +_ https://github.com/processing/processing/issues/1940 +_ shouldn't write sketch.properties unless it's a non-default mode +_ https://github.com/processing/processing/issues/2531 +_ closing the color selector makes things freeze (only Linux and Windows?) +_ https://github.com/processing/processing/issues/2381 +_ move sketchbook into its own window +_ move recent into the sketchbook menu +_ needs to recognize the p5 app folder +_ also should recognize the user's home dir +_ incorporate new preproc +_ https://github.com/fjenett/processing-preprocessor-antlr4 +_ SOCKS proxy not working: +_ https://github.com/processing/processing/issues/2643 +_ the current code that gets/sets the pref is in Preferences +_ instead of current implementation, can we auto-detect proxy settings? +_ old issue: https://github.com/processing/processing/issues/1476 +_ http://docs.oracle.com/javase/7/docs/technotes/guides/net/proxies.html +_ http://docs.oracle.com/javase/1.5.0/docs/guide/net/proxies.html +_ http://stackoverflow.com/questions/4933677/detecting-windows-ie-proxy-setting-using-java +_ http://www.java2s.com/Code/Java/Network-Protocol/DetectProxySettingsforInternetConnection.htm +_ problems with non-US keyboards and some shortcuts +_ https://github.com/processing/processing/issues/2199 medium -_ possible to open a sketch multiple times -_ by double-clicking one of its files instead of the main pde file -_ https://github.com/processing/processing/issues/2506 -_ closing the color selector makes things freeze (only Linux and Windows?) -_ https://github.com/processing/processing/issues/2381 -_ check on why 2x core.jar inside the Java folder -_ maybe OS X Java can't look in subfolders? (just auto-adds things) +_ possibility of libraries folder inside a particular sketch? _ display "1" is not correct in 2.1.2 _ https://github.com/processing/processing/issues/2502 _ re/move things from Google Code downloads @@ -42,8 +166,6 @@ _ the Find window (also the save windows) also have the same problem _ move old Google Code SVN back to processing.org _ then cull out the old branches/tags from the Github repo _ and/or start bundling separate source downloads -_ "String index out of range" error -_ https://github.com/processing/processing/issues/1940 _ look through all isPopupTrigger() code _ make sure both press/release are implemented _ emacs style errors in commander aren't quite right @@ -57,21 +179,6 @@ _ PDE and sketches are 2x smaller on high-res Windows 8 machines _ https://github.com/processing/processing/issues/2411 -pulls -_ may need a progress bar for "save as" -_ or just the file copy function in general -_ since it may take a long time (i.e. 1000s of screen grabs) -_ http://code.google.com/p/processing/issues/detail?id=31 -_ https://github.com/processing/processing/issues/70 -_ https://github.com/processing/processing/pull/2370 - - -post 2.1 cleaning -_ remove the prefs for 32/64-bit from Preferences -_ remove the extra OS X cruft inside Runner.java -_ exclude 'fonts' folder from build (since it's going into the JRE) - - . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @@ -249,9 +356,6 @@ PDE - Processing Development Environment PDE / Dialogs -_ type cut off in dialog boxes on OS X retina machines -_ https://github.com/processing/processing/issues/2116 -_ add spaces to the end of the text? _ dialog box icon is fuzzy on OS X retina machines _ https://github.com/processing/processing/issues/2117 _ solution might be our own dialog boxes @@ -543,6 +647,7 @@ _ https://github.com/processing/processing/issues/943 PDE / Manager +_ something to set min/max versions that are supported by a library _ ability to cancel a download/install _ we shouldn't use .properties extension for modes, et al _ because a .properties file is iso8859-1 @@ -692,8 +797,6 @@ _ update will update classes from shared in the current folder TOOLS / Auto Format -_ for() loop with nothing inside parens crashes Auto Format -_ https://github.com/processing/processing/issues/2141 _ extra indent found _ https://github.com/processing/processing/issues/1041 _ Switch block cases not indented @@ -790,14 +893,13 @@ _ http://code.google.com/p/processing/issues/detail?id=632 DIST / Mac OS X +_ more OS X-specific hackery for improved appearance +_ https://developer.apple.com/library/mac/technotes/tn2007/tn2196.html _ possible better option for doing retina? _ g.getFontRenderContext().getTransform().equals(AffineTransform.getScaleInstance(2.0, 2.0)) _ appbundler improvements _ don't re-copy JRE into work folder if already exists _ implement a splash screen -_ remove default menu bar hack when 7u60 arrives -_ http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8022667 -_ OS X not opening a sketch at all on pde double-click? (though opening the app) _ LWJGL forum discussion _ http://lwjgl.org/forum/index.php/topic,4711.225.html _ change cmd line for OS X to use symlink? @@ -861,6 +963,8 @@ find YOUR_APP/Contents/ -type f \ DIST / Linux +_ Processing is named processing-app-Base in Gnome 3 +_ https://github.com/processing/processing/issues/2534 _ how to run "headless" from user Batuff _ sudo apt-get install xvfb _ Xvfb :2 -screen 0 1024x768x24 &